@gmb/bitmark-parser 7.4.0 → 7.6.0
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/config/bitmark.json +522 -170
- package/dist/browser/bitmark-parser.min.js +1 -1
- package/dist/browser/bitmark-parser.min.js.map +1 -1
- package/dist/browser/cjs/index.cjs +1 -1
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +26 -2
- package/dist/browser/esm/index.d.ts +26 -2
- package/dist/browser/esm/index.js +1 -1
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/wasm/bitmark_browser_full_wasm_bg.wasm +0 -0
- package/dist/browser/wasm/bitmark_json_wasm_bg.wasm +0 -0
- package/dist/browser/wasm/bitmark_wasm_bg.wasm +0 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -2
- package/dist/index.d.ts +26 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.cjs +1 -1
- package/dist/legacy.cjs.map +1 -1
- package/dist/legacy.js +1 -1
- package/dist/legacy.js.map +1 -1
- package/package.json +6 -6
- package/schema/bitmark.schema.json +133 -1
- package/translations/translations.json +189 -161
- package/wasm/bitmark_wasm_bg.wasm +0 -0
- package/wasm/package.json +1 -1
- package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm +0 -0
- package/wasm-bitmark-json/package.json +1 -1
- package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm +0 -0
- package/wasm-browser-full/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../wasm-web/bitmark_wasm.js","../../wasm-web-browser-full/bitmark_browser_full_wasm.js","../../wasm-web-bitmark-json/bitmark_json_wasm.js","../../src/generated/package_info.ts","../../src/core/facade.ts","../../src/core/hooked-transform.ts","../../src/core/parallel.ts","../../src/legacy/runtime.ts","../../src/core/pool.ts","../../src/browser/pool.ts","../../src/legacy/index.ts","../../src/legacy/errors.ts","../../src/legacy/translate.ts","../../src/legacy/pseudo-ast.ts","../../src/legacy/generated/resource-collection-keys.ts","../../src/legacy/builder.ts","../../src/legacy/bpg-class.ts","../../src/legacy/resource-builder.ts","../../src/legacy/options.ts","../../src/legacy/enums-extra.ts","../../src/legacy/stubs.ts","../../src/editor-types.ts","../../src/types.ts","../../src/core/api.ts","../../src/browser/index.ts"],"names":["bitmark_wasm_exports","__export","breakscape_text","canonicalize","complete","convert","convert_text","count_bits","bitmark_wasm_default","diff","hover","info","info_text_supported","initSync","is_bitmark","prettify","register","resolve","resolve_patch_document","split_bits","split_json_bits","transform","unbreakscape_text","wasm","cachedTextDecoder","cachedUint8ArrayMemory0","getUint8ArrayMemory0","getStringFromWasm0","ptr","len","heap","heap_next","addHeapObject","obj","idx","WASM_VECTOR_LEN","cachedTextEncoder","encodeString","arg","view","buf","passStringToWasm0","malloc","realloc","mem","offset","code","ret","isLikeNone","x","cachedDataViewMemory0","getDataViewMemory0","input","format","location","sub_location","deferred5_0","deferred5_1","retptr","ptr0","len0","ptr1","len1","ptr2","len2","ptr3","len3","r0","r1","info_type","bit","pretty","indent","include_deprecated","only_deprecated","full","language","getObject","dropObject","takeObject","direction","deferred6_0","deferred6_1","r2","r3","ptr5","len5","input_format_sel","output_format_sel","mode","patch_json","spaces_around_values","deferred7_0","deferred7_1","ptr4","len4","ptr6","len6","a","b","context","locate","similarity","bbox_tolerance","line","character","position_encoding","trigger_character","label","kind","deferred4_0","deferred4_1","data_type","data","include_unknown_properties","mapping_report","tokens_layout","deferred8_0","deferred8_1","ptr7","len7","deferred3_0","deferred3_1","deferred2_0","deferred2_1","json","__wbg_load","module","imports","e","bytes","instance","__wbg_get_imports","arg0","arg1","__wbg_finalize_init","__wbg_init","module_or_path","bitmark_browser_full_wasm_exports","bitmark_browser_full_wasm_default","bitmark_json_wasm_exports","bitmark_json_wasm_default","PACKAGE_INFO","BROWSER_DEFAULT_FEATURE","NotInitializedError","RegisterError","message","PatchError","diagnostics","lines","d","__publicField","UnsupportedFeatureError","what","active","activeFeature","lazyLoader","registrations","getActive","setActive","feature","type","rememberRegistration","variant","stripArray","doc","t","patchJsonOf","patch","buildUnits","inputIsBitmark","slices","s","envelopes","env","index","planTransform","options","output","spacesAroundValues","sel","inputFormat","units","total","hooked","result","patchJson","resolved","_","jobs","views","item","hook","bitOutput","envelopeJson","outputFormat","computeBit","job","recombine","elements","arr","runHookedTransform","plan","rendered","skipped","i","element","orchestrateParallel","runJobs","outputs","wasmProvider","setLegacyWasmProvider","provider","getLegacyWasm","runJobsWithPool","workers","spawn","poolSize","reject","results","next","settled","done","pool","finish","err","w","dispatch","id","res","runJobsParallel","workerUrl","onResult","onError","ev","msg","legacy_exports","Ast","BitType","BitmarkFileGenerator","BitmarkGenerator","BitmarkParser","BitmarkParserGenerator","BitmarkParserType","BitmarkStringGenerator","BitmarkVersion","BodyTextFormat","BoundingBoxIndex","Builder","CardSetVersion","FileWriter","HtmlTableGenerator","HtmlTableParser","InfoFormat","InfoType","Input","InputFormat","JsonFileGenerator","JsonGenerator","JsonParser","JsonStringGenerator","LegacyUnsupportedError","NodeType","Output","ResourceBuilder","StreamWriter","StringWriter","TextLocation","TextMarkType","TextNodeType","bitmarkTextParse","isPseudoAst","unsupportedMember","member","reason","unsupportedOption","option","V3_ONLY","validateVersionOptions","opts","validateBitmarkOptions","o","validateJsonOptions","prettyIndent","spacesAround","v","mapTextFormat","f","PSEUDO_AST_MARKER","makePseudoAst","bits","ast","RESOURCE_COLLECTION_KEYS","BUILT_BIT_PARSER","DATA_KEY_TO_JSON_KEY","DEPRECATED_TEXT_FORMATS","CONFIG_BODY_FORMAT_TO_TEXT_FORMAT","TAG_TEXT_KEYS","_options","src","bitType","bitConfig","textFormat","body","resources","list","collection","r","parser","extraProperties","key","value","out","built","_context","attrs","stripUndefined","toAst","bitmarkBody","exclude","k","jsonOptions","bitmarkOptions","source","isBitmark","coreFormat","emit","spaces","includeUnknown","inStr","extractHtmlTables","wrapped","isBitmarkText","textLocation","outStr","textAst","n","entries","parsed","entry","wrapper","outputFile","fileOptions","html","tables","lower","start","depth","j","end","open","close","closeEnd","text","RESOURCE_SPECS","buildResource","spec","_typeAlias","rest","inner","SPEC_BY_TYPE","resource","single","nodes","asString","url","bitNameToKey","name","c","bitTypeCache","loadBitTypes","all","map","_t","prop","unsupportedEnum","stubClass","WALKER_REASON","INTERNAL_REASON","DiagnosticSeverity","CompletionItemKind","CompletionItemTag","patchEntry","path","op","ALL_LANGUAGES","bitmarkToObjects","objectsToBitmark","semanticTokens","position","countBits","splitBits","diffBits","breakscapeText","subLocation","unbreakscapeText","infoType","includeDeprecated","onlyDeprecated","WASM_BASE","VARIANTS","defaultFeatureFor","isInitOptions","proto","normalizeInit","initSeq","activeOut","inflight","init","mySeq","promise","version","transformParallel"],"mappings":"AAAA,IAAA,EAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,IAAA,CAAA,YAAA,CAAA,IAAA,CAAA,QAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,IAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,EAAA,CAAA,CAAA,CAAA,OAAA,CAAA,EAAA,QAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,C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AAA,CAAImH,GAAShP,CAAO,CAAA,CACpBwJ,EAAM3B,CAAAA,CAAE,QAAA,CAAS,CAAE,MAAA,CAAA9J,CAAO,CAAC,CAAA,CACjC,OAAA,EAAEsR,GACFE,EAAAA,CAAW,MAAA,CACXxP,GAAUC,CAAAA,CAAS6H,CAAAA,CAAE,EAAE,CAAA,CACvByH,EAAAA,CAAY9F,EACLA,CACT,CAmIO,SAASmG,EAAAA,EAAkB,CAChC,OAAO7Q,EAAAA,CAAa,OACtB,CAqBO,SAAS8Q,EAAAA,CACdxW,EACA6H,CAAAA,CAA4B,GACX,CACjB,IAAM1J,EAAOuI,CAAAA,EAAU,CACjBE,EAAmBG,EAAAA,EAAQ,EAAKpB,GACtC,OAAOgE,EAAAA,CAAoBxL,EAAM6B,CAAAA,CAAO6H,CAAAA,CAAS,CAACY,CAAAA,CAAM0B,CAAAA,GACtDe,GAAgBzC,CAAAA,CAAM0B,CAAAA,CAASvD,CAAO,CACxC,CACF","file":"bitmark-parser.min.js","sourcesContent":["let wasm;\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nconst heap = new Array(128).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nlet heap_next = heap.length;\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nconst cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * `sub_location`: `\"text\"` (default) or `\"attrValue\"` — the value half of an\n * inline-attr chain segment (`==t==|link:VALUE|`), which escapes `|` and\n * skips the running-text rules (PLAN-211)\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @param {string | null} [sub_location]\n * @returns {string}\n */\nexport function breakscape_text(input, format, location, sub_location) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n var len3 = WASM_VECTOR_LEN;\n wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * `sub_location`: accepted and IGNORED — unbreakscape is sub-location\n * independent for bitmarkText, so one inverse undoes every breakscape mode\n * (PLAN-211 D5a)\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @param {string | null} [sub_location]\n * @returns {string}\n */\nexport function unbreakscape_text(input, format, location, sub_location) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n var len3 = WASM_VECTOR_LEN;\n wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Query information about supported bit types.\n *\n * `info_type`: `\"list\"`, `\"bit\"`, `\"all\"`, `\"deprecated\"`, `\"bit-groups\"`,\n * or `\"resource-groups\"`\n * `format`: `\"text\"` or `\"json\"`\n * `bit`: bit name (required when `info_type` is `\"bit\"`)\n * `pretty`: whether to pretty-print JSON output\n * `indent`: indent size for pretty-printing (default: 2)\n * `include_deprecated`: include deprecated bits in `list`/`all` (PLAN-149)\n * `only_deprecated`: restrict `list`/`all` to deprecated bits (wins over\n * `include_deprecated`)\n * `full`: complete outline for `bit`/`all` (default is the compact\n * one-line-per-tag view)\n * `language`: BCP-47 tag(s) for display names — \"\" = English, `\"de,fr\"` for\n * several (adds a `titles` map), `\"all\"` for every resolvable language\n * @param {string} info_type\n * @param {string} format\n * @param {string} bit\n * @param {boolean} pretty\n * @param {number} indent\n * @param {boolean} include_deprecated\n * @param {boolean} only_deprecated\n * @param {boolean} full\n * @param {string} language\n * @returns {string}\n */\nexport function info(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(language, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Whether this build can render `info` as TEXT (PLAN-192 D6). The export is\n * ABSENT when it cannot — the same \"presence is the capability\" signal\n * `diff` uses, so a caller tests for the function rather than for a\n * variant name.\n * @returns {boolean}\n */\nexport function info_text_supported() {\n const ret = wasm.info_text_supported();\n return ret !== 0;\n}\n\nfunction getObject(idx) { return heap[idx]; }\n\nfunction dropObject(idx) {\n if (idx < 132) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n/**\n * Convert a standalone bitmark text fragment ↔ TextAst (ProseMirror JSON).\n *\n * `direction`: `\"textToAst\"` | `\"astToText\"` | `\"astToPlainText\"`.\n * `format`: a bitmark text format (`\"bitmark++\"`, `\"bitmark+\"`) parses\n * inline marks; anything else is treated as plain text (textToAst only).\n * `location`: `\"body\"` (default) or `\"tag\"`.\n * Returns the converted fragment; throws on failure.\n * @param {string} input\n * @param {string} direction\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function convert_text(input, direction, format, location) {\n let deferred6_0;\n let deferred6_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(direction, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr5 = r0;\n var len5 = r1;\n if (r3) {\n ptr5 = 0; len5 = 0;\n throw takeObject(r2);\n }\n deferred6_0 = ptr5;\n deferred6_1 = len5;\n return getStringFromWasm0(ptr5, len5);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);\n }\n}\n\n/**\n * Apply a patch (a JSON array of patch entries) to every bit and re-emit.\n *\n * `input_format_sel`: `\"auto\"` | `\"bitmark\"` | `\"json\"`.\n * `output_format_sel`: the same vocabulary as `convert` — `\"bitmark\"` |\n * `\"json\"` | `\"text\"` | a mapping id (`\"html\"`, …), `\"auto\"` (or empty) being\n * the opposite of the resolved input format. The whole-document outputs\n * (`lex`, `semantic-tokens`, `diagnostics`) are not per-bit formats; the\n * pipeline refuses them and that refusal is what throws.\n * `patch_json`: the patch entry array (empty string = no patches, i.e. a\n * canonicalizing pass). Parallelism is a JS-side concern (web workers); this\n * runs sequentially. Returns `{ \"data\": <document text/JSON>, \"diagnostics\":\n * [ { \"path\", \"kind\", \"message\" } ] }` — the diagnostics are the entries the\n * pipeline skipped (PLAN-209 T9; `kind` is the error contract's identifier,\n * e.g. `patch-index-out-of-range`); throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} output_format_sel\n * @param {string} mode\n * @param {string} patch_json\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @returns {string}\n */\nexport function transform(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {\n let deferred7_0;\n let deferred7_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n const ptr4 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len4 = WASM_VECTOR_LEN;\n wasm.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr6 = r0;\n var len6 = r1;\n if (r3) {\n ptr6 = 0; len6 = 0;\n throw takeObject(r2);\n }\n deferred7_0 = ptr6;\n deferred7_1 = len6;\n return getStringFromWasm0(ptr6, len6);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred7_0, deferred7_1, 1);\n }\n}\n\n/**\n * Resolve a patch document against `input` (bitmark or JSON) into the\n * ordered output items, so a JS per-bit planner (hooks, worker pool) can\n * reorder, drop and insert jobs from the one Rust implementation\n * (PLAN-179). `input_format_sel` is the caller's input-format selector\n * (`\"auto\"` | `\"bitmark\"` | `\"json\"`): the document is split under the SAME\n * selection the planner already resolved, never re-sniffed (PLAN-187 D1).\n * Returns a JSON array of\n * `{ \"source\": <original index> | null, \"bit\": <inner bit> | null,\n * \"patch\": [ … ] }`; throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} patch_json\n * @returns {string}\n */\nexport function resolve_patch_document(input, input_format_sel, patch_json) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.resolve_patch_document(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Semantic diff of two documents (PLAN-179). Flat arguments like every\n * other export:\n * - `input_format`: `\"auto\"` | `\"bitmark\"` | `\"json\"` | a mapping id,\n * applied to both sides;\n * - `output_format`: `\"bitmark\"` (unified-style text) | `\"json\"` |\n * `\"patch\"`;\n * - `context`, `locate`, `similarity`, `bbox_tolerance`,\n * `spaces_around_values` as documented on `DiffOptions`.\n * Returns the diff (empty text / `[]` of unchanged bits / a patch document\n * with no entries when the documents are semantically equal); throws on\n * failure.\n * @param {string} a\n * @param {string} b\n * @param {string} input_format_sel\n * @param {string} output_format_sel\n * @param {number} context\n * @param {boolean} locate\n * @param {number} similarity\n * @param {number} bbox_tolerance\n * @param {number} spaces_around_values\n * @returns {string}\n */\nexport function diff(a, b, input_format_sel, output_format_sel, context, locate, similarity, bbox_tolerance, spaces_around_values) {\n let deferred6_0;\n let deferred6_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(a, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(b, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n wasm.diff(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, context, locate, similarity, bbox_tolerance, spaces_around_values);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr5 = r0;\n var len5 = r1;\n if (r3) {\n ptr5 = 0; len5 = 0;\n throw takeObject(r2);\n }\n deferred6_0 = ptr5;\n deferred6_1 = len5;\n return getStringFromWasm0(ptr5, len5);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);\n }\n}\n\n/**\n * The constructs valid at a position, as an LSP `CompletionList` (PLAN-196\n * D7; contract `API-EDT-editor-services.tsp`). `line` / `character` are\n * 0-based, `character` in `position_encoding` units (`\"utf-16\"`, the\n * default, or `\"utf-8\"`); `include_deprecated` offers deprecated bits too;\n * `trigger_character` is the character the editor sent as the trigger (LSP\n * `CompletionContext.triggerCharacter`; empty when invoked explicitly) — a\n * trigger that opens nothing where the cursor is answers the empty list\n * (PLAN-203 D1). ABSENT on a variant built without `editor` — the same\n * \"presence is the capability\" signal `diff` uses. Throws when the line is\n * past the text.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @param {boolean} include_deprecated\n * @param {string} trigger_character\n * @returns {string}\n */\nexport function complete(input, line, character, position_encoding, include_deprecated, trigger_character) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(trigger_character, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.complete(retptr, ptr0, len0, line, character, ptr1, len1, include_deprecated, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * One item of the list `complete` returns at this position, its Markdown\n * `documentation` filled in — LSP `completionItem/resolve` (PLAN-202):\n * `complete` ships no documentation, an editor asks for the one item it is\n * about to show. `label` and `kind` (the LSP `CompletionItemKind` number)\n * name the item; the JSON `null` when the list has no such item. Arguments\n * otherwise as `complete`.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @param {boolean} include_deprecated\n * @param {string} label\n * @param {number} kind\n * @returns {string}\n */\nexport function resolve(input, line, character, position_encoding, include_deprecated, label, kind) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(label, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.resolve(retptr, ptr0, len0, line, character, ptr1, len1, include_deprecated, ptr2, len2, kind);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * The construct at a position, as an LSP `Hover` — or the JSON `null` when\n * there is nothing to show (PLAN-196 D8). Arguments as `complete`.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @returns {string}\n */\nexport function hover(input, line, character, position_encoding) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.hover(retptr, ptr0, len0, line, character, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr3 = r0;\n var len3 = r1;\n if (r3) {\n ptr3 = 0; len3 = 0;\n throw takeObject(r2);\n }\n deferred4_0 = ptr3;\n deferred4_1 = len3;\n return getStringFromWasm0(ptr3, len3);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Register data with the parser process (PLAN-173 P12).\n *\n * `data_type`: `\"translations\"` today. One verb rather than one function per\n * registerable thing — the same discriminated-options idiom as `info`.\n *\n * `data` is the file's own text. Semantics are REPLACE: a second call\n * supersedes the first entirely, and the built-in table (where the variant\n * bakes one) stays underneath. Throws on bad data — like every other\n * fallible export (PLAN-192 D1).\n *\n * Available in EVERY variant, including those that bake nothing: that is\n * exactly where a consumer must supply the file themselves.\n * @param {string} data_type\n * @param {string} data\n */\nexport function register(data_type, data) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(data_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.register(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n if (r1) {\n throw takeObject(r0);\n }\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n}\n\n/**\n * Convert between bitmark and JSON with explicit input/output formats + mode.\n *\n * `input_format`: `\"auto\"` (default) | `\"bitmark\"` | `\"json\"` | a mapping id.\n * `output_format`: `\"auto\"` (opposite of input) | `\"bitmark\"` | `\"json\"` |\n * `\"text\"` | `\"lex\"` (the token stream as JSON) | `\"semantic-tokens\"` |\n * `\"diagnostics\"` (the last three bitmark input only) | a mapping id.\n * `mode`: `\"optimized\"` (default) | `\"full\"`.\n * `mapping_report`: replace the output with a human-readable report of the\n * input→output mappings, including inputs that are NOT mapped (PLAN-147).\n * `position_encoding`: `\"utf-16\"` (default) | `\"utf-8\"` — the\n * `semantic-tokens` and `diagnostics` outputs' encoding (PLAN-193 /\n * PLAN-196) — and `tokens_layout`: `\"lsp\"` (default) | `\"absolute\"` — the\n * `semantic-tokens` layout; `\"\"` means the default, and every other output\n * format ignores them.\n * Returns the converted text/JSON; throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} output_format_sel\n * @param {string} mode\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @param {boolean} include_unknown_properties\n * @param {boolean} mapping_report\n * @param {string} position_encoding\n * @param {string} tokens_layout\n * @returns {string}\n */\nexport function convert(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, position_encoding, tokens_layout) {\n let deferred8_0;\n let deferred8_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n const ptr4 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len4 = WASM_VECTOR_LEN;\n const ptr5 = passStringToWasm0(tokens_layout, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len5 = WASM_VECTOR_LEN;\n wasm.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, ptr4, len4, ptr5, len5);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr7 = r0;\n var len7 = r1;\n if (r3) {\n ptr7 = 0; len7 = 0;\n throw takeObject(r2);\n }\n deferred8_0 = ptr7;\n deferred8_1 = len7;\n return getStringFromWasm0(ptr7, len7);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred8_0, deferred8_1, 1);\n }\n}\n\n/**\n * Re-emit input in its own format in canonical form at `mode`.\n *\n * `input_format`: `\"auto\"` (default) | `\"bitmark\"` | `\"json\"` | any config\n * mapping id (`html`, `xml`, …). The output is re-emitted in this same format.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} mode\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @returns {string}\n */\nexport function canonicalize(input, input_format_sel, mode, pretty, indent, spaces_around_values) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Count the bits in `input` (auto-detecting bitmark vs JSON).\n * Returns the count as a decimal string; throws on failure.\n * @param {string} input\n * @returns {string}\n */\nexport function count_bits(input) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.count_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0; len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Split a bitmark document into per-bit source slices.\n *\n * Returns a JSON array of `{ index, byteStart, byteEnd, source }`. Lets a JS\n * caller chunk a document at bit boundaries (e.g. to feed a worker pool).\n * @param {string} input\n * @returns {string}\n */\nexport function split_bits(input) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.split_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n}\n\n/**\n * Whether `input` looks like bitmark (vs JSON). Mirrors the auto-detection\n * used across the API so a JS caller can resolve `\"auto\"` consistently.\n * @param {string} input\n * @returns {boolean}\n */\nexport function is_bitmark(input) {\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.is_bitmark(ptr0, len0);\n return ret !== 0;\n}\n\n/**\n * Split a JSON document (a top-level array of bit envelopes) into its per-bit\n * envelope objects, returned as a JSON array string. Lets a JS caller iterate\n * JSON-input bits for per-bit hooks (the JSON counterpart of [`split_bits`]).\n * Throws if the input is not a JSON array of bits.\n * @param {string} input\n * @returns {string}\n */\nexport function split_json_bits(input) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.split_json_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0; len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Pretty-print a compact JSON string with the given indent. Used to format a\n * document recombined on the JS side (the per-bit hook path) so its output\n * matches the in-Rust recombination byte-for-byte.\n * @param {string} json\n * @param {number} indent\n * @returns {string}\n */\nexport function prettify(json, indent) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.prettify(retptr, ptr0, len0, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbindgen_error_new = function(arg0, arg1) {\n const ret = new Error(getStringFromWasm0(arg0, arg1));\n return addHeapObject(ret);\n };\n\n return imports;\n}\n\nfunction __wbg_init_memory(imports, memory) {\n\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n __wbg_init_memory(imports);\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('bitmark_wasm_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n __wbg_init_memory(imports);\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n","let wasm;\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nconst heap = new Array(128).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nlet heap_next = heap.length;\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nconst cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * `sub_location`: `\"text\"` (default) or `\"attrValue\"` — the value half of an\n * inline-attr chain segment (`==t==|link:VALUE|`), which escapes `|` and\n * skips the running-text rules (PLAN-211)\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @param {string | null} [sub_location]\n * @returns {string}\n */\nexport function breakscape_text(input, format, location, sub_location) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n var len3 = WASM_VECTOR_LEN;\n wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * `sub_location`: accepted and IGNORED — unbreakscape is sub-location\n * independent for bitmarkText, so one inverse undoes every breakscape mode\n * (PLAN-211 D5a)\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @param {string | null} [sub_location]\n * @returns {string}\n */\nexport function unbreakscape_text(input, format, location, sub_location) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n var len3 = WASM_VECTOR_LEN;\n wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Query information about supported bit types.\n *\n * `info_type`: `\"list\"`, `\"bit\"`, `\"all\"`, `\"deprecated\"`, `\"bit-groups\"`,\n * or `\"resource-groups\"`\n * `format`: `\"text\"` or `\"json\"`\n * `bit`: bit name (required when `info_type` is `\"bit\"`)\n * `pretty`: whether to pretty-print JSON output\n * `indent`: indent size for pretty-printing (default: 2)\n * `include_deprecated`: include deprecated bits in `list`/`all` (PLAN-149)\n * `only_deprecated`: restrict `list`/`all` to deprecated bits (wins over\n * `include_deprecated`)\n * `full`: complete outline for `bit`/`all` (default is the compact\n * one-line-per-tag view)\n * `language`: BCP-47 tag(s) for display names — \"\" = English, `\"de,fr\"` for\n * several (adds a `titles` map), `\"all\"` for every resolvable language\n * @param {string} info_type\n * @param {string} format\n * @param {string} bit\n * @param {boolean} pretty\n * @param {number} indent\n * @param {boolean} include_deprecated\n * @param {boolean} only_deprecated\n * @param {boolean} full\n * @param {string} language\n * @returns {string}\n */\nexport function info(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(language, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Whether this build can render `info` as TEXT (PLAN-192 D6). The export is\n * ABSENT when it cannot — the same \"presence is the capability\" signal\n * `diff` uses, so a caller tests for the function rather than for a\n * variant name.\n * @returns {boolean}\n */\nexport function info_text_supported() {\n const ret = wasm.info_text_supported();\n return ret !== 0;\n}\n\nfunction getObject(idx) { return heap[idx]; }\n\nfunction dropObject(idx) {\n if (idx < 132) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n/**\n * Convert a standalone bitmark text fragment ↔ TextAst (ProseMirror JSON).\n *\n * `direction`: `\"textToAst\"` | `\"astToText\"` | `\"astToPlainText\"`.\n * `format`: a bitmark text format (`\"bitmark++\"`, `\"bitmark+\"`) parses\n * inline marks; anything else is treated as plain text (textToAst only).\n * `location`: `\"body\"` (default) or `\"tag\"`.\n * Returns the converted fragment; throws on failure.\n * @param {string} input\n * @param {string} direction\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function convert_text(input, direction, format, location) {\n let deferred6_0;\n let deferred6_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(direction, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr5 = r0;\n var len5 = r1;\n if (r3) {\n ptr5 = 0; len5 = 0;\n throw takeObject(r2);\n }\n deferred6_0 = ptr5;\n deferred6_1 = len5;\n return getStringFromWasm0(ptr5, len5);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);\n }\n}\n\n/**\n * Apply a patch (a JSON array of patch entries) to every bit and re-emit.\n *\n * `input_format_sel`: `\"auto\"` | `\"bitmark\"` | `\"json\"`.\n * `output_format_sel`: the same vocabulary as `convert` — `\"bitmark\"` |\n * `\"json\"` | `\"text\"` | a mapping id (`\"html\"`, …), `\"auto\"` (or empty) being\n * the opposite of the resolved input format. The whole-document outputs\n * (`lex`, `semantic-tokens`, `diagnostics`) are not per-bit formats; the\n * pipeline refuses them and that refusal is what throws.\n * `patch_json`: the patch entry array (empty string = no patches, i.e. a\n * canonicalizing pass). Parallelism is a JS-side concern (web workers); this\n * runs sequentially. Returns `{ \"data\": <document text/JSON>, \"diagnostics\":\n * [ { \"path\", \"kind\", \"message\" } ] }` — the diagnostics are the entries the\n * pipeline skipped (PLAN-209 T9; `kind` is the error contract's identifier,\n * e.g. `patch-index-out-of-range`); throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} output_format_sel\n * @param {string} mode\n * @param {string} patch_json\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @returns {string}\n */\nexport function transform(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {\n let deferred7_0;\n let deferred7_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n const ptr4 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len4 = WASM_VECTOR_LEN;\n wasm.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr6 = r0;\n var len6 = r1;\n if (r3) {\n ptr6 = 0; len6 = 0;\n throw takeObject(r2);\n }\n deferred7_0 = ptr6;\n deferred7_1 = len6;\n return getStringFromWasm0(ptr6, len6);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred7_0, deferred7_1, 1);\n }\n}\n\n/**\n * Resolve a patch document against `input` (bitmark or JSON) into the\n * ordered output items, so a JS per-bit planner (hooks, worker pool) can\n * reorder, drop and insert jobs from the one Rust implementation\n * (PLAN-179). `input_format_sel` is the caller's input-format selector\n * (`\"auto\"` | `\"bitmark\"` | `\"json\"`): the document is split under the SAME\n * selection the planner already resolved, never re-sniffed (PLAN-187 D1).\n * Returns a JSON array of\n * `{ \"source\": <original index> | null, \"bit\": <inner bit> | null,\n * \"patch\": [ … ] }`; throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} patch_json\n * @returns {string}\n */\nexport function resolve_patch_document(input, input_format_sel, patch_json) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.resolve_patch_document(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Semantic diff of two documents (PLAN-179). Flat arguments like every\n * other export:\n * - `input_format`: `\"auto\"` | `\"bitmark\"` | `\"json\"` | a mapping id,\n * applied to both sides;\n * - `output_format`: `\"bitmark\"` (unified-style text) | `\"json\"` |\n * `\"patch\"`;\n * - `context`, `locate`, `similarity`, `bbox_tolerance`,\n * `spaces_around_values` as documented on `DiffOptions`.\n * Returns the diff (empty text / `[]` of unchanged bits / a patch document\n * with no entries when the documents are semantically equal); throws on\n * failure.\n * @param {string} a\n * @param {string} b\n * @param {string} input_format_sel\n * @param {string} output_format_sel\n * @param {number} context\n * @param {boolean} locate\n * @param {number} similarity\n * @param {number} bbox_tolerance\n * @param {number} spaces_around_values\n * @returns {string}\n */\nexport function diff(a, b, input_format_sel, output_format_sel, context, locate, similarity, bbox_tolerance, spaces_around_values) {\n let deferred6_0;\n let deferred6_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(a, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(b, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n wasm.diff(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, context, locate, similarity, bbox_tolerance, spaces_around_values);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr5 = r0;\n var len5 = r1;\n if (r3) {\n ptr5 = 0; len5 = 0;\n throw takeObject(r2);\n }\n deferred6_0 = ptr5;\n deferred6_1 = len5;\n return getStringFromWasm0(ptr5, len5);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);\n }\n}\n\n/**\n * The constructs valid at a position, as an LSP `CompletionList` (PLAN-196\n * D7; contract `API-EDT-editor-services.tsp`). `line` / `character` are\n * 0-based, `character` in `position_encoding` units (`\"utf-16\"`, the\n * default, or `\"utf-8\"`); `include_deprecated` offers deprecated bits too;\n * `trigger_character` is the character the editor sent as the trigger (LSP\n * `CompletionContext.triggerCharacter`; empty when invoked explicitly) — a\n * trigger that opens nothing where the cursor is answers the empty list\n * (PLAN-203 D1). ABSENT on a variant built without `editor` — the same\n * \"presence is the capability\" signal `diff` uses. Throws when the line is\n * past the text.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @param {boolean} include_deprecated\n * @param {string} trigger_character\n * @returns {string}\n */\nexport function complete(input, line, character, position_encoding, include_deprecated, trigger_character) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(trigger_character, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.complete(retptr, ptr0, len0, line, character, ptr1, len1, include_deprecated, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * One item of the list `complete` returns at this position, its Markdown\n * `documentation` filled in — LSP `completionItem/resolve` (PLAN-202):\n * `complete` ships no documentation, an editor asks for the one item it is\n * about to show. `label` and `kind` (the LSP `CompletionItemKind` number)\n * name the item; the JSON `null` when the list has no such item. Arguments\n * otherwise as `complete`.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @param {boolean} include_deprecated\n * @param {string} label\n * @param {number} kind\n * @returns {string}\n */\nexport function resolve(input, line, character, position_encoding, include_deprecated, label, kind) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(label, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.resolve(retptr, ptr0, len0, line, character, ptr1, len1, include_deprecated, ptr2, len2, kind);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * The construct at a position, as an LSP `Hover` — or the JSON `null` when\n * there is nothing to show (PLAN-196 D8). Arguments as `complete`.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @returns {string}\n */\nexport function hover(input, line, character, position_encoding) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.hover(retptr, ptr0, len0, line, character, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr3 = r0;\n var len3 = r1;\n if (r3) {\n ptr3 = 0; len3 = 0;\n throw takeObject(r2);\n }\n deferred4_0 = ptr3;\n deferred4_1 = len3;\n return getStringFromWasm0(ptr3, len3);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Register data with the parser process (PLAN-173 P12).\n *\n * `data_type`: `\"translations\"` today. One verb rather than one function per\n * registerable thing — the same discriminated-options idiom as `info`.\n *\n * `data` is the file's own text. Semantics are REPLACE: a second call\n * supersedes the first entirely, and the built-in table (where the variant\n * bakes one) stays underneath. Throws on bad data — like every other\n * fallible export (PLAN-192 D1).\n *\n * Available in EVERY variant, including those that bake nothing: that is\n * exactly where a consumer must supply the file themselves.\n * @param {string} data_type\n * @param {string} data\n */\nexport function register(data_type, data) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(data_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.register(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n if (r1) {\n throw takeObject(r0);\n }\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n}\n\n/**\n * Convert between bitmark and JSON with explicit input/output formats + mode.\n *\n * `input_format`: `\"auto\"` (default) | `\"bitmark\"` | `\"json\"` | a mapping id.\n * `output_format`: `\"auto\"` (opposite of input) | `\"bitmark\"` | `\"json\"` |\n * `\"text\"` | `\"lex\"` (the token stream as JSON) | `\"semantic-tokens\"` |\n * `\"diagnostics\"` (the last three bitmark input only) | a mapping id.\n * `mode`: `\"optimized\"` (default) | `\"full\"`.\n * `mapping_report`: replace the output with a human-readable report of the\n * input→output mappings, including inputs that are NOT mapped (PLAN-147).\n * `position_encoding`: `\"utf-16\"` (default) | `\"utf-8\"` — the\n * `semantic-tokens` and `diagnostics` outputs' encoding (PLAN-193 /\n * PLAN-196) — and `tokens_layout`: `\"lsp\"` (default) | `\"absolute\"` — the\n * `semantic-tokens` layout; `\"\"` means the default, and every other output\n * format ignores them.\n * Returns the converted text/JSON; throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} output_format_sel\n * @param {string} mode\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @param {boolean} include_unknown_properties\n * @param {boolean} mapping_report\n * @param {string} position_encoding\n * @param {string} tokens_layout\n * @returns {string}\n */\nexport function convert(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, position_encoding, tokens_layout) {\n let deferred8_0;\n let deferred8_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n const ptr4 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len4 = WASM_VECTOR_LEN;\n const ptr5 = passStringToWasm0(tokens_layout, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len5 = WASM_VECTOR_LEN;\n wasm.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, ptr4, len4, ptr5, len5);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr7 = r0;\n var len7 = r1;\n if (r3) {\n ptr7 = 0; len7 = 0;\n throw takeObject(r2);\n }\n deferred8_0 = ptr7;\n deferred8_1 = len7;\n return getStringFromWasm0(ptr7, len7);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred8_0, deferred8_1, 1);\n }\n}\n\n/**\n * Re-emit input in its own format in canonical form at `mode`.\n *\n * `input_format`: `\"auto\"` (default) | `\"bitmark\"` | `\"json\"` | any config\n * mapping id (`html`, `xml`, …). The output is re-emitted in this same format.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} mode\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @returns {string}\n */\nexport function canonicalize(input, input_format_sel, mode, pretty, indent, spaces_around_values) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Count the bits in `input` (auto-detecting bitmark vs JSON).\n * Returns the count as a decimal string; throws on failure.\n * @param {string} input\n * @returns {string}\n */\nexport function count_bits(input) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.count_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0; len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Split a bitmark document into per-bit source slices.\n *\n * Returns a JSON array of `{ index, byteStart, byteEnd, source }`. Lets a JS\n * caller chunk a document at bit boundaries (e.g. to feed a worker pool).\n * @param {string} input\n * @returns {string}\n */\nexport function split_bits(input) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.split_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n}\n\n/**\n * Whether `input` looks like bitmark (vs JSON). Mirrors the auto-detection\n * used across the API so a JS caller can resolve `\"auto\"` consistently.\n * @param {string} input\n * @returns {boolean}\n */\nexport function is_bitmark(input) {\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.is_bitmark(ptr0, len0);\n return ret !== 0;\n}\n\n/**\n * Split a JSON document (a top-level array of bit envelopes) into its per-bit\n * envelope objects, returned as a JSON array string. Lets a JS caller iterate\n * JSON-input bits for per-bit hooks (the JSON counterpart of [`split_bits`]).\n * Throws if the input is not a JSON array of bits.\n * @param {string} input\n * @returns {string}\n */\nexport function split_json_bits(input) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.split_json_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0; len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Pretty-print a compact JSON string with the given indent. Used to format a\n * document recombined on the JS side (the per-bit hook path) so its output\n * matches the in-Rust recombination byte-for-byte.\n * @param {string} json\n * @param {number} indent\n * @returns {string}\n */\nexport function prettify(json, indent) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.prettify(retptr, ptr0, len0, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbindgen_error_new = function(arg0, arg1) {\n const ret = new Error(getStringFromWasm0(arg0, arg1));\n return addHeapObject(ret);\n };\n\n return imports;\n}\n\nfunction __wbg_init_memory(imports, memory) {\n\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n __wbg_init_memory(imports);\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('bitmark_browser_full_wasm_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n __wbg_init_memory(imports);\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n","let wasm;\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nconst heap = new Array(128).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nlet heap_next = heap.length;\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nconst cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * `sub_location`: `\"text\"` (default) or `\"attrValue\"` — the value half of an\n * inline-attr chain segment (`==t==|link:VALUE|`), which escapes `|` and\n * skips the running-text rules (PLAN-211)\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @param {string | null} [sub_location]\n * @returns {string}\n */\nexport function breakscape_text(input, format, location, sub_location) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n var len3 = WASM_VECTOR_LEN;\n wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * `sub_location`: accepted and IGNORED — unbreakscape is sub-location\n * independent for bitmarkText, so one inverse undoes every breakscape mode\n * (PLAN-211 D5a)\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @param {string | null} [sub_location]\n * @returns {string}\n */\nexport function unbreakscape_text(input, format, location, sub_location) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n var len3 = WASM_VECTOR_LEN;\n wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Query information about supported bit types.\n *\n * `info_type`: `\"list\"`, `\"bit\"`, `\"all\"`, `\"deprecated\"`, `\"bit-groups\"`,\n * or `\"resource-groups\"`\n * `format`: `\"text\"` or `\"json\"`\n * `bit`: bit name (required when `info_type` is `\"bit\"`)\n * `pretty`: whether to pretty-print JSON output\n * `indent`: indent size for pretty-printing (default: 2)\n * `include_deprecated`: include deprecated bits in `list`/`all` (PLAN-149)\n * `only_deprecated`: restrict `list`/`all` to deprecated bits (wins over\n * `include_deprecated`)\n * `full`: complete outline for `bit`/`all` (default is the compact\n * one-line-per-tag view)\n * `language`: BCP-47 tag(s) for display names — \"\" = English, `\"de,fr\"` for\n * several (adds a `titles` map), `\"all\"` for every resolvable language\n * @param {string} info_type\n * @param {string} format\n * @param {string} bit\n * @param {boolean} pretty\n * @param {number} indent\n * @param {boolean} include_deprecated\n * @param {boolean} only_deprecated\n * @param {boolean} full\n * @param {string} language\n * @returns {string}\n */\nexport function info(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(language, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\nfunction getObject(idx) { return heap[idx]; }\n\nfunction dropObject(idx) {\n if (idx < 132) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n/**\n * Register data with the parser process (PLAN-173 P12).\n *\n * `data_type`: `\"translations\"` today. One verb rather than one function per\n * registerable thing — the same discriminated-options idiom as `info`.\n *\n * `data` is the file's own text. Semantics are REPLACE: a second call\n * supersedes the first entirely, and the built-in table (where the variant\n * bakes one) stays underneath. Throws on bad data — like every other\n * fallible export (PLAN-192 D1).\n *\n * Available in EVERY variant, including those that bake nothing: that is\n * exactly where a consumer must supply the file themselves.\n * @param {string} data_type\n * @param {string} data\n */\nexport function register(data_type, data) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(data_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.register(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n if (r1) {\n throw takeObject(r0);\n }\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n}\n\n/**\n * Apply a patch (a JSON array of patch entries) to every bit and re-emit.\n *\n * `input_format_sel`: `\"auto\"` | `\"bitmark\"` | `\"json\"`.\n * `output_format_sel`: the same vocabulary as `convert` — `\"bitmark\"` |\n * `\"json\"` | `\"text\"` | a mapping id (`\"html\"`, …), `\"auto\"` (or empty) being\n * the opposite of the resolved input format. The whole-document outputs\n * (`lex`, `semantic-tokens`, `diagnostics`) are not per-bit formats; the\n * pipeline refuses them and that refusal is what throws.\n * `patch_json`: the patch entry array (empty string = no patches, i.e. a\n * canonicalizing pass). Parallelism is a JS-side concern (web workers); this\n * runs sequentially. Returns `{ \"data\": <document text/JSON>, \"diagnostics\":\n * [ { \"path\", \"kind\", \"message\" } ] }` — the diagnostics are the entries the\n * pipeline skipped (PLAN-209 T9; `kind` is the error contract's identifier,\n * e.g. `patch-index-out-of-range`); throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} output_format_sel\n * @param {string} mode\n * @param {string} patch_json\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @returns {string}\n */\nexport function transform(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {\n let deferred7_0;\n let deferred7_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n const ptr4 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len4 = WASM_VECTOR_LEN;\n wasm.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr6 = r0;\n var len6 = r1;\n if (r3) {\n ptr6 = 0; len6 = 0;\n throw takeObject(r2);\n }\n deferred7_0 = ptr6;\n deferred7_1 = len6;\n return getStringFromWasm0(ptr6, len6);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred7_0, deferred7_1, 1);\n }\n}\n\n/**\n * Resolve a patch document against `input` (bitmark or JSON) into the\n * ordered output items, so a JS per-bit planner (hooks, worker pool) can\n * reorder, drop and insert jobs from the one Rust implementation\n * (PLAN-179). `input_format_sel` is the caller's input-format selector\n * (`\"auto\"` | `\"bitmark\"` | `\"json\"`): the document is split under the SAME\n * selection the planner already resolved, never re-sniffed (PLAN-187 D1).\n * Returns a JSON array of\n * `{ \"source\": <original index> | null, \"bit\": <inner bit> | null,\n * \"patch\": [ … ] }`; throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} patch_json\n * @returns {string}\n */\nexport function resolve_patch_document(input, input_format_sel, patch_json) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.resolve_patch_document(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * The constructs valid at a position, as an LSP `CompletionList` (PLAN-196\n * D7; contract `API-EDT-editor-services.tsp`). `line` / `character` are\n * 0-based, `character` in `position_encoding` units (`\"utf-16\"`, the\n * default, or `\"utf-8\"`); `include_deprecated` offers deprecated bits too;\n * `trigger_character` is the character the editor sent as the trigger (LSP\n * `CompletionContext.triggerCharacter`; empty when invoked explicitly) — a\n * trigger that opens nothing where the cursor is answers the empty list\n * (PLAN-203 D1). ABSENT on a variant built without `editor` — the same\n * \"presence is the capability\" signal `diff` uses. Throws when the line is\n * past the text.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @param {boolean} include_deprecated\n * @param {string} trigger_character\n * @returns {string}\n */\nexport function complete(input, line, character, position_encoding, include_deprecated, trigger_character) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(trigger_character, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.complete(retptr, ptr0, len0, line, character, ptr1, len1, include_deprecated, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * One item of the list `complete` returns at this position, its Markdown\n * `documentation` filled in — LSP `completionItem/resolve` (PLAN-202):\n * `complete` ships no documentation, an editor asks for the one item it is\n * about to show. `label` and `kind` (the LSP `CompletionItemKind` number)\n * name the item; the JSON `null` when the list has no such item. Arguments\n * otherwise as `complete`.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @param {boolean} include_deprecated\n * @param {string} label\n * @param {number} kind\n * @returns {string}\n */\nexport function resolve(input, line, character, position_encoding, include_deprecated, label, kind) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(label, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.resolve(retptr, ptr0, len0, line, character, ptr1, len1, include_deprecated, ptr2, len2, kind);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * The construct at a position, as an LSP `Hover` — or the JSON `null` when\n * there is nothing to show (PLAN-196 D8). Arguments as `complete`.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @returns {string}\n */\nexport function hover(input, line, character, position_encoding) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.hover(retptr, ptr0, len0, line, character, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr3 = r0;\n var len3 = r1;\n if (r3) {\n ptr3 = 0; len3 = 0;\n throw takeObject(r2);\n }\n deferred4_0 = ptr3;\n deferred4_1 = len3;\n return getStringFromWasm0(ptr3, len3);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Convert between bitmark and JSON with explicit input/output formats + mode.\n *\n * `input_format`: `\"auto\"` (default) | `\"bitmark\"` | `\"json\"` | a mapping id.\n * `output_format`: `\"auto\"` (opposite of input) | `\"bitmark\"` | `\"json\"` |\n * `\"text\"` | `\"lex\"` (the token stream as JSON) | `\"semantic-tokens\"` |\n * `\"diagnostics\"` (the last three bitmark input only) | a mapping id.\n * `mode`: `\"optimized\"` (default) | `\"full\"`.\n * `mapping_report`: replace the output with a human-readable report of the\n * input→output mappings, including inputs that are NOT mapped (PLAN-147).\n * `position_encoding`: `\"utf-16\"` (default) | `\"utf-8\"` — the\n * `semantic-tokens` and `diagnostics` outputs' encoding (PLAN-193 /\n * PLAN-196) — and `tokens_layout`: `\"lsp\"` (default) | `\"absolute\"` — the\n * `semantic-tokens` layout; `\"\"` means the default, and every other output\n * format ignores them.\n * Returns the converted text/JSON; throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} output_format_sel\n * @param {string} mode\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @param {boolean} include_unknown_properties\n * @param {boolean} mapping_report\n * @param {string} position_encoding\n * @param {string} tokens_layout\n * @returns {string}\n */\nexport function convert(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, position_encoding, tokens_layout) {\n let deferred8_0;\n let deferred8_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n const ptr4 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len4 = WASM_VECTOR_LEN;\n const ptr5 = passStringToWasm0(tokens_layout, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len5 = WASM_VECTOR_LEN;\n wasm.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, ptr4, len4, ptr5, len5);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr7 = r0;\n var len7 = r1;\n if (r3) {\n ptr7 = 0; len7 = 0;\n throw takeObject(r2);\n }\n deferred8_0 = ptr7;\n deferred8_1 = len7;\n return getStringFromWasm0(ptr7, len7);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred8_0, deferred8_1, 1);\n }\n}\n\n/**\n * Re-emit input in its own format in canonical form at `mode`.\n *\n * `input_format`: `\"auto\"` (default) | `\"bitmark\"` | `\"json\"` | any config\n * mapping id (`html`, `xml`, …). The output is re-emitted in this same format.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} mode\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @returns {string}\n */\nexport function canonicalize(input, input_format_sel, mode, pretty, indent, spaces_around_values) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Count the bits in `input` (auto-detecting bitmark vs JSON).\n * Returns the count as a decimal string; throws on failure.\n * @param {string} input\n * @returns {string}\n */\nexport function count_bits(input) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.count_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0; len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Split a bitmark document into per-bit source slices.\n *\n * Returns a JSON array of `{ index, byteStart, byteEnd, source }`. Lets a JS\n * caller chunk a document at bit boundaries (e.g. to feed a worker pool).\n * @param {string} input\n * @returns {string}\n */\nexport function split_bits(input) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.split_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n}\n\n/**\n * Whether `input` looks like bitmark (vs JSON). Mirrors the auto-detection\n * used across the API so a JS caller can resolve `\"auto\"` consistently.\n * @param {string} input\n * @returns {boolean}\n */\nexport function is_bitmark(input) {\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.is_bitmark(ptr0, len0);\n return ret !== 0;\n}\n\n/**\n * Split a JSON document (a top-level array of bit envelopes) into its per-bit\n * envelope objects, returned as a JSON array string. Lets a JS caller iterate\n * JSON-input bits for per-bit hooks (the JSON counterpart of [`split_bits`]).\n * Throws if the input is not a JSON array of bits.\n * @param {string} input\n * @returns {string}\n */\nexport function split_json_bits(input) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.split_json_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0; len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Pretty-print a compact JSON string with the given indent. Used to format a\n * document recombined on the JS side (the per-bit hook path) so its output\n * matches the in-Rust recombination byte-for-byte.\n * @param {string} json\n * @param {number} indent\n * @returns {string}\n */\nexport function prettify(json, indent) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.prettify(retptr, ptr0, len0, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n}\n\n/**\n * Convert a standalone bitmark text fragment ↔ TextAst (ProseMirror JSON).\n *\n * `direction`: `\"textToAst\"` | `\"astToText\"` | `\"astToPlainText\"`.\n * `format`: a bitmark text format (`\"bitmark++\"`, `\"bitmark+\"`) parses\n * inline marks; anything else is treated as plain text (textToAst only).\n * `location`: `\"body\"` (default) or `\"tag\"`.\n * Returns the converted fragment; throws on failure.\n * @param {string} input\n * @param {string} direction\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function convert_text(input, direction, format, location) {\n let deferred6_0;\n let deferred6_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(direction, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr5 = r0;\n var len5 = r1;\n if (r3) {\n ptr5 = 0; len5 = 0;\n throw takeObject(r2);\n }\n deferred6_0 = ptr5;\n deferred6_1 = len5;\n return getStringFromWasm0(ptr5, len5);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);\n }\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbindgen_error_new = function(arg0, arg1) {\n const ret = new Error(getStringFromWasm0(arg0, arg1));\n return addHeapObject(ret);\n };\n\n return imports;\n}\n\nfunction __wbg_init_memory(imports, memory) {\n\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n __wbg_init_memory(imports);\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('bitmark_json_wasm_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n __wbg_init_memory(imports);\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n","// This file is automatically generated. DO NOT EDIT.\n\n/* eslint-disable */\n\nexport const PACKAGE_INFO = {\n \"name\": \"@gmb/bitmark-parser\",\n \"version\": \"7.4.0\",\n \"author\": \"Get More Brain Ltd <info@getmorebrain.com>\",\n \"license\": \"ISC\",\n \"description\": \"A parser for bitmark text, powered by WebAssembly.\"\n};\n","// @zen-component: TS-VariantFacade\n//\n// Runtime variant selection (PLAN-166). The package ships one API surface\n// backed by a mutable reference to the ACTIVE wasm module; `init({ feature })`\n// selects which wasm variant backs it, and a later re-init swaps the module\n// atomically between calls (every wasm call is stateless string → string).\n// Platform entries (Node / browser) own the loading; this module owns the\n// reference, the feature vocabulary, and the error types.\n\nimport type { PatchDiagnostic } from \"../types.js\";\n\n/**\n * A deployable wasm feature set (PLAN-174).\n *\n * - `full` — everything, including the `info` META layer (tag descriptions,\n * group provenance, raw mappingKeys patterns). Native-CLI parity.\n * - `browser-full` — the same conversion capabilities as `full`, minus the\n * meta strings the browser should not pay to download.\n * - `bitmark-json` — bitmark ↔ JSON only.\n *\n * Size gating follows the DELIVERY CHANNEL, not the compilation target: a Node\n * backend loading wasm from disk has native-CLI requirements, while any entry\n * can be bundled for the browser. So every variant is buildable for both\n * targets and richness is always chosen explicitly. The per-entry defaults\n * below are conveniences; the contract is \"you get the variant you selected\".\n */\nexport type Feature = \"full\" | \"browser-full\" | \"bitmark-json\";\n\n/** Default variant for the Node entry — disk-loaded wasm, no download budget. */\nexport const NODE_DEFAULT_FEATURE: Feature = \"full\";\n\n/** Default variant for the browser entry — download latency is the budget. */\nexport const BROWSER_DEFAULT_FEATURE: Feature = \"browser-full\";\n\n/**\n * The wasm surface the shared wrappers drive. The optional members are the\n * capabilities a lean variant compiles out (calling their wrapper there\n * throws {@link UnsupportedFeatureError}).\n *\n * Every fallible member THROWS a JavaScript `Error` on failure (PLAN-192 D1);\n * its `message` is the core's error contract, `<kind> at <path>: <message>`,\n * with `<kind>` a stable kebab-case identifier. A returned string is always a\n * result — there is no in-band error prefix to test for.\n */\nexport interface WasmModule {\n convert(\n input: string,\n inputFormat: string,\n outputFormat: string,\n mode: string,\n pretty: boolean,\n indent: number,\n spacesAroundValues: number,\n includeUnknownProperties: boolean,\n mappingReport: boolean,\n /** `semantic-tokens` output only: `\"utf-16\"` | `\"utf-8\"`, `\"\"` = default (PLAN-193). */\n positionEncoding: string,\n /** `semantic-tokens` output only: `\"lsp\"` | `\"absolute\"`, `\"\"` = default. */\n tokensLayout: string,\n ): string;\n canonicalize(\n input: string,\n inputFormat: string,\n mode: string,\n pretty: boolean,\n indent: number,\n spacesAroundValues: number,\n ): string;\n transform(\n input: string,\n inputFormat: string,\n outputFormat: string,\n mode: string,\n patchJson: string,\n pretty: boolean,\n indent: number,\n spacesAroundValues: number,\n ): string;\n info(\n infoType: string,\n format: string,\n bit: string,\n pretty: boolean,\n indent: number,\n includeDeprecated: boolean,\n onlyDeprecated: boolean,\n full: boolean,\n language: string,\n ): string;\n /** Throws when the data is not valid for `dataType`. */\n register(dataType: string, data: string): void;\n count_bits(input: string): string;\n split_bits(input: string): string;\n split_json_bits(input: string): string;\n is_bitmark(input: string): boolean;\n prettify(json: string, indent: number): string;\n convert_text(input: string, direction: string, format: string, location: string): string;\n breakscape_text(input: string, format: string, location: string, subLocation: string): string;\n unbreakscape_text(input: string, format: string, location: string, subLocation: string): string;\n /**\n * Resolve a patch document against a document into ordered items\n * (PLAN-179), splitting it under `inputFormat` (`\"auto\"` | `\"bitmark\"` |\n * `\"json\"`) — the selector the caller already resolved, never a re-sniff.\n */\n resolve_patch_document(input: string, inputFormat: string, patchJson: string): string;\n /**\n * Present only where this build can render `info` as TEXT (PLAN-192 D6) —\n * the same \"presence is the capability\" signal as `diff`, so no caller\n * has to test for a variant name. Absent on `bitmark-json`, where `info`\n * serves JSON only.\n */\n info_text_supported?(): boolean;\n /** Completion at a position (PLAN-196); absent on a variant built without `editor`. */\n complete?(\n input: string,\n line: number,\n character: number,\n positionEncoding: string,\n includeDeprecated: boolean,\n triggerCharacter: string,\n ): string;\n /** One completion item with its documentation (PLAN-202); absent on a variant built without `editor`. */\n resolve?(\n input: string,\n line: number,\n character: number,\n positionEncoding: string,\n includeDeprecated: boolean,\n label: string,\n kind: number,\n ): string;\n /** Hover at a position (PLAN-196); absent on a variant built without `editor`. */\n hover?(input: string, line: number, character: number, positionEncoding: string): string;\n /** Semantic diff (PLAN-179); absent on a variant built without `diff`. */\n diff?(\n a: string,\n b: string,\n inputFormat: string,\n outputFormat: string,\n context: number,\n locate: boolean,\n similarity: number,\n bboxTolerance: number,\n spacesAroundValues: number,\n ): string;\n}\n\n/** Options accepted by `init` / `initSync` on every platform entry. */\nexport interface InitOptions {\n /** Which wasm variant to load. Default: `\"full\"`. */\n feature?: Feature;\n}\n\n/** A call arrived before any wasm module was initialised (browser only). */\nexport class NotInitializedError extends Error {\n constructor() {\n super(\"wasm not initialised: call init() (or init({ feature: … })) first\");\n this.name = \"NotInitializedError\";\n }\n}\n\n/** `register` rejected the supplied data. */\nexport class RegisterError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"RegisterError\";\n }\n}\n\n/**\n * `transform` skipped one or more patch entries (PLAN-209 T9). The document\n * was NOT returned: a silently ignored edit is worse than an error. Each\n * diagnostic names the entry's `path`, the error contract's `kind`\n * (`patch-parse-error`, `patch-index-out-of-range`, `patch-type-mismatch`)\n * and a `message`.\n */\nexport class PatchError extends Error {\n readonly diagnostics: PatchDiagnostic[];\n constructor(diagnostics: PatchDiagnostic[]) {\n const lines = diagnostics.map((d) => `${d.kind} at ${d.path}: ${d.message}`);\n super(\n `${diagnostics.length} patch ${diagnostics.length === 1 ? \"entry was\" : \"entries were\"} skipped:\\n` +\n lines.join(\"\\n\"),\n );\n this.name = \"PatchError\";\n this.diagnostics = diagnostics;\n }\n}\n\n/** A call needs a capability the ACTIVE wasm variant compiled out. */\nexport class UnsupportedFeatureError extends Error {\n constructor(what: string, active: Feature | undefined) {\n super(\n `${what} is not available in the loaded wasm module` +\n `${active ? ` (feature: \"${active}\")` : \"\"}; init({ feature: \"full\" }) to load it`,\n );\n this.name = \"UnsupportedFeatureError\";\n }\n}\n\nlet active: WasmModule | undefined;\nlet activeFeature: Feature | undefined;\nlet lazyLoader: (() => void) | undefined;\n\n// Data registered through `register`, kept so it can be REPLAYED onto each\n// newly activated module. Each variant is a separate wasm instance with its\n// own memory, so a registration made against one is invisible to the next —\n// and PLAN-166's promise is that swapping variants is invisible to the\n// caller. Keyed by type, because `register` replaces per type.\nconst registrations = new Map<string, string>();\n\n/**\n * The active wasm module. On Node the entry installs a lazy loader, so the\n * first call without an explicit `init` loads the default (`full`) variant\n * synchronously; in the browser an uninitialised call throws\n * {@link NotInitializedError} (wasm instantiation is async there).\n */\nexport function getActive(): WasmModule {\n if (!active && lazyLoader) lazyLoader();\n if (!active) throw new NotInitializedError();\n return active;\n}\n\n/** Swap the active module — the single atomic reference assignment. */\nexport function setActive(feature: Feature, module: WasmModule): void {\n // Replay first: a module that cannot take the registered data must not\n // become active half-configured. The data was accepted once already, so a\n // failure here is a bug worth surfacing rather than swallowing.\n for (const [type, data] of registrations) {\n try {\n module.register(type, data);\n } catch (e) {\n throw new RegisterError(e instanceof Error ? e.message : String(e));\n }\n }\n active = module;\n activeFeature = feature;\n}\n\n/**\n * Remember what `register` accepted, so it survives an `init` swap. Called\n * only after the ACTIVE module has accepted the same data.\n */\nexport function rememberRegistration(type: string, data: string): void {\n registrations.set(type, data);\n}\n\n/**\n * Install the Node lazy default loader (runs on the first call when no\n * explicit `init` happened; must call {@link setActive}).\n */\nexport function setLazyLoader(loader: () => void): void {\n lazyLoader = loader;\n}\n\n/** The active wasm feature, or `undefined` before the first init. */\nexport function variant(): Feature | undefined {\n return activeFeature;\n}\n","// @zen-component: TS-HookedTransform\n\nimport type { BitView, OutputFormat, PatchDiagnostic, PatchEntry, TransformOptions } from \"../types.js\";\nimport { PatchError } from \"./facade.js\";\n\n/** What the WASM `transform` export returns (PLAN-209 T9). */\nexport interface TransformEnvelope {\n data: string;\n diagnostics: PatchDiagnostic[];\n}\n\n/** One bit's rendered element plus the entries skipped on it. */\nexport interface BitOutput {\n element: string;\n diagnostics: PatchDiagnostic[];\n}\n\n/**\n * The minimal WASM surface the per-bit hook driver needs. Both the Node and\n * browser entry points satisfy this with their loaded module.\n */\nexport interface HookedWasm {\n is_bitmark(input: string): boolean;\n split_bits(input: string): string;\n split_json_bits(input: string): string;\n prettify(json: string, indent: number): string;\n resolve_patch_document(input: string, inputFormat: string, patchJson: string): string;\n /** Returns the {@link TransformEnvelope} as JSON text. */\n transform(\n input: string,\n inputFormat: string,\n outputFormat: string,\n mode: string,\n patchJson: string,\n pretty: boolean,\n indent: number,\n spacesAroundValues: number,\n ): string;\n}\n\n/** A single bit's compute job: data only, safe to ship to a worker thread. */\nexport interface BitJob {\n index: number;\n source: string;\n inputFormat: \"bitmark\" | \"json\";\n outputFormat: OutputFormat;\n mode: string;\n patchJson: string;\n spacesAroundValues: number;\n}\n\n/**\n * The result of running `preHook` over a document's bits: the compute `jobs`\n * for the bits that survived (in document order) and the matching `views`\n * (so `postHook` can be called per surviving bit), plus the document-level\n * recombination settings.\n */\nexport interface TransformPlan {\n jobs: BitJob[];\n views: BitView[];\n output: OutputFormat;\n pretty: boolean;\n indent: number;\n}\n\n/** Strip the outer `[ … ]` of a compact one-element JSON array. */\nexport function stripArray(doc: string): string {\n const t = doc.trim();\n return t.startsWith(\"[\") && t.endsWith(\"]\") ? t.slice(1, -1) : doc;\n}\n\n/**\n * The `patch` option as the JSON text the WASM resolver takes — a patch\n * document or the bare-array every-bit shorthand — or `\"\"` when absent.\n */\nfunction patchJsonOf(patch: TransformOptions[\"patch\"]): string {\n if (patch === undefined) return \"\";\n if (typeof patch === \"string\") return patch.trim();\n return JSON.stringify(patch);\n}\n\n/**\n * One slot of the resolved patch document (see `resolve_patch_document`).\n * An inserted `bit` is a JSON bit or, as a string, one bit of bitmark\n * source (PLAN-209 D15).\n */\ninterface ResolvedItem {\n source: number | null;\n bit: Record<string, unknown> | string | null;\n patch: PatchEntry[];\n}\n\nfunction buildUnits(\n wasm: HookedWasm,\n input: string,\n inputIsBitmark: boolean,\n): { view: BitView; source: string }[] {\n if (inputIsBitmark) {\n const slices = JSON.parse(wasm.split_bits(input)) as { index: number; source: string }[];\n return slices.map((s) => ({\n view: { format: \"bitmark\", index: s.index, total: slices.length, source: s.source },\n source: s.source,\n }));\n }\n const envelopes = JSON.parse(wasm.split_json_bits(input)) as {\n bit?: import(\"../generated/bit-types.js\").AnyBit;\n }[];\n return envelopes.map((env, index) => ({\n view: { format: \"json\", index, total: envelopes.length, bit: env.bit ?? {} },\n // Per-bit transform consumes a one-bit JSON document.\n source: JSON.stringify([env]),\n }));\n}\n\n/**\n * Split the document and run `preHook` (on the calling thread) for each bit,\n * producing the surviving compute jobs + their views. This is the main-thread\n * half shared by the sync and worker-pool drivers — only the resulting\n * data-only {@link BitJob}s ever cross to a worker.\n */\nexport function planTransform(\n wasm: HookedWasm,\n input: string,\n options: TransformOptions,\n): TransformPlan {\n const mode = options.mode ?? \"optimized\";\n const output: OutputFormat = options.outputFormat ?? \"json\";\n const spacesAroundValues = options.spacesAroundValues ?? 1;\n const indent = options.indent ?? 2;\n const pretty = options.pretty ?? false;\n\n const sel = options.inputFormat ?? \"auto\";\n const inputIsBitmark = sel === \"bitmark\" || (sel !== \"json\" && wasm.is_bitmark(input));\n const inputFormat = inputIsBitmark ? \"bitmark\" : \"json\";\n\n // The engine decides which output formats are per-bit (the whole-document\n // `lex` / `semantic-tokens` / `diagnostics` are not, and it refuses them\n // before any hook runs). Ask it the same way, once, with an empty document:\n // a document that splits into no bits would otherwise never carry that\n // refusal, and the hooked path would answer `\"\"` where the hookless one\n // throws (PLAN-192 D1 parity).\n wasm.transform(\"\", \"bitmark\", output, mode, \"\", false, indent, spacesAroundValues);\n\n const units = buildUnits(wasm, input, inputIsBitmark);\n const total = units.length;\n\n // Hooks see the ORIGINAL bits, in order, before the patch document\n // reshapes anything (same as the Rust pipeline's Phase A).\n const hooked: ({ patches: PatchEntry[]; outputFormat: OutputFormat } | null)[] = [];\n for (let index = 0; index < total; index++) {\n const { view } = units[index];\n view.index = index;\n view.total = total;\n const result = options.preHook ? options.preHook(view) || {} : {};\n hooked.push(result.drop ? null : { patches: result.patches ?? [], outputFormat: result.outputFormat ?? output });\n }\n\n // The patch document (or the every-bit shorthand) is resolved by the one\n // Rust implementation into the ordered output slots; without a patch the\n // slots are simply the original bits. The resolver splits under the SAME\n // input format resolved above — an explicit selection is never re-sniffed.\n const patchJson = patchJsonOf(options.patch);\n let resolved: ResolvedItem[];\n if (patchJson === \"\") {\n resolved = units.map((_, index) => ({ source: index, bit: null, patch: [] }));\n } else {\n resolved = JSON.parse(\n wasm.resolve_patch_document(input, inputFormat, patchJson),\n ) as ResolvedItem[];\n }\n\n const jobs: BitJob[] = [];\n const views: BitView[] = [];\n for (const item of resolved) {\n if (item.source !== null) {\n const hook = hooked[item.source];\n if (!hook) continue; // dropped by the pre-hook\n jobs.push({\n index: item.source,\n source: units[item.source].source,\n inputFormat,\n outputFormat: hook.outputFormat,\n mode,\n // The document's patches first, the hook's after (the hook contract).\n patchJson: JSON.stringify([...item.patch, ...hook.patches]),\n spacesAroundValues,\n });\n views.push(units[item.source].view);\n } else if (typeof item.bit === \"string\") {\n // An inserted bitmark bit (PLAN-209 D15), seen by `postHook` only.\n const index = jobs.length;\n jobs.push({\n index,\n source: item.bit,\n inputFormat: \"bitmark\",\n outputFormat: output,\n mode,\n patchJson: JSON.stringify(item.patch),\n spacesAroundValues,\n });\n views.push({ format: \"bitmark\", index, total, source: item.bit });\n } else {\n // An inserted bit: a one-bit JSON document, seen by `postHook` only.\n const bit = (item.bit ?? {}) as import(\"../generated/bit-types.js\").AnyBit;\n const index = jobs.length;\n jobs.push({\n index,\n source: JSON.stringify([{ bit }]),\n inputFormat: \"json\",\n outputFormat: output,\n mode,\n patchJson: JSON.stringify(item.patch),\n spacesAroundValues,\n });\n views.push({ format: \"json\", index, total, bit });\n }\n }\n return { jobs, views, output, pretty, indent };\n}\n\n/**\n * Read the WASM `transform` envelope for one bit: the element (compact JSON\n * stripped of its one-element array) and the entries skipped on it.\n */\nexport function bitOutput(envelopeJson: string, outputFormat: OutputFormat): BitOutput {\n const { data, diagnostics } = JSON.parse(envelopeJson) as TransformEnvelope;\n return { element: outputFormat === \"json\" ? stripArray(data) : data, diagnostics };\n}\n\n/**\n * Compute one bit's rendered element synchronously via WASM. The per-bit\n * element is always compact JSON (the document is prettified once on\n * recombination). Throws on failure; skipped entries come back as\n * diagnostics for the driver to raise.\n */\nexport function computeBit(wasm: HookedWasm, job: BitJob): BitOutput {\n return bitOutput(\n wasm.transform(\n job.source,\n job.inputFormat,\n job.outputFormat,\n job.mode,\n job.patchJson,\n false,\n 2,\n job.spacesAroundValues,\n ),\n job.outputFormat,\n );\n}\n\n/** Recombine per-bit elements into the final document, in document order. */\nexport function recombine(\n wasm: HookedWasm,\n elements: string[],\n output: OutputFormat,\n pretty: boolean,\n indent: number,\n): string {\n // Only JSON wraps as an array; every other per-bit output (bitmark, plain\n // text, a mapping such as html) is text and joins with newlines — the same\n // rule as the Rust pipeline's recombine.\n if (output !== \"json\") return elements.join(\"\\n\");\n const arr = `[${elements.join(\",\")}]`;\n return pretty ? wasm.prettify(arr, indent) : arr;\n}\n\n/**\n * Per-bit transform driver (synchronous, in-process): split the document, run\n * `preHook` for each bit on the calling thread, apply the static patch + any\n * hook patches, re-emit the bit, run `postHook`, then recombine in document\n * order.\n *\n * Hooks run synchronously on the calling thread; only data crosses into WASM.\n * Used when a `preHook`/`postHook` is supplied; the hookless path stays a\n * single `wasm.transform` call. Throws on failure (PLAN-192 D1), and a\n * `PatchError` when any entry was skipped (PLAN-209 T9).\n */\nexport function runHookedTransform(\n wasm: HookedWasm,\n input: string,\n options: TransformOptions,\n): string {\n const plan: TransformPlan = planTransform(wasm, input, options);\n\n const rendered: string[] = [];\n const skipped: PatchDiagnostic[] = [];\n for (let i = 0; i < plan.jobs.length; i++) {\n const { element, diagnostics } = computeBit(wasm, plan.jobs[i]);\n skipped.push(...diagnostics);\n options.postHook?.(plan.views[i], element);\n rendered.push(element);\n }\n // A skipped entry is never silent (PLAN-209 T9).\n if (skipped.length > 0) throw new PatchError(skipped);\n return recombine(wasm, rendered, plan.output, plan.pretty, plan.indent);\n}\n","// @zen-component: TS-ParallelOrchestrator\n\nimport type { PatchDiagnostic, TransformOptions } from \"../types.js\";\nimport { PatchError } from \"./facade.js\";\nimport { type BitJob, type BitOutput, type HookedWasm, planTransform, recombine } from \"./hooked-transform.js\";\n\n/**\n * A platform pool: compute `jobs` across up to `workers` workers, returning the\n * rendered element (and skipped entries) per job in submission order. Node and\n * browser supply their own (worker_threads / Worker); the orchestration around\n * it is shared.\n */\nexport type RunJobs = (jobs: BitJob[], workers: number) => Promise<BitOutput[]>;\n\n/**\n * Shared parallel transform orchestration. The main-thread half — split +\n * `preHook` + recombine + `postHook` — is identical to the sync driver; only\n * the data-only per-bit jobs cross to `runJobs` (the platform pool). Closures\n * (`preHook`/`postHook`) never leave the calling thread.\n *\n * Rejects on failure (PLAN-192 D1): the planning error, or the first worker /\n * job error the pool surfaces; and with a `PatchError` when any entry was\n * skipped (PLAN-209 T9).\n */\nexport async function orchestrateParallel(\n wasm: HookedWasm,\n input: string,\n options: TransformOptions,\n runJobs: RunJobs,\n): Promise<string> {\n const plan = planTransform(wasm, input, options);\n const outputs = await runJobs(plan.jobs, options.workers ?? 4);\n\n const elements: string[] = [];\n const skipped: PatchDiagnostic[] = [];\n for (let i = 0; i < outputs.length; i++) {\n elements.push(outputs[i].element);\n skipped.push(...outputs[i].diagnostics);\n options.postHook?.(plan.views[i], outputs[i].element);\n }\n // A skipped entry is never silent (PLAN-209 T9) — same as the sync driver.\n if (skipped.length > 0) throw new PatchError(skipped);\n return recombine(wasm, elements, plan.output, plan.pretty, plan.indent);\n}\n","// @zen-component: LEGACY-Facade\n// Platform injection for the legacy facade. The Node and browser entries\n// provide the WASM module (and, on Node, file I/O) before exposing the\n// `legacy` namespace — the facade itself stays platform-free.\n\n/** The subset of the WASM surface the legacy facade drives. */\nexport interface LegacyWasm {\n convert(\n input: string,\n inputFormat: string,\n outputFormat: string,\n mode: string,\n pretty: boolean,\n indent: number,\n spacesAroundValues: number,\n includeUnknownProperties: boolean,\n mappingReport: boolean,\n /** `semantic-tokens` output only (PLAN-193); the legacy facade passes `\"\"`. */\n positionEncoding: string,\n tokensLayout: string,\n ): string;\n canonicalize(\n input: string,\n inputFormat: string,\n mode: string,\n pretty: boolean,\n indent: number,\n spacesAroundValues: number,\n ): string;\n breakscape_text(input: string, format: string, location: string): string;\n unbreakscape_text(input: string, format: string, location: string): string;\n info(\n infoType: string,\n format: string,\n bit: string,\n pretty: boolean,\n indent: number,\n includeDeprecated: boolean,\n onlyDeprecated: boolean,\n full: boolean,\n language: string,\n ): string;\n is_bitmark(input: string): boolean;\n prettify(json: string, indent: number): string;\n convert_text(input: string, direction: string, format: string, location: string): string;\n}\n\nlet wasmProvider: (() => LegacyWasm) | undefined;\n\nexport function setLegacyWasm(wasm: LegacyWasm): void {\n wasmProvider = () => wasm;\n}\n\n/**\n * Provide the WASM module lazily (PLAN-166): the provider is consulted on\n * every legacy call, so it can defer loading and always reflects the ACTIVE\n * variant after an `init({ feature })` swap.\n */\nexport function setLegacyWasmProvider(provider: () => LegacyWasm): void {\n wasmProvider = provider;\n}\n\nexport function getLegacyWasm(): LegacyWasm {\n if (!wasmProvider) {\n throw new Error(\n \"legacy API not initialised: the WASM module has not been provided (browser consumers must call init() first)\",\n );\n }\n return wasmProvider();\n}\n\n/** Node file I/O, injected by the Node entry only (PLAN-126 F-5). */\nexport interface LegacyFileIo {\n existsSync(path: string): boolean;\n readFileSync(path: string, encoding: string): string;\n /** Write (or append) `data`, creating parent directories as needed. */\n writeFile(path: string, data: string, opts: { append?: boolean; encoding?: string }): void;\n}\n\nlet fileIo: LegacyFileIo | undefined;\n\nexport function setLegacyFileIo(io: LegacyFileIo): void {\n fileIo = io;\n}\n\n/** Returns undefined in the browser (no file I/O). */\nexport function getLegacyFileIo(): LegacyFileIo | undefined {\n return fileIo;\n}\n","// @zen-component: TS-WorkerPool\n//\n// The platform-neutral half of the parallel transform pool: dispatch-on-idle,\n// results matched by id and returned in submission order, the first worker or\n// job error rejecting, every worker terminated once the run settles. Node and\n// the browser each supply a `SpawnWorker` that owns Worker construction, its\n// message / error wiring and termination — nothing else differs.\n\nimport type { BitJob, BitOutput } from \"./hooked-transform.js\";\nimport type { PatchDiagnostic } from \"../types.js\";\n\n/** What a worker posts back for one job (the `id` it was given). */\nexport interface JobResult {\n id: number;\n ok: boolean;\n element?: string;\n /** The entries skipped on this bit (PLAN-209 T9). */\n diagnostics?: PatchDiagnostic[];\n error?: string;\n}\n\n/** A spawned worker as the scheduler drives it. */\nexport interface PoolWorker {\n post(msg: { id: number; job: BitJob }): void;\n terminate(): void;\n}\n\n/**\n * Create one worker, routing its results to `onResult` and any failure\n * (an uncaught worker error, an abnormal exit) to `onError`.\n */\nexport type SpawnWorker = (\n onResult: (res: JobResult) => void,\n onError: (err: Error) => void,\n) => PoolWorker;\n\n/**\n * Run `jobs` across up to `workers` workers created by `spawn`, returning the\n * rendered element (and skipped entries) per job in the **same order** as\n * `jobs`. Rejects on the first worker or job error; the pool is terminated\n * either way.\n */\nexport function runJobsWithPool(jobs: BitJob[], workers: number, spawn: SpawnWorker): Promise<BitOutput[]> {\n if (jobs.length === 0) return Promise.resolve([]);\n const poolSize = Math.max(1, Math.min(workers, jobs.length));\n\n return new Promise<BitOutput[]>((resolve, reject) => {\n const results = new Array<BitOutput>(jobs.length);\n let next = 0;\n let settled = 0;\n let done = false;\n const pool: PoolWorker[] = [];\n\n const finish = (err?: Error) => {\n if (done) return;\n done = true;\n for (const w of pool) w.terminate();\n if (err) reject(err);\n else resolve(results);\n };\n const dispatch = (w: PoolWorker) => {\n if (done || next >= jobs.length) return;\n const id = next++;\n w.post({ id, job: jobs[id] });\n };\n\n for (let i = 0; i < poolSize; i++) {\n const w = spawn((res) => {\n if (done) return;\n if (!res.ok) return finish(new Error(res.error ?? \"worker job failed\"));\n results[res.id] = { element: res.element as string, diagnostics: res.diagnostics ?? [] };\n if (++settled === jobs.length) finish();\n else dispatch(w);\n }, finish);\n pool.push(w);\n }\n\n // Prime each worker with one job.\n for (const w of pool) dispatch(w);\n });\n}\n","// @zen-component: TS-BrowserWorkerPool\n//\n// The browser module-Worker adapter of the shared pool scheduler\n// (core/pool.ts): Worker construction, message / error wiring and\n// termination. Each module worker loads its own WASM instance.\n\nimport type { Feature } from \"../core/facade.js\";\nimport type { BitJob, BitOutput } from \"../core/hooked-transform.js\";\nimport { runJobsWithPool, type JobResult } from \"../core/pool.js\";\n\n/**\n * Run `jobs` across up to `workers` module Workers, returning the rendered\n * element per job in submission order. Rejects on the first worker/job error.\n * Each worker loads the given wasm `feature` (PLAN-166) — the variant active\n * on the calling thread.\n */\nexport function runJobsParallel(jobs: BitJob[], workers: number, feature: Feature): Promise<BitOutput[]> {\n // worker-entry.js is emitted beside this bundle (see tsup config).\n const workerUrl = new URL(\"./worker-entry.js\", import.meta.url);\n return runJobsWithPool(jobs, workers, (onResult, onError) => {\n const w = new Worker(workerUrl, { type: \"module\" });\n w.onmessage = (ev: MessageEvent<JobResult>) => onResult(ev.data);\n w.onerror = (e: ErrorEvent) => onError(new Error(e.message || \"worker error\"));\n return { post: (msg) => w.postMessage({ ...msg, feature }), terminate: () => w.terminate() };\n });\n}\n","// @zen-component: LEGACY-Facade\n// The `legacy` namespace: a bpg-compatible (bitmark-parser-generator\n// v5.31.1) programmatic interface over the WASM core (PLAN-126).\n//\n// Everything here is exposed ONLY via `legacy.*` / the\n// `@gmb/bitmark-parser/legacy` subpath — nothing is re-exported at the\n// package root (reserved for the modern API and its future generated types).\n\nexport { BitmarkParserGenerator, bitmarkTextParse } from \"./bpg-class.js\";\nexport { Builder, type BuildBitOptions } from \"./builder.js\";\nexport { ResourceBuilder, type ResourceMethod } from \"./resource-builder.js\";\nexport { LegacyUnsupportedError } from \"./errors.js\";\nexport { isPseudoAst, type LegacyPseudoAst } from \"./pseudo-ast.js\";\n\n// Enum objects + option interfaces (vendored shapes)\nexport * from \"./options.js\";\nexport { BitType, BoundingBoxIndex, NodeType, TextMarkType, TextNodeType } from \"./enums-extra.js\";\n\n// Unsupported bpg internals — present but throwing (PLAN-126 F-2)\nexport {\n Ast,\n BitmarkFileGenerator,\n BitmarkGenerator,\n BitmarkParser,\n BitmarkStringGenerator,\n FileWriter,\n HtmlTableGenerator,\n HtmlTableParser,\n JsonFileGenerator,\n JsonGenerator,\n JsonParser,\n JsonStringGenerator,\n StreamWriter,\n StringWriter,\n} from \"./stubs.js\";\n\n// Vendored bpg JSON model / text-node types (type-only)\nexport type * from \"./vendor/BitJson.js\";\nexport type * from \"./vendor/BitWrapperJson.js\";\nexport type * from \"./vendor/BodyBitJson.js\";\nexport type * from \"./vendor/ParserJson.js\";\nexport type * from \"./vendor/ResourceJson.js\";\nexport type * from \"./vendor/TextNodes.js\";\n// bpg parity: bpg additionally exported JsonText under the alias `Text`\n// (bitmark-parser-generator src/index.ts: `JsonText as Text`).\nexport type { JsonText as Text } from \"./vendor/TextNodes.js\";\nexport type {\n ParserError,\n ParserInfo,\n ParserLocation,\n BitTypeType,\n TextFormatType,\n ResourceTypeType,\n TextMarkTypeType,\n TextNodeTypeType,\n} from \"./vendor/enums.js\";\n","// @zen-component: LEGACY-Facade\n\n/** Error thrown for bpg API members / options the legacy facade does not support. */\nexport class LegacyUnsupportedError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"LegacyUnsupportedError\";\n }\n}\n\n/** Throw for a bpg API member that is not supported (PLAN-126 F-2). */\nexport function unsupportedMember(member: string, reason?: string): never {\n throw new LegacyUnsupportedError(\n `'${member}' is not supported by the @gmb/bitmark-parser legacy API` + (reason ? `: ${reason}` : \"\"),\n );\n}\n\n/** Throw for an option that cannot be honoured (PLAN-126 F-9: never silently ignore). */\nexport function unsupportedOption(option: string, reason?: string): never {\n throw new LegacyUnsupportedError(\n `Option '${option}' is not supported by the @gmb/bitmark-parser legacy API` +\n (reason ? `: ${reason}` : \"\"),\n );\n}\n","// @zen-component: LEGACY-Facade\n// Central bpg-option → core-parameter translation table (PLAN-126 F-4/F-9).\n// Strict policy: options that map are honoured; options we cannot honour\n// throw a LegacyUnsupportedError naming the option. Sole exception:\n// `bitmarkParserType` is accepted and ignored — bpg v5.31.1 itself hardcodes\n// the peggy parser and ignores the option.\n\nimport { unsupportedOption } from \"./errors.js\";\nimport type { BitmarkOptions, JsonOptions } from \"./options.js\";\n\nconst V3_ONLY = \"bitmark v2 output is not supported (this parser is bitmark v3 only)\";\n\nexport function validateVersionOptions(opts: {\n bitmarkVersion?: number;\n bitmarkParserType?: string;\n}): void {\n if (opts.bitmarkVersion === 2) unsupportedOption(\"bitmarkVersion: 2\", V3_ONLY);\n // bitmarkParserType: accepted + ignored (documented exception).\n}\n\nexport function validateBitmarkOptions(o: BitmarkOptions): void {\n // The option TYPES are narrowed to the supported values (build-time\n // errors for TS consumers), but JS callers can still pass anything —\n // keep validating the runtime values (hence the widening casts).\n // Booleans error only when set truthy (false === bpg default behaviour).\n if (o.explicitTextFormat) unsupportedOption(\"bitmarkOptions.explicitTextFormat\");\n // prettifyJson: honoured — maps to the core's pretty/indent for bitmark\n // output (embedded JSON bodies of json-format bits); see prettyIndent().\n if ((o.cardSetVersion as number | undefined) === 1) {\n unsupportedOption(\"bitmarkOptions.cardSetVersion: 1\", V3_ONLY);\n }\n if (o.debugGenerationInline) unsupportedOption(\"bitmarkOptions.debugGenerationInline\");\n if (o.noBreakscaping) unsupportedOption(\"bitmarkOptions.noBreakscaping\");\n}\n\nexport function validateJsonOptions(o: JsonOptions): void {\n if (o.textAsPlainText) unsupportedOption(\"jsonOptions.textAsPlainText\", V3_ONLY);\n // excludeUnknownProperties: honoured — maps to the core's inverse\n // `includeUnknownProperties` flag (bpg default: include; see bpg-class).\n if (o.debugGenerationInline) unsupportedOption(\"jsonOptions.debugGenerationInline\");\n // enableWarnings: accepted — parser warnings are always carried in the\n // output envelope by this parser, so both values are honoured trivially.\n}\n\n/**\n * bpg `prettify?: boolean | number` → core (pretty, indent).\n *\n * Also used for `bitmarkOptions.prettifyJson` (identical bpg semantics:\n * true → indent 2, positive number → that indent, else off) — for bitmark\n * output the core's pretty/indent prettify the embedded JSON bodies of\n * json-format bits, which is exactly what bpg's prettifyJson did.\n */\nexport function prettyIndent(prettify: boolean | number | undefined): {\n pretty: boolean;\n indent: number;\n} {\n if (prettify === true) return { pretty: true, indent: 2 };\n if (typeof prettify === \"number\" && prettify > 0) return { pretty: true, indent: prettify };\n return { pretty: false, indent: 2 };\n}\n\n/** bpg `spacesAroundValues?: number | boolean` → core spaces count (cap 10, as bpg). */\nexport function spacesAround(v: number | boolean | undefined): number {\n if (v === undefined || v === true) return 1;\n if (v === false) return 0;\n return Math.max(0, Math.min(10, v));\n}\n\n/**\n * bpg text format value → core breakscape format.\n * bpg maps `latex`/`json`/`xml` as aliases of plain text, and defaults\n * anything else (including absent) to bitmark text (`bitmark++`).\n */\nexport function mapTextFormat(f: string | undefined): \"bitmark++\" | \"plainText\" {\n switch (f) {\n case \"text\":\n case \"latex\":\n case \"json\":\n case \"xml\":\n return \"plainText\";\n default:\n return \"bitmark++\";\n }\n}\n","// @zen-component: LEGACY-Facade\n// The legacy \"AST\" is bit JSON (PLAN-126 §3.1): an envelope of the parser's\n// wrapper entries (`{ bit, parser?, bitmark? }`), tagged with a\n// non-enumerable marker so it can be recognised without surviving\n// JSON.stringify. It round-trips through `convert`, but is NOT bpg's\n// internal TS AST node model (no `cardNode` / `BodyPart[]` structure).\n\nexport const PSEUDO_AST_MARKER = Symbol.for(\"@gmb/bitmark-parser/legacy-pseudo-ast\");\n\nexport interface LegacyPseudoAst {\n bits: unknown[];\n}\n\nexport function makePseudoAst(bits: unknown[]): LegacyPseudoAst {\n const ast: LegacyPseudoAst = { bits };\n Object.defineProperty(ast, PSEUDO_AST_MARKER, { value: true, enumerable: false });\n return ast;\n}\n\nexport function isPseudoAst(v: unknown): v is LegacyPseudoAst {\n return (\n v !== null &&\n typeof v === \"object\" &&\n (PSEUDO_AST_MARKER in v || Array.isArray((v as LegacyPseudoAst).bits))\n );\n}\n","// GENERATED FILE — do not edit.\n// Emitted by scripts/gen-legacy-resource-keys.mjs from\n// resources/bitmark-configurator/bitmark.json. Regenerate via `npm run init`.\n//\n// Every bit whose config maps a repeatable resource tag group onto a single\n// JSON collection key. The legacy `Builder.buildBit` routes bpg's\n// `resources` input onto this key (bpg's JsonGenerator special-cased the\n// same family by bit type; here it is derived from config).\n\n/** A bit's resource-collection mapping: target JSON key + accepted resource type. */\nexport interface ResourceCollection {\n key: string;\n resourceType: string;\n}\n\nexport const RESOURCE_COLLECTION_KEYS: Readonly<Record<string, ResourceCollection>> = {\n \"extractor-image\": { key: \"images\", resourceType: \"image\" },\n \"extractor-image-collapsible\": { key: \"images\", resourceType: \"image\" },\n \"images-logo-grave\": { key: \"logos\", resourceType: \"image\" },\n \"prototype-images\": { key: \"images\", resourceType: \"image\" },\n};\n","// @zen-component: LEGACY-Facade\n// bpg-compatible `Builder` (PLAN-126 §3.1): the legacy AST is bit JSON, so\n// building a bit is a data *mapping* (bpg buildBit data → bit JSON keys)\n// followed by one WASM json→json normalization pass — the config-driven core\n// performs the defaulting/coercion/validation that bpg's ~4.2k-line builder\n// does in TS. No parsing logic lives here.\n\nimport { getLegacyWasm } from \"./runtime.js\";\nimport { makePseudoAst, type LegacyPseudoAst } from \"./pseudo-ast.js\";\nimport { RESOURCE_COLLECTION_KEYS } from \"./generated/resource-collection-keys.js\";\nimport type { ParserError, ParserInfo } from \"./vendor/enums.js\";\n\n/** Carries bpg `data.parser` (wrapper-level metadata) invisibly on the built bit. */\nexport const BUILT_BIT_PARSER = Symbol.for(\"@gmb/bitmark-parser/legacy-built-bit-parser\");\n\n/**\n * bpg buildBit data keys whose bit-JSON key differs. Everything else in the\n * flat data object maps by identity (the data fields are already the bpg\n * JSON model types) and unknown keys pass through untouched (PLAN-126 F-6).\n */\nconst DATA_KEY_TO_JSON_KEY: Record<string, string> = {\n bitType: \"type\",\n textFormat: \"format\",\n flashcards: \"cards\",\n markConfig: \"marks\",\n};\n\n/** bpg deprecated text-format value accepted by buildBit. */\nconst DEPRECATED_TEXT_FORMATS: Record<string, string> = {\n \"bitmark--\": \"bitmark++\",\n \"bitmark+\": \"bitmark++\",\n};\n\n/**\n * Config `bodyFormat` → bpg TextFormat value. When the caller omits\n * `textFormat`, bpg defaults to the bit config's `textFormatDefault`\n * (bpg Builder.bit), which is derived from the config `bodyFormat` — NOT\n * to bitmark text. E.g. `extractor-information` (bodyFormat: json) built\n * without an explicit `textFormat` must keep its JSON body verbatim.\n */\nconst CONFIG_BODY_FORMAT_TO_TEXT_FORMAT: Record<string, string> = {\n bitmark: \"bitmark++\",\n text: \"text\",\n json: \"json\",\n latex: \"latex\",\n xml: \"xml\",\n};\n\n/** Top-level bit JSON fields typed JsonText (tag location) in bpg. */\nconst TAG_TEXT_KEYS = [\n \"title\",\n \"subtitle\",\n \"item\",\n \"lead\",\n \"pageNumber\",\n \"marginNumber\",\n \"hint\",\n \"instruction\",\n \"caption\",\n] as const;\n\nexport interface BuildBitOptions {\n cardSet?: {\n sideNo: number;\n variantNo: number;\n };\n}\n\nexport class Builder {\n /**\n * Build bitmark AST envelope (bpg-compatible `buildBitmark`).\n */\n buildBitmark(data: { bits?: unknown[]; errors?: ParserError[] }): LegacyPseudoAst {\n const ast = makePseudoAst(data.bits ?? []);\n if (data.errors !== undefined) {\n (ast as LegacyPseudoAst & { errors?: ParserError[] }).errors = data.errors;\n }\n return ast;\n }\n\n /**\n * Build a bit (bpg-compatible `buildBit`).\n *\n * Accepts the full bpg data shape (flat, ~250 optional fields, values in\n * the JSON model types). Returns the normalized bit JSON. Throws\n * `No config found for bit: X` for unknown bit types, as bpg does.\n *\n * NOTE (documented divergences from bpg):\n * - the return value is bit JSON, not bpg's internal AST node model;\n * - `resourceType` (an inference hint in bpg) is not carried into the\n * JSON — the attached `resource` object is authoritative.\n *\n * `resources` follows bpg's JsonGenerator routing: on a bit whose config\n * maps a repeatable resource tag group onto a collection key (e.g.\n * `images` / `logos` — see the generated RESOURCE_COLLECTION_KEYS), the\n * matching-type entries land under that key; on every other bit the first\n * entry becomes the canonical single `resource` (as bpg: \"if there is\n * more than one resource, use the first one\").\n */\n buildBit(data: Record<string, unknown>, _options?: BuildBitOptions): Record<string, unknown> {\n const wasm = getLegacyWasm();\n const src = { ...data };\n\n const bitType = src.bitType as string | undefined;\n const bitConfig = this.getBitConfig(bitType);\n\n // --- divergent keys ---\n const bit: Record<string, unknown> = {};\n bit.type = bitType;\n if (src.isCommented) {\n bit.type = \"_comment\";\n bit.originalType = bitType;\n }\n delete src.bitType;\n delete src.isCommented;\n\n const textFormat = src.textFormat as string | undefined;\n if (textFormat !== undefined) {\n bit.format = DEPRECATED_TEXT_FORMATS[textFormat] ?? textFormat;\n delete src.textFormat;\n } else {\n // bpg parity: `textFormat ?? bitConfig.textFormatDefault` — the\n // config-driven default, so e.g. JSON-bodied bits don't get their\n // body mangled by the bitmark text parser (see parseStringTexts).\n bit.format = CONFIG_BODY_FORMAT_TO_TEXT_FORMAT[bitConfig.bodyFormat ?? \"\"] ?? \"bitmark++\";\n }\n\n // resourceType is an inference hint only (see doc comment)\n delete src.resourceType;\n\n // body: accept bpg's Partial<Body> node ({ body: <JsonText> }) or a bare JsonText\n const body = src.body as { body?: unknown } | unknown;\n if (body !== undefined && body !== null && typeof body === \"object\" && \"body\" in (body as object)) {\n bit.body = (body as { body?: unknown }).body;\n delete src.body;\n }\n\n // example / __isDefaultExample → isExample + example (bpg toExample semantics)\n if (src.example !== undefined) {\n bit.isExample = true;\n bit.example = src.example;\n delete src.example;\n delete src.__isDefaultExample;\n } else if (src.__isDefaultExample) {\n bit.isExample = true;\n delete src.__isDefaultExample;\n }\n\n // resources → the bit's resource-collection key (config-derived), else\n // the canonical single `resource` — bpg's JsonGenerator routing.\n const resources = src.resources;\n if (resources !== undefined && bitType !== undefined) {\n const list = Array.isArray(resources) ? resources : [resources];\n const collection = RESOURCE_COLLECTION_KEYS[bitType];\n if (collection) {\n // bpg keeps only the entries of the collection's resource type.\n bit[collection.key] = list.filter(\n (r) =>\n r !== null &&\n typeof r === \"object\" &&\n (r as { type?: unknown }).type === collection.resourceType,\n );\n } else if (list.length >= 1) {\n bit.resource = list[0];\n }\n delete src.resources;\n }\n\n // parser metadata lives on the wrapper, not in the bit JSON\n const parser = src.parser as ParserInfo | undefined;\n delete src.parser;\n\n // extraProperties spread into the bit JSON top level (bpg semantics)\n const extraProperties = src.extraProperties as Record<string, unknown> | undefined;\n delete src.extraProperties;\n\n // --- renamed + identity + unknown keys (pass through, PLAN-126 F-6) ---\n for (const [key, value] of Object.entries(src)) {\n if (value === undefined) continue;\n bit[DATA_KEY_TO_JSON_KEY[key] ?? key] = value;\n }\n if (extraProperties) {\n for (const [key, value] of Object.entries(extraProperties)) {\n if (!(key in bit)) bit[key] = value;\n }\n }\n\n // --- bpg parity: string JsonText values are parsed bitmark text ---\n this.parseStringTexts(bit);\n\n // --- normalization pass: the config-driven core defaults/coerces/validates ---\n const out = wasm.convert(JSON.stringify([{ bit }]), \"json\", \"json\", \"optimized\", false, 2, 1, false, false, \"\", \"\");\n const entries = JSON.parse(out) as { bit: Record<string, unknown> }[];\n const built = entries[0]?.bit ?? bit;\n\n // F-6: keys the core doesn't know are dropped by the normalize pass —\n // re-attach them so nothing is lost silently. Values matching bpg's own\n // \"unset optional\" strip set (false / \"\" / [] / null) stay stripped,\n // mirroring bpg's removeUnwantedProperties.\n for (const [key, value] of Object.entries(bit)) {\n if (key in built) continue;\n if (\n value === false ||\n value === \"\" ||\n value === null ||\n (Array.isArray(value) && value.length === 0)\n ) {\n continue;\n }\n built[key] = value;\n }\n if (parser !== undefined) {\n Object.defineProperty(built, BUILT_BIT_PARSER, { value: parser, enumerable: false });\n }\n return built;\n }\n\n /**\n * Build a highlight body bit (bpg-compatible `buildHighlight`).\n * Shapes the HighlightJson body-bit; unset optionals are omitted.\n */\n buildHighlight(\n _context: unknown,\n data: Record<string, unknown> | undefined,\n ): Record<string, unknown> | undefined {\n if (!data) return undefined;\n const src = { ...data };\n // bpg: data may arrive nested under 'attrs' (when coming from JSON)\n const attrs = src.attrs as Record<string, unknown> | undefined;\n if (attrs) Object.assign(src, attrs);\n\n const texts = Array.isArray(src.texts)\n ? (src.texts as Record<string, unknown>[]).filter((t) => t != null).map((t) => ({\n text: t.text ?? \"\",\n isCorrect: t.isCorrect ?? false,\n isHighlighted: t.isHighlighted ?? false,\n ...stripUndefined(t, [\"text\", \"isCorrect\", \"isHighlighted\"]),\n }))\n : [];\n\n const node: Record<string, unknown> = {\n type: \"highlight\",\n texts,\n prefix: src.prefix ?? \"\",\n postfix: src.postfix ?? \"\",\n ...stripUndefined(src, [\"type\", \"texts\", \"prefix\", \"postfix\", \"attrs\"]),\n attrs: {},\n };\n return node;\n }\n\n /**\n * bpg's builder parses string-valued JsonText fields as bitmark text\n * (inline marks become TextAst marks); the composer would otherwise treat\n * them as literal text. Converts top-level JsonText fields in place.\n * Nested (card-content) strings are left literal — documented divergence.\n *\n * A string body is dispatched on the bit's resolved text format, as bpg's\n * buildBody: bitmark text is parsed to TextAst, `json` is JSON.parsed\n * (unparseable → null), and plain-text formats (text/latex/xml) stay\n * verbatim. Tag texts are always bitmark text, independent of body format\n * (bpg TextParser.toAst ignores format; only location matters).\n */\n private parseStringTexts(bit: Record<string, unknown>): void {\n const wasm = getLegacyWasm();\n const toAst = (s: string, location: \"body\" | \"tag\"): unknown => {\n if (s === \"\") return s;\n const out = wasm.convert_text(s, \"textToAst\", \"bitmark++\", location);\n try {\n return JSON.parse(out) as unknown;\n } catch {\n return s;\n }\n };\n\n const format = bit.format as string | undefined;\n const bitmarkBody = format === undefined || format === \"bitmark++\" || format === \"bitmark+\";\n if (typeof bit.body === \"string\") {\n if (format === \"json\") {\n // bpg handleJsonBody: parse legacy string bodies; null on failure\n try {\n bit.body = JSON.parse(bit.body) as unknown;\n } catch {\n bit.body = null;\n }\n } else if (bitmarkBody) {\n bit.body = toAst(bit.body, \"body\");\n }\n // plain-text formats (text/latex/xml): body stays a verbatim string\n }\n for (const key of TAG_TEXT_KEYS) {\n const v = bit[key];\n if (typeof v === \"string\") bit[key] = toAst(v, \"tag\");\n }\n }\n\n /**\n * Look up the bit's config (`wasm.info`); throws bpg's exact\n * bit-type-invalid error (`Config.getBitConfig` parity).\n */\n private getBitConfig(bitType: string | undefined): { bodyFormat?: string } {\n const wasm = getLegacyWasm();\n if (bitType !== undefined) {\n try {\n const info = JSON.parse(wasm.info(\"bit\", \"json\", bitType, false, 2, false, false, true, \"\")) as {\n error?: string;\n body?: { format?: string };\n };\n // PLAN-149 restructured the info JSON: bodyFormat now lives at\n // `body.format`; adapt to the legacy flat shape callers expect.\n if (info.error === undefined) return { bodyFormat: info.body?.format };\n } catch {\n // fall through to the not-found error\n }\n }\n throw new Error(`No config found for bit: ${bitType}`);\n }\n}\n\nfunction stripUndefined(\n src: Record<string, unknown>,\n exclude: string[],\n): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(src)) {\n if (v !== undefined && !exclude.includes(k)) out[k] = v;\n }\n return out;\n}\n","// @zen-component: LEGACY-Facade\n// bpg-compatible `BitmarkParserGenerator` class — a thin synchronous wrapper\n// over the WASM core (PLAN-126). Behavioural parity is at the call boundary:\n// same method names, option keys and return shapes as bpg v5.31.1.\n\nimport { PACKAGE_INFO } from \"../generated/package_info.js\";\nimport { unsupportedMember, unsupportedOption } from \"./errors.js\";\nimport { getLegacyFileIo, getLegacyWasm } from \"./runtime.js\";\nimport {\n mapTextFormat,\n prettyIndent,\n spacesAround,\n validateBitmarkOptions,\n validateJsonOptions,\n validateVersionOptions,\n} from \"./translate.js\";\nimport type {\n BreakscapeOptions,\n ConvertHtmlTableOptions,\n ConvertOptions,\n ConvertTextOptions,\n CreateAstOptions,\n ExtractPlainTextOptions,\n FileOptions,\n InfoOptions,\n UnbreakscapeOptions,\n UpgradeOptions,\n} from \"./options.js\";\nimport { makePseudoAst, type LegacyPseudoAst } from \"./pseudo-ast.js\";\nimport { BUILT_BIT_PARSER } from \"./builder.js\";\n\n/** Classified input for the convert/upgrade pipeline (PLAN-126 F-10). */\ninterface ResolvedInput {\n /** JSON-wrapper-array string (json/ast input) or bitmark source (bitmark input). */\n source: string;\n isBitmark: boolean;\n}\n\nexport class BitmarkParserGenerator {\n /**\n * Get the version of the library.\n *\n * Reports the @gmb/bitmark-parser version (not a bpg version string).\n */\n public version(): string {\n return PACKAGE_INFO.version;\n }\n\n /**\n * Convert bitmark from bitmark to JSON, or JSON to bitmark (bpg-compatible).\n *\n * Input detection order matches bpg: AST → JSON → assume bitmark.\n * Default output: bitmark input → json; json/ast input → bitmark.\n */\n public convert(input: string | unknown, options?: ConvertOptions): string | unknown | void {\n const opts: ConvertOptions = Object.assign({}, options);\n const jsonOptions = Object.assign({}, opts.jsonOptions);\n const bitmarkOptions = Object.assign({}, opts.bitmarkOptions);\n validateVersionOptions(opts);\n validateBitmarkOptions(bitmarkOptions);\n validateJsonOptions(jsonOptions);\n this.checkBrowserFileWrite(opts.outputFile);\n\n const wasm = getLegacyWasm();\n const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);\n\n const outputFormat = opts.outputFormat ?? (isBitmark ? \"json\" : \"bitmark\");\n const coreFormat = outputFormat === \"ast\" ? \"json\" : outputFormat;\n // bpg parity: `jsonOptions.prettify` governs JSON output only;\n // `bitmarkOptions.prettifyJson` governs bitmark output (it prettifies the\n // embedded JSON bodies of json-format bits — same boolean|number shape).\n const { pretty, indent } = prettyIndent(jsonOptions.prettify);\n const emit =\n coreFormat === \"bitmark\" ? prettyIndent(bitmarkOptions.prettifyJson) : { pretty, indent };\n const spaces = spacesAround(bitmarkOptions.spacesAroundValues);\n // bpg parity: unknown properties are included in JSON output unless\n // `jsonOptions.excludeUnknownProperties` is set (the core flag is the\n // inverse and only affects the bitmark → JSON direction).\n const includeUnknown = !jsonOptions.excludeUnknownProperties;\n\n const out = wasm.convert(source, isBitmark ? \"bitmark\" : \"json\", coreFormat, \"optimized\", emit.pretty, emit.indent, spaces, includeUnknown, false, \"\", \"\");\n\n // Shape the result per output format (bpg-compatible return shapes)\n if (outputFormat === \"bitmark\" || outputFormat === \"text\") {\n return this.deliver(out, opts.outputFile, opts.fileOptions);\n }\n if (outputFormat === \"json\") {\n if (opts.outputFile) return this.deliver(out, opts.outputFile, opts.fileOptions);\n if (pretty || jsonOptions.stringify) return out;\n return JSON.parse(out) as unknown;\n }\n // outputFormat === \"ast\": bit-JSON pseudo-AST (PLAN-126 §3.1)\n const ast = makePseudoAst(JSON.parse(out) as unknown[]);\n if (opts.outputFile) {\n return this.deliver(JSON.stringify(ast), opts.outputFile, opts.fileOptions);\n }\n return ast;\n }\n\n /**\n * Upgrade (prettify / canonicalize) bitmark or JSON to the latest version\n * of itself (bpg-compatible `upgrade`).\n */\n public upgrade(input: string | unknown, options?: UpgradeOptions): string | unknown | void {\n const opts: UpgradeOptions = Object.assign({}, options);\n const jsonOptions = Object.assign({}, opts.jsonOptions);\n const bitmarkOptions = Object.assign({}, opts.bitmarkOptions);\n validateVersionOptions(opts);\n validateBitmarkOptions(bitmarkOptions);\n validateJsonOptions(jsonOptions);\n this.checkBrowserFileWrite(opts.outputFile);\n\n const wasm = getLegacyWasm();\n const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);\n // Same routing as convert(): bitmark in → bitmark out, so prettifyJson\n // applies; JSON in → JSON out, so jsonOptions.prettify applies.\n const { pretty, indent } = prettyIndent(\n isBitmark ? bitmarkOptions.prettifyJson : jsonOptions.prettify,\n );\n const spaces = spacesAround(bitmarkOptions.spacesAroundValues);\n\n const out = wasm.canonicalize(source, isBitmark ? \"bitmark\" : \"json\", \"optimized\", pretty, indent, spaces);\n\n if (isBitmark) return this.deliver(out, opts.outputFile, opts.fileOptions);\n if (opts.outputFile) return this.deliver(out, opts.outputFile, opts.fileOptions);\n if (pretty || jsonOptions.stringify) return out;\n return JSON.parse(out) as unknown;\n }\n\n /**\n * Get information about the bitmark language (bpg-compatible `info`).\n */\n public info(options?: InfoOptions): unknown {\n const opts: InfoOptions = Object.assign({}, options);\n const wasm = getLegacyWasm();\n const type = opts.type ?? \"list\";\n const format = opts.outputFormat ?? \"text\";\n const { pretty, indent } = prettyIndent(opts.prettify);\n\n const coreFormat = format === \"pojo\" ? \"json\" : format;\n // full=true: the legacy facade keeps the rich info shape (bpg parity).\n // The legacy (bpg-compatible) surface is English-only by definition.\n const out = wasm.info(type, coreFormat, opts.bit ?? \"\", pretty, indent, false, false, true, \"\");\n if (format === \"pojo\") return JSON.parse(out) as unknown;\n return out;\n }\n\n /** Not supported: bpg-internal development tool. */\n public generateConfig(_options?: unknown): void {\n unsupportedMember(\"BitmarkParserGenerator.generateConfig\", \"bpg-internal development tool\");\n }\n\n /**\n * Convert between HTML tables and bitmark tables (bpg-compatible\n * `convertHtmlTable`).\n *\n * Backed by the core's schema-driven html mapping: HTML input has each\n * `<table>` wrapped in the core's `<bitmark-bit>` envelope and parsed;\n * bits input is emitted as html and the `<table>` fragments extracted\n * (the envelope stripped). The markup *inside* `<table>` follows this\n * parser's html mapping, which may differ from bpg's in detail.\n */\n public convertHtmlTable(\n input: string | unknown,\n options?: ConvertHtmlTableOptions,\n ): string | unknown | void {\n const opts: ConvertHtmlTableOptions = Object.assign({}, options);\n const jsonOptions = Object.assign({}, opts.jsonOptions);\n const bitmarkOptions = Object.assign({}, opts.bitmarkOptions);\n validateBitmarkOptions(bitmarkOptions);\n validateJsonOptions(jsonOptions);\n if (opts.keepUnknownTags) unsupportedOption(\"keepUnknownTags\");\n if (opts.noBreakscaping) unsupportedOption(\"noBreakscaping\");\n this.checkBrowserFileWrite(opts.outputFile);\n const wasm = getLegacyWasm();\n\n const inStr = typeof input === \"string\" ? this.maybeReadFile(input, undefined) : \"\";\n const isHtmlInput =\n opts.inputFormat === \"html\" ||\n (opts.inputFormat === undefined && typeof input === \"string\" && /<table[\\s>]/iu.test(inStr));\n\n if (!isHtmlInput) {\n // bits (bitmark / JSON / AST) → HTML `<table>` fragments\n const { source, isBitmark } = this.resolveInput(input, undefined);\n const out = wasm.convert(source, isBitmark ? \"bitmark\" : \"json\", \"html\", \"optimized\", false, 2, 1, false, false, \"\", \"\");\n return this.deliver(extractHtmlTables(out).join(\"\\n\"), opts.outputFile, opts.fileOptions);\n }\n\n // HTML input: wrap each <table> in the core's bit envelope and parse\n const bitType = opts.tableFormat === \"table\" ? \"table\" : \"table-extended\";\n const wrapped = extractHtmlTables(inStr)\n .map((t) => `<bitmark-bit data-type=\"${bitType}\" data-format=\"bitmark++\">${t}</bitmark-bit>`)\n .join(\"\");\n const outputFormat = opts.outputFormat ?? \"bitmark\";\n const { pretty, indent } = prettyIndent(jsonOptions.prettify);\n const spaces = spacesAround(bitmarkOptions.spacesAroundValues);\n\n if (outputFormat === \"html\") {\n const out = wasm.convert(wrapped, \"html\", \"html\", \"optimized\", false, 2, 1, false, false, \"\", \"\");\n return this.deliver(extractHtmlTables(out).join(\"\\n\"), opts.outputFile, opts.fileOptions);\n }\n const coreFormat = outputFormat === \"ast\" ? \"json\" : outputFormat;\n const out = wasm.convert(wrapped, \"html\", coreFormat, \"optimized\", pretty, indent, spaces, false, false, \"\", \"\");\n if (outputFormat === \"bitmark\" || outputFormat === \"text\") {\n return this.deliver(out, opts.outputFile, opts.fileOptions);\n }\n if (outputFormat === \"json\") {\n if (opts.outputFile) return this.deliver(out, opts.outputFile, opts.fileOptions);\n if (pretty || jsonOptions.stringify) return out;\n return JSON.parse(out) as unknown;\n }\n const ast = makePseudoAst(JSON.parse(out) as unknown[]);\n if (opts.outputFile) return this.deliver(JSON.stringify(ast), opts.outputFile, opts.fileOptions);\n return ast;\n }\n\n /**\n * Create a bit-JSON pseudo-AST from bitmark or JSON input (PLAN-126 §3.1).\n *\n * NOTE: the returned structure is the bit JSON (wrapper entries), not\n * bpg's internal TS AST node model. It round-trips through `convert` but\n * is not walkable with bpg's `Ast`/`NodeType`.\n */\n public createAst(input: unknown, options?: CreateAstOptions): LegacyPseudoAst {\n const opts: CreateAstOptions = Object.assign({}, options);\n const wasm = getLegacyWasm();\n const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);\n // bpg's AST carries extraProperties unconditionally (createAst has no\n // jsonOptions), so unknown properties are always included here.\n const out = wasm.convert(source, isBitmark ? \"bitmark\" : \"json\", \"json\", \"optimized\", false, 2, 1, true, false, \"\", \"\");\n return makePseudoAst(JSON.parse(out) as unknown[]);\n }\n\n /**\n * Breakscape text (bpg-compatible `breakscapeText`).\n */\n public breakscapeText(input: string, options?: BreakscapeOptions): string | void {\n if (!input) return input;\n const opts: BreakscapeOptions = Object.assign({}, options);\n this.checkBrowserFileWrite(opts.outputFile);\n const wasm = getLegacyWasm();\n const inStr = this.maybeReadFile(input, opts.inputFormat);\n const res = wasm.breakscape_text(inStr, mapTextFormat(opts.textFormat), opts.textLocation ?? \"body\");\n return this.deliver(res, opts.outputFile, opts.fileOptions);\n }\n\n /**\n * Unbreakscape text (bpg-compatible `unbreakscapeText`).\n */\n public unbreakscapeText(input: string, options?: UnbreakscapeOptions): string | void {\n if (!input) return input;\n const opts: UnbreakscapeOptions = Object.assign({}, options);\n this.checkBrowserFileWrite(opts.outputFile);\n const wasm = getLegacyWasm();\n const inStr = this.maybeReadFile(input, opts.inputFormat);\n const res = wasm.unbreakscape_text(inStr, mapTextFormat(opts.textFormat), opts.textLocation ?? \"body\");\n return this.deliver(res, opts.outputFile, opts.fileOptions);\n }\n\n /**\n * Convert bitmark text ↔ text AST (bpg-compatible `convertText`).\n *\n * Direction is auto-detected: TextAst (JSON) input generates bitmark\n * text; anything else parses as bitmark text and returns the TextAst\n * (plain JS object; a string when `jsonOptions.prettify` is set).\n */\n public convertText(input: string | unknown, options?: ConvertTextOptions): string | unknown | void {\n const opts: ConvertTextOptions = Object.assign({}, options);\n const jsonOptions = Object.assign({}, opts.jsonOptions);\n this.checkBrowserFileWrite(opts.outputFile);\n const wasm = getLegacyWasm();\n\n const isBitmarkText = opts.textFormat === undefined || mapTextFormat(opts.textFormat) === \"bitmark++\";\n const textLocation = opts.textLocation ?? \"body\";\n\n let inStr: string;\n let ast: unknown[] | undefined;\n if (typeof input === \"string\") {\n inStr = this.maybeReadFile(input, opts.inputFormat);\n ast = this.parseTextAstString(inStr);\n } else {\n inStr = JSON.stringify(input);\n ast = Array.isArray(input) ? input : undefined;\n }\n\n if (ast !== undefined) {\n // TextAst → text (reverse honours the location; a plain-text format\n // generates plain text, i.e. marks are dropped — bpg parity)\n const out = isBitmarkText\n ? wasm.convert_text(JSON.stringify(ast), \"astToText\", \"bitmark++\", textLocation)\n : wasm.convert_text(JSON.stringify(ast), \"astToPlainText\", \"plainText\", textLocation);\n return this.deliver(out, opts.outputFile, opts.fileOptions);\n }\n\n // text → TextAst (bpg parses forward at body location)\n const out = wasm.convert_text(inStr, \"textToAst\", isBitmarkText ? \"bitmark++\" : \"plainText\", \"body\");\n const { pretty, indent } = prettyIndent(jsonOptions.prettify);\n const outStr = pretty ? wasm.prettify(out, indent) : out;\n if (opts.outputFile) return this.deliver(outStr, opts.outputFile, opts.fileOptions);\n if (pretty) return outStr;\n return JSON.parse(out) as unknown;\n }\n\n /**\n * Convert a text AST to plain text (bpg-compatible `textAstToPlainText`).\n */\n public textAstToPlainText(textAst: unknown, _options?: ExtractPlainTextOptions): string {\n const wasm = getLegacyWasm();\n const out = wasm.convert_text(\n typeof textAst === \"string\" ? textAst : JSON.stringify(textAst),\n \"astToPlainText\",\n \"bitmark++\",\n \"body\",\n );\n return out;\n }\n\n /**\n * Extract plain text from bitmark or bitmark JSON (bpg-compatible).\n */\n public extractPlainText(input: string | unknown, options?: ExtractPlainTextOptions): string {\n const inputFormat = options?.inputFormat;\n const wasm = getLegacyWasm();\n if (inputFormat === \"plainText\") {\n return typeof input === \"string\" ? String(input) : \"\";\n }\n if (inputFormat === \"bitmarkText\") {\n const ast = wasm.convert_text(String(input), \"textToAst\", \"bitmark++\", \"body\");\n const out = wasm.convert_text(ast, \"astToPlainText\", \"bitmark++\", \"body\");\n return out;\n }\n if (typeof input === \"string\" && this.parseTextAstString(input) === undefined && !wasm.is_bitmark(input)) {\n // Neither JSON nor bitmark: bpg falls through to bitmark text\n const looksJson = ((): boolean => {\n try {\n JSON.parse(input);\n return true;\n } catch {\n return false;\n }\n })();\n if (!looksJson) {\n return this.extractPlainText(input, { inputFormat: \"bitmarkText\" });\n }\n }\n const { source, isBitmark } = this.resolveInput(input, undefined);\n const out = wasm.convert(source, isBitmark ? \"bitmark\" : \"json\", \"text\", \"optimized\", false, 2, 1, false, false, \"\", \"\");\n return out;\n }\n\n /** If `s` parses as a TextAst JSON array, return it. */\n private parseTextAstString(s: string): unknown[] | undefined {\n const t = s.trim();\n if (!t.startsWith(\"[\")) return undefined;\n try {\n const v = JSON.parse(t) as unknown;\n if (Array.isArray(v) && v.every((n) => n !== null && typeof n === \"object\" && \"type\" in n)) {\n return v;\n }\n } catch {\n // not JSON\n }\n return undefined;\n }\n\n // ------------------------------------------------------------------\n // Internal helpers\n // ------------------------------------------------------------------\n\n /**\n * Resolve bpg input (string | file path | JSON value | pseudo-AST) to a\n * source string for the WASM core, classified per bpg's detection order:\n * AST → JSON → assume bitmark (PLAN-126 F-10).\n */\n protected resolveInput(input: unknown, inputFormat: string | undefined): ResolvedInput {\n if (typeof input !== \"string\") {\n // Parsed JSON / pseudo-AST value.\n const entries = this.jsonEntries(input);\n return {\n source: JSON.stringify(entries ? entries.map((b) => this.toWrapperEntry(b)) : input),\n isBitmark: false,\n };\n }\n const inStr = this.maybeReadFile(input, inputFormat);\n const wasm = getLegacyWasm();\n if (wasm.is_bitmark(inStr)) return { source: inStr, isBitmark: true };\n // JSON-ish: normalise loose shapes (AST envelope, single wrapper, bare bit)\n try {\n const parsed = JSON.parse(inStr) as unknown;\n const entries = this.jsonEntries(parsed);\n if (entries) {\n return {\n source: JSON.stringify(entries.map((b) => this.toWrapperEntry(b))),\n isBitmark: false,\n };\n }\n } catch {\n // is_bitmark said \"not bitmark\" but it is not JSON either —\n // fall through and let the core's own detection handle it (bpg\n // behaviour: assume bitmark).\n return { source: inStr, isBitmark: true };\n }\n return { source: inStr, isBitmark: false };\n }\n\n /**\n * Normalise the JSON shapes bpg accepts to a bits/entries array:\n * wrapper array, `{ bits: [...] }` AST envelope, single `{ bit: ... }`\n * wrapper, or a bare bit object (`{ type: ... }`).\n */\n private jsonEntries(v: unknown): unknown[] | undefined {\n if (Array.isArray(v)) return v;\n if (v !== null && typeof v === \"object\") {\n const o = v as Record<string, unknown>;\n if (Array.isArray(o.bits)) return o.bits;\n if (\"bit\" in o) return [o];\n if (typeof o.type === \"string\") return [{ bit: o }];\n }\n return undefined;\n }\n\n /**\n * Normalise a pseudo-AST bits entry to a `{ bit, parser? }` wrapper.\n * `Builder.buildBit` returns bare bit JSON (with any parser metadata\n * attached under a non-enumerable symbol); parsed forward output is\n * already wrapper-shaped.\n */\n private toWrapperEntry(entry: unknown): unknown {\n if (entry !== null && typeof entry === \"object\" && \"bit\" in (entry as object)) return entry;\n const wrapper: { bit: unknown; parser?: unknown } = { bit: entry };\n const parser = (entry as Record<symbol, unknown> | null)?.[BUILT_BIT_PARSER];\n if (parser !== undefined) wrapper.parser = parser;\n return wrapper;\n }\n\n /** bpg parity: read `input` as a file when it names one (Node only). */\n protected maybeReadFile(input: string, inputFormat: string | undefined): string {\n if (inputFormat === \"string\") return input;\n const io = getLegacyFileIo();\n if (!io) return input;\n try {\n if (io.existsSync(input)) return io.readFileSync(input, \"utf8\");\n } catch {\n // treat as literal input\n }\n return input;\n }\n\n /** bpg parity: writing a file is impossible in the browser. */\n protected checkBrowserFileWrite(outputFile: string | undefined): void {\n if (outputFile && !getLegacyFileIo()) {\n throw new Error(\"Cannot write to file in browser environment\");\n }\n }\n\n /** Return `data`, or write it to `outputFile` (returning void), as bpg does. */\n protected deliver(data: string, outputFile?: string, fileOptions?: FileOptions): string | void {\n if (!outputFile) return data;\n const io = getLegacyFileIo();\n if (!io) throw new Error(\"Cannot write to file in browser environment\");\n io.writeFile(outputFile, data, {\n append: fileOptions?.append,\n encoding: fileOptions?.encoding ?? \"utf8\",\n });\n }\n\n}\n\n/**\n * Extract every top-level `<table>…</table>` fragment from `html`\n * (case-insensitive, nesting-safe). Pure string scanning — no HTML parsing.\n */\nfunction extractHtmlTables(html: string): string[] {\n const tables: string[] = [];\n const lower = html.toLowerCase();\n let i = 0;\n for (;;) {\n const start = lower.indexOf(\"<table\", i);\n if (start === -1) break;\n let depth = 0;\n let j = start;\n let end = -1;\n while (j < html.length) {\n const open = lower.indexOf(\"<table\", j);\n const close = lower.indexOf(\"</table\", j);\n if (close === -1) break;\n if (open !== -1 && open < close) {\n depth++;\n j = open + \"<table\".length;\n } else {\n depth--;\n const closeEnd = lower.indexOf(\">\", close);\n j = closeEnd === -1 ? html.length : closeEnd + 1;\n if (depth === 0) {\n end = j;\n break;\n }\n }\n }\n if (end === -1) break;\n tables.push(html.slice(start, end));\n i = end;\n }\n return tables;\n}\n\n/**\n * Direct bitmark text parser (bpg-compatible `bitmarkTextParse`):\n * bitmark text → TextAst array.\n */\nexport function bitmarkTextParse(text: string): unknown[] {\n const out = getLegacyWasm().convert_text(text, \"textToAst\", \"bitmark++\", \"body\");\n return JSON.parse(out) as unknown[];\n}\n","// @zen-component: LEGACY-Facade\n// bpg-compatible `ResourceBuilder` (PLAN-126 §3.1): each method shapes the\n// `{ type, <family>: { ... } }` ResourceJson wrapper from bpg's flat data.\n// One generic table-driven implementation — per-bit-type defaulting and\n// URL-derived cosmetics are left to the config-driven core, which normalizes\n// the resource when the bit containing it is converted.\n\ninterface ResourceSpec {\n /** ResourceJson discriminator (`type`). */\n type: string;\n /** Family key holding the resource data object. */\n key: string;\n /** JSON field that bpg's `data.value` maps to. */\n valueField: \"src\" | \"url\" | \"body\";\n}\n\nconst RESOURCE_SPECS = {\n imageResource: { type: \"image\", key: \"image\", valueField: \"src\" },\n imageLinkResource: { type: \"image-link\", key: \"imageLink\", valueField: \"url\" },\n audioResource: { type: \"audio\", key: \"audio\", valueField: \"src\" },\n audioEmbedResource: { type: \"audio-embed\", key: \"audioEmbed\", valueField: \"src\" },\n audioLinkResource: { type: \"audio-link\", key: \"audioLink\", valueField: \"url\" },\n videoResource: { type: \"video\", key: \"video\", valueField: \"src\" },\n videoEmbedResource: { type: \"video-embed\", key: \"videoEmbed\", valueField: \"url\" },\n videoLinkResource: { type: \"video-link\", key: \"videoLink\", valueField: \"url\" },\n stillImageFilmEmbedResource: {\n type: \"still-image-film-embed\",\n key: \"stillImageFilmEmbed\",\n valueField: \"url\",\n },\n stillImageFilmLinkResource: {\n type: \"still-image-film-link\",\n key: \"stillImageFilmLink\",\n valueField: \"url\",\n },\n articleResource: { type: \"article\", key: \"article\", valueField: \"body\" },\n documentResource: { type: \"document\", key: \"document\", valueField: \"url\" },\n documentEmbedResource: { type: \"document-embed\", key: \"documentEmbed\", valueField: \"url\" },\n documentLinkResource: { type: \"document-link\", key: \"documentLink\", valueField: \"url\" },\n documentDownloadResource: {\n type: \"document-download\",\n key: \"documentDownload\",\n valueField: \"url\",\n },\n appLinkResource: { type: \"app-link\", key: \"appLink\", valueField: \"url\" },\n websiteLinkResource: { type: \"website-link\", key: \"websiteLink\", valueField: \"url\" },\n} as const satisfies Record<string, ResourceSpec>;\n\nexport type ResourceMethod = (\n context: unknown,\n data: Record<string, unknown> | undefined,\n __typeAlias?: string,\n) => Record<string, unknown> | undefined;\n\nfunction buildResource(spec: ResourceSpec): ResourceMethod {\n return (_context, data, _typeAlias) => {\n if (!data) return undefined;\n const { value, ...rest } = data;\n const inner: Record<string, unknown> = { [spec.valueField]: value ?? \"\" };\n for (const [k, v] of Object.entries(rest)) {\n if (v !== undefined) inner[k] = v;\n }\n return { type: spec.type, [spec.key]: inner };\n };\n}\n\n/** Resource `type` string → spec (for the generic wrapper/data entry points). */\nconst SPEC_BY_TYPE: Record<string, ResourceSpec> = Object.fromEntries(\n Object.values(RESOURCE_SPECS).map((s) => [s.type, s]),\n);\n\n/** bpg-compatible ResourceBuilder: 17 `<family>Resource(context, data)` methods\n * plus the generic `resourceFromResourceJson` / `resourceFromResourceDataJson`. */\nexport class ResourceBuilder {\n /**\n * Normalise existing ResourceJson wrapper(s) (bpg-compatible).\n * Unknown resource types are dropped (bpg parity: it skips invalid types).\n */\n resourceFromResourceJson(\n _context: unknown,\n resource?: Record<string, unknown> | Record<string, unknown>[],\n ): unknown {\n if (!resource) return undefined;\n const single = !Array.isArray(resource);\n const list = single ? [resource as Record<string, unknown>] : resource;\n const nodes: Record<string, unknown>[] = [];\n for (const wrapper of list) {\n const spec = SPEC_BY_TYPE[wrapper.type as string];\n if (!spec) continue;\n const inner = (wrapper[spec.key] ?? {}) as Record<string, unknown>;\n const { [spec.valueField]: value, ...rest } = inner;\n const built = buildResource(spec)(undefined, { value, ...rest });\n if (built) nodes.push(built);\n }\n if (nodes.length === 0) return undefined;\n return single ? nodes[0] : nodes;\n }\n\n /**\n * Build a resource wrapper from a bare ResourceDataJson (bpg-compatible).\n * `data` may also be a plain string (used as the url/src/body value).\n */\n resourceFromResourceDataJson(\n context: unknown,\n type: string,\n data?: Record<string, unknown> | string,\n ): Record<string, unknown> | undefined {\n if (!data) return undefined;\n const spec = SPEC_BY_TYPE[type];\n if (!spec) return undefined;\n const asString = typeof data === \"string\" ? data : undefined;\n const obj = typeof data === \"object\" ? data : {};\n const { url, src, body, ...rest } = obj as {\n url?: unknown;\n src?: unknown;\n body?: unknown;\n [k: string]: unknown;\n };\n const value = url ?? src ?? body ?? asString;\n return buildResource(spec)(context, { value, ...rest });\n }\n imageResource: ResourceMethod = buildResource(RESOURCE_SPECS.imageResource);\n imageLinkResource: ResourceMethod = buildResource(RESOURCE_SPECS.imageLinkResource);\n audioResource: ResourceMethod = buildResource(RESOURCE_SPECS.audioResource);\n audioEmbedResource: ResourceMethod = buildResource(RESOURCE_SPECS.audioEmbedResource);\n audioLinkResource: ResourceMethod = buildResource(RESOURCE_SPECS.audioLinkResource);\n videoResource: ResourceMethod = buildResource(RESOURCE_SPECS.videoResource);\n videoEmbedResource: ResourceMethod = buildResource(RESOURCE_SPECS.videoEmbedResource);\n videoLinkResource: ResourceMethod = buildResource(RESOURCE_SPECS.videoLinkResource);\n stillImageFilmEmbedResource: ResourceMethod = buildResource(\n RESOURCE_SPECS.stillImageFilmEmbedResource,\n );\n stillImageFilmLinkResource: ResourceMethod = buildResource(\n RESOURCE_SPECS.stillImageFilmLinkResource,\n );\n articleResource: ResourceMethod = buildResource(RESOURCE_SPECS.articleResource);\n documentResource: ResourceMethod = buildResource(RESOURCE_SPECS.documentResource);\n documentEmbedResource: ResourceMethod = buildResource(RESOURCE_SPECS.documentEmbedResource);\n documentLinkResource: ResourceMethod = buildResource(RESOURCE_SPECS.documentLinkResource);\n documentDownloadResource: ResourceMethod = buildResource(\n RESOURCE_SPECS.documentDownloadResource,\n );\n appLinkResource: ResourceMethod = buildResource(RESOURCE_SPECS.appLinkResource);\n websiteLinkResource: ResourceMethod = buildResource(RESOURCE_SPECS.websiteLinkResource);\n}\n","// @zen-component: LEGACY-Facade\n// bpg-compatible enum objects and option interfaces (vendored from\n// bitmark-parser-generator v5.31.1, superenum EnumType<> replaced with the\n// equivalent value-union derivation). Exposed ONLY via the `legacy`\n// namespace / subpath — never re-exported at the package root.\n\n/** @internal */\ntype EnumType<T> = T[keyof T];\n\n/** Input type enumeration */\nexport const Input = {\n /** Input is as a string */\n string: \"string\",\n /** Input is as a file path */\n file: \"file\",\n} as const;\nexport type InputType = EnumType<typeof Input>;\n\n/** Output type enumeration */\nexport const Output = {\n /** Output bitmark string */\n bitmark: \"bitmark\",\n /** Output JSON as a plain JS object, or a file */\n json: \"json\",\n /** Output AST as a plain JS object, or a file */\n ast: \"ast\",\n /** Output plain text as a string, or a file */\n text: \"text\",\n} as const;\nexport type OutputType = EnumType<typeof Output>;\n\n/** Input format enumeration */\nexport const InputFormat = {\n bitmark: \"bitmark\",\n bitmarkText: \"bitmarkText\",\n plainText: \"plainText\",\n html: \"html\",\n} as const;\nexport type InputFormatType = EnumType<typeof InputFormat>;\n\nexport const BitmarkVersion = {\n v2: 2,\n v3: 3,\n} as const;\nexport type BitmarkVersionType = EnumType<typeof BitmarkVersion>;\n\nexport const CardSetVersion = {\n v1: 1,\n v2: 2,\n} as const;\nexport type CardSetVersionType = EnumType<typeof CardSetVersion>;\n\nexport const BitmarkParserType = {\n peggy: \"peggy\",\n} as const;\nexport type BitmarkParserTypeType = EnumType<typeof BitmarkParserType>;\n\nexport const InfoType = {\n list: \"list\",\n deprecated: \"deprecated\",\n all: \"all\",\n bit: \"bit\",\n} as const;\nexport type InfoTypeType = EnumType<typeof InfoType>;\n\nexport const InfoFormat = {\n text: \"text\",\n json: \"json\",\n pojo: \"pojo\",\n} as const;\nexport type InfoFormatType = EnumType<typeof InfoFormat>;\n\nexport const BodyTextFormat = {\n plainText: \"text\",\n latex: \"latex\",\n json: \"json\",\n xml: \"xml\",\n bitmarkPlusPlus: \"bitmark++\",\n} as const;\nexport type BodyTextFormatType = EnumType<typeof BodyTextFormat>;\n\nexport const TextLocation = {\n tag: \"tag\",\n body: \"body\",\n cardBody: \"cardBody\",\n} as const;\nexport type TextLocationType = EnumType<typeof TextLocation>;\n\n/** Options for the output file (Node only) */\nexport interface FileOptions {\n /** Append to a file if true, otherwise overwrite */\n append?: boolean;\n /** Character encoding, defaults to 'utf8' */\n encoding?: string;\n}\n\n// Strict option policy, surfaced at BUILD time (bpg declared these wider):\n// options this facade cannot honour are narrowed to their supported value(s)\n// — truthy-throws booleans to `false`, value-gated enums to the supported\n// literal — so TS consumers get a type error instead of only the runtime\n// LegacyUnsupportedError. The runtime validation stays (JS callers, or TS\n// with the type ignored, still get the loud error).\n\n/** Options for bitmark generation */\nexport interface BitmarkOptions {\n /** Not supported — `true` throws `LegacyUnsupportedError` at runtime. */\n explicitTextFormat?: false;\n prettifyJson?: boolean | number;\n /** bitmark v3 only — card set version `1` throws `LegacyUnsupportedError` at runtime. */\n cardSetVersion?: typeof CardSetVersion.v2;\n spacesAroundValues?: number | boolean;\n /** Not supported — `true` throws `LegacyUnsupportedError` at runtime. */\n debugGenerationInline?: false;\n /** Not supported — `true` throws `LegacyUnsupportedError` at runtime. */\n noBreakscaping?: false;\n}\n\n/** Options for JSON generation */\nexport interface JsonOptions {\n enableWarnings?: boolean | number;\n prettify?: boolean | number;\n stringify?: boolean;\n /** bitmark v3 only — `true` throws `LegacyUnsupportedError` at runtime. */\n textAsPlainText?: false;\n /**\n * Exclude unknown properties from the JSON output (default: `false` —\n * unknown properties are included, as bpg). The parser's warning text\n * references the new API's inverse flag (`includeUnknownProperties`).\n */\n excludeUnknownProperties?: boolean;\n /** Not supported — `true` throws `LegacyUnsupportedError` at runtime. */\n debugGenerationInline?: false;\n}\n\n/** Options for bitmark text JSON generation */\nexport interface TextJsonOptions {\n prettify?: boolean | number;\n}\n\n/** Info options for the parser */\nexport interface InfoOptions {\n type?: InfoTypeType;\n bit?: string;\n outputFormat?: InfoFormatType;\n prettify?: boolean | number;\n}\n\n/** Conversion options for bitmark / JSON conversion */\nexport interface ConvertOptions {\n /** bitmark v3 only — version `2` throws `LegacyUnsupportedError` at runtime. */\n bitmarkVersion?: typeof BitmarkVersion.v3;\n bitmarkParserType?: BitmarkParserTypeType;\n inputFormat?: InputType;\n outputFormat?: OutputType;\n outputFile?: string;\n fileOptions?: FileOptions;\n bitmarkOptions?: BitmarkOptions;\n jsonOptions?: JsonOptions;\n}\n\n/** Prettify options for bitmark / JSON prettify / validate */\nexport interface UpgradeOptions {\n /** bitmark v3 only — version `2` throws `LegacyUnsupportedError` at runtime. */\n bitmarkVersion?: typeof BitmarkVersion.v3;\n bitmarkParserType?: BitmarkParserTypeType;\n inputFormat?: InputType;\n outputFile?: string;\n fileOptions?: FileOptions;\n bitmarkOptions?: BitmarkOptions;\n jsonOptions?: JsonOptions;\n}\n\n/** Conversion options for bitmark text / JSON conversion */\nexport interface ConvertTextOptions {\n textFormat?: BodyTextFormatType;\n textLocation?: TextLocationType;\n inputFormat?: InputType;\n outputFile?: string;\n fileOptions?: FileOptions;\n jsonOptions?: TextJsonOptions;\n}\n\n/** Create AST options */\nexport interface CreateAstOptions {\n inputFormat?: InputType;\n}\n\nexport interface ExtractPlainTextOptions {\n inputFormat?: InputFormatType;\n}\n\n/** Options for convertHtmlTable */\nexport interface ConvertHtmlTableOptions {\n inputFormat?: InputFormatType;\n outputFormat?: OutputType | \"html\";\n tableFormat?: string;\n keepUnknownTags?: boolean;\n /** Not supported — `true` throws `LegacyUnsupportedError` at runtime. */\n noBreakscaping?: false;\n outputFile?: string;\n fileOptions?: FileOptions;\n bitmarkOptions?: BitmarkOptions;\n jsonOptions?: JsonOptions;\n}\n\n/** Breakscape options */\nexport interface BreakscapeOptions {\n inputFormat?: InputType;\n outputFile?: string;\n fileOptions?: FileOptions;\n textFormat?: BodyTextFormatType;\n textLocation?: TextLocationType;\n}\n\n/** Unbreakscape options */\nexport interface UnbreakscapeOptions {\n inputFormat?: InputType;\n outputFile?: string;\n fileOptions?: FileOptions;\n textFormat?: BodyTextFormatType;\n textLocation?: TextLocationType;\n}\n","// @zen-component: LEGACY-Facade\n// Remaining bpg enum exports: TextMarkType / TextNodeType (vendored values),\n// BitType (built lazily from the config-driven core — never a hardcoded bit\n// list), and throwing proxies for enums tied to unsupported internals.\n\nimport { unsupportedMember } from \"./errors.js\";\nimport { getLegacyWasm } from \"./runtime.js\";\n\n/** Vendored from bpg v5.31.1 model/enum/TextMarkType.ts. */\nexport const TextMarkType = {\n bold: \"bold\",\n light: \"light\",\n italic: \"italic\",\n highlight: \"highlight\",\n highlightOrange: \"highlightOrange\",\n highlightYellow: \"highlightYellow\",\n highlightGreen: \"highlightGreen\",\n highlightBlue: \"highlightBlue\",\n highlightPurple: \"highlightPurple\",\n highlightPink: \"highlightPink\",\n highlightBrown: \"highlightBrown\",\n highlightBlack: \"highlightBlack\",\n highlightWhite: \"highlightWhite\",\n highlightGray: \"highlightGray\",\n strike: \"strike\",\n subscript: \"subscript\",\n superscript: \"superscript\",\n ins: \"ins\",\n del: \"del\",\n underline: \"underline\",\n doubleUnderline: \"doubleUnderline\",\n circle: \"circle\",\n languageEmRed: \"languageEmRed\",\n languageEmOrange: \"languageEmOrange\",\n languageEmYellow: \"languageEmYellow\",\n languageEmGreen: \"languageEmGreen\",\n languageEmBlue: \"languageEmBlue\",\n languageEmPurple: \"languageEmPurple\",\n languageEmPink: \"languageEmPink\",\n languageEmBrown: \"languageEmBrown\",\n languageEmBlack: \"languageEmBlack\",\n languageEmWhite: \"languageEmWhite\",\n languageEmGray: \"languageEmGray\",\n languageEm: \"languageEm\",\n userUnderline: \"userUnderline\",\n userDoubleUnderline: \"userDoubleUnderline\",\n userStrike: \"userStrike\",\n userCircle: \"userCircle\",\n userHighlight: \"userHighlight\",\n notranslate: \"notranslate\",\n link: \"link\",\n ref: \"ref\",\n xref: \"xref\",\n extref: \"extref\",\n footnote: \"footnote\",\n footnoteStar: \"footnote*\",\n symbol: \"symbol\",\n var: \"var\",\n code: \"code\",\n timer: \"timer\",\n duration: \"duration\",\n color: \"color\",\n colorPicker: \"colorPicker\",\n comment: \"comment\",\n} as const;\n\n/** Vendored from bpg v5.31.1 model/enum/TextNodeType.ts. */\nexport const TextNodeType = {\n text: \"text\",\n hardBreak: \"hardBreak\",\n paragraph: \"paragraph\",\n heading: \"heading\",\n section: \"section\",\n noBulletList: \"noBulletList\",\n bulletList: \"bulletList\",\n orderedList: \"orderedList\",\n orderedListRoman: \"orderedListRoman\",\n orderedListRomanLower: \"orderedListRomanLower\",\n letteredList: \"letteredList\",\n letteredListLower: \"letteredListLower\",\n taskList: \"taskList\",\n listItem: \"listItem\",\n taskItem: \"taskItem\",\n image: \"image\",\n imageInline: \"imageInline\",\n codeBlock: \"codeBlock\",\n latex: \"latex\",\n gap: \"gap\",\n select: \"select\",\n highlight: \"highlight\",\n mark: \"mark\",\n} as const;\n\n/** bpg key derivation: kebab-case bit name → camelCase enum key. */\nfunction bitNameToKey(name: string): string {\n return name.replace(/-([a-z0-9])/gu, (_, c: string) => c.toUpperCase());\n}\n\nlet bitTypeCache: Record<string, string> | undefined;\n\nfunction loadBitTypes(): Record<string, string> {\n if (!bitTypeCache) {\n const wasm = getLegacyWasm();\n // includeDeprecated: bpg's BitType enum carries the deprecated bit\n // types too (PLAN-149 hides them from listings by default).\n const all = JSON.parse(wasm.info(\"all\", \"json\", \"\", false, 2, true, false, false, \"\")) as {\n name: string;\n }[];\n const map: Record<string, string> = { _standard: \"_standard\" };\n for (const { name } of all) {\n map[bitNameToKey(name)] = name;\n }\n bitTypeCache = map;\n }\n return bitTypeCache;\n}\n\n/**\n * bpg-compatible `BitType` enum object, built lazily from the core's\n * config (`info`) rather than a hardcoded list. Keys are the camelCase of\n * the bit names, exactly as bpg derives them.\n */\nexport const BitType: Record<string, string> = new Proxy(\n {},\n {\n get: (_t, prop) => (typeof prop === \"string\" ? loadBitTypes()[prop] : undefined),\n has: (_t, prop) => typeof prop === \"string\" && prop in loadBitTypes(),\n ownKeys: () => Reflect.ownKeys(loadBitTypes()),\n getOwnPropertyDescriptor: (_t, prop) =>\n typeof prop === \"string\" && prop in loadBitTypes()\n ? { value: loadBitTypes()[prop], enumerable: true, configurable: true, writable: false }\n : undefined,\n },\n);\n\n/** Loud F-2 stand-in for enums tied to unsupported bpg internals. */\nfunction unsupportedEnum(name: string, reason: string): Record<string, string> {\n return new Proxy(\n {},\n {\n get: (_t, prop) => {\n if (prop === Symbol.toPrimitive || prop === \"toString\" || prop === Symbol.toStringTag) {\n return () => `[unsupported ${name}]`;\n }\n return unsupportedMember(name, reason);\n },\n has: () => unsupportedMember(name, reason),\n ownKeys: () => unsupportedMember(name, reason),\n },\n );\n}\n\n/** bpg `NodeType` — names bpg's internal AST nodes; the legacy AST is bit JSON. */\nexport const NodeType = unsupportedEnum(\n \"NodeType\",\n \"it names bpg's internal AST nodes; the legacy AST is bit JSON (see createAst)\",\n);\n\n/** bpg `BoundingBoxIndex` — bpg-internal utility. */\nexport const BoundingBoxIndex = unsupportedEnum(\n \"BoundingBoxIndex\",\n \"bpg-internal bounding-box utility\",\n);\n","// @zen-component: LEGACY-Facade\n// Throwing stubs for bpg exports the legacy facade deliberately does not\n// implement (PLAN-126 F-2: exist, but fail loudly and deterministically —\n// never silent no-ops). These are internals of bpg's TS implementation\n// (its AST walker, generators, parsers, writers), which have no equivalent\n// over the WASM core.\n\nimport { unsupportedMember } from \"./errors.js\";\n\nfunction stubClass(name: string, reason: string): new (...args: unknown[]) => never {\n return class {\n constructor() {\n unsupportedMember(name, reason);\n }\n } as unknown as new (...args: unknown[]) => never;\n}\n\nconst WALKER_REASON =\n \"the legacy AST is bit JSON, not bpg's internal node model; walking it with bpg NodeType names would silently misbehave\";\nconst INTERNAL_REASON = \"internal class of bpg's TS implementation\";\n\n/** bpg `Ast` walker — unsupported (PLAN-126 decision Q-7). */\nexport const Ast = stubClass(\"Ast\", WALKER_REASON);\n\nexport const BitmarkGenerator = stubClass(\"BitmarkGenerator\", INTERNAL_REASON);\nexport const BitmarkStringGenerator = stubClass(\"BitmarkStringGenerator\", INTERNAL_REASON);\nexport const BitmarkFileGenerator = stubClass(\"BitmarkFileGenerator\", INTERNAL_REASON);\nexport const JsonGenerator = stubClass(\"JsonGenerator\", INTERNAL_REASON);\nexport const JsonStringGenerator = stubClass(\"JsonStringGenerator\", INTERNAL_REASON);\nexport const JsonFileGenerator = stubClass(\"JsonFileGenerator\", INTERNAL_REASON);\nexport const HtmlTableGenerator = stubClass(\"HtmlTableGenerator\", INTERNAL_REASON);\nexport const HtmlTableParser = stubClass(\"HtmlTableParser\", INTERNAL_REASON);\nexport const BitmarkParser = stubClass(\"BitmarkParser\", INTERNAL_REASON);\nexport const JsonParser = stubClass(\"JsonParser\", INTERNAL_REASON);\nexport const StringWriter = stubClass(\"StringWriter\", INTERNAL_REASON);\nexport const FileWriter = stubClass(\"FileWriter\", INTERNAL_REASON);\nexport const StreamWriter = stubClass(\"StreamWriter\", INTERNAL_REASON);\n","// @zen-component: TS-EditorTypes\n//\n// The editor services (PLAN-196): what an editor needs from the parser, in\n// LSP 3.17 shapes — `Diagnostic`, and (PLAN-196 PR 4) `CompletionList` /\n// `CompletionItem` and `Hover`. The types are written here by hand, field\n// for field and value for value as the protocol defines them, so they assign\n// to Monaco's and `vscode-languageserver-types`' without a cast and the\n// package keeps its zero runtime dependencies. The contract is\n// `.zen/specs/API-EDT-editor-services.tsp`.\n\nimport type { PositionEncoding } from \"./semantic-tokens-types.js\";\nimport type { CompactTagInfo, FullTagInfo } from \"./types.js\";\n\n/** An LSP position: 0-based `line`, 0-based `character` in the response's\n * `positionEncoding` units (UTF-16 code units by default). */\nexport interface Position {\n line: number;\n character: number;\n}\n\n/** An LSP range: `start` inclusive, `end` exclusive; may span lines. */\nexport interface Range {\n start: Position;\n end: Position;\n}\n\n/**\n * LSP `DiagnosticSeverity`. The JSON envelope's buckets map onto it:\n * `errors` → `Error`, `warnings` → `Warning`, `infos` → `Information`.\n * `Hint` is never produced.\n */\nexport const DiagnosticSeverity = {\n Error: 1,\n Warning: 2,\n Information: 3,\n Hint: 4,\n} as const;\nexport type DiagnosticSeverity = (typeof DiagnosticSeverity)[keyof typeof DiagnosticSeverity];\n\n/**\n * Where an issue sits: the bit itself (its header, body or cardset), a card\n * variant, or a chain in either. Emitted beside `code` on every issue — in\n * the JSON envelope and in `Diagnostic.data`. Contractual, like `code`.\n *\n * Not the same thing as {@link EditorContext.scope}, which classifies a\n * cursor position for completion.\n */\nexport type IssueScope = \"bit\" | \"card\" | \"bit-chain\" | \"card-chain\";\n\n/**\n * One issue, as LSP defines a diagnostic. `code` is the stable contract\n * (the same codes as the JSON envelope's `parser.errors` / `warnings` /\n * `infos`); `message` is human prose and may change. `data.bit` is the\n * index of the bit the issue belongs to, the same index the JSON array\n * uses; `data.scope` is the issue's {@link IssueScope}.\n */\nexport interface Diagnostic {\n range: Range;\n severity: DiagnosticSeverity;\n code: string;\n source: \"bitmark\";\n message: string;\n data: { bit: number; scope: IssueScope };\n}\n\n/** What {@link diagnostics} returns. */\nexport interface Diagnostics {\n positionEncoding: PositionEncoding;\n diagnostics: Diagnostic[];\n}\n\n/** Options for {@link diagnostics}. */\nexport interface DiagnosticsOptions {\n /** Default: `\"utf-16\"`. */\n positionEncoding?: PositionEncoding;\n}\n\n// ── completion ──────────────────────────────────────────────────────\n\n/** LSP `MarkupContent` — this parser always writes Markdown. */\nexport interface MarkupContent {\n kind: \"markdown\";\n value: string;\n}\n\n/** LSP `CompletionItemKind` — the members this parser uses. */\nexport const CompletionItemKind = {\n Class: 7,\n Property: 10,\n Value: 12,\n Keyword: 14,\n Snippet: 15,\n EnumMember: 20,\n TypeParameter: 25,\n} as const;\nexport type CompletionItemKind = (typeof CompletionItemKind)[keyof typeof CompletionItemKind];\n\n/** LSP `CompletionItemTag`: `Deprecated` is the only member. */\nexport const CompletionItemTag = { Deprecated: 1 } as const;\nexport type CompletionItemTag = (typeof CompletionItemTag)[keyof typeof CompletionItemTag];\n\n/** What a completion item carries in LSP's `data` slot. */\nexport type CompletionItemData =\n | { kind: \"bit\"; name: string; id: number; deprecated?: string; migrateTo?: string }\n | { kind: \"tag\"; tag: CompactTagInfo }\n | { kind: \"value\"; tag: string; value: string }\n | { kind: \"attr\"; key: string; takesValue: boolean; values?: string[] }\n | null;\n\n/**\n * LSP `CompletionItem`, the fields this parser fills. `kind` is\n * `Class` for a bit type, `Property` for a tag or a valued inline attribute,\n * `Keyword` for a body format or an inline style key, `TypeParameter` for a\n * resource type, `EnumMember` / `Value` for an enum / boolean value,\n * `Snippet` for a structural line (`====`, `--`, `++`, `==== footer ====`).\n * Deprecated bits and tags carry `tags: [1]`. `sortText` puts required tags\n * the scope still lacks first (the first is `preselect`ed), then config\n * order. The parser returns EVERY candidate for the context; filtering by\n * the typed prefix is the editor's job.\n */\nexport interface CompletionItem {\n label: string;\n kind: CompletionItemKind;\n detail?: string;\n /** Absent from `complete`'s items; `resolve` fills it in (PLAN-202). */\n documentation?: MarkupContent;\n tags?: CompletionItemTag[];\n preselect?: boolean;\n sortText: string;\n insertText: string;\n /** `2` when `insertText` is an LSP snippet (the inline mark, `==${1:text}==|${2:bold}|`). */\n insertTextFormat?: 1 | 2;\n data: CompletionItemData;\n}\n\n/** Where a query resolved — an extension field of the LSP shapes. */\nexport interface EditorContext {\n bit?: string;\n scope: \"header\" | \"bit\" | \"card\" | \"chain\" | \"value\" | \"attr\" | \"footer\" | \"none\";\n chainParent?: string;\n /** 0-based card, side and variant. */\n card?: { card: number; side: number; variant: number };\n}\n\n/** LSP `CompletionList` plus the extension field `context`. */\nexport interface CompletionList {\n isIncomplete: false;\n items: CompletionItem[];\n context: EditorContext;\n}\n\n/** Options for {@link complete}. */\nexport interface CompleteOptions {\n /** Default: `\"utf-16\"`. */\n positionEncoding?: PositionEncoding;\n /** Offer deprecated bits too (deprecated tags are always offered, flagged). */\n includeDeprecated?: boolean;\n /**\n * The character the editor sent as the trigger (LSP\n * `CompletionContext.triggerCharacter`); omit when invoked explicitly.\n * A trigger that opens nothing where the cursor is answers an empty list\n * (PLAN-203).\n */\n triggerCharacter?: string;\n}\n\n/** Options for {@link resolve} — the same as the `complete` call's. */\nexport type ResolveOptions = CompleteOptions;\n\n// ── hover ───────────────────────────────────────────────────────────\n\n/** The record behind a hover — the extension field `data`. */\nexport type HoverData =\n | {\n kind: \"bit\";\n bit: string;\n bitInfo: { name: string; id: number; title?: string; description?: string; deprecated?: string; migrateTo?: string };\n }\n | {\n kind: \"tag\";\n bit?: string;\n scope: EditorContext[\"scope\"];\n chainParent?: string;\n card?: { card: number; side: number; variant: number };\n /** The `info` full record of the tag in this scope. */\n tag: FullTagInfo;\n }\n | { kind: \"value\"; tag: string; value: string }\n | { kind: \"resourceType\"; resourceType: string; tags: string[] }\n | { kind: \"attrKey\"; attr: { key: string; takesValue: boolean; values?: string[] } }\n | { kind: \"attrValue\"; attr: { key: string; value: string } };\n\n/** LSP `Hover` plus the extension field `data`. */\nexport interface Hover {\n range: Range;\n contents: MarkupContent;\n data: HoverData;\n}\n\n/** Options for {@link hover}. */\nexport interface HoverOptions {\n /** Default: `\"utf-16\"`. */\n positionEncoding?: PositionEncoding;\n}\n","// @zen-component: WASM-TSBindings\n\nimport type { PatchDocument } from \"./diff-types.js\";\nimport type { AnyBit } from \"./generated/bit-types.js\";\nimport type { PositionEncoding, TokensLayout } from \"./semantic-tokens-types.js\";\n\n/**\n * Output mode for JSON serialization.\n *\n * - `\"optimized\"` — omit keys whose values match their natural defaults.\n * - `\"full\"` — include all keys enumerated from the bitmark configuration.\n */\nexport type OutputMode = \"optimized\" | \"full\";\n\n/** Options for the typed conversion pair ({@link bitmarkToObjects} /\n * {@link objectsToBitmark}). */\nexport interface ParseOptions {\n /** JSON output mode (default: `\"optimized\"`). */\n mode?: OutputMode;\n /**\n * Include unknown properties in the bit JSON (default: `false`). Applies\n * to {@link bitmarkToObjects} only (parsing); ignored by\n * {@link objectsToBitmark} — unknown properties are never converted back\n * to bitmark. See {@link ConvertOptions.includeUnknownProperties}.\n */\n includeUnknownProperties?: boolean;\n}\n\n/**\n * Input format selector (adds auto-detection).\n *\n * `\"auto\"` sniffs bitmark-vs-JSON from the content; `\"bitmark\"` / `\"json\"` are\n * explicit; any config mapping id (e.g. `\"html\"`, `\"xml\"`) selects a markup\n * input that is reversed to the AST. The `(string & {})` arm admits those\n * config-driven mapping ids while keeping literal autocompletion.\n */\nexport type InputFormat = \"auto\" | \"bitmark\" | \"json\" | (string & {});\n\n/**\n * Concrete output format. `\"text\"` is lossy plain-text extraction,\n * `\"semantic-tokens\"` is parser-derived highlighting in the LSP shape (see\n * {@link semanticTokens}), `\"diagnostics\"` is every issue the JSON envelope\n * would carry as LSP diagnostics with encoded positions (see\n * {@link diagnostics}), `\"lex\"` is the lexer's token stream as a JSON\n * array (`[{ kind, span, text }]`, byte spans; debug tooling) and `\"ast\"` is\n * the parser's tree as JSON (debug tooling too, PLAN-209: it shows the runs,\n * dividers and spans a bitmark patch path addresses; the shape follows\n * the parser and is not a contract) — all five are output-only (they cannot\n * be used as an input format), and the last four take bitmark input only. Any config mapping id (`\"html\"`, `\"xml\"`, …) is\n * accepted too.\n */\nexport type OutputFormat =\n | \"bitmark\"\n | \"json\"\n | \"text\"\n | \"lex\"\n | \"ast\"\n | \"semantic-tokens\"\n | \"diagnostics\"\n | (string & {});\n\n/** One lexer token of the `\"lex\"` output format. */\nexport interface LexToken {\n /** The token kind — the engine's own name for it (`\"BitStart(1, false)\"`,\n * `\"Text(Body, false)\"`, `\"Bold\"`, …). Not a stable vocabulary. */\n kind: string;\n /** Byte offsets into the source (UTF-8). */\n span: { start: number; end: number };\n /** The source slice. */\n text: string;\n}\n\n/** Options for the {@link convert} function. */\nexport interface ConvertOptions {\n /** Input format (default: `\"auto\"`). */\n inputFormat?: InputFormat;\n /** Output format (default: `\"auto\"` — the opposite of the input). */\n outputFormat?: OutputFormat | \"auto\";\n /** JSON output mode (default: `\"optimized\"`). */\n mode?: OutputMode;\n /** Include validation warnings in `parser.warnings` output (default: `false`). */\n warnings?: boolean;\n /** Output text as plain text — debug mode (default: `false`). */\n plainText?: boolean;\n /**\n * Prettify the JSON being emitted (default: `false`). For JSON output this\n * is the whole document; for bitmark output it is the embedded JSON bodies\n * of `json`-format bits (cosmetic — they re-parse to the same value).\n */\n pretty?: boolean;\n /** Indent size for pretty-printing (default: `2`). */\n indent?: number;\n /** Spaces around tag values in bitmark output, `0..=10` (default: `1`). */\n spacesAroundValues?: number;\n /**\n * Bitmark → JSON only: include unknown properties in the bit JSON\n * (default: `false`). An unknown property (`[@key:value]` the bit's\n * config cannot resolve, at the bit body/footer — never inside cards or\n * consumed by a chain) is appended after all real keys as an array of\n * strings (`[@u]` with no value → `true`); a key colliding with a\n * configured key is `_`-prefixed. Unknown properties are never converted\n * back to bitmark, and each occurrence still warns.\n */\n includeUnknownProperties?: boolean;\n /**\n * Replace the converted output with a human-readable MAPPING REPORT of\n * what each input construct mapped to — including inputs that are NOT\n * mapped (default: `false`). Composite conversions (e.g. xml → json)\n * report every leg, one section after the other.\n */\n mappingReport?: boolean;\n /**\n * `\"semantic-tokens\"` and `\"diagnostics\"` output only: how columns and\n * lengths are counted — `\"utf-16\"` code units (default; the LSP default,\n * what browser editors index by) or `\"utf-8\"` bytes. Echoed in the output;\n * ignored by every other output format.\n */\n positionEncoding?: PositionEncoding;\n /**\n * `\"semantic-tokens\"` output only: `\"lsp\"` (default) writes the relative\n * `data` array, `\"absolute\"` one `{ line, start, length, type, modifiers }`\n * object per token. Ignored by every other output format.\n */\n tokensLayout?: TokensLayout;\n}\n\n/** Options for the {@link canonicalize} function (the single same-format\n * re-emit surface; `mode` covers what the removed optimize/fullize did). */\nexport interface CanonicalizeOptions {\n /**\n * Input format (default: `\"auto\"`). The output is re-emitted in this same\n * format — e.g. `\"html\"` in, html out. `\"auto\"` sniffs bitmark vs JSON.\n */\n inputFormat?: InputFormat;\n /** Output mode (default: `\"optimized\"`; `\"full\"` emits all keys). */\n mode?: OutputMode;\n /**\n * Prettify the JSON being emitted (default: `false`) — the whole document\n * for JSON input, the embedded JSON bodies of `json`-format bits for\n * bitmark input.\n */\n pretty?: boolean;\n /** Indent size for pretty-printing (default: `2`). */\n indent?: number;\n /** Spaces around tag values in bitmark output, `0..=10` (default: `1`). */\n spacesAroundValues?: number;\n}\n\n/** A patch operation. */\nexport type PatchOp = \"set\" | \"create\" | \"delete\" | \"append\";\n\n/**\n * A patch entry. Either the verbose form `{ path, op, value? }` or the\n * shorthand single-key object `{ \"<path>\": value }` (which means `set`).\n *\n * `path` is in one of two languages, told apart by its first character:\n *\n * - a **JSON path** addresses the bit JSON directly (`id`,\n * `cards[2].question.instruction`, `id[-1]`) and `value` is a JSON value;\n * - a **bitmark path** (PLAN-209) addresses the bit as an author writes it —\n * it starts with `$` or with `[` followed by a non-digit: `[@id]`, `[!]`,\n * `[&image][@width]`, `$card[1][0][!]`, `$card[2]$body`, `$raw`, `$footer`\n * — and `value` is bitmark source (a string, breakscaped as an author would\n * write it; `null` for a valueless tag). Bitmark paths need bitmark input.\n *\n * Every entry of one `transform` call must be in the same language.\n */\nexport type PatchEntry =\n { path: string; op: PatchOp; value?: unknown } | Record<string, unknown>;\n\n/**\n * One skipped patch entry, as carried by {@link PatchError} (PLAN-209 T9):\n * the entry's `path`, the error contract's `kind` (`patch-parse-error`,\n * `patch-index-out-of-range`, `patch-type-mismatch`, `patch-conflict`) and\n * a human-readable `message`.\n */\nexport interface PatchDiagnostic {\n path: string;\n kind: string;\n message: string;\n}\n\n/** Whether a literal patch path is a bitmark path (PLAN-209 D2). */\nexport type IsBitmarkPath<P extends string> = P extends `$${string}`\n ? true\n : P extends `[${infer C}${string}`\n ? C extends `${number}`\n ? false\n : true\n : false;\n\n// ── typed patch values (PLAN-128 §3.7) ──────────────────────────────────\n// The value type is resolved from the caller's literal path against `AnyBit`,\n// segment by segment — no enumeration of the path space, so compile cost is\n// per-call-site and bounded by the literal's length. Unresolvable segments and\n// dynamic (non-literal) paths degrade to `unknown`.\n\n/** @internal Peel `[n]` indexes off the front of `S`, unwrapping one array level each. */\ntype ApplyIndexes<T, S extends string> = S extends `[${string}]${infer Rest}`\n ? ApplyIndexes<T extends readonly (infer E)[] ? E : unknown, Rest>\n : T;\n\n/** @internal Resolve one dot-separated segment (`key`, `key[n]…`, or bare index). */\ntype Seg<T, S extends string> = S extends `${infer K}[${infer Rest}`\n ? ApplyIndexes<\n K extends \"\" ? T : K extends keyof T ? T[K] : unknown,\n `[${Rest}`\n >\n : S extends keyof T\n ? T[S]\n : S extends `${number}` | `-${number}`\n ? T extends readonly (infer E)[]\n ? E\n : unknown\n : unknown;\n\n/**\n * The type at patch path `P` within `T` (paths as in {@link PatchEntry}:\n * dot-separated keys with `[n]` indexes, negative-from-end allowed).\n */\nexport type PathValue<T, P extends string> = string extends P\n ? unknown\n : P extends `${infer S}.${infer Rest}`\n ? PathValue<NonNullable<Seg<T, S>>, Rest>\n : Seg<T, P>;\n\n/**\n * Build a {@link PatchEntry} with the `value` typed from the literal `path`,\n * resolved against {@link AnyBit}. A bitmark path (`$…` or `[…]`, PLAN-209)\n * takes bitmark source: its value is a `string` (or `null` for a valueless\n * tag).\n *\n * For `append`, the value is typed as an *element* of the array at the path.\n *\n * @example\n * patchEntry(\"instruction\", \"set\", [{ type: \"paragraph\", content: [] }]);\n * patchEntry(\"id\", \"append\", \"1234\");\n * patchEntry(\"cards[0].question\", \"delete\");\n * patchEntry(\"$card[1][-]\", \"append\", \"green\");\n */\nexport type PatchValueFor<\n P extends string,\n O extends PatchOp,\n> = IsBitmarkPath<P> extends true\n ? string | null\n : O extends \"append\"\n ? NonNullable<PathValue<AnyBit, P>> extends readonly (infer E)[]\n ? E\n : PathValue<AnyBit, P>\n : PathValue<AnyBit, P>;\n\nexport function patchEntry<const P extends string, const O extends PatchOp>(\n path: P,\n op: O,\n value?: PatchValueFor<P, O>,\n): PatchEntry {\n return value === undefined ? { path, op } : { path, op, value };\n}\n\n// The semantic-tokens types (PLAN-193) live in `semantic-tokens-types.ts`.\nexport type {\n PositionEncoding,\n TokensLayout,\n SemanticTokenType,\n SemanticTokenModifier,\n SemanticTokensLegend,\n SemanticToken,\n SemanticTokensLsp,\n SemanticTokensAbsolute,\n SemanticTokens,\n SemanticTokensOptions,\n} from \"./semantic-tokens-types.js\";\n\n// The editor-service types (PLAN-196) live in `editor-types.ts`.\nexport type {\n Position,\n Range,\n Diagnostic,\n Diagnostics,\n DiagnosticsOptions,\n IssueScope,\n MarkupContent,\n CompletionItemData,\n CompletionItem,\n EditorContext,\n CompletionList,\n CompleteOptions,\n ResolveOptions,\n HoverData,\n Hover,\n HoverOptions,\n} from \"./editor-types.js\";\nexport { CompletionItemKind, CompletionItemTag, DiagnosticSeverity } from \"./editor-types.js\";\n\n// The patch document and diff types (PLAN-179) live in `diff-types.ts`.\nexport type {\n BitSelector,\n PatchDocumentEntry,\n PatchDocument,\n DiffOutputFormat,\n DiffOptions,\n BitDiffRef,\n DiffHunkLine,\n DiffHunk,\n BitDiff,\n} from \"./diff-types.js\";\n\n/** One bit's source slice within a bitmark document (from {@link splitBits}). */\nexport interface BitSlice {\n index: number;\n byteStart: number;\n byteEnd: number;\n source: string;\n}\n\n/**\n * What a {@link PreHook} / {@link PostHook} sees for one bit, in its source\n * format. `index` is the bit's 0-based position; `total` is the bit count.\n */\nexport type BitView =\n | { format: \"bitmark\"; index: number; total: number; source: string }\n | { format: \"json\"; index: number; total: number; bit: AnyBit };\n\n/**\n * What a {@link PreHook} may return for a bit. All fields are optional; an\n * empty result (or `void`) makes the hook a pure observer.\n */\nexport interface PreHookResult {\n /** Patches to apply to this bit, after the patch document's entries for it. */\n patches?: PatchEntry[];\n /** Override the output format for this bit only. */\n outputFormat?: OutputFormat;\n /** Drop the bit from the output entirely. */\n drop?: boolean;\n}\n\n/** Pre-processing hook: inspect a bit, optionally return modifications. */\nexport type PreHook = (view: BitView) => PreHookResult | void;\n\n/** Post-processing hook: observe a bit's input view and rendered output. */\nexport type PostHook = (view: BitView, output: string) => void;\n\n/** Options for the {@link transform} function. */\nexport interface TransformOptions {\n /** Input format (default: `\"auto\"`). */\n inputFormat?: InputFormat;\n /** Output format (default: `\"json\"`). */\n outputFormat?: OutputFormat;\n /** Output mode (default: `\"optimized\"`). */\n mode?: OutputMode;\n /**\n * A patch document (PLAN-179) — per-bit patches by selector, removes,\n * inserts and moves — or the every-bit shorthand: a bare array of entries\n * applied to every bit. Either form may be given as a JSON string.\n */\n patch?: PatchEntry[] | PatchDocument | string;\n /**\n * Per-bit pre-hook, run on the calling thread. Returns patches (applied\n * after the static `patch`), an output-format override, or `drop`. Providing\n * a `preHook` or `postHook` switches `transform` to the per-bit path; with\n * neither, the whole document is transformed in a single pass.\n */\n preHook?: PreHook;\n /** Per-bit post-hook, run on the calling thread after each bit is rendered. */\n postHook?: PostHook;\n /**\n * Worker-thread count for {@link transformParallel} (Node only; default `4`).\n * Ignored by the synchronous {@link transform}.\n */\n workers?: number;\n /** Prettify the emitted JSON (default: `false`) — for bitmark output, the\n * embedded JSON bodies of `json`-format bits. */\n pretty?: boolean;\n /** Indent size for pretty-printing (default: `2`). */\n indent?: number;\n /** Spaces around tag values in bitmark output, `0..=10` (default: `1`). */\n spacesAroundValues?: number;\n}\n\n/** Text format for breakscape / unbreakscape operations. */\nexport type TextFormat = \"bitmark++\" | \"plainText\";\n\n/**\n * Text location for breakscape / unbreakscape operations.\n *\n * `\"cardBody\"` is a card side or variant body. It has every `\"body\"` rule plus\n * the card dividers `--` and `++`, which are markup only inside a card set and\n * only at the start of a line.\n */\nexport type TextLocation = \"body\" | \"cardBody\" | \"tag\";\n\n/**\n * Where within the {@link TextLocation} the text sits.\n *\n * `\"attrValue\"` is the value half of an inline-attr chain segment\n * (`==t==|link:VALUE|`). It REFINES the location rather than replacing it: it\n * adds the chain delimiter `|` to the escaped set and drops the running-text\n * rules, while `location` keeps deciding the tag rules.\n */\nexport type TextSubLocation = \"text\" | \"attrValue\";\n\n/** Options for the {@link breakscapeText} and {@link unbreakscapeText} functions. */\nexport interface BreakscapeOptions {\n /** Text format (default: `\"bitmark++\"`). */\n format?: TextFormat;\n /** Text location (default: `\"body\"`). */\n location?: TextLocation;\n /**\n * Sub-location within `location` (default: `\"text\"`).\n *\n * Ignored by {@link unbreakscapeText} — for `bitmark++` one inverse undoes\n * every breakscape mode.\n */\n subLocation?: TextSubLocation;\n}\n\n/** Info query type for the {@link info} function. */\nexport type InfoType =\n | \"list\"\n | \"bit\"\n | \"all\"\n | \"deprecated\"\n | \"bit-groups\"\n | \"resource-groups\"\n | \"languages\"\n | \"error-codes\";\n\n/** Output format for the {@link info} function. */\nexport type InfoFormat = \"text\" | \"json\";\n\n/**\n * The language token selecting every language this build can resolve —\n * `info({ language: ALL_LANGUAGES })`. The same spelling the parser and the\n * CLI (`--language all`) use; exported so a consumer names it instead of\n * retyping the literal.\n */\nexport const ALL_LANGUAGES = \"all\";\n\n/** Options for the {@link info} function. */\nexport interface InfoOptions {\n /** Info query type (default: `\"list\"`). */\n infoType?: InfoType;\n /** Output format (default: `\"text\"`). */\n format?: InfoFormat;\n /** Bit name — required when `infoType` is `\"bit\"`. */\n bit?: string;\n /** Whether to pretty-print JSON output (default: `false`). */\n pretty?: boolean;\n /** Indent size for pretty-printing (default: `2`). */\n indent?: number;\n /** Include deprecated bits in `list`/`all` output (default: `false`). */\n includeDeprecated?: boolean;\n /** Restrict `list`/`all` output to deprecated bits only (default: `false`;\n * wins over `includeDeprecated`). */\n onlyDeprecated?: boolean;\n /** Full detail for `\"bit\"`/`\"all\"`: provenance, keys, card structure\n * (default `false` = compact one-line-per-tag view). */\n full?: boolean;\n /**\n * BCP-47 language tag(s) for DISPLAY NAMES — `title` on bits, bit groups\n * and resource groups. Default (or `\"\"`) is English.\n *\n * Accepts one tag (`\"de\"`), several (`[\"de\", \"fr\"]` or `\"de,fr\"`), or\n * {@link ALL_LANGUAGES} for every language this build can resolve — see\n * `info({ infoType: \"languages\" })`.\n *\n * **More than one language adds a `titles` map** to each result, so a\n * consumer building a multilingual index makes ONE call instead of one per\n * language. A single tag renders exactly as it always did, with no `titles`.\n *\n * Resolution narrows one subtag at a time (`de-CH` → `de`), then falls back\n * to the English title, then to the technical key. A partially translated\n * language is therefore safe: untranslated entries stay English rather than\n * emptying out. Technical identity — `name`, `key` — is never translated.\n *\n * Which translations are available depends on the variant and on\n * {@link register}: the `full` wasm bakes a table in, the lean variants\n * start empty and expect you to register one.\n */\n language?: string | readonly string[];\n}\n\n/** Options for {@link register}. Discriminated on `type`. */\nexport interface RegisterOptions {\n /** What kind of data `data` is. */\n type: \"translations\";\n /**\n * The file's own text — for `\"translations\"`, the JSON published at\n * `@gmb/bitmark-parser/translations`:\n * `{ \"<key>\": { \"<bcp47 tag>\": \"<display name>\" } }`, English excluded.\n */\n data: string;\n}\n\n/*\n * ── info JSON result types ────────────────────────────────────────────\n *\n * {@link info} returns a STRING — it renders a document, and `format:\n * \"text\"` / `pretty` / `indent` only mean anything for one. When you ask for\n * `format: \"json\"`, parse it and assert the matching type below:\n *\n * ```ts\n * const groups = JSON.parse(\n * info({ infoType: \"deprecated\", format: \"json\" }),\n * ) as DeprecatedInfo;\n * ```\n *\n * These shapes are a STABLE CONTRACT: a change to any of them is a\n * semver-major release. The normative definition is\n * `.zen/specs/API-INF-info-output.tsp`, enforced by the parser's\n * `info_contract_test`. TEXT output is explicitly NOT contractual — it is\n * human-readable and may change in any release, so never parse it.\n *\n * Fields marked \"info-meta only\" are absent from the wasm build (they carry\n * descriptions and provenance, kept out of the binary for size). Absence is\n * structural: the key is missing, never `null` or empty.\n *\n * Two invariants hold throughout, both enforced by the parser's test suite:\n *\n * 1. `null` is NEVER used for absence — a key whose fact does not apply is\n * missing. `null` appears only where it means something, and those fields\n * say so: `max: null` (unbounded), `default: null` (OMIT).\n * 2. {@link FullBitInfo} is a strict SUPERSET of {@link CompactBitInfo} —\n * same spelling, same values, full just adds. One parser reads either.\n */\n\n/** A tag's value format. Closed vocabulary. */\nexport type TagFormat =\n \"string\" | \"number\" | \"boolean\" | \"bitmark++\" | \"numberList4\" | \"enum\";\n\n/** A body region's resolved format. Closed vocabulary. */\nexport type BodyFormat = \"bitmark\" | \"text\" | \"json\" | \"latex\" | \"xml\";\n\n/**\n * A bit's resource-attachment rule: a mode keyword, or the explicit list of\n * permitted resource type names.\n */\nexport type ResourceAttachment = \"all\" | \"none\" | string[];\n\n/** A tag in compact (`full: false`) output. */\nexport interface CompactTagInfo {\n /** Tag name including its sigil, e.g. `@id`, `&image`, `#title`. */\n name: string;\n format: TagFormat;\n /** Enum vocabulary — only on `enum`-format tags. */\n values?: string[];\n /** Effective minimum occurrences. */\n min: number;\n /** Effective maximum occurrences; `null` means unbounded. */\n max: number | null;\n /**\n * Default value, wire-encoded. `null` means OMIT: the tag has no default\n * and absence is its canonical state — not \"unknown\".\n */\n default: string | null;\n /** Only present when the tag is always emitted (then always `true`). */\n alwaysEmit?: true;\n /** Chained tags; only present when non-empty. */\n chain?: CompactTagInfo[];\n}\n\n/** A tag in full (`full: true`) output. */\nexport interface FullTagInfo {\n name: string;\n /** info-meta only. */\n description?: string;\n /** Deprecation version — only on a deprecated tag. */\n deprecated?: string;\n format: TagFormat;\n /** Enum vocabulary — only on `enum`-format tags. */\n values?: string[];\n min: number;\n /** `null` means unbounded. */\n max: number | null;\n /** Pre-override minimum — present with `baseMax` when this context overrides. */\n baseMin?: number;\n /** Pre-override maximum; `null` means unbounded. */\n baseMax?: number | null;\n /** Wire-encoded default; `null` means OMIT. */\n default: string | null;\n /**\n * The format's natural default, wire-encoded. ABSENT for an omit tag\n * (`default: null`), which has no natural default.\n */\n naturalDefault?: string;\n alwaysEmit?: true;\n /** Output key per mapping type; `json` is always present. */\n mappingKeys: Record<string, string>;\n /** Only present when this context overrides the tag's key (then `true`). */\n keyOverridden?: true;\n /**\n * Group-inheritance path, outermost first. On info-meta builds this is\n * always present and `[]` is meaningful — the tag is declared DIRECTLY on\n * its owner. Absent means \"not reported\", never \"declared directly\".\n *\n * info-meta only.\n */\n via?: string[];\n chain?: FullTagInfo[];\n}\n\n/** Card-set structures in compact output. */\nexport interface CompactVariantInfo {\n /** 0-based position within the side. */\n position: number;\n tags: CompactTagInfo[];\n}\nexport interface CompactSideInfo {\n name: string;\n variants: CompactVariantInfo[];\n}\nexport interface CompactCardInfo {\n name: string;\n sides: CompactSideInfo[];\n}\nexport interface CompactCardSetInfo {\n key: string;\n cards: CompactCardInfo[];\n}\n\n/** Card-set structures in full output. */\nexport interface FullVariantInfo {\n position: number;\n bodyFormat: BodyFormat;\n bodyRequired: boolean;\n bodyForbidden: boolean;\n repeat: boolean;\n tags: FullTagInfo[];\n}\nexport interface FullSideInfo {\n name: string;\n repeat: boolean;\n variants: FullVariantInfo[];\n}\nexport interface FullCardInfo {\n name: string;\n isDefault: boolean;\n min: number;\n /** `null` means unbounded. */\n max: number | null;\n sides: FullSideInfo[];\n}\nexport interface FullCardSetInfo {\n key: string;\n cards: FullCardInfo[];\n}\n\n/** A bit's body rules (full output). */\nexport interface BodyRulesInfo {\n format: BodyFormat;\n required: boolean;\n forbidden: boolean;\n hasFooter: boolean;\n}\n\n/**\n * One bit in compact output.\n *\n * {@link FullBitInfo} is a strict superset: every key here appears there,\n * spelled identically and with an equal value.\n */\nexport interface CompactBitInfo {\n /** Bit type name, e.g. `cloze`. */\n name: string;\n /** Internal config id — stable only within one config version. */\n id: number;\n /** English display name; only present when authored. */\n title?: string;\n /**\n * Display names by BCP-47 tag, present ONLY when {@link InfoOptions.language}\n * named more than one (or `\"all\"`).\n *\n * Always carries `en` — the English title, which every build has. Otherwise\n * SPARSE: a requested language with no translation is absent rather than\n * filled with English, so a hole is visible instead of silently\n * indistinguishable. Keyed by the tag you ASKED for, not the one that\n * satisfied it: request `de-CH` with only `de` available and you read\n * `titles[\"de-CH\"]`.\n */\n titles?: Record<string, string>;\n /**\n * Description. info-meta only: present on the `full` wasm variant and every\n * native binary, absent on `browser-full` and `bitmark-json`.\n */\n description?: string;\n /** Bit-group keys this bit belongs to, sorted. Omitted when it has none. */\n bitGroups?: string[];\n /** Only present when the bit is deprecated. */\n deprecated?: string;\n /**\n * Only present when a migration target exists. Such a bit is re-emitted\n * under its target's name in every parser output, so this name identifies\n * legacy input and already-indexed content — never new parser output.\n */\n migrateTo?: string;\n tags: CompactTagInfo[];\n /** Required resource name — only present when one is required. Name only:\n * its chain is already in `tags`. */\n requiredResource?: string;\n /** Only present when the bit has a card set. */\n cardSet?: CompactCardSetInfo;\n}\n\n/** One bit in full output. */\nexport interface FullBitInfo {\n name: string;\n id: number;\n /** As {@link CompactBitInfo.title}. */\n title?: string;\n /** As {@link CompactBitInfo.titles}. */\n titles?: Record<string, string>;\n /** As {@link CompactBitInfo.description} — info-meta only. */\n description?: string;\n /** As {@link CompactBitInfo.bitGroups}. */\n bitGroups?: string[];\n /** Only present when the bit is deprecated. */\n deprecated?: string;\n /** Only present when a migration target exists. */\n migrateTo?: string;\n body: BodyRulesInfo;\n /** This bit's resource-attachment rule. */\n resourceAttachment: ResourceAttachment;\n /** Required resource name — only present when one is required. */\n requiredResource?: string;\n /** Bit-level mapping keys, where the config authors them. info-meta only. */\n mappingKeys?: Record<string, string>;\n tags: FullTagInfo[];\n /** Only present when the bit has a card set. */\n cardSet?: FullCardSetInfo;\n}\n\n/**\n * One member of a bit group. An object rather than a bare string so a\n * deprecated member can carry its facts.\n */\nexport interface BitGroupMemberInfo {\n name: string;\n /**\n * The member's display name, in the requested language — the same terms as\n * {@link BitGroupInfo.title}.\n *\n * This is what makes `bit-groups` a complete answer to \"every bit type,\n * what it is called, and which categories it is in\" in ONE call: without\n * it the only route carrying display names was `infoType: \"all\"`, which is\n * ~50× the payload.\n */\n title?: string;\n /** As {@link CompactBitInfo.titles}. */\n titles?: Record<string, string>;\n /** Only present for a deprecated member. */\n deprecated?: string;\n /**\n * Only present when a migration target exists. Such a bit is re-emitted\n * under its target's name, so this member matches already-indexed legacy\n * content, not new parser output.\n */\n migrateTo?: string;\n}\n\n/** One bit group: a search/filter category over bit types. */\nexport interface BitGroupInfo {\n /** Group key, e.g. `cloze`. Lookups also accept an alias. */\n key: string;\n title: string;\n /** As {@link CompactBitInfo.titles}. */\n titles?: Record<string, string>;\n description: string;\n /** Omitted when there are none. */\n aliases?: string[];\n /**\n * Informational parent group — NEVER implies membership. Intersecting a\n * bit's `bitGroups` with the groups carrying `subgroupOf: \"quizzes\"` is\n * how a consumer derives quiz categories.\n */\n subgroupOf?: string;\n /** Present, and always `true`, for a deliberately memberless group. */\n allowEmpty?: true;\n /**\n * Member bit types, name-sorted. Filtered by `includeDeprecated` /\n * `onlyDeprecated`, so the DEFAULT EXCLUDES deprecated members — a search\n * consumer matching already-indexed content passes `includeDeprecated`.\n */\n bitTypes: BitGroupMemberInfo[];\n}\n\n/** One resource group: a search/filter category over resource types. */\nexport interface ResourceGroupInfo {\n key: string;\n title: string;\n /** As {@link CompactBitInfo.titles}. */\n titles?: Record<string, string>;\n description: string;\n aliases?: string[];\n /**\n * Member resource types (canonical kebab-case), sorted. Consumers\n * normalize legacy camelCase (`imageLink` → `image-link`) before matching.\n */\n resourceTypes: string[];\n}\n\n/**\n * `infoType: \"bit-groups\"` — the bit-group catalog, key-sorted. Available\n * in every build, including the lean wasm variants.\n */\nexport type BitGroupsInfo = BitGroupInfo[];\n\n/** `infoType: \"resource-groups\"` — the resource-group catalog, key-sorted. */\nexport type ResourceGroupsInfo = ResourceGroupInfo[];\n\n/** `infoType: \"list\"` — bit type names in registry order. */\nexport type BitListInfo = string[];\n\n/**\n * `infoType: \"languages\"` — the BCP-47 tags this build can resolve, sorted.\n *\n * Always includes `\"en\"`. This is what `language: \"all\"` expands to, so a\n * consumer can enumerate the set rather than guess it; it grows when\n * {@link register} supplies a file carrying further languages.\n */\nexport type LanguagesInfo = string[];\n\n/**\n * A code's templates in one scope: the message templates the parser renders\n * for that (code, scope) pair — named slots (`{tag}`, `{bitType}`, …) as\n * written, with the scope's location fragment already in place. Never empty.\n */\nexport interface ErrorCodeScopeInfo {\n scope: \"bit\" | \"card\" | \"bit-chain\" | \"card-chain\";\n templates: string[];\n}\n\n/**\n * One entry of `infoType: \"error-codes\"`: an issue code, its severity, and\n * its templates per scope it can occur in (only declared scopes, in order\n * `bit`, `card`, `bit-chain`, `card-chain`). `code` and a scope are the pair\n * every envelope issue (and every diagnostic's `code` + `data.scope`)\n * carries, so a consumer looks a live issue up by them. The templates are\n * NOT contractual (they may be reworded); `code`, `severity` and `scope` are.\n */\nexport interface ErrorCodeInfo {\n code: string;\n severity: \"error\" | \"warning\" | \"info\";\n scopes: ErrorCodeScopeInfo[];\n}\n\n/**\n * `infoType: \"error-codes\"` — every issue code the parser can emit, one\n * entry each, in code order. Read from the validator's own message table, so\n * it can never drift from what the envelope emits. English only; `language`\n * does not apply. In every variant.\n */\nexport type ErrorCodesInfo = ErrorCodeInfo[];\n\n/** `infoType: \"bit\"` — one bit at the requested detail. */\nexport type BitInfo = CompactBitInfo | FullBitInfo;\n\n/** `infoType: \"all\"` — every bit at the requested detail, in registry order. */\nexport type AllBitsInfo = CompactBitInfo[] | FullBitInfo[];\n\n/** One entry of {@link DeprecatedInfo}. */\nexport interface DeprecatedEntryInfo {\n name: string;\n /** Always set — every entry is deprecated. */\n deprecated: string;\n /** Only present for a bit that migrates. */\n migrateTo?: string;\n}\n\n/** `infoType: \"deprecated\"` — every deprecated bit, in registry order. */\nexport type DeprecatedInfo = DeprecatedEntryInfo[];\n\n/**\n * Returned in place of a result when `infoType` is `\"bit\"` and the name is\n * unknown or missing. Distinguishable from every success shape: those are an\n * array, or an object with `name`.\n *\n * The `error` KEY is contractual; its message text is not.\n */\nexport interface InfoErrorResult {\n error: string;\n}\n","// @zen-component: TS-SharedApi\n//\n// The shared API wrappers (PLAN-166): platform entries re-export these. Every\n// call reads the ACTIVE wasm module through the variant facade at call time,\n// so an `init({ feature })` swap applies to the next call with no interface\n// change.\n\nimport type { AnyBit, Bit, BitEntry } from \"../generated/bit-types.js\";\nimport type {\n BitDiff,\n BitSlice,\n BreakscapeOptions,\n CanonicalizeOptions,\n ConvertOptions,\n DiffOptions,\n InfoOptions,\n RegisterOptions,\n ParseOptions,\n SemanticTokens,\n SemanticTokensOptions,\n Diagnostics,\n DiagnosticsOptions,\n CompletionList,\n CompletionItem,\n CompleteOptions,\n ResolveOptions,\n Hover,\n HoverOptions,\n Position,\n TransformOptions,\n} from \"../types.js\";\nimport {\n PatchError,\n getActive,\n rememberRegistration,\n RegisterError,\n UnsupportedFeatureError,\n variant,\n} from \"./facade.js\";\nimport { type HookedWasm, runHookedTransform, type TransformEnvelope } from \"./hooked-transform.js\";\n\n/**\n * Parse bitmark into typed bit entries.\n *\n * The typed (object) counterpart of\n * `convert(input, { inputFormat: \"bitmark\", outputFormat: \"json\" })`:\n * returns the entries as objects instead of a JSON string. **Bitmark input\n * only** — the format is pinned, no auto-detection.\n *\n * @example\n * const entries = bitmarkToObjects(\"[.article]\\nHello **world**\");\n * const bit = entries[0].bit;\n * if (bit.type === \"article\") console.log(bit.body);\n *\n * @throws If the core reports a conversion error.\n */\nexport function bitmarkToObjects(input: string, options: ParseOptions = {}): BitEntry[] {\n const out = getActive().convert(\n input,\n \"bitmark\",\n \"json\",\n options.mode ?? \"optimized\",\n false,\n 2,\n 1,\n options.includeUnknownProperties ?? false,\n false,\n \"\",\n \"\",\n );\n return JSON.parse(out) as BitEntry[];\n}\n\n/**\n * Compose bitmark text from typed bits or entries.\n *\n * The typed (object) counterpart of\n * `convert(json, { inputFormat: \"json\", outputFormat: \"bitmark\" })` — typed\n * objects are JSON by construction, so the format is pinned, no\n * auto-detection. Bare bits are auto-wrapped into entries; the config-driven\n * composer normalizes, defaults and validates on ingest — construct bits as\n * plain typed literals (no builder needed).\n *\n * @example\n * const bitmark = objectsToBitmark([{ type: \"article\", body: \"Hello\" }]);\n *\n * @throws If the core reports a compose error.\n */\nexport function objectsToBitmark(bits: readonly (Bit | AnyBit | BitEntry)[], options: ParseOptions = {}): string {\n const entries = bits.map((b) =>\n b !== null && typeof b === \"object\" && \"bit\" in b && typeof (b as BitEntry).bit === \"object\"\n ? b\n : { bit: b },\n );\n const out = getActive().convert(\n JSON.stringify(entries),\n \"json\",\n \"bitmark\",\n options.mode ?? \"optimized\",\n false,\n 2,\n 1,\n false,\n false,\n \"\",\n \"\",\n );\n return out;\n}\n\n/**\n * Convert between bitmark, JSON, and the mapped markup formats (html/xml/…) —\n * the single string-based conversion surface.\n *\n * The markup formats need a wasm variant built with `markup`; on\n * `bitmark-json` they throw an `unsupported` error.\n *\n * Performance: `inputFormat` defaults to `\"auto\"`, which detects the format\n * by scanning the input for a bitmark bit header — for non-bitmark input\n * that is a full pass over the whole input before parsing starts, and the\n * detection is heuristic (markup formats are never auto-detected). **If you\n * know the input format, set `inputFormat` explicitly.** For typed objects\n * use {@link bitmarkToObjects} / {@link objectsToBitmark}, which pin their\n * formats.\n *\n * @param input - Bitmark, JSON, or mapped-format input text.\n * @param options - Convert options (e.g. `{ inputFormat: \"bitmark\", mode: \"full\" }`).\n * @returns Converted output string. For bitmark input, this is a JSON string\n * array of structured parsed entries (`bit`, `parser`, `bitmark`).\n */\nexport function convert(input: string, options: ConvertOptions = {}): string {\n return getActive().convert(\n input,\n options.inputFormat ?? \"auto\",\n options.outputFormat ?? \"auto\",\n options.mode ?? \"optimized\",\n options.pretty ?? false,\n options.indent ?? 2,\n options.spacesAroundValues ?? 1,\n options.includeUnknownProperties ?? false,\n options.mappingReport ?? false,\n options.positionEncoding ?? \"\",\n options.tokensLayout ?? \"\",\n );\n}\n\n/**\n * Parser-derived highlighting of bitmark source in the LSP semantic-tokens\n * shape (PLAN-193) — the typed form of\n * `convert(input, { inputFormat: \"bitmark\", outputFormat: \"semantic-tokens\" })`.\n *\n * The parser runs (never the validator) and every byte of the source is\n * covered exactly once: unpaired marks are text, an abandoned tag is text\n * and the dividers it would have swallowed keep their meaning, a raw body\n * (`[.code]`, `==== text ====`) is one plain-text run per line. Token types\n * name sigil classes and syntax positions, never a bit or tag name; the tag\n * class, the commented-bit flag and `unclosed` are modifiers. Both layouts\n * carry the legend, so the response is self-describing.\n *\n * @param input - Bitmark source text.\n * @param options - `positionEncoding` (`\"utf-16\"`, the default, or `\"utf-8\"`)\n * and `tokensLayout` (`\"lsp\"`, the default, or `\"absolute\"`).\n * @returns A {@link SemanticTokens} object, discriminated by `layout`.\n * @throws On a variant built without `semantic-tokens` (an `unsupported`\n * error).\n */\nexport function semanticTokens(input: string, options: SemanticTokensOptions = {}): SemanticTokens {\n return JSON.parse(\n convert(input, {\n inputFormat: \"bitmark\",\n outputFormat: \"semantic-tokens\",\n positionEncoding: options.positionEncoding,\n tokensLayout: options.tokensLayout,\n }),\n ) as SemanticTokens;\n}\n\n/**\n * Every issue the JSON `parser` envelope would carry for bitmark source, as\n * LSP `Diagnostic`s with encoded positions (PLAN-196) — the typed form of\n * `convert(input, { inputFormat: \"bitmark\", outputFormat: \"diagnostics\" })`.\n *\n * Parse and validate, no serialization: cheap enough to run on every\n * keystroke. Same codes, same spans and same order as the envelope's\n * `errors` / `warnings` / `infos`, whose buckets become LSP severities\n * 1 / 2 / 3. `code` is the contract; `message` is prose. `data.bit` is the\n * bit's index in the JSON array. Feed the list to `editor.setModelMarkers`\n * (Monaco) or `publishDiagnostics` (LSP) as is.\n *\n * @param input - Bitmark source text.\n * @param options - `positionEncoding` (`\"utf-16\"`, the default, or `\"utf-8\"`).\n * @returns A {@link Diagnostics} object.\n * @throws On a variant built without `editor` (an `unsupported` error).\n */\nexport function diagnostics(input: string, options: DiagnosticsOptions = {}): Diagnostics {\n return JSON.parse(\n convert(input, {\n inputFormat: \"bitmark\",\n outputFormat: \"diagnostics\",\n positionEncoding: options.positionEncoding,\n }),\n ) as Diagnostics;\n}\n\n/**\n * The constructs valid at `position` in bitmark source, as an LSP\n * `CompletionList` (PLAN-196): every bit type after `[.`, the body formats\n * and the bit's allowed resource types in the header, the tags valid in the\n * scope at the cursor (the bit body, a card variant, a chain — the same set\n * the validator enforces, minus tags already at their maximum, the required\n * ones the scope still lacks first), a tag's enum / boolean values, the\n * inline attribute keys and closed values, and the structural lines the\n * card config allows at a line start. Every candidate for the context is\n * returned; the editor filters by the typed prefix. Half-typed constructs\n * (`[@wi`, `[.art`, `==x==|bo`) resolve as if closed.\n *\n * @param input - Bitmark source text.\n * @param position - 0-based `line` / `character` in `positionEncoding` units.\n * @param options - `positionEncoding` (`\"utf-16\"`, the default, or `\"utf-8\"`),\n * `includeDeprecated`, and `triggerCharacter` — the character the editor\n * sent as the trigger (LSP `CompletionContext.triggerCharacter`), omitted\n * when invoked explicitly. A trigger that opens nothing where the cursor\n * is — a `.` or a `-` typed in prose — answers an empty list; `[` opens a\n * tag anywhere, and `=` / `-` / `+` at a line start narrow the list to the\n * structural lines they begin.\n * @returns A {@link CompletionList}; `context` says where the query resolved.\n * @throws {@link UnsupportedFeatureError} on a variant built without `editor`;\n * an error when `position.line` is past the end of the text, or when the\n * input is a JSON document (there is no bitmark source to resolve a\n * position in).\n */\nexport function complete(input: string, position: Position, options: CompleteOptions = {}): CompletionList {\n const wasm = getActive();\n if (typeof wasm.complete !== \"function\") throw new UnsupportedFeatureError(\"complete\", variant());\n return JSON.parse(\n wasm.complete(\n input,\n position.line,\n position.character,\n options.positionEncoding ?? \"\",\n options.includeDeprecated ?? false,\n options.triggerCharacter ?? \"\",\n ),\n ) as CompletionList;\n}\n\n/**\n * One item of the list `complete` returns at `position`, with its Markdown\n * `documentation` filled in — LSP `completionItem/resolve` (PLAN-202).\n * `complete` ships no documentation; an editor calls this for the one item\n * it is about to show (Monaco's `resolveCompletionItem`), passing the item\n * back as it was listed. The item is found by `label` and `kind`; when the\n * list no longer holds it (the text or the cursor moved on) the item is\n * returned as it was given.\n *\n * @param input - The bitmark source `complete` was asked about.\n * @param position - The position `complete` was asked at.\n * @param item - The item as `complete` listed it (`label` and `kind` are read).\n * @param options - As for `complete`.\n * @returns The item with `documentation` set where the parser has any.\n * @throws {@link UnsupportedFeatureError} on a variant built without `editor`;\n * an error when `position.line` is past the end of the text, or when the\n * input is a JSON document.\n */\nexport function resolve(\n input: string,\n position: Position,\n item: CompletionItem,\n options: ResolveOptions = {},\n): CompletionItem {\n const wasm = getActive();\n if (typeof wasm.resolve !== \"function\") throw new UnsupportedFeatureError(\"resolve\", variant());\n const resolved = JSON.parse(\n wasm.resolve(\n input,\n position.line,\n position.character,\n options.positionEncoding ?? \"\",\n options.includeDeprecated ?? false,\n item.label,\n item.kind,\n ),\n ) as CompletionItem | null;\n return resolved ?? item;\n}\n\n/**\n * The construct at `position` in bitmark source, as an LSP `Hover`\n * (PLAN-196): the bit type, a tag in its scope (with the same record\n * `info({ infoType: \"bit\", full: true })` shows for it there), a tag value, a\n * header resource type, an inline attribute key or value. `contents` is\n * Markdown; `data` carries the record it was rendered from. `null` on body\n * text, dividers and whitespace.\n *\n * @param input - Bitmark source text.\n * @param position - 0-based `line` / `character` in `positionEncoding` units.\n * @param options - `positionEncoding` (`\"utf-16\"`, the default, or `\"utf-8\"`).\n * @returns A {@link Hover}, or `null`.\n * @throws {@link UnsupportedFeatureError} on a variant built without `editor`;\n * an error when `position.line` is past the end of the text, or when the\n * input is a JSON document (there is no bitmark source to resolve a\n * position in).\n */\nexport function hover(input: string, position: Position, options: HoverOptions = {}): Hover | null {\n const wasm = getActive();\n if (typeof wasm.hover !== \"function\") throw new UnsupportedFeatureError(\"hover\", variant());\n return JSON.parse(\n wasm.hover(input, position.line, position.character, options.positionEncoding ?? \"\"),\n ) as Hover | null;\n}\n\n/**\n * Re-emit input in its own format in canonical form — the single same-format\n * surface (the former `optimize`/`fullize`/`expand` were pure mode pins of\n * this function and were removed).\n *\n * @param input - Input text (bitmark, JSON, or a markup format such as html/xml).\n * @param options - `mode`: `\"optimized\"` (default — omit natural defaults) or\n * `\"full\"` (emit all keys). `inputFormat` selects the format (default:\n * `\"auto\"`; prefer explicit — see {@link convert}); the output is\n * re-emitted in that same format.\n */\nexport function canonicalize(input: string, options: CanonicalizeOptions = {}): string {\n return getActive().canonicalize(\n input,\n options.inputFormat ?? \"auto\",\n options.mode ?? \"optimized\",\n options.pretty ?? false,\n options.indent ?? 2,\n options.spacesAroundValues ?? 1,\n );\n}\n\n/**\n * Count the bits in `input`, auto-detecting bitmark vs JSON (heuristic —\n * a full input scan when the input is not bitmark; see {@link convert}).\n *\n * @throws If the input cannot be parsed.\n */\nexport function countBits(input: string): number {\n return Number.parseInt(getActive().count_bits(input), 10);\n}\n\n/**\n * Split a bitmark document into per-bit source slices.\n *\n * @returns Array of `{ index, byteStart, byteEnd, source }`.\n */\nexport function splitBits(input: string): BitSlice[] {\n return JSON.parse(getActive().split_bits(input)) as BitSlice[];\n}\n\n/**\n * Transform a document bit-by-bit: apply an optional {@link PatchDocument}\n * and/or per-bit `preHook`/`postHook`, then re-emit.\n *\n * The patch document selects bits by pre-application index and/or id (or\n * `\"all\"`) and patches, removes, moves or inserts them; a bare array of\n * entries is the shorthand for \"patch every bit\". Hooks always see the\n * original bits, in order, before the document reshapes anything, and a\n * hook's patches apply after the document's for that bit. `diff` with\n * `outputFormat: \"patch\"` produces a document that turns one version of a\n * file into another.\n *\n * With neither hook, the whole document is transformed in a single WASM pass\n * (the fast path). When a `preHook` or `postHook` is supplied, `transform`\n * drives the bits one at a time on the calling thread — the hook inspects each\n * bit, may return patches / an output-format override / `drop`, and only data\n * crosses into WASM.\n *\n * `options.inputFormat` defaults to `\"auto\"`; prefer an explicit format when\n * known — see {@link convert}.\n *\n * Paths are JSON paths (`title`, `quizzes[0].choices[1].choice`) or bitmark\n * paths (`[@id]`, `$card[1][0][!]`, `$card[2]$body` — PLAN-209),\n * told apart by the first character; one language per call, and bitmark\n * paths need bitmark input.\n *\n * @returns The transformed document.\n * @throws {PatchError} If any entry was skipped (a bad path, an index out of\n * range, a refused value) — the diagnostics name each one. A silently\n * ignored edit is never returned.\n * @throws If the core reports a conversion or patch-document error.\n */\nexport function transform(input: string, options: TransformOptions = {}): string {\n const wasm = getActive();\n if (options.preHook || options.postHook) {\n return runHookedTransform(wasm as unknown as HookedWasm, input, options);\n }\n const patchJson =\n options.patch === undefined\n ? \"\"\n : typeof options.patch === \"string\"\n ? options.patch\n : JSON.stringify(options.patch);\n const { data, diagnostics } = JSON.parse(\n wasm.transform(\n input,\n options.inputFormat ?? \"auto\",\n options.outputFormat ?? \"json\",\n options.mode ?? \"optimized\",\n patchJson,\n options.pretty ?? false,\n options.indent ?? 2,\n options.spacesAroundValues ?? 1,\n ),\n ) as TransformEnvelope;\n if (diagnostics.length > 0) throw new PatchError(diagnostics);\n return data;\n}\n\n/**\n * Semantic diff of two documents (PLAN-179). Both sides are re-canonicalized\n * and compared as bit JSON; every difference is rendered as the canonical\n * bitmark an author would type. Bits are paired by `id`, then by `sourceBB`\n * on the same `sourceRL`, then by exact content, then by text similarity.\n *\n * @param a - The old document (bitmark or JSON).\n * @param b - The new document (bitmark or JSON; the formats need not match).\n * @param options - Diff options; `outputFormat` selects the unified-style\n * text (default), the per-bit JSON, or an applyable patch document.\n * @returns The diff in the selected format — empty text, an array of\n * `unchanged` bits, or a patch document with no entries when the two are\n * semantically equal.\n * @throws If the active variant was built without `diff`, or on a\n * conversion error.\n */\nexport function diff(a: string, b: string, options: DiffOptions = {}): string {\n const wasm = getActive();\n if (typeof wasm.diff !== \"function\") throw new UnsupportedFeatureError(\"diff\", variant());\n const out = wasm.diff(\n a,\n b,\n options.inputFormat ?? \"auto\",\n options.outputFormat ?? \"bitmark\",\n options.context ?? 3,\n options.locate ?? false,\n options.similarity ?? 0.6,\n options.bboxTolerance ?? 8,\n options.spacesAroundValues ?? 0,\n );\n return out;\n}\n\n/**\n * Typed form of {@link diff}: one {@link BitDiff} per aligned bit, unchanged\n * bits included (so the alignment is reconstructible). `outputFormat` is\n * ignored.\n */\nexport function diffBits(a: string, b: string, options: DiffOptions = {}): BitDiff[] {\n return JSON.parse(diff(a, b, { ...options, outputFormat: \"json\" })) as BitDiff[];\n}\n\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * @param input - The text to breakscape.\n * @param options - Breakscape options (e.g. `{ format: \"plainText\", location: \"tag\" }`).\n * Pass `subLocation: \"attrValue\"` when the text is the value half of an\n * inline-attr chain segment (`==t==|link:VALUE|`).\n * @returns Breakscaped text.\n */\nexport function breakscapeText(input: string, options: BreakscapeOptions = {}): string {\n const format = options.format ?? \"bitmark++\";\n const location = options.location ?? \"body\";\n const subLocation = options.subLocation ?? \"text\";\n return getActive().breakscape_text(input, format, location, subLocation);\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * @param input - The text to unbreakscape.\n * @param options - Unbreakscape options (e.g. `{ format: \"plainText\", location: \"tag\" }`).\n * `subLocation` is accepted and ignored — for `bitmark++` one inverse undoes\n * every breakscape mode.\n * @returns Unbreakscaped text.\n */\nexport function unbreakscapeText(input: string, options: BreakscapeOptions = {}): string {\n const format = options.format ?? \"bitmark++\";\n const location = options.location ?? \"body\";\n const subLocation = options.subLocation ?? \"text\";\n return getActive().unbreakscape_text(input, format, location, subLocation);\n}\n\n/**\n * Query information about supported bit types.\n *\n * `format` defaults to `\"text\"`, the human-readable rendering. That renderer\n * is only in the variants built with `info-text` — on `bitmark-json` it is\n * compiled out and this throws {@link UnsupportedFeatureError}; ask for\n * `format: \"json\"` there (the JSON views are the contractual ones and are in\n * every variant).\n *\n * @param options - Info options (e.g. `{ infoType: \"bit\", format: \"json\", bit: \"cloze\" }`).\n * @returns Information string.\n * @throws UnsupportedFeatureError if `format` is `\"text\"` on a variant built\n * without the text renderer.\n */\nexport function info(options: InfoOptions = {}): string {\n const infoType = options.infoType ?? \"list\";\n const format = options.format ?? \"text\";\n const bit = options.bit ?? \"\";\n const pretty = options.pretty ?? false;\n const indent = options.indent ?? 2;\n const includeDeprecated = options.includeDeprecated ?? false;\n const onlyDeprecated = options.onlyDeprecated ?? false;\n const full = options.full ?? false;\n // The wasm boundary is flat strings: \"\" = English, a comma list selects\n // several, `all` selects every resolvable one. An array is the idiomatic JS\n // spelling of the list and joins to the same thing.\n const language =\n typeof options.language === \"string\"\n ? options.language\n : (options.language?.join(\",\") ?? \"\");\n const wasm = getActive();\n if (format !== \"json\" && typeof wasm.info_text_supported !== \"function\") {\n throw new UnsupportedFeatureError('info (format: \"text\")', variant());\n }\n return wasm.info(\n infoType,\n format,\n bit,\n pretty,\n indent,\n includeDeprecated,\n onlyDeprecated,\n full,\n language,\n );\n}\n\n/**\n * Register data with the parser (PLAN-173). One verb rather than a function\n * per registerable thing — the same discriminated-options idiom as\n * {@link info}.\n *\n * Today the only type is `\"translations\"`, whose `data` is the text of a\n * translations file — the format published at `@gmb/bitmark-parser/translations`,\n * which is also what the CLI's `--translations` flag reads.\n *\n * Semantics are REPLACE: a second call supersedes the first entirely, and the\n * variant's built-in table (if any) stays underneath, so a key your file omits\n * still resolves. State is process-global, like {@link init} — the per-consumer\n * axis is `language`, which stays a per-call option on {@link info}.\n *\n * Works in every variant, including the lean ones that bake no table at all,\n * and SURVIVES an {@link init} variant swap — the data is replayed onto the\n * newly activated module.\n *\n * @throws RegisterError if the data is not a valid translations document.\n */\nexport function register(options: RegisterOptions): void {\n try {\n getActive().register(options.type, options.data);\n } catch (e) {\n throw new RegisterError(e instanceof Error ? e.message : String(e));\n }\n // Survives an `init` swap: each variant is a separate wasm instance with\n // its own memory, and switching variants must stay invisible to callers.\n rememberRegistration(options.type, options.data);\n}\n","// @zen-component: WASM-TSBindings\n//\n// Browser entry. The wasm variant is selected at runtime (PLAN-166 /\n// PLAN-174): all three glue modules are bundled (small), but only the selected\n// variant's `.wasm` is fetched — `init()` loads `browser-full`,\n// `init({ feature: \"full\" })` the richest one (adds the `info` meta layer),\n// `init({ feature: \"bitmark-json\" })` the minimal bitmark ↔ JSON one. A later\n// re-init loads the new module in the background while every call keeps being\n// served by the active one, then swaps atomically between calls.\n//\n// import { init, convert, ... } from '@gmb/bitmark-parser/browser'\n\nimport wasmFullInit, {\n initSync as wasmFullInitSync,\n} from \"../../wasm-web/bitmark_wasm.js\";\nimport * as wasmFull from \"../../wasm-web/bitmark_wasm.js\";\nimport wasmBrowserFullInit, {\n initSync as wasmBrowserFullInitSync,\n} from \"../../wasm-web-browser-full/bitmark_browser_full_wasm.js\";\nimport * as wasmBrowserFull from \"../../wasm-web-browser-full/bitmark_browser_full_wasm.js\";\nimport wasmJsonInit, {\n initSync as wasmJsonInitSync,\n} from \"../../wasm-web-bitmark-json/bitmark_json_wasm.js\";\nimport * as wasmJson from \"../../wasm-web-bitmark-json/bitmark_json_wasm.js\";\nimport { PACKAGE_INFO } from \"../generated/package_info.js\";\nimport {\n getActive,\n setActive,\n variant,\n BROWSER_DEFAULT_FEATURE,\n type Feature,\n type InitOptions,\n type WasmModule,\n} from \"../core/facade.js\";\nimport type { HookedWasm } from \"../core/hooked-transform.js\";\nimport { orchestrateParallel } from \"../core/parallel.js\";\nimport { setLegacyWasmProvider, type LegacyWasm } from \"../legacy/runtime.js\";\nimport type { TransformOptions } from \"../types.js\";\nimport { runJobsParallel } from \"./pool.js\";\n\n// Path from this bundle to the shared `dist/browser/wasm/` asset dir, injected\n// by tsup `define` (PLAN-174) because the three browser bundles sit at\n// different depths. Only bundled code ever loads a `.wasm`; the `typeof` guard\n// just keeps the module importable unbundled (typedoc, type tests), where no\n// init call is made.\ndeclare const __BITMARK_WASM_BASE__: string;\nconst WASM_BASE =\n typeof __BITMARK_WASM_BASE__ === \"string\" ? __BITMARK_WASM_BASE__ : \"./\";\n\n// Variant map (PLAN-166 / PLAN-174): feature → glue + the `.wasm` filename\n// under that asset dir. A future variant is one entry here plus one\n// build-script table row.\ninterface VariantSpec {\n init: (module_or_path?: unknown) => Promise<unknown>;\n initSync: (module: unknown) => unknown;\n ns: WasmModule;\n wasmFile: string;\n}\nconst VARIANTS: Record<Feature, VariantSpec> = {\n full: {\n init: wasmFullInit as (m?: unknown) => Promise<unknown>,\n initSync: wasmFullInitSync as (m: unknown) => unknown,\n ns: wasmFull as unknown as WasmModule,\n wasmFile: \"bitmark_wasm_bg.wasm\",\n },\n \"browser-full\": {\n init: wasmBrowserFullInit as (m?: unknown) => Promise<unknown>,\n initSync: wasmBrowserFullInitSync as (m: unknown) => unknown,\n ns: wasmBrowserFull as unknown as WasmModule,\n wasmFile: \"bitmark_browser_full_wasm_bg.wasm\",\n },\n \"bitmark-json\": {\n init: wasmJsonInit as (m?: unknown) => Promise<unknown>,\n initSync: wasmJsonInitSync as (m: unknown) => unknown,\n ns: wasmJson as unknown as WasmModule,\n wasmFile: \"bitmark_json_wasm_bg.wasm\",\n },\n};\n\n// Legacy (bpg-compatible) API — namespaced; WASM must be init()ed before use.\n// Reads the ACTIVE wasm per call, so it follows init swaps; on `bitmark-json`\n// only its HTML-dependent members fail (PLAN-166 decision 4). No file I/O is\n// provided in the browser (file options throw, as bpg does).\nsetLegacyWasmProvider(() => getActive() as unknown as LegacyWasm);\nexport * as legacy from \"../legacy/index.js\";\n\n/** `init` options (browser): feature and/or an explicit wasm source. */\nexport interface BrowserInitOptions extends InitOptions {\n /** Explicit `.wasm` source (URL / Request / Response / Module / bytes). */\n module_or_path?: unknown;\n}\n\n/**\n * The variant an init call without an explicit `feature` selects.\n *\n * With no source, that is the browser default (`browser-full`, PLAN-174). With\n * an EXPLICIT source it stays `\"full\"`: those bytes predate this variant split\n * and are `bitmark_wasm_bg.wasm`, and glue must match the bytes it\n * instantiates — pairing them with another variant's glue fails at\n * instantiation. Name the feature alongside the source to load any other one.\n */\nfunction defaultFeatureFor(module_or_path: unknown): Feature {\n return module_or_path === undefined ? BROWSER_DEFAULT_FEATURE : \"full\";\n}\n\n/**\n * Whether an `init` argument is an options record rather than a bare wasm\n * source. A record names `feature` and/or `module_or_path` — or is the empty\n * record `{}`, which is the same request as no argument at all. Every source\n * (URL, Request, Response, `WebAssembly.Module`, bytes, a promise of one) is\n * a non-plain object, so it never reads as the empty record.\n */\nfunction isInitOptions(arg: unknown): arg is BrowserInitOptions {\n if (arg === null || typeof arg !== \"object\") return false;\n if (\"feature\" in arg || \"module_or_path\" in arg) return true;\n const proto = Object.getPrototypeOf(arg);\n return (proto === Object.prototype || proto === null) && Object.keys(arg).length === 0;\n}\n\nfunction normalizeInit(arg: unknown): {\n feature: Feature;\n module_or_path?: unknown;\n} {\n if (isInitOptions(arg)) {\n return {\n feature: arg.feature ?? defaultFeatureFor(arg.module_or_path),\n module_or_path: arg.module_or_path,\n };\n }\n // Back-compat: a bare module_or_path initialises `full`; nothing at all\n // initialises the browser default.\n const module_or_path = arg ?? undefined;\n return { feature: defaultFeatureFor(module_or_path), module_or_path };\n}\n\n// Init sequencing: every activation — async or sync — takes the next number,\n// and an async load swaps only if it is still the newest when it lands.\nlet initSeq = 0;\nlet activeOut: unknown;\nlet inflight:\n { feature: Feature; seq: number; promise: Promise<unknown> } | undefined;\n\n/**\n * Initialise the WASM module, selecting the variant (PLAN-166 / PLAN-174):\n * `\"browser-full\"` (the browser default — every conversion capability, without\n * the `info` meta layer), `\"full\"` (adds that meta layer: tag descriptions,\n * group provenance, raw mappingKeys patterns — bigger to download) or\n * `\"bitmark-json\"` (bitmark ↔ JSON only; markup formats, mapping report and\n * the `lex` output unavailable). All three glue modules are in the bundle; only the\n * selected variant's `.wasm` is fetched.\n *\n * May be called again to switch variants: the new module loads in the\n * background while calls keep being served by the active one, then one\n * atomic swap applies. Overlapping calls: same-feature in-flight inits are\n * coalesced; a different-feature init supersedes an unfinished one (its load\n * is discarded without swapping); every returned promise resolves once the\n * finally-active module is live. Re-init of the already-active feature is a\n * no-op unless an explicit `module_or_path` forces re-instantiation.\n *\n * When no explicit source is given, the default `.wasm` URL is decorated\n * with a cache-busting `?v=<version>` query parameter so CDN caches are\n * invalidated when the package version changes.\n *\n * Back-compat: `init(module_or_path)` (no options object) initialises `full`,\n * because those bytes are `bitmark_wasm_bg.wasm` — see {@link defaultFeatureFor}.\n * `init({})` is the same request as `init()`.\n */\nexport async function init(\n options?: BrowserInitOptions | unknown,\n): Promise<unknown> {\n const { feature, module_or_path } = normalizeInit(options);\n if (module_or_path === undefined) {\n if (!inflight && variant() === feature) return activeOut; // no-op\n if (inflight?.feature === feature) return inflight.promise; // coalesce\n }\n const mySeq = ++initSeq;\n const v = VARIANTS[feature];\n const source =\n module_or_path ??\n new URL(`${WASM_BASE}${v.wasmFile}?v=${PACKAGE_INFO.version}`, import.meta.url);\n const promise: Promise<unknown> = (async () => {\n try {\n // wasm-bindgen's init takes an options object; a bare source is the\n // deprecated positional form and warns on every load.\n const out = await v.init({ module_or_path: source });\n if (mySeq === initSeq) {\n // Last call wins: a superseded load never swaps. The previous\n // module's reference is dropped here (its glue retains the instance\n // until that variant is re-initialised — wasm-bindgen keeps\n // module-level state).\n setActive(feature, v.ns);\n activeOut = out;\n }\n } finally {\n if (inflight?.seq === mySeq) inflight = undefined;\n }\n // Resolve to the finally-active state: if a newer init superseded this\n // one, wait for it (and any further successors) to settle.\n while (inflight) await inflight.promise.catch(() => {});\n return activeOut;\n })();\n inflight = { feature, seq: mySeq, promise };\n return promise;\n}\n\n/**\n * Synchronous initialisation from already-loaded wasm bytes / a compiled\n * `WebAssembly.Module` (no fetch). `options.feature` selects the variant the\n * bytes belong to — it must MATCH them, since glue and module are a pair.\n * Default `\"full\"`, for the same back-compat reason as {@link defaultFeatureFor}.\n *\n * Takes part in the same last-call-wins sequencing as {@link init}: an\n * unfinished async load is superseded (it completes but never swaps, and a\n * later `init` of its feature starts afresh rather than joining it).\n */\nexport function initSync(module: unknown, options: InitOptions = {}): unknown {\n const feature = options.feature ?? defaultFeatureFor(module);\n const v = VARIANTS[feature];\n const out = v.initSync({ module });\n ++initSeq;\n inflight = undefined;\n setActive(feature, v.ns);\n activeOut = out;\n return out;\n}\n\nexport {\n variant,\n NotInitializedError,\n PatchError,\n RegisterError,\n UnsupportedFeatureError,\n} from \"../core/facade.js\";\nexport type { Feature, InitOptions } from \"../core/facade.js\";\n\nexport type {\n LexToken,\n PositionEncoding,\n TokensLayout,\n SemanticTokenType,\n SemanticTokenModifier,\n SemanticTokensLegend,\n SemanticToken,\n SemanticTokensLsp,\n SemanticTokensAbsolute,\n SemanticTokens,\n SemanticTokensOptions,\n Position,\n Range,\n Diagnostic,\n Diagnostics,\n DiagnosticsOptions,\n IssueScope,\n MarkupContent,\n CompletionItemData,\n CompletionItem,\n EditorContext,\n CompletionList,\n CompleteOptions,\n HoverData,\n Hover,\n HoverOptions,\n ParseOptions,\n ConvertOptions,\n OutputMode,\n BreakscapeOptions,\n TextFormat,\n TextLocation,\n TextSubLocation,\n InfoOptions,\n RegisterOptions,\n InfoType,\n InfoFormat,\n InputFormat,\n OutputFormat,\n CanonicalizeOptions,\n TransformOptions,\n PatchOp,\n PatchEntry,\n PatchDiagnostic,\n IsBitmarkPath,\n PathValue,\n PatchValueFor,\n PatchDocument,\n PatchDocumentEntry,\n BitSelector,\n DiffOptions,\n DiffOutputFormat,\n BitDiff,\n BitDiffRef,\n DiffHunk,\n DiffHunkLine,\n BitSlice,\n BitView,\n PreHook,\n PostHook,\n PreHookResult,\n TagFormat,\n BodyFormat,\n ResourceAttachment,\n CompactTagInfo,\n FullTagInfo,\n CompactVariantInfo,\n CompactSideInfo,\n CompactCardInfo,\n CompactCardSetInfo,\n FullVariantInfo,\n FullSideInfo,\n FullCardInfo,\n FullCardSetInfo,\n BodyRulesInfo,\n CompactBitInfo,\n FullBitInfo,\n BitListInfo,\n LanguagesInfo,\n BitInfo,\n AllBitsInfo,\n DeprecatedEntryInfo,\n DeprecatedInfo,\n InfoErrorResult,\n} from \"../types.js\";\nexport { patchEntry, ALL_LANGUAGES } from \"../types.js\";\n\n// Generated types for the parser's JSON (from bitmark.json via schemagen, PLAN-128)\nexport type * from \"../generated/bit-types.js\";\n\nexport { CompletionItemKind, CompletionItemTag, DiagnosticSeverity } from \"../editor-types.js\";\n\n// The shared wrappers (PLAN-166): every call reads the active wasm module.\nexport {\n bitmarkToObjects,\n objectsToBitmark,\n convert,\n semanticTokens,\n diagnostics,\n complete,\n resolve,\n hover,\n canonicalize,\n countBits,\n splitBits,\n transform,\n diff,\n diffBits,\n breakscapeText,\n unbreakscapeText,\n info,\n register,\n} from \"../core/api.js\";\n\n/**\n * Get the version of the @gmb/bitmark-parser library.\n *\n * @returns Version string (e.g. \"3.0.0\").\n */\nexport function version(): string {\n return PACKAGE_INFO.version;\n}\n\n/**\n * Parallel counterpart of {@link transform} (browser). Fans the per-bit WASM\n * compute across a pool of module `Worker`s (`options.workers`, default `4`);\n * each worker loads its own WASM instance of the ACTIVE variant.\n * `preHook`/`postHook` run on the calling thread. Call {@link init} before\n * use. Output is identical to {@link transform}; this trades worker startup\n * cost for throughput on large documents.\n *\n * **Requires the ESM build** (`@gmb/bitmark-parser/browser`, i.e.\n * `dist/browser/esm`): the module-`Worker` entry (`worker-entry.js`) and its\n * `.wasm` are emitted only beside that bundle. Module workers are ESM by\n * nature; the CJS / single-file min bundles ship the sync {@link transform}\n * only, and calling this there resolves to an `error:` string (the worker\n * file is absent). For throughput in those targets, use {@link transform} or\n * chunk + your own workers.\n *\n * @returns A Promise of the transformed document, or an `error:`-prefixed\n * string on failure.\n */\nexport function transformParallel(\n input: string,\n options: TransformOptions = {},\n): Promise<string> {\n const wasm = getActive() as unknown as HookedWasm;\n const feature: Feature = variant() ?? BROWSER_DEFAULT_FEATURE;\n return orchestrateParallel(wasm, input, options, (jobs, workers) =>\n runJobsParallel(jobs, workers, feature),\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../wasm-web/bitmark_wasm.js","../../wasm-web-browser-full/bitmark_browser_full_wasm.js","../../wasm-web-bitmark-json/bitmark_json_wasm.js","../../src/generated/package_info.ts","../../src/core/facade.ts","../../src/core/hooked-transform.ts","../../src/core/parallel.ts","../../src/legacy/runtime.ts","../../src/core/pool.ts","../../src/browser/pool.ts","../../src/legacy/index.ts","../../src/legacy/errors.ts","../../src/legacy/translate.ts","../../src/legacy/pseudo-ast.ts","../../src/legacy/generated/resource-collection-keys.ts","../../src/legacy/builder.ts","../../src/legacy/bpg-class.ts","../../src/legacy/resource-builder.ts","../../src/legacy/options.ts","../../src/legacy/enums-extra.ts","../../src/legacy/stubs.ts","../../src/editor-types.ts","../../src/types.ts","../../src/core/api.ts","../../src/browser/index.ts"],"names":["bitmark_wasm_exports","__export","breakscape_text","canonicalize","complete","convert","convert_text","count_bits","bitmark_wasm_default","diff","hover","info","info_text_supported","initSync","is_bitmark","prettify","register","resolve","resolve_patch_document","split_bits","split_json_bits","transform","unbreakscape_text","wasm","cachedTextDecoder","cachedUint8ArrayMemory0","getUint8ArrayMemory0","getStringFromWasm0","ptr","len","heap","heap_next","addHeapObject","obj","idx","WASM_VECTOR_LEN","cachedTextEncoder","encodeString","arg","view","buf","passStringToWasm0","malloc","realloc","mem","offset","code","ret","isLikeNone","x","cachedDataViewMemory0","getDataViewMemory0","input","format","location","sub_location","deferred5_0","deferred5_1","retptr","ptr0","len0","ptr1","len1","ptr2","len2","ptr3","len3","r0","r1","info_type","bit","pretty","indent","include_deprecated","only_deprecated","full","language","getObject","dropObject","takeObject","direction","deferred6_0","deferred6_1","r2","r3","ptr5","len5","input_format_sel","output_format_sel","mode","patch_json","spaces_around_values","deferred7_0","deferred7_1","ptr4","len4","ptr6","len6","a","b","context","locate","similarity","bbox_tolerance","line","character","position_encoding","trigger_character","label","kind","deferred4_0","deferred4_1","data_type","data","include_unknown_properties","mapping_report","tokens_layout","deferred8_0","deferred8_1","ptr7","len7","deferred3_0","deferred3_1","deferred2_0","deferred2_1","json","__wbg_load","module","imports","e","bytes","instance","__wbg_get_imports","arg0","arg1","__wbg_finalize_init","__wbg_init","module_or_path","bitmark_browser_full_wasm_exports","bitmark_browser_full_wasm_default","bitmark_json_wasm_exports","bitmark_json_wasm_default","PACKAGE_INFO","BROWSER_DEFAULT_FEATURE","NotInitializedError","RegisterError","message","PatchError","diagnostics","lines","d","__publicField","UnsupportedFeatureError","what","active","activeFeature","lazyLoader","registrations","getActive","setActive","feature","type","rememberRegistration","variant","stripArray","doc","t","patchJsonOf","patch","buildUnits","inputIsBitmark","slices","s","envelopes","env","index","planTransform","options","output","spacesAroundValues","sel","inputFormat","units","total","hooked","result","patchJson","resolved","_","jobs","views","item","hook","bitOutput","envelopeJson","outputFormat","computeBit","job","recombine","elements","arr","runHookedTransform","plan","rendered","skipped","i","element","orchestrateParallel","runJobs","outputs","wasmProvider","setLegacyWasmProvider","provider","getLegacyWasm","runJobsWithPool","workers","spawn","poolSize","reject","results","next","settled","done","pool","finish","err","w","dispatch","id","res","runJobsParallel","workerUrl","onResult","onError","ev","msg","legacy_exports","Ast","BitType","BitmarkFileGenerator","BitmarkGenerator","BitmarkParser","BitmarkParserGenerator","BitmarkParserType","BitmarkStringGenerator","BitmarkVersion","BodyTextFormat","BoundingBoxIndex","Builder","CardSetVersion","FileWriter","HtmlTableGenerator","HtmlTableParser","InfoFormat","InfoType","Input","InputFormat","JsonFileGenerator","JsonGenerator","JsonParser","JsonStringGenerator","LegacyUnsupportedError","NodeType","Output","ResourceBuilder","StreamWriter","StringWriter","TextLocation","TextMarkType","TextNodeType","bitmarkTextParse","isPseudoAst","unsupportedMember","member","reason","unsupportedOption","option","V3_ONLY","validateVersionOptions","opts","validateBitmarkOptions","o","validateJsonOptions","prettyIndent","spacesAround","v","mapTextFormat","f","PSEUDO_AST_MARKER","makePseudoAst","bits","ast","RESOURCE_COLLECTION_KEYS","BUILT_BIT_PARSER","DATA_KEY_TO_JSON_KEY","DEPRECATED_TEXT_FORMATS","CONFIG_BODY_FORMAT_TO_TEXT_FORMAT","TAG_TEXT_KEYS","_options","src","bitType","bitConfig","textFormat","body","resources","list","collection","r","parser","extraProperties","key","value","out","built","_context","attrs","stripUndefined","toAst","bitmarkBody","exclude","k","jsonOptions","bitmarkOptions","source","isBitmark","coreFormat","emit","spaces","includeUnknown","inStr","extractHtmlTables","wrapped","isBitmarkText","textLocation","outStr","textAst","n","entries","parsed","entry","wrapper","outputFile","fileOptions","html","tables","lower","start","depth","j","end","open","close","closeEnd","text","RESOURCE_SPECS","buildResource","spec","_typeAlias","rest","inner","SPEC_BY_TYPE","resource","single","nodes","asString","url","bitNameToKey","name","c","bitTypeCache","loadBitTypes","all","map","_t","prop","unsupportedEnum","stubClass","WALKER_REASON","INTERNAL_REASON","DiagnosticSeverity","CompletionItemKind","CompletionItemTag","patchEntry","path","op","ALL_LANGUAGES","bitmarkToObjects","objectsToBitmark","semanticTokens","position","countBits","splitBits","diffBits","breakscapeText","subLocation","unbreakscapeText","infoType","includeDeprecated","onlyDeprecated","WASM_BASE","VARIANTS","defaultFeatureFor","isInitOptions","proto","normalizeInit","initSeq","activeOut","inflight","init","mySeq","promise","version","transformParallel"],"mappings":"AAAA,IAAA,EAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,IAAA,CAAA,YAAA,CAAA,IAAA,CAAA,QAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,IAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,EAAA,CAAA,CA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5E,IAAMjB,CAAAA,CAAUiB,EAAQ,OAAA,EAAWgO,EAAAA,CAAkBlR,CAAM,CAAA,CACrD8J,CAAAA,CAAImH,GAAShP,CAAO,CAAA,CACpBwJ,EAAM3B,CAAAA,CAAE,QAAA,CAAS,CAAE,MAAA,CAAA9J,CAAO,CAAC,CAAA,CACjC,OAAA,EAAEsR,GACFE,EAAAA,CAAW,MAAA,CACXxP,GAAUC,CAAAA,CAAS6H,CAAAA,CAAE,EAAE,CAAA,CACvByH,EAAAA,CAAY9F,EACLA,CACT,CAmIO,SAASmG,EAAAA,EAAkB,CAChC,OAAO7Q,EAAAA,CAAa,OACtB,CAqBO,SAAS8Q,EAAAA,CACdxW,EACA6H,CAAAA,CAA4B,GACX,CACjB,IAAM1J,EAAOuI,CAAAA,EAAU,CACjBE,EAAmBG,EAAAA,EAAQ,EAAKpB,GACtC,OAAOgE,EAAAA,CAAoBxL,EAAM6B,CAAAA,CAAO6H,CAAAA,CAAS,CAACY,CAAAA,CAAM0B,CAAAA,GACtDe,GAAgBzC,CAAAA,CAAM0B,CAAAA,CAASvD,CAAO,CACxC,CACF","file":"bitmark-parser.min.js","sourcesContent":["let wasm;\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nconst heap = new Array(128).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nlet heap_next = heap.length;\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nconst cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * `sub_location`: `\"text\"` (default) or `\"attrValue\"` — the value half of an\n * inline-attr chain segment (`==t==|link:VALUE|`), which escapes `|` and\n * skips the running-text rules (PLAN-211)\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @param {string | null} [sub_location]\n * @returns {string}\n */\nexport function breakscape_text(input, format, location, sub_location) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n var len3 = WASM_VECTOR_LEN;\n wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * `sub_location`: accepted and IGNORED — unbreakscape is sub-location\n * independent for bitmarkText, so one inverse undoes every breakscape mode\n * (PLAN-211 D5a)\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @param {string | null} [sub_location]\n * @returns {string}\n */\nexport function unbreakscape_text(input, format, location, sub_location) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n var len3 = WASM_VECTOR_LEN;\n wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Query information about supported bit types.\n *\n * `info_type`: `\"list\"`, `\"bit\"`, `\"all\"`, `\"deprecated\"`, `\"bit-groups\"`,\n * or `\"resource-groups\"`\n * `format`: `\"text\"` or `\"json\"`\n * `bit`: bit name (required when `info_type` is `\"bit\"`)\n * `pretty`: whether to pretty-print JSON output\n * `indent`: indent size for pretty-printing (default: 2)\n * `include_deprecated`: include deprecated bits in `list`/`all` (PLAN-149)\n * `only_deprecated`: restrict `list`/`all` to deprecated bits (wins over\n * `include_deprecated`)\n * `full`: complete outline for `bit`/`all` (default is the compact\n * one-line-per-tag view)\n * `language`: BCP-47 tag(s) for display names — \"\" = English, `\"de,fr\"` for\n * several (adds a `titles` map), `\"all\"` for every resolvable language\n * @param {string} info_type\n * @param {string} format\n * @param {string} bit\n * @param {boolean} pretty\n * @param {number} indent\n * @param {boolean} include_deprecated\n * @param {boolean} only_deprecated\n * @param {boolean} full\n * @param {string} language\n * @returns {string}\n */\nexport function info(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(language, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Whether this build can render `info` as TEXT (PLAN-192 D6). The export is\n * ABSENT when it cannot — the same \"presence is the capability\" signal\n * `diff` uses, so a caller tests for the function rather than for a\n * variant name.\n * @returns {boolean}\n */\nexport function info_text_supported() {\n const ret = wasm.info_text_supported();\n return ret !== 0;\n}\n\nfunction getObject(idx) { return heap[idx]; }\n\nfunction dropObject(idx) {\n if (idx < 132) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n/**\n * Convert a standalone bitmark text fragment ↔ TextAst (ProseMirror JSON).\n *\n * `direction`: `\"textToAst\"` | `\"astToText\"` | `\"astToPlainText\"`.\n * `format`: a bitmark text format (`\"bitmark++\"`, `\"bitmark+\"`) parses\n * inline marks; anything else is treated as plain text (textToAst only).\n * `location`: `\"body\"` (default) or `\"tag\"`.\n * Returns the converted fragment; throws on failure.\n * @param {string} input\n * @param {string} direction\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function convert_text(input, direction, format, location) {\n let deferred6_0;\n let deferred6_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(direction, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr5 = r0;\n var len5 = r1;\n if (r3) {\n ptr5 = 0; len5 = 0;\n throw takeObject(r2);\n }\n deferred6_0 = ptr5;\n deferred6_1 = len5;\n return getStringFromWasm0(ptr5, len5);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);\n }\n}\n\n/**\n * Apply a patch (a JSON array of patch entries) to every bit and re-emit.\n *\n * `input_format_sel`: `\"auto\"` | `\"bitmark\"` | `\"json\"`.\n * `output_format_sel`: the same vocabulary as `convert` — `\"bitmark\"` |\n * `\"json\"` | `\"text\"` | a mapping id (`\"html\"`, …), `\"auto\"` (or empty) being\n * the opposite of the resolved input format. The whole-document outputs\n * (`lex`, `semantic-tokens`, `diagnostics`) are not per-bit formats; the\n * pipeline refuses them and that refusal is what throws.\n * `patch_json`: the patch entry array (empty string = no patches, i.e. a\n * canonicalizing pass). Parallelism is a JS-side concern (web workers); this\n * runs sequentially. Returns `{ \"data\": <document text/JSON>, \"diagnostics\":\n * [ { \"path\", \"kind\", \"message\" } ] }` — the diagnostics are the entries the\n * pipeline skipped (PLAN-209 T9; `kind` is the error contract's identifier,\n * e.g. `patch-index-out-of-range`); throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} output_format_sel\n * @param {string} mode\n * @param {string} patch_json\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @returns {string}\n */\nexport function transform(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {\n let deferred7_0;\n let deferred7_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n const ptr4 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len4 = WASM_VECTOR_LEN;\n wasm.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr6 = r0;\n var len6 = r1;\n if (r3) {\n ptr6 = 0; len6 = 0;\n throw takeObject(r2);\n }\n deferred7_0 = ptr6;\n deferred7_1 = len6;\n return getStringFromWasm0(ptr6, len6);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred7_0, deferred7_1, 1);\n }\n}\n\n/**\n * Resolve a patch document against `input` (bitmark or JSON) into the\n * ordered output items, so a JS per-bit planner (hooks, worker pool) can\n * reorder, drop and insert jobs from the one Rust implementation\n * (PLAN-179). `input_format_sel` is the caller's input-format selector\n * (`\"auto\"` | `\"bitmark\"` | `\"json\"`): the document is split under the SAME\n * selection the planner already resolved, never re-sniffed (PLAN-187 D1).\n * Returns a JSON array of\n * `{ \"source\": <original index> | null, \"bit\": <inner bit> | null,\n * \"patch\": [ … ] }`; throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} patch_json\n * @returns {string}\n */\nexport function resolve_patch_document(input, input_format_sel, patch_json) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.resolve_patch_document(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Semantic diff of two documents (PLAN-179). Flat arguments like every\n * other export:\n * - `input_format`: `\"auto\"` | `\"bitmark\"` | `\"json\"` | a mapping id,\n * applied to both sides;\n * - `output_format`: `\"bitmark\"` (unified-style text) | `\"json\"` |\n * `\"patch\"`;\n * - `context`, `locate`, `similarity`, `bbox_tolerance`,\n * `spaces_around_values` as documented on `DiffOptions`.\n * Returns the diff (empty text / `[]` of unchanged bits / a patch document\n * with no entries when the documents are semantically equal); throws on\n * failure.\n * @param {string} a\n * @param {string} b\n * @param {string} input_format_sel\n * @param {string} output_format_sel\n * @param {number} context\n * @param {boolean} locate\n * @param {number} similarity\n * @param {number} bbox_tolerance\n * @param {number} spaces_around_values\n * @returns {string}\n */\nexport function diff(a, b, input_format_sel, output_format_sel, context, locate, similarity, bbox_tolerance, spaces_around_values) {\n let deferred6_0;\n let deferred6_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(a, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(b, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n wasm.diff(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, context, locate, similarity, bbox_tolerance, spaces_around_values);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr5 = r0;\n var len5 = r1;\n if (r3) {\n ptr5 = 0; len5 = 0;\n throw takeObject(r2);\n }\n deferred6_0 = ptr5;\n deferred6_1 = len5;\n return getStringFromWasm0(ptr5, len5);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);\n }\n}\n\n/**\n * The constructs valid at a position, as an LSP `CompletionList` (PLAN-196\n * D7; contract `API-EDT-editor-services.tsp`). `line` / `character` are\n * 0-based, `character` in `position_encoding` units (`\"utf-16\"`, the\n * default, or `\"utf-8\"`); `include_deprecated` offers deprecated bits too;\n * `trigger_character` is the character the editor sent as the trigger (LSP\n * `CompletionContext.triggerCharacter`; empty when invoked explicitly) — a\n * trigger that opens nothing where the cursor is answers the empty list\n * (PLAN-203 D1). ABSENT on a variant built without `editor` — the same\n * \"presence is the capability\" signal `diff` uses. Throws when the line is\n * past the text.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @param {boolean} include_deprecated\n * @param {string} trigger_character\n * @returns {string}\n */\nexport function complete(input, line, character, position_encoding, include_deprecated, trigger_character) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(trigger_character, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.complete(retptr, ptr0, len0, line, character, ptr1, len1, include_deprecated, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * One item of the list `complete` returns at this position, its Markdown\n * `documentation` filled in — LSP `completionItem/resolve` (PLAN-202):\n * `complete` ships no documentation, an editor asks for the one item it is\n * about to show. `label` and `kind` (the LSP `CompletionItemKind` number)\n * name the item; the JSON `null` when the list has no such item. Arguments\n * otherwise as `complete`.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @param {boolean} include_deprecated\n * @param {string} label\n * @param {number} kind\n * @returns {string}\n */\nexport function resolve(input, line, character, position_encoding, include_deprecated, label, kind) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(label, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.resolve(retptr, ptr0, len0, line, character, ptr1, len1, include_deprecated, ptr2, len2, kind);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * The construct at a position, as an LSP `Hover` — or the JSON `null` when\n * there is nothing to show (PLAN-196 D8). Arguments as `complete`.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @returns {string}\n */\nexport function hover(input, line, character, position_encoding) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.hover(retptr, ptr0, len0, line, character, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr3 = r0;\n var len3 = r1;\n if (r3) {\n ptr3 = 0; len3 = 0;\n throw takeObject(r2);\n }\n deferred4_0 = ptr3;\n deferred4_1 = len3;\n return getStringFromWasm0(ptr3, len3);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Register data with the parser process (PLAN-173 P12).\n *\n * `data_type`: `\"translations\"` today. One verb rather than one function per\n * registerable thing — the same discriminated-options idiom as `info`.\n *\n * `data` is the file's own text. Semantics are REPLACE: a second call\n * supersedes the first entirely, and the built-in table (where the variant\n * bakes one) stays underneath. Throws on bad data — like every other\n * fallible export (PLAN-192 D1).\n *\n * Available in EVERY variant, including those that bake nothing: that is\n * exactly where a consumer must supply the file themselves.\n * @param {string} data_type\n * @param {string} data\n */\nexport function register(data_type, data) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(data_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.register(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n if (r1) {\n throw takeObject(r0);\n }\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n}\n\n/**\n * Convert between bitmark and JSON with explicit input/output formats + mode.\n *\n * `input_format`: `\"auto\"` (default) | `\"bitmark\"` | `\"json\"` | a mapping id.\n * `output_format`: `\"auto\"` (opposite of input) | `\"bitmark\"` | `\"json\"` |\n * `\"text\"` | `\"lex\"` (the token stream as JSON) | `\"semantic-tokens\"` |\n * `\"diagnostics\"` (the last three bitmark input only) | a mapping id.\n * `mode`: `\"optimized\"` (default) | `\"full\"`.\n * `mapping_report`: replace the output with a human-readable report of the\n * input→output mappings, including inputs that are NOT mapped (PLAN-147).\n * `position_encoding`: `\"utf-16\"` (default) | `\"utf-8\"` — the\n * `semantic-tokens` and `diagnostics` outputs' encoding (PLAN-193 /\n * PLAN-196) — and `tokens_layout`: `\"lsp\"` (default) | `\"absolute\"` — the\n * `semantic-tokens` layout; `\"\"` means the default, and every other output\n * format ignores them.\n * Returns the converted text/JSON; throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} output_format_sel\n * @param {string} mode\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @param {boolean} include_unknown_properties\n * @param {boolean} mapping_report\n * @param {string} position_encoding\n * @param {string} tokens_layout\n * @returns {string}\n */\nexport function convert(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, position_encoding, tokens_layout) {\n let deferred8_0;\n let deferred8_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n const ptr4 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len4 = WASM_VECTOR_LEN;\n const ptr5 = passStringToWasm0(tokens_layout, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len5 = WASM_VECTOR_LEN;\n wasm.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, ptr4, len4, ptr5, len5);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr7 = r0;\n var len7 = r1;\n if (r3) {\n ptr7 = 0; len7 = 0;\n throw takeObject(r2);\n }\n deferred8_0 = ptr7;\n deferred8_1 = len7;\n return getStringFromWasm0(ptr7, len7);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred8_0, deferred8_1, 1);\n }\n}\n\n/**\n * Re-emit input in its own format in canonical form at `mode`.\n *\n * `input_format`: `\"auto\"` (default) | `\"bitmark\"` | `\"json\"` | any config\n * mapping id (`html`, `xml`, …). The output is re-emitted in this same format.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} mode\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @returns {string}\n */\nexport function canonicalize(input, input_format_sel, mode, pretty, indent, spaces_around_values) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Count the bits in `input` (auto-detecting bitmark vs JSON).\n * Returns the count as a decimal string; throws on failure.\n * @param {string} input\n * @returns {string}\n */\nexport function count_bits(input) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.count_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0; len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Split a bitmark document into per-bit source slices.\n *\n * Returns a JSON array of `{ index, byteStart, byteEnd, source }`. Lets a JS\n * caller chunk a document at bit boundaries (e.g. to feed a worker pool).\n * @param {string} input\n * @returns {string}\n */\nexport function split_bits(input) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.split_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n}\n\n/**\n * Whether `input` looks like bitmark (vs JSON). Mirrors the auto-detection\n * used across the API so a JS caller can resolve `\"auto\"` consistently.\n * @param {string} input\n * @returns {boolean}\n */\nexport function is_bitmark(input) {\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.is_bitmark(ptr0, len0);\n return ret !== 0;\n}\n\n/**\n * Split a JSON document (a top-level array of bit envelopes) into its per-bit\n * envelope objects, returned as a JSON array string. Lets a JS caller iterate\n * JSON-input bits for per-bit hooks (the JSON counterpart of [`split_bits`]).\n * Throws if the input is not a JSON array of bits.\n * @param {string} input\n * @returns {string}\n */\nexport function split_json_bits(input) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.split_json_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0; len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Pretty-print a compact JSON string with the given indent. Used to format a\n * document recombined on the JS side (the per-bit hook path) so its output\n * matches the in-Rust recombination byte-for-byte.\n * @param {string} json\n * @param {number} indent\n * @returns {string}\n */\nexport function prettify(json, indent) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.prettify(retptr, ptr0, len0, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbindgen_error_new = function(arg0, arg1) {\n const ret = new Error(getStringFromWasm0(arg0, arg1));\n return addHeapObject(ret);\n };\n\n return imports;\n}\n\nfunction __wbg_init_memory(imports, memory) {\n\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n __wbg_init_memory(imports);\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('bitmark_wasm_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n __wbg_init_memory(imports);\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n","let wasm;\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nconst heap = new Array(128).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nlet heap_next = heap.length;\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nconst cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * `sub_location`: `\"text\"` (default) or `\"attrValue\"` — the value half of an\n * inline-attr chain segment (`==t==|link:VALUE|`), which escapes `|` and\n * skips the running-text rules (PLAN-211)\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @param {string | null} [sub_location]\n * @returns {string}\n */\nexport function breakscape_text(input, format, location, sub_location) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n var len3 = WASM_VECTOR_LEN;\n wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * `sub_location`: accepted and IGNORED — unbreakscape is sub-location\n * independent for bitmarkText, so one inverse undoes every breakscape mode\n * (PLAN-211 D5a)\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @param {string | null} [sub_location]\n * @returns {string}\n */\nexport function unbreakscape_text(input, format, location, sub_location) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n var len3 = WASM_VECTOR_LEN;\n wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Query information about supported bit types.\n *\n * `info_type`: `\"list\"`, `\"bit\"`, `\"all\"`, `\"deprecated\"`, `\"bit-groups\"`,\n * or `\"resource-groups\"`\n * `format`: `\"text\"` or `\"json\"`\n * `bit`: bit name (required when `info_type` is `\"bit\"`)\n * `pretty`: whether to pretty-print JSON output\n * `indent`: indent size for pretty-printing (default: 2)\n * `include_deprecated`: include deprecated bits in `list`/`all` (PLAN-149)\n * `only_deprecated`: restrict `list`/`all` to deprecated bits (wins over\n * `include_deprecated`)\n * `full`: complete outline for `bit`/`all` (default is the compact\n * one-line-per-tag view)\n * `language`: BCP-47 tag(s) for display names — \"\" = English, `\"de,fr\"` for\n * several (adds a `titles` map), `\"all\"` for every resolvable language\n * @param {string} info_type\n * @param {string} format\n * @param {string} bit\n * @param {boolean} pretty\n * @param {number} indent\n * @param {boolean} include_deprecated\n * @param {boolean} only_deprecated\n * @param {boolean} full\n * @param {string} language\n * @returns {string}\n */\nexport function info(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(language, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Whether this build can render `info` as TEXT (PLAN-192 D6). The export is\n * ABSENT when it cannot — the same \"presence is the capability\" signal\n * `diff` uses, so a caller tests for the function rather than for a\n * variant name.\n * @returns {boolean}\n */\nexport function info_text_supported() {\n const ret = wasm.info_text_supported();\n return ret !== 0;\n}\n\nfunction getObject(idx) { return heap[idx]; }\n\nfunction dropObject(idx) {\n if (idx < 132) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n/**\n * Convert a standalone bitmark text fragment ↔ TextAst (ProseMirror JSON).\n *\n * `direction`: `\"textToAst\"` | `\"astToText\"` | `\"astToPlainText\"`.\n * `format`: a bitmark text format (`\"bitmark++\"`, `\"bitmark+\"`) parses\n * inline marks; anything else is treated as plain text (textToAst only).\n * `location`: `\"body\"` (default) or `\"tag\"`.\n * Returns the converted fragment; throws on failure.\n * @param {string} input\n * @param {string} direction\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function convert_text(input, direction, format, location) {\n let deferred6_0;\n let deferred6_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(direction, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr5 = r0;\n var len5 = r1;\n if (r3) {\n ptr5 = 0; len5 = 0;\n throw takeObject(r2);\n }\n deferred6_0 = ptr5;\n deferred6_1 = len5;\n return getStringFromWasm0(ptr5, len5);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);\n }\n}\n\n/**\n * Apply a patch (a JSON array of patch entries) to every bit and re-emit.\n *\n * `input_format_sel`: `\"auto\"` | `\"bitmark\"` | `\"json\"`.\n * `output_format_sel`: the same vocabulary as `convert` — `\"bitmark\"` |\n * `\"json\"` | `\"text\"` | a mapping id (`\"html\"`, …), `\"auto\"` (or empty) being\n * the opposite of the resolved input format. The whole-document outputs\n * (`lex`, `semantic-tokens`, `diagnostics`) are not per-bit formats; the\n * pipeline refuses them and that refusal is what throws.\n * `patch_json`: the patch entry array (empty string = no patches, i.e. a\n * canonicalizing pass). Parallelism is a JS-side concern (web workers); this\n * runs sequentially. Returns `{ \"data\": <document text/JSON>, \"diagnostics\":\n * [ { \"path\", \"kind\", \"message\" } ] }` — the diagnostics are the entries the\n * pipeline skipped (PLAN-209 T9; `kind` is the error contract's identifier,\n * e.g. `patch-index-out-of-range`); throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} output_format_sel\n * @param {string} mode\n * @param {string} patch_json\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @returns {string}\n */\nexport function transform(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {\n let deferred7_0;\n let deferred7_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n const ptr4 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len4 = WASM_VECTOR_LEN;\n wasm.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr6 = r0;\n var len6 = r1;\n if (r3) {\n ptr6 = 0; len6 = 0;\n throw takeObject(r2);\n }\n deferred7_0 = ptr6;\n deferred7_1 = len6;\n return getStringFromWasm0(ptr6, len6);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred7_0, deferred7_1, 1);\n }\n}\n\n/**\n * Resolve a patch document against `input` (bitmark or JSON) into the\n * ordered output items, so a JS per-bit planner (hooks, worker pool) can\n * reorder, drop and insert jobs from the one Rust implementation\n * (PLAN-179). `input_format_sel` is the caller's input-format selector\n * (`\"auto\"` | `\"bitmark\"` | `\"json\"`): the document is split under the SAME\n * selection the planner already resolved, never re-sniffed (PLAN-187 D1).\n * Returns a JSON array of\n * `{ \"source\": <original index> | null, \"bit\": <inner bit> | null,\n * \"patch\": [ … ] }`; throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} patch_json\n * @returns {string}\n */\nexport function resolve_patch_document(input, input_format_sel, patch_json) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.resolve_patch_document(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Semantic diff of two documents (PLAN-179). Flat arguments like every\n * other export:\n * - `input_format`: `\"auto\"` | `\"bitmark\"` | `\"json\"` | a mapping id,\n * applied to both sides;\n * - `output_format`: `\"bitmark\"` (unified-style text) | `\"json\"` |\n * `\"patch\"`;\n * - `context`, `locate`, `similarity`, `bbox_tolerance`,\n * `spaces_around_values` as documented on `DiffOptions`.\n * Returns the diff (empty text / `[]` of unchanged bits / a patch document\n * with no entries when the documents are semantically equal); throws on\n * failure.\n * @param {string} a\n * @param {string} b\n * @param {string} input_format_sel\n * @param {string} output_format_sel\n * @param {number} context\n * @param {boolean} locate\n * @param {number} similarity\n * @param {number} bbox_tolerance\n * @param {number} spaces_around_values\n * @returns {string}\n */\nexport function diff(a, b, input_format_sel, output_format_sel, context, locate, similarity, bbox_tolerance, spaces_around_values) {\n let deferred6_0;\n let deferred6_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(a, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(b, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n wasm.diff(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, context, locate, similarity, bbox_tolerance, spaces_around_values);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr5 = r0;\n var len5 = r1;\n if (r3) {\n ptr5 = 0; len5 = 0;\n throw takeObject(r2);\n }\n deferred6_0 = ptr5;\n deferred6_1 = len5;\n return getStringFromWasm0(ptr5, len5);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);\n }\n}\n\n/**\n * The constructs valid at a position, as an LSP `CompletionList` (PLAN-196\n * D7; contract `API-EDT-editor-services.tsp`). `line` / `character` are\n * 0-based, `character` in `position_encoding` units (`\"utf-16\"`, the\n * default, or `\"utf-8\"`); `include_deprecated` offers deprecated bits too;\n * `trigger_character` is the character the editor sent as the trigger (LSP\n * `CompletionContext.triggerCharacter`; empty when invoked explicitly) — a\n * trigger that opens nothing where the cursor is answers the empty list\n * (PLAN-203 D1). ABSENT on a variant built without `editor` — the same\n * \"presence is the capability\" signal `diff` uses. Throws when the line is\n * past the text.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @param {boolean} include_deprecated\n * @param {string} trigger_character\n * @returns {string}\n */\nexport function complete(input, line, character, position_encoding, include_deprecated, trigger_character) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(trigger_character, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.complete(retptr, ptr0, len0, line, character, ptr1, len1, include_deprecated, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * One item of the list `complete` returns at this position, its Markdown\n * `documentation` filled in — LSP `completionItem/resolve` (PLAN-202):\n * `complete` ships no documentation, an editor asks for the one item it is\n * about to show. `label` and `kind` (the LSP `CompletionItemKind` number)\n * name the item; the JSON `null` when the list has no such item. Arguments\n * otherwise as `complete`.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @param {boolean} include_deprecated\n * @param {string} label\n * @param {number} kind\n * @returns {string}\n */\nexport function resolve(input, line, character, position_encoding, include_deprecated, label, kind) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(label, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.resolve(retptr, ptr0, len0, line, character, ptr1, len1, include_deprecated, ptr2, len2, kind);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * The construct at a position, as an LSP `Hover` — or the JSON `null` when\n * there is nothing to show (PLAN-196 D8). Arguments as `complete`.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @returns {string}\n */\nexport function hover(input, line, character, position_encoding) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.hover(retptr, ptr0, len0, line, character, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr3 = r0;\n var len3 = r1;\n if (r3) {\n ptr3 = 0; len3 = 0;\n throw takeObject(r2);\n }\n deferred4_0 = ptr3;\n deferred4_1 = len3;\n return getStringFromWasm0(ptr3, len3);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Register data with the parser process (PLAN-173 P12).\n *\n * `data_type`: `\"translations\"` today. One verb rather than one function per\n * registerable thing — the same discriminated-options idiom as `info`.\n *\n * `data` is the file's own text. Semantics are REPLACE: a second call\n * supersedes the first entirely, and the built-in table (where the variant\n * bakes one) stays underneath. Throws on bad data — like every other\n * fallible export (PLAN-192 D1).\n *\n * Available in EVERY variant, including those that bake nothing: that is\n * exactly where a consumer must supply the file themselves.\n * @param {string} data_type\n * @param {string} data\n */\nexport function register(data_type, data) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(data_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.register(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n if (r1) {\n throw takeObject(r0);\n }\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n}\n\n/**\n * Convert between bitmark and JSON with explicit input/output formats + mode.\n *\n * `input_format`: `\"auto\"` (default) | `\"bitmark\"` | `\"json\"` | a mapping id.\n * `output_format`: `\"auto\"` (opposite of input) | `\"bitmark\"` | `\"json\"` |\n * `\"text\"` | `\"lex\"` (the token stream as JSON) | `\"semantic-tokens\"` |\n * `\"diagnostics\"` (the last three bitmark input only) | a mapping id.\n * `mode`: `\"optimized\"` (default) | `\"full\"`.\n * `mapping_report`: replace the output with a human-readable report of the\n * input→output mappings, including inputs that are NOT mapped (PLAN-147).\n * `position_encoding`: `\"utf-16\"` (default) | `\"utf-8\"` — the\n * `semantic-tokens` and `diagnostics` outputs' encoding (PLAN-193 /\n * PLAN-196) — and `tokens_layout`: `\"lsp\"` (default) | `\"absolute\"` — the\n * `semantic-tokens` layout; `\"\"` means the default, and every other output\n * format ignores them.\n * Returns the converted text/JSON; throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} output_format_sel\n * @param {string} mode\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @param {boolean} include_unknown_properties\n * @param {boolean} mapping_report\n * @param {string} position_encoding\n * @param {string} tokens_layout\n * @returns {string}\n */\nexport function convert(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, position_encoding, tokens_layout) {\n let deferred8_0;\n let deferred8_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n const ptr4 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len4 = WASM_VECTOR_LEN;\n const ptr5 = passStringToWasm0(tokens_layout, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len5 = WASM_VECTOR_LEN;\n wasm.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, ptr4, len4, ptr5, len5);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr7 = r0;\n var len7 = r1;\n if (r3) {\n ptr7 = 0; len7 = 0;\n throw takeObject(r2);\n }\n deferred8_0 = ptr7;\n deferred8_1 = len7;\n return getStringFromWasm0(ptr7, len7);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred8_0, deferred8_1, 1);\n }\n}\n\n/**\n * Re-emit input in its own format in canonical form at `mode`.\n *\n * `input_format`: `\"auto\"` (default) | `\"bitmark\"` | `\"json\"` | any config\n * mapping id (`html`, `xml`, …). The output is re-emitted in this same format.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} mode\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @returns {string}\n */\nexport function canonicalize(input, input_format_sel, mode, pretty, indent, spaces_around_values) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Count the bits in `input` (auto-detecting bitmark vs JSON).\n * Returns the count as a decimal string; throws on failure.\n * @param {string} input\n * @returns {string}\n */\nexport function count_bits(input) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.count_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0; len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Split a bitmark document into per-bit source slices.\n *\n * Returns a JSON array of `{ index, byteStart, byteEnd, source }`. Lets a JS\n * caller chunk a document at bit boundaries (e.g. to feed a worker pool).\n * @param {string} input\n * @returns {string}\n */\nexport function split_bits(input) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.split_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n}\n\n/**\n * Whether `input` looks like bitmark (vs JSON). Mirrors the auto-detection\n * used across the API so a JS caller can resolve `\"auto\"` consistently.\n * @param {string} input\n * @returns {boolean}\n */\nexport function is_bitmark(input) {\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.is_bitmark(ptr0, len0);\n return ret !== 0;\n}\n\n/**\n * Split a JSON document (a top-level array of bit envelopes) into its per-bit\n * envelope objects, returned as a JSON array string. Lets a JS caller iterate\n * JSON-input bits for per-bit hooks (the JSON counterpart of [`split_bits`]).\n * Throws if the input is not a JSON array of bits.\n * @param {string} input\n * @returns {string}\n */\nexport function split_json_bits(input) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.split_json_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0; len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Pretty-print a compact JSON string with the given indent. Used to format a\n * document recombined on the JS side (the per-bit hook path) so its output\n * matches the in-Rust recombination byte-for-byte.\n * @param {string} json\n * @param {number} indent\n * @returns {string}\n */\nexport function prettify(json, indent) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.prettify(retptr, ptr0, len0, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbindgen_error_new = function(arg0, arg1) {\n const ret = new Error(getStringFromWasm0(arg0, arg1));\n return addHeapObject(ret);\n };\n\n return imports;\n}\n\nfunction __wbg_init_memory(imports, memory) {\n\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n __wbg_init_memory(imports);\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('bitmark_browser_full_wasm_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n __wbg_init_memory(imports);\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n","let wasm;\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nconst heap = new Array(128).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nlet heap_next = heap.length;\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nconst cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * `sub_location`: `\"text\"` (default) or `\"attrValue\"` — the value half of an\n * inline-attr chain segment (`==t==|link:VALUE|`), which escapes `|` and\n * skips the running-text rules (PLAN-211)\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @param {string | null} [sub_location]\n * @returns {string}\n */\nexport function breakscape_text(input, format, location, sub_location) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n var len3 = WASM_VECTOR_LEN;\n wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * `sub_location`: accepted and IGNORED — unbreakscape is sub-location\n * independent for bitmarkText, so one inverse undoes every breakscape mode\n * (PLAN-211 D5a)\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @param {string | null} [sub_location]\n * @returns {string}\n */\nexport function unbreakscape_text(input, format, location, sub_location) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n var len3 = WASM_VECTOR_LEN;\n wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Query information about supported bit types.\n *\n * `info_type`: `\"list\"`, `\"bit\"`, `\"all\"`, `\"deprecated\"`, `\"bit-groups\"`,\n * or `\"resource-groups\"`\n * `format`: `\"text\"` or `\"json\"`\n * `bit`: bit name (required when `info_type` is `\"bit\"`)\n * `pretty`: whether to pretty-print JSON output\n * `indent`: indent size for pretty-printing (default: 2)\n * `include_deprecated`: include deprecated bits in `list`/`all` (PLAN-149)\n * `only_deprecated`: restrict `list`/`all` to deprecated bits (wins over\n * `include_deprecated`)\n * `full`: complete outline for `bit`/`all` (default is the compact\n * one-line-per-tag view)\n * `language`: BCP-47 tag(s) for display names — \"\" = English, `\"de,fr\"` for\n * several (adds a `titles` map), `\"all\"` for every resolvable language\n * @param {string} info_type\n * @param {string} format\n * @param {string} bit\n * @param {boolean} pretty\n * @param {number} indent\n * @param {boolean} include_deprecated\n * @param {boolean} only_deprecated\n * @param {boolean} full\n * @param {string} language\n * @returns {string}\n */\nexport function info(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(language, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred5_0 = r0;\n deferred5_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\nfunction getObject(idx) { return heap[idx]; }\n\nfunction dropObject(idx) {\n if (idx < 132) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n/**\n * Register data with the parser process (PLAN-173 P12).\n *\n * `data_type`: `\"translations\"` today. One verb rather than one function per\n * registerable thing — the same discriminated-options idiom as `info`.\n *\n * `data` is the file's own text. Semantics are REPLACE: a second call\n * supersedes the first entirely, and the built-in table (where the variant\n * bakes one) stays underneath. Throws on bad data — like every other\n * fallible export (PLAN-192 D1).\n *\n * Available in EVERY variant, including those that bake nothing: that is\n * exactly where a consumer must supply the file themselves.\n * @param {string} data_type\n * @param {string} data\n */\nexport function register(data_type, data) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(data_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.register(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n if (r1) {\n throw takeObject(r0);\n }\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n}\n\n/**\n * Apply a patch (a JSON array of patch entries) to every bit and re-emit.\n *\n * `input_format_sel`: `\"auto\"` | `\"bitmark\"` | `\"json\"`.\n * `output_format_sel`: the same vocabulary as `convert` — `\"bitmark\"` |\n * `\"json\"` | `\"text\"` | a mapping id (`\"html\"`, …), `\"auto\"` (or empty) being\n * the opposite of the resolved input format. The whole-document outputs\n * (`lex`, `semantic-tokens`, `diagnostics`) are not per-bit formats; the\n * pipeline refuses them and that refusal is what throws.\n * `patch_json`: the patch entry array (empty string = no patches, i.e. a\n * canonicalizing pass). Parallelism is a JS-side concern (web workers); this\n * runs sequentially. Returns `{ \"data\": <document text/JSON>, \"diagnostics\":\n * [ { \"path\", \"kind\", \"message\" } ] }` — the diagnostics are the entries the\n * pipeline skipped (PLAN-209 T9; `kind` is the error contract's identifier,\n * e.g. `patch-index-out-of-range`); throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} output_format_sel\n * @param {string} mode\n * @param {string} patch_json\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @returns {string}\n */\nexport function transform(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {\n let deferred7_0;\n let deferred7_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n const ptr4 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len4 = WASM_VECTOR_LEN;\n wasm.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr6 = r0;\n var len6 = r1;\n if (r3) {\n ptr6 = 0; len6 = 0;\n throw takeObject(r2);\n }\n deferred7_0 = ptr6;\n deferred7_1 = len6;\n return getStringFromWasm0(ptr6, len6);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred7_0, deferred7_1, 1);\n }\n}\n\n/**\n * Resolve a patch document against `input` (bitmark or JSON) into the\n * ordered output items, so a JS per-bit planner (hooks, worker pool) can\n * reorder, drop and insert jobs from the one Rust implementation\n * (PLAN-179). `input_format_sel` is the caller's input-format selector\n * (`\"auto\"` | `\"bitmark\"` | `\"json\"`): the document is split under the SAME\n * selection the planner already resolved, never re-sniffed (PLAN-187 D1).\n * Returns a JSON array of\n * `{ \"source\": <original index> | null, \"bit\": <inner bit> | null,\n * \"patch\": [ … ] }`; throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} patch_json\n * @returns {string}\n */\nexport function resolve_patch_document(input, input_format_sel, patch_json) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.resolve_patch_document(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * The constructs valid at a position, as an LSP `CompletionList` (PLAN-196\n * D7; contract `API-EDT-editor-services.tsp`). `line` / `character` are\n * 0-based, `character` in `position_encoding` units (`\"utf-16\"`, the\n * default, or `\"utf-8\"`); `include_deprecated` offers deprecated bits too;\n * `trigger_character` is the character the editor sent as the trigger (LSP\n * `CompletionContext.triggerCharacter`; empty when invoked explicitly) — a\n * trigger that opens nothing where the cursor is answers the empty list\n * (PLAN-203 D1). ABSENT on a variant built without `editor` — the same\n * \"presence is the capability\" signal `diff` uses. Throws when the line is\n * past the text.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @param {boolean} include_deprecated\n * @param {string} trigger_character\n * @returns {string}\n */\nexport function complete(input, line, character, position_encoding, include_deprecated, trigger_character) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(trigger_character, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.complete(retptr, ptr0, len0, line, character, ptr1, len1, include_deprecated, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * One item of the list `complete` returns at this position, its Markdown\n * `documentation` filled in — LSP `completionItem/resolve` (PLAN-202):\n * `complete` ships no documentation, an editor asks for the one item it is\n * about to show. `label` and `kind` (the LSP `CompletionItemKind` number)\n * name the item; the JSON `null` when the list has no such item. Arguments\n * otherwise as `complete`.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @param {boolean} include_deprecated\n * @param {string} label\n * @param {number} kind\n * @returns {string}\n */\nexport function resolve(input, line, character, position_encoding, include_deprecated, label, kind) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(label, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.resolve(retptr, ptr0, len0, line, character, ptr1, len1, include_deprecated, ptr2, len2, kind);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * The construct at a position, as an LSP `Hover` — or the JSON `null` when\n * there is nothing to show (PLAN-196 D8). Arguments as `complete`.\n * @param {string} input\n * @param {number} line\n * @param {number} character\n * @param {string} position_encoding\n * @returns {string}\n */\nexport function hover(input, line, character, position_encoding) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.hover(retptr, ptr0, len0, line, character, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr3 = r0;\n var len3 = r1;\n if (r3) {\n ptr3 = 0; len3 = 0;\n throw takeObject(r2);\n }\n deferred4_0 = ptr3;\n deferred4_1 = len3;\n return getStringFromWasm0(ptr3, len3);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Convert between bitmark and JSON with explicit input/output formats + mode.\n *\n * `input_format`: `\"auto\"` (default) | `\"bitmark\"` | `\"json\"` | a mapping id.\n * `output_format`: `\"auto\"` (opposite of input) | `\"bitmark\"` | `\"json\"` |\n * `\"text\"` | `\"lex\"` (the token stream as JSON) | `\"semantic-tokens\"` |\n * `\"diagnostics\"` (the last three bitmark input only) | a mapping id.\n * `mode`: `\"optimized\"` (default) | `\"full\"`.\n * `mapping_report`: replace the output with a human-readable report of the\n * input→output mappings, including inputs that are NOT mapped (PLAN-147).\n * `position_encoding`: `\"utf-16\"` (default) | `\"utf-8\"` — the\n * `semantic-tokens` and `diagnostics` outputs' encoding (PLAN-193 /\n * PLAN-196) — and `tokens_layout`: `\"lsp\"` (default) | `\"absolute\"` — the\n * `semantic-tokens` layout; `\"\"` means the default, and every other output\n * format ignores them.\n * Returns the converted text/JSON; throws on failure.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} output_format_sel\n * @param {string} mode\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @param {boolean} include_unknown_properties\n * @param {boolean} mapping_report\n * @param {string} position_encoding\n * @param {string} tokens_layout\n * @returns {string}\n */\nexport function convert(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, position_encoding, tokens_layout) {\n let deferred8_0;\n let deferred8_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n const ptr4 = passStringToWasm0(position_encoding, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len4 = WASM_VECTOR_LEN;\n const ptr5 = passStringToWasm0(tokens_layout, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len5 = WASM_VECTOR_LEN;\n wasm.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report, ptr4, len4, ptr5, len5);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr7 = r0;\n var len7 = r1;\n if (r3) {\n ptr7 = 0; len7 = 0;\n throw takeObject(r2);\n }\n deferred8_0 = ptr7;\n deferred8_1 = len7;\n return getStringFromWasm0(ptr7, len7);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred8_0, deferred8_1, 1);\n }\n}\n\n/**\n * Re-emit input in its own format in canonical form at `mode`.\n *\n * `input_format`: `\"auto\"` (default) | `\"bitmark\"` | `\"json\"` | any config\n * mapping id (`html`, `xml`, …). The output is re-emitted in this same format.\n * @param {string} input\n * @param {string} input_format_sel\n * @param {string} mode\n * @param {boolean} pretty\n * @param {number} indent\n * @param {number} spaces_around_values\n * @returns {string}\n */\nexport function canonicalize(input, input_format_sel, mode, pretty, indent, spaces_around_values) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * Count the bits in `input` (auto-detecting bitmark vs JSON).\n * Returns the count as a decimal string; throws on failure.\n * @param {string} input\n * @returns {string}\n */\nexport function count_bits(input) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.count_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0; len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Split a bitmark document into per-bit source slices.\n *\n * Returns a JSON array of `{ index, byteStart, byteEnd, source }`. Lets a JS\n * caller chunk a document at bit boundaries (e.g. to feed a worker pool).\n * @param {string} input\n * @returns {string}\n */\nexport function split_bits(input) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.split_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n}\n\n/**\n * Whether `input` looks like bitmark (vs JSON). Mirrors the auto-detection\n * used across the API so a JS caller can resolve `\"auto\"` consistently.\n * @param {string} input\n * @returns {boolean}\n */\nexport function is_bitmark(input) {\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.is_bitmark(ptr0, len0);\n return ret !== 0;\n}\n\n/**\n * Split a JSON document (a top-level array of bit envelopes) into its per-bit\n * envelope objects, returned as a JSON array string. Lets a JS caller iterate\n * JSON-input bits for per-bit hooks (the JSON counterpart of [`split_bits`]).\n * Throws if the input is not a JSON array of bits.\n * @param {string} input\n * @returns {string}\n */\nexport function split_json_bits(input) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.split_json_bits(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0; len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Pretty-print a compact JSON string with the given indent. Used to format a\n * document recombined on the JS side (the per-bit hook path) so its output\n * matches the in-Rust recombination byte-for-byte.\n * @param {string} json\n * @param {number} indent\n * @returns {string}\n */\nexport function prettify(json, indent) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.prettify(retptr, ptr0, len0, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n}\n\n/**\n * Convert a standalone bitmark text fragment ↔ TextAst (ProseMirror JSON).\n *\n * `direction`: `\"textToAst\"` | `\"astToText\"` | `\"astToPlainText\"`.\n * `format`: a bitmark text format (`\"bitmark++\"`, `\"bitmark+\"`) parses\n * inline marks; anything else is treated as plain text (textToAst only).\n * `location`: `\"body\"` (default) or `\"tag\"`.\n * Returns the converted fragment; throws on failure.\n * @param {string} input\n * @param {string} direction\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function convert_text(input, direction, format, location) {\n let deferred6_0;\n let deferred6_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(direction, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len3 = WASM_VECTOR_LEN;\n wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr5 = r0;\n var len5 = r1;\n if (r3) {\n ptr5 = 0; len5 = 0;\n throw takeObject(r2);\n }\n deferred6_0 = ptr5;\n deferred6_1 = len5;\n return getStringFromWasm0(ptr5, len5);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);\n }\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbindgen_error_new = function(arg0, arg1) {\n const ret = new Error(getStringFromWasm0(arg0, arg1));\n return addHeapObject(ret);\n };\n\n return imports;\n}\n\nfunction __wbg_init_memory(imports, memory) {\n\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n __wbg_init_memory(imports);\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('bitmark_json_wasm_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n __wbg_init_memory(imports);\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n","// This file is automatically generated. DO NOT EDIT.\n\n/* eslint-disable */\n\nexport const PACKAGE_INFO = {\n \"name\": \"@gmb/bitmark-parser\",\n \"version\": \"7.6.0\",\n \"author\": \"Get More Brain Ltd <info@getmorebrain.com>\",\n \"license\": \"ISC\",\n \"description\": \"A parser for bitmark text, powered by WebAssembly.\"\n};\n","// @zen-component: TS-VariantFacade\n//\n// Runtime variant selection (PLAN-166). The package ships one API surface\n// backed by a mutable reference to the ACTIVE wasm module; `init({ feature })`\n// selects which wasm variant backs it, and a later re-init swaps the module\n// atomically between calls (every wasm call is stateless string → string).\n// Platform entries (Node / browser) own the loading; this module owns the\n// reference, the feature vocabulary, and the error types.\n\nimport type { PatchDiagnostic } from \"../types.js\";\n\n/**\n * A deployable wasm feature set (PLAN-174).\n *\n * - `full` — everything, including the `info` META layer (tag descriptions,\n * group provenance, raw mappingKeys patterns). Native-CLI parity.\n * - `browser-full` — the same conversion capabilities as `full`, minus the\n * meta strings the browser should not pay to download.\n * - `bitmark-json` — bitmark ↔ JSON only.\n *\n * Size gating follows the DELIVERY CHANNEL, not the compilation target: a Node\n * backend loading wasm from disk has native-CLI requirements, while any entry\n * can be bundled for the browser. So every variant is buildable for both\n * targets and richness is always chosen explicitly. The per-entry defaults\n * below are conveniences; the contract is \"you get the variant you selected\".\n */\nexport type Feature = \"full\" | \"browser-full\" | \"bitmark-json\";\n\n/** Default variant for the Node entry — disk-loaded wasm, no download budget. */\nexport const NODE_DEFAULT_FEATURE: Feature = \"full\";\n\n/** Default variant for the browser entry — download latency is the budget. */\nexport const BROWSER_DEFAULT_FEATURE: Feature = \"browser-full\";\n\n/**\n * The wasm surface the shared wrappers drive. The optional members are the\n * capabilities a lean variant compiles out (calling their wrapper there\n * throws {@link UnsupportedFeatureError}).\n *\n * Every fallible member THROWS a JavaScript `Error` on failure (PLAN-192 D1);\n * its `message` is the core's error contract, `<kind> at <path>: <message>`,\n * with `<kind>` a stable kebab-case identifier. A returned string is always a\n * result — there is no in-band error prefix to test for.\n */\nexport interface WasmModule {\n convert(\n input: string,\n inputFormat: string,\n outputFormat: string,\n mode: string,\n pretty: boolean,\n indent: number,\n spacesAroundValues: number,\n includeUnknownProperties: boolean,\n mappingReport: boolean,\n /** `semantic-tokens` output only: `\"utf-16\"` | `\"utf-8\"`, `\"\"` = default (PLAN-193). */\n positionEncoding: string,\n /** `semantic-tokens` output only: `\"lsp\"` | `\"absolute\"`, `\"\"` = default. */\n tokensLayout: string,\n ): string;\n canonicalize(\n input: string,\n inputFormat: string,\n mode: string,\n pretty: boolean,\n indent: number,\n spacesAroundValues: number,\n ): string;\n transform(\n input: string,\n inputFormat: string,\n outputFormat: string,\n mode: string,\n patchJson: string,\n pretty: boolean,\n indent: number,\n spacesAroundValues: number,\n ): string;\n info(\n infoType: string,\n format: string,\n bit: string,\n pretty: boolean,\n indent: number,\n includeDeprecated: boolean,\n onlyDeprecated: boolean,\n full: boolean,\n language: string,\n ): string;\n /** Throws when the data is not valid for `dataType`. */\n register(dataType: string, data: string): void;\n count_bits(input: string): string;\n split_bits(input: string): string;\n split_json_bits(input: string): string;\n is_bitmark(input: string): boolean;\n prettify(json: string, indent: number): string;\n convert_text(input: string, direction: string, format: string, location: string): string;\n breakscape_text(input: string, format: string, location: string, subLocation: string): string;\n unbreakscape_text(input: string, format: string, location: string, subLocation: string): string;\n /**\n * Resolve a patch document against a document into ordered items\n * (PLAN-179), splitting it under `inputFormat` (`\"auto\"` | `\"bitmark\"` |\n * `\"json\"`) — the selector the caller already resolved, never a re-sniff.\n */\n resolve_patch_document(input: string, inputFormat: string, patchJson: string): string;\n /**\n * Present only where this build can render `info` as TEXT (PLAN-192 D6) —\n * the same \"presence is the capability\" signal as `diff`, so no caller\n * has to test for a variant name. Absent on `bitmark-json`, where `info`\n * serves JSON only.\n */\n info_text_supported?(): boolean;\n /** Completion at a position (PLAN-196); absent on a variant built without `editor`. */\n complete?(\n input: string,\n line: number,\n character: number,\n positionEncoding: string,\n includeDeprecated: boolean,\n triggerCharacter: string,\n ): string;\n /** One completion item with its documentation (PLAN-202); absent on a variant built without `editor`. */\n resolve?(\n input: string,\n line: number,\n character: number,\n positionEncoding: string,\n includeDeprecated: boolean,\n label: string,\n kind: number,\n ): string;\n /** Hover at a position (PLAN-196); absent on a variant built without `editor`. */\n hover?(input: string, line: number, character: number, positionEncoding: string): string;\n /** Semantic diff (PLAN-179); absent on a variant built without `diff`. */\n diff?(\n a: string,\n b: string,\n inputFormat: string,\n outputFormat: string,\n context: number,\n locate: boolean,\n similarity: number,\n bboxTolerance: number,\n spacesAroundValues: number,\n ): string;\n}\n\n/** Options accepted by `init` / `initSync` on every platform entry. */\nexport interface InitOptions {\n /** Which wasm variant to load. Default: `\"full\"`. */\n feature?: Feature;\n}\n\n/** A call arrived before any wasm module was initialised (browser only). */\nexport class NotInitializedError extends Error {\n constructor() {\n super(\"wasm not initialised: call init() (or init({ feature: … })) first\");\n this.name = \"NotInitializedError\";\n }\n}\n\n/** `register` rejected the supplied data. */\nexport class RegisterError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"RegisterError\";\n }\n}\n\n/**\n * `transform` skipped one or more patch entries (PLAN-209 T9). The document\n * was NOT returned: a silently ignored edit is worse than an error. Each\n * diagnostic names the entry's `path`, the error contract's `kind`\n * (`patch-parse-error`, `patch-index-out-of-range`, `patch-type-mismatch`)\n * and a `message`.\n */\nexport class PatchError extends Error {\n readonly diagnostics: PatchDiagnostic[];\n constructor(diagnostics: PatchDiagnostic[]) {\n const lines = diagnostics.map((d) => `${d.kind} at ${d.path}: ${d.message}`);\n super(\n `${diagnostics.length} patch ${diagnostics.length === 1 ? \"entry was\" : \"entries were\"} skipped:\\n` +\n lines.join(\"\\n\"),\n );\n this.name = \"PatchError\";\n this.diagnostics = diagnostics;\n }\n}\n\n/** A call needs a capability the ACTIVE wasm variant compiled out. */\nexport class UnsupportedFeatureError extends Error {\n constructor(what: string, active: Feature | undefined) {\n super(\n `${what} is not available in the loaded wasm module` +\n `${active ? ` (feature: \"${active}\")` : \"\"}; init({ feature: \"full\" }) to load it`,\n );\n this.name = \"UnsupportedFeatureError\";\n }\n}\n\nlet active: WasmModule | undefined;\nlet activeFeature: Feature | undefined;\nlet lazyLoader: (() => void) | undefined;\n\n// Data registered through `register`, kept so it can be REPLAYED onto each\n// newly activated module. Each variant is a separate wasm instance with its\n// own memory, so a registration made against one is invisible to the next —\n// and PLAN-166's promise is that swapping variants is invisible to the\n// caller. Keyed by type, because `register` replaces per type.\nconst registrations = new Map<string, string>();\n\n/**\n * The active wasm module. On Node the entry installs a lazy loader, so the\n * first call without an explicit `init` loads the default (`full`) variant\n * synchronously; in the browser an uninitialised call throws\n * {@link NotInitializedError} (wasm instantiation is async there).\n */\nexport function getActive(): WasmModule {\n if (!active && lazyLoader) lazyLoader();\n if (!active) throw new NotInitializedError();\n return active;\n}\n\n/** Swap the active module — the single atomic reference assignment. */\nexport function setActive(feature: Feature, module: WasmModule): void {\n // Replay first: a module that cannot take the registered data must not\n // become active half-configured. The data was accepted once already, so a\n // failure here is a bug worth surfacing rather than swallowing.\n for (const [type, data] of registrations) {\n try {\n module.register(type, data);\n } catch (e) {\n throw new RegisterError(e instanceof Error ? e.message : String(e));\n }\n }\n active = module;\n activeFeature = feature;\n}\n\n/**\n * Remember what `register` accepted, so it survives an `init` swap. Called\n * only after the ACTIVE module has accepted the same data.\n */\nexport function rememberRegistration(type: string, data: string): void {\n registrations.set(type, data);\n}\n\n/**\n * Install the Node lazy default loader (runs on the first call when no\n * explicit `init` happened; must call {@link setActive}).\n */\nexport function setLazyLoader(loader: () => void): void {\n lazyLoader = loader;\n}\n\n/** The active wasm feature, or `undefined` before the first init. */\nexport function variant(): Feature | undefined {\n return activeFeature;\n}\n","// @zen-component: TS-HookedTransform\n\nimport type { BitView, OutputFormat, PatchDiagnostic, PatchEntry, TransformOptions } from \"../types.js\";\nimport { PatchError } from \"./facade.js\";\n\n/** What the WASM `transform` export returns (PLAN-209 T9). */\nexport interface TransformEnvelope {\n data: string;\n diagnostics: PatchDiagnostic[];\n}\n\n/** One bit's rendered element plus the entries skipped on it. */\nexport interface BitOutput {\n element: string;\n diagnostics: PatchDiagnostic[];\n}\n\n/**\n * The minimal WASM surface the per-bit hook driver needs. Both the Node and\n * browser entry points satisfy this with their loaded module.\n */\nexport interface HookedWasm {\n is_bitmark(input: string): boolean;\n split_bits(input: string): string;\n split_json_bits(input: string): string;\n prettify(json: string, indent: number): string;\n resolve_patch_document(input: string, inputFormat: string, patchJson: string): string;\n /** Returns the {@link TransformEnvelope} as JSON text. */\n transform(\n input: string,\n inputFormat: string,\n outputFormat: string,\n mode: string,\n patchJson: string,\n pretty: boolean,\n indent: number,\n spacesAroundValues: number,\n ): string;\n}\n\n/** A single bit's compute job: data only, safe to ship to a worker thread. */\nexport interface BitJob {\n index: number;\n source: string;\n inputFormat: \"bitmark\" | \"json\";\n outputFormat: OutputFormat;\n mode: string;\n patchJson: string;\n spacesAroundValues: number;\n}\n\n/**\n * The result of running `preHook` over a document's bits: the compute `jobs`\n * for the bits that survived (in document order) and the matching `views`\n * (so `postHook` can be called per surviving bit), plus the document-level\n * recombination settings.\n */\nexport interface TransformPlan {\n jobs: BitJob[];\n views: BitView[];\n output: OutputFormat;\n pretty: boolean;\n indent: number;\n}\n\n/** Strip the outer `[ … ]` of a compact one-element JSON array. */\nexport function stripArray(doc: string): string {\n const t = doc.trim();\n return t.startsWith(\"[\") && t.endsWith(\"]\") ? t.slice(1, -1) : doc;\n}\n\n/**\n * The `patch` option as the JSON text the WASM resolver takes — a patch\n * document or the bare-array every-bit shorthand — or `\"\"` when absent.\n */\nfunction patchJsonOf(patch: TransformOptions[\"patch\"]): string {\n if (patch === undefined) return \"\";\n if (typeof patch === \"string\") return patch.trim();\n return JSON.stringify(patch);\n}\n\n/**\n * One slot of the resolved patch document (see `resolve_patch_document`).\n * An inserted `bit` is a JSON bit or, as a string, one bit of bitmark\n * source (PLAN-209 D15).\n */\ninterface ResolvedItem {\n source: number | null;\n bit: Record<string, unknown> | string | null;\n patch: PatchEntry[];\n}\n\nfunction buildUnits(\n wasm: HookedWasm,\n input: string,\n inputIsBitmark: boolean,\n): { view: BitView; source: string }[] {\n if (inputIsBitmark) {\n const slices = JSON.parse(wasm.split_bits(input)) as { index: number; source: string }[];\n return slices.map((s) => ({\n view: { format: \"bitmark\", index: s.index, total: slices.length, source: s.source },\n source: s.source,\n }));\n }\n const envelopes = JSON.parse(wasm.split_json_bits(input)) as {\n bit?: import(\"../generated/bit-types.js\").AnyBit;\n }[];\n return envelopes.map((env, index) => ({\n view: { format: \"json\", index, total: envelopes.length, bit: env.bit ?? {} },\n // Per-bit transform consumes a one-bit JSON document.\n source: JSON.stringify([env]),\n }));\n}\n\n/**\n * Split the document and run `preHook` (on the calling thread) for each bit,\n * producing the surviving compute jobs + their views. This is the main-thread\n * half shared by the sync and worker-pool drivers — only the resulting\n * data-only {@link BitJob}s ever cross to a worker.\n */\nexport function planTransform(\n wasm: HookedWasm,\n input: string,\n options: TransformOptions,\n): TransformPlan {\n const mode = options.mode ?? \"optimized\";\n const output: OutputFormat = options.outputFormat ?? \"json\";\n const spacesAroundValues = options.spacesAroundValues ?? 1;\n const indent = options.indent ?? 2;\n const pretty = options.pretty ?? false;\n\n const sel = options.inputFormat ?? \"auto\";\n const inputIsBitmark = sel === \"bitmark\" || (sel !== \"json\" && wasm.is_bitmark(input));\n const inputFormat = inputIsBitmark ? \"bitmark\" : \"json\";\n\n // The engine decides which output formats are per-bit (the whole-document\n // `lex` / `semantic-tokens` / `diagnostics` are not, and it refuses them\n // before any hook runs). Ask it the same way, once, with an empty document:\n // a document that splits into no bits would otherwise never carry that\n // refusal, and the hooked path would answer `\"\"` where the hookless one\n // throws (PLAN-192 D1 parity).\n wasm.transform(\"\", \"bitmark\", output, mode, \"\", false, indent, spacesAroundValues);\n\n const units = buildUnits(wasm, input, inputIsBitmark);\n const total = units.length;\n\n // Hooks see the ORIGINAL bits, in order, before the patch document\n // reshapes anything (same as the Rust pipeline's Phase A).\n const hooked: ({ patches: PatchEntry[]; outputFormat: OutputFormat } | null)[] = [];\n for (let index = 0; index < total; index++) {\n const { view } = units[index];\n view.index = index;\n view.total = total;\n const result = options.preHook ? options.preHook(view) || {} : {};\n hooked.push(result.drop ? null : { patches: result.patches ?? [], outputFormat: result.outputFormat ?? output });\n }\n\n // The patch document (or the every-bit shorthand) is resolved by the one\n // Rust implementation into the ordered output slots; without a patch the\n // slots are simply the original bits. The resolver splits under the SAME\n // input format resolved above — an explicit selection is never re-sniffed.\n const patchJson = patchJsonOf(options.patch);\n let resolved: ResolvedItem[];\n if (patchJson === \"\") {\n resolved = units.map((_, index) => ({ source: index, bit: null, patch: [] }));\n } else {\n resolved = JSON.parse(\n wasm.resolve_patch_document(input, inputFormat, patchJson),\n ) as ResolvedItem[];\n }\n\n const jobs: BitJob[] = [];\n const views: BitView[] = [];\n for (const item of resolved) {\n if (item.source !== null) {\n const hook = hooked[item.source];\n if (!hook) continue; // dropped by the pre-hook\n jobs.push({\n index: item.source,\n source: units[item.source].source,\n inputFormat,\n outputFormat: hook.outputFormat,\n mode,\n // The document's patches first, the hook's after (the hook contract).\n patchJson: JSON.stringify([...item.patch, ...hook.patches]),\n spacesAroundValues,\n });\n views.push(units[item.source].view);\n } else if (typeof item.bit === \"string\") {\n // An inserted bitmark bit (PLAN-209 D15), seen by `postHook` only.\n const index = jobs.length;\n jobs.push({\n index,\n source: item.bit,\n inputFormat: \"bitmark\",\n outputFormat: output,\n mode,\n patchJson: JSON.stringify(item.patch),\n spacesAroundValues,\n });\n views.push({ format: \"bitmark\", index, total, source: item.bit });\n } else {\n // An inserted bit: a one-bit JSON document, seen by `postHook` only.\n const bit = (item.bit ?? {}) as import(\"../generated/bit-types.js\").AnyBit;\n const index = jobs.length;\n jobs.push({\n index,\n source: JSON.stringify([{ bit }]),\n inputFormat: \"json\",\n outputFormat: output,\n mode,\n patchJson: JSON.stringify(item.patch),\n spacesAroundValues,\n });\n views.push({ format: \"json\", index, total, bit });\n }\n }\n return { jobs, views, output, pretty, indent };\n}\n\n/**\n * Read the WASM `transform` envelope for one bit: the element (compact JSON\n * stripped of its one-element array) and the entries skipped on it.\n */\nexport function bitOutput(envelopeJson: string, outputFormat: OutputFormat): BitOutput {\n const { data, diagnostics } = JSON.parse(envelopeJson) as TransformEnvelope;\n return { element: outputFormat === \"json\" ? stripArray(data) : data, diagnostics };\n}\n\n/**\n * Compute one bit's rendered element synchronously via WASM. The per-bit\n * element is always compact JSON (the document is prettified once on\n * recombination). Throws on failure; skipped entries come back as\n * diagnostics for the driver to raise.\n */\nexport function computeBit(wasm: HookedWasm, job: BitJob): BitOutput {\n return bitOutput(\n wasm.transform(\n job.source,\n job.inputFormat,\n job.outputFormat,\n job.mode,\n job.patchJson,\n false,\n 2,\n job.spacesAroundValues,\n ),\n job.outputFormat,\n );\n}\n\n/** Recombine per-bit elements into the final document, in document order. */\nexport function recombine(\n wasm: HookedWasm,\n elements: string[],\n output: OutputFormat,\n pretty: boolean,\n indent: number,\n): string {\n // Only JSON wraps as an array; every other per-bit output (bitmark, plain\n // text, a mapping such as html) is text and joins with newlines — the same\n // rule as the Rust pipeline's recombine.\n if (output !== \"json\") return elements.join(\"\\n\");\n const arr = `[${elements.join(\",\")}]`;\n return pretty ? wasm.prettify(arr, indent) : arr;\n}\n\n/**\n * Per-bit transform driver (synchronous, in-process): split the document, run\n * `preHook` for each bit on the calling thread, apply the static patch + any\n * hook patches, re-emit the bit, run `postHook`, then recombine in document\n * order.\n *\n * Hooks run synchronously on the calling thread; only data crosses into WASM.\n * Used when a `preHook`/`postHook` is supplied; the hookless path stays a\n * single `wasm.transform` call. Throws on failure (PLAN-192 D1), and a\n * `PatchError` when any entry was skipped (PLAN-209 T9).\n */\nexport function runHookedTransform(\n wasm: HookedWasm,\n input: string,\n options: TransformOptions,\n): string {\n const plan: TransformPlan = planTransform(wasm, input, options);\n\n const rendered: string[] = [];\n const skipped: PatchDiagnostic[] = [];\n for (let i = 0; i < plan.jobs.length; i++) {\n const { element, diagnostics } = computeBit(wasm, plan.jobs[i]);\n skipped.push(...diagnostics);\n options.postHook?.(plan.views[i], element);\n rendered.push(element);\n }\n // A skipped entry is never silent (PLAN-209 T9).\n if (skipped.length > 0) throw new PatchError(skipped);\n return recombine(wasm, rendered, plan.output, plan.pretty, plan.indent);\n}\n","// @zen-component: TS-ParallelOrchestrator\n\nimport type { PatchDiagnostic, TransformOptions } from \"../types.js\";\nimport { PatchError } from \"./facade.js\";\nimport { type BitJob, type BitOutput, type HookedWasm, planTransform, recombine } from \"./hooked-transform.js\";\n\n/**\n * A platform pool: compute `jobs` across up to `workers` workers, returning the\n * rendered element (and skipped entries) per job in submission order. Node and\n * browser supply their own (worker_threads / Worker); the orchestration around\n * it is shared.\n */\nexport type RunJobs = (jobs: BitJob[], workers: number) => Promise<BitOutput[]>;\n\n/**\n * Shared parallel transform orchestration. The main-thread half — split +\n * `preHook` + recombine + `postHook` — is identical to the sync driver; only\n * the data-only per-bit jobs cross to `runJobs` (the platform pool). Closures\n * (`preHook`/`postHook`) never leave the calling thread.\n *\n * Rejects on failure (PLAN-192 D1): the planning error, or the first worker /\n * job error the pool surfaces; and with a `PatchError` when any entry was\n * skipped (PLAN-209 T9).\n */\nexport async function orchestrateParallel(\n wasm: HookedWasm,\n input: string,\n options: TransformOptions,\n runJobs: RunJobs,\n): Promise<string> {\n const plan = planTransform(wasm, input, options);\n const outputs = await runJobs(plan.jobs, options.workers ?? 4);\n\n const elements: string[] = [];\n const skipped: PatchDiagnostic[] = [];\n for (let i = 0; i < outputs.length; i++) {\n elements.push(outputs[i].element);\n skipped.push(...outputs[i].diagnostics);\n options.postHook?.(plan.views[i], outputs[i].element);\n }\n // A skipped entry is never silent (PLAN-209 T9) — same as the sync driver.\n if (skipped.length > 0) throw new PatchError(skipped);\n return recombine(wasm, elements, plan.output, plan.pretty, plan.indent);\n}\n","// @zen-component: LEGACY-Facade\n// Platform injection for the legacy facade. The Node and browser entries\n// provide the WASM module (and, on Node, file I/O) before exposing the\n// `legacy` namespace — the facade itself stays platform-free.\n\n/** The subset of the WASM surface the legacy facade drives. */\nexport interface LegacyWasm {\n convert(\n input: string,\n inputFormat: string,\n outputFormat: string,\n mode: string,\n pretty: boolean,\n indent: number,\n spacesAroundValues: number,\n includeUnknownProperties: boolean,\n mappingReport: boolean,\n /** `semantic-tokens` output only (PLAN-193); the legacy facade passes `\"\"`. */\n positionEncoding: string,\n tokensLayout: string,\n ): string;\n canonicalize(\n input: string,\n inputFormat: string,\n mode: string,\n pretty: boolean,\n indent: number,\n spacesAroundValues: number,\n ): string;\n breakscape_text(input: string, format: string, location: string): string;\n unbreakscape_text(input: string, format: string, location: string): string;\n info(\n infoType: string,\n format: string,\n bit: string,\n pretty: boolean,\n indent: number,\n includeDeprecated: boolean,\n onlyDeprecated: boolean,\n full: boolean,\n language: string,\n ): string;\n is_bitmark(input: string): boolean;\n prettify(json: string, indent: number): string;\n convert_text(input: string, direction: string, format: string, location: string): string;\n}\n\nlet wasmProvider: (() => LegacyWasm) | undefined;\n\nexport function setLegacyWasm(wasm: LegacyWasm): void {\n wasmProvider = () => wasm;\n}\n\n/**\n * Provide the WASM module lazily (PLAN-166): the provider is consulted on\n * every legacy call, so it can defer loading and always reflects the ACTIVE\n * variant after an `init({ feature })` swap.\n */\nexport function setLegacyWasmProvider(provider: () => LegacyWasm): void {\n wasmProvider = provider;\n}\n\nexport function getLegacyWasm(): LegacyWasm {\n if (!wasmProvider) {\n throw new Error(\n \"legacy API not initialised: the WASM module has not been provided (browser consumers must call init() first)\",\n );\n }\n return wasmProvider();\n}\n\n/** Node file I/O, injected by the Node entry only (PLAN-126 F-5). */\nexport interface LegacyFileIo {\n existsSync(path: string): boolean;\n readFileSync(path: string, encoding: string): string;\n /** Write (or append) `data`, creating parent directories as needed. */\n writeFile(path: string, data: string, opts: { append?: boolean; encoding?: string }): void;\n}\n\nlet fileIo: LegacyFileIo | undefined;\n\nexport function setLegacyFileIo(io: LegacyFileIo): void {\n fileIo = io;\n}\n\n/** Returns undefined in the browser (no file I/O). */\nexport function getLegacyFileIo(): LegacyFileIo | undefined {\n return fileIo;\n}\n","// @zen-component: TS-WorkerPool\n//\n// The platform-neutral half of the parallel transform pool: dispatch-on-idle,\n// results matched by id and returned in submission order, the first worker or\n// job error rejecting, every worker terminated once the run settles. Node and\n// the browser each supply a `SpawnWorker` that owns Worker construction, its\n// message / error wiring and termination — nothing else differs.\n\nimport type { BitJob, BitOutput } from \"./hooked-transform.js\";\nimport type { PatchDiagnostic } from \"../types.js\";\n\n/** What a worker posts back for one job (the `id` it was given). */\nexport interface JobResult {\n id: number;\n ok: boolean;\n element?: string;\n /** The entries skipped on this bit (PLAN-209 T9). */\n diagnostics?: PatchDiagnostic[];\n error?: string;\n}\n\n/** A spawned worker as the scheduler drives it. */\nexport interface PoolWorker {\n post(msg: { id: number; job: BitJob }): void;\n terminate(): void;\n}\n\n/**\n * Create one worker, routing its results to `onResult` and any failure\n * (an uncaught worker error, an abnormal exit) to `onError`.\n */\nexport type SpawnWorker = (\n onResult: (res: JobResult) => void,\n onError: (err: Error) => void,\n) => PoolWorker;\n\n/**\n * Run `jobs` across up to `workers` workers created by `spawn`, returning the\n * rendered element (and skipped entries) per job in the **same order** as\n * `jobs`. Rejects on the first worker or job error; the pool is terminated\n * either way.\n */\nexport function runJobsWithPool(jobs: BitJob[], workers: number, spawn: SpawnWorker): Promise<BitOutput[]> {\n if (jobs.length === 0) return Promise.resolve([]);\n const poolSize = Math.max(1, Math.min(workers, jobs.length));\n\n return new Promise<BitOutput[]>((resolve, reject) => {\n const results = new Array<BitOutput>(jobs.length);\n let next = 0;\n let settled = 0;\n let done = false;\n const pool: PoolWorker[] = [];\n\n const finish = (err?: Error) => {\n if (done) return;\n done = true;\n for (const w of pool) w.terminate();\n if (err) reject(err);\n else resolve(results);\n };\n const dispatch = (w: PoolWorker) => {\n if (done || next >= jobs.length) return;\n const id = next++;\n w.post({ id, job: jobs[id] });\n };\n\n for (let i = 0; i < poolSize; i++) {\n const w = spawn((res) => {\n if (done) return;\n if (!res.ok) return finish(new Error(res.error ?? \"worker job failed\"));\n results[res.id] = { element: res.element as string, diagnostics: res.diagnostics ?? [] };\n if (++settled === jobs.length) finish();\n else dispatch(w);\n }, finish);\n pool.push(w);\n }\n\n // Prime each worker with one job.\n for (const w of pool) dispatch(w);\n });\n}\n","// @zen-component: TS-BrowserWorkerPool\n//\n// The browser module-Worker adapter of the shared pool scheduler\n// (core/pool.ts): Worker construction, message / error wiring and\n// termination. Each module worker loads its own WASM instance.\n\nimport type { Feature } from \"../core/facade.js\";\nimport type { BitJob, BitOutput } from \"../core/hooked-transform.js\";\nimport { runJobsWithPool, type JobResult } from \"../core/pool.js\";\n\n/**\n * Run `jobs` across up to `workers` module Workers, returning the rendered\n * element per job in submission order. Rejects on the first worker/job error.\n * Each worker loads the given wasm `feature` (PLAN-166) — the variant active\n * on the calling thread.\n */\nexport function runJobsParallel(jobs: BitJob[], workers: number, feature: Feature): Promise<BitOutput[]> {\n // worker-entry.js is emitted beside this bundle (see tsup config).\n const workerUrl = new URL(\"./worker-entry.js\", import.meta.url);\n return runJobsWithPool(jobs, workers, (onResult, onError) => {\n const w = new Worker(workerUrl, { type: \"module\" });\n w.onmessage = (ev: MessageEvent<JobResult>) => onResult(ev.data);\n w.onerror = (e: ErrorEvent) => onError(new Error(e.message || \"worker error\"));\n return { post: (msg) => w.postMessage({ ...msg, feature }), terminate: () => w.terminate() };\n });\n}\n","// @zen-component: LEGACY-Facade\n// The `legacy` namespace: a bpg-compatible (bitmark-parser-generator\n// v5.31.1) programmatic interface over the WASM core (PLAN-126).\n//\n// Everything here is exposed ONLY via `legacy.*` / the\n// `@gmb/bitmark-parser/legacy` subpath — nothing is re-exported at the\n// package root (reserved for the modern API and its future generated types).\n\nexport { BitmarkParserGenerator, bitmarkTextParse } from \"./bpg-class.js\";\nexport { Builder, type BuildBitOptions } from \"./builder.js\";\nexport { ResourceBuilder, type ResourceMethod } from \"./resource-builder.js\";\nexport { LegacyUnsupportedError } from \"./errors.js\";\nexport { isPseudoAst, type LegacyPseudoAst } from \"./pseudo-ast.js\";\n\n// Enum objects + option interfaces (vendored shapes)\nexport * from \"./options.js\";\nexport { BitType, BoundingBoxIndex, NodeType, TextMarkType, TextNodeType } from \"./enums-extra.js\";\n\n// Unsupported bpg internals — present but throwing (PLAN-126 F-2)\nexport {\n Ast,\n BitmarkFileGenerator,\n BitmarkGenerator,\n BitmarkParser,\n BitmarkStringGenerator,\n FileWriter,\n HtmlTableGenerator,\n HtmlTableParser,\n JsonFileGenerator,\n JsonGenerator,\n JsonParser,\n JsonStringGenerator,\n StreamWriter,\n StringWriter,\n} from \"./stubs.js\";\n\n// Vendored bpg JSON model / text-node types (type-only)\nexport type * from \"./vendor/BitJson.js\";\nexport type * from \"./vendor/BitWrapperJson.js\";\nexport type * from \"./vendor/BodyBitJson.js\";\nexport type * from \"./vendor/ParserJson.js\";\nexport type * from \"./vendor/ResourceJson.js\";\nexport type * from \"./vendor/TextNodes.js\";\n// bpg parity: bpg additionally exported JsonText under the alias `Text`\n// (bitmark-parser-generator src/index.ts: `JsonText as Text`).\nexport type { JsonText as Text } from \"./vendor/TextNodes.js\";\nexport type {\n ParserError,\n ParserInfo,\n ParserLocation,\n BitTypeType,\n TextFormatType,\n ResourceTypeType,\n TextMarkTypeType,\n TextNodeTypeType,\n} from \"./vendor/enums.js\";\n","// @zen-component: LEGACY-Facade\n\n/** Error thrown for bpg API members / options the legacy facade does not support. */\nexport class LegacyUnsupportedError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"LegacyUnsupportedError\";\n }\n}\n\n/** Throw for a bpg API member that is not supported (PLAN-126 F-2). */\nexport function unsupportedMember(member: string, reason?: string): never {\n throw new LegacyUnsupportedError(\n `'${member}' is not supported by the @gmb/bitmark-parser legacy API` + (reason ? `: ${reason}` : \"\"),\n );\n}\n\n/** Throw for an option that cannot be honoured (PLAN-126 F-9: never silently ignore). */\nexport function unsupportedOption(option: string, reason?: string): never {\n throw new LegacyUnsupportedError(\n `Option '${option}' is not supported by the @gmb/bitmark-parser legacy API` +\n (reason ? `: ${reason}` : \"\"),\n );\n}\n","// @zen-component: LEGACY-Facade\n// Central bpg-option → core-parameter translation table (PLAN-126 F-4/F-9).\n// Strict policy: options that map are honoured; options we cannot honour\n// throw a LegacyUnsupportedError naming the option. Sole exception:\n// `bitmarkParserType` is accepted and ignored — bpg v5.31.1 itself hardcodes\n// the peggy parser and ignores the option.\n\nimport { unsupportedOption } from \"./errors.js\";\nimport type { BitmarkOptions, JsonOptions } from \"./options.js\";\n\nconst V3_ONLY = \"bitmark v2 output is not supported (this parser is bitmark v3 only)\";\n\nexport function validateVersionOptions(opts: {\n bitmarkVersion?: number;\n bitmarkParserType?: string;\n}): void {\n if (opts.bitmarkVersion === 2) unsupportedOption(\"bitmarkVersion: 2\", V3_ONLY);\n // bitmarkParserType: accepted + ignored (documented exception).\n}\n\nexport function validateBitmarkOptions(o: BitmarkOptions): void {\n // The option TYPES are narrowed to the supported values (build-time\n // errors for TS consumers), but JS callers can still pass anything —\n // keep validating the runtime values (hence the widening casts).\n // Booleans error only when set truthy (false === bpg default behaviour).\n if (o.explicitTextFormat) unsupportedOption(\"bitmarkOptions.explicitTextFormat\");\n // prettifyJson: honoured — maps to the core's pretty/indent for bitmark\n // output (embedded JSON bodies of json-format bits); see prettyIndent().\n if ((o.cardSetVersion as number | undefined) === 1) {\n unsupportedOption(\"bitmarkOptions.cardSetVersion: 1\", V3_ONLY);\n }\n if (o.debugGenerationInline) unsupportedOption(\"bitmarkOptions.debugGenerationInline\");\n if (o.noBreakscaping) unsupportedOption(\"bitmarkOptions.noBreakscaping\");\n}\n\nexport function validateJsonOptions(o: JsonOptions): void {\n if (o.textAsPlainText) unsupportedOption(\"jsonOptions.textAsPlainText\", V3_ONLY);\n // excludeUnknownProperties: honoured — maps to the core's inverse\n // `includeUnknownProperties` flag (bpg default: include; see bpg-class).\n if (o.debugGenerationInline) unsupportedOption(\"jsonOptions.debugGenerationInline\");\n // enableWarnings: accepted — parser warnings are always carried in the\n // output envelope by this parser, so both values are honoured trivially.\n}\n\n/**\n * bpg `prettify?: boolean | number` → core (pretty, indent).\n *\n * Also used for `bitmarkOptions.prettifyJson` (identical bpg semantics:\n * true → indent 2, positive number → that indent, else off) — for bitmark\n * output the core's pretty/indent prettify the embedded JSON bodies of\n * json-format bits, which is exactly what bpg's prettifyJson did.\n */\nexport function prettyIndent(prettify: boolean | number | undefined): {\n pretty: boolean;\n indent: number;\n} {\n if (prettify === true) return { pretty: true, indent: 2 };\n if (typeof prettify === \"number\" && prettify > 0) return { pretty: true, indent: prettify };\n return { pretty: false, indent: 2 };\n}\n\n/** bpg `spacesAroundValues?: number | boolean` → core spaces count (cap 10, as bpg). */\nexport function spacesAround(v: number | boolean | undefined): number {\n if (v === undefined || v === true) return 1;\n if (v === false) return 0;\n return Math.max(0, Math.min(10, v));\n}\n\n/**\n * bpg text format value → core breakscape format.\n * bpg maps `latex`/`json`/`xml` as aliases of plain text, and defaults\n * anything else (including absent) to bitmark text (`bitmark++`).\n */\nexport function mapTextFormat(f: string | undefined): \"bitmark++\" | \"plainText\" {\n switch (f) {\n case \"text\":\n case \"latex\":\n case \"json\":\n case \"xml\":\n return \"plainText\";\n default:\n return \"bitmark++\";\n }\n}\n","// @zen-component: LEGACY-Facade\n// The legacy \"AST\" is bit JSON (PLAN-126 §3.1): an envelope of the parser's\n// wrapper entries (`{ bit, parser?, bitmark? }`), tagged with a\n// non-enumerable marker so it can be recognised without surviving\n// JSON.stringify. It round-trips through `convert`, but is NOT bpg's\n// internal TS AST node model (no `cardNode` / `BodyPart[]` structure).\n\nexport const PSEUDO_AST_MARKER = Symbol.for(\"@gmb/bitmark-parser/legacy-pseudo-ast\");\n\nexport interface LegacyPseudoAst {\n bits: unknown[];\n}\n\nexport function makePseudoAst(bits: unknown[]): LegacyPseudoAst {\n const ast: LegacyPseudoAst = { bits };\n Object.defineProperty(ast, PSEUDO_AST_MARKER, { value: true, enumerable: false });\n return ast;\n}\n\nexport function isPseudoAst(v: unknown): v is LegacyPseudoAst {\n return (\n v !== null &&\n typeof v === \"object\" &&\n (PSEUDO_AST_MARKER in v || Array.isArray((v as LegacyPseudoAst).bits))\n );\n}\n","// GENERATED FILE — do not edit.\n// Emitted by scripts/gen-legacy-resource-keys.mjs from\n// resources/bitmark-configurator/bitmark.json. Regenerate via `npm run init`.\n//\n// Every bit whose config maps a repeatable resource tag group onto a single\n// JSON collection key. The legacy `Builder.buildBit` routes bpg's\n// `resources` input onto this key (bpg's JsonGenerator special-cased the\n// same family by bit type; here it is derived from config).\n\n/** A bit's resource-collection mapping: target JSON key + accepted resource type. */\nexport interface ResourceCollection {\n key: string;\n resourceType: string;\n}\n\nexport const RESOURCE_COLLECTION_KEYS: Readonly<Record<string, ResourceCollection>> = {\n \"extractor-image\": { key: \"images\", resourceType: \"image\" },\n \"extractor-image-collapsible\": { key: \"images\", resourceType: \"image\" },\n \"images-logo-grave\": { key: \"logos\", resourceType: \"image\" },\n \"prototype-images\": { key: \"images\", resourceType: \"image\" },\n};\n","// @zen-component: LEGACY-Facade\n// bpg-compatible `Builder` (PLAN-126 §3.1): the legacy AST is bit JSON, so\n// building a bit is a data *mapping* (bpg buildBit data → bit JSON keys)\n// followed by one WASM json→json normalization pass — the config-driven core\n// performs the defaulting/coercion/validation that bpg's ~4.2k-line builder\n// does in TS. No parsing logic lives here.\n\nimport { getLegacyWasm } from \"./runtime.js\";\nimport { makePseudoAst, type LegacyPseudoAst } from \"./pseudo-ast.js\";\nimport { RESOURCE_COLLECTION_KEYS } from \"./generated/resource-collection-keys.js\";\nimport type { ParserError, ParserInfo } from \"./vendor/enums.js\";\n\n/** Carries bpg `data.parser` (wrapper-level metadata) invisibly on the built bit. */\nexport const BUILT_BIT_PARSER = Symbol.for(\"@gmb/bitmark-parser/legacy-built-bit-parser\");\n\n/**\n * bpg buildBit data keys whose bit-JSON key differs. Everything else in the\n * flat data object maps by identity (the data fields are already the bpg\n * JSON model types) and unknown keys pass through untouched (PLAN-126 F-6).\n */\nconst DATA_KEY_TO_JSON_KEY: Record<string, string> = {\n bitType: \"type\",\n textFormat: \"format\",\n flashcards: \"cards\",\n markConfig: \"marks\",\n};\n\n/** bpg deprecated text-format value accepted by buildBit. */\nconst DEPRECATED_TEXT_FORMATS: Record<string, string> = {\n \"bitmark--\": \"bitmark++\",\n \"bitmark+\": \"bitmark++\",\n};\n\n/**\n * Config `bodyFormat` → bpg TextFormat value. When the caller omits\n * `textFormat`, bpg defaults to the bit config's `textFormatDefault`\n * (bpg Builder.bit), which is derived from the config `bodyFormat` — NOT\n * to bitmark text. E.g. `extractor-information` (bodyFormat: json) built\n * without an explicit `textFormat` must keep its JSON body verbatim.\n */\nconst CONFIG_BODY_FORMAT_TO_TEXT_FORMAT: Record<string, string> = {\n bitmark: \"bitmark++\",\n text: \"text\",\n json: \"json\",\n latex: \"latex\",\n xml: \"xml\",\n};\n\n/** Top-level bit JSON fields typed JsonText (tag location) in bpg. */\nconst TAG_TEXT_KEYS = [\n \"title\",\n \"subtitle\",\n \"item\",\n \"lead\",\n \"pageNumber\",\n \"marginNumber\",\n \"hint\",\n \"instruction\",\n \"caption\",\n] as const;\n\nexport interface BuildBitOptions {\n cardSet?: {\n sideNo: number;\n variantNo: number;\n };\n}\n\nexport class Builder {\n /**\n * Build bitmark AST envelope (bpg-compatible `buildBitmark`).\n */\n buildBitmark(data: { bits?: unknown[]; errors?: ParserError[] }): LegacyPseudoAst {\n const ast = makePseudoAst(data.bits ?? []);\n if (data.errors !== undefined) {\n (ast as LegacyPseudoAst & { errors?: ParserError[] }).errors = data.errors;\n }\n return ast;\n }\n\n /**\n * Build a bit (bpg-compatible `buildBit`).\n *\n * Accepts the full bpg data shape (flat, ~250 optional fields, values in\n * the JSON model types). Returns the normalized bit JSON. Throws\n * `No config found for bit: X` for unknown bit types, as bpg does.\n *\n * NOTE (documented divergences from bpg):\n * - the return value is bit JSON, not bpg's internal AST node model;\n * - `resourceType` (an inference hint in bpg) is not carried into the\n * JSON — the attached `resource` object is authoritative.\n *\n * `resources` follows bpg's JsonGenerator routing: on a bit whose config\n * maps a repeatable resource tag group onto a collection key (e.g.\n * `images` / `logos` — see the generated RESOURCE_COLLECTION_KEYS), the\n * matching-type entries land under that key; on every other bit the first\n * entry becomes the canonical single `resource` (as bpg: \"if there is\n * more than one resource, use the first one\").\n */\n buildBit(data: Record<string, unknown>, _options?: BuildBitOptions): Record<string, unknown> {\n const wasm = getLegacyWasm();\n const src = { ...data };\n\n const bitType = src.bitType as string | undefined;\n const bitConfig = this.getBitConfig(bitType);\n\n // --- divergent keys ---\n const bit: Record<string, unknown> = {};\n bit.type = bitType;\n if (src.isCommented) {\n bit.type = \"_comment\";\n bit.originalType = bitType;\n }\n delete src.bitType;\n delete src.isCommented;\n\n const textFormat = src.textFormat as string | undefined;\n if (textFormat !== undefined) {\n bit.format = DEPRECATED_TEXT_FORMATS[textFormat] ?? textFormat;\n delete src.textFormat;\n } else {\n // bpg parity: `textFormat ?? bitConfig.textFormatDefault` — the\n // config-driven default, so e.g. JSON-bodied bits don't get their\n // body mangled by the bitmark text parser (see parseStringTexts).\n bit.format = CONFIG_BODY_FORMAT_TO_TEXT_FORMAT[bitConfig.bodyFormat ?? \"\"] ?? \"bitmark++\";\n }\n\n // resourceType is an inference hint only (see doc comment)\n delete src.resourceType;\n\n // body: accept bpg's Partial<Body> node ({ body: <JsonText> }) or a bare JsonText\n const body = src.body as { body?: unknown } | unknown;\n if (body !== undefined && body !== null && typeof body === \"object\" && \"body\" in (body as object)) {\n bit.body = (body as { body?: unknown }).body;\n delete src.body;\n }\n\n // example / __isDefaultExample → isExample + example (bpg toExample semantics)\n if (src.example !== undefined) {\n bit.isExample = true;\n bit.example = src.example;\n delete src.example;\n delete src.__isDefaultExample;\n } else if (src.__isDefaultExample) {\n bit.isExample = true;\n delete src.__isDefaultExample;\n }\n\n // resources → the bit's resource-collection key (config-derived), else\n // the canonical single `resource` — bpg's JsonGenerator routing.\n const resources = src.resources;\n if (resources !== undefined && bitType !== undefined) {\n const list = Array.isArray(resources) ? resources : [resources];\n const collection = RESOURCE_COLLECTION_KEYS[bitType];\n if (collection) {\n // bpg keeps only the entries of the collection's resource type.\n bit[collection.key] = list.filter(\n (r) =>\n r !== null &&\n typeof r === \"object\" &&\n (r as { type?: unknown }).type === collection.resourceType,\n );\n } else if (list.length >= 1) {\n bit.resource = list[0];\n }\n delete src.resources;\n }\n\n // parser metadata lives on the wrapper, not in the bit JSON\n const parser = src.parser as ParserInfo | undefined;\n delete src.parser;\n\n // extraProperties spread into the bit JSON top level (bpg semantics)\n const extraProperties = src.extraProperties as Record<string, unknown> | undefined;\n delete src.extraProperties;\n\n // --- renamed + identity + unknown keys (pass through, PLAN-126 F-6) ---\n for (const [key, value] of Object.entries(src)) {\n if (value === undefined) continue;\n bit[DATA_KEY_TO_JSON_KEY[key] ?? key] = value;\n }\n if (extraProperties) {\n for (const [key, value] of Object.entries(extraProperties)) {\n if (!(key in bit)) bit[key] = value;\n }\n }\n\n // --- bpg parity: string JsonText values are parsed bitmark text ---\n this.parseStringTexts(bit);\n\n // --- normalization pass: the config-driven core defaults/coerces/validates ---\n const out = wasm.convert(JSON.stringify([{ bit }]), \"json\", \"json\", \"optimized\", false, 2, 1, false, false, \"\", \"\");\n const entries = JSON.parse(out) as { bit: Record<string, unknown> }[];\n const built = entries[0]?.bit ?? bit;\n\n // F-6: keys the core doesn't know are dropped by the normalize pass —\n // re-attach them so nothing is lost silently. Values matching bpg's own\n // \"unset optional\" strip set (false / \"\" / [] / null) stay stripped,\n // mirroring bpg's removeUnwantedProperties.\n for (const [key, value] of Object.entries(bit)) {\n if (key in built) continue;\n if (\n value === false ||\n value === \"\" ||\n value === null ||\n (Array.isArray(value) && value.length === 0)\n ) {\n continue;\n }\n built[key] = value;\n }\n if (parser !== undefined) {\n Object.defineProperty(built, BUILT_BIT_PARSER, { value: parser, enumerable: false });\n }\n return built;\n }\n\n /**\n * Build a highlight body bit (bpg-compatible `buildHighlight`).\n * Shapes the HighlightJson body-bit; unset optionals are omitted.\n */\n buildHighlight(\n _context: unknown,\n data: Record<string, unknown> | undefined,\n ): Record<string, unknown> | undefined {\n if (!data) return undefined;\n const src = { ...data };\n // bpg: data may arrive nested under 'attrs' (when coming from JSON)\n const attrs = src.attrs as Record<string, unknown> | undefined;\n if (attrs) Object.assign(src, attrs);\n\n const texts = Array.isArray(src.texts)\n ? (src.texts as Record<string, unknown>[]).filter((t) => t != null).map((t) => ({\n text: t.text ?? \"\",\n isCorrect: t.isCorrect ?? false,\n isHighlighted: t.isHighlighted ?? false,\n ...stripUndefined(t, [\"text\", \"isCorrect\", \"isHighlighted\"]),\n }))\n : [];\n\n const node: Record<string, unknown> = {\n type: \"highlight\",\n texts,\n prefix: src.prefix ?? \"\",\n postfix: src.postfix ?? \"\",\n ...stripUndefined(src, [\"type\", \"texts\", \"prefix\", \"postfix\", \"attrs\"]),\n attrs: {},\n };\n return node;\n }\n\n /**\n * bpg's builder parses string-valued JsonText fields as bitmark text\n * (inline marks become TextAst marks); the composer would otherwise treat\n * them as literal text. Converts top-level JsonText fields in place.\n * Nested (card-content) strings are left literal — documented divergence.\n *\n * A string body is dispatched on the bit's resolved text format, as bpg's\n * buildBody: bitmark text is parsed to TextAst, `json` is JSON.parsed\n * (unparseable → null), and plain-text formats (text/latex/xml) stay\n * verbatim. Tag texts are always bitmark text, independent of body format\n * (bpg TextParser.toAst ignores format; only location matters).\n */\n private parseStringTexts(bit: Record<string, unknown>): void {\n const wasm = getLegacyWasm();\n const toAst = (s: string, location: \"body\" | \"tag\"): unknown => {\n if (s === \"\") return s;\n const out = wasm.convert_text(s, \"textToAst\", \"bitmark++\", location);\n try {\n return JSON.parse(out) as unknown;\n } catch {\n return s;\n }\n };\n\n const format = bit.format as string | undefined;\n const bitmarkBody = format === undefined || format === \"bitmark++\" || format === \"bitmark+\";\n if (typeof bit.body === \"string\") {\n if (format === \"json\") {\n // bpg handleJsonBody: parse legacy string bodies; null on failure\n try {\n bit.body = JSON.parse(bit.body) as unknown;\n } catch {\n bit.body = null;\n }\n } else if (bitmarkBody) {\n bit.body = toAst(bit.body, \"body\");\n }\n // plain-text formats (text/latex/xml): body stays a verbatim string\n }\n for (const key of TAG_TEXT_KEYS) {\n const v = bit[key];\n if (typeof v === \"string\") bit[key] = toAst(v, \"tag\");\n }\n }\n\n /**\n * Look up the bit's config (`wasm.info`); throws bpg's exact\n * bit-type-invalid error (`Config.getBitConfig` parity).\n */\n private getBitConfig(bitType: string | undefined): { bodyFormat?: string } {\n const wasm = getLegacyWasm();\n if (bitType !== undefined) {\n try {\n const info = JSON.parse(wasm.info(\"bit\", \"json\", bitType, false, 2, false, false, true, \"\")) as {\n error?: string;\n body?: { format?: string };\n };\n // PLAN-149 restructured the info JSON: bodyFormat now lives at\n // `body.format`; adapt to the legacy flat shape callers expect.\n if (info.error === undefined) return { bodyFormat: info.body?.format };\n } catch {\n // fall through to the not-found error\n }\n }\n throw new Error(`No config found for bit: ${bitType}`);\n }\n}\n\nfunction stripUndefined(\n src: Record<string, unknown>,\n exclude: string[],\n): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(src)) {\n if (v !== undefined && !exclude.includes(k)) out[k] = v;\n }\n return out;\n}\n","// @zen-component: LEGACY-Facade\n// bpg-compatible `BitmarkParserGenerator` class — a thin synchronous wrapper\n// over the WASM core (PLAN-126). Behavioural parity is at the call boundary:\n// same method names, option keys and return shapes as bpg v5.31.1.\n\nimport { PACKAGE_INFO } from \"../generated/package_info.js\";\nimport { unsupportedMember, unsupportedOption } from \"./errors.js\";\nimport { getLegacyFileIo, getLegacyWasm } from \"./runtime.js\";\nimport {\n mapTextFormat,\n prettyIndent,\n spacesAround,\n validateBitmarkOptions,\n validateJsonOptions,\n validateVersionOptions,\n} from \"./translate.js\";\nimport type {\n BreakscapeOptions,\n ConvertHtmlTableOptions,\n ConvertOptions,\n ConvertTextOptions,\n CreateAstOptions,\n ExtractPlainTextOptions,\n FileOptions,\n InfoOptions,\n UnbreakscapeOptions,\n UpgradeOptions,\n} from \"./options.js\";\nimport { makePseudoAst, type LegacyPseudoAst } from \"./pseudo-ast.js\";\nimport { BUILT_BIT_PARSER } from \"./builder.js\";\n\n/** Classified input for the convert/upgrade pipeline (PLAN-126 F-10). */\ninterface ResolvedInput {\n /** JSON-wrapper-array string (json/ast input) or bitmark source (bitmark input). */\n source: string;\n isBitmark: boolean;\n}\n\nexport class BitmarkParserGenerator {\n /**\n * Get the version of the library.\n *\n * Reports the @gmb/bitmark-parser version (not a bpg version string).\n */\n public version(): string {\n return PACKAGE_INFO.version;\n }\n\n /**\n * Convert bitmark from bitmark to JSON, or JSON to bitmark (bpg-compatible).\n *\n * Input detection order matches bpg: AST → JSON → assume bitmark.\n * Default output: bitmark input → json; json/ast input → bitmark.\n */\n public convert(input: string | unknown, options?: ConvertOptions): string | unknown | void {\n const opts: ConvertOptions = Object.assign({}, options);\n const jsonOptions = Object.assign({}, opts.jsonOptions);\n const bitmarkOptions = Object.assign({}, opts.bitmarkOptions);\n validateVersionOptions(opts);\n validateBitmarkOptions(bitmarkOptions);\n validateJsonOptions(jsonOptions);\n this.checkBrowserFileWrite(opts.outputFile);\n\n const wasm = getLegacyWasm();\n const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);\n\n const outputFormat = opts.outputFormat ?? (isBitmark ? \"json\" : \"bitmark\");\n const coreFormat = outputFormat === \"ast\" ? \"json\" : outputFormat;\n // bpg parity: `jsonOptions.prettify` governs JSON output only;\n // `bitmarkOptions.prettifyJson` governs bitmark output (it prettifies the\n // embedded JSON bodies of json-format bits — same boolean|number shape).\n const { pretty, indent } = prettyIndent(jsonOptions.prettify);\n const emit =\n coreFormat === \"bitmark\" ? prettyIndent(bitmarkOptions.prettifyJson) : { pretty, indent };\n const spaces = spacesAround(bitmarkOptions.spacesAroundValues);\n // bpg parity: unknown properties are included in JSON output unless\n // `jsonOptions.excludeUnknownProperties` is set (the core flag is the\n // inverse and only affects the bitmark → JSON direction).\n const includeUnknown = !jsonOptions.excludeUnknownProperties;\n\n const out = wasm.convert(source, isBitmark ? \"bitmark\" : \"json\", coreFormat, \"optimized\", emit.pretty, emit.indent, spaces, includeUnknown, false, \"\", \"\");\n\n // Shape the result per output format (bpg-compatible return shapes)\n if (outputFormat === \"bitmark\" || outputFormat === \"text\") {\n return this.deliver(out, opts.outputFile, opts.fileOptions);\n }\n if (outputFormat === \"json\") {\n if (opts.outputFile) return this.deliver(out, opts.outputFile, opts.fileOptions);\n if (pretty || jsonOptions.stringify) return out;\n return JSON.parse(out) as unknown;\n }\n // outputFormat === \"ast\": bit-JSON pseudo-AST (PLAN-126 §3.1)\n const ast = makePseudoAst(JSON.parse(out) as unknown[]);\n if (opts.outputFile) {\n return this.deliver(JSON.stringify(ast), opts.outputFile, opts.fileOptions);\n }\n return ast;\n }\n\n /**\n * Upgrade (prettify / canonicalize) bitmark or JSON to the latest version\n * of itself (bpg-compatible `upgrade`).\n */\n public upgrade(input: string | unknown, options?: UpgradeOptions): string | unknown | void {\n const opts: UpgradeOptions = Object.assign({}, options);\n const jsonOptions = Object.assign({}, opts.jsonOptions);\n const bitmarkOptions = Object.assign({}, opts.bitmarkOptions);\n validateVersionOptions(opts);\n validateBitmarkOptions(bitmarkOptions);\n validateJsonOptions(jsonOptions);\n this.checkBrowserFileWrite(opts.outputFile);\n\n const wasm = getLegacyWasm();\n const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);\n // Same routing as convert(): bitmark in → bitmark out, so prettifyJson\n // applies; JSON in → JSON out, so jsonOptions.prettify applies.\n const { pretty, indent } = prettyIndent(\n isBitmark ? bitmarkOptions.prettifyJson : jsonOptions.prettify,\n );\n const spaces = spacesAround(bitmarkOptions.spacesAroundValues);\n\n const out = wasm.canonicalize(source, isBitmark ? \"bitmark\" : \"json\", \"optimized\", pretty, indent, spaces);\n\n if (isBitmark) return this.deliver(out, opts.outputFile, opts.fileOptions);\n if (opts.outputFile) return this.deliver(out, opts.outputFile, opts.fileOptions);\n if (pretty || jsonOptions.stringify) return out;\n return JSON.parse(out) as unknown;\n }\n\n /**\n * Get information about the bitmark language (bpg-compatible `info`).\n */\n public info(options?: InfoOptions): unknown {\n const opts: InfoOptions = Object.assign({}, options);\n const wasm = getLegacyWasm();\n const type = opts.type ?? \"list\";\n const format = opts.outputFormat ?? \"text\";\n const { pretty, indent } = prettyIndent(opts.prettify);\n\n const coreFormat = format === \"pojo\" ? \"json\" : format;\n // full=true: the legacy facade keeps the rich info shape (bpg parity).\n // The legacy (bpg-compatible) surface is English-only by definition.\n const out = wasm.info(type, coreFormat, opts.bit ?? \"\", pretty, indent, false, false, true, \"\");\n if (format === \"pojo\") return JSON.parse(out) as unknown;\n return out;\n }\n\n /** Not supported: bpg-internal development tool. */\n public generateConfig(_options?: unknown): void {\n unsupportedMember(\"BitmarkParserGenerator.generateConfig\", \"bpg-internal development tool\");\n }\n\n /**\n * Convert between HTML tables and bitmark tables (bpg-compatible\n * `convertHtmlTable`).\n *\n * Backed by the core's schema-driven html mapping: HTML input has each\n * `<table>` wrapped in the core's `<bitmark-bit>` envelope and parsed;\n * bits input is emitted as html and the `<table>` fragments extracted\n * (the envelope stripped). The markup *inside* `<table>` follows this\n * parser's html mapping, which may differ from bpg's in detail.\n */\n public convertHtmlTable(\n input: string | unknown,\n options?: ConvertHtmlTableOptions,\n ): string | unknown | void {\n const opts: ConvertHtmlTableOptions = Object.assign({}, options);\n const jsonOptions = Object.assign({}, opts.jsonOptions);\n const bitmarkOptions = Object.assign({}, opts.bitmarkOptions);\n validateBitmarkOptions(bitmarkOptions);\n validateJsonOptions(jsonOptions);\n if (opts.keepUnknownTags) unsupportedOption(\"keepUnknownTags\");\n if (opts.noBreakscaping) unsupportedOption(\"noBreakscaping\");\n this.checkBrowserFileWrite(opts.outputFile);\n const wasm = getLegacyWasm();\n\n const inStr = typeof input === \"string\" ? this.maybeReadFile(input, undefined) : \"\";\n const isHtmlInput =\n opts.inputFormat === \"html\" ||\n (opts.inputFormat === undefined && typeof input === \"string\" && /<table[\\s>]/iu.test(inStr));\n\n if (!isHtmlInput) {\n // bits (bitmark / JSON / AST) → HTML `<table>` fragments\n const { source, isBitmark } = this.resolveInput(input, undefined);\n const out = wasm.convert(source, isBitmark ? \"bitmark\" : \"json\", \"html\", \"optimized\", false, 2, 1, false, false, \"\", \"\");\n return this.deliver(extractHtmlTables(out).join(\"\\n\"), opts.outputFile, opts.fileOptions);\n }\n\n // HTML input: wrap each <table> in the core's bit envelope and parse\n const bitType = opts.tableFormat === \"table\" ? \"table\" : \"table-extended\";\n const wrapped = extractHtmlTables(inStr)\n .map((t) => `<bitmark-bit data-type=\"${bitType}\" data-format=\"bitmark++\">${t}</bitmark-bit>`)\n .join(\"\");\n const outputFormat = opts.outputFormat ?? \"bitmark\";\n const { pretty, indent } = prettyIndent(jsonOptions.prettify);\n const spaces = spacesAround(bitmarkOptions.spacesAroundValues);\n\n if (outputFormat === \"html\") {\n const out = wasm.convert(wrapped, \"html\", \"html\", \"optimized\", false, 2, 1, false, false, \"\", \"\");\n return this.deliver(extractHtmlTables(out).join(\"\\n\"), opts.outputFile, opts.fileOptions);\n }\n const coreFormat = outputFormat === \"ast\" ? \"json\" : outputFormat;\n const out = wasm.convert(wrapped, \"html\", coreFormat, \"optimized\", pretty, indent, spaces, false, false, \"\", \"\");\n if (outputFormat === \"bitmark\" || outputFormat === \"text\") {\n return this.deliver(out, opts.outputFile, opts.fileOptions);\n }\n if (outputFormat === \"json\") {\n if (opts.outputFile) return this.deliver(out, opts.outputFile, opts.fileOptions);\n if (pretty || jsonOptions.stringify) return out;\n return JSON.parse(out) as unknown;\n }\n const ast = makePseudoAst(JSON.parse(out) as unknown[]);\n if (opts.outputFile) return this.deliver(JSON.stringify(ast), opts.outputFile, opts.fileOptions);\n return ast;\n }\n\n /**\n * Create a bit-JSON pseudo-AST from bitmark or JSON input (PLAN-126 §3.1).\n *\n * NOTE: the returned structure is the bit JSON (wrapper entries), not\n * bpg's internal TS AST node model. It round-trips through `convert` but\n * is not walkable with bpg's `Ast`/`NodeType`.\n */\n public createAst(input: unknown, options?: CreateAstOptions): LegacyPseudoAst {\n const opts: CreateAstOptions = Object.assign({}, options);\n const wasm = getLegacyWasm();\n const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);\n // bpg's AST carries extraProperties unconditionally (createAst has no\n // jsonOptions), so unknown properties are always included here.\n const out = wasm.convert(source, isBitmark ? \"bitmark\" : \"json\", \"json\", \"optimized\", false, 2, 1, true, false, \"\", \"\");\n return makePseudoAst(JSON.parse(out) as unknown[]);\n }\n\n /**\n * Breakscape text (bpg-compatible `breakscapeText`).\n */\n public breakscapeText(input: string, options?: BreakscapeOptions): string | void {\n if (!input) return input;\n const opts: BreakscapeOptions = Object.assign({}, options);\n this.checkBrowserFileWrite(opts.outputFile);\n const wasm = getLegacyWasm();\n const inStr = this.maybeReadFile(input, opts.inputFormat);\n const res = wasm.breakscape_text(inStr, mapTextFormat(opts.textFormat), opts.textLocation ?? \"body\");\n return this.deliver(res, opts.outputFile, opts.fileOptions);\n }\n\n /**\n * Unbreakscape text (bpg-compatible `unbreakscapeText`).\n */\n public unbreakscapeText(input: string, options?: UnbreakscapeOptions): string | void {\n if (!input) return input;\n const opts: UnbreakscapeOptions = Object.assign({}, options);\n this.checkBrowserFileWrite(opts.outputFile);\n const wasm = getLegacyWasm();\n const inStr = this.maybeReadFile(input, opts.inputFormat);\n const res = wasm.unbreakscape_text(inStr, mapTextFormat(opts.textFormat), opts.textLocation ?? \"body\");\n return this.deliver(res, opts.outputFile, opts.fileOptions);\n }\n\n /**\n * Convert bitmark text ↔ text AST (bpg-compatible `convertText`).\n *\n * Direction is auto-detected: TextAst (JSON) input generates bitmark\n * text; anything else parses as bitmark text and returns the TextAst\n * (plain JS object; a string when `jsonOptions.prettify` is set).\n */\n public convertText(input: string | unknown, options?: ConvertTextOptions): string | unknown | void {\n const opts: ConvertTextOptions = Object.assign({}, options);\n const jsonOptions = Object.assign({}, opts.jsonOptions);\n this.checkBrowserFileWrite(opts.outputFile);\n const wasm = getLegacyWasm();\n\n const isBitmarkText = opts.textFormat === undefined || mapTextFormat(opts.textFormat) === \"bitmark++\";\n const textLocation = opts.textLocation ?? \"body\";\n\n let inStr: string;\n let ast: unknown[] | undefined;\n if (typeof input === \"string\") {\n inStr = this.maybeReadFile(input, opts.inputFormat);\n ast = this.parseTextAstString(inStr);\n } else {\n inStr = JSON.stringify(input);\n ast = Array.isArray(input) ? input : undefined;\n }\n\n if (ast !== undefined) {\n // TextAst → text (reverse honours the location; a plain-text format\n // generates plain text, i.e. marks are dropped — bpg parity)\n const out = isBitmarkText\n ? wasm.convert_text(JSON.stringify(ast), \"astToText\", \"bitmark++\", textLocation)\n : wasm.convert_text(JSON.stringify(ast), \"astToPlainText\", \"plainText\", textLocation);\n return this.deliver(out, opts.outputFile, opts.fileOptions);\n }\n\n // text → TextAst (bpg parses forward at body location)\n const out = wasm.convert_text(inStr, \"textToAst\", isBitmarkText ? \"bitmark++\" : \"plainText\", \"body\");\n const { pretty, indent } = prettyIndent(jsonOptions.prettify);\n const outStr = pretty ? wasm.prettify(out, indent) : out;\n if (opts.outputFile) return this.deliver(outStr, opts.outputFile, opts.fileOptions);\n if (pretty) return outStr;\n return JSON.parse(out) as unknown;\n }\n\n /**\n * Convert a text AST to plain text (bpg-compatible `textAstToPlainText`).\n */\n public textAstToPlainText(textAst: unknown, _options?: ExtractPlainTextOptions): string {\n const wasm = getLegacyWasm();\n const out = wasm.convert_text(\n typeof textAst === \"string\" ? textAst : JSON.stringify(textAst),\n \"astToPlainText\",\n \"bitmark++\",\n \"body\",\n );\n return out;\n }\n\n /**\n * Extract plain text from bitmark or bitmark JSON (bpg-compatible).\n */\n public extractPlainText(input: string | unknown, options?: ExtractPlainTextOptions): string {\n const inputFormat = options?.inputFormat;\n const wasm = getLegacyWasm();\n if (inputFormat === \"plainText\") {\n return typeof input === \"string\" ? String(input) : \"\";\n }\n if (inputFormat === \"bitmarkText\") {\n const ast = wasm.convert_text(String(input), \"textToAst\", \"bitmark++\", \"body\");\n const out = wasm.convert_text(ast, \"astToPlainText\", \"bitmark++\", \"body\");\n return out;\n }\n if (typeof input === \"string\" && this.parseTextAstString(input) === undefined && !wasm.is_bitmark(input)) {\n // Neither JSON nor bitmark: bpg falls through to bitmark text\n const looksJson = ((): boolean => {\n try {\n JSON.parse(input);\n return true;\n } catch {\n return false;\n }\n })();\n if (!looksJson) {\n return this.extractPlainText(input, { inputFormat: \"bitmarkText\" });\n }\n }\n const { source, isBitmark } = this.resolveInput(input, undefined);\n const out = wasm.convert(source, isBitmark ? \"bitmark\" : \"json\", \"text\", \"optimized\", false, 2, 1, false, false, \"\", \"\");\n return out;\n }\n\n /** If `s` parses as a TextAst JSON array, return it. */\n private parseTextAstString(s: string): unknown[] | undefined {\n const t = s.trim();\n if (!t.startsWith(\"[\")) return undefined;\n try {\n const v = JSON.parse(t) as unknown;\n if (Array.isArray(v) && v.every((n) => n !== null && typeof n === \"object\" && \"type\" in n)) {\n return v;\n }\n } catch {\n // not JSON\n }\n return undefined;\n }\n\n // ------------------------------------------------------------------\n // Internal helpers\n // ------------------------------------------------------------------\n\n /**\n * Resolve bpg input (string | file path | JSON value | pseudo-AST) to a\n * source string for the WASM core, classified per bpg's detection order:\n * AST → JSON → assume bitmark (PLAN-126 F-10).\n */\n protected resolveInput(input: unknown, inputFormat: string | undefined): ResolvedInput {\n if (typeof input !== \"string\") {\n // Parsed JSON / pseudo-AST value.\n const entries = this.jsonEntries(input);\n return {\n source: JSON.stringify(entries ? entries.map((b) => this.toWrapperEntry(b)) : input),\n isBitmark: false,\n };\n }\n const inStr = this.maybeReadFile(input, inputFormat);\n const wasm = getLegacyWasm();\n if (wasm.is_bitmark(inStr)) return { source: inStr, isBitmark: true };\n // JSON-ish: normalise loose shapes (AST envelope, single wrapper, bare bit)\n try {\n const parsed = JSON.parse(inStr) as unknown;\n const entries = this.jsonEntries(parsed);\n if (entries) {\n return {\n source: JSON.stringify(entries.map((b) => this.toWrapperEntry(b))),\n isBitmark: false,\n };\n }\n } catch {\n // is_bitmark said \"not bitmark\" but it is not JSON either —\n // fall through and let the core's own detection handle it (bpg\n // behaviour: assume bitmark).\n return { source: inStr, isBitmark: true };\n }\n return { source: inStr, isBitmark: false };\n }\n\n /**\n * Normalise the JSON shapes bpg accepts to a bits/entries array:\n * wrapper array, `{ bits: [...] }` AST envelope, single `{ bit: ... }`\n * wrapper, or a bare bit object (`{ type: ... }`).\n */\n private jsonEntries(v: unknown): unknown[] | undefined {\n if (Array.isArray(v)) return v;\n if (v !== null && typeof v === \"object\") {\n const o = v as Record<string, unknown>;\n if (Array.isArray(o.bits)) return o.bits;\n if (\"bit\" in o) return [o];\n if (typeof o.type === \"string\") return [{ bit: o }];\n }\n return undefined;\n }\n\n /**\n * Normalise a pseudo-AST bits entry to a `{ bit, parser? }` wrapper.\n * `Builder.buildBit` returns bare bit JSON (with any parser metadata\n * attached under a non-enumerable symbol); parsed forward output is\n * already wrapper-shaped.\n */\n private toWrapperEntry(entry: unknown): unknown {\n if (entry !== null && typeof entry === \"object\" && \"bit\" in (entry as object)) return entry;\n const wrapper: { bit: unknown; parser?: unknown } = { bit: entry };\n const parser = (entry as Record<symbol, unknown> | null)?.[BUILT_BIT_PARSER];\n if (parser !== undefined) wrapper.parser = parser;\n return wrapper;\n }\n\n /** bpg parity: read `input` as a file when it names one (Node only). */\n protected maybeReadFile(input: string, inputFormat: string | undefined): string {\n if (inputFormat === \"string\") return input;\n const io = getLegacyFileIo();\n if (!io) return input;\n try {\n if (io.existsSync(input)) return io.readFileSync(input, \"utf8\");\n } catch {\n // treat as literal input\n }\n return input;\n }\n\n /** bpg parity: writing a file is impossible in the browser. */\n protected checkBrowserFileWrite(outputFile: string | undefined): void {\n if (outputFile && !getLegacyFileIo()) {\n throw new Error(\"Cannot write to file in browser environment\");\n }\n }\n\n /** Return `data`, or write it to `outputFile` (returning void), as bpg does. */\n protected deliver(data: string, outputFile?: string, fileOptions?: FileOptions): string | void {\n if (!outputFile) return data;\n const io = getLegacyFileIo();\n if (!io) throw new Error(\"Cannot write to file in browser environment\");\n io.writeFile(outputFile, data, {\n append: fileOptions?.append,\n encoding: fileOptions?.encoding ?? \"utf8\",\n });\n }\n\n}\n\n/**\n * Extract every top-level `<table>…</table>` fragment from `html`\n * (case-insensitive, nesting-safe). Pure string scanning — no HTML parsing.\n */\nfunction extractHtmlTables(html: string): string[] {\n const tables: string[] = [];\n const lower = html.toLowerCase();\n let i = 0;\n for (;;) {\n const start = lower.indexOf(\"<table\", i);\n if (start === -1) break;\n let depth = 0;\n let j = start;\n let end = -1;\n while (j < html.length) {\n const open = lower.indexOf(\"<table\", j);\n const close = lower.indexOf(\"</table\", j);\n if (close === -1) break;\n if (open !== -1 && open < close) {\n depth++;\n j = open + \"<table\".length;\n } else {\n depth--;\n const closeEnd = lower.indexOf(\">\", close);\n j = closeEnd === -1 ? html.length : closeEnd + 1;\n if (depth === 0) {\n end = j;\n break;\n }\n }\n }\n if (end === -1) break;\n tables.push(html.slice(start, end));\n i = end;\n }\n return tables;\n}\n\n/**\n * Direct bitmark text parser (bpg-compatible `bitmarkTextParse`):\n * bitmark text → TextAst array.\n */\nexport function bitmarkTextParse(text: string): unknown[] {\n const out = getLegacyWasm().convert_text(text, \"textToAst\", \"bitmark++\", \"body\");\n return JSON.parse(out) as unknown[];\n}\n","// @zen-component: LEGACY-Facade\n// bpg-compatible `ResourceBuilder` (PLAN-126 §3.1): each method shapes the\n// `{ type, <family>: { ... } }` ResourceJson wrapper from bpg's flat data.\n// One generic table-driven implementation — per-bit-type defaulting and\n// URL-derived cosmetics are left to the config-driven core, which normalizes\n// the resource when the bit containing it is converted.\n\ninterface ResourceSpec {\n /** ResourceJson discriminator (`type`). */\n type: string;\n /** Family key holding the resource data object. */\n key: string;\n /** JSON field that bpg's `data.value` maps to. */\n valueField: \"src\" | \"url\" | \"body\";\n}\n\nconst RESOURCE_SPECS = {\n imageResource: { type: \"image\", key: \"image\", valueField: \"src\" },\n imageLinkResource: { type: \"image-link\", key: \"imageLink\", valueField: \"url\" },\n audioResource: { type: \"audio\", key: \"audio\", valueField: \"src\" },\n audioEmbedResource: { type: \"audio-embed\", key: \"audioEmbed\", valueField: \"src\" },\n audioLinkResource: { type: \"audio-link\", key: \"audioLink\", valueField: \"url\" },\n videoResource: { type: \"video\", key: \"video\", valueField: \"src\" },\n videoEmbedResource: { type: \"video-embed\", key: \"videoEmbed\", valueField: \"url\" },\n videoLinkResource: { type: \"video-link\", key: \"videoLink\", valueField: \"url\" },\n stillImageFilmEmbedResource: {\n type: \"still-image-film-embed\",\n key: \"stillImageFilmEmbed\",\n valueField: \"url\",\n },\n stillImageFilmLinkResource: {\n type: \"still-image-film-link\",\n key: \"stillImageFilmLink\",\n valueField: \"url\",\n },\n articleResource: { type: \"article\", key: \"article\", valueField: \"body\" },\n documentResource: { type: \"document\", key: \"document\", valueField: \"url\" },\n documentEmbedResource: { type: \"document-embed\", key: \"documentEmbed\", valueField: \"url\" },\n documentLinkResource: { type: \"document-link\", key: \"documentLink\", valueField: \"url\" },\n documentDownloadResource: {\n type: \"document-download\",\n key: \"documentDownload\",\n valueField: \"url\",\n },\n appLinkResource: { type: \"app-link\", key: \"appLink\", valueField: \"url\" },\n websiteLinkResource: { type: \"website-link\", key: \"websiteLink\", valueField: \"url\" },\n} as const satisfies Record<string, ResourceSpec>;\n\nexport type ResourceMethod = (\n context: unknown,\n data: Record<string, unknown> | undefined,\n __typeAlias?: string,\n) => Record<string, unknown> | undefined;\n\nfunction buildResource(spec: ResourceSpec): ResourceMethod {\n return (_context, data, _typeAlias) => {\n if (!data) return undefined;\n const { value, ...rest } = data;\n const inner: Record<string, unknown> = { [spec.valueField]: value ?? \"\" };\n for (const [k, v] of Object.entries(rest)) {\n if (v !== undefined) inner[k] = v;\n }\n return { type: spec.type, [spec.key]: inner };\n };\n}\n\n/** Resource `type` string → spec (for the generic wrapper/data entry points). */\nconst SPEC_BY_TYPE: Record<string, ResourceSpec> = Object.fromEntries(\n Object.values(RESOURCE_SPECS).map((s) => [s.type, s]),\n);\n\n/** bpg-compatible ResourceBuilder: 17 `<family>Resource(context, data)` methods\n * plus the generic `resourceFromResourceJson` / `resourceFromResourceDataJson`. */\nexport class ResourceBuilder {\n /**\n * Normalise existing ResourceJson wrapper(s) (bpg-compatible).\n * Unknown resource types are dropped (bpg parity: it skips invalid types).\n */\n resourceFromResourceJson(\n _context: unknown,\n resource?: Record<string, unknown> | Record<string, unknown>[],\n ): unknown {\n if (!resource) return undefined;\n const single = !Array.isArray(resource);\n const list = single ? [resource as Record<string, unknown>] : resource;\n const nodes: Record<string, unknown>[] = [];\n for (const wrapper of list) {\n const spec = SPEC_BY_TYPE[wrapper.type as string];\n if (!spec) continue;\n const inner = (wrapper[spec.key] ?? {}) as Record<string, unknown>;\n const { [spec.valueField]: value, ...rest } = inner;\n const built = buildResource(spec)(undefined, { value, ...rest });\n if (built) nodes.push(built);\n }\n if (nodes.length === 0) return undefined;\n return single ? nodes[0] : nodes;\n }\n\n /**\n * Build a resource wrapper from a bare ResourceDataJson (bpg-compatible).\n * `data` may also be a plain string (used as the url/src/body value).\n */\n resourceFromResourceDataJson(\n context: unknown,\n type: string,\n data?: Record<string, unknown> | string,\n ): Record<string, unknown> | undefined {\n if (!data) return undefined;\n const spec = SPEC_BY_TYPE[type];\n if (!spec) return undefined;\n const asString = typeof data === \"string\" ? data : undefined;\n const obj = typeof data === \"object\" ? data : {};\n const { url, src, body, ...rest } = obj as {\n url?: unknown;\n src?: unknown;\n body?: unknown;\n [k: string]: unknown;\n };\n const value = url ?? src ?? body ?? asString;\n return buildResource(spec)(context, { value, ...rest });\n }\n imageResource: ResourceMethod = buildResource(RESOURCE_SPECS.imageResource);\n imageLinkResource: ResourceMethod = buildResource(RESOURCE_SPECS.imageLinkResource);\n audioResource: ResourceMethod = buildResource(RESOURCE_SPECS.audioResource);\n audioEmbedResource: ResourceMethod = buildResource(RESOURCE_SPECS.audioEmbedResource);\n audioLinkResource: ResourceMethod = buildResource(RESOURCE_SPECS.audioLinkResource);\n videoResource: ResourceMethod = buildResource(RESOURCE_SPECS.videoResource);\n videoEmbedResource: ResourceMethod = buildResource(RESOURCE_SPECS.videoEmbedResource);\n videoLinkResource: ResourceMethod = buildResource(RESOURCE_SPECS.videoLinkResource);\n stillImageFilmEmbedResource: ResourceMethod = buildResource(\n RESOURCE_SPECS.stillImageFilmEmbedResource,\n );\n stillImageFilmLinkResource: ResourceMethod = buildResource(\n RESOURCE_SPECS.stillImageFilmLinkResource,\n );\n articleResource: ResourceMethod = buildResource(RESOURCE_SPECS.articleResource);\n documentResource: ResourceMethod = buildResource(RESOURCE_SPECS.documentResource);\n documentEmbedResource: ResourceMethod = buildResource(RESOURCE_SPECS.documentEmbedResource);\n documentLinkResource: ResourceMethod = buildResource(RESOURCE_SPECS.documentLinkResource);\n documentDownloadResource: ResourceMethod = buildResource(\n RESOURCE_SPECS.documentDownloadResource,\n );\n appLinkResource: ResourceMethod = buildResource(RESOURCE_SPECS.appLinkResource);\n websiteLinkResource: ResourceMethod = buildResource(RESOURCE_SPECS.websiteLinkResource);\n}\n","// @zen-component: LEGACY-Facade\n// bpg-compatible enum objects and option interfaces (vendored from\n// bitmark-parser-generator v5.31.1, superenum EnumType<> replaced with the\n// equivalent value-union derivation). Exposed ONLY via the `legacy`\n// namespace / subpath — never re-exported at the package root.\n\n/** @internal */\ntype EnumType<T> = T[keyof T];\n\n/** Input type enumeration */\nexport const Input = {\n /** Input is as a string */\n string: \"string\",\n /** Input is as a file path */\n file: \"file\",\n} as const;\nexport type InputType = EnumType<typeof Input>;\n\n/** Output type enumeration */\nexport const Output = {\n /** Output bitmark string */\n bitmark: \"bitmark\",\n /** Output JSON as a plain JS object, or a file */\n json: \"json\",\n /** Output AST as a plain JS object, or a file */\n ast: \"ast\",\n /** Output plain text as a string, or a file */\n text: \"text\",\n} as const;\nexport type OutputType = EnumType<typeof Output>;\n\n/** Input format enumeration */\nexport const InputFormat = {\n bitmark: \"bitmark\",\n bitmarkText: \"bitmarkText\",\n plainText: \"plainText\",\n html: \"html\",\n} as const;\nexport type InputFormatType = EnumType<typeof InputFormat>;\n\nexport const BitmarkVersion = {\n v2: 2,\n v3: 3,\n} as const;\nexport type BitmarkVersionType = EnumType<typeof BitmarkVersion>;\n\nexport const CardSetVersion = {\n v1: 1,\n v2: 2,\n} as const;\nexport type CardSetVersionType = EnumType<typeof CardSetVersion>;\n\nexport const BitmarkParserType = {\n peggy: \"peggy\",\n} as const;\nexport type BitmarkParserTypeType = EnumType<typeof BitmarkParserType>;\n\nexport const InfoType = {\n list: \"list\",\n deprecated: \"deprecated\",\n all: \"all\",\n bit: \"bit\",\n} as const;\nexport type InfoTypeType = EnumType<typeof InfoType>;\n\nexport const InfoFormat = {\n text: \"text\",\n json: \"json\",\n pojo: \"pojo\",\n} as const;\nexport type InfoFormatType = EnumType<typeof InfoFormat>;\n\nexport const BodyTextFormat = {\n plainText: \"text\",\n latex: \"latex\",\n json: \"json\",\n xml: \"xml\",\n bitmarkPlusPlus: \"bitmark++\",\n} as const;\nexport type BodyTextFormatType = EnumType<typeof BodyTextFormat>;\n\nexport const TextLocation = {\n tag: \"tag\",\n body: \"body\",\n cardBody: \"cardBody\",\n} as const;\nexport type TextLocationType = EnumType<typeof TextLocation>;\n\n/** Options for the output file (Node only) */\nexport interface FileOptions {\n /** Append to a file if true, otherwise overwrite */\n append?: boolean;\n /** Character encoding, defaults to 'utf8' */\n encoding?: string;\n}\n\n// Strict option policy, surfaced at BUILD time (bpg declared these wider):\n// options this facade cannot honour are narrowed to their supported value(s)\n// — truthy-throws booleans to `false`, value-gated enums to the supported\n// literal — so TS consumers get a type error instead of only the runtime\n// LegacyUnsupportedError. The runtime validation stays (JS callers, or TS\n// with the type ignored, still get the loud error).\n\n/** Options for bitmark generation */\nexport interface BitmarkOptions {\n /** Not supported — `true` throws `LegacyUnsupportedError` at runtime. */\n explicitTextFormat?: false;\n prettifyJson?: boolean | number;\n /** bitmark v3 only — card set version `1` throws `LegacyUnsupportedError` at runtime. */\n cardSetVersion?: typeof CardSetVersion.v2;\n spacesAroundValues?: number | boolean;\n /** Not supported — `true` throws `LegacyUnsupportedError` at runtime. */\n debugGenerationInline?: false;\n /** Not supported — `true` throws `LegacyUnsupportedError` at runtime. */\n noBreakscaping?: false;\n}\n\n/** Options for JSON generation */\nexport interface JsonOptions {\n enableWarnings?: boolean | number;\n prettify?: boolean | number;\n stringify?: boolean;\n /** bitmark v3 only — `true` throws `LegacyUnsupportedError` at runtime. */\n textAsPlainText?: false;\n /**\n * Exclude unknown properties from the JSON output (default: `false` —\n * unknown properties are included, as bpg). The parser's warning text\n * references the new API's inverse flag (`includeUnknownProperties`).\n */\n excludeUnknownProperties?: boolean;\n /** Not supported — `true` throws `LegacyUnsupportedError` at runtime. */\n debugGenerationInline?: false;\n}\n\n/** Options for bitmark text JSON generation */\nexport interface TextJsonOptions {\n prettify?: boolean | number;\n}\n\n/** Info options for the parser */\nexport interface InfoOptions {\n type?: InfoTypeType;\n bit?: string;\n outputFormat?: InfoFormatType;\n prettify?: boolean | number;\n}\n\n/** Conversion options for bitmark / JSON conversion */\nexport interface ConvertOptions {\n /** bitmark v3 only — version `2` throws `LegacyUnsupportedError` at runtime. */\n bitmarkVersion?: typeof BitmarkVersion.v3;\n bitmarkParserType?: BitmarkParserTypeType;\n inputFormat?: InputType;\n outputFormat?: OutputType;\n outputFile?: string;\n fileOptions?: FileOptions;\n bitmarkOptions?: BitmarkOptions;\n jsonOptions?: JsonOptions;\n}\n\n/** Prettify options for bitmark / JSON prettify / validate */\nexport interface UpgradeOptions {\n /** bitmark v3 only — version `2` throws `LegacyUnsupportedError` at runtime. */\n bitmarkVersion?: typeof BitmarkVersion.v3;\n bitmarkParserType?: BitmarkParserTypeType;\n inputFormat?: InputType;\n outputFile?: string;\n fileOptions?: FileOptions;\n bitmarkOptions?: BitmarkOptions;\n jsonOptions?: JsonOptions;\n}\n\n/** Conversion options for bitmark text / JSON conversion */\nexport interface ConvertTextOptions {\n textFormat?: BodyTextFormatType;\n textLocation?: TextLocationType;\n inputFormat?: InputType;\n outputFile?: string;\n fileOptions?: FileOptions;\n jsonOptions?: TextJsonOptions;\n}\n\n/** Create AST options */\nexport interface CreateAstOptions {\n inputFormat?: InputType;\n}\n\nexport interface ExtractPlainTextOptions {\n inputFormat?: InputFormatType;\n}\n\n/** Options for convertHtmlTable */\nexport interface ConvertHtmlTableOptions {\n inputFormat?: InputFormatType;\n outputFormat?: OutputType | \"html\";\n tableFormat?: string;\n keepUnknownTags?: boolean;\n /** Not supported — `true` throws `LegacyUnsupportedError` at runtime. */\n noBreakscaping?: false;\n outputFile?: string;\n fileOptions?: FileOptions;\n bitmarkOptions?: BitmarkOptions;\n jsonOptions?: JsonOptions;\n}\n\n/** Breakscape options */\nexport interface BreakscapeOptions {\n inputFormat?: InputType;\n outputFile?: string;\n fileOptions?: FileOptions;\n textFormat?: BodyTextFormatType;\n textLocation?: TextLocationType;\n}\n\n/** Unbreakscape options */\nexport interface UnbreakscapeOptions {\n inputFormat?: InputType;\n outputFile?: string;\n fileOptions?: FileOptions;\n textFormat?: BodyTextFormatType;\n textLocation?: TextLocationType;\n}\n","// @zen-component: LEGACY-Facade\n// Remaining bpg enum exports: TextMarkType / TextNodeType (vendored values),\n// BitType (built lazily from the config-driven core — never a hardcoded bit\n// list), and throwing proxies for enums tied to unsupported internals.\n\nimport { unsupportedMember } from \"./errors.js\";\nimport { getLegacyWasm } from \"./runtime.js\";\n\n/** Vendored from bpg v5.31.1 model/enum/TextMarkType.ts. */\nexport const TextMarkType = {\n bold: \"bold\",\n light: \"light\",\n italic: \"italic\",\n highlight: \"highlight\",\n highlightOrange: \"highlightOrange\",\n highlightYellow: \"highlightYellow\",\n highlightGreen: \"highlightGreen\",\n highlightBlue: \"highlightBlue\",\n highlightPurple: \"highlightPurple\",\n highlightPink: \"highlightPink\",\n highlightBrown: \"highlightBrown\",\n highlightBlack: \"highlightBlack\",\n highlightWhite: \"highlightWhite\",\n highlightGray: \"highlightGray\",\n strike: \"strike\",\n subscript: \"subscript\",\n superscript: \"superscript\",\n ins: \"ins\",\n del: \"del\",\n underline: \"underline\",\n doubleUnderline: \"doubleUnderline\",\n circle: \"circle\",\n languageEmRed: \"languageEmRed\",\n languageEmOrange: \"languageEmOrange\",\n languageEmYellow: \"languageEmYellow\",\n languageEmGreen: \"languageEmGreen\",\n languageEmBlue: \"languageEmBlue\",\n languageEmPurple: \"languageEmPurple\",\n languageEmPink: \"languageEmPink\",\n languageEmBrown: \"languageEmBrown\",\n languageEmBlack: \"languageEmBlack\",\n languageEmWhite: \"languageEmWhite\",\n languageEmGray: \"languageEmGray\",\n languageEm: \"languageEm\",\n userUnderline: \"userUnderline\",\n userDoubleUnderline: \"userDoubleUnderline\",\n userStrike: \"userStrike\",\n userCircle: \"userCircle\",\n userHighlight: \"userHighlight\",\n notranslate: \"notranslate\",\n link: \"link\",\n ref: \"ref\",\n xref: \"xref\",\n extref: \"extref\",\n footnote: \"footnote\",\n footnoteStar: \"footnote*\",\n symbol: \"symbol\",\n var: \"var\",\n code: \"code\",\n timer: \"timer\",\n duration: \"duration\",\n color: \"color\",\n colorPicker: \"colorPicker\",\n comment: \"comment\",\n} as const;\n\n/** Vendored from bpg v5.31.1 model/enum/TextNodeType.ts. */\nexport const TextNodeType = {\n text: \"text\",\n hardBreak: \"hardBreak\",\n paragraph: \"paragraph\",\n heading: \"heading\",\n section: \"section\",\n noBulletList: \"noBulletList\",\n bulletList: \"bulletList\",\n orderedList: \"orderedList\",\n orderedListRoman: \"orderedListRoman\",\n orderedListRomanLower: \"orderedListRomanLower\",\n letteredList: \"letteredList\",\n letteredListLower: \"letteredListLower\",\n taskList: \"taskList\",\n listItem: \"listItem\",\n taskItem: \"taskItem\",\n image: \"image\",\n imageInline: \"imageInline\",\n codeBlock: \"codeBlock\",\n latex: \"latex\",\n gap: \"gap\",\n select: \"select\",\n highlight: \"highlight\",\n mark: \"mark\",\n} as const;\n\n/** bpg key derivation: kebab-case bit name → camelCase enum key. */\nfunction bitNameToKey(name: string): string {\n return name.replace(/-([a-z0-9])/gu, (_, c: string) => c.toUpperCase());\n}\n\nlet bitTypeCache: Record<string, string> | undefined;\n\nfunction loadBitTypes(): Record<string, string> {\n if (!bitTypeCache) {\n const wasm = getLegacyWasm();\n // includeDeprecated: bpg's BitType enum carries the deprecated bit\n // types too (PLAN-149 hides them from listings by default).\n const all = JSON.parse(wasm.info(\"all\", \"json\", \"\", false, 2, true, false, false, \"\")) as {\n name: string;\n }[];\n const map: Record<string, string> = { _standard: \"_standard\" };\n for (const { name } of all) {\n map[bitNameToKey(name)] = name;\n }\n bitTypeCache = map;\n }\n return bitTypeCache;\n}\n\n/**\n * bpg-compatible `BitType` enum object, built lazily from the core's\n * config (`info`) rather than a hardcoded list. Keys are the camelCase of\n * the bit names, exactly as bpg derives them.\n */\nexport const BitType: Record<string, string> = new Proxy(\n {},\n {\n get: (_t, prop) => (typeof prop === \"string\" ? loadBitTypes()[prop] : undefined),\n has: (_t, prop) => typeof prop === \"string\" && prop in loadBitTypes(),\n ownKeys: () => Reflect.ownKeys(loadBitTypes()),\n getOwnPropertyDescriptor: (_t, prop) =>\n typeof prop === \"string\" && prop in loadBitTypes()\n ? { value: loadBitTypes()[prop], enumerable: true, configurable: true, writable: false }\n : undefined,\n },\n);\n\n/** Loud F-2 stand-in for enums tied to unsupported bpg internals. */\nfunction unsupportedEnum(name: string, reason: string): Record<string, string> {\n return new Proxy(\n {},\n {\n get: (_t, prop) => {\n if (prop === Symbol.toPrimitive || prop === \"toString\" || prop === Symbol.toStringTag) {\n return () => `[unsupported ${name}]`;\n }\n return unsupportedMember(name, reason);\n },\n has: () => unsupportedMember(name, reason),\n ownKeys: () => unsupportedMember(name, reason),\n },\n );\n}\n\n/** bpg `NodeType` — names bpg's internal AST nodes; the legacy AST is bit JSON. */\nexport const NodeType = unsupportedEnum(\n \"NodeType\",\n \"it names bpg's internal AST nodes; the legacy AST is bit JSON (see createAst)\",\n);\n\n/** bpg `BoundingBoxIndex` — bpg-internal utility. */\nexport const BoundingBoxIndex = unsupportedEnum(\n \"BoundingBoxIndex\",\n \"bpg-internal bounding-box utility\",\n);\n","// @zen-component: LEGACY-Facade\n// Throwing stubs for bpg exports the legacy facade deliberately does not\n// implement (PLAN-126 F-2: exist, but fail loudly and deterministically —\n// never silent no-ops). These are internals of bpg's TS implementation\n// (its AST walker, generators, parsers, writers), which have no equivalent\n// over the WASM core.\n\nimport { unsupportedMember } from \"./errors.js\";\n\nfunction stubClass(name: string, reason: string): new (...args: unknown[]) => never {\n return class {\n constructor() {\n unsupportedMember(name, reason);\n }\n } as unknown as new (...args: unknown[]) => never;\n}\n\nconst WALKER_REASON =\n \"the legacy AST is bit JSON, not bpg's internal node model; walking it with bpg NodeType names would silently misbehave\";\nconst INTERNAL_REASON = \"internal class of bpg's TS implementation\";\n\n/** bpg `Ast` walker — unsupported (PLAN-126 decision Q-7). */\nexport const Ast = stubClass(\"Ast\", WALKER_REASON);\n\nexport const BitmarkGenerator = stubClass(\"BitmarkGenerator\", INTERNAL_REASON);\nexport const BitmarkStringGenerator = stubClass(\"BitmarkStringGenerator\", INTERNAL_REASON);\nexport const BitmarkFileGenerator = stubClass(\"BitmarkFileGenerator\", INTERNAL_REASON);\nexport const JsonGenerator = stubClass(\"JsonGenerator\", INTERNAL_REASON);\nexport const JsonStringGenerator = stubClass(\"JsonStringGenerator\", INTERNAL_REASON);\nexport const JsonFileGenerator = stubClass(\"JsonFileGenerator\", INTERNAL_REASON);\nexport const HtmlTableGenerator = stubClass(\"HtmlTableGenerator\", INTERNAL_REASON);\nexport const HtmlTableParser = stubClass(\"HtmlTableParser\", INTERNAL_REASON);\nexport const BitmarkParser = stubClass(\"BitmarkParser\", INTERNAL_REASON);\nexport const JsonParser = stubClass(\"JsonParser\", INTERNAL_REASON);\nexport const StringWriter = stubClass(\"StringWriter\", INTERNAL_REASON);\nexport const FileWriter = stubClass(\"FileWriter\", INTERNAL_REASON);\nexport const StreamWriter = stubClass(\"StreamWriter\", INTERNAL_REASON);\n","// @zen-component: TS-EditorTypes\n//\n// The editor services (PLAN-196): what an editor needs from the parser, in\n// LSP 3.17 shapes — `Diagnostic`, and (PLAN-196 PR 4) `CompletionList` /\n// `CompletionItem` and `Hover`. The types are written here by hand, field\n// for field and value for value as the protocol defines them, so they assign\n// to Monaco's and `vscode-languageserver-types`' without a cast and the\n// package keeps its zero runtime dependencies. The contract is\n// `.zen/specs/API-EDT-editor-services.tsp`.\n\nimport type { PositionEncoding } from \"./semantic-tokens-types.js\";\nimport type { CompactTagInfo, FullTagInfo } from \"./types.js\";\n\n/** An LSP position: 0-based `line`, 0-based `character` in the response's\n * `positionEncoding` units (UTF-16 code units by default). */\nexport interface Position {\n line: number;\n character: number;\n}\n\n/** An LSP range: `start` inclusive, `end` exclusive; may span lines. */\nexport interface Range {\n start: Position;\n end: Position;\n}\n\n/**\n * LSP `DiagnosticSeverity`. The JSON envelope's buckets map onto it:\n * `errors` → `Error`, `warnings` → `Warning`, `infos` → `Information`.\n * `Hint` is never produced.\n */\nexport const DiagnosticSeverity = {\n Error: 1,\n Warning: 2,\n Information: 3,\n Hint: 4,\n} as const;\nexport type DiagnosticSeverity = (typeof DiagnosticSeverity)[keyof typeof DiagnosticSeverity];\n\n/**\n * Where an issue sits: the bit itself (its header, body or cardset), a card\n * variant, or a chain in either. Emitted beside `code` on every issue — in\n * the JSON envelope and in `Diagnostic.data`. Contractual, like `code`.\n *\n * Not the same thing as {@link EditorContext.scope}, which classifies a\n * cursor position for completion.\n */\nexport type IssueScope = \"bit\" | \"card\" | \"bit-chain\" | \"card-chain\";\n\n/**\n * One issue, as LSP defines a diagnostic. `code` is the stable contract\n * (the same codes as the JSON envelope's `parser.errors` / `warnings` /\n * `infos`); `message` is human prose and may change. `data.bit` is the\n * index of the bit the issue belongs to, the same index the JSON array\n * uses; `data.scope` is the issue's {@link IssueScope}.\n */\nexport interface Diagnostic {\n range: Range;\n severity: DiagnosticSeverity;\n code: string;\n source: \"bitmark\";\n message: string;\n data: { bit: number; scope: IssueScope };\n}\n\n/** What {@link diagnostics} returns. */\nexport interface Diagnostics {\n positionEncoding: PositionEncoding;\n diagnostics: Diagnostic[];\n}\n\n/** Options for {@link diagnostics}. */\nexport interface DiagnosticsOptions {\n /** Default: `\"utf-16\"`. */\n positionEncoding?: PositionEncoding;\n}\n\n// ── completion ──────────────────────────────────────────────────────\n\n/** LSP `MarkupContent` — this parser always writes Markdown. */\nexport interface MarkupContent {\n kind: \"markdown\";\n value: string;\n}\n\n/** LSP `CompletionItemKind` — the members this parser uses. */\nexport const CompletionItemKind = {\n Class: 7,\n Property: 10,\n Value: 12,\n Keyword: 14,\n Snippet: 15,\n EnumMember: 20,\n TypeParameter: 25,\n} as const;\nexport type CompletionItemKind = (typeof CompletionItemKind)[keyof typeof CompletionItemKind];\n\n/** LSP `CompletionItemTag`: `Deprecated` is the only member. */\nexport const CompletionItemTag = { Deprecated: 1 } as const;\nexport type CompletionItemTag = (typeof CompletionItemTag)[keyof typeof CompletionItemTag];\n\n/** What a completion item carries in LSP's `data` slot. */\nexport type CompletionItemData =\n | { kind: \"bit\"; name: string; id: number; deprecated?: string; migrateTo?: string }\n | { kind: \"tag\"; tag: CompactTagInfo }\n | { kind: \"value\"; tag: string; value: string }\n | { kind: \"attr\"; key: string; takesValue: boolean; values?: string[] }\n | null;\n\n/**\n * LSP `CompletionItem`, the fields this parser fills. `kind` is\n * `Class` for a bit type, `Property` for a tag or a valued inline attribute,\n * `Keyword` for a body format or an inline style key, `TypeParameter` for a\n * resource type, `EnumMember` / `Value` for an enum / boolean value,\n * `Snippet` for a structural line (`====`, `--`, `++`, `==== footer ====`).\n * Deprecated bits and tags carry `tags: [1]`. `sortText` puts required tags\n * the scope still lacks first (the first is `preselect`ed), then config\n * order. The parser returns EVERY candidate for the context; filtering by\n * the typed prefix is the editor's job.\n */\nexport interface CompletionItem {\n label: string;\n kind: CompletionItemKind;\n detail?: string;\n /** Absent from `complete`'s items; `resolve` fills it in (PLAN-202). */\n documentation?: MarkupContent;\n tags?: CompletionItemTag[];\n preselect?: boolean;\n sortText: string;\n insertText: string;\n /** `2` when `insertText` is an LSP snippet (the inline mark, `==${1:text}==|${2:bold}|`). */\n insertTextFormat?: 1 | 2;\n data: CompletionItemData;\n}\n\n/** Where a query resolved — an extension field of the LSP shapes. */\nexport interface EditorContext {\n bit?: string;\n scope: \"header\" | \"bit\" | \"card\" | \"chain\" | \"value\" | \"attr\" | \"footer\" | \"none\";\n chainParent?: string;\n /** 0-based card, side and variant. */\n card?: { card: number; side: number; variant: number };\n}\n\n/** LSP `CompletionList` plus the extension field `context`. */\nexport interface CompletionList {\n isIncomplete: false;\n items: CompletionItem[];\n context: EditorContext;\n}\n\n/** Options for {@link complete}. */\nexport interface CompleteOptions {\n /** Default: `\"utf-16\"`. */\n positionEncoding?: PositionEncoding;\n /** Offer deprecated bits too (deprecated tags are always offered, flagged). */\n includeDeprecated?: boolean;\n /**\n * The character the editor sent as the trigger (LSP\n * `CompletionContext.triggerCharacter`); omit when invoked explicitly.\n * A trigger that opens nothing where the cursor is answers an empty list\n * (PLAN-203).\n */\n triggerCharacter?: string;\n}\n\n/** Options for {@link resolve} — the same as the `complete` call's. */\nexport type ResolveOptions = CompleteOptions;\n\n// ── hover ───────────────────────────────────────────────────────────\n\n/** The record behind a hover — the extension field `data`. */\nexport type HoverData =\n | {\n kind: \"bit\";\n bit: string;\n bitInfo: { name: string; id: number; title?: string; description?: string; deprecated?: string; migrateTo?: string };\n }\n | {\n kind: \"tag\";\n bit?: string;\n scope: EditorContext[\"scope\"];\n chainParent?: string;\n card?: { card: number; side: number; variant: number };\n /** The `info` full record of the tag in this scope. */\n tag: FullTagInfo;\n }\n | { kind: \"value\"; tag: string; value: string }\n | { kind: \"resourceType\"; resourceType: string; tags: string[] }\n | { kind: \"attrKey\"; attr: { key: string; takesValue: boolean; values?: string[] } }\n | { kind: \"attrValue\"; attr: { key: string; value: string } };\n\n/** LSP `Hover` plus the extension field `data`. */\nexport interface Hover {\n range: Range;\n contents: MarkupContent;\n data: HoverData;\n}\n\n/** Options for {@link hover}. */\nexport interface HoverOptions {\n /** Default: `\"utf-16\"`. */\n positionEncoding?: PositionEncoding;\n}\n","// @zen-component: WASM-TSBindings\n\nimport type { PatchDocument } from \"./diff-types.js\";\nimport type { AnyBit } from \"./generated/bit-types.js\";\nimport type { PositionEncoding, TokensLayout } from \"./semantic-tokens-types.js\";\n\n/**\n * Output mode for JSON serialization.\n *\n * - `\"optimized\"` — omit keys whose values match their natural defaults.\n * - `\"full\"` — include all keys enumerated from the bitmark configuration.\n */\nexport type OutputMode = \"optimized\" | \"full\";\n\n/** Options for the typed conversion pair ({@link bitmarkToObjects} /\n * {@link objectsToBitmark}). */\nexport interface ParseOptions {\n /** JSON output mode (default: `\"optimized\"`). */\n mode?: OutputMode;\n /**\n * Include unknown properties in the bit JSON (default: `false`). Applies\n * to {@link bitmarkToObjects} only (parsing); ignored by\n * {@link objectsToBitmark} — unknown properties are never converted back\n * to bitmark. See {@link ConvertOptions.includeUnknownProperties}.\n */\n includeUnknownProperties?: boolean;\n}\n\n/**\n * Input format selector (adds auto-detection).\n *\n * `\"auto\"` sniffs bitmark-vs-JSON from the content; `\"bitmark\"` / `\"json\"` are\n * explicit; any config mapping id (e.g. `\"html\"`, `\"xml\"`) selects a markup\n * input that is reversed to the AST. The `(string & {})` arm admits those\n * config-driven mapping ids while keeping literal autocompletion.\n */\nexport type InputFormat = \"auto\" | \"bitmark\" | \"json\" | (string & {});\n\n/**\n * Concrete output format. `\"text\"` is lossy plain-text extraction,\n * `\"semantic-tokens\"` is parser-derived highlighting in the LSP shape (see\n * {@link semanticTokens}), `\"diagnostics\"` is every issue the JSON envelope\n * would carry as LSP diagnostics with encoded positions (see\n * {@link diagnostics}), `\"lex\"` is the lexer's token stream as a JSON\n * array (`[{ kind, span, text }]`, byte spans; debug tooling) and `\"ast\"` is\n * the parser's tree as JSON (debug tooling too, PLAN-209: it shows the runs,\n * dividers and spans a bitmark patch path addresses; the shape follows\n * the parser and is not a contract) — all five are output-only (they cannot\n * be used as an input format), and the last four take bitmark input only. Any config mapping id (`\"html\"`, `\"xml\"`, …) is\n * accepted too.\n */\nexport type OutputFormat =\n | \"bitmark\"\n | \"json\"\n | \"text\"\n | \"lex\"\n | \"ast\"\n | \"semantic-tokens\"\n | \"diagnostics\"\n | (string & {});\n\n/** One lexer token of the `\"lex\"` output format. */\nexport interface LexToken {\n /** The token kind — the engine's own name for it (`\"BitStart(1, false)\"`,\n * `\"Text(Body, false)\"`, `\"Bold\"`, …). Not a stable vocabulary. */\n kind: string;\n /** Byte offsets into the source (UTF-8). */\n span: { start: number; end: number };\n /** The source slice. */\n text: string;\n}\n\n/** Options for the {@link convert} function. */\nexport interface ConvertOptions {\n /** Input format (default: `\"auto\"`). */\n inputFormat?: InputFormat;\n /** Output format (default: `\"auto\"` — the opposite of the input). */\n outputFormat?: OutputFormat | \"auto\";\n /** JSON output mode (default: `\"optimized\"`). */\n mode?: OutputMode;\n /** Include validation warnings in `parser.warnings` output (default: `false`). */\n warnings?: boolean;\n /** Output text as plain text — debug mode (default: `false`). */\n plainText?: boolean;\n /**\n * Prettify the JSON being emitted (default: `false`). For JSON output this\n * is the whole document; for bitmark output it is the embedded JSON bodies\n * of `json`-format bits (cosmetic — they re-parse to the same value).\n */\n pretty?: boolean;\n /** Indent size for pretty-printing (default: `2`). */\n indent?: number;\n /** Spaces around tag values in bitmark output, `0..=10` (default: `1`). */\n spacesAroundValues?: number;\n /**\n * Bitmark → JSON only: include unknown properties in the bit JSON\n * (default: `false`). An unknown property (`[@key:value]` the bit's\n * config cannot resolve, at the bit body/footer — never inside cards or\n * consumed by a chain) is appended after all real keys as an array of\n * strings (`[@u]` with no value → `true`); a key colliding with a\n * configured key is `_`-prefixed. Unknown properties are never converted\n * back to bitmark, and each occurrence still warns.\n */\n includeUnknownProperties?: boolean;\n /**\n * Replace the converted output with a human-readable MAPPING REPORT of\n * what each input construct mapped to — including inputs that are NOT\n * mapped (default: `false`). Composite conversions (e.g. xml → json)\n * report every leg, one section after the other.\n */\n mappingReport?: boolean;\n /**\n * `\"semantic-tokens\"` and `\"diagnostics\"` output only: how columns and\n * lengths are counted — `\"utf-16\"` code units (default; the LSP default,\n * what browser editors index by) or `\"utf-8\"` bytes. Echoed in the output;\n * ignored by every other output format.\n */\n positionEncoding?: PositionEncoding;\n /**\n * `\"semantic-tokens\"` output only: `\"lsp\"` (default) writes the relative\n * `data` array, `\"absolute\"` one `{ line, start, length, type, modifiers }`\n * object per token. Ignored by every other output format.\n */\n tokensLayout?: TokensLayout;\n}\n\n/** Options for the {@link canonicalize} function (the single same-format\n * re-emit surface; `mode` covers what the removed optimize/fullize did). */\nexport interface CanonicalizeOptions {\n /**\n * Input format (default: `\"auto\"`). The output is re-emitted in this same\n * format — e.g. `\"html\"` in, html out. `\"auto\"` sniffs bitmark vs JSON.\n */\n inputFormat?: InputFormat;\n /** Output mode (default: `\"optimized\"`; `\"full\"` emits all keys). */\n mode?: OutputMode;\n /**\n * Prettify the JSON being emitted (default: `false`) — the whole document\n * for JSON input, the embedded JSON bodies of `json`-format bits for\n * bitmark input.\n */\n pretty?: boolean;\n /** Indent size for pretty-printing (default: `2`). */\n indent?: number;\n /** Spaces around tag values in bitmark output, `0..=10` (default: `1`). */\n spacesAroundValues?: number;\n}\n\n/** A patch operation. */\nexport type PatchOp = \"set\" | \"create\" | \"delete\" | \"append\";\n\n/**\n * A patch entry. Either the verbose form `{ path, op, value? }` or the\n * shorthand single-key object `{ \"<path>\": value }` (which means `set`).\n *\n * `path` is in one of two languages, told apart by its first character:\n *\n * - a **JSON path** addresses the bit JSON directly (`id`,\n * `cards[2].question.instruction`, `id[-1]`) and `value` is a JSON value;\n * - a **bitmark path** (PLAN-209) addresses the bit as an author writes it —\n * it starts with `$` or with `[` followed by a non-digit: `[@id]`, `[!]`,\n * `[&image][@width]`, `$card[1][0][!]`, `$card[2]$body`, `$raw`, `$footer`\n * — and `value` is bitmark source (a string, breakscaped as an author would\n * write it; `null` for a valueless tag). Bitmark paths need bitmark input.\n *\n * Every entry of one `transform` call must be in the same language.\n */\nexport type PatchEntry =\n { path: string; op: PatchOp; value?: unknown } | Record<string, unknown>;\n\n/**\n * One skipped patch entry, as carried by {@link PatchError} (PLAN-209 T9):\n * the entry's `path`, the error contract's `kind` (`patch-parse-error`,\n * `patch-index-out-of-range`, `patch-type-mismatch`, `patch-conflict`) and\n * a human-readable `message`.\n */\nexport interface PatchDiagnostic {\n path: string;\n kind: string;\n message: string;\n}\n\n/** Whether a literal patch path is a bitmark path (PLAN-209 D2). */\nexport type IsBitmarkPath<P extends string> = P extends `$${string}`\n ? true\n : P extends `[${infer C}${string}`\n ? C extends `${number}`\n ? false\n : true\n : false;\n\n// ── typed patch values (PLAN-128 §3.7) ──────────────────────────────────\n// The value type is resolved from the caller's literal path against `AnyBit`,\n// segment by segment — no enumeration of the path space, so compile cost is\n// per-call-site and bounded by the literal's length. Unresolvable segments and\n// dynamic (non-literal) paths degrade to `unknown`.\n\n/** @internal Peel `[n]` indexes off the front of `S`, unwrapping one array level each. */\ntype ApplyIndexes<T, S extends string> = S extends `[${string}]${infer Rest}`\n ? ApplyIndexes<T extends readonly (infer E)[] ? E : unknown, Rest>\n : T;\n\n/** @internal Resolve one dot-separated segment (`key`, `key[n]…`, or bare index). */\ntype Seg<T, S extends string> = S extends `${infer K}[${infer Rest}`\n ? ApplyIndexes<\n K extends \"\" ? T : K extends keyof T ? T[K] : unknown,\n `[${Rest}`\n >\n : S extends keyof T\n ? T[S]\n : S extends `${number}` | `-${number}`\n ? T extends readonly (infer E)[]\n ? E\n : unknown\n : unknown;\n\n/**\n * The type at patch path `P` within `T` (paths as in {@link PatchEntry}:\n * dot-separated keys with `[n]` indexes, negative-from-end allowed).\n */\nexport type PathValue<T, P extends string> = string extends P\n ? unknown\n : P extends `${infer S}.${infer Rest}`\n ? PathValue<NonNullable<Seg<T, S>>, Rest>\n : Seg<T, P>;\n\n/**\n * Build a {@link PatchEntry} with the `value` typed from the literal `path`,\n * resolved against {@link AnyBit}. A bitmark path (`$…` or `[…]`, PLAN-209)\n * takes bitmark source: its value is a `string` (or `null` for a valueless\n * tag).\n *\n * For `append`, the value is typed as an *element* of the array at the path.\n *\n * @example\n * patchEntry(\"instruction\", \"set\", [{ type: \"paragraph\", content: [] }]);\n * patchEntry(\"id\", \"append\", \"1234\");\n * patchEntry(\"cards[0].question\", \"delete\");\n * patchEntry(\"$card[1][-]\", \"append\", \"green\");\n */\nexport type PatchValueFor<\n P extends string,\n O extends PatchOp,\n> = IsBitmarkPath<P> extends true\n ? string | null\n : O extends \"append\"\n ? NonNullable<PathValue<AnyBit, P>> extends readonly (infer E)[]\n ? E\n : PathValue<AnyBit, P>\n : PathValue<AnyBit, P>;\n\nexport function patchEntry<const P extends string, const O extends PatchOp>(\n path: P,\n op: O,\n value?: PatchValueFor<P, O>,\n): PatchEntry {\n return value === undefined ? { path, op } : { path, op, value };\n}\n\n// The semantic-tokens types (PLAN-193) live in `semantic-tokens-types.ts`.\nexport type {\n PositionEncoding,\n TokensLayout,\n SemanticTokenType,\n SemanticTokenModifier,\n SemanticTokensLegend,\n SemanticToken,\n SemanticTokensLsp,\n SemanticTokensAbsolute,\n SemanticTokens,\n SemanticTokensOptions,\n} from \"./semantic-tokens-types.js\";\n\n// The editor-service types (PLAN-196) live in `editor-types.ts`.\nexport type {\n Position,\n Range,\n Diagnostic,\n Diagnostics,\n DiagnosticsOptions,\n IssueScope,\n MarkupContent,\n CompletionItemData,\n CompletionItem,\n EditorContext,\n CompletionList,\n CompleteOptions,\n ResolveOptions,\n HoverData,\n Hover,\n HoverOptions,\n} from \"./editor-types.js\";\nexport { CompletionItemKind, CompletionItemTag, DiagnosticSeverity } from \"./editor-types.js\";\n\n// The patch document and diff types (PLAN-179) live in `diff-types.ts`.\nexport type {\n BitSelector,\n PatchDocumentEntry,\n PatchDocument,\n DiffOutputFormat,\n DiffOptions,\n BitDiffRef,\n DiffHunkLine,\n DiffHunk,\n BitDiff,\n} from \"./diff-types.js\";\n\n/** One bit's source slice within a bitmark document (from {@link splitBits}). */\nexport interface BitSlice {\n index: number;\n byteStart: number;\n byteEnd: number;\n source: string;\n}\n\n/**\n * What a {@link PreHook} / {@link PostHook} sees for one bit, in its source\n * format. `index` is the bit's 0-based position; `total` is the bit count.\n */\nexport type BitView =\n | { format: \"bitmark\"; index: number; total: number; source: string }\n | { format: \"json\"; index: number; total: number; bit: AnyBit };\n\n/**\n * What a {@link PreHook} may return for a bit. All fields are optional; an\n * empty result (or `void`) makes the hook a pure observer.\n */\nexport interface PreHookResult {\n /** Patches to apply to this bit, after the patch document's entries for it. */\n patches?: PatchEntry[];\n /** Override the output format for this bit only. */\n outputFormat?: OutputFormat;\n /** Drop the bit from the output entirely. */\n drop?: boolean;\n}\n\n/** Pre-processing hook: inspect a bit, optionally return modifications. */\nexport type PreHook = (view: BitView) => PreHookResult | void;\n\n/** Post-processing hook: observe a bit's input view and rendered output. */\nexport type PostHook = (view: BitView, output: string) => void;\n\n/** Options for the {@link transform} function. */\nexport interface TransformOptions {\n /** Input format (default: `\"auto\"`). */\n inputFormat?: InputFormat;\n /** Output format (default: `\"json\"`). */\n outputFormat?: OutputFormat;\n /** Output mode (default: `\"optimized\"`). */\n mode?: OutputMode;\n /**\n * A patch document (PLAN-179) — per-bit patches by selector, removes,\n * inserts and moves — or the every-bit shorthand: a bare array of entries\n * applied to every bit. Either form may be given as a JSON string.\n */\n patch?: PatchEntry[] | PatchDocument | string;\n /**\n * Per-bit pre-hook, run on the calling thread. Returns patches (applied\n * after the static `patch`), an output-format override, or `drop`. Providing\n * a `preHook` or `postHook` switches `transform` to the per-bit path; with\n * neither, the whole document is transformed in a single pass.\n */\n preHook?: PreHook;\n /** Per-bit post-hook, run on the calling thread after each bit is rendered. */\n postHook?: PostHook;\n /**\n * Worker-thread count for {@link transformParallel} (Node only; default `4`).\n * Ignored by the synchronous {@link transform}.\n */\n workers?: number;\n /** Prettify the emitted JSON (default: `false`) — for bitmark output, the\n * embedded JSON bodies of `json`-format bits. */\n pretty?: boolean;\n /** Indent size for pretty-printing (default: `2`). */\n indent?: number;\n /** Spaces around tag values in bitmark output, `0..=10` (default: `1`). */\n spacesAroundValues?: number;\n}\n\n/** Text format for breakscape / unbreakscape operations. */\nexport type TextFormat = \"bitmark++\" | \"plainText\";\n\n/**\n * Text location for breakscape / unbreakscape operations.\n *\n * `\"cardBody\"` is a card side or variant body. It has every `\"body\"` rule plus\n * the card dividers `--` and `++`, which are markup only inside a card set and\n * only at the start of a line.\n */\nexport type TextLocation = \"body\" | \"cardBody\" | \"tag\";\n\n/**\n * Where within the {@link TextLocation} the text sits.\n *\n * `\"attrValue\"` is the value half of an inline-attr chain segment\n * (`==t==|link:VALUE|`). It REFINES the location rather than replacing it: it\n * adds the chain delimiter `|` to the escaped set and drops the running-text\n * rules, while `location` keeps deciding the tag rules.\n */\nexport type TextSubLocation = \"text\" | \"attrValue\";\n\n/** Options for the {@link breakscapeText} and {@link unbreakscapeText} functions. */\nexport interface BreakscapeOptions {\n /** Text format (default: `\"bitmark++\"`). */\n format?: TextFormat;\n /** Text location (default: `\"body\"`). */\n location?: TextLocation;\n /**\n * Sub-location within `location` (default: `\"text\"`).\n *\n * Ignored by {@link unbreakscapeText} — for `bitmark++` one inverse undoes\n * every breakscape mode.\n */\n subLocation?: TextSubLocation;\n}\n\n/** Info query type for the {@link info} function. */\nexport type InfoType =\n | \"list\"\n | \"bit\"\n | \"all\"\n | \"deprecated\"\n | \"bit-groups\"\n | \"resource-groups\"\n | \"languages\"\n | \"error-codes\";\n\n/** Output format for the {@link info} function. */\nexport type InfoFormat = \"text\" | \"json\";\n\n/**\n * The language token selecting every language this build can resolve —\n * `info({ language: ALL_LANGUAGES })`. The same spelling the parser and the\n * CLI (`--language all`) use; exported so a consumer names it instead of\n * retyping the literal.\n */\nexport const ALL_LANGUAGES = \"all\";\n\n/** Options for the {@link info} function. */\nexport interface InfoOptions {\n /** Info query type (default: `\"list\"`). */\n infoType?: InfoType;\n /** Output format (default: `\"text\"`). */\n format?: InfoFormat;\n /** Bit name — required when `infoType` is `\"bit\"`. */\n bit?: string;\n /** Whether to pretty-print JSON output (default: `false`). */\n pretty?: boolean;\n /** Indent size for pretty-printing (default: `2`). */\n indent?: number;\n /** Include deprecated bits in `list`/`all` output (default: `false`). */\n includeDeprecated?: boolean;\n /** Restrict `list`/`all` output to deprecated bits only (default: `false`;\n * wins over `includeDeprecated`). */\n onlyDeprecated?: boolean;\n /** Full detail for `\"bit\"`/`\"all\"`: provenance, keys, card structure\n * (default `false` = compact one-line-per-tag view). */\n full?: boolean;\n /**\n * BCP-47 language tag(s) for DISPLAY NAMES — `title` on bits, bit groups\n * and resource groups. Default (or `\"\"`) is English.\n *\n * Accepts one tag (`\"de\"`), several (`[\"de\", \"fr\"]` or `\"de,fr\"`), or\n * {@link ALL_LANGUAGES} for every language this build can resolve — see\n * `info({ infoType: \"languages\" })`.\n *\n * **More than one language adds a `titles` map** to each result, so a\n * consumer building a multilingual index makes ONE call instead of one per\n * language. A single tag renders exactly as it always did, with no `titles`.\n *\n * Resolution narrows one subtag at a time (`de-CH` → `de`), then falls back\n * to the English title, then to the technical key. A partially translated\n * language is therefore safe: untranslated entries stay English rather than\n * emptying out. Technical identity — `name`, `key` — is never translated.\n *\n * Which translations are available depends on the variant and on\n * {@link register}: the `full` wasm bakes a table in, the lean variants\n * start empty and expect you to register one.\n */\n language?: string | readonly string[];\n}\n\n/** Options for {@link register}. Discriminated on `type`. */\nexport interface RegisterOptions {\n /** What kind of data `data` is. */\n type: \"translations\";\n /**\n * The file's own text — for `\"translations\"`, the JSON published at\n * `@gmb/bitmark-parser/translations`:\n * `{ \"<key>\": { \"<bcp47 tag>\": \"<display name>\" } }`, English excluded.\n */\n data: string;\n}\n\n/*\n * ── info JSON result types ────────────────────────────────────────────\n *\n * {@link info} returns a STRING — it renders a document, and `format:\n * \"text\"` / `pretty` / `indent` only mean anything for one. When you ask for\n * `format: \"json\"`, parse it and assert the matching type below:\n *\n * ```ts\n * const groups = JSON.parse(\n * info({ infoType: \"deprecated\", format: \"json\" }),\n * ) as DeprecatedInfo;\n * ```\n *\n * These shapes are a STABLE CONTRACT: a change to any of them is a\n * semver-major release. The normative definition is\n * `.zen/specs/API-INF-info-output.tsp`, enforced by the parser's\n * `info_contract_test`. TEXT output is explicitly NOT contractual — it is\n * human-readable and may change in any release, so never parse it.\n *\n * Fields marked \"info-meta only\" are absent from the wasm build (they carry\n * descriptions and provenance, kept out of the binary for size). Absence is\n * structural: the key is missing, never `null` or empty.\n *\n * Two invariants hold throughout, both enforced by the parser's test suite:\n *\n * 1. `null` is NEVER used for absence — a key whose fact does not apply is\n * missing. `null` appears only where it means something, and those fields\n * say so: `max: null` (unbounded), `default: null` (OMIT).\n * 2. {@link FullBitInfo} is a strict SUPERSET of {@link CompactBitInfo} —\n * same spelling, same values, full just adds. One parser reads either.\n */\n\n/** A tag's value format. Closed vocabulary. */\nexport type TagFormat =\n \"string\" | \"number\" | \"boolean\" | \"bitmark++\" | \"numberList4\" | \"enum\";\n\n/** A body region's resolved format. Closed vocabulary. */\nexport type BodyFormat = \"bitmark\" | \"text\" | \"json\" | \"latex\" | \"xml\";\n\n/**\n * A bit's resource-attachment rule: a mode keyword, or the explicit list of\n * permitted resource type names.\n */\nexport type ResourceAttachment = \"all\" | \"none\" | string[];\n\n/** A tag in compact (`full: false`) output. */\nexport interface CompactTagInfo {\n /** Tag name including its sigil, e.g. `@id`, `&image`, `#title`. */\n name: string;\n format: TagFormat;\n /** Enum vocabulary — only on `enum`-format tags. */\n values?: string[];\n /** Effective minimum occurrences. */\n min: number;\n /** Effective maximum occurrences; `null` means unbounded. */\n max: number | null;\n /**\n * Default value, wire-encoded. `null` means OMIT: the tag has no default\n * and absence is its canonical state — not \"unknown\".\n */\n default: string | null;\n /** Only present when the tag is always emitted (then always `true`). */\n alwaysEmit?: true;\n /** Chained tags; only present when non-empty. */\n chain?: CompactTagInfo[];\n}\n\n/** A tag in full (`full: true`) output. */\nexport interface FullTagInfo {\n name: string;\n /** info-meta only. */\n description?: string;\n /** Deprecation version — only on a deprecated tag. */\n deprecated?: string;\n format: TagFormat;\n /** Enum vocabulary — only on `enum`-format tags. */\n values?: string[];\n min: number;\n /** `null` means unbounded. */\n max: number | null;\n /** Pre-override minimum — present with `baseMax` when this context overrides. */\n baseMin?: number;\n /** Pre-override maximum; `null` means unbounded. */\n baseMax?: number | null;\n /** Wire-encoded default; `null` means OMIT. */\n default: string | null;\n /**\n * The format's natural default, wire-encoded. ABSENT for an omit tag\n * (`default: null`), which has no natural default.\n */\n naturalDefault?: string;\n alwaysEmit?: true;\n /** Output key per mapping type; `json` is always present. */\n mappingKeys: Record<string, string>;\n /** Only present when this context overrides the tag's key (then `true`). */\n keyOverridden?: true;\n /**\n * Group-inheritance path, outermost first. On info-meta builds this is\n * always present and `[]` is meaningful — the tag is declared DIRECTLY on\n * its owner. Absent means \"not reported\", never \"declared directly\".\n *\n * info-meta only.\n */\n via?: string[];\n chain?: FullTagInfo[];\n}\n\n/** Card-set structures in compact output. */\nexport interface CompactVariantInfo {\n /** 0-based position within the side. */\n position: number;\n tags: CompactTagInfo[];\n}\nexport interface CompactSideInfo {\n name: string;\n variants: CompactVariantInfo[];\n}\nexport interface CompactCardInfo {\n name: string;\n sides: CompactSideInfo[];\n}\nexport interface CompactCardSetInfo {\n key: string;\n cards: CompactCardInfo[];\n}\n\n/** Card-set structures in full output. */\nexport interface FullVariantInfo {\n position: number;\n bodyFormat: BodyFormat;\n bodyRequired: boolean;\n bodyForbidden: boolean;\n repeat: boolean;\n tags: FullTagInfo[];\n}\nexport interface FullSideInfo {\n name: string;\n repeat: boolean;\n variants: FullVariantInfo[];\n}\nexport interface FullCardInfo {\n name: string;\n isDefault: boolean;\n min: number;\n /** `null` means unbounded. */\n max: number | null;\n sides: FullSideInfo[];\n}\nexport interface FullCardSetInfo {\n key: string;\n cards: FullCardInfo[];\n}\n\n/** A bit's body rules (full output). */\nexport interface BodyRulesInfo {\n format: BodyFormat;\n required: boolean;\n forbidden: boolean;\n hasFooter: boolean;\n}\n\n/**\n * One bit in compact output.\n *\n * {@link FullBitInfo} is a strict superset: every key here appears there,\n * spelled identically and with an equal value.\n */\nexport interface CompactBitInfo {\n /** Bit type name, e.g. `cloze`. */\n name: string;\n /** Internal config id — stable only within one config version. */\n id: number;\n /** English display name; only present when authored. */\n title?: string;\n /**\n * Display names by BCP-47 tag, present ONLY when {@link InfoOptions.language}\n * named more than one (or `\"all\"`).\n *\n * Always carries `en` — the English title, which every build has. Otherwise\n * SPARSE: a requested language with no translation is absent rather than\n * filled with English, so a hole is visible instead of silently\n * indistinguishable. Keyed by the tag you ASKED for, not the one that\n * satisfied it: request `de-CH` with only `de` available and you read\n * `titles[\"de-CH\"]`.\n */\n titles?: Record<string, string>;\n /**\n * Description. info-meta only: present on the `full` wasm variant and every\n * native binary, absent on `browser-full` and `bitmark-json`.\n */\n description?: string;\n /** Bit-group keys this bit belongs to, sorted. Omitted when it has none. */\n bitGroups?: string[];\n /** Only present when the bit is deprecated. */\n deprecated?: string;\n /**\n * Only present when a migration target exists. Such a bit is re-emitted\n * under its target's name in every parser output, so this name identifies\n * legacy input and already-indexed content — never new parser output.\n */\n migrateTo?: string;\n tags: CompactTagInfo[];\n /** Required resource name — only present when one is required. Name only:\n * its chain is already in `tags`. */\n requiredResource?: string;\n /** Only present when the bit has a card set. */\n cardSet?: CompactCardSetInfo;\n}\n\n/** One bit in full output. */\nexport interface FullBitInfo {\n name: string;\n id: number;\n /** As {@link CompactBitInfo.title}. */\n title?: string;\n /** As {@link CompactBitInfo.titles}. */\n titles?: Record<string, string>;\n /** As {@link CompactBitInfo.description} — info-meta only. */\n description?: string;\n /** As {@link CompactBitInfo.bitGroups}. */\n bitGroups?: string[];\n /** Only present when the bit is deprecated. */\n deprecated?: string;\n /** Only present when a migration target exists. */\n migrateTo?: string;\n body: BodyRulesInfo;\n /** This bit's resource-attachment rule. */\n resourceAttachment: ResourceAttachment;\n /** Required resource name — only present when one is required. */\n requiredResource?: string;\n /** Bit-level mapping keys, where the config authors them. info-meta only. */\n mappingKeys?: Record<string, string>;\n tags: FullTagInfo[];\n /** Only present when the bit has a card set. */\n cardSet?: FullCardSetInfo;\n}\n\n/**\n * One member of a bit group. An object rather than a bare string so a\n * deprecated member can carry its facts.\n */\nexport interface BitGroupMemberInfo {\n name: string;\n /**\n * The member's display name, in the requested language — the same terms as\n * {@link BitGroupInfo.title}.\n *\n * This is what makes `bit-groups` a complete answer to \"every bit type,\n * what it is called, and which categories it is in\" in ONE call: without\n * it the only route carrying display names was `infoType: \"all\"`, which is\n * ~50× the payload.\n */\n title?: string;\n /** As {@link CompactBitInfo.titles}. */\n titles?: Record<string, string>;\n /** Only present for a deprecated member. */\n deprecated?: string;\n /**\n * Only present when a migration target exists. Such a bit is re-emitted\n * under its target's name, so this member matches already-indexed legacy\n * content, not new parser output.\n */\n migrateTo?: string;\n}\n\n/** One bit group: a search/filter category over bit types. */\nexport interface BitGroupInfo {\n /** Group key, e.g. `cloze`. Lookups also accept an alias. */\n key: string;\n title: string;\n /** As {@link CompactBitInfo.titles}. */\n titles?: Record<string, string>;\n description: string;\n /** Omitted when there are none. */\n aliases?: string[];\n /**\n * Informational parent group — NEVER implies membership. Intersecting a\n * bit's `bitGroups` with the groups carrying `subgroupOf: \"quizzes\"` is\n * how a consumer derives quiz categories.\n */\n subgroupOf?: string;\n /** Present, and always `true`, for a deliberately memberless group. */\n allowEmpty?: true;\n /**\n * Member bit types, name-sorted. Filtered by `includeDeprecated` /\n * `onlyDeprecated`, so the DEFAULT EXCLUDES deprecated members — a search\n * consumer matching already-indexed content passes `includeDeprecated`.\n */\n bitTypes: BitGroupMemberInfo[];\n}\n\n/** One resource group: a search/filter category over resource types. */\nexport interface ResourceGroupInfo {\n key: string;\n title: string;\n /** As {@link CompactBitInfo.titles}. */\n titles?: Record<string, string>;\n description: string;\n aliases?: string[];\n /**\n * Member resource types (canonical kebab-case), sorted. Consumers\n * normalize legacy camelCase (`imageLink` → `image-link`) before matching.\n */\n resourceTypes: string[];\n}\n\n/**\n * `infoType: \"bit-groups\"` — the bit-group catalog, key-sorted. Available\n * in every build, including the lean wasm variants.\n */\nexport type BitGroupsInfo = BitGroupInfo[];\n\n/** `infoType: \"resource-groups\"` — the resource-group catalog, key-sorted. */\nexport type ResourceGroupsInfo = ResourceGroupInfo[];\n\n/** `infoType: \"list\"` — bit type names in registry order. */\nexport type BitListInfo = string[];\n\n/**\n * `infoType: \"languages\"` — the BCP-47 tags this build can resolve, sorted.\n *\n * Always includes `\"en\"`. This is what `language: \"all\"` expands to, so a\n * consumer can enumerate the set rather than guess it; it grows when\n * {@link register} supplies a file carrying further languages.\n */\nexport type LanguagesInfo = string[];\n\n/**\n * A code's templates in one scope: the message templates the parser renders\n * for that (code, scope) pair — named slots (`{tag}`, `{bitType}`, …) as\n * written, with the scope's location fragment already in place. Never empty.\n */\nexport interface ErrorCodeScopeInfo {\n scope: \"bit\" | \"card\" | \"bit-chain\" | \"card-chain\";\n templates: string[];\n}\n\n/**\n * One entry of `infoType: \"error-codes\"`: an issue code, its severity, and\n * its templates per scope it can occur in (only declared scopes, in order\n * `bit`, `card`, `bit-chain`, `card-chain`). `code` and a scope are the pair\n * every envelope issue (and every diagnostic's `code` + `data.scope`)\n * carries, so a consumer looks a live issue up by them. The templates are\n * NOT contractual (they may be reworded); `code`, `severity` and `scope` are.\n */\nexport interface ErrorCodeInfo {\n code: string;\n severity: \"error\" | \"warning\" | \"info\";\n scopes: ErrorCodeScopeInfo[];\n}\n\n/**\n * `infoType: \"error-codes\"` — every issue code the parser can emit, one\n * entry each, in code order. Read from the validator's own message table, so\n * it can never drift from what the envelope emits. English only; `language`\n * does not apply. In every variant.\n */\nexport type ErrorCodesInfo = ErrorCodeInfo[];\n\n/** `infoType: \"bit\"` — one bit at the requested detail. */\nexport type BitInfo = CompactBitInfo | FullBitInfo;\n\n/** `infoType: \"all\"` — every bit at the requested detail, in registry order. */\nexport type AllBitsInfo = CompactBitInfo[] | FullBitInfo[];\n\n/** One entry of {@link DeprecatedInfo}. */\nexport interface DeprecatedEntryInfo {\n name: string;\n /** Always set — every entry is deprecated. */\n deprecated: string;\n /** Only present for a bit that migrates. */\n migrateTo?: string;\n}\n\n/** `infoType: \"deprecated\"` — every deprecated bit, in registry order. */\nexport type DeprecatedInfo = DeprecatedEntryInfo[];\n\n/**\n * Returned in place of a result when `infoType` is `\"bit\"` and the name is\n * unknown or missing. Distinguishable from every success shape: those are an\n * array, or an object with `name`.\n *\n * The `error` KEY is contractual; its message text is not.\n */\nexport interface InfoErrorResult {\n error: string;\n}\n","// @zen-component: TS-SharedApi\n//\n// The shared API wrappers (PLAN-166): platform entries re-export these. Every\n// call reads the ACTIVE wasm module through the variant facade at call time,\n// so an `init({ feature })` swap applies to the next call with no interface\n// change.\n\nimport type { AnyBit, Bit, BitEntry } from \"../generated/bit-types.js\";\nimport type {\n BitDiff,\n BitSlice,\n BreakscapeOptions,\n CanonicalizeOptions,\n ConvertOptions,\n DiffOptions,\n InfoOptions,\n RegisterOptions,\n ParseOptions,\n SemanticTokens,\n SemanticTokensOptions,\n Diagnostics,\n DiagnosticsOptions,\n CompletionList,\n CompletionItem,\n CompleteOptions,\n ResolveOptions,\n Hover,\n HoverOptions,\n Position,\n TransformOptions,\n} from \"../types.js\";\nimport {\n PatchError,\n getActive,\n rememberRegistration,\n RegisterError,\n UnsupportedFeatureError,\n variant,\n} from \"./facade.js\";\nimport { type HookedWasm, runHookedTransform, type TransformEnvelope } from \"./hooked-transform.js\";\n\n/**\n * Parse bitmark into typed bit entries.\n *\n * The typed (object) counterpart of\n * `convert(input, { inputFormat: \"bitmark\", outputFormat: \"json\" })`:\n * returns the entries as objects instead of a JSON string. **Bitmark input\n * only** — the format is pinned, no auto-detection.\n *\n * @example\n * const entries = bitmarkToObjects(\"[.article]\\nHello **world**\");\n * const bit = entries[0].bit;\n * if (bit.type === \"article\") console.log(bit.body);\n *\n * @throws If the core reports a conversion error.\n */\nexport function bitmarkToObjects(input: string, options: ParseOptions = {}): BitEntry[] {\n const out = getActive().convert(\n input,\n \"bitmark\",\n \"json\",\n options.mode ?? \"optimized\",\n false,\n 2,\n 1,\n options.includeUnknownProperties ?? false,\n false,\n \"\",\n \"\",\n );\n return JSON.parse(out) as BitEntry[];\n}\n\n/**\n * Compose bitmark text from typed bits or entries.\n *\n * The typed (object) counterpart of\n * `convert(json, { inputFormat: \"json\", outputFormat: \"bitmark\" })` — typed\n * objects are JSON by construction, so the format is pinned, no\n * auto-detection. Bare bits are auto-wrapped into entries; the config-driven\n * composer normalizes, defaults and validates on ingest — construct bits as\n * plain typed literals (no builder needed).\n *\n * @example\n * const bitmark = objectsToBitmark([{ type: \"article\", body: \"Hello\" }]);\n *\n * @throws If the core reports a compose error.\n */\nexport function objectsToBitmark(bits: readonly (Bit | AnyBit | BitEntry)[], options: ParseOptions = {}): string {\n const entries = bits.map((b) =>\n b !== null && typeof b === \"object\" && \"bit\" in b && typeof (b as BitEntry).bit === \"object\"\n ? b\n : { bit: b },\n );\n const out = getActive().convert(\n JSON.stringify(entries),\n \"json\",\n \"bitmark\",\n options.mode ?? \"optimized\",\n false,\n 2,\n 1,\n false,\n false,\n \"\",\n \"\",\n );\n return out;\n}\n\n/**\n * Convert between bitmark, JSON, and the mapped markup formats (html/xml/…) —\n * the single string-based conversion surface.\n *\n * The markup formats need a wasm variant built with `markup`; on\n * `bitmark-json` they throw an `unsupported` error.\n *\n * Performance: `inputFormat` defaults to `\"auto\"`, which detects the format\n * by scanning the input for a bitmark bit header — for non-bitmark input\n * that is a full pass over the whole input before parsing starts, and the\n * detection is heuristic (markup formats are never auto-detected). **If you\n * know the input format, set `inputFormat` explicitly.** For typed objects\n * use {@link bitmarkToObjects} / {@link objectsToBitmark}, which pin their\n * formats.\n *\n * @param input - Bitmark, JSON, or mapped-format input text.\n * @param options - Convert options (e.g. `{ inputFormat: \"bitmark\", mode: \"full\" }`).\n * @returns Converted output string. For bitmark input, this is a JSON string\n * array of structured parsed entries (`bit`, `parser`, `bitmark`).\n */\nexport function convert(input: string, options: ConvertOptions = {}): string {\n return getActive().convert(\n input,\n options.inputFormat ?? \"auto\",\n options.outputFormat ?? \"auto\",\n options.mode ?? \"optimized\",\n options.pretty ?? false,\n options.indent ?? 2,\n options.spacesAroundValues ?? 1,\n options.includeUnknownProperties ?? false,\n options.mappingReport ?? false,\n options.positionEncoding ?? \"\",\n options.tokensLayout ?? \"\",\n );\n}\n\n/**\n * Parser-derived highlighting of bitmark source in the LSP semantic-tokens\n * shape (PLAN-193) — the typed form of\n * `convert(input, { inputFormat: \"bitmark\", outputFormat: \"semantic-tokens\" })`.\n *\n * The parser runs (never the validator) and every byte of the source is\n * covered exactly once: unpaired marks are text, an abandoned tag is text\n * and the dividers it would have swallowed keep their meaning, a raw body\n * (`[.code]`, `==== text ====`) is one plain-text run per line. Token types\n * name sigil classes and syntax positions, never a bit or tag name; the tag\n * class, the commented-bit flag and `unclosed` are modifiers. Both layouts\n * carry the legend, so the response is self-describing.\n *\n * @param input - Bitmark source text.\n * @param options - `positionEncoding` (`\"utf-16\"`, the default, or `\"utf-8\"`)\n * and `tokensLayout` (`\"lsp\"`, the default, or `\"absolute\"`).\n * @returns A {@link SemanticTokens} object, discriminated by `layout`.\n * @throws On a variant built without `semantic-tokens` (an `unsupported`\n * error).\n */\nexport function semanticTokens(input: string, options: SemanticTokensOptions = {}): SemanticTokens {\n return JSON.parse(\n convert(input, {\n inputFormat: \"bitmark\",\n outputFormat: \"semantic-tokens\",\n positionEncoding: options.positionEncoding,\n tokensLayout: options.tokensLayout,\n }),\n ) as SemanticTokens;\n}\n\n/**\n * Every issue the JSON `parser` envelope would carry for bitmark source, as\n * LSP `Diagnostic`s with encoded positions (PLAN-196) — the typed form of\n * `convert(input, { inputFormat: \"bitmark\", outputFormat: \"diagnostics\" })`.\n *\n * Parse and validate, no serialization: cheap enough to run on every\n * keystroke. Same codes, same spans and same order as the envelope's\n * `errors` / `warnings` / `infos`, whose buckets become LSP severities\n * 1 / 2 / 3. `code` is the contract; `message` is prose. `data.bit` is the\n * bit's index in the JSON array. Feed the list to `editor.setModelMarkers`\n * (Monaco) or `publishDiagnostics` (LSP) as is.\n *\n * @param input - Bitmark source text.\n * @param options - `positionEncoding` (`\"utf-16\"`, the default, or `\"utf-8\"`).\n * @returns A {@link Diagnostics} object.\n * @throws On a variant built without `editor` (an `unsupported` error).\n */\nexport function diagnostics(input: string, options: DiagnosticsOptions = {}): Diagnostics {\n return JSON.parse(\n convert(input, {\n inputFormat: \"bitmark\",\n outputFormat: \"diagnostics\",\n positionEncoding: options.positionEncoding,\n }),\n ) as Diagnostics;\n}\n\n/**\n * The constructs valid at `position` in bitmark source, as an LSP\n * `CompletionList` (PLAN-196): every bit type after `[.`, the body formats\n * and the bit's allowed resource types in the header, the tags valid in the\n * scope at the cursor (the bit body, a card variant, a chain — the same set\n * the validator enforces, minus tags already at their maximum, the required\n * ones the scope still lacks first), a tag's enum / boolean values, the\n * inline attribute keys and closed values, and the structural lines the\n * card config allows at a line start. Every candidate for the context is\n * returned; the editor filters by the typed prefix. Half-typed constructs\n * (`[@wi`, `[.art`, `==x==|bo`) resolve as if closed.\n *\n * @param input - Bitmark source text.\n * @param position - 0-based `line` / `character` in `positionEncoding` units.\n * @param options - `positionEncoding` (`\"utf-16\"`, the default, or `\"utf-8\"`),\n * `includeDeprecated`, and `triggerCharacter` — the character the editor\n * sent as the trigger (LSP `CompletionContext.triggerCharacter`), omitted\n * when invoked explicitly. A trigger that opens nothing where the cursor\n * is — a `.` or a `-` typed in prose — answers an empty list; `[` opens a\n * tag anywhere, and `=` / `-` / `+` at a line start narrow the list to the\n * structural lines they begin.\n * @returns A {@link CompletionList}; `context` says where the query resolved.\n * @throws {@link UnsupportedFeatureError} on a variant built without `editor`;\n * an error when `position.line` is past the end of the text, or when the\n * input is a JSON document (there is no bitmark source to resolve a\n * position in).\n */\nexport function complete(input: string, position: Position, options: CompleteOptions = {}): CompletionList {\n const wasm = getActive();\n if (typeof wasm.complete !== \"function\") throw new UnsupportedFeatureError(\"complete\", variant());\n return JSON.parse(\n wasm.complete(\n input,\n position.line,\n position.character,\n options.positionEncoding ?? \"\",\n options.includeDeprecated ?? false,\n options.triggerCharacter ?? \"\",\n ),\n ) as CompletionList;\n}\n\n/**\n * One item of the list `complete` returns at `position`, with its Markdown\n * `documentation` filled in — LSP `completionItem/resolve` (PLAN-202).\n * `complete` ships no documentation; an editor calls this for the one item\n * it is about to show (Monaco's `resolveCompletionItem`), passing the item\n * back as it was listed. The item is found by `label` and `kind`; when the\n * list no longer holds it (the text or the cursor moved on) the item is\n * returned as it was given.\n *\n * @param input - The bitmark source `complete` was asked about.\n * @param position - The position `complete` was asked at.\n * @param item - The item as `complete` listed it (`label` and `kind` are read).\n * @param options - As for `complete`.\n * @returns The item with `documentation` set where the parser has any.\n * @throws {@link UnsupportedFeatureError} on a variant built without `editor`;\n * an error when `position.line` is past the end of the text, or when the\n * input is a JSON document.\n */\nexport function resolve(\n input: string,\n position: Position,\n item: CompletionItem,\n options: ResolveOptions = {},\n): CompletionItem {\n const wasm = getActive();\n if (typeof wasm.resolve !== \"function\") throw new UnsupportedFeatureError(\"resolve\", variant());\n const resolved = JSON.parse(\n wasm.resolve(\n input,\n position.line,\n position.character,\n options.positionEncoding ?? \"\",\n options.includeDeprecated ?? false,\n item.label,\n item.kind,\n ),\n ) as CompletionItem | null;\n return resolved ?? item;\n}\n\n/**\n * The construct at `position` in bitmark source, as an LSP `Hover`\n * (PLAN-196): the bit type, a tag in its scope (with the same record\n * `info({ infoType: \"bit\", full: true })` shows for it there), a tag value, a\n * header resource type, an inline attribute key or value. `contents` is\n * Markdown; `data` carries the record it was rendered from. `null` on body\n * text, dividers and whitespace.\n *\n * @param input - Bitmark source text.\n * @param position - 0-based `line` / `character` in `positionEncoding` units.\n * @param options - `positionEncoding` (`\"utf-16\"`, the default, or `\"utf-8\"`).\n * @returns A {@link Hover}, or `null`.\n * @throws {@link UnsupportedFeatureError} on a variant built without `editor`;\n * an error when `position.line` is past the end of the text, or when the\n * input is a JSON document (there is no bitmark source to resolve a\n * position in).\n */\nexport function hover(input: string, position: Position, options: HoverOptions = {}): Hover | null {\n const wasm = getActive();\n if (typeof wasm.hover !== \"function\") throw new UnsupportedFeatureError(\"hover\", variant());\n return JSON.parse(\n wasm.hover(input, position.line, position.character, options.positionEncoding ?? \"\"),\n ) as Hover | null;\n}\n\n/**\n * Re-emit input in its own format in canonical form — the single same-format\n * surface (the former `optimize`/`fullize`/`expand` were pure mode pins of\n * this function and were removed).\n *\n * @param input - Input text (bitmark, JSON, or a markup format such as html/xml).\n * @param options - `mode`: `\"optimized\"` (default — omit natural defaults) or\n * `\"full\"` (emit all keys). `inputFormat` selects the format (default:\n * `\"auto\"`; prefer explicit — see {@link convert}); the output is\n * re-emitted in that same format.\n */\nexport function canonicalize(input: string, options: CanonicalizeOptions = {}): string {\n return getActive().canonicalize(\n input,\n options.inputFormat ?? \"auto\",\n options.mode ?? \"optimized\",\n options.pretty ?? false,\n options.indent ?? 2,\n options.spacesAroundValues ?? 1,\n );\n}\n\n/**\n * Count the bits in `input`, auto-detecting bitmark vs JSON (heuristic —\n * a full input scan when the input is not bitmark; see {@link convert}).\n *\n * @throws If the input cannot be parsed.\n */\nexport function countBits(input: string): number {\n return Number.parseInt(getActive().count_bits(input), 10);\n}\n\n/**\n * Split a bitmark document into per-bit source slices.\n *\n * @returns Array of `{ index, byteStart, byteEnd, source }`.\n */\nexport function splitBits(input: string): BitSlice[] {\n return JSON.parse(getActive().split_bits(input)) as BitSlice[];\n}\n\n/**\n * Transform a document bit-by-bit: apply an optional {@link PatchDocument}\n * and/or per-bit `preHook`/`postHook`, then re-emit.\n *\n * The patch document selects bits by pre-application index and/or id (or\n * `\"all\"`) and patches, removes, moves or inserts them; a bare array of\n * entries is the shorthand for \"patch every bit\". Hooks always see the\n * original bits, in order, before the document reshapes anything, and a\n * hook's patches apply after the document's for that bit. `diff` with\n * `outputFormat: \"patch\"` produces a document that turns one version of a\n * file into another.\n *\n * With neither hook, the whole document is transformed in a single WASM pass\n * (the fast path). When a `preHook` or `postHook` is supplied, `transform`\n * drives the bits one at a time on the calling thread — the hook inspects each\n * bit, may return patches / an output-format override / `drop`, and only data\n * crosses into WASM.\n *\n * `options.inputFormat` defaults to `\"auto\"`; prefer an explicit format when\n * known — see {@link convert}.\n *\n * Paths are JSON paths (`title`, `quizzes[0].choices[1].choice`) or bitmark\n * paths (`[@id]`, `$card[1][0][!]`, `$card[2]$body` — PLAN-209),\n * told apart by the first character; one language per call, and bitmark\n * paths need bitmark input.\n *\n * @returns The transformed document.\n * @throws {PatchError} If any entry was skipped (a bad path, an index out of\n * range, a refused value) — the diagnostics name each one. A silently\n * ignored edit is never returned.\n * @throws If the core reports a conversion or patch-document error.\n */\nexport function transform(input: string, options: TransformOptions = {}): string {\n const wasm = getActive();\n if (options.preHook || options.postHook) {\n return runHookedTransform(wasm as unknown as HookedWasm, input, options);\n }\n const patchJson =\n options.patch === undefined\n ? \"\"\n : typeof options.patch === \"string\"\n ? options.patch\n : JSON.stringify(options.patch);\n const { data, diagnostics } = JSON.parse(\n wasm.transform(\n input,\n options.inputFormat ?? \"auto\",\n options.outputFormat ?? \"json\",\n options.mode ?? \"optimized\",\n patchJson,\n options.pretty ?? false,\n options.indent ?? 2,\n options.spacesAroundValues ?? 1,\n ),\n ) as TransformEnvelope;\n if (diagnostics.length > 0) throw new PatchError(diagnostics);\n return data;\n}\n\n/**\n * Semantic diff of two documents (PLAN-179). Both sides are re-canonicalized\n * and compared as bit JSON; every difference is rendered as the canonical\n * bitmark an author would type. Bits are paired by `id`, then by `sourceBB`\n * on the same `sourceRL`, then by exact content, then by text similarity.\n *\n * @param a - The old document (bitmark or JSON).\n * @param b - The new document (bitmark or JSON; the formats need not match).\n * @param options - Diff options; `outputFormat` selects the unified-style\n * text (default), the per-bit JSON, or an applyable patch document.\n * @returns The diff in the selected format — empty text, an array of\n * `unchanged` bits, or a patch document with no entries when the two are\n * semantically equal.\n * @throws If the active variant was built without `diff`, or on a\n * conversion error.\n */\nexport function diff(a: string, b: string, options: DiffOptions = {}): string {\n const wasm = getActive();\n if (typeof wasm.diff !== \"function\") throw new UnsupportedFeatureError(\"diff\", variant());\n const out = wasm.diff(\n a,\n b,\n options.inputFormat ?? \"auto\",\n options.outputFormat ?? \"bitmark\",\n options.context ?? 3,\n options.locate ?? false,\n options.similarity ?? 0.6,\n options.bboxTolerance ?? 8,\n options.spacesAroundValues ?? 0,\n );\n return out;\n}\n\n/**\n * Typed form of {@link diff}: one {@link BitDiff} per aligned bit, unchanged\n * bits included (so the alignment is reconstructible). `outputFormat` is\n * ignored.\n */\nexport function diffBits(a: string, b: string, options: DiffOptions = {}): BitDiff[] {\n return JSON.parse(diff(a, b, { ...options, outputFormat: \"json\" })) as BitDiff[];\n}\n\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * @param input - The text to breakscape.\n * @param options - Breakscape options (e.g. `{ format: \"plainText\", location: \"tag\" }`).\n * Pass `subLocation: \"attrValue\"` when the text is the value half of an\n * inline-attr chain segment (`==t==|link:VALUE|`).\n * @returns Breakscaped text.\n */\nexport function breakscapeText(input: string, options: BreakscapeOptions = {}): string {\n const format = options.format ?? \"bitmark++\";\n const location = options.location ?? \"body\";\n const subLocation = options.subLocation ?? \"text\";\n return getActive().breakscape_text(input, format, location, subLocation);\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * @param input - The text to unbreakscape.\n * @param options - Unbreakscape options (e.g. `{ format: \"plainText\", location: \"tag\" }`).\n * `subLocation` is accepted and ignored — for `bitmark++` one inverse undoes\n * every breakscape mode.\n * @returns Unbreakscaped text.\n */\nexport function unbreakscapeText(input: string, options: BreakscapeOptions = {}): string {\n const format = options.format ?? \"bitmark++\";\n const location = options.location ?? \"body\";\n const subLocation = options.subLocation ?? \"text\";\n return getActive().unbreakscape_text(input, format, location, subLocation);\n}\n\n/**\n * Query information about supported bit types.\n *\n * `format` defaults to `\"text\"`, the human-readable rendering. That renderer\n * is only in the variants built with `info-text` — on `bitmark-json` it is\n * compiled out and this throws {@link UnsupportedFeatureError}; ask for\n * `format: \"json\"` there (the JSON views are the contractual ones and are in\n * every variant).\n *\n * @param options - Info options (e.g. `{ infoType: \"bit\", format: \"json\", bit: \"cloze\" }`).\n * @returns Information string.\n * @throws UnsupportedFeatureError if `format` is `\"text\"` on a variant built\n * without the text renderer.\n */\nexport function info(options: InfoOptions = {}): string {\n const infoType = options.infoType ?? \"list\";\n const format = options.format ?? \"text\";\n const bit = options.bit ?? \"\";\n const pretty = options.pretty ?? false;\n const indent = options.indent ?? 2;\n const includeDeprecated = options.includeDeprecated ?? false;\n const onlyDeprecated = options.onlyDeprecated ?? false;\n const full = options.full ?? false;\n // The wasm boundary is flat strings: \"\" = English, a comma list selects\n // several, `all` selects every resolvable one. An array is the idiomatic JS\n // spelling of the list and joins to the same thing.\n const language =\n typeof options.language === \"string\"\n ? options.language\n : (options.language?.join(\",\") ?? \"\");\n const wasm = getActive();\n if (format !== \"json\" && typeof wasm.info_text_supported !== \"function\") {\n throw new UnsupportedFeatureError('info (format: \"text\")', variant());\n }\n return wasm.info(\n infoType,\n format,\n bit,\n pretty,\n indent,\n includeDeprecated,\n onlyDeprecated,\n full,\n language,\n );\n}\n\n/**\n * Register data with the parser (PLAN-173). One verb rather than a function\n * per registerable thing — the same discriminated-options idiom as\n * {@link info}.\n *\n * Today the only type is `\"translations\"`, whose `data` is the text of a\n * translations file — the format published at `@gmb/bitmark-parser/translations`,\n * which is also what the CLI's `--translations` flag reads.\n *\n * Semantics are REPLACE: a second call supersedes the first entirely, and the\n * variant's built-in table (if any) stays underneath, so a key your file omits\n * still resolves. State is process-global, like {@link init} — the per-consumer\n * axis is `language`, which stays a per-call option on {@link info}.\n *\n * Works in every variant, including the lean ones that bake no table at all,\n * and SURVIVES an {@link init} variant swap — the data is replayed onto the\n * newly activated module.\n *\n * @throws RegisterError if the data is not a valid translations document.\n */\nexport function register(options: RegisterOptions): void {\n try {\n getActive().register(options.type, options.data);\n } catch (e) {\n throw new RegisterError(e instanceof Error ? e.message : String(e));\n }\n // Survives an `init` swap: each variant is a separate wasm instance with\n // its own memory, and switching variants must stay invisible to callers.\n rememberRegistration(options.type, options.data);\n}\n","// @zen-component: WASM-TSBindings\n//\n// Browser entry. The wasm variant is selected at runtime (PLAN-166 /\n// PLAN-174): all three glue modules are bundled (small), but only the selected\n// variant's `.wasm` is fetched — `init()` loads `browser-full`,\n// `init({ feature: \"full\" })` the richest one (adds the `info` meta layer),\n// `init({ feature: \"bitmark-json\" })` the minimal bitmark ↔ JSON one. A later\n// re-init loads the new module in the background while every call keeps being\n// served by the active one, then swaps atomically between calls.\n//\n// import { init, convert, ... } from '@gmb/bitmark-parser/browser'\n\nimport wasmFullInit, {\n initSync as wasmFullInitSync,\n} from \"../../wasm-web/bitmark_wasm.js\";\nimport * as wasmFull from \"../../wasm-web/bitmark_wasm.js\";\nimport wasmBrowserFullInit, {\n initSync as wasmBrowserFullInitSync,\n} from \"../../wasm-web-browser-full/bitmark_browser_full_wasm.js\";\nimport * as wasmBrowserFull from \"../../wasm-web-browser-full/bitmark_browser_full_wasm.js\";\nimport wasmJsonInit, {\n initSync as wasmJsonInitSync,\n} from \"../../wasm-web-bitmark-json/bitmark_json_wasm.js\";\nimport * as wasmJson from \"../../wasm-web-bitmark-json/bitmark_json_wasm.js\";\nimport { PACKAGE_INFO } from \"../generated/package_info.js\";\nimport {\n getActive,\n setActive,\n variant,\n BROWSER_DEFAULT_FEATURE,\n type Feature,\n type InitOptions,\n type WasmModule,\n} from \"../core/facade.js\";\nimport type { HookedWasm } from \"../core/hooked-transform.js\";\nimport { orchestrateParallel } from \"../core/parallel.js\";\nimport { setLegacyWasmProvider, type LegacyWasm } from \"../legacy/runtime.js\";\nimport type { TransformOptions } from \"../types.js\";\nimport { runJobsParallel } from \"./pool.js\";\n\n// Path from this bundle to the shared `dist/browser/wasm/` asset dir, injected\n// by tsup `define` (PLAN-174) because the three browser bundles sit at\n// different depths. Only bundled code ever loads a `.wasm`; the `typeof` guard\n// just keeps the module importable unbundled (typedoc, type tests), where no\n// init call is made.\ndeclare const __BITMARK_WASM_BASE__: string;\nconst WASM_BASE =\n typeof __BITMARK_WASM_BASE__ === \"string\" ? __BITMARK_WASM_BASE__ : \"./\";\n\n// Variant map (PLAN-166 / PLAN-174): feature → glue + the `.wasm` filename\n// under that asset dir. A future variant is one entry here plus one\n// build-script table row.\ninterface VariantSpec {\n init: (module_or_path?: unknown) => Promise<unknown>;\n initSync: (module: unknown) => unknown;\n ns: WasmModule;\n wasmFile: string;\n}\nconst VARIANTS: Record<Feature, VariantSpec> = {\n full: {\n init: wasmFullInit as (m?: unknown) => Promise<unknown>,\n initSync: wasmFullInitSync as (m: unknown) => unknown,\n ns: wasmFull as unknown as WasmModule,\n wasmFile: \"bitmark_wasm_bg.wasm\",\n },\n \"browser-full\": {\n init: wasmBrowserFullInit as (m?: unknown) => Promise<unknown>,\n initSync: wasmBrowserFullInitSync as (m: unknown) => unknown,\n ns: wasmBrowserFull as unknown as WasmModule,\n wasmFile: \"bitmark_browser_full_wasm_bg.wasm\",\n },\n \"bitmark-json\": {\n init: wasmJsonInit as (m?: unknown) => Promise<unknown>,\n initSync: wasmJsonInitSync as (m: unknown) => unknown,\n ns: wasmJson as unknown as WasmModule,\n wasmFile: \"bitmark_json_wasm_bg.wasm\",\n },\n};\n\n// Legacy (bpg-compatible) API — namespaced; WASM must be init()ed before use.\n// Reads the ACTIVE wasm per call, so it follows init swaps; on `bitmark-json`\n// only its HTML-dependent members fail (PLAN-166 decision 4). No file I/O is\n// provided in the browser (file options throw, as bpg does).\nsetLegacyWasmProvider(() => getActive() as unknown as LegacyWasm);\nexport * as legacy from \"../legacy/index.js\";\n\n/** `init` options (browser): feature and/or an explicit wasm source. */\nexport interface BrowserInitOptions extends InitOptions {\n /** Explicit `.wasm` source (URL / Request / Response / Module / bytes). */\n module_or_path?: unknown;\n}\n\n/**\n * The variant an init call without an explicit `feature` selects.\n *\n * With no source, that is the browser default (`browser-full`, PLAN-174). With\n * an EXPLICIT source it stays `\"full\"`: those bytes predate this variant split\n * and are `bitmark_wasm_bg.wasm`, and glue must match the bytes it\n * instantiates — pairing them with another variant's glue fails at\n * instantiation. Name the feature alongside the source to load any other one.\n */\nfunction defaultFeatureFor(module_or_path: unknown): Feature {\n return module_or_path === undefined ? BROWSER_DEFAULT_FEATURE : \"full\";\n}\n\n/**\n * Whether an `init` argument is an options record rather than a bare wasm\n * source. A record names `feature` and/or `module_or_path` — or is the empty\n * record `{}`, which is the same request as no argument at all. Every source\n * (URL, Request, Response, `WebAssembly.Module`, bytes, a promise of one) is\n * a non-plain object, so it never reads as the empty record.\n */\nfunction isInitOptions(arg: unknown): arg is BrowserInitOptions {\n if (arg === null || typeof arg !== \"object\") return false;\n if (\"feature\" in arg || \"module_or_path\" in arg) return true;\n const proto = Object.getPrototypeOf(arg);\n return (proto === Object.prototype || proto === null) && Object.keys(arg).length === 0;\n}\n\nfunction normalizeInit(arg: unknown): {\n feature: Feature;\n module_or_path?: unknown;\n} {\n if (isInitOptions(arg)) {\n return {\n feature: arg.feature ?? defaultFeatureFor(arg.module_or_path),\n module_or_path: arg.module_or_path,\n };\n }\n // Back-compat: a bare module_or_path initialises `full`; nothing at all\n // initialises the browser default.\n const module_or_path = arg ?? undefined;\n return { feature: defaultFeatureFor(module_or_path), module_or_path };\n}\n\n// Init sequencing: every activation — async or sync — takes the next number,\n// and an async load swaps only if it is still the newest when it lands.\nlet initSeq = 0;\nlet activeOut: unknown;\nlet inflight:\n { feature: Feature; seq: number; promise: Promise<unknown> } | undefined;\n\n/**\n * Initialise the WASM module, selecting the variant (PLAN-166 / PLAN-174):\n * `\"browser-full\"` (the browser default — every conversion capability, without\n * the `info` meta layer), `\"full\"` (adds that meta layer: tag descriptions,\n * group provenance, raw mappingKeys patterns — bigger to download) or\n * `\"bitmark-json\"` (bitmark ↔ JSON only; markup formats, mapping report and\n * the `lex` output unavailable). All three glue modules are in the bundle; only the\n * selected variant's `.wasm` is fetched.\n *\n * May be called again to switch variants: the new module loads in the\n * background while calls keep being served by the active one, then one\n * atomic swap applies. Overlapping calls: same-feature in-flight inits are\n * coalesced; a different-feature init supersedes an unfinished one (its load\n * is discarded without swapping); every returned promise resolves once the\n * finally-active module is live. Re-init of the already-active feature is a\n * no-op unless an explicit `module_or_path` forces re-instantiation.\n *\n * When no explicit source is given, the default `.wasm` URL is decorated\n * with a cache-busting `?v=<version>` query parameter so CDN caches are\n * invalidated when the package version changes.\n *\n * Back-compat: `init(module_or_path)` (no options object) initialises `full`,\n * because those bytes are `bitmark_wasm_bg.wasm` — see {@link defaultFeatureFor}.\n * `init({})` is the same request as `init()`.\n */\nexport async function init(\n options?: BrowserInitOptions | unknown,\n): Promise<unknown> {\n const { feature, module_or_path } = normalizeInit(options);\n if (module_or_path === undefined) {\n if (!inflight && variant() === feature) return activeOut; // no-op\n if (inflight?.feature === feature) return inflight.promise; // coalesce\n }\n const mySeq = ++initSeq;\n const v = VARIANTS[feature];\n const source =\n module_or_path ??\n new URL(`${WASM_BASE}${v.wasmFile}?v=${PACKAGE_INFO.version}`, import.meta.url);\n const promise: Promise<unknown> = (async () => {\n try {\n // wasm-bindgen's init takes an options object; a bare source is the\n // deprecated positional form and warns on every load.\n const out = await v.init({ module_or_path: source });\n if (mySeq === initSeq) {\n // Last call wins: a superseded load never swaps. The previous\n // module's reference is dropped here (its glue retains the instance\n // until that variant is re-initialised — wasm-bindgen keeps\n // module-level state).\n setActive(feature, v.ns);\n activeOut = out;\n }\n } finally {\n if (inflight?.seq === mySeq) inflight = undefined;\n }\n // Resolve to the finally-active state: if a newer init superseded this\n // one, wait for it (and any further successors) to settle.\n while (inflight) await inflight.promise.catch(() => {});\n return activeOut;\n })();\n inflight = { feature, seq: mySeq, promise };\n return promise;\n}\n\n/**\n * Synchronous initialisation from already-loaded wasm bytes / a compiled\n * `WebAssembly.Module` (no fetch). `options.feature` selects the variant the\n * bytes belong to — it must MATCH them, since glue and module are a pair.\n * Default `\"full\"`, for the same back-compat reason as {@link defaultFeatureFor}.\n *\n * Takes part in the same last-call-wins sequencing as {@link init}: an\n * unfinished async load is superseded (it completes but never swaps, and a\n * later `init` of its feature starts afresh rather than joining it).\n */\nexport function initSync(module: unknown, options: InitOptions = {}): unknown {\n const feature = options.feature ?? defaultFeatureFor(module);\n const v = VARIANTS[feature];\n const out = v.initSync({ module });\n ++initSeq;\n inflight = undefined;\n setActive(feature, v.ns);\n activeOut = out;\n return out;\n}\n\nexport {\n variant,\n NotInitializedError,\n PatchError,\n RegisterError,\n UnsupportedFeatureError,\n} from \"../core/facade.js\";\nexport type { Feature, InitOptions } from \"../core/facade.js\";\n\nexport type {\n LexToken,\n PositionEncoding,\n TokensLayout,\n SemanticTokenType,\n SemanticTokenModifier,\n SemanticTokensLegend,\n SemanticToken,\n SemanticTokensLsp,\n SemanticTokensAbsolute,\n SemanticTokens,\n SemanticTokensOptions,\n Position,\n Range,\n Diagnostic,\n Diagnostics,\n DiagnosticsOptions,\n IssueScope,\n MarkupContent,\n CompletionItemData,\n CompletionItem,\n EditorContext,\n CompletionList,\n CompleteOptions,\n HoverData,\n Hover,\n HoverOptions,\n ParseOptions,\n ConvertOptions,\n OutputMode,\n BreakscapeOptions,\n TextFormat,\n TextLocation,\n TextSubLocation,\n InfoOptions,\n RegisterOptions,\n InfoType,\n InfoFormat,\n InputFormat,\n OutputFormat,\n CanonicalizeOptions,\n TransformOptions,\n PatchOp,\n PatchEntry,\n PatchDiagnostic,\n IsBitmarkPath,\n PathValue,\n PatchValueFor,\n PatchDocument,\n PatchDocumentEntry,\n BitSelector,\n DiffOptions,\n DiffOutputFormat,\n BitDiff,\n BitDiffRef,\n DiffHunk,\n DiffHunkLine,\n BitSlice,\n BitView,\n PreHook,\n PostHook,\n PreHookResult,\n TagFormat,\n BodyFormat,\n ResourceAttachment,\n CompactTagInfo,\n FullTagInfo,\n CompactVariantInfo,\n CompactSideInfo,\n CompactCardInfo,\n CompactCardSetInfo,\n FullVariantInfo,\n FullSideInfo,\n FullCardInfo,\n FullCardSetInfo,\n BodyRulesInfo,\n CompactBitInfo,\n FullBitInfo,\n BitListInfo,\n LanguagesInfo,\n BitInfo,\n AllBitsInfo,\n DeprecatedEntryInfo,\n DeprecatedInfo,\n InfoErrorResult,\n} from \"../types.js\";\nexport { patchEntry, ALL_LANGUAGES } from \"../types.js\";\n\n// Generated types for the parser's JSON (from bitmark.json via schemagen, PLAN-128)\nexport type * from \"../generated/bit-types.js\";\n\nexport { CompletionItemKind, CompletionItemTag, DiagnosticSeverity } from \"../editor-types.js\";\n\n// The shared wrappers (PLAN-166): every call reads the active wasm module.\nexport {\n bitmarkToObjects,\n objectsToBitmark,\n convert,\n semanticTokens,\n diagnostics,\n complete,\n resolve,\n hover,\n canonicalize,\n countBits,\n splitBits,\n transform,\n diff,\n diffBits,\n breakscapeText,\n unbreakscapeText,\n info,\n register,\n} from \"../core/api.js\";\n\n/**\n * Get the version of the @gmb/bitmark-parser library.\n *\n * @returns Version string (e.g. \"3.0.0\").\n */\nexport function version(): string {\n return PACKAGE_INFO.version;\n}\n\n/**\n * Parallel counterpart of {@link transform} (browser). Fans the per-bit WASM\n * compute across a pool of module `Worker`s (`options.workers`, default `4`);\n * each worker loads its own WASM instance of the ACTIVE variant.\n * `preHook`/`postHook` run on the calling thread. Call {@link init} before\n * use. Output is identical to {@link transform}; this trades worker startup\n * cost for throughput on large documents.\n *\n * **Requires the ESM build** (`@gmb/bitmark-parser/browser`, i.e.\n * `dist/browser/esm`): the module-`Worker` entry (`worker-entry.js`) and its\n * `.wasm` are emitted only beside that bundle. Module workers are ESM by\n * nature; the CJS / single-file min bundles ship the sync {@link transform}\n * only, and calling this there resolves to an `error:` string (the worker\n * file is absent). For throughput in those targets, use {@link transform} or\n * chunk + your own workers.\n *\n * @returns A Promise of the transformed document, or an `error:`-prefixed\n * string on failure.\n */\nexport function transformParallel(\n input: string,\n options: TransformOptions = {},\n): Promise<string> {\n const wasm = getActive() as unknown as HookedWasm;\n const feature: Feature = variant() ?? BROWSER_DEFAULT_FEATURE;\n return orchestrateParallel(wasm, input, options, (jobs, workers) =>\n runJobsParallel(jobs, workers, feature),\n );\n}\n"]}
|