epub-codec 1.2.11 → 1.3.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.
Files changed (170) hide show
  1. package/README.md +24 -10
  2. package/dist/base64--HuymRl_.d.cts +5 -0
  3. package/dist/base64--HuymRl_.d.ts +5 -0
  4. package/dist/build-B1UxbO20.d.cts +5 -0
  5. package/dist/build-BCUsHLYw.d.ts +5 -0
  6. package/dist/codec-CX2Pa6Jq.d.ts +2876 -0
  7. package/dist/codec-qyKMOMt6.d.cts +2876 -0
  8. package/dist/codec.cjs +16 -0
  9. package/dist/codec.d.cts +2 -2702
  10. package/dist/codec.d.ts +2 -2702
  11. package/dist/codec.js +14 -1
  12. package/dist/container-B6cHHiY9.d.cts +4 -0
  13. package/dist/container-B6cHHiY9.d.ts +4 -0
  14. package/dist/context-CTgx7PwU.d.ts +28 -0
  15. package/dist/context-CXs2Yc9w.d.cts +28 -0
  16. package/dist/dimensions-B7ogpvKQ.d.cts +11 -0
  17. package/dist/dimensions-B7ogpvKQ.d.ts +11 -0
  18. package/dist/entities-CfQKtI34.d.ts +7 -0
  19. package/dist/entities-wt9zCx5q.d.cts +7 -0
  20. package/dist/footnote-CxsO5tCV.d.cts +7 -0
  21. package/dist/footnote-iZAPC_NT.d.ts +7 -0
  22. package/dist/format-DxUddUPj.d.cts +6 -0
  23. package/dist/format-DxUddUPj.d.ts +6 -0
  24. package/dist/format.d.cts +1 -5
  25. package/dist/format.d.ts +1 -5
  26. package/dist/image/dimensions.d.cts +1 -10
  27. package/dist/image/dimensions.d.ts +1 -10
  28. package/dist/index.cjs +24 -8
  29. package/dist/index.d.cts +31 -31
  30. package/dist/index.d.ts +31 -31
  31. package/dist/index.js +13 -10
  32. package/dist/inline-DDj6Sl3e.d.ts +12 -0
  33. package/dist/inline-YZOQY2wR.d.cts +12 -0
  34. package/dist/list-id-BB_yxm1H.d.cts +13 -0
  35. package/dist/list-id-BB_yxm1H.d.ts +13 -0
  36. package/dist/metadata-DXto7sM6.d.cts +7 -0
  37. package/dist/metadata-T5V2ovtS.d.ts +7 -0
  38. package/dist/model/package.cjs +19 -0
  39. package/dist/model/package.d.cts +2 -0
  40. package/dist/model/package.d.ts +2 -0
  41. package/dist/model/package.js +15 -0
  42. package/dist/nav/nav3.cjs +1 -1
  43. package/dist/nav/nav3.d.cts +1 -3
  44. package/dist/nav/nav3.d.ts +1 -3
  45. package/dist/nav/nav3.js +1 -1
  46. package/dist/nav/ncx.cjs +1 -1
  47. package/dist/nav/ncx.d.cts +1 -3
  48. package/dist/nav/ncx.d.ts +1 -3
  49. package/dist/nav/ncx.js +1 -1
  50. package/dist/nav/reconcile.d.cts +1 -3
  51. package/dist/nav/reconcile.d.ts +1 -3
  52. package/dist/nav/write.cjs +1 -1
  53. package/dist/nav/write.d.cts +1 -9
  54. package/dist/nav/write.d.ts +1 -9
  55. package/dist/nav/write.js +1 -1
  56. package/dist/nav3-SbAp8zlu.d.cts +4 -0
  57. package/dist/nav3-SbAp8zlu.d.ts +4 -0
  58. package/dist/ncx-kYhlXucj.d.cts +4 -0
  59. package/dist/ncx-kYhlXucj.d.ts +4 -0
  60. package/dist/node-CJLSSs1k.d.cts +84 -0
  61. package/dist/node-CJLSSs1k.d.ts +84 -0
  62. package/dist/ocf/container.cjs +1 -1
  63. package/dist/ocf/container.d.cts +1 -3
  64. package/dist/ocf/container.d.ts +1 -3
  65. package/dist/ocf/container.js +1 -1
  66. package/dist/ocf/write.d.cts +1 -3
  67. package/dist/ocf/write.d.ts +1 -3
  68. package/dist/opf/metadata.d.cts +1 -6
  69. package/dist/opf/metadata.d.ts +1 -6
  70. package/dist/opf/parse.cjs +1 -1
  71. package/dist/opf/parse.d.cts +1 -5
  72. package/dist/opf/parse.d.ts +1 -5
  73. package/dist/opf/parse.js +1 -1
  74. package/dist/opf/types.d.cts +1 -19
  75. package/dist/opf/types.d.ts +1 -19
  76. package/dist/opf/write.cjs +1 -1
  77. package/dist/opf/write.d.cts +1 -11
  78. package/dist/opf/write.d.ts +1 -11
  79. package/dist/opf/write.js +1 -1
  80. package/dist/package-io/read.cjs +39 -0
  81. package/dist/package-io/read.d.cts +2 -0
  82. package/dist/package-io/read.d.ts +2 -0
  83. package/dist/package-io/read.js +37 -0
  84. package/dist/package-io/write.cjs +34 -0
  85. package/dist/package-io/write.d.cts +2 -0
  86. package/dist/package-io/write.d.ts +2 -0
  87. package/dist/package-io/write.js +32 -0
  88. package/dist/parse-Bkkb7qXz.d.cts +6 -0
  89. package/dist/parse-C5GxodcX.d.ts +6 -0
  90. package/dist/parse-CmCjyz8i.d.cts +5 -0
  91. package/dist/parse-Dc76LQIj.d.ts +5 -0
  92. package/dist/path-Cx8-QMD6.d.cts +5 -0
  93. package/dist/path-Cx8-QMD6.d.ts +5 -0
  94. package/dist/path.d.cts +1 -4
  95. package/dist/path.d.ts +1 -4
  96. package/dist/query-B79eElol.d.ts +12 -0
  97. package/dist/query-C6ftPqNQ.d.cts +12 -0
  98. package/dist/read-B7kc_MeO.d.cts +10 -0
  99. package/dist/read-BMGq_D9y.d.cts +30 -0
  100. package/dist/read-Czqr3aop.d.ts +30 -0
  101. package/dist/read-DPkpZsYG.d.ts +10 -0
  102. package/dist/read.cjs +51 -6
  103. package/dist/read.d.cts +1 -9
  104. package/dist/read.d.ts +1 -9
  105. package/dist/read.js +52 -7
  106. package/dist/reconcile-BHky0kta.d.cts +4 -0
  107. package/dist/reconcile-BHky0kta.d.ts +4 -0
  108. package/dist/style-constants-RVoHdmju.d.cts +8 -0
  109. package/dist/style-constants-RVoHdmju.d.ts +8 -0
  110. package/dist/types-BxmkPT_F.d.cts +20 -0
  111. package/dist/types-BxmkPT_F.d.ts +20 -0
  112. package/dist/util/base64.d.cts +1 -4
  113. package/dist/util/base64.d.ts +1 -4
  114. package/dist/write-B89sagtw.d.cts +12 -0
  115. package/dist/write-BQcrPQvx.d.ts +10 -0
  116. package/dist/write-Boxi3aK0.d.cts +10 -0
  117. package/dist/write-COdkb8lG.d.cts +10 -0
  118. package/dist/write-COdkb8lG.d.ts +10 -0
  119. package/dist/write-DwaEwwgZ.d.ts +12 -0
  120. package/dist/write-DxiR-9eH.d.cts +4 -0
  121. package/dist/write-DxiR-9eH.d.ts +4 -0
  122. package/dist/write-Klo0WDhT.d.ts +13 -0
  123. package/dist/write-WSIgARHT.d.cts +13 -0
  124. package/dist/write.cjs +28 -6
  125. package/dist/write.d.cts +1 -9
  126. package/dist/write.d.ts +1 -9
  127. package/dist/write.js +28 -6
  128. package/dist/xhtml/context.d.cts +2 -22
  129. package/dist/xhtml/context.d.ts +2 -22
  130. package/dist/xhtml/footnote.cjs +4 -8
  131. package/dist/xhtml/footnote.d.cts +2 -7
  132. package/dist/xhtml/footnote.d.ts +2 -7
  133. package/dist/xhtml/footnote.js +4 -8
  134. package/dist/xhtml/inline.cjs +13 -7
  135. package/dist/xhtml/inline.d.cts +1 -11
  136. package/dist/xhtml/inline.d.ts +1 -11
  137. package/dist/xhtml/inline.js +13 -7
  138. package/dist/xhtml/link-target.cjs +18 -0
  139. package/dist/xhtml/link-target.d.cts +8 -0
  140. package/dist/xhtml/link-target.d.ts +8 -0
  141. package/dist/xhtml/link-target.js +17 -0
  142. package/dist/xhtml/list-id.d.cts +1 -12
  143. package/dist/xhtml/list-id.d.ts +1 -12
  144. package/dist/xhtml/read.cjs +50 -18
  145. package/dist/xhtml/read.d.cts +2 -20
  146. package/dist/xhtml/read.d.ts +2 -20
  147. package/dist/xhtml/read.js +49 -19
  148. package/dist/xhtml/style-constants.d.cts +1 -7
  149. package/dist/xhtml/style-constants.d.ts +1 -7
  150. package/dist/xhtml/write.cjs +44 -19
  151. package/dist/xhtml/write.d.cts +1 -11
  152. package/dist/xhtml/write.d.ts +1 -11
  153. package/dist/xhtml/write.js +44 -19
  154. package/dist/xml/build.d.cts +1 -4
  155. package/dist/xml/build.d.ts +1 -4
  156. package/dist/xml/entities.d.cts +1 -6
  157. package/dist/xml/entities.d.ts +1 -6
  158. package/dist/xml/node.d.cts +1 -83
  159. package/dist/xml/node.d.ts +1 -83
  160. package/dist/xml/parse.d.cts +1 -4
  161. package/dist/xml/parse.d.ts +1 -4
  162. package/dist/xml/query.cjs +1 -1
  163. package/dist/xml/query.d.cts +1 -11
  164. package/dist/xml/query.d.ts +1 -11
  165. package/dist/xml/query.js +1 -1
  166. package/dist/zip-ie17sOo5.d.cts +9 -0
  167. package/dist/zip-ie17sOo5.d.ts +9 -0
  168. package/dist/zip.d.cts +1 -8
  169. package/dist/zip.d.ts +1 -8
  170. package/package.json +19 -22
