@docmentis/udoc-viewer 0.7.20 → 0.8.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 (386) hide show
  1. package/API-COMPARISON.md +441 -0
  2. package/LICENSE-APACHE +202 -0
  3. package/LICENSE-MIT +21 -0
  4. package/README.md +23 -1220
  5. package/dist/index.d.ts +40 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +52 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/version.d.ts +2 -0
  10. package/dist/version.d.ts.map +1 -0
  11. package/dist/version.js +7 -0
  12. package/dist/version.js.map +1 -0
  13. package/dist/worker/worker-source.d.ts +3 -0
  14. package/dist/worker/worker-source.d.ts.map +1 -0
  15. package/dist/worker/worker-source.js +11 -0
  16. package/dist/worker/worker.d.ts +2 -0
  17. package/dist/worker/worker.d.ts.map +1 -0
  18. package/dist/worker/worker.js +5 -0
  19. package/dist/worker/worker.js.map +1 -0
  20. package/package.json +48 -59
  21. package/dist/package.json +0 -79
  22. package/dist/src/UDocClient.d.ts +0 -730
  23. package/dist/src/UDocClient.d.ts.map +0 -1
  24. package/dist/src/UDocClient.js +0 -649
  25. package/dist/src/UDocClient.js.map +0 -1
  26. package/dist/src/UDocViewer.d.ts +0 -883
  27. package/dist/src/UDocViewer.d.ts.map +0 -1
  28. package/dist/src/UDocViewer.js +0 -2180
  29. package/dist/src/UDocViewer.js.map +0 -1
  30. package/dist/src/fonts.d.ts +0 -47
  31. package/dist/src/fonts.d.ts.map +0 -1
  32. package/dist/src/fonts.js +0 -49
  33. package/dist/src/fonts.js.map +0 -1
  34. package/dist/src/index.d.ts +0 -13
  35. package/dist/src/index.d.ts.map +0 -1
  36. package/dist/src/index.js +0 -5
  37. package/dist/src/index.js.map +0 -1
  38. package/dist/src/meta-url.d.ts +0 -2
  39. package/dist/src/meta-url.d.ts.map +0 -1
  40. package/dist/src/meta-url.js +0 -10
  41. package/dist/src/meta-url.js.map +0 -1
  42. package/dist/src/performance/PerformanceCounter.d.ts +0 -132
  43. package/dist/src/performance/PerformanceCounter.d.ts.map +0 -1
  44. package/dist/src/performance/PerformanceCounter.js +0 -129
  45. package/dist/src/performance/PerformanceCounter.js.map +0 -1
  46. package/dist/src/performance/index.d.ts +0 -2
  47. package/dist/src/performance/index.d.ts.map +0 -1
  48. package/dist/src/performance/index.js +0 -2
  49. package/dist/src/performance/index.js.map +0 -1
  50. package/dist/src/ui/framework/component.d.ts +0 -68
  51. package/dist/src/ui/framework/component.d.ts.map +0 -1
  52. package/dist/src/ui/framework/component.js +0 -97
  53. package/dist/src/ui/framework/component.js.map +0 -1
  54. package/dist/src/ui/framework/dom.d.ts +0 -19
  55. package/dist/src/ui/framework/dom.d.ts.map +0 -1
  56. package/dist/src/ui/framework/dom.js +0 -29
  57. package/dist/src/ui/framework/dom.js.map +0 -1
  58. package/dist/src/ui/framework/events.d.ts +0 -18
  59. package/dist/src/ui/framework/events.d.ts.map +0 -1
  60. package/dist/src/ui/framework/events.js +0 -23
  61. package/dist/src/ui/framework/events.js.map +0 -1
  62. package/dist/src/ui/framework/index.d.ts +0 -15
  63. package/dist/src/ui/framework/index.d.ts.map +0 -1
  64. package/dist/src/ui/framework/index.js +0 -15
  65. package/dist/src/ui/framework/index.js.map +0 -1
  66. package/dist/src/ui/framework/selectors.d.ts +0 -51
  67. package/dist/src/ui/framework/selectors.d.ts.map +0 -1
  68. package/dist/src/ui/framework/selectors.js +0 -28
  69. package/dist/src/ui/framework/selectors.js.map +0 -1
  70. package/dist/src/ui/framework/store.d.ts +0 -44
  71. package/dist/src/ui/framework/store.d.ts.map +0 -1
  72. package/dist/src/ui/framework/store.js +0 -79
  73. package/dist/src/ui/framework/store.js.map +0 -1
  74. package/dist/src/ui/viewer/a11y.d.ts +0 -26
  75. package/dist/src/ui/viewer/a11y.d.ts.map +0 -1
  76. package/dist/src/ui/viewer/a11y.js +0 -116
  77. package/dist/src/ui/viewer/a11y.js.map +0 -1
  78. package/dist/src/ui/viewer/actions.d.ts +0 -308
  79. package/dist/src/ui/viewer/actions.d.ts.map +0 -1
  80. package/dist/src/ui/viewer/actions.js +0 -2
  81. package/dist/src/ui/viewer/actions.js.map +0 -1
  82. package/dist/src/ui/viewer/animation-presets.d.ts +0 -37
  83. package/dist/src/ui/viewer/animation-presets.d.ts.map +0 -1
  84. package/dist/src/ui/viewer/animation-presets.js +0 -123
  85. package/dist/src/ui/viewer/animation-presets.js.map +0 -1
  86. package/dist/src/ui/viewer/animation.d.ts +0 -162
  87. package/dist/src/ui/viewer/animation.d.ts.map +0 -1
  88. package/dist/src/ui/viewer/animation.js +0 -506
  89. package/dist/src/ui/viewer/animation.js.map +0 -1
  90. package/dist/src/ui/viewer/annotation/LinkRenderer.d.ts +0 -9
  91. package/dist/src/ui/viewer/annotation/LinkRenderer.d.ts.map +0 -1
  92. package/dist/src/ui/viewer/annotation/LinkRenderer.js +0 -17
  93. package/dist/src/ui/viewer/annotation/LinkRenderer.js.map +0 -1
  94. package/dist/src/ui/viewer/annotation/MarkupRenderer.d.ts +0 -21
  95. package/dist/src/ui/viewer/annotation/MarkupRenderer.d.ts.map +0 -1
  96. package/dist/src/ui/viewer/annotation/MarkupRenderer.js +0 -136
  97. package/dist/src/ui/viewer/annotation/MarkupRenderer.js.map +0 -1
  98. package/dist/src/ui/viewer/annotation/ShapeRenderer.d.ts +0 -33
  99. package/dist/src/ui/viewer/annotation/ShapeRenderer.d.ts.map +0 -1
  100. package/dist/src/ui/viewer/annotation/ShapeRenderer.js +0 -379
  101. package/dist/src/ui/viewer/annotation/ShapeRenderer.js.map +0 -1
  102. package/dist/src/ui/viewer/annotation/TextRenderer.d.ts +0 -23
  103. package/dist/src/ui/viewer/annotation/TextRenderer.d.ts.map +0 -1
  104. package/dist/src/ui/viewer/annotation/TextRenderer.js +0 -196
  105. package/dist/src/ui/viewer/annotation/TextRenderer.js.map +0 -1
  106. package/dist/src/ui/viewer/annotation/index.d.ts +0 -9
  107. package/dist/src/ui/viewer/annotation/index.d.ts.map +0 -1
  108. package/dist/src/ui/viewer/annotation/index.js +0 -10
  109. package/dist/src/ui/viewer/annotation/index.js.map +0 -1
  110. package/dist/src/ui/viewer/annotation/propertyUtils.d.ts +0 -29
  111. package/dist/src/ui/viewer/annotation/propertyUtils.d.ts.map +0 -1
  112. package/dist/src/ui/viewer/annotation/propertyUtils.js +0 -151
  113. package/dist/src/ui/viewer/annotation/propertyUtils.js.map +0 -1
  114. package/dist/src/ui/viewer/annotation/render.d.ts +0 -24
  115. package/dist/src/ui/viewer/annotation/render.d.ts.map +0 -1
  116. package/dist/src/ui/viewer/annotation/render.js +0 -191
  117. package/dist/src/ui/viewer/annotation/render.js.map +0 -1
  118. package/dist/src/ui/viewer/annotation/types.d.ts +0 -309
  119. package/dist/src/ui/viewer/annotation/types.d.ts.map +0 -1
  120. package/dist/src/ui/viewer/annotation/types.js +0 -7
  121. package/dist/src/ui/viewer/annotation/types.js.map +0 -1
  122. package/dist/src/ui/viewer/annotation/utils.d.ts +0 -75
  123. package/dist/src/ui/viewer/annotation/utils.d.ts.map +0 -1
  124. package/dist/src/ui/viewer/annotation/utils.js +0 -250
  125. package/dist/src/ui/viewer/annotation/utils.js.map +0 -1
  126. package/dist/src/ui/viewer/components/AnnotationPanel.d.ts +0 -20
  127. package/dist/src/ui/viewer/components/AnnotationPanel.d.ts.map +0 -1
  128. package/dist/src/ui/viewer/components/AnnotationPanel.js +0 -276
  129. package/dist/src/ui/viewer/components/AnnotationPanel.js.map +0 -1
  130. package/dist/src/ui/viewer/components/AttachmentsPanel.d.ts +0 -8
  131. package/dist/src/ui/viewer/components/AttachmentsPanel.d.ts.map +0 -1
  132. package/dist/src/ui/viewer/components/AttachmentsPanel.js +0 -16
  133. package/dist/src/ui/viewer/components/AttachmentsPanel.js.map +0 -1
  134. package/dist/src/ui/viewer/components/BookmarksPanel.d.ts +0 -8
  135. package/dist/src/ui/viewer/components/BookmarksPanel.d.ts.map +0 -1
  136. package/dist/src/ui/viewer/components/BookmarksPanel.js +0 -16
  137. package/dist/src/ui/viewer/components/BookmarksPanel.js.map +0 -1
  138. package/dist/src/ui/viewer/components/Branding.d.ts +0 -49
  139. package/dist/src/ui/viewer/components/Branding.d.ts.map +0 -1
  140. package/dist/src/ui/viewer/components/Branding.js +0 -334
  141. package/dist/src/ui/viewer/components/Branding.js.map +0 -1
  142. package/dist/src/ui/viewer/components/ColorSelect.d.ts +0 -26
  143. package/dist/src/ui/viewer/components/ColorSelect.d.ts.map +0 -1
  144. package/dist/src/ui/viewer/components/ColorSelect.js +0 -120
  145. package/dist/src/ui/viewer/components/ColorSelect.js.map +0 -1
  146. package/dist/src/ui/viewer/components/FloatingToolbar.d.ts +0 -10
  147. package/dist/src/ui/viewer/components/FloatingToolbar.d.ts.map +0 -1
  148. package/dist/src/ui/viewer/components/FloatingToolbar.js +0 -396
  149. package/dist/src/ui/viewer/components/FloatingToolbar.js.map +0 -1
  150. package/dist/src/ui/viewer/components/FontsPanel.d.ts +0 -12
  151. package/dist/src/ui/viewer/components/FontsPanel.d.ts.map +0 -1
  152. package/dist/src/ui/viewer/components/FontsPanel.js +0 -141
  153. package/dist/src/ui/viewer/components/FontsPanel.js.map +0 -1
  154. package/dist/src/ui/viewer/components/LayersPanel.d.ts +0 -12
  155. package/dist/src/ui/viewer/components/LayersPanel.d.ts.map +0 -1
  156. package/dist/src/ui/viewer/components/LayersPanel.js +0 -139
  157. package/dist/src/ui/viewer/components/LayersPanel.js.map +0 -1
  158. package/dist/src/ui/viewer/components/LeftPanel.d.ts +0 -11
  159. package/dist/src/ui/viewer/components/LeftPanel.d.ts.map +0 -1
  160. package/dist/src/ui/viewer/components/LeftPanel.js +0 -296
  161. package/dist/src/ui/viewer/components/LeftPanel.js.map +0 -1
  162. package/dist/src/ui/viewer/components/LoadingOverlay.d.ts +0 -13
  163. package/dist/src/ui/viewer/components/LoadingOverlay.d.ts.map +0 -1
  164. package/dist/src/ui/viewer/components/LoadingOverlay.js +0 -146
  165. package/dist/src/ui/viewer/components/LoadingOverlay.js.map +0 -1
  166. package/dist/src/ui/viewer/components/NumberInput.d.ts +0 -32
  167. package/dist/src/ui/viewer/components/NumberInput.d.ts.map +0 -1
  168. package/dist/src/ui/viewer/components/NumberInput.js +0 -101
  169. package/dist/src/ui/viewer/components/NumberInput.js.map +0 -1
  170. package/dist/src/ui/viewer/components/OutlinePanel.d.ts +0 -11
  171. package/dist/src/ui/viewer/components/OutlinePanel.d.ts.map +0 -1
  172. package/dist/src/ui/viewer/components/OutlinePanel.js +0 -307
  173. package/dist/src/ui/viewer/components/OutlinePanel.js.map +0 -1
  174. package/dist/src/ui/viewer/components/PasswordDialog.d.ts +0 -16
  175. package/dist/src/ui/viewer/components/PasswordDialog.d.ts.map +0 -1
  176. package/dist/src/ui/viewer/components/PasswordDialog.js +0 -179
  177. package/dist/src/ui/viewer/components/PasswordDialog.js.map +0 -1
  178. package/dist/src/ui/viewer/components/PermitNoticeOverlay.d.ts +0 -27
  179. package/dist/src/ui/viewer/components/PermitNoticeOverlay.d.ts.map +0 -1
  180. package/dist/src/ui/viewer/components/PermitNoticeOverlay.js +0 -79
  181. package/dist/src/ui/viewer/components/PermitNoticeOverlay.js.map +0 -1
  182. package/dist/src/ui/viewer/components/PrintDialog.d.ts +0 -34
  183. package/dist/src/ui/viewer/components/PrintDialog.d.ts.map +0 -1
  184. package/dist/src/ui/viewer/components/PrintDialog.js +0 -317
  185. package/dist/src/ui/viewer/components/PrintDialog.js.map +0 -1
  186. package/dist/src/ui/viewer/components/RightPanel.d.ts +0 -10
  187. package/dist/src/ui/viewer/components/RightPanel.d.ts.map +0 -1
  188. package/dist/src/ui/viewer/components/RightPanel.js +0 -154
  189. package/dist/src/ui/viewer/components/RightPanel.js.map +0 -1
  190. package/dist/src/ui/viewer/components/SearchPanel.d.ts +0 -21
  191. package/dist/src/ui/viewer/components/SearchPanel.d.ts.map +0 -1
  192. package/dist/src/ui/viewer/components/SearchPanel.js +0 -323
  193. package/dist/src/ui/viewer/components/SearchPanel.js.map +0 -1
  194. package/dist/src/ui/viewer/components/SheetTabBar.d.ts +0 -9
  195. package/dist/src/ui/viewer/components/SheetTabBar.d.ts.map +0 -1
  196. package/dist/src/ui/viewer/components/SheetTabBar.js +0 -57
  197. package/dist/src/ui/viewer/components/SheetTabBar.js.map +0 -1
  198. package/dist/src/ui/viewer/components/Spread.d.ts +0 -85
  199. package/dist/src/ui/viewer/components/Spread.d.ts.map +0 -1
  200. package/dist/src/ui/viewer/components/Spread.js +0 -749
  201. package/dist/src/ui/viewer/components/Spread.js.map +0 -1
  202. package/dist/src/ui/viewer/components/SubToolbar.d.ts +0 -11
  203. package/dist/src/ui/viewer/components/SubToolbar.d.ts.map +0 -1
  204. package/dist/src/ui/viewer/components/SubToolbar.js +0 -722
  205. package/dist/src/ui/viewer/components/SubToolbar.js.map +0 -1
  206. package/dist/src/ui/viewer/components/ThumbnailPanel.d.ts +0 -12
  207. package/dist/src/ui/viewer/components/ThumbnailPanel.d.ts.map +0 -1
  208. package/dist/src/ui/viewer/components/ThumbnailPanel.js +0 -290
  209. package/dist/src/ui/viewer/components/ThumbnailPanel.js.map +0 -1
  210. package/dist/src/ui/viewer/components/Toolbar.d.ts +0 -12
  211. package/dist/src/ui/viewer/components/Toolbar.d.ts.map +0 -1
  212. package/dist/src/ui/viewer/components/Toolbar.js +0 -761
  213. package/dist/src/ui/viewer/components/Toolbar.js.map +0 -1
  214. package/dist/src/ui/viewer/components/ViewModeMenu.d.ts +0 -10
  215. package/dist/src/ui/viewer/components/ViewModeMenu.d.ts.map +0 -1
  216. package/dist/src/ui/viewer/components/ViewModeMenu.js +0 -206
  217. package/dist/src/ui/viewer/components/ViewModeMenu.js.map +0 -1
  218. package/dist/src/ui/viewer/components/Viewport.d.ts +0 -28
  219. package/dist/src/ui/viewer/components/Viewport.d.ts.map +0 -1
  220. package/dist/src/ui/viewer/components/Viewport.js +0 -1721
  221. package/dist/src/ui/viewer/components/Viewport.js.map +0 -1
  222. package/dist/src/ui/viewer/effects.d.ts +0 -8
  223. package/dist/src/ui/viewer/effects.d.ts.map +0 -1
  224. package/dist/src/ui/viewer/effects.js +0 -452
  225. package/dist/src/ui/viewer/effects.js.map +0 -1
  226. package/dist/src/ui/viewer/i18n/ar.d.ts +0 -3
  227. package/dist/src/ui/viewer/i18n/ar.d.ts.map +0 -1
  228. package/dist/src/ui/viewer/i18n/ar.js +0 -198
  229. package/dist/src/ui/viewer/i18n/ar.js.map +0 -1
  230. package/dist/src/ui/viewer/i18n/de.d.ts +0 -3
  231. package/dist/src/ui/viewer/i18n/de.d.ts.map +0 -1
  232. package/dist/src/ui/viewer/i18n/de.js +0 -198
  233. package/dist/src/ui/viewer/i18n/de.js.map +0 -1
  234. package/dist/src/ui/viewer/i18n/en.d.ts +0 -3
  235. package/dist/src/ui/viewer/i18n/en.d.ts.map +0 -1
  236. package/dist/src/ui/viewer/i18n/en.js +0 -200
  237. package/dist/src/ui/viewer/i18n/en.js.map +0 -1
  238. package/dist/src/ui/viewer/i18n/es.d.ts +0 -3
  239. package/dist/src/ui/viewer/i18n/es.d.ts.map +0 -1
  240. package/dist/src/ui/viewer/i18n/es.js +0 -198
  241. package/dist/src/ui/viewer/i18n/es.js.map +0 -1
  242. package/dist/src/ui/viewer/i18n/fr.d.ts +0 -3
  243. package/dist/src/ui/viewer/i18n/fr.d.ts.map +0 -1
  244. package/dist/src/ui/viewer/i18n/fr.js +0 -198
  245. package/dist/src/ui/viewer/i18n/fr.js.map +0 -1
  246. package/dist/src/ui/viewer/i18n/index.d.ts +0 -27
  247. package/dist/src/ui/viewer/i18n/index.d.ts.map +0 -1
  248. package/dist/src/ui/viewer/i18n/index.js +0 -88
  249. package/dist/src/ui/viewer/i18n/index.js.map +0 -1
  250. package/dist/src/ui/viewer/i18n/ja.d.ts +0 -3
  251. package/dist/src/ui/viewer/i18n/ja.d.ts.map +0 -1
  252. package/dist/src/ui/viewer/i18n/ja.js +0 -198
  253. package/dist/src/ui/viewer/i18n/ja.js.map +0 -1
  254. package/dist/src/ui/viewer/i18n/ko.d.ts +0 -3
  255. package/dist/src/ui/viewer/i18n/ko.d.ts.map +0 -1
  256. package/dist/src/ui/viewer/i18n/ko.js +0 -198
  257. package/dist/src/ui/viewer/i18n/ko.js.map +0 -1
  258. package/dist/src/ui/viewer/i18n/pt-BR.d.ts +0 -3
  259. package/dist/src/ui/viewer/i18n/pt-BR.d.ts.map +0 -1
  260. package/dist/src/ui/viewer/i18n/pt-BR.js +0 -198
  261. package/dist/src/ui/viewer/i18n/pt-BR.js.map +0 -1
  262. package/dist/src/ui/viewer/i18n/ru.d.ts +0 -3
  263. package/dist/src/ui/viewer/i18n/ru.d.ts.map +0 -1
  264. package/dist/src/ui/viewer/i18n/ru.js +0 -198
  265. package/dist/src/ui/viewer/i18n/ru.js.map +0 -1
  266. package/dist/src/ui/viewer/i18n/types.d.ts +0 -176
  267. package/dist/src/ui/viewer/i18n/types.d.ts.map +0 -1
  268. package/dist/src/ui/viewer/i18n/types.js +0 -2
  269. package/dist/src/ui/viewer/i18n/types.js.map +0 -1
  270. package/dist/src/ui/viewer/i18n/zh-CN.d.ts +0 -3
  271. package/dist/src/ui/viewer/i18n/zh-CN.d.ts.map +0 -1
  272. package/dist/src/ui/viewer/i18n/zh-CN.js +0 -198
  273. package/dist/src/ui/viewer/i18n/zh-CN.js.map +0 -1
  274. package/dist/src/ui/viewer/i18n/zh-TW.d.ts +0 -3
  275. package/dist/src/ui/viewer/i18n/zh-TW.d.ts.map +0 -1
  276. package/dist/src/ui/viewer/i18n/zh-TW.js +0 -198
  277. package/dist/src/ui/viewer/i18n/zh-TW.js.map +0 -1
  278. package/dist/src/ui/viewer/icons.d.ts +0 -77
  279. package/dist/src/ui/viewer/icons.d.ts.map +0 -1
  280. package/dist/src/ui/viewer/icons.js +0 -109
  281. package/dist/src/ui/viewer/icons.js.map +0 -1
  282. package/dist/src/ui/viewer/index.d.ts +0 -6
  283. package/dist/src/ui/viewer/index.d.ts.map +0 -1
  284. package/dist/src/ui/viewer/index.js +0 -6
  285. package/dist/src/ui/viewer/index.js.map +0 -1
  286. package/dist/src/ui/viewer/layout/index.d.ts +0 -3
  287. package/dist/src/ui/viewer/layout/index.d.ts.map +0 -1
  288. package/dist/src/ui/viewer/layout/index.js +0 -3
  289. package/dist/src/ui/viewer/layout/index.js.map +0 -1
  290. package/dist/src/ui/viewer/layout/pixelAlign.d.ts +0 -8
  291. package/dist/src/ui/viewer/layout/pixelAlign.d.ts.map +0 -1
  292. package/dist/src/ui/viewer/layout/pixelAlign.js +0 -42
  293. package/dist/src/ui/viewer/layout/pixelAlign.js.map +0 -1
  294. package/dist/src/ui/viewer/layout/spreadLayout.d.ts +0 -155
  295. package/dist/src/ui/viewer/layout/spreadLayout.d.ts.map +0 -1
  296. package/dist/src/ui/viewer/layout/spreadLayout.js +0 -574
  297. package/dist/src/ui/viewer/layout/spreadLayout.js.map +0 -1
  298. package/dist/src/ui/viewer/navigation.d.ts +0 -91
  299. package/dist/src/ui/viewer/navigation.d.ts.map +0 -1
  300. package/dist/src/ui/viewer/navigation.js +0 -59
  301. package/dist/src/ui/viewer/navigation.js.map +0 -1
  302. package/dist/src/ui/viewer/reducer.d.ts +0 -4
  303. package/dist/src/ui/viewer/reducer.d.ts.map +0 -1
  304. package/dist/src/ui/viewer/reducer.js +0 -841
  305. package/dist/src/ui/viewer/reducer.js.map +0 -1
  306. package/dist/src/ui/viewer/search/index.d.ts +0 -2
  307. package/dist/src/ui/viewer/search/index.d.ts.map +0 -1
  308. package/dist/src/ui/viewer/search/index.js +0 -2
  309. package/dist/src/ui/viewer/search/index.js.map +0 -1
  310. package/dist/src/ui/viewer/search/search.d.ts +0 -31
  311. package/dist/src/ui/viewer/search/search.d.ts.map +0 -1
  312. package/dist/src/ui/viewer/search/search.js +0 -446
  313. package/dist/src/ui/viewer/search/search.js.map +0 -1
  314. package/dist/src/ui/viewer/shell.d.ts +0 -65
  315. package/dist/src/ui/viewer/shell.d.ts.map +0 -1
  316. package/dist/src/ui/viewer/shell.js +0 -366
  317. package/dist/src/ui/viewer/shell.js.map +0 -1
  318. package/dist/src/ui/viewer/state.d.ts +0 -313
  319. package/dist/src/ui/viewer/state.d.ts.map +0 -1
  320. package/dist/src/ui/viewer/state.js +0 -157
  321. package/dist/src/ui/viewer/state.js.map +0 -1
  322. package/dist/src/ui/viewer/styles-inline.d.ts +0 -2
  323. package/dist/src/ui/viewer/styles-inline.d.ts.map +0 -1
  324. package/dist/src/ui/viewer/styles-inline.js +0 -3526
  325. package/dist/src/ui/viewer/styles-inline.js.map +0 -1
  326. package/dist/src/ui/viewer/text/index.d.ts +0 -6
  327. package/dist/src/ui/viewer/text/index.d.ts.map +0 -1
  328. package/dist/src/ui/viewer/text/index.js +0 -6
  329. package/dist/src/ui/viewer/text/index.js.map +0 -1
  330. package/dist/src/ui/viewer/text/render.d.ts +0 -18
  331. package/dist/src/ui/viewer/text/render.d.ts.map +0 -1
  332. package/dist/src/ui/viewer/text/render.js +0 -480
  333. package/dist/src/ui/viewer/text/render.js.map +0 -1
  334. package/dist/src/ui/viewer/text/selection.d.ts +0 -12
  335. package/dist/src/ui/viewer/text/selection.d.ts.map +0 -1
  336. package/dist/src/ui/viewer/text/selection.js +0 -69
  337. package/dist/src/ui/viewer/text/selection.js.map +0 -1
  338. package/dist/src/ui/viewer/tools/AnnotationDrawController.d.ts +0 -21
  339. package/dist/src/ui/viewer/tools/AnnotationDrawController.d.ts.map +0 -1
  340. package/dist/src/ui/viewer/tools/AnnotationDrawController.js +0 -410
  341. package/dist/src/ui/viewer/tools/AnnotationDrawController.js.map +0 -1
  342. package/dist/src/ui/viewer/tools/AnnotationSelectController.d.ts +0 -22
  343. package/dist/src/ui/viewer/tools/AnnotationSelectController.d.ts.map +0 -1
  344. package/dist/src/ui/viewer/tools/AnnotationSelectController.js +0 -378
  345. package/dist/src/ui/viewer/tools/AnnotationSelectController.js.map +0 -1
  346. package/dist/src/ui/viewer/tools/AnnotationUndoManager.d.ts +0 -29
  347. package/dist/src/ui/viewer/tools/AnnotationUndoManager.d.ts.map +0 -1
  348. package/dist/src/ui/viewer/tools/AnnotationUndoManager.js +0 -144
  349. package/dist/src/ui/viewer/tools/AnnotationUndoManager.js.map +0 -1
  350. package/dist/src/ui/viewer/tools/ViewToolController.d.ts +0 -20
  351. package/dist/src/ui/viewer/tools/ViewToolController.d.ts.map +0 -1
  352. package/dist/src/ui/viewer/tools/ViewToolController.js +0 -179
  353. package/dist/src/ui/viewer/tools/ViewToolController.js.map +0 -1
  354. package/dist/src/ui/viewer/transition-gl.d.ts +0 -25
  355. package/dist/src/ui/viewer/transition-gl.d.ts.map +0 -1
  356. package/dist/src/ui/viewer/transition-gl.js +0 -823
  357. package/dist/src/ui/viewer/transition-gl.js.map +0 -1
  358. package/dist/src/ui/viewer/transition.d.ts +0 -26
  359. package/dist/src/ui/viewer/transition.d.ts.map +0 -1
  360. package/dist/src/ui/viewer/transition.js +0 -1383
  361. package/dist/src/ui/viewer/transition.js.map +0 -1
  362. package/dist/src/wasm/LICENSE +0 -112
  363. package/dist/src/wasm/udoc.d.ts +0 -1338
  364. package/dist/src/wasm/udoc.js +0 -2645
  365. package/dist/src/wasm/udoc_bg.wasm +0 -0
  366. package/dist/src/wasm/udoc_bg.wasm.d.ts +0 -58
  367. package/dist/src/worker/WorkerClient.d.ts +0 -489
  368. package/dist/src/worker/WorkerClient.d.ts.map +0 -1
  369. package/dist/src/worker/WorkerClient.js +0 -1383
  370. package/dist/src/worker/WorkerClient.js.map +0 -1
  371. package/dist/src/worker/index.d.ts +0 -4
  372. package/dist/src/worker/index.d.ts.map +0 -1
  373. package/dist/src/worker/index.js +0 -2
  374. package/dist/src/worker/index.js.map +0 -1
  375. package/dist/src/worker/wasmError.d.ts +0 -17
  376. package/dist/src/worker/wasmError.d.ts.map +0 -1
  377. package/dist/src/worker/wasmError.js +0 -28
  378. package/dist/src/worker/wasmError.js.map +0 -1
  379. package/dist/src/worker/worker-inline.d.ts +0 -2
  380. package/dist/src/worker/worker-inline.d.ts.map +0 -1
  381. package/dist/src/worker/worker-inline.js +0 -2
  382. package/dist/src/worker/worker-inline.js.map +0 -1
  383. package/dist/src/worker/worker.d.ts +0 -530
  384. package/dist/src/worker/worker.d.ts.map +0 -1
  385. package/dist/src/worker/worker.js +0 -2935
  386. package/dist/src/worker/worker.js.map +0 -1