@@ -1,14 +1,14 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_xml_node = require("../xml/node.cjs");
3
+ const require_util_base64 = require("../util/base64.cjs");
4
+ const require_xml_parse = require("../xml/parse.cjs");
5
+ const require_xml_build = require("../xml/build.cjs");
2
6
  const require_diagnostics = require("../diagnostics.cjs");
3
7
  const require_xml_entities = require("../xml/entities.cjs");
4
- const require_xml_node = require("../xml/node.cjs");
5
8
  const require_xml_query = require("../xml/query.cjs");
6
- const require_xml_parse = require("../xml/parse.cjs");
9
+ const require_xhtml_footnote = require("./footnote.cjs");
7
10
  const require_image_dimensions = require("../image/dimensions.cjs");
8
- const require_util_base64 = require("../util/base64.cjs");
9
- const require_xml_build = require("../xml/build.cjs");
10
11
  const require_xhtml_context = require("./context.cjs");
11
- const require_xhtml_footnote = require("./footnote.cjs");
12
12
  const require_xhtml_style_constants = require("./style-constants.cjs");
13
13
  const require_xhtml_inline = require("./inline.cjs");
14
14
  const require_xhtml_list_id = require("./list-id.cjs");
@@ -100,6 +100,19 @@ function elementsWithTagSkippingInert(nodes, tag) {
100
100
  }
101
101
  return out;
102
102
  }
103
+ function scanXhtmlAnchors(xml) {
104
+ const nodes = require_xml_parse.parseXml(xml);
105
+ const html = require_xml_query.rootElement(nodes);
106
+ const body = html === void 0 ? void 0 : require_xml_query.findChildElement(html.children, "body");
107
+ if (body === void 0) return {
108
+ idElements: /* @__PURE__ */ new Map(),
109
+ anchors: []
110
+ };
111
+ return {
112
+ idElements: buildIdElementMap(body.children),
113
+ anchors: elementsWithTagSkippingInert(body.children, "a").filter((anchor) => require_xml_query.attrValue(anchor, "href") !== void 0)
114
+ };
115
+ }
103
116
  function readStyleResidue(html, context) {
104
117
  const head = require_xml_query.findChildElement(html.children, "head");
105
118
  if (head === void 0) return;
@@ -125,17 +138,27 @@ function readXhtmlBody(xml, options) {
125
138
  source: void 0
126
139
  };
127
140
  const idElements = buildIdElementMap(body.children);
128
- const footnoteTargetIds = /* @__PURE__ */ new Set();
141
+ const anchorTargets = new Map(options.extraAnchorTargets);
129
142
  for (const anchor of elementsWithTagSkippingInert(body.children, "a")) {
130
- const name = require_xhtml_footnote.isFootnoteReferenceAnchor(anchor, idElements);
131
- if (name !== void 0) footnoteTargetIds.add(name);
143
+ const fragment = require_xhtml_footnote.sameDocumentFragment(require_xml_query.attrValue(anchor, "href"));
144
+ const target = fragment === void 0 ? void 0 : idElements.get(fragment);
145
+ if (fragment === void 0 || target === void 0 || !BLOCK_LEVEL_TAGS.has(target.tag) || anchorTargets.has(fragment)) continue;
146
+ anchorTargets.set(fragment, {
147
+ anchorType: require_xhtml_footnote.isFootnoteReference(anchor, target) ? "footnote" : "bookmark",
148
+ name: fragment
149
+ });
132
150
  }
133
151
  const context = {
134
152
  resolveImage: options.resolveImage,
135
153
  sink: options.sink,
136
154
  sourceHref: options.sourceHref,
137
155
  idElements,
138
- footnoteTargetIds,
156
+ anchorTargets,
157
+ resolveAnchorHref: (href) => {
158
+ const fragment = require_xhtml_footnote.sameDocumentFragment(href);
159
+ if (fragment !== void 0) return anchorTargets.get(fragment);
160
+ return options.resolveCrossDocumentAnchorHref?.(href);
161
+ },
139
162
  quoteDepth: 0
140
163
  };
141
164
  const state = {
@@ -208,16 +231,17 @@ function headingLevelOf(tag) {
208
231
  }
209
232
  function readBlockElement(element, state) {
210
233
  const id = require_xml_query.attrValue(element, "id");
211
- const isFootnoteTarget = id !== void 0 && state.context.footnoteTargetIds.has(id) && !require_xhtml_footnote.isFootnoteAside(element);
212
234
  const blocks = readBlockElementInner(element, state);
213
- if (!isFootnoteTarget) return blocks;
235
+ if (id === void 0) return blocks;
236
+ const target = state.context.anchorTargets.get(id);
237
+ if (target === void 0 || require_xhtml_footnote.isFootnoteAside(element)) return blocks;
214
238
  return [
215
239
  {
216
240
  kind: "constructStart",
217
241
  descriptor: {
218
242
  kind: "anchor",
219
- anchorType: "footnote",
220
- name: id
243
+ anchorType: target.anchorType,
244
+ name: target.name
221
245
  }
222
246
  },
223
247
  ...blocks,
@@ -280,10 +304,16 @@ function readPreFlatRuns(nodes, context) {
280
304
  fontFamily: require_xhtml_style_constants.MONOSPACE_FONT_FAMILY
281
305
  }] : [];
282
306
  }
307
+ function preFootnoteReferenceName(anchor, context) {
308
+ const href = require_xml_query.attrValue(anchor, "href");
309
+ if (href === void 0) return;
310
+ const target = context.resolveAnchorHref(href);
311
+ return target?.anchorType === "footnote" ? target.name : void 0;
312
+ }
283
313
  function containsFootnoteReference(nodes, context) {
284
314
  for (const node of nodes) {
285
315
  if (node.type !== "element" || require_xhtml_context.isInertElement(node.tag)) continue;
286
- if (node.tag === "a" && require_xhtml_footnote.isFootnoteReferenceAnchor(node, context.idElements) !== void 0) return true;
316
+ if (node.tag === "a" && preFootnoteReferenceName(node, context) !== void 0) return true;
287
317
  if (containsFootnoteReference(node.children, context)) return true;
288
318
  }
289
319
  return false;
@@ -318,7 +348,7 @@ function readPreRuns(nodes, context) {
318
348
  buffer += "\n";
319
349
  continue;
320
350
  }
321
- const footnoteName = node.tag === "a" ? require_xhtml_footnote.isFootnoteReferenceAnchor(node, context.idElements) : void 0;
351
+ const footnoteName = node.tag === "a" ? preFootnoteReferenceName(node, context) : void 0;
322
352
  if (footnoteName === void 0 && !containsFootnoteReference([node], context)) {
323
353
  buffer += readPreText(node.children, context);
324
354
  continue;
@@ -659,8 +689,8 @@ function readImage(element, state) {
659
689
  }
660
690
  function readAside(element, state) {
661
691
  if (!require_xhtml_footnote.isFootnoteAside(element)) return readContainerChildren(element.children, state);
662
- const name = require_xml_query.attrValue(element, "id");
663
- if (name === void 0) {
692
+ const id = require_xml_query.attrValue(element, "id");
693
+ if (id === void 0) {
664
694
  state.context.sink({
665
695
  code: require_diagnostics.EpubDiagnosticCodes.FOOTNOTE_TARGET_UNRESOLVED,
666
696
  severity: "warning",
@@ -675,7 +705,7 @@ function readAside(element, state) {
675
705
  descriptor: {
676
706
  kind: "anchor",
677
707
  anchorType: "footnote",
678
- name
708
+ name: state.context.anchorTargets.get(id)?.name ?? id
679
709
  }
680
710
  },
681
711
  ...readContainerChildren(element.children, state),
@@ -683,4 +713,6 @@ function readAside(element, state) {
683
713
  ];
684
714
  }
685
715
  //#endregion
716
+ exports.BLOCK_LEVEL_TAGS = BLOCK_LEVEL_TAGS;
686
717
  exports.readXhtmlBody = readXhtmlBody;
718
+ exports.scanXhtmlAnchors = scanXhtmlAnchors;
@@ -1,20 +1,2 @@
1
- import { ContentBlock, SourceResidue } from "document-schema.js";
2
- //#region src/xhtml/read.d.ts
3
- interface ReadXhtmlBodyOptions {
4
- readonly resolveImage: (href: string) => Uint8Array<ArrayBuffer> | undefined;
5
- readonly sink: (diagnostic: {
6
- code: string;
7
- severity: "info" | "warning";
8
- message: string;
9
- href?: string;
10
- }) => void;
11
- readonly sourceHref: string;
12
- readonly contentWidthPt: number;
13
- }
14
- interface ReadXhtmlBodyResult {
15
- readonly blocks: ContentBlock[];
16
- readonly source: SourceResidue | undefined;
17
- }
18
- declare function readXhtmlBody(xml: string, options: ReadXhtmlBodyOptions): ReadXhtmlBodyResult;
19
- //#endregion
20
- export { ReadXhtmlBodyOptions, ReadXhtmlBodyResult, readXhtmlBody };
1
+ import { a as readXhtmlBody, i as XhtmlAnchorScan, n as ReadXhtmlBodyOptions, o as scanXhtmlAnchors, r as ReadXhtmlBodyResult, t as BLOCK_LEVEL_TAGS } from "../read-BMGq_D9y.cjs";
2
+ export { BLOCK_LEVEL_TAGS, ReadXhtmlBodyOptions, ReadXhtmlBodyResult, XhtmlAnchorScan, readXhtmlBody, scanXhtmlAnchors };
@@ -1,20 +1,2 @@
1
- import { ContentBlock, SourceResidue } from "document-schema.js";
2
- //#region src/xhtml/read.d.ts
3
- interface ReadXhtmlBodyOptions {
4
- readonly resolveImage: (href: string) => Uint8Array<ArrayBuffer> | undefined;
5
- readonly sink: (diagnostic: {
6
- code: string;
7
- severity: "info" | "warning";
8
- message: string;
9
- href?: string;
10
- }) => void;
11
- readonly sourceHref: string;
12
- readonly contentWidthPt: number;
13
- }
14
- interface ReadXhtmlBodyResult {
15
- readonly blocks: ContentBlock[];
16
- readonly source: SourceResidue | undefined;
17
- }
18
- declare function readXhtmlBody(xml: string, options: ReadXhtmlBodyOptions): ReadXhtmlBodyResult;
19
- //#endregion
20
- export { ReadXhtmlBodyOptions, ReadXhtmlBodyResult, readXhtmlBody };
1
+ import { a as readXhtmlBody, i as XhtmlAnchorScan, n as ReadXhtmlBodyOptions, o as scanXhtmlAnchors, r as ReadXhtmlBodyResult, t as BLOCK_LEVEL_TAGS } from "../read-Czqr3aop.js";
2
+ export { BLOCK_LEVEL_TAGS, ReadXhtmlBodyOptions, ReadXhtmlBodyResult, XhtmlAnchorScan, readXhtmlBody, scanXhtmlAnchors };
@@ -1,13 +1,13 @@
1
+ import { isTextLikeNode } from "../xml/node.js";
2
+ import { bytesToBase64 } from "../util/base64.js";
3
+ import { parseXml } from "../xml/parse.js";
4
+ import { buildXml } from "../xml/build.js";
1
5
  import { EpubDiagnosticCodes } from "../diagnostics.js";
2
6
  import { decodeEntities, decodeTextLikeNode } from "../xml/entities.js";
3
- import { isTextLikeNode } from "../xml/node.js";
4
7
  import { attrValue, findChildElement, rootElement } from "../xml/query.js";
5
- import { parseXml } from "../xml/parse.js";
8
+ import { isFootnoteAside, isFootnoteReference, sameDocumentFragment } from "./footnote.js";
6
9
  import { POINTS_PER_PIXEL, detectImageFormat, readImageDimensions } from "../image/dimensions.js";
7
- import { bytesToBase64 } from "../util/base64.js";
8
- import { buildXml } from "../xml/build.js";
9
10
  import { isInertElement, reportInertElementSkip } from "./context.js";
10
- import { isFootnoteAside, isFootnoteReferenceAnchor } from "./footnote.js";
11
11
  import { HORIZONTAL_RULE_STYLE_ID, MONOSPACE_FONT_FAMILY } from "./style-constants.js";
12
12
  import { buildInlineRuns, rebaseConstructs } from "./inline.js";
13
13
  import { mintListNumId } from "./list-id.js";
@@ -99,6 +99,19 @@ function elementsWithTagSkippingInert(nodes, tag) {
99
99
  }
100
100
  return out;
101
101
  }
102
+ function scanXhtmlAnchors(xml) {
103
+ const nodes = parseXml(xml);
104
+ const html = rootElement(nodes);
105
+ const body = html === void 0 ? void 0 : findChildElement(html.children, "body");
106
+ if (body === void 0) return {
107
+ idElements: /* @__PURE__ */ new Map(),
108
+ anchors: []
109
+ };
110
+ return {
111
+ idElements: buildIdElementMap(body.children),
112
+ anchors: elementsWithTagSkippingInert(body.children, "a").filter((anchor) => attrValue(anchor, "href") !== void 0)
113
+ };
114
+ }
102
115
  function readStyleResidue(html, context) {
103
116
  const head = findChildElement(html.children, "head");
104
117
  if (head === void 0) return;
@@ -124,17 +137,27 @@ function readXhtmlBody(xml, options) {
124
137
  source: void 0
125
138
  };
126
139
  const idElements = buildIdElementMap(body.children);
127
- const footnoteTargetIds = /* @__PURE__ */ new Set();
140
+ const anchorTargets = new Map(options.extraAnchorTargets);
128
141
  for (const anchor of elementsWithTagSkippingInert(body.children, "a")) {
129
- const name = isFootnoteReferenceAnchor(anchor, idElements);
130
- if (name !== void 0) footnoteTargetIds.add(name);
142
+ const fragment = sameDocumentFragment(attrValue(anchor, "href"));
143
+ const target = fragment === void 0 ? void 0 : idElements.get(fragment);
144
+ if (fragment === void 0 || target === void 0 || !BLOCK_LEVEL_TAGS.has(target.tag) || anchorTargets.has(fragment)) continue;
145
+ anchorTargets.set(fragment, {
146
+ anchorType: isFootnoteReference(anchor, target) ? "footnote" : "bookmark",
147
+ name: fragment
148
+ });
131
149
  }
132
150
  const context = {
133
151
  resolveImage: options.resolveImage,
134
152
  sink: options.sink,
135
153
  sourceHref: options.sourceHref,
136
154
  idElements,
137
- footnoteTargetIds,
155
+ anchorTargets,
156
+ resolveAnchorHref: (href) => {
157
+ const fragment = sameDocumentFragment(href);
158
+ if (fragment !== void 0) return anchorTargets.get(fragment);
159
+ return options.resolveCrossDocumentAnchorHref?.(href);
160
+ },
138
161
  quoteDepth: 0
139
162
  };
140
163
  const state = {
@@ -207,16 +230,17 @@ function headingLevelOf(tag) {
207
230
  }
208
231
  function readBlockElement(element, state) {
209
232
  const id = attrValue(element, "id");
210
- const isFootnoteTarget = id !== void 0 && state.context.footnoteTargetIds.has(id) && !isFootnoteAside(element);
211
233
  const blocks = readBlockElementInner(element, state);
212
- if (!isFootnoteTarget) return blocks;
234
+ if (id === void 0) return blocks;
235
+ const target = state.context.anchorTargets.get(id);
236
+ if (target === void 0 || isFootnoteAside(element)) return blocks;
213
237
  return [
214
238
  {
215
239
  kind: "constructStart",
216
240
  descriptor: {
217
241
  kind: "anchor",
218
- anchorType: "footnote",
219
- name: id
242
+ anchorType: target.anchorType,
243
+ name: target.name
220
244
  }
221
245
  },
222
246
  ...blocks,
@@ -279,10 +303,16 @@ function readPreFlatRuns(nodes, context) {
279
303
  fontFamily: MONOSPACE_FONT_FAMILY
280
304
  }] : [];
281
305
  }
306
+ function preFootnoteReferenceName(anchor, context) {
307
+ const href = attrValue(anchor, "href");
308
+ if (href === void 0) return;
309
+ const target = context.resolveAnchorHref(href);
310
+ return target?.anchorType === "footnote" ? target.name : void 0;
311
+ }
282
312
  function containsFootnoteReference(nodes, context) {
283
313
  for (const node of nodes) {
284
314
  if (node.type !== "element" || isInertElement(node.tag)) continue;
285
- if (node.tag === "a" && isFootnoteReferenceAnchor(node, context.idElements) !== void 0) return true;
315
+ if (node.tag === "a" && preFootnoteReferenceName(node, context) !== void 0) return true;
286
316
  if (containsFootnoteReference(node.children, context)) return true;
287
317
  }
288
318
  return false;
@@ -317,7 +347,7 @@ function readPreRuns(nodes, context) {
317
347
  buffer += "\n";
318
348
  continue;
319
349
  }
320
- const footnoteName = node.tag === "a" ? isFootnoteReferenceAnchor(node, context.idElements) : void 0;
350
+ const footnoteName = node.tag === "a" ? preFootnoteReferenceName(node, context) : void 0;
321
351
  if (footnoteName === void 0 && !containsFootnoteReference([node], context)) {
322
352
  buffer += readPreText(node.children, context);
323
353
  continue;
@@ -658,8 +688,8 @@ function readImage(element, state) {
658
688
  }
659
689
  function readAside(element, state) {
660
690
  if (!isFootnoteAside(element)) return readContainerChildren(element.children, state);
661
- const name = attrValue(element, "id");
662
- if (name === void 0) {
691
+ const id = attrValue(element, "id");
692
+ if (id === void 0) {
663
693
  state.context.sink({
664
694
  code: EpubDiagnosticCodes.FOOTNOTE_TARGET_UNRESOLVED,
665
695
  severity: "warning",
@@ -674,7 +704,7 @@ function readAside(element, state) {
674
704
  descriptor: {
675
705
  kind: "anchor",
676
706
  anchorType: "footnote",
677
- name
707
+ name: state.context.anchorTargets.get(id)?.name ?? id
678
708
  }
679
709
  },
680
710
  ...readContainerChildren(element.children, state),
@@ -682,4 +712,4 @@ function readAside(element, state) {
682
712
  ];
683
713
  }
684
714
  //#endregion
685
- export { readXhtmlBody };
715
+ export { BLOCK_LEVEL_TAGS, readXhtmlBody, scanXhtmlAnchors };
@@ -1,8 +1,2 @@
1
- //#region src/xhtml/style-constants.d.ts
2
- declare const HORIZONTAL_RULE_STYLE_ID = "HorizontalRule";
3
- declare const QUOTE_STYLE_ID = "Quote";
4
- declare const QUOTE_INDENT_PT = 36;
5
- declare const MONOSPACE_FONT_FAMILY = "Courier New";
6
- declare const DEFINITION_BODY_INDENT_PT = 36;
7
- //#endregion
1
+ import { a as QUOTE_STYLE_ID, i as QUOTE_INDENT_PT, n as HORIZONTAL_RULE_STYLE_ID, r as MONOSPACE_FONT_FAMILY, t as DEFINITION_BODY_INDENT_PT } from "../style-constants-RVoHdmju.cjs";
8
2
  export { DEFINITION_BODY_INDENT_PT, HORIZONTAL_RULE_STYLE_ID, MONOSPACE_FONT_FAMILY, QUOTE_INDENT_PT, QUOTE_STYLE_ID };
@@ -1,8 +1,2 @@
1
- //#region src/xhtml/style-constants.d.ts
2
- declare const HORIZONTAL_RULE_STYLE_ID = "HorizontalRule";
3
- declare const QUOTE_STYLE_ID = "Quote";
4
- declare const QUOTE_INDENT_PT = 36;
5
- declare const MONOSPACE_FONT_FAMILY = "Courier New";
6
- declare const DEFINITION_BODY_INDENT_PT = 36;
7
- //#endregion
1
+ import { a as QUOTE_STYLE_ID, i as QUOTE_INDENT_PT, n as HORIZONTAL_RULE_STYLE_ID, r as MONOSPACE_FONT_FAMILY, t as DEFINITION_BODY_INDENT_PT } from "../style-constants-RVoHdmju.js";
8
2
  export { DEFINITION_BODY_INDENT_PT, HORIZONTAL_RULE_STYLE_ID, MONOSPACE_FONT_FAMILY, QUOTE_INDENT_PT, QUOTE_STYLE_ID };
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_util_base64 = require("../util/base64.cjs");
2
3
  const require_diagnostics = require("../diagnostics.cjs");
3
4
  const require_xml_entities = require("../xml/entities.cjs");
4
- const require_util_base64 = require("../util/base64.cjs");
5
5
  require("./style-constants.cjs");
6
6
  const require_xhtml_list_id = require("./list-id.cjs");
7
7
  let document_schema_js = require("document-schema.js");
@@ -93,6 +93,7 @@ function writeSectionConstructGroup(group, context) {
93
93
  "epub:type": "footnote",
94
94
  id: descriptor.name
95
95
  }, writeSectionChildren(group.children, context))];
96
+ if (descriptor.kind === "anchor" && descriptor.anchorType === "bookmark") return writeBookmarkConstructGroup(descriptor.name, group, context);
96
97
  context.sink({
97
98
  code: require_diagnostics.EpubDiagnosticCodes.CONSTRUCT_UNREPRESENTED,
98
99
  severity: "info",
@@ -101,6 +102,24 @@ function writeSectionConstructGroup(group, context) {
101
102
  });
102
103
  return writeSectionChildren(group.children, context);
103
104
  }
105
+ function writeBookmarkConstructGroup(name, group, context) {
106
+ const written = writeSectionChildren(group.children, context);
107
+ const [only] = written;
108
+ if (written.length === 1 && only?.type === "element") return [{
109
+ ...only,
110
+ attributes: [...only.attributes.filter((attribute) => attribute.name !== "id"), {
111
+ name: "id",
112
+ value: name
113
+ }]
114
+ }];
115
+ context.sink({
116
+ code: require_diagnostics.EpubDiagnosticCodes.CONSTRUCT_UNREPRESENTED,
117
+ severity: "info",
118
+ message: `a bookmark target ('${name}') wraps more than one written element (or none); this package's writer only restores an id attribute onto a single wrapped element, so the target's own addressability is dropped`,
119
+ href: context.sourceHref
120
+ });
121
+ return written;
122
+ }
104
123
  function writeLeafBlock(block, context) {
105
124
  switch (block.kind) {
106
125
  case "paragraph": return [writeParagraph(block, context)];
@@ -139,12 +158,19 @@ function writeParagraphAsEmbeddedNodes(paragraph, context, wrapOrdinaryInParagra
139
158
  const runNodes = writeRunsToNodes(paragraph.runs, paragraph.constructs, context);
140
159
  return wrapOrdinaryInParagraph ? [element("p", {}, runNodes)] : runNodes;
141
160
  }
142
- function isFootnoteExtent(construct) {
143
- return construct.descriptor.kind === "anchor" && construct.descriptor.anchorType === "footnote";
161
+ function isReferenceExtent(construct) {
162
+ return construct.descriptor.kind === "anchor" && construct.descriptor.anchorType === "footnote" || construct.descriptor.kind === "link" && construct.descriptor.target.kind === "internal";
163
+ }
164
+ function referenceExtentAttrs(descriptor, context) {
165
+ if (descriptor.kind === "anchor") return {
166
+ "epub:type": "noteref",
167
+ href: context.resolveAnchorHref(descriptor.name)
168
+ };
169
+ return { href: context.resolveAnchorHref(descriptor.target.anchor) };
144
170
  }
145
171
  function reportUnhandledAnchorExtents(constructs, context) {
146
172
  for (const construct of constructs ?? []) {
147
- if (construct.descriptor.kind !== "anchor" || construct.descriptor.anchorType === "footnote") continue;
173
+ if (isReferenceExtent(construct) || construct.descriptor.kind !== "anchor") continue;
148
174
  context.sink({
149
175
  code: require_diagnostics.EpubDiagnosticCodes.CONSTRUCT_UNREPRESENTED,
150
176
  severity: "info",
@@ -153,33 +179,32 @@ function reportUnhandledAnchorExtents(constructs, context) {
153
179
  });
154
180
  }
155
181
  }
156
- function describeUnrepresentedFootnoteExtent(extent) {
157
- if (extent.endRun === extent.startRun) return `a footnote reference ('${extent.descriptor.name}') marking the boundary before run ${extent.startRun} is never reached by the write walk -- either because it sits inside another footnote reference's own winning run range, or because its own run range falls outside this paragraph's actual runs; a point anchor wraps no run text of its own, so nothing besides this reference's own <a> link is missing from the output`;
158
- return `a footnote reference ('${extent.descriptor.name}') is never reached by the write walk and cannot be represented as its own <a> element -- either because it overlaps another footnote reference's own winning run range, or because its own run range falls outside this paragraph's actual runs; wherever an overlap is the cause, the run text underneath it is not lost, since it is still written, wrapped by whichever extent's range actually claims it, or written unwrapped past it, but this reference's own anchor link is not emitted regardless of cause`;
182
+ function referenceExtentName(descriptor) {
183
+ return descriptor.kind === "anchor" ? descriptor.name : descriptor.target.anchor;
184
+ }
185
+ function describeUnrepresentedReferenceExtent(extent) {
186
+ const kind = extent.descriptor.kind === "anchor" ? "footnote reference" : "internal link";
187
+ const name = referenceExtentName(extent.descriptor);
188
+ if (extent.endRun === extent.startRun) return `a ${kind} ('${name}') marking the boundary before run ${extent.startRun} is never reached by the write walk -- either because it sits inside another reference's own winning run range, or because its own run range falls outside this paragraph's actual runs; a point anchor wraps no run text of its own, so nothing besides this reference's own <a> link is missing from the output`;
189
+ return `a ${kind} ('${name}') is never reached by the write walk and cannot be represented as its own <a> element -- either because it overlaps another reference's own winning run range, or because its own run range falls outside this paragraph's actual runs; wherever an overlap is the cause, the run text underneath it is not lost, since it is still written, wrapped by whichever extent's range actually claims it, or written unwrapped past it, but this reference's own anchor link is not emitted regardless of cause`;
159
190
  }
160
191
  function writeRunRangeNodes(runs, constructs, renderRun, renderExtentRange, context) {
161
192
  reportUnhandledAnchorExtents(constructs, context);
162
- const footnoteExtents = (constructs ?? []).filter(isFootnoteExtent);
193
+ const referenceExtents = (constructs ?? []).filter(isReferenceExtent);
163
194
  const emittedExtents = /* @__PURE__ */ new Set();
164
195
  const out = [];
165
196
  let index = 0;
166
197
  while (index <= runs.length) {
167
- const extentsHere = footnoteExtents.filter((e) => e.startRun === index);
198
+ const extentsHere = referenceExtents.filter((e) => e.startRun === index);
168
199
  for (const point of extentsHere.filter((e) => e.endRun === e.startRun)) {
169
200
  emittedExtents.add(point);
170
- out.push(element("a", {
171
- "epub:type": "noteref",
172
- href: `#${point.descriptor.name}`
173
- }, renderExtentRange([])));
201
+ out.push(element("a", referenceExtentAttrs(point.descriptor, context), renderExtentRange([])));
174
202
  }
175
203
  const [primaryRange] = index < runs.length ? extentsHere.filter((e) => e.endRun > e.startRun) : [];
176
204
  if (primaryRange !== void 0) {
177
205
  emittedExtents.add(primaryRange);
178
206
  const rangeRuns = runs.slice(primaryRange.startRun, primaryRange.endRun);
179
- out.push(element("a", {
180
- "epub:type": "noteref",
181
- href: `#${primaryRange.descriptor.name}`
182
- }, renderExtentRange(rangeRuns)));
207
+ out.push(element("a", referenceExtentAttrs(primaryRange.descriptor, context), renderExtentRange(rangeRuns)));
183
208
  index = primaryRange.endRun;
184
209
  continue;
185
210
  }
@@ -187,12 +212,12 @@ function writeRunRangeNodes(runs, constructs, renderRun, renderExtentRange, cont
187
212
  if (run !== void 0) out.push(...renderRun(run));
188
213
  index += 1;
189
214
  }
190
- for (const extent of footnoteExtents) {
215
+ for (const extent of referenceExtents) {
191
216
  if (emittedExtents.has(extent)) continue;
192
217
  context.sink({
193
218
  code: require_diagnostics.EpubDiagnosticCodes.CONSTRUCT_UNREPRESENTED,
194
219
  severity: "info",
195
- message: describeUnrepresentedFootnoteExtent(extent),
220
+ message: describeUnrepresentedReferenceExtent(extent),
196
221
  href: context.sourceHref
197
222
  });
198
223
  }
@@ -1,12 +1,2 @@
1
- import { i as EpubDiagnosticSink } from "../diagnostics-C0CRdoda.cjs";
2
- import { XmlElement } from "../xml/node.cjs";
3
- import { ContentBlock, ContentImageBlock } from "document-schema.js";
4
- //#region src/xhtml/write.d.ts
5
- interface XhtmlWriteContext {
6
- readonly registerImage: (bytes: Uint8Array<ArrayBuffer>, format: ContentImageBlock["format"]) => string;
7
- readonly sink: EpubDiagnosticSink;
8
- readonly sourceHref: string;
9
- }
10
- declare function writeXhtmlBody(blocks: readonly ContentBlock[], context: XhtmlWriteContext): XmlElement;
11
- //#endregion
1
+ import { n as writeXhtmlBody, t as XhtmlWriteContext } from "../write-WSIgARHT.cjs";
12
2
  export { XhtmlWriteContext, writeXhtmlBody };
@@ -1,12 +1,2 @@
1
- import { i as EpubDiagnosticSink } from "../diagnostics-C0CRdoda.js";
2
- import { XmlElement } from "../xml/node.js";
3
- import { ContentBlock, ContentImageBlock } from "document-schema.js";
4
- //#region src/xhtml/write.d.ts
5
- interface XhtmlWriteContext {
6
- readonly registerImage: (bytes: Uint8Array<ArrayBuffer>, format: ContentImageBlock["format"]) => string;
7
- readonly sink: EpubDiagnosticSink;
8
- readonly sourceHref: string;
9
- }
10
- declare function writeXhtmlBody(blocks: readonly ContentBlock[], context: XhtmlWriteContext): XmlElement;
11
- //#endregion
1
+ import { n as writeXhtmlBody, t as XhtmlWriteContext } from "../write-Klo0WDhT.js";
12
2
  export { XhtmlWriteContext, writeXhtmlBody };
@@ -1,6 +1,6 @@
1
+ import { base64ToBytes } from "../util/base64.js";
1
2
  import { EpubDiagnosticCodes } from "../diagnostics.js";
2
3
  import { encodeEntities } from "../xml/entities.js";
3
- import { base64ToBytes } from "../util/base64.js";
4
4
  import "./style-constants.js";
5
5
  import { parseListNumId } from "./list-id.js";
6
6
  import { isHeadingGroupNode, isListGroupNode, isSectionConstructGroupNode, isTreeBlockLeaf } from "document-schema.js";
@@ -92,6 +92,7 @@ function writeSectionConstructGroup(group, context) {
92
92
  "epub:type": "footnote",
93
93
  id: descriptor.name
94
94
  }, writeSectionChildren(group.children, context))];
95
+ if (descriptor.kind === "anchor" && descriptor.anchorType === "bookmark") return writeBookmarkConstructGroup(descriptor.name, group, context);
95
96
  context.sink({
96
97
  code: EpubDiagnosticCodes.CONSTRUCT_UNREPRESENTED,
97
98
  severity: "info",
@@ -100,6 +101,24 @@ function writeSectionConstructGroup(group, context) {
100
101
  });
101
102
  return writeSectionChildren(group.children, context);
102
103
  }
104
+ function writeBookmarkConstructGroup(name, group, context) {
105
+ const written = writeSectionChildren(group.children, context);
106
+ const [only] = written;
107
+ if (written.length === 1 && only?.type === "element") return [{
108
+ ...only,
109
+ attributes: [...only.attributes.filter((attribute) => attribute.name !== "id"), {
110
+ name: "id",
111
+ value: name
112
+ }]
113
+ }];
114
+ context.sink({
115
+ code: EpubDiagnosticCodes.CONSTRUCT_UNREPRESENTED,
116
+ severity: "info",
117
+ message: `a bookmark target ('${name}') wraps more than one written element (or none); this package's writer only restores an id attribute onto a single wrapped element, so the target's own addressability is dropped`,
118
+ href: context.sourceHref
119
+ });
120
+ return written;
121
+ }
103
122
  function writeLeafBlock(block, context) {
104
123
  switch (block.kind) {
105
124
  case "paragraph": return [writeParagraph(block, context)];
@@ -138,12 +157,19 @@ function writeParagraphAsEmbeddedNodes(paragraph, context, wrapOrdinaryInParagra
138
157
  const runNodes = writeRunsToNodes(paragraph.runs, paragraph.constructs, context);
139
158
  return wrapOrdinaryInParagraph ? [element("p", {}, runNodes)] : runNodes;
140
159
  }
141
- function isFootnoteExtent(construct) {
142
- return construct.descriptor.kind === "anchor" && construct.descriptor.anchorType === "footnote";
160
+ function isReferenceExtent(construct) {
161
+ return construct.descriptor.kind === "anchor" && construct.descriptor.anchorType === "footnote" || construct.descriptor.kind === "link" && construct.descriptor.target.kind === "internal";
162
+ }
163
+ function referenceExtentAttrs(descriptor, context) {
164
+ if (descriptor.kind === "anchor") return {
165
+ "epub:type": "noteref",
166
+ href: context.resolveAnchorHref(descriptor.name)
167
+ };
168
+ return { href: context.resolveAnchorHref(descriptor.target.anchor) };
143
169
  }
144
170
  function reportUnhandledAnchorExtents(constructs, context) {
145
171
  for (const construct of constructs ?? []) {
146
- if (construct.descriptor.kind !== "anchor" || construct.descriptor.anchorType === "footnote") continue;
172
+ if (isReferenceExtent(construct) || construct.descriptor.kind !== "anchor") continue;
147
173
  context.sink({
148
174
  code: EpubDiagnosticCodes.CONSTRUCT_UNREPRESENTED,
149
175
  severity: "info",
@@ -152,33 +178,32 @@ function reportUnhandledAnchorExtents(constructs, context) {
152
178
  });
153
179
  }
154
180
  }
155
- function describeUnrepresentedFootnoteExtent(extent) {
156
- if (extent.endRun === extent.startRun) return `a footnote reference ('${extent.descriptor.name}') marking the boundary before run ${extent.startRun} is never reached by the write walk -- either because it sits inside another footnote reference's own winning run range, or because its own run range falls outside this paragraph's actual runs; a point anchor wraps no run text of its own, so nothing besides this reference's own <a> link is missing from the output`;
157
- return `a footnote reference ('${extent.descriptor.name}') is never reached by the write walk and cannot be represented as its own <a> element -- either because it overlaps another footnote reference's own winning run range, or because its own run range falls outside this paragraph's actual runs; wherever an overlap is the cause, the run text underneath it is not lost, since it is still written, wrapped by whichever extent's range actually claims it, or written unwrapped past it, but this reference's own anchor link is not emitted regardless of cause`;
181
+ function referenceExtentName(descriptor) {
182
+ return descriptor.kind === "anchor" ? descriptor.name : descriptor.target.anchor;
183
+ }
184
+ function describeUnrepresentedReferenceExtent(extent) {
185
+ const kind = extent.descriptor.kind === "anchor" ? "footnote reference" : "internal link";
186
+ const name = referenceExtentName(extent.descriptor);
187
+ if (extent.endRun === extent.startRun) return `a ${kind} ('${name}') marking the boundary before run ${extent.startRun} is never reached by the write walk -- either because it sits inside another reference's own winning run range, or because its own run range falls outside this paragraph's actual runs; a point anchor wraps no run text of its own, so nothing besides this reference's own <a> link is missing from the output`;
188
+ return `a ${kind} ('${name}') is never reached by the write walk and cannot be represented as its own <a> element -- either because it overlaps another reference's own winning run range, or because its own run range falls outside this paragraph's actual runs; wherever an overlap is the cause, the run text underneath it is not lost, since it is still written, wrapped by whichever extent's range actually claims it, or written unwrapped past it, but this reference's own anchor link is not emitted regardless of cause`;
158
189
  }
159
190
  function writeRunRangeNodes(runs, constructs, renderRun, renderExtentRange, context) {
160
191
  reportUnhandledAnchorExtents(constructs, context);
161
- const footnoteExtents = (constructs ?? []).filter(isFootnoteExtent);
192
+ const referenceExtents = (constructs ?? []).filter(isReferenceExtent);
162
193
  const emittedExtents = /* @__PURE__ */ new Set();
163
194
  const out = [];
164
195
  let index = 0;
165
196
  while (index <= runs.length) {
166
- const extentsHere = footnoteExtents.filter((e) => e.startRun === index);
197
+ const extentsHere = referenceExtents.filter((e) => e.startRun === index);
167
198
  for (const point of extentsHere.filter((e) => e.endRun === e.startRun)) {
168
199
  emittedExtents.add(point);
169
- out.push(element("a", {
170
- "epub:type": "noteref",
171
- href: `#${point.descriptor.name}`
172
- }, renderExtentRange([])));
200
+ out.push(element("a", referenceExtentAttrs(point.descriptor, context), renderExtentRange([])));
173
201
  }
174
202
  const [primaryRange] = index < runs.length ? extentsHere.filter((e) => e.endRun > e.startRun) : [];
175
203
  if (primaryRange !== void 0) {
176
204
  emittedExtents.add(primaryRange);
177
205
  const rangeRuns = runs.slice(primaryRange.startRun, primaryRange.endRun);
178
- out.push(element("a", {
179
- "epub:type": "noteref",
180
- href: `#${primaryRange.descriptor.name}`
181
- }, renderExtentRange(rangeRuns)));
206
+ out.push(element("a", referenceExtentAttrs(primaryRange.descriptor, context), renderExtentRange(rangeRuns)));
182
207
  index = primaryRange.endRun;
183
208
  continue;
184
209
  }
@@ -186,12 +211,12 @@ function writeRunRangeNodes(runs, constructs, renderRun, renderExtentRange, cont
186
211
  if (run !== void 0) out.push(...renderRun(run));
187
212
  index += 1;
188
213
  }
189
- for (const extent of footnoteExtents) {
214
+ for (const extent of referenceExtents) {
190
215
  if (emittedExtents.has(extent)) continue;
191
216
  context.sink({
192
217
  code: EpubDiagnosticCodes.CONSTRUCT_UNREPRESENTED,
193
218
  severity: "info",
194
- message: describeUnrepresentedFootnoteExtent(extent),
219
+ message: describeUnrepresentedReferenceExtent(extent),
195
220
  href: context.sourceHref
196
221
  });
197
222
  }
@@ -1,5 +1,2 @@
1
- import { XmlNode } from "./node.cjs";
2
- //#region src/xml/build.d.ts
3
- declare function buildXml(nodes: XmlNode[]): string;
4
- //#endregion
1
+ import { t as buildXml } from "../build-B1UxbO20.cjs";
5
2
  export { buildXml };
@@ -1,5 +1,2 @@
1
- import { XmlNode } from "./node.js";
2
- //#region src/xml/build.d.ts
3
- declare function buildXml(nodes: XmlNode[]): string;
4
- //#endregion
1
+ import { t as buildXml } from "../build-BCUsHLYw.js";
5
2
  export { buildXml };