@@ -1,2935 +0,0 @@
1
- "use strict";
2
- (() => {
3
- // dist/src/wasm/udoc.js
4
- var Wasm = class {
5
- __destroy_into_raw() {
6
- const ptr = this.__wbg_ptr;
7
- this.__wbg_ptr = 0;
8
- WasmFinalization.unregister(this);
9
- return ptr;
10
- }
11
- free() {
12
- const ptr = this.__destroy_into_raw();
13
- wasm.__wbg_wasm_free(ptr, 0);
14
- }
15
- /**
16
- * Get info for all pages in one call.
17
- *
18
- * Returns an array of `PageInfo` objects, one per page.
19
- * More efficient than calling `page_info` for each page.
20
- * @param {string} id
21
- * @returns {JsPageInfo[]}
22
- */
23
- all_page_info(id) {
24
- try {
25
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
26
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
27
- const len0 = WASM_VECTOR_LEN;
28
- wasm.wasm_all_page_info(retptr, this.__wbg_ptr, ptr0, len0);
29
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
30
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
31
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
32
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
33
- if (r3) {
34
- throw takeObject(r2);
35
- }
36
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
37
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
38
- return v2;
39
- } finally {
40
- wasm.__wbindgen_add_to_stack_pointer(16);
41
- }
42
- }
43
- /**
44
- * Authenticate with a password to unlock an encrypted document.
45
- *
46
- * # Arguments
47
- * * `id` - Document ID
48
- * * `password` - Password to try
49
- *
50
- * # Returns
51
- * `true` if authentication succeeded, `false` if the password was incorrect.
52
- * @param {string} id
53
- * @param {string} password
54
- * @returns {boolean}
55
- */
56
- authenticate(id, password) {
57
- try {
58
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
59
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
60
- const len0 = WASM_VECTOR_LEN;
61
- const ptr1 = passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
62
- const len1 = WASM_VECTOR_LEN;
63
- wasm.wasm_authenticate(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
64
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
65
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
66
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
67
- if (r2) {
68
- throw takeObject(r1);
69
- }
70
- return r0 !== 0;
71
- } finally {
72
- wasm.__wbindgen_add_to_stack_pointer(16);
73
- }
74
- }
75
- /**
76
- * Disable telemetry reporting.
77
- *
78
- * Only takes effect if the current license includes the `no_telemetry`
79
- * feature flag. Returns `true` if telemetry was disabled, `false` if the
80
- * license does not permit it.
81
- * @returns {boolean}
82
- */
83
- disable_telemetry() {
84
- const ret = wasm.wasm_disable_telemetry(this.__wbg_ptr);
85
- return ret !== 0;
86
- }
87
- /**
88
- * Get the number of documents currently loaded.
89
- * @returns {number}
90
- */
91
- get document_count() {
92
- const ret = wasm.wasm_document_count(this.__wbg_ptr);
93
- return ret >>> 0;
94
- }
95
- /**
96
- * Get the format of a loaded document.
97
- *
98
- * Returns one of: "pdf", "docx", "pptx", "xlsx", "csv", "image".
99
- * @param {string} id
100
- * @returns {string}
101
- */
102
- document_format(id) {
103
- let deferred3_0;
104
- let deferred3_1;
105
- try {
106
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
107
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
108
- const len0 = WASM_VECTOR_LEN;
109
- wasm.wasm_document_format(retptr, this.__wbg_ptr, ptr0, len0);
110
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
111
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
112
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
113
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
114
- var ptr2 = r0;
115
- var len2 = r1;
116
- if (r3) {
117
- ptr2 = 0;
118
- len2 = 0;
119
- throw takeObject(r2);
120
- }
121
- deferred3_0 = ptr2;
122
- deferred3_1 = len2;
123
- return getStringFromWasm0(ptr2, len2);
124
- } finally {
125
- wasm.__wbindgen_add_to_stack_pointer(16);
126
- wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
127
- }
128
- }
129
- /**
130
- * Get all document IDs.
131
- * @returns {string[]}
132
- */
133
- document_ids() {
134
- try {
135
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
136
- wasm.wasm_document_ids(retptr, this.__wbg_ptr);
137
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
138
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
139
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
140
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
141
- return v1;
142
- } finally {
143
- wasm.__wbindgen_add_to_stack_pointer(16);
144
- }
145
- }
146
- /**
147
- * Enable Google Fonts.
148
- *
149
- * When enabled, fonts that are not embedded in the document will be
150
- * automatically fetched from Google Fonts during rendering. Google Fonts
151
- * are resolved after any URL fonts registered via `registerFonts`.
152
- *
153
- * Call this before loading documents.
154
- *
155
- * # Example (JavaScript)
156
- * ```js
157
- * udoc.enableGoogleFonts();
158
- * const docId = udoc.loadPptx(pptxBytes);
159
- * const pixels = udoc.renderPageToRgba(docId, 0, 800, 600);
160
- * ```
161
- */
162
- enableGoogleFonts() {
163
- wasm.wasm_enableGoogleFonts(this.__wbg_ptr);
164
- }
165
- /**
166
- * Get all annotations in the document, grouped by page index.
167
- *
168
- * Returns an object mapping page indices (as strings) to arrays of annotations.
169
- * @param {string} id
170
- * @returns {JsAnnotationsByPage}
171
- */
172
- get_all_annotations(id) {
173
- try {
174
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
175
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
176
- const len0 = WASM_VECTOR_LEN;
177
- wasm.wasm_get_all_annotations(retptr, this.__wbg_ptr, ptr0, len0);
178
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
179
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
180
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
181
- if (r2) {
182
- throw takeObject(r1);
183
- }
184
- return takeObject(r0);
185
- } finally {
186
- wasm.__wbindgen_add_to_stack_pointer(16);
187
- }
188
- }
189
- /**
190
- * Get the raw file bytes of a document.
191
- *
192
- * Returns the original file data for the document.
193
- * @param {string} id
194
- * @returns {Uint8Array}
195
- */
196
- get_bytes(id) {
197
- try {
198
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
199
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
200
- const len0 = WASM_VECTOR_LEN;
201
- wasm.wasm_get_bytes(retptr, this.__wbg_ptr, ptr0, len0);
202
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
203
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
204
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
205
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
206
- if (r3) {
207
- throw takeObject(r2);
208
- }
209
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
210
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
211
- return v2;
212
- } finally {
213
- wasm.__wbindgen_add_to_stack_pointer(16);
214
- }
215
- }
216
- /**
217
- * Get font usage information for a document.
218
- *
219
- * Returns an array of `FontUsageEntry` objects describing how each font
220
- * spec in the document was resolved, including primary resolution and
221
- * any glyph-fallback fonts used during text shaping.
222
- *
223
- * This information is populated during layout — call after rendering at
224
- * least one page to get results.
225
- *
226
- * # Arguments
227
- * * `id` - Document ID
228
- *
229
- * # Returns
230
- * `FontUsageEntry[]` — see TypeScript types for shape.
231
- * @param {string} id
232
- * @returns {JsFontUsageEntry[]}
233
- */
234
- get_font_usage(id) {
235
- try {
236
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
237
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
238
- const len0 = WASM_VECTOR_LEN;
239
- wasm.wasm_get_font_usage(retptr, this.__wbg_ptr, ptr0, len0);
240
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
241
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
242
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
243
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
244
- if (r3) {
245
- throw takeObject(r2);
246
- }
247
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
248
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
249
- return v2;
250
- } finally {
251
- wasm.__wbindgen_add_to_stack_pointer(16);
252
- }
253
- }
254
- /**
255
- * Get the layout model for a specific page.
256
- *
257
- * Returns the hierarchical layout structure (frames, parcels, lines, runs,
258
- * glyphs, tables, grids) without building the full display list. This is
259
- * more efficient than `get_page_text` for text selection/search and
260
- * preserves semantic structure (paragraphs, tables, etc.).
261
- *
262
- * All coordinates are in points (1/72 inch). The viewer should scale by
263
- * `canvasWidth / layoutPage.width` to convert to pixels.
264
- * @param {string} id
265
- * @param {number} page_index
266
- * @returns {JsLayoutPage}
267
- */
268
- get_layout_page(id, page_index) {
269
- try {
270
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
271
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
272
- const len0 = WASM_VECTOR_LEN;
273
- wasm.wasm_get_layout_page(retptr, this.__wbg_ptr, ptr0, len0, page_index);
274
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
275
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
276
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
277
- if (r2) {
278
- throw takeObject(r1);
279
- }
280
- return takeObject(r0);
281
- } finally {
282
- wasm.__wbindgen_add_to_stack_pointer(16);
283
- }
284
- }
285
- /**
286
- * Get a numeric limit from the current license.
287
- *
288
- * Returns the limit value if set in the license, otherwise returns the default.
289
- * @param {string} limit_name
290
- * @param {bigint} _default
291
- * @returns {bigint}
292
- */
293
- get_limit(limit_name, _default) {
294
- const ptr0 = passStringToWasm0(limit_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
295
- const len0 = WASM_VECTOR_LEN;
296
- const ret = wasm.wasm_get_limit(this.__wbg_ptr, ptr0, len0, _default);
297
- return BigInt.asUintN(64, ret);
298
- }
299
- /**
300
- * Get the document outline (bookmarks/table of contents).
301
- *
302
- * Returns an array of outline items, where each item has:
303
- * - `title`: Display text for the item
304
- * - `destination`: Optional navigation destination with `pageIndex` and display parameters
305
- * - `children`: Nested child items
306
- *
307
- * Returns an empty array if the document has no outline.
308
- * @param {string} id
309
- * @returns {JsOutlineItem[]}
310
- */
311
- get_outline(id) {
312
- try {
313
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
314
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
315
- const len0 = WASM_VECTOR_LEN;
316
- wasm.wasm_get_outline(retptr, this.__wbg_ptr, ptr0, len0);
317
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
318
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
319
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
320
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
321
- if (r3) {
322
- throw takeObject(r2);
323
- }
324
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
325
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
326
- return v2;
327
- } finally {
328
- wasm.__wbindgen_add_to_stack_pointer(16);
329
- }
330
- }
331
- /**
332
- * Get annotations for a specific page.
333
- *
334
- * Returns an array of annotation objects for the given page.
335
- * Uses per-page loading for efficiency (only loads the requested page).
336
- *
337
- * All geometry fields on the returned annotations (`bounds`, `quads`,
338
- * `vertices`, `inkList`, `start`/`end`, …) are in the page's unrotated
339
- * MediaBox coordinate space — origin top-left, PDF points, +y downward
340
- * — regardless of the page's `/Rotate` value. The viewer applies
341
- * rotation as a display transform on top. This matches the input space
342
- * expected by `pdf_save_annotations`, so the round-trip is consistent.
343
- * @param {string} id
344
- * @param {number} page_index
345
- * @returns {JsAnnotation[]}
346
- */
347
- get_page_annotations(id, page_index) {
348
- try {
349
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
350
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
351
- const len0 = WASM_VECTOR_LEN;
352
- wasm.wasm_get_page_annotations(retptr, this.__wbg_ptr, ptr0, len0, page_index);
353
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
354
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
355
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
356
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
357
- if (r3) {
358
- throw takeObject(r2);
359
- }
360
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
361
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
362
- return v2;
363
- } finally {
364
- wasm.__wbindgen_add_to_stack_pointer(16);
365
- }
366
- }
367
- /**
368
- * Get all visibility groups for a document.
369
- *
370
- * Returns an array of objects, each containing:
371
- * - `id`: Unique identifier string
372
- * - `name`: Display name for UI
373
- * - `visible`: Whether the group is currently visible
374
- *
375
- * Returns an empty array for documents without visibility groups.
376
- * @param {string} id
377
- * @returns {JsVisibilityGroup[]}
378
- */
379
- get_visibility_groups(id) {
380
- try {
381
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
382
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
383
- const len0 = WASM_VECTOR_LEN;
384
- wasm.wasm_get_visibility_groups(retptr, this.__wbg_ptr, ptr0, len0);
385
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
386
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
387
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
388
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
389
- if (r3) {
390
- throw takeObject(r2);
391
- }
392
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
393
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
394
- return v2;
395
- } finally {
396
- wasm.__wbindgen_add_to_stack_pointer(16);
397
- }
398
- }
399
- /**
400
- * Check if a document with the given ID exists.
401
- * @param {string} id
402
- * @returns {boolean}
403
- */
404
- has_document(id) {
405
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
406
- const len0 = WASM_VECTOR_LEN;
407
- const ret = wasm.wasm_has_document(this.__wbg_ptr, ptr0, len0);
408
- return ret !== 0;
409
- }
410
- /**
411
- * Check if a feature is enabled by the current license.
412
- * @param {string} feature
413
- * @returns {boolean}
414
- */
415
- has_feature(feature) {
416
- const ptr0 = passStringToWasm0(feature, wasm.__wbindgen_export, wasm.__wbindgen_export2);
417
- const len0 = WASM_VECTOR_LEN;
418
- const ret = wasm.wasm_has_feature(this.__wbg_ptr, ptr0, len0);
419
- return ret !== 0;
420
- }
421
- /**
422
- * Check whether the GPU render backend is available.
423
- * @returns {boolean}
424
- */
425
- has_gpu() {
426
- const ret = wasm.wasm_has_gpu(this.__wbg_ptr);
427
- return ret !== 0;
428
- }
429
- /**
430
- * Initialize the GPU render backend (Vello + WebGPU).
431
- *
432
- * This is async because wgpu device initialization requires yielding
433
- * to the browser event loop. Call this once after construction.
434
- * Returns `true` if GPU initialization succeeded, `false` if no
435
- * WebGPU adapter is available (the CPU backend remains usable).
436
- * @returns {Promise<boolean>}
437
- */
438
- init_gpu() {
439
- const ret = wasm.wasm_init_gpu(this.__wbg_ptr);
440
- return takeObject(ret);
441
- }
442
- /**
443
- * Get current license status.
444
- * @returns {LicenseResult}
445
- */
446
- license_status() {
447
- const ret = wasm.wasm_license_status(this.__wbg_ptr);
448
- return takeObject(ret);
449
- }
450
- /**
451
- * Load a document by auto-detecting its format from the file contents.
452
- *
453
- * When `format` is supplied (one of `"pdf"`, `"docx"`, `"pptx"`, `"xlsx"`,
454
- * `"csv"`, `"image"`), it is authoritative and the matching loader is used
455
- * directly — the viewer is expected to know the format (from extension, MIME
456
- * type, or user choice). This is the only way to open formats with no magic
457
- * bytes, such as CSV. When `format` is `None`, the format is detected from
458
- * magic bytes:
459
- * - `%PDF` → PDF
460
- * - `PK\x03\x04` (ZIP) → inspects ZIP entries for `word/` (DOCX), `ppt/` (PPTX), or `xl/` (XLSX)
461
- * - Image magic bytes (JPEG, PNG, GIF, BMP, TIFF, WebP) → Image
462
- *
463
- * # Arguments
464
- * * `bytes` - Raw file data
465
- * * `format` - Optional explicit format hint; falls back to magic-byte
466
- * detection when `None`.
467
- *
468
- * # Returns
469
- * A unique document ID that can be used to reference this document.
470
- *
471
- * # Permit enforcement
472
- * This is the single, gated document-open entry point. For
473
- * free/unlicensed usage it requires a valid server-signed permit (fetched
474
- * and verified inside WASM) before the document is opened; commercial
475
- * licensed usage skips the permit entirely. The per-format loaders are
476
- * private so there is no ungated open path.
477
- * @param {Uint8Array} bytes
478
- * @param {string | null} [format]
479
- * @returns {Promise<string>}
480
- */
481
- load(bytes, format) {
482
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
483
- const len0 = WASM_VECTOR_LEN;
484
- var ptr1 = isLikeNone(format) ? 0 : passStringToWasm0(format, wasm.__wbindgen_export, wasm.__wbindgen_export2);
485
- var len1 = WASM_VECTOR_LEN;
486
- const ret = wasm.wasm_load(this.__wbg_ptr, ptr0, len0, ptr1, len1);
487
- return takeObject(ret);
488
- }
489
- /**
490
- * Check if a document requires a password to open.
491
- *
492
- * Returns `true` if the document is encrypted and requires authentication
493
- * before pages can be loaded or rendered.
494
- * @param {string} id
495
- * @returns {boolean}
496
- */
497
- needs_password(id) {
498
- try {
499
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
500
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
501
- const len0 = WASM_VECTOR_LEN;
502
- wasm.wasm_needs_password(retptr, this.__wbg_ptr, ptr0, len0);
503
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
504
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
505
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
506
- if (r2) {
507
- throw takeObject(r1);
508
- }
509
- return r0 !== 0;
510
- } finally {
511
- wasm.__wbindgen_add_to_stack_pointer(16);
512
- }
513
- }
514
- /**
515
- * Create a new document viewer.
516
- *
517
- * # Arguments
518
- * * `domain` - Hostname of the embedding page (e.g. from `window.location.hostname`)
519
- * * `viewer_version` - SDK version string
520
- * @param {string} domain
521
- * @param {string} viewer_version
522
- */
523
- constructor(domain, viewer_version) {
524
- const ptr0 = passStringToWasm0(domain, wasm.__wbindgen_export, wasm.__wbindgen_export2);
525
- const len0 = WASM_VECTOR_LEN;
526
- const ptr1 = passStringToWasm0(viewer_version, wasm.__wbindgen_export, wasm.__wbindgen_export2);
527
- const len1 = WASM_VECTOR_LEN;
528
- const ret = wasm.wasm_new(ptr0, len0, ptr1, len1);
529
- this.__wbg_ptr = ret;
530
- WasmFinalization.register(this, this.__wbg_ptr, this);
531
- return this;
532
- }
533
- /**
534
- * Get the page count of a document.
535
- * @param {string} id
536
- * @returns {number}
537
- */
538
- page_count(id) {
539
- try {
540
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
541
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
542
- const len0 = WASM_VECTOR_LEN;
543
- wasm.wasm_page_count(retptr, this.__wbg_ptr, ptr0, len0);
544
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
545
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
546
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
547
- if (r2) {
548
- throw takeObject(r1);
549
- }
550
- return r0 >>> 0;
551
- } finally {
552
- wasm.__wbindgen_add_to_stack_pointer(16);
553
- }
554
- }
555
- /**
556
- * Get the page groups for a document.
557
- *
558
- * Each group covers a contiguous range of global page indices with a
559
- * shared stitching layout. Use this to build per-group canvases (e.g.,
560
- * one panel per Excel sheet) and group-named sidebars.
561
- *
562
- * - PDF/DOCX: one `linear` group covering all pages, no name.
563
- * - PPTX: one `linear` group (per-section groups once sections are modeled).
564
- * - XLSX: one `tiled` group per sheet with the sheet name and page-grid dimensions.
565
- * @param {string} id
566
- * @returns {JsPageGroup[]}
567
- */
568
- page_groups(id) {
569
- try {
570
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
571
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
572
- const len0 = WASM_VECTOR_LEN;
573
- wasm.wasm_page_groups(retptr, this.__wbg_ptr, ptr0, len0);
574
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
575
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
576
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
577
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
578
- if (r3) {
579
- throw takeObject(r2);
580
- }
581
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
582
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
583
- return v2;
584
- } finally {
585
- wasm.__wbindgen_add_to_stack_pointer(16);
586
- }
587
- }
588
- /**
589
- * Get info for a specific page.
590
- * @param {string} id
591
- * @param {number} page_index
592
- * @returns {JsPageInfo}
593
- */
594
- page_info(id, page_index) {
595
- try {
596
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
597
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
598
- const len0 = WASM_VECTOR_LEN;
599
- wasm.wasm_page_info(retptr, this.__wbg_ptr, ptr0, len0, page_index);
600
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
601
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
602
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
603
- if (r2) {
604
- throw takeObject(r1);
605
- }
606
- return takeObject(r0);
607
- } finally {
608
- wasm.__wbindgen_add_to_stack_pointer(16);
609
- }
610
- }
611
- /**
612
- * Compose new PDF documents by cherry-picking pages from source documents.
613
- *
614
- * The original documents remain unchanged.
615
- *
616
- * # Arguments
617
- * * `compositions` - Array of compositions. Each composition is an array of picks.
618
- * Each pick is `{ doc: docIndex, pages: "0-2,4" }` where `docIndex` is the index
619
- * in the `doc_ids` array and `pages` is a page range string (0-based).
620
- * * `doc_ids` - Array of document IDs to use as sources (order matters for doc indices)
621
- *
622
- * # Example
623
- * ```js
624
- * // Create two documents: first has pages 0-2 from doc A, second has page 0 from A and 1 from B
625
- * const newDocIds = udoc.pdf_compose(
626
- * [
627
- * [{ doc: 0, pages: "0-2" }],
628
- * [{ doc: 0, pages: "0" }, { doc: 1, pages: "1" }]
629
- * ],
630
- * ["doc_0", "doc_1"]
631
- * );
632
- * ```
633
- *
634
- * # Returns
635
- * Array of IDs for the newly created documents (one per composition).
636
- * @param {JsCompositions} compositions
637
- * @param {string[]} doc_ids
638
- * @returns {string[]}
639
- */
640
- pdf_compose(compositions, doc_ids) {
641
- try {
642
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
643
- const ptr0 = passArrayJsValueToWasm0(doc_ids, wasm.__wbindgen_export);
644
- const len0 = WASM_VECTOR_LEN;
645
- wasm.wasm_pdf_compose(retptr, this.__wbg_ptr, addHeapObject(compositions), ptr0, len0);
646
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
647
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
648
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
649
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
650
- if (r3) {
651
- throw takeObject(r2);
652
- }
653
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
654
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
655
- return v2;
656
- } finally {
657
- wasm.__wbindgen_add_to_stack_pointer(16);
658
- }
659
- }
660
- /**
661
- * Compress a PDF document.
662
- *
663
- * Saves the document with full compression options enabled:
664
- * - Compress stream data using FlateDecode
665
- * - Pack objects into compressed object streams (PDF 1.5+)
666
- * - Use compressed xref streams (PDF 1.5+)
667
- * - Remove unreferenced objects
668
- *
669
- * # Arguments
670
- * * `doc_id` - Document ID to compress
671
- *
672
- * # Returns
673
- * Compressed PDF data as Uint8Array
674
- * @param {string} doc_id
675
- * @returns {Uint8Array}
676
- */
677
- pdf_compress(doc_id) {
678
- try {
679
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
680
- const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
681
- const len0 = WASM_VECTOR_LEN;
682
- wasm.wasm_pdf_compress(retptr, this.__wbg_ptr, ptr0, len0);
683
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
684
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
685
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
686
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
687
- if (r3) {
688
- throw takeObject(r2);
689
- }
690
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
691
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
692
- return v2;
693
- } finally {
694
- wasm.__wbindgen_add_to_stack_pointer(16);
695
- }
696
- }
697
- /**
698
- * Decompress a PDF document.
699
- *
700
- * Removes all filter encodings from streams, resulting in raw,
701
- * uncompressed stream data. Useful for debugging or inspection.
702
- *
703
- * # Arguments
704
- * * `doc_id` - Document ID to decompress
705
- *
706
- * # Returns
707
- * Decompressed PDF data as Uint8Array
708
- * @param {string} doc_id
709
- * @returns {Uint8Array}
710
- */
711
- pdf_decompress(doc_id) {
712
- try {
713
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
714
- const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
715
- const len0 = WASM_VECTOR_LEN;
716
- wasm.wasm_pdf_decompress(retptr, this.__wbg_ptr, ptr0, len0);
717
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
718
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
719
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
720
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
721
- if (r3) {
722
- throw takeObject(r2);
723
- }
724
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
725
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
726
- return v2;
727
- } finally {
728
- wasm.__wbindgen_add_to_stack_pointer(16);
729
- }
730
- }
731
- /**
732
- * Extract all embedded fonts from a PDF document.
733
- *
734
- * # Arguments
735
- * * `doc_id` - Document ID to extract fonts from
736
- *
737
- * # Returns
738
- * Array of extracted font objects, each with:
739
- * - `name`: Font name from the resource dictionary
740
- * - `fontType`: Font type (Type1, TrueType, etc.)
741
- * - `extension`: File extension (ttf, cff, t1, etc.)
742
- * - `data`: Raw font data as Uint8Array
743
- * @param {string} doc_id
744
- * @returns {JsExtractedFont[]}
745
- */
746
- pdf_extract_fonts(doc_id) {
747
- try {
748
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
749
- const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
750
- const len0 = WASM_VECTOR_LEN;
751
- wasm.wasm_pdf_extract_fonts(retptr, this.__wbg_ptr, ptr0, len0);
752
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
753
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
754
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
755
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
756
- if (r3) {
757
- throw takeObject(r2);
758
- }
759
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
760
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
761
- return v2;
762
- } finally {
763
- wasm.__wbindgen_add_to_stack_pointer(16);
764
- }
765
- }
766
- /**
767
- * Extract all embedded images from a PDF document.
768
- *
769
- * # Arguments
770
- * * `doc_id` - Document ID to extract images from
771
- * * `convert_raw_to_png` - When true, converts raw pixel data to PNG format
772
- *
773
- * # Returns
774
- * Array of extracted image objects, each with:
775
- * - `name`: Image name from the resource dictionary
776
- * - `format`: Image format (jpeg, png, jp2, etc.)
777
- * - `width`: Width in pixels
778
- * - `height`: Height in pixels
779
- * - `data`: Raw image data as Uint8Array
780
- * @param {string} doc_id
781
- * @param {boolean} convert_raw_to_png
782
- * @returns {JsExtractedImage[]}
783
- */
784
- pdf_extract_images(doc_id, convert_raw_to_png) {
785
- try {
786
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
787
- const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
788
- const len0 = WASM_VECTOR_LEN;
789
- wasm.wasm_pdf_extract_images(retptr, this.__wbg_ptr, ptr0, len0, convert_raw_to_png);
790
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
791
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
792
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
793
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
794
- if (r3) {
795
- throw takeObject(r2);
796
- }
797
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
798
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
799
- return v2;
800
- } finally {
801
- wasm.__wbindgen_add_to_stack_pointer(16);
802
- }
803
- }
804
- /**
805
- * Save annotations back to a PDF document.
806
- *
807
- * Takes the current document and a set of annotations (grouped by page),
808
- * writes them into the PDF's annotation structures, and returns the
809
- * modified PDF bytes.
810
- *
811
- * # Coordinate space
812
- *
813
- * Every geometry field on the supplied annotations (`bounds`, `quads`,
814
- * `vertices`, `inkList`, `start`/`end`, `calloutLine`, …) must be in
815
- * the page's **unrotated MediaBox** coordinate space:
816
- *
817
- * - Origin = MediaBox top-left of the page in its natural (pre-`/Rotate`)
818
- * orientation. `(0, 0)` does not move when the page is displayed
819
- * rotated 90°/180°/270°.
820
- * - Units = PDF points (1/72 inch).
821
- * - Axes = `+x` right, `+y` downward (Y-flipped relative to PDF's native
822
- * bottom-up `/Rect`; this function performs the flip on the way out).
823
- * - `CropBox` is ignored — coordinates are MediaBox-relative even when
824
- * the page's CropBox trims the visible area.
825
- *
826
- * This is the same space returned by `get_page_annotations` /
827
- * `get_all_annotations`, so a load-edit-save round-trip is consistent.
828
- * Pages with no existing `/Annots` array are handled automatically: any
829
- * pre-existing array is cleared and a fresh one is created.
830
- *
831
- * # Arguments
832
- * * `doc_id` - Document ID
833
- * * `annotations_by_page` - Object mapping page indices (as strings) to
834
- * arrays of annotation objects. Same schema as returned by
835
- * `get_all_annotations`.
836
- *
837
- * # Returns
838
- * The modified PDF file bytes with annotations saved.
839
- *
840
- * # Example (JavaScript)
841
- * ```js
842
- * const annotations = udoc.get_all_annotations(docId);
843
- * // ... viewer edits annotations ...
844
- * const pdfBytes = udoc.pdf_save_annotations(docId, annotations);
845
- * ```
846
- * @param {string} doc_id
847
- * @param {JsAnnotationsByPage} annotations_by_page
848
- * @returns {Uint8Array}
849
- */
850
- pdf_save_annotations(doc_id, annotations_by_page) {
851
- try {
852
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
853
- const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
854
- const len0 = WASM_VECTOR_LEN;
855
- wasm.wasm_pdf_save_annotations(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(annotations_by_page));
856
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
857
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
858
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
859
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
860
- if (r3) {
861
- throw takeObject(r2);
862
- }
863
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
864
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
865
- return v2;
866
- } finally {
867
- wasm.__wbindgen_add_to_stack_pointer(16);
868
- }
869
- }
870
- /**
871
- * Split a PDF document by its outline (bookmarks) structure.
872
- *
873
- * Creates multiple documents, one for each outline section at the specified level.
874
- *
875
- * # Arguments
876
- * * `doc_id` - Document ID to split
877
- * * `max_level` - Maximum outline level to consider (1 = top level only)
878
- * * `split_mid_page` - When true, filters page content when sections share a page
879
- *
880
- * # Returns
881
- * Object with:
882
- * - `documentIds`: Array of IDs for the newly created documents
883
- * - `sections`: Array of section info objects with `title`, `startPage`, `level`
884
- * @param {string} doc_id
885
- * @param {number} max_level
886
- * @param {boolean} split_mid_page
887
- * @returns {JsSplitByOutlineResult}
888
- */
889
- pdf_split_by_outline(doc_id, max_level, split_mid_page) {
890
- try {
891
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
892
- const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
893
- const len0 = WASM_VECTOR_LEN;
894
- wasm.wasm_pdf_split_by_outline(retptr, this.__wbg_ptr, ptr0, len0, max_level, split_mid_page);
895
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
896
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
897
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
898
- if (r2) {
899
- throw takeObject(r1);
900
- }
901
- return takeObject(r0);
902
- } finally {
903
- wasm.__wbindgen_add_to_stack_pointer(16);
904
- }
905
- }
906
- /**
907
- * Register font URLs.
908
- *
909
- * The caller provides a list of all available fonts with their download
910
- * URLs. During layout, when the engine needs a font, it is fetched from
911
- * the URL, parsed, and cached for reuse.
912
- *
913
- * Call this before loading documents. Registered fonts are automatically
914
- * applied to every document loaded afterward. URL fonts are always
915
- * resolved before Google Fonts.
916
- *
917
- * # Arguments
918
- * * `fonts` - Array of font entries: `[{ typeface: "Roboto", bold: false, italic: false, url: "https://..." }, ...]`
919
- *
920
- * # Example (JavaScript)
921
- * ```js
922
- * // Register available fonts before loading documents
923
- * udoc.registerFonts([
924
- * { typeface: "Roboto", bold: false, italic: false, url: "https://cdn.example.com/Roboto-Regular.woff2" },
925
- * { typeface: "Roboto", bold: true, italic: false, url: "https://cdn.example.com/Roboto-Bold.woff2" },
926
- * ]);
927
- *
928
- * // Load and render - fonts are fetched on demand during layout
929
- * const docId = udoc.loadPptx(pptxBytes);
930
- * const pixels = udoc.renderPageToRgba(docId, 0, 800, 600);
931
- * ```
932
- * @param {JsFontRegistration[]} fonts
933
- */
934
- registerFonts(fonts) {
935
- try {
936
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
937
- const ptr0 = passArrayJsValueToWasm0(fonts, wasm.__wbindgen_export);
938
- const len0 = WASM_VECTOR_LEN;
939
- wasm.wasm_registerFonts(retptr, this.__wbg_ptr, ptr0, len0);
940
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
941
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
942
- if (r1) {
943
- throw takeObject(r0);
944
- }
945
- } finally {
946
- wasm.__wbindgen_add_to_stack_pointer(16);
947
- }
948
- }
949
- /**
950
- * Remove a document by ID.
951
- *
952
- * Returns true if the document was removed, false if it didn't exist.
953
- * @param {string} id
954
- * @returns {boolean}
955
- */
956
- remove_document(id) {
957
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
958
- const len0 = WASM_VECTOR_LEN;
959
- const ret = wasm.wasm_remove_document(this.__wbg_ptr, ptr0, len0);
960
- return ret !== 0;
961
- }
962
- /**
963
- * Render a page using the GPU backend (Vello + WebGPU).
964
- *
965
- * Returns raw RGBA pixel data in premultiplied alpha format,
966
- * identical to `render_page_to_rgba` but GPU-accelerated.
967
- *
968
- * # Errors
969
- * Returns an error if the GPU backend is not initialized
970
- * (call `init_gpu()` first), if the document is not found,
971
- * or if rendering fails.
972
- * @param {string} id
973
- * @param {number} page_index
974
- * @param {number} width
975
- * @param {number} height
976
- * @returns {Promise<Uint8Array>}
977
- */
978
- render_page_gpu(id, page_index, width, height) {
979
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
980
- const len0 = WASM_VECTOR_LEN;
981
- const ret = wasm.wasm_render_page_gpu(this.__wbg_ptr, ptr0, len0, page_index, width, height);
982
- return takeObject(ret);
983
- }
984
- /**
985
- * Render a page as separate animation layers, back-to-front.
986
- *
987
- * Each animated shape gets its own layer and each run of static frames
988
- * between them gets another, so drawing the layers in order reproduces
989
- * the page exactly while leaving each animated shape independently
990
- * transformable. Rasters are cropped to their content; `x` and `y` give
991
- * the offset within the page.
992
- *
993
- * Returns `undefined` when the page has no animations — render it with
994
- * `render_page_to_rgba` instead.
995
- * @param {string} id
996
- * @param {number} page_index
997
- * @param {number} width
998
- * @param {number} height
999
- * @returns {JsAnimationLayer[] | undefined}
1000
- */
1001
- render_page_layers(id, page_index, width, height) {
1002
- try {
1003
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1004
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1005
- const len0 = WASM_VECTOR_LEN;
1006
- wasm.wasm_render_page_layers(retptr, this.__wbg_ptr, ptr0, len0, page_index, width, height);
1007
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1008
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1009
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1010
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1011
- if (r3) {
1012
- throw takeObject(r2);
1013
- }
1014
- let v2;
1015
- if (r0 !== 0) {
1016
- v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1017
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
1018
- }
1019
- return v2;
1020
- } finally {
1021
- wasm.__wbindgen_add_to_stack_pointer(16);
1022
- }
1023
- }
1024
- /**
1025
- * Render a page to PNG bytes.
1026
- *
1027
- * # Arguments
1028
- * * `id` - Document ID
1029
- * * `page_index` - Zero-based page index
1030
- * * `width` - Output width in pixels
1031
- * * `height` - Output height in pixels
1032
- *
1033
- * # Returns
1034
- * PNG-encoded image data as a byte array.
1035
- * @param {string} id
1036
- * @param {number} page_index
1037
- * @param {number} width
1038
- * @param {number} height
1039
- * @returns {Uint8Array}
1040
- */
1041
- render_page_to_png(id, page_index, width, height) {
1042
- try {
1043
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1044
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1045
- const len0 = WASM_VECTOR_LEN;
1046
- wasm.wasm_render_page_to_png(retptr, this.__wbg_ptr, ptr0, len0, page_index, width, height);
1047
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1048
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1049
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1050
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1051
- if (r3) {
1052
- throw takeObject(r2);
1053
- }
1054
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
1055
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
1056
- return v2;
1057
- } finally {
1058
- wasm.__wbindgen_add_to_stack_pointer(16);
1059
- }
1060
- }
1061
- /**
1062
- * Render a page to raw RGBA pixel data.
1063
- *
1064
- * The returned data is in premultiplied alpha format, suitable for
1065
- * use with `ImageData` and canvas rendering.
1066
- *
1067
- * # Arguments
1068
- * * `id` - Document ID
1069
- * * `page_index` - Zero-based page index
1070
- * * `width` - Output width in pixels
1071
- * * `height` - Output height in pixels
1072
- *
1073
- * # Returns
1074
- * Raw RGBA pixel data (width * height * 4 bytes).
1075
- * @param {string} id
1076
- * @param {number} page_index
1077
- * @param {number} width
1078
- * @param {number} height
1079
- * @returns {Uint8Array}
1080
- */
1081
- render_page_to_rgba(id, page_index, width, height) {
1082
- try {
1083
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1084
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1085
- const len0 = WASM_VECTOR_LEN;
1086
- wasm.wasm_render_page_to_rgba(retptr, this.__wbg_ptr, ptr0, len0, page_index, width, height);
1087
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1088
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1089
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1090
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1091
- if (r3) {
1092
- throw takeObject(r2);
1093
- }
1094
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
1095
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
1096
- return v2;
1097
- } finally {
1098
- wasm.__wbindgen_add_to_stack_pointer(16);
1099
- }
1100
- }
1101
- /**
1102
- * Set the license key.
1103
- *
1104
- * # Arguments
1105
- * * `license_key` - The license key string
1106
- *
1107
- * # Returns
1108
- * License validation result as JSON.
1109
- * @param {string} license_key
1110
- * @returns {LicenseResult}
1111
- */
1112
- set_license(license_key) {
1113
- const ptr0 = passStringToWasm0(license_key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1114
- const len0 = WASM_VECTOR_LEN;
1115
- const ret = wasm.wasm_set_license(this.__wbg_ptr, ptr0, len0);
1116
- return takeObject(ret);
1117
- }
1118
- /**
1119
- * Set the visibility of a specific visibility group.
1120
- *
1121
- * # Arguments
1122
- * * `id` - Document ID
1123
- * * `group_id` - Visibility group ID
1124
- * * `visible` - Whether the group should be visible
1125
- *
1126
- * Returns `true` if the group was found and updated, `false` if not found.
1127
- * @param {string} id
1128
- * @param {string} group_id
1129
- * @param {boolean} visible
1130
- * @returns {boolean}
1131
- */
1132
- set_visibility_group_visible(id, group_id, visible) {
1133
- try {
1134
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1135
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1136
- const len0 = WASM_VECTOR_LEN;
1137
- const ptr1 = passStringToWasm0(group_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1138
- const len1 = WASM_VECTOR_LEN;
1139
- wasm.wasm_set_visibility_group_visible(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, visible);
1140
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1141
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1142
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1143
- if (r2) {
1144
- throw takeObject(r1);
1145
- }
1146
- return r0 !== 0;
1147
- } finally {
1148
- wasm.__wbindgen_add_to_stack_pointer(16);
1149
- }
1150
- }
1151
- /**
1152
- * Set the anonymous distinct ID for telemetry tracking.
1153
- *
1154
- * Call this after `new()` once the ID has been read from localStorage
1155
- * (or generated). Must be called before loading documents so that
1156
- * telemetry events include the correct metadata.
1157
- *
1158
- * # Arguments
1159
- * * `distinct_id` - Anonymous UUID for per-user tracking (persisted in localStorage)
1160
- * @param {string} distinct_id
1161
- */
1162
- setup_telemetry(distinct_id) {
1163
- const ptr0 = passStringToWasm0(distinct_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1164
- const len0 = WASM_VECTOR_LEN;
1165
- wasm.wasm_setup_telemetry(this.__wbg_ptr, ptr0, len0);
1166
- }
1167
- /**
1168
- * Get the build sequence of a page (PPTX slide animations).
1169
- *
1170
- * Returns `undefined` for pages without animations, which is every page
1171
- * of a PDF, DOCX or XLSX and most PPTX slides. Loading is lazy — unlike
1172
- * transitions on `page_info`, this triggers a full page load, so call it
1173
- * only for the page being displayed.
1174
- * @param {string} id
1175
- * @param {number} page_index
1176
- * @returns {JsSlideAnimation | undefined}
1177
- */
1178
- slide_animation(id, page_index) {
1179
- try {
1180
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1181
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1182
- const len0 = WASM_VECTOR_LEN;
1183
- wasm.wasm_slide_animation(retptr, this.__wbg_ptr, ptr0, len0, page_index);
1184
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1185
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1186
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1187
- if (r2) {
1188
- throw takeObject(r1);
1189
- }
1190
- return takeObject(r0);
1191
- } finally {
1192
- wasm.__wbindgen_add_to_stack_pointer(16);
1193
- }
1194
- }
1195
- /**
1196
- * Get viewer preferences embedded in the document.
1197
- *
1198
- * Returns a `JsViewerPreferences` with optional fields:
1199
- * - `layoutMode`: `"single-page"` | `"double-page-odd-right"` | `"double-page-odd-left"`
1200
- * - `scrollMode`: `"spread"` | `"continuous"`
1201
- * @param {string} id
1202
- * @returns {JsViewerPreferences}
1203
- */
1204
- viewer_preferences(id) {
1205
- try {
1206
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1207
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1208
- const len0 = WASM_VECTOR_LEN;
1209
- wasm.wasm_viewer_preferences(retptr, this.__wbg_ptr, ptr0, len0);
1210
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1211
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1212
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1213
- if (r2) {
1214
- throw takeObject(r1);
1215
- }
1216
- return takeObject(r0);
1217
- } finally {
1218
- wasm.__wbindgen_add_to_stack_pointer(16);
1219
- }
1220
- }
1221
- };
1222
- if (Symbol.dispose) Wasm.prototype[Symbol.dispose] = Wasm.prototype.free;
1223
- function parseFontInfo(data) {
1224
- try {
1225
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1226
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
1227
- const len0 = WASM_VECTOR_LEN;
1228
- wasm.parseFontInfo(retptr, ptr0, len0);
1229
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1230
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1231
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1232
- if (r2) {
1233
- throw takeObject(r1);
1234
- }
1235
- return takeObject(r0);
1236
- } finally {
1237
- wasm.__wbindgen_add_to_stack_pointer(16);
1238
- }
1239
- }
1240
- function __wbg_get_imports() {
1241
- const import0 = {
1242
- __proto__: null,
1243
- __wbg_Error_ef53bc310eb298a0: function(arg0, arg1) {
1244
- const ret = Error(getStringFromWasm0(arg0, arg1));
1245
- return addHeapObject(ret);
1246
- },
1247
- __wbg_Number_6b506e6536831eaa: function(arg0) {
1248
- const ret = Number(getObject(arg0));
1249
- return ret;
1250
- },
1251
- __wbg_String_8564e559799eccda: function(arg0, arg1) {
1252
- const ret = String(getObject(arg1));
1253
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1254
- const len1 = WASM_VECTOR_LEN;
1255
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1256
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1257
- },
1258
- __wbg_Window_defb2c76b3875a73: function(arg0) {
1259
- const ret = getObject(arg0).Window;
1260
- return addHeapObject(ret);
1261
- },
1262
- __wbg_WorkerGlobalScope_184e45d6565eb3f0: function(arg0) {
1263
- const ret = getObject(arg0).WorkerGlobalScope;
1264
- return addHeapObject(ret);
1265
- },
1266
- __wbg___wbindgen_bigint_get_as_i64_38130e98eecd467d: function(arg0, arg1) {
1267
- const v = getObject(arg1);
1268
- const ret = typeof v === "bigint" ? v : void 0;
1269
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1270
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1271
- },
1272
- __wbg___wbindgen_boolean_get_1a45e2c38d4d41b9: function(arg0) {
1273
- const v = getObject(arg0);
1274
- const ret = typeof v === "boolean" ? v : void 0;
1275
- return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
1276
- },
1277
- __wbg___wbindgen_debug_string_0accd80f45e5faa2: function(arg0, arg1) {
1278
- const ret = debugString(getObject(arg1));
1279
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1280
- const len1 = WASM_VECTOR_LEN;
1281
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1282
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1283
- },
1284
- __wbg___wbindgen_in_70a403a56e771704: function(arg0, arg1) {
1285
- const ret = getObject(arg0) in getObject(arg1);
1286
- return ret;
1287
- },
1288
- __wbg___wbindgen_is_bigint_6ffd6468a9bc44b9: function(arg0) {
1289
- const ret = typeof getObject(arg0) === "bigint";
1290
- return ret;
1291
- },
1292
- __wbg___wbindgen_is_function_754e9f305ff6029e: function(arg0) {
1293
- const ret = typeof getObject(arg0) === "function";
1294
- return ret;
1295
- },
1296
- __wbg___wbindgen_is_null_87c3bfe968c6a5ad: function(arg0) {
1297
- const ret = getObject(arg0) === null;
1298
- return ret;
1299
- },
1300
- __wbg___wbindgen_is_object_56732c2bc353f41d: function(arg0) {
1301
- const val = getObject(arg0);
1302
- const ret = typeof val === "object" && val !== null;
1303
- return ret;
1304
- },
1305
- __wbg___wbindgen_is_string_c236cabd84a4d769: function(arg0) {
1306
- const ret = typeof getObject(arg0) === "string";
1307
- return ret;
1308
- },
1309
- __wbg___wbindgen_is_undefined_67b456be8673d3d7: function(arg0) {
1310
- const ret = getObject(arg0) === void 0;
1311
- return ret;
1312
- },
1313
- __wbg___wbindgen_jsval_eq_1068e624fa87f6ab: function(arg0, arg1) {
1314
- const ret = getObject(arg0) === getObject(arg1);
1315
- return ret;
1316
- },
1317
- __wbg___wbindgen_jsval_loose_eq_2c56564c75129511: function(arg0, arg1) {
1318
- const ret = getObject(arg0) == getObject(arg1);
1319
- return ret;
1320
- },
1321
- __wbg___wbindgen_number_get_9bb1761122181af2: function(arg0, arg1) {
1322
- const obj = getObject(arg1);
1323
- const ret = typeof obj === "number" ? obj : void 0;
1324
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1325
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1326
- },
1327
- __wbg___wbindgen_string_get_72bdf95d3ae505b1: function(arg0, arg1) {
1328
- const obj = getObject(arg1);
1329
- const ret = typeof obj === "string" ? obj : void 0;
1330
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1331
- var len1 = WASM_VECTOR_LEN;
1332
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1333
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1334
- },
1335
- __wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
1336
- throw new Error(getStringFromWasm0(arg0, arg1));
1337
- },
1338
- __wbg__wbg_cb_unref_61db23ac97f16c31: function(arg0) {
1339
- getObject(arg0)._wbg_cb_unref();
1340
- },
1341
- __wbg_beginComputePass_1fc169dd9fc89475: function(arg0, arg1) {
1342
- const ret = getObject(arg0).beginComputePass(getObject(arg1));
1343
- return addHeapObject(ret);
1344
- },
1345
- __wbg_buffer_d370c8cae5692933: function(arg0) {
1346
- const ret = getObject(arg0).buffer;
1347
- return addHeapObject(ret);
1348
- },
1349
- __wbg_call_40e4174f169eaca7: function() {
1350
- return handleError(function(arg0, arg1, arg2, arg3) {
1351
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
1352
- return addHeapObject(ret);
1353
- }, arguments);
1354
- },
1355
- __wbg_call_8a89609d89f6608a: function() {
1356
- return handleError(function(arg0, arg1) {
1357
- const ret = getObject(arg0).call(getObject(arg1));
1358
- return addHeapObject(ret);
1359
- }, arguments);
1360
- },
1361
- __wbg_call_9c758de292015997: function() {
1362
- return handleError(function(arg0, arg1, arg2) {
1363
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1364
- return addHeapObject(ret);
1365
- }, arguments);
1366
- },
1367
- __wbg_clearBuffer_5c4f30438f07155a: function(arg0, arg1, arg2, arg3) {
1368
- getObject(arg0).clearBuffer(getObject(arg1), arg2, arg3);
1369
- },
1370
- __wbg_clearBuffer_de7e8cd418b56c30: function(arg0, arg1, arg2) {
1371
- getObject(arg0).clearBuffer(getObject(arg1), arg2);
1372
- },
1373
- __wbg_copyBufferToBuffer_55e9540007aef863: function() {
1374
- return handleError(function(arg0, arg1, arg2, arg3, arg4) {
1375
- getObject(arg0).copyBufferToBuffer(getObject(arg1), arg2, getObject(arg3), arg4);
1376
- }, arguments);
1377
- },
1378
- __wbg_copyBufferToBuffer_7adcb79ef87447dc: function() {
1379
- return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5) {
1380
- getObject(arg0).copyBufferToBuffer(getObject(arg1), arg2, getObject(arg3), arg4, arg5);
1381
- }, arguments);
1382
- },
1383
- __wbg_copyTextureToBuffer_09ba100a04b1b001: function() {
1384
- return handleError(function(arg0, arg1, arg2, arg3) {
1385
- getObject(arg0).copyTextureToBuffer(getObject(arg1), getObject(arg2), getObject(arg3));
1386
- }, arguments);
1387
- },
1388
- __wbg_copyTextureToTexture_66ab51b863dec546: function() {
1389
- return handleError(function(arg0, arg1, arg2, arg3) {
1390
- getObject(arg0).copyTextureToTexture(getObject(arg1), getObject(arg2), getObject(arg3));
1391
- }, arguments);
1392
- },
1393
- __wbg_createBindGroupLayout_1dad97f44fda2929: function() {
1394
- return handleError(function(arg0, arg1) {
1395
- const ret = getObject(arg0).createBindGroupLayout(getObject(arg1));
1396
- return addHeapObject(ret);
1397
- }, arguments);
1398
- },
1399
- __wbg_createBindGroup_0ee0646375643dfb: function(arg0, arg1) {
1400
- const ret = getObject(arg0).createBindGroup(getObject(arg1));
1401
- return addHeapObject(ret);
1402
- },
1403
- __wbg_createBuffer_474baee88e74f68a: function() {
1404
- return handleError(function(arg0, arg1) {
1405
- const ret = getObject(arg0).createBuffer(getObject(arg1));
1406
- return addHeapObject(ret);
1407
- }, arguments);
1408
- },
1409
- __wbg_createCommandEncoder_5229e112300218b4: function(arg0, arg1) {
1410
- const ret = getObject(arg0).createCommandEncoder(getObject(arg1));
1411
- return addHeapObject(ret);
1412
- },
1413
- __wbg_createComputePipeline_1cd8bf7e02a1a06d: function(arg0, arg1) {
1414
- const ret = getObject(arg0).createComputePipeline(getObject(arg1));
1415
- return addHeapObject(ret);
1416
- },
1417
- __wbg_createPipelineLayout_bf0deba7918ca157: function(arg0, arg1) {
1418
- const ret = getObject(arg0).createPipelineLayout(getObject(arg1));
1419
- return addHeapObject(ret);
1420
- },
1421
- __wbg_createShaderModule_744311a1dd685c14: function(arg0, arg1) {
1422
- const ret = getObject(arg0).createShaderModule(getObject(arg1));
1423
- return addHeapObject(ret);
1424
- },
1425
- __wbg_createTexture_f357c38256411287: function() {
1426
- return handleError(function(arg0, arg1) {
1427
- const ret = getObject(arg0).createTexture(getObject(arg1));
1428
- return addHeapObject(ret);
1429
- }, arguments);
1430
- },
1431
- __wbg_createView_e7a36ec95c4190f3: function() {
1432
- return handleError(function(arg0, arg1) {
1433
- const ret = getObject(arg0).createView(getObject(arg1));
1434
- return addHeapObject(ret);
1435
- }, arguments);
1436
- },
1437
- __wbg_crypto_48300657fced39f9: function(arg0) {
1438
- const ret = getObject(arg0).crypto;
1439
- return addHeapObject(ret);
1440
- },
1441
- __wbg_debug_78b457f1effb3792: function(arg0) {
1442
- console.debug(getObject(arg0));
1443
- },
1444
- __wbg_dispatchWorkgroupsIndirect_cdb624732570d2ab: function(arg0, arg1, arg2) {
1445
- getObject(arg0).dispatchWorkgroupsIndirect(getObject(arg1), arg2);
1446
- },
1447
- __wbg_dispatchWorkgroups_727fa35f9c69d73c: function(arg0, arg1, arg2, arg3) {
1448
- getObject(arg0).dispatchWorkgroups(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0);
1449
- },
1450
- __wbg_done_60cf307fcc680536: function(arg0) {
1451
- const ret = getObject(arg0).done;
1452
- return ret;
1453
- },
1454
- __wbg_end_2398df10208cf1ee: function(arg0) {
1455
- getObject(arg0).end();
1456
- },
1457
- __wbg_entries_04b37a02507f1713: function(arg0) {
1458
- const ret = Object.entries(getObject(arg0));
1459
- return addHeapObject(ret);
1460
- },
1461
- __wbg_error_78ff5b3a29b770e0: function(arg0) {
1462
- console.error(getObject(arg0));
1463
- },
1464
- __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
1465
- let deferred0_0;
1466
- let deferred0_1;
1467
- try {
1468
- deferred0_0 = arg0;
1469
- deferred0_1 = arg1;
1470
- console.error(getStringFromWasm0(arg0, arg1));
1471
- } finally {
1472
- wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1473
- }
1474
- },
1475
- __wbg_fetch_38c2afdf0e494736: function(arg0) {
1476
- const ret = fetch(getObject(arg0));
1477
- return addHeapObject(ret);
1478
- },
1479
- __wbg_finish_7370ad1c0e62b448: function(arg0) {
1480
- const ret = getObject(arg0).finish();
1481
- return addHeapObject(ret);
1482
- },
1483
- __wbg_finish_797b32d15bab2338: function(arg0, arg1) {
1484
- const ret = getObject(arg0).finish(getObject(arg1));
1485
- return addHeapObject(ret);
1486
- },
1487
- __wbg_from_d300fe49deab18f5: function(arg0) {
1488
- const ret = Array.from(getObject(arg0));
1489
- return addHeapObject(ret);
1490
- },
1491
- __wbg_getDate_3d2f964145b3449d: function(arg0) {
1492
- const ret = getObject(arg0).getDate();
1493
- return ret;
1494
- },
1495
- __wbg_getFullYear_8b1ba9a648a4de7f: function(arg0) {
1496
- const ret = getObject(arg0).getFullYear();
1497
- return ret;
1498
- },
1499
- __wbg_getHours_91ac680ae491b8ea: function(arg0) {
1500
- const ret = getObject(arg0).getHours();
1501
- return ret;
1502
- },
1503
- __wbg_getMappedRange_9f13d158ba3946fd: function() {
1504
- return handleError(function(arg0, arg1, arg2) {
1505
- const ret = getObject(arg0).getMappedRange(arg1, arg2);
1506
- return addHeapObject(ret);
1507
- }, arguments);
1508
- },
1509
- __wbg_getMinutes_c1c2573becc0c7b5: function(arg0) {
1510
- const ret = getObject(arg0).getMinutes();
1511
- return ret;
1512
- },
1513
- __wbg_getMonth_44bdf67c99f2ed79: function(arg0) {
1514
- const ret = getObject(arg0).getMonth();
1515
- return ret;
1516
- },
1517
- __wbg_getRandomValues_263d0aa5464054ee: function() {
1518
- return handleError(function(arg0, arg1) {
1519
- getObject(arg0).getRandomValues(getObject(arg1));
1520
- }, arguments);
1521
- },
1522
- __wbg_getSeconds_2716239745eecd0a: function(arg0) {
1523
- const ret = getObject(arg0).getSeconds();
1524
- return ret;
1525
- },
1526
- __wbg_get_1f8f054ddbaa7db2: function() {
1527
- return handleError(function(arg0, arg1) {
1528
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
1529
- return addHeapObject(ret);
1530
- }, arguments);
1531
- },
1532
- __wbg_get_2b48c7d0d006a781: function(arg0, arg1) {
1533
- const ret = getObject(arg0)[arg1 >>> 0];
1534
- return addHeapObject(ret);
1535
- },
1536
- __wbg_get_de6a0f7d4d18a304: function() {
1537
- return handleError(function(arg0, arg1) {
1538
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
1539
- return addHeapObject(ret);
1540
- }, arguments);
1541
- },
1542
- __wbg_get_unchecked_33f6e5c9e2f2d6b2: function(arg0, arg1) {
1543
- const ret = getObject(arg0)[arg1 >>> 0];
1544
- return addHeapObject(ret);
1545
- },
1546
- __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
1547
- const ret = getObject(arg0)[getObject(arg1)];
1548
- return addHeapObject(ret);
1549
- },
1550
- __wbg_gpu_ac6dc8fb638a26c3: function(arg0) {
1551
- const ret = getObject(arg0).gpu;
1552
- return addHeapObject(ret);
1553
- },
1554
- __wbg_info_af7f45292ba9b0ea: function(arg0) {
1555
- console.info(getObject(arg0));
1556
- },
1557
- __wbg_instanceof_ArrayBuffer_8f49811467741499: function(arg0) {
1558
- let result;
1559
- try {
1560
- result = getObject(arg0) instanceof ArrayBuffer;
1561
- } catch (_) {
1562
- result = false;
1563
- }
1564
- const ret = result;
1565
- return ret;
1566
- },
1567
- __wbg_instanceof_GpuAdapter_fb230cdccb184887: function(arg0) {
1568
- let result;
1569
- try {
1570
- result = getObject(arg0) instanceof GPUAdapter;
1571
- } catch (_) {
1572
- result = false;
1573
- }
1574
- const ret = result;
1575
- return ret;
1576
- },
1577
- __wbg_instanceof_Map_9fc06d9a951bcee6: function(arg0) {
1578
- let result;
1579
- try {
1580
- result = getObject(arg0) instanceof Map;
1581
- } catch (_) {
1582
- result = false;
1583
- }
1584
- const ret = result;
1585
- return ret;
1586
- },
1587
- __wbg_instanceof_Response_cb984bd66d7bd408: function(arg0) {
1588
- let result;
1589
- try {
1590
- result = getObject(arg0) instanceof Response;
1591
- } catch (_) {
1592
- result = false;
1593
- }
1594
- const ret = result;
1595
- return ret;
1596
- },
1597
- __wbg_instanceof_Uint8Array_86f30649f63ef9c2: function(arg0) {
1598
- let result;
1599
- try {
1600
- result = getObject(arg0) instanceof Uint8Array;
1601
- } catch (_) {
1602
- result = false;
1603
- }
1604
- const ret = result;
1605
- return ret;
1606
- },
1607
- __wbg_isArray_67c2c9c4313f4448: function(arg0) {
1608
- const ret = Array.isArray(getObject(arg0));
1609
- return ret;
1610
- },
1611
- __wbg_isSafeInteger_66acec27e09e99a7: function(arg0) {
1612
- const ret = Number.isSafeInteger(getObject(arg0));
1613
- return ret;
1614
- },
1615
- __wbg_iterator_8732428d309e270e: function() {
1616
- const ret = Symbol.iterator;
1617
- return addHeapObject(ret);
1618
- },
1619
- __wbg_label_84abde6506fa15b7: function(arg0, arg1) {
1620
- const ret = getObject(arg1).label;
1621
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1622
- const len1 = WASM_VECTOR_LEN;
1623
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1624
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1625
- },
1626
- __wbg_length_4a591ecaa01354d9: function(arg0) {
1627
- const ret = getObject(arg0).length;
1628
- return ret;
1629
- },
1630
- __wbg_length_66f1a4b2e9026940: function(arg0) {
1631
- const ret = getObject(arg0).length;
1632
- return ret;
1633
- },
1634
- __wbg_log_cf2e968649f3384e: function(arg0) {
1635
- console.log(getObject(arg0));
1636
- },
1637
- __wbg_mapAsync_3546b4b874e14738: function(arg0, arg1, arg2, arg3) {
1638
- const ret = getObject(arg0).mapAsync(arg1 >>> 0, arg2, arg3);
1639
- return addHeapObject(ret);
1640
- },
1641
- __wbg_msCrypto_8c6d45a75ef1d3da: function(arg0) {
1642
- const ret = getObject(arg0).msCrypto;
1643
- return addHeapObject(ret);
1644
- },
1645
- __wbg_navigator_3833ecdbc19d2757: function(arg0) {
1646
- const ret = getObject(arg0).navigator;
1647
- return addHeapObject(ret);
1648
- },
1649
- __wbg_navigator_391291470f58c650: function(arg0) {
1650
- const ret = getObject(arg0).navigator;
1651
- return addHeapObject(ret);
1652
- },
1653
- __wbg_new_0_445c13a750296eb6: function() {
1654
- const ret = /* @__PURE__ */ new Date();
1655
- return addHeapObject(ret);
1656
- },
1657
- __wbg_new_227d7c05414eb861: function() {
1658
- const ret = new Error();
1659
- return addHeapObject(ret);
1660
- },
1661
- __wbg_new_2ee370dca414d926: function() {
1662
- return handleError(function() {
1663
- const ret = new XMLHttpRequest();
1664
- return addHeapObject(ret);
1665
- }, arguments);
1666
- },
1667
- __wbg_new_578aeef4b6b94378: function(arg0) {
1668
- const ret = new Uint8Array(getObject(arg0));
1669
- return addHeapObject(ret);
1670
- },
1671
- __wbg_new_622fc80556be2e26: function() {
1672
- const ret = /* @__PURE__ */ new Map();
1673
- return addHeapObject(ret);
1674
- },
1675
- __wbg_new_b682b81e8eaaf027: function(arg0, arg1) {
1676
- try {
1677
- var state0 = { a: arg0, b: arg1 };
1678
- var cb0 = (arg02, arg12) => {
1679
- const a = state0.a;
1680
- state0.a = 0;
1681
- try {
1682
- return __wasm_bindgen_func_elem_34711(a, state0.b, arg02, arg12);
1683
- } finally {
1684
- state0.a = a;
1685
- }
1686
- };
1687
- const ret = new Promise(cb0);
1688
- return addHeapObject(ret);
1689
- } finally {
1690
- state0.a = 0;
1691
- }
1692
- },
1693
- __wbg_new_ce1ab61c1c2b300d: function() {
1694
- const ret = new Object();
1695
- return addHeapObject(ret);
1696
- },
1697
- __wbg_new_d90091b82fdf5b91: function() {
1698
- const ret = new Array();
1699
- return addHeapObject(ret);
1700
- },
1701
- __wbg_new_e436d06bc8e77460: function() {
1702
- return handleError(function() {
1703
- const ret = new Headers();
1704
- return addHeapObject(ret);
1705
- }, arguments);
1706
- },
1707
- __wbg_new_from_slice_18fa1f71286d66b8: function(arg0, arg1) {
1708
- const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1709
- return addHeapObject(ret);
1710
- },
1711
- __wbg_new_typed_bf31d18f92484486: function(arg0, arg1) {
1712
- try {
1713
- var state0 = { a: arg0, b: arg1 };
1714
- var cb0 = (arg02, arg12) => {
1715
- const a = state0.a;
1716
- state0.a = 0;
1717
- try {
1718
- return __wasm_bindgen_func_elem_34711(a, state0.b, arg02, arg12);
1719
- } finally {
1720
- state0.a = a;
1721
- }
1722
- };
1723
- const ret = new Promise(cb0);
1724
- return addHeapObject(ret);
1725
- } finally {
1726
- state0.a = 0;
1727
- }
1728
- },
1729
- __wbg_new_with_byte_offset_and_length_d836f26d916dd9ad: function(arg0, arg1, arg2) {
1730
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
1731
- return addHeapObject(ret);
1732
- },
1733
- __wbg_new_with_length_36a4998e27b014c5: function(arg0) {
1734
- const ret = new Uint8Array(arg0 >>> 0);
1735
- return addHeapObject(ret);
1736
- },
1737
- __wbg_new_with_str_and_init_bcd02b79a793d27f: function() {
1738
- return handleError(function(arg0, arg1, arg2) {
1739
- const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
1740
- return addHeapObject(ret);
1741
- }, arguments);
1742
- },
1743
- __wbg_next_9e03acdf51c4960d: function(arg0) {
1744
- const ret = getObject(arg0).next;
1745
- return addHeapObject(ret);
1746
- },
1747
- __wbg_next_eb8ca7351fa27906: function() {
1748
- return handleError(function(arg0) {
1749
- const ret = getObject(arg0).next();
1750
- return addHeapObject(ret);
1751
- }, arguments);
1752
- },
1753
- __wbg_node_95beb7570492fd97: function(arg0) {
1754
- const ret = getObject(arg0).node;
1755
- return addHeapObject(ret);
1756
- },
1757
- __wbg_now_190933fa139cc119: function() {
1758
- const ret = Date.now();
1759
- return ret;
1760
- },
1761
- __wbg_open_837bab9ccb9e06da: function() {
1762
- return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5) {
1763
- getObject(arg0).open(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), arg5 !== 0);
1764
- }, arguments);
1765
- },
1766
- __wbg_process_b2fea42461d03994: function(arg0) {
1767
- const ret = getObject(arg0).process;
1768
- return addHeapObject(ret);
1769
- },
1770
- __wbg_prototypesetcall_3249fc62a0fafa30: function(arg0, arg1, arg2) {
1771
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1772
- },
1773
- __wbg_push_a6822215aa43e71c: function(arg0, arg1) {
1774
- const ret = getObject(arg0).push(getObject(arg1));
1775
- return ret;
1776
- },
1777
- __wbg_queueMicrotask_35c611f4a14830b2: function(arg0) {
1778
- queueMicrotask(getObject(arg0));
1779
- },
1780
- __wbg_queueMicrotask_404ed0a58e0b63cc: function(arg0) {
1781
- const ret = getObject(arg0).queueMicrotask;
1782
- return addHeapObject(ret);
1783
- },
1784
- __wbg_queue_8cb065d04b06cb13: function(arg0) {
1785
- const ret = getObject(arg0).queue;
1786
- return addHeapObject(ret);
1787
- },
1788
- __wbg_randomFillSync_ca9f178fb14c88cb: function() {
1789
- return handleError(function(arg0, arg1) {
1790
- getObject(arg0).randomFillSync(takeObject(arg1));
1791
- }, arguments);
1792
- },
1793
- __wbg_requestAdapter_4814cb479d2dcf15: function(arg0, arg1) {
1794
- const ret = getObject(arg0).requestAdapter(getObject(arg1));
1795
- return addHeapObject(ret);
1796
- },
1797
- __wbg_requestDevice_1b8f321791aa8b00: function(arg0, arg1) {
1798
- const ret = getObject(arg0).requestDevice(getObject(arg1));
1799
- return addHeapObject(ret);
1800
- },
1801
- __wbg_require_7a9419e39d796c95: function() {
1802
- return handleError(function() {
1803
- const ret = module.require;
1804
- return addHeapObject(ret);
1805
- }, arguments);
1806
- },
1807
- __wbg_resolve_25a7e548d5881dca: function(arg0) {
1808
- const ret = Promise.resolve(getObject(arg0));
1809
- return addHeapObject(ret);
1810
- },
1811
- __wbg_responseText_266ec252b6be1e56: function() {
1812
- return handleError(function(arg0, arg1) {
1813
- const ret = getObject(arg1).responseText;
1814
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1815
- var len1 = WASM_VECTOR_LEN;
1816
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1817
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1818
- }, arguments);
1819
- },
1820
- __wbg_response_8ec82c168e320475: function() {
1821
- return handleError(function(arg0) {
1822
- const ret = getObject(arg0).response;
1823
- return addHeapObject(ret);
1824
- }, arguments);
1825
- },
1826
- __wbg_send_dce79f146638dfda: function() {
1827
- return handleError(function(arg0) {
1828
- getObject(arg0).send();
1829
- }, arguments);
1830
- },
1831
- __wbg_setBindGroup_67bd9a0c57486387: function() {
1832
- return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
1833
- getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2), getArrayU32FromWasm0(arg3, arg4), arg5, arg6 >>> 0);
1834
- }, arguments);
1835
- },
1836
- __wbg_setBindGroup_a2a4442ac2a0be99: function(arg0, arg1, arg2) {
1837
- getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2));
1838
- },
1839
- __wbg_setPipeline_50cfc53a5d0eb1d7: function(arg0, arg1) {
1840
- getObject(arg0).setPipeline(getObject(arg1));
1841
- },
1842
- __wbg_set_25ef40a9aeff260d: function() {
1843
- return handleError(function(arg0, arg1, arg2, arg3, arg4) {
1844
- getObject(arg0).set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1845
- }, arguments);
1846
- },
1847
- __wbg_set_52b1e1eb5bed906a: function(arg0, arg1, arg2) {
1848
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
1849
- return addHeapObject(ret);
1850
- },
1851
- __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
1852
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1853
- },
1854
- __wbg_set_6e30c9374c26414c: function() {
1855
- return handleError(function(arg0, arg1, arg2) {
1856
- const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
1857
- return ret;
1858
- }, arguments);
1859
- },
1860
- __wbg_set_access_67a4b0ae1c0f32f5: function(arg0, arg1) {
1861
- getObject(arg0).access = __wbindgen_enum_GpuStorageTextureAccess[arg1];
1862
- },
1863
- __wbg_set_array_layer_count_c2e975f5b62596bb: function(arg0, arg1) {
1864
- getObject(arg0).arrayLayerCount = arg1 >>> 0;
1865
- },
1866
- __wbg_set_aspect_a453970e75d8e849: function(arg0, arg1) {
1867
- getObject(arg0).aspect = __wbindgen_enum_GpuTextureAspect[arg1];
1868
- },
1869
- __wbg_set_base_array_layer_b67db9750fbc7053: function(arg0, arg1) {
1870
- getObject(arg0).baseArrayLayer = arg1 >>> 0;
1871
- },
1872
- __wbg_set_base_mip_level_35f2fc3293e96083: function(arg0, arg1) {
1873
- getObject(arg0).baseMipLevel = arg1 >>> 0;
1874
- },
1875
- __wbg_set_beginning_of_pass_write_index_ddfc55f615254cc1: function(arg0, arg1) {
1876
- getObject(arg0).beginningOfPassWriteIndex = arg1 >>> 0;
1877
- },
1878
- __wbg_set_bind_group_layouts_436bd62a9b35e1ab: function(arg0, arg1) {
1879
- getObject(arg0).bindGroupLayouts = getObject(arg1);
1880
- },
1881
- __wbg_set_binding_b575483e08d5ba4a: function(arg0, arg1) {
1882
- getObject(arg0).binding = arg1 >>> 0;
1883
- },
1884
- __wbg_set_binding_c9feebb53a130ebe: function(arg0, arg1) {
1885
- getObject(arg0).binding = arg1 >>> 0;
1886
- },
1887
- __wbg_set_body_36614c7e61546809: function(arg0, arg1) {
1888
- getObject(arg0).body = getObject(arg1);
1889
- },
1890
- __wbg_set_buffer_468874ee2bc9df02: function(arg0, arg1) {
1891
- getObject(arg0).buffer = getObject(arg1);
1892
- },
1893
- __wbg_set_buffer_6c45652fb024e808: function(arg0, arg1) {
1894
- getObject(arg0).buffer = getObject(arg1);
1895
- },
1896
- __wbg_set_buffer_83041e80a2b2c1b9: function(arg0, arg1) {
1897
- getObject(arg0).buffer = getObject(arg1);
1898
- },
1899
- __wbg_set_bytes_per_row_c127092e4fe9be22: function(arg0, arg1) {
1900
- getObject(arg0).bytesPerRow = arg1 >>> 0;
1901
- },
1902
- __wbg_set_bytes_per_row_fecf7d0d8d5038d0: function(arg0, arg1) {
1903
- getObject(arg0).bytesPerRow = arg1 >>> 0;
1904
- },
1905
- __wbg_set_c775d84916be79ea: function(arg0, arg1, arg2) {
1906
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
1907
- },
1908
- __wbg_set_code_0a82fa86cf58ca3b: function(arg0, arg1, arg2) {
1909
- getObject(arg0).code = getStringFromWasm0(arg1, arg2);
1910
- },
1911
- __wbg_set_compute_dc74d722ba27aa5b: function(arg0, arg1) {
1912
- getObject(arg0).compute = getObject(arg1);
1913
- },
1914
- __wbg_set_dca99999bba88a9a: function(arg0, arg1, arg2) {
1915
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1916
- },
1917
- __wbg_set_depth_or_array_layers_17284e1eac0007a1: function(arg0, arg1) {
1918
- getObject(arg0).depthOrArrayLayers = arg1 >>> 0;
1919
- },
1920
- __wbg_set_dimension_3144c827eb67b110: function(arg0, arg1) {
1921
- getObject(arg0).dimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
1922
- },
1923
- __wbg_set_dimension_9054f7ab0acbfd31: function(arg0, arg1) {
1924
- getObject(arg0).dimension = __wbindgen_enum_GpuTextureDimension[arg1];
1925
- },
1926
- __wbg_set_end_of_pass_write_index_786588764311c9aa: function(arg0, arg1) {
1927
- getObject(arg0).endOfPassWriteIndex = arg1 >>> 0;
1928
- },
1929
- __wbg_set_entries_247b5e665db79583: function(arg0, arg1) {
1930
- getObject(arg0).entries = getObject(arg1);
1931
- },
1932
- __wbg_set_entries_bfbb6a7f04b96709: function(arg0, arg1) {
1933
- getObject(arg0).entries = getObject(arg1);
1934
- },
1935
- __wbg_set_entry_point_3b13db51cfe0c5d6: function(arg0, arg1, arg2) {
1936
- getObject(arg0).entryPoint = getStringFromWasm0(arg1, arg2);
1937
- },
1938
- __wbg_set_external_texture_a0db2eb13c76e01c: function(arg0, arg1) {
1939
- getObject(arg0).externalTexture = getObject(arg1);
1940
- },
1941
- __wbg_set_format_237b3e4047d1be9a: function(arg0, arg1) {
1942
- getObject(arg0).format = __wbindgen_enum_GpuTextureFormat[arg1];
1943
- },
1944
- __wbg_set_format_c9dcecebf9c1e619: function(arg0, arg1) {
1945
- getObject(arg0).format = __wbindgen_enum_GpuTextureFormat[arg1];
1946
- },
1947
- __wbg_set_format_d9d3420c1a9d1c59: function(arg0, arg1) {
1948
- getObject(arg0).format = __wbindgen_enum_GpuTextureFormat[arg1];
1949
- },
1950
- __wbg_set_has_dynamic_offset_0c8a607543be8069: function(arg0, arg1) {
1951
- getObject(arg0).hasDynamicOffset = arg1 !== 0;
1952
- },
1953
- __wbg_set_headers_7c1e39ece7826bec: function(arg0, arg1) {
1954
- getObject(arg0).headers = getObject(arg1);
1955
- },
1956
- __wbg_set_height_96611e96eee67c44: function(arg0, arg1) {
1957
- getObject(arg0).height = arg1 >>> 0;
1958
- },
1959
- __wbg_set_label_01228663ea03b92f: function(arg0, arg1, arg2) {
1960
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1961
- },
1962
- __wbg_set_label_22e57f4c5b38215f: function(arg0, arg1, arg2) {
1963
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1964
- },
1965
- __wbg_set_label_382417d222111912: function(arg0, arg1, arg2) {
1966
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1967
- },
1968
- __wbg_set_label_4d049edb707ba31c: function(arg0, arg1, arg2) {
1969
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1970
- },
1971
- __wbg_set_label_66fc1d23dd10d4f5: function(arg0, arg1, arg2) {
1972
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1973
- },
1974
- __wbg_set_label_806446f85d68e201: function(arg0, arg1, arg2) {
1975
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1976
- },
1977
- __wbg_set_label_8354c6463558484f: function(arg0, arg1, arg2) {
1978
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1979
- },
1980
- __wbg_set_label_b3da7636c69f1a4c: function(arg0, arg1, arg2) {
1981
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1982
- },
1983
- __wbg_set_label_b7f797c13bc822c4: function(arg0, arg1, arg2) {
1984
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1985
- },
1986
- __wbg_set_label_e026aa2aea731594: function(arg0, arg1, arg2) {
1987
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1988
- },
1989
- __wbg_set_label_e6bc3b86ef6deeb8: function(arg0, arg1, arg2) {
1990
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1991
- },
1992
- __wbg_set_label_e7f76bba99d72971: function(arg0, arg1, arg2) {
1993
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1994
- },
1995
- __wbg_set_layout_44943c4c7d78f826: function(arg0, arg1) {
1996
- getObject(arg0).layout = getObject(arg1);
1997
- },
1998
- __wbg_set_layout_726c6ae6f5919730: function(arg0, arg1) {
1999
- getObject(arg0).layout = getObject(arg1);
2000
- },
2001
- __wbg_set_mapped_at_creation_12773dff1bb6ea0f: function(arg0, arg1) {
2002
- getObject(arg0).mappedAtCreation = arg1 !== 0;
2003
- },
2004
- __wbg_set_method_7a6811dec7a4feff: function(arg0, arg1, arg2) {
2005
- getObject(arg0).method = getStringFromWasm0(arg1, arg2);
2006
- },
2007
- __wbg_set_min_binding_size_164df827e02821e1: function(arg0, arg1) {
2008
- getObject(arg0).minBindingSize = arg1;
2009
- },
2010
- __wbg_set_mip_level_7f56c1c607dda5cf: function(arg0, arg1) {
2011
- getObject(arg0).mipLevel = arg1 >>> 0;
2012
- },
2013
- __wbg_set_mip_level_count_3402f5315a423b69: function(arg0, arg1) {
2014
- getObject(arg0).mipLevelCount = arg1 >>> 0;
2015
- },
2016
- __wbg_set_mip_level_count_ed029120a0ee12b8: function(arg0, arg1) {
2017
- getObject(arg0).mipLevelCount = arg1 >>> 0;
2018
- },
2019
- __wbg_set_module_af2f871a0bed003c: function(arg0, arg1) {
2020
- getObject(arg0).module = getObject(arg1);
2021
- },
2022
- __wbg_set_multisampled_e9d7bed0e68d1d6f: function(arg0, arg1) {
2023
- getObject(arg0).multisampled = arg1 !== 0;
2024
- },
2025
- __wbg_set_offset_01c04218a4ccfa08: function(arg0, arg1) {
2026
- getObject(arg0).offset = arg1;
2027
- },
2028
- __wbg_set_offset_bd11f79890456c6f: function(arg0, arg1) {
2029
- getObject(arg0).offset = arg1;
2030
- },
2031
- __wbg_set_offset_f07a73165707eb4c: function(arg0, arg1) {
2032
- getObject(arg0).offset = arg1;
2033
- },
2034
- __wbg_set_origin_6be40076fb0623f4: function(arg0, arg1) {
2035
- getObject(arg0).origin = getObject(arg1);
2036
- },
2037
- __wbg_set_power_preference_0721cf46746c0c7d: function(arg0, arg1) {
2038
- getObject(arg0).powerPreference = __wbindgen_enum_GpuPowerPreference[arg1];
2039
- },
2040
- __wbg_set_query_set_aadbb433c8390a5c: function(arg0, arg1) {
2041
- getObject(arg0).querySet = getObject(arg1);
2042
- },
2043
- __wbg_set_required_features_5202fa8cd082e531: function(arg0, arg1) {
2044
- getObject(arg0).requiredFeatures = getObject(arg1);
2045
- },
2046
- __wbg_set_resource_c73d0c2d815f7211: function(arg0, arg1) {
2047
- getObject(arg0).resource = getObject(arg1);
2048
- },
2049
- __wbg_set_responseType_cfb49ea8269f8317: function(arg0, arg1) {
2050
- getObject(arg0).responseType = __wbindgen_enum_XmlHttpRequestResponseType[arg1];
2051
- },
2052
- __wbg_set_rows_per_image_00c8e938dae40dae: function(arg0, arg1) {
2053
- getObject(arg0).rowsPerImage = arg1 >>> 0;
2054
- },
2055
- __wbg_set_rows_per_image_e6e2c0c4a7e4fa8d: function(arg0, arg1) {
2056
- getObject(arg0).rowsPerImage = arg1 >>> 0;
2057
- },
2058
- __wbg_set_sample_count_05dcc9952f4fa7ac: function(arg0, arg1) {
2059
- getObject(arg0).sampleCount = arg1 >>> 0;
2060
- },
2061
- __wbg_set_sample_type_93886b8f9794f85c: function(arg0, arg1) {
2062
- getObject(arg0).sampleType = __wbindgen_enum_GpuTextureSampleType[arg1];
2063
- },
2064
- __wbg_set_sampler_02989e99b27a50db: function(arg0, arg1) {
2065
- getObject(arg0).sampler = getObject(arg1);
2066
- },
2067
- __wbg_set_size_b3e6b2bf58d62082: function(arg0, arg1) {
2068
- getObject(arg0).size = getObject(arg1);
2069
- },
2070
- __wbg_set_size_c2a556d5571231f5: function(arg0, arg1) {
2071
- getObject(arg0).size = arg1;
2072
- },
2073
- __wbg_set_size_f7b29f6cb1669c4d: function(arg0, arg1) {
2074
- getObject(arg0).size = arg1;
2075
- },
2076
- __wbg_set_storage_texture_50af47fec531be02: function(arg0, arg1) {
2077
- getObject(arg0).storageTexture = getObject(arg1);
2078
- },
2079
- __wbg_set_texture_884f2777c0fe1e91: function(arg0, arg1) {
2080
- getObject(arg0).texture = getObject(arg1);
2081
- },
2082
- __wbg_set_texture_a1baf7da91d20351: function(arg0, arg1) {
2083
- getObject(arg0).texture = getObject(arg1);
2084
- },
2085
- __wbg_set_timestamp_writes_7fa18118aa24ddc1: function(arg0, arg1) {
2086
- getObject(arg0).timestampWrites = getObject(arg1);
2087
- },
2088
- __wbg_set_type_109702a7ec65b49d: function(arg0, arg1) {
2089
- getObject(arg0).type = __wbindgen_enum_GpuSamplerBindingType[arg1];
2090
- },
2091
- __wbg_set_type_55112c374bcc5a9d: function(arg0, arg1) {
2092
- getObject(arg0).type = __wbindgen_enum_GpuBufferBindingType[arg1];
2093
- },
2094
- __wbg_set_usage_ac04cadda4108c1a: function(arg0, arg1) {
2095
- getObject(arg0).usage = arg1 >>> 0;
2096
- },
2097
- __wbg_set_usage_ad30cd3b0e0f4244: function(arg0, arg1) {
2098
- getObject(arg0).usage = arg1 >>> 0;
2099
- },
2100
- __wbg_set_usage_cc34543608cf3335: function(arg0, arg1) {
2101
- getObject(arg0).usage = arg1 >>> 0;
2102
- },
2103
- __wbg_set_view_dimension_50f3edb06107948f: function(arg0, arg1) {
2104
- getObject(arg0).viewDimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
2105
- },
2106
- __wbg_set_view_dimension_925bb358df1f2b9d: function(arg0, arg1) {
2107
- getObject(arg0).viewDimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
2108
- },
2109
- __wbg_set_view_formats_3d2a72ffb1f55a75: function(arg0, arg1) {
2110
- getObject(arg0).viewFormats = getObject(arg1);
2111
- },
2112
- __wbg_set_visibility_bdebc70a7c0f236d: function(arg0, arg1) {
2113
- getObject(arg0).visibility = arg1 >>> 0;
2114
- },
2115
- __wbg_set_width_40592253da7b2113: function(arg0, arg1) {
2116
- getObject(arg0).width = arg1 >>> 0;
2117
- },
2118
- __wbg_set_x_3c1cb8191b848172: function(arg0, arg1) {
2119
- getObject(arg0).x = arg1 >>> 0;
2120
- },
2121
- __wbg_set_y_9024331910317eff: function(arg0, arg1) {
2122
- getObject(arg0).y = arg1 >>> 0;
2123
- },
2124
- __wbg_set_z_b6182f4c230116a7: function(arg0, arg1) {
2125
- getObject(arg0).z = arg1 >>> 0;
2126
- },
2127
- __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
2128
- const ret = getObject(arg1).stack;
2129
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2130
- const len1 = WASM_VECTOR_LEN;
2131
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2132
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2133
- },
2134
- __wbg_static_accessor_GLOBAL_9d53f2689e622ca1: function() {
2135
- const ret = typeof global === "undefined" ? null : global;
2136
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2137
- },
2138
- __wbg_static_accessor_GLOBAL_THIS_a1a35cec07001a8a: function() {
2139
- const ret = typeof globalThis === "undefined" ? null : globalThis;
2140
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2141
- },
2142
- __wbg_static_accessor_SELF_4c59f6c7ea29a144: function() {
2143
- const ret = typeof self === "undefined" ? null : self;
2144
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2145
- },
2146
- __wbg_static_accessor_WINDOW_e70ae9f2eb052253: function() {
2147
- const ret = typeof window === "undefined" ? null : window;
2148
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2149
- },
2150
- __wbg_status_214edd0820ca76fc: function() {
2151
- return handleError(function(arg0) {
2152
- const ret = getObject(arg0).status;
2153
- return ret;
2154
- }, arguments);
2155
- },
2156
- __wbg_subarray_4aa221f6a4f5ab22: function(arg0, arg1, arg2) {
2157
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
2158
- return addHeapObject(ret);
2159
- },
2160
- __wbg_submit_fc5b9a1154201a58: function(arg0, arg1) {
2161
- getObject(arg0).submit(getObject(arg1));
2162
- },
2163
- __wbg_text_a17febec76d36501: function() {
2164
- return handleError(function(arg0) {
2165
- const ret = getObject(arg0).text();
2166
- return addHeapObject(ret);
2167
- }, arguments);
2168
- },
2169
- __wbg_then_18f476d590e58992: function(arg0, arg1, arg2) {
2170
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
2171
- return addHeapObject(ret);
2172
- },
2173
- __wbg_then_529ea37d9bdbf95d: function(arg0, arg1, arg2) {
2174
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
2175
- return addHeapObject(ret);
2176
- },
2177
- __wbg_then_ac7b025999b52837: function(arg0, arg1) {
2178
- const ret = getObject(arg0).then(getObject(arg1));
2179
- return addHeapObject(ret);
2180
- },
2181
- __wbg_toISOString_d485be0388a74494: function(arg0) {
2182
- const ret = getObject(arg0).toISOString();
2183
- return addHeapObject(ret);
2184
- },
2185
- __wbg_value_f3625092ee4b37f4: function(arg0) {
2186
- const ret = getObject(arg0).value;
2187
- return addHeapObject(ret);
2188
- },
2189
- __wbg_versions_215a3ab1c9d5745a: function(arg0) {
2190
- const ret = getObject(arg0).versions;
2191
- return addHeapObject(ret);
2192
- },
2193
- __wbg_warn_410c3261e3c6d686: function(arg0) {
2194
- console.warn(getObject(arg0));
2195
- },
2196
- __wbg_writeBuffer_7d54524c36f1c7e2: function() {
2197
- return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5) {
2198
- getObject(arg0).writeBuffer(getObject(arg1), arg2, getObject(arg3), arg4, arg5);
2199
- }, arguments);
2200
- },
2201
- __wbg_writeTexture_9d4c493be748d189: function() {
2202
- return handleError(function(arg0, arg1, arg2, arg3, arg4) {
2203
- getObject(arg0).writeTexture(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
2204
- }, arguments);
2205
- },
2206
- __wbindgen_cast_0000000000000001: function(arg0, arg1) {
2207
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3678);
2208
- return addHeapObject(ret);
2209
- },
2210
- __wbindgen_cast_0000000000000002: function(arg0, arg1) {
2211
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_34709);
2212
- return addHeapObject(ret);
2213
- },
2214
- __wbindgen_cast_0000000000000003: function(arg0) {
2215
- const ret = arg0;
2216
- return addHeapObject(ret);
2217
- },
2218
- __wbindgen_cast_0000000000000004: function(arg0) {
2219
- const ret = arg0;
2220
- return addHeapObject(ret);
2221
- },
2222
- __wbindgen_cast_0000000000000005: function(arg0, arg1) {
2223
- const ret = getArrayU8FromWasm0(arg0, arg1);
2224
- return addHeapObject(ret);
2225
- },
2226
- __wbindgen_cast_0000000000000006: function(arg0, arg1) {
2227
- const ret = getStringFromWasm0(arg0, arg1);
2228
- return addHeapObject(ret);
2229
- },
2230
- __wbindgen_cast_0000000000000007: function(arg0) {
2231
- const ret = BigInt.asUintN(64, arg0);
2232
- return addHeapObject(ret);
2233
- },
2234
- __wbindgen_cast_0000000000000008: function(arg0, arg1) {
2235
- var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
2236
- wasm.__wbindgen_export4(arg0, arg1 * 1, 1);
2237
- const ret = v0;
2238
- return addHeapObject(ret);
2239
- },
2240
- __wbindgen_object_clone_ref: function(arg0) {
2241
- const ret = getObject(arg0);
2242
- return addHeapObject(ret);
2243
- },
2244
- __wbindgen_object_drop_ref: function(arg0) {
2245
- takeObject(arg0);
2246
- }
2247
- };
2248
- return {
2249
- __proto__: null,
2250
- "./udoc_bg.js": import0
2251
- };
2252
- }
2253
- function __wasm_bindgen_func_elem_3678(arg0, arg1, arg2) {
2254
- wasm.__wasm_bindgen_func_elem_3678(arg0, arg1, addHeapObject(arg2));
2255
- }
2256
- function __wasm_bindgen_func_elem_34709(arg0, arg1, arg2) {
2257
- try {
2258
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2259
- wasm.__wasm_bindgen_func_elem_34709(retptr, arg0, arg1, addHeapObject(arg2));
2260
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2261
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2262
- if (r1) {
2263
- throw takeObject(r0);
2264
- }
2265
- } finally {
2266
- wasm.__wbindgen_add_to_stack_pointer(16);
2267
- }
2268
- }
2269
- function __wasm_bindgen_func_elem_34711(arg0, arg1, arg2, arg3) {
2270
- wasm.__wasm_bindgen_func_elem_34711(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
2271
- }
2272
- var __wbindgen_enum_GpuBufferBindingType = ["uniform", "storage", "read-only-storage"];
2273
- var __wbindgen_enum_GpuPowerPreference = ["low-power", "high-performance"];
2274
- var __wbindgen_enum_GpuSamplerBindingType = ["filtering", "non-filtering", "comparison"];
2275
- var __wbindgen_enum_GpuStorageTextureAccess = ["write-only", "read-only", "read-write"];
2276
- var __wbindgen_enum_GpuTextureAspect = ["all", "stencil-only", "depth-only"];
2277
- var __wbindgen_enum_GpuTextureDimension = ["1d", "2d", "3d"];
2278
- var __wbindgen_enum_GpuTextureFormat = ["r8unorm", "r8snorm", "r8uint", "r8sint", "r16uint", "r16sint", "r16float", "rg8unorm", "rg8snorm", "rg8uint", "rg8sint", "r32uint", "r32sint", "r32float", "rg16uint", "rg16sint", "rg16float", "rgba8unorm", "rgba8unorm-srgb", "rgba8snorm", "rgba8uint", "rgba8sint", "bgra8unorm", "bgra8unorm-srgb", "rgb9e5ufloat", "rgb10a2uint", "rgb10a2unorm", "rg11b10ufloat", "rg32uint", "rg32sint", "rg32float", "rgba16uint", "rgba16sint", "rgba16float", "rgba32uint", "rgba32sint", "rgba32float", "stencil8", "depth16unorm", "depth24plus", "depth24plus-stencil8", "depth32float", "depth32float-stencil8", "bc1-rgba-unorm", "bc1-rgba-unorm-srgb", "bc2-rgba-unorm", "bc2-rgba-unorm-srgb", "bc3-rgba-unorm", "bc3-rgba-unorm-srgb", "bc4-r-unorm", "bc4-r-snorm", "bc5-rg-unorm", "bc5-rg-snorm", "bc6h-rgb-ufloat", "bc6h-rgb-float", "bc7-rgba-unorm", "bc7-rgba-unorm-srgb", "etc2-rgb8unorm", "etc2-rgb8unorm-srgb", "etc2-rgb8a1unorm", "etc2-rgb8a1unorm-srgb", "etc2-rgba8unorm", "etc2-rgba8unorm-srgb", "eac-r11unorm", "eac-r11snorm", "eac-rg11unorm", "eac-rg11snorm", "astc-4x4-unorm", "astc-4x4-unorm-srgb", "astc-5x4-unorm", "astc-5x4-unorm-srgb", "astc-5x5-unorm", "astc-5x5-unorm-srgb", "astc-6x5-unorm", "astc-6x5-unorm-srgb", "astc-6x6-unorm", "astc-6x6-unorm-srgb", "astc-8x5-unorm", "astc-8x5-unorm-srgb", "astc-8x6-unorm", "astc-8x6-unorm-srgb", "astc-8x8-unorm", "astc-8x8-unorm-srgb", "astc-10x5-unorm", "astc-10x5-unorm-srgb", "astc-10x6-unorm", "astc-10x6-unorm-srgb", "astc-10x8-unorm", "astc-10x8-unorm-srgb", "astc-10x10-unorm", "astc-10x10-unorm-srgb", "astc-12x10-unorm", "astc-12x10-unorm-srgb", "astc-12x12-unorm", "astc-12x12-unorm-srgb"];
2279
- var __wbindgen_enum_GpuTextureSampleType = ["float", "unfilterable-float", "depth", "sint", "uint"];
2280
- var __wbindgen_enum_GpuTextureViewDimension = ["1d", "2d", "2d-array", "cube", "cube-array", "3d"];
2281
- var __wbindgen_enum_XmlHttpRequestResponseType = ["", "arraybuffer", "blob", "document", "json", "text"];
2282
- var WasmFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2283
- }, unregister: () => {
2284
- } } : new FinalizationRegistry((ptr) => wasm.__wbg_wasm_free(ptr, 1));
2285
- function addHeapObject(obj) {
2286
- if (heap_next === heap.length) heap.push(heap.length + 1);
2287
- const idx = heap_next;
2288
- heap_next = heap[idx];
2289
- heap[idx] = obj;
2290
- return idx;
2291
- }
2292
- var CLOSURE_DTORS = typeof FinalizationRegistry === "undefined" ? { register: () => {
2293
- }, unregister: () => {
2294
- } } : new FinalizationRegistry((state) => wasm.__wbindgen_export5(state.a, state.b));
2295
- function debugString(val) {
2296
- const type = typeof val;
2297
- if (type == "number" || type == "boolean" || val == null) {
2298
- return `${val}`;
2299
- }
2300
- if (type == "string") {
2301
- return `"${val}"`;
2302
- }
2303
- if (type == "symbol") {
2304
- const description = val.description;
2305
- if (description == null) {
2306
- return "Symbol";
2307
- } else {
2308
- return `Symbol(${description})`;
2309
- }
2310
- }
2311
- if (type == "function") {
2312
- const name = val.name;
2313
- if (typeof name == "string" && name.length > 0) {
2314
- return `Function(${name})`;
2315
- } else {
2316
- return "Function";
2317
- }
2318
- }
2319
- if (Array.isArray(val)) {
2320
- const length = val.length;
2321
- let debug = "[";
2322
- if (length > 0) {
2323
- debug += debugString(val[0]);
2324
- }
2325
- for (let i = 1; i < length; i++) {
2326
- debug += ", " + debugString(val[i]);
2327
- }
2328
- debug += "]";
2329
- return debug;
2330
- }
2331
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
2332
- let className;
2333
- if (builtInMatches && builtInMatches.length > 1) {
2334
- className = builtInMatches[1];
2335
- } else {
2336
- return toString.call(val);
2337
- }
2338
- if (className == "Object") {
2339
- try {
2340
- return "Object(" + JSON.stringify(val) + ")";
2341
- } catch (_) {
2342
- return "Object";
2343
- }
2344
- }
2345
- if (val instanceof Error) {
2346
- return `${val.name}: ${val.message}
2347
- ${val.stack}`;
2348
- }
2349
- return className;
2350
- }
2351
- function dropObject(idx) {
2352
- if (idx < 1028) return;
2353
- heap[idx] = heap_next;
2354
- heap_next = idx;
2355
- }
2356
- function getArrayJsValueFromWasm0(ptr, len) {
2357
- ptr = ptr >>> 0;
2358
- const mem = getDataViewMemory0();
2359
- const result = [];
2360
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
2361
- result.push(takeObject(mem.getUint32(i, true)));
2362
- }
2363
- return result;
2364
- }
2365
- function getArrayU32FromWasm0(ptr, len) {
2366
- ptr = ptr >>> 0;
2367
- return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
2368
- }
2369
- function getArrayU8FromWasm0(ptr, len) {
2370
- ptr = ptr >>> 0;
2371
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
2372
- }
2373
- var cachedDataViewMemory0 = null;
2374
- function getDataViewMemory0() {
2375
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
2376
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
2377
- }
2378
- return cachedDataViewMemory0;
2379
- }
2380
- function getStringFromWasm0(ptr, len) {
2381
- return decodeText(ptr >>> 0, len);
2382
- }
2383
- var cachedUint32ArrayMemory0 = null;
2384
- function getUint32ArrayMemory0() {
2385
- if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
2386
- cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
2387
- }
2388
- return cachedUint32ArrayMemory0;
2389
- }
2390
- var cachedUint8ArrayMemory0 = null;
2391
- function getUint8ArrayMemory0() {
2392
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
2393
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
2394
- }
2395
- return cachedUint8ArrayMemory0;
2396
- }
2397
- function getObject(idx) {
2398
- return heap[idx];
2399
- }
2400
- function handleError(f, args) {
2401
- try {
2402
- return f.apply(this, args);
2403
- } catch (e) {
2404
- wasm.__wbindgen_export3(addHeapObject(e));
2405
- }
2406
- }
2407
- var heap = new Array(1024).fill(void 0);
2408
- heap.push(void 0, null, true, false);
2409
- var heap_next = heap.length;
2410
- function isLikeNone(x) {
2411
- return x === void 0 || x === null;
2412
- }
2413
- function makeMutClosure(arg0, arg1, f) {
2414
- const state = { a: arg0, b: arg1, cnt: 1 };
2415
- const real = (...args) => {
2416
- state.cnt++;
2417
- const a = state.a;
2418
- state.a = 0;
2419
- try {
2420
- return f(a, state.b, ...args);
2421
- } finally {
2422
- state.a = a;
2423
- real._wbg_cb_unref();
2424
- }
2425
- };
2426
- real._wbg_cb_unref = () => {
2427
- if (--state.cnt === 0) {
2428
- wasm.__wbindgen_export5(state.a, state.b);
2429
- state.a = 0;
2430
- CLOSURE_DTORS.unregister(state);
2431
- }
2432
- };
2433
- CLOSURE_DTORS.register(real, state, state);
2434
- return real;
2435
- }
2436
- function passArray8ToWasm0(arg, malloc) {
2437
- const ptr = malloc(arg.length * 1, 1) >>> 0;
2438
- getUint8ArrayMemory0().set(arg, ptr / 1);
2439
- WASM_VECTOR_LEN = arg.length;
2440
- return ptr;
2441
- }
2442
- function passArrayJsValueToWasm0(array, malloc) {
2443
- const ptr = malloc(array.length * 4, 4) >>> 0;
2444
- const mem = getDataViewMemory0();
2445
- for (let i = 0; i < array.length; i++) {
2446
- mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
2447
- }
2448
- WASM_VECTOR_LEN = array.length;
2449
- return ptr;
2450
- }
2451
- function passStringToWasm0(arg, malloc, realloc) {
2452
- if (realloc === void 0) {
2453
- const buf = cachedTextEncoder.encode(arg);
2454
- const ptr2 = malloc(buf.length, 1) >>> 0;
2455
- getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
2456
- WASM_VECTOR_LEN = buf.length;
2457
- return ptr2;
2458
- }
2459
- let len = arg.length;
2460
- let ptr = malloc(len, 1) >>> 0;
2461
- const mem = getUint8ArrayMemory0();
2462
- let offset = 0;
2463
- for (; offset < len; offset++) {
2464
- const code = arg.charCodeAt(offset);
2465
- if (code > 127) break;
2466
- mem[ptr + offset] = code;
2467
- }
2468
- if (offset !== len) {
2469
- if (offset !== 0) {
2470
- arg = arg.slice(offset);
2471
- }
2472
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
2473
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
2474
- const ret = cachedTextEncoder.encodeInto(arg, view);
2475
- offset += ret.written;
2476
- ptr = realloc(ptr, len, offset, 1) >>> 0;
2477
- }
2478
- WASM_VECTOR_LEN = offset;
2479
- return ptr;
2480
- }
2481
- function takeObject(idx) {
2482
- const ret = getObject(idx);
2483
- dropObject(idx);
2484
- return ret;
2485
- }
2486
- var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
2487
- cachedTextDecoder.decode();
2488
- var MAX_SAFARI_DECODE_BYTES = 2146435072;
2489
- var numBytesDecoded = 0;
2490
- function decodeText(ptr, len) {
2491
- numBytesDecoded += len;
2492
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
2493
- cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
2494
- cachedTextDecoder.decode();
2495
- numBytesDecoded = len;
2496
- }
2497
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
2498
- }
2499
- var cachedTextEncoder = new TextEncoder();
2500
- if (!("encodeInto" in cachedTextEncoder)) {
2501
- cachedTextEncoder.encodeInto = function(arg, view) {
2502
- const buf = cachedTextEncoder.encode(arg);
2503
- view.set(buf);
2504
- return {
2505
- read: arg.length,
2506
- written: buf.length
2507
- };
2508
- };
2509
- }
2510
- var WASM_VECTOR_LEN = 0;
2511
- var wasmModule;
2512
- var wasmInstance;
2513
- var wasm;
2514
- function __wbg_finalize_init(instance, module2) {
2515
- wasmInstance = instance;
2516
- wasm = instance.exports;
2517
- wasmModule = module2;
2518
- cachedDataViewMemory0 = null;
2519
- cachedUint32ArrayMemory0 = null;
2520
- cachedUint8ArrayMemory0 = null;
2521
- return wasm;
2522
- }
2523
- async function __wbg_load(module2, imports) {
2524
- if (typeof Response === "function" && module2 instanceof Response) {
2525
- if (typeof WebAssembly.instantiateStreaming === "function") {
2526
- try {
2527
- return await WebAssembly.instantiateStreaming(module2, imports);
2528
- } catch (e) {
2529
- const validResponse = module2.ok && expectedResponseType(module2.type);
2530
- if (validResponse && module2.headers.get("Content-Type") !== "application/wasm") {
2531
- 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);
2532
- } else {
2533
- throw e;
2534
- }
2535
- }
2536
- }
2537
- const bytes = await module2.arrayBuffer();
2538
- return await WebAssembly.instantiate(bytes, imports);
2539
- } else {
2540
- const instance = await WebAssembly.instantiate(module2, imports);
2541
- if (instance instanceof WebAssembly.Instance) {
2542
- return { instance, module: module2 };
2543
- } else {
2544
- return instance;
2545
- }
2546
- }
2547
- function expectedResponseType(type) {
2548
- switch (type) {
2549
- case "basic":
2550
- case "cors":
2551
- case "default":
2552
- return true;
2553
- }
2554
- return false;
2555
- }
2556
- }
2557
- async function __wbg_init(module_or_path) {
2558
- if (wasm !== void 0) return wasm;
2559
- if (module_or_path !== void 0) {
2560
- if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
2561
- ({ module_or_path } = module_or_path);
2562
- } else {
2563
- console.warn("using deprecated parameters for the initialization function; pass a single object instead");
2564
- }
2565
- }
2566
- if (module_or_path === void 0) {
2567
- module_or_path = new URL("udoc_bg.wasm", "about:blank");
2568
- }
2569
- const imports = __wbg_get_imports();
2570
- if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
2571
- module_or_path = fetch(module_or_path);
2572
- }
2573
- const { instance, module: module2 } = await __wbg_load(await module_or_path, imports);
2574
- return __wbg_finalize_init(instance, module2);
2575
- }
2576
-
2577
- // dist/src/worker/wasmError.js
2578
- function describeInitError(error, wasmUrl, version) {
2579
- const message = error instanceof Error ? error.message : String(error);
2580
- const mismatch = typeof WebAssembly.LinkError === "function" && error instanceof WebAssembly.LinkError || /\bimport\b/i.test(message) && /callable|not a function/i.test(message);
2581
- if (!mismatch) {
2582
- return error instanceof Error ? error : new Error(message);
2583
- }
2584
- const source = wasmUrl ? `at ${wasmUrl}` : "bundled with this app";
2585
- return new Error(`WASM engine version mismatch: udoc_bg.wasm ${source} was built for a different release than this worker (SDK ${version}). Serve worker.js and udoc_bg.wasm from the same @docmentis/udoc-viewer version, then clear any CDN or browser cache. (${message})`);
2586
- }
2587
-
2588
- // dist/src/worker/worker.js
2589
- var wasm2 = null;
2590
- var wasmMemory = null;
2591
- var gpuAvailable = false;
2592
- var currentRequestId;
2593
- var processing = false;
2594
- var messageQueue = [];
2595
- self.onmessage = (event) => {
2596
- messageQueue.push(event);
2597
- if (!processing) {
2598
- processQueue();
2599
- }
2600
- };
2601
- async function processQueue() {
2602
- processing = true;
2603
- while (messageQueue.length > 0) {
2604
- const event = messageQueue.shift();
2605
- await handleMessage(event);
2606
- }
2607
- processing = false;
2608
- }
2609
- async function handleMessage(event) {
2610
- const { _id, ...request } = event.data;
2611
- currentRequestId = _id;
2612
- try {
2613
- switch (request.type) {
2614
- case "init": {
2615
- let exports;
2616
- try {
2617
- exports = await __wbg_init(request.wasmUrl ? { module_or_path: request.wasmUrl } : void 0);
2618
- } catch (error) {
2619
- throw describeInitError(error, request.wasmUrl, request.viewerVersion);
2620
- }
2621
- wasmMemory = exports.memory ?? null;
2622
- wasm2 = new Wasm(request.domain, request.viewerVersion);
2623
- if (request.gpu) {
2624
- try {
2625
- gpuAvailable = await wasm2.init_gpu();
2626
- } catch {
2627
- gpuAvailable = false;
2628
- }
2629
- }
2630
- respond({ type: "init", success: true });
2631
- break;
2632
- }
2633
- case "setupTelemetry": {
2634
- ensureInitialized();
2635
- wasm2.setup_telemetry(request.distinctId);
2636
- respond({ type: "setupTelemetry", success: true });
2637
- break;
2638
- }
2639
- case "disableTelemetry": {
2640
- ensureInitialized();
2641
- const disabled = wasm2.disable_telemetry();
2642
- respond({ type: "disableTelemetry", success: true, disabled });
2643
- break;
2644
- }
2645
- case "setLicense": {
2646
- ensureInitialized();
2647
- const result = wasm2.set_license(request.license);
2648
- respond({ type: "setLicense", success: true, result });
2649
- break;
2650
- }
2651
- case "getLicenseStatus": {
2652
- ensureInitialized();
2653
- const result = wasm2.license_status();
2654
- respond({ type: "getLicenseStatus", success: true, result });
2655
- break;
2656
- }
2657
- case "load": {
2658
- ensureInitialized();
2659
- const documentId = await wasm2.load(request.bytes, request.format ?? null);
2660
- respond({ type: "load", success: true, documentId });
2661
- break;
2662
- }
2663
- case "getDocumentFormat": {
2664
- ensureInitialized();
2665
- const format = wasm2.document_format(request.documentId);
2666
- respond({ type: "getDocumentFormat", success: true, format });
2667
- break;
2668
- }
2669
- // The format-specific load entry points all route through the single
2670
- // permit-gated async `load` (format is auto-detected in WASM); there
2671
- // is intentionally no ungated open path.
2672
- case "loadPdf": {
2673
- ensureInitialized();
2674
- const documentId = await wasm2.load(request.bytes);
2675
- respond({ type: "loadPdf", success: true, documentId });
2676
- break;
2677
- }
2678
- case "loadImage": {
2679
- ensureInitialized();
2680
- const documentId = await wasm2.load(request.bytes);
2681
- respond({ type: "loadImage", success: true, documentId });
2682
- break;
2683
- }
2684
- case "loadPptx": {
2685
- ensureInitialized();
2686
- const documentId = await wasm2.load(request.bytes);
2687
- respond({ type: "loadPptx", success: true, documentId });
2688
- break;
2689
- }
2690
- case "loadDocx": {
2691
- ensureInitialized();
2692
- const documentId = await wasm2.load(request.bytes);
2693
- respond({ type: "loadDocx", success: true, documentId });
2694
- break;
2695
- }
2696
- case "loadXlsx": {
2697
- ensureInitialized();
2698
- const documentId = await wasm2.load(request.bytes);
2699
- respond({ type: "loadXlsx", success: true, documentId });
2700
- break;
2701
- }
2702
- case "unloadPdf": {
2703
- ensureInitialized();
2704
- const removed = wasm2.remove_document(request.documentId);
2705
- respond({ type: "unloadPdf", success: true, removed });
2706
- break;
2707
- }
2708
- case "needsPassword": {
2709
- ensureInitialized();
2710
- const needsPassword = wasm2.needs_password(request.documentId);
2711
- respond({ type: "needsPassword", success: true, needsPassword });
2712
- break;
2713
- }
2714
- case "authenticate": {
2715
- ensureInitialized();
2716
- const authenticated = wasm2.authenticate(request.documentId, request.password);
2717
- respond({ type: "authenticate", success: true, authenticated });
2718
- break;
2719
- }
2720
- case "getPageCount": {
2721
- ensureInitialized();
2722
- const pageCount = wasm2.page_count(request.documentId);
2723
- respond({ type: "getPageCount", success: true, pageCount });
2724
- break;
2725
- }
2726
- case "getPageInfo": {
2727
- ensureInitialized();
2728
- const info = wasm2.page_info(request.documentId, request.pageIndex);
2729
- respond({
2730
- type: "getPageInfo",
2731
- success: true,
2732
- width: info.width,
2733
- height: info.height,
2734
- rotation: info.rotation,
2735
- transition: info.transition
2736
- });
2737
- break;
2738
- }
2739
- case "getAllPageInfo": {
2740
- ensureInitialized();
2741
- const pages = wasm2.all_page_info(request.documentId);
2742
- respond({ type: "getAllPageInfo", success: true, pages });
2743
- break;
2744
- }
2745
- case "getPageGroups": {
2746
- ensureInitialized();
2747
- const groups = wasm2.page_groups(request.documentId);
2748
- respond({ type: "getPageGroups", success: true, groups });
2749
- break;
2750
- }
2751
- case "renderPage": {
2752
- ensureInitialized();
2753
- if (!wasm2.has_document(request.documentId)) {
2754
- respond({ type: "renderPage", success: false, error: `Document not found: ${request.documentId}` });
2755
- break;
2756
- }
2757
- let rgba;
2758
- if (gpuAvailable) {
2759
- const gpuResult = await wasm2.render_page_gpu(request.documentId, request.pageIndex, request.width, request.height);
2760
- rgba = new Uint8Array(gpuResult);
2761
- } else {
2762
- rgba = wasm2.render_page_to_rgba(request.documentId, request.pageIndex, request.width, request.height);
2763
- }
2764
- respond({ type: "renderPage", success: true, rgba, width: request.width, height: request.height }, [
2765
- rgba.buffer
2766
- ]);
2767
- break;
2768
- }
2769
- case "getOutline": {
2770
- ensureInitialized();
2771
- const outline = wasm2.get_outline(request.documentId);
2772
- respond({ type: "getOutline", success: true, outline });
2773
- break;
2774
- }
2775
- case "getPageAnnotations": {
2776
- ensureInitialized();
2777
- const annotations = wasm2.get_page_annotations(request.documentId, request.pageIndex);
2778
- respond({ type: "getPageAnnotations", success: true, annotations });
2779
- break;
2780
- }
2781
- case "getLayoutPage": {
2782
- ensureInitialized();
2783
- const layout = wasm2.get_layout_page(request.documentId, request.pageIndex);
2784
- respond({ type: "getLayoutPage", success: true, layout });
2785
- break;
2786
- }
2787
- case "getSlideAnimation": {
2788
- ensureInitialized();
2789
- const animation = wasm2.slide_animation(request.documentId, request.pageIndex);
2790
- respond({ type: "getSlideAnimation", success: true, animation });
2791
- break;
2792
- }
2793
- case "renderPageLayers": {
2794
- ensureInitialized();
2795
- if (!wasm2.has_document(request.documentId)) {
2796
- respond({
2797
- type: "renderPageLayers",
2798
- success: false,
2799
- error: `Document not found: ${request.documentId}`
2800
- });
2801
- break;
2802
- }
2803
- const layers = wasm2.render_page_layers(request.documentId, request.pageIndex, request.width, request.height);
2804
- const transfer = (layers ?? []).map((layer) => layer.rgba.buffer).filter((buffer) => buffer instanceof ArrayBuffer);
2805
- respond({ type: "renderPageLayers", success: true, layers }, transfer);
2806
- break;
2807
- }
2808
- case "getAllAnnotations": {
2809
- ensureInitialized();
2810
- const annotations = wasm2.get_all_annotations(request.documentId);
2811
- respond({ type: "getAllAnnotations", success: true, annotations });
2812
- break;
2813
- }
2814
- case "pdfCompose": {
2815
- ensureInitialized();
2816
- const documentIds = wasm2.pdf_compose(request.compositions.map((comp) => comp.map((pick) => ({ ...pick, rotation: pick.rotation ?? void 0 }))), request.docIds);
2817
- respond({ type: "pdfCompose", success: true, documentIds });
2818
- break;
2819
- }
2820
- case "getBytes": {
2821
- ensureInitialized();
2822
- const bytes = wasm2.get_bytes(request.documentId);
2823
- respond({ type: "getBytes", success: true, bytes }, [bytes.buffer]);
2824
- break;
2825
- }
2826
- case "pdfSplitByOutline": {
2827
- ensureInitialized();
2828
- const result = wasm2.pdf_split_by_outline(request.documentId, request.maxLevel, request.splitMidPage);
2829
- respond({ type: "pdfSplitByOutline", success: true, result });
2830
- break;
2831
- }
2832
- case "pdfExtractImages": {
2833
- ensureInitialized();
2834
- const rawImages = wasm2.pdf_extract_images(request.documentId, request.convertRawToPng);
2835
- const images = rawImages.map((img) => ({
2836
- ...img,
2837
- data: new Uint8Array(img.data)
2838
- }));
2839
- const transfers = images.map((img) => img.data.buffer);
2840
- respond({ type: "pdfExtractImages", success: true, images }, transfers);
2841
- break;
2842
- }
2843
- case "pdfExtractFonts": {
2844
- ensureInitialized();
2845
- const rawFonts = wasm2.pdf_extract_fonts(request.documentId);
2846
- const fonts = rawFonts.map((font) => ({
2847
- ...font,
2848
- data: new Uint8Array(font.data)
2849
- }));
2850
- const transfers = fonts.map((font) => font.data.buffer);
2851
- respond({ type: "pdfExtractFonts", success: true, fonts }, transfers);
2852
- break;
2853
- }
2854
- case "pdfCompress": {
2855
- ensureInitialized();
2856
- const compressedBytes = wasm2.pdf_compress(request.documentId);
2857
- respond({ type: "pdfCompress", success: true, bytes: compressedBytes }, [compressedBytes.buffer]);
2858
- break;
2859
- }
2860
- case "pdfDecompress": {
2861
- ensureInitialized();
2862
- const decompressedBytes = wasm2.pdf_decompress(request.documentId);
2863
- respond({ type: "pdfDecompress", success: true, bytes: decompressedBytes }, [decompressedBytes.buffer]);
2864
- break;
2865
- }
2866
- case "registerFonts": {
2867
- ensureInitialized();
2868
- wasm2.registerFonts(request.fonts);
2869
- respond({ type: "registerFonts", success: true });
2870
- break;
2871
- }
2872
- case "enableGoogleFonts": {
2873
- ensureInitialized();
2874
- wasm2.enableGoogleFonts();
2875
- respond({ type: "enableGoogleFonts", success: true });
2876
- break;
2877
- }
2878
- case "getVisibilityGroups": {
2879
- ensureInitialized();
2880
- const groups = wasm2.get_visibility_groups(request.documentId);
2881
- respond({ type: "getVisibilityGroups", success: true, groups });
2882
- break;
2883
- }
2884
- case "setVisibilityGroupVisible": {
2885
- ensureInitialized();
2886
- const updated = wasm2.set_visibility_group_visible(request.documentId, request.groupId, request.visible);
2887
- respond({ type: "setVisibilityGroupVisible", success: true, updated });
2888
- break;
2889
- }
2890
- case "parseFontInfo": {
2891
- ensureInitialized();
2892
- const info = parseFontInfo(request.data);
2893
- respond({ type: "parseFontInfo", success: true, info });
2894
- break;
2895
- }
2896
- case "getFontUsage": {
2897
- ensureInitialized();
2898
- const entries = wasm2.get_font_usage(request.documentId);
2899
- respond({ type: "getFontUsage", success: true, entries });
2900
- break;
2901
- }
2902
- case "pdfSaveAnnotations": {
2903
- ensureInitialized();
2904
- const bytes = wasm2.pdf_save_annotations(request.documentId, request.annotationsByPage);
2905
- respond({ type: "pdfSaveAnnotations", success: true, bytes }, [bytes.buffer]);
2906
- break;
2907
- }
2908
- case "getWasmMemoryBytes": {
2909
- respond({ type: "getWasmMemoryBytes", success: true, bytes: wasmMemory?.buffer.byteLength ?? 0 });
2910
- break;
2911
- }
2912
- default: {
2913
- const _exhaustive = request;
2914
- throw new Error(`Unknown request type: ${request.type}`);
2915
- }
2916
- }
2917
- } catch (error) {
2918
- const errorMessage = error instanceof Error ? error.message : String(error);
2919
- respond({ type: request.type, success: false, error: errorMessage });
2920
- }
2921
- }
2922
- function ensureInitialized() {
2923
- if (!wasm2) {
2924
- throw new Error("Worker not initialized. Call init first.");
2925
- }
2926
- }
2927
- function respond(response, transfer) {
2928
- const message = currentRequestId !== void 0 ? { ...response, _id: currentRequestId } : response;
2929
- if (transfer) {
2930
- self.postMessage(message, transfer);
2931
- } else {
2932
- self.postMessage(message);
2933
- }
2934
- }
2935
- })();