@getflip/swirl-components 0.423.1 → 0.425.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 (2038) hide show
  1. package/components.json +319 -4
  2. package/dist/cjs/file-manager.cjs.entry.js +1 -1
  3. package/dist/cjs/index-31zRgX-7.js +16 -8
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/swirl-app-layout_5.cjs.entry.js +2 -2
  6. package/dist/cjs/swirl-avatar.cjs.entry.js +1 -1
  7. package/dist/cjs/swirl-components.cjs.js +1 -1
  8. package/dist/cjs/swirl-data-cell-stack.cjs.entry.js +39 -0
  9. package/dist/cjs/swirl-data-cell.cjs.entry.js +32 -0
  10. package/dist/cjs/swirl-date-input.cjs.entry.js +1 -1
  11. package/dist/cjs/swirl-date-picker_2.cjs.entry.js +2 -2
  12. package/dist/cjs/swirl-description-list-item.cjs.entry.js +1 -1
  13. package/dist/cjs/swirl-description-list.cjs.entry.js +1 -1
  14. package/dist/cjs/swirl-emoji-clap.cjs.entry.js +1 -1
  15. package/dist/cjs/swirl-emoji-happy.cjs.entry.js +1 -1
  16. package/dist/cjs/swirl-emoji-idea.cjs.entry.js +1 -1
  17. package/dist/cjs/swirl-emoji-love.cjs.entry.js +1 -1
  18. package/dist/cjs/swirl-emoji-sad.cjs.entry.js +1 -1
  19. package/dist/cjs/swirl-emoji-thumbs-up.cjs.entry.js +1 -1
  20. package/dist/cjs/swirl-emoji.cjs.entry.js +1 -1
  21. package/dist/cjs/swirl-file-chip.cjs.entry.js +1 -1
  22. package/dist/cjs/swirl-file-uploader.cjs.entry.js +2 -2
  23. package/dist/cjs/swirl-file-viewer_8.cjs.entry.js +7 -7
  24. package/dist/cjs/swirl-icon-add-moderator.cjs.entry.js +1 -1
  25. package/dist/cjs/swirl-icon-add-photo.cjs.entry.js +1 -1
  26. package/dist/cjs/swirl-icon-add-reaction.cjs.entry.js +1 -1
  27. package/dist/cjs/swirl-icon-add_6.cjs.entry.js +6 -6
  28. package/dist/cjs/swirl-icon-admin-panel-settings.cjs.entry.js +1 -1
  29. package/dist/cjs/swirl-icon-ai-filled.cjs.entry.js +1 -1
  30. package/dist/cjs/swirl-icon-ai.cjs.entry.js +1 -1
  31. package/dist/cjs/swirl-icon-apps.cjs.entry.js +1 -1
  32. package/dist/cjs/swirl-icon-arrow-back_5.cjs.entry.js +5 -5
  33. package/dist/cjs/swirl-icon-arrow-downward_2.cjs.entry.js +2 -2
  34. package/dist/cjs/swirl-icon-arrow-left_4.cjs.entry.js +3 -3
  35. package/dist/cjs/swirl-icon-arrow-right-small.cjs.entry.js +1 -1
  36. package/dist/cjs/swirl-icon-aspect-ratio.cjs.entry.js +1 -1
  37. package/dist/cjs/swirl-icon-attachment_6.cjs.entry.js +6 -6
  38. package/dist/cjs/swirl-icon-autorenew.cjs.entry.js +1 -1
  39. package/dist/cjs/swirl-icon-bar-chart.cjs.entry.js +1 -1
  40. package/dist/cjs/swirl-icon-beach-access-filled.cjs.entry.js +1 -1
  41. package/dist/cjs/swirl-icon-beach-access.cjs.entry.js +1 -1
  42. package/dist/cjs/swirl-icon-block.cjs.entry.js +1 -1
  43. package/dist/cjs/swirl-icon-bookmark-filled.cjs.entry.js +1 -1
  44. package/dist/cjs/swirl-icon-bookmark.cjs.entry.js +1 -1
  45. package/dist/cjs/swirl-icon-calendar-add-on-filled.cjs.entry.js +1 -1
  46. package/dist/cjs/swirl-icon-calendar-respond.cjs.entry.js +1 -1
  47. package/dist/cjs/swirl-icon-calendar-today.cjs.entry.js +1 -1
  48. package/dist/cjs/swirl-icon-call-end.cjs.entry.js +1 -1
  49. package/dist/cjs/swirl-icon-call.cjs.entry.js +1 -1
  50. package/dist/cjs/swirl-icon-cancel-filled.cjs.entry.js +1 -1
  51. package/dist/cjs/swirl-icon-cancel-outline.cjs.entry.js +1 -1
  52. package/dist/cjs/swirl-icon-cancel_4.cjs.entry.js +4 -4
  53. package/dist/cjs/swirl-icon-chat-bubble.cjs.entry.js +1 -1
  54. package/dist/cjs/swirl-icon-chats-filled.cjs.entry.js +1 -1
  55. package/dist/cjs/swirl-icon-chats.cjs.entry.js +1 -1
  56. package/dist/cjs/swirl-icon-check-circle-filled.cjs.entry.js +1 -1
  57. package/dist/cjs/swirl-icon-check-circle_2.cjs.entry.js +2 -2
  58. package/dist/cjs/swirl-icon-check-small_3.cjs.entry.js +3 -3
  59. package/dist/cjs/swirl-icon-check.cjs.entry.js +1 -1
  60. package/dist/cjs/swirl-icon-checkbox-filled.cjs.entry.js +1 -1
  61. package/dist/cjs/swirl-icon-chevron-left.cjs.entry.js +1 -1
  62. package/dist/cjs/swirl-icon-chevron-right.cjs.entry.js +1 -1
  63. package/dist/cjs/swirl-icon-close-fullscreen.cjs.entry.js +1 -1
  64. package/dist/cjs/swirl-icon-close-small.cjs.entry.js +1 -1
  65. package/dist/cjs/swirl-icon-close.cjs.entry.js +1 -1
  66. package/dist/cjs/swirl-icon-cloud-upload.cjs.entry.js +1 -1
  67. package/dist/cjs/swirl-icon-column.cjs.entry.js +1 -1
  68. package/dist/cjs/swirl-icon-comment.cjs.entry.js +1 -1
  69. package/dist/cjs/swirl-icon-contrast.cjs.entry.js +1 -1
  70. package/dist/cjs/swirl-icon-copy.cjs.entry.js +1 -1
  71. package/dist/cjs/swirl-icon-crop.cjs.entry.js +1 -1
  72. package/dist/cjs/swirl-icon-dark-mode.cjs.entry.js +1 -1
  73. package/dist/cjs/swirl-icon-date-range.cjs.entry.js +1 -1
  74. package/dist/cjs/swirl-icon-delete.cjs.entry.js +1 -1
  75. package/dist/cjs/swirl-icon-deployed-code.cjs.entry.js +1 -1
  76. package/dist/cjs/swirl-icon-description.cjs.entry.js +1 -1
  77. package/dist/cjs/swirl-icon-desktop.cjs.entry.js +1 -1
  78. package/dist/cjs/swirl-icon-directory-filled.cjs.entry.js +1 -1
  79. package/dist/cjs/swirl-icon-directory.cjs.entry.js +1 -1
  80. package/dist/cjs/swirl-icon-discover.cjs.entry.js +1 -1
  81. package/dist/cjs/swirl-icon-dock-left.cjs.entry.js +1 -1
  82. package/dist/cjs/swirl-icon-door-open.cjs.entry.js +1 -1
  83. package/dist/cjs/swirl-icon-dot.cjs.entry.js +1 -1
  84. package/dist/cjs/swirl-icon-double-arrow-right.cjs.entry.js +1 -1
  85. package/dist/cjs/swirl-icon-download.cjs.entry.js +1 -1
  86. package/dist/cjs/swirl-icon-edit-note.cjs.entry.js +1 -1
  87. package/dist/cjs/swirl-icon-edit.cjs.entry.js +1 -1
  88. package/dist/cjs/swirl-icon-emoji-mood.cjs.entry.js +1 -1
  89. package/dist/cjs/swirl-icon-emoji-satisfied.cjs.entry.js +1 -1
  90. package/dist/cjs/swirl-icon-emoji-symbols.cjs.entry.js +1 -1
  91. package/dist/cjs/swirl-icon-error_3.cjs.entry.js +1 -1
  92. package/dist/cjs/swirl-icon-expand-more.cjs.entry.js +1 -1
  93. package/dist/cjs/swirl-icon-experiment.cjs.entry.js +1 -1
  94. package/dist/cjs/swirl-icon-file.cjs.entry.js +1 -1
  95. package/dist/cjs/swirl-icon-filter.cjs.entry.js +1 -1
  96. package/dist/cjs/swirl-icon-format-h-one.cjs.entry.js +1 -1
  97. package/dist/cjs/swirl-icon-format-list-bulleted.cjs.entry.js +1 -1
  98. package/dist/cjs/swirl-icon-forward.cjs.entry.js +1 -1
  99. package/dist/cjs/swirl-icon-gif.cjs.entry.js +1 -1
  100. package/dist/cjs/swirl-icon-group-add.cjs.entry.js +1 -1
  101. package/dist/cjs/swirl-icon-group-assign.cjs.entry.js +1 -1
  102. package/dist/cjs/swirl-icon-groups-filled.cjs.entry.js +1 -1
  103. package/dist/cjs/swirl-icon-groups.cjs.entry.js +1 -1
  104. package/dist/cjs/swirl-icon-hamburger-menu.cjs.entry.js +1 -1
  105. package/dist/cjs/swirl-icon-health-and-safety.cjs.entry.js +1 -1
  106. package/dist/cjs/swirl-icon-help-filled.cjs.entry.js +1 -1
  107. package/dist/cjs/swirl-icon-help.cjs.entry.js +1 -1
  108. package/dist/cjs/swirl-icon-highlight.cjs.entry.js +1 -1
  109. package/dist/cjs/swirl-icon-history.cjs.entry.js +1 -1
  110. package/dist/cjs/swirl-icon-home-filled.cjs.entry.js +1 -1
  111. package/dist/cjs/swirl-icon-home.cjs.entry.js +1 -1
  112. package/dist/cjs/swirl-icon-hr-resting.cjs.entry.js +1 -1
  113. package/dist/cjs/swirl-icon-improve-text.cjs.entry.js +1 -1
  114. package/dist/cjs/swirl-icon-info.cjs.entry.js +1 -1
  115. package/dist/cjs/swirl-icon-insert-below.cjs.entry.js +1 -1
  116. package/dist/cjs/swirl-icon-insert-chart.cjs.entry.js +1 -1
  117. package/dist/cjs/swirl-icon-insert-on-top.cjs.entry.js +1 -1
  118. package/dist/cjs/swirl-icon-inventory-off.cjs.entry.js +1 -1
  119. package/dist/cjs/swirl-icon-inventory.cjs.entry.js +1 -1
  120. package/dist/cjs/swirl-icon-iphone.cjs.entry.js +1 -1
  121. package/dist/cjs/swirl-icon-key.cjs.entry.js +1 -1
  122. package/dist/cjs/swirl-icon-keyboard-hide.cjs.entry.js +1 -1
  123. package/dist/cjs/swirl-icon-keyboard.cjs.entry.js +1 -1
  124. package/dist/cjs/swirl-icon-language.cjs.entry.js +1 -1
  125. package/dist/cjs/swirl-icon-light-mode.cjs.entry.js +1 -1
  126. package/dist/cjs/swirl-icon-like.cjs.entry.js +1 -1
  127. package/dist/cjs/swirl-icon-link.cjs.entry.js +1 -1
  128. package/dist/cjs/swirl-icon-live.cjs.entry.js +1 -1
  129. package/dist/cjs/swirl-icon-load.cjs.entry.js +1 -1
  130. package/dist/cjs/swirl-icon-location-on.cjs.entry.js +1 -1
  131. package/dist/cjs/swirl-icon-lock-open.cjs.entry.js +1 -1
  132. package/dist/cjs/swirl-icon-lock-person.cjs.entry.js +1 -1
  133. package/dist/cjs/swirl-icon-lock.cjs.entry.js +1 -1
  134. package/dist/cjs/swirl-icon-login.cjs.entry.js +1 -1
  135. package/dist/cjs/swirl-icon-logout.cjs.entry.js +1 -1
  136. package/dist/cjs/swirl-icon-long-text.cjs.entry.js +1 -1
  137. package/dist/cjs/swirl-icon-mail.cjs.entry.js +1 -1
  138. package/dist/cjs/swirl-icon-manage-accounts.cjs.entry.js +1 -1
  139. package/dist/cjs/swirl-icon-mark-chat-read.cjs.entry.js +1 -1
  140. package/dist/cjs/swirl-icon-mark-chat-unread.cjs.entry.js +1 -1
  141. package/dist/cjs/swirl-icon-mention.cjs.entry.js +1 -1
  142. package/dist/cjs/swirl-icon-menu-book-filled.cjs.entry.js +1 -1
  143. package/dist/cjs/swirl-icon-menu-filled.cjs.entry.js +1 -1
  144. package/dist/cjs/swirl-icon-menu.cjs.entry.js +1 -1
  145. package/dist/cjs/swirl-icon-message.cjs.entry.js +1 -1
  146. package/dist/cjs/swirl-icon-mic-off.cjs.entry.js +1 -1
  147. package/dist/cjs/swirl-icon-mic.cjs.entry.js +1 -1
  148. package/dist/cjs/swirl-icon-more-horizontal.cjs.entry.js +1 -1
  149. package/dist/cjs/swirl-icon-news-filled.cjs.entry.js +1 -1
  150. package/dist/cjs/swirl-icon-news-off.cjs.entry.js +1 -1
  151. package/dist/cjs/swirl-icon-news.cjs.entry.js +1 -1
  152. package/dist/cjs/swirl-icon-next-plan.cjs.entry.js +1 -1
  153. package/dist/cjs/swirl-icon-note-stack-filled.cjs.entry.js +1 -1
  154. package/dist/cjs/swirl-icon-note-stack.cjs.entry.js +1 -1
  155. package/dist/cjs/swirl-icon-notifications-active.cjs.entry.js +1 -1
  156. package/dist/cjs/swirl-icon-notifications-off.cjs.entry.js +1 -1
  157. package/dist/cjs/swirl-icon-notifications.cjs.entry.js +1 -1
  158. package/dist/cjs/swirl-icon-open-in-full.cjs.entry.js +1 -1
  159. package/dist/cjs/swirl-icon-open-in-new.cjs.entry.js +1 -1
  160. package/dist/cjs/swirl-icon-patient-list.cjs.entry.js +1 -1
  161. package/dist/cjs/swirl-icon-pause-circle.cjs.entry.js +1 -1
  162. package/dist/cjs/swirl-icon-pause.cjs.entry.js +1 -1
  163. package/dist/cjs/swirl-icon-people-alt.cjs.entry.js +1 -1
  164. package/dist/cjs/swirl-icon-person-check.cjs.entry.js +1 -1
  165. package/dist/cjs/swirl-icon-person-off.cjs.entry.js +1 -1
  166. package/dist/cjs/swirl-icon-person.cjs.entry.js +1 -1
  167. package/dist/cjs/swirl-icon-phone.cjs.entry.js +1 -1
  168. package/dist/cjs/swirl-icon-photo-camera.cjs.entry.js +1 -1
  169. package/dist/cjs/swirl-icon-picture-in-picture.cjs.entry.js +1 -1
  170. package/dist/cjs/swirl-icon-pin-off.cjs.entry.js +1 -1
  171. package/dist/cjs/swirl-icon-pin.cjs.entry.js +1 -1
  172. package/dist/cjs/swirl-icon-place.cjs.entry.js +1 -1
  173. package/dist/cjs/swirl-icon-play-arrow.cjs.entry.js +1 -1
  174. package/dist/cjs/swirl-icon-poll.cjs.entry.js +1 -1
  175. package/dist/cjs/swirl-icon-post-approval.cjs.entry.js +1 -1
  176. package/dist/cjs/swirl-icon-present.cjs.entry.js +1 -1
  177. package/dist/cjs/swirl-icon-preview.cjs.entry.js +1 -1
  178. package/dist/cjs/swirl-icon-print.cjs.entry.js +1 -1
  179. package/dist/cjs/swirl-icon-public-off.cjs.entry.js +1 -1
  180. package/dist/cjs/swirl-icon-public.cjs.entry.js +1 -1
  181. package/dist/cjs/swirl-icon-published-with-changes.cjs.entry.js +1 -1
  182. package/dist/cjs/swirl-icon-ratio-four-to-three.cjs.entry.js +1 -1
  183. package/dist/cjs/swirl-icon-ratio-freeform.cjs.entry.js +1 -1
  184. package/dist/cjs/swirl-icon-ratio-sixteen-to-nine.cjs.entry.js +1 -1
  185. package/dist/cjs/swirl-icon-ratio-square.cjs.entry.js +1 -1
  186. package/dist/cjs/swirl-icon-ratio-three-to-four.cjs.entry.js +1 -1
  187. package/dist/cjs/swirl-icon-ratio-three-to-two.cjs.entry.js +1 -1
  188. package/dist/cjs/swirl-icon-recieved.cjs.entry.js +1 -1
  189. package/dist/cjs/swirl-icon-refresh.cjs.entry.js +1 -1
  190. package/dist/cjs/swirl-icon-remove-circle.cjs.entry.js +1 -1
  191. package/dist/cjs/swirl-icon-remove-moderator.cjs.entry.js +1 -1
  192. package/dist/cjs/swirl-icon-reply.cjs.entry.js +1 -1
  193. package/dist/cjs/swirl-icon-report.cjs.entry.js +1 -1
  194. package/dist/cjs/swirl-icon-roadmap.cjs.entry.js +1 -1
  195. package/dist/cjs/swirl-icon-rotate-left.cjs.entry.js +1 -1
  196. package/dist/cjs/swirl-icon-rotate-right.cjs.entry.js +1 -1
  197. package/dist/cjs/swirl-icon-screenshare-off.cjs.entry.js +1 -1
  198. package/dist/cjs/swirl-icon-screenshare.cjs.entry.js +1 -1
  199. package/dist/cjs/swirl-icon-search-strong.cjs.entry.js +1 -1
  200. package/dist/cjs/swirl-icon-search.cjs.entry.js +1 -1
  201. package/dist/cjs/swirl-icon-section.cjs.entry.js +1 -1
  202. package/dist/cjs/swirl-icon-secure.cjs.entry.js +1 -1
  203. package/dist/cjs/swirl-icon-send.cjs.entry.js +1 -1
  204. package/dist/cjs/swirl-icon-settings.cjs.entry.js +1 -1
  205. package/dist/cjs/swirl-icon-short-text.cjs.entry.js +1 -1
  206. package/dist/cjs/swirl-icon-simplify.cjs.entry.js +1 -1
  207. package/dist/cjs/swirl-icon-spellcheck.cjs.entry.js +1 -1
  208. package/dist/cjs/swirl-icon-stars.cjs.entry.js +1 -1
  209. package/dist/cjs/swirl-icon-sticky-note.cjs.entry.js +1 -1
  210. package/dist/cjs/swirl-icon-stop-circle.cjs.entry.js +1 -1
  211. package/dist/cjs/swirl-icon-stop.cjs.entry.js +1 -1
  212. package/dist/cjs/swirl-icon-sunny.cjs.entry.js +1 -1
  213. package/dist/cjs/swirl-icon-sync.cjs.entry.js +1 -1
  214. package/dist/cjs/swirl-icon-tasks-filled.cjs.entry.js +1 -1
  215. package/dist/cjs/swirl-icon-tasks.cjs.entry.js +1 -1
  216. package/dist/cjs/swirl-icon-terminal.cjs.entry.js +1 -1
  217. package/dist/cjs/swirl-icon-time-filled.cjs.entry.js +1 -1
  218. package/dist/cjs/swirl-icon-time.cjs.entry.js +1 -1
  219. package/dist/cjs/swirl-icon-today-filled.cjs.entry.js +1 -1
  220. package/dist/cjs/swirl-icon-translate.cjs.entry.js +1 -1
  221. package/dist/cjs/swirl-icon-tree-structure.cjs.entry.js +1 -1
  222. package/dist/cjs/swirl-icon-undo.cjs.entry.js +1 -1
  223. package/dist/cjs/swirl-icon-unlock-person.cjs.entry.js +1 -1
  224. package/dist/cjs/swirl-icon-upload.cjs.entry.js +1 -1
  225. package/dist/cjs/swirl-icon-user-add.cjs.entry.js +1 -1
  226. package/dist/cjs/swirl-icon-user-assign.cjs.entry.js +1 -1
  227. package/dist/cjs/swirl-icon-video-camera-off.cjs.entry.js +1 -1
  228. package/dist/cjs/swirl-icon-video-camera.cjs.entry.js +1 -1
  229. package/dist/cjs/swirl-icon-video-library.cjs.entry.js +1 -1
  230. package/dist/cjs/swirl-icon-view-agenda.cjs.entry.js +1 -1
  231. package/dist/cjs/swirl-icon-voice.cjs.entry.js +1 -1
  232. package/dist/cjs/swirl-icon-volume-up.cjs.entry.js +1 -1
  233. package/dist/cjs/swirl-icon-web-asset-off.cjs.entry.js +1 -1
  234. package/dist/cjs/swirl-icon-web-asset.cjs.entry.js +1 -1
  235. package/dist/cjs/swirl-icon-work.cjs.entry.js +1 -1
  236. package/dist/cjs/swirl-lightbox.cjs.entry.js +1 -1
  237. package/dist/cjs/swirl-list.cjs.entry.js +1 -1
  238. package/dist/cjs/swirl-menu-item.cjs.entry.js +2 -2
  239. package/dist/cjs/swirl-modal-shell.cjs.entry.js +1 -1
  240. package/dist/cjs/swirl-option-list-section.cjs.entry.js +1 -1
  241. package/dist/cjs/swirl-option-list_2.cjs.entry.js +1 -1
  242. package/dist/cjs/swirl-pdf-reader.cjs.entry.js +3 -3
  243. package/dist/cjs/swirl-popover_2.cjs.entry.js +1 -1
  244. package/dist/cjs/swirl-radio-group.cjs.entry.js +1 -1
  245. package/dist/cjs/swirl-resource-list-file-item.cjs.entry.js +1 -1
  246. package/dist/cjs/swirl-resource-list-section.cjs.entry.js +1 -1
  247. package/dist/cjs/swirl-select.cjs.entry.js +2 -2
  248. package/dist/cjs/swirl-shell-layout.cjs.entry.js +8 -6
  249. package/dist/cjs/swirl-symbol-ac-unit.cjs.entry.js +1 -1
  250. package/dist/cjs/swirl-symbol-account-circle.cjs.entry.js +1 -1
  251. package/dist/cjs/swirl-symbol-alternate-email.cjs.entry.js +1 -1
  252. package/dist/cjs/swirl-symbol-android.cjs.entry.js +1 -1
  253. package/dist/cjs/swirl-symbol-announcement.cjs.entry.js +1 -1
  254. package/dist/cjs/swirl-symbol-autorenew.cjs.entry.js +1 -1
  255. package/dist/cjs/swirl-symbol-backup.cjs.entry.js +1 -1
  256. package/dist/cjs/swirl-symbol-badge.cjs.entry.js +1 -1
  257. package/dist/cjs/swirl-symbol-barcode-reader.cjs.entry.js +1 -1
  258. package/dist/cjs/swirl-symbol-barcode-scanner.cjs.entry.js +1 -1
  259. package/dist/cjs/swirl-symbol-battery-horiz.cjs.entry.js +1 -1
  260. package/dist/cjs/swirl-symbol-beach-access.cjs.entry.js +1 -1
  261. package/dist/cjs/swirl-symbol-bolt.cjs.entry.js +1 -1
  262. package/dist/cjs/swirl-symbol-bookmark.cjs.entry.js +1 -1
  263. package/dist/cjs/swirl-symbol-calendar.cjs.entry.js +1 -1
  264. package/dist/cjs/swirl-symbol-campaign.cjs.entry.js +1 -1
  265. package/dist/cjs/swirl-symbol-cards-star.cjs.entry.js +1 -1
  266. package/dist/cjs/swirl-symbol-cloud.cjs.entry.js +1 -1
  267. package/dist/cjs/swirl-symbol-construction.cjs.entry.js +1 -1
  268. package/dist/cjs/swirl-symbol-contacts.cjs.entry.js +1 -1
  269. package/dist/cjs/swirl-symbol-coronavirus.cjs.entry.js +1 -1
  270. package/dist/cjs/swirl-symbol-design-services.cjs.entry.js +1 -1
  271. package/dist/cjs/swirl-symbol-desktop-windows.cjs.entry.js +1 -1
  272. package/dist/cjs/swirl-symbol-directions-car-filled.cjs.entry.js +1 -1
  273. package/dist/cjs/swirl-symbol-diversity.cjs.entry.js +1 -1
  274. package/dist/cjs/swirl-symbol-draw.cjs.entry.js +1 -1
  275. package/dist/cjs/swirl-symbol-edit-calendar.cjs.entry.js +1 -1
  276. package/dist/cjs/swirl-symbol-email.cjs.entry.js +1 -1
  277. package/dist/cjs/swirl-symbol-emergency.cjs.entry.js +1 -1
  278. package/dist/cjs/swirl-symbol-emoji-food-beverage.cjs.entry.js +1 -1
  279. package/dist/cjs/swirl-symbol-engineering.cjs.entry.js +1 -1
  280. package/dist/cjs/swirl-symbol-event-menu.cjs.entry.js +1 -1
  281. package/dist/cjs/swirl-symbol-explore.cjs.entry.js +1 -1
  282. package/dist/cjs/swirl-symbol-extension.cjs.entry.js +1 -1
  283. package/dist/cjs/swirl-symbol-facebook.cjs.entry.js +1 -1
  284. package/dist/cjs/swirl-symbol-favorite.cjs.entry.js +1 -1
  285. package/dist/cjs/swirl-symbol-fitness-center.cjs.entry.js +1 -1
  286. package/dist/cjs/swirl-symbol-flag.cjs.entry.js +1 -1
  287. package/dist/cjs/swirl-symbol-flight.cjs.entry.js +1 -1
  288. package/dist/cjs/swirl-symbol-folder.cjs.entry.js +1 -1
  289. package/dist/cjs/swirl-symbol-globe.cjs.entry.js +1 -1
  290. package/dist/cjs/swirl-symbol-groups.cjs.entry.js +1 -1
  291. package/dist/cjs/swirl-symbol-healing.cjs.entry.js +1 -1
  292. package/dist/cjs/swirl-symbol-health-and-safety.cjs.entry.js +1 -1
  293. package/dist/cjs/swirl-symbol-help.cjs.entry.js +1 -1
  294. package/dist/cjs/swirl-symbol-home-repair-service.cjs.entry.js +1 -1
  295. package/dist/cjs/swirl-symbol-home-storage.cjs.entry.js +1 -1
  296. package/dist/cjs/swirl-symbol-id-card.cjs.entry.js +1 -1
  297. package/dist/cjs/swirl-symbol-image.cjs.entry.js +1 -1
  298. package/dist/cjs/swirl-symbol-info-menu.cjs.entry.js +1 -1
  299. package/dist/cjs/swirl-symbol-instagram.cjs.entry.js +1 -1
  300. package/dist/cjs/swirl-symbol-inventory-2.cjs.entry.js +1 -1
  301. package/dist/cjs/swirl-symbol-inventory.cjs.entry.js +1 -1
  302. package/dist/cjs/swirl-symbol-ios.cjs.entry.js +1 -1
  303. package/dist/cjs/swirl-symbol-key.cjs.entry.js +1 -1
  304. package/dist/cjs/swirl-symbol-language.cjs.entry.js +1 -1
  305. package/dist/cjs/swirl-symbol-leaderboard.cjs.entry.js +1 -1
  306. package/dist/cjs/swirl-symbol-lightbulb.cjs.entry.js +1 -1
  307. package/dist/cjs/swirl-symbol-linkedin.cjs.entry.js +1 -1
  308. package/dist/cjs/swirl-symbol-local-shipping.cjs.entry.js +1 -1
  309. package/dist/cjs/swirl-symbol-location-on.cjs.entry.js +1 -1
  310. package/dist/cjs/swirl-symbol-loyalty.cjs.entry.js +1 -1
  311. package/dist/cjs/swirl-symbol-map.cjs.entry.js +1 -1
  312. package/dist/cjs/swirl-symbol-maps-home-work.cjs.entry.js +1 -1
  313. package/dist/cjs/swirl-symbol-menu-book.cjs.entry.js +1 -1
  314. package/dist/cjs/swirl-symbol-mop.cjs.entry.js +1 -1
  315. package/dist/cjs/swirl-symbol-nest-eco-leaf.cjs.entry.js +1 -1
  316. package/dist/cjs/swirl-symbol-notifications.cjs.entry.js +1 -1
  317. package/dist/cjs/swirl-symbol-open-in-new.cjs.entry.js +1 -1
  318. package/dist/cjs/swirl-symbol-orders.cjs.entry.js +1 -1
  319. package/dist/cjs/swirl-symbol-package.cjs.entry.js +1 -1
  320. package/dist/cjs/swirl-symbol-palette.cjs.entry.js +1 -1
  321. package/dist/cjs/swirl-symbol-partly-cloudy-day.cjs.entry.js +1 -1
  322. package/dist/cjs/swirl-symbol-pedal-bike.cjs.entry.js +1 -1
  323. package/dist/cjs/swirl-symbol-percent-discount.cjs.entry.js +1 -1
  324. package/dist/cjs/swirl-symbol-pets.cjs.entry.js +1 -1
  325. package/dist/cjs/swirl-symbol-pinterest.cjs.entry.js +1 -1
  326. package/dist/cjs/swirl-symbol-point-of-sale.cjs.entry.js +1 -1
  327. package/dist/cjs/swirl-symbol-policy.cjs.entry.js +1 -1
  328. package/dist/cjs/swirl-symbol-precision-manufacturing.cjs.entry.js +1 -1
  329. package/dist/cjs/swirl-symbol-print.cjs.entry.js +1 -1
  330. package/dist/cjs/swirl-symbol-push-pin.cjs.entry.js +1 -1
  331. package/dist/cjs/swirl-symbol-recycling.cjs.entry.js +1 -1
  332. package/dist/cjs/swirl-symbol-redeem.cjs.entry.js +1 -1
  333. package/dist/cjs/swirl-symbol-report-problem.cjs.entry.js +1 -1
  334. package/dist/cjs/swirl-symbol-restaurant.cjs.entry.js +1 -1
  335. package/dist/cjs/swirl-symbol-roadmap.cjs.entry.js +1 -1
  336. package/dist/cjs/swirl-symbol-rocket-launch.cjs.entry.js +1 -1
  337. package/dist/cjs/swirl-symbol-room.cjs.entry.js +1 -1
  338. package/dist/cjs/swirl-symbol-savings.cjs.entry.js +1 -1
  339. package/dist/cjs/swirl-symbol-school.cjs.entry.js +1 -1
  340. package/dist/cjs/swirl-symbol-sell.cjs.entry.js +1 -1
  341. package/dist/cjs/swirl-symbol-settings-voice.cjs.entry.js +1 -1
  342. package/dist/cjs/swirl-symbol-shopping-bag.cjs.entry.js +1 -1
  343. package/dist/cjs/swirl-symbol-shopping-cart.cjs.entry.js +1 -1
  344. package/dist/cjs/swirl-symbol-smartphone.cjs.entry.js +1 -1
  345. package/dist/cjs/swirl-symbol-spa.cjs.entry.js +1 -1
  346. package/dist/cjs/swirl-symbol-sports-soccer.cjs.entry.js +1 -1
  347. package/dist/cjs/swirl-symbol-star.cjs.entry.js +1 -1
  348. package/dist/cjs/swirl-symbol-supervisor-account.cjs.entry.js +1 -1
  349. package/dist/cjs/swirl-symbol-task.cjs.entry.js +1 -1
  350. package/dist/cjs/swirl-symbol-tasks.cjs.entry.js +1 -1
  351. package/dist/cjs/swirl-symbol-thumbs-up-down.cjs.entry.js +1 -1
  352. package/dist/cjs/swirl-symbol-timer.cjs.entry.js +1 -1
  353. package/dist/cjs/swirl-symbol-tools-power-drill.cjs.entry.js +1 -1
  354. package/dist/cjs/swirl-symbol-train.cjs.entry.js +1 -1
  355. package/dist/cjs/swirl-symbol-trophy.cjs.entry.js +1 -1
  356. package/dist/cjs/swirl-symbol-twitter.cjs.entry.js +1 -1
  357. package/dist/cjs/swirl-symbol-video.cjs.entry.js +1 -1
  358. package/dist/cjs/swirl-symbol-warehouse.cjs.entry.js +1 -1
  359. package/dist/cjs/swirl-symbol-water-drop.cjs.entry.js +1 -1
  360. package/dist/cjs/swirl-symbol-wb-sunny.cjs.entry.js +1 -1
  361. package/dist/cjs/swirl-symbol-wechat.cjs.entry.js +1 -1
  362. package/dist/cjs/swirl-symbol-weibo.cjs.entry.js +1 -1
  363. package/dist/cjs/swirl-symbol-wifi.cjs.entry.js +1 -1
  364. package/dist/cjs/swirl-symbol-work.cjs.entry.js +1 -1
  365. package/dist/cjs/swirl-symbol-xing.cjs.entry.js +1 -1
  366. package/dist/cjs/swirl-symbol-youtube.cjs.entry.js +1 -1
  367. package/dist/cjs/swirl-symbol.cjs.entry.js +1 -1
  368. package/dist/cjs/swirl-table-cell.cjs.entry.js +1 -1
  369. package/dist/cjs/swirl-table-column.cjs.entry.js +3 -2
  370. package/dist/cjs/swirl-table-row-group.cjs.entry.js +2 -2
  371. package/dist/cjs/swirl-table-row.cjs.entry.js +1 -1
  372. package/dist/cjs/swirl-tabs.cjs.entry.js +1 -1
  373. package/dist/cjs/swirl-theme-provider.cjs.entry.js +1 -1
  374. package/dist/cjs/swirl-time-input.cjs.entry.js +1 -1
  375. package/dist/cjs/swirl-toggle-button.cjs.entry.js +1 -1
  376. package/dist/cjs/swirl-tree-navigation-item.cjs.entry.js +3 -3
  377. package/dist/cjs/swirl-tree-navigation.cjs.entry.js +1 -1
  378. package/dist/cjs/swirl-video-thumbnail.cjs.entry.js +1 -1
  379. package/dist/cjs/swirl-visually-hidden.cjs.entry.js +1 -1
  380. package/dist/collection/collection-manifest.json +2 -0
  381. package/dist/collection/components/swirl-avatar/swirl-avatar.css +2 -0
  382. package/dist/collection/components/swirl-data-cell/swirl-data-cell.css +100 -0
  383. package/dist/collection/components/swirl-data-cell/swirl-data-cell.js +120 -0
  384. package/dist/collection/components/swirl-data-cell/swirl-data-cell.stories.js +73 -0
  385. package/dist/collection/components/swirl-data-cell-stack/swirl-data-cell-stack.css +82 -0
  386. package/dist/collection/components/swirl-data-cell-stack/swirl-data-cell-stack.js +108 -0
  387. package/dist/collection/components/swirl-data-cell-stack/swirl-data-cell-stack.stories.js +71 -0
  388. package/dist/collection/components/swirl-date-input/swirl-date-input.js +1 -1
  389. package/dist/collection/components/swirl-date-picker/swirl-date-picker.js +1 -1
  390. package/dist/collection/components/swirl-description-list/swirl-description-list.js +1 -1
  391. package/dist/collection/components/swirl-description-list-item/swirl-description-list-item.js +1 -1
  392. package/dist/collection/components/swirl-emoji/emojis/swirl-emoji-clap.js +1 -1
  393. package/dist/collection/components/swirl-emoji/emojis/swirl-emoji-happy.js +1 -1
  394. package/dist/collection/components/swirl-emoji/emojis/swirl-emoji-idea.js +1 -1
  395. package/dist/collection/components/swirl-emoji/emojis/swirl-emoji-love.js +1 -1
  396. package/dist/collection/components/swirl-emoji/emojis/swirl-emoji-sad.js +1 -1
  397. package/dist/collection/components/swirl-emoji/emojis/swirl-emoji-thumbs-up.js +1 -1
  398. package/dist/collection/components/swirl-emoji/swirl-emoji.js +1 -1
  399. package/dist/collection/components/swirl-empty-state/swirl-empty-state.js +1 -1
  400. package/dist/collection/components/swirl-file-chip/swirl-file-chip.js +1 -1
  401. package/dist/collection/components/swirl-file-uploader/swirl-file-uploader.js +2 -2
  402. package/dist/collection/components/swirl-file-viewer/swirl-file-viewer.js +1 -1
  403. package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-audio/swirl-file-viewer-audio.js +1 -1
  404. package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-csv/swirl-file-viewer-csv.js +1 -1
  405. package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-fallback/swirl-file-viewer-fallback.js +1 -1
  406. package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-image/swirl-file-viewer-image.js +1 -1
  407. package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-text/swirl-file-viewer-text.js +1 -1
  408. package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-video/swirl-file-viewer-video.js +1 -1
  409. package/dist/collection/components/swirl-icon/icons/swirl-icon-add-moderator.js +1 -1
  410. package/dist/collection/components/swirl-icon/icons/swirl-icon-add-photo.js +1 -1
  411. package/dist/collection/components/swirl-icon/icons/swirl-icon-add-reaction.js +1 -1
  412. package/dist/collection/components/swirl-icon/icons/swirl-icon-add.js +1 -1
  413. package/dist/collection/components/swirl-icon/icons/swirl-icon-admin-panel-settings.js +1 -1
  414. package/dist/collection/components/swirl-icon/icons/swirl-icon-ai-filled.js +1 -1
  415. package/dist/collection/components/swirl-icon/icons/swirl-icon-ai.js +1 -1
  416. package/dist/collection/components/swirl-icon/icons/swirl-icon-apps.js +1 -1
  417. package/dist/collection/components/swirl-icon/icons/swirl-icon-arrow-back.js +1 -1
  418. package/dist/collection/components/swirl-icon/icons/swirl-icon-arrow-downward.js +1 -1
  419. package/dist/collection/components/swirl-icon/icons/swirl-icon-arrow-forward.js +1 -1
  420. package/dist/collection/components/swirl-icon/icons/swirl-icon-arrow-left.js +1 -1
  421. package/dist/collection/components/swirl-icon/icons/swirl-icon-arrow-right-small.js +1 -1
  422. package/dist/collection/components/swirl-icon/icons/swirl-icon-arrow-right.js +1 -1
  423. package/dist/collection/components/swirl-icon/icons/swirl-icon-arrow-upward.js +1 -1
  424. package/dist/collection/components/swirl-icon/icons/swirl-icon-aspect-ratio.js +1 -1
  425. package/dist/collection/components/swirl-icon/icons/swirl-icon-attachment.js +1 -1
  426. package/dist/collection/components/swirl-icon/icons/swirl-icon-audio-file.js +1 -1
  427. package/dist/collection/components/swirl-icon/icons/swirl-icon-autorenew.js +1 -1
  428. package/dist/collection/components/swirl-icon/icons/swirl-icon-bar-chart.js +1 -1
  429. package/dist/collection/components/swirl-icon/icons/swirl-icon-beach-access-filled.js +1 -1
  430. package/dist/collection/components/swirl-icon/icons/swirl-icon-beach-access.js +1 -1
  431. package/dist/collection/components/swirl-icon/icons/swirl-icon-block.js +1 -1
  432. package/dist/collection/components/swirl-icon/icons/swirl-icon-bookmark-filled.js +1 -1
  433. package/dist/collection/components/swirl-icon/icons/swirl-icon-bookmark.js +1 -1
  434. package/dist/collection/components/swirl-icon/icons/swirl-icon-calendar-add-on-filled.js +1 -1
  435. package/dist/collection/components/swirl-icon/icons/swirl-icon-calendar-respond.js +1 -1
  436. package/dist/collection/components/swirl-icon/icons/swirl-icon-calendar-today.js +1 -1
  437. package/dist/collection/components/swirl-icon/icons/swirl-icon-call-end.js +1 -1
  438. package/dist/collection/components/swirl-icon/icons/swirl-icon-call.js +1 -1
  439. package/dist/collection/components/swirl-icon/icons/swirl-icon-cancel-filled.js +1 -1
  440. package/dist/collection/components/swirl-icon/icons/swirl-icon-cancel-outline.js +1 -1
  441. package/dist/collection/components/swirl-icon/icons/swirl-icon-cancel.js +1 -1
  442. package/dist/collection/components/swirl-icon/icons/swirl-icon-chat-bubble.js +1 -1
  443. package/dist/collection/components/swirl-icon/icons/swirl-icon-chats-filled.js +1 -1
  444. package/dist/collection/components/swirl-icon/icons/swirl-icon-chats.js +1 -1
  445. package/dist/collection/components/swirl-icon/icons/swirl-icon-check-circle-filled.js +1 -1
  446. package/dist/collection/components/swirl-icon/icons/swirl-icon-check-circle.js +1 -1
  447. package/dist/collection/components/swirl-icon/icons/swirl-icon-check-small.js +1 -1
  448. package/dist/collection/components/swirl-icon/icons/swirl-icon-check-strong.js +1 -1
  449. package/dist/collection/components/swirl-icon/icons/swirl-icon-check.js +1 -1
  450. package/dist/collection/components/swirl-icon/icons/swirl-icon-checkbox-filled.js +1 -1
  451. package/dist/collection/components/swirl-icon/icons/swirl-icon-chevron-left.js +1 -1
  452. package/dist/collection/components/swirl-icon/icons/swirl-icon-chevron-right.js +1 -1
  453. package/dist/collection/components/swirl-icon/icons/swirl-icon-close-fullscreen.js +1 -1
  454. package/dist/collection/components/swirl-icon/icons/swirl-icon-close-small.js +1 -1
  455. package/dist/collection/components/swirl-icon/icons/swirl-icon-close.js +1 -1
  456. package/dist/collection/components/swirl-icon/icons/swirl-icon-cloud-upload.js +1 -1
  457. package/dist/collection/components/swirl-icon/icons/swirl-icon-column.js +1 -1
  458. package/dist/collection/components/swirl-icon/icons/swirl-icon-comment.js +1 -1
  459. package/dist/collection/components/swirl-icon/icons/swirl-icon-contrast.js +1 -1
  460. package/dist/collection/components/swirl-icon/icons/swirl-icon-copy.js +1 -1
  461. package/dist/collection/components/swirl-icon/icons/swirl-icon-crop.js +1 -1
  462. package/dist/collection/components/swirl-icon/icons/swirl-icon-dark-mode.js +1 -1
  463. package/dist/collection/components/swirl-icon/icons/swirl-icon-date-range.js +1 -1
  464. package/dist/collection/components/swirl-icon/icons/swirl-icon-delete.js +1 -1
  465. package/dist/collection/components/swirl-icon/icons/swirl-icon-deployed-code.js +1 -1
  466. package/dist/collection/components/swirl-icon/icons/swirl-icon-description.js +1 -1
  467. package/dist/collection/components/swirl-icon/icons/swirl-icon-desktop.js +1 -1
  468. package/dist/collection/components/swirl-icon/icons/swirl-icon-directory-filled.js +1 -1
  469. package/dist/collection/components/swirl-icon/icons/swirl-icon-directory.js +1 -1
  470. package/dist/collection/components/swirl-icon/icons/swirl-icon-discover.js +1 -1
  471. package/dist/collection/components/swirl-icon/icons/swirl-icon-dock-left-collapse.js +1 -1
  472. package/dist/collection/components/swirl-icon/icons/swirl-icon-dock-left-expand.js +1 -1
  473. package/dist/collection/components/swirl-icon/icons/swirl-icon-dock-left.js +1 -1
  474. package/dist/collection/components/swirl-icon/icons/swirl-icon-door-open.js +1 -1
  475. package/dist/collection/components/swirl-icon/icons/swirl-icon-dot.js +1 -1
  476. package/dist/collection/components/swirl-icon/icons/swirl-icon-double-arrow-left.js +1 -1
  477. package/dist/collection/components/swirl-icon/icons/swirl-icon-double-arrow-right.js +1 -1
  478. package/dist/collection/components/swirl-icon/icons/swirl-icon-download.js +1 -1
  479. package/dist/collection/components/swirl-icon/icons/swirl-icon-drag-handle.js +1 -1
  480. package/dist/collection/components/swirl-icon/icons/swirl-icon-edit-note.js +1 -1
  481. package/dist/collection/components/swirl-icon/icons/swirl-icon-edit.js +1 -1
  482. package/dist/collection/components/swirl-icon/icons/swirl-icon-emoji-mood.js +1 -1
  483. package/dist/collection/components/swirl-icon/icons/swirl-icon-emoji-satisfied.js +1 -1
  484. package/dist/collection/components/swirl-icon/icons/swirl-icon-emoji-symbols.js +1 -1
  485. package/dist/collection/components/swirl-icon/icons/swirl-icon-error.js +1 -1
  486. package/dist/collection/components/swirl-icon/icons/swirl-icon-expand-less.js +1 -1
  487. package/dist/collection/components/swirl-icon/icons/swirl-icon-expand-more.js +1 -1
  488. package/dist/collection/components/swirl-icon/icons/swirl-icon-experiment.js +1 -1
  489. package/dist/collection/components/swirl-icon/icons/swirl-icon-file-copy.js +1 -1
  490. package/dist/collection/components/swirl-icon/icons/swirl-icon-file.js +1 -1
  491. package/dist/collection/components/swirl-icon/icons/swirl-icon-filter.js +1 -1
  492. package/dist/collection/components/swirl-icon/icons/swirl-icon-folder-shared.js +1 -1
  493. package/dist/collection/components/swirl-icon/icons/swirl-icon-folder.js +1 -1
  494. package/dist/collection/components/swirl-icon/icons/swirl-icon-format-h-one.js +1 -1
  495. package/dist/collection/components/swirl-icon/icons/swirl-icon-format-list-bulleted.js +1 -1
  496. package/dist/collection/components/swirl-icon/icons/swirl-icon-forward.js +1 -1
  497. package/dist/collection/components/swirl-icon/icons/swirl-icon-fullscreen-exit.js +1 -1
  498. package/dist/collection/components/swirl-icon/icons/swirl-icon-fullscreen.js +1 -1
  499. package/dist/collection/components/swirl-icon/icons/swirl-icon-gif.js +1 -1
  500. package/dist/collection/components/swirl-icon/icons/swirl-icon-group-add.js +1 -1
  501. package/dist/collection/components/swirl-icon/icons/swirl-icon-group-assign.js +1 -1
  502. package/dist/collection/components/swirl-icon/icons/swirl-icon-groups-filled.js +1 -1
  503. package/dist/collection/components/swirl-icon/icons/swirl-icon-groups.js +1 -1
  504. package/dist/collection/components/swirl-icon/icons/swirl-icon-hamburger-menu.js +1 -1
  505. package/dist/collection/components/swirl-icon/icons/swirl-icon-health-and-safety.js +1 -1
  506. package/dist/collection/components/swirl-icon/icons/swirl-icon-help-filled.js +1 -1
  507. package/dist/collection/components/swirl-icon/icons/swirl-icon-help.js +1 -1
  508. package/dist/collection/components/swirl-icon/icons/swirl-icon-highlight.js +1 -1
  509. package/dist/collection/components/swirl-icon/icons/swirl-icon-history.js +1 -1
  510. package/dist/collection/components/swirl-icon/icons/swirl-icon-home-filled.js +1 -1
  511. package/dist/collection/components/swirl-icon/icons/swirl-icon-home.js +1 -1
  512. package/dist/collection/components/swirl-icon/icons/swirl-icon-hr-resting.js +1 -1
  513. package/dist/collection/components/swirl-icon/icons/swirl-icon-image.js +1 -1
  514. package/dist/collection/components/swirl-icon/icons/swirl-icon-improve-text.js +1 -1
  515. package/dist/collection/components/swirl-icon/icons/swirl-icon-info.js +1 -1
  516. package/dist/collection/components/swirl-icon/icons/swirl-icon-insert-below.js +1 -1
  517. package/dist/collection/components/swirl-icon/icons/swirl-icon-insert-chart.js +1 -1
  518. package/dist/collection/components/swirl-icon/icons/swirl-icon-insert-on-top.js +1 -1
  519. package/dist/collection/components/swirl-icon/icons/swirl-icon-inventory-off.js +1 -1
  520. package/dist/collection/components/swirl-icon/icons/swirl-icon-inventory.js +1 -1
  521. package/dist/collection/components/swirl-icon/icons/swirl-icon-iphone.js +1 -1
  522. package/dist/collection/components/swirl-icon/icons/swirl-icon-key.js +1 -1
  523. package/dist/collection/components/swirl-icon/icons/swirl-icon-keyboard-hide.js +1 -1
  524. package/dist/collection/components/swirl-icon/icons/swirl-icon-keyboard.js +1 -1
  525. package/dist/collection/components/swirl-icon/icons/swirl-icon-language.js +1 -1
  526. package/dist/collection/components/swirl-icon/icons/swirl-icon-light-mode.js +1 -1
  527. package/dist/collection/components/swirl-icon/icons/swirl-icon-like.js +1 -1
  528. package/dist/collection/components/swirl-icon/icons/swirl-icon-link.js +1 -1
  529. package/dist/collection/components/swirl-icon/icons/swirl-icon-live.js +1 -1
  530. package/dist/collection/components/swirl-icon/icons/swirl-icon-load.js +1 -1
  531. package/dist/collection/components/swirl-icon/icons/swirl-icon-location-on.js +1 -1
  532. package/dist/collection/components/swirl-icon/icons/swirl-icon-lock-open.js +1 -1
  533. package/dist/collection/components/swirl-icon/icons/swirl-icon-lock-person.js +1 -1
  534. package/dist/collection/components/swirl-icon/icons/swirl-icon-lock.js +1 -1
  535. package/dist/collection/components/swirl-icon/icons/swirl-icon-login.js +1 -1
  536. package/dist/collection/components/swirl-icon/icons/swirl-icon-logout.js +1 -1
  537. package/dist/collection/components/swirl-icon/icons/swirl-icon-long-text.js +1 -1
  538. package/dist/collection/components/swirl-icon/icons/swirl-icon-mail.js +1 -1
  539. package/dist/collection/components/swirl-icon/icons/swirl-icon-manage-accounts.js +1 -1
  540. package/dist/collection/components/swirl-icon/icons/swirl-icon-mark-chat-read.js +1 -1
  541. package/dist/collection/components/swirl-icon/icons/swirl-icon-mark-chat-unread.js +1 -1
  542. package/dist/collection/components/swirl-icon/icons/swirl-icon-mention.js +1 -1
  543. package/dist/collection/components/swirl-icon/icons/swirl-icon-menu-book-filled.js +1 -1
  544. package/dist/collection/components/swirl-icon/icons/swirl-icon-menu-book.js +1 -1
  545. package/dist/collection/components/swirl-icon/icons/swirl-icon-menu-filled.js +1 -1
  546. package/dist/collection/components/swirl-icon/icons/swirl-icon-menu.js +1 -1
  547. package/dist/collection/components/swirl-icon/icons/swirl-icon-message.js +1 -1
  548. package/dist/collection/components/swirl-icon/icons/swirl-icon-mic-off.js +1 -1
  549. package/dist/collection/components/swirl-icon/icons/swirl-icon-mic.js +1 -1
  550. package/dist/collection/components/swirl-icon/icons/swirl-icon-more-horizontal.js +1 -1
  551. package/dist/collection/components/swirl-icon/icons/swirl-icon-more-vertikal.js +1 -1
  552. package/dist/collection/components/swirl-icon/icons/swirl-icon-news-filled.js +1 -1
  553. package/dist/collection/components/swirl-icon/icons/swirl-icon-news-off.js +1 -1
  554. package/dist/collection/components/swirl-icon/icons/swirl-icon-news.js +1 -1
  555. package/dist/collection/components/swirl-icon/icons/swirl-icon-next-plan.js +1 -1
  556. package/dist/collection/components/swirl-icon/icons/swirl-icon-note-stack-filled.js +1 -1
  557. package/dist/collection/components/swirl-icon/icons/swirl-icon-note-stack.js +1 -1
  558. package/dist/collection/components/swirl-icon/icons/swirl-icon-notifications-active.js +1 -1
  559. package/dist/collection/components/swirl-icon/icons/swirl-icon-notifications-off.js +1 -1
  560. package/dist/collection/components/swirl-icon/icons/swirl-icon-notifications.js +1 -1
  561. package/dist/collection/components/swirl-icon/icons/swirl-icon-open-in-full.js +1 -1
  562. package/dist/collection/components/swirl-icon/icons/swirl-icon-open-in-new.js +1 -1
  563. package/dist/collection/components/swirl-icon/icons/swirl-icon-patient-list.js +1 -1
  564. package/dist/collection/components/swirl-icon/icons/swirl-icon-pause-circle.js +1 -1
  565. package/dist/collection/components/swirl-icon/icons/swirl-icon-pause.js +1 -1
  566. package/dist/collection/components/swirl-icon/icons/swirl-icon-people-alt.js +1 -1
  567. package/dist/collection/components/swirl-icon/icons/swirl-icon-person-check.js +1 -1
  568. package/dist/collection/components/swirl-icon/icons/swirl-icon-person-off.js +1 -1
  569. package/dist/collection/components/swirl-icon/icons/swirl-icon-person.js +1 -1
  570. package/dist/collection/components/swirl-icon/icons/swirl-icon-phone.js +1 -1
  571. package/dist/collection/components/swirl-icon/icons/swirl-icon-photo-camera.js +1 -1
  572. package/dist/collection/components/swirl-icon/icons/swirl-icon-picture-as-pdf.js +1 -1
  573. package/dist/collection/components/swirl-icon/icons/swirl-icon-picture-in-picture.js +1 -1
  574. package/dist/collection/components/swirl-icon/icons/swirl-icon-pin-off.js +1 -1
  575. package/dist/collection/components/swirl-icon/icons/swirl-icon-pin.js +1 -1
  576. package/dist/collection/components/swirl-icon/icons/swirl-icon-place.js +1 -1
  577. package/dist/collection/components/swirl-icon/icons/swirl-icon-play-arrow.js +1 -1
  578. package/dist/collection/components/swirl-icon/icons/swirl-icon-poll.js +1 -1
  579. package/dist/collection/components/swirl-icon/icons/swirl-icon-post-approval.js +1 -1
  580. package/dist/collection/components/swirl-icon/icons/swirl-icon-present.js +1 -1
  581. package/dist/collection/components/swirl-icon/icons/swirl-icon-preview.js +1 -1
  582. package/dist/collection/components/swirl-icon/icons/swirl-icon-print.js +1 -1
  583. package/dist/collection/components/swirl-icon/icons/swirl-icon-public-off.js +1 -1
  584. package/dist/collection/components/swirl-icon/icons/swirl-icon-public.js +1 -1
  585. package/dist/collection/components/swirl-icon/icons/swirl-icon-published-with-changes.js +1 -1
  586. package/dist/collection/components/swirl-icon/icons/swirl-icon-ratio-four-to-three.js +1 -1
  587. package/dist/collection/components/swirl-icon/icons/swirl-icon-ratio-freeform.js +1 -1
  588. package/dist/collection/components/swirl-icon/icons/swirl-icon-ratio-sixteen-to-nine.js +1 -1
  589. package/dist/collection/components/swirl-icon/icons/swirl-icon-ratio-square.js +1 -1
  590. package/dist/collection/components/swirl-icon/icons/swirl-icon-ratio-three-to-four.js +1 -1
  591. package/dist/collection/components/swirl-icon/icons/swirl-icon-ratio-three-to-two.js +1 -1
  592. package/dist/collection/components/swirl-icon/icons/swirl-icon-recieved.js +1 -1
  593. package/dist/collection/components/swirl-icon/icons/swirl-icon-refresh.js +1 -1
  594. package/dist/collection/components/swirl-icon/icons/swirl-icon-remove-circle.js +1 -1
  595. package/dist/collection/components/swirl-icon/icons/swirl-icon-remove-moderator.js +1 -1
  596. package/dist/collection/components/swirl-icon/icons/swirl-icon-remove.js +1 -1
  597. package/dist/collection/components/swirl-icon/icons/swirl-icon-reply.js +1 -1
  598. package/dist/collection/components/swirl-icon/icons/swirl-icon-report.js +1 -1
  599. package/dist/collection/components/swirl-icon/icons/swirl-icon-roadmap.js +1 -1
  600. package/dist/collection/components/swirl-icon/icons/swirl-icon-rotate-left.js +1 -1
  601. package/dist/collection/components/swirl-icon/icons/swirl-icon-rotate-right.js +1 -1
  602. package/dist/collection/components/swirl-icon/icons/swirl-icon-screenshare-off.js +1 -1
  603. package/dist/collection/components/swirl-icon/icons/swirl-icon-screenshare.js +1 -1
  604. package/dist/collection/components/swirl-icon/icons/swirl-icon-search-strong.js +1 -1
  605. package/dist/collection/components/swirl-icon/icons/swirl-icon-search.js +1 -1
  606. package/dist/collection/components/swirl-icon/icons/swirl-icon-section.js +1 -1
  607. package/dist/collection/components/swirl-icon/icons/swirl-icon-secure.js +1 -1
  608. package/dist/collection/components/swirl-icon/icons/swirl-icon-send.js +1 -1
  609. package/dist/collection/components/swirl-icon/icons/swirl-icon-settings.js +1 -1
  610. package/dist/collection/components/swirl-icon/icons/swirl-icon-short-text.js +1 -1
  611. package/dist/collection/components/swirl-icon/icons/swirl-icon-simplify.js +1 -1
  612. package/dist/collection/components/swirl-icon/icons/swirl-icon-spellcheck.js +1 -1
  613. package/dist/collection/components/swirl-icon/icons/swirl-icon-stars.js +1 -1
  614. package/dist/collection/components/swirl-icon/icons/swirl-icon-sticky-note.js +1 -1
  615. package/dist/collection/components/swirl-icon/icons/swirl-icon-stop-circle.js +1 -1
  616. package/dist/collection/components/swirl-icon/icons/swirl-icon-stop.js +1 -1
  617. package/dist/collection/components/swirl-icon/icons/swirl-icon-sunny.js +1 -1
  618. package/dist/collection/components/swirl-icon/icons/swirl-icon-sync.js +1 -1
  619. package/dist/collection/components/swirl-icon/icons/swirl-icon-tasks-filled.js +1 -1
  620. package/dist/collection/components/swirl-icon/icons/swirl-icon-tasks.js +1 -1
  621. package/dist/collection/components/swirl-icon/icons/swirl-icon-terminal.js +1 -1
  622. package/dist/collection/components/swirl-icon/icons/swirl-icon-time-filled.js +1 -1
  623. package/dist/collection/components/swirl-icon/icons/swirl-icon-time.js +1 -1
  624. package/dist/collection/components/swirl-icon/icons/swirl-icon-today-filled.js +1 -1
  625. package/dist/collection/components/swirl-icon/icons/swirl-icon-today.js +1 -1
  626. package/dist/collection/components/swirl-icon/icons/swirl-icon-translate.js +1 -1
  627. package/dist/collection/components/swirl-icon/icons/swirl-icon-tree-structure.js +1 -1
  628. package/dist/collection/components/swirl-icon/icons/swirl-icon-undo.js +1 -1
  629. package/dist/collection/components/swirl-icon/icons/swirl-icon-unlock-person.js +1 -1
  630. package/dist/collection/components/swirl-icon/icons/swirl-icon-upload.js +1 -1
  631. package/dist/collection/components/swirl-icon/icons/swirl-icon-user-add.js +1 -1
  632. package/dist/collection/components/swirl-icon/icons/swirl-icon-user-assign.js +1 -1
  633. package/dist/collection/components/swirl-icon/icons/swirl-icon-video-camera-off.js +1 -1
  634. package/dist/collection/components/swirl-icon/icons/swirl-icon-video-camera.js +1 -1
  635. package/dist/collection/components/swirl-icon/icons/swirl-icon-video-library.js +1 -1
  636. package/dist/collection/components/swirl-icon/icons/swirl-icon-video-player.js +1 -1
  637. package/dist/collection/components/swirl-icon/icons/swirl-icon-view-agenda.js +1 -1
  638. package/dist/collection/components/swirl-icon/icons/swirl-icon-visibility-off.js +1 -1
  639. package/dist/collection/components/swirl-icon/icons/swirl-icon-visibility.js +1 -1
  640. package/dist/collection/components/swirl-icon/icons/swirl-icon-voice.js +1 -1
  641. package/dist/collection/components/swirl-icon/icons/swirl-icon-volume-up.js +1 -1
  642. package/dist/collection/components/swirl-icon/icons/swirl-icon-warning.js +1 -1
  643. package/dist/collection/components/swirl-icon/icons/swirl-icon-web-asset-off.js +1 -1
  644. package/dist/collection/components/swirl-icon/icons/swirl-icon-web-asset.js +1 -1
  645. package/dist/collection/components/swirl-icon/icons/swirl-icon-work.js +1 -1
  646. package/dist/collection/components/swirl-lightbox/swirl-lightbox.js +1 -1
  647. package/dist/collection/components/swirl-list/swirl-list.js +1 -1
  648. package/dist/collection/components/swirl-menu-item/swirl-menu-item.js +2 -2
  649. package/dist/collection/components/swirl-modal-shell/swirl-modal-shell.js +1 -1
  650. package/dist/collection/components/swirl-option-list/swirl-option-list.js +1 -1
  651. package/dist/collection/components/swirl-option-list-section/swirl-option-list-section.js +1 -1
  652. package/dist/collection/components/swirl-pdf-reader/swirl-pdf-reader.js +3 -3
  653. package/dist/collection/components/swirl-popover-trigger/swirl-popover-trigger.js +1 -1
  654. package/dist/collection/components/swirl-radio-group/swirl-radio-group.js +1 -1
  655. package/dist/collection/components/swirl-resource-list-file-item/swirl-resource-list-file-item.js +1 -1
  656. package/dist/collection/components/swirl-resource-list-section/swirl-resource-list-section.js +1 -1
  657. package/dist/collection/components/swirl-select/swirl-select.js +2 -2
  658. package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.js +46 -6
  659. package/dist/collection/components/swirl-symbol/swirl-symbol.js +1 -1
  660. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-ac-unit.js +1 -1
  661. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-account-circle.js +1 -1
  662. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-alternate-email.js +1 -1
  663. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-android.js +1 -1
  664. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-announcement.js +1 -1
  665. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-autorenew.js +1 -1
  666. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-backup.js +1 -1
  667. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-badge.js +1 -1
  668. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-barcode-reader.js +1 -1
  669. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-barcode-scanner.js +1 -1
  670. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-battery-horiz.js +1 -1
  671. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-beach-access.js +1 -1
  672. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-bolt.js +1 -1
  673. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-bookmark.js +1 -1
  674. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-calendar.js +1 -1
  675. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-campaign.js +1 -1
  676. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-cards-star.js +1 -1
  677. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-cloud.js +1 -1
  678. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-construction.js +1 -1
  679. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-contacts.js +1 -1
  680. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-coronavirus.js +1 -1
  681. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-design-services.js +1 -1
  682. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-desktop-windows.js +1 -1
  683. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-directions-car-filled.js +1 -1
  684. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-diversity.js +1 -1
  685. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-draw.js +1 -1
  686. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-edit-calendar.js +1 -1
  687. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-email.js +1 -1
  688. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-emergency.js +1 -1
  689. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-emoji-food-beverage.js +1 -1
  690. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-engineering.js +1 -1
  691. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-event-menu.js +1 -1
  692. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-explore.js +1 -1
  693. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-extension.js +1 -1
  694. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-facebook.js +1 -1
  695. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-favorite.js +1 -1
  696. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-fitness-center.js +1 -1
  697. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-flag.js +1 -1
  698. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-flight.js +1 -1
  699. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-folder.js +1 -1
  700. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-globe.js +1 -1
  701. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-groups.js +1 -1
  702. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-healing.js +1 -1
  703. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-health-and-safety.js +1 -1
  704. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-help.js +1 -1
  705. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-home-repair-service.js +1 -1
  706. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-home-storage.js +1 -1
  707. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-id-card.js +1 -1
  708. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-image.js +1 -1
  709. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-info-menu.js +1 -1
  710. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-instagram.js +1 -1
  711. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-inventory-2.js +1 -1
  712. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-inventory.js +1 -1
  713. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-ios.js +1 -1
  714. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-key.js +1 -1
  715. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-language.js +1 -1
  716. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-leaderboard.js +1 -1
  717. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-lightbulb.js +1 -1
  718. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-linkedin.js +1 -1
  719. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-local-shipping.js +1 -1
  720. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-location-on.js +1 -1
  721. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-loyalty.js +1 -1
  722. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-map.js +1 -1
  723. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-maps-home-work.js +1 -1
  724. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-menu-book.js +1 -1
  725. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-mop.js +1 -1
  726. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-nest-eco-leaf.js +1 -1
  727. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-notifications.js +1 -1
  728. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-open-in-new.js +1 -1
  729. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-orders.js +1 -1
  730. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-package.js +1 -1
  731. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-palette.js +1 -1
  732. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-partly-cloudy-day.js +1 -1
  733. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-pedal-bike.js +1 -1
  734. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-percent-discount.js +1 -1
  735. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-pets.js +1 -1
  736. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-pinterest.js +1 -1
  737. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-point-of-sale.js +1 -1
  738. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-policy.js +1 -1
  739. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-precision-manufacturing.js +1 -1
  740. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-print.js +1 -1
  741. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-push-pin.js +1 -1
  742. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-recycling.js +1 -1
  743. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-redeem.js +1 -1
  744. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-report-problem.js +1 -1
  745. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-restaurant.js +1 -1
  746. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-roadmap.js +1 -1
  747. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-rocket-launch.js +1 -1
  748. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-room.js +1 -1
  749. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-savings.js +1 -1
  750. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-school.js +1 -1
  751. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-sell.js +1 -1
  752. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-settings-voice.js +1 -1
  753. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-shopping-bag.js +1 -1
  754. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-shopping-cart.js +1 -1
  755. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-smartphone.js +1 -1
  756. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-spa.js +1 -1
  757. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-sports-soccer.js +1 -1
  758. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-star.js +1 -1
  759. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-supervisor-account.js +1 -1
  760. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-task.js +1 -1
  761. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-tasks.js +1 -1
  762. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-thumbs-up-down.js +1 -1
  763. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-timer.js +1 -1
  764. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-tools-power-drill.js +1 -1
  765. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-train.js +1 -1
  766. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-trophy.js +1 -1
  767. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-twitter.js +1 -1
  768. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-video.js +1 -1
  769. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-warehouse.js +1 -1
  770. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-water-drop.js +1 -1
  771. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-wb-sunny.js +1 -1
  772. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-wechat.js +1 -1
  773. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-weibo.js +1 -1
  774. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-wifi.js +1 -1
  775. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-work.js +1 -1
  776. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-xing.js +1 -1
  777. package/dist/collection/components/swirl-symbol/symbols/swirl-symbol-youtube.js +1 -1
  778. package/dist/collection/components/swirl-table-cell/swirl-table-cell.js +1 -1
  779. package/dist/collection/components/swirl-table-column/swirl-table-column.css +4 -0
  780. package/dist/collection/components/swirl-table-column/swirl-table-column.js +3 -2
  781. package/dist/collection/components/swirl-table-row/swirl-table-row.js +1 -1
  782. package/dist/collection/components/swirl-table-row-group/swirl-table-row-group.js +2 -2
  783. package/dist/collection/components/swirl-tabs/swirl-tabs.js +1 -1
  784. package/dist/collection/components/swirl-theme-provider/swirl-theme-provider.js +1 -1
  785. package/dist/collection/components/swirl-time-input/swirl-time-input.js +1 -1
  786. package/dist/collection/components/swirl-toggle-button/swirl-toggle-button.js +1 -1
  787. package/dist/collection/components/swirl-tree-navigation/swirl-tree-navigation.js +1 -1
  788. package/dist/collection/components/swirl-tree-navigation-item/swirl-tree-navigation-item.js +3 -3
  789. package/dist/collection/components/swirl-video-thumbnail/swirl-video-thumbnail.js +1 -1
  790. package/dist/collection/components/swirl-visually-hidden/swirl-visually-hidden.js +1 -1
  791. package/dist/collection/prototypes/file-manager/file-manager.js +1 -1
  792. package/dist/components/assets/pdfjs/pdf.worker.min.mjs +1 -1
  793. package/dist/components/file-manager.js +1 -1
  794. package/dist/components/index.js +4 -0
  795. package/dist/components/swirl-avatar.js +1 -1
  796. package/dist/components/swirl-data-cell-stack.d.ts +11 -0
  797. package/dist/components/swirl-data-cell-stack.js +59 -0
  798. package/dist/components/swirl-data-cell.d.ts +11 -0
  799. package/dist/components/swirl-data-cell.js +65 -0
  800. package/dist/components/swirl-date-input.js +1 -1
  801. package/dist/components/swirl-date-picker2.js +1 -1
  802. package/dist/components/swirl-description-list-item.js +1 -1
  803. package/dist/components/swirl-description-list.js +1 -1
  804. package/dist/components/swirl-emoji-clap.js +1 -1
  805. package/dist/components/swirl-emoji-happy.js +1 -1
  806. package/dist/components/swirl-emoji-idea.js +1 -1
  807. package/dist/components/swirl-emoji-love.js +1 -1
  808. package/dist/components/swirl-emoji-sad.js +1 -1
  809. package/dist/components/swirl-emoji-thumbs-up.js +1 -1
  810. package/dist/components/swirl-emoji.js +1 -1
  811. package/dist/components/swirl-empty-state2.js +1 -1
  812. package/dist/components/swirl-file-chip.js +1 -1
  813. package/dist/components/swirl-file-uploader.js +2 -2
  814. package/dist/components/swirl-file-viewer-audio2.js +1 -1
  815. package/dist/components/swirl-file-viewer-csv2.js +1 -1
  816. package/dist/components/swirl-file-viewer-fallback2.js +1 -1
  817. package/dist/components/swirl-file-viewer-image2.js +1 -1
  818. package/dist/components/swirl-file-viewer-text2.js +1 -1
  819. package/dist/components/swirl-file-viewer-video2.js +1 -1
  820. package/dist/components/swirl-file-viewer2.js +1 -1
  821. package/dist/components/swirl-icon-add-moderator.js +1 -1
  822. package/dist/components/swirl-icon-add-photo.js +1 -1
  823. package/dist/components/swirl-icon-add-reaction.js +1 -1
  824. package/dist/components/swirl-icon-add2.js +1 -1
  825. package/dist/components/swirl-icon-admin-panel-settings.js +1 -1
  826. package/dist/components/swirl-icon-ai-filled.js +1 -1
  827. package/dist/components/swirl-icon-ai.js +1 -1
  828. package/dist/components/swirl-icon-apps.js +1 -1
  829. package/dist/components/swirl-icon-arrow-back2.js +1 -1
  830. package/dist/components/swirl-icon-arrow-downward2.js +1 -1
  831. package/dist/components/swirl-icon-arrow-forward2.js +1 -1
  832. package/dist/components/swirl-icon-arrow-left2.js +1 -1
  833. package/dist/components/swirl-icon-arrow-right-small.js +1 -1
  834. package/dist/components/swirl-icon-arrow-right2.js +1 -1
  835. package/dist/components/swirl-icon-arrow-upward2.js +1 -1
  836. package/dist/components/swirl-icon-aspect-ratio.js +1 -1
  837. package/dist/components/swirl-icon-attachment2.js +1 -1
  838. package/dist/components/swirl-icon-audio-file2.js +1 -1
  839. package/dist/components/swirl-icon-autorenew.js +1 -1
  840. package/dist/components/swirl-icon-bar-chart.js +1 -1
  841. package/dist/components/swirl-icon-beach-access-filled.js +1 -1
  842. package/dist/components/swirl-icon-beach-access.js +1 -1
  843. package/dist/components/swirl-icon-block.js +1 -1
  844. package/dist/components/swirl-icon-bookmark-filled.js +1 -1
  845. package/dist/components/swirl-icon-bookmark.js +1 -1
  846. package/dist/components/swirl-icon-calendar-add-on-filled.js +1 -1
  847. package/dist/components/swirl-icon-calendar-respond.js +1 -1
  848. package/dist/components/swirl-icon-calendar-today.js +1 -1
  849. package/dist/components/swirl-icon-call-end.js +1 -1
  850. package/dist/components/swirl-icon-call.js +1 -1
  851. package/dist/components/swirl-icon-cancel-filled.js +1 -1
  852. package/dist/components/swirl-icon-cancel-outline.js +1 -1
  853. package/dist/components/swirl-icon-cancel2.js +1 -1
  854. package/dist/components/swirl-icon-chat-bubble.js +1 -1
  855. package/dist/components/swirl-icon-chats-filled.js +1 -1
  856. package/dist/components/swirl-icon-chats.js +1 -1
  857. package/dist/components/swirl-icon-check-circle-filled.js +1 -1
  858. package/dist/components/swirl-icon-check-circle2.js +1 -1
  859. package/dist/components/swirl-icon-check-small2.js +1 -1
  860. package/dist/components/swirl-icon-check-strong2.js +1 -1
  861. package/dist/components/swirl-icon-check.js +1 -1
  862. package/dist/components/swirl-icon-checkbox-filled.js +1 -1
  863. package/dist/components/swirl-icon-chevron-left.js +1 -1
  864. package/dist/components/swirl-icon-chevron-right2.js +1 -1
  865. package/dist/components/swirl-icon-close-fullscreen.js +1 -1
  866. package/dist/components/swirl-icon-close-small.js +1 -1
  867. package/dist/components/swirl-icon-close2.js +1 -1
  868. package/dist/components/swirl-icon-cloud-upload2.js +1 -1
  869. package/dist/components/swirl-icon-column.js +1 -1
  870. package/dist/components/swirl-icon-comment.js +1 -1
  871. package/dist/components/swirl-icon-contrast.js +1 -1
  872. package/dist/components/swirl-icon-copy.js +1 -1
  873. package/dist/components/swirl-icon-crop.js +1 -1
  874. package/dist/components/swirl-icon-dark-mode.js +1 -1
  875. package/dist/components/swirl-icon-date-range.js +1 -1
  876. package/dist/components/swirl-icon-delete.js +1 -1
  877. package/dist/components/swirl-icon-deployed-code.js +1 -1
  878. package/dist/components/swirl-icon-description.js +1 -1
  879. package/dist/components/swirl-icon-desktop.js +1 -1
  880. package/dist/components/swirl-icon-directory-filled.js +1 -1
  881. package/dist/components/swirl-icon-directory.js +1 -1
  882. package/dist/components/swirl-icon-discover.js +1 -1
  883. package/dist/components/swirl-icon-dock-left-collapse2.js +1 -1
  884. package/dist/components/swirl-icon-dock-left-expand2.js +1 -1
  885. package/dist/components/swirl-icon-dock-left.js +1 -1
  886. package/dist/components/swirl-icon-door-open.js +1 -1
  887. package/dist/components/swirl-icon-dot.js +1 -1
  888. package/dist/components/swirl-icon-double-arrow-left2.js +1 -1
  889. package/dist/components/swirl-icon-double-arrow-right.js +1 -1
  890. package/dist/components/swirl-icon-download.js +1 -1
  891. package/dist/components/swirl-icon-drag-handle2.js +1 -1
  892. package/dist/components/swirl-icon-edit-note.js +1 -1
  893. package/dist/components/swirl-icon-edit.js +1 -1
  894. package/dist/components/swirl-icon-emoji-mood.js +1 -1
  895. package/dist/components/swirl-icon-emoji-satisfied.js +1 -1
  896. package/dist/components/swirl-icon-emoji-symbols.js +1 -1
  897. package/dist/components/swirl-icon-error2.js +1 -1
  898. package/dist/components/swirl-icon-expand-less2.js +1 -1
  899. package/dist/components/swirl-icon-expand-more2.js +1 -1
  900. package/dist/components/swirl-icon-experiment.js +1 -1
  901. package/dist/components/swirl-icon-file-copy2.js +1 -1
  902. package/dist/components/swirl-icon-file2.js +1 -1
  903. package/dist/components/swirl-icon-filter.js +1 -1
  904. package/dist/components/swirl-icon-folder-shared2.js +1 -1
  905. package/dist/components/swirl-icon-folder2.js +1 -1
  906. package/dist/components/swirl-icon-format-h-one.js +1 -1
  907. package/dist/components/swirl-icon-format-list-bulleted.js +1 -1
  908. package/dist/components/swirl-icon-forward.js +1 -1
  909. package/dist/components/swirl-icon-fullscreen-exit2.js +1 -1
  910. package/dist/components/swirl-icon-fullscreen2.js +1 -1
  911. package/dist/components/swirl-icon-gif.js +1 -1
  912. package/dist/components/swirl-icon-group-add.js +1 -1
  913. package/dist/components/swirl-icon-group-assign.js +1 -1
  914. package/dist/components/swirl-icon-groups-filled.js +1 -1
  915. package/dist/components/swirl-icon-groups.js +1 -1
  916. package/dist/components/swirl-icon-hamburger-menu.js +1 -1
  917. package/dist/components/swirl-icon-health-and-safety.js +1 -1
  918. package/dist/components/swirl-icon-help-filled.js +1 -1
  919. package/dist/components/swirl-icon-help2.js +1 -1
  920. package/dist/components/swirl-icon-highlight.js +1 -1
  921. package/dist/components/swirl-icon-history.js +1 -1
  922. package/dist/components/swirl-icon-home-filled.js +1 -1
  923. package/dist/components/swirl-icon-home.js +1 -1
  924. package/dist/components/swirl-icon-hr-resting.js +1 -1
  925. package/dist/components/swirl-icon-image2.js +1 -1
  926. package/dist/components/swirl-icon-improve-text.js +1 -1
  927. package/dist/components/swirl-icon-info2.js +1 -1
  928. package/dist/components/swirl-icon-insert-below.js +1 -1
  929. package/dist/components/swirl-icon-insert-chart.js +1 -1
  930. package/dist/components/swirl-icon-insert-on-top.js +1 -1
  931. package/dist/components/swirl-icon-inventory-off.js +1 -1
  932. package/dist/components/swirl-icon-inventory.js +1 -1
  933. package/dist/components/swirl-icon-iphone.js +1 -1
  934. package/dist/components/swirl-icon-key.js +1 -1
  935. package/dist/components/swirl-icon-keyboard-hide.js +1 -1
  936. package/dist/components/swirl-icon-keyboard.js +1 -1
  937. package/dist/components/swirl-icon-language.js +1 -1
  938. package/dist/components/swirl-icon-light-mode.js +1 -1
  939. package/dist/components/swirl-icon-like.js +1 -1
  940. package/dist/components/swirl-icon-link.js +1 -1
  941. package/dist/components/swirl-icon-live.js +1 -1
  942. package/dist/components/swirl-icon-load.js +1 -1
  943. package/dist/components/swirl-icon-location-on.js +1 -1
  944. package/dist/components/swirl-icon-lock-open.js +1 -1
  945. package/dist/components/swirl-icon-lock-person.js +1 -1
  946. package/dist/components/swirl-icon-lock.js +1 -1
  947. package/dist/components/swirl-icon-login.js +1 -1
  948. package/dist/components/swirl-icon-logout.js +1 -1
  949. package/dist/components/swirl-icon-long-text.js +1 -1
  950. package/dist/components/swirl-icon-mail.js +1 -1
  951. package/dist/components/swirl-icon-manage-accounts.js +1 -1
  952. package/dist/components/swirl-icon-mark-chat-read.js +1 -1
  953. package/dist/components/swirl-icon-mark-chat-unread.js +1 -1
  954. package/dist/components/swirl-icon-mention.js +1 -1
  955. package/dist/components/swirl-icon-menu-book-filled.js +1 -1
  956. package/dist/components/swirl-icon-menu-book2.js +1 -1
  957. package/dist/components/swirl-icon-menu-filled.js +1 -1
  958. package/dist/components/swirl-icon-menu.js +1 -1
  959. package/dist/components/swirl-icon-message.js +1 -1
  960. package/dist/components/swirl-icon-mic-off.js +1 -1
  961. package/dist/components/swirl-icon-mic.js +1 -1
  962. package/dist/components/swirl-icon-more-horizontal.js +1 -1
  963. package/dist/components/swirl-icon-more-vertikal2.js +1 -1
  964. package/dist/components/swirl-icon-news-filled.js +1 -1
  965. package/dist/components/swirl-icon-news-off.js +1 -1
  966. package/dist/components/swirl-icon-news.js +1 -1
  967. package/dist/components/swirl-icon-next-plan.js +1 -1
  968. package/dist/components/swirl-icon-note-stack-filled.js +1 -1
  969. package/dist/components/swirl-icon-note-stack.js +1 -1
  970. package/dist/components/swirl-icon-notifications-active.js +1 -1
  971. package/dist/components/swirl-icon-notifications-off.js +1 -1
  972. package/dist/components/swirl-icon-notifications.js +1 -1
  973. package/dist/components/swirl-icon-open-in-full.js +1 -1
  974. package/dist/components/swirl-icon-open-in-new2.js +1 -1
  975. package/dist/components/swirl-icon-patient-list.js +1 -1
  976. package/dist/components/swirl-icon-pause-circle.js +1 -1
  977. package/dist/components/swirl-icon-pause.js +1 -1
  978. package/dist/components/swirl-icon-people-alt.js +1 -1
  979. package/dist/components/swirl-icon-person-check.js +1 -1
  980. package/dist/components/swirl-icon-person-off.js +1 -1
  981. package/dist/components/swirl-icon-person2.js +1 -1
  982. package/dist/components/swirl-icon-phone.js +1 -1
  983. package/dist/components/swirl-icon-photo-camera.js +1 -1
  984. package/dist/components/swirl-icon-picture-as-pdf2.js +1 -1
  985. package/dist/components/swirl-icon-picture-in-picture.js +1 -1
  986. package/dist/components/swirl-icon-pin-off.js +1 -1
  987. package/dist/components/swirl-icon-pin.js +1 -1
  988. package/dist/components/swirl-icon-place.js +1 -1
  989. package/dist/components/swirl-icon-play-arrow.js +1 -1
  990. package/dist/components/swirl-icon-poll.js +1 -1
  991. package/dist/components/swirl-icon-post-approval.js +1 -1
  992. package/dist/components/swirl-icon-present.js +1 -1
  993. package/dist/components/swirl-icon-preview.js +1 -1
  994. package/dist/components/swirl-icon-print.js +1 -1
  995. package/dist/components/swirl-icon-public-off.js +1 -1
  996. package/dist/components/swirl-icon-public.js +1 -1
  997. package/dist/components/swirl-icon-published-with-changes.js +1 -1
  998. package/dist/components/swirl-icon-ratio-four-to-three.js +1 -1
  999. package/dist/components/swirl-icon-ratio-freeform.js +1 -1
  1000. package/dist/components/swirl-icon-ratio-sixteen-to-nine.js +1 -1
  1001. package/dist/components/swirl-icon-ratio-square.js +1 -1
  1002. package/dist/components/swirl-icon-ratio-three-to-four.js +1 -1
  1003. package/dist/components/swirl-icon-ratio-three-to-two.js +1 -1
  1004. package/dist/components/swirl-icon-recieved.js +1 -1
  1005. package/dist/components/swirl-icon-refresh.js +1 -1
  1006. package/dist/components/swirl-icon-remove-circle.js +1 -1
  1007. package/dist/components/swirl-icon-remove-moderator.js +1 -1
  1008. package/dist/components/swirl-icon-remove2.js +1 -1
  1009. package/dist/components/swirl-icon-reply.js +1 -1
  1010. package/dist/components/swirl-icon-report.js +1 -1
  1011. package/dist/components/swirl-icon-roadmap.js +1 -1
  1012. package/dist/components/swirl-icon-rotate-left.js +1 -1
  1013. package/dist/components/swirl-icon-rotate-right.js +1 -1
  1014. package/dist/components/swirl-icon-screenshare-off.js +1 -1
  1015. package/dist/components/swirl-icon-screenshare.js +1 -1
  1016. package/dist/components/swirl-icon-search-strong.js +1 -1
  1017. package/dist/components/swirl-icon-search2.js +1 -1
  1018. package/dist/components/swirl-icon-section.js +1 -1
  1019. package/dist/components/swirl-icon-secure.js +1 -1
  1020. package/dist/components/swirl-icon-send.js +1 -1
  1021. package/dist/components/swirl-icon-settings.js +1 -1
  1022. package/dist/components/swirl-icon-short-text.js +1 -1
  1023. package/dist/components/swirl-icon-simplify.js +1 -1
  1024. package/dist/components/swirl-icon-spellcheck.js +1 -1
  1025. package/dist/components/swirl-icon-stars.js +1 -1
  1026. package/dist/components/swirl-icon-sticky-note.js +1 -1
  1027. package/dist/components/swirl-icon-stop-circle.js +1 -1
  1028. package/dist/components/swirl-icon-stop.js +1 -1
  1029. package/dist/components/swirl-icon-sunny.js +1 -1
  1030. package/dist/components/swirl-icon-sync.js +1 -1
  1031. package/dist/components/swirl-icon-tasks-filled.js +1 -1
  1032. package/dist/components/swirl-icon-tasks.js +1 -1
  1033. package/dist/components/swirl-icon-terminal.js +1 -1
  1034. package/dist/components/swirl-icon-time-filled.js +1 -1
  1035. package/dist/components/swirl-icon-time.js +1 -1
  1036. package/dist/components/swirl-icon-today-filled.js +1 -1
  1037. package/dist/components/swirl-icon-today2.js +1 -1
  1038. package/dist/components/swirl-icon-translate.js +1 -1
  1039. package/dist/components/swirl-icon-tree-structure.js +1 -1
  1040. package/dist/components/swirl-icon-undo.js +1 -1
  1041. package/dist/components/swirl-icon-unlock-person.js +1 -1
  1042. package/dist/components/swirl-icon-upload.js +1 -1
  1043. package/dist/components/swirl-icon-user-add.js +1 -1
  1044. package/dist/components/swirl-icon-user-assign.js +1 -1
  1045. package/dist/components/swirl-icon-video-camera-off.js +1 -1
  1046. package/dist/components/swirl-icon-video-camera.js +1 -1
  1047. package/dist/components/swirl-icon-video-library.js +1 -1
  1048. package/dist/components/swirl-icon-video-player2.js +1 -1
  1049. package/dist/components/swirl-icon-view-agenda.js +1 -1
  1050. package/dist/components/swirl-icon-visibility-off2.js +1 -1
  1051. package/dist/components/swirl-icon-visibility2.js +1 -1
  1052. package/dist/components/swirl-icon-voice.js +1 -1
  1053. package/dist/components/swirl-icon-volume-up.js +1 -1
  1054. package/dist/components/swirl-icon-warning2.js +1 -1
  1055. package/dist/components/swirl-icon-web-asset-off.js +1 -1
  1056. package/dist/components/swirl-icon-web-asset.js +1 -1
  1057. package/dist/components/swirl-icon-work.js +1 -1
  1058. package/dist/components/swirl-lightbox.js +1 -1
  1059. package/dist/components/swirl-list.js +1 -1
  1060. package/dist/components/swirl-menu-item.js +2 -2
  1061. package/dist/components/swirl-modal-shell.js +1 -1
  1062. package/dist/components/swirl-option-list-section.js +1 -1
  1063. package/dist/components/swirl-option-list2.js +1 -1
  1064. package/dist/components/swirl-pdf-reader.js +3 -3
  1065. package/dist/components/swirl-popover-trigger2.js +1 -1
  1066. package/dist/components/swirl-radio-group.js +1 -1
  1067. package/dist/components/swirl-resource-list-file-item.js +1 -1
  1068. package/dist/components/swirl-resource-list-section.js +1 -1
  1069. package/dist/components/swirl-select.js +2 -2
  1070. package/dist/components/swirl-shell-layout.js +8 -6
  1071. package/dist/components/swirl-symbol-ac-unit.js +1 -1
  1072. package/dist/components/swirl-symbol-account-circle.js +1 -1
  1073. package/dist/components/swirl-symbol-alternate-email.js +1 -1
  1074. package/dist/components/swirl-symbol-android.js +1 -1
  1075. package/dist/components/swirl-symbol-announcement.js +1 -1
  1076. package/dist/components/swirl-symbol-autorenew.js +1 -1
  1077. package/dist/components/swirl-symbol-backup.js +1 -1
  1078. package/dist/components/swirl-symbol-badge.js +1 -1
  1079. package/dist/components/swirl-symbol-barcode-reader.js +1 -1
  1080. package/dist/components/swirl-symbol-barcode-scanner.js +1 -1
  1081. package/dist/components/swirl-symbol-battery-horiz.js +1 -1
  1082. package/dist/components/swirl-symbol-beach-access.js +1 -1
  1083. package/dist/components/swirl-symbol-bolt.js +1 -1
  1084. package/dist/components/swirl-symbol-bookmark.js +1 -1
  1085. package/dist/components/swirl-symbol-calendar.js +1 -1
  1086. package/dist/components/swirl-symbol-campaign.js +1 -1
  1087. package/dist/components/swirl-symbol-cards-star.js +1 -1
  1088. package/dist/components/swirl-symbol-cloud.js +1 -1
  1089. package/dist/components/swirl-symbol-construction.js +1 -1
  1090. package/dist/components/swirl-symbol-contacts.js +1 -1
  1091. package/dist/components/swirl-symbol-coronavirus.js +1 -1
  1092. package/dist/components/swirl-symbol-design-services.js +1 -1
  1093. package/dist/components/swirl-symbol-desktop-windows.js +1 -1
  1094. package/dist/components/swirl-symbol-directions-car-filled.js +1 -1
  1095. package/dist/components/swirl-symbol-diversity.js +1 -1
  1096. package/dist/components/swirl-symbol-draw.js +1 -1
  1097. package/dist/components/swirl-symbol-edit-calendar.js +1 -1
  1098. package/dist/components/swirl-symbol-email.js +1 -1
  1099. package/dist/components/swirl-symbol-emergency.js +1 -1
  1100. package/dist/components/swirl-symbol-emoji-food-beverage.js +1 -1
  1101. package/dist/components/swirl-symbol-engineering.js +1 -1
  1102. package/dist/components/swirl-symbol-event-menu.js +1 -1
  1103. package/dist/components/swirl-symbol-explore.js +1 -1
  1104. package/dist/components/swirl-symbol-extension.js +1 -1
  1105. package/dist/components/swirl-symbol-facebook.js +1 -1
  1106. package/dist/components/swirl-symbol-favorite.js +1 -1
  1107. package/dist/components/swirl-symbol-fitness-center.js +1 -1
  1108. package/dist/components/swirl-symbol-flag.js +1 -1
  1109. package/dist/components/swirl-symbol-flight.js +1 -1
  1110. package/dist/components/swirl-symbol-folder.js +1 -1
  1111. package/dist/components/swirl-symbol-globe.js +1 -1
  1112. package/dist/components/swirl-symbol-groups.js +1 -1
  1113. package/dist/components/swirl-symbol-healing.js +1 -1
  1114. package/dist/components/swirl-symbol-health-and-safety.js +1 -1
  1115. package/dist/components/swirl-symbol-help.js +1 -1
  1116. package/dist/components/swirl-symbol-home-repair-service.js +1 -1
  1117. package/dist/components/swirl-symbol-home-storage.js +1 -1
  1118. package/dist/components/swirl-symbol-id-card.js +1 -1
  1119. package/dist/components/swirl-symbol-image.js +1 -1
  1120. package/dist/components/swirl-symbol-info-menu.js +1 -1
  1121. package/dist/components/swirl-symbol-instagram.js +1 -1
  1122. package/dist/components/swirl-symbol-inventory-2.js +1 -1
  1123. package/dist/components/swirl-symbol-inventory.js +1 -1
  1124. package/dist/components/swirl-symbol-ios.js +1 -1
  1125. package/dist/components/swirl-symbol-key.js +1 -1
  1126. package/dist/components/swirl-symbol-language.js +1 -1
  1127. package/dist/components/swirl-symbol-leaderboard.js +1 -1
  1128. package/dist/components/swirl-symbol-lightbulb.js +1 -1
  1129. package/dist/components/swirl-symbol-linkedin.js +1 -1
  1130. package/dist/components/swirl-symbol-local-shipping.js +1 -1
  1131. package/dist/components/swirl-symbol-location-on.js +1 -1
  1132. package/dist/components/swirl-symbol-loyalty.js +1 -1
  1133. package/dist/components/swirl-symbol-map.js +1 -1
  1134. package/dist/components/swirl-symbol-maps-home-work.js +1 -1
  1135. package/dist/components/swirl-symbol-menu-book.js +1 -1
  1136. package/dist/components/swirl-symbol-mop.js +1 -1
  1137. package/dist/components/swirl-symbol-nest-eco-leaf.js +1 -1
  1138. package/dist/components/swirl-symbol-notifications.js +1 -1
  1139. package/dist/components/swirl-symbol-open-in-new.js +1 -1
  1140. package/dist/components/swirl-symbol-orders.js +1 -1
  1141. package/dist/components/swirl-symbol-package.js +1 -1
  1142. package/dist/components/swirl-symbol-palette.js +1 -1
  1143. package/dist/components/swirl-symbol-partly-cloudy-day.js +1 -1
  1144. package/dist/components/swirl-symbol-pedal-bike.js +1 -1
  1145. package/dist/components/swirl-symbol-percent-discount.js +1 -1
  1146. package/dist/components/swirl-symbol-pets.js +1 -1
  1147. package/dist/components/swirl-symbol-pinterest.js +1 -1
  1148. package/dist/components/swirl-symbol-point-of-sale.js +1 -1
  1149. package/dist/components/swirl-symbol-policy.js +1 -1
  1150. package/dist/components/swirl-symbol-precision-manufacturing.js +1 -1
  1151. package/dist/components/swirl-symbol-print.js +1 -1
  1152. package/dist/components/swirl-symbol-push-pin.js +1 -1
  1153. package/dist/components/swirl-symbol-recycling.js +1 -1
  1154. package/dist/components/swirl-symbol-redeem.js +1 -1
  1155. package/dist/components/swirl-symbol-report-problem.js +1 -1
  1156. package/dist/components/swirl-symbol-restaurant.js +1 -1
  1157. package/dist/components/swirl-symbol-roadmap.js +1 -1
  1158. package/dist/components/swirl-symbol-rocket-launch.js +1 -1
  1159. package/dist/components/swirl-symbol-room.js +1 -1
  1160. package/dist/components/swirl-symbol-savings.js +1 -1
  1161. package/dist/components/swirl-symbol-school.js +1 -1
  1162. package/dist/components/swirl-symbol-sell.js +1 -1
  1163. package/dist/components/swirl-symbol-settings-voice.js +1 -1
  1164. package/dist/components/swirl-symbol-shopping-bag.js +1 -1
  1165. package/dist/components/swirl-symbol-shopping-cart.js +1 -1
  1166. package/dist/components/swirl-symbol-smartphone.js +1 -1
  1167. package/dist/components/swirl-symbol-spa.js +1 -1
  1168. package/dist/components/swirl-symbol-sports-soccer.js +1 -1
  1169. package/dist/components/swirl-symbol-star.js +1 -1
  1170. package/dist/components/swirl-symbol-supervisor-account.js +1 -1
  1171. package/dist/components/swirl-symbol-task.js +1 -1
  1172. package/dist/components/swirl-symbol-tasks.js +1 -1
  1173. package/dist/components/swirl-symbol-thumbs-up-down.js +1 -1
  1174. package/dist/components/swirl-symbol-timer.js +1 -1
  1175. package/dist/components/swirl-symbol-tools-power-drill.js +1 -1
  1176. package/dist/components/swirl-symbol-train.js +1 -1
  1177. package/dist/components/swirl-symbol-trophy.js +1 -1
  1178. package/dist/components/swirl-symbol-twitter.js +1 -1
  1179. package/dist/components/swirl-symbol-video.js +1 -1
  1180. package/dist/components/swirl-symbol-warehouse.js +1 -1
  1181. package/dist/components/swirl-symbol-water-drop.js +1 -1
  1182. package/dist/components/swirl-symbol-wb-sunny.js +1 -1
  1183. package/dist/components/swirl-symbol-wechat.js +1 -1
  1184. package/dist/components/swirl-symbol-weibo.js +1 -1
  1185. package/dist/components/swirl-symbol-wifi.js +1 -1
  1186. package/dist/components/swirl-symbol-work.js +1 -1
  1187. package/dist/components/swirl-symbol-xing.js +1 -1
  1188. package/dist/components/swirl-symbol-youtube.js +1 -1
  1189. package/dist/components/swirl-symbol.js +1 -1
  1190. package/dist/components/swirl-table-cell.js +1 -1
  1191. package/dist/components/swirl-table-column.js +3 -2
  1192. package/dist/components/swirl-table-row-group.js +2 -2
  1193. package/dist/components/swirl-table-row.js +1 -1
  1194. package/dist/components/swirl-tabs.js +1 -1
  1195. package/dist/components/swirl-theme-provider.js +1 -1
  1196. package/dist/components/swirl-time-input.js +1 -1
  1197. package/dist/components/swirl-toggle-button.js +1 -1
  1198. package/dist/components/swirl-tree-navigation-item.js +3 -3
  1199. package/dist/components/swirl-tree-navigation.js +1 -1
  1200. package/dist/components/swirl-video-thumbnail.js +1 -1
  1201. package/dist/components/swirl-visually-hidden2.js +1 -1
  1202. package/dist/esm/file-manager.entry.js +1 -1
  1203. package/dist/esm/index-Dj_4Fda9.js +16 -8
  1204. package/dist/esm/loader.js +1 -1
  1205. package/dist/esm/swirl-app-layout_5.entry.js +2 -2
  1206. package/dist/esm/swirl-avatar.entry.js +1 -1
  1207. package/dist/esm/swirl-components.js +1 -1
  1208. package/dist/esm/swirl-data-cell-stack.entry.js +37 -0
  1209. package/dist/esm/swirl-data-cell.entry.js +30 -0
  1210. package/dist/esm/swirl-date-input.entry.js +1 -1
  1211. package/dist/esm/swirl-date-picker_2.entry.js +2 -2
  1212. package/dist/esm/swirl-description-list-item.entry.js +1 -1
  1213. package/dist/esm/swirl-description-list.entry.js +1 -1
  1214. package/dist/esm/swirl-emoji-clap.entry.js +1 -1
  1215. package/dist/esm/swirl-emoji-happy.entry.js +1 -1
  1216. package/dist/esm/swirl-emoji-idea.entry.js +1 -1
  1217. package/dist/esm/swirl-emoji-love.entry.js +1 -1
  1218. package/dist/esm/swirl-emoji-sad.entry.js +1 -1
  1219. package/dist/esm/swirl-emoji-thumbs-up.entry.js +1 -1
  1220. package/dist/esm/swirl-emoji.entry.js +1 -1
  1221. package/dist/esm/swirl-file-chip.entry.js +1 -1
  1222. package/dist/esm/swirl-file-uploader.entry.js +2 -2
  1223. package/dist/esm/swirl-file-viewer_8.entry.js +7 -7
  1224. package/dist/esm/swirl-icon-add-moderator.entry.js +1 -1
  1225. package/dist/esm/swirl-icon-add-photo.entry.js +1 -1
  1226. package/dist/esm/swirl-icon-add-reaction.entry.js +1 -1
  1227. package/dist/esm/swirl-icon-add_6.entry.js +6 -6
  1228. package/dist/esm/swirl-icon-admin-panel-settings.entry.js +1 -1
  1229. package/dist/esm/swirl-icon-ai-filled.entry.js +1 -1
  1230. package/dist/esm/swirl-icon-ai.entry.js +1 -1
  1231. package/dist/esm/swirl-icon-apps.entry.js +1 -1
  1232. package/dist/esm/swirl-icon-arrow-back_5.entry.js +5 -5
  1233. package/dist/esm/swirl-icon-arrow-downward_2.entry.js +2 -2
  1234. package/dist/esm/swirl-icon-arrow-left_4.entry.js +3 -3
  1235. package/dist/esm/swirl-icon-arrow-right-small.entry.js +1 -1
  1236. package/dist/esm/swirl-icon-aspect-ratio.entry.js +1 -1
  1237. package/dist/esm/swirl-icon-attachment_6.entry.js +6 -6
  1238. package/dist/esm/swirl-icon-autorenew.entry.js +1 -1
  1239. package/dist/esm/swirl-icon-bar-chart.entry.js +1 -1
  1240. package/dist/esm/swirl-icon-beach-access-filled.entry.js +1 -1
  1241. package/dist/esm/swirl-icon-beach-access.entry.js +1 -1
  1242. package/dist/esm/swirl-icon-block.entry.js +1 -1
  1243. package/dist/esm/swirl-icon-bookmark-filled.entry.js +1 -1
  1244. package/dist/esm/swirl-icon-bookmark.entry.js +1 -1
  1245. package/dist/esm/swirl-icon-calendar-add-on-filled.entry.js +1 -1
  1246. package/dist/esm/swirl-icon-calendar-respond.entry.js +1 -1
  1247. package/dist/esm/swirl-icon-calendar-today.entry.js +1 -1
  1248. package/dist/esm/swirl-icon-call-end.entry.js +1 -1
  1249. package/dist/esm/swirl-icon-call.entry.js +1 -1
  1250. package/dist/esm/swirl-icon-cancel-filled.entry.js +1 -1
  1251. package/dist/esm/swirl-icon-cancel-outline.entry.js +1 -1
  1252. package/dist/esm/swirl-icon-cancel_4.entry.js +4 -4
  1253. package/dist/esm/swirl-icon-chat-bubble.entry.js +1 -1
  1254. package/dist/esm/swirl-icon-chats-filled.entry.js +1 -1
  1255. package/dist/esm/swirl-icon-chats.entry.js +1 -1
  1256. package/dist/esm/swirl-icon-check-circle-filled.entry.js +1 -1
  1257. package/dist/esm/swirl-icon-check-circle_2.entry.js +2 -2
  1258. package/dist/esm/swirl-icon-check-small_3.entry.js +3 -3
  1259. package/dist/esm/swirl-icon-check.entry.js +1 -1
  1260. package/dist/esm/swirl-icon-checkbox-filled.entry.js +1 -1
  1261. package/dist/esm/swirl-icon-chevron-left.entry.js +1 -1
  1262. package/dist/esm/swirl-icon-chevron-right.entry.js +1 -1
  1263. package/dist/esm/swirl-icon-close-fullscreen.entry.js +1 -1
  1264. package/dist/esm/swirl-icon-close-small.entry.js +1 -1
  1265. package/dist/esm/swirl-icon-close.entry.js +1 -1
  1266. package/dist/esm/swirl-icon-cloud-upload.entry.js +1 -1
  1267. package/dist/esm/swirl-icon-column.entry.js +1 -1
  1268. package/dist/esm/swirl-icon-comment.entry.js +1 -1
  1269. package/dist/esm/swirl-icon-contrast.entry.js +1 -1
  1270. package/dist/esm/swirl-icon-copy.entry.js +1 -1
  1271. package/dist/esm/swirl-icon-crop.entry.js +1 -1
  1272. package/dist/esm/swirl-icon-dark-mode.entry.js +1 -1
  1273. package/dist/esm/swirl-icon-date-range.entry.js +1 -1
  1274. package/dist/esm/swirl-icon-delete.entry.js +1 -1
  1275. package/dist/esm/swirl-icon-deployed-code.entry.js +1 -1
  1276. package/dist/esm/swirl-icon-description.entry.js +1 -1
  1277. package/dist/esm/swirl-icon-desktop.entry.js +1 -1
  1278. package/dist/esm/swirl-icon-directory-filled.entry.js +1 -1
  1279. package/dist/esm/swirl-icon-directory.entry.js +1 -1
  1280. package/dist/esm/swirl-icon-discover.entry.js +1 -1
  1281. package/dist/esm/swirl-icon-dock-left.entry.js +1 -1
  1282. package/dist/esm/swirl-icon-door-open.entry.js +1 -1
  1283. package/dist/esm/swirl-icon-dot.entry.js +1 -1
  1284. package/dist/esm/swirl-icon-double-arrow-right.entry.js +1 -1
  1285. package/dist/esm/swirl-icon-download.entry.js +1 -1
  1286. package/dist/esm/swirl-icon-edit-note.entry.js +1 -1
  1287. package/dist/esm/swirl-icon-edit.entry.js +1 -1
  1288. package/dist/esm/swirl-icon-emoji-mood.entry.js +1 -1
  1289. package/dist/esm/swirl-icon-emoji-satisfied.entry.js +1 -1
  1290. package/dist/esm/swirl-icon-emoji-symbols.entry.js +1 -1
  1291. package/dist/esm/swirl-icon-error_3.entry.js +1 -1
  1292. package/dist/esm/swirl-icon-expand-more.entry.js +1 -1
  1293. package/dist/esm/swirl-icon-experiment.entry.js +1 -1
  1294. package/dist/esm/swirl-icon-file.entry.js +1 -1
  1295. package/dist/esm/swirl-icon-filter.entry.js +1 -1
  1296. package/dist/esm/swirl-icon-format-h-one.entry.js +1 -1
  1297. package/dist/esm/swirl-icon-format-list-bulleted.entry.js +1 -1
  1298. package/dist/esm/swirl-icon-forward.entry.js +1 -1
  1299. package/dist/esm/swirl-icon-gif.entry.js +1 -1
  1300. package/dist/esm/swirl-icon-group-add.entry.js +1 -1
  1301. package/dist/esm/swirl-icon-group-assign.entry.js +1 -1
  1302. package/dist/esm/swirl-icon-groups-filled.entry.js +1 -1
  1303. package/dist/esm/swirl-icon-groups.entry.js +1 -1
  1304. package/dist/esm/swirl-icon-hamburger-menu.entry.js +1 -1
  1305. package/dist/esm/swirl-icon-health-and-safety.entry.js +1 -1
  1306. package/dist/esm/swirl-icon-help-filled.entry.js +1 -1
  1307. package/dist/esm/swirl-icon-help.entry.js +1 -1
  1308. package/dist/esm/swirl-icon-highlight.entry.js +1 -1
  1309. package/dist/esm/swirl-icon-history.entry.js +1 -1
  1310. package/dist/esm/swirl-icon-home-filled.entry.js +1 -1
  1311. package/dist/esm/swirl-icon-home.entry.js +1 -1
  1312. package/dist/esm/swirl-icon-hr-resting.entry.js +1 -1
  1313. package/dist/esm/swirl-icon-improve-text.entry.js +1 -1
  1314. package/dist/esm/swirl-icon-info.entry.js +1 -1
  1315. package/dist/esm/swirl-icon-insert-below.entry.js +1 -1
  1316. package/dist/esm/swirl-icon-insert-chart.entry.js +1 -1
  1317. package/dist/esm/swirl-icon-insert-on-top.entry.js +1 -1
  1318. package/dist/esm/swirl-icon-inventory-off.entry.js +1 -1
  1319. package/dist/esm/swirl-icon-inventory.entry.js +1 -1
  1320. package/dist/esm/swirl-icon-iphone.entry.js +1 -1
  1321. package/dist/esm/swirl-icon-key.entry.js +1 -1
  1322. package/dist/esm/swirl-icon-keyboard-hide.entry.js +1 -1
  1323. package/dist/esm/swirl-icon-keyboard.entry.js +1 -1
  1324. package/dist/esm/swirl-icon-language.entry.js +1 -1
  1325. package/dist/esm/swirl-icon-light-mode.entry.js +1 -1
  1326. package/dist/esm/swirl-icon-like.entry.js +1 -1
  1327. package/dist/esm/swirl-icon-link.entry.js +1 -1
  1328. package/dist/esm/swirl-icon-live.entry.js +1 -1
  1329. package/dist/esm/swirl-icon-load.entry.js +1 -1
  1330. package/dist/esm/swirl-icon-location-on.entry.js +1 -1
  1331. package/dist/esm/swirl-icon-lock-open.entry.js +1 -1
  1332. package/dist/esm/swirl-icon-lock-person.entry.js +1 -1
  1333. package/dist/esm/swirl-icon-lock.entry.js +1 -1
  1334. package/dist/esm/swirl-icon-login.entry.js +1 -1
  1335. package/dist/esm/swirl-icon-logout.entry.js +1 -1
  1336. package/dist/esm/swirl-icon-long-text.entry.js +1 -1
  1337. package/dist/esm/swirl-icon-mail.entry.js +1 -1
  1338. package/dist/esm/swirl-icon-manage-accounts.entry.js +1 -1
  1339. package/dist/esm/swirl-icon-mark-chat-read.entry.js +1 -1
  1340. package/dist/esm/swirl-icon-mark-chat-unread.entry.js +1 -1
  1341. package/dist/esm/swirl-icon-mention.entry.js +1 -1
  1342. package/dist/esm/swirl-icon-menu-book-filled.entry.js +1 -1
  1343. package/dist/esm/swirl-icon-menu-filled.entry.js +1 -1
  1344. package/dist/esm/swirl-icon-menu.entry.js +1 -1
  1345. package/dist/esm/swirl-icon-message.entry.js +1 -1
  1346. package/dist/esm/swirl-icon-mic-off.entry.js +1 -1
  1347. package/dist/esm/swirl-icon-mic.entry.js +1 -1
  1348. package/dist/esm/swirl-icon-more-horizontal.entry.js +1 -1
  1349. package/dist/esm/swirl-icon-news-filled.entry.js +1 -1
  1350. package/dist/esm/swirl-icon-news-off.entry.js +1 -1
  1351. package/dist/esm/swirl-icon-news.entry.js +1 -1
  1352. package/dist/esm/swirl-icon-next-plan.entry.js +1 -1
  1353. package/dist/esm/swirl-icon-note-stack-filled.entry.js +1 -1
  1354. package/dist/esm/swirl-icon-note-stack.entry.js +1 -1
  1355. package/dist/esm/swirl-icon-notifications-active.entry.js +1 -1
  1356. package/dist/esm/swirl-icon-notifications-off.entry.js +1 -1
  1357. package/dist/esm/swirl-icon-notifications.entry.js +1 -1
  1358. package/dist/esm/swirl-icon-open-in-full.entry.js +1 -1
  1359. package/dist/esm/swirl-icon-open-in-new.entry.js +1 -1
  1360. package/dist/esm/swirl-icon-patient-list.entry.js +1 -1
  1361. package/dist/esm/swirl-icon-pause-circle.entry.js +1 -1
  1362. package/dist/esm/swirl-icon-pause.entry.js +1 -1
  1363. package/dist/esm/swirl-icon-people-alt.entry.js +1 -1
  1364. package/dist/esm/swirl-icon-person-check.entry.js +1 -1
  1365. package/dist/esm/swirl-icon-person-off.entry.js +1 -1
  1366. package/dist/esm/swirl-icon-person.entry.js +1 -1
  1367. package/dist/esm/swirl-icon-phone.entry.js +1 -1
  1368. package/dist/esm/swirl-icon-photo-camera.entry.js +1 -1
  1369. package/dist/esm/swirl-icon-picture-in-picture.entry.js +1 -1
  1370. package/dist/esm/swirl-icon-pin-off.entry.js +1 -1
  1371. package/dist/esm/swirl-icon-pin.entry.js +1 -1
  1372. package/dist/esm/swirl-icon-place.entry.js +1 -1
  1373. package/dist/esm/swirl-icon-play-arrow.entry.js +1 -1
  1374. package/dist/esm/swirl-icon-poll.entry.js +1 -1
  1375. package/dist/esm/swirl-icon-post-approval.entry.js +1 -1
  1376. package/dist/esm/swirl-icon-present.entry.js +1 -1
  1377. package/dist/esm/swirl-icon-preview.entry.js +1 -1
  1378. package/dist/esm/swirl-icon-print.entry.js +1 -1
  1379. package/dist/esm/swirl-icon-public-off.entry.js +1 -1
  1380. package/dist/esm/swirl-icon-public.entry.js +1 -1
  1381. package/dist/esm/swirl-icon-published-with-changes.entry.js +1 -1
  1382. package/dist/esm/swirl-icon-ratio-four-to-three.entry.js +1 -1
  1383. package/dist/esm/swirl-icon-ratio-freeform.entry.js +1 -1
  1384. package/dist/esm/swirl-icon-ratio-sixteen-to-nine.entry.js +1 -1
  1385. package/dist/esm/swirl-icon-ratio-square.entry.js +1 -1
  1386. package/dist/esm/swirl-icon-ratio-three-to-four.entry.js +1 -1
  1387. package/dist/esm/swirl-icon-ratio-three-to-two.entry.js +1 -1
  1388. package/dist/esm/swirl-icon-recieved.entry.js +1 -1
  1389. package/dist/esm/swirl-icon-refresh.entry.js +1 -1
  1390. package/dist/esm/swirl-icon-remove-circle.entry.js +1 -1
  1391. package/dist/esm/swirl-icon-remove-moderator.entry.js +1 -1
  1392. package/dist/esm/swirl-icon-reply.entry.js +1 -1
  1393. package/dist/esm/swirl-icon-report.entry.js +1 -1
  1394. package/dist/esm/swirl-icon-roadmap.entry.js +1 -1
  1395. package/dist/esm/swirl-icon-rotate-left.entry.js +1 -1
  1396. package/dist/esm/swirl-icon-rotate-right.entry.js +1 -1
  1397. package/dist/esm/swirl-icon-screenshare-off.entry.js +1 -1
  1398. package/dist/esm/swirl-icon-screenshare.entry.js +1 -1
  1399. package/dist/esm/swirl-icon-search-strong.entry.js +1 -1
  1400. package/dist/esm/swirl-icon-search.entry.js +1 -1
  1401. package/dist/esm/swirl-icon-section.entry.js +1 -1
  1402. package/dist/esm/swirl-icon-secure.entry.js +1 -1
  1403. package/dist/esm/swirl-icon-send.entry.js +1 -1
  1404. package/dist/esm/swirl-icon-settings.entry.js +1 -1
  1405. package/dist/esm/swirl-icon-short-text.entry.js +1 -1
  1406. package/dist/esm/swirl-icon-simplify.entry.js +1 -1
  1407. package/dist/esm/swirl-icon-spellcheck.entry.js +1 -1
  1408. package/dist/esm/swirl-icon-stars.entry.js +1 -1
  1409. package/dist/esm/swirl-icon-sticky-note.entry.js +1 -1
  1410. package/dist/esm/swirl-icon-stop-circle.entry.js +1 -1
  1411. package/dist/esm/swirl-icon-stop.entry.js +1 -1
  1412. package/dist/esm/swirl-icon-sunny.entry.js +1 -1
  1413. package/dist/esm/swirl-icon-sync.entry.js +1 -1
  1414. package/dist/esm/swirl-icon-tasks-filled.entry.js +1 -1
  1415. package/dist/esm/swirl-icon-tasks.entry.js +1 -1
  1416. package/dist/esm/swirl-icon-terminal.entry.js +1 -1
  1417. package/dist/esm/swirl-icon-time-filled.entry.js +1 -1
  1418. package/dist/esm/swirl-icon-time.entry.js +1 -1
  1419. package/dist/esm/swirl-icon-today-filled.entry.js +1 -1
  1420. package/dist/esm/swirl-icon-translate.entry.js +1 -1
  1421. package/dist/esm/swirl-icon-tree-structure.entry.js +1 -1
  1422. package/dist/esm/swirl-icon-undo.entry.js +1 -1
  1423. package/dist/esm/swirl-icon-unlock-person.entry.js +1 -1
  1424. package/dist/esm/swirl-icon-upload.entry.js +1 -1
  1425. package/dist/esm/swirl-icon-user-add.entry.js +1 -1
  1426. package/dist/esm/swirl-icon-user-assign.entry.js +1 -1
  1427. package/dist/esm/swirl-icon-video-camera-off.entry.js +1 -1
  1428. package/dist/esm/swirl-icon-video-camera.entry.js +1 -1
  1429. package/dist/esm/swirl-icon-video-library.entry.js +1 -1
  1430. package/dist/esm/swirl-icon-view-agenda.entry.js +1 -1
  1431. package/dist/esm/swirl-icon-voice.entry.js +1 -1
  1432. package/dist/esm/swirl-icon-volume-up.entry.js +1 -1
  1433. package/dist/esm/swirl-icon-web-asset-off.entry.js +1 -1
  1434. package/dist/esm/swirl-icon-web-asset.entry.js +1 -1
  1435. package/dist/esm/swirl-icon-work.entry.js +1 -1
  1436. package/dist/esm/swirl-lightbox.entry.js +1 -1
  1437. package/dist/esm/swirl-list.entry.js +1 -1
  1438. package/dist/esm/swirl-menu-item.entry.js +2 -2
  1439. package/dist/esm/swirl-modal-shell.entry.js +1 -1
  1440. package/dist/esm/swirl-option-list-section.entry.js +1 -1
  1441. package/dist/esm/swirl-option-list_2.entry.js +1 -1
  1442. package/dist/esm/swirl-pdf-reader.entry.js +3 -3
  1443. package/dist/esm/swirl-popover_2.entry.js +1 -1
  1444. package/dist/esm/swirl-radio-group.entry.js +1 -1
  1445. package/dist/esm/swirl-resource-list-file-item.entry.js +1 -1
  1446. package/dist/esm/swirl-resource-list-section.entry.js +1 -1
  1447. package/dist/esm/swirl-select.entry.js +2 -2
  1448. package/dist/esm/swirl-shell-layout.entry.js +8 -6
  1449. package/dist/esm/swirl-symbol-ac-unit.entry.js +1 -1
  1450. package/dist/esm/swirl-symbol-account-circle.entry.js +1 -1
  1451. package/dist/esm/swirl-symbol-alternate-email.entry.js +1 -1
  1452. package/dist/esm/swirl-symbol-android.entry.js +1 -1
  1453. package/dist/esm/swirl-symbol-announcement.entry.js +1 -1
  1454. package/dist/esm/swirl-symbol-autorenew.entry.js +1 -1
  1455. package/dist/esm/swirl-symbol-backup.entry.js +1 -1
  1456. package/dist/esm/swirl-symbol-badge.entry.js +1 -1
  1457. package/dist/esm/swirl-symbol-barcode-reader.entry.js +1 -1
  1458. package/dist/esm/swirl-symbol-barcode-scanner.entry.js +1 -1
  1459. package/dist/esm/swirl-symbol-battery-horiz.entry.js +1 -1
  1460. package/dist/esm/swirl-symbol-beach-access.entry.js +1 -1
  1461. package/dist/esm/swirl-symbol-bolt.entry.js +1 -1
  1462. package/dist/esm/swirl-symbol-bookmark.entry.js +1 -1
  1463. package/dist/esm/swirl-symbol-calendar.entry.js +1 -1
  1464. package/dist/esm/swirl-symbol-campaign.entry.js +1 -1
  1465. package/dist/esm/swirl-symbol-cards-star.entry.js +1 -1
  1466. package/dist/esm/swirl-symbol-cloud.entry.js +1 -1
  1467. package/dist/esm/swirl-symbol-construction.entry.js +1 -1
  1468. package/dist/esm/swirl-symbol-contacts.entry.js +1 -1
  1469. package/dist/esm/swirl-symbol-coronavirus.entry.js +1 -1
  1470. package/dist/esm/swirl-symbol-design-services.entry.js +1 -1
  1471. package/dist/esm/swirl-symbol-desktop-windows.entry.js +1 -1
  1472. package/dist/esm/swirl-symbol-directions-car-filled.entry.js +1 -1
  1473. package/dist/esm/swirl-symbol-diversity.entry.js +1 -1
  1474. package/dist/esm/swirl-symbol-draw.entry.js +1 -1
  1475. package/dist/esm/swirl-symbol-edit-calendar.entry.js +1 -1
  1476. package/dist/esm/swirl-symbol-email.entry.js +1 -1
  1477. package/dist/esm/swirl-symbol-emergency.entry.js +1 -1
  1478. package/dist/esm/swirl-symbol-emoji-food-beverage.entry.js +1 -1
  1479. package/dist/esm/swirl-symbol-engineering.entry.js +1 -1
  1480. package/dist/esm/swirl-symbol-event-menu.entry.js +1 -1
  1481. package/dist/esm/swirl-symbol-explore.entry.js +1 -1
  1482. package/dist/esm/swirl-symbol-extension.entry.js +1 -1
  1483. package/dist/esm/swirl-symbol-facebook.entry.js +1 -1
  1484. package/dist/esm/swirl-symbol-favorite.entry.js +1 -1
  1485. package/dist/esm/swirl-symbol-fitness-center.entry.js +1 -1
  1486. package/dist/esm/swirl-symbol-flag.entry.js +1 -1
  1487. package/dist/esm/swirl-symbol-flight.entry.js +1 -1
  1488. package/dist/esm/swirl-symbol-folder.entry.js +1 -1
  1489. package/dist/esm/swirl-symbol-globe.entry.js +1 -1
  1490. package/dist/esm/swirl-symbol-groups.entry.js +1 -1
  1491. package/dist/esm/swirl-symbol-healing.entry.js +1 -1
  1492. package/dist/esm/swirl-symbol-health-and-safety.entry.js +1 -1
  1493. package/dist/esm/swirl-symbol-help.entry.js +1 -1
  1494. package/dist/esm/swirl-symbol-home-repair-service.entry.js +1 -1
  1495. package/dist/esm/swirl-symbol-home-storage.entry.js +1 -1
  1496. package/dist/esm/swirl-symbol-id-card.entry.js +1 -1
  1497. package/dist/esm/swirl-symbol-image.entry.js +1 -1
  1498. package/dist/esm/swirl-symbol-info-menu.entry.js +1 -1
  1499. package/dist/esm/swirl-symbol-instagram.entry.js +1 -1
  1500. package/dist/esm/swirl-symbol-inventory-2.entry.js +1 -1
  1501. package/dist/esm/swirl-symbol-inventory.entry.js +1 -1
  1502. package/dist/esm/swirl-symbol-ios.entry.js +1 -1
  1503. package/dist/esm/swirl-symbol-key.entry.js +1 -1
  1504. package/dist/esm/swirl-symbol-language.entry.js +1 -1
  1505. package/dist/esm/swirl-symbol-leaderboard.entry.js +1 -1
  1506. package/dist/esm/swirl-symbol-lightbulb.entry.js +1 -1
  1507. package/dist/esm/swirl-symbol-linkedin.entry.js +1 -1
  1508. package/dist/esm/swirl-symbol-local-shipping.entry.js +1 -1
  1509. package/dist/esm/swirl-symbol-location-on.entry.js +1 -1
  1510. package/dist/esm/swirl-symbol-loyalty.entry.js +1 -1
  1511. package/dist/esm/swirl-symbol-map.entry.js +1 -1
  1512. package/dist/esm/swirl-symbol-maps-home-work.entry.js +1 -1
  1513. package/dist/esm/swirl-symbol-menu-book.entry.js +1 -1
  1514. package/dist/esm/swirl-symbol-mop.entry.js +1 -1
  1515. package/dist/esm/swirl-symbol-nest-eco-leaf.entry.js +1 -1
  1516. package/dist/esm/swirl-symbol-notifications.entry.js +1 -1
  1517. package/dist/esm/swirl-symbol-open-in-new.entry.js +1 -1
  1518. package/dist/esm/swirl-symbol-orders.entry.js +1 -1
  1519. package/dist/esm/swirl-symbol-package.entry.js +1 -1
  1520. package/dist/esm/swirl-symbol-palette.entry.js +1 -1
  1521. package/dist/esm/swirl-symbol-partly-cloudy-day.entry.js +1 -1
  1522. package/dist/esm/swirl-symbol-pedal-bike.entry.js +1 -1
  1523. package/dist/esm/swirl-symbol-percent-discount.entry.js +1 -1
  1524. package/dist/esm/swirl-symbol-pets.entry.js +1 -1
  1525. package/dist/esm/swirl-symbol-pinterest.entry.js +1 -1
  1526. package/dist/esm/swirl-symbol-point-of-sale.entry.js +1 -1
  1527. package/dist/esm/swirl-symbol-policy.entry.js +1 -1
  1528. package/dist/esm/swirl-symbol-precision-manufacturing.entry.js +1 -1
  1529. package/dist/esm/swirl-symbol-print.entry.js +1 -1
  1530. package/dist/esm/swirl-symbol-push-pin.entry.js +1 -1
  1531. package/dist/esm/swirl-symbol-recycling.entry.js +1 -1
  1532. package/dist/esm/swirl-symbol-redeem.entry.js +1 -1
  1533. package/dist/esm/swirl-symbol-report-problem.entry.js +1 -1
  1534. package/dist/esm/swirl-symbol-restaurant.entry.js +1 -1
  1535. package/dist/esm/swirl-symbol-roadmap.entry.js +1 -1
  1536. package/dist/esm/swirl-symbol-rocket-launch.entry.js +1 -1
  1537. package/dist/esm/swirl-symbol-room.entry.js +1 -1
  1538. package/dist/esm/swirl-symbol-savings.entry.js +1 -1
  1539. package/dist/esm/swirl-symbol-school.entry.js +1 -1
  1540. package/dist/esm/swirl-symbol-sell.entry.js +1 -1
  1541. package/dist/esm/swirl-symbol-settings-voice.entry.js +1 -1
  1542. package/dist/esm/swirl-symbol-shopping-bag.entry.js +1 -1
  1543. package/dist/esm/swirl-symbol-shopping-cart.entry.js +1 -1
  1544. package/dist/esm/swirl-symbol-smartphone.entry.js +1 -1
  1545. package/dist/esm/swirl-symbol-spa.entry.js +1 -1
  1546. package/dist/esm/swirl-symbol-sports-soccer.entry.js +1 -1
  1547. package/dist/esm/swirl-symbol-star.entry.js +1 -1
  1548. package/dist/esm/swirl-symbol-supervisor-account.entry.js +1 -1
  1549. package/dist/esm/swirl-symbol-task.entry.js +1 -1
  1550. package/dist/esm/swirl-symbol-tasks.entry.js +1 -1
  1551. package/dist/esm/swirl-symbol-thumbs-up-down.entry.js +1 -1
  1552. package/dist/esm/swirl-symbol-timer.entry.js +1 -1
  1553. package/dist/esm/swirl-symbol-tools-power-drill.entry.js +1 -1
  1554. package/dist/esm/swirl-symbol-train.entry.js +1 -1
  1555. package/dist/esm/swirl-symbol-trophy.entry.js +1 -1
  1556. package/dist/esm/swirl-symbol-twitter.entry.js +1 -1
  1557. package/dist/esm/swirl-symbol-video.entry.js +1 -1
  1558. package/dist/esm/swirl-symbol-warehouse.entry.js +1 -1
  1559. package/dist/esm/swirl-symbol-water-drop.entry.js +1 -1
  1560. package/dist/esm/swirl-symbol-wb-sunny.entry.js +1 -1
  1561. package/dist/esm/swirl-symbol-wechat.entry.js +1 -1
  1562. package/dist/esm/swirl-symbol-weibo.entry.js +1 -1
  1563. package/dist/esm/swirl-symbol-wifi.entry.js +1 -1
  1564. package/dist/esm/swirl-symbol-work.entry.js +1 -1
  1565. package/dist/esm/swirl-symbol-xing.entry.js +1 -1
  1566. package/dist/esm/swirl-symbol-youtube.entry.js +1 -1
  1567. package/dist/esm/swirl-symbol.entry.js +1 -1
  1568. package/dist/esm/swirl-table-cell.entry.js +1 -1
  1569. package/dist/esm/swirl-table-column.entry.js +3 -2
  1570. package/dist/esm/swirl-table-row-group.entry.js +2 -2
  1571. package/dist/esm/swirl-table-row.entry.js +1 -1
  1572. package/dist/esm/swirl-tabs.entry.js +1 -1
  1573. package/dist/esm/swirl-theme-provider.entry.js +1 -1
  1574. package/dist/esm/swirl-time-input.entry.js +1 -1
  1575. package/dist/esm/swirl-toggle-button.entry.js +1 -1
  1576. package/dist/esm/swirl-tree-navigation-item.entry.js +3 -3
  1577. package/dist/esm/swirl-tree-navigation.entry.js +1 -1
  1578. package/dist/esm/swirl-video-thumbnail.entry.js +1 -1
  1579. package/dist/esm/swirl-visually-hidden.entry.js +1 -1
  1580. package/dist/swirl-components/p-01584f24.entry.js +1 -0
  1581. package/dist/swirl-components/{p-1369783e.entry.js → p-01723682.entry.js} +1 -1
  1582. package/dist/swirl-components/{p-fe2e4215.entry.js → p-02b5276f.entry.js} +1 -1
  1583. package/dist/swirl-components/{p-08ffdbc4.entry.js → p-048dad72.entry.js} +1 -1
  1584. package/dist/swirl-components/{p-537cb29d.entry.js → p-0689be3f.entry.js} +1 -1
  1585. package/dist/swirl-components/{p-99cde5f0.entry.js → p-08e77e17.entry.js} +1 -1
  1586. package/dist/swirl-components/{p-4c646f7a.entry.js → p-08f6ac37.entry.js} +1 -1
  1587. package/dist/swirl-components/{p-cf3019db.entry.js → p-0a193d0f.entry.js} +1 -1
  1588. package/dist/swirl-components/{p-5e675dda.entry.js → p-0a505891.entry.js} +1 -1
  1589. package/dist/swirl-components/{p-619480f8.entry.js → p-0ab6bfeb.entry.js} +1 -1
  1590. package/dist/swirl-components/{p-3525c8b7.entry.js → p-0bf0b6d6.entry.js} +1 -1
  1591. package/dist/swirl-components/{p-afbda14c.entry.js → p-0ed0bfc7.entry.js} +1 -1
  1592. package/dist/swirl-components/{p-965fdc4d.entry.js → p-0fec7c33.entry.js} +1 -1
  1593. package/dist/swirl-components/{p-4f90ed70.entry.js → p-103b046f.entry.js} +1 -1
  1594. package/dist/swirl-components/{p-c2624c29.entry.js → p-111b34fd.entry.js} +1 -1
  1595. package/dist/swirl-components/{p-25f65176.entry.js → p-11454ef1.entry.js} +1 -1
  1596. package/dist/swirl-components/p-122c83c5.entry.js +1 -0
  1597. package/dist/swirl-components/{p-80fd6f6c.entry.js → p-1232c3a1.entry.js} +1 -1
  1598. package/dist/swirl-components/{p-9a2f709b.entry.js → p-134395da.entry.js} +1 -1
  1599. package/dist/swirl-components/{p-a56fdacb.entry.js → p-13a18b9a.entry.js} +1 -1
  1600. package/dist/swirl-components/p-13db8c07.entry.js +1 -0
  1601. package/dist/swirl-components/{p-2ebdb46b.entry.js → p-14ae282f.entry.js} +1 -1
  1602. package/dist/swirl-components/{p-9604c4e4.entry.js → p-152ae9c8.entry.js} +1 -1
  1603. package/dist/swirl-components/{p-735f4ea3.entry.js → p-17d3cc3c.entry.js} +1 -1
  1604. package/dist/swirl-components/{p-58080223.entry.js → p-17d8173c.entry.js} +1 -1
  1605. package/dist/swirl-components/p-18db4d1d.entry.js +1 -0
  1606. package/dist/swirl-components/{p-bf32b52d.entry.js → p-1910b5ea.entry.js} +1 -1
  1607. package/dist/swirl-components/p-19a7ddf5.entry.js +1 -0
  1608. package/dist/swirl-components/{p-f7734ebb.entry.js → p-1a4f3594.entry.js} +1 -1
  1609. package/dist/swirl-components/p-1a527cd9.entry.js +1 -0
  1610. package/dist/swirl-components/p-1a6c3170.entry.js +1 -0
  1611. package/dist/swirl-components/{p-b4c06459.entry.js → p-1b056440.entry.js} +1 -1
  1612. package/dist/swirl-components/{p-fb5c1da3.entry.js → p-1b361b2f.entry.js} +1 -1
  1613. package/dist/swirl-components/{p-1d5201b8.entry.js → p-1b4252d6.entry.js} +1 -1
  1614. package/dist/swirl-components/{p-469243d3.entry.js → p-1b5224d2.entry.js} +1 -1
  1615. package/dist/swirl-components/{p-c3ac3f8d.entry.js → p-1d16b2b4.entry.js} +1 -1
  1616. package/dist/swirl-components/{p-22f8ab2d.entry.js → p-1e9cacc7.entry.js} +1 -1
  1617. package/dist/swirl-components/{p-b223709b.entry.js → p-1f19ad75.entry.js} +1 -1
  1618. package/dist/swirl-components/{p-bdba9ae2.entry.js → p-1fbe0627.entry.js} +1 -1
  1619. package/dist/swirl-components/{p-48dfb55b.entry.js → p-200e83a1.entry.js} +1 -1
  1620. package/dist/swirl-components/p-207d94fc.entry.js +1 -0
  1621. package/dist/swirl-components/{p-e96067f0.entry.js → p-24bc12e4.entry.js} +1 -1
  1622. package/dist/swirl-components/p-253812a2.entry.js +1 -0
  1623. package/dist/swirl-components/{p-8112dbb3.entry.js → p-267d5d1b.entry.js} +1 -1
  1624. package/dist/swirl-components/p-26a45f7b.entry.js +1 -0
  1625. package/dist/swirl-components/{p-1e019b1d.entry.js → p-26fa1726.entry.js} +1 -1
  1626. package/dist/swirl-components/{p-b25abc0d.entry.js → p-2a0f3d08.entry.js} +1 -1
  1627. package/dist/swirl-components/{p-73e6be99.entry.js → p-2a9a5d37.entry.js} +1 -1
  1628. package/dist/swirl-components/p-2c7c6e51.entry.js +1 -0
  1629. package/dist/swirl-components/{p-8f4a18f8.entry.js → p-2d85c1ec.entry.js} +1 -1
  1630. package/dist/swirl-components/{p-edb6a9dc.entry.js → p-2f802aac.entry.js} +1 -1
  1631. package/dist/swirl-components/{p-cd27ea60.entry.js → p-2ffb681a.entry.js} +1 -1
  1632. package/dist/swirl-components/{p-63198f3d.entry.js → p-308c89b2.entry.js} +1 -1
  1633. package/dist/swirl-components/p-3111fac5.entry.js +1 -0
  1634. package/dist/swirl-components/{p-4244916c.entry.js → p-313ec2bf.entry.js} +1 -1
  1635. package/dist/swirl-components/{p-a48b2009.entry.js → p-31535e48.entry.js} +1 -1
  1636. package/dist/swirl-components/{p-1a7096f9.entry.js → p-31d42180.entry.js} +1 -1
  1637. package/dist/swirl-components/p-322e0e47.entry.js +1 -0
  1638. package/dist/swirl-components/{p-c222b7d6.entry.js → p-328e62e9.entry.js} +1 -1
  1639. package/dist/swirl-components/{p-f3cc5f22.entry.js → p-33c27057.entry.js} +1 -1
  1640. package/dist/swirl-components/{p-d925a5da.entry.js → p-34098696.entry.js} +1 -1
  1641. package/dist/swirl-components/{p-e95ec1fb.entry.js → p-3456ec45.entry.js} +1 -1
  1642. package/dist/swirl-components/{p-81c63162.entry.js → p-34ee2051.entry.js} +1 -1
  1643. package/dist/swirl-components/{p-b7b2d90c.entry.js → p-351e9c46.entry.js} +1 -1
  1644. package/dist/swirl-components/{p-3599fdf5.entry.js → p-35529fe8.entry.js} +1 -1
  1645. package/dist/swirl-components/{p-bfbfcda6.entry.js → p-3599335e.entry.js} +1 -1
  1646. package/dist/swirl-components/{p-f067fb8c.entry.js → p-35f06f59.entry.js} +1 -1
  1647. package/dist/swirl-components/{p-b258e493.entry.js → p-372bee3b.entry.js} +1 -1
  1648. package/dist/swirl-components/{p-01ee5bbc.entry.js → p-38a0b921.entry.js} +1 -1
  1649. package/dist/swirl-components/{p-3d234b5c.entry.js → p-38c2b0dd.entry.js} +1 -1
  1650. package/dist/swirl-components/p-392edc20.entry.js +1 -0
  1651. package/dist/swirl-components/{p-2297d732.entry.js → p-3b86924a.entry.js} +1 -1
  1652. package/dist/swirl-components/{p-5c622620.entry.js → p-3b9910ae.entry.js} +1 -1
  1653. package/dist/swirl-components/p-3bb8d4f5.entry.js +1 -0
  1654. package/dist/swirl-components/p-3bbda100.entry.js +1 -0
  1655. package/dist/swirl-components/{p-521c2ea3.entry.js → p-3bcd6287.entry.js} +1 -1
  1656. package/dist/swirl-components/{p-ff4c6c76.entry.js → p-3c4dbc34.entry.js} +1 -1
  1657. package/dist/swirl-components/{p-9b63bc9f.entry.js → p-3c8f832d.entry.js} +1 -1
  1658. package/dist/swirl-components/p-3d10ca0e.entry.js +1 -0
  1659. package/dist/swirl-components/{p-e394f13e.entry.js → p-3d3dab6f.entry.js} +1 -1
  1660. package/dist/swirl-components/p-3da00a57.entry.js +1 -0
  1661. package/dist/swirl-components/{p-5d34bd5d.entry.js → p-3e133e3e.entry.js} +1 -1
  1662. package/dist/swirl-components/{p-fabfe31b.entry.js → p-3f53bbe9.entry.js} +1 -1
  1663. package/dist/swirl-components/p-3f8f4998.entry.js +1 -0
  1664. package/dist/swirl-components/{p-a4d6a08e.entry.js → p-400229aa.entry.js} +1 -1
  1665. package/dist/swirl-components/{p-4fa1bb23.entry.js → p-402512c3.entry.js} +1 -1
  1666. package/dist/swirl-components/p-4091a2a6.entry.js +1 -0
  1667. package/dist/swirl-components/{p-fc408008.entry.js → p-40c841c8.entry.js} +1 -1
  1668. package/dist/swirl-components/p-40fadd55.entry.js +1 -0
  1669. package/dist/swirl-components/{p-0380ac9c.entry.js → p-412bdc78.entry.js} +1 -1
  1670. package/dist/swirl-components/{p-283e2b78.entry.js → p-4264f3fd.entry.js} +1 -1
  1671. package/dist/swirl-components/{p-f9349652.entry.js → p-4280ff50.entry.js} +1 -1
  1672. package/dist/swirl-components/{p-291b5070.entry.js → p-433fc98e.entry.js} +1 -1
  1673. package/dist/swirl-components/{p-ec1a5cf3.entry.js → p-4398e99b.entry.js} +1 -1
  1674. package/dist/swirl-components/{p-24bf59a4.entry.js → p-43991877.entry.js} +1 -1
  1675. package/dist/swirl-components/{p-f228eff0.entry.js → p-442ed727.entry.js} +1 -1
  1676. package/dist/swirl-components/{p-3aa8c981.entry.js → p-4494c1ee.entry.js} +1 -1
  1677. package/dist/swirl-components/{p-9ec9020b.entry.js → p-45188372.entry.js} +1 -1
  1678. package/dist/swirl-components/{p-5670c1f3.entry.js → p-47f4f565.entry.js} +1 -1
  1679. package/dist/swirl-components/p-47f6b154.entry.js +1 -0
  1680. package/dist/swirl-components/p-488f32e3.entry.js +1 -0
  1681. package/dist/swirl-components/{p-ffcf6f54.entry.js → p-48f603c8.entry.js} +1 -1
  1682. package/dist/swirl-components/{p-f7895a83.entry.js → p-495523cd.entry.js} +1 -1
  1683. package/dist/swirl-components/{p-dcf5246a.entry.js → p-49a6301c.entry.js} +1 -1
  1684. package/dist/swirl-components/p-4a5cdc63.entry.js +1 -0
  1685. package/dist/swirl-components/{p-fa33a143.entry.js → p-4bdd16bf.entry.js} +1 -1
  1686. package/dist/swirl-components/{p-44f981d3.entry.js → p-4ccd7ae3.entry.js} +1 -1
  1687. package/dist/swirl-components/{p-49c79666.entry.js → p-4e0b8ac1.entry.js} +1 -1
  1688. package/dist/swirl-components/{p-d2b1a2c6.entry.js → p-4f0387d2.entry.js} +1 -1
  1689. package/dist/swirl-components/{p-788d2b22.entry.js → p-4fa6cc85.entry.js} +1 -1
  1690. package/dist/swirl-components/{p-3b1084d9.entry.js → p-4fc438e2.entry.js} +1 -1
  1691. package/dist/swirl-components/{p-f39f3c85.entry.js → p-50b51faa.entry.js} +1 -1
  1692. package/dist/swirl-components/{p-0aab51e8.entry.js → p-511005d3.entry.js} +1 -1
  1693. package/dist/swirl-components/p-51bcdeef.entry.js +1 -0
  1694. package/dist/swirl-components/{p-abdf4e2a.entry.js → p-5204f7b0.entry.js} +1 -1
  1695. package/dist/swirl-components/{p-68e2caca.entry.js → p-5392dac8.entry.js} +1 -1
  1696. package/dist/swirl-components/{p-88b775bd.entry.js → p-53aa7334.entry.js} +1 -1
  1697. package/dist/swirl-components/{p-1c6e6641.entry.js → p-53b8be84.entry.js} +1 -1
  1698. package/dist/swirl-components/{p-33aeb754.entry.js → p-540dd536.entry.js} +1 -1
  1699. package/dist/swirl-components/p-565274c4.entry.js +1 -0
  1700. package/dist/swirl-components/{p-dd213c54.entry.js → p-56b1c412.entry.js} +1 -1
  1701. package/dist/swirl-components/{p-e09751e7.entry.js → p-57b8a554.entry.js} +1 -1
  1702. package/dist/swirl-components/{p-803f3472.entry.js → p-58ce9ffc.entry.js} +1 -1
  1703. package/dist/swirl-components/p-59ceddce.entry.js +1 -0
  1704. package/dist/swirl-components/{p-c1f87023.entry.js → p-5a103f31.entry.js} +1 -1
  1705. package/dist/swirl-components/{p-a3737bbe.entry.js → p-5acc4954.entry.js} +1 -1
  1706. package/dist/swirl-components/{p-065b47d3.entry.js → p-5b654e95.entry.js} +1 -1
  1707. package/dist/swirl-components/{p-d3cabe65.entry.js → p-5c4d8191.entry.js} +1 -1
  1708. package/dist/swirl-components/{p-36e22894.entry.js → p-5c67ee09.entry.js} +1 -1
  1709. package/dist/swirl-components/{p-f657d1b2.entry.js → p-5d742109.entry.js} +1 -1
  1710. package/dist/swirl-components/{p-0005fc08.entry.js → p-5eb80e8a.entry.js} +1 -1
  1711. package/dist/swirl-components/{p-7d30a3c5.entry.js → p-5ef5a85e.entry.js} +1 -1
  1712. package/dist/swirl-components/{p-3fd30d5f.entry.js → p-5f3005ab.entry.js} +1 -1
  1713. package/dist/swirl-components/{p-08118561.entry.js → p-5fe8e456.entry.js} +1 -1
  1714. package/dist/swirl-components/{p-4abc0c4e.entry.js → p-60354d9f.entry.js} +1 -1
  1715. package/dist/swirl-components/{p-43f10659.entry.js → p-6036bca7.entry.js} +1 -1
  1716. package/dist/swirl-components/{p-ba305051.entry.js → p-607545ea.entry.js} +1 -1
  1717. package/dist/swirl-components/p-608dee68.entry.js +1 -0
  1718. package/dist/swirl-components/{p-94e30964.entry.js → p-60bbaf88.entry.js} +1 -1
  1719. package/dist/swirl-components/{p-d7a634cd.entry.js → p-60c60c2b.entry.js} +1 -1
  1720. package/dist/swirl-components/{p-24e1ddf1.entry.js → p-61b0026e.entry.js} +1 -1
  1721. package/dist/swirl-components/{p-ad4507c6.entry.js → p-61d0ac65.entry.js} +1 -1
  1722. package/dist/swirl-components/p-62319934.entry.js +1 -0
  1723. package/dist/swirl-components/{p-0d909db5.entry.js → p-62fff8d1.entry.js} +1 -1
  1724. package/dist/swirl-components/{p-4eaa3cfb.entry.js → p-6352d126.entry.js} +1 -1
  1725. package/dist/swirl-components/{p-d788d0be.entry.js → p-635ba143.entry.js} +1 -1
  1726. package/dist/swirl-components/{p-43d73ace.entry.js → p-6437f324.entry.js} +1 -1
  1727. package/dist/swirl-components/{p-ab6c9633.entry.js → p-648ffc20.entry.js} +1 -1
  1728. package/dist/swirl-components/p-64af39a9.entry.js +1 -0
  1729. package/dist/swirl-components/{p-f877284d.entry.js → p-658db9e1.entry.js} +1 -1
  1730. package/dist/swirl-components/{p-cfef3b3f.entry.js → p-65f6379c.entry.js} +1 -1
  1731. package/dist/swirl-components/{p-bae364ab.entry.js → p-66126bbd.entry.js} +1 -1
  1732. package/dist/swirl-components/{p-a5614cfc.entry.js → p-661584e4.entry.js} +1 -1
  1733. package/dist/swirl-components/{p-81c2f1d4.entry.js → p-66ee857c.entry.js} +1 -1
  1734. package/dist/swirl-components/{p-49594f16.entry.js → p-675b447e.entry.js} +1 -1
  1735. package/dist/swirl-components/{p-f842d194.entry.js → p-6842536b.entry.js} +1 -1
  1736. package/dist/swirl-components/{p-da4b7dac.entry.js → p-692cb1d4.entry.js} +1 -1
  1737. package/dist/swirl-components/{p-42a81a03.entry.js → p-6946e8b9.entry.js} +1 -1
  1738. package/dist/swirl-components/{p-9b519a31.entry.js → p-6b146c19.entry.js} +1 -1
  1739. package/dist/swirl-components/{p-373c1c8d.entry.js → p-6b629222.entry.js} +1 -1
  1740. package/dist/swirl-components/{p-2fee14f0.entry.js → p-6bd4c397.entry.js} +1 -1
  1741. package/dist/swirl-components/{p-e571989d.entry.js → p-6c258a68.entry.js} +1 -1
  1742. package/dist/swirl-components/{p-f26189ba.entry.js → p-6db4d0f9.entry.js} +1 -1
  1743. package/dist/swirl-components/{p-4e512330.entry.js → p-6efac17b.entry.js} +1 -1
  1744. package/dist/swirl-components/{p-7e3348a8.entry.js → p-701a7cb8.entry.js} +1 -1
  1745. package/dist/swirl-components/{p-6e2006c7.entry.js → p-70ced3d9.entry.js} +1 -1
  1746. package/dist/swirl-components/{p-f3a45c60.entry.js → p-711e9ba4.entry.js} +1 -1
  1747. package/dist/swirl-components/{p-5fc61cdf.entry.js → p-7148feb3.entry.js} +1 -1
  1748. package/dist/swirl-components/{p-b009de1a.entry.js → p-7183297d.entry.js} +1 -1
  1749. package/dist/swirl-components/p-7192c2ae.entry.js +1 -0
  1750. package/dist/swirl-components/{p-c4f79a00.entry.js → p-719e2a7a.entry.js} +1 -1
  1751. package/dist/swirl-components/{p-992201c1.entry.js → p-71a87cf2.entry.js} +1 -1
  1752. package/dist/swirl-components/{p-315d29d9.entry.js → p-721b37ac.entry.js} +1 -1
  1753. package/dist/swirl-components/{p-1c1ad38d.entry.js → p-72d3b347.entry.js} +1 -1
  1754. package/dist/swirl-components/{p-40428712.entry.js → p-73669333.entry.js} +1 -1
  1755. package/dist/swirl-components/{p-ee7daf89.entry.js → p-73a3d381.entry.js} +1 -1
  1756. package/dist/swirl-components/{p-9b6a4b57.entry.js → p-73ba5a83.entry.js} +1 -1
  1757. package/dist/swirl-components/{p-bc359b9e.entry.js → p-75c7c6da.entry.js} +1 -1
  1758. package/dist/swirl-components/p-75f110bb.entry.js +1 -0
  1759. package/dist/swirl-components/{p-53397ffa.entry.js → p-774b2380.entry.js} +1 -1
  1760. package/dist/swirl-components/{p-24877f26.entry.js → p-77a8171c.entry.js} +1 -1
  1761. package/dist/swirl-components/{p-594bc1d5.entry.js → p-77eb7345.entry.js} +1 -1
  1762. package/dist/swirl-components/{p-7af6cb1e.entry.js → p-79d45756.entry.js} +1 -1
  1763. package/dist/swirl-components/p-7b3f49b2.entry.js +1 -0
  1764. package/dist/swirl-components/{p-ce78fa80.entry.js → p-7b6e81fb.entry.js} +1 -1
  1765. package/dist/swirl-components/p-7ba8c595.entry.js +1 -0
  1766. package/dist/swirl-components/{p-340cebd5.entry.js → p-7eb977de.entry.js} +1 -1
  1767. package/dist/swirl-components/p-7ed8229f.entry.js +1 -0
  1768. package/dist/swirl-components/{p-fa9586b7.entry.js → p-7f00ec03.entry.js} +1 -1
  1769. package/dist/swirl-components/p-7f780bf4.entry.js +1 -0
  1770. package/dist/swirl-components/{p-aba8f375.entry.js → p-808c9ec6.entry.js} +1 -1
  1771. package/dist/swirl-components/{p-686387e5.entry.js → p-8200de4a.entry.js} +1 -1
  1772. package/dist/swirl-components/{p-e0f51383.entry.js → p-82b94119.entry.js} +1 -1
  1773. package/dist/swirl-components/{p-083a4df1.entry.js → p-846b56d1.entry.js} +1 -1
  1774. package/dist/swirl-components/{p-867c28a3.entry.js → p-84b0220e.entry.js} +1 -1
  1775. package/dist/swirl-components/p-84bc3095.entry.js +1 -0
  1776. package/dist/swirl-components/{p-b0df6e3c.entry.js → p-84eda141.entry.js} +1 -1
  1777. package/dist/swirl-components/{p-4646cdaf.entry.js → p-853e9542.entry.js} +1 -1
  1778. package/dist/swirl-components/{p-8d11bf0e.entry.js → p-854c18c6.entry.js} +1 -1
  1779. package/dist/swirl-components/{p-a9948772.entry.js → p-85a4c4a9.entry.js} +1 -1
  1780. package/dist/swirl-components/{p-d4b5e6a8.entry.js → p-85b2eb71.entry.js} +1 -1
  1781. package/dist/swirl-components/{p-f358dcaf.entry.js → p-86104cc3.entry.js} +1 -1
  1782. package/dist/swirl-components/p-87a4e8ae.entry.js +1 -0
  1783. package/dist/swirl-components/{p-06e0b554.entry.js → p-87f0deff.entry.js} +1 -1
  1784. package/dist/swirl-components/p-88b022ed.entry.js +1 -0
  1785. package/dist/swirl-components/{p-22c10fd5.entry.js → p-8949aeeb.entry.js} +1 -1
  1786. package/dist/swirl-components/{p-9aaa5c7f.entry.js → p-89ce106a.entry.js} +1 -1
  1787. package/dist/swirl-components/{p-2d6857a1.entry.js → p-8a27d321.entry.js} +1 -1
  1788. package/dist/swirl-components/{p-ed66fae5.entry.js → p-8aa46528.entry.js} +1 -1
  1789. package/dist/swirl-components/{p-f99046b5.entry.js → p-8ae2d034.entry.js} +1 -1
  1790. package/dist/swirl-components/p-8bed834d.entry.js +1 -0
  1791. package/dist/swirl-components/{p-df474124.entry.js → p-8beefa5d.entry.js} +1 -1
  1792. package/dist/swirl-components/p-8c6bba77.entry.js +1 -0
  1793. package/dist/swirl-components/p-8d09f27a.entry.js +1 -0
  1794. package/dist/swirl-components/p-8dd850ac.entry.js +1 -0
  1795. package/dist/swirl-components/{p-432b80e9.entry.js → p-8e3ccb4f.entry.js} +1 -1
  1796. package/dist/swirl-components/{p-6e9bb3db.entry.js → p-8e7f121e.entry.js} +1 -1
  1797. package/dist/swirl-components/{p-1fe5e741.entry.js → p-8f0dcdde.entry.js} +1 -1
  1798. package/dist/swirl-components/{p-a9ac8654.entry.js → p-8f1a3f2b.entry.js} +1 -1
  1799. package/dist/swirl-components/{p-267444dc.entry.js → p-913af6ca.entry.js} +1 -1
  1800. package/dist/swirl-components/p-919f027e.entry.js +1 -0
  1801. package/dist/swirl-components/p-91fc4536.entry.js +1 -0
  1802. package/dist/swirl-components/{p-69486a19.entry.js → p-921f4379.entry.js} +1 -1
  1803. package/dist/swirl-components/{p-3cc16246.entry.js → p-92aeaf00.entry.js} +1 -1
  1804. package/dist/swirl-components/{p-66732760.entry.js → p-92b7b005.entry.js} +1 -1
  1805. package/dist/swirl-components/p-930e9294.entry.js +1 -0
  1806. package/dist/swirl-components/{p-ccff7ab2.entry.js → p-934ce72b.entry.js} +1 -1
  1807. package/dist/swirl-components/{p-a3df3261.entry.js → p-954da07d.entry.js} +1 -1
  1808. package/dist/swirl-components/{p-cec9d6a0.entry.js → p-95914ccb.entry.js} +1 -1
  1809. package/dist/swirl-components/{p-9b942dc9.entry.js → p-95ac9000.entry.js} +1 -1
  1810. package/dist/swirl-components/{p-8a72a10d.entry.js → p-969b1ab4.entry.js} +1 -1
  1811. package/dist/swirl-components/p-96d53921.entry.js +1 -0
  1812. package/dist/swirl-components/{p-4495cc18.entry.js → p-96d56855.entry.js} +1 -1
  1813. package/dist/swirl-components/{p-fa7741e9.entry.js → p-96f6918f.entry.js} +1 -1
  1814. package/dist/swirl-components/{p-5f974d33.entry.js → p-96fa6200.entry.js} +1 -1
  1815. package/dist/swirl-components/p-9749735e.entry.js +1 -0
  1816. package/dist/swirl-components/{p-bda5f428.entry.js → p-97efbfd4.entry.js} +1 -1
  1817. package/dist/swirl-components/{p-0f02f2c5.entry.js → p-97f4e314.entry.js} +1 -1
  1818. package/dist/swirl-components/p-980da38e.entry.js +1 -0
  1819. package/dist/swirl-components/{p-6ebf6ea3.entry.js → p-98614a09.entry.js} +1 -1
  1820. package/dist/swirl-components/{p-d2d80f4f.entry.js → p-9977cd94.entry.js} +1 -1
  1821. package/dist/swirl-components/{p-05c9893a.entry.js → p-9991dfe3.entry.js} +1 -1
  1822. package/dist/swirl-components/p-99e49b6a.entry.js +1 -0
  1823. package/dist/swirl-components/{p-62f8012f.entry.js → p-9abddd0f.entry.js} +1 -1
  1824. package/dist/swirl-components/{p-7bd4138a.entry.js → p-9b1529f8.entry.js} +1 -1
  1825. package/dist/swirl-components/p-9bfd141b.entry.js +1 -0
  1826. package/dist/swirl-components/{p-bb94513a.entry.js → p-9d071b42.entry.js} +1 -1
  1827. package/dist/swirl-components/{p-9576a37c.entry.js → p-9d1b7a89.entry.js} +1 -1
  1828. package/dist/swirl-components/{p-18a6f010.entry.js → p-9d1c89ac.entry.js} +1 -1
  1829. package/dist/swirl-components/{p-ae466055.entry.js → p-9d529149.entry.js} +1 -1
  1830. package/dist/swirl-components/p-9d81dab4.entry.js +1 -0
  1831. package/dist/swirl-components/{p-81a9d24a.entry.js → p-9e10a30e.entry.js} +1 -1
  1832. package/dist/swirl-components/{p-1db27ac6.entry.js → p-9e269037.entry.js} +1 -1
  1833. package/dist/swirl-components/{p-a6978979.entry.js → p-9ea7930e.entry.js} +1 -1
  1834. package/dist/swirl-components/{p-158161d1.entry.js → p-9f6bfab0.entry.js} +1 -1
  1835. package/dist/swirl-components/{p-b27562d7.entry.js → p-9fa55e68.entry.js} +1 -1
  1836. package/dist/swirl-components/{p-3d3bdf60.entry.js → p-a1766db6.entry.js} +1 -1
  1837. package/dist/swirl-components/{p-3f3b9e90.entry.js → p-a36d6c29.entry.js} +1 -1
  1838. package/dist/swirl-components/{p-33de46d9.entry.js → p-a37b9e8b.entry.js} +1 -1
  1839. package/dist/swirl-components/{p-6fa4395b.entry.js → p-a46ddf9e.entry.js} +1 -1
  1840. package/dist/swirl-components/{p-9980c82c.entry.js → p-a6a51376.entry.js} +1 -1
  1841. package/dist/swirl-components/{p-ea226def.entry.js → p-a715b867.entry.js} +1 -1
  1842. package/dist/swirl-components/p-a7840640.entry.js +1 -0
  1843. package/dist/swirl-components/{p-2f70cb18.entry.js → p-a7b9c8af.entry.js} +1 -1
  1844. package/dist/swirl-components/{p-cd09a540.entry.js → p-a7d234dc.entry.js} +1 -1
  1845. package/dist/swirl-components/{p-a70ca3b8.entry.js → p-a83c8aee.entry.js} +1 -1
  1846. package/dist/swirl-components/{p-c85b3adb.entry.js → p-a84b562e.entry.js} +1 -1
  1847. package/dist/swirl-components/p-a8774bf7.entry.js +1 -0
  1848. package/dist/swirl-components/{p-ee58fc60.entry.js → p-a9bea105.entry.js} +1 -1
  1849. package/dist/swirl-components/{p-3a534541.entry.js → p-aaad0cf6.entry.js} +1 -1
  1850. package/dist/swirl-components/{p-d29f8446.entry.js → p-ace5b057.entry.js} +1 -1
  1851. package/dist/swirl-components/{p-99a38b33.entry.js → p-adce1b0f.entry.js} +1 -1
  1852. package/dist/swirl-components/{p-a78fe0df.entry.js → p-af4292d1.entry.js} +1 -1
  1853. package/dist/swirl-components/{p-9645e509.entry.js → p-afbd7762.entry.js} +1 -1
  1854. package/dist/swirl-components/{p-25dd2a43.entry.js → p-afd3fbc0.entry.js} +1 -1
  1855. package/dist/swirl-components/{p-4ad688e4.entry.js → p-b00c447b.entry.js} +1 -1
  1856. package/dist/swirl-components/{p-ba9ba67a.entry.js → p-b031c493.entry.js} +1 -1
  1857. package/dist/swirl-components/{p-ad50812a.entry.js → p-b0fa1c80.entry.js} +1 -1
  1858. package/dist/swirl-components/{p-8044886a.entry.js → p-b18a017f.entry.js} +1 -1
  1859. package/dist/swirl-components/p-b1e64952.entry.js +1 -0
  1860. package/dist/swirl-components/{p-06227257.entry.js → p-b27242e1.entry.js} +1 -1
  1861. package/dist/swirl-components/p-b27610c0.entry.js +1 -0
  1862. package/dist/swirl-components/p-b2d5c869.entry.js +1 -0
  1863. package/dist/swirl-components/{p-54e20362.entry.js → p-b35f5703.entry.js} +1 -1
  1864. package/dist/swirl-components/p-b3b7b2f0.entry.js +1 -0
  1865. package/dist/swirl-components/{p-a299e60c.entry.js → p-b4c4a221.entry.js} +1 -1
  1866. package/dist/swirl-components/{p-47db0a81.entry.js → p-b557e158.entry.js} +1 -1
  1867. package/dist/swirl-components/{p-0a6c4697.entry.js → p-b61c36c9.entry.js} +1 -1
  1868. package/dist/swirl-components/{p-7f3b2335.entry.js → p-b70476e7.entry.js} +1 -1
  1869. package/dist/swirl-components/{p-f3be233c.entry.js → p-b8780e08.entry.js} +1 -1
  1870. package/dist/swirl-components/{p-012a92af.entry.js → p-b92659e2.entry.js} +1 -1
  1871. package/dist/swirl-components/{p-168e465f.entry.js → p-b9f6d49b.entry.js} +1 -1
  1872. package/dist/swirl-components/p-ba6ad301.entry.js +1 -0
  1873. package/dist/swirl-components/{p-e4c444dc.entry.js → p-bae31543.entry.js} +1 -1
  1874. package/dist/swirl-components/{p-2f535718.entry.js → p-bb802002.entry.js} +1 -1
  1875. package/dist/swirl-components/{p-14160ea6.entry.js → p-bcf0b62a.entry.js} +1 -1
  1876. package/dist/swirl-components/p-bf0d4cc1.entry.js +1 -0
  1877. package/dist/swirl-components/{p-956dd560.entry.js → p-bf287c1b.entry.js} +1 -1
  1878. package/dist/swirl-components/{p-8abc0298.entry.js → p-bfe7d2a7.entry.js} +1 -1
  1879. package/dist/swirl-components/{p-4f2e0a5a.entry.js → p-c05df540.entry.js} +1 -1
  1880. package/dist/swirl-components/{p-93b7f357.entry.js → p-c0c00d97.entry.js} +1 -1
  1881. package/dist/swirl-components/{p-29bef0bb.entry.js → p-c0cdca79.entry.js} +1 -1
  1882. package/dist/swirl-components/p-c1755d61.entry.js +1 -0
  1883. package/dist/swirl-components/{p-e3717b22.entry.js → p-c2daf636.entry.js} +3 -3
  1884. package/dist/swirl-components/{p-0749a392.entry.js → p-c2dc6256.entry.js} +1 -1
  1885. package/dist/swirl-components/{p-9ad0209f.entry.js → p-c3697434.entry.js} +1 -1
  1886. package/dist/swirl-components/{p-2c5ed3a8.entry.js → p-c3de89c7.entry.js} +1 -1
  1887. package/dist/swirl-components/{p-c95f3ad3.entry.js → p-c4a0dfd8.entry.js} +1 -1
  1888. package/dist/swirl-components/p-c6cc26bb.entry.js +1 -0
  1889. package/dist/swirl-components/{p-f2761468.entry.js → p-c7319b4f.entry.js} +1 -1
  1890. package/dist/swirl-components/{p-b4cf0d01.entry.js → p-c76907d3.entry.js} +1 -1
  1891. package/dist/swirl-components/{p-42811f7a.entry.js → p-c76f855e.entry.js} +1 -1
  1892. package/dist/swirl-components/{p-2dc9d1f8.entry.js → p-c7a791da.entry.js} +1 -1
  1893. package/dist/swirl-components/{p-35188cbf.entry.js → p-c8801f0d.entry.js} +1 -1
  1894. package/dist/swirl-components/{p-d65a21eb.entry.js → p-c91984dd.entry.js} +1 -1
  1895. package/dist/swirl-components/{p-a894f382.entry.js → p-ca27fbbf.entry.js} +1 -1
  1896. package/dist/swirl-components/{p-fb4a2444.entry.js → p-ca414a57.entry.js} +1 -1
  1897. package/dist/swirl-components/{p-dabf2ca6.entry.js → p-cb6868fb.entry.js} +1 -1
  1898. package/dist/swirl-components/{p-9427779e.entry.js → p-cb908522.entry.js} +1 -1
  1899. package/dist/swirl-components/{p-345181e7.entry.js → p-cd96647a.entry.js} +1 -1
  1900. package/dist/swirl-components/{p-4e046fb0.entry.js → p-cebae107.entry.js} +1 -1
  1901. package/dist/swirl-components/{p-1274f545.entry.js → p-cf643e3b.entry.js} +1 -1
  1902. package/dist/swirl-components/p-cf8629b9.entry.js +1 -0
  1903. package/dist/swirl-components/p-d030b30f.entry.js +1 -0
  1904. package/dist/swirl-components/p-d105a11f.entry.js +1 -0
  1905. package/dist/swirl-components/p-d1c3097d.entry.js +1 -0
  1906. package/dist/swirl-components/{p-96cff4f4.entry.js → p-d2df466e.entry.js} +1 -1
  1907. package/dist/swirl-components/{p-64e277c7.entry.js → p-d38b61c1.entry.js} +1 -1
  1908. package/dist/swirl-components/p-d58c1157.entry.js +1 -0
  1909. package/dist/swirl-components/{p-2e66d0a8.entry.js → p-d60d6b0d.entry.js} +1 -1
  1910. package/dist/swirl-components/p-d69bd65a.entry.js +1 -0
  1911. package/dist/swirl-components/{p-fb2384cd.entry.js → p-d6a34f69.entry.js} +1 -1
  1912. package/dist/swirl-components/p-d6ec8182.entry.js +1 -0
  1913. package/dist/swirl-components/{p-ff9a1624.entry.js → p-d70eb176.entry.js} +1 -1
  1914. package/dist/swirl-components/{p-df359854.entry.js → p-d7c43529.entry.js} +1 -1
  1915. package/dist/swirl-components/{p-53ce4cf3.entry.js → p-d88aceef.entry.js} +1 -1
  1916. package/dist/swirl-components/{p-c4ba9b11.entry.js → p-d8909c30.entry.js} +1 -1
  1917. package/dist/swirl-components/{p-31c6ea9b.entry.js → p-d8c8d815.entry.js} +1 -1
  1918. package/dist/swirl-components/{p-7206daf2.entry.js → p-d927d6eb.entry.js} +1 -1
  1919. package/dist/swirl-components/p-d96a6590.entry.js +1 -0
  1920. package/dist/swirl-components/{p-9a391127.entry.js → p-d9e0a84b.entry.js} +1 -1
  1921. package/dist/swirl-components/{p-161254e9.entry.js → p-da854f14.entry.js} +1 -1
  1922. package/dist/swirl-components/{p-642cf726.entry.js → p-dae8b063.entry.js} +1 -1
  1923. package/dist/swirl-components/{p-8ff46f10.entry.js → p-db2ed09e.entry.js} +1 -1
  1924. package/dist/swirl-components/{p-305e684d.entry.js → p-dc1d3130.entry.js} +1 -1
  1925. package/dist/swirl-components/{p-1f5e34cd.entry.js → p-dc76a5bf.entry.js} +1 -1
  1926. package/dist/swirl-components/{p-2e66f5a8.entry.js → p-dd4f4aed.entry.js} +1 -1
  1927. package/dist/swirl-components/{p-0d557c5f.entry.js → p-dda12e08.entry.js} +1 -1
  1928. package/dist/swirl-components/{p-bd88f386.entry.js → p-de3c159e.entry.js} +1 -1
  1929. package/dist/swirl-components/{p-0102779a.entry.js → p-ded5585e.entry.js} +1 -1
  1930. package/dist/swirl-components/{p-4b10ac7e.entry.js → p-df5ad71c.entry.js} +1 -1
  1931. package/dist/swirl-components/{p-9af9c955.entry.js → p-e05e2dd8.entry.js} +1 -1
  1932. package/dist/swirl-components/{p-bc679d4a.entry.js → p-e282ac8b.entry.js} +1 -1
  1933. package/dist/swirl-components/p-e2acb1bd.entry.js +1 -0
  1934. package/dist/swirl-components/{p-78c07461.entry.js → p-e331e1ed.entry.js} +1 -1
  1935. package/dist/swirl-components/{p-2ec43b07.entry.js → p-e3796507.entry.js} +1 -1
  1936. package/dist/swirl-components/{p-8c04def4.entry.js → p-e3d64e7d.entry.js} +1 -1
  1937. package/dist/swirl-components/{p-a46b9bf8.entry.js → p-e56b6f60.entry.js} +1 -1
  1938. package/dist/swirl-components/{p-69850cc6.entry.js → p-e587bc8d.entry.js} +1 -1
  1939. package/dist/swirl-components/{p-434d3d41.entry.js → p-e5bffec3.entry.js} +1 -1
  1940. package/dist/swirl-components/{p-b061bdcc.entry.js → p-e65fbbec.entry.js} +1 -1
  1941. package/dist/swirl-components/{p-8b239ef4.entry.js → p-e9d819b5.entry.js} +1 -1
  1942. package/dist/swirl-components/p-eb46df46.entry.js +1 -0
  1943. package/dist/swirl-components/{p-06d2cc5d.entry.js → p-ebad01a9.entry.js} +1 -1
  1944. package/dist/swirl-components/{p-2e74b82a.entry.js → p-f034fc82.entry.js} +1 -1
  1945. package/dist/swirl-components/p-f2fcabd1.entry.js +1 -0
  1946. package/dist/swirl-components/{p-d09d4bf6.entry.js → p-f4e1d1e2.entry.js} +1 -1
  1947. package/dist/swirl-components/p-f4f09af8.entry.js +1 -0
  1948. package/dist/swirl-components/{p-88dc4033.entry.js → p-f4f27741.entry.js} +1 -1
  1949. package/dist/swirl-components/{p-8d28c17b.entry.js → p-f6fe64b0.entry.js} +1 -1
  1950. package/dist/swirl-components/{p-3afbf7bb.entry.js → p-f74958f6.entry.js} +1 -1
  1951. package/dist/swirl-components/p-f979650f.entry.js +1 -0
  1952. package/dist/swirl-components/{p-cfd3969b.entry.js → p-fd1d75fb.entry.js} +1 -1
  1953. package/dist/swirl-components/p-fd69f022.entry.js +1 -0
  1954. package/dist/swirl-components/{p-cc06c837.entry.js → p-fe7fe183.entry.js} +1 -1
  1955. package/dist/swirl-components/swirl-components.esm.js +1 -1
  1956. package/dist/types/components/swirl-data-cell/swirl-data-cell.d.ts +13 -0
  1957. package/dist/types/components/swirl-data-cell/swirl-data-cell.stories.d.ts +14 -0
  1958. package/dist/types/components/swirl-data-cell-stack/swirl-data-cell-stack.d.ts +13 -0
  1959. package/dist/types/components/swirl-data-cell-stack/swirl-data-cell-stack.stories.d.ts +14 -0
  1960. package/dist/types/components/swirl-shell-layout/swirl-shell-layout.d.ts +2 -0
  1961. package/dist/types/components/swirl-table-column/swirl-table-column.d.ts +1 -1
  1962. package/dist/types/components.d.ts +56 -0
  1963. package/package.json +1 -1
  1964. package/vscode-data.json +49 -0
  1965. package/dist/swirl-components/p-022e6ef3.entry.js +0 -1
  1966. package/dist/swirl-components/p-049a92a9.entry.js +0 -1
  1967. package/dist/swirl-components/p-05784cd8.entry.js +0 -1
  1968. package/dist/swirl-components/p-06b57310.entry.js +0 -1
  1969. package/dist/swirl-components/p-09d26f2c.entry.js +0 -1
  1970. package/dist/swirl-components/p-0abde1b2.entry.js +0 -1
  1971. package/dist/swirl-components/p-0d4ab2e8.entry.js +0 -1
  1972. package/dist/swirl-components/p-0df5b76f.entry.js +0 -1
  1973. package/dist/swirl-components/p-10eb1825.entry.js +0 -1
  1974. package/dist/swirl-components/p-16ad78ff.entry.js +0 -1
  1975. package/dist/swirl-components/p-1ad96dd8.entry.js +0 -1
  1976. package/dist/swirl-components/p-1c62118d.entry.js +0 -1
  1977. package/dist/swirl-components/p-1e0a77da.entry.js +0 -1
  1978. package/dist/swirl-components/p-1f1d2862.entry.js +0 -1
  1979. package/dist/swirl-components/p-238b68b9.entry.js +0 -1
  1980. package/dist/swirl-components/p-2e319a8d.entry.js +0 -1
  1981. package/dist/swirl-components/p-317f3783.entry.js +0 -1
  1982. package/dist/swirl-components/p-34e5b82a.entry.js +0 -1
  1983. package/dist/swirl-components/p-35620691.entry.js +0 -1
  1984. package/dist/swirl-components/p-38bbbc2d.entry.js +0 -1
  1985. package/dist/swirl-components/p-3f013e08.entry.js +0 -1
  1986. package/dist/swirl-components/p-43d41bc3.entry.js +0 -1
  1987. package/dist/swirl-components/p-4a93d274.entry.js +0 -1
  1988. package/dist/swirl-components/p-4b407963.entry.js +0 -1
  1989. package/dist/swirl-components/p-4f7cd1b4.entry.js +0 -1
  1990. package/dist/swirl-components/p-52d14fe5.entry.js +0 -1
  1991. package/dist/swirl-components/p-533c3221.entry.js +0 -1
  1992. package/dist/swirl-components/p-5472560c.entry.js +0 -1
  1993. package/dist/swirl-components/p-5ec4bedc.entry.js +0 -1
  1994. package/dist/swirl-components/p-5f094d9e.entry.js +0 -1
  1995. package/dist/swirl-components/p-60fd09a5.entry.js +0 -1
  1996. package/dist/swirl-components/p-6120d10c.entry.js +0 -1
  1997. package/dist/swirl-components/p-623e9f4f.entry.js +0 -1
  1998. package/dist/swirl-components/p-6733c4f3.entry.js +0 -1
  1999. package/dist/swirl-components/p-6e1694b3.entry.js +0 -1
  2000. package/dist/swirl-components/p-6e3435c4.entry.js +0 -1
  2001. package/dist/swirl-components/p-703f0f93.entry.js +0 -1
  2002. package/dist/swirl-components/p-77c28530.entry.js +0 -1
  2003. package/dist/swirl-components/p-86cf052e.entry.js +0 -1
  2004. package/dist/swirl-components/p-8f2699bb.entry.js +0 -1
  2005. package/dist/swirl-components/p-8ff35b80.entry.js +0 -1
  2006. package/dist/swirl-components/p-91f6613d.entry.js +0 -1
  2007. package/dist/swirl-components/p-9394dfd4.entry.js +0 -1
  2008. package/dist/swirl-components/p-94a95fb8.entry.js +0 -1
  2009. package/dist/swirl-components/p-972b0fb9.entry.js +0 -1
  2010. package/dist/swirl-components/p-9aa81513.entry.js +0 -1
  2011. package/dist/swirl-components/p-a24cc398.entry.js +0 -1
  2012. package/dist/swirl-components/p-a8521962.entry.js +0 -1
  2013. package/dist/swirl-components/p-abc1ef8b.entry.js +0 -1
  2014. package/dist/swirl-components/p-ace8772d.entry.js +0 -1
  2015. package/dist/swirl-components/p-b02b99aa.entry.js +0 -1
  2016. package/dist/swirl-components/p-b121b87a.entry.js +0 -1
  2017. package/dist/swirl-components/p-b2197a5d.entry.js +0 -1
  2018. package/dist/swirl-components/p-b351585f.entry.js +0 -1
  2019. package/dist/swirl-components/p-c481c1f2.entry.js +0 -1
  2020. package/dist/swirl-components/p-c488e85f.entry.js +0 -1
  2021. package/dist/swirl-components/p-c6f6858b.entry.js +0 -1
  2022. package/dist/swirl-components/p-cab00cf6.entry.js +0 -1
  2023. package/dist/swirl-components/p-ccbdb456.entry.js +0 -1
  2024. package/dist/swirl-components/p-cccc9706.entry.js +0 -1
  2025. package/dist/swirl-components/p-cd22601f.entry.js +0 -1
  2026. package/dist/swirl-components/p-cd2dec9a.entry.js +0 -1
  2027. package/dist/swirl-components/p-cd961b72.entry.js +0 -1
  2028. package/dist/swirl-components/p-d09548d8.entry.js +0 -1
  2029. package/dist/swirl-components/p-d3008950.entry.js +0 -1
  2030. package/dist/swirl-components/p-d34cd8e7.entry.js +0 -1
  2031. package/dist/swirl-components/p-d717843a.entry.js +0 -1
  2032. package/dist/swirl-components/p-dded9e6e.entry.js +0 -1
  2033. package/dist/swirl-components/p-e24ddca7.entry.js +0 -1
  2034. package/dist/swirl-components/p-e60f98e7.entry.js +0 -1
  2035. package/dist/swirl-components/p-e775b898.entry.js +0 -1
  2036. package/dist/swirl-components/p-eb20edc1.entry.js +0 -1
  2037. package/dist/swirl-components/p-ee653977.entry.js +0 -1
  2038. package/dist/swirl-components/p-f57a77d8.entry.js +0 -1
@@ -1,10 +1,10 @@
1
- import{r as t,c as i,h as e,H as s,d as n}from"./p-Dj_4Fda9.js";import{F as r}from"./p-Bp6322JD.js";import{a as o,d as h,u as a,i as c}from"./p-wi_3Z3FQ.js";import{c as l}from"./p-orsBiyT_.js";const u=class{constructor(e){t(this,e),this.activate=i(this,"activate",7),this.visiblePagesChange=i(this,"visiblePagesChange",7),this.downloadStart=i(this,"downloadStart",7),this.active=!0,this.errorMessage="File could not be loaded.",this.typeUnsupportedMessage="File type is not supported.",this.viewMode="single",this.zoom=1,this.skipNativeDownload=!1,this.onActivate=t=>{this.activate.emit(t.detail)},this.onVisiblePagesChange=t=>{this.visiblePagesChange.emit(t.detail)},this.onFallbackDownload=()=>{this.download()}}async download(){if(this.downloadStart.emit(),this.skipNativeDownload)return;const t=this.fileName||this.file.split("/").pop(),i=await fetch(this.file);r.saveAs(await i.blob(),t)}async print(){"application/pdf"!==this.type||this.disablePrint||this.viewer.print()}render(){const t=!Boolean(this.type)||!o(this.type)&&!this.type.startsWith("video/")&&!this.type.startsWith("audio/")&&"text/plain"!==this.type&&"text/csv"!==this.type&&"application/pdf"!==this.type;return e(s,{key:"07c8b42a2b38f1cabe35be6997da85ae7e13cd64"},e("div",{key:"eed905679fb09994a343c754ff46f620d7cf61fe",class:"file-viewer"},this.type&&this.active&&e("div",{key:"76458467e500219a99c079b977afcb94240e03eb",class:"file-viewer__file"},o(this.type)&&e("swirl-file-viewer-image",{key:"3587c8b5383288786f407dc857f66a1ccb539c99",description:this.description,errorMessage:this.errorMessage,file:this.file,ref:t=>this.viewer=t}),"text/plain"===this.type&&e("swirl-file-viewer-text",{key:"66f0f2ff1dc741aa2bc44448d6c52dfc710d9e83",errorMessage:this.errorMessage,file:this.file,ref:t=>this.viewer=t}),"text/csv"===this.type&&e("swirl-file-viewer-csv",{key:"851502429ed72a062e3c94e388d376702aab9c91",errorMessage:this.errorMessage,file:this.file,ref:t=>this.viewer=t}),"application/pdf"===this.type&&e("swirl-file-viewer-pdf",{key:"540f92c26a34786cf9590da7052ac68128db1eea",errorMessage:this.errorMessage,file:this.file,onActivate:this.onActivate,onVisiblePagesChange:this.onVisiblePagesChange,ref:t=>this.viewer=t,viewMode:this.viewMode,workerSrc:this.pdfWorkerSrc,zoom:this.zoom}),this.type.startsWith("video/")&&e("swirl-file-viewer-video",{key:"fad2a1dbb1643b05d45119f93b01fa7636d6f1f7",autoplay:this.autoplay,disableDownload:this.disableDownload,file:this.file,ref:t=>this.viewer=t}),this.type.startsWith("audio/")&&e("swirl-file-viewer-audio",{key:"904155b750e023ced64ef1d55d5f3b0b23fd15ae",autoplay:this.autoplay,file:this.file,ref:t=>this.viewer=t}),t&&e("swirl-file-viewer-fallback",{key:"57c53d6e49fc916d13c662fd284c4163c8d349ee",disableDownload:this.disableDownload,file:this.file,fileName:this.fileName,onDownload:this.onFallbackDownload}))))}};u.style=":host{display:block;width:100%;height:100%;pointer-events:none}:host *{box-sizing:border-box}.file-viewer{display:flex;width:100%;height:100%;justify-content:center;align-items:center}.file-viewer__file{display:inline-flex;width:100%;height:100%;justify-content:center;align-items:center}";const d=class{constructor(e){t(this,e),this.activate=i(this,"activate",7)}componentDidLoad(){this.activate.emit(this.el)}render(){return e(s,{key:"2a19acc10183877f1d972a7ffe5ddd181c5904b5",class:"file-viewer-audio"},e("audio",{key:"9e6a6835d0716ce6cf929d896552e0d6e0b3ce42",autoplay:this.autoplay,class:"file-viewer-audio__audio",src:this.file,controls:!0}))}get el(){return n(this)}};d.style=":host{display:inline-flex;width:100%;height:100%;pointer-events:auto}:host *{box-sizing:border-box}.file-viewer-audio__audio{width:100%;height:100%}";var f,p={exports:{}},g=(f||(f=1,p.exports=function t(){var i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==i?i:{},e=!i.document&&!!i.postMessage,s=e&&/blob:/i.test((i.location||{}).protocol),n={},r=0,o={parse:function(e,s){var h=(s=s||{}).dynamicTyping||!1;if(y(h)&&(s.dynamicTypingFunction=h,h={}),s.dynamicTyping=h,s.transform=!!y(s.transform)&&s.transform,s.worker&&o.WORKERS_SUPPORTED){var a=function(){if(!o.WORKERS_SUPPORTED)return!1;var e,s,h=(e=i.URL||i.webkitURL||null,s=t.toString(),o.BLOB_URL||(o.BLOB_URL=e.createObjectURL(new Blob(["(",s,")();"],{type:"text/javascript"})))),a=new i.Worker(h);return a.onmessage=w,a.id=r++,n[a.id]=a}();return a.userStep=s.step,a.userChunk=s.chunk,a.userComplete=s.complete,a.userError=s.error,s.step=y(s.step),s.chunk=y(s.chunk),s.complete=y(s.complete),s.error=y(s.error),delete s.worker,void a.postMessage({input:e,config:s,workerId:a.id})}var f=null;return"string"==typeof e?f=s.download?new c(s):new u(s):!0===e.readable&&y(e.read)&&y(e.on)?f=new d(s):(i.File&&e instanceof File||e instanceof Object)&&(f=new l(s)),f.stream(e)},unparse:function(t,i){var e=!1,s=!0,n=",",r="\r\n",h='"',a=h+h,c=!1,l=null,u=!1;!function(){if("object"==typeof i){if("string"!=typeof i.delimiter||o.BAD_DELIMITERS.filter((function(t){return-1!==i.delimiter.indexOf(t)})).length||(n=i.delimiter),("boolean"==typeof i.quotes||"function"==typeof i.quotes||Array.isArray(i.quotes))&&(e=i.quotes),"boolean"!=typeof i.skipEmptyLines&&"string"!=typeof i.skipEmptyLines||(c=i.skipEmptyLines),"string"==typeof i.newline&&(r=i.newline),"string"==typeof i.quoteChar&&(h=i.quoteChar),"boolean"==typeof i.header&&(s=i.header),Array.isArray(i.columns)){if(0===i.columns.length)throw new Error("Option columns is empty");l=i.columns}void 0!==i.escapeChar&&(a=i.escapeChar+h),("boolean"==typeof i.escapeFormulae||i.escapeFormulae instanceof RegExp)&&(u=i.escapeFormulae instanceof RegExp?i.escapeFormulae:/^[=+\-@\t\r].*$/)}}();var d=new RegExp(p(h),"g");if("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return f(null,t,c);if("object"==typeof t[0])return f(l||Object.keys(t[0]),t,c)}else if("object"==typeof t)return"string"==typeof t.data&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||l),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:"object"==typeof t.data[0]?Object.keys(t.data[0]):[]),Array.isArray(t.data[0])||"object"==typeof t.data[0]||(t.data=[t.data])),f(t.fields||[],t.data||[],c);throw new Error("Unable to serialize unrecognized input");function f(t,i,e){var o="";"string"==typeof t&&(t=JSON.parse(t)),"string"==typeof i&&(i=JSON.parse(i));var h=Array.isArray(t)&&0<t.length,a=!Array.isArray(i[0]);if(h&&s){for(var c=0;c<t.length;c++)0<c&&(o+=n),o+=g(t[c],c);0<i.length&&(o+=r)}for(var l=0;l<i.length;l++){var u=h?t.length:i[l].length,d=!1,f=h?0===Object.keys(i[l]).length:0===i[l].length;if(e&&!h&&(d="greedy"===e?""===i[l].join("").trim():1===i[l].length&&0===i[l][0].length),"greedy"===e&&h){for(var p=[],w=0;w<u;w++)p.push(i[l][a?t[w]:w]);d=""===p.join("").trim()}if(!d){for(var m=0;m<u;m++)0<m&&!f&&(o+=n),o+=g(i[l][h&&a?t[m]:m],m);l<i.length-1&&(!e||0<u&&!f)&&(o+=r)}}return o}function g(t,i){if(null==t)return"";if(t.constructor===Date)return JSON.stringify(t).slice(1,25);var s=!1;u&&"string"==typeof t&&u.test(t)&&(t="'"+t,s=!0);var r=t.toString().replace(d,a);return(s=s||!0===e||"function"==typeof e&&e(t,i)||Array.isArray(e)&&e[i]||function(t,i){for(var e=0;e<i.length;e++)if(-1<t.indexOf(i[e]))return!0;return!1}(r,o.BAD_DELIMITERS)||-1<r.indexOf(n)||" "===r.charAt(0)||" "===r.charAt(r.length-1))?h+r+h:r}}};if(o.RECORD_SEP=String.fromCharCode(30),o.UNIT_SEP=String.fromCharCode(31),o.BYTE_ORDER_MARK="\ufeff",o.BAD_DELIMITERS=["\r","\n",'"',o.BYTE_ORDER_MARK],o.WORKERS_SUPPORTED=!e&&!!i.Worker,o.NODE_STREAM_INPUT=1,o.LocalChunkSize=10485760,o.RemoteChunkSize=5242880,o.DefaultDelimiter=",",o.Parser=g,o.ParserHandle=f,o.NetworkStreamer=c,o.FileStreamer=l,o.StringStreamer=u,o.ReadableStreamStreamer=d,i.jQuery){var h=i.jQuery;h.fn.parse=function(t){var e=t.config||{},s=[];return this.each((function(){if("INPUT"!==h(this).prop("tagName").toUpperCase()||"file"!==h(this).attr("type").toLowerCase()||!i.FileReader||!this.files||0===this.files.length)return!0;for(var t=0;t<this.files.length;t++)s.push({file:this.files[t],inputElem:this,instanceConfig:h.extend({},e)})})),n(),this;function n(){if(0!==s.length){var i,e,n,a=s[0];if(y(t.before)){var c=t.before(a.file,a.inputElem);if("object"==typeof c){if("abort"===c.action)return i=a.file,e=a.inputElem,n=c.reason,void(y(t.error)&&t.error({name:"AbortError"},i,e,n));if("skip"===c.action)return void r();"object"==typeof c.config&&(a.instanceConfig=h.extend(a.instanceConfig,c.config))}else if("skip"===c)return void r()}var l=a.instanceConfig.complete;a.instanceConfig.complete=function(t){y(l)&&l(t,a.file,a.inputElem),r()},o.parse(a.file,a.instanceConfig)}else y(t.complete)&&t.complete()}function r(){s.splice(0,1),n()}}}function a(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(t){var i=v(t);i.chunkSize=parseInt(i.chunkSize),t.step||t.chunk||(i.chunkSize=null),this._handle=new f(i),(this._handle.streamer=this)._config=i}.call(this,t),this.parseChunk=function(t,e){if(this.isFirstChunk&&y(this._config.beforeFirstChunk)){var n=this._config.beforeFirstChunk(t);void 0!==n&&(t=n)}this.isFirstChunk=!1,this._halted=!1;var r=this._partialLine+t;this._partialLine="";var h=this._handle.parse(r,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var a=h.meta.cursor;this._finished||(this._partialLine=r.substring(a-this._baseIndex),this._baseIndex=a),h&&h.data&&(this._rowCount+=h.data.length);var c=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(s)i.postMessage({results:h,workerId:o.WORKER_ID,finished:c});else if(y(this._config.chunk)&&!e){if(this._config.chunk(h,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);h=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(h.data),this._completeResults.errors=this._completeResults.errors.concat(h.errors),this._completeResults.meta=h.meta),this._completed||!c||!y(this._config.complete)||h&&h.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),c||h&&h.meta.paused||this._nextChunk(),h}this._halted=!0},this._sendError=function(t){y(this._config.error)?this._config.error(t):s&&this._config.error&&i.postMessage({workerId:o.WORKER_ID,error:t,finished:!1})}}function c(t){var i;(t=t||{}).chunkSize||(t.chunkSize=o.RemoteChunkSize),a.call(this,t),this._nextChunk=e?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(t){this._input=t,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(i=new XMLHttpRequest,this._config.withCredentials&&(i.withCredentials=this._config.withCredentials),e||(i.onload=b(this._chunkLoaded,this),i.onerror=b(this._chunkError,this)),i.open(this._config.downloadRequestBody?"POST":"GET",this._input,!e),this._config.downloadRequestHeaders){var t=this._config.downloadRequestHeaders;for(var s in t)i.setRequestHeader(s,t[s])}this._config.chunkSize&&i.setRequestHeader("Range","bytes="+this._start+"-"+(this._start+this._config.chunkSize-1));try{i.send(this._config.downloadRequestBody)}catch(t){this._chunkError(t.message)}e&&0===i.status&&this._chunkError()}},this._chunkLoaded=function(){4===i.readyState&&(i.status<200||400<=i.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:i.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(t){var i=t.getResponseHeader("Content-Range");return null===i?-1:parseInt(i.substring(i.lastIndexOf("/")+1))}(i),this.parseChunk(i.responseText)))},this._chunkError=function(t){this._sendError(new Error(i.statusText||t))}}function l(t){var i,e;(t=t||{}).chunkSize||(t.chunkSize=o.LocalChunkSize),a.call(this,t);var s="undefined"!=typeof FileReader;this.stream=function(t){this._input=t,e=t.slice||t.webkitSlice||t.mozSlice,s?((i=new FileReader).onload=b(this._chunkLoaded,this),i.onerror=b(this._chunkError,this)):i=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var t=this._input;if(this._config.chunkSize){var n=Math.min(this._start+this._config.chunkSize,this._input.size);t=e.call(t,this._start,n)}var r=i.readAsText(t,this._config.encoding);s||this._chunkLoaded({target:{result:r}})},this._chunkLoaded=function(t){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(t.target.result)},this._chunkError=function(){this._sendError(i.error)}}function u(t){var i;a.call(this,t=t||{}),this.stream=function(t){return i=t,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var t,e=this._config.chunkSize;return e?(t=i.substring(0,e),i=i.substring(e)):(t=i,i=""),this._finished=!i,this.parseChunk(t)}}}function d(t){a.call(this,t=t||{});var i=[],e=!0,s=!1;this.pause=function(){a.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){a.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(t){this._input=t,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){s&&1===i.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),i.length?this.parseChunk(i.shift()):e=!0},this._streamData=b((function(t){try{i.push("string"==typeof t?t:t.toString(this._config.encoding)),e&&(e=!1,this._checkIsFinished(),this.parseChunk(i.shift()))}catch(t){this._streamError(t)}}),this),this._streamError=b((function(t){this._streamCleanUp(),this._sendError(t)}),this),this._streamEnd=b((function(){this._streamCleanUp(),s=!0,this._streamData("")}),this),this._streamCleanUp=b((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function f(t){var i,e,s,n=Math.pow(2,53),r=-n,h=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,a=/^(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))$/,c=this,l=0,u=0,d=!1,f=!1,w=[],m={data:[],errors:[],meta:{}};if(y(t.step)){var A=t.step;t.step=function(i){if(m=i,M())x();else{if(x(),0===m.data.length)return;l+=i.data.length,t.preview&&l>t.preview?e.abort():(m.data=m.data[0],A(m,c))}}}function b(i){return"greedy"===t.skipEmptyLines?""===i.join("").trim():1===i.length&&0===i[0].length}function x(){return m&&s&&(E("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),s=!1),t.skipEmptyLines&&(m.data=m.data.filter((function(t){return!b(t)}))),M()&&function(){if(m)if(Array.isArray(m.data[0])){for(var i=0;M()&&i<m.data.length;i++)m.data[i].forEach(e);m.data.splice(0,1)}else m.data.forEach(e);function e(i,e){y(t.transformHeader)&&(i=t.transformHeader(i,e)),w.push(i)}}(),function(){if(!m||!t.header&&!t.dynamicTyping&&!t.transform)return m;function i(i,e){var s,n=t.header?{}:[];for(s=0;s<i.length;s++){var r=s,o=i[s];t.header&&(r=s>=w.length?"__parsed_extra":w[s]),t.transform&&(o=t.transform(o,r)),o=k(r,o),"__parsed_extra"===r?(n[r]=n[r]||[],n[r].push(o)):n[r]=o}return t.header&&(s>w.length?E("FieldMismatch","TooManyFields","Too many fields: expected "+w.length+" fields but parsed "+s,u+e):s<w.length&&E("FieldMismatch","TooFewFields","Too few fields: expected "+w.length+" fields but parsed "+s,u+e)),n}var e=1;return!m.data.length||Array.isArray(m.data[0])?(m.data=m.data.map(i),e=m.data.length):m.data=i(m.data,0),t.header&&m.meta&&(m.meta.fields=w),u+=e,m}()}function M(){return t.header&&0===w.length}function k(i,e){return s=i,t.dynamicTypingFunction&&void 0===t.dynamicTyping[s]&&(t.dynamicTyping[s]=t.dynamicTypingFunction(s)),!0===(t.dynamicTyping[s]||t.dynamicTyping)?"true"===e||"TRUE"===e||"false"!==e&&"FALSE"!==e&&(function(t){if(h.test(t)){var i=parseFloat(t);if(r<i&&i<n)return!0}return!1}(e)?parseFloat(e):a.test(e)?new Date(e):""===e?null:e):e;var s}function E(t,i,e,s){var n={type:t,code:i,message:e};void 0!==s&&(n.row=s),m.errors.push(n)}this.parse=function(n,r,h){if(t.newline||(t.newline=function(t,i){t=t.substring(0,1048576);var e=new RegExp(p(i)+"([^]*?)"+p(i),"gm"),s=(t=t.replace(e,"")).split("\r"),n=t.split("\n");if(1===s.length||1<n.length&&n[0].length<s[0].length)return"\n";for(var r=0,o=0;o<s.length;o++)"\n"===s[o][0]&&r++;return r>=s.length/2?"\r\n":"\r"}(n,t.quoteChar||'"')),s=!1,t.delimiter)y(t.delimiter)&&(t.delimiter=t.delimiter(n),m.meta.delimiter=t.delimiter);else{var a=function(i,e,s,n,r){var h,a,c,l;r=r||[",","\t","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var u=0;u<r.length;u++){var d=r[u],f=0,p=0,w=0;c=void 0;for(var m=new g({comments:n,delimiter:d,newline:e,preview:10}).parse(i),A=0;A<m.data.length;A++)if(s&&b(m.data[A]))w++;else{var v=m.data[A].length;p+=v,void 0!==c?0<v&&(f+=Math.abs(v-c),c=v):c=v}0<m.data.length&&(p/=m.data.length-w),(void 0===a||f<=a)&&(void 0===l||l<p)&&1.99<p&&(a=f,h=d,l=p)}return{successful:!!(t.delimiter=h),bestDelimiter:h}}(n,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess);a.successful?t.delimiter=a.bestDelimiter:(s=!0,t.delimiter=o.DefaultDelimiter),m.meta.delimiter=t.delimiter}var c=v(t);return t.preview&&t.header&&c.preview++,i=n,e=new g(c),m=e.parse(i,r,h),x(),d?{meta:{paused:!0}}:m||{meta:{paused:!1}}},this.paused=function(){return d},this.pause=function(){d=!0,e.abort(),i=y(t.chunk)?"":i.substring(e.getCharIndex())},this.resume=function(){c.streamer._halted?(d=!1,c.streamer.parseChunk(i,!0)):setTimeout(c.resume,3)},this.aborted=function(){return f},this.abort=function(){f=!0,e.abort(),m.meta.aborted=!0,y(t.complete)&&t.complete(m),i=""}}function p(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g(t){var i,e=(t=t||{}).delimiter,s=t.newline,n=t.comments,r=t.step,h=t.preview,a=t.fastMode,c=i=null==t.quoteChar?'"':t.quoteChar;if(void 0!==t.escapeChar&&(c=t.escapeChar),("string"!=typeof e||-1<o.BAD_DELIMITERS.indexOf(e))&&(e=","),n===e)throw new Error("Comment character same as delimiter");!0===n?n="#":("string"!=typeof n||-1<o.BAD_DELIMITERS.indexOf(n))&&(n=!1),"\n"!==s&&"\r"!==s&&"\r\n"!==s&&(s="\n");var l=0,u=!1;this.parse=function(t,o,d){if("string"!=typeof t)throw new Error("Input must be a string");var f=t.length,g=e.length,w=s.length,m=n.length,A=y(r),v=[],b=[],x=[],M=l=0;if(!t)return O();if(a||!1!==a&&-1===t.indexOf(i)){for(var k=t.split(s),E=0;E<k.length;E++){if(l+=(x=k[E]).length,E!==k.length-1)l+=s.length;else if(d)return O();if(!n||x.substring(0,m)!==n){if(A){if(v=[],N(x.split(e)),$(),u)return O()}else N(x.split(e));if(h&&h<=E)return v=v.slice(0,h),O(!0)}}return O()}for(var S=t.indexOf(e,l),_=t.indexOf(s,l),T=new RegExp(p(c)+p(i),"g"),C=t.indexOf(i,l);;)if(t[l]!==i)if(n&&0===x.length&&t.substring(l,l+m)===n){if(-1===_)return O();_=t.indexOf(s,l=_+w),S=t.indexOf(e,l)}else if(-1!==S&&(S<_||-1===_))x.push(t.substring(l,S)),S=t.indexOf(e,l=S+g);else{if(-1===_)break;if(x.push(t.substring(l,_)),F(_+w),A&&($(),u))return O();if(h&&v.length>=h)return O(!0)}else for(C=l,l++;;){if(-1===(C=t.indexOf(i,C+1)))return d||b.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:v.length,index:l}),I();if(C===f-1)return I(t.substring(l,C).replace(T,i));if(i!==c||t[C+1]!==c){if(i===c||0===C||t[C-1]!==c){-1!==S&&S<C+1&&(S=t.indexOf(e,C+1)),-1!==_&&_<C+1&&(_=t.indexOf(s,C+1));var P=D(-1===_?S:Math.min(S,_));if(t.substr(C+1+P,g)===e){x.push(t.substring(l,C).replace(T,i)),t[l=C+1+P+g]!==i&&(C=t.indexOf(i,l)),S=t.indexOf(e,l),_=t.indexOf(s,l);break}var R=D(_);if(t.substring(C+1+R,C+1+R+w)===s){if(x.push(t.substring(l,C).replace(T,i)),F(C+1+R+w),S=t.indexOf(e,l),C=t.indexOf(i,l),A&&($(),u))return O();if(h&&v.length>=h)return O(!0);break}b.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:v.length,index:l}),C++}}else C++}return I();function N(t){v.push(t),M=l}function D(i){var e=0;if(-1!==i){var s=t.substring(C+1,i);s&&""===s.trim()&&(e=s.length)}return e}function I(i){return d||(void 0===i&&(i=t.substring(l)),x.push(i),l=f,N(x),A&&$()),O()}function F(i){l=i,N(x),x=[],_=t.indexOf(s,l)}function O(t){return{data:v,errors:b,meta:{delimiter:e,linebreak:s,aborted:u,truncated:!!t,cursor:M+(o||0)}}}function $(){r(O()),v=[],b=[]}},this.abort=function(){u=!0},this.getCharIndex=function(){return l}}function w(t){var i=t.data,e=n[i.workerId],s=!1;if(i.error)e.userError(i.error,i.file);else if(i.results&&i.results.data){var r={abort:function(){s=!0,m(i.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:A,resume:A};if(y(e.userStep)){for(var o=0;o<i.results.data.length&&(e.userStep({data:i.results.data[o],errors:i.results.errors,meta:i.results.meta},r),!s);o++);delete i.results}else y(e.userChunk)&&(e.userChunk(i.results,r,i.file),delete i.results)}i.finished&&!s&&m(i.workerId,i.results)}function m(t,i){var e=n[t];y(e.userComplete)&&e.userComplete(i),e.terminate(),delete n[t]}function A(){throw new Error("Not implemented.")}function v(t){if("object"!=typeof t||null===t)return t;var i=Array.isArray(t)?[]:{};for(var e in t)i[e]=v(t[e]);return i}function b(t,i){return function(){t.apply(i,arguments)}}function y(t){return"function"==typeof t}return s&&(i.onmessage=function(t){var e=t.data;if(void 0===o.WORKER_ID&&e&&(o.WORKER_ID=e.workerId),"string"==typeof e.input)i.postMessage({workerId:o.WORKER_ID,results:o.parse(e.input,e.config),finished:!0});else if(i.File&&e.input instanceof File||e.input instanceof Object){var s=o.parse(e.input,e.config);s&&i.postMessage({workerId:o.WORKER_ID,results:s,finished:!0})}}),(c.prototype=Object.create(a.prototype)).constructor=c,(l.prototype=Object.create(a.prototype)).constructor=l,(u.prototype=Object.create(u.prototype)).constructor=u,(d.prototype=Object.create(a.prototype)).constructor=d,o}()),p.exports);
1
+ import{r as t,c as i,h as e,H as s,d as n}from"./p-Dj_4Fda9.js";import{F as r}from"./p-Bp6322JD.js";import{a as o,d as h,u as a,i as c}from"./p-wi_3Z3FQ.js";import{c as l}from"./p-orsBiyT_.js";const u=class{constructor(e){t(this,e),this.activate=i(this,"activate",7),this.visiblePagesChange=i(this,"visiblePagesChange",7),this.downloadStart=i(this,"downloadStart",7),this.active=!0,this.errorMessage="File could not be loaded.",this.typeUnsupportedMessage="File type is not supported.",this.viewMode="single",this.zoom=1,this.skipNativeDownload=!1,this.onActivate=t=>{this.activate.emit(t.detail)},this.onVisiblePagesChange=t=>{this.visiblePagesChange.emit(t.detail)},this.onFallbackDownload=()=>{this.download()}}async download(){if(this.downloadStart.emit(),this.skipNativeDownload)return;const t=this.fileName||this.file.split("/").pop(),i=await fetch(this.file);r.saveAs(await i.blob(),t)}async print(){"application/pdf"!==this.type||this.disablePrint||this.viewer.print()}render(){const t=!Boolean(this.type)||!o(this.type)&&!this.type.startsWith("video/")&&!this.type.startsWith("audio/")&&"text/plain"!==this.type&&"text/csv"!==this.type&&"application/pdf"!==this.type;return e(s,{key:"eaccb23a0e7e13270576afef209f3febb9d3a900"},e("div",{key:"52def83884de3cbc807bc85ca99536cb2535534e",class:"file-viewer"},this.type&&this.active&&e("div",{key:"0156a95c126e2daebaa2dc4f00cfb7b0670a7343",class:"file-viewer__file"},o(this.type)&&e("swirl-file-viewer-image",{key:"ff6cc1d618d7206c971882ea5397bb1d2ce01b86",description:this.description,errorMessage:this.errorMessage,file:this.file,ref:t=>this.viewer=t}),"text/plain"===this.type&&e("swirl-file-viewer-text",{key:"e824b4209c2b96f451d5f4b9a4750af625c080ba",errorMessage:this.errorMessage,file:this.file,ref:t=>this.viewer=t}),"text/csv"===this.type&&e("swirl-file-viewer-csv",{key:"df8abc4ade24e042ad0cf4ffa513c29ebe242151",errorMessage:this.errorMessage,file:this.file,ref:t=>this.viewer=t}),"application/pdf"===this.type&&e("swirl-file-viewer-pdf",{key:"ba771630d69e75dbc97b6abf81c164593b04a19b",errorMessage:this.errorMessage,file:this.file,onActivate:this.onActivate,onVisiblePagesChange:this.onVisiblePagesChange,ref:t=>this.viewer=t,viewMode:this.viewMode,workerSrc:this.pdfWorkerSrc,zoom:this.zoom}),this.type.startsWith("video/")&&e("swirl-file-viewer-video",{key:"8157c3f2df31912d24f013d75b0cb573c2b8d932",autoplay:this.autoplay,disableDownload:this.disableDownload,file:this.file,ref:t=>this.viewer=t}),this.type.startsWith("audio/")&&e("swirl-file-viewer-audio",{key:"f55af2653c88e64c1608b42a600a56ba6d45712b",autoplay:this.autoplay,file:this.file,ref:t=>this.viewer=t}),t&&e("swirl-file-viewer-fallback",{key:"b4dbb3c44c060be52a565491aabeb6248a9c3ee7",disableDownload:this.disableDownload,file:this.file,fileName:this.fileName,onDownload:this.onFallbackDownload}))))}};u.style=":host{display:block;width:100%;height:100%;pointer-events:none}:host *{box-sizing:border-box}.file-viewer{display:flex;width:100%;height:100%;justify-content:center;align-items:center}.file-viewer__file{display:inline-flex;width:100%;height:100%;justify-content:center;align-items:center}";const d=class{constructor(e){t(this,e),this.activate=i(this,"activate",7)}componentDidLoad(){this.activate.emit(this.el)}render(){return e(s,{key:"4b597070229656ffbf9fbfa59e83fb96f964d6f0",class:"file-viewer-audio"},e("audio",{key:"757dccdabed2aefa5588e050c09dd913149f9ef6",autoplay:this.autoplay,class:"file-viewer-audio__audio",src:this.file,controls:!0}))}get el(){return n(this)}};d.style=":host{display:inline-flex;width:100%;height:100%;pointer-events:auto}:host *{box-sizing:border-box}.file-viewer-audio__audio{width:100%;height:100%}";var f,p={exports:{}},g=(f||(f=1,p.exports=function t(){var i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==i?i:{},e=!i.document&&!!i.postMessage,s=e&&/blob:/i.test((i.location||{}).protocol),n={},r=0,o={parse:function(e,s){var h=(s=s||{}).dynamicTyping||!1;if(y(h)&&(s.dynamicTypingFunction=h,h={}),s.dynamicTyping=h,s.transform=!!y(s.transform)&&s.transform,s.worker&&o.WORKERS_SUPPORTED){var a=function(){if(!o.WORKERS_SUPPORTED)return!1;var e,s,h=(e=i.URL||i.webkitURL||null,s=t.toString(),o.BLOB_URL||(o.BLOB_URL=e.createObjectURL(new Blob(["(",s,")();"],{type:"text/javascript"})))),a=new i.Worker(h);return a.onmessage=w,a.id=r++,n[a.id]=a}();return a.userStep=s.step,a.userChunk=s.chunk,a.userComplete=s.complete,a.userError=s.error,s.step=y(s.step),s.chunk=y(s.chunk),s.complete=y(s.complete),s.error=y(s.error),delete s.worker,void a.postMessage({input:e,config:s,workerId:a.id})}var f=null;return"string"==typeof e?f=s.download?new c(s):new u(s):!0===e.readable&&y(e.read)&&y(e.on)?f=new d(s):(i.File&&e instanceof File||e instanceof Object)&&(f=new l(s)),f.stream(e)},unparse:function(t,i){var e=!1,s=!0,n=",",r="\r\n",h='"',a=h+h,c=!1,l=null,u=!1;!function(){if("object"==typeof i){if("string"!=typeof i.delimiter||o.BAD_DELIMITERS.filter((function(t){return-1!==i.delimiter.indexOf(t)})).length||(n=i.delimiter),("boolean"==typeof i.quotes||"function"==typeof i.quotes||Array.isArray(i.quotes))&&(e=i.quotes),"boolean"!=typeof i.skipEmptyLines&&"string"!=typeof i.skipEmptyLines||(c=i.skipEmptyLines),"string"==typeof i.newline&&(r=i.newline),"string"==typeof i.quoteChar&&(h=i.quoteChar),"boolean"==typeof i.header&&(s=i.header),Array.isArray(i.columns)){if(0===i.columns.length)throw new Error("Option columns is empty");l=i.columns}void 0!==i.escapeChar&&(a=i.escapeChar+h),("boolean"==typeof i.escapeFormulae||i.escapeFormulae instanceof RegExp)&&(u=i.escapeFormulae instanceof RegExp?i.escapeFormulae:/^[=+\-@\t\r].*$/)}}();var d=new RegExp(p(h),"g");if("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return f(null,t,c);if("object"==typeof t[0])return f(l||Object.keys(t[0]),t,c)}else if("object"==typeof t)return"string"==typeof t.data&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||l),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:"object"==typeof t.data[0]?Object.keys(t.data[0]):[]),Array.isArray(t.data[0])||"object"==typeof t.data[0]||(t.data=[t.data])),f(t.fields||[],t.data||[],c);throw new Error("Unable to serialize unrecognized input");function f(t,i,e){var o="";"string"==typeof t&&(t=JSON.parse(t)),"string"==typeof i&&(i=JSON.parse(i));var h=Array.isArray(t)&&0<t.length,a=!Array.isArray(i[0]);if(h&&s){for(var c=0;c<t.length;c++)0<c&&(o+=n),o+=g(t[c],c);0<i.length&&(o+=r)}for(var l=0;l<i.length;l++){var u=h?t.length:i[l].length,d=!1,f=h?0===Object.keys(i[l]).length:0===i[l].length;if(e&&!h&&(d="greedy"===e?""===i[l].join("").trim():1===i[l].length&&0===i[l][0].length),"greedy"===e&&h){for(var p=[],w=0;w<u;w++)p.push(i[l][a?t[w]:w]);d=""===p.join("").trim()}if(!d){for(var m=0;m<u;m++)0<m&&!f&&(o+=n),o+=g(i[l][h&&a?t[m]:m],m);l<i.length-1&&(!e||0<u&&!f)&&(o+=r)}}return o}function g(t,i){if(null==t)return"";if(t.constructor===Date)return JSON.stringify(t).slice(1,25);var s=!1;u&&"string"==typeof t&&u.test(t)&&(t="'"+t,s=!0);var r=t.toString().replace(d,a);return(s=s||!0===e||"function"==typeof e&&e(t,i)||Array.isArray(e)&&e[i]||function(t,i){for(var e=0;e<i.length;e++)if(-1<t.indexOf(i[e]))return!0;return!1}(r,o.BAD_DELIMITERS)||-1<r.indexOf(n)||" "===r.charAt(0)||" "===r.charAt(r.length-1))?h+r+h:r}}};if(o.RECORD_SEP=String.fromCharCode(30),o.UNIT_SEP=String.fromCharCode(31),o.BYTE_ORDER_MARK="\ufeff",o.BAD_DELIMITERS=["\r","\n",'"',o.BYTE_ORDER_MARK],o.WORKERS_SUPPORTED=!e&&!!i.Worker,o.NODE_STREAM_INPUT=1,o.LocalChunkSize=10485760,o.RemoteChunkSize=5242880,o.DefaultDelimiter=",",o.Parser=g,o.ParserHandle=f,o.NetworkStreamer=c,o.FileStreamer=l,o.StringStreamer=u,o.ReadableStreamStreamer=d,i.jQuery){var h=i.jQuery;h.fn.parse=function(t){var e=t.config||{},s=[];return this.each((function(){if("INPUT"!==h(this).prop("tagName").toUpperCase()||"file"!==h(this).attr("type").toLowerCase()||!i.FileReader||!this.files||0===this.files.length)return!0;for(var t=0;t<this.files.length;t++)s.push({file:this.files[t],inputElem:this,instanceConfig:h.extend({},e)})})),n(),this;function n(){if(0!==s.length){var i,e,n,a=s[0];if(y(t.before)){var c=t.before(a.file,a.inputElem);if("object"==typeof c){if("abort"===c.action)return i=a.file,e=a.inputElem,n=c.reason,void(y(t.error)&&t.error({name:"AbortError"},i,e,n));if("skip"===c.action)return void r();"object"==typeof c.config&&(a.instanceConfig=h.extend(a.instanceConfig,c.config))}else if("skip"===c)return void r()}var l=a.instanceConfig.complete;a.instanceConfig.complete=function(t){y(l)&&l(t,a.file,a.inputElem),r()},o.parse(a.file,a.instanceConfig)}else y(t.complete)&&t.complete()}function r(){s.splice(0,1),n()}}}function a(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(t){var i=b(t);i.chunkSize=parseInt(i.chunkSize),t.step||t.chunk||(i.chunkSize=null),this._handle=new f(i),(this._handle.streamer=this)._config=i}.call(this,t),this.parseChunk=function(t,e){if(this.isFirstChunk&&y(this._config.beforeFirstChunk)){var n=this._config.beforeFirstChunk(t);void 0!==n&&(t=n)}this.isFirstChunk=!1,this._halted=!1;var r=this._partialLine+t;this._partialLine="";var h=this._handle.parse(r,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var a=h.meta.cursor;this._finished||(this._partialLine=r.substring(a-this._baseIndex),this._baseIndex=a),h&&h.data&&(this._rowCount+=h.data.length);var c=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(s)i.postMessage({results:h,workerId:o.WORKER_ID,finished:c});else if(y(this._config.chunk)&&!e){if(this._config.chunk(h,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);h=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(h.data),this._completeResults.errors=this._completeResults.errors.concat(h.errors),this._completeResults.meta=h.meta),this._completed||!c||!y(this._config.complete)||h&&h.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),c||h&&h.meta.paused||this._nextChunk(),h}this._halted=!0},this._sendError=function(t){y(this._config.error)?this._config.error(t):s&&this._config.error&&i.postMessage({workerId:o.WORKER_ID,error:t,finished:!1})}}function c(t){var i;(t=t||{}).chunkSize||(t.chunkSize=o.RemoteChunkSize),a.call(this,t),this._nextChunk=e?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(t){this._input=t,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(i=new XMLHttpRequest,this._config.withCredentials&&(i.withCredentials=this._config.withCredentials),e||(i.onload=v(this._chunkLoaded,this),i.onerror=v(this._chunkError,this)),i.open(this._config.downloadRequestBody?"POST":"GET",this._input,!e),this._config.downloadRequestHeaders){var t=this._config.downloadRequestHeaders;for(var s in t)i.setRequestHeader(s,t[s])}this._config.chunkSize&&i.setRequestHeader("Range","bytes="+this._start+"-"+(this._start+this._config.chunkSize-1));try{i.send(this._config.downloadRequestBody)}catch(t){this._chunkError(t.message)}e&&0===i.status&&this._chunkError()}},this._chunkLoaded=function(){4===i.readyState&&(i.status<200||400<=i.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:i.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(t){var i=t.getResponseHeader("Content-Range");return null===i?-1:parseInt(i.substring(i.lastIndexOf("/")+1))}(i),this.parseChunk(i.responseText)))},this._chunkError=function(t){this._sendError(new Error(i.statusText||t))}}function l(t){var i,e;(t=t||{}).chunkSize||(t.chunkSize=o.LocalChunkSize),a.call(this,t);var s="undefined"!=typeof FileReader;this.stream=function(t){this._input=t,e=t.slice||t.webkitSlice||t.mozSlice,s?((i=new FileReader).onload=v(this._chunkLoaded,this),i.onerror=v(this._chunkError,this)):i=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var t=this._input;if(this._config.chunkSize){var n=Math.min(this._start+this._config.chunkSize,this._input.size);t=e.call(t,this._start,n)}var r=i.readAsText(t,this._config.encoding);s||this._chunkLoaded({target:{result:r}})},this._chunkLoaded=function(t){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(t.target.result)},this._chunkError=function(){this._sendError(i.error)}}function u(t){var i;a.call(this,t=t||{}),this.stream=function(t){return i=t,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var t,e=this._config.chunkSize;return e?(t=i.substring(0,e),i=i.substring(e)):(t=i,i=""),this._finished=!i,this.parseChunk(t)}}}function d(t){a.call(this,t=t||{});var i=[],e=!0,s=!1;this.pause=function(){a.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){a.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(t){this._input=t,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){s&&1===i.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),i.length?this.parseChunk(i.shift()):e=!0},this._streamData=v((function(t){try{i.push("string"==typeof t?t:t.toString(this._config.encoding)),e&&(e=!1,this._checkIsFinished(),this.parseChunk(i.shift()))}catch(t){this._streamError(t)}}),this),this._streamError=v((function(t){this._streamCleanUp(),this._sendError(t)}),this),this._streamEnd=v((function(){this._streamCleanUp(),s=!0,this._streamData("")}),this),this._streamCleanUp=v((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function f(t){var i,e,s,n=Math.pow(2,53),r=-n,h=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,a=/^(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))$/,c=this,l=0,u=0,d=!1,f=!1,w=[],m={data:[],errors:[],meta:{}};if(y(t.step)){var A=t.step;t.step=function(i){if(m=i,M())x();else{if(x(),0===m.data.length)return;l+=i.data.length,t.preview&&l>t.preview?e.abort():(m.data=m.data[0],A(m,c))}}}function v(i){return"greedy"===t.skipEmptyLines?""===i.join("").trim():1===i.length&&0===i[0].length}function x(){return m&&s&&(E("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),s=!1),t.skipEmptyLines&&(m.data=m.data.filter((function(t){return!v(t)}))),M()&&function(){if(m)if(Array.isArray(m.data[0])){for(var i=0;M()&&i<m.data.length;i++)m.data[i].forEach(e);m.data.splice(0,1)}else m.data.forEach(e);function e(i,e){y(t.transformHeader)&&(i=t.transformHeader(i,e)),w.push(i)}}(),function(){if(!m||!t.header&&!t.dynamicTyping&&!t.transform)return m;function i(i,e){var s,n=t.header?{}:[];for(s=0;s<i.length;s++){var r=s,o=i[s];t.header&&(r=s>=w.length?"__parsed_extra":w[s]),t.transform&&(o=t.transform(o,r)),o=k(r,o),"__parsed_extra"===r?(n[r]=n[r]||[],n[r].push(o)):n[r]=o}return t.header&&(s>w.length?E("FieldMismatch","TooManyFields","Too many fields: expected "+w.length+" fields but parsed "+s,u+e):s<w.length&&E("FieldMismatch","TooFewFields","Too few fields: expected "+w.length+" fields but parsed "+s,u+e)),n}var e=1;return!m.data.length||Array.isArray(m.data[0])?(m.data=m.data.map(i),e=m.data.length):m.data=i(m.data,0),t.header&&m.meta&&(m.meta.fields=w),u+=e,m}()}function M(){return t.header&&0===w.length}function k(i,e){return s=i,t.dynamicTypingFunction&&void 0===t.dynamicTyping[s]&&(t.dynamicTyping[s]=t.dynamicTypingFunction(s)),!0===(t.dynamicTyping[s]||t.dynamicTyping)?"true"===e||"TRUE"===e||"false"!==e&&"FALSE"!==e&&(function(t){if(h.test(t)){var i=parseFloat(t);if(r<i&&i<n)return!0}return!1}(e)?parseFloat(e):a.test(e)?new Date(e):""===e?null:e):e;var s}function E(t,i,e,s){var n={type:t,code:i,message:e};void 0!==s&&(n.row=s),m.errors.push(n)}this.parse=function(n,r,h){if(t.newline||(t.newline=function(t,i){t=t.substring(0,1048576);var e=new RegExp(p(i)+"([^]*?)"+p(i),"gm"),s=(t=t.replace(e,"")).split("\r"),n=t.split("\n");if(1===s.length||1<n.length&&n[0].length<s[0].length)return"\n";for(var r=0,o=0;o<s.length;o++)"\n"===s[o][0]&&r++;return r>=s.length/2?"\r\n":"\r"}(n,t.quoteChar||'"')),s=!1,t.delimiter)y(t.delimiter)&&(t.delimiter=t.delimiter(n),m.meta.delimiter=t.delimiter);else{var a=function(i,e,s,n,r){var h,a,c,l;r=r||[",","\t","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var u=0;u<r.length;u++){var d=r[u],f=0,p=0,w=0;c=void 0;for(var m=new g({comments:n,delimiter:d,newline:e,preview:10}).parse(i),A=0;A<m.data.length;A++)if(s&&v(m.data[A]))w++;else{var b=m.data[A].length;p+=b,void 0!==c?0<b&&(f+=Math.abs(b-c),c=b):c=b}0<m.data.length&&(p/=m.data.length-w),(void 0===a||f<=a)&&(void 0===l||l<p)&&1.99<p&&(a=f,h=d,l=p)}return{successful:!!(t.delimiter=h),bestDelimiter:h}}(n,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess);a.successful?t.delimiter=a.bestDelimiter:(s=!0,t.delimiter=o.DefaultDelimiter),m.meta.delimiter=t.delimiter}var c=b(t);return t.preview&&t.header&&c.preview++,i=n,e=new g(c),m=e.parse(i,r,h),x(),d?{meta:{paused:!0}}:m||{meta:{paused:!1}}},this.paused=function(){return d},this.pause=function(){d=!0,e.abort(),i=y(t.chunk)?"":i.substring(e.getCharIndex())},this.resume=function(){c.streamer._halted?(d=!1,c.streamer.parseChunk(i,!0)):setTimeout(c.resume,3)},this.aborted=function(){return f},this.abort=function(){f=!0,e.abort(),m.meta.aborted=!0,y(t.complete)&&t.complete(m),i=""}}function p(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g(t){var i,e=(t=t||{}).delimiter,s=t.newline,n=t.comments,r=t.step,h=t.preview,a=t.fastMode,c=i=null==t.quoteChar?'"':t.quoteChar;if(void 0!==t.escapeChar&&(c=t.escapeChar),("string"!=typeof e||-1<o.BAD_DELIMITERS.indexOf(e))&&(e=","),n===e)throw new Error("Comment character same as delimiter");!0===n?n="#":("string"!=typeof n||-1<o.BAD_DELIMITERS.indexOf(n))&&(n=!1),"\n"!==s&&"\r"!==s&&"\r\n"!==s&&(s="\n");var l=0,u=!1;this.parse=function(t,o,d){if("string"!=typeof t)throw new Error("Input must be a string");var f=t.length,g=e.length,w=s.length,m=n.length,A=y(r),b=[],v=[],x=[],M=l=0;if(!t)return O();if(a||!1!==a&&-1===t.indexOf(i)){for(var k=t.split(s),E=0;E<k.length;E++){if(l+=(x=k[E]).length,E!==k.length-1)l+=s.length;else if(d)return O();if(!n||x.substring(0,m)!==n){if(A){if(b=[],N(x.split(e)),$(),u)return O()}else N(x.split(e));if(h&&h<=E)return b=b.slice(0,h),O(!0)}}return O()}for(var S=t.indexOf(e,l),_=t.indexOf(s,l),T=new RegExp(p(c)+p(i),"g"),C=t.indexOf(i,l);;)if(t[l]!==i)if(n&&0===x.length&&t.substring(l,l+m)===n){if(-1===_)return O();_=t.indexOf(s,l=_+w),S=t.indexOf(e,l)}else if(-1!==S&&(S<_||-1===_))x.push(t.substring(l,S)),S=t.indexOf(e,l=S+g);else{if(-1===_)break;if(x.push(t.substring(l,_)),F(_+w),A&&($(),u))return O();if(h&&b.length>=h)return O(!0)}else for(C=l,l++;;){if(-1===(C=t.indexOf(i,C+1)))return d||v.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:b.length,index:l}),I();if(C===f-1)return I(t.substring(l,C).replace(T,i));if(i!==c||t[C+1]!==c){if(i===c||0===C||t[C-1]!==c){-1!==S&&S<C+1&&(S=t.indexOf(e,C+1)),-1!==_&&_<C+1&&(_=t.indexOf(s,C+1));var P=D(-1===_?S:Math.min(S,_));if(t.substr(C+1+P,g)===e){x.push(t.substring(l,C).replace(T,i)),t[l=C+1+P+g]!==i&&(C=t.indexOf(i,l)),S=t.indexOf(e,l),_=t.indexOf(s,l);break}var R=D(_);if(t.substring(C+1+R,C+1+R+w)===s){if(x.push(t.substring(l,C).replace(T,i)),F(C+1+R+w),S=t.indexOf(e,l),C=t.indexOf(i,l),A&&($(),u))return O();if(h&&b.length>=h)return O(!0);break}v.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:b.length,index:l}),C++}}else C++}return I();function N(t){b.push(t),M=l}function D(i){var e=0;if(-1!==i){var s=t.substring(C+1,i);s&&""===s.trim()&&(e=s.length)}return e}function I(i){return d||(void 0===i&&(i=t.substring(l)),x.push(i),l=f,N(x),A&&$()),O()}function F(i){l=i,N(x),x=[],_=t.indexOf(s,l)}function O(t){return{data:b,errors:v,meta:{delimiter:e,linebreak:s,aborted:u,truncated:!!t,cursor:M+(o||0)}}}function $(){r(O()),b=[],v=[]}},this.abort=function(){u=!0},this.getCharIndex=function(){return l}}function w(t){var i=t.data,e=n[i.workerId],s=!1;if(i.error)e.userError(i.error,i.file);else if(i.results&&i.results.data){var r={abort:function(){s=!0,m(i.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:A,resume:A};if(y(e.userStep)){for(var o=0;o<i.results.data.length&&(e.userStep({data:i.results.data[o],errors:i.results.errors,meta:i.results.meta},r),!s);o++);delete i.results}else y(e.userChunk)&&(e.userChunk(i.results,r,i.file),delete i.results)}i.finished&&!s&&m(i.workerId,i.results)}function m(t,i){var e=n[t];y(e.userComplete)&&e.userComplete(i),e.terminate(),delete n[t]}function A(){throw new Error("Not implemented.")}function b(t){if("object"!=typeof t||null===t)return t;var i=Array.isArray(t)?[]:{};for(var e in t)i[e]=b(t[e]);return i}function v(t,i){return function(){t.apply(i,arguments)}}function y(t){return"function"==typeof t}return s&&(i.onmessage=function(t){var e=t.data;if(void 0===o.WORKER_ID&&e&&(o.WORKER_ID=e.workerId),"string"==typeof e.input)i.postMessage({workerId:o.WORKER_ID,results:o.parse(e.input,e.config),finished:!0});else if(i.File&&e.input instanceof File||e.input instanceof Object){var s=o.parse(e.input,e.config);s&&i.postMessage({workerId:o.WORKER_ID,results:s,finished:!0})}}),(c.prototype=Object.create(a.prototype)).constructor=c,(l.prototype=Object.create(a.prototype)).constructor=l,(u.prototype=Object.create(u.prototype)).constructor=u,(d.prototype=Object.create(a.prototype)).constructor=d,o}()),p.exports);
2
2
  /* @license
3
3
  Papa Parse
4
4
  v5.3.2
5
5
  https://github.com/mholt/PapaParse
6
6
  License: MIT
7
- */const w=class{constructor(e){t(this,e),this.activate=i(this,"activate",7),this.errorMessage="File could not be loaded."}componentWillLoad(){this.updateTable()}componentDidLoad(){this.activate.emit(this.el)}async updateTable(){this.error=!1,this.loading=!0;try{const t=await fetch(this.file),i=g.parse(await t.text(),{dynamicTyping:!0,fastMode:!1,skipEmptyLines:!0});if(i.errors?.length>0)return this.error=!0,void(this.loading=!1);this.data=i.data,this.loading=!1}catch(t){this.loading=!1,this.error=!0}}render(){return e(s,{key:"d14281440a5315074ebacc9eb50778ff1f858193",class:"file-viewer-csv",exportparts:"file-viewer-csv__table"},this.error&&e("swirl-inline-error",{key:"c8fd3ee1512f8b80a1d19c5866cab69b5ac0a071",class:"file-viewer-csv__error",message:this.errorMessage}),e("div",{key:"7cc29b8557899ead3773c14c09bd30eadcdcc8cb",class:"file-viewer-csv__csv",tabIndex:0},e("table",{key:"fafde14505de917855ee4edb837f927d38bc1631",class:"file-viewer-csv__table",part:"file-viewer-csv__table"},e("tbody",{key:"b3e2dc77236c5ab309b8e3bcd20782c5011bdaaa"},this.data?.map(((t,i)=>e("tr",{class:"file-viewer-csv__row",key:`row-${i}`},t.map(((t,s)=>e("td",{class:"file-viewer-csv__cell",key:`cell-${i}-${s}`},t))))))))),this.loading&&e("div",{key:"805df059246795405d21a8a4d1bdfcbe865dc740",class:"file-viewer-csv__spinner"},e("swirl-spinner",{key:"66d407e21691d718f6f4ec920eaaac286bdc2f5b"})))}get el(){return n(this)}static get watchers(){return{file:["updateTable"]}}};w.style=":host{position:relative;display:inline-flex;width:100%;max-height:100%;pointer-events:auto}:host *{box-sizing:border-box}.file-viewer-csv__csv{overflow:auto;width:100%;max-height:100%;padding:var(--s-space-16);background-color:var(--s-background-default)}.file-viewer-csv__table{margin-right:auto;margin-left:auto;border-collapse:collapse;line-height:var(--s-line-height-base)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.file-viewer-csv__table{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.file-viewer-csv__cell{padding:var(--s-space-8);border:var(--s-border-width-default) solid var(--s-border-default)}.file-viewer-csv__spinner{position:absolute;display:flex;justify-content:center;align-items:center;background-color:rgba(0, 0, 0, 0.2);inset:0}.file-viewer-csv__error{position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}";const m=class{constructor(e){t(this,e),this.activate=i(this,"activate",7),this.download=i(this,"download",7),this.downloadButtonLabel="Download",this.onDownload=t=>{t.preventDefault(),this.download.emit()}}componentDidLoad(){this.activate.emit(this.el)}render(){return e(s,{key:"4bf2941dea790b11ca9e05b1215d7baf207ee623",class:"file-viewer-fallback"},e("swirl-stack",{key:"6a31cdbd5c931b46b43ab1893f14e0ba0c485ffb",align:"center",height:"100%",justify:"center",spacing:"16"},e("swirl-icon-file",{key:"6581e3df50fb3c44d874b1aabdb10a66b648babe",class:"file-viewer-fallback__icon",color:"on-image",size:28}),this.fileName&&e("swirl-text",{key:"711b29cf73a248a8127f98adf938496fa3bd5607",color:"on-image",size:"lg",weight:"medium"},this.fileName),!this.disableDownload&&e("swirl-button",{key:"8c0b228b6f03448868cdb8679a7240ba65e26802",download:this.fileName,href:this.file,icon:"<swirl-icon-download></swirl-icon-download>",label:this.downloadButtonLabel,onClick:this.onDownload,variant:"on-image"})))}get el(){return n(this)}};m.style=":host{display:inline-flex;width:100%;height:100%;justify-content:center;align-items:center;pointer-events:auto}:host *{box-sizing:border-box}.file-viewer-fallback__icon::part(icon){height:2.875rem;width:2.875rem}";const A=class{constructor(e){t(this,e),this.activate=i(this,"activate",7),this.description="",this.errorMessage="File could not be loaded.",this.maxZoom=3,this.loading=!0,this.panX=0,this.panY=0,this.zoom=1,this.onError=()=>{this.error=!0,this.loading=!1},this.onLoad=()=>{this.error=!1,this.loading=!1},this.onDblClick=t=>{this.clickToZoom(t)},this.onWheel=t=>{t.preventDefault();const i=Math.min(Math.max(1,this.zoom+-1*t.deltaY/100),this.maxZoom);i!==this.zoom&&(this.updateTransformOrigin(t.offsetX,t.offsetY),this.updateZoomAndPan(i,0,0))},this.onPointerDown=t=>{this.startPan(t)},this.onPointerMove=t=>{this.pan(t)},this.onPointerUp=()=>{this.endPan()},this.onTouchStart=t=>{t.preventDefault(),2===t.touches.length&&this.startPinchToZoom(t)},this.onTouchMove=t=>{t.preventDefault(),this.pinching&&this.pinchToZoom(t)},this.onTouchEnd=t=>{t.preventDefault(),this.pinching&&this.endPinchToZoom()},this.startPinchToZoom=t=>{Boolean(this.imageEl)&&(this.pinchDistance=this.getPinchDistance(t),this.pinching=!0)},this.pinchToZoom=t=>{const i=this.getPinchDistance(t)-this.pinchDistance,e=Math.min(Math.max(1,this.zoom+i/100),this.maxZoom);this.zoom!==e&&(this.pinchDistance=this.getPinchDistance(t),this.updateZoomAndPan(e))},this.endPinchToZoom=()=>{this.pinching=!1,Math.abs(this.zoom-1)<.2&&(this.zoom=1,this.imageEl.style.transform="")},this.getPinchDistance=t=>Math.hypot(t.touches[0].pageX-t.touches[1].pageX,t.touches[0].pageY-t.touches[1].pageY),this.clickToZoom=t=>{if(!(navigator.maxTouchPoints>1))if(1===this.zoom){const i=t.pageX-this.el.getBoundingClientRect().x,e=t.pageY-this.el.getBoundingClientRect().y;this.updateTransformOrigin(i,e),this.updateZoomAndPan(2)}else this.updateZoomAndPan(1)},this.updateZoomAndPan=(t,i,e)=>{const s=void 0===t?this.zoom:t,n=s-this.zoom,r=void 0===i?this.panX+this.panX*n:i,o=void 0===i?this.panY+this.panY*n:e,h=this.panX,a=this.panY;this.zoom=s,this.panX=r,this.panY=o;const c=(this.el.parentElement||this.el).getBoundingClientRect(),l=this.imageEl.getBoundingClientRect(),u=l.bottom<c.bottom&&o<a||l.top>c.top&&o>a;(l.right<c.right&&r<h||l.left>c.left&&r>h)&&(this.panX=h),u&&(this.panY=a),1===this.zoom&&(this.panX=0,this.panY=0),this.imageEl.style.transform=`matrix(${this.zoom}, 0, 0, ${this.zoom}, ${this.panX}, ${this.panY})`},this.updateTransformOrigin=(t,i)=>{this.transformOriginX=t,this.transformOriginY=i,this.imageEl.style.transformOrigin=`${this.transformOriginX}px ${this.transformOriginY}px`},this.startPan=t=>{this.panning=!0,this.previousScreenX=t.screenX,this.previousScreenY=t.screenY},this.pan=t=>{const i=this.previousScreenX||0,e=this.previousScreenY||0;this.previousScreenX=t.screenX,this.previousScreenY=t.screenY,this.panning&&!this.pinching&&(t.preventDefault(),this.updateZoomAndPan(this.zoom,this.panX+t.screenX-i,this.panY+t.screenY-e))},this.endPan=()=>{this.panning=!1},this.onImageElementUpdate=t=>{this.imageEl?.removeEventListener("load",this.onLoad),this.imageEl?.removeEventListener("error",this.onError),this.imageEl=t,this.imageEl&&(this.imageEl.addEventListener("load",this.onLoad),this.imageEl.addEventListener("error",this.onError))}}componentDidLoad(){this.activate.emit(this.el)}disconnectedCallback(){this.imageEl?.removeEventListener("load",this.onLoad),this.imageEl?.removeEventListener("error",this.onError)}watchFile(){this.error=!1,this.loading=!0}async getZoom(){return this.zoom}async resetZoom(){return this.updateZoomAndPan(1)}render(){return e(s,{key:"86f13b2614472cab2c15921a709ec0f31df6b3f5",onDblClick:this.onDblClick,onWheel:this.onWheel,onPointerDown:this.onPointerDown,onPointerMove:this.onPointerMove,onPointerUp:this.onPointerUp,onTouchStart:this.onTouchStart,onTouchMove:this.onTouchMove,onTouchEnd:this.onTouchEnd},this.error&&e("swirl-inline-error",{key:"e33badc0e7bd9f4f2e84e4eceee034a16dbd3aea",class:"file-viewer-image__error",message:this.errorMessage}),e("figure",{key:"1cb3535b5136edec2e856bc85ef315fe7e427dbd",class:"file-viewer-image"},e("img",{key:"8e397b1c705a7b683e79ee977e892ed45bd25498",alt:this.description,class:"file-viewer-image__image",ref:this.onImageElementUpdate,src:this.file}),this.loading&&e("div",{key:"6d43acf2fcd4c0191909d433ce96577331ada3cf",class:"file-viewer-image__spinner"},e("swirl-spinner",{key:"e997796b0baec1014e4a73feae3a3570ed97a2bf"}))))}get el(){return n(this)}static get watchers(){return{file:["watchFile"]}}};A.style=":host{position:relative;display:inline-flex;max-height:100%;pointer-events:none}:host *{box-sizing:border-box}.file-viewer-image{display:inline-flex;justify-content:center;margin:0}.file-viewer-image__image{pointer-events:auto;max-width:100%;-o-object-fit:contain;object-fit:contain}.file-viewer-image__spinner{position:absolute;display:flex;justify-content:center;align-items:center;background-color:rgba(0, 0, 0, 0.2);inset:0}.file-viewer-image__error{position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}";
7
+ */const w=class{constructor(e){t(this,e),this.activate=i(this,"activate",7),this.errorMessage="File could not be loaded."}componentWillLoad(){this.updateTable()}componentDidLoad(){this.activate.emit(this.el)}async updateTable(){this.error=!1,this.loading=!0;try{const t=await fetch(this.file),i=g.parse(await t.text(),{dynamicTyping:!0,fastMode:!1,skipEmptyLines:!0});if(i.errors?.length>0)return this.error=!0,void(this.loading=!1);this.data=i.data,this.loading=!1}catch(t){this.loading=!1,this.error=!0}}render(){return e(s,{key:"2d998d2f6003691285c7e4be4bbc24c0fc82134c",class:"file-viewer-csv",exportparts:"file-viewer-csv__table"},this.error&&e("swirl-inline-error",{key:"4a495b4447de40e933c4cdc3e4c441844d1276ae",class:"file-viewer-csv__error",message:this.errorMessage}),e("div",{key:"c3a9f2dde498ea23702992d1f626d608329a1047",class:"file-viewer-csv__csv",tabIndex:0},e("table",{key:"362004a62f6563b78959832cad1968a20d9987ac",class:"file-viewer-csv__table",part:"file-viewer-csv__table"},e("tbody",{key:"4c3080cf1fed3ed520002329c013a28f418aa99e"},this.data?.map(((t,i)=>e("tr",{class:"file-viewer-csv__row",key:`row-${i}`},t.map(((t,s)=>e("td",{class:"file-viewer-csv__cell",key:`cell-${i}-${s}`},t))))))))),this.loading&&e("div",{key:"f4b6a5121e5162b4ac4e1bc915f99e7cd443b78a",class:"file-viewer-csv__spinner"},e("swirl-spinner",{key:"c5d87eb9a9d93ccf574e4286f16708eb4093ed59"})))}get el(){return n(this)}static get watchers(){return{file:["updateTable"]}}};w.style=":host{position:relative;display:inline-flex;width:100%;max-height:100%;pointer-events:auto}:host *{box-sizing:border-box}.file-viewer-csv__csv{overflow:auto;width:100%;max-height:100%;padding:var(--s-space-16);background-color:var(--s-background-default)}.file-viewer-csv__table{margin-right:auto;margin-left:auto;border-collapse:collapse;line-height:var(--s-line-height-base)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.file-viewer-csv__table{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.file-viewer-csv__cell{padding:var(--s-space-8);border:var(--s-border-width-default) solid var(--s-border-default)}.file-viewer-csv__spinner{position:absolute;display:flex;justify-content:center;align-items:center;background-color:rgba(0, 0, 0, 0.2);inset:0}.file-viewer-csv__error{position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}";const m=class{constructor(e){t(this,e),this.activate=i(this,"activate",7),this.download=i(this,"download",7),this.downloadButtonLabel="Download",this.onDownload=t=>{t.preventDefault(),this.download.emit()}}componentDidLoad(){this.activate.emit(this.el)}render(){return e(s,{key:"a3ad0f00afa112d19e29ff13abf51692ab9d8ffa",class:"file-viewer-fallback"},e("swirl-stack",{key:"dab7f8716509fb310716750a9282c08cfbab35e9",align:"center",height:"100%",justify:"center",spacing:"16"},e("swirl-icon-file",{key:"35397e5b1351b6dc22ae48e39f0a21b14990c348",class:"file-viewer-fallback__icon",color:"on-image",size:28}),this.fileName&&e("swirl-text",{key:"da97715a10f4f34bf6f6b09b36cca83c0a571952",color:"on-image",size:"lg",weight:"medium"},this.fileName),!this.disableDownload&&e("swirl-button",{key:"182bfad82ee14bee1033e1558cd12e4fad56f105",download:this.fileName,href:this.file,icon:"<swirl-icon-download></swirl-icon-download>",label:this.downloadButtonLabel,onClick:this.onDownload,variant:"on-image"})))}get el(){return n(this)}};m.style=":host{display:inline-flex;width:100%;height:100%;justify-content:center;align-items:center;pointer-events:auto}:host *{box-sizing:border-box}.file-viewer-fallback__icon::part(icon){height:2.875rem;width:2.875rem}";const A=class{constructor(e){t(this,e),this.activate=i(this,"activate",7),this.description="",this.errorMessage="File could not be loaded.",this.maxZoom=3,this.loading=!0,this.panX=0,this.panY=0,this.zoom=1,this.onError=()=>{this.error=!0,this.loading=!1},this.onLoad=()=>{this.error=!1,this.loading=!1},this.onDblClick=t=>{this.clickToZoom(t)},this.onWheel=t=>{t.preventDefault();const i=Math.min(Math.max(1,this.zoom+-1*t.deltaY/100),this.maxZoom);i!==this.zoom&&(this.updateTransformOrigin(t.offsetX,t.offsetY),this.updateZoomAndPan(i,0,0))},this.onPointerDown=t=>{this.startPan(t)},this.onPointerMove=t=>{this.pan(t)},this.onPointerUp=()=>{this.endPan()},this.onTouchStart=t=>{t.preventDefault(),2===t.touches.length&&this.startPinchToZoom(t)},this.onTouchMove=t=>{t.preventDefault(),this.pinching&&this.pinchToZoom(t)},this.onTouchEnd=t=>{t.preventDefault(),this.pinching&&this.endPinchToZoom()},this.startPinchToZoom=t=>{Boolean(this.imageEl)&&(this.pinchDistance=this.getPinchDistance(t),this.pinching=!0)},this.pinchToZoom=t=>{const i=this.getPinchDistance(t)-this.pinchDistance,e=Math.min(Math.max(1,this.zoom+i/100),this.maxZoom);this.zoom!==e&&(this.pinchDistance=this.getPinchDistance(t),this.updateZoomAndPan(e))},this.endPinchToZoom=()=>{this.pinching=!1,Math.abs(this.zoom-1)<.2&&(this.zoom=1,this.imageEl.style.transform="")},this.getPinchDistance=t=>Math.hypot(t.touches[0].pageX-t.touches[1].pageX,t.touches[0].pageY-t.touches[1].pageY),this.clickToZoom=t=>{if(!(navigator.maxTouchPoints>1))if(1===this.zoom){const i=t.pageX-this.el.getBoundingClientRect().x,e=t.pageY-this.el.getBoundingClientRect().y;this.updateTransformOrigin(i,e),this.updateZoomAndPan(2)}else this.updateZoomAndPan(1)},this.updateZoomAndPan=(t,i,e)=>{const s=void 0===t?this.zoom:t,n=s-this.zoom,r=void 0===i?this.panX+this.panX*n:i,o=void 0===i?this.panY+this.panY*n:e,h=this.panX,a=this.panY;this.zoom=s,this.panX=r,this.panY=o;const c=(this.el.parentElement||this.el).getBoundingClientRect(),l=this.imageEl.getBoundingClientRect(),u=l.bottom<c.bottom&&o<a||l.top>c.top&&o>a;(l.right<c.right&&r<h||l.left>c.left&&r>h)&&(this.panX=h),u&&(this.panY=a),1===this.zoom&&(this.panX=0,this.panY=0),this.imageEl.style.transform=`matrix(${this.zoom}, 0, 0, ${this.zoom}, ${this.panX}, ${this.panY})`},this.updateTransformOrigin=(t,i)=>{this.transformOriginX=t,this.transformOriginY=i,this.imageEl.style.transformOrigin=`${this.transformOriginX}px ${this.transformOriginY}px`},this.startPan=t=>{this.panning=!0,this.previousScreenX=t.screenX,this.previousScreenY=t.screenY},this.pan=t=>{const i=this.previousScreenX||0,e=this.previousScreenY||0;this.previousScreenX=t.screenX,this.previousScreenY=t.screenY,this.panning&&!this.pinching&&(t.preventDefault(),this.updateZoomAndPan(this.zoom,this.panX+t.screenX-i,this.panY+t.screenY-e))},this.endPan=()=>{this.panning=!1},this.onImageElementUpdate=t=>{this.imageEl?.removeEventListener("load",this.onLoad),this.imageEl?.removeEventListener("error",this.onError),this.imageEl=t,this.imageEl&&(this.imageEl.addEventListener("load",this.onLoad),this.imageEl.addEventListener("error",this.onError))}}componentDidLoad(){this.activate.emit(this.el)}disconnectedCallback(){this.imageEl?.removeEventListener("load",this.onLoad),this.imageEl?.removeEventListener("error",this.onError)}watchFile(){this.error=!1,this.loading=!0}async getZoom(){return this.zoom}async resetZoom(){return this.updateZoomAndPan(1)}render(){return e(s,{key:"c7280521f67f5a8e988496db51a5a1018da8059c",onDblClick:this.onDblClick,onWheel:this.onWheel,onPointerDown:this.onPointerDown,onPointerMove:this.onPointerMove,onPointerUp:this.onPointerUp,onTouchStart:this.onTouchStart,onTouchMove:this.onTouchMove,onTouchEnd:this.onTouchEnd},this.error&&e("swirl-inline-error",{key:"e3ad917c4c006275e7b0f885c09478bb5e77616b",class:"file-viewer-image__error",message:this.errorMessage}),e("figure",{key:"217b3ef167777066d61a6407ec955207e4755eba",class:"file-viewer-image"},e("img",{key:"23dd87f7142873d65b9c5d5f85aa08558b448e8c",alt:this.description,class:"file-viewer-image__image",ref:this.onImageElementUpdate,src:this.file}),this.loading&&e("div",{key:"7d655d674ab24393d3a7a3bcb2ab83b7c0fad075",class:"file-viewer-image__spinner"},e("swirl-spinner",{key:"0d07a0907c18a2bd527a9b125bf433b153d86179"}))))}get el(){return n(this)}static get watchers(){return{file:["watchFile"]}}};A.style=":host{position:relative;display:inline-flex;max-height:100%;pointer-events:none}:host *{box-sizing:border-box}.file-viewer-image{display:inline-flex;justify-content:center;margin:0}.file-viewer-image__image{pointer-events:auto;max-width:100%;-o-object-fit:contain;object-fit:contain}.file-viewer-image__spinner{position:absolute;display:flex;justify-content:center;align-items:center;background-color:rgba(0, 0, 0, 0.2);inset:0}.file-viewer-image__error{position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}";
8
8
  /**
9
9
  * @licstart The following is the entire license notice for the
10
10
  * JavaScript code in this page
@@ -25,4 +25,4 @@ License: MIT
25
25
  *
26
26
  * @licend The above is the entire license notice for the
27
27
  * JavaScript code in this page
28
- */var v={34:(t,i,e)=>{var s=e(4901);t.exports=function(t){return"object"==typeof t?null!==t:s(t)}},81:(t,i,e)=>{var s=e(9565),n=e(9306),r=e(8551),o=e(6823),h=e(851),a=TypeError;t.exports=function(t,i){var e=arguments.length<2?h(t):i;if(n(e))return r(s(e,t));throw new a(o(t)+" is not iterable")}},283:(t,i,e)=>{var s=e(9504),n=e(9039),r=e(4901),o=e(9297),h=e(3724),a=e(350).CONFIGURABLE,c=e(3706),l=e(1181),u=l.enforce,d=l.get,f=String,p=Object.defineProperty,g=s("".slice),w=s("".replace),m=s([].join),A=h&&!n((function(){return 8!==p((function(){}),"length",{value:8}).length})),v=String(String).split("String"),b=t.exports=function(t,i,e){"Symbol("===g(f(i),0,7)&&(i="["+w(f(i),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),e&&e.getter&&(i="get "+i),e&&e.setter&&(i="set "+i),(!o(t,"name")||a&&t.name!==i)&&(h?p(t,"name",{value:i,configurable:!0}):t.name=i),A&&e&&o(e,"arity")&&t.length!==e.arity&&p(t,"length",{value:e.arity});try{e&&o(e,"constructor")&&e.constructor?h&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var s=u(t);return o(s,"source")||(s.source=m(v,"string"==typeof i?i:"")),t};Function.prototype.toString=b((function(){return r(this)&&d(this).source||c(this)}),"toString")},350:(t,i,e)=>{var s=e(3724),n=e(9297),r=Function.prototype,o=s&&Object.getOwnPropertyDescriptor,h=n(r,"name"),a=h&&"something"===function(){}.name,c=h&&(!s||s&&o(r,"name").configurable);t.exports={EXISTS:h,PROPER:a,CONFIGURABLE:c}},397:(t,i,e)=>{var s=e(7751);t.exports=s("document","documentElement")},421:t=>{t.exports={}},507:(t,i,e)=>{var s=e(9565);t.exports=function(t,i,e){for(var n,r,o=e?t:t.iterator,h=t.next;!(n=s(h,o)).done;)if(void 0!==(r=i(n.value)))return r}},531:(t,i,e)=>{var s=e(6518),n=e(9565),r=e(9306),o=e(8551),h=e(1767),a=e(8646),c=e(9462),l=e(9539),u=e(6395),d=e(4549),f=!u&&d("flatMap",TypeError),p=c((function(){for(var t,i,e=this.iterator,s=this.mapper;;){if(i=this.inner)try{if(!(t=o(n(i.next,i.iterator))).done)return t.value;this.inner=null}catch(t){l(e,"throw",t)}if(t=o(n(this.next,e)),this.done=!!t.done)return;try{this.inner=a(s(t.value,this.counter++),!1)}catch(t){l(e,"throw",t)}}}));s({target:"Iterator",proto:!0,real:!0,forced:u||f},{flatMap:function(t){o(this);try{r(t)}catch(t){l(this,"throw",t)}return f?n(f,this,t):new p(h(this),{mapper:t,inner:null})}})},616:(t,i,e)=>{var s=e(9039);t.exports=!s((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},655:(t,i,e)=>{var s=e(6955),n=String;t.exports=function(t){if("Symbol"===s(t))throw new TypeError("Cannot convert a Symbol value to a string");return n(t)}},679:(t,i,e)=>{var s=e(1625),n=TypeError;t.exports=function(t,i){if(s(i,t))return t;throw new n("Incorrect invocation")}},741:t=>{var i=Math.ceil,e=Math.floor;t.exports=Math.trunc||function(t){var s=+t;return(s>0?e:i)(s)}},757:(t,i,e)=>{var s=e(7751),n=e(4901),r=e(1625),o=e(7040),h=Object;t.exports=o?function(t){return"symbol"==typeof t}:function(t){var i=s("Symbol");return n(i)&&r(i.prototype,h(t))}},851:(t,i,e)=>{var s=e(6955),n=e(5966),r=e(4117),o=e(6269),h=e(8227)("iterator");t.exports=function(t){if(!r(t))return n(t,h)||n(t,"@@iterator")||o[s(t)]}},944:t=>{var i=TypeError;t.exports=function(t){var e=t&&t.alphabet;if(void 0===e||"base64"===e||"base64url"===e)return e||"base64";throw new i("Incorrect `alphabet` option")}},1072:(t,i,e)=>{var s=e(1828),n=e(8727);t.exports=Object.keys||function(t){return s(t,n)}},1103:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},1148:(t,i,e)=>{var s=e(6518),n=e(9565),r=e(2652),o=e(9306),h=e(8551),a=e(1767),c=e(9539),l=e(4549)("every",TypeError);s({target:"Iterator",proto:!0,real:!0,forced:l},{every:function(t){h(this);try{o(t)}catch(t){c(this,"throw",t)}if(l)return n(l,this,t);var i=a(this),e=0;return!r(i,(function(i,s){if(!t(i,e++))return s()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},1181:(t,i,e)=>{var s,n,r,o=e(8622),h=e(4576),a=e(34),c=e(6699),l=e(9297),u=e(7629),d=e(6119),f=e(421),p="Object already initialized",g=h.TypeError;if(o||u.state){var w=u.state||(u.state=new(0,h.WeakMap));w.get=w.get,w.has=w.has,w.set=w.set,s=function(t,i){if(w.has(t))throw new g(p);return i.facade=t,w.set(t,i),i},n=function(t){return w.get(t)||{}},r=function(t){return w.has(t)}}else{var m=d("state");f[m]=!0,s=function(t,i){if(l(t,m))throw new g(p);return i.facade=t,c(t,m,i),i},n=function(t){return l(t,m)?t[m]:{}},r=function(t){return l(t,m)}}t.exports={set:s,get:n,has:r,enforce:function(t){return r(t)?n(t):s(t,{})},getterFor:function(t){return function(i){var e;if(!a(i)||(e=n(i)).type!==t)throw new g("Incompatible receiver, "+t+" required");return e}}}},1291:(t,i,e)=>{var s=e(741);t.exports=function(t){var i=+t;return i!=i||0===i?0:s(i)}},1548:(t,i,e)=>{var s=e(4576),n=e(9039),r=e(9519),o=e(4215),h=s.structuredClone;t.exports=!!h&&!n((function(){if("DENO"===o&&r>92||"NODE"===o&&r>94||"BROWSER"===o&&r>97)return!1;var t=new ArrayBuffer(8),i=h(t,{transfer:[t]});return 0!==t.byteLength||8!==i.byteLength}))},1549:(t,i,e)=>{var s=e(6518),n=e(4576),r=e(9143),o=e(4154),h=n.Uint8Array,a=!h||!h.prototype.setFromBase64||!function(){var t=new h([255,255,255,255,255]);try{t.setFromBase64("MjYyZg===")}catch(i){return 50===t[0]&&54===t[1]&&50===t[2]&&255===t[3]&&255===t[4]}}();h&&s({target:"Uint8Array",proto:!0,forced:a},{setFromBase64:function(t){o(this);var i=r(t,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:i.read,written:i.written}}})},1625:(t,i,e)=>{var s=e(9504);t.exports=s({}.isPrototypeOf)},1689:(t,i,e)=>{var s=e(6518),n=e(4576),r=e(8745),o=e(7680),h=e(6043),a=e(9306),c=e(1103),l=n.Promise,u=!1;s({target:"Promise",stat:!0,forced:!l||!l.try||c((function(){l.try((function(t){u=8===t}),8)})).error||!u},{try:function(t){var i=arguments.length>1?o(arguments,1):[],e=h.f(this),s=c((function(){return r(a(t),void 0,i)}));return(s.error?e.reject:e.resolve)(s.value),e.promise}})},1698:(t,i,e)=>{var s=e(6518),n=e(4204);s({target:"Set",proto:!0,real:!0,forced:!e(4916)("union")},{union:n})},1701:(t,i,e)=>{var s=e(6518),n=e(9565),r=e(9306),o=e(8551),h=e(1767),a=e(9462),c=e(6319),l=e(9539),u=e(4549),d=e(6395),f=!d&&u("map",TypeError),p=a((function(){var t=this.iterator,i=o(n(this.next,t));if(!(this.done=!!i.done))return c(t,this.mapper,[i.value,this.counter++],!0)}));s({target:"Iterator",proto:!0,real:!0,forced:d||f},{map:function(t){o(this);try{r(t)}catch(t){l(this,"throw",t)}return f?n(f,this,t):new p(h(this),{mapper:t})}})},1767:t=>{t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},1828:(t,i,e)=>{var s=e(9504),n=e(9297),r=e(5397),o=e(9617).indexOf,h=e(421),a=s([].push);t.exports=function(t,i){var e,s=r(t),c=0,l=[];for(e in s)!n(h,e)&&n(s,e)&&a(l,e);for(;i.length>c;)n(s,e=i[c++])&&(~o(l,e)||a(l,e));return l}},2106:(t,i,e)=>{var s=e(283),n=e(4913);t.exports=function(t,i,e){return e.get&&s(e.get,i,{getter:!0}),e.set&&s(e.set,i,{setter:!0}),n.f(t,i,e)}},2140:(t,i,e)=>{var s={};s[e(8227)("toStringTag")]="z",t.exports="[object z]"===String(s)},2195:(t,i,e)=>{var s=e(9504),n=s({}.toString),r=s("".slice);t.exports=function(t){return r(n(t),8,-1)}},2211:(t,i,e)=>{var s=e(9039);t.exports=!s((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},2303:(t,i,e)=>{var s=e(4576),n=e(9504),r=s.Uint8Array,o=s.SyntaxError,h=s.parseInt,a=Math.min,c=/[^\da-f]/i,l=n(c.exec),u=n("".slice);t.exports=function(t,i){var e=t.length;if(e%2!=0)throw new o("String should be an even number of characters");for(var s=i?a(i.length,e/2):e/2,n=i||new r(s),d=0,f=0;f<s;){var p=u(t,d,d+=2);if(l(c,p))throw new o("String should only contain hex characters");n[f++]=h(p,16)}return{bytes:n,read:d}}},2360:(t,i,e)=>{var s,n=e(8551),r=e(6801),o=e(8727),h=e(421),a=e(397),c=e(4055),l=e(6119),u="prototype",d="script",f=l("IE_PROTO"),p=function(){},g=function(t){return"<"+d+">"+t+"</"+d+">"},w=function(t){t.write(g("")),t.close();var i=t.parentWindow.Object;return t=null,i},m=function(){try{s=new ActiveXObject("htmlfile")}catch(t){}var t,i,e;m="undefined"!=typeof document?document.domain&&s?w(s):(i=c("iframe"),e="java"+d+":",i.style.display="none",a.appendChild(i),i.src=String(e),(t=i.contentWindow.document).open(),t.write(g("document.F=Object")),t.close(),t.F):w(s);for(var n=o.length;n--;)delete m[u][o[n]];return m()};h[f]=!0,t.exports=Object.create||function(t,i){var e;return null!==t?(p[u]=n(t),e=new p,p[u]=null,e[f]=t):e=m(),void 0===i?e:r.f(e,i)}},2475:(t,i,e)=>{var s=e(6518),n=e(8527);s({target:"Set",proto:!0,real:!0,forced:!e(4916)("isSupersetOf",(function(t){return!t}))},{isSupersetOf:n})},2489:(t,i,e)=>{var s=e(6518),n=e(9565),r=e(9306),o=e(8551),h=e(1767),a=e(9462),c=e(6319),l=e(6395),u=e(9539),d=e(4549),f=!l&&d("filter",TypeError),p=a((function(){for(var t,i,e=this.iterator,s=this.predicate,r=this.next;;){if(t=o(n(r,e)),this.done=!!t.done)return;if(c(e,s,[i=t.value,this.counter++],!0))return i}}));s({target:"Iterator",proto:!0,real:!0,forced:l||f},{filter:function(t){o(this);try{r(t)}catch(t){u(this,"throw",t)}return f?n(f,this,t):new p(h(this),{predicate:t})}})},2529:t=>{t.exports=function(t,i){return{value:t,done:i}}},2603:(t,i,e)=>{var s=e(655);t.exports=function(t,i){return void 0===t?arguments.length<2?"":i:s(t)}},2652:(t,i,e)=>{var s=e(6080),n=e(9565),r=e(8551),o=e(6823),h=e(4209),a=e(6198),c=e(1625),l=e(81),u=e(851),d=e(9539),f=TypeError,p=function(t,i){this.stopped=t,this.result=i},g=p.prototype;t.exports=function(t,i,e){var w,m,A,v,b,y,x,M=!(!e||!e.AS_ENTRIES),k=!(!e||!e.IS_RECORD),E=!(!e||!e.IS_ITERATOR),S=!(!e||!e.INTERRUPTED),_=s(i,e&&e.that),T=function(t){return w&&d(w,"normal",t),new p(!0,t)},C=function(t){return M?(r(t),S?_(t[0],t[1],T):_(t[0],t[1])):S?_(t,T):_(t)};if(k)w=t.iterator;else if(E)w=t;else{if(!(m=u(t)))throw new f(o(t)+" is not iterable");if(h(m)){for(A=0,v=a(t);v>A;A++)if((b=C(t[A]))&&c(g,b))return b;return new p(!1)}w=l(t,m)}for(y=k?t.next:w.next;!(x=n(y,w)).done;){try{b=C(x.value)}catch(t){d(w,"throw",t)}if("object"==typeof b&&b&&c(g,b))return b}return new p(!1)}},2777:(t,i,e)=>{var s=e(9565),n=e(34),r=e(757),o=e(5966),h=e(4270),a=e(8227),c=TypeError,l=a("toPrimitive");t.exports=function(t,i){if(!n(t)||r(t))return t;var e,a=o(t,l);if(a){if(void 0===i&&(i="default"),e=s(a,t,i),!n(e)||r(e))return e;throw new c("Can't convert object to primitive value")}return void 0===i&&(i="number"),h(t,i)}},2787:(t,i,e)=>{var s=e(9297),n=e(4901),r=e(8981),o=e(6119),h=e(2211),a=o("IE_PROTO"),c=Object,l=c.prototype;t.exports=h?c.getPrototypeOf:function(t){var i=r(t);if(s(i,a))return i[a];var e=i.constructor;return n(e)&&i instanceof e?e.prototype:i instanceof c?l:null}},2796:(t,i,e)=>{var s=e(9039),n=e(4901),r=/#|\.prototype\./,o=function(t,i){var e=a[h(t)];return e===l||e!==c&&(n(i)?s(i):!!i)},h=o.normalize=function(t){return String(t).replace(r,".").toLowerCase()},a=o.data={},c=o.NATIVE="N",l=o.POLYFILL="P";t.exports=o},2804:t=>{var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=i+"+/",s=i+"-_",n=function(t){for(var i={},e=0;e<64;e++)i[t.charAt(e)]=e;return i};t.exports={i2c:e,c2i:n(e),i2cUrl:s,c2iUrl:n(s)}},2812:t=>{var i=TypeError;t.exports=function(t,e){if(t<e)throw new i("Not enough arguments");return t}},2839:(t,i,e)=>{var s=e(4576).navigator,n=s&&s.userAgent;t.exports=n?String(n):""},2967:(t,i,e)=>{var s=e(6706),n=e(34),r=e(7750),o=e(3506);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,i=!1,e={};try{(t=s(Object.prototype,"__proto__","set"))(e,[]),i=e instanceof Array}catch(t){}return function(e,s){return r(e),o(s),n(e)?(i?t(e,s):e.__proto__=s,e):e}}():void 0)},3167:(t,i,e)=>{var s=e(4901),n=e(34),r=e(2967);t.exports=function(t,i,e){var o,h;return r&&s(o=i.constructor)&&o!==e&&n(h=o.prototype)&&h!==e.prototype&&r(t,h),t}},3238:(t,i,e)=>{var s=e(4576),n=e(7811),r=e(7394),o=s.DataView;t.exports=function(t){if(!n||0!==r(t))return!1;try{return new o(t),!1}catch(t){return!0}}},3392:(t,i,e)=>{var s=e(9504),n=0,r=Math.random(),o=s(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+o(++n+r,36)}},3440:(t,i,e)=>{var s=e(7080),n=e(4402),r=e(9286),o=e(5170),h=e(3789),a=e(8469),c=e(507),l=n.has,u=n.remove;t.exports=function(t){var i=s(this),e=h(t),n=r(i);return o(i)<=e.size?a(i,(function(t){e.includes(t)&&u(n,t)})):c(e.getIterator(),(function(t){l(i,t)&&u(n,t)})),n}},3463:t=>{var i=TypeError;t.exports=function(t){if("string"==typeof t)return t;throw new i("Argument is not a string")}},3506:(t,i,e)=>{var s=e(3925),n=String,r=TypeError;t.exports=function(t){if(s(t))return t;throw new r("Can't set "+n(t)+" as a prototype")}},3579:(t,i,e)=>{var s=e(6518),n=e(9565),r=e(2652),o=e(9306),h=e(8551),a=e(1767),c=e(9539),l=e(4549)("some",TypeError);s({target:"Iterator",proto:!0,real:!0,forced:l},{some:function(t){h(this);try{o(t)}catch(t){c(this,"throw",t)}if(l)return n(l,this,t);var i=a(this),e=0;return r(i,(function(i,s){if(t(i,e++))return s()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},3650:(t,i,e)=>{var s=e(7080),n=e(4402),r=e(9286),o=e(3789),h=e(507),a=n.add,c=n.has,l=n.remove;t.exports=function(t){var i=s(this),e=o(t).getIterator(),n=r(i);return h(e,(function(t){c(i,t)?l(n,t):a(n,t)})),n}},3706:(t,i,e)=>{var s=e(9504),n=e(4901),r=e(7629),o=s(Function.toString);n(r.inspectSource)||(r.inspectSource=function(t){return o(t)}),t.exports=r.inspectSource},3717:(t,i)=>{i.f=Object.getOwnPropertySymbols},3724:(t,i,e)=>{var s=e(9039);t.exports=!s((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},3789:(t,i,e)=>{var s=e(9306),n=e(8551),r=e(9565),o=e(1291),h=e(1767),a="Invalid size",c=RangeError,l=TypeError,u=Math.max,d=function(t,i){this.set=t,this.size=u(i,0),this.has=s(t.has),this.keys=s(t.keys)};d.prototype={getIterator:function(){return h(n(r(this.keys,this.set)))},includes:function(t){return r(this.has,this.set,t)}},t.exports=function(t){n(t);var i=+t.size;if(i!=i)throw new l(a);var e=o(i);if(e<0)throw new c(a);return new d(t,e)}},3838:(t,i,e)=>{var s=e(7080),n=e(5170),r=e(8469),o=e(3789);t.exports=function(t){var i=s(this),e=o(t);return!(n(i)>e.size)&&!1!==r(i,(function(t){if(!e.includes(t))return!1}),!0)}},3853:(t,i,e)=>{var s=e(6518),n=e(4449);s({target:"Set",proto:!0,real:!0,forced:!e(4916)("isDisjointFrom",(function(t){return!t}))},{isDisjointFrom:n})},3925:(t,i,e)=>{var s=e(34);t.exports=function(t){return s(t)||null===t}},3972:(t,i,e)=>{var s=e(34),n=String,r=TypeError;t.exports=function(t){if(void 0===t||s(t))return t;throw new r(n(t)+" is not an object or undefined")}},4055:(t,i,e)=>{var s=e(4576),n=e(34),r=s.document,o=n(r)&&n(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},4114:(t,i,e)=>{var s=e(6518),n=e(8981),r=e(6198),o=e(4527),h=e(6837);s({target:"Array",proto:!0,arity:1,forced:e(9039)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var i=n(this),e=r(i),s=arguments.length;h(e+s);for(var a=0;a<s;a++)i[e]=arguments[a],e++;return o(i,e),e}})},4117:t=>{t.exports=function(t){return null==t}},4149:t=>{var i=RangeError;t.exports=function(t){if(t==t)return t;throw new i("NaN is not allowed")}},4154:(t,i,e)=>{var s=e(6955),n=TypeError;t.exports=function(t){if("Uint8Array"===s(t))return t;throw new n("Argument is not an Uint8Array")}},4204:(t,i,e)=>{var s=e(7080),n=e(4402).add,r=e(9286),o=e(3789),h=e(507);t.exports=function(t){var i=s(this),e=o(t).getIterator(),a=r(i);return h(e,(function(t){n(a,t)})),a}},4209:(t,i,e)=>{var s=e(8227),n=e(6269),r=s("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||o[r]===t)}},4215:(t,i,e)=>{var s=e(4576),n=e(2839),r=e(2195),o=function(t){return n.slice(0,t.length)===t};t.exports=o("Bun/")?"BUN":o("Cloudflare-Workers")?"CLOUDFLARE":o("Deno/")?"DENO":o("Node.js/")?"NODE":s.Bun&&"string"==typeof Bun.version?"BUN":s.Deno&&"object"==typeof Deno.version?"DENO":"process"===r(s.process)?"NODE":s.window&&s.document?"BROWSER":"REST"},4270:(t,i,e)=>{var s=e(9565),n=e(4901),r=e(34),o=TypeError;t.exports=function(t,i){var e,h;if("string"===i&&n(e=t.toString)&&!r(h=s(e,t)))return h;if(n(e=t.valueOf)&&!r(h=s(e,t)))return h;if("string"!==i&&n(e=t.toString)&&!r(h=s(e,t)))return h;throw new o("Can't convert object to primitive value")}},4376:(t,i,e)=>{var s=e(2195);t.exports=Array.isArray||function(t){return"Array"===s(t)}},4402:(t,i,e)=>{var s=e(9504),n=Set.prototype;t.exports={Set,add:s(n.add),has:s(n.has),remove:s(n.delete),proto:n}},4449:(t,i,e)=>{var s=e(7080),n=e(4402).has,r=e(5170),o=e(3789),h=e(8469),a=e(507),c=e(9539);t.exports=function(t){var i=s(this),e=o(t);if(r(i)<=e.size)return!1!==h(i,(function(t){if(e.includes(t))return!1}),!0);var l=e.getIterator();return!1!==a(l,(function(t){if(n(i,t))return c(l,"normal",!1)}))}},4483:(t,i,e)=>{var s,n,r,o,h=e(4576),a=e(9429),c=e(1548),l=h.structuredClone,u=h.ArrayBuffer,d=h.MessageChannel,f=!1;if(c)f=function(t){l(t,{transfer:[t]})};else if(u)try{d||(s=a("worker_threads"))&&(d=s.MessageChannel),d&&(n=new d,r=new u(2),o=function(t){n.port1.postMessage(null,[t])},2===r.byteLength&&(o(r),0===r.byteLength&&(f=o)))}catch(t){}t.exports=f},4495:(t,i,e)=>{var s=e(9519),n=e(9039),r=e(4576).String;t.exports=!!Object.getOwnPropertySymbols&&!n((function(){var t=Symbol("symbol detection");return!r(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&s&&s<41}))},4527:(t,i,e)=>{var s=e(3724),n=e(4376),r=TypeError,o=Object.getOwnPropertyDescriptor,h=s&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=h?function(t,i){if(n(t)&&!o(t,"length").writable)throw new r("Cannot set read only .length");return t.length=i}:function(t,i){return t.length=i}},4549:(t,i,e)=>{var s=e(4576);t.exports=function(t,i){var e=s.Iterator,n=e&&e.prototype,r=n&&n[t],o=!1;if(r)try{r.call({next:function(){return{done:!0}},return:function(){o=!0}},-1)}catch(t){t instanceof i||(o=!1)}if(!o)return r}},4576:function(t){var i=function(t){return t&&t.Math===Math&&t};t.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof global&&global)||i("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4603:(t,i,e)=>{var s=e(6840),n=e(9504),r=e(655),o=e(2812),h=URLSearchParams,a=h.prototype,c=n(a.append),l=n(a.delete),u=n(a.forEach),d=n([].push),f=new h("a=1&a=2&b=3");f.delete("a",1),f.delete("b",void 0),f+""!="a=2"&&s(a,"delete",(function(t){var i=arguments.length,e=i<2?void 0:arguments[1];if(i&&void 0===e)return l(this,t);var s=[];u(this,(function(t,i){d(s,{key:i,value:t})})),o(i,1);for(var n,h=r(t),a=r(e),f=0,p=0,g=!1,w=s.length;f<w;)n=s[f++],g||n.key===h?(g=!0,l(this,n.key)):p++;for(;p<w;)(n=s[p++]).key===h&&n.value===a||c(this,n.key,n.value)}),{enumerable:!0,unsafe:!0})},4628:(t,i,e)=>{var s=e(6518),n=e(6043);s({target:"Promise",stat:!0},{withResolvers:function(){var t=n.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}})},4659:(t,i,e)=>{var s=e(3724),n=e(4913),r=e(6980);t.exports=function(t,i,e){s?n.f(t,i,r(0,e)):t[i]=e}},4901:t=>{var i="object"==typeof document&&document.all;t.exports=void 0===i&&void 0!==i?function(t){return"function"==typeof t||t===i}:function(t){return"function"==typeof t}},4913:(t,i,e)=>{var s=e(3724),n=e(5917),r=e(8686),o=e(8551),h=e(6969),a=TypeError,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u="enumerable",d="configurable",f="writable";i.f=s?r?function(t,i,e){if(o(t),i=h(i),o(e),"function"==typeof t&&"prototype"===i&&"value"in e&&f in e&&!e[f]){var s=l(t,i);s&&s[f]&&(t[i]=e.value,e={configurable:d in e?e[d]:s[d],enumerable:u in e?e[u]:s[u],writable:!1})}return c(t,i,e)}:c:function(t,i,e){if(o(t),i=h(i),o(e),n)try{return c(t,i,e)}catch(t){}if("get"in e||"set"in e)throw new a("Accessors not supported");return"value"in e&&(t[i]=e.value),t}},4916:(t,i,e)=>{var s=e(7751),n=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},r=function(t){return{size:t,has:function(){return!0},keys:function(){throw new Error("e")}}};t.exports=function(t,i){var e=s("Set");try{(new e)[t](n(0));try{return(new e)[t](n(-1)),!1}catch(s){if(!i)return!0;try{return(new e)[t](r(-1/0)),!1}catch(s){var o=new e;return o.add(1),o.add(2),i(o[t](r(1/0)))}}}catch(t){return!1}}},4979:(t,i,e)=>{var s=e(6518),n=e(4576),r=e(7751),o=e(6980),h=e(4913).f,a=e(9297),c=e(679),l=e(3167),u=e(2603),d=e(5002),f=e(8574),p=e(3724),g=e(6395),w="DOMException",m=r("Error"),A=r(w),v=function(){c(this,b);var t=arguments.length,i=u(t<1?void 0:arguments[0]),e=u(t<2?void 0:arguments[1],"Error"),s=new A(i,e),n=new m(i);return n.name=w,h(s,"stack",o(1,f(n.stack,1))),l(s,this,v),s},b=v.prototype=A.prototype,y="stack"in new m(w),x="stack"in new A(1,2),M=A&&p&&Object.getOwnPropertyDescriptor(n,w),k=y&&!!(!M||M.writable&&M.configurable)&&!x;s({global:!0,constructor:!0,forced:g||k},{DOMException:k?v:A});var E=r(w),S=E.prototype;if(S.constructor!==E)for(var _ in g||h(S,"constructor",o(1,E)),d)if(a(d,_)){var T=d[_],C=T.s;a(E,C)||h(E,C,o(6,T.c))}},5002:t=>{t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},5024:(t,i,e)=>{var s=e(6518),n=e(3650);s({target:"Set",proto:!0,real:!0,forced:!e(4916)("symmetricDifference")},{symmetricDifference:n})},5031:(t,i,e)=>{var s=e(7751),n=e(9504),r=e(8480),o=e(3717),h=e(8551),a=n([].concat);t.exports=s("Reflect","ownKeys")||function(t){var i=r.f(h(t)),e=o.f;return e?a(i,e(t)):i}},5169:(t,i,e)=>{var s=e(3238),n=TypeError;t.exports=function(t){if(s(t))throw new n("ArrayBuffer is detached");return t}},5170:(t,i,e)=>{var s=e(6706),n=e(4402);t.exports=s(n.proto,"size","get")||function(t){return t.size}},5370:(t,i,e)=>{var s=e(6198);t.exports=function(t,i,e){for(var n=0,r=arguments.length>2?e:s(i),o=new t(r);r>n;)o[n]=i[n++];return o}},5397:(t,i,e)=>{var s=e(7055),n=e(7750);t.exports=function(t){return s(n(t))}},5610:(t,i,e)=>{var s=e(1291),n=Math.max,r=Math.min;t.exports=function(t,i){var e=s(t);return e<0?n(e+i,0):r(e,i)}},5623:(t,i,e)=>{var s=e(6518),n=e(4576),r=e(9504),o=e(4154),h=e(5169),a=r(1..toString);n.Uint8Array&&s({target:"Uint8Array",proto:!0},{toHex:function(){o(this),h(this.buffer);for(var t="",i=0,e=this.length;i<e;i++){var s=a(this[i],16);t+=1===s.length?"0"+s:s}return t}})},5636:(t,i,e)=>{var s=e(4576),n=e(9504),r=e(6706),o=e(7696),h=e(5169),a=e(7394),c=e(4483),l=e(1548),u=s.structuredClone,d=s.ArrayBuffer,f=s.DataView,p=Math.min,g=d.prototype,w=f.prototype,m=n(g.slice),A=r(g,"resizable","get"),v=r(g,"maxByteLength","get"),b=n(w.getInt8),y=n(w.setInt8);t.exports=(l||c)&&function(t,i,e){var s,n=a(t),r=void 0===i?n:o(i),g=!A||!A(t);if(h(t),l&&(t=u(t,{transfer:[t]}),n===r&&(e||g)))return t;if(n>=r&&(!e||g))s=m(t,0,r);else{var w=e&&!g&&v?{maxByteLength:v(t)}:void 0;s=new d(r,w);for(var x=new f(t),M=new f(s),k=p(r,n),E=0;E<k;E++)y(M,E,b(x,E))}return l||c(t),s}},5745:(t,i,e)=>{var s=e(7629);t.exports=function(t,i){return s[t]||(s[t]=i||{})}},5781:(t,i,e)=>{var s=e(6518),n=e(7751),r=e(2812),o=e(655),h=e(7416),a=n("URL");s({target:"URL",stat:!0,forced:!h},{parse:function(t){var i=r(arguments.length,1),e=o(t),s=i<2||void 0===arguments[1]?void 0:o(arguments[1]);try{return new a(e,s)}catch(t){return null}}})},5876:(t,i,e)=>{var s=e(6518),n=e(3838);s({target:"Set",proto:!0,real:!0,forced:!e(4916)("isSubsetOf",(function(t){return t}))},{isSubsetOf:n})},5917:(t,i,e)=>{var s=e(3724),n=e(9039),r=e(4055);t.exports=!s&&!n((function(){return 7!==Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))},5966:(t,i,e)=>{var s=e(9306),n=e(4117);t.exports=function(t,i){var e=t[i];return n(e)?void 0:s(e)}},6043:(t,i,e)=>{var s=e(9306),n=TypeError,r=function(t){var i,e;this.promise=new t((function(t,s){if(void 0!==i||void 0!==e)throw new n("Bad Promise constructor");i=t,e=s})),this.resolve=s(i),this.reject=s(e)};t.exports.f=function(t){return new r(t)}},6080:(t,i,e)=>{var s=e(7476),n=e(9306),r=e(616),o=s(s.bind);t.exports=function(t,i){return n(t),void 0===i?t:r?o(t,i):function(){return t.apply(i,arguments)}}},6119:(t,i,e)=>{var s=e(5745),n=e(3392),r=s("keys");t.exports=function(t){return r[t]||(r[t]=n(t))}},6193:(t,i,e)=>{var s=e(4215);t.exports="NODE"===s},6198:(t,i,e)=>{var s=e(8014);t.exports=function(t){return s(t.length)}},6269:t=>{t.exports={}},6279:(t,i,e)=>{var s=e(6840);t.exports=function(t,i,e){for(var n in i)s(t,n,i[n],e);return t}},6319:(t,i,e)=>{var s=e(8551),n=e(9539);t.exports=function(t,i,e,r){try{return r?i(s(e)[0],e[1]):i(e)}catch(i){n(t,"throw",i)}}},6395:t=>{t.exports=!1},6518:(t,i,e)=>{var s=e(4576),n=e(7347).f,r=e(6699),o=e(6840),h=e(9433),a=e(7740),c=e(2796);t.exports=function(t,i){var e,l,u,d,f,p=t.target,g=t.global,w=t.stat;if(e=g?s:w?s[p]||h(p,{}):s[p]&&s[p].prototype)for(l in i){if(d=i[l],u=t.dontCallGetSet?(f=n(e,l))&&f.value:e[l],!c(g?l:p+(w?".":"#")+l,t.forced)&&void 0!==u){if(typeof d==typeof u)continue;a(d,u)}(t.sham||u&&u.sham)&&r(d,"sham",!0),o(e,l,d,t)}}},6573:(t,i,e)=>{var s=e(3724),n=e(2106),r=e(3238),o=ArrayBuffer.prototype;s&&!("detached"in o)&&n(o,"detached",{configurable:!0,get:function(){return r(this)}})},6699:(t,i,e)=>{var s=e(3724),n=e(4913),r=e(6980);t.exports=s?function(t,i,e){return n.f(t,i,r(1,e))}:function(t,i,e){return t[i]=e,t}},6706:(t,i,e)=>{var s=e(9504),n=e(9306);t.exports=function(t,i,e){try{return s(n(Object.getOwnPropertyDescriptor(t,i)[e]))}catch(t){}}},6801:(t,i,e)=>{var s=e(3724),n=e(8686),r=e(4913),o=e(8551),h=e(5397),a=e(1072);i.f=s&&!n?Object.defineProperties:function(t,i){o(t);for(var e,s=h(i),n=a(i),c=n.length,l=0;c>l;)r.f(t,e=n[l++],s[e]);return t}},6823:t=>{var i=String;t.exports=function(t){try{return i(t)}catch(t){return"Object"}}},6837:t=>{var i=TypeError;t.exports=function(t){if(t>9007199254740991)throw i("Maximum allowed index exceeded");return t}},6840:(t,i,e)=>{var s=e(4901),n=e(4913),r=e(283),o=e(9433);t.exports=function(t,i,e,h){h||(h={});var a=h.enumerable,c=void 0!==h.name?h.name:i;if(s(e)&&r(e,c,h),h.global)a?t[i]=e:o(i,e);else{try{h.unsafe?t[i]&&(a=!0):delete t[i]}catch(t){}a?t[i]=e:n.f(t,i,{value:e,enumerable:!1,configurable:!h.nonConfigurable,writable:!h.nonWritable})}return t}},6955:(t,i,e)=>{var s=e(2140),n=e(4901),r=e(2195),o=e(8227)("toStringTag"),h=Object,a="Arguments"===r(function(){return arguments}());t.exports=s?r:function(t){var i,e,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,i){try{return t[i]}catch(t){}}(i=h(t),o))?e:a?r(i):"Object"===(s=r(i))&&n(i.callee)?"Arguments":s}},6969:(t,i,e)=>{var s=e(2777),n=e(757);t.exports=function(t){var i=s(t,"string");return n(i)?i:i+""}},6980:t=>{t.exports=function(t,i){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:i}}},7040:(t,i,e)=>{var s=e(4495);t.exports=s&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7055:(t,i,e)=>{var s=e(9504),n=e(9039),r=e(2195),o=Object,h=s("".split);t.exports=n((function(){return!o("z").propertyIsEnumerable(0)}))?function(t){return"String"===r(t)?h(t,""):o(t)}:o},7080:(t,i,e)=>{var s=e(4402).has;t.exports=function(t){return s(t),t}},7347:(t,i,e)=>{var s=e(3724),n=e(9565),r=e(8773),o=e(6980),h=e(5397),a=e(6969),c=e(9297),l=e(5917),u=Object.getOwnPropertyDescriptor;i.f=s?u:function(t,i){if(t=h(t),i=a(i),l)try{return u(t,i)}catch(t){}if(c(t,i))return o(!n(r.f,t,i),t[i])}},7394:(t,i,e)=>{var s=e(4576),n=e(6706),r=e(2195),o=s.ArrayBuffer,h=s.TypeError;t.exports=o&&n(o.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==r(t))throw new h("ArrayBuffer expected");return t.byteLength}},7416:(t,i,e)=>{var s=e(9039),n=e(8227),r=e(3724),o=e(6395),h=n("iterator");t.exports=!s((function(){var t=new URL("b?a=1&b=2&c=3","https://a"),i=t.searchParams,e=new URLSearchParams("a=1&a=2&b=3"),s="";return t.pathname="c%20d",i.forEach((function(t,e){i.delete("b"),s+=e+t})),e.delete("a",2),e.delete("b",void 0),o&&(!t.toJSON||!e.has("a",1)||e.has("a",2)||!e.has("a",void 0)||e.has("b"))||!i.size&&(o||!r)||!i.sort||"https://a/c%20d?a=1&c=3"!==t.href||"3"!==i.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!i[h]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==s||"x"!==new URL("https://x",void 0).host}))},7476:(t,i,e)=>{var s=e(2195),n=e(9504);t.exports=function(t){if("Function"===s(t))return n(t)}},7566:(t,i,e)=>{var s=e(6840),n=e(9504),r=e(655),o=e(2812),h=URLSearchParams,a=h.prototype,c=n(a.getAll),l=n(a.has),u=new h("a=1");!u.has("a",2)&&u.has("a",void 0)||s(a,"has",(function(t){var i=arguments.length,e=i<2?void 0:arguments[1];if(i&&void 0===e)return l(this,t);var s=c(this,t);o(i,1);for(var n=r(e),h=0;h<s.length;)if(s[h++]===n)return!0;return!1}),{enumerable:!0,unsafe:!0})},7629:(t,i,e)=>{var s=e(6395),n=e(4576),r=e(9433),o="__core-js_shared__",h=t.exports=n[o]||r(o,{});(h.versions||(h.versions=[])).push({version:"3.42.0",mode:s?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})},7642:(t,i,e)=>{var s=e(6518),n=e(3440);s({target:"Set",proto:!0,real:!0,forced:!e(4916)("difference",(function(t){return 0===t.size}))},{difference:n})},7657:(t,i,e)=>{var s,n,r,o=e(9039),h=e(4901),a=e(34),c=e(2360),l=e(2787),u=e(6840),d=e(8227),f=e(6395),p=d("iterator"),g=!1;[].keys&&("next"in(r=[].keys())?(n=l(l(r)))!==Object.prototype&&(s=n):g=!0),!a(s)||o((function(){var t={};return s[p].call(t)!==t}))?s={}:f&&(s=c(s)),h(s[p])||u(s,p,(function(){return this})),t.exports={IteratorPrototype:s,BUGGY_SAFARI_ITERATORS:g}},7680:(t,i,e)=>{var s=e(9504);t.exports=s([].slice)},7696:(t,i,e)=>{var s=e(1291),n=e(8014),r=RangeError;t.exports=function(t){if(void 0===t)return 0;var i=s(t),e=n(i);if(i!==e)throw new r("Wrong length or index");return e}},7740:(t,i,e)=>{var s=e(9297),n=e(5031),r=e(7347),o=e(4913);t.exports=function(t,i,e){for(var h=n(i),a=o.f,c=r.f,l=0;l<h.length;l++){var u=h[l];s(t,u)||e&&s(e,u)||a(t,u,c(i,u))}}},7750:(t,i,e)=>{var s=e(4117),n=TypeError;t.exports=function(t){if(s(t))throw new n("Can't call method on "+t);return t}},7751:(t,i,e)=>{var s=e(4576),n=e(4901);t.exports=function(t,i){return arguments.length<2?n(e=s[t])?e:void 0:s[t]&&s[t][i];var e}},7811:t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},7936:(t,i,e)=>{var s=e(6518),n=e(5636);n&&s({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return n(this,arguments.length?arguments[0]:void 0,!1)}})},8004:(t,i,e)=>{var s=e(6518),n=e(9039),r=e(8750);s({target:"Set",proto:!0,real:!0,forced:!e(4916)("intersection",(function(t){return 2===t.size&&t.has(1)&&t.has(2)}))||n((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:r})},8014:(t,i,e)=>{var s=e(1291),n=Math.min;t.exports=function(t){var i=s(t);return i>0?n(i,9007199254740991):0}},8100:(t,i,e)=>{var s=e(6518),n=e(5636);n&&s({target:"ArrayBuffer",proto:!0},{transfer:function(){return n(this,arguments.length?arguments[0]:void 0,!0)}})},8111:(t,i,e)=>{var s=e(6518),n=e(4576),r=e(679),o=e(8551),h=e(4901),a=e(2787),c=e(2106),l=e(4659),u=e(9039),d=e(9297),f=e(8227),p=e(7657).IteratorPrototype,g=e(3724),w=e(6395),m="constructor",A="Iterator",v=f("toStringTag"),b=TypeError,y=n[A],x=w||!h(y)||y.prototype!==p||!u((function(){y({})})),M=function(){if(r(this,p),a(this)===p)throw new b("Abstract class Iterator not directly constructable")},k=function(t,i){g?c(p,t,{configurable:!0,get:function(){return i},set:function(i){if(o(this),this===p)throw new b("You can't redefine this property");d(this,t)?this[t]=i:l(this,t,i)}}):p[t]=i};d(p,v)||k(v,A),!x&&d(p,m)&&p[m]!==Object||k(m,M),M.prototype=p,s({global:!0,constructor:!0,forced:x},{Iterator:M})},8227:(t,i,e)=>{var s=e(4576),n=e(5745),r=e(9297),o=e(3392),h=e(4495),a=e(7040),c=s.Symbol,l=n("wks"),u=a?c.for||c:c&&c.withoutSetter||o;t.exports=function(t){return r(l,t)||(l[t]=h&&r(c,t)?c[t]:u("Symbol."+t)),l[t]}},8235:(t,i,e)=>{var s=e(9504),n=e(9297),r=SyntaxError,o=parseInt,h=String.fromCharCode,a=s("".charAt),c=s("".slice),l=s(/./.exec),u={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},d=/^[\da-f]{4}$/i,f=/^[\u0000-\u001F]$/;t.exports=function(t,i){for(var e=!0,s="";i<t.length;){var p=a(t,i);if("\\"===p){var g=c(t,i,i+2);if(n(u,g))s+=u[g],i+=2;else{if("\\u"!==g)throw new r('Unknown escape sequence: "'+g+'"');var w=c(t,i+=2,i+4);if(!l(d,w))throw new r("Bad Unicode escape at: "+i);s+=h(o(w,16)),i+=4}}else{if('"'===p){e=!1,i++;break}if(l(f,p))throw new r("Bad control character in string literal at: "+i);s+=p,i++}}if(e)throw new r("Unterminated string at: "+i);return{value:s,end:i}}},8237:(t,i,e)=>{var s=e(6518),n=e(2652),r=e(9306),o=e(8551),h=e(1767),a=e(9539),c=e(4549),l=e(8745),u=e(9039),d=TypeError,f=u((function(){[].keys().reduce((function(){}),void 0)})),p=!f&&c("reduce",d);s({target:"Iterator",proto:!0,real:!0,forced:f||p},{reduce:function(t){o(this);try{r(t)}catch(t){a(this,"throw",t)}var i=arguments.length<2,e=i?void 0:arguments[1];if(p)return l(p,this,i?[t]:[t,e]);var s=h(this),c=0;if(n(s,(function(s){i?(i=!1,e=s):e=t(e,s,c),c++}),{IS_RECORD:!0}),i)throw new d("Reduce of empty iterator with no initial value");return e}})},8335:(t,i,e)=>{var s=e(6518),n=e(3724),r=e(4576),o=e(7751),h=e(9504),a=e(9565),c=e(4901),l=e(34),u=e(4376),d=e(9297),f=e(655),p=e(6198),g=e(4659),w=e(9039),m=e(8235),A=e(4495),v=r.JSON,b=r.Number,y=r.SyntaxError,x=v&&v.parse,M=o("Object","keys"),k=Object.getOwnPropertyDescriptor,E=h("".charAt),S=h("".slice),_=h(/./.exec),T=h([].push),C=/^\d$/,P=/^[1-9]$/,R=/^[\d-]$/,N=/^[\t\n\r ]$/,D=function(t,i,e,s){var n,r,o,h,c,f=t[i],g=s&&f===s.value,w=g&&"string"==typeof s.source?{source:s.source}:{};if(l(f)){var m=u(f),A=g?s.nodes:m?[]:{};if(m)for(n=A.length,o=p(f),h=0;h<o;h++)I(f,h,D(f,""+h,e,h<n?A[h]:void 0));else for(r=M(f),o=p(r),h=0;h<o;h++)I(f,c=r[h],D(f,c,e,d(A,c)?A[c]:void 0))}return a(e,t,i,f,w)},I=function(t,i,e){if(n){var s=k(t,i);if(s&&!s.configurable)return}void 0===e?delete t[i]:g(t,i,e)},F=function(t,i,e,s){this.value=t,this.end=i,this.source=e,this.nodes=s},O=function(t,i){this.source=t,this.index=i};O.prototype={fork:function(t){return new O(this.source,t)},parse:function(){var t=this.source,i=this.skip(N,this.index),e=this.fork(i),s=E(t,i);if(_(R,s))return e.number();switch(s){case"{":return e.object();case"[":return e.array();case'"':return e.string();case"t":return e.keyword(!0);case"f":return e.keyword(!1);case"n":return e.keyword(null)}throw new y('Unexpected character: "'+s+'" at: '+i)},node:function(t,i,e,s,n){return new F(i,s,t?null:S(this.source,e,s),n)},object:function(){for(var t=this.source,i=this.index+1,e=!1,s={},n={};i<t.length;){if(i=this.until(['"',"}"],i),"}"===E(t,i)&&!e){i++;break}var r=this.fork(i).string(),o=r.value;i=this.until([":"],i=r.end)+1,i=this.skip(N,i),r=this.fork(i).parse(),g(n,o,r),g(s,o,r.value),i=this.until([",","}"],r.end);var h=E(t,i);if(","===h)e=!0,i++;else if("}"===h){i++;break}}return this.node(1,s,this.index,i,n)},array:function(){for(var t=this.source,i=this.index+1,e=!1,s=[],n=[];i<t.length;){if(i=this.skip(N,i),"]"===E(t,i)&&!e){i++;break}var r=this.fork(i).parse();if(T(n,r),T(s,r.value),i=this.until([",","]"],r.end),","===E(t,i))e=!0,i++;else if("]"===E(t,i)){i++;break}}return this.node(1,s,this.index,i,n)},string:function(){var t=this.index,i=m(this.source,this.index+1);return this.node(0,i.value,t,i.end)},number:function(){var t=this.source,i=this.index,e=i;if("-"===E(t,e)&&e++,"0"===E(t,e))e++;else{if(!_(P,E(t,e)))throw new y("Failed to parse number at: "+e);e=this.skip(C,e+1)}if(!("."===E(t,e)&&(e=this.skip(C,e+1)),"e"!==E(t,e)&&"E"!==E(t,e)||(e++,"+"!==E(t,e)&&"-"!==E(t,e)||e++,e!==(e=this.skip(C,e)))))throw new y("Failed to parse number's exponent value at: "+e);return this.node(0,b(S(t,i,e)),i,e)},keyword:function(t){var i=""+t,e=this.index,s=e+i.length;if(S(this.source,e,s)!==i)throw new y("Failed to parse value at: "+e);return this.node(0,t,e,s)},skip:function(t,i){for(var e=this.source;i<e.length&&_(t,E(e,i));i++);return i},until:function(t,i){i=this.skip(N,i);for(var e=E(this.source,i),s=0;s<t.length;s++)if(t[s]===e)return i;throw new y('Unexpected character: "'+e+'" at: '+i)}};var $=w((function(){var t,i="9007199254740993";return x(i,(function(i,e,s){t=s.source})),t!==i})),L=A&&!w((function(){return 1/x("-0 \t")!=-1/0}));s({target:"JSON",stat:!0,forced:$},{parse:function(t,i){return L&&!c(i)?x(t):function(t,i){t=f(t);var e=new O(t,0),s=e.parse(),n=s.value,r=e.skip(N,s.end);if(r<t.length)throw new y('Unexpected extra character: "'+E(t,r)+'" after the parsed data at: '+r);return c(i)?D({"":n},"",i,s):n}(t,i)}})},8469:(t,i,e)=>{var s=e(9504),n=e(507),r=e(4402),o=r.Set,h=r.proto,a=s(h.forEach),c=s(h.keys),l=c(new o).next;t.exports=function(t,i,e){return e?n({iterator:c(t),next:l},i):a(t,i)}},8480:(t,i,e)=>{var s=e(1828),n=e(8727).concat("length","prototype");i.f=Object.getOwnPropertyNames||function(t){return s(t,n)}},8527:(t,i,e)=>{var s=e(7080),n=e(4402).has,r=e(5170),o=e(3789),h=e(507),a=e(9539);t.exports=function(t){var i=s(this),e=o(t);if(r(i)<e.size)return!1;var c=e.getIterator();return!1!==h(c,(function(t){if(!n(i,t))return a(c,"normal",!1)}))}},8551:(t,i,e)=>{var s=e(34),n=String,r=TypeError;t.exports=function(t){if(s(t))return t;throw new r(n(t)+" is not an object")}},8574:(t,i,e)=>{var s=e(9504),n=Error,r=s("".replace),o=String(new n("zxcasd").stack),h=/\n\s*at [^:]*:[^\n]*/,a=h.test(o);t.exports=function(t,i){if(a&&"string"==typeof t&&!n.prepareStackTrace)for(;i--;)t=r(t,h,"");return t}},8622:(t,i,e)=>{var s=e(4576),n=e(4901),r=s.WeakMap;t.exports=n(r)&&/native code/.test(String(r))},8646:(t,i,e)=>{var s=e(9565),n=e(8551),r=e(1767),o=e(851);t.exports=function(t,i){i&&"string"==typeof t||n(t);var e=o(t);return r(n(void 0!==e?s(e,t):t))}},8686:(t,i,e)=>{var s=e(3724),n=e(9039);t.exports=s&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8721:(t,i,e)=>{var s=e(3724),n=e(9504),r=e(2106),o=URLSearchParams.prototype,h=n(o.forEach);s&&!("size"in o)&&r(o,"size",{get:function(){var t=0;return h(this,(function(){t++})),t},configurable:!0,enumerable:!0})},8727:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8745:(t,i,e)=>{var s=e(616),n=Function.prototype,r=n.apply,o=n.call;t.exports="object"==typeof Reflect&&Reflect.apply||(s?o.bind(r):function(){return o.apply(r,arguments)})},8750:(t,i,e)=>{var s=e(7080),n=e(4402),r=e(5170),o=e(3789),h=e(8469),a=e(507),c=n.Set,l=n.add,u=n.has;t.exports=function(t){var i=s(this),e=o(t),n=new c;return r(i)>e.size?a(e.getIterator(),(function(t){u(i,t)&&l(n,t)})):h(i,(function(t){e.includes(t)&&l(n,t)})),n}},8773:(t,i)=>{var e={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,n=s&&!e.call({1:2},1);i.f=n?function(t){var i=s(this,t);return!!i&&i.enumerable}:e},8981:(t,i,e)=>{var s=e(7750),n=Object;t.exports=function(t){return n(s(t))}},9039:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},9143:(t,i,e)=>{var s=e(4576),n=e(9504),r=e(3972),o=e(3463),h=e(9297),a=e(2804),c=e(944),l=e(5169),u=a.c2i,d=a.c2iUrl,f=s.SyntaxError,p=s.TypeError,g=n("".charAt),w=function(t,i){for(var e=t.length;i<e;i++){var s=g(t,i);if(" "!==s&&"\t"!==s&&"\n"!==s&&"\f"!==s&&"\r"!==s)break}return i},m=function(t,i,e){var s=t.length;s<4&&(t+=2===s?"AA":"A");var n=(i[g(t,0)]<<18)+(i[g(t,1)]<<12)+(i[g(t,2)]<<6)+i[g(t,3)],r=[n>>16&255,n>>8&255,255&n];if(2===s){if(e&&0!==r[1])throw new f("Extra bits");return[r[0]]}if(3===s){if(e&&0!==r[2])throw new f("Extra bits");return[r[0],r[1]]}return r},A=function(t,i,e){for(var s=i.length,n=0;n<s;n++)t[e+n]=i[n];return e+s};t.exports=function(t,i,e,s){o(t),r(i);var n="base64"===c(i)?u:d,a=i?i.lastChunkHandling:void 0;if(void 0===a&&(a="loose"),"loose"!==a&&"strict"!==a&&"stop-before-partial"!==a)throw new p("Incorrect `lastChunkHandling` option");e&&l(e.buffer);var v=e||[],b=0,y=0,x="",M=0;if(s)for(;;){if((M=w(t,M))===t.length){if(x.length>0){if("stop-before-partial"===a)break;if("loose"!==a)throw new f("Missing padding");if(1===x.length)throw new f("Malformed padding: exactly one additional character");b=A(v,m(x,n,!1),b)}y=t.length;break}var k=g(t,M);if(++M,"="===k){if(x.length<2)throw new f("Padding is too early");if(M=w(t,M),2===x.length){if(M===t.length){if("stop-before-partial"===a)break;throw new f("Malformed padding: only one =")}"="===g(t,M)&&(++M,M=w(t,M))}if(M<t.length)throw new f("Unexpected character after padding");b=A(v,m(x,n,"strict"===a),b),y=t.length;break}if(!h(n,k))throw new f("Unexpected character");var E=s-b;if(1===E&&2===x.length||2===E&&3===x.length)break;if(4===(x+=k).length&&(b=A(v,m(x,n,!1),b),x="",y=M,b===s))break}return{bytes:v,read:y,written:b}}},9286:(t,i,e)=>{var s=e(4402),n=e(8469),r=s.Set,o=s.add;t.exports=function(t){var i=new r;return n(t,(function(t){o(i,t)})),i}},9297:(t,i,e)=>{var s=e(9504),n=e(8981),r=s({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,i){return r(n(t),i)}},9306:(t,i,e)=>{var s=e(4901),n=e(6823),r=TypeError;t.exports=function(t){if(s(t))return t;throw new r(n(t)+" is not a function")}},9314:(t,i,e)=>{var s=e(6518),n=e(9565),r=e(8551),o=e(1767),h=e(4149),a=e(9590),c=e(9539),l=e(9462),u=e(4549),d=e(6395),f=!d&&u("drop",RangeError),p=l((function(){for(var t,i=this.iterator,e=this.next;this.remaining;)if(this.remaining--,t=r(n(e,i)),this.done=!!t.done)return;if(t=r(n(e,i)),!(this.done=!!t.done))return t.value}));s({target:"Iterator",proto:!0,real:!0,forced:d||f},{drop:function(t){var i;r(this);try{i=a(h(+t))}catch(t){c(this,"throw",t)}return f?n(f,this,i):new p(o(this),{remaining:i})}})},9429:(t,i,e)=>{var s=e(4576),n=e(6193);t.exports=function(t){if(n){try{return s.process.getBuiltinModule(t)}catch(t){}try{return Function('return require("'+t+'")')()}catch(t){}}}},9432:(t,i,e)=>{var s=e(6518),n=e(4576),r=e(5370),o=e(9143),h=n.Uint8Array;h&&s({target:"Uint8Array",stat:!0},{fromBase64:function(t){var i=o(t,arguments.length>1?arguments[1]:void 0,null,9007199254740991);return r(h,i.bytes)}})},9433:(t,i,e)=>{var s=e(4576),n=Object.defineProperty;t.exports=function(t,i){try{n(s,t,{value:i,configurable:!0,writable:!0})}catch(e){s[t]=i}return i}},9462:(t,i,e)=>{var s=e(9565),n=e(2360),r=e(6699),o=e(6279),h=e(8227),a=e(1181),c=e(5966),l=e(7657).IteratorPrototype,u=e(2529),d=e(9539),f=h("toStringTag"),p="IteratorHelper",g="WrapForValidIterator",w=a.set,m=function(t){var i=a.getterFor(t?g:p);return o(n(l),{next:function(){var e=i(this);if(t)return e.nextHandler();if(e.done)return u(void 0,!0);try{var s=e.nextHandler();return e.returnHandlerResult?s:u(s,e.done)}catch(t){throw e.done=!0,t}},return:function(){var e=i(this),n=e.iterator;if(e.done=!0,t){var r=c(n,"return");return r?s(r,n):u(void 0,!0)}if(e.inner)try{d(e.inner.iterator,"normal")}catch(t){return d(n,"throw",t)}return n&&d(n,"normal"),u(void 0,!0)}})},A=m(!0),v=m(!1);r(v,f,"Iterator Helper"),t.exports=function(t,i,e){var s=function(s,n){n?(n.iterator=s.iterator,n.next=s.next):n=s,n.type=i?g:p,n.returnHandlerResult=!!e,n.nextHandler=t,n.counter=0,n.done=!1,w(this,n)};return s.prototype=i?A:v,s}},9504:(t,i,e)=>{var s=e(616),n=Function.prototype,r=n.call,o=s&&n.bind.bind(r,r);t.exports=s?o:function(t){return function(){return r.apply(t,arguments)}}},9519:(t,i,e)=>{var s,n,r=e(4576),o=e(2839),h=r.process,a=r.Deno,c=h&&h.versions||a&&a.version,l=c&&c.v8;l&&(n=(s=l.split("."))[0]>0&&s[0]<4?1:+(s[0]+s[1])),!n&&o&&(!(s=o.match(/Edge\/(\d+)/))||s[1]>=74)&&(s=o.match(/Chrome\/(\d+)/))&&(n=+s[1]),t.exports=n},9539:(t,i,e)=>{var s=e(9565),n=e(8551),r=e(5966);t.exports=function(t,i,e){var o,h;n(t);try{if(!(o=r(t,"return"))){if("throw"===i)throw e;return e}o=s(o,t)}catch(t){h=!0,o=t}if("throw"===i)throw e;if(h)throw o;return n(o),e}},9565:(t,i,e)=>{var s=e(616),n=Function.prototype.call;t.exports=s?n.bind(n):function(){return n.apply(n,arguments)}},9590:(t,i,e)=>{var s=e(1291),n=RangeError;t.exports=function(t){var i=s(t);if(i<0)throw new n("The argument can't be less than 0");return i}},9617:(t,i,e)=>{var s=e(5397),n=e(5610),r=e(6198),o=function(t){return function(i,e,o){var h=s(i),a=r(h);if(0===a)return!t&&-1;var c,l=n(o,a);if(t&&e!=e){for(;a>l;)if((c=h[l++])!=c)return!0}else for(;a>l;l++)if((t||l in h)&&h[l]===e)return t||l||0;return!t&&-1}};t.exports={includes:o(!0),indexOf:o(!1)}},9631:(t,i,e)=>{var s=e(6518),n=e(4576),r=e(9504),o=e(3972),h=e(4154),a=e(5169),c=e(2804),l=e(944),u=c.i2c,d=c.i2cUrl,f=r("".charAt);n.Uint8Array&&s({target:"Uint8Array",proto:!0},{toBase64:function(){var t=h(this),i=arguments.length?o(arguments[0]):void 0,e="base64"===l(i)?u:d,s=!!i&&!!i.omitPadding;a(this.buffer);for(var n,r="",c=0,p=t.length,g=function(t){return f(e,n>>6*t&63)};c+2<p;c+=3)n=(t[c]<<16)+(t[c+1]<<8)+t[c+2],r+=g(3)+g(2)+g(1)+g(0);return c+2===p?(n=(t[c]<<16)+(t[c+1]<<8),r+=g(3)+g(2)+g(1)+(s?"":"=")):c+1===p&&(n=t[c]<<16,r+=g(3)+g(2)+(s?"":"==")),r}})},9797:(t,i,e)=>{var s=e(6518),n=e(4576),r=e(3463),o=e(4154),h=e(5169),a=e(2303);n.Uint8Array&&s({target:"Uint8Array",proto:!0},{setFromHex:function(t){o(this),r(t),h(this.buffer);var i=a(t,this).read;return{read:i,written:i/2}}})}},b={};function y(t){var i=b[t];if(void 0!==i)return i.exports;var e=b[t]={exports:{}};return v[t].call(e.exports,e,e.exports,y),e.exports}y(4114),y(6573),y(8100),y(7936),y(8111),y(8237),y(1689),y(9432),y(1549),y(9797),y(9631),y(5623),y(4979),y(5781);const x=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),M=[.001,0,0,.001,0,0],k=1.35,E={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},S={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101},_={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35,DRAW_STEP:41},T={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},C={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},P={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},R={ERRORS:0,WARNINGS:1,INFOS:5},N={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},D={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let I=R.WARNINGS;function F(t){Number.isInteger(t)&&(I=t)}function O(){return I}function $(t){I>=R.INFOS&&console.log(`Info: ${t}`)}function L(t){I>=R.WARNINGS&&console.log(`Warning: ${t}`)}function B(t){throw new Error(t)}function j(t,i){t||B(i)}function U(t,i=null,e=null){if(!t)return null;if(e&&"string"==typeof t){if(e.addDefaultProtocol&&t.startsWith("www.")){const i=t.match(/\./g);i?.length>=2&&(t=`http://${t}`)}if(e.tryConvertEncoding)try{t=decodeURIComponent(escape(t))}catch{}}const s=i?URL.parse(t,i):URL.parse(t);return function(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(s)?s:null}function z(t,i,e=!1){const s=URL.parse(t);return s?(s.hash=i,s.href):e&&U(t,"http://example.com")?t.split("#",1)[0]+""+(i?`#${i}`:""):""}function H(t,i,e,s=!1){return Object.defineProperty(t,i,{value:e,enumerable:!s,configurable:!0,writable:!1}),e}const G=function(){function t(t,i){this.message=t,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class W extends G{constructor(t,i){super(t,"PasswordException"),this.code=i}}class V extends G{constructor(t,i){super(t,"UnknownErrorException"),this.details=i}}class X extends G{constructor(t){super(t,"InvalidPDFException")}}class Y extends G{constructor(t,i,e){super(t,"ResponseException"),this.status=i,this.missing=e}}class Q extends G{constructor(t){super(t,"FormatError")}}class q extends G{constructor(t){super(t,"AbortException")}}function K(t){"object"==typeof t&&void 0!==t?.length||B("Invalid argument for bytesToString");const i=t.length,e=8192;if(i<e)return String.fromCharCode.apply(null,t);const s=[];for(let n=0;n<i;n+=e){const r=Math.min(n+e,i),o=t.subarray(n,r);s.push(String.fromCharCode.apply(null,o))}return s.join("")}function J(t){"string"!=typeof t&&B("Invalid argument for stringToBytes");const i=t.length,e=new Uint8Array(i);for(let s=0;s<i;++s)e[s]=255&t.charCodeAt(s);return e}class Z{static get isLittleEndian(){return H(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return H(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return H(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get isImageDecoderSupported(){return H(this,"isImageDecoderSupported","undefined"!=typeof ImageDecoder)}static get platform(){const{platform:t,userAgent:i}=navigator;return H(this,"platform",{isAndroid:i.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:i.includes("Firefox")})}static get isCSSRoundSupported(){return H(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const tt=Array.from(Array(256).keys(),(t=>t.toString(16).padStart(2,"0")));class it{static makeHexColor(t,i,e){return`#${tt[t]}${tt[i]}${tt[e]}`}static scaleMinMax(t,i){let e;t[0]?(t[0]<0&&(e=i[0],i[0]=i[2],i[2]=e),i[0]*=t[0],i[2]*=t[0],t[3]<0&&(e=i[1],i[1]=i[3],i[3]=e),i[1]*=t[3],i[3]*=t[3]):(e=i[0],i[0]=i[1],i[1]=e,e=i[2],i[2]=i[3],i[3]=e,t[1]<0&&(e=i[1],i[1]=i[3],i[3]=e),i[1]*=t[1],i[3]*=t[1],t[2]<0&&(e=i[0],i[0]=i[2],i[2]=e),i[0]*=t[2],i[2]*=t[2]),i[0]+=t[4],i[1]+=t[5],i[2]+=t[4],i[3]+=t[5]}static transform(t,i){return[t[0]*i[0]+t[2]*i[1],t[1]*i[0]+t[3]*i[1],t[0]*i[2]+t[2]*i[3],t[1]*i[2]+t[3]*i[3],t[0]*i[4]+t[2]*i[5]+t[4],t[1]*i[4]+t[3]*i[5]+t[5]]}static applyTransform(t,i,e=0){const s=t[e],n=t[e+1];t[e]=s*i[0]+n*i[2]+i[4],t[e+1]=s*i[1]+n*i[3]+i[5]}static applyTransformToBezier(t,i,e=0){const s=i[0],n=i[1],r=i[2],o=i[3],h=i[4],a=i[5];for(let i=0;i<6;i+=2){const c=t[e+i],l=t[e+i+1];t[e+i]=c*s+l*r+h,t[e+i+1]=c*n+l*o+a}}static applyInverseTransform(t,i){const e=t[0],s=t[1],n=i[0]*i[3]-i[1]*i[2];t[0]=(e*i[3]-s*i[2]+i[2]*i[5]-i[4]*i[3])/n,t[1]=(-e*i[1]+s*i[0]+i[4]*i[1]-i[5]*i[0])/n}static axialAlignedBoundingBox(t,i,e){const s=i[0],n=i[1],r=i[2],o=i[3],h=i[4],a=i[5],c=t[0],l=t[1],u=t[2],d=t[3];let f=s*c+h,p=f,g=s*u+h,w=g,m=o*l+a,A=m,v=o*d+a,b=v;if(0!==n||0!==r){const t=n*c,i=n*u,e=r*l,s=r*d;f+=e,w+=e,g+=s,p+=s,m+=t,b+=t,v+=i,A+=i}e[0]=Math.min(e[0],f,g,p,w),e[1]=Math.min(e[1],m,v,A,b),e[2]=Math.max(e[2],f,g,p,w),e[3]=Math.max(e[3],m,v,A,b)}static inverseTransform(t){const i=t[0]*t[3]-t[1]*t[2];return[t[3]/i,-t[1]/i,-t[2]/i,t[0]/i,(t[2]*t[5]-t[4]*t[3])/i,(t[4]*t[1]-t[5]*t[0])/i]}static singularValueDecompose2dScale(t,i){const e=t[0],s=t[1],n=t[2],r=t[3],o=e**2+s**2,h=n**2+r**2,a=(o+h)/2,c=Math.sqrt(a**2-(o*h-(e*n+s*r)**2));i[0]=Math.sqrt(a+c||1),i[1]=Math.sqrt(a-c||1)}static normalizeRect(t){const i=t.slice(0);return t[0]>t[2]&&(i[0]=t[2],i[2]=t[0]),t[1]>t[3]&&(i[1]=t[3],i[3]=t[1]),i}static intersect(t,i){const e=Math.max(Math.min(t[0],t[2]),Math.min(i[0],i[2])),s=Math.min(Math.max(t[0],t[2]),Math.max(i[0],i[2]));if(e>s)return null;const n=Math.max(Math.min(t[1],t[3]),Math.min(i[1],i[3])),r=Math.min(Math.max(t[1],t[3]),Math.max(i[1],i[3]));return n>r?null:[e,n,s,r]}static pointBoundingBox(t,i,e){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],i),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],i)}static rectBoundingBox(t,i,e,s,n){n[0]=Math.min(n[0],t,e),n[1]=Math.min(n[1],i,s),n[2]=Math.max(n[2],t,e),n[3]=Math.max(n[3],i,s)}static#t(t,i,e,s,n,r,o,h,a,c){if(a<=0||a>=1)return;const l=1-a,u=a*a,d=u*a,f=l*(l*(l*t+3*a*i)+3*u*e)+d*s,p=l*(l*(l*n+3*a*r)+3*u*o)+d*h;c[0]=Math.min(c[0],f),c[1]=Math.min(c[1],p),c[2]=Math.max(c[2],f),c[3]=Math.max(c[3],p)}static#i(t,i,e,s,n,r,o,h,a,c,l,u){if(Math.abs(a)<1e-12)return void(Math.abs(c)>=1e-12&&this.#t(t,i,e,s,n,r,o,h,-l/c,u));const d=c**2-4*l*a;if(d<0)return;const f=Math.sqrt(d),p=2*a;this.#t(t,i,e,s,n,r,o,h,(-c+f)/p,u),this.#t(t,i,e,s,n,r,o,h,(-c-f)/p,u)}static bezierBoundingBox(t,i,e,s,n,r,o,h,a){a[0]=Math.min(a[0],t,o),a[1]=Math.min(a[1],i,h),a[2]=Math.max(a[2],t,o),a[3]=Math.max(a[3],i,h),this.#i(t,e,n,o,i,s,r,h,3*(3*(e-n)-t+o),6*(t-2*e+n),3*(e-t),a),this.#i(t,e,n,o,i,s,r,h,3*(3*(s-r)-i+h),6*(i-2*s+r),3*(s-i),a)}}let et=null,st=null;function nt(t){return et||(et=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,st=new Map([["ſt","ſt"]])),t.replaceAll(et,((t,i,e)=>i?i.normalize("NFKC"):st.get(e)))}function rt(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);return crypto.getRandomValues(t),K(t)}const ot="pdfjs_internal_id_";function ht(t,i,e){return Math.min(Math.max(t,i),e)}function at(t){return Uint8Array.prototype.toBase64?t.toBase64():btoa(K(t))}"function"!=typeof Math.sumPrecise&&(Math.sumPrecise=function(t){return t.reduce(((t,i)=>t+i),0)}),"function"!=typeof AbortSignal.any&&(AbortSignal.any=function(t){const i=new AbortController,{signal:e}=i;for(const s of t)if(s.aborted)return i.abort(s.reason),e;for(const s of t)s.addEventListener("abort",(()=>{i.abort(s.reason)}),{signal:e});return e}),y(1701),y(4628),y(7642),y(8004),y(3853),y(5876),y(2475),y(5024),y(1698),y(4603),y(7566),y(8721),y(9314),y(1148),y(3579),y(8335);const ct="http://www.w3.org/2000/svg";class lt{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function ut(t,i="text"){if(vt(t,document.baseURI)){const e=await fetch(t);if(!e.ok)throw new Error(e.statusText);switch(i){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"json":return e.json()}return e.text()}return new Promise(((e,s)=>{const n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType=i,n.onreadystatechange=()=>{if(n.readyState===XMLHttpRequest.DONE)if(200!==n.status&&0!==n.status)s(new Error(n.statusText));else{switch(i){case"arraybuffer":case"blob":case"json":return void e(n.response)}e(n.responseText)}},n.send(null)}))}class dt{constructor({viewBox:t,userUnit:i,scale:e,rotation:s,offsetX:n=0,offsetY:r=0,dontFlip:o=!1}){this.viewBox=t,this.userUnit=i,this.scale=e,this.rotation=s,this.offsetX=n,this.offsetY=r,e*=i;const h=(t[2]+t[0])/2,a=(t[3]+t[1])/2;let c,l,u,d,f,p,g,w;switch((s%=360)<0&&(s+=360),s){case 180:c=-1,l=0,u=0,d=1;break;case 90:c=0,l=1,u=1,d=0;break;case 270:c=0,l=-1,u=-1,d=0;break;case 0:c=1,l=0,u=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(u=-u,d=-d),0===c?(f=Math.abs(a-t[1])*e+n,p=Math.abs(h-t[0])*e+r,g=(t[3]-t[1])*e,w=(t[2]-t[0])*e):(f=Math.abs(h-t[0])*e+n,p=Math.abs(a-t[1])*e+r,g=(t[2]-t[0])*e,w=(t[3]-t[1])*e),this.transform=[c*e,l*e,u*e,d*e,f-c*e*h-u*e*a,p-l*e*h-d*e*a],this.width=g,this.height=w}get rawDims(){const t=this.viewBox;return H(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:i=this.rotation,offsetX:e=this.offsetX,offsetY:s=this.offsetY,dontFlip:n=!1}={}){return new dt({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:i,offsetX:e,offsetY:s,dontFlip:n})}convertToViewportPoint(t,i){const e=[t,i];return it.applyTransform(e,this.transform),e}convertToViewportRectangle(t){const i=[t[0],t[1]];it.applyTransform(i,this.transform);const e=[t[2],t[3]];return it.applyTransform(e,this.transform),[i[0],i[1],e[0],e[1]]}convertToPdfPoint(t,i){const e=[t,i];return it.applyInverseTransform(e,this.transform),e}}class ft extends G{constructor(t,i=0){super(t,"RenderingCancelledException"),this.extraDelay=i}}function pt(t){const i=t.length;let e=0;for(;e<i&&""===t[e].trim();)e++;return"data:"===t.substring(e,e+5).toLowerCase()}function gt(t){return"string"==typeof t&&/\.pdf$/i.test(t)}function wt(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function mt(t,i="document.pdf"){if("string"!=typeof t)return i;if(pt(t))return L('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),i;const e=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,s=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let n=e.exec(s[1])||e.exec(s[2])||e.exec(s[3]);if(n&&(n=n[0],n.includes("%")))try{n=e.exec(decodeURIComponent(n))[0]}catch{}return n||i}class At{started=Object.create(null);times=[];time(t){t in this.started&&L(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||L(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let i=0;for(const{name:t}of this.times)i=Math.max(t.length,i);for(const{name:e,start:s,end:n}of this.times)t.push(`${e.padEnd(i)} ${n-s}ms\n`);return t.join("")}}function vt(t,i){const e=i?URL.parse(t,i):URL.parse(t);return"http:"===e?.protocol||"https:"===e?.protocol}function bt(t){t.preventDefault()}function yt(t){t.preventDefault(),t.stopPropagation()}class xt{static#e;static toDateObject(t){if(!t||"string"!=typeof t)return null;this.#e||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const i=this.#e.exec(t);if(!i)return null;const e=parseInt(i[1],10);let s=parseInt(i[2],10);s=s>=1&&s<=12?s-1:0;let n=parseInt(i[3],10);n=n>=1&&n<=31?n:1;let r=parseInt(i[4],10);r=r>=0&&r<=23?r:0;let o=parseInt(i[5],10);o=o>=0&&o<=59?o:0;let h=parseInt(i[6],10);h=h>=0&&h<=59?h:0;const a=i[7]||"Z";let c=parseInt(i[8],10);c=c>=0&&c<=23?c:0;let l=parseInt(i[9],10)||0;return l=l>=0&&l<=59?l:0,"-"===a?(r+=c,o+=l):"+"===a&&(r-=c,o-=l),new Date(Date.UTC(e,s,n,r,o,h))}}function Mt(t,{scale:i=1,rotation:e=0}){const{width:s,height:n}=t.attributes.style,r=[0,0,parseInt(s),parseInt(n)];return new dt({viewBox:r,userUnit:1,scale:i,rotation:e})}function kt(t){if(t.startsWith("#")){const i=parseInt(t.slice(1),16);return[(16711680&i)>>16,(65280&i)>>8,255&i]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map((t=>parseInt(t))):t.startsWith("rgba(")?t.slice(5,-1).split(",").map((t=>parseInt(t))).slice(0,3):(L(`Not a valid color format: "${t}"`),[0,0,0])}function Et(t){const{a:i,b:e,c:s,d:n,e:r,f:o}=t.getTransform();return[i,e,s,n,r,o]}function St(t){const{a:i,b:e,c:s,d:n,e:r,f:o}=t.getTransform().invertSelf();return[i,e,s,n,r,o]}function _t(t,i,e=!1,s=!0){if(i instanceof dt){const{pageWidth:s,pageHeight:n}=i.rawDims,{style:r}=t,o=Z.isCSSRoundSupported,h=`var(--total-scale-factor) * ${s}px`,a=`var(--total-scale-factor) * ${n}px`,c=o?`round(down, ${h}, var(--scale-round-x))`:`calc(${h})`,l=o?`round(down, ${a}, var(--scale-round-y))`:`calc(${a})`;e&&i.rotation%180!=0?(r.width=l,r.height=c):(r.width=c,r.height=l)}s&&t.setAttribute("data-main-rotation",i.rotation)}class Tt{constructor(){const{pixelRatio:t}=Tt;this.sx=t,this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}limitCanvas(t,i,e,s,n=-1){let r=1/0,o=1/0,h=1/0;(e=Tt.capPixels(e,n))>0&&(r=Math.sqrt(e/(t*i))),-1!==s&&(o=s/t,h=s/i);const a=Math.min(r,o,h);return(this.sx>a||this.sy>a)&&(this.sx=a,this.sy=a,!0)}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,i){if(i>=0){const e=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+i/100));return t>0?Math.min(t,e):e}return t}}const Ct=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class Pt{#s=null;#n=null;#r;#o=null;#h=null;#a=null;static#c=null;constructor(t){this.#r=t,Pt.#c||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const t=this.#s=document.createElement("div");t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const i=this.#r._uiManager._signal;t.addEventListener("contextmenu",bt,{signal:i}),t.addEventListener("pointerdown",Pt.#l,{signal:i});const e=this.#o=document.createElement("div");e.className="buttons",t.append(e);const s=this.#r.toolbarPosition;if(s){const{style:i}=t,e="ltr"===this.#r._uiManager.direction?1-s[0]:s[0];i.insetInlineEnd=100*e+"%",i.top=`calc(${100*s[1]}% + var(--editor-toolbar-vert-offset))`}return this.#u(),t}get div(){return this.#s}static#l(t){t.stopPropagation()}#d(t){this.#r._focusEventsAllowed=!1,yt(t)}#f(t){this.#r._focusEventsAllowed=!0,yt(t)}#p(t){const i=this.#r._uiManager._signal;t.addEventListener("focusin",this.#d.bind(this),{capture:!0,signal:i}),t.addEventListener("focusout",this.#f.bind(this),{capture:!0,signal:i}),t.addEventListener("contextmenu",bt,{signal:i})}hide(){this.#s.classList.add("hidden"),this.#n?.hideDropdown()}show(){this.#s.classList.remove("hidden"),this.#h?.shown()}#u(){const{editorType:t,_uiManager:i}=this.#r,e=document.createElement("button");e.className="delete",e.tabIndex=0,e.setAttribute("data-l10n-id",Pt.#c[t]),this.#p(e),e.addEventListener("click",(()=>{i.delete()}),{signal:i._signal}),this.#o.append(e)}get#g(){const t=document.createElement("div");return t.className="divider",t}async addAltText(t){const i=await t.render();this.#p(i),this.#o.prepend(i,this.#g),this.#h=t}addColorPicker(t){this.#n=t;const i=t.renderButton();this.#p(i),this.#o.prepend(i,this.#g)}async addEditSignatureButton(t){const i=this.#a=await t.renderEditButton(this.#r);this.#p(i),this.#o.prepend(i,this.#g)}updateEditSignatureButton(t){this.#a&&(this.#a.title=t)}remove(){this.#s.remove(),this.#n?.destroy(),this.#n=null}}class Rt{#o=null;#s=null;#w;constructor(t){this.#w=t}#m(){const t=this.#s=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",bt,{signal:this.#w._signal});const i=this.#o=document.createElement("div");return i.className="buttons",t.append(i),this.#A(),t}#v(t,i){let e=0,s=0;for(const n of t){const t=n.y+n.height;if(t<e)continue;const r=n.x+(i?n.width:0);t>e?(s=r,e=t):i?r>s&&(s=r):r<s&&(s=r)}return[i?1-s:s,e]}show(t,i,e){const[s,n]=this.#v(i,e),{style:r}=this.#s||=this.#m();t.append(this.#s),r.insetInlineEnd=100*s+"%",r.top=`calc(${100*n}% + var(--editor-toolbar-vert-offset))`}hide(){this.#s.remove()}#A(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const i=document.createElement("span");t.append(i),i.className="visuallyHidden",i.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const e=this.#w._signal;t.addEventListener("contextmenu",bt,{signal:e}),t.addEventListener("click",(()=>{this.#w.highlightSelection("floating_button")}),{signal:e}),this.#o.append(t)}}function Nt(t,i,e){for(const s of e)i.addEventListener(s,t[s].bind(t))}class Dt{#b=0;get id(){return"pdfjs_internal_editor_"+this.#b++}}class It{#y=rt();#b=0;#x=null;static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;return i.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',H(this,"_isSVGFittingCanvas",i.decode().then((()=>(t.drawImage(i,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]))))}async#M(t,i){this.#x||=new Map;let e=this.#x.get(t);if(null===e)return null;if(e?.bitmap)return e.refCounter+=1,e;try{let t;if(e||={bitmap:null,id:`image_${this.#y}_${this.#b++}`,refCounter:0,isSvg:!1},"string"==typeof i?(e.url=i,t=await ut(i,"blob")):i instanceof File?t=e.file=i:i instanceof Blob&&(t=i),"image/svg+xml"===t.type){const i=It._isSVGFittingCanvas,s=new FileReader,n=new Image,r=new Promise(((t,r)=>{n.onload=()=>{e.bitmap=n,e.isSvg=!0,t()},s.onload=async()=>{const t=e.svgUrl=s.result;n.src=await i?`${t}#svgView(preserveAspectRatio(none))`:t},n.onerror=s.onerror=r}));s.readAsDataURL(t),await r}else e.bitmap=await createImageBitmap(t);e.refCounter=1}catch(t){L(t),e=null}return this.#x.set(t,e),e&&this.#x.set(e.id,e),e}async getFromFile(t){const{lastModified:i,name:e,size:s,type:n}=t;return this.#M(`${i}_${e}_${s}_${n}`,t)}async getFromUrl(t){return this.#M(t,t)}async getFromBlob(t,i){const e=await i;return this.#M(t,e)}async getFromId(t){this.#x||=new Map;const i=this.#x.get(t);if(!i)return null;if(i.bitmap)return i.refCounter+=1,i;if(i.file)return this.getFromFile(i.file);if(i.blobPromise){const{blobPromise:t}=i;return delete i.blobPromise,this.getFromBlob(i.id,t)}return this.getFromUrl(i.url)}getFromCanvas(t,i){this.#x||=new Map;let e=this.#x.get(t);if(e?.bitmap)return e.refCounter+=1,e;const s=new OffscreenCanvas(i.width,i.height);return s.getContext("2d").drawImage(i,0,0),e={bitmap:s.transferToImageBitmap(),id:`image_${this.#y}_${this.#b++}`,refCounter:1,isSvg:!1},this.#x.set(t,e),this.#x.set(e.id,e),e}getSvgUrl(t){const i=this.#x.get(t);return i?.isSvg?i.svgUrl:null}deleteId(t){this.#x||=new Map;const i=this.#x.get(t);if(!i)return;if(i.refCounter-=1,0!==i.refCounter)return;const{bitmap:e}=i;if(!i.url&&!i.file){const t=new OffscreenCanvas(e.width,e.height);t.getContext("bitmaprenderer").transferFromImageBitmap(e),i.blobPromise=t.convertToBlob()}e.close?.(),i.bitmap=null}isValidId(t){return t.startsWith(`image_${this.#y}_`)}}class Ft{#k=[];#E=!1;#S;#_=-1;constructor(t=128){this.#S=t}add({cmd:t,undo:i,post:e,mustExec:s,type:n=NaN,overwriteIfSameType:r=!1,keepUndo:o=!1}){if(s&&t(),this.#E)return;const h={cmd:t,undo:i,post:e,type:n};if(-1===this.#_)return this.#k.length>0&&(this.#k.length=0),this.#_=0,void this.#k.push(h);if(r&&this.#k[this.#_].type===n)return o&&(h.undo=this.#k[this.#_].undo),void(this.#k[this.#_]=h);const a=this.#_+1;a===this.#S?this.#k.splice(0,1):(this.#_=a,a<this.#k.length&&this.#k.splice(a)),this.#k.push(h)}undo(){if(-1===this.#_)return;this.#E=!0;const{undo:t,post:i}=this.#k[this.#_];t(),i?.(),this.#E=!1,this.#_-=1}redo(){if(this.#_<this.#k.length-1){this.#_+=1,this.#E=!0;const{cmd:t,post:i}=this.#k[this.#_];t(),i?.(),this.#E=!1}}hasSomethingToUndo(){return-1!==this.#_}hasSomethingToRedo(){return this.#_<this.#k.length-1}cleanType(t){if(-1!==this.#_){for(let i=this.#_;i>=0;i--)if(this.#k[i].type!==t)return this.#k.splice(i+1,this.#_-i),void(this.#_=i);this.#k.length=0,this.#_=-1}}destroy(){this.#k=null}}class Ot{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:i}=Z.platform;for(const[e,s,n={}]of t)for(const t of e){const e=t.startsWith("mac+");i&&e?(this.callbacks.set(t.slice(4),{callback:s,options:n}),this.allKeys.add(t.split("+").at(-1))):i||e||(this.callbacks.set(t,{callback:s,options:n}),this.allKeys.add(t.split("+").at(-1)))}}#T(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const i=this.buffer.join("+");return this.buffer.length=0,i}exec(t,i){if(!this.allKeys.has(i.key))return;const e=this.callbacks.get(this.#T(i));if(!e)return;const{callback:s,options:{bubbles:n=!1,args:r=[],checker:o=null}}=e;o&&!o(t,i)||(s.bind(t,...r,i)(),n||yt(i))}}class $t{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const i=document.createElement("span");i.style.visibility="hidden",i.style.colorScheme="only light",document.body.append(i);for(const e of t.keys()){i.style.color=e;const s=window.getComputedStyle(i).color;t.set(e,kt(s))}i.remove()}(t),H(this,"_colors",t)}convert(t){const i=kt(t);if(!window.matchMedia("(forced-colors: active)").matches)return i;for(const[t,e]of this._colors)if(e.every(((t,e)=>t===i[e])))return $t._colorsMapping.get(t);return i}getHexCode(t){const i=this._colors.get(t);return i?it.makeHexColor(...i):t}}class Lt{#C=new AbortController;#P=null;#R=new Map;#N=new Map;#D=null;#I=null;#F=null;#O=new Ft;#$=null;#L=null;#B=0;#j=new Set;#U=null;#z=null;#H=new Set;_editorUndoBar=null;#G=!1;#W=!1;#V=!1;#X=null;#Y=null;#Q=null;#q=null;#K=!1;#J=null;#Z=new Dt;#tt=!1;#it=!1;#et=null;#st=null;#nt=null;#rt=null;#ot=null;#ht=S.NONE;#at=new Set;#ct=null;#lt=null;#ut=null;#dt=null;#ft={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#pt=[0,0];#gt=null;#wt=null;#mt=null;#At=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=Lt.prototype,i=t=>t.#wt.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),e=(t,{target:i})=>{if(i instanceof HTMLInputElement){const{type:t}=i;return"text"!==t&&"number"!==t}return!0},s=this.TRANSLATE_SMALL,n=this.TRANSLATE_BIG;return H(this,"_keyboardManager",new Ot([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:e}],[["ctrl+z","mac+meta+z"],t.undo,{checker:e}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:e}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:e}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(t,{target:i})=>!(i instanceof HTMLButtonElement)&&t.#wt.contains(i)&&!t.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,{target:i})=>!(i instanceof HTMLButtonElement)&&t.#wt.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:i}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:i}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:i}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:i}]]))}constructor(t,i,e,s,n,r,o,h,a,c,l,u,d,f){const p=this._signal=this.#C.signal;this.#wt=t,this.#mt=i,this.#D=e,this.#lt=s,this._eventBus=n,n._on("editingaction",this.onEditingAction.bind(this),{signal:p}),n._on("pagechanging",this.onPageChanging.bind(this),{signal:p}),n._on("scalechanging",this.onScaleChanging.bind(this),{signal:p}),n._on("rotationchanging",this.onRotationChanging.bind(this),{signal:p}),n._on("setpreference",this.onSetPreference.bind(this),{signal:p}),n._on("switchannotationeditorparams",(t=>this.updateParams(t.type,t.value)),{signal:p}),this.#vt(),this.#bt(),this.#yt(),this.#I=r.annotationStorage,this.#X=r.filterFactory,this.#ut=o,this.#q=h||null,this.#G=a,this.#W=c,this.#V=l,this.#ot=u||null,this.viewParameters={realScale:lt.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=d||null,this._supportsPinchToZoom=!1!==f}destroy(){this.#At?.resolve(),this.#At=null,this.#C?.abort(),this.#C=null,this._signal=null;for(const t of this.#N.values())t.destroy();this.#N.clear(),this.#R.clear(),this.#H.clear(),this.#rt?.clear(),this.#P=null,this.#at.clear(),this.#O.destroy(),this.#D?.destroy(),this.#lt?.destroy(),this.#J?.hide(),this.#J=null,this.#nt?.destroy(),this.#nt=null,this.#Y&&(clearTimeout(this.#Y),this.#Y=null),this.#gt&&(clearTimeout(this.#gt),this.#gt=null),this._editorUndoBar?.destroy()}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#ot}get useNewAltTextFlow(){return this.#W}get useNewAltTextWhenAddingImage(){return this.#V}get hcmFilter(){return H(this,"hcmFilter",this.#ut?this.#X.addHCMFilter(this.#ut.foreground,this.#ut.background):"none")}get direction(){return H(this,"direction",getComputedStyle(this.#wt).direction)}get highlightColors(){return H(this,"highlightColors",this.#q?new Map(this.#q.split(",").map((t=>t.split("=").map((t=>t.trim()))))):null)}get highlightColorNames(){return H(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,(t=>t.reverse()))):null)}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#L=t}setMainHighlightColorPicker(t){this.#nt=t}editAltText(t,i=!1){this.#D?.editAltText(this,t,i)}getSignature(t){this.#lt?.getSignature({uiManager:this,editor:t})}get signatureManager(){return this.#lt}switchToMode(t,i){this._eventBus.on("annotationeditormodechanged",i,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,i){this._eventBus.dispatch("setpreference",{source:this,name:t,value:i})}onSetPreference({name:t,value:i}){"enableNewAltTextWhenAddingImage"===t&&(this.#V=i)}onPageChanging({pageNumber:t}){this.#B=t-1}focusMainContainer(){this.#wt.focus()}findParent(t,i){for(const e of this.#N.values()){const{x:s,y:n,width:r,height:o}=e.div.getBoundingClientRect();if(t>=s&&t<=s+r&&i>=n&&i<=n+o)return e}return null}disableUserSelect(t=!1){this.#mt.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#H.add(t)}removeShouldRescale(t){this.#H.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*lt.PDF_TO_CSS_UNITS;for(const t of this.#H)t.onScaleChanging();this.#L?.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#xt({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}#Mt(t){const{currentLayer:i}=this;if(i.hasTextLayer(t))return i;for(const i of this.#N.values())if(i.hasTextLayer(t))return i;return null}highlightSelection(t=""){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:e,anchorOffset:s,focusNode:n,focusOffset:r}=i,o=i.toString(),h=this.#xt(i).closest(".textLayer"),a=this.getSelectionBoxes(h);if(!a)return;i.empty();const c=this.#Mt(h),l=this.#ht===S.NONE,u=()=>{c?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:a,anchorNode:e,anchorOffset:s,focusNode:n,focusOffset:r,text:o}),l&&this.showAllEditors("highlight",!0,!0)};l?this.switchToMode(S.HIGHLIGHT,u):u()}#kt(){const t=document.getSelection();if(!t||t.isCollapsed)return;const i=this.#xt(t).closest(".textLayer"),e=this.getSelectionBoxes(i);e&&(this.#J||=new Rt(this),this.#J.show(i,e,"ltr"===this.direction))}addToAnnotationStorage(t){t.isEmpty()||!this.#I||this.#I.has(t.id)||this.#I.setValue(t.id,t)}#Et(){const t=document.getSelection();if(!t||t.isCollapsed)return void(this.#ct&&(this.#J?.hide(),this.#ct=null,this.#St({hasSelectedText:!1})));const{anchorNode:i}=t;if(i===this.#ct)return;const e=this.#xt(t).closest(".textLayer");if(e){if(this.#J?.hide(),this.#ct=i,this.#St({hasSelectedText:!0}),(this.#ht===S.HIGHLIGHT||this.#ht===S.NONE)&&(this.#ht===S.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#K=this.isShiftKeyDown,!this.isShiftKeyDown)){const t=this.#ht===S.HIGHLIGHT?this.#Mt(e):null;t?.toggleDrawing();const i=new AbortController,s=this.combinedSignal(i),n=e=>{"pointerup"===e.type&&0!==e.button||(i.abort(),t?.toggleDrawing(!0),"pointerup"===e.type&&this.#_t("main_toolbar"))};window.addEventListener("pointerup",n,{signal:s}),window.addEventListener("blur",n,{signal:s})}}else this.#ct&&(this.#J?.hide(),this.#ct=null,this.#St({hasSelectedText:!1}))}#_t(t=""){this.#ht===S.HIGHLIGHT?this.highlightSelection(t):this.#G&&this.#kt()}#vt(){document.addEventListener("selectionchange",this.#Et.bind(this),{signal:this._signal})}#Tt(){if(this.#Q)return;this.#Q=new AbortController;const t=this.combinedSignal(this.#Q);window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}#Ct(){this.#Q?.abort(),this.#Q=null}blur(){if(this.isShiftKeyDown=!1,this.#K&&(this.#K=!1,this.#_t("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const i of this.#at)if(i.div.contains(t)){this.#st=[i,t],i._focusEventsAllowed=!1;break}}focus(){if(!this.#st)return;const[t,i]=this.#st;this.#st=null,i.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:this._signal}),i.focus()}#yt(){if(this.#et)return;this.#et=new AbortController;const t=this.combinedSignal(this.#et);window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#Pt(){this.#et?.abort(),this.#et=null}#Rt(){if(this.#$)return;this.#$=new AbortController;const t=this.combinedSignal(this.#$);document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}#Nt(){this.#$?.abort(),this.#$=null}#bt(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#yt(),this.#Rt()}removeEditListeners(){this.#Pt(),this.#Nt()}dragOver(t){for(const{type:i}of t.dataTransfer.items)for(const e of this.#z)if(e.isHandlingMimeForPasting(i))return t.dataTransfer.dropEffect="copy",void t.preventDefault()}drop(t){for(const i of t.dataTransfer.items)for(const e of this.#z)if(e.isHandlingMimeForPasting(i.type))return e.paste(i,this.currentLayer),void t.preventDefault()}copy(t){if(t.preventDefault(),this.#P?.commitOrRemove(),!this.hasSelection)return;const i=[];for(const t of this.#at){const e=t.serialize(!0);e&&i.push(e)}0!==i.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:i}=t;for(const t of i.items)for(const i of this.#z)if(i.isHandlingMimeForPasting(t.type))return void i.paste(t,this.currentLayer);let e=i.getData("application/pdfjs");if(!e)return;try{e=JSON.parse(e)}catch(t){return void L(`paste: "${t.message}".`)}if(!Array.isArray(e))return;this.unselectAll();const s=this.currentLayer;try{const t=[];for(const i of e){const e=await s.deserialize(i);if(!e)return;t.push(e)}this.addCommands({cmd:()=>{for(const i of t)this.#Dt(i);this.#It(t)},undo:()=>{for(const i of t)i.remove()},mustExec:!0})}catch(t){L(`paste: "${t.message}".`)}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),this.#ht===S.NONE||this.isEditorHandlingKeyboard||Lt._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,this.#K&&(this.#K=!1,this.#_t("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu")}}#St(t){Object.entries(t).some((([t,i])=>this.#ft[t]!==i))&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#ft,t)}),this.#ht===S.HIGHLIGHT&&!1===t.hasSelectedEditor&&this.#Ft([[_.HIGHLIGHT_FREE,!0]]))}#Ft(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#Tt(),this.#Rt(),this.#St({isEditing:this.#ht!==S.NONE,isEmpty:this.#Ot(),hasSomethingToUndo:this.#O.hasSomethingToUndo(),hasSomethingToRedo:this.#O.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#Ct(),this.#Nt(),this.#St({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#z){this.#z=t;for(const t of this.#z)this.#Ft(t.defaultPropertiesToUpdate)}}getId(){return this.#Z.id}get currentLayer(){return this.#N.get(this.#B)}getLayer(t){return this.#N.get(t)}get currentPageIndex(){return this.#B}addLayer(t){this.#N.set(t.pageIndex,t),this.#tt?t.enable():t.disable()}removeLayer(t){this.#N.delete(t.pageIndex)}async updateMode(t,i=null,e=!1){if(this.#ht!==t&&(!this.#At||(await this.#At.promise,this.#At))){if(this.#At=Promise.withResolvers(),this.#L?.commitOrRemove(),this.#ht=t,t===S.NONE)return this.setEditingState(!1),this.#$t(),this._editorUndoBar?.hide(),void this.#At.resolve();t===S.SIGNATURE&&await(this.#lt?.loadSignatures()),this.setEditingState(!0),await this.#Lt(),this.unselectAll();for(const i of this.#N.values())i.updateMode(t);if(!i)return e&&this.addNewEditorFromKeyboard(),void this.#At.resolve();for(const t of this.#R.values())t.annotationElementId===i||t.id===i?(this.setSelected(t),t.enterInEditMode()):t.unselect();this.#At.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==this.#ht&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,i){if(this.#z){switch(t){case _.CREATE:return void this.currentLayer.addNewEditor(i);case _.HIGHLIGHT_DEFAULT_COLOR:this.#nt?.updateColor(i);break;case _.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#dt||=new Map).set(t,i),this.showAllEditors("highlight",i)}for(const e of this.#at)e.updateParams(t,i);for(const e of this.#z)e.updateDefaultParams(t,i)}}showAllEditors(t,i,e=!1){for(const e of this.#R.values())e.editorType===t&&e.show(i);(this.#dt?.get(_.HIGHLIGHT_SHOW_ALL)??!0)!==i&&this.#Ft([[_.HIGHLIGHT_SHOW_ALL,i]])}enableWaiting(t=!1){if(this.#it!==t){this.#it=t;for(const i of this.#N.values())t?i.disableClick():i.enableClick(),i.div.classList.toggle("waiting",t)}}async#Lt(){if(!this.#tt){this.#tt=!0;const t=[];for(const i of this.#N.values())t.push(i.enable());await Promise.all(t);for(const t of this.#R.values())t.enable()}}#$t(){if(this.unselectAll(),this.#tt){this.#tt=!1;for(const t of this.#N.values())t.disable();for(const t of this.#R.values())t.disable()}}getEditors(t){const i=[];for(const e of this.#R.values())e.pageIndex===t&&i.push(e);return i}getEditor(t){return this.#R.get(t)}addEditor(t){this.#R.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#Y&&clearTimeout(this.#Y),this.#Y=setTimeout((()=>{this.focusMainContainer(),this.#Y=null}),0)),this.#R.delete(t.id),t.annotationElementId&&this.#rt?.delete(t.annotationElementId),this.unselect(t),t.annotationElementId&&this.#j.has(t.annotationElementId)||this.#I?.remove(t.id)}addDeletedAnnotationElement(t){this.#j.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#j.has(t)}removeDeletedAnnotationElement(t){this.#j.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#Dt(t){const i=this.#N.get(t.pageIndex);i?i.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#P!==t&&(this.#P=t,t&&this.#Ft(t.propertiesToUpdate))}get#Bt(){let t=null;for(t of this.#at);return t}updateUI(t){this.#Bt===t&&this.#Ft(t.propertiesToUpdate)}updateUIForDefaultProperties(t){this.#Ft(t.defaultPropertiesToUpdate)}toggleSelected(t){if(this.#at.has(t))return this.#at.delete(t),t.unselect(),void this.#St({hasSelectedEditor:this.hasSelection});this.#at.add(t),t.select(),this.#Ft(t.propertiesToUpdate),this.#St({hasSelectedEditor:!0})}setSelected(t){this.#L?.commitOrRemove();for(const i of this.#at)i!==t&&i.unselect();this.#at.clear(),this.#at.add(t),t.select(),this.#Ft(t.propertiesToUpdate),this.#St({hasSelectedEditor:!0})}isSelected(t){return this.#at.has(t)}get firstSelectedEditor(){return this.#at.values().next().value}unselect(t){t.unselect(),this.#at.delete(t),this.#St({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#at.size}get isEnterHandled(){return 1===this.#at.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#O.undo(),this.#St({hasSomethingToUndo:this.#O.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Ot()}),this._editorUndoBar?.hide()}redo(){this.#O.redo(),this.#St({hasSomethingToUndo:!0,hasSomethingToRedo:this.#O.hasSomethingToRedo(),isEmpty:this.#Ot()})}addCommands(t){this.#O.add(t),this.#St({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Ot()})}cleanUndoStack(t){this.#O.cleanType(t)}#Ot(){if(0===this.#R.size)return!0;if(1===this.#R.size)for(const t of this.#R.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();const t=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const i=t?[t]:[...this.#at],e=()=>{for(const t of i)this.#Dt(t)};this.addCommands({cmd:()=>{this._editorUndoBar?.show(e,1===i.length?i[0].editorType:i.length);for(const t of i)t.remove()},undo:e,mustExec:!0})}commitOrRemove(){this.#P?.commitOrRemove()}hasSomethingToControl(){return this.#P||this.hasSelection}#It(t){for(const t of this.#at)t.unselect();this.#at.clear();for(const i of t)i.isEmpty()||(this.#at.add(i),i.select());this.#St({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#at)t.commit();this.#It(this.#R.values())}unselectAll(){if((!this.#P||(this.#P.commitOrRemove(),this.#ht===S.NONE))&&!this.#L?.commitOrRemove()&&this.hasSelection){for(const t of this.#at)t.unselect();this.#at.clear(),this.#St({hasSelectedEditor:!1})}}translateSelectedEditors(t,i,e=!1){if(e||this.commitOrRemove(),!this.hasSelection)return;this.#pt[0]+=t,this.#pt[1]+=i;const[s,n]=this.#pt,r=[...this.#at];this.#gt&&clearTimeout(this.#gt),this.#gt=setTimeout((()=>{this.#gt=null,this.#pt[0]=this.#pt[1]=0,this.addCommands({cmd:()=>{for(const t of r)this.#R.has(t.id)&&(t.translateInPage(s,n),t.translationDone())},undo:()=>{for(const t of r)this.#R.has(t.id)&&(t.translateInPage(-s,-n),t.translationDone())},mustExec:!1})}),1e3);for(const e of r)e.translateInPage(t,i),e.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#U=new Map;for(const t of this.#at)this.#U.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#U)return!1;this.disableUserSelect(!1);const t=this.#U;this.#U=null;let i=!1;for(const[{x:e,y:s,pageIndex:n},r]of t)r.newX=e,r.newY=s,r.newPageIndex=n,i||=e!==r.savedX||s!==r.savedY||n!==r.savedPageIndex;if(!i)return!1;const e=(t,i,e,s)=>{if(this.#R.has(t.id)){const n=this.#N.get(s);n?t._setParentAndPosition(n,i,e):(t.pageIndex=s,t.x=i,t.y=e)}};return this.addCommands({cmd:()=>{for(const[i,{newX:s,newY:n,newPageIndex:r}]of t)e(i,s,n,r)},undo:()=>{for(const[i,{savedX:s,savedY:n,savedPageIndex:r}]of t)e(i,s,n,r)},mustExec:!0}),!0}dragSelectedEditors(t,i){if(this.#U)for(const e of this.#U.keys())e.drag(t,i)}rebuild(t){if(null===t.parent){const i=this.getLayer(t.pageIndex);i?(i.changeParent(t),i.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#at.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#P===t}getActive(){return this.#P}getMode(){return this.#ht}get imageManager(){return H(this,"imageManager",new It)}getSelectionBoxes(t){if(!t)return null;const i=document.getSelection();for(let e=0,s=i.rangeCount;e<s;e++)if(!t.contains(i.getRangeAt(e).commonAncestorContainer))return null;const{x:e,y:s,width:n,height:r}=t.getBoundingClientRect();let o;switch(t.getAttribute("data-main-rotation")){case"90":o=(t,i,o,h)=>({x:(i-s)/r,y:1-(t+o-e)/n,width:h/r,height:o/n});break;case"180":o=(t,i,o,h)=>({x:1-(t+o-e)/n,y:1-(i+h-s)/r,width:o/n,height:h/r});break;case"270":o=(t,i,o,h)=>({x:1-(i+h-s)/r,y:(t-e)/n,width:h/r,height:o/n});break;default:o=(t,i,o,h)=>({x:(t-e)/n,y:(i-s)/r,width:o/n,height:h/r})}const h=[];for(let t=0,e=i.rangeCount;t<e;t++){const e=i.getRangeAt(t);if(!e.collapsed)for(const{x:t,y:i,width:s,height:n}of e.getClientRects())0!==s&&0!==n&&h.push(o(t,i,s,n))}return 0===h.length?null:h}addChangedExistingAnnotation({annotationElementId:t,id:i}){(this.#F||=new Map).set(t,i)}removeChangedExistingAnnotation({annotationElementId:t}){this.#F?.delete(t)}renderAnnotationElement(t){const i=this.#F?.get(t.data.id);if(!i)return;const e=this.#I.getRawValue(i);e&&(this.#ht!==S.NONE||e.hasBeenModified)&&e.renderAnnotationElement(t)}setMissingCanvas(t,i,e){const s=this.#rt?.get(t);s&&(s.setCanvas(i,e),this.#rt.delete(t))}addMissingCanvas(t,i){(this.#rt||=new Map).set(t,i)}}class Bt{#h=null;#jt=!1;#Ut=null;#zt=null;#Ht=null;#Gt=null;#Wt=!1;#Vt=null;#r=null;#Xt=null;#Yt=null;#Qt=!1;static#qt=null;static _l10n=null;constructor(t){this.#r=t,this.#Qt=t._uiManager.useNewAltTextFlow,Bt.#qt||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(t){Bt._l10n??=t}async render(){const t=this.#Ut=document.createElement("button");t.className="altText",t.tabIndex="0";const i=this.#zt=document.createElement("span");t.append(i),this.#Qt?(t.classList.add("new"),t.setAttribute("data-l10n-id",Bt.#qt.missing),i.setAttribute("data-l10n-id",Bt.#qt["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const e=this.#r._uiManager._signal;t.addEventListener("contextmenu",bt,{signal:e}),t.addEventListener("pointerdown",(t=>t.stopPropagation()),{signal:e});const s=t=>{t.preventDefault(),this.#r._uiManager.editAltText(this.#r),this.#Qt&&this.#r._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#Kt}})};return t.addEventListener("click",s,{capture:!0,signal:e}),t.addEventListener("keydown",(i=>{i.target===t&&"Enter"===i.key&&(this.#Wt=!0,s(i))}),{signal:e}),await this.#Jt(),t}get#Kt(){return(this.#h?"added":null===this.#h&&this.guessedText&&"review")||"missing"}finish(){this.#Ut&&(this.#Ut.focus({focusVisible:this.#Wt}),this.#Wt=!1)}isEmpty(){return this.#Qt?null===this.#h:!this.#h&&!this.#jt}hasData(){return this.#Qt?null!==this.#h||!!this.#Xt:this.isEmpty()}get guessedText(){return this.#Xt}async setGuessedText(t){null===this.#h&&(this.#Xt=t,this.#Yt=await Bt._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t}),this.#Jt())}toggleAltTextBadge(t=!1){if(!this.#Qt||this.#h)return this.#Vt?.remove(),void(this.#Vt=null);if(!this.#Vt){const t=this.#Vt=document.createElement("div");t.className="noAltTextBadge",this.#r.div.append(t)}this.#Vt.classList.toggle("hidden",!t)}serialize(t){let i=this.#h;return t||this.#Xt!==i||(i=this.#Yt),{altText:i,decorative:this.#jt,guessedText:this.#Xt,textWithDisclaimer:this.#Yt}}get data(){return{altText:this.#h,decorative:this.#jt}}set data({altText:t,decorative:i,guessedText:e,textWithDisclaimer:s,cancel:n=!1}){e&&(this.#Xt=e,this.#Yt=s),this.#h===t&&this.#jt===i||(n||(this.#h=t,this.#jt=i),this.#Jt())}toggle(t=!1){this.#Ut&&(!t&&this.#Gt&&(clearTimeout(this.#Gt),this.#Gt=null),this.#Ut.disabled=!t)}shown(){this.#r._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#Kt}})}destroy(){this.#Ut?.remove(),this.#Ut=null,this.#zt=null,this.#Ht=null,this.#Vt?.remove(),this.#Vt=null}async#Jt(){const t=this.#Ut;if(!t)return;if(this.#Qt){if(t.classList.toggle("done",!!this.#h),t.setAttribute("data-l10n-id",Bt.#qt[this.#Kt]),this.#zt?.setAttribute("data-l10n-id",Bt.#qt[`${this.#Kt}-label`]),!this.#h)return void this.#Ht?.remove()}else{if(!this.#h&&!this.#jt)return t.classList.remove("done"),void this.#Ht?.remove();t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let i=this.#Ht;if(!i){this.#Ht=i=document.createElement("span"),i.className="tooltip",i.setAttribute("role","tooltip"),i.id=`alt-text-tooltip-${this.#r.id}`;const e=100,s=this.#r._uiManager._signal;s.addEventListener("abort",(()=>{clearTimeout(this.#Gt),this.#Gt=null}),{once:!0}),t.addEventListener("mouseenter",(()=>{this.#Gt=setTimeout((()=>{this.#Gt=null,this.#Ht.classList.add("show"),this.#r._reportTelemetry({action:"alt_text_tooltip"})}),e)}),{signal:s}),t.addEventListener("mouseleave",(()=>{this.#Gt&&(clearTimeout(this.#Gt),this.#Gt=null),this.#Ht?.classList.remove("show")}),{signal:s})}this.#jt?i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(i.removeAttribute("data-l10n-id"),i.textContent=this.#h),i.parentNode||t.append(i);const e=this.#r.getElementForAltText();e?.setAttribute("aria-describedby",i.id)}}class jt{#wt;#Zt=!1;#ti=null;#ii;#ei;#si;#ni;#ri=null;#oi;#hi=null;#ai;#ci=null;constructor({container:t,isPinchingDisabled:i=null,isPinchingStopped:e=null,onPinchStart:s=null,onPinching:n=null,onPinchEnd:r=null,signal:o}){this.#wt=t,this.#ti=e,this.#ii=i,this.#ei=s,this.#si=n,this.#ni=r,this.#ai=new AbortController,this.#oi=AbortSignal.any([o,this.#ai.signal]),t.addEventListener("touchstart",this.#li.bind(this),{passive:!1,signal:this.#oi})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Tt.pixelRatio}#li(t){if(this.#ii?.())return;if(1===t.touches.length){if(this.#ri)return;const t=this.#ri=new AbortController,i=AbortSignal.any([this.#oi,t.signal]),e=this.#wt,s={capture:!0,signal:i,passive:!1},n=t=>{"touch"===t.pointerType&&(this.#ri?.abort(),this.#ri=null)};return e.addEventListener("pointerdown",(t=>{"touch"===t.pointerType&&(yt(t),n(t))}),s),e.addEventListener("pointerup",n,s),void e.addEventListener("pointercancel",n,s)}if(!this.#ci){this.#ci=new AbortController;const t=AbortSignal.any([this.#oi,this.#ci.signal]),i=this.#wt,e={signal:t,capture:!1,passive:!1};i.addEventListener("touchmove",this.#ui.bind(this),e);const s=this.#di.bind(this);i.addEventListener("touchend",s,e),i.addEventListener("touchcancel",s,e),e.capture=!0,i.addEventListener("pointerdown",yt,e),i.addEventListener("pointermove",yt,e),i.addEventListener("pointercancel",yt,e),i.addEventListener("pointerup",yt,e),this.#ei?.()}if(yt(t),2!==t.touches.length||this.#ti?.())return void(this.#hi=null);let[i,e]=t.touches;i.identifier>e.identifier&&([i,e]=[e,i]),this.#hi={touch0X:i.screenX,touch0Y:i.screenY,touch1X:e.screenX,touch1Y:e.screenY}}#ui(t){if(!this.#hi||2!==t.touches.length)return;yt(t);let[i,e]=t.touches;i.identifier>e.identifier&&([i,e]=[e,i]);const{screenX:s,screenY:n}=i,{screenX:r,screenY:o}=e,h=this.#hi,{touch0X:a,touch0Y:c,touch1X:l,touch1Y:u}=h,d=l-a,f=u-c,p=Math.hypot(r-s,o-n)||1,g=Math.hypot(d,f)||1;if(!this.#Zt&&Math.abs(g-p)<=jt.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(h.touch0X=s,h.touch0Y=n,h.touch1X=r,h.touch1Y=o,!this.#Zt)return void(this.#Zt=!0);const w=[(s+r)/2,(n+o)/2];this.#si?.(w,g,p)}#di(t){t.touches.length>=2||(this.#ci&&(this.#ci.abort(),this.#ci=null,this.#ni?.()),this.#hi&&(yt(t),this.#hi=null,this.#Zt=!1))}destroy(){this.#ai?.abort(),this.#ai=null,this.#ri?.abort(),this.#ri=null}}class Ut{#fi=null;#pi=null;#h=null;#gi=!1;#wi=null;#mi="";#Ai=!1;#vi=null;#bi=null;#yi=null;#xi=null;#Mi="";#ki=!1;#Ei=null;#Si=!1;#_i=!1;#Ti=!1;#Ci=null;#Pi=0;#Ri=0;#Ni=null;#Di=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#Ii=!1;#Fi=Ut._zIndex++;static _borderLineWidth=-1;static _colorManager=new $t;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=Ut.prototype._resizeWithKeyboard,i=Lt.TRANSLATE_SMALL,e=Lt.TRANSLATE_BIG;return H(this,"_resizerKeyboardManager",new Ot([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-i,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-e,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[i,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[e,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-i]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-e]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,i]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,e]}],[["Escape","mac+Escape"],Ut.prototype._stopResizingWithKeyboard]]))}constructor(t){this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:i,rawDims:{pageWidth:e,pageHeight:s,pageX:n,pageY:r}}=this.parent.viewport;this.rotation=i,this.pageRotation=(360+i-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[e,s],this.pageTranslation=[n,r];const[o,h]=this.parentDimensions;this.x=t.x/o,this.y=t.y/h,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get isDrawer(){return!1}static get _defaultLineColor(){return H(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const i=new zt({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});i.annotationElementId=t.annotationElementId,i.deleted=!0,i._uiManager.addToAnnotationStorage(i)}static initialize(t,i){if(Ut._l10n??=t,Ut._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),-1!==Ut._borderLineWidth)return;const e=getComputedStyle(document.documentElement);Ut._borderLineWidth=parseFloat(e.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,i){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,i){B("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#Ii}set _isDraggable(t){this.#Ii=t,this.div?.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,i]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*i/(2*t),this.y+=this.width*t/(2*i);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*i/(2*t),this.y-=this.width*t/(2*i);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#Fi}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#Oi(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#ki?this.#ki=!1:this.parent.setSelected(this))}focusout(t){if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const i=t.relatedTarget;i?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,i,e,s){const[n,r]=this.parentDimensions;[e,s]=this.screenToPageTranslation(e,s),this.x=(t+e)/n,this.y=(i+s)/r,this.fixAndSetPosition()}_moveAfterPaste(t,i){const[e,s]=this.parentDimensions;this.setAt(t*e,i*s,this.width*e,this.height*s),this._onTranslated()}#$i([t,i],e,s){[e,s]=this.screenToPageTranslation(e,s),this.x+=e/t,this.y+=s/i,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(t,i){this.#$i(this.parentDimensions,t,i)}translateInPage(t,i){this.#Ei||=[this.x,this.y,this.width,this.height],this.#$i(this.pageDimensions,t,i),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,i){this.#Ei||=[this.x,this.y,this.width,this.height];const{div:e,parentDimensions:[s,n]}=this;if(this.x+=t/s,this.y+=i/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:i}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,i)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:r,y:o}=this;const[h,a]=this.getBaseTranslation();r+=h,o+=a;const{style:c}=e;c.left=`${(100*r).toFixed(2)}%`,c.top=`${(100*o).toFixed(2)}%`,this._onTranslating(r,o),e.scrollIntoView({block:"nearest"})}_onTranslating(t,i){}_onTranslated(t,i){}get _hasBeenMoved(){return!!this.#Ei&&(this.#Ei[0]!==this.x||this.#Ei[1]!==this.y)}get _hasBeenResized(){return!!this.#Ei&&(this.#Ei[2]!==this.width||this.#Ei[3]!==this.height)}getBaseTranslation(){const[t,i]=this.parentDimensions,{_borderLineWidth:e}=Ut,s=e/t,n=e/i;switch(this.rotation){case 90:return[-s,n];case 180:return[s,n];case 270:return[s,-n];default:return[-s,-n]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:i},pageDimensions:[e,s]}=this;let{x:n,y:r,width:o,height:h}=this;if(o*=e,h*=s,n*=e,r*=s,this._mustFixPosition)switch(t){case 0:n=ht(n,0,e-o),r=ht(r,0,s-h);break;case 90:n=ht(n,0,e-h),r=ht(r,o,s);break;case 180:n=ht(n,o,e),r=ht(r,h,s);break;case 270:n=ht(n,h,e),r=ht(r,0,s-o)}this.x=n/=e,this.y=r/=s;const[a,c]=this.getBaseTranslation();n+=a,r+=c,i.left=`${(100*n).toFixed(2)}%`,i.top=`${(100*r).toFixed(2)}%`,this.moveInDOM()}static#Li(t,i,e){switch(e){case 90:return[i,-t];case 180:return[-t,-i];case 270:return[-i,t];default:return[t,i]}}screenToPageTranslation(t,i){return Ut.#Li(t,i,this.parentRotation)}pageTranslationToScreen(t,i){return Ut.#Li(t,i,360-this.parentRotation)}#Bi(t){switch(t){case 90:{const[t,i]=this.pageDimensions;return[0,-t/i,i/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,i]=this.pageDimensions;return[0,t/i,-i/t,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[i,e]}=this;return[i*t,e*t]}setDims(t,i){const[e,s]=this.parentDimensions,{style:n}=this.div;n.width=`${(100*t/e).toFixed(2)}%`,this.#Ai||(n.height=`${(100*i/s).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:i,width:e}=t,s=e.endsWith("%"),n=!this.#Ai&&i.endsWith("%");if(s&&n)return;const[r,o]=this.parentDimensions;s||(t.width=`${(100*parseFloat(e)/r).toFixed(2)}%`),this.#Ai||n||(t.height=`${(100*parseFloat(i)/o).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#ji(){if(this.#vi)return;this.#vi=document.createElement("div"),this.#vi.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],i=this._uiManager._signal;for(const e of t){const t=document.createElement("div");this.#vi.append(t),t.classList.add("resizer",e),t.setAttribute("data-resizer-name",e),t.addEventListener("pointerdown",this.#Ui.bind(this,e),{signal:i}),t.addEventListener("contextmenu",bt,{signal:i}),t.tabIndex=-1}this.div.prepend(this.#vi)}#Ui(t,i){i.preventDefault();const{isMac:e}=Z.platform;if(0!==i.button||i.ctrlKey&&e)return;this.#h?.toggle(!1);const s=this._isDraggable;this._isDraggable=!1,this.#bi=[i.screenX,i.screenY];const n=new AbortController,r=this._uiManager.combinedSignal(n);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#zi.bind(this,t),{passive:!0,capture:!0,signal:r}),window.addEventListener("touchmove",yt,{passive:!1,signal:r}),window.addEventListener("contextmenu",bt,{signal:r}),this.#yi={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const o=this.parent.div.style.cursor,h=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(i.target).cursor;const a=()=>{n.abort(),this.parent.togglePointerEvents(!0),this.#h?.toggle(!0),this._isDraggable=s,this.parent.div.style.cursor=o,this.div.style.cursor=h,this.#Hi()};window.addEventListener("pointerup",a,{signal:r}),window.addEventListener("blur",a,{signal:r})}#Gi(t,i,e,s){this.width=e,this.height=s,this.x=t,this.y=i;const[n,r]=this.parentDimensions;this.setDims(n*e,r*s),this.fixAndSetPosition(),this._onResized()}_onResized(){}#Hi(){if(!this.#yi)return;const{savedX:t,savedY:i,savedWidth:e,savedHeight:s}=this.#yi;this.#yi=null;const n=this.x,r=this.y,o=this.width,h=this.height;n===t&&r===i&&o===e&&h===s||this.addCommands({cmd:this.#Gi.bind(this,n,r,o,h),undo:this.#Gi.bind(this,t,i,e,s),mustExec:!0})}static _round(t){return Math.round(1e4*t)/1e4}#zi(t,i){const[e,s]=this.parentDimensions,n=this.x,r=this.y,o=this.width,h=this.height,a=Ut.MIN_SIZE/e,c=Ut.MIN_SIZE/s,l=this.#Bi(this.rotation),u=(t,i)=>[l[0]*t+l[2]*i,l[1]*t+l[3]*i],d=this.#Bi(360-this.rotation);let f,p,g=!1,w=!1;switch(t){case"topLeft":g=!0,f=()=>[0,0],p=(t,i)=>[t,i];break;case"topMiddle":f=t=>[t/2,0],p=(t,i)=>[t/2,i];break;case"topRight":g=!0,f=t=>[t,0],p=(t,i)=>[0,i];break;case"middleRight":w=!0,f=(t,i)=>[t,i/2],p=(t,i)=>[0,i/2];break;case"bottomRight":g=!0,f=(t,i)=>[t,i],p=()=>[0,0];break;case"bottomMiddle":f=(t,i)=>[t/2,i],p=t=>[t/2,0];break;case"bottomLeft":g=!0,f=(t,i)=>[0,i],p=t=>[t,0];break;case"middleLeft":w=!0,f=(t,i)=>[0,i/2],p=(t,i)=>[t,i/2]}const m=f(o,h),A=p(o,h);let v=u(...A);const b=Ut._round(n+v[0]),y=Ut._round(r+v[1]);let x,M,k=1,E=1;if(i.fromKeyboard)({deltaX:x,deltaY:M}=i);else{const{screenX:t,screenY:e}=i,[s,n]=this.#bi;[x,M]=this.screenToPageTranslation(t-s,e-n),this.#bi[0]=t,this.#bi[1]=e}var S,_;if([x,M]=[d[0]*(S=x/e)+d[2]*(_=M/s),d[1]*S+d[3]*_],g){const t=Math.hypot(o,h);k=E=Math.max(Math.min(Math.hypot(A[0]-m[0]-x,A[1]-m[1]-M)/t,1/o,1/h),a/o,c/h)}else w?k=ht(Math.abs(A[0]-m[0]-x),a,1)/o:E=ht(Math.abs(A[1]-m[1]-M),c,1)/h;const T=Ut._round(o*k),C=Ut._round(h*E);v=u(...p(T,C));const P=b-v[0],R=y-v[1];this.#Ei||=[this.x,this.y,this.width,this.height],this.width=T,this.height=C,this.x=P,this.y=R,this.setDims(e*T,s*C),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#h?.finish()}async addEditToolbar(){return this._editToolbar||this.#_i||(this._editToolbar=new Pt(this),this.div.append(this._editToolbar.render()),this.#h&&await this._editToolbar.addAltText(this.#h)),this._editToolbar}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#h?.destroy())}addContainer(t){const i=this._editToolbar?.div;i?i.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#h||(Bt.initialize(Ut._l10n),this.#h=new Bt(this),this.#fi&&(this.#h.data=this.#fi,this.#fi=null),await this.addEditToolbar())}get altTextData(){return this.#h?.data}set altTextData(t){this.#h&&(this.#h.data=t)}get guessedAltText(){return this.#h?.guessedText}async setGuessedAltText(t){await(this.#h?.setGuessedText(t))}serializeAltText(t){return this.#h?.serialize(t)}hasAltText(){return!!this.#h&&!this.#h.isEmpty()}hasAltTextData(){return this.#h?.hasData()??!1}render(){const t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=this.#gi?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),this.#Wi();const[i,e]=this.parentDimensions;this.parentRotation%180!=0&&(t.style.maxWidth=`${(100*e/i).toFixed(2)}%`,t.style.maxHeight=`${(100*i/e).toFixed(2)}%`);const[s,n]=this.getInitialTranslation();return this.translate(s,n),Nt(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#Di||=new jt({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#Vi.bind(this),onPinching:this.#Xi.bind(this),onPinchEnd:this.#Yi.bind(this),signal:this._uiManager._signal})),this._uiManager._editorUndoBar?.hide(),t}#Vi(){this.#yi={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#h?.toggle(!1),this.parent.togglePointerEvents(!1)}#Xi(t,i,e){let s=e/i*.7+1-.7;if(1===s)return;const n=this.#Bi(this.rotation),r=(t,i)=>[n[0]*t+n[2]*i,n[1]*t+n[3]*i],[o,h]=this.parentDimensions,a=this.x,c=this.y,l=this.width,u=this.height,d=Ut.MIN_SIZE/o,f=Ut.MIN_SIZE/h;s=Math.max(Math.min(s,1/l,1/u),d/l,f/u);const p=Ut._round(l*s),g=Ut._round(u*s);if(p===l&&g===u)return;this.#Ei||=[a,c,l,u];const w=r(l/2,u/2),m=Ut._round(a+w[0]),A=Ut._round(c+w[1]),v=r(p/2,g/2);this.x=m-v[0],this.y=A-v[1],this.width=p,this.height=g,this.setDims(o*p,h*g),this.fixAndSetPosition(),this._onResizing()}#Yi(){this.#h?.toggle(!0),this.parent.togglePointerEvents(!0),this.#Hi()}pointerdown(t){const{isMac:i}=Z.platform;0!==t.button||t.ctrlKey&&i?t.preventDefault():(this.#ki=!0,this._isDraggable?this.#Qi(t):this.#qi(t))}#qi(t){const{isMac:i}=Z.platform;t.ctrlKey&&!i||t.shiftKey||t.metaKey&&i?this.parent.toggleSelected(this):this.parent.setSelected(this)}#Qi(t){const{isSelected:i}=this;this._uiManager.setUpDragSession();let e=!1;const s=new AbortController,n=this._uiManager.combinedSignal(s),r={capture:!0,passive:!1,signal:n},o=t=>{s.abort(),this.#wi=null,this.#ki=!1,this._uiManager.endDragSession()||this.#qi(t),e&&this._onStopDragging()};i&&(this.#Pi=t.clientX,this.#Ri=t.clientY,this.#wi=t.pointerId,this.#mi=t.pointerType,window.addEventListener("pointermove",(t=>{e||(e=!0,this._onStartDragging());const{clientX:i,clientY:s,pointerId:n}=t;if(n!==this.#wi)return void yt(t);const[r,o]=this.screenToPageTranslation(i-this.#Pi,s-this.#Ri);this.#Pi=i,this.#Ri=s,this._uiManager.dragSelectedEditors(r,o)}),r),window.addEventListener("touchmove",yt,r),window.addEventListener("pointerdown",(t=>{t.pointerType===this.#mi&&(this.#Di||t.isPrimary)&&o(t),yt(t)}),r));const h=t=>{this.#wi&&this.#wi!==t.pointerId?yt(t):o(t)};window.addEventListener("pointerup",h,{signal:n}),window.addEventListener("blur",h,{signal:n})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#Ci&&clearTimeout(this.#Ci),this.#Ci=setTimeout((()=>{this.#Ci=null,this.parent?.moveEditorInDOM(this)}),0)}_setParentAndPosition(t,i,e){t.changeParent(this),this.x=i,this.y=e,this.fixAndSetPosition(),this._onTranslated()}getRect(t,i,e=this.rotation){const s=this.parentScale,[n,r]=this.pageDimensions,[o,h]=this.pageTranslation,a=t/s,c=i/s,l=this.x*n,u=this.y*r,d=this.width*n,f=this.height*r;switch(e){case 0:return[l+a+o,r-u-c-f+h,l+a+d+o,r-u-c+h];case 90:return[l+c+o,r-u+a+h,l+c+f+o,r-u+a+d+h];case 180:return[l-a-d+o,r-u+c+h,l-a+o,r-u+c+f+h];case 270:return[l-c-f+o,r-u-a-d+h,l-c+o,r-u-a+h];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,i){const[e,s,n,r]=t,o=n-e,h=r-s;switch(this.rotation){case 0:return[e,i-r,o,h];case 90:return[e,i-s,h,o];case 180:return[n,i-s,o,h];case 270:return[n,i-r,h,o];default:throw new Error("Invalid rotation")}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),this.#_i=!0,!0)}disableEditMode(){return!!this.isInEditMode()&&(this.parent.setEditingState(!0),this.#_i=!1,!0)}isInEditMode(){return this.#_i}shouldGetKeyboardEvents(){return this.#Ti}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:i,bottom:e,right:s}=this.getClientDimensions(),{innerHeight:n,innerWidth:r}=window;return i<r&&s>0&&t<n&&e>0}#Wi(){if(this.#xi||!this.div)return;this.#xi=new AbortController;const t=this._uiManager.combinedSignal(this.#xi);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}rebuild(){this.#Wi()}rotate(t){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,i=null){B("An editor must be serializable")}static async deserialize(t,i,e){const s=new this.prototype.constructor({parent:i,id:i.getNextId(),uiManager:e});s.rotation=t.rotation,s.#fi=t.accessibilityData,s._isCopy=t.isCopy||!1;const[n,r]=s.pageDimensions,[o,h,a,c]=s.getRectInCurrentCoords(t.rect,r);return s.x=o/n,s.y=h/r,s.width=a/n,s.height=c/r,s}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.#xi?.abort(),this.#xi=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#Ci&&(clearTimeout(this.#Ci),this.#Ci=null),this.#Oi(),this.removeEditToolbar(),this.#Ni){for(const t of this.#Ni.values())clearTimeout(t);this.#Ni=null}this.parent=null,this.#Di?.destroy(),this.#Di=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#ji(),this.#vi.classList.remove("hidden"))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),this.#yi={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const i=this.#vi.children;if(!this.#pi){this.#pi=Array.from(i);const t=this.#Ki.bind(this),e=this.#Ji.bind(this),s=this._uiManager._signal;for(const i of this.#pi){const n=i.getAttribute("data-resizer-name");i.setAttribute("role","spinbutton"),i.addEventListener("keydown",t,{signal:s}),i.addEventListener("blur",e,{signal:s}),i.addEventListener("focus",this.#Zi.bind(this,n),{signal:s}),i.setAttribute("data-l10n-id",Ut._l10nResizer[n])}}const e=this.#pi[0];let s=0;for(const t of i){if(t===e)break;s++}const n=(360-this.rotation+this.parentRotation)%360/90*(this.#pi.length/4);if(n!==s){if(n<s)for(let t=0;t<s-n;t++)this.#vi.append(this.#vi.firstChild);else if(n>s)for(let t=0;t<n-s;t++)this.#vi.firstChild.before(this.#vi.lastChild);let t=0;for(const e of i){const i=this.#pi[t++].getAttribute("data-resizer-name");e.setAttribute("data-l10n-id",Ut._l10nResizer[i])}}this.#te(0),this.#Ti=!0,this.#vi.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#Ki(t){Ut._resizerKeyboardManager.exec(this,t)}#Ji(t){this.#Ti&&t.relatedTarget?.parentNode!==this.#vi&&this.#Oi()}#Zi(t){this.#Mi=this.#Ti?t:""}#te(t){if(this.#pi)for(const i of this.#pi)i.tabIndex=t}_resizeWithKeyboard(t,i){this.#Ti&&this.#zi(this.#Mi,{deltaX:t,deltaY:i,fromKeyboard:!0})}#Oi(){this.#Ti=!1,this.#te(-1),this.#Hi()}_stopResizingWithKeyboard(){this.#Oi(),this.div.focus()}select(){this.isSelected&&this._editToolbar||(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),this._editToolbar?(this._editToolbar?.show(),this.#h?.toggleAltTextBadge(!1)):this.addEditToolbar().then((()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()})))}unselect(){this.isSelected&&(this.isSelected=!1,this.#vi?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#h?.toggleAltTextBadge(!0))}updateParams(t,i){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id})}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#Si}set isEditing(t){this.#Si=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,i){this.#Ai=!0;const e=t/i,{style:s}=this.div;s.aspectRatio=e,s.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,i=!1){if(i){this.#Ni||=new Map;const{action:i}=t;let e=this.#Ni.get(i);return e&&clearTimeout(e),e=setTimeout((()=>{this._reportTelemetry(t),this.#Ni.delete(i),0===this.#Ni.size&&(this.#Ni=null)}),Ut._telemetryTimeout),void this.#Ni.set(i,e)}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#gi=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#gi=!0}renderAnnotationElement(t){let i=t.container.querySelector(".annotationContent");if(i){if("CANVAS"===i.nodeName){const t=i;i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),t.before(i)}}else i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),t.container.prepend(i);return i}resetAnnotationElement(t){const{firstChild:i}=t.container;"DIV"===i?.nodeName&&i.classList.contains("annotationContent")&&i.remove()}}class zt extends Ut{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const Ht=3285377520,Gt=4294901760,Wt=65535;class Vt{constructor(t){this.h1=t?4294967295&t:Ht,this.h2=t?4294967295&t:Ht}update(t){let i,e;if("string"==typeof t){i=new Uint8Array(2*t.length),e=0;for(let s=0,n=t.length;s<n;s++){const n=t.charCodeAt(s);n<=255?i[e++]=n:(i[e++]=n>>>8,i[e++]=255&n)}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");i=t.slice(),e=i.byteLength}const s=e>>2,n=e-4*s,r=new Uint32Array(i.buffer,0,s);let o=0,h=0,a=this.h1,c=this.h2;const l=3432918353,u=461845907,d=11601,f=13715;for(let t=0;t<s;t++)1&t?(o=r[t],o=o*l&Gt|o*d&Wt,o=o<<15|o>>>17,o=o*u&Gt|o*f&Wt,a^=o,a=a<<13|a>>>19,a=5*a+3864292196):(h=r[t],h=h*l&Gt|h*d&Wt,h=h<<15|h>>>17,h=h*u&Gt|h*f&Wt,c^=h,c=c<<13|c>>>19,c=5*c+3864292196);switch(o=0,n){case 3:o^=i[4*s+2]<<16;case 2:o^=i[4*s+1]<<8;case 1:o^=i[4*s],o=o*l&Gt|o*d&Wt,o=o<<15|o>>>17,o=o*u&Gt|o*f&Wt,1&s?a^=o:c^=o}this.h1=a,this.h2=c}hexdigest(){let t=this.h1,i=this.h2;return t^=i>>>1,t=3981806797*t&Gt|36045*t&Wt,i=4283543511*i&Gt|(2950163797*(i<<16|t>>>16)&Gt)>>>16,t^=i>>>1,t=444984403*t&Gt|60499*t&Wt,i=3301882366*i&Gt|(3120437893*(i<<16|t>>>16)&Gt)>>>16,t^=i>>>1,(t>>>0).toString(16).padStart(8,"0")+(i>>>0).toString(16).padStart(8,"0")}}const Xt=Object.freeze({map:null,hash:"",transfer:void 0});class Yt{#ie=!1;#ee=null;#se=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,i){const e=this.#se.get(t);return void 0===e?i:Object.assign(i,e)}getRawValue(t){return this.#se.get(t)}remove(t){if(this.#se.delete(t),0===this.#se.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const t of this.#se.values())if(t instanceof Ut)return;this.onAnnotationEditor(null)}}setValue(t,i){const e=this.#se.get(t);let s=!1;if(void 0!==e)for(const[t,n]of Object.entries(i))e[t]!==n&&(s=!0,e[t]=n);else s=!0,this.#se.set(t,i);s&&this.#ne(),i instanceof Ut&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(i.constructor._type)}has(t){return this.#se.has(t)}get size(){return this.#se.size}#ne(){this.#ie||(this.#ie=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#ie&&(this.#ie=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new Qt(this)}get serializable(){if(0===this.#se.size)return Xt;const t=new Map,i=new Vt,e=[],s=Object.create(null);let n=!1;for(const[e,r]of this.#se){const o=r instanceof Ut?r.serialize(!1,s):r;o&&(t.set(e,o),i.update(`${e}:${JSON.stringify(o)}`),n||=!!o.bitmap)}if(n)for(const i of t.values())i.bitmap&&e.push(i.bitmap);return t.size>0?{map:t,hash:i.hexdigest(),transfer:e}:Xt}get editorStats(){let t=null;const i=new Map;for(const e of this.#se.values()){if(!(e instanceof Ut))continue;const s=e.telemetryFinalData;if(!s)continue;const{type:n}=s;i.has(n)||i.set(n,Object.getPrototypeOf(e).constructor),t||=Object.create(null);const r=t[n]||=new Map;for(const[t,i]of Object.entries(s)){if("type"===t)continue;let e=r.get(t);e||(e=new Map,r.set(t,e));const s=e.get(i)??0;e.set(i,s+1)}}for(const[e,s]of i)t[e]=s.computeTelemetryFinalData(t[e]);return t}resetModifiedIds(){this.#ee=null}get modifiedIds(){if(this.#ee)return this.#ee;const t=[];for(const i of this.#se.values())i instanceof Ut&&i.annotationElementId&&i.serialize()&&t.push(i.annotationElementId);return this.#ee={ids:new Set(t),hash:t.join(",")}}[Symbol.iterator](){return this.#se.entries()}}class Qt extends Yt{#re;constructor(t){super();const{map:i,hash:e,transfer:s}=t.serializable,n=structuredClone(i,s?{transfer:s}:null);this.#re={map:n,hash:e,transfer:s}}get print(){B("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#re}get modifiedIds(){return H(this,"modifiedIds",{ids:new Set,hash:""})}}class qt{#oe=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:i=null}){this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const i=this.styleElement.sheet;i.insertRule(t,i.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#oe.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:i,_inspectFont:e}){if(t&&!this.#oe.has(t.loadedName))if(j(!i,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:s,style:n}=t,r=new FontFace(i,s,n);this.addNativeFontFace(r);try{await r.load(),this.#oe.add(i),e?.(t)}catch{L(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(r)}}else B("Not implemented: loadSystemFont without the Font Loading API.")}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo)return void await this.loadSystemFont(t);if(this.isFontLoadingAPISupported){const i=t.createNativeFontFace();if(i){this.addNativeFontFace(i);try{await i.loaded}catch(e){throw L(`Failed to load font '${i.family}': '${e}'.`),t.disableFontFace=!0,e}}return}const i=t.createFontFaceRule();if(i){if(this.insertRule(i),this.isSyncFontLoadingSupported)return;await new Promise((i=>{const e=this._queueLoadingCallback(i);this._prepareFontLoadEvent(t,e)}))}}get isFontLoadingAPISupported(){return H(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){return H(this,"isSyncFontLoadingSupported",x||Z.platform.isFirefox)}_queueLoadingCallback(t){const{loadingRequests:i}=this,e={done:!1,complete:function(){for(j(!e.done,"completeRequest() cannot be called twice."),e.done=!0;i.length>0&&i[0].done;){const t=i.shift();setTimeout(t.callback,0)}},callback:t};return i.push(e),e}get _loadTestFont(){return H(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,i){function e(t,i){return t.charCodeAt(i)<<24|t.charCodeAt(i+1)<<16|t.charCodeAt(i+2)<<8|255&t.charCodeAt(i+3)}function s(t,i,e,s){return t.substring(0,i)+s+t.substring(i+e)}let n,r;const o=this._document.createElement("canvas");o.width=1,o.height=1;const h=o.getContext("2d");let a=0;const c=`lt${Date.now()}${this.loadTestFontId++}`;let l=this._loadTestFont;l=s(l,976,c.length,c);const u=1482184792;let d=e(l,16);for(n=0,r=c.length-3;n<r;n+=4)d=d-u+e(c,n)|0;var f;n<c.length&&(d=d-u+e(c+"XXX",n)|0),l=s(l,16,4,(f=d,String.fromCharCode(f>>24&255,f>>16&255,f>>8&255,255&f)));const p=`url(data:font/opentype;base64,${btoa(l)});`;this.insertRule(`@font-face {font-family:"${c}";src:${p}}`);const g=this._document.createElement("div");g.style.visibility="hidden",g.style.width=g.style.height="10px",g.style.position="absolute",g.style.top=g.style.left="0px";for(const i of[t.loadedName,c]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=i,g.append(t)}this._document.body.append(g),function t(i,e){if(++a>30)return L("Load test font never loaded."),void e();h.font="30px "+i,h.fillText(".",0,20),h.getImageData(0,0,1,1).data[3]>0?e():setTimeout(t.bind(null,i,e))}(c,(()=>{g.remove(),i.complete()}))}}class Kt{constructor(t,i=null){this.compiledGlyphs=Object.create(null);for(const i in t)this[i]=t[i];this._inspectFont=i}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const i={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(i.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,i)}else t=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=`url(data:${this.mimetype};base64,${at(this.data)});`;let i;if(this.cssFontInfo){let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${e}src:${t}}`}else i=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this._inspectFont?.(this,t),i}getPathGenerator(t,i){if(void 0!==this.compiledGlyphs[i])return this.compiledGlyphs[i];const e=this.loadedName+"_path_"+i;let s;try{s=t.get(e)}catch(t){L(`getPathGenerator - ignoring character: "${t}".`)}const n=new Path2D(s||"");return this.fontExtraProperties||t.delete(e),this.compiledGlyphs[i]=n}}function Jt(t){if("string"!=typeof t)return null;if(t.endsWith("/"))return t;throw new Error(`Invalid factory url: "${t}" must include trailing slash.`)}const Zt=t=>"object"==typeof t&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0,ti=function(t,i,e){if(!Array.isArray(e)||e.length<2)return!1;const[s,n,...r]=e;if(!t(s)&&!Number.isInteger(s))return!1;if(!i(n))return!1;const o=r.length;let h=!0;switch(n.name){case"XYZ":if(o<2||o>3)return!1;break;case"Fit":case"FitB":return 0===o;case"FitH":case"FitBH":case"FitV":case"FitBV":if(o>1)return!1;break;case"FitR":if(4!==o)return!1;h=!1;break;default:return!1}for(const t of r)if(!("number"==typeof t||h&&null===t))return!1;return!0}.bind(null,Zt,(t=>"object"==typeof t&&"string"==typeof t?.name));class ii{#he=new Map;#ae=Promise.resolve();postMessage(t,i){const e={data:structuredClone(t,i?{transfer:i}:null)};this.#ae.then((()=>{for(const[t]of this.#he)t.call(this,e)}))}addEventListener(t,i,e=null){let s=null;if(e?.signal instanceof AbortSignal){const{signal:n}=e;if(n.aborted)return void L("LoopbackPort - cannot use an `aborted` signal.");const r=()=>this.removeEventListener(t,i);s=()=>n.removeEventListener("abort",r),n.addEventListener("abort",r)}this.#he.set(i,s)}removeEventListener(t,i){const e=this.#he.get(i);e?.(),this.#he.delete(i)}terminate(){for(const[,t]of this.#he)t?.();this.#he.clear()}}function ei(){}function si(t){if(t instanceof q||t instanceof X||t instanceof W||t instanceof Y||t instanceof V)return t;switch(t instanceof Error||"object"==typeof t&&null!==t||B('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new q(t.message);case"InvalidPDFException":return new X(t.message);case"PasswordException":return new W(t.message,t.code);case"ResponseException":return new Y(t.message,t.status,t.missing);case"UnknownErrorException":return new V(t.message,t.details)}return new V(t.message,t.toString())}class ni{#ce=new AbortController;constructor(t,i,e){this.sourceName=t,this.targetName=i,this.comObj=e,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),e.addEventListener("message",this.#le.bind(this),{signal:this.#ce.signal})}#le({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream)return void this.#ue(t);if(t.callback){const i=t.callbackId,e=this.callbackCapabilities[i];if(!e)throw new Error(`Cannot resolve callback ${i}`);if(delete this.callbackCapabilities[i],1===t.callback)e.resolve(t.data);else{if(2!==t.callback)throw new Error("Unexpected callback case");e.reject(si(t.reason))}return}const i=this.actionHandler[t.action];if(!i)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,s=t.sourceName,n=this.comObj;Promise.try(i,t.data).then((function(i){n.postMessage({sourceName:e,targetName:s,callback:1,callbackId:t.callbackId,data:i})}),(function(i){n.postMessage({sourceName:e,targetName:s,callback:2,callbackId:t.callbackId,reason:si(i)})}))}else t.streamId?this.#de(t):i(t.data)}on(t,i){const e=this.actionHandler;if(e[t])throw new Error(`There is already an actionName called "${t}"`);e[t]=i}send(t,i,e){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:i},e)}sendWithPromise(t,i,e){const s=this.callbackId++,n=Promise.withResolvers();this.callbackCapabilities[s]=n;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:s,data:i},e)}catch(t){n.reject(t)}return n.promise}sendWithStream(t,i,e,s){const n=this.streamId++,r=this.sourceName,o=this.targetName,h=this.comObj;return new ReadableStream({start:e=>{const a=Promise.withResolvers();return this.streamControllers[n]={controller:e,startCall:a,pullCall:null,cancelCall:null,isClosed:!1},h.postMessage({sourceName:r,targetName:o,action:t,streamId:n,data:i,desiredSize:e.desiredSize},s),a.promise},pull:t=>{const i=Promise.withResolvers();return this.streamControllers[n].pullCall=i,h.postMessage({sourceName:r,targetName:o,stream:6,streamId:n,desiredSize:t.desiredSize}),i.promise},cancel:t=>{j(t instanceof Error,"cancel must have a valid reason");const i=Promise.withResolvers();return this.streamControllers[n].cancelCall=i,this.streamControllers[n].isClosed=!0,h.postMessage({sourceName:r,targetName:o,stream:1,streamId:n,reason:si(t)}),i.promise}},e)}#de(t){const i=t.streamId,e=this.sourceName,s=t.sourceName,n=this.comObj,r=this,o=this.actionHandler[t.action],h={enqueue(t,r=1,o){if(this.isCancelled)return;const h=this.desiredSize;this.desiredSize-=r,h>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),n.postMessage({sourceName:e,targetName:s,stream:4,streamId:i,chunk:t},o)},close(){this.isCancelled||(this.isCancelled=!0,n.postMessage({sourceName:e,targetName:s,stream:3,streamId:i}),delete r.streamSinks[i])},error(t){j(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,n.postMessage({sourceName:e,targetName:s,stream:5,streamId:i,reason:si(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};h.sinkCapability.resolve(),h.ready=h.sinkCapability.promise,this.streamSinks[i]=h,Promise.try(o,t.data,h).then((function(){n.postMessage({sourceName:e,targetName:s,stream:8,streamId:i,success:!0})}),(function(t){n.postMessage({sourceName:e,targetName:s,stream:8,streamId:i,reason:si(t)})}))}#ue(t){const i=t.streamId,e=this.sourceName,s=t.sourceName,n=this.comObj,r=this.streamControllers[i],o=this.streamSinks[i];switch(t.stream){case 8:t.success?r.startCall.resolve():r.startCall.reject(si(t.reason));break;case 7:t.success?r.pullCall.resolve():r.pullCall.reject(si(t.reason));break;case 6:if(!o){n.postMessage({sourceName:e,targetName:s,stream:7,streamId:i,success:!0});break}o.desiredSize<=0&&t.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=t.desiredSize,Promise.try(o.onPull||ei).then((function(){n.postMessage({sourceName:e,targetName:s,stream:7,streamId:i,success:!0})}),(function(t){n.postMessage({sourceName:e,targetName:s,stream:7,streamId:i,reason:si(t)})}));break;case 4:if(j(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case 3:if(j(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),this.#fe(r,i);break;case 5:j(r,"error should have stream controller"),r.controller.error(si(t.reason)),this.#fe(r,i);break;case 2:t.success?r.cancelCall.resolve():r.cancelCall.reject(si(t.reason)),this.#fe(r,i);break;case 1:if(!o)break;const h=si(t.reason);Promise.try(o.onCancel||ei,h).then((function(){n.postMessage({sourceName:e,targetName:s,stream:2,streamId:i,success:!0})}),(function(t){n.postMessage({sourceName:e,targetName:s,stream:2,streamId:i,reason:si(t)})})),o.sinkCapability.reject(h),o.isCancelled=!0,delete this.streamSinks[i];break;default:throw new Error("Unexpected stream case")}}async#fe(t,i){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[i]}destroy(){this.#ce?.abort(),this.#ce=null}}class ri{#pe=!1;constructor({enableHWA:t=!1}){this.#pe=t}create(t,i){if(t<=0||i<=0)throw new Error("Invalid canvas size");const e=this._createCanvas(t,i);return{canvas:e,context:e.getContext("2d",{willReadFrequently:!this.#pe})}}reset(t,i,e){if(!t.canvas)throw new Error("Canvas is not specified");if(i<=0||e<=0)throw new Error("Invalid canvas size");t.canvas.width=i,t.canvas.height=e}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,i){B("Abstract method `_createCanvas` called.")}}class oi extends ri{constructor({ownerDocument:t=globalThis.document,enableHWA:i=!1}){super({enableHWA:i}),this._document=t}_createCanvas(t,i){const e=this._document.createElement("canvas");return e.width=t,e.height=i,e}}class hi{constructor({baseUrl:t=null,isCompressed:i=!0}){this.baseUrl=t,this.isCompressed=i}async fetch({name:t}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!t)throw new Error("CMap name must be specified.");const i=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(i).then((t=>({cMapData:t,isCompressed:this.isCompressed}))).catch((()=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)}))}async _fetch(t){B("Abstract method `_fetch` called.")}}class ai extends hi{async _fetch(t){const i=await ut(t,this.isCompressed?"arraybuffer":"text");return i instanceof ArrayBuffer?new Uint8Array(i):J(i)}}y(2489);class ci{addFilter(t){return"none"}addHCMFilter(t,i){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,i,e,s,n){return"none"}destroy(t=!1){}}class li extends ci{#ge;#we;#me;#Ae;#ve;#be;#b=0;constructor({docId:t,ownerDocument:i=globalThis.document}){super(),this.#Ae=t,this.#ve=i}get#x(){return this.#we||=new Map}get#ye(){return this.#be||=new Map}get#xe(){if(!this.#me){const t=this.#ve.createElement("div"),{style:i}=t;i.visibility="hidden",i.contain="strict",i.width=i.height=0,i.position="absolute",i.top=i.left=0,i.zIndex=-1;const e=this.#ve.createElementNS(ct,"svg");e.setAttribute("width",0),e.setAttribute("height",0),this.#me=this.#ve.createElementNS(ct,"defs"),t.append(e),e.append(this.#me),this.#ve.body.append(t)}return this.#me}#Me(t){if(1===t.length){const i=t[0],e=new Array(256);for(let t=0;t<256;t++)e[t]=i[t]/255;const s=e.join(",");return[s,s,s]}const[i,e,s]=t,n=new Array(256),r=new Array(256),o=new Array(256);for(let t=0;t<256;t++)n[t]=i[t]/255,r[t]=e[t]/255,o[t]=s[t]/255;return[n.join(","),r.join(","),o.join(",")]}#ke(t){if(void 0===this.#ge){this.#ge="";const t=this.#ve.URL;t!==this.#ve.baseURI&&(pt(t)?L('#createUrl: ignore "data:"-URL for performance reasons.'):this.#ge=z(t,""))}return`url(${this.#ge}#${t})`}addFilter(t){if(!t)return"none";let i=this.#x.get(t);if(i)return i;const[e,s,n]=this.#Me(t),r=1===t.length?e:`${e}${s}${n}`;if(i=this.#x.get(r),i)return this.#x.set(t,i),i;const o=`g_${this.#Ae}_transfer_map_${this.#b++}`,h=this.#ke(o);this.#x.set(t,h),this.#x.set(r,h);const a=this.#Ee(o);return this.#Se(e,s,n,a),h}addHCMFilter(t,i){const e=`${t}-${i}`,s="base";let n=this.#ye.get(s);if(n?.key===e)return n.url;if(n?(n.filter?.remove(),n.key=e,n.url="none",n.filter=null):(n={key:e,url:"none",filter:null},this.#ye.set(s,n)),!t||!i)return n.url;const r=this.#_e(t);t=it.makeHexColor(...r);const o=this.#_e(i);if(i=it.makeHexColor(...o),this.#xe.style.color="","#000000"===t&&"#ffffff"===i||t===i)return n.url;const h=new Array(256);for(let t=0;t<=255;t++){const i=t/255;h[t]=i<=.03928?i/12.92:((i+.055)/1.055)**2.4}const a=h.join(","),c=`g_${this.#Ae}_hcm_filter`,l=n.filter=this.#Ee(c);this.#Se(a,a,a,l),this.#Te(l);const u=(t,i)=>{const e=r[t]/255,s=o[t]/255,n=new Array(i+1);for(let t=0;t<=i;t++)n[t]=e+t/i*(s-e);return n.join(",")};return this.#Se(u(0,5),u(1,5),u(2,5),l),n.url=this.#ke(c),n.url}addAlphaFilter(t){let i=this.#x.get(t);if(i)return i;const[e]=this.#Me([t]),s=`alpha_${e}`;if(i=this.#x.get(s),i)return this.#x.set(t,i),i;const n=`g_${this.#Ae}_alpha_map_${this.#b++}`,r=this.#ke(n);this.#x.set(t,r),this.#x.set(s,r);const o=this.#Ee(n);return this.#Ce(e,o),r}addLuminosityFilter(t){let i,e,s=this.#x.get(t||"luminosity");if(s)return s;if(t?([i]=this.#Me([t]),e=`luminosity_${i}`):e="luminosity",s=this.#x.get(e),s)return this.#x.set(t,s),s;const n=`g_${this.#Ae}_luminosity_map_${this.#b++}`,r=this.#ke(n);this.#x.set(t,r),this.#x.set(e,r);const o=this.#Ee(n);return this.#Pe(o),t&&this.#Ce(i,o),r}addHighlightHCMFilter(t,i,e,s,n){const r=`${i}-${e}-${s}-${n}`;let o=this.#ye.get(t);if(o?.key===r)return o.url;if(o?(o.filter?.remove(),o.key=r,o.url="none",o.filter=null):(o={key:r,url:"none",filter:null},this.#ye.set(t,o)),!i||!e)return o.url;const[h,a]=[i,e].map(this.#_e.bind(this));let c=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),l=Math.round(.2126*a[0]+.7152*a[1]+.0722*a[2]),[u,d]=[s,n].map(this.#_e.bind(this));l<c&&([c,l,u,d]=[l,c,d,u]),this.#xe.style.color="";const f=(t,i,e)=>{const s=new Array(256),n=(l-c)/e,r=t/255,o=(i-t)/(255*e);let h=0;for(let t=0;t<=e;t++){const i=Math.round(c+t*n),e=r+t*o;for(let t=h;t<=i;t++)s[t]=e;h=i+1}for(let t=h;t<256;t++)s[t]=s[h-1];return s.join(",")},p=`g_${this.#Ae}_hcm_${t}_filter`,g=o.filter=this.#Ee(p);return this.#Te(g),this.#Se(f(u[0],d[0],5),f(u[1],d[1],5),f(u[2],d[2],5),g),o.url=this.#ke(p),o.url}destroy(t=!1){t&&this.#be?.size||(this.#me?.parentNode.parentNode.remove(),this.#me=null,this.#we?.clear(),this.#we=null,this.#be?.clear(),this.#be=null,this.#b=0)}#Pe(t){const i=this.#ve.createElementNS(ct,"feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(i)}#Te(t){const i=this.#ve.createElementNS(ct,"feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(i)}#Ee(t){const i=this.#ve.createElementNS(ct,"filter");return i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("id",t),this.#xe.append(i),i}#Re(t,i,e){const s=this.#ve.createElementNS(ct,i);s.setAttribute("type","discrete"),s.setAttribute("tableValues",e),t.append(s)}#Se(t,i,e,s){const n=this.#ve.createElementNS(ct,"feComponentTransfer");s.append(n),this.#Re(n,"feFuncR",t),this.#Re(n,"feFuncG",i),this.#Re(n,"feFuncB",e)}#Ce(t,i){const e=this.#ve.createElementNS(ct,"feComponentTransfer");i.append(e),this.#Re(e,"feFuncA",t)}#_e(t){return this.#xe.style.color=t,kt(getComputedStyle(this.#xe).getPropertyValue("color"))}}class ui{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!t)throw new Error("Font filename must be specified.");const i=`${this.baseUrl}${t}`;return this._fetch(i).catch((()=>{throw new Error(`Unable to load font data at: ${i}`)}))}async _fetch(t){B("Abstract method `_fetch` called.")}}class di extends ui{async _fetch(t){const i=await ut(t,"arraybuffer");return new Uint8Array(i)}}class fi{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!t)throw new Error("Wasm filename must be specified.");const i=`${this.baseUrl}${t}`;return this._fetch(i).catch((()=>{throw new Error(`Unable to load wasm data at: ${i}`)}))}async _fetch(t){B("Abstract method `_fetch` called.")}}class pi extends fi{async _fetch(t){const i=await ut(t,"arraybuffer");return new Uint8Array(i)}}if(x){let t;try{const i=process.getBuiltinModule("module").createRequire(import.meta.url);try{t=i("@napi-rs/canvas")}catch(t){L(`Cannot load "@napi-rs/canvas" package: "${t}".`)}}catch(t){L(`Cannot access the \`require\` function: "${t}".`)}globalThis.DOMMatrix||(t?.DOMMatrix?globalThis.DOMMatrix=t.DOMMatrix:L("Cannot polyfill `DOMMatrix`, rendering may be broken.")),globalThis.ImageData||(t?.ImageData?globalThis.ImageData=t.ImageData:L("Cannot polyfill `ImageData`, rendering may be broken.")),globalThis.Path2D||(t?.Path2D?globalThis.Path2D=t.Path2D:L("Cannot polyfill `Path2D`, rendering may be broken.")),globalThis.navigator?.language||(globalThis.navigator={language:"en-US",platform:"",userAgent:""})}async function gi(t){const i=process.getBuiltinModule("fs"),e=await i.promises.readFile(t);return new Uint8Array(e)}class wi extends ci{}class mi extends ri{_createCanvas(t,i){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t,i)}}class Ai extends hi{async _fetch(t){return gi(t)}}class vi extends ui{async _fetch(t){return gi(t)}}class bi extends fi{async _fetch(t){return gi(t)}}const yi="Fill",xi="Stroke",Mi="Shading";function ki(t,i){if(!i)return;const e=i[2]-i[0],s=i[3]-i[1],n=new Path2D;n.rect(i[0],i[1],e,s),t.clip(n)}class Ei{isModifyingCurrentTransform(){return!1}getPattern(){B("Abstract method `getPattern` called.")}}class Si extends Ei{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let i;"axial"===this._type?i=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(i=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const t of this._colorStops)i.addColorStop(t[0],t[1]);return i}getPattern(t,i,e,s){let n;if(s===xi||s===yi){const r=i.current.getClippedPathBoundingBox(s,Et(t))||[0,0,0,0],o=Math.ceil(r[2]-r[0])||1,h=Math.ceil(r[3]-r[1])||1,a=i.cachedCanvases.getCanvas("pattern",o,h),c=a.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-r[0],-r[1]),e=it.transform(e,[1,0,0,1,r[0],r[1]]),c.transform(...i.baseTransform),this.matrix&&c.transform(...this.matrix),ki(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),n=t.createPattern(a.canvas,"no-repeat");const l=new DOMMatrix(e);n.setTransform(l)}else ki(t,this._bbox),n=this._createGradient(t);return n}}function _i(t,i,e,s,n,r,o,h){const a=i.coords,c=i.colors,l=t.data,u=4*t.width;let d;a[e+1]>a[s+1]&&(d=e,e=s,s=d,d=r,r=o,o=d),a[s+1]>a[n+1]&&(d=s,s=n,n=d,d=o,o=h,h=d),a[e+1]>a[s+1]&&(d=e,e=s,s=d,d=r,r=o,o=d);const f=(a[e]+i.offsetX)*i.scaleX,p=(a[e+1]+i.offsetY)*i.scaleY,g=(a[s]+i.offsetX)*i.scaleX,w=(a[s+1]+i.offsetY)*i.scaleY,m=(a[n]+i.offsetX)*i.scaleX,A=(a[n+1]+i.offsetY)*i.scaleY;if(p>=A)return;const v=c[r],b=c[r+1],y=c[r+2],x=c[o],M=c[o+1],k=c[o+2],E=c[h],S=c[h+1],_=c[h+2],T=Math.round(p),C=Math.round(A);let P,R,N,D,I,F,O,$;for(let t=T;t<=C;t++){if(t<w){const i=t<p?0:(p-t)/(p-w);P=f-(f-g)*i,R=v-(v-x)*i,N=b-(b-M)*i,D=y-(y-k)*i}else{let i;i=t>A?1:w===A?0:(w-t)/(w-A),P=g-(g-m)*i,R=x-(x-E)*i,N=M-(M-S)*i,D=k-(k-_)*i}let i;i=t<p?0:t>A?1:(p-t)/(p-A),I=f-(f-m)*i,F=v-(v-E)*i,O=b-(b-S)*i,$=y-(y-_)*i;const e=Math.round(Math.min(P,I)),s=Math.round(Math.max(P,I));let n=u*t+4*e;for(let t=e;t<=s;t++)i=(P-t)/(P-I),i<0?i=0:i>1&&(i=1),l[n++]=R-(R-F)*i|0,l[n++]=N-(N-O)*i|0,l[n++]=D-(D-$)*i|0,l[n++]=255}}function Ti(t,i,e){const s=i.coords,n=i.colors;let r,o;switch(i.type){case"lattice":const h=i.verticesPerRow,a=Math.floor(s.length/h)-1,c=h-1;for(r=0;r<a;r++){let i=r*h;for(let r=0;r<c;r++,i++)_i(t,e,s[i],s[i+1],s[i+h],n[i],n[i+1],n[i+h]),_i(t,e,s[i+h+1],s[i+1],s[i+h],n[i+h+1],n[i+1],n[i+h])}break;case"triangles":for(r=0,o=s.length;r<o;r+=3)_i(t,e,s[r],s[r+1],s[r+2],n[r],n[r+1],n[r+2]);break;default:throw new Error("illegal figure")}}class Ci extends Ei{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],this.matrix=null}_createMeshCanvas(t,i,e){const s=Math.floor(this._bounds[0]),n=Math.floor(this._bounds[1]),r=Math.ceil(this._bounds[2])-s,o=Math.ceil(this._bounds[3])-n,h=Math.min(Math.ceil(Math.abs(r*t[0]*1.1)),3e3),a=Math.min(Math.ceil(Math.abs(o*t[1]*1.1)),3e3),c=r/h,l=o/a,u={coords:this._coords,colors:this._colors,offsetX:-s,offsetY:-n,scaleX:1/c,scaleY:1/l},d=e.getCanvas("mesh",h+4,a+4),f=d.context,p=f.createImageData(h,a);if(i){const t=p.data;for(let e=0,s=t.length;e<s;e+=4)t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=255}for(const t of this._figures)Ti(p,t,u);return f.putImageData(p,2,2),{canvas:d.canvas,offsetX:s-2*c,offsetY:n-2*l,scaleX:c,scaleY:l}}isModifyingCurrentTransform(){return!0}getPattern(t,i,e,s){ki(t,this._bbox);const n=new Float32Array(2);if(s===Mi)it.singularValueDecompose2dScale(Et(t),n);else if(this.matrix){it.singularValueDecompose2dScale(this.matrix,n);const[t,e]=n;it.singularValueDecompose2dScale(i.baseTransform,n),n[0]*=t,n[1]*=e}else it.singularValueDecompose2dScale(i.baseTransform,n);const r=this._createMeshCanvas(n,s===Mi?null:this._background,i.cachedCanvases);return s!==Mi&&(t.setTransform(...i.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(r.offsetX,r.offsetY),t.scale(r.scaleX,r.scaleY),t.createPattern(r.canvas,"no-repeat")}}class Pi extends Ei{getPattern(){return"hotpink"}}class Ri{static MAX_PATTERN_SIZE=3e3;constructor(t,i,e,s){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.ctx=i,this.canvasGraphicsFactory=e,this.baseTransform=s}createPatternCanvas(t){const{bbox:i,operatorList:e,paintType:s,tilingType:n,color:r,canvasGraphicsFactory:o}=this;let{xstep:h,ystep:a}=this;h=Math.abs(h),a=Math.abs(a),$("TilingType: "+n);const c=i[0],l=i[1],u=i[2],d=i[3],f=u-c,p=d-l,g=new Float32Array(2);it.singularValueDecompose2dScale(this.matrix,g);const[w,m]=g;it.singularValueDecompose2dScale(this.baseTransform,g);const A=w*g[0],v=m*g[1];let b=f,y=p,x=!1,M=!1;const k=Math.ceil(h*A),E=Math.ceil(a*v);k>=Math.ceil(f*A)?b=h:x=!0,E>=Math.ceil(p*v)?y=a:M=!0;const S=this.getSizeAndScale(b,this.ctx.canvas.width,A),_=this.getSizeAndScale(y,this.ctx.canvas.height,v),T=t.cachedCanvases.getCanvas("pattern",S.size,_.size),C=T.context,P=o.createCanvasGraphics(C);if(P.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(P,s,r),C.translate(-S.scale*c,-_.scale*l),P.transform(S.scale,0,0,_.scale,0,0),C.save(),this.clipBbox(P,c,l,u,d),P.baseTransform=Et(P.ctx),P.executeOperatorList(e),P.endDrawing(),C.restore(),x||M){const i=T.canvas;x&&(b=h),M&&(y=a);const e=this.getSizeAndScale(b,this.ctx.canvas.width,A),s=this.getSizeAndScale(y,this.ctx.canvas.height,v),n=e.size,r=s.size,o=t.cachedCanvases.getCanvas("pattern-workaround",n,r),u=o.context,d=x?Math.floor(f/h):0,g=M?Math.floor(p/a):0;for(let t=0;t<=d;t++)for(let e=0;e<=g;e++)u.drawImage(i,n*t,r*e,n,r,0,0,n,r);return{canvas:o.canvas,scaleX:e.scale,scaleY:s.scale,offsetX:c,offsetY:l}}return{canvas:T.canvas,scaleX:S.scale,scaleY:_.scale,offsetX:c,offsetY:l}}getSizeAndScale(t,i,e){const s=Math.max(Ri.MAX_PATTERN_SIZE,i);let n=Math.ceil(t*e);return n>=s?n=s:e=n/t,{scale:e,size:n}}clipBbox(t,i,e,s,n){t.ctx.rect(i,e,s-i,n-e),it.axialAlignedBoundingBox([i,e,s,n],Et(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,i,e){const s=t.ctx,n=t.current;switch(i){case 1:const{fillStyle:t,strokeStyle:r}=this.ctx;s.fillStyle=n.fillColor=t,s.strokeStyle=n.strokeColor=r;break;case 2:s.fillStyle=s.strokeStyle=e,n.fillColor=n.strokeColor=e;break;default:throw new Q(`Unsupported paint type: ${i}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,i,e,s){let n=e;s!==Mi&&(n=it.transform(n,i.baseTransform),this.matrix&&(n=it.transform(n,this.matrix)));const r=this.createPatternCanvas(i);let o=new DOMMatrix(n);o=o.translate(r.offsetX,r.offsetY),o=o.scale(1/r.scaleX,1/r.scaleY);const h=t.createPattern(r.canvas,"repeat");return h.setTransform(o),h}}function Ni({src:t,srcPos:i=0,dest:e,width:s,height:n,nonBlackColor:r=4294967295,inverseDecode:o=!1}){const h=Z.isLittleEndian?4278190080:255,[a,c]=o?[r,h]:[h,r],l=s>>3,u=7&s,d=t.length;e=new Uint32Array(e.buffer);let f=0;for(let s=0;s<n;s++){for(const s=i+l;i<s;i++){const s=i<d?t[i]:255;e[f++]=128&s?c:a,e[f++]=64&s?c:a,e[f++]=32&s?c:a,e[f++]=16&s?c:a,e[f++]=8&s?c:a,e[f++]=4&s?c:a,e[f++]=2&s?c:a,e[f++]=1&s?c:a}if(0===u)continue;const s=i<d?t[i++]:255;for(let t=0;t<u;t++)e[f++]=s&1<<7-t?c:a}return{srcPos:i,destPos:f}}const Di=16,Ii=new DOMMatrix,Fi=new Float32Array(2),Oi=new Float32Array([1/0,1/0,-1/0,-1/0]);class $i{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,i,e){let s;return void 0!==this.cache[t]?(s=this.cache[t],this.canvasFactory.reset(s,i,e)):(s=this.canvasFactory.create(i,e),this.cache[t]=s),s}delete(t){delete this.cache[t]}clear(){for(const t in this.cache)this.canvasFactory.destroy(this.cache[t]),delete this.cache[t]}}function Li(t,i,e,s,n,r,o,h,a,c){const[l,u,d,f,p,g]=Et(t);if(0===u&&0===d){const w=Math.round(o*l+p),m=Math.round(h*f+g),A=Math.abs(Math.round((o+a)*l+p)-w)||1,v=Math.abs(Math.round((h+c)*f+g)-m)||1;return t.setTransform(Math.sign(l),0,0,Math.sign(f),w,m),t.drawImage(i,e,s,n,r,0,0,A,v),t.setTransform(l,u,d,f,p,g),[A,v]}if(0===l&&0===f){const w=Math.round(h*d+p),m=Math.round(o*u+g),A=Math.abs(Math.round((h+c)*d+p)-w)||1,v=Math.abs(Math.round((o+a)*u+g)-m)||1;return t.setTransform(0,Math.sign(u),Math.sign(d),0,w,m),t.drawImage(i,e,s,n,r,0,0,v,A),t.setTransform(l,u,d,f,p,g),[v,A]}return t.drawImage(i,e,s,n,r,o,h,a,c),[Math.hypot(l,u)*a,Math.hypot(d,f)*c]}class Bi{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=M;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=0;textRise=0;fillColor="#000000";strokeColor="#000000";patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";constructor(t,i){this.clipBox=new Float32Array([0,0,t,i]),this.minMax=Oi.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=yi,i=null){const e=this.minMax.slice();if(t===xi){i||B("Stroke bounding box must include transform."),it.singularValueDecompose2dScale(i,Fi);const t=Fi[0]*this.lineWidth/2,s=Fi[1]*this.lineWidth/2;e[0]-=t,e[1]-=s,e[2]+=t,e[3]+=s}return e}updateClipFromPath(){const t=it.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0),this.minMax.set(Oi,0)}getClippedPathBoundingBox(t=yi,i=null){return it.intersect(this.clipBox,this.getPathBoundingBox(t,i))}}function ji(t,i){if(i instanceof ImageData)return void t.putImageData(i,0,0);const e=i.height,s=i.width,n=e%Di,r=(e-n)/Di,o=0===n?r:r+1,h=t.createImageData(s,Di);let a,c=0;const l=i.data,u=h.data;let d,f,p,g;if(i.kind===C.GRAYSCALE_1BPP){const i=l.byteLength,e=new Uint32Array(u.buffer,0,u.byteLength>>2),g=e.length,w=s+7>>3,m=4294967295,A=Z.isLittleEndian?4278190080:255;for(d=0;d<o;d++){for(p=d<r?Di:n,a=0,f=0;f<p;f++){const t=i-c;let n=0;const r=t>w?s:8*t-7,o=-8&r;let h=0,u=0;for(;n<o;n+=8)u=l[c++],e[a++]=128&u?m:A,e[a++]=64&u?m:A,e[a++]=32&u?m:A,e[a++]=16&u?m:A,e[a++]=8&u?m:A,e[a++]=4&u?m:A,e[a++]=2&u?m:A,e[a++]=1&u?m:A;for(;n<r;n++)0===h&&(u=l[c++],h=128),e[a++]=u&h?m:A,h>>=1}for(;a<g;)e[a++]=0;t.putImageData(h,0,d*Di)}}else if(i.kind===C.RGBA_32BPP){for(f=0,g=s*Di*4,d=0;d<r;d++)u.set(l.subarray(c,c+g)),c+=g,t.putImageData(h,0,f),f+=Di;d<o&&(g=s*n*4,u.set(l.subarray(c,c+g)),t.putImageData(h,0,f))}else{if(i.kind!==C.RGB_24BPP)throw new Error(`bad image kind: ${i.kind}`);for(p=Di,g=s*p,d=0;d<o;d++){for(d>=r&&(p=n,g=s*p),a=0,f=g;f--;)u[a++]=l[c++],u[a++]=l[c++],u[a++]=l[c++],u[a++]=255;t.putImageData(h,0,d*Di)}}}function Ui(t,i){if(i.bitmap)return void t.drawImage(i.bitmap,0,0);const e=i.height,s=i.width,n=e%Di,r=(e-n)/Di,o=0===n?r:r+1,h=t.createImageData(s,Di);let a=0;const c=i.data,l=h.data;for(let i=0;i<o;i++){const e=i<r?Di:n;({srcPos:a}=Ni({src:c,srcPos:a,dest:l,width:s,height:e,nonBlackColor:0})),t.putImageData(h,0,i*Di)}}function zi(t,i){const e=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const s of e)void 0!==t[s]&&(i[s]=t[s]);void 0!==t.setLineDash&&(i.setLineDash(t.getLineDash()),i.lineDashOffset=t.lineDashOffset)}function Hi(t){t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0);const{filter:i}=t;"none"!==i&&""!==i&&(t.filter="none")}function Gi(t,i){if(i)return!0;it.singularValueDecompose2dScale(t,Fi);const e=Math.fround(Tt.pixelRatio*lt.PDF_TO_CSS_UNITS);return Fi[0]<=e&&Fi[1]<=e}const Wi=["butt","round","square"],Vi=["miter","round","bevel"],Xi={},Yi={};class Qi{constructor(t,i,e,s,n,{optionalContentConfig:r,markedContentStack:o=null},h,a){this.ctx=t,this.current=new Bi(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=i,this.objs=e,this.canvasFactory=s,this.filterFactory=n,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=r,this.cachedCanvases=new $i(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=h,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=a,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,i=null){return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):i}beginDrawing({transform:t,viewport:i,transparency:e=!1,background:s=null}){const n=this.ctx.canvas.width,r=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,n,r),this.ctx.fillStyle=o,e){const t=this.cachedCanvases.getCanvas("transparent",n,r);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...Et(this.compositeCtx))}this.ctx.save(),Hi(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=Et(this.ctx)}executeOperatorList(t,i,e,s){const n=t.argsArray,r=t.fnArray;let o=i||0;const h=n.length;if(h===o)return o;const a=h-o>10&&"function"==typeof e,c=a?Date.now()+15:0;let l=0;const u=this.commonObjs,d=this.objs;let f;for(;;){if(void 0!==s&&o===s.nextBreakPoint)return s.breakIt(o,e),o;if(f=r[o],f!==N.dependency)this[f].apply(this,n[o]);else for(const t of n[o]){const i=t.startsWith("g_")?u:d;if(!i.has(t))return i.get(t,e),o}if(o++,o===h)return o;if(a&&++l>10){if(Date.now()>c)return e(),o;l=0}}}#Ne(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#Ne(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const i of t.values())"undefined"!=typeof HTMLCanvasElement&&i instanceof HTMLCanvasElement&&(i.width=i.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#De()}#De(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const i=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=i}}}_scaleImage(t,i){const e=t.width??t.displayWidth,s=t.height??t.displayHeight;let n,r,o=Math.max(Math.hypot(i[0],i[1]),1),h=Math.max(Math.hypot(i[2],i[3]),1),a=e,c=s,l="prescale1";for(;o>2&&a>1||h>2&&c>1;){let i=a,e=c;o>2&&a>1&&(i=a>=16384?Math.floor(a/2)-1||1:Math.ceil(a/2),o/=a/i),h>2&&c>1&&(e=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,h/=c/e),n=this.cachedCanvases.getCanvas(l,i,e),r=n.context,r.clearRect(0,0,i,e),r.drawImage(t,0,0,a,c,0,0,i,e),t=n.canvas,a=i,c=e,l="prescale1"===l?"prescale2":"prescale1"}return{img:t,paintWidth:a,paintHeight:c}}_createMaskCanvas(t){const i=this.ctx,{width:e,height:s}=t,n=this.current.fillColor,r=this.current.patternFill,o=Et(i);let h,a,c,l;if((t.bitmap||t.data)&&t.count>1){const i=t.bitmap||t.data.buffer;a=JSON.stringify(r?o:[o.slice(0,4),n]),h=this._cachedBitmapsMap.get(i),h||(h=new Map,this._cachedBitmapsMap.set(i,h));const e=h.get(a);if(e&&!r)return{canvas:e,offsetX:Math.round(Math.min(o[0],o[2])+o[4]),offsetY:Math.round(Math.min(o[1],o[3])+o[5])};c=e}c||(l=this.cachedCanvases.getCanvas("maskCanvas",e,s),Ui(l.context,t));let u=it.transform(o,[1/e,0,0,-1/s,0,0]);u=it.transform(u,[1,0,0,1,0,-s]);const d=Oi.slice();it.axialAlignedBoundingBox([0,0,e,s],u,d);const[f,p,g,w]=d,m=Math.round(g-f)||1,A=Math.round(w-p)||1,v=this.cachedCanvases.getCanvas("fillCanvas",m,A),b=v.context,y=f,x=p;b.translate(-y,-x),b.transform(...u),c||(c=this._scaleImage(l.canvas,St(b)),c=c.img,h&&r&&h.set(a,c)),b.imageSmoothingEnabled=Gi(Et(b),t.interpolate),Li(b,c,0,0,c.width,c.height,0,0,e,s),b.globalCompositeOperation="source-in";const M=it.transform(St(b),[1,0,0,1,-y,-x]);return b.fillStyle=r?n.getPattern(i,this,M,yi):n,b.fillRect(0,0,e,s),h&&!r&&(this.cachedCanvases.delete("fillCanvas"),h.set(a,v.canvas)),{canvas:v.canvas,offsetX:Math.round(y),offsetY:Math.round(x)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=Wi[t]}setLineJoin(t){this.ctx.lineJoin=Vi[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,i){const e=this.ctx;void 0!==e.setLineDash&&(e.setLineDash(t),e.lineDashOffset=i)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[i,e]of t)switch(i){case"LW":this.setLineWidth(e);break;case"LC":this.setLineCap(e);break;case"LJ":this.setLineJoin(e);break;case"ML":this.setMiterLimit(e);break;case"D":this.setDash(e[0],e[1]);break;case"RI":this.setRenderingIntent(e);break;case"FL":this.setFlatness(e);break;case"Font":this.setFont(e[0],e[1]);break;case"CA":this.current.strokeAlpha=e;break;case"ca":this.ctx.globalAlpha=this.current.fillAlpha=e;break;case"BM":this.ctx.globalCompositeOperation=e;break;case"SMask":this.current.activeSMask=e?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(e)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.cachedCanvases.getCanvas("smaskGroupAt"+this.groupLevel,this.ctx.canvas.width,this.ctx.canvas.height);this.suspendedCtx=this.ctx;const i=this.ctx=t.context;i.setTransform(this.suspendedCtx.getTransform()),zi(this.suspendedCtx,i),function(t,i){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){i.save(),this.__originalSave()},t.restore=function(){i.restore(),this.__originalRestore()},t.translate=function(t,e){i.translate(t,e),this.__originalTranslate(t,e)},t.scale=function(t,e){i.scale(t,e),this.__originalScale(t,e)},t.transform=function(t,e,s,n,r,o){i.transform(t,e,s,n,r,o),this.__originalTransform(t,e,s,n,r,o)},t.setTransform=function(t,e,s,n,r,o){i.setTransform(t,e,s,n,r,o),this.__originalSetTransform(t,e,s,n,r,o)},t.resetTransform=function(){i.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){i.rotate(t),this.__originalRotate(t)},t.clip=function(t){i.clip(t),this.__originalClip(t)},t.moveTo=function(t,e){i.moveTo(t,e),this.__originalMoveTo(t,e)},t.lineTo=function(t,e){i.lineTo(t,e),this.__originalLineTo(t,e)},t.bezierCurveTo=function(t,e,s,n,r,o){i.bezierCurveTo(t,e,s,n,r,o),this.__originalBezierCurveTo(t,e,s,n,r,o)},t.rect=function(t,e,s,n){i.rect(t,e,s,n),this.__originalRect(t,e,s,n)},t.closePath=function(){i.closePath(),this.__originalClosePath()},t.beginPath=function(){i.beginPath(),this.__originalBeginPath()}}(i,this.suspendedCtx),this.setGState([["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),zi(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){this.current.activeSMask&&(t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height],this.composeSMask(this.suspendedCtx,this.current.activeSMask,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore())}composeSMask(t,i,e,s){const n=s[0],r=s[1],o=s[2]-n,h=s[3]-r;0!==o&&0!==h&&(this.genericComposeSMask(i.context,e,o,h,i.subtype,i.backdrop,i.transferMap,n,r,i.offsetX,i.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(e.canvas,0,0),t.restore())}genericComposeSMask(t,i,e,s,n,r,o,h,a,c,l){let u=t.canvas,d=h-c,f=a-l;if(r)if(d<0||f<0||d+e>u.width||f+s>u.height){const t=this.cachedCanvases.getCanvas("maskExtension",e,s),i=t.context;i.drawImage(u,-d,-f),i.globalCompositeOperation="destination-atop",i.fillStyle=r,i.fillRect(0,0,e,s),i.globalCompositeOperation="source-over",u=t.canvas,d=f=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const i=new Path2D;i.rect(d,f,e,s),t.clip(i),t.globalCompositeOperation="destination-atop",t.fillStyle=r,t.fillRect(d,f,e,s),t.restore()}i.save(),i.globalAlpha=1,i.setTransform(1,0,0,1,0,0),"Alpha"===n&&o?i.filter=this.filterFactory.addAlphaFilter(o):"Luminosity"===n&&(i.filter=this.filterFactory.addLuminosityFilter(o));const p=new Path2D;p.rect(h,a,e,s),i.clip(p),i.globalCompositeOperation="destination-in",i.drawImage(u,d,f,e,s,h,a,e,s),i.restore()}save(){this.inSMaskMode&&zi(this.ctx,this.suspendedCtx),this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0!==this.stateStack.length?(this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&zi(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null):this.inSMaskMode&&this.endSMaskMode()}transform(t,i,e,s,n,r){this.ctx.transform(t,i,e,s,n,r),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,i,e){let[s]=i;if(!e)return s||=i[0]=new Path2D,void this[t](s);if(!(s instanceof Path2D)){const t=i[0]=new Path2D;for(let i=0,e=s.length;i<e;)switch(s[i++]){case 0:t.moveTo(s[i++],s[i++]);break;case 1:t.lineTo(s[i++],s[i++]);break;case 2:t.bezierCurveTo(s[i++],s[i++],s[i++],s[i++],s[i++],s[i++]);break;case 3:t.closePath();break;default:L(`Unrecognized drawing path operator: ${s[i-1]}`)}s=t}it.axialAlignedBoundingBox(e,Et(this.ctx),this.current.minMax),this[t](s)}closePath(){this.ctx.closePath()}stroke(t,i=!0){const e=this.ctx,s=this.current.strokeColor;if(e.globalAlpha=this.current.strokeAlpha,this.contentVisible)if("object"==typeof s&&s?.getPattern){const i=s.isModifyingCurrentTransform()?e.getTransform():null;if(e.save(),e.strokeStyle=s.getPattern(e,this,St(e),xi),i){const s=new Path2D;s.addPath(t,e.getTransform().invertSelf().multiplySelf(i)),t=s}this.rescaleAndStroke(t,!1),e.restore()}else this.rescaleAndStroke(t,!0);i&&this.consumePath(t,this.current.getClippedPathBoundingBox(xi,Et(this.ctx))),e.globalAlpha=this.current.fillAlpha}closeStroke(t){this.stroke(t)}fill(t,i=!0){const e=this.ctx,s=this.current.fillColor;let n=!1;if(this.current.patternFill){const i=s.isModifyingCurrentTransform()?e.getTransform():null;if(e.save(),e.fillStyle=s.getPattern(e,this,St(e),yi),i){const s=new Path2D;s.addPath(t,e.getTransform().invertSelf().multiplySelf(i)),t=s}n=!0}const r=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==r&&(this.pendingEOFill?(e.fill(t,"evenodd"),this.pendingEOFill=!1):e.fill(t)),n&&e.restore(),i&&this.consumePath(t,r)}eoFill(t){this.pendingEOFill=!0,this.fill(t)}fillStroke(t){this.fill(t,!1),this.stroke(t,!1),this.consumePath(t)}eoFillStroke(t){this.pendingEOFill=!0,this.fillStroke(t)}closeFillStroke(t){this.fillStroke(t)}closeEOFillStroke(t){this.pendingEOFill=!0,this.fillStroke(t)}endPath(t){this.consumePath(t)}rawFillPath(t){this.ctx.fill(t)}clip(){this.pendingClip=Xi}eoClip(){this.pendingClip=Yi}beginText(){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,i=this.ctx;if(void 0===t)return;const e=new Path2D,s=i.getTransform().invertSelf();for(const{transform:i,x:n,y:r,fontSize:o,path:h}of t)e.addPath(h,new DOMMatrix(i).preMultiplySelf(s).translate(n,r).scale(o,-o));i.clip(e),delete this.pendingTextPaths}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,i){const e=this.commonObjs.get(t),s=this.current;if(!e)throw new Error(`Can't find font for ${t}`);if(s.fontMatrix=e.fontMatrix||M,0!==s.fontMatrix[0]&&0!==s.fontMatrix[3]||L("Invalid font matrix for font "+t),i<0?(i=-i,s.fontDirection=-1):s.fontDirection=1,this.current.font=e,this.current.fontSize=i,e.isType3Font)return;const n=e.loadedName||"sans-serif",r=e.systemFontInfo?.css||`"${n}", ${e.fallbackName}`;let o="normal";e.black?o="900":e.bold&&(o="bold");const h=e.italic?"italic":"normal";let a=i;i<16?a=16:i>100&&(a=100),this.current.fontSizeScale=i/a,this.ctx.font=`${h} ${o} ${a}px ${r}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,i){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=i}setLeadingMoveText(t,i){this.setLeading(-i),this.moveText(t,i)}setTextMatrix(t){const{current:i}=this;i.textMatrix=t,i.textMatrixScale=Math.hypot(t[0],t[1]),i.x=i.lineX=0,i.y=i.lineY=0}nextLine(){this.moveText(0,this.current.leading)}#Ie(t,i,e){const s=new Path2D;return s.addPath(t,new DOMMatrix(e).invertSelf().multiplySelf(i)),s}paintChar(t,i,e,s,n){const r=this.ctx,o=this.current,h=o.font,a=o.textRenderingMode,c=o.fontSize/o.fontSizeScale,l=3&a,u=!!(4&a),d=o.patternFill&&!h.missingFile,f=o.patternStroke&&!h.missingFile;let p;if((h.disableFontFace||u||d||f)&&(p=h.getPathGenerator(this.commonObjs,t)),h.disableFontFace||d||f){let t;if(r.save(),r.translate(i,e),r.scale(c,-c),0!==l&&2!==l||(s?(t=r.getTransform(),r.setTransform(...s),r.fill(this.#Ie(p,t,s))):r.fill(p)),1===l||2===l)if(n){t||=r.getTransform(),r.setTransform(...n);const{a:i,b:e,c:s,d:o}=t,h=it.inverseTransform(n),a=it.transform([i,e,s,o,0,0],h);it.singularValueDecompose2dScale(a,Fi),r.lineWidth*=Math.max(Fi[0],Fi[1])/c,r.stroke(this.#Ie(p,t,n))}else r.lineWidth/=c,r.stroke(p);r.restore()}else 0!==l&&2!==l||r.fillText(t,i,e),1!==l&&2!==l||r.strokeText(t,i,e);u&&(this.pendingTextPaths||=[]).push({transform:Et(r),x:i,y:e,fontSize:c,path:p})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const i=t.getImageData(0,0,10,10).data;let e=!1;for(let t=3;t<i.length;t+=4)if(i[t]>0&&i[t]<255){e=!0;break}return H(this,"isFontSubpixelAAEnabled",e)}showText(t){const i=this.current,e=i.font;if(e.isType3Font)return this.showType3Text(t);const s=i.fontSize;if(0===s)return;const n=this.ctx,r=i.fontSizeScale,o=i.charSpacing,h=i.wordSpacing,a=i.fontDirection,c=i.textHScale*a,l=t.length,u=e.vertical,d=u?1:-1,f=e.defaultVMetrics,p=s*i.fontMatrix[0],g=0===i.textRenderingMode&&!e.disableFontFace&&!i.patternFill;let w,m;if(n.save(),i.textMatrix&&n.transform(...i.textMatrix),n.translate(i.x,i.y+i.textRise),n.scale(c,a>0?-1:1),i.patternFill){n.save();const t=i.fillColor.getPattern(n,this,St(n),yi);w=Et(n),n.restore(),n.fillStyle=t}if(i.patternStroke){n.save();const t=i.strokeColor.getPattern(n,this,St(n),xi);m=Et(n),n.restore(),n.strokeStyle=t}let A=i.lineWidth;const v=i.textMatrixScale;if(0===v||0===A){const t=3&i.textRenderingMode;1!==t&&2!==t||(A=this.getSinglePixelWidth())}else A/=v;if(1!==r&&(n.scale(r,r),A/=r),n.lineWidth=A,e.isInvalidPDFjsFont){const e=[];let s=0;for(const i of t)e.push(i.unicode),s+=i.width;return n.fillText(e.join(""),0,0),i.x+=s*p*c,n.restore(),void this.compose()}let b,y=0;for(b=0;b<l;++b){const i=t[b];if("number"==typeof i){y+=d*i*s/1e3;continue}let c=!1;const l=(i.isSpace?h:0)+o,A=i.fontChar,v=i.accent;let x,M,k=i.width;if(u){const t=i.vmetric||f,e=-(i.vmetric?t[1]:.5*k)*p;k=t?-t[0]:k,x=e/r,M=(y+t[2]*p)/r}else x=y/r,M=0;if(e.remeasure&&k>0){const t=1e3*n.measureText(A).width/s*r;if(k<t&&this.isFontSubpixelAAEnabled){const i=k/t;c=!0,n.save(),n.scale(i,1),x/=i}else k!==t&&(x+=(k-t)/2e3*s/r)}this.contentVisible&&(i.isInFont||e.missingFile)&&(g&&!v?n.fillText(A,x,M):(this.paintChar(A,x,M,w,m),v&&this.paintChar(v.fontChar,x+s*v.offset.x/r,M-s*v.offset.y/r,w,m))),y+=u?k*p-l*a:k*p+l*a,c&&n.restore()}u?i.y-=y:i.x+=y*c,n.restore(),this.compose()}showType3Text(t){const i=this.ctx,e=this.current,s=e.font,n=e.fontSize,r=e.fontDirection,o=s.vertical?1:-1,h=e.charSpacing,a=e.wordSpacing,c=e.textHScale*r,l=e.fontMatrix||M,u=t.length;let d,f,p,g;if(3!==e.textRenderingMode&&0!==n){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),e.textMatrix&&i.transform(...e.textMatrix),i.translate(e.x,e.y+e.textRise),i.scale(c,r),d=0;d<u;++d){if(f=t[d],"number"==typeof f){g=o*f*n/1e3,this.ctx.translate(g,0),e.x+=g*c;continue}const r=(f.isSpace?a:0)+h,u=s.charProcOperatorList[f.operatorListId];u?this.contentVisible&&(this.save(),i.scale(n,n),i.transform(...l),this.executeOperatorList(u),this.restore()):L(`Type3 character "${f.operatorListId}" is not available.`);const w=[f.width,0];it.applyTransform(w,l),p=w[0]*n+r,i.translate(p,0),e.x+=p*c}i.restore()}}setCharWidth(t,i){}setCharWidthAndBounds(t,i,e,s,n,r){const o=new Path2D;o.rect(e,s,n-e,r-s),this.ctx.clip(o),this.endPath()}getColorN_Pattern(t){let i;if("TilingPattern"===t[0]){const e=this.baseTransform||Et(this.ctx);i=new Ri(t,this.ctx,{createCanvasGraphics:t=>new Qi(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})},e)}else i=this._getPattern(t[1],t[2]);return i}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments),this.current.patternStroke=!0}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t){this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t){this.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,i=null){let e;return this.cachedPatterns.has(t)?e=this.cachedPatterns.get(t):(e=function(t){switch(t[0]){case"RadialAxial":return new Si(t);case"Mesh":return new Ci(t);case"Dummy":return new Pi}throw new Error(`Unknown IR type: ${t[0]}`)}(this.getObject(t)),this.cachedPatterns.set(t,e)),i&&(e.matrix=i),e}shadingFill(t){if(!this.contentVisible)return;const i=this.ctx;this.save();const e=this._getPattern(t);i.fillStyle=e.getPattern(i,this,St(i),Mi);const s=St(i);if(s){const{width:t,height:e}=i.canvas,n=Oi.slice();it.axialAlignedBoundingBox([0,0,t,e],s,n);const[r,o,h,a]=n;this.ctx.fillRect(r,o,h-r,a-o)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){B("Should not call beginInlineImage")}beginImageData(){B("Should not call beginImageData")}paintFormXObjectBegin(t,i){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=Et(this.ctx),i)){it.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);const[t,e,s,n]=i,r=new Path2D;r.rect(t,e,s-t,n-e),this.ctx.clip(r),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const i=this.ctx;t.isolated||$("TODO: Support non-isolated groups."),t.knockout&&L("Knockout groups not supported.");const e=Et(i);if(t.matrix&&i.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let s=Oi.slice();it.axialAlignedBoundingBox(t.bbox,Et(i),s),s=it.intersect(s,[0,0,i.canvas.width,i.canvas.height])||[0,0,0,0];const n=Math.floor(s[0]),r=Math.floor(s[1]),o=Math.max(Math.ceil(s[2])-n,1),h=Math.max(Math.ceil(s[3])-r,1);this.current.startNewPathAndClipBox([0,0,o,h]);let a="groupAt"+this.groupLevel;t.smask&&(a+="_smask_"+this.smaskCounter++%2);const c=this.cachedCanvases.getCanvas(a,o,h),l=c.context;l.translate(-n,-r),l.transform(...e);let u=new Path2D;const[d,f,p,g]=t.bbox;if(u.rect(d,f,p-d,g-f),t.matrix){const i=new Path2D;i.addPath(u,new DOMMatrix(t.matrix)),u=i}l.clip(u),t.smask?this.smaskStack.push({canvas:c.canvas,context:l,offsetX:n,offsetY:r,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(i.setTransform(1,0,0,1,0,0),i.translate(n,r),i.save()),zi(i,l),this.ctx=l,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(i),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const i=this.ctx,e=this.groupStack.pop();if(this.ctx=e,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=Et(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const e=Oi.slice();it.axialAlignedBoundingBox([0,0,i.canvas.width,i.canvas.height],t,e),this.ctx.drawImage(i.canvas,0,0),this.ctx.restore(),this.compose(e)}}beginAnnotation(t,i,e,s,n){if(this.#Ne(),Hi(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),i){const s=i[2]-i[0],r=i[3]-i[1];if(n&&this.annotationCanvasMap){(e=e.slice())[4]-=i[0],e[5]-=i[1],(i=i.slice())[0]=i[1]=0,i[2]=s,i[3]=r,it.singularValueDecompose2dScale(Et(this.ctx),Fi);const{viewportScale:n}=this,o=Math.ceil(s*this.outputScaleX*n),h=Math.ceil(r*this.outputScaleY*n);this.annotationCanvas=this.canvasFactory.create(o,h);const{canvas:a,context:c}=this.annotationCanvas;this.annotationCanvasMap.set(t,a),this.annotationCanvas.savedCtx=this.ctx,this.ctx=c,this.ctx.save(),this.ctx.setTransform(Fi[0],0,0,-Fi[1],0,r*Fi[1]),Hi(this.ctx)}else{Hi(this.ctx),this.endPath();const t=new Path2D;t.rect(i[0],i[1],s,r),this.ctx.clip(t)}}this.current=new Bi(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...e),this.transform(...s)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#De(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const i=t.count;(t=this.getObject(t.data,t)).count=i;const e=this.ctx,s=this._createMaskCanvas(t),n=s.canvas;e.save(),e.setTransform(1,0,0,1,0,0),e.drawImage(n,s.offsetX,s.offsetY),e.restore(),this.compose()}paintImageMaskXObjectRepeat(t,i,e=0,s=0,n,r){if(!this.contentVisible)return;t=this.getObject(t.data,t);const o=this.ctx;o.save();const h=Et(o);o.transform(i,e,s,n,0,0);const a=this._createMaskCanvas(t);o.setTransform(1,0,0,1,a.offsetX-h[4],a.offsetY-h[5]);for(let t=0,c=r.length;t<c;t+=2){const c=it.transform(h,[i,e,s,n,r[t],r[t+1]]);o.drawImage(a.canvas,c[4],c[5])}o.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const i=this.ctx,e=this.current.fillColor,s=this.current.patternFill;for(const n of t){const{data:t,width:r,height:o,transform:h}=n,a=this.cachedCanvases.getCanvas("maskCanvas",r,o),c=a.context;c.save(),Ui(c,this.getObject(t,n)),c.globalCompositeOperation="source-in",c.fillStyle=s?e.getPattern(c,this,St(i),yi):e,c.fillRect(0,0,r,o),c.restore(),i.save(),i.transform(...h),i.scale(1,-1),Li(i,a.canvas,0,0,r,o,0,-1,1,1),i.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const i=this.getObject(t);i?this.paintInlineImageXObject(i):L("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,i,e,s){if(!this.contentVisible)return;const n=this.getObject(t);if(!n)return void L("Dependent image isn't ready yet");const r=n.width,o=n.height,h=[];for(let t=0,n=s.length;t<n;t+=2)h.push({transform:[i,0,0,e,s[t],s[t+1]],x:0,y:0,w:r,h:o});this.paintInlineImageXObjectGroup(n,h)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;const{bitmap:i,width:e,height:s}=t,n=this.cachedCanvases.getCanvas("inlineImage",e,s),r=n.context;return r.filter=this.current.transferMaps,r.drawImage(i,0,0),r.filter="none",n.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const i=t.width,e=t.height,s=this.ctx;this.save();const{filter:n}=s;let r;if("none"!==n&&""!==n&&(s.filter="none"),s.scale(1/i,-1/e),t.bitmap)r=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)r=t;else{const s=this.cachedCanvases.getCanvas("inlineImage",i,e).context;ji(s,t),r=this.applyTransferMapsToCanvas(s)}const o=this._scaleImage(r,St(s));s.imageSmoothingEnabled=Gi(Et(s),t.interpolate),Li(s,o.img,0,0,o.paintWidth,o.paintHeight,0,-e,i,e),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,i){if(!this.contentVisible)return;const e=this.ctx;let s;if(t.bitmap)s=t.bitmap;else{const i=this.cachedCanvases.getCanvas("inlineImage",t.width,t.height).context;ji(i,t),s=this.applyTransferMapsToCanvas(i)}for(const t of i)e.save(),e.transform(...t.transform),e.scale(1,-1),Li(e,s,t.x,t.y,t.w,t.h,0,-1,1,1),e.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,i){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,i){this.markedContentStack.push("OC"===t?{visible:this.optionalContentConfig.isVisible(i)}:{visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t,i){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(i);const s=this.ctx;this.pendingClip&&(e||(this.pendingClip===Yi?s.clip(t,"evenodd"):s.clip(t)),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Et(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const i=Math.abs(t[0]*t[3]-t[2]*t[1]),e=Math.hypot(t[0],t[2]),s=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(e,s)/i}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:t}=this.current,{a:i,b:e,c:s,d:n}=this.ctx.getTransform();let r,o;if(0===e&&0===s){const e=Math.abs(i),s=Math.abs(n);if(e===s)if(0===t)r=o=1/e;else{const i=e*t;r=o=i<1?1/i:1}else if(0===t)r=1/e,o=1/s;else{const i=e*t,n=s*t;r=i<1?1/i:1,o=n<1?1/n:1}}else{const h=Math.abs(i*n-e*s),a=Math.hypot(i,e),c=Math.hypot(s,n);if(0===t)r=c/h,o=a/h;else{const i=t*h;r=c>i?c/i:1,o=a>i?a/i:1}}this._cachedScaleForStroking[0]=r,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(t,i){const{ctx:e,current:{lineWidth:s}}=this,[n,r]=this.getScaleForStroking();if(n===r)return e.lineWidth=(s||1)*n,void e.stroke(t);const o=e.getLineDash();i&&e.save(),e.scale(n,r),Ii.a=1/n,Ii.d=1/r;const h=new Path2D;if(h.addPath(t,Ii),o.length>0){const t=Math.max(n,r);e.setLineDash(o.map((i=>i/t))),e.lineDashOffset/=t}e.lineWidth=s||1,e.stroke(h),i&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const t in N)void 0!==Qi.prototype[t]&&(Qi.prototype[N[t]]=Qi.prototype[t]);class qi{static#Fe=null;static#Oe="";static get workerPort(){return this.#Fe}static set workerPort(t){if(!("undefined"!=typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");this.#Fe=t}static get workerSrc(){return this.#Oe}static set workerSrc(t){if("string"!=typeof t)throw new Error("Invalid `workerSrc` type.");this.#Oe=t}}class Ki{#$e;#Le;constructor({parsedData:t,rawData:i}){this.#$e=t,this.#Le=i}getRaw(){return this.#Le}get(t){return this.#$e.get(t)??null}[Symbol.iterator](){return this.#$e.entries()}}const Ji=Symbol("INTERNAL");class Zi{#Be=!1;#je=!1;#Ue=!1;#ze=!0;constructor(t,{name:i,intent:e,usage:s,rbGroups:n}){this.#Be=!!(2&t),this.#je=!!(4&t),this.name=i,this.intent=e,this.usage=s,this.rbGroups=n}get visible(){if(this.#Ue)return this.#ze;if(!this.#ze)return!1;const{print:t,view:i}=this.usage;return this.#Be?"OFF"!==i?.viewState:!this.#je||"OFF"!==t?.printState}_setVisible(t,i,e=!1){t!==Ji&&B("Internal method `_setVisible` called."),this.#Ue=e,this.#ze=i}}class te{#He=null;#Ge=new Map;#We=null;#Ve=null;constructor(t,i=2){if(this.renderingIntent=i,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,this.#Ve=t.order;for(const e of t.groups)this.#Ge.set(e.id,new Zi(i,e));if("OFF"===t.baseState)for(const t of this.#Ge.values())t._setVisible(Ji,!1);for(const i of t.on)this.#Ge.get(i)._setVisible(Ji,!0);for(const i of t.off)this.#Ge.get(i)._setVisible(Ji,!1);this.#We=this.getHash()}}#Xe(t){const i=t.length;if(i<2)return!0;const e=t[0];for(let s=1;s<i;s++){const i=t[s];let n;if(Array.isArray(i))n=this.#Xe(i);else{if(!this.#Ge.has(i))return L(`Optional content group not found: ${i}`),!0;n=this.#Ge.get(i).visible}switch(e){case"And":if(!n)return!1;break;case"Or":if(n)return!0;break;case"Not":return!n;default:return!0}}return"And"===e}isVisible(t){if(0===this.#Ge.size)return!0;if(!t)return $("Optional content group not defined."),!0;if("OCG"===t.type)return this.#Ge.has(t.id)?this.#Ge.get(t.id).visible:(L(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return this.#Xe(t.expression);if(!t.policy||"AnyOn"===t.policy){for(const i of t.ids){if(!this.#Ge.has(i))return L(`Optional content group not found: ${i}`),!0;if(this.#Ge.get(i).visible)return!0}return!1}if("AllOn"===t.policy){for(const i of t.ids){if(!this.#Ge.has(i))return L(`Optional content group not found: ${i}`),!0;if(!this.#Ge.get(i).visible)return!1}return!0}if("AnyOff"===t.policy){for(const i of t.ids){if(!this.#Ge.has(i))return L(`Optional content group not found: ${i}`),!0;if(!this.#Ge.get(i).visible)return!0}return!1}if("AllOff"===t.policy){for(const i of t.ids){if(!this.#Ge.has(i))return L(`Optional content group not found: ${i}`),!0;if(this.#Ge.get(i).visible)return!1}return!0}return L(`Unknown optional content policy ${t.policy}.`),!0}return L(`Unknown group type ${t.type}.`),!0}setVisibility(t,i=!0,e=!0){const s=this.#Ge.get(t);if(s){if(e&&i&&s.rbGroups.length)for(const i of s.rbGroups)for(const e of i)e!==t&&this.#Ge.get(e)?._setVisible(Ji,!1,!0);s._setVisible(Ji,!!i,!0),this.#He=null}else L(`Optional content group not found: ${t}`)}setOCGState({state:t,preserveRB:i}){let e;for(const s of t){switch(s){case"ON":case"OFF":case"Toggle":e=s;continue}const t=this.#Ge.get(s);if(t)switch(e){case"ON":this.setVisibility(s,!0,i);break;case"OFF":this.setVisibility(s,!1,i);break;case"Toggle":this.setVisibility(s,!t.visible,i)}}this.#He=null}get hasInitialVisibility(){return null===this.#We||this.getHash()===this.#We}getOrder(){return this.#Ge.size?this.#Ve?this.#Ve.slice():[...this.#Ge.keys()]:null}getGroup(t){return this.#Ge.get(t)||null}getHash(){if(null!==this.#He)return this.#He;const t=new Vt;for(const[i,e]of this.#Ge)t.update(`${i}:${e.visible}`);return this.#He=t.hexdigest()}[Symbol.iterator](){return this.#Ge.entries()}}class ie{constructor(t,{disableRange:i=!1,disableStream:e=!1}){j(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:n,progressiveDone:r,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=r,this._contentDispositionFilename=o,n?.length>0){const t=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!e,this._isRangeSupported=!i,this._contentLength=s,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener(((t,i)=>{this._onReceiveData({begin:t,chunk:i})})),t.addProgressListener(((t,i)=>{this._onProgress({loaded:t,total:i})})),t.addProgressiveReadListener((t=>{this._onReceiveData({chunk:t})})),t.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),t.transportReady()}_onReceiveData({begin:t,chunk:i}){const e=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;void 0===t?this._fullRequestReader?this._fullRequestReader._enqueue(e):this._queuedChunks.push(e):j(this._rangeReaders.some((function(i){return i._begin===t&&(i._enqueue(e),!0)})),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const i=this._rangeReaders.indexOf(t);i>=0&&this._rangeReaders.splice(i,1)}getFullReader(){j(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new ee(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,i){if(i<=this._progressiveDataLength)return null;const e=new se(this,t,i);return this._pdfDataRangeTransport.requestDataRange(t,i),this._rangeReaders.push(e),e}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const i of this._rangeReaders.slice(0))i.cancel(t);this._pdfDataRangeTransport.abort()}}class ee{constructor(t,i,e=!1,s=null){this._stream=t,this._done=e||!1,this._filename=gt(s)?s:null,this._queuedChunks=i||[],this._loaded=0;for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class se{constructor(t,i,e){this._stream=t,this._begin=i,this._end=e,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function ne(t,i){const e=new Headers;if(!t||!i||"object"!=typeof i)return e;for(const t in i){const s=i[t];void 0!==s&&e.append(t,s)}return e}function re(t){return URL.parse(t)?.origin??null}function oe({responseHeaders:t,isHttp:i,rangeChunkSize:e,disableRange:s}){const n={allowRangeRequests:!1,suggestedLength:void 0},r=parseInt(t.get("Content-Length"),10);return Number.isInteger(r)?(n.suggestedLength=r,r<=2*e||s||!i||"bytes"!==t.get("Accept-Ranges")||"identity"!==(t.get("Content-Encoding")||"identity")||(n.allowRangeRequests=!0),n):n}function he(t){const i=t.get("Content-Disposition");if(i){let t=function(t){let i=!0,e=s("filename\\*","i").exec(t);if(e){e=e[1];let t=o(e);return t=unescape(t),t=h(t),t=a(t),r(t)}if(e=function(t){const i=[];let e;const n=s("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(e=n.exec(t));){let[,t,s,n]=e;if(t=parseInt(t,10),t in i){if(0===t)break}else i[t]=[s,n]}const r=[];for(let t=0;t<i.length&&t in i;++t){let[e,s]=i[t];s=o(s),e&&(s=unescape(s),0===t&&(s=h(s))),r.push(s)}return r.join("")}(t),e)return r(a(e));if(e=s("filename","i").exec(t),e){e=e[1];let t=o(e);return t=a(t),r(t)}function s(t,i){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',i)}function n(t,e){if(t){if(!/^[\x00-\xFF]+$/.test(e))return e;try{const s=new TextDecoder(t,{fatal:!0}),n=J(e);e=s.decode(n),i=!1}catch{}}return e}function r(t){return i&&/[\x80-\xff]/.test(t)&&(t=n("utf-8",t),i&&(t=n("iso-8859-1",t))),t}function o(t){if(t.startsWith('"')){const i=t.slice(1).split('\\"');for(let t=0;t<i.length;++t){const e=i[t].indexOf('"');-1!==e&&(i[t]=i[t].slice(0,e),i.length=t+1),i[t]=i[t].replaceAll(/\\(.)/g,"$1")}t=i.join('"')}return t}function h(t){const i=t.indexOf("'");return-1===i?t:n(t.slice(0,i),t.slice(i+1).replace(/^[^']*'/,""))}function a(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,i,e,s){if("q"===e||"Q"===e)return n(i,s=(s=s.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,(function(t,i){return String.fromCharCode(parseInt(i,16))})));try{s=atob(s)}catch{}return n(i,s)}))}return""}(i);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(gt(t))return t}return null}function ae(t,i){return new Y(`Unexpected server response (${t}) while retrieving PDF "${i}".`,t,404===t||0===t&&i.startsWith("file:"))}function ce(t){return 200===t||206===t}function le(t,i,e){return{method:"GET",headers:t,signal:e.signal,mode:"cors",credentials:i?"include":"same-origin",redirect:"follow"}}function ue(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(L(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class de{_responseOrigin=null;constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=ne(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return j(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new fe(this),this._fullRequestReader}getRangeReader(t,i){if(i<=this._progressiveDataLength)return null;const e=new pe(this,t,i);return this._rangeRequestReaders.push(e),e}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class fe{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const i=t.source;this._withCredentials=i.withCredentials||!1,this._contentLength=i.length,this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange;const e=new Headers(t.headers),s=i.url;fetch(s,le(e,this._withCredentials,this._abortController)).then((i=>{if(t._responseOrigin=re(i.url),!ce(i.status))throw ae(i.status,s);this._reader=i.body.getReader(),this._headersCapability.resolve();const e=i.headers,{allowRangeRequests:n,suggestedLength:r}=oe({responseHeaders:e,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=r||this._contentLength,this._filename=he(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new q("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:i}=await this._reader.read();return i?{value:t,done:i}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:ue(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class pe{constructor(t,i,e){this._stream=t,this._reader=null,this._loaded=0;const s=t.source;this._withCredentials=s.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!s.disableStream,this._abortController=new AbortController;const n=new Headers(t.headers);n.append("Range",`bytes=${i}-${e-1}`);const r=s.url;fetch(r,le(n,this._withCredentials,this._abortController)).then((i=>{const e=re(i.url);if(e!==t._responseOrigin)throw new Error(`Expected range response-origin "${e}" to match "${t._responseOrigin}".`);if(!ce(i.status))throw ae(i.status,r);this._readCapability.resolve(),this._reader=i.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:i}=await this._reader.read();return i?{value:t,done:i}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:ue(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class ge{_responseOrigin=null;constructor({url:t,httpHeaders:i,withCredentials:e}){this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=ne(this.isHttp,i),this.withCredentials=e||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){const i=new XMLHttpRequest,e=this.currXhrId++,s=this.pendingRequests[e]={xhr:i};i.open("GET",this.url),i.withCredentials=this.withCredentials;for(const[t,e]of this.headers)i.setRequestHeader(t,e);return this.isHttp&&"begin"in t&&"end"in t?(i.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),s.expectedStatus=206):s.expectedStatus=200,i.responseType="arraybuffer",j(t.onError,"Expected `onError` callback to be provided."),i.onerror=()=>{t.onError(i.status)},i.onreadystatechange=this.onStateChange.bind(this,e),i.onprogress=this.onProgress.bind(this,e),s.onHeadersReceived=t.onHeadersReceived,s.onDone=t.onDone,s.onError=t.onError,s.onProgress=t.onProgress,i.send(null),e}onProgress(t,i){const e=this.pendingRequests[t];e&&e.onProgress?.(i)}onStateChange(t,i){const e=this.pendingRequests[t];if(!e)return;const s=e.xhr;if(s.readyState>=2&&e.onHeadersReceived&&(e.onHeadersReceived(),delete e.onHeadersReceived),4!==s.readyState)return;if(!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===s.status&&this.isHttp)return void e.onError(s.status);const n=s.status||200;if((200!==n||206!==e.expectedStatus)&&n!==e.expectedStatus)return void e.onError(s.status);const r=function(t){const i=t.response;return"string"!=typeof i?i:J(i).buffer}(s);if(206===n){const t=s.getResponseHeader("Content-Range"),i=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);i?e.onDone({begin:parseInt(i[1],10),chunk:r}):(L('Missing or invalid "Content-Range" header.'),e.onError(0))}else r?e.onDone({begin:0,chunk:r}):e.onError(s.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const i=this.pendingRequests[t].xhr;delete this.pendingRequests[t],i.abort()}}class we{constructor(t){this._source=t,this._manager=new ge(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const i=this._rangeRequestReaders.indexOf(t);i>=0&&this._rangeRequestReaders.splice(i,1)}getFullReader(){return j(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new me(this._manager,this._source),this._fullRequestReader}getRangeReader(t,i){const e=new Ae(this._manager,t,i);return e.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(e),e}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class me{constructor(t,i){this._manager=t,this._url=i.url,this._fullRequestId=t.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._contentLength=i.length,this._rangeChunkSize=i.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,i=this._manager.getRequestXhr(t);this._manager._responseOrigin=re(i.responseURL);const e=i.getAllResponseHeaders(),s=new Headers(e?e.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map((t=>{const[i,...e]=t.split(": ");return[i,e.join(": ")]})):[]),{allowRangeRequests:n,suggestedLength:r}=oe({responseHeaders:s,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=r||this._contentLength,this._filename=he(s),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=ae(t,this._url),this._headersCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class Ae{constructor(t,i,e){this._manager=t,this._url=t.url,this._requestId=t.request({begin:i,end:e,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){const t=re(this._manager.getRequestXhr(this._requestId)?.responseURL);t!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(t){const i=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:i,done:!1}):this._queuedChunk=i,this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError??=ae(t,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const ve=/^[a-z][a-z0-9\-+.]+:/i;class be{constructor(t){this.source=t,this.url=function(t){if(ve.test(t))return new URL(t);const i=process.getBuiltinModule("url");return new URL(i.pathToFileURL(t))}(t.url),j("file:"===this.url.protocol,"PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return j(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new ye(this),this._fullRequestReader}getRangeReader(t,i){if(i<=this._progressiveDataLength)return null;const e=new xe(this,t,i);return this._rangeRequestReaders.push(e),e}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class ye{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const i=t.source;this._contentLength=i.length,this._loaded=0,this._filename=null,this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const e=process.getBuiltinModule("fs");e.promises.lstat(this._url).then((t=>{this._contentLength=t.size,this._setReadableStream(e.createReadStream(this._url)),this._headersCapability.resolve()}),(t=>{"ENOENT"===t.code&&(t=ae(0,this._url.href)),this._storedError=t,this._headersCapability.reject(t)}))}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new q("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class xe{constructor(t,i,e){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!t.source.disableStream;const s=process.getBuiltinModule("fs");this._setReadableStream(s.createReadStream(this._url,{start:i,end:e-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),this._storedError&&this._readableStream.destroy(this._storedError)}}const Me=Symbol("INITIAL_DATA");class ke{#Ye=Object.create(null);#Qe(t){return this.#Ye[t]||={...Promise.withResolvers(),data:Me}}get(t,i=null){if(i){const e=this.#Qe(t);return e.promise.then((()=>i(e.data))),null}const e=this.#Ye[t];if(!e||e.data===Me)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return e.data}has(t){const i=this.#Ye[t];return!!i&&i.data!==Me}delete(t){const i=this.#Ye[t];return!(!i||i.data===Me||(delete this.#Ye[t],0))}resolve(t,i=null){const e=this.#Qe(t);e.data=i,e.resolve()}clear(){for(const t in this.#Ye){const{data:i}=this.#Ye[t];i?.bitmap?.close()}this.#Ye=Object.create(null)}*[Symbol.iterator](){for(const t in this.#Ye){const{data:i}=this.#Ye[t];i!==Me&&(yield[t,i])}}}class Ee{#qe=Promise.withResolvers();#wt=null;#Ke=!1;#Je=!!globalThis.FontInspector?.enabled;#Ze=null;#ts=null;#is=0;#es=0;#ss=null;#ns=null;#rs=0;#os=0;#hs=Object.create(null);#as=[];#cs=null;#ls=[];#us=new WeakMap;#ds=null;static#fs=new Map;static#ps=new Map;static#gs=new WeakMap;static#ws=null;static#ms=new Set;constructor({textContentSource:t,container:i,viewport:e}){if(t instanceof ReadableStream)this.#cs=t;else{if("object"!=typeof t)throw new Error('No "textContentSource" parameter specified.');this.#cs=new ReadableStream({start(i){i.enqueue(t),i.close()}})}this.#wt=this.#ns=i,this.#os=e.scale*Tt.pixelRatio,this.#rs=e.rotation,this.#ts={div:null,properties:null,ctx:null};const{pageWidth:s,pageHeight:n,pageX:r,pageY:o}=e.rawDims;this.#ds=[1,0,0,-1,-r,o+n],this.#es=s,this.#is=n,Ee.#As(),_t(i,e),this.#qe.promise.finally((()=>{Ee.#ms.delete(this),this.#ts=null,this.#hs=null})).catch((()=>{}))}static get fontFamilyMap(){const{isWindows:t,isFirefox:i}=Z.platform;return H(this,"fontFamilyMap",new Map([["sans-serif",(t&&i?"Calibri, ":"")+"sans-serif"],["monospace",(t&&i?"Lucida Console, ":"")+"monospace"]]))}render(){const t=()=>{this.#ss.read().then((({value:i,done:e})=>{e?this.#qe.resolve():(this.#Ze??=i.lang,Object.assign(this.#hs,i.styles),this.#vs(i.items),t())}),this.#qe.reject)};return this.#ss=this.#cs.getReader(),Ee.#ms.add(this),t(),this.#qe.promise}update({viewport:t,onBefore:i=null}){const e=t.scale*Tt.pixelRatio,s=t.rotation;if(s!==this.#rs&&(i?.(),this.#rs=s,_t(this.#ns,{rotation:s})),e!==this.#os){i?.(),this.#os=e;const t={div:null,properties:null,ctx:Ee.#bs(this.#Ze)};for(const i of this.#ls)t.properties=this.#us.get(i),t.div=i,this.#ys(t)}}cancel(){const t=new q("TextLayer task cancelled.");this.#ss?.cancel(t).catch((()=>{})),this.#ss=null,this.#qe.reject(t)}get textDivs(){return this.#ls}get textContentItemsStr(){return this.#as}#vs(t){if(this.#Ke)return;this.#ts.ctx??=Ee.#bs(this.#Ze);const i=this.#ls,e=this.#as;for(const s of t){if(i.length>1e5)return L("Ignoring additional textDivs for performance reasons."),void(this.#Ke=!0);if(void 0!==s.str)e.push(s.str),this.#xs(s);else if("beginMarkedContentProps"===s.type||"beginMarkedContent"===s.type){const t=this.#wt;this.#wt=document.createElement("span"),this.#wt.classList.add("markedContent"),null!==s.id&&this.#wt.setAttribute("id",`${s.id}`),t.append(this.#wt)}else"endMarkedContent"===s.type&&(this.#wt=this.#wt.parentNode)}}#xs(t){const i=document.createElement("span"),e={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};this.#ls.push(i);const s=it.transform(this.#ds,t.transform);let n=Math.atan2(s[1],s[0]);const r=this.#hs[t.fontName];r.vertical&&(n+=Math.PI/2);let o=this.#Je&&r.fontSubstitution||r.fontFamily;o=Ee.fontFamilyMap.get(o)||o;const h=Math.hypot(s[2],s[3]),a=h*Ee.#Ms(o,r,this.#Ze);let c,l;0===n?(c=s[4],l=s[5]-a):(c=s[4]+a*Math.sin(n),l=s[5]-a*Math.cos(n));const u="calc(var(--total-scale-factor) *",d=i.style;this.#wt===this.#ns?(d.left=`${(100*c/this.#es).toFixed(2)}%`,d.top=`${(100*l/this.#is).toFixed(2)}%`):(d.left=`${u}${c.toFixed(2)}px)`,d.top=`${u}${l.toFixed(2)}px)`),d.fontSize=`${u}${(Ee.#ws*h).toFixed(2)}px)`,d.fontFamily=o,e.fontSize=h,i.setAttribute("role","presentation"),i.textContent=t.str,i.dir=t.dir,this.#Je&&(i.dataset.fontName=r.fontSubstitutionLoadedName||t.fontName),0!==n&&(e.angle=n*(180/Math.PI));let f=!1;if(t.str.length>1)f=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const i=Math.abs(t.transform[0]),e=Math.abs(t.transform[3]);i!==e&&Math.max(i,e)/Math.min(i,e)>1.5&&(f=!0)}if(f&&(e.canvasWidth=r.vertical?t.height:t.width),this.#us.set(i,e),this.#ts.div=i,this.#ts.properties=e,this.#ys(this.#ts),e.hasText&&this.#wt.append(i),e.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),this.#wt.append(t)}}#ys(t){const{div:i,properties:e,ctx:s}=t,{style:n}=i;let r="";if(Ee.#ws>1&&(r=`scale(${1/Ee.#ws})`),0!==e.canvasWidth&&e.hasText){const{fontFamily:t}=n,{canvasWidth:o,fontSize:h}=e;Ee.#ks(s,h*this.#os,t);const{width:a}=s.measureText(i.textContent);a>0&&(r=`scaleX(${o*this.#os/a}) ${r}`)}0!==e.angle&&(r=`rotate(${e.angle}deg) ${r}`),r.length>0&&(n.transform=r)}static cleanup(){if(!(this.#ms.size>0)){this.#fs.clear();for(const{canvas:t}of this.#ps.values())t.remove();this.#ps.clear()}}static#bs(t=null){let i=this.#ps.get(t||="");if(!i){const e=document.createElement("canvas");e.className="hiddenCanvasElement",e.lang=t,document.body.append(e),i=e.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#ps.set(t,i),this.#gs.set(i,{size:0,family:""})}return i}static#ks(t,i,e){const s=this.#gs.get(t);i===s.size&&e===s.family||(t.font=`${i}px ${e}`,s.size=i,s.family=e)}static#As(){if(null!==this.#ws)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),this.#ws=t.getBoundingClientRect().height,t.remove()}static#Ms(t,i,e){const s=this.#fs.get(t);if(s)return s;const n=this.#bs(e);n.canvas.width=n.canvas.height=30,this.#ks(n,30,t);const r=n.measureText(""),o=r.fontBoundingBoxAscent,h=Math.abs(r.fontBoundingBoxDescent);n.canvas.width=n.canvas.height=0;let a=.8;return o?a=o/(o+h):(Z.platform.isFirefox&&L("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),i.ascent?a=i.ascent:i.descent&&(a=1+i.descent)),this.#fs.set(t,a),a}}class Se{static textContent(t){const i=[],e={items:i,styles:Object.create(null)};return function t(e){if(!e)return;let s=null;const n=e.name;if("#text"===n)s=e.value;else{if(!Se.shouldBuildText(n))return;e?.attributes?.textContent?s=e.attributes.textContent:e.value&&(s=e.value)}if(null!==s&&i.push({str:s}),e.children)for(const i of e.children)t(i)}(t),e}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}function _e(t={}){"string"==typeof t||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const i=new Te,{docId:e}=i,s=t.url?function(t){if(t instanceof URL)return t.href;if("string"==typeof t){if(x)return t;const i=URL.parse(t,window.location);if(i)return i.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url):null,n=t.data?function(t){if(x&&"undefined"!=typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return J(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"==typeof t&&!isNaN(t?.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(t.data):null,r=t.httpHeaders||null,o=!0===t.withCredentials,h=t.password??null,a=t.range instanceof Ce?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:65536;let l=t.worker instanceof Ne?t.worker:null;const u=t.verbosity,d="string"!=typeof t.docBaseUrl||pt(t.docBaseUrl)?null:t.docBaseUrl,f=Jt(t.cMapUrl),p=!1!==t.cMapPacked,g=t.CMapReaderFactory||(x?Ai:ai),w=Jt(t.iccUrl),m=Jt(t.standardFontDataUrl),A=t.StandardFontDataFactory||(x?vi:di),v=Jt(t.wasmUrl),b=t.WasmFactory||(x?bi:pi),y=!0!==t.stopAtErrors,M=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,k=!1!==t.isEvalSupported,E="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!x,S="boolean"==typeof t.isImageDecoderSupported?t.isImageDecoderSupported:!x&&(Z.platform.isFirefox||!globalThis.chrome),_=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,T="boolean"==typeof t.disableFontFace?t.disableFontFace:x,C=!0===t.fontExtraProperties,P=!0===t.enableXfa,R=t.ownerDocument||globalThis.document,N=!0===t.disableRange,D=!0===t.disableStream,I=!0===t.disableAutoFetch,O=!0===t.pdfBug,$=t.CanvasFactory||(x?mi:oi),L=t.FilterFactory||(x?wi:li),B=!0===t.enableHWA,j=!1!==t.useWasm,U=a?a.length:t.length??NaN,z="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!x&&!T,H="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:!!(g===ai&&A===di&&b===pi&&f&&m&&v&&vt(f,document.baseURI)&&vt(m,document.baseURI)&&vt(v,document.baseURI));F(u);const G={canvasFactory:new $({ownerDocument:R,enableHWA:B}),filterFactory:new L({docId:e,ownerDocument:R}),cMapReaderFactory:H?null:new g({baseUrl:f,isCompressed:p}),standardFontDataFactory:H?null:new A({baseUrl:m}),wasmFactory:H?null:new b({baseUrl:v})};l||(l=Ne.create({verbosity:u,port:qi.workerPort}),i._worker=l);const W={docId:e,apiVersion:"5.3.31",data:n,password:h,disableAutoFetch:I,rangeChunkSize:c,length:U,docBaseUrl:d,enableXfa:P,evaluatorOptions:{maxImageSize:M,disableFontFace:T,ignoreErrors:y,isEvalSupported:k,isOffscreenCanvasSupported:E,isImageDecoderSupported:S,canvasMaxAreaInBytes:_,fontExtraProperties:C,useSystemFonts:z,useWasm:j,useWorkerFetch:H,cMapUrl:f,iccUrl:w,standardFontDataUrl:m,wasmUrl:v}},V={ownerDocument:R,pdfBug:O,styleElement:null,loadingParams:{disableAutoFetch:I,enableXfa:P}};return l.promise.then((function(){if(i.destroyed)throw new Error("Loading aborted");if(l.destroyed)throw new Error("Worker was destroyed");const t=l.messageHandler.sendWithPromise("GetDocRequest",W,n?[n.buffer]:null);let h;if(a)h=new ie(a,{disableRange:N,disableStream:D});else if(!n){if(!s)throw new Error("getDocument - no `url` parameter provided.");const t=vt(s)?de:x?be:we;h=new t({url:s,length:U,httpHeaders:r,withCredentials:o,rangeChunkSize:c,disableRange:N,disableStream:D})}return t.then((t=>{if(i.destroyed)throw new Error("Loading aborted");if(l.destroyed)throw new Error("Worker was destroyed");const s=new ni(e,t,l.port),n=new De(s,i,h,V,G);i._transport=n,s.send("Ready",null)}))})).catch(i._capability.reject),i}class Te{static#Ae=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId="d"+Te.#Ae++;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await(this._transport?.destroy())}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}}class Ce{#qe=Promise.withResolvers();#Es=[];#Ss=[];#_s=[];#Ts=[];constructor(t,i,e=!1,s=null){this.length=t,this.initialData=i,this.progressiveDone=e,this.contentDispositionFilename=s}addRangeListener(t){this.#Ts.push(t)}addProgressListener(t){this.#_s.push(t)}addProgressiveReadListener(t){this.#Ss.push(t)}addProgressiveDoneListener(t){this.#Es.push(t)}onDataRange(t,i){for(const e of this.#Ts)e(t,i)}onDataProgress(t,i){this.#qe.promise.then((()=>{for(const e of this.#_s)e(t,i)}))}onDataProgressiveRead(t){this.#qe.promise.then((()=>{for(const i of this.#Ss)i(t)}))}onDataProgressiveDone(){this.#qe.promise.then((()=>{for(const t of this.#Es)t()}))}transportReady(){this.#qe.resolve()}requestDataRange(t,i){B("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class Pe{constructor(t,i){this._pdfInfo=t,this._transport=i}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return H(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(i)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class Re{#Cs=!1;constructor(t,i,e,s=!1){this._pageIndex=t,this._pageInfo=i,this._transport=e,this._stats=s?new At:null,this._pdfBug=s,this.commonObjs=e.commonObjs,this.objs=new ke,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:i=this.rotate,offsetX:e=0,offsetY:s=0,dontFlip:n=!1}={}){return new dt({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:i,offsetX:e,offsetY:s,dontFlip:n})}getAnnotations({intent:t="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,i)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return H(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:i,intent:e="display",annotationMode:s=E.ENABLE,transform:n=null,background:r=null,optionalContentConfigPromise:o=null,annotationCanvasMap:h=null,pageColors:a=null,printAnnotationStorage:c=null,isEditing:l=!1}){this._stats?.time("Overall");const u=this._transport.getRenderingIntent(e,s,c,l),{renderingIntent:d,cacheKey:f}=u;this.#Cs=!1,o||=this._transport.getOptionalContentConfig(d);let p=this._intentStates.get(f);p||(p=Object.create(null),this._intentStates.set(f,p)),p.streamReaderCancelTimeout&&(clearTimeout(p.streamReaderCancelTimeout),p.streamReaderCancelTimeout=null);const g=!!(4&d);p.displayReadyCapability||(p.displayReadyCapability=Promise.withResolvers(),p.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(u));const w=t=>{p.renderTasks.delete(m),g&&(this.#Cs=!0),this.#Ps(),t?(m.capability.reject(t),this._abortOperatorList({intentState:p,reason:t instanceof Error?t:new Error(t)})):m.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},m=new Fe({callback:w,params:{canvasContext:t,viewport:i,transform:n,background:r},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:h,operatorList:p.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!g,pdfBug:this._pdfBug,pageColors:a});(p.renderTasks||=new Set).add(m);const A=m.task;return Promise.all([p.displayReadyCapability.promise,o]).then((([t,i])=>{if(this.destroyed)w();else{if(this._stats?.time("Rendering"),!(i.renderingIntent&d))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");m.initializeGraphics({transparency:t,optionalContentConfig:i}),m.operatorListChanged()}})).catch(w),A}getOperatorList({intent:t="display",annotationMode:i=E.ENABLE,printAnnotationStorage:e=null,isEditing:s=!1}={}){const n=this._transport.getRenderingIntent(t,i,e,s,!0);let r,o=this._intentStates.get(n.cacheKey);return o||(o=Object.create(null),this._intentStates.set(n.cacheKey,o)),o.opListReadCapability||(r=Object.create(null),r.operatorListChanged=function(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(r))},o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||=new Set).add(r),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(n)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:i=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===i},{highWaterMark:100,size:t=>t.items.length})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then((t=>Se.textContent(t)));const i=this.streamTextContent(t);return new Promise((function(t,e){const s=i.getReader(),n={items:[],styles:Object.create(null),lang:null};!function i(){s.read().then((function({value:e,done:s}){s?t(n):(n.lang??=e.lang,Object.assign(n.styles,e.styles),n.items.push(...e.items),i())}),e)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const i of this._intentStates.values())if(this._abortOperatorList({intentState:i,reason:new Error("Page was destroyed."),force:!0}),!i.opListReadCapability)for(const e of i.renderTasks)t.push(e.completed),e.cancel();return this.objs.clear(),this.#Cs=!1,Promise.all(t)}cleanup(t=!1){this.#Cs=!0;const i=this.#Ps();return t&&i&&(this._stats&&=new At),i}#Ps(){if(!this.#Cs||this.destroyed)return!1;for(const{renderTasks:t,operatorList:i}of this._intentStates.values())if(t.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#Cs=!1,!0}_startRenderPage(t,i){const e=this._intentStates.get(i);e&&(this._stats?.timeEnd("Page Request"),e.displayReadyCapability?.resolve(t))}_renderPageChunk(t,i){for(let e=0,s=t.length;e<s;e++)i.operatorList.fnArray.push(t.fnArray[e]),i.operatorList.argsArray.push(t.argsArray[e]);i.operatorList.lastChunk=t.lastChunk,i.operatorList.separateAnnots=t.separateAnnots;for(const t of i.renderTasks)t.operatorListChanged();t.lastChunk&&this.#Ps()}_pumpOperatorList({renderingIntent:t,cacheKey:i,annotationStorageSerializable:e,modifiedIds:s}){const{map:n,transfer:r}=e,o=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:i,annotationStorage:n,modifiedIds:s},r).getReader(),h=this._intentStates.get(i);h.streamReader=o;const a=()=>{o.read().then((({value:t,done:i})=>{i?h.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,h),a())}),(t=>{if(h.streamReader=null,!this._transport.destroyed){if(h.operatorList){h.operatorList.lastChunk=!0;for(const t of h.renderTasks)t.operatorListChanged();this.#Ps()}if(h.displayReadyCapability)h.displayReadyCapability.reject(t);else{if(!h.opListReadCapability)throw t;h.opListReadCapability.reject(t)}}}))};a()}_abortOperatorList({intentState:t,reason:i,force:e=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!e){if(t.renderTasks.size>0)return;if(i instanceof ft){let e=100;return i.extraDelay>0&&i.extraDelay<1e3&&(e+=i.extraDelay),void(t.streamReaderCancelTimeout=setTimeout((()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:i,force:!0})}),e))}}if(t.streamReader.cancel(new q(i.message)).catch((()=>{})),t.streamReader=null,!this._transport.destroyed){for(const[i,e]of this._intentStates)if(e===t){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}}class Ne{#qe=Promise.withResolvers();#Rs=null;#Fe=null;#Ns=null;static#Ds=0;static#Is=!1;static#Fs=new WeakMap;static{x&&(this.#Is=!0,qi.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(t,i)=>{const e=URL.parse(t);if(!e?.origin||"null"===e.origin)return!1;const s=new URL(i,e);return e.origin===s.origin},this._createCDNWrapper=t=>URL.createObjectURL(new Blob([`await import("${t}");`],{type:"text/javascript"})),this.fromPort=t=>{if(console.log("Deprecated API usage: `PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.create(t)}}constructor({name:t=null,port:i=null,verbosity:e=O()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=e,i){if(Ne.#Fs.has(i))throw new Error("Cannot use more than one PDFWorker per port.");Ne.#Fs.set(i,this),this.#Os(i)}else this.#$s()}get promise(){return this.#qe.promise}#Ls(){this.#qe.resolve(),this.#Rs.send("configure",{verbosity:this.verbosity})}get port(){return this.#Fe}get messageHandler(){return this.#Rs}#Os(t){this.#Fe=t,this.#Rs=new ni("main","worker",t),this.#Rs.on("ready",(()=>{})),this.#Ls()}#$s(){if(Ne.#Is||Ne.#Bs)return void this.#js();let{workerSrc:t}=Ne;try{Ne._isSameOrigin(window.location,t)||(t=Ne._createCDNWrapper(new URL(t,window.location).href));const i=new Worker(t,{type:"module"}),e=new ni("main","worker",i),s=()=>{n.abort(),e.destroy(),i.terminate(),this.destroyed?this.#qe.reject(new Error("Worker was destroyed")):this.#js()},n=new AbortController;i.addEventListener("error",(()=>{this.#Ns||s()}),{signal:n.signal}),e.on("test",(t=>{n.abort(),!this.destroyed&&t?(this.#Rs=e,this.#Fe=i,this.#Ns=i,this.#Ls()):s()})),e.on("ready",(()=>{if(n.abort(),this.destroyed)s();else try{r()}catch{this.#js()}}));const r=()=>{const t=new Uint8Array;e.send("test",t,[t.buffer])};return void r()}catch{$("The worker has been disabled.")}this.#js()}#js(){Ne.#Is||(L("Setting up fake worker."),Ne.#Is=!0),Ne._setupFakeWorkerGlobal.then((t=>{if(this.destroyed)return void this.#qe.reject(new Error("Worker was destroyed"));const i=new ii;this.#Fe=i;const e="fake"+Ne.#Ds++,s=new ni(e+"_worker",e,i);t.setup(s,i),this.#Rs=new ni(e,e+"_worker",i),this.#Ls()})).catch((t=>{this.#qe.reject(new Error(`Setting up fake worker failed: "${t.message}".`))}))}destroy(){this.destroyed=!0,this.#Ns?.terminate(),this.#Ns=null,Ne.#Fs.delete(this.#Fe),this.#Fe=null,this.#Rs?.destroy(),this.#Rs=null}static create(t){const i=this.#Fs.get(t?.port);if(i){if(i._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return i}return new Ne(t)}static get workerSrc(){if(qi.workerSrc)return qi.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#Bs(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return H(this,"_setupFakeWorkerGlobal",(async()=>this.#Bs?this.#Bs:(await import(this.workerSrc)).WorkerMessageHandler)())}}class De{#Us=new Map;#zs=new Map;#Hs=new Map;#Gs=new Map;#Ws=null;constructor(t,i,e,s,n){this.messageHandler=t,this.loadingTask=i,this.commonObjs=new ke,this.fontLoader=new qt({ownerDocument:s.ownerDocument,styleElement:s.styleElement}),this.loadingParams=s.loadingParams,this._params=s,this.canvasFactory=n.canvasFactory,this.filterFactory=n.filterFactory,this.cMapReaderFactory=n.cMapReaderFactory,this.standardFontDataFactory=n.standardFontDataFactory,this.wasmFactory=n.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=e,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#Vs(t,i=null){const e=this.#Us.get(t);if(e)return e;const s=this.messageHandler.sendWithPromise(t,i);return this.#Us.set(t,s),s}get annotationStorage(){return H(this,"annotationStorage",new Yt)}getRenderingIntent(t,i=E.ENABLE,e=null,s=!1,n=!1){let r=2,o=Xt;switch(t){case"any":r=1;break;case"display":break;case"print":r=4;break;default:L(`getRenderingIntent - invalid intent: ${t}`)}const h=4&r&&e instanceof Qt?e:this.annotationStorage;switch(i){case E.DISABLE:r+=64;break;case E.ENABLE:break;case E.ENABLE_FORMS:r+=16;break;case E.ENABLE_STORAGE:r+=32,o=h.serializable;break;default:L(`getRenderingIntent - invalid annotationMode: ${i}`)}s&&(r+=128),n&&(r+=256);const{ids:a,hash:c}=h.modifiedIds;return{renderingIntent:r,cacheKey:[r,o.hash,c].join("_"),annotationStorageSerializable:o,modifiedIds:a}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#Ws?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const i of this.#zs.values())t.push(i._destroy());this.#zs.clear(),this.#Hs.clear(),this.#Gs.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const i=this.messageHandler.sendWithPromise("Terminate",null);return t.push(i),Promise.all(t).then((()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#Us.clear(),this.filterFactory.destroy(),Ee.cleanup(),this._networkStream?.cancelAllRequests(new q("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:i}=this;t.on("GetReader",((t,i)=>{j(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},i.onPull=()=>{this._fullReader.read().then((function({value:t,done:e}){e?i.close():(j(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(t),1,[t]))})).catch((t=>{i.error(t)}))},i.onCancel=t=>{this._fullReader.cancel(t),i.ready.catch((t=>{if(!this.destroyed)throw t}))}})),t.on("ReaderHeadersReady",(async()=>{await this._fullReader.headersReady;const{isStreamingSupported:t,isRangeSupported:e,contentLength:s}=this._fullReader;return t&&e||(this._lastProgress&&i.onProgress?.(this._lastProgress),this._fullReader.onProgress=t=>{i.onProgress?.({loaded:t.loaded,total:t.total})}),{isStreamingSupported:t,isRangeSupported:e,contentLength:s}})),t.on("GetRangeReader",((t,i)=>{j(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const e=this._networkStream.getRangeReader(t.begin,t.end);e?(i.onPull=()=>{e.read().then((function({value:t,done:e}){e?i.close():(j(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(t),1,[t]))})).catch((t=>{i.error(t)}))},i.onCancel=t=>{e.cancel(t),i.ready.catch((t=>{if(!this.destroyed)throw t}))}):i.close()})),t.on("GetDoc",(({pdfInfo:t})=>{this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,i._capability.resolve(new Pe(t,this))})),t.on("DocException",(t=>{i._capability.reject(si(t))})),t.on("PasswordRequest",(t=>{this.#Ws=Promise.withResolvers();try{if(!i.onPassword)throw si(t);i.onPassword((t=>{t instanceof Error?this.#Ws.reject(t):this.#Ws.resolve({password:t})}),t.code)}catch(t){this.#Ws.reject(t)}return this.#Ws.promise})),t.on("DataLoaded",(t=>{i.onProgress?.({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)})),t.on("StartRenderPage",(t=>{this.destroyed||this.#zs.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)})),t.on("commonobj",(([i,e,s])=>{if(this.destroyed)return null;if(this.commonObjs.has(i))return null;switch(e){case"Font":if("error"in s){const t=s.error;L(`Error during font loading: ${t}`),this.commonObjs.resolve(i,t);break}const n=this._params.pdfBug&&globalThis.FontInspector?.enabled?(t,i)=>globalThis.FontInspector.fontAdded(t,i):null,r=new Kt(s,n);this.fontLoader.bind(r).catch((()=>t.sendWithPromise("FontFallback",{id:i}))).finally((()=>{!r.fontExtraProperties&&r.data&&(r.data=null),this.commonObjs.resolve(i,r)}));break;case"CopyLocalImage":const{imageRef:o}=s;j(o,"The imageRef must be defined.");for(const t of this.#zs.values())for(const[,e]of t.objs)if(e?.ref===o)return e.dataLen?(this.commonObjs.resolve(i,structuredClone(e)),e.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,s);break;default:throw new Error(`Got unknown common object type ${e}`)}return null})),t.on("obj",(([t,i,e,s])=>{if(this.destroyed)return;const n=this.#zs.get(i);if(!n.objs.has(t))if(0!==n._intentStates.size)switch(e){case"Image":case"Pattern":n.objs.resolve(t,s);break;default:throw new Error(`Got unknown object type ${e}`)}else s?.bitmap?.close()})),t.on("DocProgress",(t=>{this.destroyed||i.onProgress?.({loaded:t.loaded,total:t.total})})),t.on("FetchBinaryData",(async t=>{if(this.destroyed)throw new Error("Worker was destroyed.");const i=this[t.type];if(!i)throw new Error(`${t.type} not initialized, see the \`useWorkerFetch\` parameter.`);return i.fetch(t)}))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&L("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:i}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},i).finally((()=>{this.annotationStorage.resetModified()}))}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const i=t-1,e=this.#Hs.get(i);if(e)return e;const s=this.messageHandler.sendWithPromise("GetPage",{pageIndex:i}).then((e=>{if(this.destroyed)throw new Error("Transport destroyed");e.refStr&&this.#Gs.set(e.refStr,t);const s=new Re(i,e,this,this._params.pdfBug);return this.#zs.set(i,s),s}));return this.#Hs.set(i,s),s}getPageIndex(t){return Zt(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,i){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:i})}getFieldObjects(){return this.#Vs("GetFieldObjects")}hasJSActions(){return this.#Vs("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#Vs("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#Vs("GetOptionalContentConfig").then((i=>new te(i,t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",i=this.#Us.get(t);if(i)return i;const e=this.messageHandler.sendWithPromise(t,null).then((t=>({info:t[0],metadata:t[1]?new Ki(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})));return this.#Us.set(t,e),e}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#zs.values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#Us.clear(),this.filterFactory.destroy(!0),Ee.cleanup()}}cachedPageNumber(t){return Zt(t)?this.#Gs.get(0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`)??null:null}}class Ie{#Xs=null;onContinue=null;onError=null;constructor(t){this.#Xs=t}get promise(){return this.#Xs.capability.promise}cancel(t=0){this.#Xs.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#Xs.operatorList;if(!t)return!1;const{annotationCanvasMap:i}=this.#Xs;return t.form||t.canvas&&i?.size>0}}class Fe{#Ys=null;static#Qs=new WeakSet;constructor({callback:t,params:i,objs:e,commonObjs:s,annotationCanvasMap:n,operatorList:r,pageIndex:o,canvasFactory:h,filterFactory:a,useRequestAnimationFrame:c=!1,pdfBug:l=!1,pageColors:u=null}){this.callback=t,this.params=i,this.objs=e,this.commonObjs=s,this.annotationCanvasMap=n,this.operatorListIdx=null,this.operatorList=r,this._pageIndex=o,this.canvasFactory=h,this.filterFactory=a,this._pdfBug=l,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&"undefined"!=typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Ie(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=i.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics({transparency:t=!1,optionalContentConfig:i}){if(this.cancelled)return;if(this._canvas){if(Fe.#Qs.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");Fe.#Qs.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:e,viewport:s,transform:n,background:r}=this.params;this.gfx=new Qi(e,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:i},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:n,viewport:s,transparency:t,background:r}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,i=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#Ys&&(window.cancelAnimationFrame(this.#Ys),this.#Ys=null),Fe.#Qs.delete(this._canvas),t||=new ft(`Rendering cancelled, page ${this._pageIndex+1}`,i),this.callback(t),this.task.onError?.(t)}operatorListChanged(){this.graphicsReady?(this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#Ys=window.requestAnimationFrame((()=>{this.#Ys=null,this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),Fe.#Qs.delete(this._canvas),this.callback())))}}const Oe="5.3.31",$e="47ad820d9";function Le(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function Be(t){return Math.max(0,Math.min(255,255*t))}y(531);class je{static CMYK_G([t,i,e,s]){return["G",1-Math.min(1,.3*t+.59*e+.11*i+s)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return[t=Be(t),t,t]}static G_HTML([t]){const i=Le(t);return`#${i}${i}${i}`}static RGB_G([t,i,e]){return["G",.3*t+.59*i+.11*e]}static RGB_rgb(t){return t.map(Be)}static RGB_HTML(t){return`#${t.map(Le).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,i,e,s]){return["RGB",1-Math.min(1,t+s),1-Math.min(1,e+s),1-Math.min(1,i+s)]}static CMYK_rgb([t,i,e,s]){return[Be(1-Math.min(1,t+s)),Be(1-Math.min(1,e+s)),Be(1-Math.min(1,i+s))]}static CMYK_HTML(t){const i=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(i)}static RGB_CMYK([t,i,e]){const s=1-t,n=1-i,r=1-e;return["CMYK",s,n,r,Math.min(s,n,r)]}}class Ue{create(t,i,e=!1){if(t<=0||i<=0)throw new Error("Invalid SVG dimensions");const s=this._createSVG("svg:svg");return s.setAttribute("version","1.1"),e||(s.setAttribute("width",`${t}px`),s.setAttribute("height",`${i}px`)),s.setAttribute("preserveAspectRatio","none"),s.setAttribute("viewBox",`0 0 ${t} ${i}`),s}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){B("Abstract method `_createSVG` called.")}}class ze extends Ue{_createSVG(t){return document.createElementNS(ct,t)}}class He{static setupStorage(t,i,e,s,n){const r=s.getValue(i,{value:null});switch(e.name){case"textarea":if(null!==r.value&&(t.textContent=r.value),"print"===n)break;t.addEventListener("input",(t=>{s.setValue(i,{value:t.target.value})}));break;case"input":if("radio"===e.attributes.type||"checkbox"===e.attributes.type){if(r.value===e.attributes.xfaOn?t.setAttribute("checked",!0):r.value===e.attributes.xfaOff&&t.removeAttribute("checked"),"print"===n)break;t.addEventListener("change",(t=>{s.setValue(i,{value:t.target.getAttribute(t.target.checked?"xfaOn":"xfaOff")})}))}else{if(null!==r.value&&t.setAttribute("value",r.value),"print"===n)break;t.addEventListener("input",(t=>{s.setValue(i,{value:t.target.value})}))}break;case"select":if(null!==r.value){t.setAttribute("value",r.value);for(const t of e.children)t.attributes.value===r.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",(t=>{const e=t.target.options;s.setValue(i,{value:-1===e.selectedIndex?"":e[e.selectedIndex].value})}))}}static setAttributes({html:t,element:i,storage:e=null,intent:s,linkService:n}){const{attributes:r}=i,o=t instanceof HTMLAnchorElement;"radio"===r.type&&(r.name=`${r.name}-${s}`);for(const[i,e]of Object.entries(r))if(null!=e)switch(i){case"class":e.length&&t.setAttribute(i,e.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",e);break;case"style":Object.assign(t.style,e);break;case"textContent":t.textContent=e;break;default:(!o||"href"!==i&&"newWindow"!==i)&&t.setAttribute(i,e)}o&&n.addLinkAttributes(t,r.href,r.newWindow),e&&r.dataId&&this.setupStorage(t,r.dataId,i,e)}static render(t){const i=t.annotationStorage,e=t.linkService,s=t.xfaHtml,n=t.intent||"display",r=document.createElement(s.name);s.attributes&&this.setAttributes({html:r,element:s,intent:n,linkService:e});const o="richText"!==n,h=t.div;if(h.append(r),t.viewport){const i=`matrix(${t.viewport.transform.join(",")})`;h.style.transform=i}o&&h.setAttribute("class","xfaLayer xfaFont");const a=[];if(0===s.children.length){if(s.value){const t=document.createTextNode(s.value);r.append(t),o&&Se.shouldBuildText(s.name)&&a.push(t)}return{textDivs:a}}const c=[[s,-1,r]];for(;c.length>0;){const[t,s,r]=c.at(-1);if(s+1===t.children.length){c.pop();continue}const h=t.children[++c.at(-1)[1]];if(null===h)continue;const{name:l}=h;if("#text"===l){const t=document.createTextNode(h.value);a.push(t),r.append(t);continue}const u=h?.attributes?.xmlns?document.createElementNS(h.attributes.xmlns,l):document.createElement(l);if(r.append(u),h.attributes&&this.setAttributes({html:u,element:h,storage:i,intent:n,linkService:e}),h.children?.length>0)c.push([h,-1,u]);else if(h.value){const t=document.createTextNode(h.value);o&&Se.shouldBuildText(l)&&a.push(t),u.append(t)}}for(const t of h.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:a}}static update(t){const i=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=i,t.div.hidden=!1}}const Ge=1e3,We=new WeakSet;class Ve{static create(t){switch(t.data.annotationType){case P.LINK:return new Ye(t);case P.TEXT:return new Qe(t);case P.WIDGET:switch(t.data.fieldType){case"Tx":return new Ke(t);case"Btn":return t.data.radioButton?new ts(t):t.data.checkBox?new Ze(t):new is(t);case"Ch":return new es(t);case"Sig":return new Je(t)}return new qe(t);case P.POPUP:return new ss(t);case P.FREETEXT:return new rs(t);case P.LINE:return new os(t);case P.SQUARE:return new hs(t);case P.CIRCLE:return new as(t);case P.POLYLINE:return new cs(t);case P.CARET:return new us(t);case P.INK:return new ds(t);case P.POLYGON:return new ls(t);case P.HIGHLIGHT:return new fs(t);case P.UNDERLINE:return new ps(t);case P.SQUIGGLY:return new gs(t);case P.STRIKEOUT:return new ws(t);case P.STAMP:return new ms(t);case P.FILEATTACHMENT:return new As(t);default:return new Xe(t)}}}class Xe{#qs=null;#Ks=!1;#Js=null;constructor(t,{isRenderable:i=!1,ignoreBorder:e=!1,createQuadrilaterals:s=!1}={}){this.isRenderable=i,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,i&&(this.container=this._createContainer(e)),s&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:i,richText:e}){return!!(t?.str||i?.str||e?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return Xe._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#qs||={rect:this.data.rect.slice(0)};const{rect:i}=t;i&&this.#Zs(i),this.#Js?.popup.updateEdited(t)}resetEdited(){this.#qs&&(this.#Zs(this.#qs.rect),this.#Js?.popup.resetEdited(),this.#qs=null)}#Zs(t){const{container:{style:i},data:{rect:e,rotation:s},parent:{viewport:{rawDims:{pageWidth:n,pageHeight:r,pageX:o,pageY:h}}}}=this;e?.splice(0,4,...t),i.left=100*(t[0]-o)/n+"%",i.top=100*(r-t[3]+h)/r+"%",0===s?(i.width=100*(t[2]-t[0])/n+"%",i.height=100*(t[3]-t[1])/r+"%"):this.setRotation(s)}_createContainer(t){const{data:i,parent:{page:e,viewport:s}}=this,n=document.createElement("section");n.setAttribute("data-annotation-id",i.id),this instanceof qe||(n.tabIndex=Ge);const{style:r}=n;if(r.zIndex=this.parent.zIndex++,i.alternativeText&&(n.title=i.alternativeText),i.noRotate&&n.classList.add("norotate"),!i.rect||this instanceof ss){const{rotation:t}=i;return i.hasOwnCanvas||0===t||this.setRotation(t,n),n}const{width:o,height:h}=this;if(!t&&i.borderStyle.width>0){r.borderWidth=`${i.borderStyle.width}px`;const t=i.borderStyle.horizontalCornerRadius,e=i.borderStyle.verticalCornerRadius;switch(t>0||e>0?r.borderRadius=`calc(${t}px * var(--total-scale-factor)) / calc(${e}px * var(--total-scale-factor))`:this instanceof ts&&(r.borderRadius=`calc(${o}px * var(--total-scale-factor)) / calc(${h}px * var(--total-scale-factor))`),i.borderStyle.style){case 1:r.borderStyle="solid";break;case 2:r.borderStyle="dashed";break;case 3:L("Unimplemented border style: beveled");break;case 4:L("Unimplemented border style: inset");break;case 5:r.borderBottomStyle="solid"}const s=i.borderColor||null;s?(this.#Ks=!0,r.borderColor=it.makeHexColor(0|s[0],0|s[1],0|s[2])):r.borderWidth=0}const a=it.normalizeRect([i.rect[0],e.view[3]-i.rect[1]+e.view[1],i.rect[2],e.view[3]-i.rect[3]+e.view[1]]),{pageWidth:c,pageHeight:l,pageX:u,pageY:d}=s.rawDims;r.left=100*(a[0]-u)/c+"%",r.top=100*(a[1]-d)/l+"%";const{rotation:f}=i;return i.hasOwnCanvas||0===f?(r.width=100*o/c+"%",r.height=100*h/l+"%"):this.setRotation(f,n),n}setRotation(t,i=this.container){if(!this.data.rect)return;const{pageWidth:e,pageHeight:s}=this.parent.viewport.rawDims;let{width:n,height:r}=this;t%180!=0&&([n,r]=[r,n]),i.style.width=100*n/e+"%",i.style.height=100*r/s+"%",i.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(t,i,e)=>{const s=e.detail[t],n=s[0],r=s.slice(1);e.target.style[i]=je[`${n}_HTML`](r),this.annotationStorage.setValue(this.data.id,{[i]:je[`${n}_rgb`](r)})};return H(this,"_commonActions",{display:t=>{const{display:i}=t.detail,e=i%2==1;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:e,noPrint:1===i||2===i})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:i}=t.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:t=>{setTimeout((()=>t.target.focus({preventScroll:!1})),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:i=>{t("bgColor","backgroundColor",i)},fillColor:i=>{t("fillColor","backgroundColor",i)},fgColor:i=>{t("fgColor","color",i)},textColor:i=>{t("textColor","color",i)},borderColor:i=>{t("borderColor","borderColor",i)},strokeColor:i=>{t("strokeColor","borderColor",i)},rotation:t=>{const i=t.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(t,i){const e=this._commonActions;for(const s of Object.keys(i.detail)){const n=t[s]||e[s];n?.(i)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const i=this.annotationStorage.getRawValue(this.data.id);if(!i)return;const e=this._commonActions;for(const[s,n]of Object.entries(i)){const r=e[s];r&&(r({detail:{[s]:n},target:t}),delete i[s])}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[i,e,s,n]=this.data.rect.map((t=>Math.fround(t)));if(8===t.length){const[r,o,h,a]=t.subarray(2,6);if(s===r&&n===o&&i===h&&e===a)return}const{style:r}=this.container;let o;if(this.#Ks){const{borderColor:t,borderWidth:i}=r;r.borderWidth=0,o=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${t}" stroke-width="${i}">`],this.container.classList.add("hasBorder")}const h=s-i,a=n-e,{svgFactory:c}=this,l=c.createElement("svg");l.classList.add("quadrilateralsContainer"),l.setAttribute("width",0),l.setAttribute("height",0);const u=c.createElement("defs");l.append(u);const d=c.createElement("clipPath"),f=`clippath_${this.data.id}`;d.setAttribute("id",f),d.setAttribute("clipPathUnits","objectBoundingBox"),u.append(d);for(let e=2,s=t.length;e<s;e+=8){const s=t[e],r=t[e+1],l=t[e+2],u=t[e+3],f=c.createElement("rect"),p=(l-i)/h,g=(n-r)/a,w=(s-l)/h,m=(r-u)/a;f.setAttribute("x",p),f.setAttribute("y",g),f.setAttribute("width",w),f.setAttribute("height",m),d.append(f),o?.push(`<rect vector-effect="non-scaling-stroke" x="${p}" y="${g}" width="${w}" height="${m}"/>`)}this.#Ks&&(o.push("</g></svg>')"),r.backgroundImage=o.join("")),this.container.append(l),this.container.style.clipPath=`url(#${f})`}_createPopup(){const{data:t}=this,i=this.#Js=new ss({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation},parent:this.parent,elements:[this]});this.parent.div.append(i.render())}render(){B("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,i=null){const e=[];if(this._fieldObjects){const s=this._fieldObjects[t];if(s)for(const{page:t,id:n,exportValues:r}of s){if(-1===t)continue;if(n===i)continue;const s="string"==typeof r?r:null,o=document.querySelector(`[data-element-id="${n}"]`);!o||We.has(o)?e.push({id:n,exportValue:s,domElement:o}):L(`_getElementsByName - element not allowed: ${n}`)}return e}for(const s of document.getElementsByName(t)){const{exportValue:t}=s,n=s.getAttribute("data-element-id");n!==i&&We.has(s)&&e.push({id:n,exportValue:t,domElement:s})}return e}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const i of t)i.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:i}}=this;this.container.addEventListener("dblclick",(()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:i})}))}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}class Ye extends Xe{constructor(t,i=null){super(t,{isRenderable:!0,ignoreBorder:!!i?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:i}=this,e=document.createElement("a");e.setAttribute("data-element-id",t.id);let s=!1;return t.url?(i.addLinkAttributes(e,t.url,t.newWindow),s=!0):t.action?(this._bindNamedAction(e,t.action),s=!0):t.attachment?(this.#tn(e,t.attachment,t.attachmentDest),s=!0):t.setOCGState?(this.#in(e,t.setOCGState),s=!0):t.dest?(this._bindLink(e,t.dest),s=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(e,t),s=!0),t.resetForm?(this._bindResetFormAction(e,t.resetForm),s=!0):this.isTooltipOnly&&!s&&(this._bindLink(e,""),s=!0)),this.container.classList.add("linkAnnotation"),s&&this.container.append(e),this.container}#en(){this.container.setAttribute("data-internal-link","")}_bindLink(t,i){t.href=this.linkService.getDestinationHash(i),t.onclick=()=>(i&&this.linkService.goToDestination(i),!1),(i||""===i)&&this.#en()}_bindNamedAction(t,i){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(i),!1),this.#en()}#tn(t,i,e=null){t.href=this.linkService.getAnchorUrl(""),i.description&&(t.title=i.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(i.content,i.filename,e),!1),this.#en()}#in(t,i){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(i),!1),this.#en()}_bindJSAction(t,i){t.href=this.linkService.getAnchorUrl("");const e=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const s of Object.keys(i.actions)){const n=e.get(s);n&&(t[n]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i.id,name:s}}),!1))}t.onclick||(t.onclick=()=>!1),this.#en()}_bindResetFormAction(t,i){const e=t.onclick;if(e||(t.href=this.linkService.getAnchorUrl("")),this.#en(),!this._fieldObjects)return L('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(e||(t.onclick=()=>!1));t.onclick=()=>{e?.();const{fields:t,refs:s,include:n}=i,r=[];if(0!==t.length||0!==s.length){const i=new Set(s);for(const e of t){const t=this._fieldObjects[e]||[];for(const{id:e}of t)i.add(e)}for(const t of Object.values(this._fieldObjects))for(const e of t)i.has(e.id)===n&&r.push(e)}else for(const t of Object.values(this._fieldObjects))r.push(...t);const o=this.annotationStorage,h=[];for(const t of r){const{id:i}=t;switch(h.push(i),t.type){case"text":case"combobox":case"listbox":o.setValue(i,{value:t.defaultValue||""});break;case"checkbox":case"radiobutton":o.setValue(i,{value:t.defaultValue===t.exportValues});break;default:continue}const e=document.querySelector(`[data-element-id="${i}"]`);e&&(We.has(e)?e.dispatchEvent(new Event("resetform")):L(`_bindResetFormAction - element not allowed: ${i}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:h,name:"ResetForm"}}),!1}}}class Qe extends Xe{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class qe extends Xe{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&("CANVAS"===t.previousSibling?.nodeName&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return Z.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,i,e,s,n){e.includes("mouse")?t.addEventListener(e,(t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:n(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(e,(t=>{if("blur"===e){if(!i.focused||!t.relatedTarget)return;i.focused=!1}else if("focus"===e){if(i.focused)return;i.focused=!0}n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:n(t)}})}))}_setEventListeners(t,i,e,s){for(const[n,r]of e)("Action"===r||this.data.actions?.[r])&&("Focus"!==r&&"Blur"!==r||(i||={focused:!1}),this._setEventListener(t,i,n,r,s),"Focus"!==r||this.data.actions?.Blur?"Blur"!==r||this.data.actions?.Focus||this._setEventListener(t,i,"focus","Focus",null):this._setEventListener(t,i,"blur","Blur",null))}_setBackgroundColor(t){const i=this.data.backgroundColor||null;t.style.backgroundColor=null===i?"transparent":it.makeHexColor(i[0],i[1],i[2])}_setTextStyle(t){const{fontColor:i}=this.data.defaultAppearanceData,e=this.data.defaultAppearanceData.fontSize||9,s=t.style;let n;const r=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),i=Math.round(t/(k*e))||1;n=Math.min(e,r(t/i/k))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);n=Math.min(e,r(t/k))}s.fontSize=`calc(${n}px * var(--total-scale-factor))`,s.color=it.makeHexColor(i[0],i[1],i[2]),null!==this.data.textAlignment&&(s.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(t,i){i?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",i)}}class Ke extends qe{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,i,e,s){const n=this.annotationStorage;for(const r of this._getElementsByName(t.name,t.id))r.domElement&&(r.domElement[i]=e),n.setValue(r.id,{[s]:e})}render(){const t=this.annotationStorage,i=this.data.id;this.container.classList.add("textWidgetAnnotation");let e=null;if(this.renderForms){const s=t.getValue(i,{value:this.data.fieldValue});let n=s.value||"";const r=t.getValue(i,{charLimit:this.data.maxLen}).charLimit;r&&n.length>r&&(n=n.slice(0,r));let o=s.formattedValue||this.data.textContent?.join("\n")||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,""));const h={userValue:n,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(e=document.createElement("textarea"),e.textContent=o??n,this.data.doNotScroll&&(e.style.overflowY="hidden")):(e=document.createElement("input"),e.type=this.data.password?"password":"text",e.setAttribute("value",o??n),this.data.doNotScroll&&(e.style.overflowX="hidden")),this.data.hasOwnCanvas&&(e.hidden=!0),We.add(e),e.setAttribute("data-element-id",i),e.disabled=this.data.readOnly,e.name=this.data.fieldName,e.tabIndex=Ge,this._setRequired(e,this.data.required),r&&(e.maxLength=r),e.addEventListener("input",(s=>{t.setValue(i,{value:s.target.value}),this.setPropertyOnSiblings(e,"value",s.target.value,"value"),h.formattedValue=null})),e.addEventListener("resetform",(()=>{e.value=h.userValue=this.data.defaultFieldValue??"",h.formattedValue=null}));let a=t=>{const{formattedValue:i}=h;null!=i&&(t.target.value=i),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){e.addEventListener("focus",(t=>{if(h.focused)return;const{target:i}=t;h.userValue&&(i.value=h.userValue),h.lastCommittedValue=i.value,h.commitKey=1,this.data.actions?.Focus||(h.focused=!0)})),e.addEventListener("updatefromsandbox",(e=>{this.showElementAndHideCanvas(e.target),this._dispatchEventFromSandbox({value(e){h.userValue=e.detail.value??"",t.setValue(i,{value:h.userValue.toString()}),e.target.value=h.userValue},formattedValue(e){const{formattedValue:s}=e.detail;h.formattedValue=s,null!=s&&e.target!==document.activeElement&&(e.target.value=s),t.setValue(i,{formattedValue:s})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:e=>{const{charLimit:s}=e.detail,{target:n}=e;if(0===s)return void n.removeAttribute("maxLength");n.setAttribute("maxLength",s);let r=h.userValue;!r||r.length<=s||(r=r.slice(0,s),n.value=h.userValue=r,t.setValue(i,{value:r}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:r,willCommit:!0,commitKey:1,selStart:n.selectionStart,selEnd:n.selectionEnd}}))}},e)})),e.addEventListener("keydown",(t=>{h.commitKey=1;let e=-1;if("Escape"===t.key?e=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(h.commitKey=3):e=2,-1===e)return;const{value:s}=t.target;h.lastCommittedValue!==s&&(h.lastCommittedValue=s,h.userValue=s,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:s,willCommit:!0,commitKey:e,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))}));const s=a;a=null,e.addEventListener("blur",(t=>{if(!h.focused||!t.relatedTarget)return;this.data.actions?.Blur||(h.focused=!1);const{value:e}=t.target;h.userValue=e,h.lastCommittedValue!==e&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:e,willCommit:!0,commitKey:h.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),s(t)})),this.data.actions?.Keystroke&&e.addEventListener("beforeinput",(t=>{h.lastCommittedValue=null;const{data:e,target:s}=t,{value:n,selectionStart:r,selectionEnd:o}=s;let a=r,c=o;switch(t.inputType){case"deleteWordBackward":{const t=n.substring(0,r).match(/\w*[^\w]*$/);t&&(a-=t[0].length);break}case"deleteWordForward":{const t=n.substring(r).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":r===o&&(a-=1);break;case"deleteContentForward":r===o&&(c+=1)}t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:n,change:e||"",willCommit:!1,selStart:a,selEnd:c}})})),this._setEventListeners(e,h,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}if(a&&e.addEventListener("blur",a),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/r;e.classList.add("comb"),e.style.letterSpacing=`calc(${t}px * var(--total-scale-factor) - 1ch)`}}else e=document.createElement("div"),e.textContent=this.data.fieldValue,e.style.verticalAlign="middle",e.style.display="table-cell",this.data.hasOwnCanvas&&(e.hidden=!0);return this._setTextStyle(e),this._setBackgroundColor(e),this._setDefaultPropertiesFromJS(e),this.container.append(e),this.container}}class Je extends qe{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class Ze extends qe{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,i=this.data,e=i.id;let s=t.getValue(e,{value:i.exportValue===i.fieldValue}).value;"string"==typeof s&&(s="Off"!==s,t.setValue(e,{value:s})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const n=document.createElement("input");return We.add(n),n.setAttribute("data-element-id",e),n.disabled=i.readOnly,this._setRequired(n,this.data.required),n.type="checkbox",n.name=i.fieldName,s&&n.setAttribute("checked",!0),n.setAttribute("exportValue",i.exportValue),n.tabIndex=Ge,n.addEventListener("change",(s=>{const{name:n,checked:r}=s.target;for(const s of this._getElementsByName(n,e)){const e=r&&s.exportValue===i.exportValue;s.domElement&&(s.domElement.checked=e),t.setValue(s.id,{value:e})}t.setValue(e,{value:r})})),n.addEventListener("resetform",(t=>{t.target.checked=(i.defaultFieldValue||"Off")===i.exportValue})),this.enableScripting&&this.hasJSActions&&(n.addEventListener("updatefromsandbox",(i=>{this._dispatchEventFromSandbox({value(i){i.target.checked="Off"!==i.detail.value,t.setValue(e,{value:i.target.checked})}},i)})),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class ts extends qe{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,i=this.data,e=i.id;let s=t.getValue(e,{value:i.fieldValue===i.buttonValue}).value;if("string"==typeof s&&(s=s!==i.buttonValue,t.setValue(e,{value:s})),s)for(const s of this._getElementsByName(i.fieldName,e))t.setValue(s.id,{value:!1});const n=document.createElement("input");if(We.add(n),n.setAttribute("data-element-id",e),n.disabled=i.readOnly,this._setRequired(n,this.data.required),n.type="radio",n.name=i.fieldName,s&&n.setAttribute("checked",!0),n.tabIndex=Ge,n.addEventListener("change",(i=>{const{name:s,checked:n}=i.target;for(const i of this._getElementsByName(s,e))t.setValue(i.id,{value:!1});t.setValue(e,{value:n})})),n.addEventListener("resetform",(t=>{const e=i.defaultFieldValue;t.target.checked=null!=e&&e===i.buttonValue})),this.enableScripting&&this.hasJSActions){const s=i.buttonValue;n.addEventListener("updatefromsandbox",(i=>{this._dispatchEventFromSandbox({value:i=>{const n=s===i.detail.value;for(const s of this._getElementsByName(i.target.name)){const i=n&&s.id===e;s.domElement&&(s.domElement.checked=i),t.setValue(s.id,{value:i})}}},i)})),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}return this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class is extends Ye{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const i=t.lastChild;return this.enableScripting&&this.hasJSActions&&i&&(this._setDefaultPropertiesFromJS(i),i.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))),t}}class es extends qe{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,i=this.data.id,e=t.getValue(i,{value:this.data.fieldValue}),s=document.createElement("select");We.add(s),s.setAttribute("data-element-id",i),s.disabled=this.data.readOnly,this._setRequired(s,this.data.required),s.name=this.data.fieldName,s.tabIndex=Ge;let n=this.data.combo&&this.data.options.length>0;this.data.combo||(s.size=this.data.options.length,this.data.multiSelect&&(s.multiple=!0)),s.addEventListener("resetform",(()=>{const t=this.data.defaultFieldValue;for(const i of s.options)i.selected=i.value===t}));for(const t of this.data.options){const i=document.createElement("option");i.textContent=t.displayValue,i.value=t.exportValue,e.value.includes(t.exportValue)&&(i.setAttribute("selected",!0),n=!1),s.append(i)}let r=null;if(n){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),s.prepend(t),r=()=>{t.remove(),s.removeEventListener("input",r),r=null},s.addEventListener("input",r)}const o=t=>{const i=t?"value":"textContent",{options:e,multiple:n}=s;return n?Array.prototype.filter.call(e,(t=>t.selected)).map((t=>t[i])):-1===e.selectedIndex?null:e[e.selectedIndex][i]};let h=o(!1);const a=t=>Array.prototype.map.call(t.target.options,(t=>({displayValue:t.textContent,exportValue:t.value})));return this.enableScripting&&this.hasJSActions?(s.addEventListener("updatefromsandbox",(e=>{this._dispatchEventFromSandbox({value(e){r?.();const n=e.detail.value,a=new Set(Array.isArray(n)?n:[n]);for(const t of s.options)t.selected=a.has(t.value);t.setValue(i,{value:o(!0)}),h=o(!1)},multipleSelection(t){s.multiple=!0},remove(e){const n=s.options,r=e.detail.remove;n[r].selected=!1,s.remove(r),n.length>0&&-1===Array.prototype.findIndex.call(n,(t=>t.selected))&&(n[0].selected=!0),t.setValue(i,{value:o(!0),items:a(e)}),h=o(!1)},clear(e){for(;0!==s.length;)s.remove(0);t.setValue(i,{value:null,items:[]}),h=o(!1)},insert(e){const{index:n,displayValue:r,exportValue:c}=e.detail.insert,l=s.children[n],u=document.createElement("option");u.textContent=r,u.value=c,l?l.before(u):s.append(u),t.setValue(i,{value:o(!0),items:a(e)}),h=o(!1)},items(e){const{items:n}=e.detail;for(;0!==s.length;)s.remove(0);for(const t of n){const{displayValue:i,exportValue:e}=t,n=document.createElement("option");n.textContent=i,n.value=e,s.append(n)}s.options.length>0&&(s.options[0].selected=!0),t.setValue(i,{value:o(!0),items:a(e)}),h=o(!1)},indices(e){const s=new Set(e.detail.indices);for(const t of e.target.options)t.selected=s.has(t.index);t.setValue(i,{value:o(!0)}),h=o(!1)},editable(t){t.target.disabled=!t.detail.editable}},e)})),s.addEventListener("input",(e=>{const s=o(!0),n=o(!1);t.setValue(i,{value:s}),e.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:h,change:n,changeEx:s,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(s,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(t=>t.target.value))):s.addEventListener("input",(function(){t.setValue(i,{value:o(!0)})})),this.data.combo&&this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class ss extends Xe{constructor(t){const{data:i,elements:e}=t;super(t,{isRenderable:Xe._hasPopupData(i)}),this.elements=e,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new ns({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),i=[];for(const e of this.elements)e.popup=t,e.container.ariaHasPopup="dialog",i.push(e.data.id),e.addHighlightArea();return this.container.setAttribute("aria-controls",i.map((t=>`${ot}${t}`)).join(",")),this.container}}class ns{#sn=this.#nn.bind(this);#rn=this.#on.bind(this);#hn=this.#an.bind(this);#cn=this.#ln.bind(this);#un=null;#wt=null;#dn=null;#fn=null;#pn=null;#gn=null;#wn=null;#mn=!1;#An=null;#_=null;#vn=null;#bn=null;#yn=null;#qs=null;#xn=!1;constructor({container:t,color:i,elements:e,titleObj:s,modificationDate:n,contentsObj:r,richText:o,parent:h,rect:a,parentRect:c,open:l}){this.#wt=t,this.#yn=s,this.#dn=r,this.#bn=o,this.#gn=h,this.#un=i,this.#vn=a,this.#wn=c,this.#pn=e,this.#fn=xt.toDateObject(n),this.trigger=e.flatMap((t=>t.getElementsToTriggerPopup()));for(const t of this.trigger)t.addEventListener("click",this.#cn),t.addEventListener("mouseenter",this.#hn),t.addEventListener("mouseleave",this.#rn),t.classList.add("popupTriggerArea");for(const t of e)t.container?.addEventListener("keydown",this.#sn);this.#wt.hidden=!0,l&&this.#ln()}render(){if(this.#An)return;const t=this.#An=document.createElement("div");if(t.className="popup",this.#un){const i=t.style.outlineColor=it.makeHexColor(...this.#un);t.style.backgroundColor=`color-mix(in srgb, ${i} 30%, white)`}const i=document.createElement("span");i.className="header";const e=document.createElement("h1");if(i.append(e),({dir:e.dir,str:e.textContent}=this.#yn),t.append(i),this.#fn){const t=document.createElement("span");t.classList.add("popupDate"),t.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),t.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#fn.valueOf()})),i.append(t)}const s=this.#Mn;if(s)He.render({xfaHtml:s,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const i=this._formatContents(this.#dn);t.append(i)}this.#wt.append(t)}get#Mn(){const t=this.#bn,i=this.#dn;return!t?.str||i?.str&&i.str!==t.str?null:this.#bn.html||null}get#kn(){return this.#Mn?.attributes?.style?.fontSize||0}get#En(){return this.#Mn?.attributes?.style?.color||null}#Sn(t){const i=[],e={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:i}]}},s={style:{color:this.#En,fontSize:this.#kn?`calc(${this.#kn}px * var(--total-scale-factor))`:""}};for(const e of t.split("\n"))i.push({name:"span",value:e,attributes:s});return e}_formatContents({str:t,dir:i}){const e=document.createElement("p");e.classList.add("popupContent"),e.dir=i;const s=t.split(/(?:\r\n?|\n)/);for(let t=0,i=s.length;t<i;++t)e.append(document.createTextNode(s[t])),t<i-1&&e.append(document.createElement("br"));return e}#nn(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&this.#mn)&&this.#ln()}updateEdited({rect:t,popupContent:i}){this.#qs||={contentsObj:this.#dn,richText:this.#bn},t&&(this.#_=null),i&&(this.#bn=this.#Sn(i),this.#dn=null),this.#An?.remove(),this.#An=null}resetEdited(){this.#qs&&(({contentsObj:this.#dn,richText:this.#bn}=this.#qs),this.#qs=null,this.#An?.remove(),this.#An=null,this.#_=null)}#_n(){if(null!==this.#_)return;const{page:{view:t},viewport:{rawDims:{pageWidth:i,pageHeight:e,pageX:s,pageY:n}}}=this.#gn;let r=!!this.#wn,o=r?this.#wn:this.#vn;for(const t of this.#pn)if(!o||null!==it.intersect(t.data.rect,o)){o=t.data.rect,r=!0;break}const h=it.normalizeRect([o[0],t[3]-o[1]+t[1],o[2],t[3]-o[3]+t[1]]);this.#_=[100*(h[0]+(r?o[2]-o[0]+5:0)-s)/i,100*(h[1]-n)/e];const{style:a}=this.#wt;a.left=`${this.#_[0]}%`,a.top=`${this.#_[1]}%`}#ln(){this.#mn=!this.#mn,this.#mn?(this.#an(),this.#wt.addEventListener("click",this.#cn),this.#wt.addEventListener("keydown",this.#sn)):(this.#on(),this.#wt.removeEventListener("click",this.#cn),this.#wt.removeEventListener("keydown",this.#sn))}#an(){this.#An||this.render(),this.isVisible?this.#mn&&this.#wt.classList.add("focused"):(this.#_n(),this.#wt.hidden=!1,this.#wt.style.zIndex=parseInt(this.#wt.style.zIndex)+1e3)}#on(){this.#wt.classList.remove("focused"),!this.#mn&&this.isVisible&&(this.#wt.hidden=!0,this.#wt.style.zIndex=parseInt(this.#wt.style.zIndex)-1e3)}forceHide(){this.#xn=this.isVisible,this.#xn&&(this.#wt.hidden=!0)}maybeShow(){this.#xn&&(this.#An||this.#an(),this.#xn=!1,this.#wt.hidden=!1)}get isVisible(){return!1===this.#wt.hidden}}class rs extends Xe{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=S.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const i of this.textContent){const e=document.createElement("span");e.textContent=i,t.append(e)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class os extends Xe{#Tn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:t,width:i,height:e}=this,s=this.svgFactory.create(i,e,!0),n=this.#Tn=this.svgFactory.createElement("svg:line");return n.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),n.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),n.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),n.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),n.setAttribute("stroke-width",t.borderStyle.width||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),s.append(n),this.container.append(s),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Tn}addHighlightArea(){this.container.classList.add("highlightArea")}}class hs extends Xe{#Cn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:t,width:i,height:e}=this,s=this.svgFactory.create(i,e,!0),n=t.borderStyle.width,r=this.#Cn=this.svgFactory.createElement("svg:rect");return r.setAttribute("x",n/2),r.setAttribute("y",n/2),r.setAttribute("width",i-n),r.setAttribute("height",e-n),r.setAttribute("stroke-width",n||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),s.append(r),this.container.append(s),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Cn}addHighlightArea(){this.container.classList.add("highlightArea")}}class as extends Xe{#Pn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:t,width:i,height:e}=this,s=this.svgFactory.create(i,e,!0),n=t.borderStyle.width,r=this.#Pn=this.svgFactory.createElement("svg:ellipse");return r.setAttribute("cx",i/2),r.setAttribute("cy",e/2),r.setAttribute("rx",i/2-n/2),r.setAttribute("ry",e/2-n/2),r.setAttribute("stroke-width",n||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),s.append(r),this.container.append(s),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Pn}addHighlightArea(){this.container.classList.add("highlightArea")}}class cs extends Xe{#Rn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:i,borderStyle:e,popupRef:s},width:n,height:r}=this;if(!i)return this.container;const o=this.svgFactory.create(n,r,!0);let h=[];for(let e=0,s=i.length;e<s;e+=2)h.push(`${i[e]-t[0]},${t[3]-i[e+1]}`);h=h.join(" ");const a=this.#Rn=this.svgFactory.createElement(this.svgElementName);return a.setAttribute("points",h),a.setAttribute("stroke-width",e.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),o.append(a),this.container.append(o),!s&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Rn}addHighlightArea(){this.container.classList.add("highlightArea")}}class ls extends cs{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class us extends Xe{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class ds extends Xe{#Nn=null;#Dn=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType="InkHighlight"===this.data.it?S.HIGHLIGHT:S.INK}#In(t,i){switch(t){case 90:return{transform:`rotate(90) translate(${-i[0]},${i[1]}) scale(1,-1)`,width:i[3]-i[1],height:i[2]-i[0]};case 180:return{transform:`rotate(180) translate(${-i[2]},${i[1]}) scale(1,-1)`,width:i[2]-i[0],height:i[3]-i[1]};case 270:return{transform:`rotate(270) translate(${-i[2]},${i[3]}) scale(1,-1)`,width:i[3]-i[1],height:i[2]-i[0]};default:return{transform:`translate(${-i[0]},${i[3]}) scale(1,-1)`,width:i[2]-i[0],height:i[3]-i[1]}}}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,rotation:i,inkLists:e,borderStyle:s,popupRef:n}}=this,{transform:r,width:o,height:h}=this.#In(i,t),a=this.svgFactory.create(o,h,!0),c=this.#Nn=this.svgFactory.createElement("svg:g");a.append(c),c.setAttribute("stroke-width",s.width||1),c.setAttribute("stroke-linecap","round"),c.setAttribute("stroke-linejoin","round"),c.setAttribute("stroke-miterlimit",10),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),c.setAttribute("transform",r);for(let t=0,i=e.length;t<i;t++){const i=this.svgFactory.createElement(this.svgElementName);this.#Dn.push(i),i.setAttribute("points",e[t].join(",")),c.append(i)}return!n&&this.hasPopupData&&this._createPopup(),this.container.append(a),this._editOnDoubleClick(),this.container}updateEdited(t){super.updateEdited(t);const{thickness:i,points:e,rect:s}=t,n=this.#Nn;if(i>=0&&n.setAttribute("stroke-width",i||1),e)for(let t=0,i=this.#Dn.length;t<i;t++)this.#Dn[t].setAttribute("points",e[t].join(","));if(s){const{transform:t,width:i,height:e}=this.#In(this.data.rotation,s);n.parentElement.setAttribute("viewBox",`0 0 ${i} ${e}`),n.setAttribute("transform",t)}}getElementsToTriggerPopup(){return this.#Dn}addHighlightArea(){this.container.classList.add("highlightArea")}}class fs extends Xe{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=S.HIGHLIGHT}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),this.container}}class ps extends Xe{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class gs extends Xe{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class ws extends Xe{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class ms extends Xe{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=S.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class As extends Xe{#Fn=null;constructor(t){super(t,{isRenderable:!0});const{file:i}=this.data;this.filename=i.filename,this.content=i.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...i})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:i}=this;let e;i.hasAppearance||0===i.fillAlpha?e=document.createElement("div"):(e=document.createElement("img"),e.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(i.name)?"paperclip":"pushpin"}.svg`,i.fillAlpha&&i.fillAlpha<1&&(e.style=`filter: opacity(${Math.round(100*i.fillAlpha)}%);`)),e.addEventListener("dblclick",this.#On.bind(this)),this.#Fn=e;const{isMac:s}=Z.platform;return t.addEventListener("keydown",(t=>{"Enter"===t.key&&(s?t.metaKey:t.ctrlKey)&&this.#On()})),!i.popupRef&&this.hasPopupData?this._createPopup():e.classList.add("popupTriggerArea"),t.append(e),t}getElementsToTriggerPopup(){return this.#Fn}addHighlightArea(){this.container.classList.add("highlightArea")}#On(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class vs{#$n=null;#Ln=null;#Bn=new Map;#jn=null;constructor({div:t,accessibilityManager:i,annotationCanvasMap:e,annotationEditorUIManager:s,page:n,viewport:r,structTreeLayer:o}){this.div=t,this.#$n=i,this.#Ln=e,this.#jn=o||null,this.page=n,this.viewport=r,this.zIndex=0,this._annotationEditorUIManager=s}hasEditableAnnotations(){return this.#Bn.size>0}async#Un(t,i){const e=t.firstChild||t,s=e.id=`${ot}${i}`,n=await(this.#jn?.getAriaAttributes(s));if(n)for(const[t,i]of n)e.setAttribute(t,i);this.div.append(t),this.#$n?.moveElementInDOM(this.div,t,e,!1)}async render(t){const{annotations:i}=t,e=this.div;_t(e,this.viewport);const s=new Map,n={data:null,layer:e,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new ze,annotationStorage:t.annotationStorage||new Yt,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const t of i){if(t.noHTML)continue;const i=t.annotationType===P.POPUP;if(i){const i=s.get(t.id);if(!i)continue;n.elements=i}else if(t.rect[2]===t.rect[0]||t.rect[3]===t.rect[1])continue;n.data=t;const e=Ve.create(n);if(!e.isRenderable)continue;if(!i&&t.popupRef){const i=s.get(t.popupRef);i?i.push(e):s.set(t.popupRef,[e])}const r=e.render();t.hidden&&(r.style.visibility="hidden"),await this.#Un(r,t.id),e._isEditable&&(this.#Bn.set(e.data.id,e),this._annotationEditorUIManager?.renderAnnotationElement(e))}this.#zn()}async addLinkAnnotations(t,i){const e={data:null,layer:this.div,linkService:i,svgFactory:new ze,parent:this};for(const i of t){i.borderStyle||=vs._defaultBorderStyle,e.data=i;const t=Ve.create(e);if(!t.isRenderable)continue;const s=t.render();await this.#Un(s,i.id)}}update({viewport:t}){const i=this.div;this.viewport=t,_t(i,{rotation:t.rotation}),this.#zn(),i.hidden=!1}#zn(){if(!this.#Ln)return;const t=this.div;for(const[i,e]of this.#Ln){const s=t.querySelector(`[data-annotation-id="${i}"]`);if(!s)continue;e.className="annotationContent";const{firstChild:n}=s;n?"CANVAS"===n.nodeName?n.replaceWith(e):n.classList.contains("annotationContent")?n.after(e):n.before(e):s.append(e);const r=this.#Bn.get(i);r&&(r._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(i,s.id,e),r._hasNoCanvas=!1):r.canvas=e)}this.#Ln.clear()}getEditableAnnotations(){return Array.from(this.#Bn.values())}getEditableAnnotation(t){return this.#Bn.get(t)}static get _defaultBorderStyle(){return H(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:1,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}}const bs=/\r\n?|\n/g;class ys extends Ut{#un;#Hn="";#Gn=`${this.id}-editor`;#Wn=null;#kn;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=ys.prototype,i=t=>t.isEmpty(),e=Lt.TRANSLATE_SMALL,s=Lt.TRANSLATE_BIG;return H(this,"_keyboardManager",new Ot([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-e,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-s,0],checker:i}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[e,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[s,0],checker:i}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-e],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-s],checker:i}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,e],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,s],checker:i}]]))}static _type="freetext";static _editorType=S.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"}),this.#un=t.color||ys._defaultColor||Ut._defaultLineColor,this.#kn=t.fontSize||ys._defaultFontSize}static initialize(t,i){Ut.initialize(t,i);const e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,i){switch(t){case _.FREETEXT_SIZE:ys._defaultFontSize=i;break;case _.FREETEXT_COLOR:ys._defaultColor=i}}updateParams(t,i){switch(t){case _.FREETEXT_SIZE:this.#Vn(i);break;case _.FREETEXT_COLOR:this.#Xn(i)}}static get defaultPropertiesToUpdate(){return[[_.FREETEXT_SIZE,ys._defaultFontSize],[_.FREETEXT_COLOR,ys._defaultColor||Ut._defaultLineColor]]}get propertiesToUpdate(){return[[_.FREETEXT_SIZE,this.#kn],[_.FREETEXT_COLOR,this.#un]]}#Vn(t){const i=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--total-scale-factor))`,this.translate(0,-(t-this.#kn)*this.parentScale),this.#kn=t,this.#Yn()},e=this.#kn;this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:_.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#Xn(t){const i=t=>{this.#un=this.editorDiv.style.color=t},e=this.#un;this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:_.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,i){this._uiManager.translateSelectedEditors(t,i,!0)}getInitialTranslation(){const t=this.parentScale;return[-ys._internalPadding*t,-(ys._internalPadding+this.#kn)*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#Wn=new AbortController;const t=this._uiManager.combinedSignal(this.#Wn);return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t}),!0}disableEditMode(){return!!super.disableEditMode()&&(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#Gn),this._isDraggable=!0,this.#Wn?.abort(),this.#Wn=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0)}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(t){this.width||(this.enableEditMode(),t&&this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#Qn(){const t=[];this.editorDiv.normalize();let i=null;for(const e of this.editorDiv.childNodes)i?.nodeType===Node.TEXT_NODE&&"BR"===e.nodeName||(t.push(ys.#qn(e)),i=e);return t.join("\n")}#Yn(){const[t,i]=this.parentDimensions;let e;if(this.isAttachedToDOM)e=this.div.getBoundingClientRect();else{const{currentLayer:t,div:i}=this,s=i.style.display,n=i.classList.contains("hidden");i.classList.remove("hidden"),i.style.display="hidden",t.div.append(this.div),e=i.getBoundingClientRect(),i.remove(),i.style.display=s,i.classList.toggle("hidden",n)}this.rotation%180==this.parentRotation%180?(this.width=e.width/t,this.height=e.height/i):(this.width=e.height/t,this.height=e.width/i),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#Hn,i=this.#Hn=this.#Qn().trimEnd();if(t===i)return;const e=t=>{this.#Hn=t,t?(this.#Kn(),this._uiManager.rebuild(this),this.#Yn()):this.remove()};this.addCommands({cmd:()=>{e(i)},undo:()=>{e(t)},mustExec:!1}),this.#Yn()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){ys._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let t,i;(this._isCopy||this.annotationElementId)&&(t=this.x,i=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#Gn),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:e}=this.editorDiv;if(e.fontSize=`calc(${this.#kn}px * var(--total-scale-factor))`,e.color=this.#un,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[e,s]=this.parentDimensions;if(this.annotationElementId){const{position:n}=this._initialData;let[r,o]=this.getInitialTranslation();[r,o]=this.pageTranslationToScreen(r,o);const[h,a]=this.pageDimensions,[c,l]=this.pageTranslation;let u,d;switch(this.rotation){case 0:u=t+(n[0]-c)/h,d=i+this.height-(n[1]-l)/a;break;case 90:u=t+(n[0]-c)/h,d=i-(n[1]-l)/a,[r,o]=[o,-r];break;case 180:u=t-this.width+(n[0]-c)/h,d=i-(n[1]-l)/a,[r,o]=[-r,-o];break;case 270:u=t+(n[0]-c-this.height*a)/h,d=i+(n[1]-l-this.width*h)/a,[r,o]=[-o,r]}this.setAt(u*e,d*s,r,o)}else this._moveAfterPaste(t,i);this.#Kn(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#qn(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(bs,"")}editorDivPaste(t){const i=t.clipboardData||window.clipboardData,{types:e}=i;if(1===e.length&&"text/plain"===e[0])return;t.preventDefault();const s=ys.#Jn(i.getData("text")||"").replaceAll(bs,"\n");if(!s)return;const n=window.getSelection();if(!n.rangeCount)return;this.editorDiv.normalize(),n.deleteFromDocument();const r=n.getRangeAt(0);if(!s.includes("\n"))return r.insertNode(document.createTextNode(s)),this.editorDiv.normalize(),void n.collapseToStart();const{startContainer:o,startOffset:h}=r,a=[],c=[];if(o.nodeType===Node.TEXT_NODE){const t=o.parentElement;if(c.push(o.nodeValue.slice(h).replaceAll(bs,"")),t!==this.editorDiv){let i=a;for(const e of this.editorDiv.childNodes)e!==t?i.push(ys.#qn(e)):i=c}a.push(o.nodeValue.slice(0,h).replaceAll(bs,""))}else if(o===this.editorDiv){let t=a,i=0;for(const e of this.editorDiv.childNodes)i++===h&&(t=c),t.push(ys.#qn(e))}this.#Hn=`${a.join("\n")}${s}${c.join("\n")}`,this.#Kn();const l=new Range;let u=Math.sumPrecise(a.map((t=>t.length)));for(const{firstChild:t}of this.editorDiv.childNodes)if(t.nodeType===Node.TEXT_NODE){const i=t.nodeValue.length;if(u<=i){l.setStart(t,u),l.setEnd(t,u);break}u-=i}n.removeAllRanges(),n.addRange(l)}#Kn(){if(this.editorDiv.replaceChildren(),this.#Hn)for(const t of this.#Hn.split("\n")){const i=document.createElement("div");i.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(i)}}#Zn(){return this.#Hn.replaceAll(" "," ")}static#Jn(t){return t.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}static async deserialize(t,i,e){let s=null;if(t instanceof rs){const{data:{defaultAppearanceData:{fontSize:i,fontColor:e},rect:n,rotation:r,id:o,popupRef:h},textContent:a,textPosition:c,parent:{page:{pageNumber:l}}}=t;if(!a||0===a.length)return null;s=t={annotationType:S.FREETEXT,color:Array.from(e),fontSize:i,value:a.join("\n"),position:c,pageIndex:l-1,rect:n.slice(0),rotation:r,id:o,deleted:!1,popupRef:h}}const n=await super.deserialize(t,i,e);return n.#kn=t.fontSize,n.#un=it.makeHexColor(...t.color),n.#Hn=ys.#Jn(t.value),n.annotationElementId=t.id||null,n._initialData=s,n}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=ys._internalPadding*this.parentScale,e=this.getRect(i,i),s=Ut._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#un),n={annotationType:S.FREETEXT,color:s,fontSize:this.#kn,value:this.#Zn(),pageIndex:this.pageIndex,rect:e,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?(n.isCopy=!0,n):this.annotationElementId&&!this.#tr(n)?null:(n.id=this.annotationElementId,n)}#tr(t){const{value:i,fontSize:e,color:s,pageIndex:n}=this._initialData;return this._hasBeenMoved||t.value!==i||t.fontSize!==e||t.color.some(((t,i)=>t!==s[i]))||t.pageIndex!==n}renderAnnotationElement(t){const i=super.renderAnnotationElement(t);if(this.deleted)return i;const{style:e}=i;e.fontSize=`calc(${this.#kn}px * var(--total-scale-factor))`,e.color=this.#un,i.replaceChildren();for(const t of this.#Hn.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),i.append(e)}const s=ys._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(s,s),popupContent:this.#Hn}),i}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}class xs{static PRECISION=1e-4;toSVGPath(){B("Abstract method `toSVGPath` must be implemented.")}get box(){B("Abstract getter `box` must be implemented.")}serialize(t,i){B("Abstract method `serialize` must be implemented.")}static _rescale(t,i,e,s,n,r){r||=new Float32Array(t.length);for(let o=0,h=t.length;o<h;o+=2)r[o]=i+t[o]*s,r[o+1]=e+t[o+1]*n;return r}static _rescaleAndSwap(t,i,e,s,n,r){r||=new Float32Array(t.length);for(let o=0,h=t.length;o<h;o+=2)r[o]=i+t[o+1]*s,r[o+1]=e+t[o]*n;return r}static _translate(t,i,e,s){s||=new Float32Array(t.length);for(let n=0,r=t.length;n<r;n+=2)s[n]=i+t[n],s[n+1]=e+t[n+1];return s}static svgRound(t){return Math.round(1e4*t)}static _normalizePoint(t,i,e,s,n){switch(n){case 90:return[1-i/e,t/s];case 180:return[1-t/e,1-i/s];case 270:return[i/e,1-t/s];default:return[t/e,i/s]}}static _normalizePagePoint(t,i,e){switch(e){case 90:return[1-i,t];case 180:return[1-t,1-i];case 270:return[i,1-t];default:return[t,i]}}static createBezierPoints(t,i,e,s,n,r){return[(t+5*e)/6,(i+5*s)/6,(5*e+n)/6,(5*s+r)/6,(e+n)/2,(s+r)/2]}}class Ms{#ir;#er=[];#sr;#nr;#rr=[];#or=new Float32Array(18);#hr;#ar;#cr;#lr;#ur;#dr;#fr=[];static#pr=8;static#gr=2;static#wr=Ms.#pr+Ms.#gr;constructor({x:t,y:i},e,s,n,r,o=0){this.#ir=e,this.#dr=n*s,this.#nr=r,this.#or.set([NaN,NaN,NaN,NaN,t,i],6),this.#sr=o,this.#lr=Ms.#pr*s,this.#cr=Ms.#wr*s,this.#ur=s,this.#fr.push(t,i)}isEmpty(){return isNaN(this.#or[8])}#mr(){const t=this.#or.subarray(4,6),i=this.#or.subarray(16,18),[e,s,n,r]=this.#ir;return[(this.#hr+(t[0]-i[0])/2-e)/n,(this.#ar+(t[1]-i[1])/2-s)/r,(this.#hr+(i[0]-t[0])/2-e)/n,(this.#ar+(i[1]-t[1])/2-s)/r]}add({x:t,y:i}){this.#hr=t,this.#ar=i;const[e,s,n,r]=this.#ir;let[o,h,a,c]=this.#or.subarray(8,12);const l=t-a,u=i-c,d=Math.hypot(l,u);if(d<this.#cr)return!1;const f=d-this.#lr,p=f/d,g=p*l,w=p*u;let m=o,A=h;o=a,h=c,a+=g,c+=w,this.#fr?.push(t,i);const v=-w/f*this.#dr,b=g/f*this.#dr;return this.#or.set(this.#or.subarray(2,8),0),this.#or.set([a+v,c+b],4),this.#or.set(this.#or.subarray(14,18),12),this.#or.set([a-v,c-b],16),isNaN(this.#or[6])?(0===this.#rr.length&&(this.#or.set([o+v,h+b],2),this.#rr.push(NaN,NaN,NaN,NaN,(o+v-e)/n,(h+b-s)/r),this.#or.set([o-v,h-b],14),this.#er.push(NaN,NaN,NaN,NaN,(o-v-e)/n,(h-b-s)/r)),this.#or.set([m,A,o,h,a,c],6),!this.isEmpty()):(this.#or.set([m,A,o,h,a,c],6),Math.abs(Math.atan2(A-h,m-o)-Math.atan2(w,g))<Math.PI/2?([o,h,a,c]=this.#or.subarray(2,6),this.#rr.push(NaN,NaN,NaN,NaN,((o+a)/2-e)/n,((h+c)/2-s)/r),[o,h,m,A]=this.#or.subarray(14,18),this.#er.push(NaN,NaN,NaN,NaN,((m+o)/2-e)/n,((A+h)/2-s)/r),!0):([m,A,o,h,a,c]=this.#or.subarray(0,6),this.#rr.push(((m+5*o)/6-e)/n,((A+5*h)/6-s)/r,((5*o+a)/6-e)/n,((5*h+c)/6-s)/r,((o+a)/2-e)/n,((h+c)/2-s)/r),[a,c,o,h,m,A]=this.#or.subarray(12,18),this.#er.push(((m+5*o)/6-e)/n,((A+5*h)/6-s)/r,((5*o+a)/6-e)/n,((5*h+c)/6-s)/r,((o+a)/2-e)/n,((h+c)/2-s)/r),!0))}toSVGPath(){if(this.isEmpty())return"";const t=this.#rr,i=this.#er;if(isNaN(this.#or[6])&&!this.isEmpty())return this.#Ar();const e=[];e.push(`M${t[4]} ${t[5]}`);for(let i=6;i<t.length;i+=6)isNaN(t[i])?e.push(`L${t[i+4]} ${t[i+5]}`):e.push(`C${t[i]} ${t[i+1]} ${t[i+2]} ${t[i+3]} ${t[i+4]} ${t[i+5]}`);this.#vr(e);for(let t=i.length-6;t>=6;t-=6)isNaN(i[t])?e.push(`L${i[t+4]} ${i[t+5]}`):e.push(`C${i[t]} ${i[t+1]} ${i[t+2]} ${i[t+3]} ${i[t+4]} ${i[t+5]}`);return this.#br(e),e.join(" ")}#Ar(){const[t,i,e,s]=this.#ir,[n,r,o,h]=this.#mr();return`M${(this.#or[2]-t)/e} ${(this.#or[3]-i)/s} L${(this.#or[4]-t)/e} ${(this.#or[5]-i)/s} L${n} ${r} L${o} ${h} L${(this.#or[16]-t)/e} ${(this.#or[17]-i)/s} L${(this.#or[14]-t)/e} ${(this.#or[15]-i)/s} Z`}#br(t){const i=this.#er;t.push(`L${i[4]} ${i[5]} Z`)}#vr(t){const[i,e,s,n]=this.#ir,r=this.#or.subarray(4,6),o=this.#or.subarray(16,18),[h,a,c,l]=this.#mr();t.push(`L${(r[0]-i)/s} ${(r[1]-e)/n} L${h} ${a} L${c} ${l} L${(o[0]-i)/s} ${(o[1]-e)/n}`)}newFreeDrawOutline(t,i,e,s,n,r){return new ks(t,i,e,s,n,r)}getOutlines(){const t=this.#rr,i=this.#er,e=this.#or,[s,n,r,o]=this.#ir,h=new Float32Array((this.#fr?.length??0)+2);for(let t=0,i=h.length-2;t<i;t+=2)h[t]=(this.#fr[t]-s)/r,h[t+1]=(this.#fr[t+1]-n)/o;if(h[h.length-2]=(this.#hr-s)/r,h[h.length-1]=(this.#ar-n)/o,isNaN(e[6])&&!this.isEmpty())return this.#yr(h);const a=new Float32Array(this.#rr.length+24+this.#er.length);let c=t.length;for(let i=0;i<c;i+=2)isNaN(t[i])?a[i]=a[i+1]=NaN:(a[i]=t[i],a[i+1]=t[i+1]);c=this.#xr(a,c);for(let t=i.length-6;t>=6;t-=6)for(let e=0;e<6;e+=2)isNaN(i[t+e])?(a[c]=a[c+1]=NaN,c+=2):(a[c]=i[t+e],a[c+1]=i[t+e+1],c+=2);return this.#Mr(a,c),this.newFreeDrawOutline(a,h,this.#ir,this.#ur,this.#sr,this.#nr)}#yr(t){const i=this.#or,[e,s,n,r]=this.#ir,[o,h,a,c]=this.#mr(),l=new Float32Array(36);return l.set([NaN,NaN,NaN,NaN,(i[2]-e)/n,(i[3]-s)/r,NaN,NaN,NaN,NaN,(i[4]-e)/n,(i[5]-s)/r,NaN,NaN,NaN,NaN,o,h,NaN,NaN,NaN,NaN,a,c,NaN,NaN,NaN,NaN,(i[16]-e)/n,(i[17]-s)/r,NaN,NaN,NaN,NaN,(i[14]-e)/n,(i[15]-s)/r],0),this.newFreeDrawOutline(l,t,this.#ir,this.#ur,this.#sr,this.#nr)}#Mr(t,i){const e=this.#er;return t.set([NaN,NaN,NaN,NaN,e[4],e[5]],i),i+6}#xr(t,i){const e=this.#or.subarray(4,6),s=this.#or.subarray(16,18),[n,r,o,h]=this.#ir,[a,c,l,u]=this.#mr();return t.set([NaN,NaN,NaN,NaN,(e[0]-n)/o,(e[1]-r)/h,NaN,NaN,NaN,NaN,a,c,NaN,NaN,NaN,NaN,l,u,NaN,NaN,NaN,NaN,(s[0]-n)/o,(s[1]-r)/h],i),i+24}}class ks extends xs{#ir;#kr=new Float32Array(4);#sr;#nr;#fr;#ur;#Er;constructor(t,i,e,s,n,r){super(),this.#Er=t,this.#fr=i,this.#ir=e,this.#ur=s,this.#sr=n,this.#nr=r,this.lastPoint=[NaN,NaN],this.#Sr(r);const[o,h,a,c]=this.#kr;for(let i=0,e=t.length;i<e;i+=2)t[i]=(t[i]-o)/a,t[i+1]=(t[i+1]-h)/c;for(let t=0,e=i.length;t<e;t+=2)i[t]=(i[t]-o)/a,i[t+1]=(i[t+1]-h)/c}toSVGPath(){const t=[`M${this.#Er[4]} ${this.#Er[5]}`];for(let i=6,e=this.#Er.length;i<e;i+=6)isNaN(this.#Er[i])?t.push(`L${this.#Er[i+4]} ${this.#Er[i+5]}`):t.push(`C${this.#Er[i]} ${this.#Er[i+1]} ${this.#Er[i+2]} ${this.#Er[i+3]} ${this.#Er[i+4]} ${this.#Er[i+5]}`);return t.push("Z"),t.join(" ")}serialize([t,i,e,s],n){const r=e-t,o=s-i;let h,a;switch(n){case 0:h=xs._rescale(this.#Er,t,s,r,-o),a=xs._rescale(this.#fr,t,s,r,-o);break;case 90:h=xs._rescaleAndSwap(this.#Er,t,i,r,o),a=xs._rescaleAndSwap(this.#fr,t,i,r,o);break;case 180:h=xs._rescale(this.#Er,e,i,-r,o),a=xs._rescale(this.#fr,e,i,-r,o);break;case 270:h=xs._rescaleAndSwap(this.#Er,e,s,-r,-o),a=xs._rescaleAndSwap(this.#fr,e,s,-r,-o)}return{outline:Array.from(h),points:[Array.from(a)]}}#Sr(t){const i=this.#Er;let e=i[4],s=i[5];const n=[e,s,e,s];let r=e,o=s;const h=t?Math.max:Math.min;for(let t=6,a=i.length;t<a;t+=6){const a=i[t+4],c=i[t+5];if(isNaN(i[t]))it.pointBoundingBox(a,c,n),o<c?(r=a,o=c):o===c&&(r=h(r,a));else{const a=[1/0,1/0,-1/0,-1/0];it.bezierBoundingBox(e,s,...i.slice(t,t+6),a),it.rectBoundingBox(...a,n),o<a[3]?(r=a[2],o=a[3]):o===a[3]&&(r=h(r,a[2]))}e=a,s=c}const a=this.#kr;a[0]=n[0]-this.#sr,a[1]=n[1]-this.#sr,a[2]=n[2]-n[0]+2*this.#sr,a[3]=n[3]-n[1]+2*this.#sr,this.lastPoint=[r,o]}get box(){return this.#kr}newOutliner(t,i,e,s,n,r=0){return new Ms(t,i,e,s,n,r)}getNewOutline(t,i){const[e,s,n,r]=this.#kr,[o,h,a,c]=this.#ir,l=n*a,u=r*c,d=e*a+o,f=s*c+h,p=this.newOutliner({x:this.#fr[0]*l+d,y:this.#fr[1]*u+f},this.#ir,this.#ur,t,this.#nr,i??this.#sr);for(let t=2;t<this.#fr.length;t+=2)p.add({x:this.#fr[t]*l+d,y:this.#fr[t+1]*u+f});return p.getOutlines()}}class Es{#ir;#_r;#Tr=[];#Cr=[];constructor(t,i=0,e=0,s=!0){const n=[1/0,1/0,-1/0,-1/0],r=10**-4;for(const{x:e,y:s,width:o,height:h}of t){const t=Math.floor((e-i)/r)*r,a=Math.ceil((e+o+i)/r)*r,c=Math.floor((s-i)/r)*r,l=Math.ceil((s+h+i)/r)*r;this.#Tr.push([t,c,l,!0],[a,c,l,!1]),it.rectBoundingBox(t,c,a,l,n)}const o=n[2]-n[0]+2*e,h=n[3]-n[1]+2*e,a=n[0]-e,c=n[1]-e,l=this.#Tr.at(s?-1:-2),u=[l[0],l[2]];for(const t of this.#Tr){const[i,e,s]=t;t[0]=(i-a)/o,t[1]=(e-c)/h,t[2]=(s-c)/h}this.#ir=new Float32Array([a,c,o,h]),this.#_r=u}getOutlines(){this.#Tr.sort(((t,i)=>t[0]-i[0]||t[1]-i[1]||t[2]-i[2]));const t=[];for(const i of this.#Tr)i[3]?(t.push(...this.#Pr(i)),this.#Rr(i)):(this.#Nr(i),t.push(...this.#Pr(i)));return this.#Dr(t)}#Dr(t){const i=[],e=new Set;for(const e of t){const[t,s,n]=e;i.push([t,s,e],[t,n,e])}i.sort(((t,i)=>t[1]-i[1]||t[0]-i[0]));for(let t=0,s=i.length;t<s;t+=2){const s=i[t][2],n=i[t+1][2];s.push(n),n.push(s),e.add(s),e.add(n)}const s=[];let n;for(;e.size>0;){const t=e.values().next().value;let[i,r,o,h,a]=t;e.delete(t);let c=i,l=r;for(n=[i,o],s.push(n);;){let t;if(e.has(h))t=h;else{if(!e.has(a))break;t=a}e.delete(t),[i,r,o,h,a]=t,c!==i&&(n.push(c,l,i,l===r?r:o),c=i),l=l===r?o:r}n.push(c,l)}return new Ss(s,this.#ir,this.#_r)}#Ir(t){const i=this.#Cr;let e=0,s=i.length-1;for(;e<=s;){const n=e+s>>1,r=i[n][0];if(r===t)return n;r<t?e=n+1:s=n-1}return s+1}#Rr([,t,i]){const e=this.#Ir(t);this.#Cr.splice(e,0,[t,i])}#Nr([,t,i]){const e=this.#Ir(t);for(let s=e;s<this.#Cr.length;s++){const[e,n]=this.#Cr[s];if(e!==t)break;if(e===t&&n===i)return void this.#Cr.splice(s,1)}for(let s=e-1;s>=0;s--){const[e,n]=this.#Cr[s];if(e!==t)break;if(e===t&&n===i)return void this.#Cr.splice(s,1)}}#Pr(t){const[i,e,s]=t,n=[[i,e,s]],r=this.#Ir(s);for(let t=0;t<r;t++){const[e,s]=this.#Cr[t];for(let t=0,r=n.length;t<r;t++){const[,o,h]=n[t];if(!(s<=o||h<=e))if(o>=e)if(h>s)n[t][1]=s;else{if(1===r)return[];n.splice(t,1),t--,r--}else n[t][2]=e,h>s&&n.push([i,s,h])}}return n}}class Ss extends xs{#ir;#Fr;constructor(t,i,e){super(),this.#Fr=t,this.#ir=i,this.lastPoint=e}toSVGPath(){const t=[];for(const i of this.#Fr){let[e,s]=i;t.push(`M${e} ${s}`);for(let n=2;n<i.length;n+=2){const r=i[n],o=i[n+1];r===e?(t.push(`V${o}`),s=o):o===s&&(t.push(`H${r}`),e=r)}t.push("Z")}return t.join(" ")}serialize([t,i,e,s],n){const r=[],o=e-t,h=s-i;for(const i of this.#Fr){const e=new Array(i.length);for(let n=0;n<i.length;n+=2)e[n]=t+i[n]*o,e[n+1]=s-i[n+1]*h;r.push(e)}return r}get box(){return this.#ir}get classNamesForOutlining(){return["highlightOutline"]}}class _s extends Ms{newFreeDrawOutline(t,i,e,s,n,r){return new Ts(t,i,e,s,n,r)}}class Ts extends ks{newOutliner(t,i,e,s,n,r=0){return new _s(t,i,e,s,n,r)}}class Cs{#Or=null;#$r=null;#Lr;#Br=null;#jr=!1;#Ur=!1;#r=null;#zr;#Hr=null;#w=null;#Gr;static#Wr=null;static get _keyboardManager(){return H(this,"_keyboardManager",new Ot([[["Escape","mac+Escape"],Cs.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Cs.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Cs.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Cs.prototype._moveToPrevious],[["Home","mac+Home"],Cs.prototype._moveToBeginning],[["End","mac+End"],Cs.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:i=null}){t?(this.#Ur=!1,this.#Gr=_.HIGHLIGHT_COLOR,this.#r=t):(this.#Ur=!0,this.#Gr=_.HIGHLIGHT_DEFAULT_COLOR),this.#w=t?._uiManager||i,this.#zr=this.#w._eventBus,this.#Lr=t?.color||this.#w?.highlightColors.values().next().value||"#FFFF98",Cs.#Wr||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const t=this.#Or=document.createElement("button");t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.setAttribute("aria-haspopup",!0);const i=this.#w._signal;t.addEventListener("click",this.#Vr.bind(this),{signal:i}),t.addEventListener("keydown",this.#nn.bind(this),{signal:i});const e=this.#$r=document.createElement("span");return e.className="swatch",e.setAttribute("aria-hidden",!0),e.style.backgroundColor=this.#Lr,t.append(e),t}renderMainDropdown(){const t=this.#Br=this.#Xr();return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}#Xr(){const t=document.createElement("div"),i=this.#w._signal;t.addEventListener("contextmenu",bt,{signal:i}),t.className="dropdown",t.role="listbox",t.setAttribute("aria-multiselectable",!1),t.setAttribute("aria-orientation","vertical"),t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[e,s]of this.#w.highlightColors){const n=document.createElement("button");n.tabIndex="0",n.role="option",n.setAttribute("data-color",s),n.title=e,n.setAttribute("data-l10n-id",Cs.#Wr[e]);const r=document.createElement("span");n.append(r),r.className="swatch",r.style.backgroundColor=s,n.setAttribute("aria-selected",s===this.#Lr),n.addEventListener("click",this.#Yr.bind(this,s),{signal:i}),t.append(n)}return t.addEventListener("keydown",this.#nn.bind(this),{signal:i}),t}#Yr(t,i){i.stopPropagation(),this.#zr.dispatch("switchannotationeditorparams",{source:this,type:this.#Gr,value:t})}_colorSelectFromKeyboard(t){if(t.target===this.#Or)return void this.#Vr(t);const i=t.target.getAttribute("data-color");i&&this.#Yr(i,t)}_moveToNext(t){this.#Qr?t.target!==this.#Or?t.target.nextSibling?.focus():this.#Br.firstChild?.focus():this.#Vr(t)}_moveToPrevious(t){t.target!==this.#Br?.firstChild&&t.target!==this.#Or?(this.#Qr||this.#Vr(t),t.target.previousSibling?.focus()):this.#Qr&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){this.#Qr?this.#Br.firstChild?.focus():this.#Vr(t)}_moveToEnd(t){this.#Qr?this.#Br.lastChild?.focus():this.#Vr(t)}#nn(t){Cs._keyboardManager.exec(this,t)}#Vr(t){if(this.#Qr)return void this.hideDropdown();if(this.#jr=0===t.detail,this.#Hr||(this.#Hr=new AbortController,window.addEventListener("pointerdown",this.#l.bind(this),{signal:this.#w.combinedSignal(this.#Hr)})),this.#Br)return void this.#Br.classList.remove("hidden");const i=this.#Br=this.#Xr();this.#Or.append(i)}#l(t){this.#Br?.contains(t.target)||this.hideDropdown()}hideDropdown(){this.#Br?.classList.add("hidden"),this.#Hr?.abort(),this.#Hr=null}get#Qr(){return this.#Br&&!this.#Br.classList.contains("hidden")}_hideDropdownFromKeyboard(){this.#Ur||(this.#Qr?(this.hideDropdown(),this.#Or.focus({preventScroll:!0,focusVisible:this.#jr})):this.#r?.unselect())}updateColor(t){if(this.#$r&&(this.#$r.style.backgroundColor=t),!this.#Br)return;const i=this.#w.highlightColors.values();for(const e of this.#Br.children)e.setAttribute("aria-selected",i.next().value===t)}destroy(){this.#Or?.remove(),this.#Or=null,this.#$r=null,this.#Br?.remove(),this.#Br=null}}class Ps extends Ut{#qr=null;#Kr=0;#Jr;#Zr=null;#n=null;#to=null;#io=null;#eo=0;#so=null;#no=null;#b=null;#ro=!1;#_r=null;#oo;#ho=null;#ao="";#dr;#co="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=S.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const t=Ps.prototype;return H(this,"_keyboardManager",new Ot([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:"highlightEditor"}),this.color=t.color||Ps._defaultColor,this.#dr=t.thickness||Ps._defaultThickness,this.#oo=t.opacity||Ps._defaultOpacity,this.#Jr=t.boxes||null,this.#co=t.methodOfCreation||"",this.#ao=t.text||"",this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(this.#ro=!0,this.#lo(t),this.#uo()):this.#Jr&&(this.#qr=t.anchorNode,this.#Kr=t.anchorOffset,this.#io=t.focusNode,this.#eo=t.focusOffset,this.#do(),this.#uo(),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:this.#ro?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#dr,methodOfCreation:this.#co}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}#do(){const t=new Es(this.#Jr,.001);this.#no=t.getOutlines(),[this.x,this.y,this.width,this.height]=this.#no.box;const i=new Es(this.#Jr,.0025,.001,"ltr"===this._uiManager.direction);this.#to=i.getOutlines();const{lastPoint:e}=this.#to;this.#_r=[(e[0]-this.x)/this.width,(e[1]-this.y)/this.height]}#lo({highlightOutlines:t,highlightId:i,clipPathId:e}){if(this.#no=t,this.#to=t.getNewOutline(this.#dr/2+1.5,.0025),i>=0)this.#b=i,this.#Zr=e,this.parent.drawLayer.finalizeDraw(i,{bbox:t.box,path:{d:t.toSVGPath()}}),this.#ho=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#to.box,path:{d:this.#to.toSVGPath()}},!0);else if(this.parent){const i=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#b,{bbox:Ps.#fo(this.#no.box,(i-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#ho,{bbox:Ps.#fo(this.#to.box,i),path:{d:this.#to.toSVGPath()}})}const[s,n,r,o]=t.box;switch(this.rotation){case 0:this.x=s,this.y=n,this.width=r,this.height=o;break;case 90:{const[t,i]=this.parentDimensions;this.x=n,this.y=1-s,this.width=r*i/t,this.height=o*t/i;break}case 180:this.x=1-s,this.y=1-n,this.width=r,this.height=o;break;case 270:{const[t,i]=this.parentDimensions;this.x=1-n,this.y=s,this.width=r*i/t,this.height=o*t/i;break}}const{lastPoint:h}=this.#to;this.#_r=[(h[0]-s)/r,(h[1]-n)/o]}static initialize(t,i){Ut.initialize(t,i),Ps._defaultColor||=i.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(t,i){switch(t){case _.HIGHLIGHT_DEFAULT_COLOR:Ps._defaultColor=i;break;case _.HIGHLIGHT_THICKNESS:Ps._defaultThickness=i}}translateInPage(t,i){}get toolbarPosition(){return this.#_r}updateParams(t,i){switch(t){case _.HIGHLIGHT_COLOR:this.#Xn(i);break;case _.HIGHLIGHT_THICKNESS:this.#po(i)}}static get defaultPropertiesToUpdate(){return[[_.HIGHLIGHT_DEFAULT_COLOR,Ps._defaultColor],[_.HIGHLIGHT_THICKNESS,Ps._defaultThickness]]}get propertiesToUpdate(){return[[_.HIGHLIGHT_COLOR,this.color||Ps._defaultColor],[_.HIGHLIGHT_THICKNESS,this.#dr||Ps._defaultThickness],[_.HIGHLIGHT_FREE,this.#ro]]}#Xn(t){const i=(t,i)=>{this.color=t,this.#oo=i,this.parent?.drawLayer.updateProperties(this.#b,{root:{fill:t,"fill-opacity":i}}),this.#n?.updateColor(t)},e=this.color,s=this.#oo;this.addCommands({cmd:i.bind(this,t,Ps._defaultOpacity),undo:i.bind(this,e,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:_.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)}#po(t){const i=this.#dr,e=t=>{this.#dr=t,this.#go(t)};this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:_.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&(this.#n=new Cs({editor:this}),t.addColorPicker(this.#n)),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#wo())}getBaseTranslation(){return[0,0]}getRect(t,i){return super.getRect(t,i,this.#wo())}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){this.#mo(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#uo(),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let i=!1;this.parent&&!t?this.#mo():t&&(this.#uo(t),i=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),i&&this.select()}#go(t){if(!this.#ro)return;this.#lo({highlightOutlines:this.#no.getNewOutline(t/2)}),this.fixAndSetPosition();const[i,e]=this.parentDimensions;this.setDims(this.width*i,this.height*e)}#mo(){null!==this.#b&&this.parent&&(this.parent.drawLayer.remove(this.#b),this.#b=null,this.parent.drawLayer.remove(this.#ho),this.#ho=null)}#uo(t=this.parent){null===this.#b&&(({id:this.#b,clipPathId:this.#Zr}=t.drawLayer.draw({bbox:this.#no.box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.#oo},rootClass:{highlight:!0,free:this.#ro},path:{d:this.#no.toSVGPath()}},!1,!0)),this.#ho=t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#ro},bbox:this.#to.box,path:{d:this.#to.toSVGPath()}},this.#ro),this.#so&&(this.#so.style.clipPath=this.#Zr))}static#fo([t,i,e,s],n){switch(n){case 90:return[1-i-s,t,s,e];case 180:return[1-t-e,1-i-s,e,s];case 270:return[i,1-t-e,s,e]}return[t,i,e,s]}rotate(t){const{drawLayer:i}=this.parent;let e;e=this.#ro?Ps.#fo(this.#no.box,t=(t-this.rotation+360)%360):Ps.#fo([this.x,this.y,this.width,this.height],t),i.updateProperties(this.#b,{bbox:e,root:{"data-main-rotation":t}}),i.updateProperties(this.#ho,{bbox:Ps.#fo(this.#to.box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;const t=super.render();this.#ao&&(t.setAttribute("aria-label",this.#ao),t.setAttribute("role","mark")),this.#ro?t.classList.add("free"):this.div.addEventListener("keydown",this.#Ao.bind(this),{signal:this._uiManager._signal});const i=this.#so=document.createElement("div");t.append(i),i.setAttribute("aria-hidden","true"),i.className="internal",i.style.clipPath=this.#Zr;const[e,s]=this.parentDimensions;return this.setDims(this.width*e,this.height*s),Nt(this,this.#so,["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#ho,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#ho,{rootClass:{hovered:!1}})}#Ao(t){Ps._keyboardManager.exec(this,t)}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:this.#vo(!0);break;case 1:case 3:this.#vo(!1)}}#vo(t){if(!this.#qr)return;const i=window.getSelection();t?i.setPosition(this.#qr,this.#Kr):i.setPosition(this.#io,this.#eo)}select(){super.select(),this.#ho&&this.parent?.drawLayer.updateProperties(this.#ho,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#ho&&(this.parent?.drawLayer.updateProperties(this.#ho,{rootClass:{selected:!1}}),this.#ro||this.#vo(!1))}get _mustFixPosition(){return!this.#ro}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(this.#b,{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(this.#ho,{rootClass:{hidden:!t}}))}#wo(){return this.#ro?this.rotation:0}#bo(){if(this.#ro)return null;const[t,i]=this.pageDimensions,[e,s]=this.pageTranslation,n=this.#Jr,r=new Float32Array(8*n.length);let o=0;for(const{x:h,y:a,width:c,height:l}of n){const n=h*t+e,u=(1-a)*i+s;r[o]=r[o+4]=n,r[o+1]=r[o+3]=u,r[o+2]=r[o+6]=n+c*t,r[o+5]=r[o+7]=u-l*i,o+=8}return r}#yo(t){return this.#no.serialize(t,this.#wo())}static startHighlighting(t,i,{target:e,x:s,y:n}){const{x:r,y:o,width:h,height:a}=e.getBoundingClientRect(),c=new AbortController,l=t.combinedSignal(c),u=i=>{c.abort(),this.#xo(t,i)};window.addEventListener("blur",u,{signal:l}),window.addEventListener("pointerup",u,{signal:l}),window.addEventListener("pointerdown",yt,{capture:!0,passive:!1,signal:l}),window.addEventListener("contextmenu",bt,{signal:l}),e.addEventListener("pointermove",this.#Mo.bind(this,t),{signal:l}),this._freeHighlight=new _s({x:s,y:n},[r,o,h,a],t.scale,this._defaultThickness/2,i,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0))}static#Mo(t,i){this._freeHighlight.add(i)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#xo(t,i){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(i,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static async deserialize(t,i,e){let s=null;if(t instanceof fs){const{data:{quadPoints:i,rect:e,rotation:n,id:r,color:o,opacity:h,popupRef:a},parent:{page:{pageNumber:c}}}=t;s=t={annotationType:S.HIGHLIGHT,color:Array.from(o),opacity:h,quadPoints:i,boxes:null,pageIndex:c-1,rect:e.slice(0),rotation:n,id:r,deleted:!1,popupRef:a}}else if(t instanceof ds){const{data:{inkLists:i,rect:e,rotation:n,id:r,color:o,borderStyle:{rawWidth:h},popupRef:a},parent:{page:{pageNumber:c}}}=t;s=t={annotationType:S.HIGHLIGHT,color:Array.from(o),thickness:h,inkLists:i,boxes:null,pageIndex:c-1,rect:e.slice(0),rotation:n,id:r,deleted:!1,popupRef:a}}const{color:n,quadPoints:r,inkLists:o,opacity:h}=t,a=await super.deserialize(t,i,e);a.color=it.makeHexColor(...n),a.#oo=h||1,o&&(a.#dr=t.thickness),a.annotationElementId=t.id||null,a._initialData=s;const[c,l]=a.pageDimensions,[u,d]=a.pageTranslation;if(r){const t=a.#Jr=[];for(let i=0;i<r.length;i+=8)t.push({x:(r[i]-u)/c,y:1-(r[i+1]-d)/l,width:(r[i+2]-r[i])/c,height:(r[i+1]-r[i+5])/l});a.#do(),a.#uo(),a.rotate(a.rotation)}else if(o){a.#ro=!0;const t=o[0],e={x:t[0]-u,y:l-(t[1]-d)},s=new _s(e,[0,0,c,l],1,a.#dr/2,!0,.001);for(let i=0,n=t.length;i<n;i+=2)e.x=t[i]-u,e.y=l-(t[i+1]-d),s.add(e);const{id:n,clipPathId:r}=i.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:a.color,"fill-opacity":a._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:s.toSVGPath()}},!0,!0);a.#lo({highlightOutlines:s.getOutlines(),highlightId:n,clipPathId:r}),a.#uo(),a.rotate(a.parentRotation)}return a}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const i=this.getRect(0,0),e=Ut._colorManager.convert(this.color),s={annotationType:S.HIGHLIGHT,color:e,opacity:this.#oo,thickness:this.#dr,quadPoints:this.#bo(),outlines:this.#yo(i),pageIndex:this.pageIndex,rect:i,rotation:this.#wo(),structTreeParentId:this._structTreeParentId};return this.annotationElementId&&!this.#tr(s)?null:(s.id=this.annotationElementId,s)}#tr(t){const{color:i}=this._initialData;return t.color.some(((t,e)=>t!==i[e]))}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}}class Rs{#ko=Object.create(null);updateProperty(t,i){this[t]=i,this.updateSVGProperty(t,i)}updateProperties(t){if(t)for(const[i,e]of Object.entries(t))i.startsWith("_")||this.updateProperty(i,e)}updateSVGProperty(t,i){this.#ko[t]=i}toSVGProperties(){const t=this.#ko;return this.#ko=Object.create(null),{root:t}}reset(){this.#ko=Object.create(null)}updateAll(t=this){this.updateProperties(t)}clone(){B("Not implemented")}}class Ns extends Ut{#Eo=null;#So;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#_o=null;static#To=null;static#Co=null;static#Po=NaN;static#Ro=null;static#No=null;static#Do=NaN;static _INNER_MARGIN=3;constructor(t){super(t),this.#So=t.mustBeCommitted||!1,this._addOutlines(t)}_addOutlines(t){t.drawOutlines&&(this.#Io(t),this.#uo())}#Io({drawOutlines:t,drawId:i,drawingOptions:e}){this.#Eo=t,this._drawingOptions||=e,i>=0?(this._drawId=i,this.parent.drawLayer.finalizeDraw(i,t.defaultProperties)):this._drawId=this.#Fo(t,this.parent),this.#Oo(t.box)}#Fo(t,i){const{id:e}=i.drawLayer.draw(Ns._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return e}static _mergeSVGProperties(t,i){const e=new Set(Object.keys(t));for(const[s,n]of Object.entries(i))e.has(s)?Object.assign(t[s],n):t[s]=n;return t}static getDefaultDrawingOptions(t){B("Not implemented")}static get typesMap(){B("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,i){const e=this.typesMap.get(t);e&&this._defaultDrawingOptions.updateProperty(e,i),this._currentParent&&(Ns.#_o.updateProperty(e,i),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,i){const e=this.constructor.typesMap.get(t);e&&this._updateProperty(t,e,i)}static get defaultPropertiesToUpdate(){const t=[],i=this._defaultDrawingOptions;for(const[e,s]of this.typesMap)t.push([e,i[s]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:i}=this;for(const[e,s]of this.constructor.typesMap)t.push([e,i[s]]);return t}_updateProperty(t,i,e){const s=this._drawingOptions,n=s[i],r=t=>{s.updateProperty(i,t);const e=this.#Eo.updateProperty(i,t);e&&this.#Oo(e),this.parent?.drawLayer.updateProperties(this._drawId,s.toSVGProperties())};this.addCommands({cmd:r.bind(this,e),undo:r.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,Ns._mergeSVGProperties(this.#Eo.getPathResizingSVGProperties(this.#$o()),{bbox:this.#Lo()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,Ns._mergeSVGProperties(this.#Eo.getPathResizedSVGProperties(this.#$o()),{bbox:this.#Lo()}))}_onTranslating(t,i){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#Lo()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,Ns._mergeSVGProperties(this.#Eo.getPathTranslatedSVGProperties(this.#$o(),this.parentDimensions),{bbox:this.#Lo()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#So&&(this.#So=!1,this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){this.#mo(),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#uo(),this.#Oo(this.#Eo.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let i=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),this.#mo()):t&&(this._uiManager.addShouldRescale(this),this.#uo(t),i=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),i&&this.select()}#mo(){null!==this._drawId&&this.parent&&(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#uo(t=this.parent){null!==this._drawId&&this.parent===t||(null===this._drawId?(this._drawingOptions.updateAll(),this._drawId=this.#Fo(this.#Eo,t)):this.parent.drawLayer.updateParent(this._drawId,t.drawLayer))}#Bo([t,i,e,s]){const{parentDimensions:[n,r],rotation:o}=this;switch(o){case 90:return[i,1-t,e*(r/n),s*(n/r)];case 180:return[1-t,1-i,e,s];case 270:return[1-i,t,e*(r/n),s*(n/r)];default:return[t,i,e,s]}}#$o(){const{x:t,y:i,width:e,height:s,parentDimensions:[n,r],rotation:o}=this;switch(o){case 90:return[1-i,t,e*(n/r),s*(r/n)];case 180:return[1-t,1-i,e,s];case 270:return[i,1-t,e*(n/r),s*(r/n)];default:return[t,i,e,s]}}#Oo(t){if([this.x,this.y,this.width,this.height]=this.#Bo(t),this.div){this.fixAndSetPosition();const[t,i]=this.parentDimensions;this.setDims(this.width*t,this.height*i)}this._onResized()}#Lo(){const{x:t,y:i,width:e,height:s,rotation:n,parentRotation:r,parentDimensions:[o,h]}=this;switch((4*n+r)/90){case 1:return[1-i-s,t,s,e];case 2:return[1-t-e,1-i-s,e,s];case 3:return[i,1-t-e,s,e];case 4:return[t,i-e*(o/h),s*(h/o),e*(o/h)];case 5:return[1-i,t,e*(o/h),s*(h/o)];case 6:return[1-t-s*(h/o),1-i,s*(h/o),e*(o/h)];case 7:return[i-e*(o/h),1-t-s*(h/o),e*(o/h),s*(h/o)];case 8:return[t-e,i-s,e,s];case 9:return[1-i,t-e,s,e];case 10:return[1-t,1-i,e,s];case 11:return[i-s,1-t,s,e];case 12:return[t-s*(h/o),i,s*(h/o),e*(o/h)];case 13:return[1-i-e*(o/h),t-s*(h/o),e*(o/h),s*(h/o)];case 14:return[1-t,1-i-e*(o/h),s*(h/o),e*(o/h)];case 15:return[i,1-t,e*(o/h),s*(h/o)];default:return[t,i,e,s]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,Ns._mergeSVGProperties({bbox:this.#Lo()},this.#Eo.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#Oo(this.#Eo.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,i;this._isCopy&&(t=this.x,i=this.y);const e=super.render();e.classList.add("draw");const s=document.createElement("div");e.append(s),s.setAttribute("aria-hidden","true"),s.className="internal";const[n,r]=this.parentDimensions;return this.setDims(this.width*n,this.height*r),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,i),e}static createDrawerInstance(t,i,e,s,n){B("Not implemented")}static startDrawing(t,i,e,s){const{target:n,offsetX:r,offsetY:o,pointerId:h,pointerType:a}=s;if(Ns.#Ro&&Ns.#Ro!==a)return;const{viewport:{rotation:c}}=t,{width:l,height:u}=n.getBoundingClientRect(),d=Ns.#To=new AbortController,f=t.combinedSignal(d);Ns.#Po||=h,Ns.#Ro??=a,window.addEventListener("pointerup",(t=>{Ns.#Po===t.pointerId?this._endDraw(t):Ns.#No?.delete(t.pointerId)}),{signal:f}),window.addEventListener("pointercancel",(t=>{Ns.#Po===t.pointerId?this._currentParent.endDrawingSession():Ns.#No?.delete(t.pointerId)}),{signal:f}),window.addEventListener("pointerdown",(t=>{Ns.#Ro===t.pointerType&&((Ns.#No||=new Set).add(t.pointerId),Ns.#_o.isCancellable()&&(Ns.#_o.removeLastElement(),Ns.#_o.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))}),{capture:!0,passive:!1,signal:f}),window.addEventListener("contextmenu",bt,{signal:f}),n.addEventListener("pointermove",this._drawMove.bind(this),{signal:f}),n.addEventListener("touchmove",(t=>{t.timeStamp===Ns.#Do&&yt(t)}),{signal:f}),t.toggleDrawing(),i._editorUndoBar?.hide(),Ns.#_o?t.drawLayer.updateProperties(this._currentDrawId,Ns.#_o.startNew(r,o,l,u,c)):(i.updateUIForDefaultProperties(this),Ns.#_o=this.createDrawerInstance(r,o,l,u,c),Ns.#Co=this.getDefaultDrawingOptions(),this._currentParent=t,({id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(Ns.#Co.toSVGProperties(),Ns.#_o.defaultSVGProperties),!0,!1)))}static _drawMove(t){if(Ns.#Do=-1,!Ns.#_o)return;const{offsetX:i,offsetY:e,pointerId:s}=t;Ns.#Po===s&&(Ns.#No?.size>=1?this._endDraw(t):(this._currentParent.drawLayer.updateProperties(this._currentDrawId,Ns.#_o.add(i,e)),Ns.#Do=t.timeStamp,yt(t)))}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,Ns.#_o=null,Ns.#Co=null,Ns.#Ro=null,Ns.#Do=NaN),Ns.#To&&(Ns.#To.abort(),Ns.#To=null,Ns.#Po=NaN,Ns.#No=null)}static _endDraw(t){const i=this._currentParent;if(i)if(i.toggleDrawing(!0),this._cleanup(!1),t?.target===i.div&&i.drawLayer.updateProperties(this._currentDrawId,Ns.#_o.end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const t=Ns.#_o,e=this._currentDrawId,s=t.getLastElement();i.addCommands({cmd:()=>{i.drawLayer.updateProperties(e,t.setLastElement(s))},undo:()=>{i.drawLayer.updateProperties(e,t.removeLastElement())},mustExec:!1,type:_.DRAW_STEP})}else this.endDrawing(!1)}static endDrawing(t){const i=this._currentParent;if(!i)return null;if(i.toggleDrawing(!0),i.cleanUndoStack(_.DRAW_STEP),!Ns.#_o.isEmpty()){const{pageDimensions:[e,s],scale:n}=i,r=i.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:Ns.#_o.getOutlines(e*n,s*n,n,this._INNER_MARGIN),drawingOptions:Ns.#Co,mustBeCommitted:!t});return this._cleanup(!0),r}return i.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,i,e,s,n,r){B("Not implemented")}static async deserialize(t,i,e){const{rawDims:{pageWidth:s,pageHeight:n,pageX:r,pageY:o}}=i.viewport,h=this.deserializeDraw(r,o,s,n,this._INNER_MARGIN,t),a=await super.deserialize(t,i,e);return a.createDrawingOptions(t),a.#Io({drawOutlines:h}),a.#uo(),a.onScaleChanging(),a.rotate(),a}serializeDraw(t){const[i,e]=this.pageTranslation,[s,n]=this.pageDimensions;return this.#Eo.serialize([i,e,s,n],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}}class Ds{#or=new Float64Array(6);#Tn;#jo;#rs;#dr;#fr;#Uo="";#zo=0;#Fr=new Is;#Ho;#Go;constructor(t,i,e,s,n,r){this.#Ho=e,this.#Go=s,this.#rs=n,this.#dr=r,[t,i]=this.#Wo(t,i);const o=this.#Tn=[NaN,NaN,NaN,NaN,t,i];this.#fr=[t,i],this.#jo=[{line:o,points:this.#fr}],this.#or.set(o,0)}updateProperty(t,i){"stroke-width"===t&&(this.#dr=i)}#Wo(t,i){return xs._normalizePoint(t,i,this.#Ho,this.#Go,this.#rs)}isEmpty(){return!this.#jo||0===this.#jo.length}isCancellable(){return this.#fr.length<=10}add(t,i){[t,i]=this.#Wo(t,i);const[e,s,n,r]=this.#or.subarray(2,6);return Math.hypot(this.#Ho*(t-n),this.#Go*(i-r))<=2?null:(this.#fr.push(t,i),isNaN(e)?(this.#or.set([n,r,t,i],2),this.#Tn.push(NaN,NaN,NaN,NaN,t,i),{path:{d:this.toSVGPath()}}):(isNaN(this.#or[0])&&this.#Tn.splice(6,6),this.#or.set([e,s,n,r,t,i],0),this.#Tn.push(...xs.createBezierPoints(e,s,n,r,t,i)),{path:{d:this.toSVGPath()}}))}end(t,i){return this.add(t,i)||(2===this.#fr.length?{path:{d:this.toSVGPath()}}:null)}startNew(t,i,e,s,n){this.#Ho=e,this.#Go=s,this.#rs=n,[t,i]=this.#Wo(t,i);const r=this.#Tn=[NaN,NaN,NaN,NaN,t,i];this.#fr=[t,i];const o=this.#jo.at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),this.#jo.push({line:r,points:this.#fr}),this.#or.set(r,0),this.#zo=0,this.toSVGPath(),null}getLastElement(){return this.#jo.at(-1)}setLastElement(t){return this.#jo?(this.#jo.push(t),this.#Tn=t.line,this.#fr=t.points,this.#zo=0,{path:{d:this.toSVGPath()}}):this.#Fr.setLastElement(t)}removeLastElement(){if(!this.#jo)return this.#Fr.removeLastElement();this.#jo.pop(),this.#Uo="";for(let t=0,i=this.#jo.length;t<i;t++){const{line:i,points:e}=this.#jo[t];this.#Tn=i,this.#fr=e,this.#zo=0,this.toSVGPath()}return{path:{d:this.#Uo}}}toSVGPath(){const t=xs.svgRound(this.#Tn[4]),i=xs.svgRound(this.#Tn[5]);if(2===this.#fr.length)return this.#Uo=`${this.#Uo} M ${t} ${i} Z`,this.#Uo;if(this.#fr.length<=6){const e=this.#Uo.lastIndexOf("M");this.#Uo=`${this.#Uo.slice(0,e)} M ${t} ${i}`,this.#zo=6}if(4===this.#fr.length){const t=xs.svgRound(this.#Tn[10]),i=xs.svgRound(this.#Tn[11]);return this.#Uo=`${this.#Uo} L ${t} ${i}`,this.#zo=12,this.#Uo}const e=[];0===this.#zo&&(e.push(`M ${t} ${i}`),this.#zo=6);for(let t=this.#zo,i=this.#Tn.length;t<i;t+=6){const[i,s,n,r,o,h]=this.#Tn.slice(t,t+6).map(xs.svgRound);e.push(`C${i} ${s} ${n} ${r} ${o} ${h}`)}return this.#Uo+=e.join(" "),this.#zo=this.#Tn.length,this.#Uo}getOutlines(t,i,e,s){const n=this.#jo.at(-1);return n.line=new Float32Array(n.line),n.points=new Float32Array(n.points),this.#Fr.build(this.#jo,t,i,e,this.#rs,this.#dr,s),this.#or=null,this.#Tn=null,this.#jo=null,this.#Uo=null,this.#Fr}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}class Is extends xs{#kr;#Vo=0;#sr;#jo;#Ho;#Go;#Xo;#rs;#dr;build(t,i,e,s,n,r,o){this.#Ho=i,this.#Go=e,this.#Xo=s,this.#rs=n,this.#dr=r,this.#sr=o??0,this.#jo=t,this.#Yo()}get thickness(){return this.#dr}setLastElement(t){return this.#jo.push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#jo.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const t=[];for(const{line:i}of this.#jo)if(t.push(`M${xs.svgRound(i[4])} ${xs.svgRound(i[5])}`),6!==i.length)if(12===i.length&&isNaN(i[6]))t.push(`L${xs.svgRound(i[10])} ${xs.svgRound(i[11])}`);else for(let e=6,s=i.length;e<s;e+=6){const[s,n,r,o,h,a]=i.subarray(e,e+6).map(xs.svgRound);t.push(`C${s} ${n} ${r} ${o} ${h} ${a}`)}else t.push("Z");return t.join("")}serialize([t,i,e,s],n){const r=[],o=[],[h,a,c,l]=this.#Qo();let u,d,f,p,g,w,m,A,v;switch(this.#rs){case 0:v=xs._rescale,u=t,d=i+s,f=e,p=-s,g=t+h*e,w=i+(1-a-l)*s,m=t+(h+c)*e,A=i+(1-a)*s;break;case 90:v=xs._rescaleAndSwap,u=t,d=i,f=e,p=s,g=t+a*e,w=i+h*s,m=t+(a+l)*e,A=i+(h+c)*s;break;case 180:v=xs._rescale,u=t+e,d=i,f=-e,p=s,g=t+(1-h-c)*e,w=i+a*s,m=t+(1-h)*e,A=i+(a+l)*s;break;case 270:v=xs._rescaleAndSwap,u=t+e,d=i+s,f=-e,p=-s,g=t+(1-a-l)*e,w=i+(1-h-c)*s,m=t+(1-a)*e,A=i+(1-h)*s}for(const{line:t,points:i}of this.#jo)r.push(v(t,u,d,f,p,n?new Array(t.length):null)),o.push(v(i,u,d,f,p,n?new Array(i.length):null));return{lines:r,points:o,rect:[g,w,m,A]}}static deserialize(t,i,e,s,n,{paths:{lines:r,points:o},rotation:h,thickness:a}){const c=[];let l,u,d,f,p;switch(h){case 0:p=xs._rescale,l=-t/e,u=i/s+1,d=1/e,f=-1/s;break;case 90:p=xs._rescaleAndSwap,l=-i/s,u=-t/e,d=1/s,f=1/e;break;case 180:p=xs._rescale,l=t/e+1,u=-i/s,d=-1/e,f=1/s;break;case 270:p=xs._rescaleAndSwap,l=i/s+1,u=t/e+1,d=-1/s,f=-1/e}if(!r){r=[];for(const t of o){const i=t.length;if(2===i){r.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1]]));continue}if(4===i){r.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1],NaN,NaN,NaN,NaN,t[2],t[3]]));continue}const e=new Float32Array(3*(i-2));r.push(e);let[s,n,o,h]=t.subarray(0,4);e.set([NaN,NaN,NaN,NaN,s,n],0);for(let r=4;r<i;r+=2){const i=t[r],a=t[r+1];e.set(xs.createBezierPoints(s,n,o,h,i,a),3*(r-2)),[s,n,o,h]=[o,h,i,a]}}}for(let t=0,i=r.length;t<i;t++)c.push({line:p(r[t].map((t=>t??NaN)),l,u,d,f),points:p(o[t].map((t=>t??NaN)),l,u,d,f)});const g=new this.prototype.constructor;return g.build(c,e,s,1,h,a,n),g}#qo(t=this.#dr){const i=this.#sr+t/2*this.#Xo;return this.#rs%180==0?[i/this.#Ho,i/this.#Go]:[i/this.#Go,i/this.#Ho]}#Qo(){const[t,i,e,s]=this.#kr,[n,r]=this.#qo(0);return[t+n,i+r,e-2*n,s-2*r]}#Yo(){const t=this.#kr=new Float32Array([1/0,1/0,-1/0,-1/0]);for(const{line:i}of this.#jo){if(i.length<=12){for(let e=4,s=i.length;e<s;e+=6)it.pointBoundingBox(i[e],i[e+1],t);continue}let e=i[4],s=i[5];for(let n=6,r=i.length;n<r;n+=6){const[r,o,h,a,c,l]=i.subarray(n,n+6);it.bezierBoundingBox(e,s,r,o,h,a,c,l,t),e=c,s=l}}const[i,e]=this.#qo();t[0]=ht(t[0]-i,0,1),t[1]=ht(t[1]-e,0,1),t[2]=ht(t[2]+i,0,1),t[3]=ht(t[3]+e,0,1),t[2]-=t[0],t[3]-=t[1]}get box(){return this.#kr}updateProperty(t,i){return"stroke-width"===t?this.#po(i):null}#po(t){const[i,e]=this.#qo();this.#dr=t;const[s,n]=this.#qo(),[r,o]=[s-i,n-e],h=this.#kr;return h[0]-=r,h[1]-=o,h[2]+=2*r,h[3]+=2*o,h}updateParentDimensions([t,i],e){const[s,n]=this.#qo();this.#Ho=t,this.#Go=i,this.#Xo=e;const[r,o]=this.#qo(),h=r-s,a=o-n,c=this.#kr;return c[0]-=h,c[1]-=a,c[2]+=2*h,c[3]+=2*a,c}updateRotation(t){return this.#Vo=t,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#kr.map(xs.svgRound).join(" ")}get defaultProperties(){const[t,i]=this.#kr;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${xs.svgRound(t)} ${xs.svgRound(i)}`}}}get rotationTransform(){const[,,t,i]=this.#kr;let e=0,s=0,n=0,r=0,o=0,h=0;switch(this.#Vo){case 90:s=i/t,n=-t/i,o=t;break;case 180:e=-1,r=-1,o=t,h=i;break;case 270:s=-i/t,n=t/i,h=i;break;default:return""}return`matrix(${e} ${s} ${n} ${r} ${xs.svgRound(o)} ${xs.svgRound(h)})`}getPathResizingSVGProperties([t,i,e,s]){const[n,r]=this.#qo(),[o,h,a,c]=this.#kr;if(Math.abs(a-n)<=xs.PRECISION||Math.abs(c-r)<=xs.PRECISION){const n=t+e/2-(o+a/2),r=i+s/2-(h+c/2);return{path:{"transform-origin":`${xs.svgRound(t)} ${xs.svgRound(i)}`,transform:`${this.rotationTransform} translate(${n} ${r})`}}}const l=(e-2*n)/(a-2*n),u=(s-2*r)/(c-2*r),d=a/e,f=c/s;return{path:{"transform-origin":`${xs.svgRound(o)} ${xs.svgRound(h)}`,transform:`${this.rotationTransform} scale(${d} ${f}) translate(${xs.svgRound(n)} ${xs.svgRound(r)}) scale(${l} ${u}) translate(${xs.svgRound(-n)} ${xs.svgRound(-r)})`}}}getPathResizedSVGProperties([t,i,e,s]){const[n,r]=this.#qo(),o=this.#kr,[h,a,c,l]=o;if(o[0]=t,o[1]=i,o[2]=e,o[3]=s,Math.abs(c-n)<=xs.PRECISION||Math.abs(l-r)<=xs.PRECISION){const n=t+e/2-(h+c/2),r=i+s/2-(a+l/2);for(const{line:t,points:i}of this.#jo)xs._translate(t,n,r,t),xs._translate(i,n,r,i);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${xs.svgRound(t)} ${xs.svgRound(i)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const u=(e-2*n)/(c-2*n),d=(s-2*r)/(l-2*r),f=-u*(h+n)+t+n,p=-d*(a+r)+i+r;if(1!==u||1!==d||0!==f||0!==p)for(const{line:t,points:i}of this.#jo)xs._rescale(t,f,p,u,d,t),xs._rescale(i,f,p,u,d,i);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${xs.svgRound(t)} ${xs.svgRound(i)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([t,i],e){const[s,n]=e,r=this.#kr,o=t-r[0],h=i-r[1];if(this.#Ho===s&&this.#Go===n)for(const{line:t,points:i}of this.#jo)xs._translate(t,o,h,t),xs._translate(i,o,h,i);else{const t=this.#Ho/s,i=this.#Go/n;this.#Ho=s,this.#Go=n;for(const{line:e,points:s}of this.#jo)xs._rescale(e,o,h,t,i,e),xs._rescale(s,o,h,t,i,s);r[2]*=t,r[3]*=i}return r[0]=t,r[1]=i,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${xs.svgRound(t)} ${xs.svgRound(i)}`}}}get defaultSVGProperties(){const t=this.#kr;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${xs.svgRound(t[0])} ${xs.svgRound(t[1])}`,transform:this.rotationTransform||null},bbox:t}}}class Fs extends Rs{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:Ut._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,i){"stroke-width"===t&&(i??=this["stroke-width"],i*=this._viewParameters.realScale),super.updateSVGProperty(t,i)}clone(){const t=new Fs(this._viewParameters);return t.updateAll(this),t}}class Os extends Ns{static _type="ink";static _editorType=S.INK;static _defaultDrawingOptions=null;constructor(t){super({...t,name:"inkEditor"}),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,i){Ut.initialize(t,i),this._defaultDrawingOptions=new Fs(i.viewParameters)}static getDefaultDrawingOptions(t){const i=this._defaultDrawingOptions.clone();return i.updateProperties(t),i}static get supportMultipleDrawings(){return!0}static get typesMap(){return H(this,"typesMap",new Map([[_.INK_THICKNESS,"stroke-width"],[_.INK_COLOR,"stroke"],[_.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,i,e,s,n){return new Ds(t,i,e,s,n,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,i,e,s,n,r){return Is.deserialize(t,i,e,s,n,r)}static async deserialize(t,i,e){let s=null;if(t instanceof ds){const{data:{inkLists:i,rect:e,rotation:n,id:r,color:o,opacity:h,borderStyle:{rawWidth:a},popupRef:c},parent:{page:{pageNumber:l}}}=t;s=t={annotationType:S.INK,color:Array.from(o),thickness:a,opacity:h,paths:{points:i},boxes:null,pageIndex:l-1,rect:e.slice(0),rotation:n,id:r,deleted:!1,popupRef:c}}const n=await super.deserialize(t,i,e);return n.annotationElementId=t.id||null,n._initialData=s,n}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:t,_drawingOptions:i,parent:e}=this;i.updateSVGProperty("stroke-width"),e.drawLayer.updateProperties(t,i.toSVGProperties())}static onScaleChangingWhenDrawing(){const t=this._currentParent;t&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),t.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:i,opacity:e}){this._drawingOptions=Os.getDefaultDrawingOptions({stroke:it.makeHexColor(...t),"stroke-width":i,"stroke-opacity":e})}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:i,points:e,rect:s}=this.serializeDraw(t),{_drawingOptions:{stroke:n,"stroke-opacity":r,"stroke-width":o}}=this,h={annotationType:S.INK,color:Ut._colorManager.convert(n),opacity:r,thickness:o,paths:{lines:i,points:e},pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?(h.isCopy=!0,h):this.annotationElementId&&!this.#tr(h)?null:(h.id=this.annotationElementId,h)}#tr(t){const{color:i,thickness:e,opacity:s,pageIndex:n}=this._initialData;return this._hasBeenMoved||this._hasBeenResized||t.color.some(((t,e)=>t!==i[e]))||t.thickness!==e||t.opacity!==s||t.pageIndex!==n}renderAnnotationElement(t){const{points:i,rect:e}=this.serializeDraw(!1);return t.updateEdited({rect:e,thickness:this._drawingOptions["stroke-width"],points:i}),null}}class $s extends Is{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}}class Ls{static#Ko={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#Jo(t,i,e,s){return s-=i,0==(e-=t)?s>0?0:4:1===e?s+6:2-s}static#Zo=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#th(t,i,e,s,n,r,o){const h=this.#Jo(e,s,n,r);for(let n=0;n<8;n++){const r=(-n+h-o+16)%8;if(0!==t[(e+this.#Zo[2*r])*i+(s+this.#Zo[2*r+1])])return r}return-1}static#ih(t,i,e,s,n,r,o){const h=this.#Jo(e,s,n,r);for(let n=0;n<8;n++){const r=(n+h+o+16)%8;if(0!==t[(e+this.#Zo[2*r])*i+(s+this.#Zo[2*r+1])])return r}return-1}static#eh(t,i,e,s){const n=t.length,r=new Int32Array(n);for(let i=0;i<n;i++)r[i]=t[i]<=s?1:0;for(let t=1;t<e-1;t++)r[t*i]=r[t*i+i-1]=0;for(let t=0;t<i;t++)r[t]=r[i*e-1-t]=0;let o,h=1;const a=[];for(let t=1;t<e-1;t++){o=1;for(let e=1;e<i-1;e++){const s=t*i+e,n=r[s];if(0===n)continue;let c=t,l=e;if(1===n&&0===r[s-1])h+=1,l-=1;else{if(!(n>=1&&0===r[s+1])){1!==n&&(o=Math.abs(n));continue}h+=1,l+=1,n>1&&(o=n)}const u=[e,t],d=l===e+1,f={isHole:d,points:u,id:h,parent:0};let p;a.push(f);for(const t of a)if(t.id===o){p=t;break}f.parent=p?p.isHole?d?p.parent:o:d?o:p.parent:d?o:0;const g=this.#th(r,i,t,e,c,l,0);if(-1===g){r[s]=-h,1!==r[s]&&(o=Math.abs(r[s]));continue}let w=this.#Zo[2*g],m=this.#Zo[2*g+1];const A=t+w,v=e+m;c=A,l=v;let b=t,y=e;for(;;){const n=this.#ih(r,i,b,y,c,l,1);w=this.#Zo[2*n],m=this.#Zo[2*n+1];const a=b+w,d=y+m;u.push(d,a);const f=b*i+y;if(0===r[f+1]?r[f]=-h:1===r[f]&&(r[f]=h),a===t&&d===e&&b===A&&y===v){1!==r[s]&&(o=Math.abs(r[s]));break}c=b,l=y,b=a,y=d}}}return a}static#sh(t,i,e,s){if(e-i<=4){for(let n=i;n<e-2;n+=2)s.push(t[n],t[n+1]);return}const n=t[i],r=t[i+1],o=t[e-4]-n,h=t[e-3]-r,a=Math.hypot(o,h),c=o/a,l=h/a,u=c*r-l*n,d=1/a,f=Math.atan(h/o),p=Math.cos(f),g=Math.sin(f),w=d*(Math.abs(p)+Math.abs(g)),m=d*(1-w+w**2),A=Math.max(Math.atan(Math.abs(g+p)*m),Math.atan(Math.abs(g-p)*m));let v=0,b=i;for(let s=i+2;s<e-2;s+=2){const i=Math.abs(u-c*t[s+1]+l*t[s]);i>v&&(b=s,v=i)}v>(a*A)**2?(this.#sh(t,i,b+2,s),this.#sh(t,b,e,s)):s.push(n,r)}static#nh(t){const i=[],e=t.length;return this.#sh(t,0,e,i),i.push(t[e-2],t[e-1]),i.length<=4?null:i}static#rh(t,i,e,s,n,r){const o=new Float32Array(r**2),h=-2*s**2,a=r>>1;for(let t=0;t<r;t++){const i=(t-a)**2;for(let e=0;e<r;e++)o[t*r+e]=Math.exp((i+(e-a)**2)/h)}const c=new Float32Array(256),l=-2*n**2;for(let t=0;t<256;t++)c[t]=Math.exp(t**2/l);const u=new Uint8Array(t.length),d=new Uint32Array(256);for(let s=0;s<e;s++)for(let n=0;n<i;n++){const h=s*i+n,l=t[h];let f=0,p=0;for(let h=0;h<r;h++){const u=s+h-a;if(!(u<0||u>=e))for(let e=0;e<r;e++){const s=n+e-a;if(s<0||s>=i)continue;const d=t[u*i+s],g=o[h*r+e]*c[Math.abs(d-l)];f+=d*g,p+=g}}d[u[h]=Math.round(f/p)]++}return[u,d]}static#oh(t){const i=new Uint32Array(256);for(const e of t)i[e]++;return i}static#hh(t){const i=t.length,e=new Uint8ClampedArray(i>>2);let s=-1/0,n=1/0;for(let i=0,r=e.length;i<r;i++){if(0===t[3+(i<<2)]){s=e[i]=255;continue}const r=e[i]=t[i<<2];r>s&&(s=r),r<n&&(n=r)}const r=255/(s-n);for(let t=0;t<i;t++)e[t]=(e[t]-n)*r;return e}static#ah(t){let i,e=-1/0,s=-1/0;const n=t.findIndex((t=>0!==t));let r=n,o=n;for(i=n;i<256;i++){const n=t[i];n>e&&(i-r>s&&(s=i-r,o=i-1),e=n,r=i)}for(i=o-1;i>=0&&!(t[i]>t[i+1]);i--);return i}static#ch(t){const i=t,{width:e,height:s}=t,{maxDim:n}=this.#Ko;let r=e,o=s;if(e>n||s>n){let h=e,a=s,c=Math.log2(Math.max(e,s)/n);const l=Math.floor(c);c=c===l?l-1:l;for(let e=0;e<c;e++){r=Math.ceil(h/2),o=Math.ceil(a/2);const e=new OffscreenCanvas(r,o);e.getContext("2d").drawImage(t,0,0,h,a,0,0,r,o),h=r,a=o,t!==i&&t.close(),t=e.transferToImageBitmap()}const u=Math.min(n/r,n/o);r=Math.round(r*u),o=Math.round(o*u)}const h=new OffscreenCanvas(r,o).getContext("2d",{willReadFrequently:!0});h.filter="grayscale(1)",h.drawImage(t,0,0,t.width,t.height,0,0,r,o);const a=h.getImageData(0,0,r,o).data;return[this.#hh(a),r,o]}static extractContoursFromText(t,{fontFamily:i,fontStyle:e,fontWeight:s},n,r,o,h){let a=new OffscreenCanvas(1,1),c=a.getContext("2d",{alpha:!1});const l=c.font=`${e} ${s} 200px ${i}`,{actualBoundingBoxLeft:u,actualBoundingBoxRight:d,actualBoundingBoxAscent:f,actualBoundingBoxDescent:p,fontBoundingBoxAscent:g,fontBoundingBoxDescent:w,width:m}=c.measureText(t),A=Math.ceil(1.5*Math.max(Math.abs(u)+Math.abs(d)||0,m)),v=Math.ceil(1.5*Math.max(Math.abs(f)+Math.abs(p)||200,Math.abs(g)+Math.abs(w)||200));a=new OffscreenCanvas(A,v),c=a.getContext("2d",{alpha:!0,willReadFrequently:!0}),c.font=l,c.filter="grayscale(1)",c.fillStyle="white",c.fillRect(0,0,A,v),c.fillStyle="black",c.fillText(t,.5*A/2,1.5*v/2);const b=this.#hh(c.getImageData(0,0,A,v).data),y=this.#oh(b),x=this.#ah(y),M=this.#eh(b,A,v,x);return this.processDrawnLines({lines:{curves:M,width:A,height:v},pageWidth:n,pageHeight:r,rotation:o,innerMargin:h,mustSmooth:!0,areContours:!0})}static process(t,i,e,s,n){const[r,o,h]=this.#ch(t),[a,c]=this.#rh(r,o,h,Math.hypot(o,h)*this.#Ko.sigmaSFactor,this.#Ko.sigmaR,this.#Ko.kernelSize),l=this.#ah(c),u=this.#eh(a,o,h,l);return this.processDrawnLines({lines:{curves:u,width:o,height:h},pageWidth:i,pageHeight:e,rotation:s,innerMargin:n,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:i,pageHeight:e,rotation:s,innerMargin:n,mustSmooth:r,areContours:o}){s%180!=0&&([i,e]=[e,i]);const{curves:h,width:a,height:c}=t,l=t.thickness??0,u=[],d=Math.min(i/a,e/c),f=d/i,p=d/e,g=[];for(const{points:t}of h){const i=r?this.#nh(t):t;if(!i)continue;g.push(i);const e=i.length,s=new Float32Array(e),n=new Float32Array(3*(2===e?2:e-2));if(u.push({line:n,points:s}),2===e){s[0]=i[0]*f,s[1]=i[1]*p,n.set([NaN,NaN,NaN,NaN,s[0],s[1]],0);continue}let[o,h,a,c]=i;o*=f,h*=p,a*=f,c*=p,s.set([o,h,a,c],0),n.set([NaN,NaN,NaN,NaN,o,h],0);for(let t=4;t<e;t+=2){const e=s[t]=i[t]*f,r=s[t+1]=i[t+1]*p;n.set(xs.createBezierPoints(o,h,a,c,e,r),3*(t-2)),[o,h,a,c]=[a,c,e,r]}}if(0===u.length)return null;const w=o?new $s:new Is;return w.build(u,i,e,1,s,o?0:l,n),{outline:w,newCurves:g,areContours:o,thickness:l,width:a,height:c}}static async compressSignature({outlines:t,areContours:i,thickness:e,width:s,height:n}){let r,o=1/0,h=-1/0,a=0;for(const i of t){a+=i.length;for(let t=2,e=i.length;t<e;t++){const e=i[t]-i[t-2];o=Math.min(o,e),h=Math.max(h,e)}}r=o>=-128&&h<=127?Int8Array:o>=-32768&&h<=32767?Int16Array:Int32Array;const c=t.length,l=8+3*c,u=new Uint32Array(l);let d=0;u[d++]=l*Uint32Array.BYTES_PER_ELEMENT+(a-2*c)*r.BYTES_PER_ELEMENT,u[d++]=0,u[d++]=s,u[d++]=n,u[d++]=i?0:1,u[d++]=Math.max(0,Math.floor(e??0)),u[d++]=c,u[d++]=r.BYTES_PER_ELEMENT;for(const i of t)u[d++]=i.length-2,u[d++]=i[0],u[d++]=i[1];const f=new CompressionStream("deflate-raw"),p=f.writable.getWriter();await p.ready,p.write(u);const g=r.prototype.constructor;for(const i of t){const t=new g(i.length-2);for(let e=2,s=i.length;e<s;e++)t[e-2]=i[e]-i[e-2];p.write(t)}p.close();const w=await new Response(f.readable).arrayBuffer();return at(new Uint8Array(w))}static async decompressSignature(t){try{const e=(i=t,Uint8Array.fromBase64?Uint8Array.fromBase64(i):J(atob(i))),{readable:s,writable:n}=new DecompressionStream("deflate-raw"),r=n.getWriter();await r.ready,r.write(e).then((async()=>{await r.ready,await r.close()})).catch((()=>{}));let o=null,h=0;for await(const t of s)o||=new Uint8Array(new Uint32Array(t.buffer,0,4)[0]),o.set(t,h),h+=t.length;const a=new Uint32Array(o.buffer,0,o.length>>2),c=a[1];if(0!==c)throw new Error(`Invalid version: ${c}`);const l=a[2],u=a[3],d=0===a[4],f=a[5],p=a[6],g=[],w=(8+3*p)*Uint32Array.BYTES_PER_ELEMENT;let m;switch(a[7]){case Int8Array.BYTES_PER_ELEMENT:m=new Int8Array(o.buffer,w);break;case Int16Array.BYTES_PER_ELEMENT:m=new Int16Array(o.buffer,w);break;case Int32Array.BYTES_PER_ELEMENT:m=new Int32Array(o.buffer,w)}h=0;for(let t=0;t<p;t++){const i=a[3*t+8],e=new Float32Array(i+2);g.push(e);for(let i=0;i<2;i++)e[i]=a[3*t+8+i+1];for(let t=0;t<i;t++)e[t+2]=e[t]+m[h++]}return{areContours:d,thickness:f,outlines:g,width:l,height:u}}catch(t){return L(`decompressSignature: ${t}`),null}var i}}class Bs extends Rs{constructor(){super(),super.updateProperties({fill:Ut._defaultLineColor,"stroke-width":0})}clone(){const t=new Bs;return t.updateAll(this),t}}class js extends Fs{constructor(t){super(t),super.updateProperties({stroke:Ut._defaultLineColor,"stroke-width":1})}clone(){const t=new js(this._viewParameters);return t.updateAll(this),t}}class Us extends Ns{#lh=!1;#uh=null;#dh=null;#fh=null;static _type="signature";static _editorType=S.SIGNATURE;static _defaultDrawingOptions=null;constructor(t){super({...t,mustBeCommitted:!0,name:"signatureEditor"}),this._willKeepAspectRatio=!0,this.#dh=t.signatureData||null,this.#uh=null,this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,i){Ut.initialize(t,i),this._defaultDrawingOptions=new Bs,this._defaultDrawnSignatureOptions=new js(i.viewParameters)}static getDefaultDrawingOptions(t){const i=this._defaultDrawingOptions.clone();return i.updateProperties(t),i}static get supportMultipleDrawings(){return!1}static get typesMap(){return H(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!this.#uh}}static computeTelemetryFinalData(t){const i=t.get("hasDescription");return{hasAltText:i.get(!0)??0,hasNoAltText:i.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){null!==this._drawId&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,i;const{_isCopy:e}=this;if(e&&(this._isCopy=!1,t=this.x,i=this.y),super.render(),null===this._drawId)if(this.#dh){const{lines:t,mustSmooth:i,areContours:e,description:s,uuid:n,heightInPage:r}=this.#dh,{rawDims:{pageWidth:o,pageHeight:h},rotation:a}=this.parent.viewport,c=Ls.processDrawnLines({lines:t,pageWidth:o,pageHeight:h,rotation:a,innerMargin:Us._INNER_MARGIN,mustSmooth:i,areContours:e});this.addSignature(c,r,s,n)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);return e&&(this._isCopy=!0,this._moveAfterPaste(t,i)),this.div}setUuid(t){this.#fh=t,this.addEditToolbar()}getUuid(){return this.#fh}get description(){return this.#uh}set description(t){this.#uh=t,super.addEditToolbar().then((i=>{i?.updateEditSignatureButton(t)}))}getSignaturePreview(){const{newCurves:t,areContours:i,thickness:e,width:s,height:n}=this.#dh,r=Math.max(s,n);return{areContours:i,outline:Ls.processDrawnLines({lines:{curves:t.map((t=>({points:t}))),thickness:e,width:s,height:n},pageWidth:r,pageHeight:r,rotation:0,innerMargin:0,mustSmooth:!1,areContours:i}).outline}}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.signatureManager&&null!==this.#uh&&(await t.addEditSignatureButton(this._uiManager.signatureManager,this.#fh,this.#uh),t.show()),t):null}addSignature(t,i,e,s){const{x:n,y:r}=this,{outline:o}=this.#dh=t;let h;this.#lh=o instanceof $s,this.#uh=e,this.div.setAttribute("data-l10n-args",JSON.stringify({description:e})),this.#lh?h=Us.getDefaultDrawingOptions():(h=Us._defaultDrawnSignatureOptions.clone(),h.updateProperties({"stroke-width":o.thickness})),this._addOutlines({drawOutlines:o,drawingOptions:h});const[a,c]=this.parentDimensions,[,l]=this.pageDimensions;let u=i/l;u=u>=1?.5:u,this.width*=u/this.height,this.width>=1&&(u*=.9/this.width,this.width=.9),this.height=u,this.setDims(a*this.width,c*this.height),this.x=n,this.y=r,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(s),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!s,hasDescription:!!e}}),this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:i,pageHeight:e},rotation:s}=this.parent.viewport;return Ls.process(t,i,e,s,Us._INNER_MARGIN)}getFromText(t,i){const{rawDims:{pageWidth:e,pageHeight:s},rotation:n}=this.parent.viewport;return Ls.extractContoursFromText(t,i,e,s,n,Us._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:i,pageHeight:e},rotation:s}=this.parent.viewport;return Ls.processDrawnLines({lines:t,pageWidth:i,pageHeight:e,rotation:s,innerMargin:Us._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:i}){t?this._drawingOptions=Us.getDefaultDrawingOptions():(this._drawingOptions=Us._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":i}))}serialize(t=!1){if(this.isEmpty())return null;const{lines:i,points:e,rect:s}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":n}}=this,r={annotationType:S.SIGNATURE,isSignature:!0,areContours:this.#lh,color:[0,0,0],thickness:this.#lh?0:n,pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?(r.paths={lines:i,points:e},r.uuid=this.#fh,r.isCopy=!0):r.lines=i,this.#uh&&(r.accessibilityData={type:"Figure",alt:this.#uh}),r}static deserializeDraw(t,i,e,s,n,r){return r.areContours?$s.deserialize(t,i,e,s,n,r):Is.deserialize(t,i,e,s,n,r)}static async deserialize(t,i,e){const s=await super.deserialize(t,i,e);return s.#lh=t.areContours,s.#uh=t.accessibilityData?.alt||"",s.#fh=t.uuid,s}}class zs extends Ut{#ph=null;#gh=null;#wh=null;#mh=null;#Ah=null;#vh="";#bh=null;#yh=!1;#xh=null;#Mh=!1;#kh=!1;static _type="stamp";static _editorType=S.STAMP;constructor(t){super({...t,name:"stampEditor"}),this.#mh=t.bitmapUrl,this.#Ah=t.bitmapFile,this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,i){Ut.initialize(t,i)}static isHandlingMimeForPasting(t){return Ct.includes(t)}static paste(t,i){i.pasteEditor({mode:S.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(t){const i=t.get("hasAltText");return{hasAltText:i.get(!0)??0,hasNoAltText:i.get(!1)??0}}#Eh(t,i=!1){t?(this.#ph=t.bitmap,i||(this.#gh=t.id,this.#Mh=t.isSvg),t.file&&(this.#vh=t.file.name),this.#Sh()):this.remove()}#_h(){if(this.#wh=null,this._uiManager.enableWaiting(!1),this.#bh){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#ph)return this._editToolbar.hide(),void this._uiManager.editAltText(this,!0);if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#ph){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(t=null,i=!0){if(this.hasAltTextData())return null;const{mlManager:e}=this._uiManager;if(!e)throw new Error("No ML.");if(!await e.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:s,width:n,height:r}=t||this.copyCanvas(null,null,!0).imageData,o=await e.guess({name:"altText",request:{data:s,width:n,height:r,channels:s.length/(n*r)}});if(!o)throw new Error("No response from the AI service.");if(o.error)throw new Error("Error from the AI service.");if(o.cancel)return null;if(!o.output)throw new Error("No valid response from the AI service.");const h=o.output;return await this.setGuessedAltText(h),i&&!this.hasAltTextData()&&(this.altTextData={alt:h,decorative:!1}),h}#Th(){if(this.#gh)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#gh).then((t=>this.#Eh(t,!0))).finally((()=>this.#_h()));if(this.#mh){const t=this.#mh;return this.#mh=null,this._uiManager.enableWaiting(!0),void(this.#wh=this._uiManager.imageManager.getFromUrl(t).then((t=>this.#Eh(t))).finally((()=>this.#_h())))}if(this.#Ah){const t=this.#Ah;return this.#Ah=null,this._uiManager.enableWaiting(!0),void(this.#wh=this._uiManager.imageManager.getFromFile(t).then((t=>this.#Eh(t))).finally((()=>this.#_h())))}const t=document.createElement("input");t.type="file",t.accept=Ct.join(",");const i=this._uiManager._signal;this.#wh=new Promise((e=>{t.addEventListener("change",(async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const i=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#Eh(i)}else this.remove();e()}),{signal:i}),t.addEventListener("cancel",(()=>{this.remove(),e()}),{signal:i})})).finally((()=>this.#_h())),t.click()}remove(){this.#gh&&(this.#ph=null,this._uiManager.imageManager.deleteId(this.#gh),this.#bh?.remove(),this.#bh=null,this.#xh&&(clearTimeout(this.#xh),this.#xh=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#gh&&null===this.#bh&&this.#Th(),this.isAttachedToDOM||this.parent.add(this))):this.#gh&&this.#Th()}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(this.#wh||this.#ph||this.#mh||this.#Ah||this.#gh||this.#yh)}get isResizable(){return!0}render(){if(this.div)return this.div;let t,i;return this._isCopy&&(t=this.x,i=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),this.#yh||(this.#ph?this.#Sh():this.#Th()),this._isCopy&&this._moveAfterPaste(t,i),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,i){const{id:e,bitmap:s}=this._uiManager.imageManager.getFromCanvas(t,i);i.remove(),e&&this._uiManager.imageManager.isValidId(e)&&(this.#gh=e,s&&(this.#ph=s),this.#yh=!1,this.#Sh())}_onResized(){this.onScaleChanging()}onScaleChanging(){this.parent&&(null!==this.#xh&&clearTimeout(this.#xh),this.#xh=setTimeout((()=>{this.#xh=null,this.#Ch()}),200))}#Sh(){const{div:t}=this;let{width:i,height:e}=this.#ph;const[s,n]=this.pageDimensions,r=.75;if(this.width)i=this.width*s,e=this.height*n;else if(i>r*s||e>r*n){const t=Math.min(r*s/i,r*n/e);i*=t,e*=t}const[o,h]=this.parentDimensions;this.setDims(i*o/s,e*h/n),this._uiManager.enableWaiting(!1);const a=this.#bh=document.createElement("canvas");a.setAttribute("role","img"),this.addContainer(a),this.width=i/s,this.height=e/n,this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(t.hidden=!1),this.#Ch(),this.#kh||(this.parent.addUndoableEditor(this),this.#kh=!0),this._reportTelemetry({action:"inserted_image"}),this.#vh&&this.div.setAttribute("aria-description",this.#vh)}copyCanvas(t,i,e=!1){t||(t=224);const{width:s,height:n}=this.#ph,r=new Tt;let o=this.#ph,h=s,a=n,c=null;if(i){if(s>i||n>i){const t=Math.min(i/s,i/n);h=Math.floor(s*t),a=Math.floor(n*t)}c=document.createElement("canvas");const t=c.width=Math.ceil(h*r.sx),e=c.height=Math.ceil(a*r.sy);this.#Mh||(o=this.#Ph(t,e));const l=c.getContext("2d");l.filter=this._uiManager.hcmFilter;let u="white",d="#cfcfd8";"none"!==this._uiManager.hcmFilter?d="black":window.matchMedia?.("(prefers-color-scheme: dark)").matches&&(u="#8f8f9d",d="#42414d");const f=15,p=f*r.sx,g=f*r.sy,w=new OffscreenCanvas(2*p,2*g),m=w.getContext("2d");m.fillStyle=u,m.fillRect(0,0,2*p,2*g),m.fillStyle=d,m.fillRect(0,0,p,g),m.fillRect(p,g,p,g),l.fillStyle=l.createPattern(w,"repeat"),l.fillRect(0,0,t,e),l.drawImage(o,0,0,o.width,o.height,0,0,t,e)}let l=null;if(e){let i,e;if(r.symmetric&&o.width<t&&o.height<t)i=o.width,e=o.height;else if(o=this.#ph,s>t||n>t){const r=Math.min(t/s,t/n);i=Math.floor(s*r),e=Math.floor(n*r),this.#Mh||(o=this.#Ph(i,e))}const h=new OffscreenCanvas(i,e).getContext("2d",{willReadFrequently:!0});h.drawImage(o,0,0,o.width,o.height,0,0,i,e),l={width:i,height:e,data:h.getImageData(0,0,i,e).data}}return{canvas:c,width:h,height:a,imageData:l}}#Ph(t,i){const{width:e,height:s}=this.#ph;let n=e,r=s,o=this.#ph;for(;n>2*t||r>2*i;){const e=n,s=r;n>2*t&&(n=n>=16384?Math.floor(n/2)-1:Math.ceil(n/2)),r>2*i&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2));const h=new OffscreenCanvas(n,r);h.getContext("2d").drawImage(o,0,0,e,s,0,0,n,r),o=h.transferToImageBitmap()}return o}#Ch(){const[t,i]=this.parentDimensions,{width:e,height:s}=this,n=new Tt,r=Math.ceil(e*t*n.sx),o=Math.ceil(s*i*n.sy),h=this.#bh;if(!h||h.width===r&&h.height===o)return;h.width=r,h.height=o;const a=this.#Mh?this.#ph:this.#Ph(r,o),c=h.getContext("2d");c.filter=this._uiManager.hcmFilter,c.drawImage(a,0,0,a.width,a.height,0,0,r,o)}#Rh(t){if(t){if(this.#Mh){const t=this._uiManager.imageManager.getSvgUrl(this.#gh);if(t)return t}const t=document.createElement("canvas");return({width:t.width,height:t.height}=this.#ph),t.getContext("2d").drawImage(this.#ph,0,0),t.toDataURL()}if(this.#Mh){const[t,i]=this.pageDimensions,e=Math.round(this.width*t*lt.PDF_TO_CSS_UNITS),s=Math.round(this.height*i*lt.PDF_TO_CSS_UNITS),n=new OffscreenCanvas(e,s);return n.getContext("2d").drawImage(this.#ph,0,0,this.#ph.width,this.#ph.height,0,0,e,s),n.transferToImageBitmap()}return structuredClone(this.#ph)}static async deserialize(t,i,e){let s=null,n=!1;if(t instanceof ms){const{data:{rect:r,rotation:o,id:h,structParent:a,popupRef:c},container:l,parent:{page:{pageNumber:u}},canvas:d}=t;let f,p;d?(delete t.canvas,({id:f,bitmap:p}=e.imageManager.getFromCanvas(l.id,d)),d.remove()):(n=!0,t._hasNoCanvas=!0);const g=(await i._structTree.getAriaAttributes(`${ot}${h}`))?.get("aria-label")||"";s=t={annotationType:S.STAMP,bitmapId:f,bitmap:p,pageIndex:u-1,rect:r.slice(0),rotation:o,id:h,deleted:!1,accessibilityData:{decorative:!1,altText:g},isSvg:!1,structParent:a,popupRef:c}}const r=await super.deserialize(t,i,e),{rect:o,bitmap:h,bitmapUrl:a,bitmapId:c,isSvg:l,accessibilityData:u}=t;n?(e.addMissingCanvas(t.id,r),r.#yh=!0):c&&e.imageManager.isValidId(c)?(r.#gh=c,h&&(r.#ph=h)):r.#mh=a,r.#Mh=l;const[d,f]=r.pageDimensions;return r.width=(o[2]-o[0])/d,r.height=(o[3]-o[1])/f,r.annotationElementId=t.id||null,u&&(r.altTextData=u),r._initialData=s,r.#kh=!!s,r}serialize(t=!1,i=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const e={annotationType:S.STAMP,bitmapId:this.#gh,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#Mh,structTreeParentId:this._structTreeParentId};if(t)return e.bitmapUrl=this.#Rh(!0),e.accessibilityData=this.serializeAltText(!0),e.isCopy=!0,e;const{decorative:s,altText:n}=this.serializeAltText(!1);if(!s&&n&&(e.accessibilityData={type:"Figure",alt:n}),this.annotationElementId){const t=this.#tr(e);if(t.isSame)return null;t.isSameAltText?delete e.accessibilityData:e.accessibilityData.structParent=this._initialData.structParent??-1}if(e.id=this.annotationElementId,null===i)return e;i.stamps||=new Map;const r=this.#Mh?(e.rect[2]-e.rect[0])*(e.rect[3]-e.rect[1]):null;if(i.stamps.has(this.#gh)){if(this.#Mh){const t=i.stamps.get(this.#gh);r>t.area&&(t.area=r,t.serialized.bitmap.close(),t.serialized.bitmap=this.#Rh(!1))}}else i.stamps.set(this.#gh,{area:r,serialized:e}),e.bitmap=this.#Rh(!1);return e}#tr(t){const{pageIndex:i,accessibilityData:{altText:e}}=this._initialData,s=t.pageIndex===i,n=(t.accessibilityData?.alt||"")===e;return{isSame:!this._hasBeenMoved&&!this._hasBeenResized&&s&&n,isSameAltText:n}}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}}class Hs{#$n;#Nh=!1;#Dh=null;#Ih=null;#Fh=null;#Oh=new Map;#$h=!1;#Lh=!1;#Bh=!1;#jh=null;#Uh=null;#zh=null;#Hh=null;#w;static _initialized=!1;static#z=new Map([ys,Os,zs,Ps,Us].map((t=>[t._editorType,t])));constructor({uiManager:t,pageIndex:i,div:e,structTreeLayer:s,accessibilityManager:n,annotationLayer:r,drawLayer:o,textLayer:h,viewport:a,l10n:c}){const l=[...Hs.#z.values()];if(!Hs._initialized){Hs._initialized=!0;for(const i of l)i.initialize(c,t)}t.registerEditorTypes(l),this.#w=t,this.pageIndex=i,this.div=e,this.#$n=n,this.#Dh=r,this.viewport=a,this.#zh=h,this.drawLayer=o,this._structTree=s,this.#w.addLayer(this)}get isEmpty(){return 0===this.#Oh.size}get isInvisible(){return this.isEmpty&&this.#w.getMode()===S.NONE}updateToolbar(t){this.#w.updateToolbar(t)}updateMode(t=this.#w.getMode()){switch(this.#Gh(),t){case S.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case S.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case S.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:i}=this.div;for(const e of Hs.#z.values())i.toggle(`${e._type}Editing`,t===e._editorType);this.div.hidden=!1}hasTextLayer(t){return t===this.#zh?.div}setEditingState(t){this.#w.setEditingState(t)}addCommands(t){this.#w.addCommands(t)}cleanUndoStack(t){this.#w.cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){this.#Dh?.div.classList.toggle("disabled",!t)}async enable(){this.#Bh=!0,this.div.tabIndex=0,this.togglePointerEvents(!0);const t=new Set;for(const i of this.#Oh.values())i.enableEditing(),i.show(!0),i.annotationElementId&&(this.#w.removeChangedExistingAnnotation(i),t.add(i.annotationElementId));if(!this.#Dh)return void(this.#Bh=!1);const i=this.#Dh.getEditableAnnotations();for(const e of i){if(e.hide(),this.#w.isDeletedAnnotationElement(e.data.id))continue;if(t.has(e.data.id))continue;const i=await this.deserialize(e);i&&(this.addOrRebuild(i),i.enableEditing())}this.#Bh=!1}disable(){this.#Lh=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1);const t=new Map,i=new Map;for(const e of this.#Oh.values())e.disableEditing(),e.annotationElementId&&(null===e.serialize()?(i.set(e.annotationElementId,e),this.getEditableAnnotation(e.annotationElementId)?.show(),e.remove()):t.set(e.annotationElementId,e));if(this.#Dh){const e=this.#Dh.getEditableAnnotations();for(const s of e){const{id:e}=s.data;if(this.#w.isDeletedAnnotationElement(e))continue;let n=i.get(e);n?(n.resetAnnotationElement(s),n.show(!1),s.show()):(n=t.get(e),n&&(this.#w.addChangedExistingAnnotation(n),n.renderAnnotationElement(s)&&n.show(!1)),s.show())}}this.#Gh(),this.isEmpty&&(this.div.hidden=!0);const{classList:e}=this.div;for(const t of Hs.#z.values())e.remove(`${t._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#Lh=!1}getEditableAnnotation(t){return this.#Dh?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#w.getActive()!==t&&this.#w.setActiveEditor(t)}enableTextSelection(){if(this.div.tabIndex=-1,this.#zh?.div&&!this.#Hh){this.#Hh=new AbortController;const t=this.#w.combinedSignal(this.#Hh);this.#zh.div.addEventListener("pointerdown",this.#Wh.bind(this),{signal:t}),this.#zh.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#zh?.div&&this.#Hh&&(this.#Hh.abort(),this.#Hh=null,this.#zh.div.classList.remove("highlighting"))}#Wh(t){this.#w.unselectAll();const{target:i}=t;if(i===this.#zh.div||("img"===i.getAttribute("role")||i.classList.contains("endOfContent"))&&this.#zh.div.contains(i)){const{isMac:i}=Z.platform;if(0!==t.button||t.ctrlKey&&i)return;this.#w.showAllEditors("highlight",!0,!0),this.#zh.div.classList.add("free"),this.toggleDrawing(),Ps.startHighlighting(this,"ltr"===this.#w.direction,{target:this.#zh.div,x:t.x,y:t.y}),this.#zh.div.addEventListener("pointerup",(()=>{this.#zh.div.classList.remove("free"),this.toggleDrawing(!0)}),{once:!0,signal:this.#w._signal}),t.preventDefault()}}enableClick(){if(this.#Ih)return;this.#Ih=new AbortController;const t=this.#w.combinedSignal(this.#Ih);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const i=this.pointerup.bind(this);this.div.addEventListener("pointerup",i,{signal:t}),this.div.addEventListener("pointercancel",i,{signal:t})}disableClick(){this.#Ih?.abort(),this.#Ih=null}attach(t){this.#Oh.set(t.id,t);const{annotationElementId:i}=t;i&&this.#w.isDeletedAnnotationElement(i)&&this.#w.removeDeletedAnnotationElement(t)}detach(t){this.#Oh.delete(t.id),this.#$n?.removePointerInTextLayer(t.contentDiv),!this.#Lh&&t.annotationElementId&&this.#w.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#w.removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(this.#w.addDeletedAnnotationElement(t.annotationElementId),Ut.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(t.parent!==this||!t.isAttachedToDOM){if(this.changeParent(t),this.#w.addEditor(t),this.attach(t),!t.isAttachedToDOM){const i=t.render();this.div.append(i),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!this.#Bh),this.#w.addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:i}=document;t.div.contains(i)&&!this.#Fh&&(t._focusEventsAllowed=!1,this.#Fh=setTimeout((()=>{this.#Fh=null,t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:this.#w._signal}),i.focus())}),0)),t._structTreeParentId=this.#$n?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||=this,t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return this.#w.getId()}get#Vh(){return Hs.#z.get(this.#w.getMode())}combinedSignal(t){return this.#w.combinedSignal(t)}#Xh(t){const i=this.#Vh;return i?new i.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#Vh?.canCreateNewEmptyEditor()}async pasteEditor(t,i){this.updateToolbar(t),await this.#w.updateMode(t.mode);const{offsetX:e,offsetY:s}=this.#Yh(),n=this.getNextId(),r=this.#Xh({parent:this,id:n,x:e,y:s,uiManager:this.#w,isCentered:!0,...i});r&&this.add(r)}async deserialize(t){return await(Hs.#z.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#w))||null}createAndAddNewEditor(t,i,e={}){const s=this.getNextId(),n=this.#Xh({parent:this,id:s,x:t.offsetX,y:t.offsetY,uiManager:this.#w,isCentered:i,...e});return n&&this.add(n),n}#Yh(){const{x:t,y:i,width:e,height:s}=this.div.getBoundingClientRect(),n=Math.max(0,t),r=Math.max(0,i),o=(n+Math.min(window.innerWidth,t+e))/2-t,h=(r+Math.min(window.innerHeight,i+s))/2-i,[a,c]=this.viewport.rotation%180==0?[o,h]:[h,o];return{offsetX:a,offsetY:c}}addNewEditor(t={}){this.createAndAddNewEditor(this.#Yh(),!0,t)}setSelected(t){this.#w.setSelected(t)}toggleSelected(t){this.#w.toggleSelected(t)}unselect(t){this.#w.unselect(t)}pointerup(t){const{isMac:i}=Z.platform;if(0!==t.button||t.ctrlKey&&i)return;if(t.target!==this.div)return;if(!this.#$h)return;if(this.#$h=!1,this.#Vh?.isDrawer&&this.#Vh.supportMultipleDrawings)return;if(!this.#Nh)return void(this.#Nh=!0);const e=this.#w.getMode();e!==S.STAMP&&e!==S.SIGNATURE?this.createAndAddNewEditor(t,!1):this.#w.unselectAll()}pointerdown(t){if(this.#w.getMode()===S.HIGHLIGHT&&this.enableTextSelection(),this.#$h)return void(this.#$h=!1);const{isMac:i}=Z.platform;if(0!==t.button||t.ctrlKey&&i)return;if(t.target!==this.div)return;if(this.#$h=!0,this.#Vh?.isDrawer)return void this.startDrawingSession(t);const e=this.#w.getActive();this.#Nh=!e||e.isEmpty()}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),this.#jh)return void this.#Vh.startDrawing(this,this.#w,!1,t);this.#w.setCurrentDrawingSession(this),this.#jh=new AbortController;const i=this.#w.combinedSignal(this.#jh);this.div.addEventListener("blur",(({relatedTarget:t})=>{t&&!this.div.contains(t)&&(this.#Uh=null,this.commitOrRemove())}),{signal:i}),this.#Vh.startDrawing(this,this.#w,!1,t)}pause(t){if(t){const{activeElement:t}=document;this.div.contains(t)&&(this.#Uh=t)}else this.#Uh&&setTimeout((()=>{this.#Uh?.focus(),this.#Uh=null}),0)}endDrawingSession(t=!1){return this.#jh?(this.#w.setCurrentDrawingSession(null),this.#jh.abort(),this.#jh=null,this.#Uh=null,this.#Vh.endDrawing(t)):null}findNewParent(t,i,e){const s=this.#w.findParent(i,e);return null!==s&&s!==this&&(s.changeParent(t),!0)}commitOrRemove(){return!!this.#jh&&(this.endDrawingSession(),!0)}onScaleChanging(){this.#jh&&this.#Vh.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#w.getActive()?.parent===this&&(this.#w.commitOrRemove(),this.#w.setActiveEditor(null)),this.#Fh&&(clearTimeout(this.#Fh),this.#Fh=null);for(const t of this.#Oh.values())this.#$n?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#Oh.clear(),this.#w.removeLayer(this)}#Gh(){for(const t of this.#Oh.values())t.isEmpty()&&t.remove()}render({viewport:t}){this.viewport=t,_t(this.div,t);for(const t of this.#w.getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:t}){this.#w.commitOrRemove(),this.#Gh();const i=this.viewport.rotation,e=t.rotation;if(this.viewport=t,_t(this.div,{rotation:e}),i!==e)for(const t of this.#Oh.values())t.rotate(e)}get pageDimensions(){const{pageWidth:t,pageHeight:i}=this.viewport.rawDims;return[t,i]}get scale(){return this.#w.viewParameters.realScale}}class Gs{#gn=null;#Qh=new Map;#qh=new Map;static#b=0;constructor({pageIndex:t}){this.pageIndex=t}setParent(t){if(this.#gn){if(this.#gn!==t){if(this.#Qh.size>0)for(const i of this.#Qh.values())i.remove(),t.append(i);this.#gn=t}}else this.#gn=t}static get _svgFactory(){return H(this,"_svgFactory",new ze)}static#Kh(t,[i,e,s,n]){const{style:r}=t;r.top=100*e+"%",r.left=100*i+"%",r.width=100*s+"%",r.height=100*n+"%"}#Jh(){const t=Gs._svgFactory.create(1,1,!0);return this.#gn.append(t),t.setAttribute("aria-hidden",!0),t}#Zh(t,i){const e=Gs._svgFactory.createElement("clipPath");t.append(e);const s=`clip_${i}`;e.setAttribute("id",s),e.setAttribute("clipPathUnits","objectBoundingBox");const n=Gs._svgFactory.createElement("use");return e.append(n),n.setAttribute("href",`#${i}`),n.classList.add("clip"),s}#ta(t,i){for(const[e,s]of Object.entries(i))null===s?t.removeAttribute(e):t.setAttribute(e,s)}draw(t,i=!1,e=!1){const s=Gs.#b++,n=this.#Jh(),r=Gs._svgFactory.createElement("defs");n.append(r);const o=Gs._svgFactory.createElement("path");r.append(o);const h=`path_p${this.pageIndex}_${s}`;o.setAttribute("id",h),o.setAttribute("vector-effect","non-scaling-stroke"),i&&this.#qh.set(s,o);const a=e?this.#Zh(r,h):null,c=Gs._svgFactory.createElement("use");return n.append(c),c.setAttribute("href",`#${h}`),this.updateProperties(n,t),this.#Qh.set(s,n),{id:s,clipPathId:`url(#${a})`}}drawOutline(t,i){const e=Gs.#b++,s=this.#Jh(),n=Gs._svgFactory.createElement("defs");s.append(n);const r=Gs._svgFactory.createElement("path");n.append(r);const o=`path_p${this.pageIndex}_${e}`;let h;if(r.setAttribute("id",o),r.setAttribute("vector-effect","non-scaling-stroke"),i){const t=Gs._svgFactory.createElement("mask");n.append(t),h=`mask_p${this.pageIndex}_${e}`,t.setAttribute("id",h),t.setAttribute("maskUnits","objectBoundingBox");const i=Gs._svgFactory.createElement("rect");t.append(i),i.setAttribute("width","1"),i.setAttribute("height","1"),i.setAttribute("fill","white");const s=Gs._svgFactory.createElement("use");t.append(s),s.setAttribute("href",`#${o}`),s.setAttribute("stroke","none"),s.setAttribute("fill","black"),s.setAttribute("fill-rule","nonzero"),s.classList.add("mask")}const a=Gs._svgFactory.createElement("use");s.append(a),a.setAttribute("href",`#${o}`),h&&a.setAttribute("mask",`url(#${h})`);const c=a.cloneNode();return s.append(c),a.classList.add("mainOutline"),c.classList.add("secondaryOutline"),this.updateProperties(s,t),this.#Qh.set(e,s),e}finalizeDraw(t,i){this.#qh.delete(t),this.updateProperties(t,i)}updateProperties(t,i){if(!i)return;const{root:e,bbox:s,rootClass:n,path:r}=i,o="number"==typeof t?this.#Qh.get(t):t;if(o){if(e&&this.#ta(o,e),s&&Gs.#Kh(o,s),n){const{classList:t}=o;for(const[i,e]of Object.entries(n))t.toggle(i,e)}r&&this.#ta(o.firstChild.firstChild,r)}}updateParent(t,i){if(i===this)return;const e=this.#Qh.get(t);e&&(i.#gn.append(e),this.#Qh.delete(t),i.#Qh.set(t,e))}remove(t){this.#qh.delete(t),null!==this.#gn&&(this.#Qh.get(t).remove(),this.#Qh.delete(t))}destroy(){this.#gn=null;for(const t of this.#Qh.values())t.remove();this.#Qh.clear(),this.#qh.clear()}}globalThis._pdfjsTestingUtils={HighlightOutliner:Es},globalThis.pdfjsLib={AbortException:q,AnnotationEditorLayer:Hs,AnnotationEditorParamsType:_,AnnotationEditorType:S,AnnotationEditorUIManager:Lt,AnnotationLayer:vs,AnnotationMode:E,AnnotationType:P,build:$e,ColorPicker:Cs,createValidAbsoluteUrl:U,DOMSVGFactory:ze,DrawLayer:Gs,FeatureTest:Z,fetchData:ut,getDocument:_e,getFilenameFromUrl:wt,getPdfFilenameFromUrl:mt,getUuid:rt,getXfaPageViewport:Mt,GlobalWorkerOptions:qi,ImageKind:C,InvalidPDFException:X,isDataScheme:pt,isPdfFile:gt,isValidExplicitDest:ti,MathClamp:ht,noContextMenu:bt,normalizeUnicode:nt,OPS:N,OutputScale:Tt,PasswordResponses:D,PDFDataRangeTransport:Ce,PDFDateString:xt,PDFWorker:Ne,PermissionFlag:T,PixelsPerInch:lt,RenderingCancelledException:ft,ResponseException:Y,setLayerDimensions:_t,shadow:H,SignatureExtractor:Ls,stopEvent:yt,SupportedImageMimeTypes:Ct,TextLayer:Ee,TouchManager:jt,updateUrlHash:z,Util:it,VerbosityLevel:R,version:Oe,XfaLayer:He},window.pdf=Object.freeze({__proto__:null,AbortException:q,AnnotationEditorLayer:Hs,AnnotationEditorParamsType:_,AnnotationEditorType:S,AnnotationEditorUIManager:Lt,AnnotationLayer:vs,AnnotationMode:E,AnnotationType:P,ColorPicker:Cs,DOMSVGFactory:ze,DrawLayer:Gs,FeatureTest:Z,GlobalWorkerOptions:qi,ImageKind:C,InvalidPDFException:X,MathClamp:ht,OPS:N,OutputScale:Tt,PDFDataRangeTransport:Ce,PDFDateString:xt,PDFWorker:Ne,PasswordResponses:D,PermissionFlag:T,PixelsPerInch:lt,RenderingCancelledException:ft,ResponseException:Y,SignatureExtractor:Ls,SupportedImageMimeTypes:Ct,TextLayer:Ee,TouchManager:jt,Util:it,VerbosityLevel:R,XfaLayer:He,build:$e,createValidAbsoluteUrl:U,fetchData:ut,getDocument:_e,getFilenameFromUrl:wt,getPdfFilenameFromUrl:mt,getUuid:rt,getXfaPageViewport:Mt,isDataScheme:pt,isPdfFile:gt,isValidExplicitDest:ti,noContextMenu:bt,normalizeUnicode:nt,setLayerDimensions:_t,shadow:H,stopEvent:yt,updateUrlHash:z,version:Oe});const Ws=class{constructor(e){t(this,e),this.activate=i(this,"activate",7),this.visiblePagesChange=i(this,"visiblePagesChange",7),this.errorMessage="File could not be loaded.",this.viewMode="single",this.workerSrc="/pdfjs/pdf.worker.min.mjs",this.zoom=1,this.currentPage=null,this.loading=!0,this.renderedPages=[],this.singlePageModePage=1,this.visiblePages=[],this.pages=[],this.renderingPageNumbers=[],this.recentScrollPosition={x:0,y:0},this.storeRecentScrollPosition=()=>{this.recentScrollPosition={x:Math.round(this.scrollContainer?.scrollLeft/this.scrollContainer?.scrollWidth*100)/100,y:Math.round(this.scrollContainer?.scrollTop/this.scrollContainer?.scrollHeight*100)/100}},this.onScroll=h((()=>{this.updateVisiblePages(),this.storeRecentScrollPosition()}),60)}componentWillLoad(){window.pdf.GlobalWorkerOptions.workerSrc=this.workerSrc}async componentDidLoad(){await this.getPages(),await this.updateVisiblePages(),this.activate.emit(this.el)}componentDidRender(){this.updateVisiblePages()}disconnectedCallback(){this.doc?.destroy()}async onWindowResize(){this.visiblePages=[],this.renderedPages=[],await this.updateVisiblePages()}async watchProps(){await this.getPages(),await this.updateVisiblePages()}async watchViewMode(){queueMicrotask((async()=>{this.visiblePages=[],this.renderedPages=[],await this.updateVisiblePages()}))}watchZoom(){queueMicrotask((async()=>{this.restoreScrollPosition(),this.visiblePages=[],this.renderedPages=[],await this.updateVisiblePages()}))}async getThumbnails(){return await Promise.all(this.pages.filter(Boolean).map((t=>{const i=t.getViewport({scale:1}),e=document.createElement("canvas");e.width=i.width,e.height=i.height;const s=Math.min(e.width/i.width,e.height/i.height);return t.render({canvasContext:e.getContext("2d"),viewport:t.getViewport({scale:s})}).promise.then((function(){return e}))})))}async print(){this.loading=!0,await this.updateVisiblePages(!0),await this.openPrintDialog(),this.loading=!1}async nextPage(){await this.setPage(this.singlePageModePage+1),await this.updateVisiblePages()}async previousPage(){await this.setPage(this.singlePageModePage-1),await this.updateVisiblePages()}async setPage(t){this.singlePageModePage=Math.min(Math.max(t,1),this.pages.length-1),await this.updateVisiblePages()}async getPages(){this.error=!1,this.loading=!0;try{Boolean(this.doc)&&this.doc.destroy(),this.doc=await _e({isEvalSupported:!1,url:this.file}).promise;const t=[];for(let i=1;i<=this.doc.numPages;i++)t.push(this.doc.getPage(i));this.pages=await Promise.all(t),this.loading=!1}catch(t){this.error=!0,this.loading=!1}}async renderVisiblePages(t){const i=Array.from(this.el.shadowRoot.querySelectorAll("canvas")),e=[];for(const s of i){const i=s.closest(".file-viewer-pdf__page"),n=this.pages.find((t=>t?.pageNumber===+i?.dataset.pageNumber));Boolean(n)&&!this.renderingPageNumbers.includes(n.pageNumber)&&(this.visiblePages.includes(n.pageNumber)||t?!this.renderedPages.includes(n.pageNumber)||t?(await this.renderPage(n,s,t),e.push(n.pageNumber)):e.push(n.pageNumber):this.destroyPage(n))}this.renderedPages=e}async renderPage(t,i,e){const s=i.closest(".file-viewer-pdf__page"),n=s?.querySelector(".file-viewer-pdf__text-container");this.renderingPageNumbers=[...this.renderingPageNumbers,t.pageNumber];const r=e?this.getPrintScale(t):this.getScale(t),o=window.devicePixelRatio||1,h=1!==o?[o,0,0,o,0,0]:null,a=t.getViewport({scale:r}),c=i.getContext("2d");i.height=Math.floor(a.height*o),i.width=Math.floor(a.width*o);const l={canvasContext:c,transform:h,viewport:a};try{await t.render(l).promise,t.cleanup(),n.innerHTML="",this.renderTextLayer(t,n).catch(),this.renderingPageNumbers=this.renderingPageNumbers.filter((i=>i!==t.pageNumber))}catch(t){}}destroyPage(t){const i=this.el.shadowRoot.querySelector(`[data-page-number="${t.pageNumber}"]`),e=i.querySelector("canvas"),s=i.querySelector(".file-viewer-pdf__text-container");e.width=1,e.height=1,e.getContext("2d").clearRect(0,0,e.width,e.height),s.innerHTML=""}async updateVisiblePages(t){const i=Array.from(this.el.shadowRoot.querySelectorAll(".file-viewer-pdf__page"));let e=[],s=null;if(this.singlePageMode)e=[this.singlePageModePage],s=this.singlePageModePage;else if(t)e=i.map((t=>+t.dataset.pageNumber));else{const t=i.map((t=>({pageNumber:+t.dataset.pageNumber,visibleHeight:a(t,this.scrollContainer)}))).filter((({visibleHeight:t})=>t>0));e=t.map((t=>t.pageNumber)),t.length>0&&(s=t.reduce(((t,i)=>i.visibleHeight>t.visibleHeight?i:t),t[0]).pageNumber)}this.visiblePages.length===e.length&&this.visiblePages.every((t=>e.includes(t)))&&this.currentPage===s||(this.visiblePages=e,this.currentPage=s,await this.renderVisiblePages(t),this.visiblePagesChange.emit(this.visiblePages))}async renderTextLayer(t,i){return new Ee({container:i,textContentSource:await t.getTextContent(),viewport:t.getViewport({scale:this.getScale(t)})}).render()}async openPrintDialog(){const t=Array.from(this.scrollContainer.querySelectorAll("canvas"));let i=`\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="UTF-8">\n <meta http-equiv="X-UA-Compatible" content="IE=edge">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <title>${this.file}</title>\n <style>\n *, *:before, *:after {\n margin: 0;\n padding: 0;\n outline: 0;\n }\n\n @page {\n size: a4 !important;\n margin: 0;\n padding: 0;\n }\n\n html, body {\n width: 210mm;\n height: 297mm;\n }\n\n img {\n display: block;\n max-width: 100%;\n max-height: 100%;\n page-break-after: always;\n }\n </style>\n </head>\n <body>\n `;for(const e of t)i+=`<img src="${e.toDataURL()}">`;i+="\n </body>\n </html>\n ";const e=document.createElement("iframe");this.el.append(e);const s=e.contentWindow;s.document.write(i),s.focus(),await new Promise((t=>setTimeout(t,100))),s.print(),e.remove()}getScale(t){const i=c()?0:32;return"auto"===this.zoom?(this.scrollContainer?.clientWidth-i)/t.view[2]:isNaN(this.zoom)?1:this.zoom}getPrintScale(t){return Math.min(Math.min(2480/t.view[2],3508/t.view[3]),2)}restoreScrollPosition(){this.scrollContainer.scrollTop=this.recentScrollPosition.y*this.scrollContainer?.scrollHeight,this.scrollContainer.scrollLeft=this.recentScrollPosition.x*this.scrollContainer?.scrollWidth}render(){const t=!this.error&&!this.loading&&this.visiblePages.length>0,i=this.loading,n=l("file-viewer-pdf",`file-viewer-pdf--view-mode-${this.viewMode}`);return e(s,{key:"17dae0b8e5bf16769a356414071943dc7f8ebec1",class:n,exportparts:"file-viewer-pdf__pagination"},this.error&&e("swirl-inline-error",{key:"472e62e48d63545fef3bddaefe8cc307139b382b",class:"file-viewer-pdf__error",message:this.errorMessage}),e("div",{key:"ae504112d088bd4990b419e787e48c5737f6d552","aria-describedby":"pagination",class:"file-viewer-pdf__pages",onScroll:this.onScroll,ref:t=>this.scrollContainer=t},this.pages.map((t=>{const i=t.getViewport({scale:this.getScale(t)}),s=i.height,n=i.width,r=this.renderedPages.includes(t.pageNumber);return e("div",{"aria-label":t.pageNumber,class:"file-viewer-pdf__page","data-page-number":t.pageNumber,hidden:!(!this.singlePageMode||t.pageNumber===this.singlePageModePage)||void 0,id:`page-${t.pageNumber}`,key:t.pageNumber,role:"region",style:{width:`${n}px`,height:`${s}px`},tabIndex:0},!r&&e("swirl-spinner",{class:"file-viewer-pdf__page-spinner"}),e("canvas",{class:"file-viewer-pdf__canvas",style:{opacity:r?"1":"0"}}),e("div",{class:"file-viewer-pdf__text-container"}))}))),t&&e("span",{key:"0986d71eab6496cd1b588afa28c8ba5cf2a02967",class:"file-viewer-pdf__pagination",id:"pagination",part:"file-viewer-pdf__pagination"},e("span",{key:"b0bd18dd65703cb4d240ab66883e23b03d282265","aria-current":"page"},this.currentPage)," /"," ",this.doc.numPages),i&&e("div",{key:"cb4c58f7641b05e55132ca315e83b7254d2a1d66",class:"file-viewer-pdf__spinner"},e("swirl-spinner",{key:"3a0dc7d43eebc9169928e07959239471d3c8b5ba"})))}get el(){return n(this)}static get watchers(){return{file:["watchProps"],viewMode:["watchViewMode"],zoom:["watchZoom"]}}};Ws.style=":host{position:relative;display:inline-flex;width:100%;height:100%;pointer-events:auto}:host(.file-viewer-pdf--view-mode-side-by-side) .file-viewer-pdf__pages{display:grid;grid-template-columns:repeat(2, 1fr);grid-row-gap:var(--s-space-8);grid-column-gap:var(--s-space-8);grid-auto-rows:auto}:host(.file-viewer-pdf--view-mode-side-by-side) .file-viewer-pdf__page{margin:0}:host(.file-viewer-pdf--view-mode-side-by-side) .file-viewer-pdf__page:nth-child(odd){justify-self:end}:host(.file-viewer-pdf--view-mode-side-by-side) .file-viewer-pdf__page:nth-child(even){justify-self:start}:host *{box-sizing:border-box}.file-viewer-pdf__pages{overflow:auto;width:100%;height:100%}@media (min-width: 768px){.file-viewer-pdf__pages{padding:var(--s-space-16)}}.file-viewer-pdf__page{position:relative;margin-right:auto;margin-left:auto;border-bottom:var(--s-border-width-default) solid var(--s-border-default);background-color:#fff}@media (min-width: 768px){.file-viewer-pdf__page{border:var(--s-border-width-default) solid var(--s-border-default)}.file-viewer-pdf__page:not(:last-of-type){margin-bottom:var(--s-space-8)}}.file-viewer-pdf__page-spinner{position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}.file-viewer-pdf__canvas{display:flex;width:100%;height:100%;margin-right:auto;margin-left:auto}.file-viewer-pdf__text-container{position:absolute;overflow:hidden;line-height:1;text-align:initial;-webkit-user-select:none;-moz-user-select:none;user-select:none;inset:0;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none}.file-viewer-pdf__text-container>*{position:absolute;color:transparent;white-space:pre;cursor:text;transform-origin:0% 0%}.file-viewer-pdf__text-container>*.markedContent{top:0;height:0}.file-viewer-pdf__text-container>*.highlight{margin:-1px;padding:1px;border-radius:4px;background-color:rgba(180, 0, 170, 1)}.file-viewer-pdf__text-container>*.highlight.appended{position:initial}.file-viewer-pdf__text-container>*.highlight.begin{border-radius:4px 0 0 4px}.file-viewer-pdf__text-container>*.highlight.end{border-radius:0 4px 4px 0}.file-viewer-pdf__text-container>*.highlight.middle{border-radius:0}.file-viewer-pdf__text-container>*.highlight.selected{background-color:rgba(0, 100, 0, 1)}.file-viewer-pdf__text-container>*.endOfContent{position:absolute;z-index:-1;top:100%;right:0;bottom:0;left:0;display:block;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.file-viewer-pdf__text-container>*.endOfContent.active{top:0}.file-viewer-pdf__text-container>br::-moz-selection{background:transparent}.file-viewer-pdf__text-container>br::selection{background:transparent}@media (min-width: 768px){.file-viewer-pdf__text-container{-webkit-user-select:auto;-moz-user-select:auto;user-select:auto}}.file-viewer-pdf__spinner{position:absolute;display:flex;justify-content:center;align-items:center;background-color:rgba(0, 0, 0, 0.2);inset:0}.file-viewer-pdf__error{position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}.file-viewer-pdf__pagination{position:absolute;bottom:var(--s-space-16);left:50%;padding:var(--s-space-4) var(--s-space-12);border-radius:var(--s-border-radius-base);color:var(--s-text-on-image);background-color:rgba(0, 0, 0, 0.6);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base);transform:translateX(-50%);pointer-events:none}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.file-viewer-pdf__pagination{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}";const Vs=class{constructor(e){t(this,e),this.activate=i(this,"activate",7),this.errorMessage="File could not be loaded."}componentWillLoad(){this.updateText()}componentDidLoad(){this.activate.emit(this.el)}async updateText(){this.error=!1,this.loading=!0;try{const t=await fetch(this.file);this.text=await t.text(),this.loading=!1}catch(t){this.loading=!1,this.error=!0}}render(){return e(s,{key:"c43d9c70f5114f2f4fe5017e1f2b1ab510626a20",class:"file-viewer-text",exportparts:"file-viewer-text__text"},this.error&&e("swirl-inline-error",{key:"cf202980c625a4069775a1f100d3b0d4321501d8",class:"file-viewer-text__error",message:this.errorMessage}),e("pre",{key:"38b4295c5ee52a43c2f37d550c6e3d1a5cf2311a",class:"file-viewer-text__text",part:"file-viewer-text__text",tabIndex:0},this.text),this.loading&&e("div",{key:"86b6c3a189c726196283c3e4fc5085a52d1678b9",class:"file-viewer-text__spinner"},e("swirl-spinner",{key:"4905814652aa8dcef4da9d1502c5c9a7a9f24d30"})))}get el(){return n(this)}static get watchers(){return{file:["updateText"]}}};Vs.style=":host{position:relative;display:inline-flex;width:100%;max-height:100%;pointer-events:auto}:host *{box-sizing:border-box}.file-viewer-text__text{overflow:auto;width:100%;max-height:100%;margin:0;padding:0;padding:var(--s-space-16);background-color:var(--s-background-default);font-family:var(--s-font-family-code)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.file-viewer-text__text{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.file-viewer-text__spinner{position:absolute;display:flex;justify-content:center;align-items:center;background-color:rgba(0, 0, 0, 0.2);inset:0}.file-viewer-text__error{position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}";const Xs=class{constructor(e){t(this,e),this.activate=i(this,"activate",7)}componentDidLoad(){this.activate.emit(this.el),this.disableDownload&&this.videoEl.setAttribute("controlsList","nodownload")}watchDisableDownload(){this.disableDownload?this.videoEl.setAttribute("controlsList","nodownload"):this.videoEl.removeAttribute("controlsList")}render(){return e(s,{key:"dcf2f2af76392a5b0548ef36edd2f59cc9870932",class:"file-viewer-video"},e("video",{key:"54ac0ea8d79ccdcd336f49b51ba09c005b654236",autoplay:this.autoplay,class:"file-viewer-video__video",src:this.file,controls:!0,ref:t=>this.videoEl=t}))}get el(){return n(this)}static get watchers(){return{disableDownload:["watchDisableDownload"]}}};Xs.style=":host{display:inline-flex;width:100%;max-height:100%;pointer-events:auto}:host *{box-sizing:border-box}.file-viewer-video__video{width:100%;background-color:rgba(0, 0, 0, 1)}";export{u as swirl_file_viewer,d as swirl_file_viewer_audio,w as swirl_file_viewer_csv,m as swirl_file_viewer_fallback,A as swirl_file_viewer_image,Ws as swirl_file_viewer_pdf,Vs as swirl_file_viewer_text,Xs as swirl_file_viewer_video}
28
+ */var b={34:(t,i,e)=>{var s=e(4901);t.exports=function(t){return"object"==typeof t?null!==t:s(t)}},81:(t,i,e)=>{var s=e(9565),n=e(9306),r=e(8551),o=e(6823),h=e(851),a=TypeError;t.exports=function(t,i){var e=arguments.length<2?h(t):i;if(n(e))return r(s(e,t));throw new a(o(t)+" is not iterable")}},283:(t,i,e)=>{var s=e(9504),n=e(9039),r=e(4901),o=e(9297),h=e(3724),a=e(350).CONFIGURABLE,c=e(3706),l=e(1181),u=l.enforce,d=l.get,f=String,p=Object.defineProperty,g=s("".slice),w=s("".replace),m=s([].join),A=h&&!n((function(){return 8!==p((function(){}),"length",{value:8}).length})),b=String(String).split("String"),v=t.exports=function(t,i,e){"Symbol("===g(f(i),0,7)&&(i="["+w(f(i),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),e&&e.getter&&(i="get "+i),e&&e.setter&&(i="set "+i),(!o(t,"name")||a&&t.name!==i)&&(h?p(t,"name",{value:i,configurable:!0}):t.name=i),A&&e&&o(e,"arity")&&t.length!==e.arity&&p(t,"length",{value:e.arity});try{e&&o(e,"constructor")&&e.constructor?h&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var s=u(t);return o(s,"source")||(s.source=m(b,"string"==typeof i?i:"")),t};Function.prototype.toString=v((function(){return r(this)&&d(this).source||c(this)}),"toString")},350:(t,i,e)=>{var s=e(3724),n=e(9297),r=Function.prototype,o=s&&Object.getOwnPropertyDescriptor,h=n(r,"name"),a=h&&"something"===function(){}.name,c=h&&(!s||s&&o(r,"name").configurable);t.exports={EXISTS:h,PROPER:a,CONFIGURABLE:c}},397:(t,i,e)=>{var s=e(7751);t.exports=s("document","documentElement")},421:t=>{t.exports={}},507:(t,i,e)=>{var s=e(9565);t.exports=function(t,i,e){for(var n,r,o=e?t:t.iterator,h=t.next;!(n=s(h,o)).done;)if(void 0!==(r=i(n.value)))return r}},531:(t,i,e)=>{var s=e(6518),n=e(9565),r=e(9306),o=e(8551),h=e(1767),a=e(8646),c=e(9462),l=e(9539),u=e(6395),d=e(4549),f=!u&&d("flatMap",TypeError),p=c((function(){for(var t,i,e=this.iterator,s=this.mapper;;){if(i=this.inner)try{if(!(t=o(n(i.next,i.iterator))).done)return t.value;this.inner=null}catch(t){l(e,"throw",t)}if(t=o(n(this.next,e)),this.done=!!t.done)return;try{this.inner=a(s(t.value,this.counter++),!1)}catch(t){l(e,"throw",t)}}}));s({target:"Iterator",proto:!0,real:!0,forced:u||f},{flatMap:function(t){o(this);try{r(t)}catch(t){l(this,"throw",t)}return f?n(f,this,t):new p(h(this),{mapper:t,inner:null})}})},616:(t,i,e)=>{var s=e(9039);t.exports=!s((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},655:(t,i,e)=>{var s=e(6955),n=String;t.exports=function(t){if("Symbol"===s(t))throw new TypeError("Cannot convert a Symbol value to a string");return n(t)}},679:(t,i,e)=>{var s=e(1625),n=TypeError;t.exports=function(t,i){if(s(i,t))return t;throw new n("Incorrect invocation")}},741:t=>{var i=Math.ceil,e=Math.floor;t.exports=Math.trunc||function(t){var s=+t;return(s>0?e:i)(s)}},757:(t,i,e)=>{var s=e(7751),n=e(4901),r=e(1625),o=e(7040),h=Object;t.exports=o?function(t){return"symbol"==typeof t}:function(t){var i=s("Symbol");return n(i)&&r(i.prototype,h(t))}},851:(t,i,e)=>{var s=e(6955),n=e(5966),r=e(4117),o=e(6269),h=e(8227)("iterator");t.exports=function(t){if(!r(t))return n(t,h)||n(t,"@@iterator")||o[s(t)]}},944:t=>{var i=TypeError;t.exports=function(t){var e=t&&t.alphabet;if(void 0===e||"base64"===e||"base64url"===e)return e||"base64";throw new i("Incorrect `alphabet` option")}},1072:(t,i,e)=>{var s=e(1828),n=e(8727);t.exports=Object.keys||function(t){return s(t,n)}},1103:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},1148:(t,i,e)=>{var s=e(6518),n=e(9565),r=e(2652),o=e(9306),h=e(8551),a=e(1767),c=e(9539),l=e(4549)("every",TypeError);s({target:"Iterator",proto:!0,real:!0,forced:l},{every:function(t){h(this);try{o(t)}catch(t){c(this,"throw",t)}if(l)return n(l,this,t);var i=a(this),e=0;return!r(i,(function(i,s){if(!t(i,e++))return s()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},1181:(t,i,e)=>{var s,n,r,o=e(8622),h=e(4576),a=e(34),c=e(6699),l=e(9297),u=e(7629),d=e(6119),f=e(421),p="Object already initialized",g=h.TypeError;if(o||u.state){var w=u.state||(u.state=new(0,h.WeakMap));w.get=w.get,w.has=w.has,w.set=w.set,s=function(t,i){if(w.has(t))throw new g(p);return i.facade=t,w.set(t,i),i},n=function(t){return w.get(t)||{}},r=function(t){return w.has(t)}}else{var m=d("state");f[m]=!0,s=function(t,i){if(l(t,m))throw new g(p);return i.facade=t,c(t,m,i),i},n=function(t){return l(t,m)?t[m]:{}},r=function(t){return l(t,m)}}t.exports={set:s,get:n,has:r,enforce:function(t){return r(t)?n(t):s(t,{})},getterFor:function(t){return function(i){var e;if(!a(i)||(e=n(i)).type!==t)throw new g("Incompatible receiver, "+t+" required");return e}}}},1291:(t,i,e)=>{var s=e(741);t.exports=function(t){var i=+t;return i!=i||0===i?0:s(i)}},1548:(t,i,e)=>{var s=e(4576),n=e(9039),r=e(9519),o=e(4215),h=s.structuredClone;t.exports=!!h&&!n((function(){if("DENO"===o&&r>92||"NODE"===o&&r>94||"BROWSER"===o&&r>97)return!1;var t=new ArrayBuffer(8),i=h(t,{transfer:[t]});return 0!==t.byteLength||8!==i.byteLength}))},1549:(t,i,e)=>{var s=e(6518),n=e(4576),r=e(9143),o=e(4154),h=n.Uint8Array,a=!h||!h.prototype.setFromBase64||!function(){var t=new h([255,255,255,255,255]);try{t.setFromBase64("MjYyZg===")}catch(i){return 50===t[0]&&54===t[1]&&50===t[2]&&255===t[3]&&255===t[4]}}();h&&s({target:"Uint8Array",proto:!0,forced:a},{setFromBase64:function(t){o(this);var i=r(t,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:i.read,written:i.written}}})},1625:(t,i,e)=>{var s=e(9504);t.exports=s({}.isPrototypeOf)},1689:(t,i,e)=>{var s=e(6518),n=e(4576),r=e(8745),o=e(7680),h=e(6043),a=e(9306),c=e(1103),l=n.Promise,u=!1;s({target:"Promise",stat:!0,forced:!l||!l.try||c((function(){l.try((function(t){u=8===t}),8)})).error||!u},{try:function(t){var i=arguments.length>1?o(arguments,1):[],e=h.f(this),s=c((function(){return r(a(t),void 0,i)}));return(s.error?e.reject:e.resolve)(s.value),e.promise}})},1698:(t,i,e)=>{var s=e(6518),n=e(4204);s({target:"Set",proto:!0,real:!0,forced:!e(4916)("union")},{union:n})},1701:(t,i,e)=>{var s=e(6518),n=e(9565),r=e(9306),o=e(8551),h=e(1767),a=e(9462),c=e(6319),l=e(9539),u=e(4549),d=e(6395),f=!d&&u("map",TypeError),p=a((function(){var t=this.iterator,i=o(n(this.next,t));if(!(this.done=!!i.done))return c(t,this.mapper,[i.value,this.counter++],!0)}));s({target:"Iterator",proto:!0,real:!0,forced:d||f},{map:function(t){o(this);try{r(t)}catch(t){l(this,"throw",t)}return f?n(f,this,t):new p(h(this),{mapper:t})}})},1767:t=>{t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},1828:(t,i,e)=>{var s=e(9504),n=e(9297),r=e(5397),o=e(9617).indexOf,h=e(421),a=s([].push);t.exports=function(t,i){var e,s=r(t),c=0,l=[];for(e in s)!n(h,e)&&n(s,e)&&a(l,e);for(;i.length>c;)n(s,e=i[c++])&&(~o(l,e)||a(l,e));return l}},2106:(t,i,e)=>{var s=e(283),n=e(4913);t.exports=function(t,i,e){return e.get&&s(e.get,i,{getter:!0}),e.set&&s(e.set,i,{setter:!0}),n.f(t,i,e)}},2140:(t,i,e)=>{var s={};s[e(8227)("toStringTag")]="z",t.exports="[object z]"===String(s)},2195:(t,i,e)=>{var s=e(9504),n=s({}.toString),r=s("".slice);t.exports=function(t){return r(n(t),8,-1)}},2211:(t,i,e)=>{var s=e(9039);t.exports=!s((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},2303:(t,i,e)=>{var s=e(4576),n=e(9504),r=s.Uint8Array,o=s.SyntaxError,h=s.parseInt,a=Math.min,c=/[^\da-f]/i,l=n(c.exec),u=n("".slice);t.exports=function(t,i){var e=t.length;if(e%2!=0)throw new o("String should be an even number of characters");for(var s=i?a(i.length,e/2):e/2,n=i||new r(s),d=0,f=0;f<s;){var p=u(t,d,d+=2);if(l(c,p))throw new o("String should only contain hex characters");n[f++]=h(p,16)}return{bytes:n,read:d}}},2360:(t,i,e)=>{var s,n=e(8551),r=e(6801),o=e(8727),h=e(421),a=e(397),c=e(4055),l=e(6119),u="prototype",d="script",f=l("IE_PROTO"),p=function(){},g=function(t){return"<"+d+">"+t+"</"+d+">"},w=function(t){t.write(g("")),t.close();var i=t.parentWindow.Object;return t=null,i},m=function(){try{s=new ActiveXObject("htmlfile")}catch(t){}var t,i,e;m="undefined"!=typeof document?document.domain&&s?w(s):(i=c("iframe"),e="java"+d+":",i.style.display="none",a.appendChild(i),i.src=String(e),(t=i.contentWindow.document).open(),t.write(g("document.F=Object")),t.close(),t.F):w(s);for(var n=o.length;n--;)delete m[u][o[n]];return m()};h[f]=!0,t.exports=Object.create||function(t,i){var e;return null!==t?(p[u]=n(t),e=new p,p[u]=null,e[f]=t):e=m(),void 0===i?e:r.f(e,i)}},2475:(t,i,e)=>{var s=e(6518),n=e(8527);s({target:"Set",proto:!0,real:!0,forced:!e(4916)("isSupersetOf",(function(t){return!t}))},{isSupersetOf:n})},2489:(t,i,e)=>{var s=e(6518),n=e(9565),r=e(9306),o=e(8551),h=e(1767),a=e(9462),c=e(6319),l=e(6395),u=e(9539),d=e(4549),f=!l&&d("filter",TypeError),p=a((function(){for(var t,i,e=this.iterator,s=this.predicate,r=this.next;;){if(t=o(n(r,e)),this.done=!!t.done)return;if(c(e,s,[i=t.value,this.counter++],!0))return i}}));s({target:"Iterator",proto:!0,real:!0,forced:l||f},{filter:function(t){o(this);try{r(t)}catch(t){u(this,"throw",t)}return f?n(f,this,t):new p(h(this),{predicate:t})}})},2529:t=>{t.exports=function(t,i){return{value:t,done:i}}},2603:(t,i,e)=>{var s=e(655);t.exports=function(t,i){return void 0===t?arguments.length<2?"":i:s(t)}},2652:(t,i,e)=>{var s=e(6080),n=e(9565),r=e(8551),o=e(6823),h=e(4209),a=e(6198),c=e(1625),l=e(81),u=e(851),d=e(9539),f=TypeError,p=function(t,i){this.stopped=t,this.result=i},g=p.prototype;t.exports=function(t,i,e){var w,m,A,b,v,y,x,M=!(!e||!e.AS_ENTRIES),k=!(!e||!e.IS_RECORD),E=!(!e||!e.IS_ITERATOR),S=!(!e||!e.INTERRUPTED),_=s(i,e&&e.that),T=function(t){return w&&d(w,"normal",t),new p(!0,t)},C=function(t){return M?(r(t),S?_(t[0],t[1],T):_(t[0],t[1])):S?_(t,T):_(t)};if(k)w=t.iterator;else if(E)w=t;else{if(!(m=u(t)))throw new f(o(t)+" is not iterable");if(h(m)){for(A=0,b=a(t);b>A;A++)if((v=C(t[A]))&&c(g,v))return v;return new p(!1)}w=l(t,m)}for(y=k?t.next:w.next;!(x=n(y,w)).done;){try{v=C(x.value)}catch(t){d(w,"throw",t)}if("object"==typeof v&&v&&c(g,v))return v}return new p(!1)}},2777:(t,i,e)=>{var s=e(9565),n=e(34),r=e(757),o=e(5966),h=e(4270),a=e(8227),c=TypeError,l=a("toPrimitive");t.exports=function(t,i){if(!n(t)||r(t))return t;var e,a=o(t,l);if(a){if(void 0===i&&(i="default"),e=s(a,t,i),!n(e)||r(e))return e;throw new c("Can't convert object to primitive value")}return void 0===i&&(i="number"),h(t,i)}},2787:(t,i,e)=>{var s=e(9297),n=e(4901),r=e(8981),o=e(6119),h=e(2211),a=o("IE_PROTO"),c=Object,l=c.prototype;t.exports=h?c.getPrototypeOf:function(t){var i=r(t);if(s(i,a))return i[a];var e=i.constructor;return n(e)&&i instanceof e?e.prototype:i instanceof c?l:null}},2796:(t,i,e)=>{var s=e(9039),n=e(4901),r=/#|\.prototype\./,o=function(t,i){var e=a[h(t)];return e===l||e!==c&&(n(i)?s(i):!!i)},h=o.normalize=function(t){return String(t).replace(r,".").toLowerCase()},a=o.data={},c=o.NATIVE="N",l=o.POLYFILL="P";t.exports=o},2804:t=>{var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=i+"+/",s=i+"-_",n=function(t){for(var i={},e=0;e<64;e++)i[t.charAt(e)]=e;return i};t.exports={i2c:e,c2i:n(e),i2cUrl:s,c2iUrl:n(s)}},2812:t=>{var i=TypeError;t.exports=function(t,e){if(t<e)throw new i("Not enough arguments");return t}},2839:(t,i,e)=>{var s=e(4576).navigator,n=s&&s.userAgent;t.exports=n?String(n):""},2967:(t,i,e)=>{var s=e(6706),n=e(34),r=e(7750),o=e(3506);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,i=!1,e={};try{(t=s(Object.prototype,"__proto__","set"))(e,[]),i=e instanceof Array}catch(t){}return function(e,s){return r(e),o(s),n(e)?(i?t(e,s):e.__proto__=s,e):e}}():void 0)},3167:(t,i,e)=>{var s=e(4901),n=e(34),r=e(2967);t.exports=function(t,i,e){var o,h;return r&&s(o=i.constructor)&&o!==e&&n(h=o.prototype)&&h!==e.prototype&&r(t,h),t}},3238:(t,i,e)=>{var s=e(4576),n=e(7811),r=e(7394),o=s.DataView;t.exports=function(t){if(!n||0!==r(t))return!1;try{return new o(t),!1}catch(t){return!0}}},3392:(t,i,e)=>{var s=e(9504),n=0,r=Math.random(),o=s(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+o(++n+r,36)}},3440:(t,i,e)=>{var s=e(7080),n=e(4402),r=e(9286),o=e(5170),h=e(3789),a=e(8469),c=e(507),l=n.has,u=n.remove;t.exports=function(t){var i=s(this),e=h(t),n=r(i);return o(i)<=e.size?a(i,(function(t){e.includes(t)&&u(n,t)})):c(e.getIterator(),(function(t){l(i,t)&&u(n,t)})),n}},3463:t=>{var i=TypeError;t.exports=function(t){if("string"==typeof t)return t;throw new i("Argument is not a string")}},3506:(t,i,e)=>{var s=e(3925),n=String,r=TypeError;t.exports=function(t){if(s(t))return t;throw new r("Can't set "+n(t)+" as a prototype")}},3579:(t,i,e)=>{var s=e(6518),n=e(9565),r=e(2652),o=e(9306),h=e(8551),a=e(1767),c=e(9539),l=e(4549)("some",TypeError);s({target:"Iterator",proto:!0,real:!0,forced:l},{some:function(t){h(this);try{o(t)}catch(t){c(this,"throw",t)}if(l)return n(l,this,t);var i=a(this),e=0;return r(i,(function(i,s){if(t(i,e++))return s()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},3650:(t,i,e)=>{var s=e(7080),n=e(4402),r=e(9286),o=e(3789),h=e(507),a=n.add,c=n.has,l=n.remove;t.exports=function(t){var i=s(this),e=o(t).getIterator(),n=r(i);return h(e,(function(t){c(i,t)?l(n,t):a(n,t)})),n}},3706:(t,i,e)=>{var s=e(9504),n=e(4901),r=e(7629),o=s(Function.toString);n(r.inspectSource)||(r.inspectSource=function(t){return o(t)}),t.exports=r.inspectSource},3717:(t,i)=>{i.f=Object.getOwnPropertySymbols},3724:(t,i,e)=>{var s=e(9039);t.exports=!s((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},3789:(t,i,e)=>{var s=e(9306),n=e(8551),r=e(9565),o=e(1291),h=e(1767),a="Invalid size",c=RangeError,l=TypeError,u=Math.max,d=function(t,i){this.set=t,this.size=u(i,0),this.has=s(t.has),this.keys=s(t.keys)};d.prototype={getIterator:function(){return h(n(r(this.keys,this.set)))},includes:function(t){return r(this.has,this.set,t)}},t.exports=function(t){n(t);var i=+t.size;if(i!=i)throw new l(a);var e=o(i);if(e<0)throw new c(a);return new d(t,e)}},3838:(t,i,e)=>{var s=e(7080),n=e(5170),r=e(8469),o=e(3789);t.exports=function(t){var i=s(this),e=o(t);return!(n(i)>e.size)&&!1!==r(i,(function(t){if(!e.includes(t))return!1}),!0)}},3853:(t,i,e)=>{var s=e(6518),n=e(4449);s({target:"Set",proto:!0,real:!0,forced:!e(4916)("isDisjointFrom",(function(t){return!t}))},{isDisjointFrom:n})},3925:(t,i,e)=>{var s=e(34);t.exports=function(t){return s(t)||null===t}},3972:(t,i,e)=>{var s=e(34),n=String,r=TypeError;t.exports=function(t){if(void 0===t||s(t))return t;throw new r(n(t)+" is not an object or undefined")}},4055:(t,i,e)=>{var s=e(4576),n=e(34),r=s.document,o=n(r)&&n(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},4114:(t,i,e)=>{var s=e(6518),n=e(8981),r=e(6198),o=e(4527),h=e(6837);s({target:"Array",proto:!0,arity:1,forced:e(9039)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var i=n(this),e=r(i),s=arguments.length;h(e+s);for(var a=0;a<s;a++)i[e]=arguments[a],e++;return o(i,e),e}})},4117:t=>{t.exports=function(t){return null==t}},4149:t=>{var i=RangeError;t.exports=function(t){if(t==t)return t;throw new i("NaN is not allowed")}},4154:(t,i,e)=>{var s=e(6955),n=TypeError;t.exports=function(t){if("Uint8Array"===s(t))return t;throw new n("Argument is not an Uint8Array")}},4204:(t,i,e)=>{var s=e(7080),n=e(4402).add,r=e(9286),o=e(3789),h=e(507);t.exports=function(t){var i=s(this),e=o(t).getIterator(),a=r(i);return h(e,(function(t){n(a,t)})),a}},4209:(t,i,e)=>{var s=e(8227),n=e(6269),r=s("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||o[r]===t)}},4215:(t,i,e)=>{var s=e(4576),n=e(2839),r=e(2195),o=function(t){return n.slice(0,t.length)===t};t.exports=o("Bun/")?"BUN":o("Cloudflare-Workers")?"CLOUDFLARE":o("Deno/")?"DENO":o("Node.js/")?"NODE":s.Bun&&"string"==typeof Bun.version?"BUN":s.Deno&&"object"==typeof Deno.version?"DENO":"process"===r(s.process)?"NODE":s.window&&s.document?"BROWSER":"REST"},4270:(t,i,e)=>{var s=e(9565),n=e(4901),r=e(34),o=TypeError;t.exports=function(t,i){var e,h;if("string"===i&&n(e=t.toString)&&!r(h=s(e,t)))return h;if(n(e=t.valueOf)&&!r(h=s(e,t)))return h;if("string"!==i&&n(e=t.toString)&&!r(h=s(e,t)))return h;throw new o("Can't convert object to primitive value")}},4376:(t,i,e)=>{var s=e(2195);t.exports=Array.isArray||function(t){return"Array"===s(t)}},4402:(t,i,e)=>{var s=e(9504),n=Set.prototype;t.exports={Set,add:s(n.add),has:s(n.has),remove:s(n.delete),proto:n}},4449:(t,i,e)=>{var s=e(7080),n=e(4402).has,r=e(5170),o=e(3789),h=e(8469),a=e(507),c=e(9539);t.exports=function(t){var i=s(this),e=o(t);if(r(i)<=e.size)return!1!==h(i,(function(t){if(e.includes(t))return!1}),!0);var l=e.getIterator();return!1!==a(l,(function(t){if(n(i,t))return c(l,"normal",!1)}))}},4483:(t,i,e)=>{var s,n,r,o,h=e(4576),a=e(9429),c=e(1548),l=h.structuredClone,u=h.ArrayBuffer,d=h.MessageChannel,f=!1;if(c)f=function(t){l(t,{transfer:[t]})};else if(u)try{d||(s=a("worker_threads"))&&(d=s.MessageChannel),d&&(n=new d,r=new u(2),o=function(t){n.port1.postMessage(null,[t])},2===r.byteLength&&(o(r),0===r.byteLength&&(f=o)))}catch(t){}t.exports=f},4495:(t,i,e)=>{var s=e(9519),n=e(9039),r=e(4576).String;t.exports=!!Object.getOwnPropertySymbols&&!n((function(){var t=Symbol("symbol detection");return!r(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&s&&s<41}))},4527:(t,i,e)=>{var s=e(3724),n=e(4376),r=TypeError,o=Object.getOwnPropertyDescriptor,h=s&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=h?function(t,i){if(n(t)&&!o(t,"length").writable)throw new r("Cannot set read only .length");return t.length=i}:function(t,i){return t.length=i}},4549:(t,i,e)=>{var s=e(4576);t.exports=function(t,i){var e=s.Iterator,n=e&&e.prototype,r=n&&n[t],o=!1;if(r)try{r.call({next:function(){return{done:!0}},return:function(){o=!0}},-1)}catch(t){t instanceof i||(o=!1)}if(!o)return r}},4576:function(t){var i=function(t){return t&&t.Math===Math&&t};t.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof global&&global)||i("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4603:(t,i,e)=>{var s=e(6840),n=e(9504),r=e(655),o=e(2812),h=URLSearchParams,a=h.prototype,c=n(a.append),l=n(a.delete),u=n(a.forEach),d=n([].push),f=new h("a=1&a=2&b=3");f.delete("a",1),f.delete("b",void 0),f+""!="a=2"&&s(a,"delete",(function(t){var i=arguments.length,e=i<2?void 0:arguments[1];if(i&&void 0===e)return l(this,t);var s=[];u(this,(function(t,i){d(s,{key:i,value:t})})),o(i,1);for(var n,h=r(t),a=r(e),f=0,p=0,g=!1,w=s.length;f<w;)n=s[f++],g||n.key===h?(g=!0,l(this,n.key)):p++;for(;p<w;)(n=s[p++]).key===h&&n.value===a||c(this,n.key,n.value)}),{enumerable:!0,unsafe:!0})},4628:(t,i,e)=>{var s=e(6518),n=e(6043);s({target:"Promise",stat:!0},{withResolvers:function(){var t=n.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}})},4659:(t,i,e)=>{var s=e(3724),n=e(4913),r=e(6980);t.exports=function(t,i,e){s?n.f(t,i,r(0,e)):t[i]=e}},4901:t=>{var i="object"==typeof document&&document.all;t.exports=void 0===i&&void 0!==i?function(t){return"function"==typeof t||t===i}:function(t){return"function"==typeof t}},4913:(t,i,e)=>{var s=e(3724),n=e(5917),r=e(8686),o=e(8551),h=e(6969),a=TypeError,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u="enumerable",d="configurable",f="writable";i.f=s?r?function(t,i,e){if(o(t),i=h(i),o(e),"function"==typeof t&&"prototype"===i&&"value"in e&&f in e&&!e[f]){var s=l(t,i);s&&s[f]&&(t[i]=e.value,e={configurable:d in e?e[d]:s[d],enumerable:u in e?e[u]:s[u],writable:!1})}return c(t,i,e)}:c:function(t,i,e){if(o(t),i=h(i),o(e),n)try{return c(t,i,e)}catch(t){}if("get"in e||"set"in e)throw new a("Accessors not supported");return"value"in e&&(t[i]=e.value),t}},4916:(t,i,e)=>{var s=e(7751),n=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},r=function(t){return{size:t,has:function(){return!0},keys:function(){throw new Error("e")}}};t.exports=function(t,i){var e=s("Set");try{(new e)[t](n(0));try{return(new e)[t](n(-1)),!1}catch(s){if(!i)return!0;try{return(new e)[t](r(-1/0)),!1}catch(s){var o=new e;return o.add(1),o.add(2),i(o[t](r(1/0)))}}}catch(t){return!1}}},4979:(t,i,e)=>{var s=e(6518),n=e(4576),r=e(7751),o=e(6980),h=e(4913).f,a=e(9297),c=e(679),l=e(3167),u=e(2603),d=e(5002),f=e(8574),p=e(3724),g=e(6395),w="DOMException",m=r("Error"),A=r(w),b=function(){c(this,v);var t=arguments.length,i=u(t<1?void 0:arguments[0]),e=u(t<2?void 0:arguments[1],"Error"),s=new A(i,e),n=new m(i);return n.name=w,h(s,"stack",o(1,f(n.stack,1))),l(s,this,b),s},v=b.prototype=A.prototype,y="stack"in new m(w),x="stack"in new A(1,2),M=A&&p&&Object.getOwnPropertyDescriptor(n,w),k=y&&!!(!M||M.writable&&M.configurable)&&!x;s({global:!0,constructor:!0,forced:g||k},{DOMException:k?b:A});var E=r(w),S=E.prototype;if(S.constructor!==E)for(var _ in g||h(S,"constructor",o(1,E)),d)if(a(d,_)){var T=d[_],C=T.s;a(E,C)||h(E,C,o(6,T.c))}},5002:t=>{t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},5024:(t,i,e)=>{var s=e(6518),n=e(3650);s({target:"Set",proto:!0,real:!0,forced:!e(4916)("symmetricDifference")},{symmetricDifference:n})},5031:(t,i,e)=>{var s=e(7751),n=e(9504),r=e(8480),o=e(3717),h=e(8551),a=n([].concat);t.exports=s("Reflect","ownKeys")||function(t){var i=r.f(h(t)),e=o.f;return e?a(i,e(t)):i}},5169:(t,i,e)=>{var s=e(3238),n=TypeError;t.exports=function(t){if(s(t))throw new n("ArrayBuffer is detached");return t}},5170:(t,i,e)=>{var s=e(6706),n=e(4402);t.exports=s(n.proto,"size","get")||function(t){return t.size}},5370:(t,i,e)=>{var s=e(6198);t.exports=function(t,i,e){for(var n=0,r=arguments.length>2?e:s(i),o=new t(r);r>n;)o[n]=i[n++];return o}},5397:(t,i,e)=>{var s=e(7055),n=e(7750);t.exports=function(t){return s(n(t))}},5610:(t,i,e)=>{var s=e(1291),n=Math.max,r=Math.min;t.exports=function(t,i){var e=s(t);return e<0?n(e+i,0):r(e,i)}},5623:(t,i,e)=>{var s=e(6518),n=e(4576),r=e(9504),o=e(4154),h=e(5169),a=r(1..toString);n.Uint8Array&&s({target:"Uint8Array",proto:!0},{toHex:function(){o(this),h(this.buffer);for(var t="",i=0,e=this.length;i<e;i++){var s=a(this[i],16);t+=1===s.length?"0"+s:s}return t}})},5636:(t,i,e)=>{var s=e(4576),n=e(9504),r=e(6706),o=e(7696),h=e(5169),a=e(7394),c=e(4483),l=e(1548),u=s.structuredClone,d=s.ArrayBuffer,f=s.DataView,p=Math.min,g=d.prototype,w=f.prototype,m=n(g.slice),A=r(g,"resizable","get"),b=r(g,"maxByteLength","get"),v=n(w.getInt8),y=n(w.setInt8);t.exports=(l||c)&&function(t,i,e){var s,n=a(t),r=void 0===i?n:o(i),g=!A||!A(t);if(h(t),l&&(t=u(t,{transfer:[t]}),n===r&&(e||g)))return t;if(n>=r&&(!e||g))s=m(t,0,r);else{var w=e&&!g&&b?{maxByteLength:b(t)}:void 0;s=new d(r,w);for(var x=new f(t),M=new f(s),k=p(r,n),E=0;E<k;E++)y(M,E,v(x,E))}return l||c(t),s}},5745:(t,i,e)=>{var s=e(7629);t.exports=function(t,i){return s[t]||(s[t]=i||{})}},5781:(t,i,e)=>{var s=e(6518),n=e(7751),r=e(2812),o=e(655),h=e(7416),a=n("URL");s({target:"URL",stat:!0,forced:!h},{parse:function(t){var i=r(arguments.length,1),e=o(t),s=i<2||void 0===arguments[1]?void 0:o(arguments[1]);try{return new a(e,s)}catch(t){return null}}})},5876:(t,i,e)=>{var s=e(6518),n=e(3838);s({target:"Set",proto:!0,real:!0,forced:!e(4916)("isSubsetOf",(function(t){return t}))},{isSubsetOf:n})},5917:(t,i,e)=>{var s=e(3724),n=e(9039),r=e(4055);t.exports=!s&&!n((function(){return 7!==Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))},5966:(t,i,e)=>{var s=e(9306),n=e(4117);t.exports=function(t,i){var e=t[i];return n(e)?void 0:s(e)}},6043:(t,i,e)=>{var s=e(9306),n=TypeError,r=function(t){var i,e;this.promise=new t((function(t,s){if(void 0!==i||void 0!==e)throw new n("Bad Promise constructor");i=t,e=s})),this.resolve=s(i),this.reject=s(e)};t.exports.f=function(t){return new r(t)}},6080:(t,i,e)=>{var s=e(7476),n=e(9306),r=e(616),o=s(s.bind);t.exports=function(t,i){return n(t),void 0===i?t:r?o(t,i):function(){return t.apply(i,arguments)}}},6119:(t,i,e)=>{var s=e(5745),n=e(3392),r=s("keys");t.exports=function(t){return r[t]||(r[t]=n(t))}},6193:(t,i,e)=>{var s=e(4215);t.exports="NODE"===s},6198:(t,i,e)=>{var s=e(8014);t.exports=function(t){return s(t.length)}},6269:t=>{t.exports={}},6279:(t,i,e)=>{var s=e(6840);t.exports=function(t,i,e){for(var n in i)s(t,n,i[n],e);return t}},6319:(t,i,e)=>{var s=e(8551),n=e(9539);t.exports=function(t,i,e,r){try{return r?i(s(e)[0],e[1]):i(e)}catch(i){n(t,"throw",i)}}},6395:t=>{t.exports=!1},6518:(t,i,e)=>{var s=e(4576),n=e(7347).f,r=e(6699),o=e(6840),h=e(9433),a=e(7740),c=e(2796);t.exports=function(t,i){var e,l,u,d,f,p=t.target,g=t.global,w=t.stat;if(e=g?s:w?s[p]||h(p,{}):s[p]&&s[p].prototype)for(l in i){if(d=i[l],u=t.dontCallGetSet?(f=n(e,l))&&f.value:e[l],!c(g?l:p+(w?".":"#")+l,t.forced)&&void 0!==u){if(typeof d==typeof u)continue;a(d,u)}(t.sham||u&&u.sham)&&r(d,"sham",!0),o(e,l,d,t)}}},6573:(t,i,e)=>{var s=e(3724),n=e(2106),r=e(3238),o=ArrayBuffer.prototype;s&&!("detached"in o)&&n(o,"detached",{configurable:!0,get:function(){return r(this)}})},6699:(t,i,e)=>{var s=e(3724),n=e(4913),r=e(6980);t.exports=s?function(t,i,e){return n.f(t,i,r(1,e))}:function(t,i,e){return t[i]=e,t}},6706:(t,i,e)=>{var s=e(9504),n=e(9306);t.exports=function(t,i,e){try{return s(n(Object.getOwnPropertyDescriptor(t,i)[e]))}catch(t){}}},6801:(t,i,e)=>{var s=e(3724),n=e(8686),r=e(4913),o=e(8551),h=e(5397),a=e(1072);i.f=s&&!n?Object.defineProperties:function(t,i){o(t);for(var e,s=h(i),n=a(i),c=n.length,l=0;c>l;)r.f(t,e=n[l++],s[e]);return t}},6823:t=>{var i=String;t.exports=function(t){try{return i(t)}catch(t){return"Object"}}},6837:t=>{var i=TypeError;t.exports=function(t){if(t>9007199254740991)throw i("Maximum allowed index exceeded");return t}},6840:(t,i,e)=>{var s=e(4901),n=e(4913),r=e(283),o=e(9433);t.exports=function(t,i,e,h){h||(h={});var a=h.enumerable,c=void 0!==h.name?h.name:i;if(s(e)&&r(e,c,h),h.global)a?t[i]=e:o(i,e);else{try{h.unsafe?t[i]&&(a=!0):delete t[i]}catch(t){}a?t[i]=e:n.f(t,i,{value:e,enumerable:!1,configurable:!h.nonConfigurable,writable:!h.nonWritable})}return t}},6955:(t,i,e)=>{var s=e(2140),n=e(4901),r=e(2195),o=e(8227)("toStringTag"),h=Object,a="Arguments"===r(function(){return arguments}());t.exports=s?r:function(t){var i,e,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,i){try{return t[i]}catch(t){}}(i=h(t),o))?e:a?r(i):"Object"===(s=r(i))&&n(i.callee)?"Arguments":s}},6969:(t,i,e)=>{var s=e(2777),n=e(757);t.exports=function(t){var i=s(t,"string");return n(i)?i:i+""}},6980:t=>{t.exports=function(t,i){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:i}}},7040:(t,i,e)=>{var s=e(4495);t.exports=s&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7055:(t,i,e)=>{var s=e(9504),n=e(9039),r=e(2195),o=Object,h=s("".split);t.exports=n((function(){return!o("z").propertyIsEnumerable(0)}))?function(t){return"String"===r(t)?h(t,""):o(t)}:o},7080:(t,i,e)=>{var s=e(4402).has;t.exports=function(t){return s(t),t}},7347:(t,i,e)=>{var s=e(3724),n=e(9565),r=e(8773),o=e(6980),h=e(5397),a=e(6969),c=e(9297),l=e(5917),u=Object.getOwnPropertyDescriptor;i.f=s?u:function(t,i){if(t=h(t),i=a(i),l)try{return u(t,i)}catch(t){}if(c(t,i))return o(!n(r.f,t,i),t[i])}},7394:(t,i,e)=>{var s=e(4576),n=e(6706),r=e(2195),o=s.ArrayBuffer,h=s.TypeError;t.exports=o&&n(o.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==r(t))throw new h("ArrayBuffer expected");return t.byteLength}},7416:(t,i,e)=>{var s=e(9039),n=e(8227),r=e(3724),o=e(6395),h=n("iterator");t.exports=!s((function(){var t=new URL("b?a=1&b=2&c=3","https://a"),i=t.searchParams,e=new URLSearchParams("a=1&a=2&b=3"),s="";return t.pathname="c%20d",i.forEach((function(t,e){i.delete("b"),s+=e+t})),e.delete("a",2),e.delete("b",void 0),o&&(!t.toJSON||!e.has("a",1)||e.has("a",2)||!e.has("a",void 0)||e.has("b"))||!i.size&&(o||!r)||!i.sort||"https://a/c%20d?a=1&c=3"!==t.href||"3"!==i.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!i[h]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==s||"x"!==new URL("https://x",void 0).host}))},7476:(t,i,e)=>{var s=e(2195),n=e(9504);t.exports=function(t){if("Function"===s(t))return n(t)}},7566:(t,i,e)=>{var s=e(6840),n=e(9504),r=e(655),o=e(2812),h=URLSearchParams,a=h.prototype,c=n(a.getAll),l=n(a.has),u=new h("a=1");!u.has("a",2)&&u.has("a",void 0)||s(a,"has",(function(t){var i=arguments.length,e=i<2?void 0:arguments[1];if(i&&void 0===e)return l(this,t);var s=c(this,t);o(i,1);for(var n=r(e),h=0;h<s.length;)if(s[h++]===n)return!0;return!1}),{enumerable:!0,unsafe:!0})},7629:(t,i,e)=>{var s=e(6395),n=e(4576),r=e(9433),o="__core-js_shared__",h=t.exports=n[o]||r(o,{});(h.versions||(h.versions=[])).push({version:"3.42.0",mode:s?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})},7642:(t,i,e)=>{var s=e(6518),n=e(3440);s({target:"Set",proto:!0,real:!0,forced:!e(4916)("difference",(function(t){return 0===t.size}))},{difference:n})},7657:(t,i,e)=>{var s,n,r,o=e(9039),h=e(4901),a=e(34),c=e(2360),l=e(2787),u=e(6840),d=e(8227),f=e(6395),p=d("iterator"),g=!1;[].keys&&("next"in(r=[].keys())?(n=l(l(r)))!==Object.prototype&&(s=n):g=!0),!a(s)||o((function(){var t={};return s[p].call(t)!==t}))?s={}:f&&(s=c(s)),h(s[p])||u(s,p,(function(){return this})),t.exports={IteratorPrototype:s,BUGGY_SAFARI_ITERATORS:g}},7680:(t,i,e)=>{var s=e(9504);t.exports=s([].slice)},7696:(t,i,e)=>{var s=e(1291),n=e(8014),r=RangeError;t.exports=function(t){if(void 0===t)return 0;var i=s(t),e=n(i);if(i!==e)throw new r("Wrong length or index");return e}},7740:(t,i,e)=>{var s=e(9297),n=e(5031),r=e(7347),o=e(4913);t.exports=function(t,i,e){for(var h=n(i),a=o.f,c=r.f,l=0;l<h.length;l++){var u=h[l];s(t,u)||e&&s(e,u)||a(t,u,c(i,u))}}},7750:(t,i,e)=>{var s=e(4117),n=TypeError;t.exports=function(t){if(s(t))throw new n("Can't call method on "+t);return t}},7751:(t,i,e)=>{var s=e(4576),n=e(4901);t.exports=function(t,i){return arguments.length<2?n(e=s[t])?e:void 0:s[t]&&s[t][i];var e}},7811:t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},7936:(t,i,e)=>{var s=e(6518),n=e(5636);n&&s({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return n(this,arguments.length?arguments[0]:void 0,!1)}})},8004:(t,i,e)=>{var s=e(6518),n=e(9039),r=e(8750);s({target:"Set",proto:!0,real:!0,forced:!e(4916)("intersection",(function(t){return 2===t.size&&t.has(1)&&t.has(2)}))||n((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:r})},8014:(t,i,e)=>{var s=e(1291),n=Math.min;t.exports=function(t){var i=s(t);return i>0?n(i,9007199254740991):0}},8100:(t,i,e)=>{var s=e(6518),n=e(5636);n&&s({target:"ArrayBuffer",proto:!0},{transfer:function(){return n(this,arguments.length?arguments[0]:void 0,!0)}})},8111:(t,i,e)=>{var s=e(6518),n=e(4576),r=e(679),o=e(8551),h=e(4901),a=e(2787),c=e(2106),l=e(4659),u=e(9039),d=e(9297),f=e(8227),p=e(7657).IteratorPrototype,g=e(3724),w=e(6395),m="constructor",A="Iterator",b=f("toStringTag"),v=TypeError,y=n[A],x=w||!h(y)||y.prototype!==p||!u((function(){y({})})),M=function(){if(r(this,p),a(this)===p)throw new v("Abstract class Iterator not directly constructable")},k=function(t,i){g?c(p,t,{configurable:!0,get:function(){return i},set:function(i){if(o(this),this===p)throw new v("You can't redefine this property");d(this,t)?this[t]=i:l(this,t,i)}}):p[t]=i};d(p,b)||k(b,A),!x&&d(p,m)&&p[m]!==Object||k(m,M),M.prototype=p,s({global:!0,constructor:!0,forced:x},{Iterator:M})},8227:(t,i,e)=>{var s=e(4576),n=e(5745),r=e(9297),o=e(3392),h=e(4495),a=e(7040),c=s.Symbol,l=n("wks"),u=a?c.for||c:c&&c.withoutSetter||o;t.exports=function(t){return r(l,t)||(l[t]=h&&r(c,t)?c[t]:u("Symbol."+t)),l[t]}},8235:(t,i,e)=>{var s=e(9504),n=e(9297),r=SyntaxError,o=parseInt,h=String.fromCharCode,a=s("".charAt),c=s("".slice),l=s(/./.exec),u={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},d=/^[\da-f]{4}$/i,f=/^[\u0000-\u001F]$/;t.exports=function(t,i){for(var e=!0,s="";i<t.length;){var p=a(t,i);if("\\"===p){var g=c(t,i,i+2);if(n(u,g))s+=u[g],i+=2;else{if("\\u"!==g)throw new r('Unknown escape sequence: "'+g+'"');var w=c(t,i+=2,i+4);if(!l(d,w))throw new r("Bad Unicode escape at: "+i);s+=h(o(w,16)),i+=4}}else{if('"'===p){e=!1,i++;break}if(l(f,p))throw new r("Bad control character in string literal at: "+i);s+=p,i++}}if(e)throw new r("Unterminated string at: "+i);return{value:s,end:i}}},8237:(t,i,e)=>{var s=e(6518),n=e(2652),r=e(9306),o=e(8551),h=e(1767),a=e(9539),c=e(4549),l=e(8745),u=e(9039),d=TypeError,f=u((function(){[].keys().reduce((function(){}),void 0)})),p=!f&&c("reduce",d);s({target:"Iterator",proto:!0,real:!0,forced:f||p},{reduce:function(t){o(this);try{r(t)}catch(t){a(this,"throw",t)}var i=arguments.length<2,e=i?void 0:arguments[1];if(p)return l(p,this,i?[t]:[t,e]);var s=h(this),c=0;if(n(s,(function(s){i?(i=!1,e=s):e=t(e,s,c),c++}),{IS_RECORD:!0}),i)throw new d("Reduce of empty iterator with no initial value");return e}})},8335:(t,i,e)=>{var s=e(6518),n=e(3724),r=e(4576),o=e(7751),h=e(9504),a=e(9565),c=e(4901),l=e(34),u=e(4376),d=e(9297),f=e(655),p=e(6198),g=e(4659),w=e(9039),m=e(8235),A=e(4495),b=r.JSON,v=r.Number,y=r.SyntaxError,x=b&&b.parse,M=o("Object","keys"),k=Object.getOwnPropertyDescriptor,E=h("".charAt),S=h("".slice),_=h(/./.exec),T=h([].push),C=/^\d$/,P=/^[1-9]$/,R=/^[\d-]$/,N=/^[\t\n\r ]$/,D=function(t,i,e,s){var n,r,o,h,c,f=t[i],g=s&&f===s.value,w=g&&"string"==typeof s.source?{source:s.source}:{};if(l(f)){var m=u(f),A=g?s.nodes:m?[]:{};if(m)for(n=A.length,o=p(f),h=0;h<o;h++)I(f,h,D(f,""+h,e,h<n?A[h]:void 0));else for(r=M(f),o=p(r),h=0;h<o;h++)I(f,c=r[h],D(f,c,e,d(A,c)?A[c]:void 0))}return a(e,t,i,f,w)},I=function(t,i,e){if(n){var s=k(t,i);if(s&&!s.configurable)return}void 0===e?delete t[i]:g(t,i,e)},F=function(t,i,e,s){this.value=t,this.end=i,this.source=e,this.nodes=s},O=function(t,i){this.source=t,this.index=i};O.prototype={fork:function(t){return new O(this.source,t)},parse:function(){var t=this.source,i=this.skip(N,this.index),e=this.fork(i),s=E(t,i);if(_(R,s))return e.number();switch(s){case"{":return e.object();case"[":return e.array();case'"':return e.string();case"t":return e.keyword(!0);case"f":return e.keyword(!1);case"n":return e.keyword(null)}throw new y('Unexpected character: "'+s+'" at: '+i)},node:function(t,i,e,s,n){return new F(i,s,t?null:S(this.source,e,s),n)},object:function(){for(var t=this.source,i=this.index+1,e=!1,s={},n={};i<t.length;){if(i=this.until(['"',"}"],i),"}"===E(t,i)&&!e){i++;break}var r=this.fork(i).string(),o=r.value;i=this.until([":"],i=r.end)+1,i=this.skip(N,i),r=this.fork(i).parse(),g(n,o,r),g(s,o,r.value),i=this.until([",","}"],r.end);var h=E(t,i);if(","===h)e=!0,i++;else if("}"===h){i++;break}}return this.node(1,s,this.index,i,n)},array:function(){for(var t=this.source,i=this.index+1,e=!1,s=[],n=[];i<t.length;){if(i=this.skip(N,i),"]"===E(t,i)&&!e){i++;break}var r=this.fork(i).parse();if(T(n,r),T(s,r.value),i=this.until([",","]"],r.end),","===E(t,i))e=!0,i++;else if("]"===E(t,i)){i++;break}}return this.node(1,s,this.index,i,n)},string:function(){var t=this.index,i=m(this.source,this.index+1);return this.node(0,i.value,t,i.end)},number:function(){var t=this.source,i=this.index,e=i;if("-"===E(t,e)&&e++,"0"===E(t,e))e++;else{if(!_(P,E(t,e)))throw new y("Failed to parse number at: "+e);e=this.skip(C,e+1)}if(!("."===E(t,e)&&(e=this.skip(C,e+1)),"e"!==E(t,e)&&"E"!==E(t,e)||(e++,"+"!==E(t,e)&&"-"!==E(t,e)||e++,e!==(e=this.skip(C,e)))))throw new y("Failed to parse number's exponent value at: "+e);return this.node(0,v(S(t,i,e)),i,e)},keyword:function(t){var i=""+t,e=this.index,s=e+i.length;if(S(this.source,e,s)!==i)throw new y("Failed to parse value at: "+e);return this.node(0,t,e,s)},skip:function(t,i){for(var e=this.source;i<e.length&&_(t,E(e,i));i++);return i},until:function(t,i){i=this.skip(N,i);for(var e=E(this.source,i),s=0;s<t.length;s++)if(t[s]===e)return i;throw new y('Unexpected character: "'+e+'" at: '+i)}};var $=w((function(){var t,i="9007199254740993";return x(i,(function(i,e,s){t=s.source})),t!==i})),L=A&&!w((function(){return 1/x("-0 \t")!=-1/0}));s({target:"JSON",stat:!0,forced:$},{parse:function(t,i){return L&&!c(i)?x(t):function(t,i){t=f(t);var e=new O(t,0),s=e.parse(),n=s.value,r=e.skip(N,s.end);if(r<t.length)throw new y('Unexpected extra character: "'+E(t,r)+'" after the parsed data at: '+r);return c(i)?D({"":n},"",i,s):n}(t,i)}})},8469:(t,i,e)=>{var s=e(9504),n=e(507),r=e(4402),o=r.Set,h=r.proto,a=s(h.forEach),c=s(h.keys),l=c(new o).next;t.exports=function(t,i,e){return e?n({iterator:c(t),next:l},i):a(t,i)}},8480:(t,i,e)=>{var s=e(1828),n=e(8727).concat("length","prototype");i.f=Object.getOwnPropertyNames||function(t){return s(t,n)}},8527:(t,i,e)=>{var s=e(7080),n=e(4402).has,r=e(5170),o=e(3789),h=e(507),a=e(9539);t.exports=function(t){var i=s(this),e=o(t);if(r(i)<e.size)return!1;var c=e.getIterator();return!1!==h(c,(function(t){if(!n(i,t))return a(c,"normal",!1)}))}},8551:(t,i,e)=>{var s=e(34),n=String,r=TypeError;t.exports=function(t){if(s(t))return t;throw new r(n(t)+" is not an object")}},8574:(t,i,e)=>{var s=e(9504),n=Error,r=s("".replace),o=String(new n("zxcasd").stack),h=/\n\s*at [^:]*:[^\n]*/,a=h.test(o);t.exports=function(t,i){if(a&&"string"==typeof t&&!n.prepareStackTrace)for(;i--;)t=r(t,h,"");return t}},8622:(t,i,e)=>{var s=e(4576),n=e(4901),r=s.WeakMap;t.exports=n(r)&&/native code/.test(String(r))},8646:(t,i,e)=>{var s=e(9565),n=e(8551),r=e(1767),o=e(851);t.exports=function(t,i){i&&"string"==typeof t||n(t);var e=o(t);return r(n(void 0!==e?s(e,t):t))}},8686:(t,i,e)=>{var s=e(3724),n=e(9039);t.exports=s&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8721:(t,i,e)=>{var s=e(3724),n=e(9504),r=e(2106),o=URLSearchParams.prototype,h=n(o.forEach);s&&!("size"in o)&&r(o,"size",{get:function(){var t=0;return h(this,(function(){t++})),t},configurable:!0,enumerable:!0})},8727:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8745:(t,i,e)=>{var s=e(616),n=Function.prototype,r=n.apply,o=n.call;t.exports="object"==typeof Reflect&&Reflect.apply||(s?o.bind(r):function(){return o.apply(r,arguments)})},8750:(t,i,e)=>{var s=e(7080),n=e(4402),r=e(5170),o=e(3789),h=e(8469),a=e(507),c=n.Set,l=n.add,u=n.has;t.exports=function(t){var i=s(this),e=o(t),n=new c;return r(i)>e.size?a(e.getIterator(),(function(t){u(i,t)&&l(n,t)})):h(i,(function(t){e.includes(t)&&l(n,t)})),n}},8773:(t,i)=>{var e={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,n=s&&!e.call({1:2},1);i.f=n?function(t){var i=s(this,t);return!!i&&i.enumerable}:e},8981:(t,i,e)=>{var s=e(7750),n=Object;t.exports=function(t){return n(s(t))}},9039:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},9143:(t,i,e)=>{var s=e(4576),n=e(9504),r=e(3972),o=e(3463),h=e(9297),a=e(2804),c=e(944),l=e(5169),u=a.c2i,d=a.c2iUrl,f=s.SyntaxError,p=s.TypeError,g=n("".charAt),w=function(t,i){for(var e=t.length;i<e;i++){var s=g(t,i);if(" "!==s&&"\t"!==s&&"\n"!==s&&"\f"!==s&&"\r"!==s)break}return i},m=function(t,i,e){var s=t.length;s<4&&(t+=2===s?"AA":"A");var n=(i[g(t,0)]<<18)+(i[g(t,1)]<<12)+(i[g(t,2)]<<6)+i[g(t,3)],r=[n>>16&255,n>>8&255,255&n];if(2===s){if(e&&0!==r[1])throw new f("Extra bits");return[r[0]]}if(3===s){if(e&&0!==r[2])throw new f("Extra bits");return[r[0],r[1]]}return r},A=function(t,i,e){for(var s=i.length,n=0;n<s;n++)t[e+n]=i[n];return e+s};t.exports=function(t,i,e,s){o(t),r(i);var n="base64"===c(i)?u:d,a=i?i.lastChunkHandling:void 0;if(void 0===a&&(a="loose"),"loose"!==a&&"strict"!==a&&"stop-before-partial"!==a)throw new p("Incorrect `lastChunkHandling` option");e&&l(e.buffer);var b=e||[],v=0,y=0,x="",M=0;if(s)for(;;){if((M=w(t,M))===t.length){if(x.length>0){if("stop-before-partial"===a)break;if("loose"!==a)throw new f("Missing padding");if(1===x.length)throw new f("Malformed padding: exactly one additional character");v=A(b,m(x,n,!1),v)}y=t.length;break}var k=g(t,M);if(++M,"="===k){if(x.length<2)throw new f("Padding is too early");if(M=w(t,M),2===x.length){if(M===t.length){if("stop-before-partial"===a)break;throw new f("Malformed padding: only one =")}"="===g(t,M)&&(++M,M=w(t,M))}if(M<t.length)throw new f("Unexpected character after padding");v=A(b,m(x,n,"strict"===a),v),y=t.length;break}if(!h(n,k))throw new f("Unexpected character");var E=s-v;if(1===E&&2===x.length||2===E&&3===x.length)break;if(4===(x+=k).length&&(v=A(b,m(x,n,!1),v),x="",y=M,v===s))break}return{bytes:b,read:y,written:v}}},9286:(t,i,e)=>{var s=e(4402),n=e(8469),r=s.Set,o=s.add;t.exports=function(t){var i=new r;return n(t,(function(t){o(i,t)})),i}},9297:(t,i,e)=>{var s=e(9504),n=e(8981),r=s({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,i){return r(n(t),i)}},9306:(t,i,e)=>{var s=e(4901),n=e(6823),r=TypeError;t.exports=function(t){if(s(t))return t;throw new r(n(t)+" is not a function")}},9314:(t,i,e)=>{var s=e(6518),n=e(9565),r=e(8551),o=e(1767),h=e(4149),a=e(9590),c=e(9539),l=e(9462),u=e(4549),d=e(6395),f=!d&&u("drop",RangeError),p=l((function(){for(var t,i=this.iterator,e=this.next;this.remaining;)if(this.remaining--,t=r(n(e,i)),this.done=!!t.done)return;if(t=r(n(e,i)),!(this.done=!!t.done))return t.value}));s({target:"Iterator",proto:!0,real:!0,forced:d||f},{drop:function(t){var i;r(this);try{i=a(h(+t))}catch(t){c(this,"throw",t)}return f?n(f,this,i):new p(o(this),{remaining:i})}})},9429:(t,i,e)=>{var s=e(4576),n=e(6193);t.exports=function(t){if(n){try{return s.process.getBuiltinModule(t)}catch(t){}try{return Function('return require("'+t+'")')()}catch(t){}}}},9432:(t,i,e)=>{var s=e(6518),n=e(4576),r=e(5370),o=e(9143),h=n.Uint8Array;h&&s({target:"Uint8Array",stat:!0},{fromBase64:function(t){var i=o(t,arguments.length>1?arguments[1]:void 0,null,9007199254740991);return r(h,i.bytes)}})},9433:(t,i,e)=>{var s=e(4576),n=Object.defineProperty;t.exports=function(t,i){try{n(s,t,{value:i,configurable:!0,writable:!0})}catch(e){s[t]=i}return i}},9462:(t,i,e)=>{var s=e(9565),n=e(2360),r=e(6699),o=e(6279),h=e(8227),a=e(1181),c=e(5966),l=e(7657).IteratorPrototype,u=e(2529),d=e(9539),f=h("toStringTag"),p="IteratorHelper",g="WrapForValidIterator",w=a.set,m=function(t){var i=a.getterFor(t?g:p);return o(n(l),{next:function(){var e=i(this);if(t)return e.nextHandler();if(e.done)return u(void 0,!0);try{var s=e.nextHandler();return e.returnHandlerResult?s:u(s,e.done)}catch(t){throw e.done=!0,t}},return:function(){var e=i(this),n=e.iterator;if(e.done=!0,t){var r=c(n,"return");return r?s(r,n):u(void 0,!0)}if(e.inner)try{d(e.inner.iterator,"normal")}catch(t){return d(n,"throw",t)}return n&&d(n,"normal"),u(void 0,!0)}})},A=m(!0),b=m(!1);r(b,f,"Iterator Helper"),t.exports=function(t,i,e){var s=function(s,n){n?(n.iterator=s.iterator,n.next=s.next):n=s,n.type=i?g:p,n.returnHandlerResult=!!e,n.nextHandler=t,n.counter=0,n.done=!1,w(this,n)};return s.prototype=i?A:b,s}},9504:(t,i,e)=>{var s=e(616),n=Function.prototype,r=n.call,o=s&&n.bind.bind(r,r);t.exports=s?o:function(t){return function(){return r.apply(t,arguments)}}},9519:(t,i,e)=>{var s,n,r=e(4576),o=e(2839),h=r.process,a=r.Deno,c=h&&h.versions||a&&a.version,l=c&&c.v8;l&&(n=(s=l.split("."))[0]>0&&s[0]<4?1:+(s[0]+s[1])),!n&&o&&(!(s=o.match(/Edge\/(\d+)/))||s[1]>=74)&&(s=o.match(/Chrome\/(\d+)/))&&(n=+s[1]),t.exports=n},9539:(t,i,e)=>{var s=e(9565),n=e(8551),r=e(5966);t.exports=function(t,i,e){var o,h;n(t);try{if(!(o=r(t,"return"))){if("throw"===i)throw e;return e}o=s(o,t)}catch(t){h=!0,o=t}if("throw"===i)throw e;if(h)throw o;return n(o),e}},9565:(t,i,e)=>{var s=e(616),n=Function.prototype.call;t.exports=s?n.bind(n):function(){return n.apply(n,arguments)}},9590:(t,i,e)=>{var s=e(1291),n=RangeError;t.exports=function(t){var i=s(t);if(i<0)throw new n("The argument can't be less than 0");return i}},9617:(t,i,e)=>{var s=e(5397),n=e(5610),r=e(6198),o=function(t){return function(i,e,o){var h=s(i),a=r(h);if(0===a)return!t&&-1;var c,l=n(o,a);if(t&&e!=e){for(;a>l;)if((c=h[l++])!=c)return!0}else for(;a>l;l++)if((t||l in h)&&h[l]===e)return t||l||0;return!t&&-1}};t.exports={includes:o(!0),indexOf:o(!1)}},9631:(t,i,e)=>{var s=e(6518),n=e(4576),r=e(9504),o=e(3972),h=e(4154),a=e(5169),c=e(2804),l=e(944),u=c.i2c,d=c.i2cUrl,f=r("".charAt);n.Uint8Array&&s({target:"Uint8Array",proto:!0},{toBase64:function(){var t=h(this),i=arguments.length?o(arguments[0]):void 0,e="base64"===l(i)?u:d,s=!!i&&!!i.omitPadding;a(this.buffer);for(var n,r="",c=0,p=t.length,g=function(t){return f(e,n>>6*t&63)};c+2<p;c+=3)n=(t[c]<<16)+(t[c+1]<<8)+t[c+2],r+=g(3)+g(2)+g(1)+g(0);return c+2===p?(n=(t[c]<<16)+(t[c+1]<<8),r+=g(3)+g(2)+g(1)+(s?"":"=")):c+1===p&&(n=t[c]<<16,r+=g(3)+g(2)+(s?"":"==")),r}})},9797:(t,i,e)=>{var s=e(6518),n=e(4576),r=e(3463),o=e(4154),h=e(5169),a=e(2303);n.Uint8Array&&s({target:"Uint8Array",proto:!0},{setFromHex:function(t){o(this),r(t),h(this.buffer);var i=a(t,this).read;return{read:i,written:i/2}}})}},v={};function y(t){var i=v[t];if(void 0!==i)return i.exports;var e=v[t]={exports:{}};return b[t].call(e.exports,e,e.exports,y),e.exports}y(4114),y(6573),y(8100),y(7936),y(8111),y(8237),y(1689),y(9432),y(1549),y(9797),y(9631),y(5623),y(4979),y(5781);const x=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),M=[.001,0,0,.001,0,0],k=1.35,E={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},S={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101},_={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35,DRAW_STEP:41},T={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},C={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},P={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},R={ERRORS:0,WARNINGS:1,INFOS:5},N={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},D={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let I=R.WARNINGS;function F(t){Number.isInteger(t)&&(I=t)}function O(){return I}function $(t){I>=R.INFOS&&console.log(`Info: ${t}`)}function L(t){I>=R.WARNINGS&&console.log(`Warning: ${t}`)}function B(t){throw new Error(t)}function j(t,i){t||B(i)}function U(t,i=null,e=null){if(!t)return null;if(e&&"string"==typeof t){if(e.addDefaultProtocol&&t.startsWith("www.")){const i=t.match(/\./g);i?.length>=2&&(t=`http://${t}`)}if(e.tryConvertEncoding)try{t=decodeURIComponent(escape(t))}catch{}}const s=i?URL.parse(t,i):URL.parse(t);return function(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(s)?s:null}function z(t,i,e=!1){const s=URL.parse(t);return s?(s.hash=i,s.href):e&&U(t,"http://example.com")?t.split("#",1)[0]+""+(i?`#${i}`:""):""}function H(t,i,e,s=!1){return Object.defineProperty(t,i,{value:e,enumerable:!s,configurable:!0,writable:!1}),e}const G=function(){function t(t,i){this.message=t,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class W extends G{constructor(t,i){super(t,"PasswordException"),this.code=i}}class V extends G{constructor(t,i){super(t,"UnknownErrorException"),this.details=i}}class X extends G{constructor(t){super(t,"InvalidPDFException")}}class Y extends G{constructor(t,i,e){super(t,"ResponseException"),this.status=i,this.missing=e}}class Q extends G{constructor(t){super(t,"FormatError")}}class q extends G{constructor(t){super(t,"AbortException")}}function K(t){"object"==typeof t&&void 0!==t?.length||B("Invalid argument for bytesToString");const i=t.length,e=8192;if(i<e)return String.fromCharCode.apply(null,t);const s=[];for(let n=0;n<i;n+=e){const r=Math.min(n+e,i),o=t.subarray(n,r);s.push(String.fromCharCode.apply(null,o))}return s.join("")}function J(t){"string"!=typeof t&&B("Invalid argument for stringToBytes");const i=t.length,e=new Uint8Array(i);for(let s=0;s<i;++s)e[s]=255&t.charCodeAt(s);return e}class Z{static get isLittleEndian(){return H(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return H(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return H(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get isImageDecoderSupported(){return H(this,"isImageDecoderSupported","undefined"!=typeof ImageDecoder)}static get platform(){const{platform:t,userAgent:i}=navigator;return H(this,"platform",{isAndroid:i.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:i.includes("Firefox")})}static get isCSSRoundSupported(){return H(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const tt=Array.from(Array(256).keys(),(t=>t.toString(16).padStart(2,"0")));class it{static makeHexColor(t,i,e){return`#${tt[t]}${tt[i]}${tt[e]}`}static scaleMinMax(t,i){let e;t[0]?(t[0]<0&&(e=i[0],i[0]=i[2],i[2]=e),i[0]*=t[0],i[2]*=t[0],t[3]<0&&(e=i[1],i[1]=i[3],i[3]=e),i[1]*=t[3],i[3]*=t[3]):(e=i[0],i[0]=i[1],i[1]=e,e=i[2],i[2]=i[3],i[3]=e,t[1]<0&&(e=i[1],i[1]=i[3],i[3]=e),i[1]*=t[1],i[3]*=t[1],t[2]<0&&(e=i[0],i[0]=i[2],i[2]=e),i[0]*=t[2],i[2]*=t[2]),i[0]+=t[4],i[1]+=t[5],i[2]+=t[4],i[3]+=t[5]}static transform(t,i){return[t[0]*i[0]+t[2]*i[1],t[1]*i[0]+t[3]*i[1],t[0]*i[2]+t[2]*i[3],t[1]*i[2]+t[3]*i[3],t[0]*i[4]+t[2]*i[5]+t[4],t[1]*i[4]+t[3]*i[5]+t[5]]}static applyTransform(t,i,e=0){const s=t[e],n=t[e+1];t[e]=s*i[0]+n*i[2]+i[4],t[e+1]=s*i[1]+n*i[3]+i[5]}static applyTransformToBezier(t,i,e=0){const s=i[0],n=i[1],r=i[2],o=i[3],h=i[4],a=i[5];for(let i=0;i<6;i+=2){const c=t[e+i],l=t[e+i+1];t[e+i]=c*s+l*r+h,t[e+i+1]=c*n+l*o+a}}static applyInverseTransform(t,i){const e=t[0],s=t[1],n=i[0]*i[3]-i[1]*i[2];t[0]=(e*i[3]-s*i[2]+i[2]*i[5]-i[4]*i[3])/n,t[1]=(-e*i[1]+s*i[0]+i[4]*i[1]-i[5]*i[0])/n}static axialAlignedBoundingBox(t,i,e){const s=i[0],n=i[1],r=i[2],o=i[3],h=i[4],a=i[5],c=t[0],l=t[1],u=t[2],d=t[3];let f=s*c+h,p=f,g=s*u+h,w=g,m=o*l+a,A=m,b=o*d+a,v=b;if(0!==n||0!==r){const t=n*c,i=n*u,e=r*l,s=r*d;f+=e,w+=e,g+=s,p+=s,m+=t,v+=t,b+=i,A+=i}e[0]=Math.min(e[0],f,g,p,w),e[1]=Math.min(e[1],m,b,A,v),e[2]=Math.max(e[2],f,g,p,w),e[3]=Math.max(e[3],m,b,A,v)}static inverseTransform(t){const i=t[0]*t[3]-t[1]*t[2];return[t[3]/i,-t[1]/i,-t[2]/i,t[0]/i,(t[2]*t[5]-t[4]*t[3])/i,(t[4]*t[1]-t[5]*t[0])/i]}static singularValueDecompose2dScale(t,i){const e=t[0],s=t[1],n=t[2],r=t[3],o=e**2+s**2,h=n**2+r**2,a=(o+h)/2,c=Math.sqrt(a**2-(o*h-(e*n+s*r)**2));i[0]=Math.sqrt(a+c||1),i[1]=Math.sqrt(a-c||1)}static normalizeRect(t){const i=t.slice(0);return t[0]>t[2]&&(i[0]=t[2],i[2]=t[0]),t[1]>t[3]&&(i[1]=t[3],i[3]=t[1]),i}static intersect(t,i){const e=Math.max(Math.min(t[0],t[2]),Math.min(i[0],i[2])),s=Math.min(Math.max(t[0],t[2]),Math.max(i[0],i[2]));if(e>s)return null;const n=Math.max(Math.min(t[1],t[3]),Math.min(i[1],i[3])),r=Math.min(Math.max(t[1],t[3]),Math.max(i[1],i[3]));return n>r?null:[e,n,s,r]}static pointBoundingBox(t,i,e){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],i),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],i)}static rectBoundingBox(t,i,e,s,n){n[0]=Math.min(n[0],t,e),n[1]=Math.min(n[1],i,s),n[2]=Math.max(n[2],t,e),n[3]=Math.max(n[3],i,s)}static#t(t,i,e,s,n,r,o,h,a,c){if(a<=0||a>=1)return;const l=1-a,u=a*a,d=u*a,f=l*(l*(l*t+3*a*i)+3*u*e)+d*s,p=l*(l*(l*n+3*a*r)+3*u*o)+d*h;c[0]=Math.min(c[0],f),c[1]=Math.min(c[1],p),c[2]=Math.max(c[2],f),c[3]=Math.max(c[3],p)}static#i(t,i,e,s,n,r,o,h,a,c,l,u){if(Math.abs(a)<1e-12)return void(Math.abs(c)>=1e-12&&this.#t(t,i,e,s,n,r,o,h,-l/c,u));const d=c**2-4*l*a;if(d<0)return;const f=Math.sqrt(d),p=2*a;this.#t(t,i,e,s,n,r,o,h,(-c+f)/p,u),this.#t(t,i,e,s,n,r,o,h,(-c-f)/p,u)}static bezierBoundingBox(t,i,e,s,n,r,o,h,a){a[0]=Math.min(a[0],t,o),a[1]=Math.min(a[1],i,h),a[2]=Math.max(a[2],t,o),a[3]=Math.max(a[3],i,h),this.#i(t,e,n,o,i,s,r,h,3*(3*(e-n)-t+o),6*(t-2*e+n),3*(e-t),a),this.#i(t,e,n,o,i,s,r,h,3*(3*(s-r)-i+h),6*(i-2*s+r),3*(s-i),a)}}let et=null,st=null;function nt(t){return et||(et=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,st=new Map([["ſt","ſt"]])),t.replaceAll(et,((t,i,e)=>i?i.normalize("NFKC"):st.get(e)))}function rt(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);return crypto.getRandomValues(t),K(t)}const ot="pdfjs_internal_id_";function ht(t,i,e){return Math.min(Math.max(t,i),e)}function at(t){return Uint8Array.prototype.toBase64?t.toBase64():btoa(K(t))}"function"!=typeof Math.sumPrecise&&(Math.sumPrecise=function(t){return t.reduce(((t,i)=>t+i),0)}),"function"!=typeof AbortSignal.any&&(AbortSignal.any=function(t){const i=new AbortController,{signal:e}=i;for(const s of t)if(s.aborted)return i.abort(s.reason),e;for(const s of t)s.addEventListener("abort",(()=>{i.abort(s.reason)}),{signal:e});return e}),y(1701),y(4628),y(7642),y(8004),y(3853),y(5876),y(2475),y(5024),y(1698),y(4603),y(7566),y(8721),y(9314),y(1148),y(3579),y(8335);const ct="http://www.w3.org/2000/svg";class lt{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function ut(t,i="text"){if(bt(t,document.baseURI)){const e=await fetch(t);if(!e.ok)throw new Error(e.statusText);switch(i){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"json":return e.json()}return e.text()}return new Promise(((e,s)=>{const n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType=i,n.onreadystatechange=()=>{if(n.readyState===XMLHttpRequest.DONE)if(200!==n.status&&0!==n.status)s(new Error(n.statusText));else{switch(i){case"arraybuffer":case"blob":case"json":return void e(n.response)}e(n.responseText)}},n.send(null)}))}class dt{constructor({viewBox:t,userUnit:i,scale:e,rotation:s,offsetX:n=0,offsetY:r=0,dontFlip:o=!1}){this.viewBox=t,this.userUnit=i,this.scale=e,this.rotation=s,this.offsetX=n,this.offsetY=r,e*=i;const h=(t[2]+t[0])/2,a=(t[3]+t[1])/2;let c,l,u,d,f,p,g,w;switch((s%=360)<0&&(s+=360),s){case 180:c=-1,l=0,u=0,d=1;break;case 90:c=0,l=1,u=1,d=0;break;case 270:c=0,l=-1,u=-1,d=0;break;case 0:c=1,l=0,u=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(u=-u,d=-d),0===c?(f=Math.abs(a-t[1])*e+n,p=Math.abs(h-t[0])*e+r,g=(t[3]-t[1])*e,w=(t[2]-t[0])*e):(f=Math.abs(h-t[0])*e+n,p=Math.abs(a-t[1])*e+r,g=(t[2]-t[0])*e,w=(t[3]-t[1])*e),this.transform=[c*e,l*e,u*e,d*e,f-c*e*h-u*e*a,p-l*e*h-d*e*a],this.width=g,this.height=w}get rawDims(){const t=this.viewBox;return H(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:i=this.rotation,offsetX:e=this.offsetX,offsetY:s=this.offsetY,dontFlip:n=!1}={}){return new dt({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:i,offsetX:e,offsetY:s,dontFlip:n})}convertToViewportPoint(t,i){const e=[t,i];return it.applyTransform(e,this.transform),e}convertToViewportRectangle(t){const i=[t[0],t[1]];it.applyTransform(i,this.transform);const e=[t[2],t[3]];return it.applyTransform(e,this.transform),[i[0],i[1],e[0],e[1]]}convertToPdfPoint(t,i){const e=[t,i];return it.applyInverseTransform(e,this.transform),e}}class ft extends G{constructor(t,i=0){super(t,"RenderingCancelledException"),this.extraDelay=i}}function pt(t){const i=t.length;let e=0;for(;e<i&&""===t[e].trim();)e++;return"data:"===t.substring(e,e+5).toLowerCase()}function gt(t){return"string"==typeof t&&/\.pdf$/i.test(t)}function wt(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function mt(t,i="document.pdf"){if("string"!=typeof t)return i;if(pt(t))return L('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),i;const e=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,s=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let n=e.exec(s[1])||e.exec(s[2])||e.exec(s[3]);if(n&&(n=n[0],n.includes("%")))try{n=e.exec(decodeURIComponent(n))[0]}catch{}return n||i}class At{started=Object.create(null);times=[];time(t){t in this.started&&L(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||L(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let i=0;for(const{name:t}of this.times)i=Math.max(t.length,i);for(const{name:e,start:s,end:n}of this.times)t.push(`${e.padEnd(i)} ${n-s}ms\n`);return t.join("")}}function bt(t,i){const e=i?URL.parse(t,i):URL.parse(t);return"http:"===e?.protocol||"https:"===e?.protocol}function vt(t){t.preventDefault()}function yt(t){t.preventDefault(),t.stopPropagation()}class xt{static#e;static toDateObject(t){if(!t||"string"!=typeof t)return null;this.#e||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const i=this.#e.exec(t);if(!i)return null;const e=parseInt(i[1],10);let s=parseInt(i[2],10);s=s>=1&&s<=12?s-1:0;let n=parseInt(i[3],10);n=n>=1&&n<=31?n:1;let r=parseInt(i[4],10);r=r>=0&&r<=23?r:0;let o=parseInt(i[5],10);o=o>=0&&o<=59?o:0;let h=parseInt(i[6],10);h=h>=0&&h<=59?h:0;const a=i[7]||"Z";let c=parseInt(i[8],10);c=c>=0&&c<=23?c:0;let l=parseInt(i[9],10)||0;return l=l>=0&&l<=59?l:0,"-"===a?(r+=c,o+=l):"+"===a&&(r-=c,o-=l),new Date(Date.UTC(e,s,n,r,o,h))}}function Mt(t,{scale:i=1,rotation:e=0}){const{width:s,height:n}=t.attributes.style,r=[0,0,parseInt(s),parseInt(n)];return new dt({viewBox:r,userUnit:1,scale:i,rotation:e})}function kt(t){if(t.startsWith("#")){const i=parseInt(t.slice(1),16);return[(16711680&i)>>16,(65280&i)>>8,255&i]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map((t=>parseInt(t))):t.startsWith("rgba(")?t.slice(5,-1).split(",").map((t=>parseInt(t))).slice(0,3):(L(`Not a valid color format: "${t}"`),[0,0,0])}function Et(t){const{a:i,b:e,c:s,d:n,e:r,f:o}=t.getTransform();return[i,e,s,n,r,o]}function St(t){const{a:i,b:e,c:s,d:n,e:r,f:o}=t.getTransform().invertSelf();return[i,e,s,n,r,o]}function _t(t,i,e=!1,s=!0){if(i instanceof dt){const{pageWidth:s,pageHeight:n}=i.rawDims,{style:r}=t,o=Z.isCSSRoundSupported,h=`var(--total-scale-factor) * ${s}px`,a=`var(--total-scale-factor) * ${n}px`,c=o?`round(down, ${h}, var(--scale-round-x))`:`calc(${h})`,l=o?`round(down, ${a}, var(--scale-round-y))`:`calc(${a})`;e&&i.rotation%180!=0?(r.width=l,r.height=c):(r.width=c,r.height=l)}s&&t.setAttribute("data-main-rotation",i.rotation)}class Tt{constructor(){const{pixelRatio:t}=Tt;this.sx=t,this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}limitCanvas(t,i,e,s,n=-1){let r=1/0,o=1/0,h=1/0;(e=Tt.capPixels(e,n))>0&&(r=Math.sqrt(e/(t*i))),-1!==s&&(o=s/t,h=s/i);const a=Math.min(r,o,h);return(this.sx>a||this.sy>a)&&(this.sx=a,this.sy=a,!0)}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,i){if(i>=0){const e=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+i/100));return t>0?Math.min(t,e):e}return t}}const Ct=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class Pt{#s=null;#n=null;#r;#o=null;#h=null;#a=null;static#c=null;constructor(t){this.#r=t,Pt.#c||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const t=this.#s=document.createElement("div");t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const i=this.#r._uiManager._signal;t.addEventListener("contextmenu",vt,{signal:i}),t.addEventListener("pointerdown",Pt.#l,{signal:i});const e=this.#o=document.createElement("div");e.className="buttons",t.append(e);const s=this.#r.toolbarPosition;if(s){const{style:i}=t,e="ltr"===this.#r._uiManager.direction?1-s[0]:s[0];i.insetInlineEnd=100*e+"%",i.top=`calc(${100*s[1]}% + var(--editor-toolbar-vert-offset))`}return this.#u(),t}get div(){return this.#s}static#l(t){t.stopPropagation()}#d(t){this.#r._focusEventsAllowed=!1,yt(t)}#f(t){this.#r._focusEventsAllowed=!0,yt(t)}#p(t){const i=this.#r._uiManager._signal;t.addEventListener("focusin",this.#d.bind(this),{capture:!0,signal:i}),t.addEventListener("focusout",this.#f.bind(this),{capture:!0,signal:i}),t.addEventListener("contextmenu",vt,{signal:i})}hide(){this.#s.classList.add("hidden"),this.#n?.hideDropdown()}show(){this.#s.classList.remove("hidden"),this.#h?.shown()}#u(){const{editorType:t,_uiManager:i}=this.#r,e=document.createElement("button");e.className="delete",e.tabIndex=0,e.setAttribute("data-l10n-id",Pt.#c[t]),this.#p(e),e.addEventListener("click",(()=>{i.delete()}),{signal:i._signal}),this.#o.append(e)}get#g(){const t=document.createElement("div");return t.className="divider",t}async addAltText(t){const i=await t.render();this.#p(i),this.#o.prepend(i,this.#g),this.#h=t}addColorPicker(t){this.#n=t;const i=t.renderButton();this.#p(i),this.#o.prepend(i,this.#g)}async addEditSignatureButton(t){const i=this.#a=await t.renderEditButton(this.#r);this.#p(i),this.#o.prepend(i,this.#g)}updateEditSignatureButton(t){this.#a&&(this.#a.title=t)}remove(){this.#s.remove(),this.#n?.destroy(),this.#n=null}}class Rt{#o=null;#s=null;#w;constructor(t){this.#w=t}#m(){const t=this.#s=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",vt,{signal:this.#w._signal});const i=this.#o=document.createElement("div");return i.className="buttons",t.append(i),this.#A(),t}#b(t,i){let e=0,s=0;for(const n of t){const t=n.y+n.height;if(t<e)continue;const r=n.x+(i?n.width:0);t>e?(s=r,e=t):i?r>s&&(s=r):r<s&&(s=r)}return[i?1-s:s,e]}show(t,i,e){const[s,n]=this.#b(i,e),{style:r}=this.#s||=this.#m();t.append(this.#s),r.insetInlineEnd=100*s+"%",r.top=`calc(${100*n}% + var(--editor-toolbar-vert-offset))`}hide(){this.#s.remove()}#A(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const i=document.createElement("span");t.append(i),i.className="visuallyHidden",i.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const e=this.#w._signal;t.addEventListener("contextmenu",vt,{signal:e}),t.addEventListener("click",(()=>{this.#w.highlightSelection("floating_button")}),{signal:e}),this.#o.append(t)}}function Nt(t,i,e){for(const s of e)i.addEventListener(s,t[s].bind(t))}class Dt{#v=0;get id(){return"pdfjs_internal_editor_"+this.#v++}}class It{#y=rt();#v=0;#x=null;static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;return i.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',H(this,"_isSVGFittingCanvas",i.decode().then((()=>(t.drawImage(i,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]))))}async#M(t,i){this.#x||=new Map;let e=this.#x.get(t);if(null===e)return null;if(e?.bitmap)return e.refCounter+=1,e;try{let t;if(e||={bitmap:null,id:`image_${this.#y}_${this.#v++}`,refCounter:0,isSvg:!1},"string"==typeof i?(e.url=i,t=await ut(i,"blob")):i instanceof File?t=e.file=i:i instanceof Blob&&(t=i),"image/svg+xml"===t.type){const i=It._isSVGFittingCanvas,s=new FileReader,n=new Image,r=new Promise(((t,r)=>{n.onload=()=>{e.bitmap=n,e.isSvg=!0,t()},s.onload=async()=>{const t=e.svgUrl=s.result;n.src=await i?`${t}#svgView(preserveAspectRatio(none))`:t},n.onerror=s.onerror=r}));s.readAsDataURL(t),await r}else e.bitmap=await createImageBitmap(t);e.refCounter=1}catch(t){L(t),e=null}return this.#x.set(t,e),e&&this.#x.set(e.id,e),e}async getFromFile(t){const{lastModified:i,name:e,size:s,type:n}=t;return this.#M(`${i}_${e}_${s}_${n}`,t)}async getFromUrl(t){return this.#M(t,t)}async getFromBlob(t,i){const e=await i;return this.#M(t,e)}async getFromId(t){this.#x||=new Map;const i=this.#x.get(t);if(!i)return null;if(i.bitmap)return i.refCounter+=1,i;if(i.file)return this.getFromFile(i.file);if(i.blobPromise){const{blobPromise:t}=i;return delete i.blobPromise,this.getFromBlob(i.id,t)}return this.getFromUrl(i.url)}getFromCanvas(t,i){this.#x||=new Map;let e=this.#x.get(t);if(e?.bitmap)return e.refCounter+=1,e;const s=new OffscreenCanvas(i.width,i.height);return s.getContext("2d").drawImage(i,0,0),e={bitmap:s.transferToImageBitmap(),id:`image_${this.#y}_${this.#v++}`,refCounter:1,isSvg:!1},this.#x.set(t,e),this.#x.set(e.id,e),e}getSvgUrl(t){const i=this.#x.get(t);return i?.isSvg?i.svgUrl:null}deleteId(t){this.#x||=new Map;const i=this.#x.get(t);if(!i)return;if(i.refCounter-=1,0!==i.refCounter)return;const{bitmap:e}=i;if(!i.url&&!i.file){const t=new OffscreenCanvas(e.width,e.height);t.getContext("bitmaprenderer").transferFromImageBitmap(e),i.blobPromise=t.convertToBlob()}e.close?.(),i.bitmap=null}isValidId(t){return t.startsWith(`image_${this.#y}_`)}}class Ft{#k=[];#E=!1;#S;#_=-1;constructor(t=128){this.#S=t}add({cmd:t,undo:i,post:e,mustExec:s,type:n=NaN,overwriteIfSameType:r=!1,keepUndo:o=!1}){if(s&&t(),this.#E)return;const h={cmd:t,undo:i,post:e,type:n};if(-1===this.#_)return this.#k.length>0&&(this.#k.length=0),this.#_=0,void this.#k.push(h);if(r&&this.#k[this.#_].type===n)return o&&(h.undo=this.#k[this.#_].undo),void(this.#k[this.#_]=h);const a=this.#_+1;a===this.#S?this.#k.splice(0,1):(this.#_=a,a<this.#k.length&&this.#k.splice(a)),this.#k.push(h)}undo(){if(-1===this.#_)return;this.#E=!0;const{undo:t,post:i}=this.#k[this.#_];t(),i?.(),this.#E=!1,this.#_-=1}redo(){if(this.#_<this.#k.length-1){this.#_+=1,this.#E=!0;const{cmd:t,post:i}=this.#k[this.#_];t(),i?.(),this.#E=!1}}hasSomethingToUndo(){return-1!==this.#_}hasSomethingToRedo(){return this.#_<this.#k.length-1}cleanType(t){if(-1!==this.#_){for(let i=this.#_;i>=0;i--)if(this.#k[i].type!==t)return this.#k.splice(i+1,this.#_-i),void(this.#_=i);this.#k.length=0,this.#_=-1}}destroy(){this.#k=null}}class Ot{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:i}=Z.platform;for(const[e,s,n={}]of t)for(const t of e){const e=t.startsWith("mac+");i&&e?(this.callbacks.set(t.slice(4),{callback:s,options:n}),this.allKeys.add(t.split("+").at(-1))):i||e||(this.callbacks.set(t,{callback:s,options:n}),this.allKeys.add(t.split("+").at(-1)))}}#T(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const i=this.buffer.join("+");return this.buffer.length=0,i}exec(t,i){if(!this.allKeys.has(i.key))return;const e=this.callbacks.get(this.#T(i));if(!e)return;const{callback:s,options:{bubbles:n=!1,args:r=[],checker:o=null}}=e;o&&!o(t,i)||(s.bind(t,...r,i)(),n||yt(i))}}class $t{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const i=document.createElement("span");i.style.visibility="hidden",i.style.colorScheme="only light",document.body.append(i);for(const e of t.keys()){i.style.color=e;const s=window.getComputedStyle(i).color;t.set(e,kt(s))}i.remove()}(t),H(this,"_colors",t)}convert(t){const i=kt(t);if(!window.matchMedia("(forced-colors: active)").matches)return i;for(const[t,e]of this._colors)if(e.every(((t,e)=>t===i[e])))return $t._colorsMapping.get(t);return i}getHexCode(t){const i=this._colors.get(t);return i?it.makeHexColor(...i):t}}class Lt{#C=new AbortController;#P=null;#R=new Map;#N=new Map;#D=null;#I=null;#F=null;#O=new Ft;#$=null;#L=null;#B=0;#j=new Set;#U=null;#z=null;#H=new Set;_editorUndoBar=null;#G=!1;#W=!1;#V=!1;#X=null;#Y=null;#Q=null;#q=null;#K=!1;#J=null;#Z=new Dt;#tt=!1;#it=!1;#et=null;#st=null;#nt=null;#rt=null;#ot=null;#ht=S.NONE;#at=new Set;#ct=null;#lt=null;#ut=null;#dt=null;#ft={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#pt=[0,0];#gt=null;#wt=null;#mt=null;#At=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=Lt.prototype,i=t=>t.#wt.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),e=(t,{target:i})=>{if(i instanceof HTMLInputElement){const{type:t}=i;return"text"!==t&&"number"!==t}return!0},s=this.TRANSLATE_SMALL,n=this.TRANSLATE_BIG;return H(this,"_keyboardManager",new Ot([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:e}],[["ctrl+z","mac+meta+z"],t.undo,{checker:e}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:e}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:e}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(t,{target:i})=>!(i instanceof HTMLButtonElement)&&t.#wt.contains(i)&&!t.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,{target:i})=>!(i instanceof HTMLButtonElement)&&t.#wt.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:i}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:i}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:i}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:i}]]))}constructor(t,i,e,s,n,r,o,h,a,c,l,u,d,f){const p=this._signal=this.#C.signal;this.#wt=t,this.#mt=i,this.#D=e,this.#lt=s,this._eventBus=n,n._on("editingaction",this.onEditingAction.bind(this),{signal:p}),n._on("pagechanging",this.onPageChanging.bind(this),{signal:p}),n._on("scalechanging",this.onScaleChanging.bind(this),{signal:p}),n._on("rotationchanging",this.onRotationChanging.bind(this),{signal:p}),n._on("setpreference",this.onSetPreference.bind(this),{signal:p}),n._on("switchannotationeditorparams",(t=>this.updateParams(t.type,t.value)),{signal:p}),this.#bt(),this.#vt(),this.#yt(),this.#I=r.annotationStorage,this.#X=r.filterFactory,this.#ut=o,this.#q=h||null,this.#G=a,this.#W=c,this.#V=l,this.#ot=u||null,this.viewParameters={realScale:lt.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=d||null,this._supportsPinchToZoom=!1!==f}destroy(){this.#At?.resolve(),this.#At=null,this.#C?.abort(),this.#C=null,this._signal=null;for(const t of this.#N.values())t.destroy();this.#N.clear(),this.#R.clear(),this.#H.clear(),this.#rt?.clear(),this.#P=null,this.#at.clear(),this.#O.destroy(),this.#D?.destroy(),this.#lt?.destroy(),this.#J?.hide(),this.#J=null,this.#nt?.destroy(),this.#nt=null,this.#Y&&(clearTimeout(this.#Y),this.#Y=null),this.#gt&&(clearTimeout(this.#gt),this.#gt=null),this._editorUndoBar?.destroy()}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#ot}get useNewAltTextFlow(){return this.#W}get useNewAltTextWhenAddingImage(){return this.#V}get hcmFilter(){return H(this,"hcmFilter",this.#ut?this.#X.addHCMFilter(this.#ut.foreground,this.#ut.background):"none")}get direction(){return H(this,"direction",getComputedStyle(this.#wt).direction)}get highlightColors(){return H(this,"highlightColors",this.#q?new Map(this.#q.split(",").map((t=>t.split("=").map((t=>t.trim()))))):null)}get highlightColorNames(){return H(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,(t=>t.reverse()))):null)}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#L=t}setMainHighlightColorPicker(t){this.#nt=t}editAltText(t,i=!1){this.#D?.editAltText(this,t,i)}getSignature(t){this.#lt?.getSignature({uiManager:this,editor:t})}get signatureManager(){return this.#lt}switchToMode(t,i){this._eventBus.on("annotationeditormodechanged",i,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,i){this._eventBus.dispatch("setpreference",{source:this,name:t,value:i})}onSetPreference({name:t,value:i}){"enableNewAltTextWhenAddingImage"===t&&(this.#V=i)}onPageChanging({pageNumber:t}){this.#B=t-1}focusMainContainer(){this.#wt.focus()}findParent(t,i){for(const e of this.#N.values()){const{x:s,y:n,width:r,height:o}=e.div.getBoundingClientRect();if(t>=s&&t<=s+r&&i>=n&&i<=n+o)return e}return null}disableUserSelect(t=!1){this.#mt.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#H.add(t)}removeShouldRescale(t){this.#H.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*lt.PDF_TO_CSS_UNITS;for(const t of this.#H)t.onScaleChanging();this.#L?.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#xt({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}#Mt(t){const{currentLayer:i}=this;if(i.hasTextLayer(t))return i;for(const i of this.#N.values())if(i.hasTextLayer(t))return i;return null}highlightSelection(t=""){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:e,anchorOffset:s,focusNode:n,focusOffset:r}=i,o=i.toString(),h=this.#xt(i).closest(".textLayer"),a=this.getSelectionBoxes(h);if(!a)return;i.empty();const c=this.#Mt(h),l=this.#ht===S.NONE,u=()=>{c?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:a,anchorNode:e,anchorOffset:s,focusNode:n,focusOffset:r,text:o}),l&&this.showAllEditors("highlight",!0,!0)};l?this.switchToMode(S.HIGHLIGHT,u):u()}#kt(){const t=document.getSelection();if(!t||t.isCollapsed)return;const i=this.#xt(t).closest(".textLayer"),e=this.getSelectionBoxes(i);e&&(this.#J||=new Rt(this),this.#J.show(i,e,"ltr"===this.direction))}addToAnnotationStorage(t){t.isEmpty()||!this.#I||this.#I.has(t.id)||this.#I.setValue(t.id,t)}#Et(){const t=document.getSelection();if(!t||t.isCollapsed)return void(this.#ct&&(this.#J?.hide(),this.#ct=null,this.#St({hasSelectedText:!1})));const{anchorNode:i}=t;if(i===this.#ct)return;const e=this.#xt(t).closest(".textLayer");if(e){if(this.#J?.hide(),this.#ct=i,this.#St({hasSelectedText:!0}),(this.#ht===S.HIGHLIGHT||this.#ht===S.NONE)&&(this.#ht===S.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#K=this.isShiftKeyDown,!this.isShiftKeyDown)){const t=this.#ht===S.HIGHLIGHT?this.#Mt(e):null;t?.toggleDrawing();const i=new AbortController,s=this.combinedSignal(i),n=e=>{"pointerup"===e.type&&0!==e.button||(i.abort(),t?.toggleDrawing(!0),"pointerup"===e.type&&this.#_t("main_toolbar"))};window.addEventListener("pointerup",n,{signal:s}),window.addEventListener("blur",n,{signal:s})}}else this.#ct&&(this.#J?.hide(),this.#ct=null,this.#St({hasSelectedText:!1}))}#_t(t=""){this.#ht===S.HIGHLIGHT?this.highlightSelection(t):this.#G&&this.#kt()}#bt(){document.addEventListener("selectionchange",this.#Et.bind(this),{signal:this._signal})}#Tt(){if(this.#Q)return;this.#Q=new AbortController;const t=this.combinedSignal(this.#Q);window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}#Ct(){this.#Q?.abort(),this.#Q=null}blur(){if(this.isShiftKeyDown=!1,this.#K&&(this.#K=!1,this.#_t("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const i of this.#at)if(i.div.contains(t)){this.#st=[i,t],i._focusEventsAllowed=!1;break}}focus(){if(!this.#st)return;const[t,i]=this.#st;this.#st=null,i.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:this._signal}),i.focus()}#yt(){if(this.#et)return;this.#et=new AbortController;const t=this.combinedSignal(this.#et);window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#Pt(){this.#et?.abort(),this.#et=null}#Rt(){if(this.#$)return;this.#$=new AbortController;const t=this.combinedSignal(this.#$);document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}#Nt(){this.#$?.abort(),this.#$=null}#vt(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#yt(),this.#Rt()}removeEditListeners(){this.#Pt(),this.#Nt()}dragOver(t){for(const{type:i}of t.dataTransfer.items)for(const e of this.#z)if(e.isHandlingMimeForPasting(i))return t.dataTransfer.dropEffect="copy",void t.preventDefault()}drop(t){for(const i of t.dataTransfer.items)for(const e of this.#z)if(e.isHandlingMimeForPasting(i.type))return e.paste(i,this.currentLayer),void t.preventDefault()}copy(t){if(t.preventDefault(),this.#P?.commitOrRemove(),!this.hasSelection)return;const i=[];for(const t of this.#at){const e=t.serialize(!0);e&&i.push(e)}0!==i.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:i}=t;for(const t of i.items)for(const i of this.#z)if(i.isHandlingMimeForPasting(t.type))return void i.paste(t,this.currentLayer);let e=i.getData("application/pdfjs");if(!e)return;try{e=JSON.parse(e)}catch(t){return void L(`paste: "${t.message}".`)}if(!Array.isArray(e))return;this.unselectAll();const s=this.currentLayer;try{const t=[];for(const i of e){const e=await s.deserialize(i);if(!e)return;t.push(e)}this.addCommands({cmd:()=>{for(const i of t)this.#Dt(i);this.#It(t)},undo:()=>{for(const i of t)i.remove()},mustExec:!0})}catch(t){L(`paste: "${t.message}".`)}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),this.#ht===S.NONE||this.isEditorHandlingKeyboard||Lt._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,this.#K&&(this.#K=!1,this.#_t("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu")}}#St(t){Object.entries(t).some((([t,i])=>this.#ft[t]!==i))&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#ft,t)}),this.#ht===S.HIGHLIGHT&&!1===t.hasSelectedEditor&&this.#Ft([[_.HIGHLIGHT_FREE,!0]]))}#Ft(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#Tt(),this.#Rt(),this.#St({isEditing:this.#ht!==S.NONE,isEmpty:this.#Ot(),hasSomethingToUndo:this.#O.hasSomethingToUndo(),hasSomethingToRedo:this.#O.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#Ct(),this.#Nt(),this.#St({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#z){this.#z=t;for(const t of this.#z)this.#Ft(t.defaultPropertiesToUpdate)}}getId(){return this.#Z.id}get currentLayer(){return this.#N.get(this.#B)}getLayer(t){return this.#N.get(t)}get currentPageIndex(){return this.#B}addLayer(t){this.#N.set(t.pageIndex,t),this.#tt?t.enable():t.disable()}removeLayer(t){this.#N.delete(t.pageIndex)}async updateMode(t,i=null,e=!1){if(this.#ht!==t&&(!this.#At||(await this.#At.promise,this.#At))){if(this.#At=Promise.withResolvers(),this.#L?.commitOrRemove(),this.#ht=t,t===S.NONE)return this.setEditingState(!1),this.#$t(),this._editorUndoBar?.hide(),void this.#At.resolve();t===S.SIGNATURE&&await(this.#lt?.loadSignatures()),this.setEditingState(!0),await this.#Lt(),this.unselectAll();for(const i of this.#N.values())i.updateMode(t);if(!i)return e&&this.addNewEditorFromKeyboard(),void this.#At.resolve();for(const t of this.#R.values())t.annotationElementId===i||t.id===i?(this.setSelected(t),t.enterInEditMode()):t.unselect();this.#At.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==this.#ht&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,i){if(this.#z){switch(t){case _.CREATE:return void this.currentLayer.addNewEditor(i);case _.HIGHLIGHT_DEFAULT_COLOR:this.#nt?.updateColor(i);break;case _.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#dt||=new Map).set(t,i),this.showAllEditors("highlight",i)}for(const e of this.#at)e.updateParams(t,i);for(const e of this.#z)e.updateDefaultParams(t,i)}}showAllEditors(t,i,e=!1){for(const e of this.#R.values())e.editorType===t&&e.show(i);(this.#dt?.get(_.HIGHLIGHT_SHOW_ALL)??!0)!==i&&this.#Ft([[_.HIGHLIGHT_SHOW_ALL,i]])}enableWaiting(t=!1){if(this.#it!==t){this.#it=t;for(const i of this.#N.values())t?i.disableClick():i.enableClick(),i.div.classList.toggle("waiting",t)}}async#Lt(){if(!this.#tt){this.#tt=!0;const t=[];for(const i of this.#N.values())t.push(i.enable());await Promise.all(t);for(const t of this.#R.values())t.enable()}}#$t(){if(this.unselectAll(),this.#tt){this.#tt=!1;for(const t of this.#N.values())t.disable();for(const t of this.#R.values())t.disable()}}getEditors(t){const i=[];for(const e of this.#R.values())e.pageIndex===t&&i.push(e);return i}getEditor(t){return this.#R.get(t)}addEditor(t){this.#R.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#Y&&clearTimeout(this.#Y),this.#Y=setTimeout((()=>{this.focusMainContainer(),this.#Y=null}),0)),this.#R.delete(t.id),t.annotationElementId&&this.#rt?.delete(t.annotationElementId),this.unselect(t),t.annotationElementId&&this.#j.has(t.annotationElementId)||this.#I?.remove(t.id)}addDeletedAnnotationElement(t){this.#j.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#j.has(t)}removeDeletedAnnotationElement(t){this.#j.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#Dt(t){const i=this.#N.get(t.pageIndex);i?i.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#P!==t&&(this.#P=t,t&&this.#Ft(t.propertiesToUpdate))}get#Bt(){let t=null;for(t of this.#at);return t}updateUI(t){this.#Bt===t&&this.#Ft(t.propertiesToUpdate)}updateUIForDefaultProperties(t){this.#Ft(t.defaultPropertiesToUpdate)}toggleSelected(t){if(this.#at.has(t))return this.#at.delete(t),t.unselect(),void this.#St({hasSelectedEditor:this.hasSelection});this.#at.add(t),t.select(),this.#Ft(t.propertiesToUpdate),this.#St({hasSelectedEditor:!0})}setSelected(t){this.#L?.commitOrRemove();for(const i of this.#at)i!==t&&i.unselect();this.#at.clear(),this.#at.add(t),t.select(),this.#Ft(t.propertiesToUpdate),this.#St({hasSelectedEditor:!0})}isSelected(t){return this.#at.has(t)}get firstSelectedEditor(){return this.#at.values().next().value}unselect(t){t.unselect(),this.#at.delete(t),this.#St({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#at.size}get isEnterHandled(){return 1===this.#at.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#O.undo(),this.#St({hasSomethingToUndo:this.#O.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Ot()}),this._editorUndoBar?.hide()}redo(){this.#O.redo(),this.#St({hasSomethingToUndo:!0,hasSomethingToRedo:this.#O.hasSomethingToRedo(),isEmpty:this.#Ot()})}addCommands(t){this.#O.add(t),this.#St({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Ot()})}cleanUndoStack(t){this.#O.cleanType(t)}#Ot(){if(0===this.#R.size)return!0;if(1===this.#R.size)for(const t of this.#R.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();const t=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const i=t?[t]:[...this.#at],e=()=>{for(const t of i)this.#Dt(t)};this.addCommands({cmd:()=>{this._editorUndoBar?.show(e,1===i.length?i[0].editorType:i.length);for(const t of i)t.remove()},undo:e,mustExec:!0})}commitOrRemove(){this.#P?.commitOrRemove()}hasSomethingToControl(){return this.#P||this.hasSelection}#It(t){for(const t of this.#at)t.unselect();this.#at.clear();for(const i of t)i.isEmpty()||(this.#at.add(i),i.select());this.#St({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#at)t.commit();this.#It(this.#R.values())}unselectAll(){if((!this.#P||(this.#P.commitOrRemove(),this.#ht===S.NONE))&&!this.#L?.commitOrRemove()&&this.hasSelection){for(const t of this.#at)t.unselect();this.#at.clear(),this.#St({hasSelectedEditor:!1})}}translateSelectedEditors(t,i,e=!1){if(e||this.commitOrRemove(),!this.hasSelection)return;this.#pt[0]+=t,this.#pt[1]+=i;const[s,n]=this.#pt,r=[...this.#at];this.#gt&&clearTimeout(this.#gt),this.#gt=setTimeout((()=>{this.#gt=null,this.#pt[0]=this.#pt[1]=0,this.addCommands({cmd:()=>{for(const t of r)this.#R.has(t.id)&&(t.translateInPage(s,n),t.translationDone())},undo:()=>{for(const t of r)this.#R.has(t.id)&&(t.translateInPage(-s,-n),t.translationDone())},mustExec:!1})}),1e3);for(const e of r)e.translateInPage(t,i),e.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#U=new Map;for(const t of this.#at)this.#U.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#U)return!1;this.disableUserSelect(!1);const t=this.#U;this.#U=null;let i=!1;for(const[{x:e,y:s,pageIndex:n},r]of t)r.newX=e,r.newY=s,r.newPageIndex=n,i||=e!==r.savedX||s!==r.savedY||n!==r.savedPageIndex;if(!i)return!1;const e=(t,i,e,s)=>{if(this.#R.has(t.id)){const n=this.#N.get(s);n?t._setParentAndPosition(n,i,e):(t.pageIndex=s,t.x=i,t.y=e)}};return this.addCommands({cmd:()=>{for(const[i,{newX:s,newY:n,newPageIndex:r}]of t)e(i,s,n,r)},undo:()=>{for(const[i,{savedX:s,savedY:n,savedPageIndex:r}]of t)e(i,s,n,r)},mustExec:!0}),!0}dragSelectedEditors(t,i){if(this.#U)for(const e of this.#U.keys())e.drag(t,i)}rebuild(t){if(null===t.parent){const i=this.getLayer(t.pageIndex);i?(i.changeParent(t),i.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#at.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#P===t}getActive(){return this.#P}getMode(){return this.#ht}get imageManager(){return H(this,"imageManager",new It)}getSelectionBoxes(t){if(!t)return null;const i=document.getSelection();for(let e=0,s=i.rangeCount;e<s;e++)if(!t.contains(i.getRangeAt(e).commonAncestorContainer))return null;const{x:e,y:s,width:n,height:r}=t.getBoundingClientRect();let o;switch(t.getAttribute("data-main-rotation")){case"90":o=(t,i,o,h)=>({x:(i-s)/r,y:1-(t+o-e)/n,width:h/r,height:o/n});break;case"180":o=(t,i,o,h)=>({x:1-(t+o-e)/n,y:1-(i+h-s)/r,width:o/n,height:h/r});break;case"270":o=(t,i,o,h)=>({x:1-(i+h-s)/r,y:(t-e)/n,width:h/r,height:o/n});break;default:o=(t,i,o,h)=>({x:(t-e)/n,y:(i-s)/r,width:o/n,height:h/r})}const h=[];for(let t=0,e=i.rangeCount;t<e;t++){const e=i.getRangeAt(t);if(!e.collapsed)for(const{x:t,y:i,width:s,height:n}of e.getClientRects())0!==s&&0!==n&&h.push(o(t,i,s,n))}return 0===h.length?null:h}addChangedExistingAnnotation({annotationElementId:t,id:i}){(this.#F||=new Map).set(t,i)}removeChangedExistingAnnotation({annotationElementId:t}){this.#F?.delete(t)}renderAnnotationElement(t){const i=this.#F?.get(t.data.id);if(!i)return;const e=this.#I.getRawValue(i);e&&(this.#ht!==S.NONE||e.hasBeenModified)&&e.renderAnnotationElement(t)}setMissingCanvas(t,i,e){const s=this.#rt?.get(t);s&&(s.setCanvas(i,e),this.#rt.delete(t))}addMissingCanvas(t,i){(this.#rt||=new Map).set(t,i)}}class Bt{#h=null;#jt=!1;#Ut=null;#zt=null;#Ht=null;#Gt=null;#Wt=!1;#Vt=null;#r=null;#Xt=null;#Yt=null;#Qt=!1;static#qt=null;static _l10n=null;constructor(t){this.#r=t,this.#Qt=t._uiManager.useNewAltTextFlow,Bt.#qt||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(t){Bt._l10n??=t}async render(){const t=this.#Ut=document.createElement("button");t.className="altText",t.tabIndex="0";const i=this.#zt=document.createElement("span");t.append(i),this.#Qt?(t.classList.add("new"),t.setAttribute("data-l10n-id",Bt.#qt.missing),i.setAttribute("data-l10n-id",Bt.#qt["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const e=this.#r._uiManager._signal;t.addEventListener("contextmenu",vt,{signal:e}),t.addEventListener("pointerdown",(t=>t.stopPropagation()),{signal:e});const s=t=>{t.preventDefault(),this.#r._uiManager.editAltText(this.#r),this.#Qt&&this.#r._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#Kt}})};return t.addEventListener("click",s,{capture:!0,signal:e}),t.addEventListener("keydown",(i=>{i.target===t&&"Enter"===i.key&&(this.#Wt=!0,s(i))}),{signal:e}),await this.#Jt(),t}get#Kt(){return(this.#h?"added":null===this.#h&&this.guessedText&&"review")||"missing"}finish(){this.#Ut&&(this.#Ut.focus({focusVisible:this.#Wt}),this.#Wt=!1)}isEmpty(){return this.#Qt?null===this.#h:!this.#h&&!this.#jt}hasData(){return this.#Qt?null!==this.#h||!!this.#Xt:this.isEmpty()}get guessedText(){return this.#Xt}async setGuessedText(t){null===this.#h&&(this.#Xt=t,this.#Yt=await Bt._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t}),this.#Jt())}toggleAltTextBadge(t=!1){if(!this.#Qt||this.#h)return this.#Vt?.remove(),void(this.#Vt=null);if(!this.#Vt){const t=this.#Vt=document.createElement("div");t.className="noAltTextBadge",this.#r.div.append(t)}this.#Vt.classList.toggle("hidden",!t)}serialize(t){let i=this.#h;return t||this.#Xt!==i||(i=this.#Yt),{altText:i,decorative:this.#jt,guessedText:this.#Xt,textWithDisclaimer:this.#Yt}}get data(){return{altText:this.#h,decorative:this.#jt}}set data({altText:t,decorative:i,guessedText:e,textWithDisclaimer:s,cancel:n=!1}){e&&(this.#Xt=e,this.#Yt=s),this.#h===t&&this.#jt===i||(n||(this.#h=t,this.#jt=i),this.#Jt())}toggle(t=!1){this.#Ut&&(!t&&this.#Gt&&(clearTimeout(this.#Gt),this.#Gt=null),this.#Ut.disabled=!t)}shown(){this.#r._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#Kt}})}destroy(){this.#Ut?.remove(),this.#Ut=null,this.#zt=null,this.#Ht=null,this.#Vt?.remove(),this.#Vt=null}async#Jt(){const t=this.#Ut;if(!t)return;if(this.#Qt){if(t.classList.toggle("done",!!this.#h),t.setAttribute("data-l10n-id",Bt.#qt[this.#Kt]),this.#zt?.setAttribute("data-l10n-id",Bt.#qt[`${this.#Kt}-label`]),!this.#h)return void this.#Ht?.remove()}else{if(!this.#h&&!this.#jt)return t.classList.remove("done"),void this.#Ht?.remove();t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let i=this.#Ht;if(!i){this.#Ht=i=document.createElement("span"),i.className="tooltip",i.setAttribute("role","tooltip"),i.id=`alt-text-tooltip-${this.#r.id}`;const e=100,s=this.#r._uiManager._signal;s.addEventListener("abort",(()=>{clearTimeout(this.#Gt),this.#Gt=null}),{once:!0}),t.addEventListener("mouseenter",(()=>{this.#Gt=setTimeout((()=>{this.#Gt=null,this.#Ht.classList.add("show"),this.#r._reportTelemetry({action:"alt_text_tooltip"})}),e)}),{signal:s}),t.addEventListener("mouseleave",(()=>{this.#Gt&&(clearTimeout(this.#Gt),this.#Gt=null),this.#Ht?.classList.remove("show")}),{signal:s})}this.#jt?i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(i.removeAttribute("data-l10n-id"),i.textContent=this.#h),i.parentNode||t.append(i);const e=this.#r.getElementForAltText();e?.setAttribute("aria-describedby",i.id)}}class jt{#wt;#Zt=!1;#ti=null;#ii;#ei;#si;#ni;#ri=null;#oi;#hi=null;#ai;#ci=null;constructor({container:t,isPinchingDisabled:i=null,isPinchingStopped:e=null,onPinchStart:s=null,onPinching:n=null,onPinchEnd:r=null,signal:o}){this.#wt=t,this.#ti=e,this.#ii=i,this.#ei=s,this.#si=n,this.#ni=r,this.#ai=new AbortController,this.#oi=AbortSignal.any([o,this.#ai.signal]),t.addEventListener("touchstart",this.#li.bind(this),{passive:!1,signal:this.#oi})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Tt.pixelRatio}#li(t){if(this.#ii?.())return;if(1===t.touches.length){if(this.#ri)return;const t=this.#ri=new AbortController,i=AbortSignal.any([this.#oi,t.signal]),e=this.#wt,s={capture:!0,signal:i,passive:!1},n=t=>{"touch"===t.pointerType&&(this.#ri?.abort(),this.#ri=null)};return e.addEventListener("pointerdown",(t=>{"touch"===t.pointerType&&(yt(t),n(t))}),s),e.addEventListener("pointerup",n,s),void e.addEventListener("pointercancel",n,s)}if(!this.#ci){this.#ci=new AbortController;const t=AbortSignal.any([this.#oi,this.#ci.signal]),i=this.#wt,e={signal:t,capture:!1,passive:!1};i.addEventListener("touchmove",this.#ui.bind(this),e);const s=this.#di.bind(this);i.addEventListener("touchend",s,e),i.addEventListener("touchcancel",s,e),e.capture=!0,i.addEventListener("pointerdown",yt,e),i.addEventListener("pointermove",yt,e),i.addEventListener("pointercancel",yt,e),i.addEventListener("pointerup",yt,e),this.#ei?.()}if(yt(t),2!==t.touches.length||this.#ti?.())return void(this.#hi=null);let[i,e]=t.touches;i.identifier>e.identifier&&([i,e]=[e,i]),this.#hi={touch0X:i.screenX,touch0Y:i.screenY,touch1X:e.screenX,touch1Y:e.screenY}}#ui(t){if(!this.#hi||2!==t.touches.length)return;yt(t);let[i,e]=t.touches;i.identifier>e.identifier&&([i,e]=[e,i]);const{screenX:s,screenY:n}=i,{screenX:r,screenY:o}=e,h=this.#hi,{touch0X:a,touch0Y:c,touch1X:l,touch1Y:u}=h,d=l-a,f=u-c,p=Math.hypot(r-s,o-n)||1,g=Math.hypot(d,f)||1;if(!this.#Zt&&Math.abs(g-p)<=jt.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(h.touch0X=s,h.touch0Y=n,h.touch1X=r,h.touch1Y=o,!this.#Zt)return void(this.#Zt=!0);const w=[(s+r)/2,(n+o)/2];this.#si?.(w,g,p)}#di(t){t.touches.length>=2||(this.#ci&&(this.#ci.abort(),this.#ci=null,this.#ni?.()),this.#hi&&(yt(t),this.#hi=null,this.#Zt=!1))}destroy(){this.#ai?.abort(),this.#ai=null,this.#ri?.abort(),this.#ri=null}}class Ut{#fi=null;#pi=null;#h=null;#gi=!1;#wi=null;#mi="";#Ai=!1;#bi=null;#vi=null;#yi=null;#xi=null;#Mi="";#ki=!1;#Ei=null;#Si=!1;#_i=!1;#Ti=!1;#Ci=null;#Pi=0;#Ri=0;#Ni=null;#Di=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#Ii=!1;#Fi=Ut._zIndex++;static _borderLineWidth=-1;static _colorManager=new $t;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=Ut.prototype._resizeWithKeyboard,i=Lt.TRANSLATE_SMALL,e=Lt.TRANSLATE_BIG;return H(this,"_resizerKeyboardManager",new Ot([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-i,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-e,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[i,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[e,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-i]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-e]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,i]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,e]}],[["Escape","mac+Escape"],Ut.prototype._stopResizingWithKeyboard]]))}constructor(t){this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:i,rawDims:{pageWidth:e,pageHeight:s,pageX:n,pageY:r}}=this.parent.viewport;this.rotation=i,this.pageRotation=(360+i-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[e,s],this.pageTranslation=[n,r];const[o,h]=this.parentDimensions;this.x=t.x/o,this.y=t.y/h,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get isDrawer(){return!1}static get _defaultLineColor(){return H(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const i=new zt({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});i.annotationElementId=t.annotationElementId,i.deleted=!0,i._uiManager.addToAnnotationStorage(i)}static initialize(t,i){if(Ut._l10n??=t,Ut._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),-1!==Ut._borderLineWidth)return;const e=getComputedStyle(document.documentElement);Ut._borderLineWidth=parseFloat(e.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,i){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,i){B("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#Ii}set _isDraggable(t){this.#Ii=t,this.div?.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,i]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*i/(2*t),this.y+=this.width*t/(2*i);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*i/(2*t),this.y-=this.width*t/(2*i);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#Fi}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#Oi(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#ki?this.#ki=!1:this.parent.setSelected(this))}focusout(t){if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const i=t.relatedTarget;i?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,i,e,s){const[n,r]=this.parentDimensions;[e,s]=this.screenToPageTranslation(e,s),this.x=(t+e)/n,this.y=(i+s)/r,this.fixAndSetPosition()}_moveAfterPaste(t,i){const[e,s]=this.parentDimensions;this.setAt(t*e,i*s,this.width*e,this.height*s),this._onTranslated()}#$i([t,i],e,s){[e,s]=this.screenToPageTranslation(e,s),this.x+=e/t,this.y+=s/i,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(t,i){this.#$i(this.parentDimensions,t,i)}translateInPage(t,i){this.#Ei||=[this.x,this.y,this.width,this.height],this.#$i(this.pageDimensions,t,i),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,i){this.#Ei||=[this.x,this.y,this.width,this.height];const{div:e,parentDimensions:[s,n]}=this;if(this.x+=t/s,this.y+=i/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:i}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,i)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:r,y:o}=this;const[h,a]=this.getBaseTranslation();r+=h,o+=a;const{style:c}=e;c.left=`${(100*r).toFixed(2)}%`,c.top=`${(100*o).toFixed(2)}%`,this._onTranslating(r,o),e.scrollIntoView({block:"nearest"})}_onTranslating(t,i){}_onTranslated(t,i){}get _hasBeenMoved(){return!!this.#Ei&&(this.#Ei[0]!==this.x||this.#Ei[1]!==this.y)}get _hasBeenResized(){return!!this.#Ei&&(this.#Ei[2]!==this.width||this.#Ei[3]!==this.height)}getBaseTranslation(){const[t,i]=this.parentDimensions,{_borderLineWidth:e}=Ut,s=e/t,n=e/i;switch(this.rotation){case 90:return[-s,n];case 180:return[s,n];case 270:return[s,-n];default:return[-s,-n]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:i},pageDimensions:[e,s]}=this;let{x:n,y:r,width:o,height:h}=this;if(o*=e,h*=s,n*=e,r*=s,this._mustFixPosition)switch(t){case 0:n=ht(n,0,e-o),r=ht(r,0,s-h);break;case 90:n=ht(n,0,e-h),r=ht(r,o,s);break;case 180:n=ht(n,o,e),r=ht(r,h,s);break;case 270:n=ht(n,h,e),r=ht(r,0,s-o)}this.x=n/=e,this.y=r/=s;const[a,c]=this.getBaseTranslation();n+=a,r+=c,i.left=`${(100*n).toFixed(2)}%`,i.top=`${(100*r).toFixed(2)}%`,this.moveInDOM()}static#Li(t,i,e){switch(e){case 90:return[i,-t];case 180:return[-t,-i];case 270:return[-i,t];default:return[t,i]}}screenToPageTranslation(t,i){return Ut.#Li(t,i,this.parentRotation)}pageTranslationToScreen(t,i){return Ut.#Li(t,i,360-this.parentRotation)}#Bi(t){switch(t){case 90:{const[t,i]=this.pageDimensions;return[0,-t/i,i/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,i]=this.pageDimensions;return[0,t/i,-i/t,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[i,e]}=this;return[i*t,e*t]}setDims(t,i){const[e,s]=this.parentDimensions,{style:n}=this.div;n.width=`${(100*t/e).toFixed(2)}%`,this.#Ai||(n.height=`${(100*i/s).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:i,width:e}=t,s=e.endsWith("%"),n=!this.#Ai&&i.endsWith("%");if(s&&n)return;const[r,o]=this.parentDimensions;s||(t.width=`${(100*parseFloat(e)/r).toFixed(2)}%`),this.#Ai||n||(t.height=`${(100*parseFloat(i)/o).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#ji(){if(this.#bi)return;this.#bi=document.createElement("div"),this.#bi.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],i=this._uiManager._signal;for(const e of t){const t=document.createElement("div");this.#bi.append(t),t.classList.add("resizer",e),t.setAttribute("data-resizer-name",e),t.addEventListener("pointerdown",this.#Ui.bind(this,e),{signal:i}),t.addEventListener("contextmenu",vt,{signal:i}),t.tabIndex=-1}this.div.prepend(this.#bi)}#Ui(t,i){i.preventDefault();const{isMac:e}=Z.platform;if(0!==i.button||i.ctrlKey&&e)return;this.#h?.toggle(!1);const s=this._isDraggable;this._isDraggable=!1,this.#vi=[i.screenX,i.screenY];const n=new AbortController,r=this._uiManager.combinedSignal(n);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#zi.bind(this,t),{passive:!0,capture:!0,signal:r}),window.addEventListener("touchmove",yt,{passive:!1,signal:r}),window.addEventListener("contextmenu",vt,{signal:r}),this.#yi={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const o=this.parent.div.style.cursor,h=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(i.target).cursor;const a=()=>{n.abort(),this.parent.togglePointerEvents(!0),this.#h?.toggle(!0),this._isDraggable=s,this.parent.div.style.cursor=o,this.div.style.cursor=h,this.#Hi()};window.addEventListener("pointerup",a,{signal:r}),window.addEventListener("blur",a,{signal:r})}#Gi(t,i,e,s){this.width=e,this.height=s,this.x=t,this.y=i;const[n,r]=this.parentDimensions;this.setDims(n*e,r*s),this.fixAndSetPosition(),this._onResized()}_onResized(){}#Hi(){if(!this.#yi)return;const{savedX:t,savedY:i,savedWidth:e,savedHeight:s}=this.#yi;this.#yi=null;const n=this.x,r=this.y,o=this.width,h=this.height;n===t&&r===i&&o===e&&h===s||this.addCommands({cmd:this.#Gi.bind(this,n,r,o,h),undo:this.#Gi.bind(this,t,i,e,s),mustExec:!0})}static _round(t){return Math.round(1e4*t)/1e4}#zi(t,i){const[e,s]=this.parentDimensions,n=this.x,r=this.y,o=this.width,h=this.height,a=Ut.MIN_SIZE/e,c=Ut.MIN_SIZE/s,l=this.#Bi(this.rotation),u=(t,i)=>[l[0]*t+l[2]*i,l[1]*t+l[3]*i],d=this.#Bi(360-this.rotation);let f,p,g=!1,w=!1;switch(t){case"topLeft":g=!0,f=()=>[0,0],p=(t,i)=>[t,i];break;case"topMiddle":f=t=>[t/2,0],p=(t,i)=>[t/2,i];break;case"topRight":g=!0,f=t=>[t,0],p=(t,i)=>[0,i];break;case"middleRight":w=!0,f=(t,i)=>[t,i/2],p=(t,i)=>[0,i/2];break;case"bottomRight":g=!0,f=(t,i)=>[t,i],p=()=>[0,0];break;case"bottomMiddle":f=(t,i)=>[t/2,i],p=t=>[t/2,0];break;case"bottomLeft":g=!0,f=(t,i)=>[0,i],p=t=>[t,0];break;case"middleLeft":w=!0,f=(t,i)=>[0,i/2],p=(t,i)=>[t,i/2]}const m=f(o,h),A=p(o,h);let b=u(...A);const v=Ut._round(n+b[0]),y=Ut._round(r+b[1]);let x,M,k=1,E=1;if(i.fromKeyboard)({deltaX:x,deltaY:M}=i);else{const{screenX:t,screenY:e}=i,[s,n]=this.#vi;[x,M]=this.screenToPageTranslation(t-s,e-n),this.#vi[0]=t,this.#vi[1]=e}var S,_;if([x,M]=[d[0]*(S=x/e)+d[2]*(_=M/s),d[1]*S+d[3]*_],g){const t=Math.hypot(o,h);k=E=Math.max(Math.min(Math.hypot(A[0]-m[0]-x,A[1]-m[1]-M)/t,1/o,1/h),a/o,c/h)}else w?k=ht(Math.abs(A[0]-m[0]-x),a,1)/o:E=ht(Math.abs(A[1]-m[1]-M),c,1)/h;const T=Ut._round(o*k),C=Ut._round(h*E);b=u(...p(T,C));const P=v-b[0],R=y-b[1];this.#Ei||=[this.x,this.y,this.width,this.height],this.width=T,this.height=C,this.x=P,this.y=R,this.setDims(e*T,s*C),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#h?.finish()}async addEditToolbar(){return this._editToolbar||this.#_i||(this._editToolbar=new Pt(this),this.div.append(this._editToolbar.render()),this.#h&&await this._editToolbar.addAltText(this.#h)),this._editToolbar}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#h?.destroy())}addContainer(t){const i=this._editToolbar?.div;i?i.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#h||(Bt.initialize(Ut._l10n),this.#h=new Bt(this),this.#fi&&(this.#h.data=this.#fi,this.#fi=null),await this.addEditToolbar())}get altTextData(){return this.#h?.data}set altTextData(t){this.#h&&(this.#h.data=t)}get guessedAltText(){return this.#h?.guessedText}async setGuessedAltText(t){await(this.#h?.setGuessedText(t))}serializeAltText(t){return this.#h?.serialize(t)}hasAltText(){return!!this.#h&&!this.#h.isEmpty()}hasAltTextData(){return this.#h?.hasData()??!1}render(){const t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=this.#gi?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),this.#Wi();const[i,e]=this.parentDimensions;this.parentRotation%180!=0&&(t.style.maxWidth=`${(100*e/i).toFixed(2)}%`,t.style.maxHeight=`${(100*i/e).toFixed(2)}%`);const[s,n]=this.getInitialTranslation();return this.translate(s,n),Nt(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#Di||=new jt({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#Vi.bind(this),onPinching:this.#Xi.bind(this),onPinchEnd:this.#Yi.bind(this),signal:this._uiManager._signal})),this._uiManager._editorUndoBar?.hide(),t}#Vi(){this.#yi={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#h?.toggle(!1),this.parent.togglePointerEvents(!1)}#Xi(t,i,e){let s=e/i*.7+1-.7;if(1===s)return;const n=this.#Bi(this.rotation),r=(t,i)=>[n[0]*t+n[2]*i,n[1]*t+n[3]*i],[o,h]=this.parentDimensions,a=this.x,c=this.y,l=this.width,u=this.height,d=Ut.MIN_SIZE/o,f=Ut.MIN_SIZE/h;s=Math.max(Math.min(s,1/l,1/u),d/l,f/u);const p=Ut._round(l*s),g=Ut._round(u*s);if(p===l&&g===u)return;this.#Ei||=[a,c,l,u];const w=r(l/2,u/2),m=Ut._round(a+w[0]),A=Ut._round(c+w[1]),b=r(p/2,g/2);this.x=m-b[0],this.y=A-b[1],this.width=p,this.height=g,this.setDims(o*p,h*g),this.fixAndSetPosition(),this._onResizing()}#Yi(){this.#h?.toggle(!0),this.parent.togglePointerEvents(!0),this.#Hi()}pointerdown(t){const{isMac:i}=Z.platform;0!==t.button||t.ctrlKey&&i?t.preventDefault():(this.#ki=!0,this._isDraggable?this.#Qi(t):this.#qi(t))}#qi(t){const{isMac:i}=Z.platform;t.ctrlKey&&!i||t.shiftKey||t.metaKey&&i?this.parent.toggleSelected(this):this.parent.setSelected(this)}#Qi(t){const{isSelected:i}=this;this._uiManager.setUpDragSession();let e=!1;const s=new AbortController,n=this._uiManager.combinedSignal(s),r={capture:!0,passive:!1,signal:n},o=t=>{s.abort(),this.#wi=null,this.#ki=!1,this._uiManager.endDragSession()||this.#qi(t),e&&this._onStopDragging()};i&&(this.#Pi=t.clientX,this.#Ri=t.clientY,this.#wi=t.pointerId,this.#mi=t.pointerType,window.addEventListener("pointermove",(t=>{e||(e=!0,this._onStartDragging());const{clientX:i,clientY:s,pointerId:n}=t;if(n!==this.#wi)return void yt(t);const[r,o]=this.screenToPageTranslation(i-this.#Pi,s-this.#Ri);this.#Pi=i,this.#Ri=s,this._uiManager.dragSelectedEditors(r,o)}),r),window.addEventListener("touchmove",yt,r),window.addEventListener("pointerdown",(t=>{t.pointerType===this.#mi&&(this.#Di||t.isPrimary)&&o(t),yt(t)}),r));const h=t=>{this.#wi&&this.#wi!==t.pointerId?yt(t):o(t)};window.addEventListener("pointerup",h,{signal:n}),window.addEventListener("blur",h,{signal:n})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#Ci&&clearTimeout(this.#Ci),this.#Ci=setTimeout((()=>{this.#Ci=null,this.parent?.moveEditorInDOM(this)}),0)}_setParentAndPosition(t,i,e){t.changeParent(this),this.x=i,this.y=e,this.fixAndSetPosition(),this._onTranslated()}getRect(t,i,e=this.rotation){const s=this.parentScale,[n,r]=this.pageDimensions,[o,h]=this.pageTranslation,a=t/s,c=i/s,l=this.x*n,u=this.y*r,d=this.width*n,f=this.height*r;switch(e){case 0:return[l+a+o,r-u-c-f+h,l+a+d+o,r-u-c+h];case 90:return[l+c+o,r-u+a+h,l+c+f+o,r-u+a+d+h];case 180:return[l-a-d+o,r-u+c+h,l-a+o,r-u+c+f+h];case 270:return[l-c-f+o,r-u-a-d+h,l-c+o,r-u-a+h];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,i){const[e,s,n,r]=t,o=n-e,h=r-s;switch(this.rotation){case 0:return[e,i-r,o,h];case 90:return[e,i-s,h,o];case 180:return[n,i-s,o,h];case 270:return[n,i-r,h,o];default:throw new Error("Invalid rotation")}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),this.#_i=!0,!0)}disableEditMode(){return!!this.isInEditMode()&&(this.parent.setEditingState(!0),this.#_i=!1,!0)}isInEditMode(){return this.#_i}shouldGetKeyboardEvents(){return this.#Ti}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:i,bottom:e,right:s}=this.getClientDimensions(),{innerHeight:n,innerWidth:r}=window;return i<r&&s>0&&t<n&&e>0}#Wi(){if(this.#xi||!this.div)return;this.#xi=new AbortController;const t=this._uiManager.combinedSignal(this.#xi);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}rebuild(){this.#Wi()}rotate(t){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,i=null){B("An editor must be serializable")}static async deserialize(t,i,e){const s=new this.prototype.constructor({parent:i,id:i.getNextId(),uiManager:e});s.rotation=t.rotation,s.#fi=t.accessibilityData,s._isCopy=t.isCopy||!1;const[n,r]=s.pageDimensions,[o,h,a,c]=s.getRectInCurrentCoords(t.rect,r);return s.x=o/n,s.y=h/r,s.width=a/n,s.height=c/r,s}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.#xi?.abort(),this.#xi=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#Ci&&(clearTimeout(this.#Ci),this.#Ci=null),this.#Oi(),this.removeEditToolbar(),this.#Ni){for(const t of this.#Ni.values())clearTimeout(t);this.#Ni=null}this.parent=null,this.#Di?.destroy(),this.#Di=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#ji(),this.#bi.classList.remove("hidden"))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),this.#yi={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const i=this.#bi.children;if(!this.#pi){this.#pi=Array.from(i);const t=this.#Ki.bind(this),e=this.#Ji.bind(this),s=this._uiManager._signal;for(const i of this.#pi){const n=i.getAttribute("data-resizer-name");i.setAttribute("role","spinbutton"),i.addEventListener("keydown",t,{signal:s}),i.addEventListener("blur",e,{signal:s}),i.addEventListener("focus",this.#Zi.bind(this,n),{signal:s}),i.setAttribute("data-l10n-id",Ut._l10nResizer[n])}}const e=this.#pi[0];let s=0;for(const t of i){if(t===e)break;s++}const n=(360-this.rotation+this.parentRotation)%360/90*(this.#pi.length/4);if(n!==s){if(n<s)for(let t=0;t<s-n;t++)this.#bi.append(this.#bi.firstChild);else if(n>s)for(let t=0;t<n-s;t++)this.#bi.firstChild.before(this.#bi.lastChild);let t=0;for(const e of i){const i=this.#pi[t++].getAttribute("data-resizer-name");e.setAttribute("data-l10n-id",Ut._l10nResizer[i])}}this.#te(0),this.#Ti=!0,this.#bi.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#Ki(t){Ut._resizerKeyboardManager.exec(this,t)}#Ji(t){this.#Ti&&t.relatedTarget?.parentNode!==this.#bi&&this.#Oi()}#Zi(t){this.#Mi=this.#Ti?t:""}#te(t){if(this.#pi)for(const i of this.#pi)i.tabIndex=t}_resizeWithKeyboard(t,i){this.#Ti&&this.#zi(this.#Mi,{deltaX:t,deltaY:i,fromKeyboard:!0})}#Oi(){this.#Ti=!1,this.#te(-1),this.#Hi()}_stopResizingWithKeyboard(){this.#Oi(),this.div.focus()}select(){this.isSelected&&this._editToolbar||(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),this._editToolbar?(this._editToolbar?.show(),this.#h?.toggleAltTextBadge(!1)):this.addEditToolbar().then((()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()})))}unselect(){this.isSelected&&(this.isSelected=!1,this.#bi?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#h?.toggleAltTextBadge(!0))}updateParams(t,i){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id})}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#Si}set isEditing(t){this.#Si=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,i){this.#Ai=!0;const e=t/i,{style:s}=this.div;s.aspectRatio=e,s.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,i=!1){if(i){this.#Ni||=new Map;const{action:i}=t;let e=this.#Ni.get(i);return e&&clearTimeout(e),e=setTimeout((()=>{this._reportTelemetry(t),this.#Ni.delete(i),0===this.#Ni.size&&(this.#Ni=null)}),Ut._telemetryTimeout),void this.#Ni.set(i,e)}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#gi=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#gi=!0}renderAnnotationElement(t){let i=t.container.querySelector(".annotationContent");if(i){if("CANVAS"===i.nodeName){const t=i;i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),t.before(i)}}else i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),t.container.prepend(i);return i}resetAnnotationElement(t){const{firstChild:i}=t.container;"DIV"===i?.nodeName&&i.classList.contains("annotationContent")&&i.remove()}}class zt extends Ut{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const Ht=3285377520,Gt=4294901760,Wt=65535;class Vt{constructor(t){this.h1=t?4294967295&t:Ht,this.h2=t?4294967295&t:Ht}update(t){let i,e;if("string"==typeof t){i=new Uint8Array(2*t.length),e=0;for(let s=0,n=t.length;s<n;s++){const n=t.charCodeAt(s);n<=255?i[e++]=n:(i[e++]=n>>>8,i[e++]=255&n)}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");i=t.slice(),e=i.byteLength}const s=e>>2,n=e-4*s,r=new Uint32Array(i.buffer,0,s);let o=0,h=0,a=this.h1,c=this.h2;const l=3432918353,u=461845907,d=11601,f=13715;for(let t=0;t<s;t++)1&t?(o=r[t],o=o*l&Gt|o*d&Wt,o=o<<15|o>>>17,o=o*u&Gt|o*f&Wt,a^=o,a=a<<13|a>>>19,a=5*a+3864292196):(h=r[t],h=h*l&Gt|h*d&Wt,h=h<<15|h>>>17,h=h*u&Gt|h*f&Wt,c^=h,c=c<<13|c>>>19,c=5*c+3864292196);switch(o=0,n){case 3:o^=i[4*s+2]<<16;case 2:o^=i[4*s+1]<<8;case 1:o^=i[4*s],o=o*l&Gt|o*d&Wt,o=o<<15|o>>>17,o=o*u&Gt|o*f&Wt,1&s?a^=o:c^=o}this.h1=a,this.h2=c}hexdigest(){let t=this.h1,i=this.h2;return t^=i>>>1,t=3981806797*t&Gt|36045*t&Wt,i=4283543511*i&Gt|(2950163797*(i<<16|t>>>16)&Gt)>>>16,t^=i>>>1,t=444984403*t&Gt|60499*t&Wt,i=3301882366*i&Gt|(3120437893*(i<<16|t>>>16)&Gt)>>>16,t^=i>>>1,(t>>>0).toString(16).padStart(8,"0")+(i>>>0).toString(16).padStart(8,"0")}}const Xt=Object.freeze({map:null,hash:"",transfer:void 0});class Yt{#ie=!1;#ee=null;#se=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,i){const e=this.#se.get(t);return void 0===e?i:Object.assign(i,e)}getRawValue(t){return this.#se.get(t)}remove(t){if(this.#se.delete(t),0===this.#se.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const t of this.#se.values())if(t instanceof Ut)return;this.onAnnotationEditor(null)}}setValue(t,i){const e=this.#se.get(t);let s=!1;if(void 0!==e)for(const[t,n]of Object.entries(i))e[t]!==n&&(s=!0,e[t]=n);else s=!0,this.#se.set(t,i);s&&this.#ne(),i instanceof Ut&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(i.constructor._type)}has(t){return this.#se.has(t)}get size(){return this.#se.size}#ne(){this.#ie||(this.#ie=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#ie&&(this.#ie=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new Qt(this)}get serializable(){if(0===this.#se.size)return Xt;const t=new Map,i=new Vt,e=[],s=Object.create(null);let n=!1;for(const[e,r]of this.#se){const o=r instanceof Ut?r.serialize(!1,s):r;o&&(t.set(e,o),i.update(`${e}:${JSON.stringify(o)}`),n||=!!o.bitmap)}if(n)for(const i of t.values())i.bitmap&&e.push(i.bitmap);return t.size>0?{map:t,hash:i.hexdigest(),transfer:e}:Xt}get editorStats(){let t=null;const i=new Map;for(const e of this.#se.values()){if(!(e instanceof Ut))continue;const s=e.telemetryFinalData;if(!s)continue;const{type:n}=s;i.has(n)||i.set(n,Object.getPrototypeOf(e).constructor),t||=Object.create(null);const r=t[n]||=new Map;for(const[t,i]of Object.entries(s)){if("type"===t)continue;let e=r.get(t);e||(e=new Map,r.set(t,e));const s=e.get(i)??0;e.set(i,s+1)}}for(const[e,s]of i)t[e]=s.computeTelemetryFinalData(t[e]);return t}resetModifiedIds(){this.#ee=null}get modifiedIds(){if(this.#ee)return this.#ee;const t=[];for(const i of this.#se.values())i instanceof Ut&&i.annotationElementId&&i.serialize()&&t.push(i.annotationElementId);return this.#ee={ids:new Set(t),hash:t.join(",")}}[Symbol.iterator](){return this.#se.entries()}}class Qt extends Yt{#re;constructor(t){super();const{map:i,hash:e,transfer:s}=t.serializable,n=structuredClone(i,s?{transfer:s}:null);this.#re={map:n,hash:e,transfer:s}}get print(){B("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#re}get modifiedIds(){return H(this,"modifiedIds",{ids:new Set,hash:""})}}class qt{#oe=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:i=null}){this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const i=this.styleElement.sheet;i.insertRule(t,i.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#oe.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:i,_inspectFont:e}){if(t&&!this.#oe.has(t.loadedName))if(j(!i,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:s,style:n}=t,r=new FontFace(i,s,n);this.addNativeFontFace(r);try{await r.load(),this.#oe.add(i),e?.(t)}catch{L(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(r)}}else B("Not implemented: loadSystemFont without the Font Loading API.")}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo)return void await this.loadSystemFont(t);if(this.isFontLoadingAPISupported){const i=t.createNativeFontFace();if(i){this.addNativeFontFace(i);try{await i.loaded}catch(e){throw L(`Failed to load font '${i.family}': '${e}'.`),t.disableFontFace=!0,e}}return}const i=t.createFontFaceRule();if(i){if(this.insertRule(i),this.isSyncFontLoadingSupported)return;await new Promise((i=>{const e=this._queueLoadingCallback(i);this._prepareFontLoadEvent(t,e)}))}}get isFontLoadingAPISupported(){return H(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){return H(this,"isSyncFontLoadingSupported",x||Z.platform.isFirefox)}_queueLoadingCallback(t){const{loadingRequests:i}=this,e={done:!1,complete:function(){for(j(!e.done,"completeRequest() cannot be called twice."),e.done=!0;i.length>0&&i[0].done;){const t=i.shift();setTimeout(t.callback,0)}},callback:t};return i.push(e),e}get _loadTestFont(){return H(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,i){function e(t,i){return t.charCodeAt(i)<<24|t.charCodeAt(i+1)<<16|t.charCodeAt(i+2)<<8|255&t.charCodeAt(i+3)}function s(t,i,e,s){return t.substring(0,i)+s+t.substring(i+e)}let n,r;const o=this._document.createElement("canvas");o.width=1,o.height=1;const h=o.getContext("2d");let a=0;const c=`lt${Date.now()}${this.loadTestFontId++}`;let l=this._loadTestFont;l=s(l,976,c.length,c);const u=1482184792;let d=e(l,16);for(n=0,r=c.length-3;n<r;n+=4)d=d-u+e(c,n)|0;var f;n<c.length&&(d=d-u+e(c+"XXX",n)|0),l=s(l,16,4,(f=d,String.fromCharCode(f>>24&255,f>>16&255,f>>8&255,255&f)));const p=`url(data:font/opentype;base64,${btoa(l)});`;this.insertRule(`@font-face {font-family:"${c}";src:${p}}`);const g=this._document.createElement("div");g.style.visibility="hidden",g.style.width=g.style.height="10px",g.style.position="absolute",g.style.top=g.style.left="0px";for(const i of[t.loadedName,c]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=i,g.append(t)}this._document.body.append(g),function t(i,e){if(++a>30)return L("Load test font never loaded."),void e();h.font="30px "+i,h.fillText(".",0,20),h.getImageData(0,0,1,1).data[3]>0?e():setTimeout(t.bind(null,i,e))}(c,(()=>{g.remove(),i.complete()}))}}class Kt{constructor(t,i=null){this.compiledGlyphs=Object.create(null);for(const i in t)this[i]=t[i];this._inspectFont=i}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const i={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(i.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,i)}else t=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=`url(data:${this.mimetype};base64,${at(this.data)});`;let i;if(this.cssFontInfo){let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${e}src:${t}}`}else i=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this._inspectFont?.(this,t),i}getPathGenerator(t,i){if(void 0!==this.compiledGlyphs[i])return this.compiledGlyphs[i];const e=this.loadedName+"_path_"+i;let s;try{s=t.get(e)}catch(t){L(`getPathGenerator - ignoring character: "${t}".`)}const n=new Path2D(s||"");return this.fontExtraProperties||t.delete(e),this.compiledGlyphs[i]=n}}function Jt(t){if("string"!=typeof t)return null;if(t.endsWith("/"))return t;throw new Error(`Invalid factory url: "${t}" must include trailing slash.`)}const Zt=t=>"object"==typeof t&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0,ti=function(t,i,e){if(!Array.isArray(e)||e.length<2)return!1;const[s,n,...r]=e;if(!t(s)&&!Number.isInteger(s))return!1;if(!i(n))return!1;const o=r.length;let h=!0;switch(n.name){case"XYZ":if(o<2||o>3)return!1;break;case"Fit":case"FitB":return 0===o;case"FitH":case"FitBH":case"FitV":case"FitBV":if(o>1)return!1;break;case"FitR":if(4!==o)return!1;h=!1;break;default:return!1}for(const t of r)if(!("number"==typeof t||h&&null===t))return!1;return!0}.bind(null,Zt,(t=>"object"==typeof t&&"string"==typeof t?.name));class ii{#he=new Map;#ae=Promise.resolve();postMessage(t,i){const e={data:structuredClone(t,i?{transfer:i}:null)};this.#ae.then((()=>{for(const[t]of this.#he)t.call(this,e)}))}addEventListener(t,i,e=null){let s=null;if(e?.signal instanceof AbortSignal){const{signal:n}=e;if(n.aborted)return void L("LoopbackPort - cannot use an `aborted` signal.");const r=()=>this.removeEventListener(t,i);s=()=>n.removeEventListener("abort",r),n.addEventListener("abort",r)}this.#he.set(i,s)}removeEventListener(t,i){const e=this.#he.get(i);e?.(),this.#he.delete(i)}terminate(){for(const[,t]of this.#he)t?.();this.#he.clear()}}function ei(){}function si(t){if(t instanceof q||t instanceof X||t instanceof W||t instanceof Y||t instanceof V)return t;switch(t instanceof Error||"object"==typeof t&&null!==t||B('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new q(t.message);case"InvalidPDFException":return new X(t.message);case"PasswordException":return new W(t.message,t.code);case"ResponseException":return new Y(t.message,t.status,t.missing);case"UnknownErrorException":return new V(t.message,t.details)}return new V(t.message,t.toString())}class ni{#ce=new AbortController;constructor(t,i,e){this.sourceName=t,this.targetName=i,this.comObj=e,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),e.addEventListener("message",this.#le.bind(this),{signal:this.#ce.signal})}#le({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream)return void this.#ue(t);if(t.callback){const i=t.callbackId,e=this.callbackCapabilities[i];if(!e)throw new Error(`Cannot resolve callback ${i}`);if(delete this.callbackCapabilities[i],1===t.callback)e.resolve(t.data);else{if(2!==t.callback)throw new Error("Unexpected callback case");e.reject(si(t.reason))}return}const i=this.actionHandler[t.action];if(!i)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,s=t.sourceName,n=this.comObj;Promise.try(i,t.data).then((function(i){n.postMessage({sourceName:e,targetName:s,callback:1,callbackId:t.callbackId,data:i})}),(function(i){n.postMessage({sourceName:e,targetName:s,callback:2,callbackId:t.callbackId,reason:si(i)})}))}else t.streamId?this.#de(t):i(t.data)}on(t,i){const e=this.actionHandler;if(e[t])throw new Error(`There is already an actionName called "${t}"`);e[t]=i}send(t,i,e){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:i},e)}sendWithPromise(t,i,e){const s=this.callbackId++,n=Promise.withResolvers();this.callbackCapabilities[s]=n;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:s,data:i},e)}catch(t){n.reject(t)}return n.promise}sendWithStream(t,i,e,s){const n=this.streamId++,r=this.sourceName,o=this.targetName,h=this.comObj;return new ReadableStream({start:e=>{const a=Promise.withResolvers();return this.streamControllers[n]={controller:e,startCall:a,pullCall:null,cancelCall:null,isClosed:!1},h.postMessage({sourceName:r,targetName:o,action:t,streamId:n,data:i,desiredSize:e.desiredSize},s),a.promise},pull:t=>{const i=Promise.withResolvers();return this.streamControllers[n].pullCall=i,h.postMessage({sourceName:r,targetName:o,stream:6,streamId:n,desiredSize:t.desiredSize}),i.promise},cancel:t=>{j(t instanceof Error,"cancel must have a valid reason");const i=Promise.withResolvers();return this.streamControllers[n].cancelCall=i,this.streamControllers[n].isClosed=!0,h.postMessage({sourceName:r,targetName:o,stream:1,streamId:n,reason:si(t)}),i.promise}},e)}#de(t){const i=t.streamId,e=this.sourceName,s=t.sourceName,n=this.comObj,r=this,o=this.actionHandler[t.action],h={enqueue(t,r=1,o){if(this.isCancelled)return;const h=this.desiredSize;this.desiredSize-=r,h>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),n.postMessage({sourceName:e,targetName:s,stream:4,streamId:i,chunk:t},o)},close(){this.isCancelled||(this.isCancelled=!0,n.postMessage({sourceName:e,targetName:s,stream:3,streamId:i}),delete r.streamSinks[i])},error(t){j(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,n.postMessage({sourceName:e,targetName:s,stream:5,streamId:i,reason:si(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};h.sinkCapability.resolve(),h.ready=h.sinkCapability.promise,this.streamSinks[i]=h,Promise.try(o,t.data,h).then((function(){n.postMessage({sourceName:e,targetName:s,stream:8,streamId:i,success:!0})}),(function(t){n.postMessage({sourceName:e,targetName:s,stream:8,streamId:i,reason:si(t)})}))}#ue(t){const i=t.streamId,e=this.sourceName,s=t.sourceName,n=this.comObj,r=this.streamControllers[i],o=this.streamSinks[i];switch(t.stream){case 8:t.success?r.startCall.resolve():r.startCall.reject(si(t.reason));break;case 7:t.success?r.pullCall.resolve():r.pullCall.reject(si(t.reason));break;case 6:if(!o){n.postMessage({sourceName:e,targetName:s,stream:7,streamId:i,success:!0});break}o.desiredSize<=0&&t.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=t.desiredSize,Promise.try(o.onPull||ei).then((function(){n.postMessage({sourceName:e,targetName:s,stream:7,streamId:i,success:!0})}),(function(t){n.postMessage({sourceName:e,targetName:s,stream:7,streamId:i,reason:si(t)})}));break;case 4:if(j(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case 3:if(j(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),this.#fe(r,i);break;case 5:j(r,"error should have stream controller"),r.controller.error(si(t.reason)),this.#fe(r,i);break;case 2:t.success?r.cancelCall.resolve():r.cancelCall.reject(si(t.reason)),this.#fe(r,i);break;case 1:if(!o)break;const h=si(t.reason);Promise.try(o.onCancel||ei,h).then((function(){n.postMessage({sourceName:e,targetName:s,stream:2,streamId:i,success:!0})}),(function(t){n.postMessage({sourceName:e,targetName:s,stream:2,streamId:i,reason:si(t)})})),o.sinkCapability.reject(h),o.isCancelled=!0,delete this.streamSinks[i];break;default:throw new Error("Unexpected stream case")}}async#fe(t,i){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[i]}destroy(){this.#ce?.abort(),this.#ce=null}}class ri{#pe=!1;constructor({enableHWA:t=!1}){this.#pe=t}create(t,i){if(t<=0||i<=0)throw new Error("Invalid canvas size");const e=this._createCanvas(t,i);return{canvas:e,context:e.getContext("2d",{willReadFrequently:!this.#pe})}}reset(t,i,e){if(!t.canvas)throw new Error("Canvas is not specified");if(i<=0||e<=0)throw new Error("Invalid canvas size");t.canvas.width=i,t.canvas.height=e}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,i){B("Abstract method `_createCanvas` called.")}}class oi extends ri{constructor({ownerDocument:t=globalThis.document,enableHWA:i=!1}){super({enableHWA:i}),this._document=t}_createCanvas(t,i){const e=this._document.createElement("canvas");return e.width=t,e.height=i,e}}class hi{constructor({baseUrl:t=null,isCompressed:i=!0}){this.baseUrl=t,this.isCompressed=i}async fetch({name:t}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!t)throw new Error("CMap name must be specified.");const i=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(i).then((t=>({cMapData:t,isCompressed:this.isCompressed}))).catch((()=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)}))}async _fetch(t){B("Abstract method `_fetch` called.")}}class ai extends hi{async _fetch(t){const i=await ut(t,this.isCompressed?"arraybuffer":"text");return i instanceof ArrayBuffer?new Uint8Array(i):J(i)}}y(2489);class ci{addFilter(t){return"none"}addHCMFilter(t,i){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,i,e,s,n){return"none"}destroy(t=!1){}}class li extends ci{#ge;#we;#me;#Ae;#be;#ve;#v=0;constructor({docId:t,ownerDocument:i=globalThis.document}){super(),this.#Ae=t,this.#be=i}get#x(){return this.#we||=new Map}get#ye(){return this.#ve||=new Map}get#xe(){if(!this.#me){const t=this.#be.createElement("div"),{style:i}=t;i.visibility="hidden",i.contain="strict",i.width=i.height=0,i.position="absolute",i.top=i.left=0,i.zIndex=-1;const e=this.#be.createElementNS(ct,"svg");e.setAttribute("width",0),e.setAttribute("height",0),this.#me=this.#be.createElementNS(ct,"defs"),t.append(e),e.append(this.#me),this.#be.body.append(t)}return this.#me}#Me(t){if(1===t.length){const i=t[0],e=new Array(256);for(let t=0;t<256;t++)e[t]=i[t]/255;const s=e.join(",");return[s,s,s]}const[i,e,s]=t,n=new Array(256),r=new Array(256),o=new Array(256);for(let t=0;t<256;t++)n[t]=i[t]/255,r[t]=e[t]/255,o[t]=s[t]/255;return[n.join(","),r.join(","),o.join(",")]}#ke(t){if(void 0===this.#ge){this.#ge="";const t=this.#be.URL;t!==this.#be.baseURI&&(pt(t)?L('#createUrl: ignore "data:"-URL for performance reasons.'):this.#ge=z(t,""))}return`url(${this.#ge}#${t})`}addFilter(t){if(!t)return"none";let i=this.#x.get(t);if(i)return i;const[e,s,n]=this.#Me(t),r=1===t.length?e:`${e}${s}${n}`;if(i=this.#x.get(r),i)return this.#x.set(t,i),i;const o=`g_${this.#Ae}_transfer_map_${this.#v++}`,h=this.#ke(o);this.#x.set(t,h),this.#x.set(r,h);const a=this.#Ee(o);return this.#Se(e,s,n,a),h}addHCMFilter(t,i){const e=`${t}-${i}`,s="base";let n=this.#ye.get(s);if(n?.key===e)return n.url;if(n?(n.filter?.remove(),n.key=e,n.url="none",n.filter=null):(n={key:e,url:"none",filter:null},this.#ye.set(s,n)),!t||!i)return n.url;const r=this.#_e(t);t=it.makeHexColor(...r);const o=this.#_e(i);if(i=it.makeHexColor(...o),this.#xe.style.color="","#000000"===t&&"#ffffff"===i||t===i)return n.url;const h=new Array(256);for(let t=0;t<=255;t++){const i=t/255;h[t]=i<=.03928?i/12.92:((i+.055)/1.055)**2.4}const a=h.join(","),c=`g_${this.#Ae}_hcm_filter`,l=n.filter=this.#Ee(c);this.#Se(a,a,a,l),this.#Te(l);const u=(t,i)=>{const e=r[t]/255,s=o[t]/255,n=new Array(i+1);for(let t=0;t<=i;t++)n[t]=e+t/i*(s-e);return n.join(",")};return this.#Se(u(0,5),u(1,5),u(2,5),l),n.url=this.#ke(c),n.url}addAlphaFilter(t){let i=this.#x.get(t);if(i)return i;const[e]=this.#Me([t]),s=`alpha_${e}`;if(i=this.#x.get(s),i)return this.#x.set(t,i),i;const n=`g_${this.#Ae}_alpha_map_${this.#v++}`,r=this.#ke(n);this.#x.set(t,r),this.#x.set(s,r);const o=this.#Ee(n);return this.#Ce(e,o),r}addLuminosityFilter(t){let i,e,s=this.#x.get(t||"luminosity");if(s)return s;if(t?([i]=this.#Me([t]),e=`luminosity_${i}`):e="luminosity",s=this.#x.get(e),s)return this.#x.set(t,s),s;const n=`g_${this.#Ae}_luminosity_map_${this.#v++}`,r=this.#ke(n);this.#x.set(t,r),this.#x.set(e,r);const o=this.#Ee(n);return this.#Pe(o),t&&this.#Ce(i,o),r}addHighlightHCMFilter(t,i,e,s,n){const r=`${i}-${e}-${s}-${n}`;let o=this.#ye.get(t);if(o?.key===r)return o.url;if(o?(o.filter?.remove(),o.key=r,o.url="none",o.filter=null):(o={key:r,url:"none",filter:null},this.#ye.set(t,o)),!i||!e)return o.url;const[h,a]=[i,e].map(this.#_e.bind(this));let c=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),l=Math.round(.2126*a[0]+.7152*a[1]+.0722*a[2]),[u,d]=[s,n].map(this.#_e.bind(this));l<c&&([c,l,u,d]=[l,c,d,u]),this.#xe.style.color="";const f=(t,i,e)=>{const s=new Array(256),n=(l-c)/e,r=t/255,o=(i-t)/(255*e);let h=0;for(let t=0;t<=e;t++){const i=Math.round(c+t*n),e=r+t*o;for(let t=h;t<=i;t++)s[t]=e;h=i+1}for(let t=h;t<256;t++)s[t]=s[h-1];return s.join(",")},p=`g_${this.#Ae}_hcm_${t}_filter`,g=o.filter=this.#Ee(p);return this.#Te(g),this.#Se(f(u[0],d[0],5),f(u[1],d[1],5),f(u[2],d[2],5),g),o.url=this.#ke(p),o.url}destroy(t=!1){t&&this.#ve?.size||(this.#me?.parentNode.parentNode.remove(),this.#me=null,this.#we?.clear(),this.#we=null,this.#ve?.clear(),this.#ve=null,this.#v=0)}#Pe(t){const i=this.#be.createElementNS(ct,"feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(i)}#Te(t){const i=this.#be.createElementNS(ct,"feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(i)}#Ee(t){const i=this.#be.createElementNS(ct,"filter");return i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("id",t),this.#xe.append(i),i}#Re(t,i,e){const s=this.#be.createElementNS(ct,i);s.setAttribute("type","discrete"),s.setAttribute("tableValues",e),t.append(s)}#Se(t,i,e,s){const n=this.#be.createElementNS(ct,"feComponentTransfer");s.append(n),this.#Re(n,"feFuncR",t),this.#Re(n,"feFuncG",i),this.#Re(n,"feFuncB",e)}#Ce(t,i){const e=this.#be.createElementNS(ct,"feComponentTransfer");i.append(e),this.#Re(e,"feFuncA",t)}#_e(t){return this.#xe.style.color=t,kt(getComputedStyle(this.#xe).getPropertyValue("color"))}}class ui{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!t)throw new Error("Font filename must be specified.");const i=`${this.baseUrl}${t}`;return this._fetch(i).catch((()=>{throw new Error(`Unable to load font data at: ${i}`)}))}async _fetch(t){B("Abstract method `_fetch` called.")}}class di extends ui{async _fetch(t){const i=await ut(t,"arraybuffer");return new Uint8Array(i)}}class fi{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!t)throw new Error("Wasm filename must be specified.");const i=`${this.baseUrl}${t}`;return this._fetch(i).catch((()=>{throw new Error(`Unable to load wasm data at: ${i}`)}))}async _fetch(t){B("Abstract method `_fetch` called.")}}class pi extends fi{async _fetch(t){const i=await ut(t,"arraybuffer");return new Uint8Array(i)}}if(x){let t;try{const i=process.getBuiltinModule("module").createRequire(import.meta.url);try{t=i("@napi-rs/canvas")}catch(t){L(`Cannot load "@napi-rs/canvas" package: "${t}".`)}}catch(t){L(`Cannot access the \`require\` function: "${t}".`)}globalThis.DOMMatrix||(t?.DOMMatrix?globalThis.DOMMatrix=t.DOMMatrix:L("Cannot polyfill `DOMMatrix`, rendering may be broken.")),globalThis.ImageData||(t?.ImageData?globalThis.ImageData=t.ImageData:L("Cannot polyfill `ImageData`, rendering may be broken.")),globalThis.Path2D||(t?.Path2D?globalThis.Path2D=t.Path2D:L("Cannot polyfill `Path2D`, rendering may be broken.")),globalThis.navigator?.language||(globalThis.navigator={language:"en-US",platform:"",userAgent:""})}async function gi(t){const i=process.getBuiltinModule("fs"),e=await i.promises.readFile(t);return new Uint8Array(e)}class wi extends ci{}class mi extends ri{_createCanvas(t,i){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t,i)}}class Ai extends hi{async _fetch(t){return gi(t)}}class bi extends ui{async _fetch(t){return gi(t)}}class vi extends fi{async _fetch(t){return gi(t)}}const yi="Fill",xi="Stroke",Mi="Shading";function ki(t,i){if(!i)return;const e=i[2]-i[0],s=i[3]-i[1],n=new Path2D;n.rect(i[0],i[1],e,s),t.clip(n)}class Ei{isModifyingCurrentTransform(){return!1}getPattern(){B("Abstract method `getPattern` called.")}}class Si extends Ei{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let i;"axial"===this._type?i=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(i=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const t of this._colorStops)i.addColorStop(t[0],t[1]);return i}getPattern(t,i,e,s){let n;if(s===xi||s===yi){const r=i.current.getClippedPathBoundingBox(s,Et(t))||[0,0,0,0],o=Math.ceil(r[2]-r[0])||1,h=Math.ceil(r[3]-r[1])||1,a=i.cachedCanvases.getCanvas("pattern",o,h),c=a.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-r[0],-r[1]),e=it.transform(e,[1,0,0,1,r[0],r[1]]),c.transform(...i.baseTransform),this.matrix&&c.transform(...this.matrix),ki(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),n=t.createPattern(a.canvas,"no-repeat");const l=new DOMMatrix(e);n.setTransform(l)}else ki(t,this._bbox),n=this._createGradient(t);return n}}function _i(t,i,e,s,n,r,o,h){const a=i.coords,c=i.colors,l=t.data,u=4*t.width;let d;a[e+1]>a[s+1]&&(d=e,e=s,s=d,d=r,r=o,o=d),a[s+1]>a[n+1]&&(d=s,s=n,n=d,d=o,o=h,h=d),a[e+1]>a[s+1]&&(d=e,e=s,s=d,d=r,r=o,o=d);const f=(a[e]+i.offsetX)*i.scaleX,p=(a[e+1]+i.offsetY)*i.scaleY,g=(a[s]+i.offsetX)*i.scaleX,w=(a[s+1]+i.offsetY)*i.scaleY,m=(a[n]+i.offsetX)*i.scaleX,A=(a[n+1]+i.offsetY)*i.scaleY;if(p>=A)return;const b=c[r],v=c[r+1],y=c[r+2],x=c[o],M=c[o+1],k=c[o+2],E=c[h],S=c[h+1],_=c[h+2],T=Math.round(p),C=Math.round(A);let P,R,N,D,I,F,O,$;for(let t=T;t<=C;t++){if(t<w){const i=t<p?0:(p-t)/(p-w);P=f-(f-g)*i,R=b-(b-x)*i,N=v-(v-M)*i,D=y-(y-k)*i}else{let i;i=t>A?1:w===A?0:(w-t)/(w-A),P=g-(g-m)*i,R=x-(x-E)*i,N=M-(M-S)*i,D=k-(k-_)*i}let i;i=t<p?0:t>A?1:(p-t)/(p-A),I=f-(f-m)*i,F=b-(b-E)*i,O=v-(v-S)*i,$=y-(y-_)*i;const e=Math.round(Math.min(P,I)),s=Math.round(Math.max(P,I));let n=u*t+4*e;for(let t=e;t<=s;t++)i=(P-t)/(P-I),i<0?i=0:i>1&&(i=1),l[n++]=R-(R-F)*i|0,l[n++]=N-(N-O)*i|0,l[n++]=D-(D-$)*i|0,l[n++]=255}}function Ti(t,i,e){const s=i.coords,n=i.colors;let r,o;switch(i.type){case"lattice":const h=i.verticesPerRow,a=Math.floor(s.length/h)-1,c=h-1;for(r=0;r<a;r++){let i=r*h;for(let r=0;r<c;r++,i++)_i(t,e,s[i],s[i+1],s[i+h],n[i],n[i+1],n[i+h]),_i(t,e,s[i+h+1],s[i+1],s[i+h],n[i+h+1],n[i+1],n[i+h])}break;case"triangles":for(r=0,o=s.length;r<o;r+=3)_i(t,e,s[r],s[r+1],s[r+2],n[r],n[r+1],n[r+2]);break;default:throw new Error("illegal figure")}}class Ci extends Ei{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],this.matrix=null}_createMeshCanvas(t,i,e){const s=Math.floor(this._bounds[0]),n=Math.floor(this._bounds[1]),r=Math.ceil(this._bounds[2])-s,o=Math.ceil(this._bounds[3])-n,h=Math.min(Math.ceil(Math.abs(r*t[0]*1.1)),3e3),a=Math.min(Math.ceil(Math.abs(o*t[1]*1.1)),3e3),c=r/h,l=o/a,u={coords:this._coords,colors:this._colors,offsetX:-s,offsetY:-n,scaleX:1/c,scaleY:1/l},d=e.getCanvas("mesh",h+4,a+4),f=d.context,p=f.createImageData(h,a);if(i){const t=p.data;for(let e=0,s=t.length;e<s;e+=4)t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=255}for(const t of this._figures)Ti(p,t,u);return f.putImageData(p,2,2),{canvas:d.canvas,offsetX:s-2*c,offsetY:n-2*l,scaleX:c,scaleY:l}}isModifyingCurrentTransform(){return!0}getPattern(t,i,e,s){ki(t,this._bbox);const n=new Float32Array(2);if(s===Mi)it.singularValueDecompose2dScale(Et(t),n);else if(this.matrix){it.singularValueDecompose2dScale(this.matrix,n);const[t,e]=n;it.singularValueDecompose2dScale(i.baseTransform,n),n[0]*=t,n[1]*=e}else it.singularValueDecompose2dScale(i.baseTransform,n);const r=this._createMeshCanvas(n,s===Mi?null:this._background,i.cachedCanvases);return s!==Mi&&(t.setTransform(...i.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(r.offsetX,r.offsetY),t.scale(r.scaleX,r.scaleY),t.createPattern(r.canvas,"no-repeat")}}class Pi extends Ei{getPattern(){return"hotpink"}}class Ri{static MAX_PATTERN_SIZE=3e3;constructor(t,i,e,s){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.ctx=i,this.canvasGraphicsFactory=e,this.baseTransform=s}createPatternCanvas(t){const{bbox:i,operatorList:e,paintType:s,tilingType:n,color:r,canvasGraphicsFactory:o}=this;let{xstep:h,ystep:a}=this;h=Math.abs(h),a=Math.abs(a),$("TilingType: "+n);const c=i[0],l=i[1],u=i[2],d=i[3],f=u-c,p=d-l,g=new Float32Array(2);it.singularValueDecompose2dScale(this.matrix,g);const[w,m]=g;it.singularValueDecompose2dScale(this.baseTransform,g);const A=w*g[0],b=m*g[1];let v=f,y=p,x=!1,M=!1;const k=Math.ceil(h*A),E=Math.ceil(a*b);k>=Math.ceil(f*A)?v=h:x=!0,E>=Math.ceil(p*b)?y=a:M=!0;const S=this.getSizeAndScale(v,this.ctx.canvas.width,A),_=this.getSizeAndScale(y,this.ctx.canvas.height,b),T=t.cachedCanvases.getCanvas("pattern",S.size,_.size),C=T.context,P=o.createCanvasGraphics(C);if(P.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(P,s,r),C.translate(-S.scale*c,-_.scale*l),P.transform(S.scale,0,0,_.scale,0,0),C.save(),this.clipBbox(P,c,l,u,d),P.baseTransform=Et(P.ctx),P.executeOperatorList(e),P.endDrawing(),C.restore(),x||M){const i=T.canvas;x&&(v=h),M&&(y=a);const e=this.getSizeAndScale(v,this.ctx.canvas.width,A),s=this.getSizeAndScale(y,this.ctx.canvas.height,b),n=e.size,r=s.size,o=t.cachedCanvases.getCanvas("pattern-workaround",n,r),u=o.context,d=x?Math.floor(f/h):0,g=M?Math.floor(p/a):0;for(let t=0;t<=d;t++)for(let e=0;e<=g;e++)u.drawImage(i,n*t,r*e,n,r,0,0,n,r);return{canvas:o.canvas,scaleX:e.scale,scaleY:s.scale,offsetX:c,offsetY:l}}return{canvas:T.canvas,scaleX:S.scale,scaleY:_.scale,offsetX:c,offsetY:l}}getSizeAndScale(t,i,e){const s=Math.max(Ri.MAX_PATTERN_SIZE,i);let n=Math.ceil(t*e);return n>=s?n=s:e=n/t,{scale:e,size:n}}clipBbox(t,i,e,s,n){t.ctx.rect(i,e,s-i,n-e),it.axialAlignedBoundingBox([i,e,s,n],Et(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,i,e){const s=t.ctx,n=t.current;switch(i){case 1:const{fillStyle:t,strokeStyle:r}=this.ctx;s.fillStyle=n.fillColor=t,s.strokeStyle=n.strokeColor=r;break;case 2:s.fillStyle=s.strokeStyle=e,n.fillColor=n.strokeColor=e;break;default:throw new Q(`Unsupported paint type: ${i}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,i,e,s){let n=e;s!==Mi&&(n=it.transform(n,i.baseTransform),this.matrix&&(n=it.transform(n,this.matrix)));const r=this.createPatternCanvas(i);let o=new DOMMatrix(n);o=o.translate(r.offsetX,r.offsetY),o=o.scale(1/r.scaleX,1/r.scaleY);const h=t.createPattern(r.canvas,"repeat");return h.setTransform(o),h}}function Ni({src:t,srcPos:i=0,dest:e,width:s,height:n,nonBlackColor:r=4294967295,inverseDecode:o=!1}){const h=Z.isLittleEndian?4278190080:255,[a,c]=o?[r,h]:[h,r],l=s>>3,u=7&s,d=t.length;e=new Uint32Array(e.buffer);let f=0;for(let s=0;s<n;s++){for(const s=i+l;i<s;i++){const s=i<d?t[i]:255;e[f++]=128&s?c:a,e[f++]=64&s?c:a,e[f++]=32&s?c:a,e[f++]=16&s?c:a,e[f++]=8&s?c:a,e[f++]=4&s?c:a,e[f++]=2&s?c:a,e[f++]=1&s?c:a}if(0===u)continue;const s=i<d?t[i++]:255;for(let t=0;t<u;t++)e[f++]=s&1<<7-t?c:a}return{srcPos:i,destPos:f}}const Di=16,Ii=new DOMMatrix,Fi=new Float32Array(2),Oi=new Float32Array([1/0,1/0,-1/0,-1/0]);class $i{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,i,e){let s;return void 0!==this.cache[t]?(s=this.cache[t],this.canvasFactory.reset(s,i,e)):(s=this.canvasFactory.create(i,e),this.cache[t]=s),s}delete(t){delete this.cache[t]}clear(){for(const t in this.cache)this.canvasFactory.destroy(this.cache[t]),delete this.cache[t]}}function Li(t,i,e,s,n,r,o,h,a,c){const[l,u,d,f,p,g]=Et(t);if(0===u&&0===d){const w=Math.round(o*l+p),m=Math.round(h*f+g),A=Math.abs(Math.round((o+a)*l+p)-w)||1,b=Math.abs(Math.round((h+c)*f+g)-m)||1;return t.setTransform(Math.sign(l),0,0,Math.sign(f),w,m),t.drawImage(i,e,s,n,r,0,0,A,b),t.setTransform(l,u,d,f,p,g),[A,b]}if(0===l&&0===f){const w=Math.round(h*d+p),m=Math.round(o*u+g),A=Math.abs(Math.round((h+c)*d+p)-w)||1,b=Math.abs(Math.round((o+a)*u+g)-m)||1;return t.setTransform(0,Math.sign(u),Math.sign(d),0,w,m),t.drawImage(i,e,s,n,r,0,0,b,A),t.setTransform(l,u,d,f,p,g),[b,A]}return t.drawImage(i,e,s,n,r,o,h,a,c),[Math.hypot(l,u)*a,Math.hypot(d,f)*c]}class Bi{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=M;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=0;textRise=0;fillColor="#000000";strokeColor="#000000";patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";constructor(t,i){this.clipBox=new Float32Array([0,0,t,i]),this.minMax=Oi.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=yi,i=null){const e=this.minMax.slice();if(t===xi){i||B("Stroke bounding box must include transform."),it.singularValueDecompose2dScale(i,Fi);const t=Fi[0]*this.lineWidth/2,s=Fi[1]*this.lineWidth/2;e[0]-=t,e[1]-=s,e[2]+=t,e[3]+=s}return e}updateClipFromPath(){const t=it.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0),this.minMax.set(Oi,0)}getClippedPathBoundingBox(t=yi,i=null){return it.intersect(this.clipBox,this.getPathBoundingBox(t,i))}}function ji(t,i){if(i instanceof ImageData)return void t.putImageData(i,0,0);const e=i.height,s=i.width,n=e%Di,r=(e-n)/Di,o=0===n?r:r+1,h=t.createImageData(s,Di);let a,c=0;const l=i.data,u=h.data;let d,f,p,g;if(i.kind===C.GRAYSCALE_1BPP){const i=l.byteLength,e=new Uint32Array(u.buffer,0,u.byteLength>>2),g=e.length,w=s+7>>3,m=4294967295,A=Z.isLittleEndian?4278190080:255;for(d=0;d<o;d++){for(p=d<r?Di:n,a=0,f=0;f<p;f++){const t=i-c;let n=0;const r=t>w?s:8*t-7,o=-8&r;let h=0,u=0;for(;n<o;n+=8)u=l[c++],e[a++]=128&u?m:A,e[a++]=64&u?m:A,e[a++]=32&u?m:A,e[a++]=16&u?m:A,e[a++]=8&u?m:A,e[a++]=4&u?m:A,e[a++]=2&u?m:A,e[a++]=1&u?m:A;for(;n<r;n++)0===h&&(u=l[c++],h=128),e[a++]=u&h?m:A,h>>=1}for(;a<g;)e[a++]=0;t.putImageData(h,0,d*Di)}}else if(i.kind===C.RGBA_32BPP){for(f=0,g=s*Di*4,d=0;d<r;d++)u.set(l.subarray(c,c+g)),c+=g,t.putImageData(h,0,f),f+=Di;d<o&&(g=s*n*4,u.set(l.subarray(c,c+g)),t.putImageData(h,0,f))}else{if(i.kind!==C.RGB_24BPP)throw new Error(`bad image kind: ${i.kind}`);for(p=Di,g=s*p,d=0;d<o;d++){for(d>=r&&(p=n,g=s*p),a=0,f=g;f--;)u[a++]=l[c++],u[a++]=l[c++],u[a++]=l[c++],u[a++]=255;t.putImageData(h,0,d*Di)}}}function Ui(t,i){if(i.bitmap)return void t.drawImage(i.bitmap,0,0);const e=i.height,s=i.width,n=e%Di,r=(e-n)/Di,o=0===n?r:r+1,h=t.createImageData(s,Di);let a=0;const c=i.data,l=h.data;for(let i=0;i<o;i++){const e=i<r?Di:n;({srcPos:a}=Ni({src:c,srcPos:a,dest:l,width:s,height:e,nonBlackColor:0})),t.putImageData(h,0,i*Di)}}function zi(t,i){const e=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const s of e)void 0!==t[s]&&(i[s]=t[s]);void 0!==t.setLineDash&&(i.setLineDash(t.getLineDash()),i.lineDashOffset=t.lineDashOffset)}function Hi(t){t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0);const{filter:i}=t;"none"!==i&&""!==i&&(t.filter="none")}function Gi(t,i){if(i)return!0;it.singularValueDecompose2dScale(t,Fi);const e=Math.fround(Tt.pixelRatio*lt.PDF_TO_CSS_UNITS);return Fi[0]<=e&&Fi[1]<=e}const Wi=["butt","round","square"],Vi=["miter","round","bevel"],Xi={},Yi={};class Qi{constructor(t,i,e,s,n,{optionalContentConfig:r,markedContentStack:o=null},h,a){this.ctx=t,this.current=new Bi(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=i,this.objs=e,this.canvasFactory=s,this.filterFactory=n,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=r,this.cachedCanvases=new $i(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=h,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=a,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,i=null){return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):i}beginDrawing({transform:t,viewport:i,transparency:e=!1,background:s=null}){const n=this.ctx.canvas.width,r=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,n,r),this.ctx.fillStyle=o,e){const t=this.cachedCanvases.getCanvas("transparent",n,r);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...Et(this.compositeCtx))}this.ctx.save(),Hi(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=Et(this.ctx)}executeOperatorList(t,i,e,s){const n=t.argsArray,r=t.fnArray;let o=i||0;const h=n.length;if(h===o)return o;const a=h-o>10&&"function"==typeof e,c=a?Date.now()+15:0;let l=0;const u=this.commonObjs,d=this.objs;let f;for(;;){if(void 0!==s&&o===s.nextBreakPoint)return s.breakIt(o,e),o;if(f=r[o],f!==N.dependency)this[f].apply(this,n[o]);else for(const t of n[o]){const i=t.startsWith("g_")?u:d;if(!i.has(t))return i.get(t,e),o}if(o++,o===h)return o;if(a&&++l>10){if(Date.now()>c)return e(),o;l=0}}}#Ne(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#Ne(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const i of t.values())"undefined"!=typeof HTMLCanvasElement&&i instanceof HTMLCanvasElement&&(i.width=i.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#De()}#De(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const i=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=i}}}_scaleImage(t,i){const e=t.width??t.displayWidth,s=t.height??t.displayHeight;let n,r,o=Math.max(Math.hypot(i[0],i[1]),1),h=Math.max(Math.hypot(i[2],i[3]),1),a=e,c=s,l="prescale1";for(;o>2&&a>1||h>2&&c>1;){let i=a,e=c;o>2&&a>1&&(i=a>=16384?Math.floor(a/2)-1||1:Math.ceil(a/2),o/=a/i),h>2&&c>1&&(e=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,h/=c/e),n=this.cachedCanvases.getCanvas(l,i,e),r=n.context,r.clearRect(0,0,i,e),r.drawImage(t,0,0,a,c,0,0,i,e),t=n.canvas,a=i,c=e,l="prescale1"===l?"prescale2":"prescale1"}return{img:t,paintWidth:a,paintHeight:c}}_createMaskCanvas(t){const i=this.ctx,{width:e,height:s}=t,n=this.current.fillColor,r=this.current.patternFill,o=Et(i);let h,a,c,l;if((t.bitmap||t.data)&&t.count>1){const i=t.bitmap||t.data.buffer;a=JSON.stringify(r?o:[o.slice(0,4),n]),h=this._cachedBitmapsMap.get(i),h||(h=new Map,this._cachedBitmapsMap.set(i,h));const e=h.get(a);if(e&&!r)return{canvas:e,offsetX:Math.round(Math.min(o[0],o[2])+o[4]),offsetY:Math.round(Math.min(o[1],o[3])+o[5])};c=e}c||(l=this.cachedCanvases.getCanvas("maskCanvas",e,s),Ui(l.context,t));let u=it.transform(o,[1/e,0,0,-1/s,0,0]);u=it.transform(u,[1,0,0,1,0,-s]);const d=Oi.slice();it.axialAlignedBoundingBox([0,0,e,s],u,d);const[f,p,g,w]=d,m=Math.round(g-f)||1,A=Math.round(w-p)||1,b=this.cachedCanvases.getCanvas("fillCanvas",m,A),v=b.context,y=f,x=p;v.translate(-y,-x),v.transform(...u),c||(c=this._scaleImage(l.canvas,St(v)),c=c.img,h&&r&&h.set(a,c)),v.imageSmoothingEnabled=Gi(Et(v),t.interpolate),Li(v,c,0,0,c.width,c.height,0,0,e,s),v.globalCompositeOperation="source-in";const M=it.transform(St(v),[1,0,0,1,-y,-x]);return v.fillStyle=r?n.getPattern(i,this,M,yi):n,v.fillRect(0,0,e,s),h&&!r&&(this.cachedCanvases.delete("fillCanvas"),h.set(a,b.canvas)),{canvas:b.canvas,offsetX:Math.round(y),offsetY:Math.round(x)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=Wi[t]}setLineJoin(t){this.ctx.lineJoin=Vi[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,i){const e=this.ctx;void 0!==e.setLineDash&&(e.setLineDash(t),e.lineDashOffset=i)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[i,e]of t)switch(i){case"LW":this.setLineWidth(e);break;case"LC":this.setLineCap(e);break;case"LJ":this.setLineJoin(e);break;case"ML":this.setMiterLimit(e);break;case"D":this.setDash(e[0],e[1]);break;case"RI":this.setRenderingIntent(e);break;case"FL":this.setFlatness(e);break;case"Font":this.setFont(e[0],e[1]);break;case"CA":this.current.strokeAlpha=e;break;case"ca":this.ctx.globalAlpha=this.current.fillAlpha=e;break;case"BM":this.ctx.globalCompositeOperation=e;break;case"SMask":this.current.activeSMask=e?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(e)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.cachedCanvases.getCanvas("smaskGroupAt"+this.groupLevel,this.ctx.canvas.width,this.ctx.canvas.height);this.suspendedCtx=this.ctx;const i=this.ctx=t.context;i.setTransform(this.suspendedCtx.getTransform()),zi(this.suspendedCtx,i),function(t,i){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){i.save(),this.__originalSave()},t.restore=function(){i.restore(),this.__originalRestore()},t.translate=function(t,e){i.translate(t,e),this.__originalTranslate(t,e)},t.scale=function(t,e){i.scale(t,e),this.__originalScale(t,e)},t.transform=function(t,e,s,n,r,o){i.transform(t,e,s,n,r,o),this.__originalTransform(t,e,s,n,r,o)},t.setTransform=function(t,e,s,n,r,o){i.setTransform(t,e,s,n,r,o),this.__originalSetTransform(t,e,s,n,r,o)},t.resetTransform=function(){i.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){i.rotate(t),this.__originalRotate(t)},t.clip=function(t){i.clip(t),this.__originalClip(t)},t.moveTo=function(t,e){i.moveTo(t,e),this.__originalMoveTo(t,e)},t.lineTo=function(t,e){i.lineTo(t,e),this.__originalLineTo(t,e)},t.bezierCurveTo=function(t,e,s,n,r,o){i.bezierCurveTo(t,e,s,n,r,o),this.__originalBezierCurveTo(t,e,s,n,r,o)},t.rect=function(t,e,s,n){i.rect(t,e,s,n),this.__originalRect(t,e,s,n)},t.closePath=function(){i.closePath(),this.__originalClosePath()},t.beginPath=function(){i.beginPath(),this.__originalBeginPath()}}(i,this.suspendedCtx),this.setGState([["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),zi(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){this.current.activeSMask&&(t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height],this.composeSMask(this.suspendedCtx,this.current.activeSMask,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore())}composeSMask(t,i,e,s){const n=s[0],r=s[1],o=s[2]-n,h=s[3]-r;0!==o&&0!==h&&(this.genericComposeSMask(i.context,e,o,h,i.subtype,i.backdrop,i.transferMap,n,r,i.offsetX,i.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(e.canvas,0,0),t.restore())}genericComposeSMask(t,i,e,s,n,r,o,h,a,c,l){let u=t.canvas,d=h-c,f=a-l;if(r)if(d<0||f<0||d+e>u.width||f+s>u.height){const t=this.cachedCanvases.getCanvas("maskExtension",e,s),i=t.context;i.drawImage(u,-d,-f),i.globalCompositeOperation="destination-atop",i.fillStyle=r,i.fillRect(0,0,e,s),i.globalCompositeOperation="source-over",u=t.canvas,d=f=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const i=new Path2D;i.rect(d,f,e,s),t.clip(i),t.globalCompositeOperation="destination-atop",t.fillStyle=r,t.fillRect(d,f,e,s),t.restore()}i.save(),i.globalAlpha=1,i.setTransform(1,0,0,1,0,0),"Alpha"===n&&o?i.filter=this.filterFactory.addAlphaFilter(o):"Luminosity"===n&&(i.filter=this.filterFactory.addLuminosityFilter(o));const p=new Path2D;p.rect(h,a,e,s),i.clip(p),i.globalCompositeOperation="destination-in",i.drawImage(u,d,f,e,s,h,a,e,s),i.restore()}save(){this.inSMaskMode&&zi(this.ctx,this.suspendedCtx),this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0!==this.stateStack.length?(this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&zi(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null):this.inSMaskMode&&this.endSMaskMode()}transform(t,i,e,s,n,r){this.ctx.transform(t,i,e,s,n,r),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,i,e){let[s]=i;if(!e)return s||=i[0]=new Path2D,void this[t](s);if(!(s instanceof Path2D)){const t=i[0]=new Path2D;for(let i=0,e=s.length;i<e;)switch(s[i++]){case 0:t.moveTo(s[i++],s[i++]);break;case 1:t.lineTo(s[i++],s[i++]);break;case 2:t.bezierCurveTo(s[i++],s[i++],s[i++],s[i++],s[i++],s[i++]);break;case 3:t.closePath();break;default:L(`Unrecognized drawing path operator: ${s[i-1]}`)}s=t}it.axialAlignedBoundingBox(e,Et(this.ctx),this.current.minMax),this[t](s)}closePath(){this.ctx.closePath()}stroke(t,i=!0){const e=this.ctx,s=this.current.strokeColor;if(e.globalAlpha=this.current.strokeAlpha,this.contentVisible)if("object"==typeof s&&s?.getPattern){const i=s.isModifyingCurrentTransform()?e.getTransform():null;if(e.save(),e.strokeStyle=s.getPattern(e,this,St(e),xi),i){const s=new Path2D;s.addPath(t,e.getTransform().invertSelf().multiplySelf(i)),t=s}this.rescaleAndStroke(t,!1),e.restore()}else this.rescaleAndStroke(t,!0);i&&this.consumePath(t,this.current.getClippedPathBoundingBox(xi,Et(this.ctx))),e.globalAlpha=this.current.fillAlpha}closeStroke(t){this.stroke(t)}fill(t,i=!0){const e=this.ctx,s=this.current.fillColor;let n=!1;if(this.current.patternFill){const i=s.isModifyingCurrentTransform()?e.getTransform():null;if(e.save(),e.fillStyle=s.getPattern(e,this,St(e),yi),i){const s=new Path2D;s.addPath(t,e.getTransform().invertSelf().multiplySelf(i)),t=s}n=!0}const r=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==r&&(this.pendingEOFill?(e.fill(t,"evenodd"),this.pendingEOFill=!1):e.fill(t)),n&&e.restore(),i&&this.consumePath(t,r)}eoFill(t){this.pendingEOFill=!0,this.fill(t)}fillStroke(t){this.fill(t,!1),this.stroke(t,!1),this.consumePath(t)}eoFillStroke(t){this.pendingEOFill=!0,this.fillStroke(t)}closeFillStroke(t){this.fillStroke(t)}closeEOFillStroke(t){this.pendingEOFill=!0,this.fillStroke(t)}endPath(t){this.consumePath(t)}rawFillPath(t){this.ctx.fill(t)}clip(){this.pendingClip=Xi}eoClip(){this.pendingClip=Yi}beginText(){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,i=this.ctx;if(void 0===t)return;const e=new Path2D,s=i.getTransform().invertSelf();for(const{transform:i,x:n,y:r,fontSize:o,path:h}of t)e.addPath(h,new DOMMatrix(i).preMultiplySelf(s).translate(n,r).scale(o,-o));i.clip(e),delete this.pendingTextPaths}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,i){const e=this.commonObjs.get(t),s=this.current;if(!e)throw new Error(`Can't find font for ${t}`);if(s.fontMatrix=e.fontMatrix||M,0!==s.fontMatrix[0]&&0!==s.fontMatrix[3]||L("Invalid font matrix for font "+t),i<0?(i=-i,s.fontDirection=-1):s.fontDirection=1,this.current.font=e,this.current.fontSize=i,e.isType3Font)return;const n=e.loadedName||"sans-serif",r=e.systemFontInfo?.css||`"${n}", ${e.fallbackName}`;let o="normal";e.black?o="900":e.bold&&(o="bold");const h=e.italic?"italic":"normal";let a=i;i<16?a=16:i>100&&(a=100),this.current.fontSizeScale=i/a,this.ctx.font=`${h} ${o} ${a}px ${r}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,i){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=i}setLeadingMoveText(t,i){this.setLeading(-i),this.moveText(t,i)}setTextMatrix(t){const{current:i}=this;i.textMatrix=t,i.textMatrixScale=Math.hypot(t[0],t[1]),i.x=i.lineX=0,i.y=i.lineY=0}nextLine(){this.moveText(0,this.current.leading)}#Ie(t,i,e){const s=new Path2D;return s.addPath(t,new DOMMatrix(e).invertSelf().multiplySelf(i)),s}paintChar(t,i,e,s,n){const r=this.ctx,o=this.current,h=o.font,a=o.textRenderingMode,c=o.fontSize/o.fontSizeScale,l=3&a,u=!!(4&a),d=o.patternFill&&!h.missingFile,f=o.patternStroke&&!h.missingFile;let p;if((h.disableFontFace||u||d||f)&&(p=h.getPathGenerator(this.commonObjs,t)),h.disableFontFace||d||f){let t;if(r.save(),r.translate(i,e),r.scale(c,-c),0!==l&&2!==l||(s?(t=r.getTransform(),r.setTransform(...s),r.fill(this.#Ie(p,t,s))):r.fill(p)),1===l||2===l)if(n){t||=r.getTransform(),r.setTransform(...n);const{a:i,b:e,c:s,d:o}=t,h=it.inverseTransform(n),a=it.transform([i,e,s,o,0,0],h);it.singularValueDecompose2dScale(a,Fi),r.lineWidth*=Math.max(Fi[0],Fi[1])/c,r.stroke(this.#Ie(p,t,n))}else r.lineWidth/=c,r.stroke(p);r.restore()}else 0!==l&&2!==l||r.fillText(t,i,e),1!==l&&2!==l||r.strokeText(t,i,e);u&&(this.pendingTextPaths||=[]).push({transform:Et(r),x:i,y:e,fontSize:c,path:p})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const i=t.getImageData(0,0,10,10).data;let e=!1;for(let t=3;t<i.length;t+=4)if(i[t]>0&&i[t]<255){e=!0;break}return H(this,"isFontSubpixelAAEnabled",e)}showText(t){const i=this.current,e=i.font;if(e.isType3Font)return this.showType3Text(t);const s=i.fontSize;if(0===s)return;const n=this.ctx,r=i.fontSizeScale,o=i.charSpacing,h=i.wordSpacing,a=i.fontDirection,c=i.textHScale*a,l=t.length,u=e.vertical,d=u?1:-1,f=e.defaultVMetrics,p=s*i.fontMatrix[0],g=0===i.textRenderingMode&&!e.disableFontFace&&!i.patternFill;let w,m;if(n.save(),i.textMatrix&&n.transform(...i.textMatrix),n.translate(i.x,i.y+i.textRise),n.scale(c,a>0?-1:1),i.patternFill){n.save();const t=i.fillColor.getPattern(n,this,St(n),yi);w=Et(n),n.restore(),n.fillStyle=t}if(i.patternStroke){n.save();const t=i.strokeColor.getPattern(n,this,St(n),xi);m=Et(n),n.restore(),n.strokeStyle=t}let A=i.lineWidth;const b=i.textMatrixScale;if(0===b||0===A){const t=3&i.textRenderingMode;1!==t&&2!==t||(A=this.getSinglePixelWidth())}else A/=b;if(1!==r&&(n.scale(r,r),A/=r),n.lineWidth=A,e.isInvalidPDFjsFont){const e=[];let s=0;for(const i of t)e.push(i.unicode),s+=i.width;return n.fillText(e.join(""),0,0),i.x+=s*p*c,n.restore(),void this.compose()}let v,y=0;for(v=0;v<l;++v){const i=t[v];if("number"==typeof i){y+=d*i*s/1e3;continue}let c=!1;const l=(i.isSpace?h:0)+o,A=i.fontChar,b=i.accent;let x,M,k=i.width;if(u){const t=i.vmetric||f,e=-(i.vmetric?t[1]:.5*k)*p;k=t?-t[0]:k,x=e/r,M=(y+t[2]*p)/r}else x=y/r,M=0;if(e.remeasure&&k>0){const t=1e3*n.measureText(A).width/s*r;if(k<t&&this.isFontSubpixelAAEnabled){const i=k/t;c=!0,n.save(),n.scale(i,1),x/=i}else k!==t&&(x+=(k-t)/2e3*s/r)}this.contentVisible&&(i.isInFont||e.missingFile)&&(g&&!b?n.fillText(A,x,M):(this.paintChar(A,x,M,w,m),b&&this.paintChar(b.fontChar,x+s*b.offset.x/r,M-s*b.offset.y/r,w,m))),y+=u?k*p-l*a:k*p+l*a,c&&n.restore()}u?i.y-=y:i.x+=y*c,n.restore(),this.compose()}showType3Text(t){const i=this.ctx,e=this.current,s=e.font,n=e.fontSize,r=e.fontDirection,o=s.vertical?1:-1,h=e.charSpacing,a=e.wordSpacing,c=e.textHScale*r,l=e.fontMatrix||M,u=t.length;let d,f,p,g;if(3!==e.textRenderingMode&&0!==n){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),e.textMatrix&&i.transform(...e.textMatrix),i.translate(e.x,e.y+e.textRise),i.scale(c,r),d=0;d<u;++d){if(f=t[d],"number"==typeof f){g=o*f*n/1e3,this.ctx.translate(g,0),e.x+=g*c;continue}const r=(f.isSpace?a:0)+h,u=s.charProcOperatorList[f.operatorListId];u?this.contentVisible&&(this.save(),i.scale(n,n),i.transform(...l),this.executeOperatorList(u),this.restore()):L(`Type3 character "${f.operatorListId}" is not available.`);const w=[f.width,0];it.applyTransform(w,l),p=w[0]*n+r,i.translate(p,0),e.x+=p*c}i.restore()}}setCharWidth(t,i){}setCharWidthAndBounds(t,i,e,s,n,r){const o=new Path2D;o.rect(e,s,n-e,r-s),this.ctx.clip(o),this.endPath()}getColorN_Pattern(t){let i;if("TilingPattern"===t[0]){const e=this.baseTransform||Et(this.ctx);i=new Ri(t,this.ctx,{createCanvasGraphics:t=>new Qi(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})},e)}else i=this._getPattern(t[1],t[2]);return i}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments),this.current.patternStroke=!0}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t){this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t){this.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,i=null){let e;return this.cachedPatterns.has(t)?e=this.cachedPatterns.get(t):(e=function(t){switch(t[0]){case"RadialAxial":return new Si(t);case"Mesh":return new Ci(t);case"Dummy":return new Pi}throw new Error(`Unknown IR type: ${t[0]}`)}(this.getObject(t)),this.cachedPatterns.set(t,e)),i&&(e.matrix=i),e}shadingFill(t){if(!this.contentVisible)return;const i=this.ctx;this.save();const e=this._getPattern(t);i.fillStyle=e.getPattern(i,this,St(i),Mi);const s=St(i);if(s){const{width:t,height:e}=i.canvas,n=Oi.slice();it.axialAlignedBoundingBox([0,0,t,e],s,n);const[r,o,h,a]=n;this.ctx.fillRect(r,o,h-r,a-o)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){B("Should not call beginInlineImage")}beginImageData(){B("Should not call beginImageData")}paintFormXObjectBegin(t,i){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=Et(this.ctx),i)){it.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);const[t,e,s,n]=i,r=new Path2D;r.rect(t,e,s-t,n-e),this.ctx.clip(r),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const i=this.ctx;t.isolated||$("TODO: Support non-isolated groups."),t.knockout&&L("Knockout groups not supported.");const e=Et(i);if(t.matrix&&i.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let s=Oi.slice();it.axialAlignedBoundingBox(t.bbox,Et(i),s),s=it.intersect(s,[0,0,i.canvas.width,i.canvas.height])||[0,0,0,0];const n=Math.floor(s[0]),r=Math.floor(s[1]),o=Math.max(Math.ceil(s[2])-n,1),h=Math.max(Math.ceil(s[3])-r,1);this.current.startNewPathAndClipBox([0,0,o,h]);let a="groupAt"+this.groupLevel;t.smask&&(a+="_smask_"+this.smaskCounter++%2);const c=this.cachedCanvases.getCanvas(a,o,h),l=c.context;l.translate(-n,-r),l.transform(...e);let u=new Path2D;const[d,f,p,g]=t.bbox;if(u.rect(d,f,p-d,g-f),t.matrix){const i=new Path2D;i.addPath(u,new DOMMatrix(t.matrix)),u=i}l.clip(u),t.smask?this.smaskStack.push({canvas:c.canvas,context:l,offsetX:n,offsetY:r,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(i.setTransform(1,0,0,1,0,0),i.translate(n,r),i.save()),zi(i,l),this.ctx=l,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(i),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const i=this.ctx,e=this.groupStack.pop();if(this.ctx=e,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=Et(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const e=Oi.slice();it.axialAlignedBoundingBox([0,0,i.canvas.width,i.canvas.height],t,e),this.ctx.drawImage(i.canvas,0,0),this.ctx.restore(),this.compose(e)}}beginAnnotation(t,i,e,s,n){if(this.#Ne(),Hi(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),i){const s=i[2]-i[0],r=i[3]-i[1];if(n&&this.annotationCanvasMap){(e=e.slice())[4]-=i[0],e[5]-=i[1],(i=i.slice())[0]=i[1]=0,i[2]=s,i[3]=r,it.singularValueDecompose2dScale(Et(this.ctx),Fi);const{viewportScale:n}=this,o=Math.ceil(s*this.outputScaleX*n),h=Math.ceil(r*this.outputScaleY*n);this.annotationCanvas=this.canvasFactory.create(o,h);const{canvas:a,context:c}=this.annotationCanvas;this.annotationCanvasMap.set(t,a),this.annotationCanvas.savedCtx=this.ctx,this.ctx=c,this.ctx.save(),this.ctx.setTransform(Fi[0],0,0,-Fi[1],0,r*Fi[1]),Hi(this.ctx)}else{Hi(this.ctx),this.endPath();const t=new Path2D;t.rect(i[0],i[1],s,r),this.ctx.clip(t)}}this.current=new Bi(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...e),this.transform(...s)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#De(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const i=t.count;(t=this.getObject(t.data,t)).count=i;const e=this.ctx,s=this._createMaskCanvas(t),n=s.canvas;e.save(),e.setTransform(1,0,0,1,0,0),e.drawImage(n,s.offsetX,s.offsetY),e.restore(),this.compose()}paintImageMaskXObjectRepeat(t,i,e=0,s=0,n,r){if(!this.contentVisible)return;t=this.getObject(t.data,t);const o=this.ctx;o.save();const h=Et(o);o.transform(i,e,s,n,0,0);const a=this._createMaskCanvas(t);o.setTransform(1,0,0,1,a.offsetX-h[4],a.offsetY-h[5]);for(let t=0,c=r.length;t<c;t+=2){const c=it.transform(h,[i,e,s,n,r[t],r[t+1]]);o.drawImage(a.canvas,c[4],c[5])}o.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const i=this.ctx,e=this.current.fillColor,s=this.current.patternFill;for(const n of t){const{data:t,width:r,height:o,transform:h}=n,a=this.cachedCanvases.getCanvas("maskCanvas",r,o),c=a.context;c.save(),Ui(c,this.getObject(t,n)),c.globalCompositeOperation="source-in",c.fillStyle=s?e.getPattern(c,this,St(i),yi):e,c.fillRect(0,0,r,o),c.restore(),i.save(),i.transform(...h),i.scale(1,-1),Li(i,a.canvas,0,0,r,o,0,-1,1,1),i.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const i=this.getObject(t);i?this.paintInlineImageXObject(i):L("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,i,e,s){if(!this.contentVisible)return;const n=this.getObject(t);if(!n)return void L("Dependent image isn't ready yet");const r=n.width,o=n.height,h=[];for(let t=0,n=s.length;t<n;t+=2)h.push({transform:[i,0,0,e,s[t],s[t+1]],x:0,y:0,w:r,h:o});this.paintInlineImageXObjectGroup(n,h)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;const{bitmap:i,width:e,height:s}=t,n=this.cachedCanvases.getCanvas("inlineImage",e,s),r=n.context;return r.filter=this.current.transferMaps,r.drawImage(i,0,0),r.filter="none",n.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const i=t.width,e=t.height,s=this.ctx;this.save();const{filter:n}=s;let r;if("none"!==n&&""!==n&&(s.filter="none"),s.scale(1/i,-1/e),t.bitmap)r=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)r=t;else{const s=this.cachedCanvases.getCanvas("inlineImage",i,e).context;ji(s,t),r=this.applyTransferMapsToCanvas(s)}const o=this._scaleImage(r,St(s));s.imageSmoothingEnabled=Gi(Et(s),t.interpolate),Li(s,o.img,0,0,o.paintWidth,o.paintHeight,0,-e,i,e),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,i){if(!this.contentVisible)return;const e=this.ctx;let s;if(t.bitmap)s=t.bitmap;else{const i=this.cachedCanvases.getCanvas("inlineImage",t.width,t.height).context;ji(i,t),s=this.applyTransferMapsToCanvas(i)}for(const t of i)e.save(),e.transform(...t.transform),e.scale(1,-1),Li(e,s,t.x,t.y,t.w,t.h,0,-1,1,1),e.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,i){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,i){this.markedContentStack.push("OC"===t?{visible:this.optionalContentConfig.isVisible(i)}:{visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t,i){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(i);const s=this.ctx;this.pendingClip&&(e||(this.pendingClip===Yi?s.clip(t,"evenodd"):s.clip(t)),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Et(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const i=Math.abs(t[0]*t[3]-t[2]*t[1]),e=Math.hypot(t[0],t[2]),s=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(e,s)/i}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:t}=this.current,{a:i,b:e,c:s,d:n}=this.ctx.getTransform();let r,o;if(0===e&&0===s){const e=Math.abs(i),s=Math.abs(n);if(e===s)if(0===t)r=o=1/e;else{const i=e*t;r=o=i<1?1/i:1}else if(0===t)r=1/e,o=1/s;else{const i=e*t,n=s*t;r=i<1?1/i:1,o=n<1?1/n:1}}else{const h=Math.abs(i*n-e*s),a=Math.hypot(i,e),c=Math.hypot(s,n);if(0===t)r=c/h,o=a/h;else{const i=t*h;r=c>i?c/i:1,o=a>i?a/i:1}}this._cachedScaleForStroking[0]=r,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(t,i){const{ctx:e,current:{lineWidth:s}}=this,[n,r]=this.getScaleForStroking();if(n===r)return e.lineWidth=(s||1)*n,void e.stroke(t);const o=e.getLineDash();i&&e.save(),e.scale(n,r),Ii.a=1/n,Ii.d=1/r;const h=new Path2D;if(h.addPath(t,Ii),o.length>0){const t=Math.max(n,r);e.setLineDash(o.map((i=>i/t))),e.lineDashOffset/=t}e.lineWidth=s||1,e.stroke(h),i&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const t in N)void 0!==Qi.prototype[t]&&(Qi.prototype[N[t]]=Qi.prototype[t]);class qi{static#Fe=null;static#Oe="";static get workerPort(){return this.#Fe}static set workerPort(t){if(!("undefined"!=typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");this.#Fe=t}static get workerSrc(){return this.#Oe}static set workerSrc(t){if("string"!=typeof t)throw new Error("Invalid `workerSrc` type.");this.#Oe=t}}class Ki{#$e;#Le;constructor({parsedData:t,rawData:i}){this.#$e=t,this.#Le=i}getRaw(){return this.#Le}get(t){return this.#$e.get(t)??null}[Symbol.iterator](){return this.#$e.entries()}}const Ji=Symbol("INTERNAL");class Zi{#Be=!1;#je=!1;#Ue=!1;#ze=!0;constructor(t,{name:i,intent:e,usage:s,rbGroups:n}){this.#Be=!!(2&t),this.#je=!!(4&t),this.name=i,this.intent=e,this.usage=s,this.rbGroups=n}get visible(){if(this.#Ue)return this.#ze;if(!this.#ze)return!1;const{print:t,view:i}=this.usage;return this.#Be?"OFF"!==i?.viewState:!this.#je||"OFF"!==t?.printState}_setVisible(t,i,e=!1){t!==Ji&&B("Internal method `_setVisible` called."),this.#Ue=e,this.#ze=i}}class te{#He=null;#Ge=new Map;#We=null;#Ve=null;constructor(t,i=2){if(this.renderingIntent=i,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,this.#Ve=t.order;for(const e of t.groups)this.#Ge.set(e.id,new Zi(i,e));if("OFF"===t.baseState)for(const t of this.#Ge.values())t._setVisible(Ji,!1);for(const i of t.on)this.#Ge.get(i)._setVisible(Ji,!0);for(const i of t.off)this.#Ge.get(i)._setVisible(Ji,!1);this.#We=this.getHash()}}#Xe(t){const i=t.length;if(i<2)return!0;const e=t[0];for(let s=1;s<i;s++){const i=t[s];let n;if(Array.isArray(i))n=this.#Xe(i);else{if(!this.#Ge.has(i))return L(`Optional content group not found: ${i}`),!0;n=this.#Ge.get(i).visible}switch(e){case"And":if(!n)return!1;break;case"Or":if(n)return!0;break;case"Not":return!n;default:return!0}}return"And"===e}isVisible(t){if(0===this.#Ge.size)return!0;if(!t)return $("Optional content group not defined."),!0;if("OCG"===t.type)return this.#Ge.has(t.id)?this.#Ge.get(t.id).visible:(L(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return this.#Xe(t.expression);if(!t.policy||"AnyOn"===t.policy){for(const i of t.ids){if(!this.#Ge.has(i))return L(`Optional content group not found: ${i}`),!0;if(this.#Ge.get(i).visible)return!0}return!1}if("AllOn"===t.policy){for(const i of t.ids){if(!this.#Ge.has(i))return L(`Optional content group not found: ${i}`),!0;if(!this.#Ge.get(i).visible)return!1}return!0}if("AnyOff"===t.policy){for(const i of t.ids){if(!this.#Ge.has(i))return L(`Optional content group not found: ${i}`),!0;if(!this.#Ge.get(i).visible)return!0}return!1}if("AllOff"===t.policy){for(const i of t.ids){if(!this.#Ge.has(i))return L(`Optional content group not found: ${i}`),!0;if(this.#Ge.get(i).visible)return!1}return!0}return L(`Unknown optional content policy ${t.policy}.`),!0}return L(`Unknown group type ${t.type}.`),!0}setVisibility(t,i=!0,e=!0){const s=this.#Ge.get(t);if(s){if(e&&i&&s.rbGroups.length)for(const i of s.rbGroups)for(const e of i)e!==t&&this.#Ge.get(e)?._setVisible(Ji,!1,!0);s._setVisible(Ji,!!i,!0),this.#He=null}else L(`Optional content group not found: ${t}`)}setOCGState({state:t,preserveRB:i}){let e;for(const s of t){switch(s){case"ON":case"OFF":case"Toggle":e=s;continue}const t=this.#Ge.get(s);if(t)switch(e){case"ON":this.setVisibility(s,!0,i);break;case"OFF":this.setVisibility(s,!1,i);break;case"Toggle":this.setVisibility(s,!t.visible,i)}}this.#He=null}get hasInitialVisibility(){return null===this.#We||this.getHash()===this.#We}getOrder(){return this.#Ge.size?this.#Ve?this.#Ve.slice():[...this.#Ge.keys()]:null}getGroup(t){return this.#Ge.get(t)||null}getHash(){if(null!==this.#He)return this.#He;const t=new Vt;for(const[i,e]of this.#Ge)t.update(`${i}:${e.visible}`);return this.#He=t.hexdigest()}[Symbol.iterator](){return this.#Ge.entries()}}class ie{constructor(t,{disableRange:i=!1,disableStream:e=!1}){j(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:n,progressiveDone:r,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=r,this._contentDispositionFilename=o,n?.length>0){const t=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!e,this._isRangeSupported=!i,this._contentLength=s,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener(((t,i)=>{this._onReceiveData({begin:t,chunk:i})})),t.addProgressListener(((t,i)=>{this._onProgress({loaded:t,total:i})})),t.addProgressiveReadListener((t=>{this._onReceiveData({chunk:t})})),t.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),t.transportReady()}_onReceiveData({begin:t,chunk:i}){const e=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;void 0===t?this._fullRequestReader?this._fullRequestReader._enqueue(e):this._queuedChunks.push(e):j(this._rangeReaders.some((function(i){return i._begin===t&&(i._enqueue(e),!0)})),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const i=this._rangeReaders.indexOf(t);i>=0&&this._rangeReaders.splice(i,1)}getFullReader(){j(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new ee(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,i){if(i<=this._progressiveDataLength)return null;const e=new se(this,t,i);return this._pdfDataRangeTransport.requestDataRange(t,i),this._rangeReaders.push(e),e}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const i of this._rangeReaders.slice(0))i.cancel(t);this._pdfDataRangeTransport.abort()}}class ee{constructor(t,i,e=!1,s=null){this._stream=t,this._done=e||!1,this._filename=gt(s)?s:null,this._queuedChunks=i||[],this._loaded=0;for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class se{constructor(t,i,e){this._stream=t,this._begin=i,this._end=e,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function ne(t,i){const e=new Headers;if(!t||!i||"object"!=typeof i)return e;for(const t in i){const s=i[t];void 0!==s&&e.append(t,s)}return e}function re(t){return URL.parse(t)?.origin??null}function oe({responseHeaders:t,isHttp:i,rangeChunkSize:e,disableRange:s}){const n={allowRangeRequests:!1,suggestedLength:void 0},r=parseInt(t.get("Content-Length"),10);return Number.isInteger(r)?(n.suggestedLength=r,r<=2*e||s||!i||"bytes"!==t.get("Accept-Ranges")||"identity"!==(t.get("Content-Encoding")||"identity")||(n.allowRangeRequests=!0),n):n}function he(t){const i=t.get("Content-Disposition");if(i){let t=function(t){let i=!0,e=s("filename\\*","i").exec(t);if(e){e=e[1];let t=o(e);return t=unescape(t),t=h(t),t=a(t),r(t)}if(e=function(t){const i=[];let e;const n=s("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(e=n.exec(t));){let[,t,s,n]=e;if(t=parseInt(t,10),t in i){if(0===t)break}else i[t]=[s,n]}const r=[];for(let t=0;t<i.length&&t in i;++t){let[e,s]=i[t];s=o(s),e&&(s=unescape(s),0===t&&(s=h(s))),r.push(s)}return r.join("")}(t),e)return r(a(e));if(e=s("filename","i").exec(t),e){e=e[1];let t=o(e);return t=a(t),r(t)}function s(t,i){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',i)}function n(t,e){if(t){if(!/^[\x00-\xFF]+$/.test(e))return e;try{const s=new TextDecoder(t,{fatal:!0}),n=J(e);e=s.decode(n),i=!1}catch{}}return e}function r(t){return i&&/[\x80-\xff]/.test(t)&&(t=n("utf-8",t),i&&(t=n("iso-8859-1",t))),t}function o(t){if(t.startsWith('"')){const i=t.slice(1).split('\\"');for(let t=0;t<i.length;++t){const e=i[t].indexOf('"');-1!==e&&(i[t]=i[t].slice(0,e),i.length=t+1),i[t]=i[t].replaceAll(/\\(.)/g,"$1")}t=i.join('"')}return t}function h(t){const i=t.indexOf("'");return-1===i?t:n(t.slice(0,i),t.slice(i+1).replace(/^[^']*'/,""))}function a(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,i,e,s){if("q"===e||"Q"===e)return n(i,s=(s=s.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,(function(t,i){return String.fromCharCode(parseInt(i,16))})));try{s=atob(s)}catch{}return n(i,s)}))}return""}(i);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(gt(t))return t}return null}function ae(t,i){return new Y(`Unexpected server response (${t}) while retrieving PDF "${i}".`,t,404===t||0===t&&i.startsWith("file:"))}function ce(t){return 200===t||206===t}function le(t,i,e){return{method:"GET",headers:t,signal:e.signal,mode:"cors",credentials:i?"include":"same-origin",redirect:"follow"}}function ue(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(L(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class de{_responseOrigin=null;constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=ne(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return j(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new fe(this),this._fullRequestReader}getRangeReader(t,i){if(i<=this._progressiveDataLength)return null;const e=new pe(this,t,i);return this._rangeRequestReaders.push(e),e}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class fe{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const i=t.source;this._withCredentials=i.withCredentials||!1,this._contentLength=i.length,this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange;const e=new Headers(t.headers),s=i.url;fetch(s,le(e,this._withCredentials,this._abortController)).then((i=>{if(t._responseOrigin=re(i.url),!ce(i.status))throw ae(i.status,s);this._reader=i.body.getReader(),this._headersCapability.resolve();const e=i.headers,{allowRangeRequests:n,suggestedLength:r}=oe({responseHeaders:e,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=r||this._contentLength,this._filename=he(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new q("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:i}=await this._reader.read();return i?{value:t,done:i}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:ue(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class pe{constructor(t,i,e){this._stream=t,this._reader=null,this._loaded=0;const s=t.source;this._withCredentials=s.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!s.disableStream,this._abortController=new AbortController;const n=new Headers(t.headers);n.append("Range",`bytes=${i}-${e-1}`);const r=s.url;fetch(r,le(n,this._withCredentials,this._abortController)).then((i=>{const e=re(i.url);if(e!==t._responseOrigin)throw new Error(`Expected range response-origin "${e}" to match "${t._responseOrigin}".`);if(!ce(i.status))throw ae(i.status,r);this._readCapability.resolve(),this._reader=i.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:i}=await this._reader.read();return i?{value:t,done:i}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:ue(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class ge{_responseOrigin=null;constructor({url:t,httpHeaders:i,withCredentials:e}){this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=ne(this.isHttp,i),this.withCredentials=e||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){const i=new XMLHttpRequest,e=this.currXhrId++,s=this.pendingRequests[e]={xhr:i};i.open("GET",this.url),i.withCredentials=this.withCredentials;for(const[t,e]of this.headers)i.setRequestHeader(t,e);return this.isHttp&&"begin"in t&&"end"in t?(i.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),s.expectedStatus=206):s.expectedStatus=200,i.responseType="arraybuffer",j(t.onError,"Expected `onError` callback to be provided."),i.onerror=()=>{t.onError(i.status)},i.onreadystatechange=this.onStateChange.bind(this,e),i.onprogress=this.onProgress.bind(this,e),s.onHeadersReceived=t.onHeadersReceived,s.onDone=t.onDone,s.onError=t.onError,s.onProgress=t.onProgress,i.send(null),e}onProgress(t,i){const e=this.pendingRequests[t];e&&e.onProgress?.(i)}onStateChange(t,i){const e=this.pendingRequests[t];if(!e)return;const s=e.xhr;if(s.readyState>=2&&e.onHeadersReceived&&(e.onHeadersReceived(),delete e.onHeadersReceived),4!==s.readyState)return;if(!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===s.status&&this.isHttp)return void e.onError(s.status);const n=s.status||200;if((200!==n||206!==e.expectedStatus)&&n!==e.expectedStatus)return void e.onError(s.status);const r=function(t){const i=t.response;return"string"!=typeof i?i:J(i).buffer}(s);if(206===n){const t=s.getResponseHeader("Content-Range"),i=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);i?e.onDone({begin:parseInt(i[1],10),chunk:r}):(L('Missing or invalid "Content-Range" header.'),e.onError(0))}else r?e.onDone({begin:0,chunk:r}):e.onError(s.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const i=this.pendingRequests[t].xhr;delete this.pendingRequests[t],i.abort()}}class we{constructor(t){this._source=t,this._manager=new ge(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const i=this._rangeRequestReaders.indexOf(t);i>=0&&this._rangeRequestReaders.splice(i,1)}getFullReader(){return j(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new me(this._manager,this._source),this._fullRequestReader}getRangeReader(t,i){const e=new Ae(this._manager,t,i);return e.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(e),e}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class me{constructor(t,i){this._manager=t,this._url=i.url,this._fullRequestId=t.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._contentLength=i.length,this._rangeChunkSize=i.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,i=this._manager.getRequestXhr(t);this._manager._responseOrigin=re(i.responseURL);const e=i.getAllResponseHeaders(),s=new Headers(e?e.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map((t=>{const[i,...e]=t.split(": ");return[i,e.join(": ")]})):[]),{allowRangeRequests:n,suggestedLength:r}=oe({responseHeaders:s,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=r||this._contentLength,this._filename=he(s),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=ae(t,this._url),this._headersCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class Ae{constructor(t,i,e){this._manager=t,this._url=t.url,this._requestId=t.request({begin:i,end:e,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){const t=re(this._manager.getRequestXhr(this._requestId)?.responseURL);t!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(t){const i=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:i,done:!1}):this._queuedChunk=i,this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError??=ae(t,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const be=/^[a-z][a-z0-9\-+.]+:/i;class ve{constructor(t){this.source=t,this.url=function(t){if(be.test(t))return new URL(t);const i=process.getBuiltinModule("url");return new URL(i.pathToFileURL(t))}(t.url),j("file:"===this.url.protocol,"PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return j(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new ye(this),this._fullRequestReader}getRangeReader(t,i){if(i<=this._progressiveDataLength)return null;const e=new xe(this,t,i);return this._rangeRequestReaders.push(e),e}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class ye{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const i=t.source;this._contentLength=i.length,this._loaded=0,this._filename=null,this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const e=process.getBuiltinModule("fs");e.promises.lstat(this._url).then((t=>{this._contentLength=t.size,this._setReadableStream(e.createReadStream(this._url)),this._headersCapability.resolve()}),(t=>{"ENOENT"===t.code&&(t=ae(0,this._url.href)),this._storedError=t,this._headersCapability.reject(t)}))}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new q("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class xe{constructor(t,i,e){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!t.source.disableStream;const s=process.getBuiltinModule("fs");this._setReadableStream(s.createReadStream(this._url,{start:i,end:e-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),this._storedError&&this._readableStream.destroy(this._storedError)}}const Me=Symbol("INITIAL_DATA");class ke{#Ye=Object.create(null);#Qe(t){return this.#Ye[t]||={...Promise.withResolvers(),data:Me}}get(t,i=null){if(i){const e=this.#Qe(t);return e.promise.then((()=>i(e.data))),null}const e=this.#Ye[t];if(!e||e.data===Me)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return e.data}has(t){const i=this.#Ye[t];return!!i&&i.data!==Me}delete(t){const i=this.#Ye[t];return!(!i||i.data===Me||(delete this.#Ye[t],0))}resolve(t,i=null){const e=this.#Qe(t);e.data=i,e.resolve()}clear(){for(const t in this.#Ye){const{data:i}=this.#Ye[t];i?.bitmap?.close()}this.#Ye=Object.create(null)}*[Symbol.iterator](){for(const t in this.#Ye){const{data:i}=this.#Ye[t];i!==Me&&(yield[t,i])}}}class Ee{#qe=Promise.withResolvers();#wt=null;#Ke=!1;#Je=!!globalThis.FontInspector?.enabled;#Ze=null;#ts=null;#is=0;#es=0;#ss=null;#ns=null;#rs=0;#os=0;#hs=Object.create(null);#as=[];#cs=null;#ls=[];#us=new WeakMap;#ds=null;static#fs=new Map;static#ps=new Map;static#gs=new WeakMap;static#ws=null;static#ms=new Set;constructor({textContentSource:t,container:i,viewport:e}){if(t instanceof ReadableStream)this.#cs=t;else{if("object"!=typeof t)throw new Error('No "textContentSource" parameter specified.');this.#cs=new ReadableStream({start(i){i.enqueue(t),i.close()}})}this.#wt=this.#ns=i,this.#os=e.scale*Tt.pixelRatio,this.#rs=e.rotation,this.#ts={div:null,properties:null,ctx:null};const{pageWidth:s,pageHeight:n,pageX:r,pageY:o}=e.rawDims;this.#ds=[1,0,0,-1,-r,o+n],this.#es=s,this.#is=n,Ee.#As(),_t(i,e),this.#qe.promise.finally((()=>{Ee.#ms.delete(this),this.#ts=null,this.#hs=null})).catch((()=>{}))}static get fontFamilyMap(){const{isWindows:t,isFirefox:i}=Z.platform;return H(this,"fontFamilyMap",new Map([["sans-serif",(t&&i?"Calibri, ":"")+"sans-serif"],["monospace",(t&&i?"Lucida Console, ":"")+"monospace"]]))}render(){const t=()=>{this.#ss.read().then((({value:i,done:e})=>{e?this.#qe.resolve():(this.#Ze??=i.lang,Object.assign(this.#hs,i.styles),this.#bs(i.items),t())}),this.#qe.reject)};return this.#ss=this.#cs.getReader(),Ee.#ms.add(this),t(),this.#qe.promise}update({viewport:t,onBefore:i=null}){const e=t.scale*Tt.pixelRatio,s=t.rotation;if(s!==this.#rs&&(i?.(),this.#rs=s,_t(this.#ns,{rotation:s})),e!==this.#os){i?.(),this.#os=e;const t={div:null,properties:null,ctx:Ee.#vs(this.#Ze)};for(const i of this.#ls)t.properties=this.#us.get(i),t.div=i,this.#ys(t)}}cancel(){const t=new q("TextLayer task cancelled.");this.#ss?.cancel(t).catch((()=>{})),this.#ss=null,this.#qe.reject(t)}get textDivs(){return this.#ls}get textContentItemsStr(){return this.#as}#bs(t){if(this.#Ke)return;this.#ts.ctx??=Ee.#vs(this.#Ze);const i=this.#ls,e=this.#as;for(const s of t){if(i.length>1e5)return L("Ignoring additional textDivs for performance reasons."),void(this.#Ke=!0);if(void 0!==s.str)e.push(s.str),this.#xs(s);else if("beginMarkedContentProps"===s.type||"beginMarkedContent"===s.type){const t=this.#wt;this.#wt=document.createElement("span"),this.#wt.classList.add("markedContent"),null!==s.id&&this.#wt.setAttribute("id",`${s.id}`),t.append(this.#wt)}else"endMarkedContent"===s.type&&(this.#wt=this.#wt.parentNode)}}#xs(t){const i=document.createElement("span"),e={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};this.#ls.push(i);const s=it.transform(this.#ds,t.transform);let n=Math.atan2(s[1],s[0]);const r=this.#hs[t.fontName];r.vertical&&(n+=Math.PI/2);let o=this.#Je&&r.fontSubstitution||r.fontFamily;o=Ee.fontFamilyMap.get(o)||o;const h=Math.hypot(s[2],s[3]),a=h*Ee.#Ms(o,r,this.#Ze);let c,l;0===n?(c=s[4],l=s[5]-a):(c=s[4]+a*Math.sin(n),l=s[5]-a*Math.cos(n));const u="calc(var(--total-scale-factor) *",d=i.style;this.#wt===this.#ns?(d.left=`${(100*c/this.#es).toFixed(2)}%`,d.top=`${(100*l/this.#is).toFixed(2)}%`):(d.left=`${u}${c.toFixed(2)}px)`,d.top=`${u}${l.toFixed(2)}px)`),d.fontSize=`${u}${(Ee.#ws*h).toFixed(2)}px)`,d.fontFamily=o,e.fontSize=h,i.setAttribute("role","presentation"),i.textContent=t.str,i.dir=t.dir,this.#Je&&(i.dataset.fontName=r.fontSubstitutionLoadedName||t.fontName),0!==n&&(e.angle=n*(180/Math.PI));let f=!1;if(t.str.length>1)f=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const i=Math.abs(t.transform[0]),e=Math.abs(t.transform[3]);i!==e&&Math.max(i,e)/Math.min(i,e)>1.5&&(f=!0)}if(f&&(e.canvasWidth=r.vertical?t.height:t.width),this.#us.set(i,e),this.#ts.div=i,this.#ts.properties=e,this.#ys(this.#ts),e.hasText&&this.#wt.append(i),e.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),this.#wt.append(t)}}#ys(t){const{div:i,properties:e,ctx:s}=t,{style:n}=i;let r="";if(Ee.#ws>1&&(r=`scale(${1/Ee.#ws})`),0!==e.canvasWidth&&e.hasText){const{fontFamily:t}=n,{canvasWidth:o,fontSize:h}=e;Ee.#ks(s,h*this.#os,t);const{width:a}=s.measureText(i.textContent);a>0&&(r=`scaleX(${o*this.#os/a}) ${r}`)}0!==e.angle&&(r=`rotate(${e.angle}deg) ${r}`),r.length>0&&(n.transform=r)}static cleanup(){if(!(this.#ms.size>0)){this.#fs.clear();for(const{canvas:t}of this.#ps.values())t.remove();this.#ps.clear()}}static#vs(t=null){let i=this.#ps.get(t||="");if(!i){const e=document.createElement("canvas");e.className="hiddenCanvasElement",e.lang=t,document.body.append(e),i=e.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#ps.set(t,i),this.#gs.set(i,{size:0,family:""})}return i}static#ks(t,i,e){const s=this.#gs.get(t);i===s.size&&e===s.family||(t.font=`${i}px ${e}`,s.size=i,s.family=e)}static#As(){if(null!==this.#ws)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),this.#ws=t.getBoundingClientRect().height,t.remove()}static#Ms(t,i,e){const s=this.#fs.get(t);if(s)return s;const n=this.#vs(e);n.canvas.width=n.canvas.height=30,this.#ks(n,30,t);const r=n.measureText(""),o=r.fontBoundingBoxAscent,h=Math.abs(r.fontBoundingBoxDescent);n.canvas.width=n.canvas.height=0;let a=.8;return o?a=o/(o+h):(Z.platform.isFirefox&&L("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),i.ascent?a=i.ascent:i.descent&&(a=1+i.descent)),this.#fs.set(t,a),a}}class Se{static textContent(t){const i=[],e={items:i,styles:Object.create(null)};return function t(e){if(!e)return;let s=null;const n=e.name;if("#text"===n)s=e.value;else{if(!Se.shouldBuildText(n))return;e?.attributes?.textContent?s=e.attributes.textContent:e.value&&(s=e.value)}if(null!==s&&i.push({str:s}),e.children)for(const i of e.children)t(i)}(t),e}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}function _e(t={}){"string"==typeof t||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const i=new Te,{docId:e}=i,s=t.url?function(t){if(t instanceof URL)return t.href;if("string"==typeof t){if(x)return t;const i=URL.parse(t,window.location);if(i)return i.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url):null,n=t.data?function(t){if(x&&"undefined"!=typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return J(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"==typeof t&&!isNaN(t?.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(t.data):null,r=t.httpHeaders||null,o=!0===t.withCredentials,h=t.password??null,a=t.range instanceof Ce?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:65536;let l=t.worker instanceof Ne?t.worker:null;const u=t.verbosity,d="string"!=typeof t.docBaseUrl||pt(t.docBaseUrl)?null:t.docBaseUrl,f=Jt(t.cMapUrl),p=!1!==t.cMapPacked,g=t.CMapReaderFactory||(x?Ai:ai),w=Jt(t.iccUrl),m=Jt(t.standardFontDataUrl),A=t.StandardFontDataFactory||(x?bi:di),b=Jt(t.wasmUrl),v=t.WasmFactory||(x?vi:pi),y=!0!==t.stopAtErrors,M=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,k=!1!==t.isEvalSupported,E="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!x,S="boolean"==typeof t.isImageDecoderSupported?t.isImageDecoderSupported:!x&&(Z.platform.isFirefox||!globalThis.chrome),_=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,T="boolean"==typeof t.disableFontFace?t.disableFontFace:x,C=!0===t.fontExtraProperties,P=!0===t.enableXfa,R=t.ownerDocument||globalThis.document,N=!0===t.disableRange,D=!0===t.disableStream,I=!0===t.disableAutoFetch,O=!0===t.pdfBug,$=t.CanvasFactory||(x?mi:oi),L=t.FilterFactory||(x?wi:li),B=!0===t.enableHWA,j=!1!==t.useWasm,U=a?a.length:t.length??NaN,z="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!x&&!T,H="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:!!(g===ai&&A===di&&v===pi&&f&&m&&b&&bt(f,document.baseURI)&&bt(m,document.baseURI)&&bt(b,document.baseURI));F(u);const G={canvasFactory:new $({ownerDocument:R,enableHWA:B}),filterFactory:new L({docId:e,ownerDocument:R}),cMapReaderFactory:H?null:new g({baseUrl:f,isCompressed:p}),standardFontDataFactory:H?null:new A({baseUrl:m}),wasmFactory:H?null:new v({baseUrl:b})};l||(l=Ne.create({verbosity:u,port:qi.workerPort}),i._worker=l);const W={docId:e,apiVersion:"5.3.31",data:n,password:h,disableAutoFetch:I,rangeChunkSize:c,length:U,docBaseUrl:d,enableXfa:P,evaluatorOptions:{maxImageSize:M,disableFontFace:T,ignoreErrors:y,isEvalSupported:k,isOffscreenCanvasSupported:E,isImageDecoderSupported:S,canvasMaxAreaInBytes:_,fontExtraProperties:C,useSystemFonts:z,useWasm:j,useWorkerFetch:H,cMapUrl:f,iccUrl:w,standardFontDataUrl:m,wasmUrl:b}},V={ownerDocument:R,pdfBug:O,styleElement:null,loadingParams:{disableAutoFetch:I,enableXfa:P}};return l.promise.then((function(){if(i.destroyed)throw new Error("Loading aborted");if(l.destroyed)throw new Error("Worker was destroyed");const t=l.messageHandler.sendWithPromise("GetDocRequest",W,n?[n.buffer]:null);let h;if(a)h=new ie(a,{disableRange:N,disableStream:D});else if(!n){if(!s)throw new Error("getDocument - no `url` parameter provided.");const t=bt(s)?de:x?ve:we;h=new t({url:s,length:U,httpHeaders:r,withCredentials:o,rangeChunkSize:c,disableRange:N,disableStream:D})}return t.then((t=>{if(i.destroyed)throw new Error("Loading aborted");if(l.destroyed)throw new Error("Worker was destroyed");const s=new ni(e,t,l.port),n=new De(s,i,h,V,G);i._transport=n,s.send("Ready",null)}))})).catch(i._capability.reject),i}class Te{static#Ae=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId="d"+Te.#Ae++;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await(this._transport?.destroy())}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}}class Ce{#qe=Promise.withResolvers();#Es=[];#Ss=[];#_s=[];#Ts=[];constructor(t,i,e=!1,s=null){this.length=t,this.initialData=i,this.progressiveDone=e,this.contentDispositionFilename=s}addRangeListener(t){this.#Ts.push(t)}addProgressListener(t){this.#_s.push(t)}addProgressiveReadListener(t){this.#Ss.push(t)}addProgressiveDoneListener(t){this.#Es.push(t)}onDataRange(t,i){for(const e of this.#Ts)e(t,i)}onDataProgress(t,i){this.#qe.promise.then((()=>{for(const e of this.#_s)e(t,i)}))}onDataProgressiveRead(t){this.#qe.promise.then((()=>{for(const i of this.#Ss)i(t)}))}onDataProgressiveDone(){this.#qe.promise.then((()=>{for(const t of this.#Es)t()}))}transportReady(){this.#qe.resolve()}requestDataRange(t,i){B("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class Pe{constructor(t,i){this._pdfInfo=t,this._transport=i}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return H(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(i)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class Re{#Cs=!1;constructor(t,i,e,s=!1){this._pageIndex=t,this._pageInfo=i,this._transport=e,this._stats=s?new At:null,this._pdfBug=s,this.commonObjs=e.commonObjs,this.objs=new ke,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:i=this.rotate,offsetX:e=0,offsetY:s=0,dontFlip:n=!1}={}){return new dt({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:i,offsetX:e,offsetY:s,dontFlip:n})}getAnnotations({intent:t="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,i)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return H(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:i,intent:e="display",annotationMode:s=E.ENABLE,transform:n=null,background:r=null,optionalContentConfigPromise:o=null,annotationCanvasMap:h=null,pageColors:a=null,printAnnotationStorage:c=null,isEditing:l=!1}){this._stats?.time("Overall");const u=this._transport.getRenderingIntent(e,s,c,l),{renderingIntent:d,cacheKey:f}=u;this.#Cs=!1,o||=this._transport.getOptionalContentConfig(d);let p=this._intentStates.get(f);p||(p=Object.create(null),this._intentStates.set(f,p)),p.streamReaderCancelTimeout&&(clearTimeout(p.streamReaderCancelTimeout),p.streamReaderCancelTimeout=null);const g=!!(4&d);p.displayReadyCapability||(p.displayReadyCapability=Promise.withResolvers(),p.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(u));const w=t=>{p.renderTasks.delete(m),g&&(this.#Cs=!0),this.#Ps(),t?(m.capability.reject(t),this._abortOperatorList({intentState:p,reason:t instanceof Error?t:new Error(t)})):m.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},m=new Fe({callback:w,params:{canvasContext:t,viewport:i,transform:n,background:r},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:h,operatorList:p.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!g,pdfBug:this._pdfBug,pageColors:a});(p.renderTasks||=new Set).add(m);const A=m.task;return Promise.all([p.displayReadyCapability.promise,o]).then((([t,i])=>{if(this.destroyed)w();else{if(this._stats?.time("Rendering"),!(i.renderingIntent&d))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");m.initializeGraphics({transparency:t,optionalContentConfig:i}),m.operatorListChanged()}})).catch(w),A}getOperatorList({intent:t="display",annotationMode:i=E.ENABLE,printAnnotationStorage:e=null,isEditing:s=!1}={}){const n=this._transport.getRenderingIntent(t,i,e,s,!0);let r,o=this._intentStates.get(n.cacheKey);return o||(o=Object.create(null),this._intentStates.set(n.cacheKey,o)),o.opListReadCapability||(r=Object.create(null),r.operatorListChanged=function(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(r))},o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||=new Set).add(r),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(n)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:i=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===i},{highWaterMark:100,size:t=>t.items.length})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then((t=>Se.textContent(t)));const i=this.streamTextContent(t);return new Promise((function(t,e){const s=i.getReader(),n={items:[],styles:Object.create(null),lang:null};!function i(){s.read().then((function({value:e,done:s}){s?t(n):(n.lang??=e.lang,Object.assign(n.styles,e.styles),n.items.push(...e.items),i())}),e)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const i of this._intentStates.values())if(this._abortOperatorList({intentState:i,reason:new Error("Page was destroyed."),force:!0}),!i.opListReadCapability)for(const e of i.renderTasks)t.push(e.completed),e.cancel();return this.objs.clear(),this.#Cs=!1,Promise.all(t)}cleanup(t=!1){this.#Cs=!0;const i=this.#Ps();return t&&i&&(this._stats&&=new At),i}#Ps(){if(!this.#Cs||this.destroyed)return!1;for(const{renderTasks:t,operatorList:i}of this._intentStates.values())if(t.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#Cs=!1,!0}_startRenderPage(t,i){const e=this._intentStates.get(i);e&&(this._stats?.timeEnd("Page Request"),e.displayReadyCapability?.resolve(t))}_renderPageChunk(t,i){for(let e=0,s=t.length;e<s;e++)i.operatorList.fnArray.push(t.fnArray[e]),i.operatorList.argsArray.push(t.argsArray[e]);i.operatorList.lastChunk=t.lastChunk,i.operatorList.separateAnnots=t.separateAnnots;for(const t of i.renderTasks)t.operatorListChanged();t.lastChunk&&this.#Ps()}_pumpOperatorList({renderingIntent:t,cacheKey:i,annotationStorageSerializable:e,modifiedIds:s}){const{map:n,transfer:r}=e,o=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:i,annotationStorage:n,modifiedIds:s},r).getReader(),h=this._intentStates.get(i);h.streamReader=o;const a=()=>{o.read().then((({value:t,done:i})=>{i?h.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,h),a())}),(t=>{if(h.streamReader=null,!this._transport.destroyed){if(h.operatorList){h.operatorList.lastChunk=!0;for(const t of h.renderTasks)t.operatorListChanged();this.#Ps()}if(h.displayReadyCapability)h.displayReadyCapability.reject(t);else{if(!h.opListReadCapability)throw t;h.opListReadCapability.reject(t)}}}))};a()}_abortOperatorList({intentState:t,reason:i,force:e=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!e){if(t.renderTasks.size>0)return;if(i instanceof ft){let e=100;return i.extraDelay>0&&i.extraDelay<1e3&&(e+=i.extraDelay),void(t.streamReaderCancelTimeout=setTimeout((()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:i,force:!0})}),e))}}if(t.streamReader.cancel(new q(i.message)).catch((()=>{})),t.streamReader=null,!this._transport.destroyed){for(const[i,e]of this._intentStates)if(e===t){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}}class Ne{#qe=Promise.withResolvers();#Rs=null;#Fe=null;#Ns=null;static#Ds=0;static#Is=!1;static#Fs=new WeakMap;static{x&&(this.#Is=!0,qi.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(t,i)=>{const e=URL.parse(t);if(!e?.origin||"null"===e.origin)return!1;const s=new URL(i,e);return e.origin===s.origin},this._createCDNWrapper=t=>URL.createObjectURL(new Blob([`await import("${t}");`],{type:"text/javascript"})),this.fromPort=t=>{if(console.log("Deprecated API usage: `PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.create(t)}}constructor({name:t=null,port:i=null,verbosity:e=O()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=e,i){if(Ne.#Fs.has(i))throw new Error("Cannot use more than one PDFWorker per port.");Ne.#Fs.set(i,this),this.#Os(i)}else this.#$s()}get promise(){return this.#qe.promise}#Ls(){this.#qe.resolve(),this.#Rs.send("configure",{verbosity:this.verbosity})}get port(){return this.#Fe}get messageHandler(){return this.#Rs}#Os(t){this.#Fe=t,this.#Rs=new ni("main","worker",t),this.#Rs.on("ready",(()=>{})),this.#Ls()}#$s(){if(Ne.#Is||Ne.#Bs)return void this.#js();let{workerSrc:t}=Ne;try{Ne._isSameOrigin(window.location,t)||(t=Ne._createCDNWrapper(new URL(t,window.location).href));const i=new Worker(t,{type:"module"}),e=new ni("main","worker",i),s=()=>{n.abort(),e.destroy(),i.terminate(),this.destroyed?this.#qe.reject(new Error("Worker was destroyed")):this.#js()},n=new AbortController;i.addEventListener("error",(()=>{this.#Ns||s()}),{signal:n.signal}),e.on("test",(t=>{n.abort(),!this.destroyed&&t?(this.#Rs=e,this.#Fe=i,this.#Ns=i,this.#Ls()):s()})),e.on("ready",(()=>{if(n.abort(),this.destroyed)s();else try{r()}catch{this.#js()}}));const r=()=>{const t=new Uint8Array;e.send("test",t,[t.buffer])};return void r()}catch{$("The worker has been disabled.")}this.#js()}#js(){Ne.#Is||(L("Setting up fake worker."),Ne.#Is=!0),Ne._setupFakeWorkerGlobal.then((t=>{if(this.destroyed)return void this.#qe.reject(new Error("Worker was destroyed"));const i=new ii;this.#Fe=i;const e="fake"+Ne.#Ds++,s=new ni(e+"_worker",e,i);t.setup(s,i),this.#Rs=new ni(e,e+"_worker",i),this.#Ls()})).catch((t=>{this.#qe.reject(new Error(`Setting up fake worker failed: "${t.message}".`))}))}destroy(){this.destroyed=!0,this.#Ns?.terminate(),this.#Ns=null,Ne.#Fs.delete(this.#Fe),this.#Fe=null,this.#Rs?.destroy(),this.#Rs=null}static create(t){const i=this.#Fs.get(t?.port);if(i){if(i._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return i}return new Ne(t)}static get workerSrc(){if(qi.workerSrc)return qi.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#Bs(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return H(this,"_setupFakeWorkerGlobal",(async()=>this.#Bs?this.#Bs:(await import(this.workerSrc)).WorkerMessageHandler)())}}class De{#Us=new Map;#zs=new Map;#Hs=new Map;#Gs=new Map;#Ws=null;constructor(t,i,e,s,n){this.messageHandler=t,this.loadingTask=i,this.commonObjs=new ke,this.fontLoader=new qt({ownerDocument:s.ownerDocument,styleElement:s.styleElement}),this.loadingParams=s.loadingParams,this._params=s,this.canvasFactory=n.canvasFactory,this.filterFactory=n.filterFactory,this.cMapReaderFactory=n.cMapReaderFactory,this.standardFontDataFactory=n.standardFontDataFactory,this.wasmFactory=n.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=e,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#Vs(t,i=null){const e=this.#Us.get(t);if(e)return e;const s=this.messageHandler.sendWithPromise(t,i);return this.#Us.set(t,s),s}get annotationStorage(){return H(this,"annotationStorage",new Yt)}getRenderingIntent(t,i=E.ENABLE,e=null,s=!1,n=!1){let r=2,o=Xt;switch(t){case"any":r=1;break;case"display":break;case"print":r=4;break;default:L(`getRenderingIntent - invalid intent: ${t}`)}const h=4&r&&e instanceof Qt?e:this.annotationStorage;switch(i){case E.DISABLE:r+=64;break;case E.ENABLE:break;case E.ENABLE_FORMS:r+=16;break;case E.ENABLE_STORAGE:r+=32,o=h.serializable;break;default:L(`getRenderingIntent - invalid annotationMode: ${i}`)}s&&(r+=128),n&&(r+=256);const{ids:a,hash:c}=h.modifiedIds;return{renderingIntent:r,cacheKey:[r,o.hash,c].join("_"),annotationStorageSerializable:o,modifiedIds:a}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#Ws?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const i of this.#zs.values())t.push(i._destroy());this.#zs.clear(),this.#Hs.clear(),this.#Gs.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const i=this.messageHandler.sendWithPromise("Terminate",null);return t.push(i),Promise.all(t).then((()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#Us.clear(),this.filterFactory.destroy(),Ee.cleanup(),this._networkStream?.cancelAllRequests(new q("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:i}=this;t.on("GetReader",((t,i)=>{j(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},i.onPull=()=>{this._fullReader.read().then((function({value:t,done:e}){e?i.close():(j(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(t),1,[t]))})).catch((t=>{i.error(t)}))},i.onCancel=t=>{this._fullReader.cancel(t),i.ready.catch((t=>{if(!this.destroyed)throw t}))}})),t.on("ReaderHeadersReady",(async()=>{await this._fullReader.headersReady;const{isStreamingSupported:t,isRangeSupported:e,contentLength:s}=this._fullReader;return t&&e||(this._lastProgress&&i.onProgress?.(this._lastProgress),this._fullReader.onProgress=t=>{i.onProgress?.({loaded:t.loaded,total:t.total})}),{isStreamingSupported:t,isRangeSupported:e,contentLength:s}})),t.on("GetRangeReader",((t,i)=>{j(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const e=this._networkStream.getRangeReader(t.begin,t.end);e?(i.onPull=()=>{e.read().then((function({value:t,done:e}){e?i.close():(j(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(t),1,[t]))})).catch((t=>{i.error(t)}))},i.onCancel=t=>{e.cancel(t),i.ready.catch((t=>{if(!this.destroyed)throw t}))}):i.close()})),t.on("GetDoc",(({pdfInfo:t})=>{this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,i._capability.resolve(new Pe(t,this))})),t.on("DocException",(t=>{i._capability.reject(si(t))})),t.on("PasswordRequest",(t=>{this.#Ws=Promise.withResolvers();try{if(!i.onPassword)throw si(t);i.onPassword((t=>{t instanceof Error?this.#Ws.reject(t):this.#Ws.resolve({password:t})}),t.code)}catch(t){this.#Ws.reject(t)}return this.#Ws.promise})),t.on("DataLoaded",(t=>{i.onProgress?.({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)})),t.on("StartRenderPage",(t=>{this.destroyed||this.#zs.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)})),t.on("commonobj",(([i,e,s])=>{if(this.destroyed)return null;if(this.commonObjs.has(i))return null;switch(e){case"Font":if("error"in s){const t=s.error;L(`Error during font loading: ${t}`),this.commonObjs.resolve(i,t);break}const n=this._params.pdfBug&&globalThis.FontInspector?.enabled?(t,i)=>globalThis.FontInspector.fontAdded(t,i):null,r=new Kt(s,n);this.fontLoader.bind(r).catch((()=>t.sendWithPromise("FontFallback",{id:i}))).finally((()=>{!r.fontExtraProperties&&r.data&&(r.data=null),this.commonObjs.resolve(i,r)}));break;case"CopyLocalImage":const{imageRef:o}=s;j(o,"The imageRef must be defined.");for(const t of this.#zs.values())for(const[,e]of t.objs)if(e?.ref===o)return e.dataLen?(this.commonObjs.resolve(i,structuredClone(e)),e.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,s);break;default:throw new Error(`Got unknown common object type ${e}`)}return null})),t.on("obj",(([t,i,e,s])=>{if(this.destroyed)return;const n=this.#zs.get(i);if(!n.objs.has(t))if(0!==n._intentStates.size)switch(e){case"Image":case"Pattern":n.objs.resolve(t,s);break;default:throw new Error(`Got unknown object type ${e}`)}else s?.bitmap?.close()})),t.on("DocProgress",(t=>{this.destroyed||i.onProgress?.({loaded:t.loaded,total:t.total})})),t.on("FetchBinaryData",(async t=>{if(this.destroyed)throw new Error("Worker was destroyed.");const i=this[t.type];if(!i)throw new Error(`${t.type} not initialized, see the \`useWorkerFetch\` parameter.`);return i.fetch(t)}))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&L("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:i}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},i).finally((()=>{this.annotationStorage.resetModified()}))}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const i=t-1,e=this.#Hs.get(i);if(e)return e;const s=this.messageHandler.sendWithPromise("GetPage",{pageIndex:i}).then((e=>{if(this.destroyed)throw new Error("Transport destroyed");e.refStr&&this.#Gs.set(e.refStr,t);const s=new Re(i,e,this,this._params.pdfBug);return this.#zs.set(i,s),s}));return this.#Hs.set(i,s),s}getPageIndex(t){return Zt(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,i){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:i})}getFieldObjects(){return this.#Vs("GetFieldObjects")}hasJSActions(){return this.#Vs("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#Vs("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#Vs("GetOptionalContentConfig").then((i=>new te(i,t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",i=this.#Us.get(t);if(i)return i;const e=this.messageHandler.sendWithPromise(t,null).then((t=>({info:t[0],metadata:t[1]?new Ki(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})));return this.#Us.set(t,e),e}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#zs.values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#Us.clear(),this.filterFactory.destroy(!0),Ee.cleanup()}}cachedPageNumber(t){return Zt(t)?this.#Gs.get(0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`)??null:null}}class Ie{#Xs=null;onContinue=null;onError=null;constructor(t){this.#Xs=t}get promise(){return this.#Xs.capability.promise}cancel(t=0){this.#Xs.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#Xs.operatorList;if(!t)return!1;const{annotationCanvasMap:i}=this.#Xs;return t.form||t.canvas&&i?.size>0}}class Fe{#Ys=null;static#Qs=new WeakSet;constructor({callback:t,params:i,objs:e,commonObjs:s,annotationCanvasMap:n,operatorList:r,pageIndex:o,canvasFactory:h,filterFactory:a,useRequestAnimationFrame:c=!1,pdfBug:l=!1,pageColors:u=null}){this.callback=t,this.params=i,this.objs=e,this.commonObjs=s,this.annotationCanvasMap=n,this.operatorListIdx=null,this.operatorList=r,this._pageIndex=o,this.canvasFactory=h,this.filterFactory=a,this._pdfBug=l,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&"undefined"!=typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Ie(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=i.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics({transparency:t=!1,optionalContentConfig:i}){if(this.cancelled)return;if(this._canvas){if(Fe.#Qs.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");Fe.#Qs.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:e,viewport:s,transform:n,background:r}=this.params;this.gfx=new Qi(e,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:i},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:n,viewport:s,transparency:t,background:r}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,i=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#Ys&&(window.cancelAnimationFrame(this.#Ys),this.#Ys=null),Fe.#Qs.delete(this._canvas),t||=new ft(`Rendering cancelled, page ${this._pageIndex+1}`,i),this.callback(t),this.task.onError?.(t)}operatorListChanged(){this.graphicsReady?(this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#Ys=window.requestAnimationFrame((()=>{this.#Ys=null,this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),Fe.#Qs.delete(this._canvas),this.callback())))}}const Oe="5.3.31",$e="47ad820d9";function Le(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function Be(t){return Math.max(0,Math.min(255,255*t))}y(531);class je{static CMYK_G([t,i,e,s]){return["G",1-Math.min(1,.3*t+.59*e+.11*i+s)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return[t=Be(t),t,t]}static G_HTML([t]){const i=Le(t);return`#${i}${i}${i}`}static RGB_G([t,i,e]){return["G",.3*t+.59*i+.11*e]}static RGB_rgb(t){return t.map(Be)}static RGB_HTML(t){return`#${t.map(Le).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,i,e,s]){return["RGB",1-Math.min(1,t+s),1-Math.min(1,e+s),1-Math.min(1,i+s)]}static CMYK_rgb([t,i,e,s]){return[Be(1-Math.min(1,t+s)),Be(1-Math.min(1,e+s)),Be(1-Math.min(1,i+s))]}static CMYK_HTML(t){const i=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(i)}static RGB_CMYK([t,i,e]){const s=1-t,n=1-i,r=1-e;return["CMYK",s,n,r,Math.min(s,n,r)]}}class Ue{create(t,i,e=!1){if(t<=0||i<=0)throw new Error("Invalid SVG dimensions");const s=this._createSVG("svg:svg");return s.setAttribute("version","1.1"),e||(s.setAttribute("width",`${t}px`),s.setAttribute("height",`${i}px`)),s.setAttribute("preserveAspectRatio","none"),s.setAttribute("viewBox",`0 0 ${t} ${i}`),s}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){B("Abstract method `_createSVG` called.")}}class ze extends Ue{_createSVG(t){return document.createElementNS(ct,t)}}class He{static setupStorage(t,i,e,s,n){const r=s.getValue(i,{value:null});switch(e.name){case"textarea":if(null!==r.value&&(t.textContent=r.value),"print"===n)break;t.addEventListener("input",(t=>{s.setValue(i,{value:t.target.value})}));break;case"input":if("radio"===e.attributes.type||"checkbox"===e.attributes.type){if(r.value===e.attributes.xfaOn?t.setAttribute("checked",!0):r.value===e.attributes.xfaOff&&t.removeAttribute("checked"),"print"===n)break;t.addEventListener("change",(t=>{s.setValue(i,{value:t.target.getAttribute(t.target.checked?"xfaOn":"xfaOff")})}))}else{if(null!==r.value&&t.setAttribute("value",r.value),"print"===n)break;t.addEventListener("input",(t=>{s.setValue(i,{value:t.target.value})}))}break;case"select":if(null!==r.value){t.setAttribute("value",r.value);for(const t of e.children)t.attributes.value===r.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",(t=>{const e=t.target.options;s.setValue(i,{value:-1===e.selectedIndex?"":e[e.selectedIndex].value})}))}}static setAttributes({html:t,element:i,storage:e=null,intent:s,linkService:n}){const{attributes:r}=i,o=t instanceof HTMLAnchorElement;"radio"===r.type&&(r.name=`${r.name}-${s}`);for(const[i,e]of Object.entries(r))if(null!=e)switch(i){case"class":e.length&&t.setAttribute(i,e.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",e);break;case"style":Object.assign(t.style,e);break;case"textContent":t.textContent=e;break;default:(!o||"href"!==i&&"newWindow"!==i)&&t.setAttribute(i,e)}o&&n.addLinkAttributes(t,r.href,r.newWindow),e&&r.dataId&&this.setupStorage(t,r.dataId,i,e)}static render(t){const i=t.annotationStorage,e=t.linkService,s=t.xfaHtml,n=t.intent||"display",r=document.createElement(s.name);s.attributes&&this.setAttributes({html:r,element:s,intent:n,linkService:e});const o="richText"!==n,h=t.div;if(h.append(r),t.viewport){const i=`matrix(${t.viewport.transform.join(",")})`;h.style.transform=i}o&&h.setAttribute("class","xfaLayer xfaFont");const a=[];if(0===s.children.length){if(s.value){const t=document.createTextNode(s.value);r.append(t),o&&Se.shouldBuildText(s.name)&&a.push(t)}return{textDivs:a}}const c=[[s,-1,r]];for(;c.length>0;){const[t,s,r]=c.at(-1);if(s+1===t.children.length){c.pop();continue}const h=t.children[++c.at(-1)[1]];if(null===h)continue;const{name:l}=h;if("#text"===l){const t=document.createTextNode(h.value);a.push(t),r.append(t);continue}const u=h?.attributes?.xmlns?document.createElementNS(h.attributes.xmlns,l):document.createElement(l);if(r.append(u),h.attributes&&this.setAttributes({html:u,element:h,storage:i,intent:n,linkService:e}),h.children?.length>0)c.push([h,-1,u]);else if(h.value){const t=document.createTextNode(h.value);o&&Se.shouldBuildText(l)&&a.push(t),u.append(t)}}for(const t of h.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:a}}static update(t){const i=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=i,t.div.hidden=!1}}const Ge=1e3,We=new WeakSet;class Ve{static create(t){switch(t.data.annotationType){case P.LINK:return new Ye(t);case P.TEXT:return new Qe(t);case P.WIDGET:switch(t.data.fieldType){case"Tx":return new Ke(t);case"Btn":return t.data.radioButton?new ts(t):t.data.checkBox?new Ze(t):new is(t);case"Ch":return new es(t);case"Sig":return new Je(t)}return new qe(t);case P.POPUP:return new ss(t);case P.FREETEXT:return new rs(t);case P.LINE:return new os(t);case P.SQUARE:return new hs(t);case P.CIRCLE:return new as(t);case P.POLYLINE:return new cs(t);case P.CARET:return new us(t);case P.INK:return new ds(t);case P.POLYGON:return new ls(t);case P.HIGHLIGHT:return new fs(t);case P.UNDERLINE:return new ps(t);case P.SQUIGGLY:return new gs(t);case P.STRIKEOUT:return new ws(t);case P.STAMP:return new ms(t);case P.FILEATTACHMENT:return new As(t);default:return new Xe(t)}}}class Xe{#qs=null;#Ks=!1;#Js=null;constructor(t,{isRenderable:i=!1,ignoreBorder:e=!1,createQuadrilaterals:s=!1}={}){this.isRenderable=i,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,i&&(this.container=this._createContainer(e)),s&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:i,richText:e}){return!!(t?.str||i?.str||e?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return Xe._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#qs||={rect:this.data.rect.slice(0)};const{rect:i}=t;i&&this.#Zs(i),this.#Js?.popup.updateEdited(t)}resetEdited(){this.#qs&&(this.#Zs(this.#qs.rect),this.#Js?.popup.resetEdited(),this.#qs=null)}#Zs(t){const{container:{style:i},data:{rect:e,rotation:s},parent:{viewport:{rawDims:{pageWidth:n,pageHeight:r,pageX:o,pageY:h}}}}=this;e?.splice(0,4,...t),i.left=100*(t[0]-o)/n+"%",i.top=100*(r-t[3]+h)/r+"%",0===s?(i.width=100*(t[2]-t[0])/n+"%",i.height=100*(t[3]-t[1])/r+"%"):this.setRotation(s)}_createContainer(t){const{data:i,parent:{page:e,viewport:s}}=this,n=document.createElement("section");n.setAttribute("data-annotation-id",i.id),this instanceof qe||(n.tabIndex=Ge);const{style:r}=n;if(r.zIndex=this.parent.zIndex++,i.alternativeText&&(n.title=i.alternativeText),i.noRotate&&n.classList.add("norotate"),!i.rect||this instanceof ss){const{rotation:t}=i;return i.hasOwnCanvas||0===t||this.setRotation(t,n),n}const{width:o,height:h}=this;if(!t&&i.borderStyle.width>0){r.borderWidth=`${i.borderStyle.width}px`;const t=i.borderStyle.horizontalCornerRadius,e=i.borderStyle.verticalCornerRadius;switch(t>0||e>0?r.borderRadius=`calc(${t}px * var(--total-scale-factor)) / calc(${e}px * var(--total-scale-factor))`:this instanceof ts&&(r.borderRadius=`calc(${o}px * var(--total-scale-factor)) / calc(${h}px * var(--total-scale-factor))`),i.borderStyle.style){case 1:r.borderStyle="solid";break;case 2:r.borderStyle="dashed";break;case 3:L("Unimplemented border style: beveled");break;case 4:L("Unimplemented border style: inset");break;case 5:r.borderBottomStyle="solid"}const s=i.borderColor||null;s?(this.#Ks=!0,r.borderColor=it.makeHexColor(0|s[0],0|s[1],0|s[2])):r.borderWidth=0}const a=it.normalizeRect([i.rect[0],e.view[3]-i.rect[1]+e.view[1],i.rect[2],e.view[3]-i.rect[3]+e.view[1]]),{pageWidth:c,pageHeight:l,pageX:u,pageY:d}=s.rawDims;r.left=100*(a[0]-u)/c+"%",r.top=100*(a[1]-d)/l+"%";const{rotation:f}=i;return i.hasOwnCanvas||0===f?(r.width=100*o/c+"%",r.height=100*h/l+"%"):this.setRotation(f,n),n}setRotation(t,i=this.container){if(!this.data.rect)return;const{pageWidth:e,pageHeight:s}=this.parent.viewport.rawDims;let{width:n,height:r}=this;t%180!=0&&([n,r]=[r,n]),i.style.width=100*n/e+"%",i.style.height=100*r/s+"%",i.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(t,i,e)=>{const s=e.detail[t],n=s[0],r=s.slice(1);e.target.style[i]=je[`${n}_HTML`](r),this.annotationStorage.setValue(this.data.id,{[i]:je[`${n}_rgb`](r)})};return H(this,"_commonActions",{display:t=>{const{display:i}=t.detail,e=i%2==1;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:e,noPrint:1===i||2===i})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:i}=t.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:t=>{setTimeout((()=>t.target.focus({preventScroll:!1})),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:i=>{t("bgColor","backgroundColor",i)},fillColor:i=>{t("fillColor","backgroundColor",i)},fgColor:i=>{t("fgColor","color",i)},textColor:i=>{t("textColor","color",i)},borderColor:i=>{t("borderColor","borderColor",i)},strokeColor:i=>{t("strokeColor","borderColor",i)},rotation:t=>{const i=t.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(t,i){const e=this._commonActions;for(const s of Object.keys(i.detail)){const n=t[s]||e[s];n?.(i)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const i=this.annotationStorage.getRawValue(this.data.id);if(!i)return;const e=this._commonActions;for(const[s,n]of Object.entries(i)){const r=e[s];r&&(r({detail:{[s]:n},target:t}),delete i[s])}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[i,e,s,n]=this.data.rect.map((t=>Math.fround(t)));if(8===t.length){const[r,o,h,a]=t.subarray(2,6);if(s===r&&n===o&&i===h&&e===a)return}const{style:r}=this.container;let o;if(this.#Ks){const{borderColor:t,borderWidth:i}=r;r.borderWidth=0,o=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${t}" stroke-width="${i}">`],this.container.classList.add("hasBorder")}const h=s-i,a=n-e,{svgFactory:c}=this,l=c.createElement("svg");l.classList.add("quadrilateralsContainer"),l.setAttribute("width",0),l.setAttribute("height",0);const u=c.createElement("defs");l.append(u);const d=c.createElement("clipPath"),f=`clippath_${this.data.id}`;d.setAttribute("id",f),d.setAttribute("clipPathUnits","objectBoundingBox"),u.append(d);for(let e=2,s=t.length;e<s;e+=8){const s=t[e],r=t[e+1],l=t[e+2],u=t[e+3],f=c.createElement("rect"),p=(l-i)/h,g=(n-r)/a,w=(s-l)/h,m=(r-u)/a;f.setAttribute("x",p),f.setAttribute("y",g),f.setAttribute("width",w),f.setAttribute("height",m),d.append(f),o?.push(`<rect vector-effect="non-scaling-stroke" x="${p}" y="${g}" width="${w}" height="${m}"/>`)}this.#Ks&&(o.push("</g></svg>')"),r.backgroundImage=o.join("")),this.container.append(l),this.container.style.clipPath=`url(#${f})`}_createPopup(){const{data:t}=this,i=this.#Js=new ss({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation},parent:this.parent,elements:[this]});this.parent.div.append(i.render())}render(){B("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,i=null){const e=[];if(this._fieldObjects){const s=this._fieldObjects[t];if(s)for(const{page:t,id:n,exportValues:r}of s){if(-1===t)continue;if(n===i)continue;const s="string"==typeof r?r:null,o=document.querySelector(`[data-element-id="${n}"]`);!o||We.has(o)?e.push({id:n,exportValue:s,domElement:o}):L(`_getElementsByName - element not allowed: ${n}`)}return e}for(const s of document.getElementsByName(t)){const{exportValue:t}=s,n=s.getAttribute("data-element-id");n!==i&&We.has(s)&&e.push({id:n,exportValue:t,domElement:s})}return e}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const i of t)i.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:i}}=this;this.container.addEventListener("dblclick",(()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:i})}))}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}class Ye extends Xe{constructor(t,i=null){super(t,{isRenderable:!0,ignoreBorder:!!i?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:i}=this,e=document.createElement("a");e.setAttribute("data-element-id",t.id);let s=!1;return t.url?(i.addLinkAttributes(e,t.url,t.newWindow),s=!0):t.action?(this._bindNamedAction(e,t.action),s=!0):t.attachment?(this.#tn(e,t.attachment,t.attachmentDest),s=!0):t.setOCGState?(this.#in(e,t.setOCGState),s=!0):t.dest?(this._bindLink(e,t.dest),s=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(e,t),s=!0),t.resetForm?(this._bindResetFormAction(e,t.resetForm),s=!0):this.isTooltipOnly&&!s&&(this._bindLink(e,""),s=!0)),this.container.classList.add("linkAnnotation"),s&&this.container.append(e),this.container}#en(){this.container.setAttribute("data-internal-link","")}_bindLink(t,i){t.href=this.linkService.getDestinationHash(i),t.onclick=()=>(i&&this.linkService.goToDestination(i),!1),(i||""===i)&&this.#en()}_bindNamedAction(t,i){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(i),!1),this.#en()}#tn(t,i,e=null){t.href=this.linkService.getAnchorUrl(""),i.description&&(t.title=i.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(i.content,i.filename,e),!1),this.#en()}#in(t,i){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(i),!1),this.#en()}_bindJSAction(t,i){t.href=this.linkService.getAnchorUrl("");const e=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const s of Object.keys(i.actions)){const n=e.get(s);n&&(t[n]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i.id,name:s}}),!1))}t.onclick||(t.onclick=()=>!1),this.#en()}_bindResetFormAction(t,i){const e=t.onclick;if(e||(t.href=this.linkService.getAnchorUrl("")),this.#en(),!this._fieldObjects)return L('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(e||(t.onclick=()=>!1));t.onclick=()=>{e?.();const{fields:t,refs:s,include:n}=i,r=[];if(0!==t.length||0!==s.length){const i=new Set(s);for(const e of t){const t=this._fieldObjects[e]||[];for(const{id:e}of t)i.add(e)}for(const t of Object.values(this._fieldObjects))for(const e of t)i.has(e.id)===n&&r.push(e)}else for(const t of Object.values(this._fieldObjects))r.push(...t);const o=this.annotationStorage,h=[];for(const t of r){const{id:i}=t;switch(h.push(i),t.type){case"text":case"combobox":case"listbox":o.setValue(i,{value:t.defaultValue||""});break;case"checkbox":case"radiobutton":o.setValue(i,{value:t.defaultValue===t.exportValues});break;default:continue}const e=document.querySelector(`[data-element-id="${i}"]`);e&&(We.has(e)?e.dispatchEvent(new Event("resetform")):L(`_bindResetFormAction - element not allowed: ${i}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:h,name:"ResetForm"}}),!1}}}class Qe extends Xe{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class qe extends Xe{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&("CANVAS"===t.previousSibling?.nodeName&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return Z.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,i,e,s,n){e.includes("mouse")?t.addEventListener(e,(t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:n(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(e,(t=>{if("blur"===e){if(!i.focused||!t.relatedTarget)return;i.focused=!1}else if("focus"===e){if(i.focused)return;i.focused=!0}n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:n(t)}})}))}_setEventListeners(t,i,e,s){for(const[n,r]of e)("Action"===r||this.data.actions?.[r])&&("Focus"!==r&&"Blur"!==r||(i||={focused:!1}),this._setEventListener(t,i,n,r,s),"Focus"!==r||this.data.actions?.Blur?"Blur"!==r||this.data.actions?.Focus||this._setEventListener(t,i,"focus","Focus",null):this._setEventListener(t,i,"blur","Blur",null))}_setBackgroundColor(t){const i=this.data.backgroundColor||null;t.style.backgroundColor=null===i?"transparent":it.makeHexColor(i[0],i[1],i[2])}_setTextStyle(t){const{fontColor:i}=this.data.defaultAppearanceData,e=this.data.defaultAppearanceData.fontSize||9,s=t.style;let n;const r=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),i=Math.round(t/(k*e))||1;n=Math.min(e,r(t/i/k))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);n=Math.min(e,r(t/k))}s.fontSize=`calc(${n}px * var(--total-scale-factor))`,s.color=it.makeHexColor(i[0],i[1],i[2]),null!==this.data.textAlignment&&(s.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(t,i){i?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",i)}}class Ke extends qe{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,i,e,s){const n=this.annotationStorage;for(const r of this._getElementsByName(t.name,t.id))r.domElement&&(r.domElement[i]=e),n.setValue(r.id,{[s]:e})}render(){const t=this.annotationStorage,i=this.data.id;this.container.classList.add("textWidgetAnnotation");let e=null;if(this.renderForms){const s=t.getValue(i,{value:this.data.fieldValue});let n=s.value||"";const r=t.getValue(i,{charLimit:this.data.maxLen}).charLimit;r&&n.length>r&&(n=n.slice(0,r));let o=s.formattedValue||this.data.textContent?.join("\n")||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,""));const h={userValue:n,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(e=document.createElement("textarea"),e.textContent=o??n,this.data.doNotScroll&&(e.style.overflowY="hidden")):(e=document.createElement("input"),e.type=this.data.password?"password":"text",e.setAttribute("value",o??n),this.data.doNotScroll&&(e.style.overflowX="hidden")),this.data.hasOwnCanvas&&(e.hidden=!0),We.add(e),e.setAttribute("data-element-id",i),e.disabled=this.data.readOnly,e.name=this.data.fieldName,e.tabIndex=Ge,this._setRequired(e,this.data.required),r&&(e.maxLength=r),e.addEventListener("input",(s=>{t.setValue(i,{value:s.target.value}),this.setPropertyOnSiblings(e,"value",s.target.value,"value"),h.formattedValue=null})),e.addEventListener("resetform",(()=>{e.value=h.userValue=this.data.defaultFieldValue??"",h.formattedValue=null}));let a=t=>{const{formattedValue:i}=h;null!=i&&(t.target.value=i),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){e.addEventListener("focus",(t=>{if(h.focused)return;const{target:i}=t;h.userValue&&(i.value=h.userValue),h.lastCommittedValue=i.value,h.commitKey=1,this.data.actions?.Focus||(h.focused=!0)})),e.addEventListener("updatefromsandbox",(e=>{this.showElementAndHideCanvas(e.target),this._dispatchEventFromSandbox({value(e){h.userValue=e.detail.value??"",t.setValue(i,{value:h.userValue.toString()}),e.target.value=h.userValue},formattedValue(e){const{formattedValue:s}=e.detail;h.formattedValue=s,null!=s&&e.target!==document.activeElement&&(e.target.value=s),t.setValue(i,{formattedValue:s})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:e=>{const{charLimit:s}=e.detail,{target:n}=e;if(0===s)return void n.removeAttribute("maxLength");n.setAttribute("maxLength",s);let r=h.userValue;!r||r.length<=s||(r=r.slice(0,s),n.value=h.userValue=r,t.setValue(i,{value:r}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:r,willCommit:!0,commitKey:1,selStart:n.selectionStart,selEnd:n.selectionEnd}}))}},e)})),e.addEventListener("keydown",(t=>{h.commitKey=1;let e=-1;if("Escape"===t.key?e=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(h.commitKey=3):e=2,-1===e)return;const{value:s}=t.target;h.lastCommittedValue!==s&&(h.lastCommittedValue=s,h.userValue=s,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:s,willCommit:!0,commitKey:e,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))}));const s=a;a=null,e.addEventListener("blur",(t=>{if(!h.focused||!t.relatedTarget)return;this.data.actions?.Blur||(h.focused=!1);const{value:e}=t.target;h.userValue=e,h.lastCommittedValue!==e&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:e,willCommit:!0,commitKey:h.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),s(t)})),this.data.actions?.Keystroke&&e.addEventListener("beforeinput",(t=>{h.lastCommittedValue=null;const{data:e,target:s}=t,{value:n,selectionStart:r,selectionEnd:o}=s;let a=r,c=o;switch(t.inputType){case"deleteWordBackward":{const t=n.substring(0,r).match(/\w*[^\w]*$/);t&&(a-=t[0].length);break}case"deleteWordForward":{const t=n.substring(r).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":r===o&&(a-=1);break;case"deleteContentForward":r===o&&(c+=1)}t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:n,change:e||"",willCommit:!1,selStart:a,selEnd:c}})})),this._setEventListeners(e,h,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}if(a&&e.addEventListener("blur",a),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/r;e.classList.add("comb"),e.style.letterSpacing=`calc(${t}px * var(--total-scale-factor) - 1ch)`}}else e=document.createElement("div"),e.textContent=this.data.fieldValue,e.style.verticalAlign="middle",e.style.display="table-cell",this.data.hasOwnCanvas&&(e.hidden=!0);return this._setTextStyle(e),this._setBackgroundColor(e),this._setDefaultPropertiesFromJS(e),this.container.append(e),this.container}}class Je extends qe{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class Ze extends qe{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,i=this.data,e=i.id;let s=t.getValue(e,{value:i.exportValue===i.fieldValue}).value;"string"==typeof s&&(s="Off"!==s,t.setValue(e,{value:s})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const n=document.createElement("input");return We.add(n),n.setAttribute("data-element-id",e),n.disabled=i.readOnly,this._setRequired(n,this.data.required),n.type="checkbox",n.name=i.fieldName,s&&n.setAttribute("checked",!0),n.setAttribute("exportValue",i.exportValue),n.tabIndex=Ge,n.addEventListener("change",(s=>{const{name:n,checked:r}=s.target;for(const s of this._getElementsByName(n,e)){const e=r&&s.exportValue===i.exportValue;s.domElement&&(s.domElement.checked=e),t.setValue(s.id,{value:e})}t.setValue(e,{value:r})})),n.addEventListener("resetform",(t=>{t.target.checked=(i.defaultFieldValue||"Off")===i.exportValue})),this.enableScripting&&this.hasJSActions&&(n.addEventListener("updatefromsandbox",(i=>{this._dispatchEventFromSandbox({value(i){i.target.checked="Off"!==i.detail.value,t.setValue(e,{value:i.target.checked})}},i)})),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class ts extends qe{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,i=this.data,e=i.id;let s=t.getValue(e,{value:i.fieldValue===i.buttonValue}).value;if("string"==typeof s&&(s=s!==i.buttonValue,t.setValue(e,{value:s})),s)for(const s of this._getElementsByName(i.fieldName,e))t.setValue(s.id,{value:!1});const n=document.createElement("input");if(We.add(n),n.setAttribute("data-element-id",e),n.disabled=i.readOnly,this._setRequired(n,this.data.required),n.type="radio",n.name=i.fieldName,s&&n.setAttribute("checked",!0),n.tabIndex=Ge,n.addEventListener("change",(i=>{const{name:s,checked:n}=i.target;for(const i of this._getElementsByName(s,e))t.setValue(i.id,{value:!1});t.setValue(e,{value:n})})),n.addEventListener("resetform",(t=>{const e=i.defaultFieldValue;t.target.checked=null!=e&&e===i.buttonValue})),this.enableScripting&&this.hasJSActions){const s=i.buttonValue;n.addEventListener("updatefromsandbox",(i=>{this._dispatchEventFromSandbox({value:i=>{const n=s===i.detail.value;for(const s of this._getElementsByName(i.target.name)){const i=n&&s.id===e;s.domElement&&(s.domElement.checked=i),t.setValue(s.id,{value:i})}}},i)})),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}return this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class is extends Ye{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const i=t.lastChild;return this.enableScripting&&this.hasJSActions&&i&&(this._setDefaultPropertiesFromJS(i),i.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))),t}}class es extends qe{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,i=this.data.id,e=t.getValue(i,{value:this.data.fieldValue}),s=document.createElement("select");We.add(s),s.setAttribute("data-element-id",i),s.disabled=this.data.readOnly,this._setRequired(s,this.data.required),s.name=this.data.fieldName,s.tabIndex=Ge;let n=this.data.combo&&this.data.options.length>0;this.data.combo||(s.size=this.data.options.length,this.data.multiSelect&&(s.multiple=!0)),s.addEventListener("resetform",(()=>{const t=this.data.defaultFieldValue;for(const i of s.options)i.selected=i.value===t}));for(const t of this.data.options){const i=document.createElement("option");i.textContent=t.displayValue,i.value=t.exportValue,e.value.includes(t.exportValue)&&(i.setAttribute("selected",!0),n=!1),s.append(i)}let r=null;if(n){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),s.prepend(t),r=()=>{t.remove(),s.removeEventListener("input",r),r=null},s.addEventListener("input",r)}const o=t=>{const i=t?"value":"textContent",{options:e,multiple:n}=s;return n?Array.prototype.filter.call(e,(t=>t.selected)).map((t=>t[i])):-1===e.selectedIndex?null:e[e.selectedIndex][i]};let h=o(!1);const a=t=>Array.prototype.map.call(t.target.options,(t=>({displayValue:t.textContent,exportValue:t.value})));return this.enableScripting&&this.hasJSActions?(s.addEventListener("updatefromsandbox",(e=>{this._dispatchEventFromSandbox({value(e){r?.();const n=e.detail.value,a=new Set(Array.isArray(n)?n:[n]);for(const t of s.options)t.selected=a.has(t.value);t.setValue(i,{value:o(!0)}),h=o(!1)},multipleSelection(t){s.multiple=!0},remove(e){const n=s.options,r=e.detail.remove;n[r].selected=!1,s.remove(r),n.length>0&&-1===Array.prototype.findIndex.call(n,(t=>t.selected))&&(n[0].selected=!0),t.setValue(i,{value:o(!0),items:a(e)}),h=o(!1)},clear(e){for(;0!==s.length;)s.remove(0);t.setValue(i,{value:null,items:[]}),h=o(!1)},insert(e){const{index:n,displayValue:r,exportValue:c}=e.detail.insert,l=s.children[n],u=document.createElement("option");u.textContent=r,u.value=c,l?l.before(u):s.append(u),t.setValue(i,{value:o(!0),items:a(e)}),h=o(!1)},items(e){const{items:n}=e.detail;for(;0!==s.length;)s.remove(0);for(const t of n){const{displayValue:i,exportValue:e}=t,n=document.createElement("option");n.textContent=i,n.value=e,s.append(n)}s.options.length>0&&(s.options[0].selected=!0),t.setValue(i,{value:o(!0),items:a(e)}),h=o(!1)},indices(e){const s=new Set(e.detail.indices);for(const t of e.target.options)t.selected=s.has(t.index);t.setValue(i,{value:o(!0)}),h=o(!1)},editable(t){t.target.disabled=!t.detail.editable}},e)})),s.addEventListener("input",(e=>{const s=o(!0),n=o(!1);t.setValue(i,{value:s}),e.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:h,change:n,changeEx:s,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(s,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(t=>t.target.value))):s.addEventListener("input",(function(){t.setValue(i,{value:o(!0)})})),this.data.combo&&this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class ss extends Xe{constructor(t){const{data:i,elements:e}=t;super(t,{isRenderable:Xe._hasPopupData(i)}),this.elements=e,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new ns({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),i=[];for(const e of this.elements)e.popup=t,e.container.ariaHasPopup="dialog",i.push(e.data.id),e.addHighlightArea();return this.container.setAttribute("aria-controls",i.map((t=>`${ot}${t}`)).join(",")),this.container}}class ns{#sn=this.#nn.bind(this);#rn=this.#on.bind(this);#hn=this.#an.bind(this);#cn=this.#ln.bind(this);#un=null;#wt=null;#dn=null;#fn=null;#pn=null;#gn=null;#wn=null;#mn=!1;#An=null;#_=null;#bn=null;#vn=null;#yn=null;#qs=null;#xn=!1;constructor({container:t,color:i,elements:e,titleObj:s,modificationDate:n,contentsObj:r,richText:o,parent:h,rect:a,parentRect:c,open:l}){this.#wt=t,this.#yn=s,this.#dn=r,this.#vn=o,this.#gn=h,this.#un=i,this.#bn=a,this.#wn=c,this.#pn=e,this.#fn=xt.toDateObject(n),this.trigger=e.flatMap((t=>t.getElementsToTriggerPopup()));for(const t of this.trigger)t.addEventListener("click",this.#cn),t.addEventListener("mouseenter",this.#hn),t.addEventListener("mouseleave",this.#rn),t.classList.add("popupTriggerArea");for(const t of e)t.container?.addEventListener("keydown",this.#sn);this.#wt.hidden=!0,l&&this.#ln()}render(){if(this.#An)return;const t=this.#An=document.createElement("div");if(t.className="popup",this.#un){const i=t.style.outlineColor=it.makeHexColor(...this.#un);t.style.backgroundColor=`color-mix(in srgb, ${i} 30%, white)`}const i=document.createElement("span");i.className="header";const e=document.createElement("h1");if(i.append(e),({dir:e.dir,str:e.textContent}=this.#yn),t.append(i),this.#fn){const t=document.createElement("span");t.classList.add("popupDate"),t.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),t.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#fn.valueOf()})),i.append(t)}const s=this.#Mn;if(s)He.render({xfaHtml:s,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const i=this._formatContents(this.#dn);t.append(i)}this.#wt.append(t)}get#Mn(){const t=this.#vn,i=this.#dn;return!t?.str||i?.str&&i.str!==t.str?null:this.#vn.html||null}get#kn(){return this.#Mn?.attributes?.style?.fontSize||0}get#En(){return this.#Mn?.attributes?.style?.color||null}#Sn(t){const i=[],e={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:i}]}},s={style:{color:this.#En,fontSize:this.#kn?`calc(${this.#kn}px * var(--total-scale-factor))`:""}};for(const e of t.split("\n"))i.push({name:"span",value:e,attributes:s});return e}_formatContents({str:t,dir:i}){const e=document.createElement("p");e.classList.add("popupContent"),e.dir=i;const s=t.split(/(?:\r\n?|\n)/);for(let t=0,i=s.length;t<i;++t)e.append(document.createTextNode(s[t])),t<i-1&&e.append(document.createElement("br"));return e}#nn(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&this.#mn)&&this.#ln()}updateEdited({rect:t,popupContent:i}){this.#qs||={contentsObj:this.#dn,richText:this.#vn},t&&(this.#_=null),i&&(this.#vn=this.#Sn(i),this.#dn=null),this.#An?.remove(),this.#An=null}resetEdited(){this.#qs&&(({contentsObj:this.#dn,richText:this.#vn}=this.#qs),this.#qs=null,this.#An?.remove(),this.#An=null,this.#_=null)}#_n(){if(null!==this.#_)return;const{page:{view:t},viewport:{rawDims:{pageWidth:i,pageHeight:e,pageX:s,pageY:n}}}=this.#gn;let r=!!this.#wn,o=r?this.#wn:this.#bn;for(const t of this.#pn)if(!o||null!==it.intersect(t.data.rect,o)){o=t.data.rect,r=!0;break}const h=it.normalizeRect([o[0],t[3]-o[1]+t[1],o[2],t[3]-o[3]+t[1]]);this.#_=[100*(h[0]+(r?o[2]-o[0]+5:0)-s)/i,100*(h[1]-n)/e];const{style:a}=this.#wt;a.left=`${this.#_[0]}%`,a.top=`${this.#_[1]}%`}#ln(){this.#mn=!this.#mn,this.#mn?(this.#an(),this.#wt.addEventListener("click",this.#cn),this.#wt.addEventListener("keydown",this.#sn)):(this.#on(),this.#wt.removeEventListener("click",this.#cn),this.#wt.removeEventListener("keydown",this.#sn))}#an(){this.#An||this.render(),this.isVisible?this.#mn&&this.#wt.classList.add("focused"):(this.#_n(),this.#wt.hidden=!1,this.#wt.style.zIndex=parseInt(this.#wt.style.zIndex)+1e3)}#on(){this.#wt.classList.remove("focused"),!this.#mn&&this.isVisible&&(this.#wt.hidden=!0,this.#wt.style.zIndex=parseInt(this.#wt.style.zIndex)-1e3)}forceHide(){this.#xn=this.isVisible,this.#xn&&(this.#wt.hidden=!0)}maybeShow(){this.#xn&&(this.#An||this.#an(),this.#xn=!1,this.#wt.hidden=!1)}get isVisible(){return!1===this.#wt.hidden}}class rs extends Xe{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=S.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const i of this.textContent){const e=document.createElement("span");e.textContent=i,t.append(e)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class os extends Xe{#Tn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:t,width:i,height:e}=this,s=this.svgFactory.create(i,e,!0),n=this.#Tn=this.svgFactory.createElement("svg:line");return n.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),n.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),n.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),n.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),n.setAttribute("stroke-width",t.borderStyle.width||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),s.append(n),this.container.append(s),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Tn}addHighlightArea(){this.container.classList.add("highlightArea")}}class hs extends Xe{#Cn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:t,width:i,height:e}=this,s=this.svgFactory.create(i,e,!0),n=t.borderStyle.width,r=this.#Cn=this.svgFactory.createElement("svg:rect");return r.setAttribute("x",n/2),r.setAttribute("y",n/2),r.setAttribute("width",i-n),r.setAttribute("height",e-n),r.setAttribute("stroke-width",n||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),s.append(r),this.container.append(s),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Cn}addHighlightArea(){this.container.classList.add("highlightArea")}}class as extends Xe{#Pn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:t,width:i,height:e}=this,s=this.svgFactory.create(i,e,!0),n=t.borderStyle.width,r=this.#Pn=this.svgFactory.createElement("svg:ellipse");return r.setAttribute("cx",i/2),r.setAttribute("cy",e/2),r.setAttribute("rx",i/2-n/2),r.setAttribute("ry",e/2-n/2),r.setAttribute("stroke-width",n||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),s.append(r),this.container.append(s),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Pn}addHighlightArea(){this.container.classList.add("highlightArea")}}class cs extends Xe{#Rn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:i,borderStyle:e,popupRef:s},width:n,height:r}=this;if(!i)return this.container;const o=this.svgFactory.create(n,r,!0);let h=[];for(let e=0,s=i.length;e<s;e+=2)h.push(`${i[e]-t[0]},${t[3]-i[e+1]}`);h=h.join(" ");const a=this.#Rn=this.svgFactory.createElement(this.svgElementName);return a.setAttribute("points",h),a.setAttribute("stroke-width",e.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),o.append(a),this.container.append(o),!s&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Rn}addHighlightArea(){this.container.classList.add("highlightArea")}}class ls extends cs{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class us extends Xe{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class ds extends Xe{#Nn=null;#Dn=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType="InkHighlight"===this.data.it?S.HIGHLIGHT:S.INK}#In(t,i){switch(t){case 90:return{transform:`rotate(90) translate(${-i[0]},${i[1]}) scale(1,-1)`,width:i[3]-i[1],height:i[2]-i[0]};case 180:return{transform:`rotate(180) translate(${-i[2]},${i[1]}) scale(1,-1)`,width:i[2]-i[0],height:i[3]-i[1]};case 270:return{transform:`rotate(270) translate(${-i[2]},${i[3]}) scale(1,-1)`,width:i[3]-i[1],height:i[2]-i[0]};default:return{transform:`translate(${-i[0]},${i[3]}) scale(1,-1)`,width:i[2]-i[0],height:i[3]-i[1]}}}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,rotation:i,inkLists:e,borderStyle:s,popupRef:n}}=this,{transform:r,width:o,height:h}=this.#In(i,t),a=this.svgFactory.create(o,h,!0),c=this.#Nn=this.svgFactory.createElement("svg:g");a.append(c),c.setAttribute("stroke-width",s.width||1),c.setAttribute("stroke-linecap","round"),c.setAttribute("stroke-linejoin","round"),c.setAttribute("stroke-miterlimit",10),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),c.setAttribute("transform",r);for(let t=0,i=e.length;t<i;t++){const i=this.svgFactory.createElement(this.svgElementName);this.#Dn.push(i),i.setAttribute("points",e[t].join(",")),c.append(i)}return!n&&this.hasPopupData&&this._createPopup(),this.container.append(a),this._editOnDoubleClick(),this.container}updateEdited(t){super.updateEdited(t);const{thickness:i,points:e,rect:s}=t,n=this.#Nn;if(i>=0&&n.setAttribute("stroke-width",i||1),e)for(let t=0,i=this.#Dn.length;t<i;t++)this.#Dn[t].setAttribute("points",e[t].join(","));if(s){const{transform:t,width:i,height:e}=this.#In(this.data.rotation,s);n.parentElement.setAttribute("viewBox",`0 0 ${i} ${e}`),n.setAttribute("transform",t)}}getElementsToTriggerPopup(){return this.#Dn}addHighlightArea(){this.container.classList.add("highlightArea")}}class fs extends Xe{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=S.HIGHLIGHT}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),this.container}}class ps extends Xe{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class gs extends Xe{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class ws extends Xe{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class ms extends Xe{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=S.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class As extends Xe{#Fn=null;constructor(t){super(t,{isRenderable:!0});const{file:i}=this.data;this.filename=i.filename,this.content=i.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...i})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:i}=this;let e;i.hasAppearance||0===i.fillAlpha?e=document.createElement("div"):(e=document.createElement("img"),e.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(i.name)?"paperclip":"pushpin"}.svg`,i.fillAlpha&&i.fillAlpha<1&&(e.style=`filter: opacity(${Math.round(100*i.fillAlpha)}%);`)),e.addEventListener("dblclick",this.#On.bind(this)),this.#Fn=e;const{isMac:s}=Z.platform;return t.addEventListener("keydown",(t=>{"Enter"===t.key&&(s?t.metaKey:t.ctrlKey)&&this.#On()})),!i.popupRef&&this.hasPopupData?this._createPopup():e.classList.add("popupTriggerArea"),t.append(e),t}getElementsToTriggerPopup(){return this.#Fn}addHighlightArea(){this.container.classList.add("highlightArea")}#On(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class bs{#$n=null;#Ln=null;#Bn=new Map;#jn=null;constructor({div:t,accessibilityManager:i,annotationCanvasMap:e,annotationEditorUIManager:s,page:n,viewport:r,structTreeLayer:o}){this.div=t,this.#$n=i,this.#Ln=e,this.#jn=o||null,this.page=n,this.viewport=r,this.zIndex=0,this._annotationEditorUIManager=s}hasEditableAnnotations(){return this.#Bn.size>0}async#Un(t,i){const e=t.firstChild||t,s=e.id=`${ot}${i}`,n=await(this.#jn?.getAriaAttributes(s));if(n)for(const[t,i]of n)e.setAttribute(t,i);this.div.append(t),this.#$n?.moveElementInDOM(this.div,t,e,!1)}async render(t){const{annotations:i}=t,e=this.div;_t(e,this.viewport);const s=new Map,n={data:null,layer:e,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new ze,annotationStorage:t.annotationStorage||new Yt,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const t of i){if(t.noHTML)continue;const i=t.annotationType===P.POPUP;if(i){const i=s.get(t.id);if(!i)continue;n.elements=i}else if(t.rect[2]===t.rect[0]||t.rect[3]===t.rect[1])continue;n.data=t;const e=Ve.create(n);if(!e.isRenderable)continue;if(!i&&t.popupRef){const i=s.get(t.popupRef);i?i.push(e):s.set(t.popupRef,[e])}const r=e.render();t.hidden&&(r.style.visibility="hidden"),await this.#Un(r,t.id),e._isEditable&&(this.#Bn.set(e.data.id,e),this._annotationEditorUIManager?.renderAnnotationElement(e))}this.#zn()}async addLinkAnnotations(t,i){const e={data:null,layer:this.div,linkService:i,svgFactory:new ze,parent:this};for(const i of t){i.borderStyle||=bs._defaultBorderStyle,e.data=i;const t=Ve.create(e);if(!t.isRenderable)continue;const s=t.render();await this.#Un(s,i.id)}}update({viewport:t}){const i=this.div;this.viewport=t,_t(i,{rotation:t.rotation}),this.#zn(),i.hidden=!1}#zn(){if(!this.#Ln)return;const t=this.div;for(const[i,e]of this.#Ln){const s=t.querySelector(`[data-annotation-id="${i}"]`);if(!s)continue;e.className="annotationContent";const{firstChild:n}=s;n?"CANVAS"===n.nodeName?n.replaceWith(e):n.classList.contains("annotationContent")?n.after(e):n.before(e):s.append(e);const r=this.#Bn.get(i);r&&(r._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(i,s.id,e),r._hasNoCanvas=!1):r.canvas=e)}this.#Ln.clear()}getEditableAnnotations(){return Array.from(this.#Bn.values())}getEditableAnnotation(t){return this.#Bn.get(t)}static get _defaultBorderStyle(){return H(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:1,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}}const vs=/\r\n?|\n/g;class ys extends Ut{#un;#Hn="";#Gn=`${this.id}-editor`;#Wn=null;#kn;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=ys.prototype,i=t=>t.isEmpty(),e=Lt.TRANSLATE_SMALL,s=Lt.TRANSLATE_BIG;return H(this,"_keyboardManager",new Ot([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-e,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-s,0],checker:i}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[e,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[s,0],checker:i}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-e],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-s],checker:i}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,e],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,s],checker:i}]]))}static _type="freetext";static _editorType=S.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"}),this.#un=t.color||ys._defaultColor||Ut._defaultLineColor,this.#kn=t.fontSize||ys._defaultFontSize}static initialize(t,i){Ut.initialize(t,i);const e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,i){switch(t){case _.FREETEXT_SIZE:ys._defaultFontSize=i;break;case _.FREETEXT_COLOR:ys._defaultColor=i}}updateParams(t,i){switch(t){case _.FREETEXT_SIZE:this.#Vn(i);break;case _.FREETEXT_COLOR:this.#Xn(i)}}static get defaultPropertiesToUpdate(){return[[_.FREETEXT_SIZE,ys._defaultFontSize],[_.FREETEXT_COLOR,ys._defaultColor||Ut._defaultLineColor]]}get propertiesToUpdate(){return[[_.FREETEXT_SIZE,this.#kn],[_.FREETEXT_COLOR,this.#un]]}#Vn(t){const i=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--total-scale-factor))`,this.translate(0,-(t-this.#kn)*this.parentScale),this.#kn=t,this.#Yn()},e=this.#kn;this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:_.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#Xn(t){const i=t=>{this.#un=this.editorDiv.style.color=t},e=this.#un;this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:_.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,i){this._uiManager.translateSelectedEditors(t,i,!0)}getInitialTranslation(){const t=this.parentScale;return[-ys._internalPadding*t,-(ys._internalPadding+this.#kn)*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#Wn=new AbortController;const t=this._uiManager.combinedSignal(this.#Wn);return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t}),!0}disableEditMode(){return!!super.disableEditMode()&&(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#Gn),this._isDraggable=!0,this.#Wn?.abort(),this.#Wn=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0)}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(t){this.width||(this.enableEditMode(),t&&this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#Qn(){const t=[];this.editorDiv.normalize();let i=null;for(const e of this.editorDiv.childNodes)i?.nodeType===Node.TEXT_NODE&&"BR"===e.nodeName||(t.push(ys.#qn(e)),i=e);return t.join("\n")}#Yn(){const[t,i]=this.parentDimensions;let e;if(this.isAttachedToDOM)e=this.div.getBoundingClientRect();else{const{currentLayer:t,div:i}=this,s=i.style.display,n=i.classList.contains("hidden");i.classList.remove("hidden"),i.style.display="hidden",t.div.append(this.div),e=i.getBoundingClientRect(),i.remove(),i.style.display=s,i.classList.toggle("hidden",n)}this.rotation%180==this.parentRotation%180?(this.width=e.width/t,this.height=e.height/i):(this.width=e.height/t,this.height=e.width/i),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#Hn,i=this.#Hn=this.#Qn().trimEnd();if(t===i)return;const e=t=>{this.#Hn=t,t?(this.#Kn(),this._uiManager.rebuild(this),this.#Yn()):this.remove()};this.addCommands({cmd:()=>{e(i)},undo:()=>{e(t)},mustExec:!1}),this.#Yn()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){ys._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let t,i;(this._isCopy||this.annotationElementId)&&(t=this.x,i=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#Gn),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:e}=this.editorDiv;if(e.fontSize=`calc(${this.#kn}px * var(--total-scale-factor))`,e.color=this.#un,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[e,s]=this.parentDimensions;if(this.annotationElementId){const{position:n}=this._initialData;let[r,o]=this.getInitialTranslation();[r,o]=this.pageTranslationToScreen(r,o);const[h,a]=this.pageDimensions,[c,l]=this.pageTranslation;let u,d;switch(this.rotation){case 0:u=t+(n[0]-c)/h,d=i+this.height-(n[1]-l)/a;break;case 90:u=t+(n[0]-c)/h,d=i-(n[1]-l)/a,[r,o]=[o,-r];break;case 180:u=t-this.width+(n[0]-c)/h,d=i-(n[1]-l)/a,[r,o]=[-r,-o];break;case 270:u=t+(n[0]-c-this.height*a)/h,d=i+(n[1]-l-this.width*h)/a,[r,o]=[-o,r]}this.setAt(u*e,d*s,r,o)}else this._moveAfterPaste(t,i);this.#Kn(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#qn(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(vs,"")}editorDivPaste(t){const i=t.clipboardData||window.clipboardData,{types:e}=i;if(1===e.length&&"text/plain"===e[0])return;t.preventDefault();const s=ys.#Jn(i.getData("text")||"").replaceAll(vs,"\n");if(!s)return;const n=window.getSelection();if(!n.rangeCount)return;this.editorDiv.normalize(),n.deleteFromDocument();const r=n.getRangeAt(0);if(!s.includes("\n"))return r.insertNode(document.createTextNode(s)),this.editorDiv.normalize(),void n.collapseToStart();const{startContainer:o,startOffset:h}=r,a=[],c=[];if(o.nodeType===Node.TEXT_NODE){const t=o.parentElement;if(c.push(o.nodeValue.slice(h).replaceAll(vs,"")),t!==this.editorDiv){let i=a;for(const e of this.editorDiv.childNodes)e!==t?i.push(ys.#qn(e)):i=c}a.push(o.nodeValue.slice(0,h).replaceAll(vs,""))}else if(o===this.editorDiv){let t=a,i=0;for(const e of this.editorDiv.childNodes)i++===h&&(t=c),t.push(ys.#qn(e))}this.#Hn=`${a.join("\n")}${s}${c.join("\n")}`,this.#Kn();const l=new Range;let u=Math.sumPrecise(a.map((t=>t.length)));for(const{firstChild:t}of this.editorDiv.childNodes)if(t.nodeType===Node.TEXT_NODE){const i=t.nodeValue.length;if(u<=i){l.setStart(t,u),l.setEnd(t,u);break}u-=i}n.removeAllRanges(),n.addRange(l)}#Kn(){if(this.editorDiv.replaceChildren(),this.#Hn)for(const t of this.#Hn.split("\n")){const i=document.createElement("div");i.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(i)}}#Zn(){return this.#Hn.replaceAll(" "," ")}static#Jn(t){return t.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}static async deserialize(t,i,e){let s=null;if(t instanceof rs){const{data:{defaultAppearanceData:{fontSize:i,fontColor:e},rect:n,rotation:r,id:o,popupRef:h},textContent:a,textPosition:c,parent:{page:{pageNumber:l}}}=t;if(!a||0===a.length)return null;s=t={annotationType:S.FREETEXT,color:Array.from(e),fontSize:i,value:a.join("\n"),position:c,pageIndex:l-1,rect:n.slice(0),rotation:r,id:o,deleted:!1,popupRef:h}}const n=await super.deserialize(t,i,e);return n.#kn=t.fontSize,n.#un=it.makeHexColor(...t.color),n.#Hn=ys.#Jn(t.value),n.annotationElementId=t.id||null,n._initialData=s,n}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=ys._internalPadding*this.parentScale,e=this.getRect(i,i),s=Ut._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#un),n={annotationType:S.FREETEXT,color:s,fontSize:this.#kn,value:this.#Zn(),pageIndex:this.pageIndex,rect:e,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?(n.isCopy=!0,n):this.annotationElementId&&!this.#tr(n)?null:(n.id=this.annotationElementId,n)}#tr(t){const{value:i,fontSize:e,color:s,pageIndex:n}=this._initialData;return this._hasBeenMoved||t.value!==i||t.fontSize!==e||t.color.some(((t,i)=>t!==s[i]))||t.pageIndex!==n}renderAnnotationElement(t){const i=super.renderAnnotationElement(t);if(this.deleted)return i;const{style:e}=i;e.fontSize=`calc(${this.#kn}px * var(--total-scale-factor))`,e.color=this.#un,i.replaceChildren();for(const t of this.#Hn.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),i.append(e)}const s=ys._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(s,s),popupContent:this.#Hn}),i}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}class xs{static PRECISION=1e-4;toSVGPath(){B("Abstract method `toSVGPath` must be implemented.")}get box(){B("Abstract getter `box` must be implemented.")}serialize(t,i){B("Abstract method `serialize` must be implemented.")}static _rescale(t,i,e,s,n,r){r||=new Float32Array(t.length);for(let o=0,h=t.length;o<h;o+=2)r[o]=i+t[o]*s,r[o+1]=e+t[o+1]*n;return r}static _rescaleAndSwap(t,i,e,s,n,r){r||=new Float32Array(t.length);for(let o=0,h=t.length;o<h;o+=2)r[o]=i+t[o+1]*s,r[o+1]=e+t[o]*n;return r}static _translate(t,i,e,s){s||=new Float32Array(t.length);for(let n=0,r=t.length;n<r;n+=2)s[n]=i+t[n],s[n+1]=e+t[n+1];return s}static svgRound(t){return Math.round(1e4*t)}static _normalizePoint(t,i,e,s,n){switch(n){case 90:return[1-i/e,t/s];case 180:return[1-t/e,1-i/s];case 270:return[i/e,1-t/s];default:return[t/e,i/s]}}static _normalizePagePoint(t,i,e){switch(e){case 90:return[1-i,t];case 180:return[1-t,1-i];case 270:return[i,1-t];default:return[t,i]}}static createBezierPoints(t,i,e,s,n,r){return[(t+5*e)/6,(i+5*s)/6,(5*e+n)/6,(5*s+r)/6,(e+n)/2,(s+r)/2]}}class Ms{#ir;#er=[];#sr;#nr;#rr=[];#or=new Float32Array(18);#hr;#ar;#cr;#lr;#ur;#dr;#fr=[];static#pr=8;static#gr=2;static#wr=Ms.#pr+Ms.#gr;constructor({x:t,y:i},e,s,n,r,o=0){this.#ir=e,this.#dr=n*s,this.#nr=r,this.#or.set([NaN,NaN,NaN,NaN,t,i],6),this.#sr=o,this.#lr=Ms.#pr*s,this.#cr=Ms.#wr*s,this.#ur=s,this.#fr.push(t,i)}isEmpty(){return isNaN(this.#or[8])}#mr(){const t=this.#or.subarray(4,6),i=this.#or.subarray(16,18),[e,s,n,r]=this.#ir;return[(this.#hr+(t[0]-i[0])/2-e)/n,(this.#ar+(t[1]-i[1])/2-s)/r,(this.#hr+(i[0]-t[0])/2-e)/n,(this.#ar+(i[1]-t[1])/2-s)/r]}add({x:t,y:i}){this.#hr=t,this.#ar=i;const[e,s,n,r]=this.#ir;let[o,h,a,c]=this.#or.subarray(8,12);const l=t-a,u=i-c,d=Math.hypot(l,u);if(d<this.#cr)return!1;const f=d-this.#lr,p=f/d,g=p*l,w=p*u;let m=o,A=h;o=a,h=c,a+=g,c+=w,this.#fr?.push(t,i);const b=-w/f*this.#dr,v=g/f*this.#dr;return this.#or.set(this.#or.subarray(2,8),0),this.#or.set([a+b,c+v],4),this.#or.set(this.#or.subarray(14,18),12),this.#or.set([a-b,c-v],16),isNaN(this.#or[6])?(0===this.#rr.length&&(this.#or.set([o+b,h+v],2),this.#rr.push(NaN,NaN,NaN,NaN,(o+b-e)/n,(h+v-s)/r),this.#or.set([o-b,h-v],14),this.#er.push(NaN,NaN,NaN,NaN,(o-b-e)/n,(h-v-s)/r)),this.#or.set([m,A,o,h,a,c],6),!this.isEmpty()):(this.#or.set([m,A,o,h,a,c],6),Math.abs(Math.atan2(A-h,m-o)-Math.atan2(w,g))<Math.PI/2?([o,h,a,c]=this.#or.subarray(2,6),this.#rr.push(NaN,NaN,NaN,NaN,((o+a)/2-e)/n,((h+c)/2-s)/r),[o,h,m,A]=this.#or.subarray(14,18),this.#er.push(NaN,NaN,NaN,NaN,((m+o)/2-e)/n,((A+h)/2-s)/r),!0):([m,A,o,h,a,c]=this.#or.subarray(0,6),this.#rr.push(((m+5*o)/6-e)/n,((A+5*h)/6-s)/r,((5*o+a)/6-e)/n,((5*h+c)/6-s)/r,((o+a)/2-e)/n,((h+c)/2-s)/r),[a,c,o,h,m,A]=this.#or.subarray(12,18),this.#er.push(((m+5*o)/6-e)/n,((A+5*h)/6-s)/r,((5*o+a)/6-e)/n,((5*h+c)/6-s)/r,((o+a)/2-e)/n,((h+c)/2-s)/r),!0))}toSVGPath(){if(this.isEmpty())return"";const t=this.#rr,i=this.#er;if(isNaN(this.#or[6])&&!this.isEmpty())return this.#Ar();const e=[];e.push(`M${t[4]} ${t[5]}`);for(let i=6;i<t.length;i+=6)isNaN(t[i])?e.push(`L${t[i+4]} ${t[i+5]}`):e.push(`C${t[i]} ${t[i+1]} ${t[i+2]} ${t[i+3]} ${t[i+4]} ${t[i+5]}`);this.#br(e);for(let t=i.length-6;t>=6;t-=6)isNaN(i[t])?e.push(`L${i[t+4]} ${i[t+5]}`):e.push(`C${i[t]} ${i[t+1]} ${i[t+2]} ${i[t+3]} ${i[t+4]} ${i[t+5]}`);return this.#vr(e),e.join(" ")}#Ar(){const[t,i,e,s]=this.#ir,[n,r,o,h]=this.#mr();return`M${(this.#or[2]-t)/e} ${(this.#or[3]-i)/s} L${(this.#or[4]-t)/e} ${(this.#or[5]-i)/s} L${n} ${r} L${o} ${h} L${(this.#or[16]-t)/e} ${(this.#or[17]-i)/s} L${(this.#or[14]-t)/e} ${(this.#or[15]-i)/s} Z`}#vr(t){const i=this.#er;t.push(`L${i[4]} ${i[5]} Z`)}#br(t){const[i,e,s,n]=this.#ir,r=this.#or.subarray(4,6),o=this.#or.subarray(16,18),[h,a,c,l]=this.#mr();t.push(`L${(r[0]-i)/s} ${(r[1]-e)/n} L${h} ${a} L${c} ${l} L${(o[0]-i)/s} ${(o[1]-e)/n}`)}newFreeDrawOutline(t,i,e,s,n,r){return new ks(t,i,e,s,n,r)}getOutlines(){const t=this.#rr,i=this.#er,e=this.#or,[s,n,r,o]=this.#ir,h=new Float32Array((this.#fr?.length??0)+2);for(let t=0,i=h.length-2;t<i;t+=2)h[t]=(this.#fr[t]-s)/r,h[t+1]=(this.#fr[t+1]-n)/o;if(h[h.length-2]=(this.#hr-s)/r,h[h.length-1]=(this.#ar-n)/o,isNaN(e[6])&&!this.isEmpty())return this.#yr(h);const a=new Float32Array(this.#rr.length+24+this.#er.length);let c=t.length;for(let i=0;i<c;i+=2)isNaN(t[i])?a[i]=a[i+1]=NaN:(a[i]=t[i],a[i+1]=t[i+1]);c=this.#xr(a,c);for(let t=i.length-6;t>=6;t-=6)for(let e=0;e<6;e+=2)isNaN(i[t+e])?(a[c]=a[c+1]=NaN,c+=2):(a[c]=i[t+e],a[c+1]=i[t+e+1],c+=2);return this.#Mr(a,c),this.newFreeDrawOutline(a,h,this.#ir,this.#ur,this.#sr,this.#nr)}#yr(t){const i=this.#or,[e,s,n,r]=this.#ir,[o,h,a,c]=this.#mr(),l=new Float32Array(36);return l.set([NaN,NaN,NaN,NaN,(i[2]-e)/n,(i[3]-s)/r,NaN,NaN,NaN,NaN,(i[4]-e)/n,(i[5]-s)/r,NaN,NaN,NaN,NaN,o,h,NaN,NaN,NaN,NaN,a,c,NaN,NaN,NaN,NaN,(i[16]-e)/n,(i[17]-s)/r,NaN,NaN,NaN,NaN,(i[14]-e)/n,(i[15]-s)/r],0),this.newFreeDrawOutline(l,t,this.#ir,this.#ur,this.#sr,this.#nr)}#Mr(t,i){const e=this.#er;return t.set([NaN,NaN,NaN,NaN,e[4],e[5]],i),i+6}#xr(t,i){const e=this.#or.subarray(4,6),s=this.#or.subarray(16,18),[n,r,o,h]=this.#ir,[a,c,l,u]=this.#mr();return t.set([NaN,NaN,NaN,NaN,(e[0]-n)/o,(e[1]-r)/h,NaN,NaN,NaN,NaN,a,c,NaN,NaN,NaN,NaN,l,u,NaN,NaN,NaN,NaN,(s[0]-n)/o,(s[1]-r)/h],i),i+24}}class ks extends xs{#ir;#kr=new Float32Array(4);#sr;#nr;#fr;#ur;#Er;constructor(t,i,e,s,n,r){super(),this.#Er=t,this.#fr=i,this.#ir=e,this.#ur=s,this.#sr=n,this.#nr=r,this.lastPoint=[NaN,NaN],this.#Sr(r);const[o,h,a,c]=this.#kr;for(let i=0,e=t.length;i<e;i+=2)t[i]=(t[i]-o)/a,t[i+1]=(t[i+1]-h)/c;for(let t=0,e=i.length;t<e;t+=2)i[t]=(i[t]-o)/a,i[t+1]=(i[t+1]-h)/c}toSVGPath(){const t=[`M${this.#Er[4]} ${this.#Er[5]}`];for(let i=6,e=this.#Er.length;i<e;i+=6)isNaN(this.#Er[i])?t.push(`L${this.#Er[i+4]} ${this.#Er[i+5]}`):t.push(`C${this.#Er[i]} ${this.#Er[i+1]} ${this.#Er[i+2]} ${this.#Er[i+3]} ${this.#Er[i+4]} ${this.#Er[i+5]}`);return t.push("Z"),t.join(" ")}serialize([t,i,e,s],n){const r=e-t,o=s-i;let h,a;switch(n){case 0:h=xs._rescale(this.#Er,t,s,r,-o),a=xs._rescale(this.#fr,t,s,r,-o);break;case 90:h=xs._rescaleAndSwap(this.#Er,t,i,r,o),a=xs._rescaleAndSwap(this.#fr,t,i,r,o);break;case 180:h=xs._rescale(this.#Er,e,i,-r,o),a=xs._rescale(this.#fr,e,i,-r,o);break;case 270:h=xs._rescaleAndSwap(this.#Er,e,s,-r,-o),a=xs._rescaleAndSwap(this.#fr,e,s,-r,-o)}return{outline:Array.from(h),points:[Array.from(a)]}}#Sr(t){const i=this.#Er;let e=i[4],s=i[5];const n=[e,s,e,s];let r=e,o=s;const h=t?Math.max:Math.min;for(let t=6,a=i.length;t<a;t+=6){const a=i[t+4],c=i[t+5];if(isNaN(i[t]))it.pointBoundingBox(a,c,n),o<c?(r=a,o=c):o===c&&(r=h(r,a));else{const a=[1/0,1/0,-1/0,-1/0];it.bezierBoundingBox(e,s,...i.slice(t,t+6),a),it.rectBoundingBox(...a,n),o<a[3]?(r=a[2],o=a[3]):o===a[3]&&(r=h(r,a[2]))}e=a,s=c}const a=this.#kr;a[0]=n[0]-this.#sr,a[1]=n[1]-this.#sr,a[2]=n[2]-n[0]+2*this.#sr,a[3]=n[3]-n[1]+2*this.#sr,this.lastPoint=[r,o]}get box(){return this.#kr}newOutliner(t,i,e,s,n,r=0){return new Ms(t,i,e,s,n,r)}getNewOutline(t,i){const[e,s,n,r]=this.#kr,[o,h,a,c]=this.#ir,l=n*a,u=r*c,d=e*a+o,f=s*c+h,p=this.newOutliner({x:this.#fr[0]*l+d,y:this.#fr[1]*u+f},this.#ir,this.#ur,t,this.#nr,i??this.#sr);for(let t=2;t<this.#fr.length;t+=2)p.add({x:this.#fr[t]*l+d,y:this.#fr[t+1]*u+f});return p.getOutlines()}}class Es{#ir;#_r;#Tr=[];#Cr=[];constructor(t,i=0,e=0,s=!0){const n=[1/0,1/0,-1/0,-1/0],r=10**-4;for(const{x:e,y:s,width:o,height:h}of t){const t=Math.floor((e-i)/r)*r,a=Math.ceil((e+o+i)/r)*r,c=Math.floor((s-i)/r)*r,l=Math.ceil((s+h+i)/r)*r;this.#Tr.push([t,c,l,!0],[a,c,l,!1]),it.rectBoundingBox(t,c,a,l,n)}const o=n[2]-n[0]+2*e,h=n[3]-n[1]+2*e,a=n[0]-e,c=n[1]-e,l=this.#Tr.at(s?-1:-2),u=[l[0],l[2]];for(const t of this.#Tr){const[i,e,s]=t;t[0]=(i-a)/o,t[1]=(e-c)/h,t[2]=(s-c)/h}this.#ir=new Float32Array([a,c,o,h]),this.#_r=u}getOutlines(){this.#Tr.sort(((t,i)=>t[0]-i[0]||t[1]-i[1]||t[2]-i[2]));const t=[];for(const i of this.#Tr)i[3]?(t.push(...this.#Pr(i)),this.#Rr(i)):(this.#Nr(i),t.push(...this.#Pr(i)));return this.#Dr(t)}#Dr(t){const i=[],e=new Set;for(const e of t){const[t,s,n]=e;i.push([t,s,e],[t,n,e])}i.sort(((t,i)=>t[1]-i[1]||t[0]-i[0]));for(let t=0,s=i.length;t<s;t+=2){const s=i[t][2],n=i[t+1][2];s.push(n),n.push(s),e.add(s),e.add(n)}const s=[];let n;for(;e.size>0;){const t=e.values().next().value;let[i,r,o,h,a]=t;e.delete(t);let c=i,l=r;for(n=[i,o],s.push(n);;){let t;if(e.has(h))t=h;else{if(!e.has(a))break;t=a}e.delete(t),[i,r,o,h,a]=t,c!==i&&(n.push(c,l,i,l===r?r:o),c=i),l=l===r?o:r}n.push(c,l)}return new Ss(s,this.#ir,this.#_r)}#Ir(t){const i=this.#Cr;let e=0,s=i.length-1;for(;e<=s;){const n=e+s>>1,r=i[n][0];if(r===t)return n;r<t?e=n+1:s=n-1}return s+1}#Rr([,t,i]){const e=this.#Ir(t);this.#Cr.splice(e,0,[t,i])}#Nr([,t,i]){const e=this.#Ir(t);for(let s=e;s<this.#Cr.length;s++){const[e,n]=this.#Cr[s];if(e!==t)break;if(e===t&&n===i)return void this.#Cr.splice(s,1)}for(let s=e-1;s>=0;s--){const[e,n]=this.#Cr[s];if(e!==t)break;if(e===t&&n===i)return void this.#Cr.splice(s,1)}}#Pr(t){const[i,e,s]=t,n=[[i,e,s]],r=this.#Ir(s);for(let t=0;t<r;t++){const[e,s]=this.#Cr[t];for(let t=0,r=n.length;t<r;t++){const[,o,h]=n[t];if(!(s<=o||h<=e))if(o>=e)if(h>s)n[t][1]=s;else{if(1===r)return[];n.splice(t,1),t--,r--}else n[t][2]=e,h>s&&n.push([i,s,h])}}return n}}class Ss extends xs{#ir;#Fr;constructor(t,i,e){super(),this.#Fr=t,this.#ir=i,this.lastPoint=e}toSVGPath(){const t=[];for(const i of this.#Fr){let[e,s]=i;t.push(`M${e} ${s}`);for(let n=2;n<i.length;n+=2){const r=i[n],o=i[n+1];r===e?(t.push(`V${o}`),s=o):o===s&&(t.push(`H${r}`),e=r)}t.push("Z")}return t.join(" ")}serialize([t,i,e,s],n){const r=[],o=e-t,h=s-i;for(const i of this.#Fr){const e=new Array(i.length);for(let n=0;n<i.length;n+=2)e[n]=t+i[n]*o,e[n+1]=s-i[n+1]*h;r.push(e)}return r}get box(){return this.#ir}get classNamesForOutlining(){return["highlightOutline"]}}class _s extends Ms{newFreeDrawOutline(t,i,e,s,n,r){return new Ts(t,i,e,s,n,r)}}class Ts extends ks{newOutliner(t,i,e,s,n,r=0){return new _s(t,i,e,s,n,r)}}class Cs{#Or=null;#$r=null;#Lr;#Br=null;#jr=!1;#Ur=!1;#r=null;#zr;#Hr=null;#w=null;#Gr;static#Wr=null;static get _keyboardManager(){return H(this,"_keyboardManager",new Ot([[["Escape","mac+Escape"],Cs.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Cs.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Cs.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Cs.prototype._moveToPrevious],[["Home","mac+Home"],Cs.prototype._moveToBeginning],[["End","mac+End"],Cs.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:i=null}){t?(this.#Ur=!1,this.#Gr=_.HIGHLIGHT_COLOR,this.#r=t):(this.#Ur=!0,this.#Gr=_.HIGHLIGHT_DEFAULT_COLOR),this.#w=t?._uiManager||i,this.#zr=this.#w._eventBus,this.#Lr=t?.color||this.#w?.highlightColors.values().next().value||"#FFFF98",Cs.#Wr||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const t=this.#Or=document.createElement("button");t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.setAttribute("aria-haspopup",!0);const i=this.#w._signal;t.addEventListener("click",this.#Vr.bind(this),{signal:i}),t.addEventListener("keydown",this.#nn.bind(this),{signal:i});const e=this.#$r=document.createElement("span");return e.className="swatch",e.setAttribute("aria-hidden",!0),e.style.backgroundColor=this.#Lr,t.append(e),t}renderMainDropdown(){const t=this.#Br=this.#Xr();return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}#Xr(){const t=document.createElement("div"),i=this.#w._signal;t.addEventListener("contextmenu",vt,{signal:i}),t.className="dropdown",t.role="listbox",t.setAttribute("aria-multiselectable",!1),t.setAttribute("aria-orientation","vertical"),t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[e,s]of this.#w.highlightColors){const n=document.createElement("button");n.tabIndex="0",n.role="option",n.setAttribute("data-color",s),n.title=e,n.setAttribute("data-l10n-id",Cs.#Wr[e]);const r=document.createElement("span");n.append(r),r.className="swatch",r.style.backgroundColor=s,n.setAttribute("aria-selected",s===this.#Lr),n.addEventListener("click",this.#Yr.bind(this,s),{signal:i}),t.append(n)}return t.addEventListener("keydown",this.#nn.bind(this),{signal:i}),t}#Yr(t,i){i.stopPropagation(),this.#zr.dispatch("switchannotationeditorparams",{source:this,type:this.#Gr,value:t})}_colorSelectFromKeyboard(t){if(t.target===this.#Or)return void this.#Vr(t);const i=t.target.getAttribute("data-color");i&&this.#Yr(i,t)}_moveToNext(t){this.#Qr?t.target!==this.#Or?t.target.nextSibling?.focus():this.#Br.firstChild?.focus():this.#Vr(t)}_moveToPrevious(t){t.target!==this.#Br?.firstChild&&t.target!==this.#Or?(this.#Qr||this.#Vr(t),t.target.previousSibling?.focus()):this.#Qr&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){this.#Qr?this.#Br.firstChild?.focus():this.#Vr(t)}_moveToEnd(t){this.#Qr?this.#Br.lastChild?.focus():this.#Vr(t)}#nn(t){Cs._keyboardManager.exec(this,t)}#Vr(t){if(this.#Qr)return void this.hideDropdown();if(this.#jr=0===t.detail,this.#Hr||(this.#Hr=new AbortController,window.addEventListener("pointerdown",this.#l.bind(this),{signal:this.#w.combinedSignal(this.#Hr)})),this.#Br)return void this.#Br.classList.remove("hidden");const i=this.#Br=this.#Xr();this.#Or.append(i)}#l(t){this.#Br?.contains(t.target)||this.hideDropdown()}hideDropdown(){this.#Br?.classList.add("hidden"),this.#Hr?.abort(),this.#Hr=null}get#Qr(){return this.#Br&&!this.#Br.classList.contains("hidden")}_hideDropdownFromKeyboard(){this.#Ur||(this.#Qr?(this.hideDropdown(),this.#Or.focus({preventScroll:!0,focusVisible:this.#jr})):this.#r?.unselect())}updateColor(t){if(this.#$r&&(this.#$r.style.backgroundColor=t),!this.#Br)return;const i=this.#w.highlightColors.values();for(const e of this.#Br.children)e.setAttribute("aria-selected",i.next().value===t)}destroy(){this.#Or?.remove(),this.#Or=null,this.#$r=null,this.#Br?.remove(),this.#Br=null}}class Ps extends Ut{#qr=null;#Kr=0;#Jr;#Zr=null;#n=null;#to=null;#io=null;#eo=0;#so=null;#no=null;#v=null;#ro=!1;#_r=null;#oo;#ho=null;#ao="";#dr;#co="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=S.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const t=Ps.prototype;return H(this,"_keyboardManager",new Ot([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:"highlightEditor"}),this.color=t.color||Ps._defaultColor,this.#dr=t.thickness||Ps._defaultThickness,this.#oo=t.opacity||Ps._defaultOpacity,this.#Jr=t.boxes||null,this.#co=t.methodOfCreation||"",this.#ao=t.text||"",this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(this.#ro=!0,this.#lo(t),this.#uo()):this.#Jr&&(this.#qr=t.anchorNode,this.#Kr=t.anchorOffset,this.#io=t.focusNode,this.#eo=t.focusOffset,this.#do(),this.#uo(),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:this.#ro?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#dr,methodOfCreation:this.#co}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}#do(){const t=new Es(this.#Jr,.001);this.#no=t.getOutlines(),[this.x,this.y,this.width,this.height]=this.#no.box;const i=new Es(this.#Jr,.0025,.001,"ltr"===this._uiManager.direction);this.#to=i.getOutlines();const{lastPoint:e}=this.#to;this.#_r=[(e[0]-this.x)/this.width,(e[1]-this.y)/this.height]}#lo({highlightOutlines:t,highlightId:i,clipPathId:e}){if(this.#no=t,this.#to=t.getNewOutline(this.#dr/2+1.5,.0025),i>=0)this.#v=i,this.#Zr=e,this.parent.drawLayer.finalizeDraw(i,{bbox:t.box,path:{d:t.toSVGPath()}}),this.#ho=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#to.box,path:{d:this.#to.toSVGPath()}},!0);else if(this.parent){const i=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#v,{bbox:Ps.#fo(this.#no.box,(i-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#ho,{bbox:Ps.#fo(this.#to.box,i),path:{d:this.#to.toSVGPath()}})}const[s,n,r,o]=t.box;switch(this.rotation){case 0:this.x=s,this.y=n,this.width=r,this.height=o;break;case 90:{const[t,i]=this.parentDimensions;this.x=n,this.y=1-s,this.width=r*i/t,this.height=o*t/i;break}case 180:this.x=1-s,this.y=1-n,this.width=r,this.height=o;break;case 270:{const[t,i]=this.parentDimensions;this.x=1-n,this.y=s,this.width=r*i/t,this.height=o*t/i;break}}const{lastPoint:h}=this.#to;this.#_r=[(h[0]-s)/r,(h[1]-n)/o]}static initialize(t,i){Ut.initialize(t,i),Ps._defaultColor||=i.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(t,i){switch(t){case _.HIGHLIGHT_DEFAULT_COLOR:Ps._defaultColor=i;break;case _.HIGHLIGHT_THICKNESS:Ps._defaultThickness=i}}translateInPage(t,i){}get toolbarPosition(){return this.#_r}updateParams(t,i){switch(t){case _.HIGHLIGHT_COLOR:this.#Xn(i);break;case _.HIGHLIGHT_THICKNESS:this.#po(i)}}static get defaultPropertiesToUpdate(){return[[_.HIGHLIGHT_DEFAULT_COLOR,Ps._defaultColor],[_.HIGHLIGHT_THICKNESS,Ps._defaultThickness]]}get propertiesToUpdate(){return[[_.HIGHLIGHT_COLOR,this.color||Ps._defaultColor],[_.HIGHLIGHT_THICKNESS,this.#dr||Ps._defaultThickness],[_.HIGHLIGHT_FREE,this.#ro]]}#Xn(t){const i=(t,i)=>{this.color=t,this.#oo=i,this.parent?.drawLayer.updateProperties(this.#v,{root:{fill:t,"fill-opacity":i}}),this.#n?.updateColor(t)},e=this.color,s=this.#oo;this.addCommands({cmd:i.bind(this,t,Ps._defaultOpacity),undo:i.bind(this,e,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:_.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)}#po(t){const i=this.#dr,e=t=>{this.#dr=t,this.#go(t)};this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:_.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&(this.#n=new Cs({editor:this}),t.addColorPicker(this.#n)),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#wo())}getBaseTranslation(){return[0,0]}getRect(t,i){return super.getRect(t,i,this.#wo())}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){this.#mo(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#uo(),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let i=!1;this.parent&&!t?this.#mo():t&&(this.#uo(t),i=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),i&&this.select()}#go(t){if(!this.#ro)return;this.#lo({highlightOutlines:this.#no.getNewOutline(t/2)}),this.fixAndSetPosition();const[i,e]=this.parentDimensions;this.setDims(this.width*i,this.height*e)}#mo(){null!==this.#v&&this.parent&&(this.parent.drawLayer.remove(this.#v),this.#v=null,this.parent.drawLayer.remove(this.#ho),this.#ho=null)}#uo(t=this.parent){null===this.#v&&(({id:this.#v,clipPathId:this.#Zr}=t.drawLayer.draw({bbox:this.#no.box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.#oo},rootClass:{highlight:!0,free:this.#ro},path:{d:this.#no.toSVGPath()}},!1,!0)),this.#ho=t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#ro},bbox:this.#to.box,path:{d:this.#to.toSVGPath()}},this.#ro),this.#so&&(this.#so.style.clipPath=this.#Zr))}static#fo([t,i,e,s],n){switch(n){case 90:return[1-i-s,t,s,e];case 180:return[1-t-e,1-i-s,e,s];case 270:return[i,1-t-e,s,e]}return[t,i,e,s]}rotate(t){const{drawLayer:i}=this.parent;let e;e=this.#ro?Ps.#fo(this.#no.box,t=(t-this.rotation+360)%360):Ps.#fo([this.x,this.y,this.width,this.height],t),i.updateProperties(this.#v,{bbox:e,root:{"data-main-rotation":t}}),i.updateProperties(this.#ho,{bbox:Ps.#fo(this.#to.box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;const t=super.render();this.#ao&&(t.setAttribute("aria-label",this.#ao),t.setAttribute("role","mark")),this.#ro?t.classList.add("free"):this.div.addEventListener("keydown",this.#Ao.bind(this),{signal:this._uiManager._signal});const i=this.#so=document.createElement("div");t.append(i),i.setAttribute("aria-hidden","true"),i.className="internal",i.style.clipPath=this.#Zr;const[e,s]=this.parentDimensions;return this.setDims(this.width*e,this.height*s),Nt(this,this.#so,["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#ho,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#ho,{rootClass:{hovered:!1}})}#Ao(t){Ps._keyboardManager.exec(this,t)}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:this.#bo(!0);break;case 1:case 3:this.#bo(!1)}}#bo(t){if(!this.#qr)return;const i=window.getSelection();t?i.setPosition(this.#qr,this.#Kr):i.setPosition(this.#io,this.#eo)}select(){super.select(),this.#ho&&this.parent?.drawLayer.updateProperties(this.#ho,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#ho&&(this.parent?.drawLayer.updateProperties(this.#ho,{rootClass:{selected:!1}}),this.#ro||this.#bo(!1))}get _mustFixPosition(){return!this.#ro}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(this.#v,{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(this.#ho,{rootClass:{hidden:!t}}))}#wo(){return this.#ro?this.rotation:0}#vo(){if(this.#ro)return null;const[t,i]=this.pageDimensions,[e,s]=this.pageTranslation,n=this.#Jr,r=new Float32Array(8*n.length);let o=0;for(const{x:h,y:a,width:c,height:l}of n){const n=h*t+e,u=(1-a)*i+s;r[o]=r[o+4]=n,r[o+1]=r[o+3]=u,r[o+2]=r[o+6]=n+c*t,r[o+5]=r[o+7]=u-l*i,o+=8}return r}#yo(t){return this.#no.serialize(t,this.#wo())}static startHighlighting(t,i,{target:e,x:s,y:n}){const{x:r,y:o,width:h,height:a}=e.getBoundingClientRect(),c=new AbortController,l=t.combinedSignal(c),u=i=>{c.abort(),this.#xo(t,i)};window.addEventListener("blur",u,{signal:l}),window.addEventListener("pointerup",u,{signal:l}),window.addEventListener("pointerdown",yt,{capture:!0,passive:!1,signal:l}),window.addEventListener("contextmenu",vt,{signal:l}),e.addEventListener("pointermove",this.#Mo.bind(this,t),{signal:l}),this._freeHighlight=new _s({x:s,y:n},[r,o,h,a],t.scale,this._defaultThickness/2,i,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0))}static#Mo(t,i){this._freeHighlight.add(i)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#xo(t,i){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(i,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static async deserialize(t,i,e){let s=null;if(t instanceof fs){const{data:{quadPoints:i,rect:e,rotation:n,id:r,color:o,opacity:h,popupRef:a},parent:{page:{pageNumber:c}}}=t;s=t={annotationType:S.HIGHLIGHT,color:Array.from(o),opacity:h,quadPoints:i,boxes:null,pageIndex:c-1,rect:e.slice(0),rotation:n,id:r,deleted:!1,popupRef:a}}else if(t instanceof ds){const{data:{inkLists:i,rect:e,rotation:n,id:r,color:o,borderStyle:{rawWidth:h},popupRef:a},parent:{page:{pageNumber:c}}}=t;s=t={annotationType:S.HIGHLIGHT,color:Array.from(o),thickness:h,inkLists:i,boxes:null,pageIndex:c-1,rect:e.slice(0),rotation:n,id:r,deleted:!1,popupRef:a}}const{color:n,quadPoints:r,inkLists:o,opacity:h}=t,a=await super.deserialize(t,i,e);a.color=it.makeHexColor(...n),a.#oo=h||1,o&&(a.#dr=t.thickness),a.annotationElementId=t.id||null,a._initialData=s;const[c,l]=a.pageDimensions,[u,d]=a.pageTranslation;if(r){const t=a.#Jr=[];for(let i=0;i<r.length;i+=8)t.push({x:(r[i]-u)/c,y:1-(r[i+1]-d)/l,width:(r[i+2]-r[i])/c,height:(r[i+1]-r[i+5])/l});a.#do(),a.#uo(),a.rotate(a.rotation)}else if(o){a.#ro=!0;const t=o[0],e={x:t[0]-u,y:l-(t[1]-d)},s=new _s(e,[0,0,c,l],1,a.#dr/2,!0,.001);for(let i=0,n=t.length;i<n;i+=2)e.x=t[i]-u,e.y=l-(t[i+1]-d),s.add(e);const{id:n,clipPathId:r}=i.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:a.color,"fill-opacity":a._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:s.toSVGPath()}},!0,!0);a.#lo({highlightOutlines:s.getOutlines(),highlightId:n,clipPathId:r}),a.#uo(),a.rotate(a.parentRotation)}return a}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const i=this.getRect(0,0),e=Ut._colorManager.convert(this.color),s={annotationType:S.HIGHLIGHT,color:e,opacity:this.#oo,thickness:this.#dr,quadPoints:this.#vo(),outlines:this.#yo(i),pageIndex:this.pageIndex,rect:i,rotation:this.#wo(),structTreeParentId:this._structTreeParentId};return this.annotationElementId&&!this.#tr(s)?null:(s.id=this.annotationElementId,s)}#tr(t){const{color:i}=this._initialData;return t.color.some(((t,e)=>t!==i[e]))}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}}class Rs{#ko=Object.create(null);updateProperty(t,i){this[t]=i,this.updateSVGProperty(t,i)}updateProperties(t){if(t)for(const[i,e]of Object.entries(t))i.startsWith("_")||this.updateProperty(i,e)}updateSVGProperty(t,i){this.#ko[t]=i}toSVGProperties(){const t=this.#ko;return this.#ko=Object.create(null),{root:t}}reset(){this.#ko=Object.create(null)}updateAll(t=this){this.updateProperties(t)}clone(){B("Not implemented")}}class Ns extends Ut{#Eo=null;#So;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#_o=null;static#To=null;static#Co=null;static#Po=NaN;static#Ro=null;static#No=null;static#Do=NaN;static _INNER_MARGIN=3;constructor(t){super(t),this.#So=t.mustBeCommitted||!1,this._addOutlines(t)}_addOutlines(t){t.drawOutlines&&(this.#Io(t),this.#uo())}#Io({drawOutlines:t,drawId:i,drawingOptions:e}){this.#Eo=t,this._drawingOptions||=e,i>=0?(this._drawId=i,this.parent.drawLayer.finalizeDraw(i,t.defaultProperties)):this._drawId=this.#Fo(t,this.parent),this.#Oo(t.box)}#Fo(t,i){const{id:e}=i.drawLayer.draw(Ns._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return e}static _mergeSVGProperties(t,i){const e=new Set(Object.keys(t));for(const[s,n]of Object.entries(i))e.has(s)?Object.assign(t[s],n):t[s]=n;return t}static getDefaultDrawingOptions(t){B("Not implemented")}static get typesMap(){B("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,i){const e=this.typesMap.get(t);e&&this._defaultDrawingOptions.updateProperty(e,i),this._currentParent&&(Ns.#_o.updateProperty(e,i),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,i){const e=this.constructor.typesMap.get(t);e&&this._updateProperty(t,e,i)}static get defaultPropertiesToUpdate(){const t=[],i=this._defaultDrawingOptions;for(const[e,s]of this.typesMap)t.push([e,i[s]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:i}=this;for(const[e,s]of this.constructor.typesMap)t.push([e,i[s]]);return t}_updateProperty(t,i,e){const s=this._drawingOptions,n=s[i],r=t=>{s.updateProperty(i,t);const e=this.#Eo.updateProperty(i,t);e&&this.#Oo(e),this.parent?.drawLayer.updateProperties(this._drawId,s.toSVGProperties())};this.addCommands({cmd:r.bind(this,e),undo:r.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,Ns._mergeSVGProperties(this.#Eo.getPathResizingSVGProperties(this.#$o()),{bbox:this.#Lo()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,Ns._mergeSVGProperties(this.#Eo.getPathResizedSVGProperties(this.#$o()),{bbox:this.#Lo()}))}_onTranslating(t,i){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#Lo()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,Ns._mergeSVGProperties(this.#Eo.getPathTranslatedSVGProperties(this.#$o(),this.parentDimensions),{bbox:this.#Lo()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#So&&(this.#So=!1,this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){this.#mo(),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#uo(),this.#Oo(this.#Eo.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let i=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),this.#mo()):t&&(this._uiManager.addShouldRescale(this),this.#uo(t),i=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),i&&this.select()}#mo(){null!==this._drawId&&this.parent&&(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#uo(t=this.parent){null!==this._drawId&&this.parent===t||(null===this._drawId?(this._drawingOptions.updateAll(),this._drawId=this.#Fo(this.#Eo,t)):this.parent.drawLayer.updateParent(this._drawId,t.drawLayer))}#Bo([t,i,e,s]){const{parentDimensions:[n,r],rotation:o}=this;switch(o){case 90:return[i,1-t,e*(r/n),s*(n/r)];case 180:return[1-t,1-i,e,s];case 270:return[1-i,t,e*(r/n),s*(n/r)];default:return[t,i,e,s]}}#$o(){const{x:t,y:i,width:e,height:s,parentDimensions:[n,r],rotation:o}=this;switch(o){case 90:return[1-i,t,e*(n/r),s*(r/n)];case 180:return[1-t,1-i,e,s];case 270:return[i,1-t,e*(n/r),s*(r/n)];default:return[t,i,e,s]}}#Oo(t){if([this.x,this.y,this.width,this.height]=this.#Bo(t),this.div){this.fixAndSetPosition();const[t,i]=this.parentDimensions;this.setDims(this.width*t,this.height*i)}this._onResized()}#Lo(){const{x:t,y:i,width:e,height:s,rotation:n,parentRotation:r,parentDimensions:[o,h]}=this;switch((4*n+r)/90){case 1:return[1-i-s,t,s,e];case 2:return[1-t-e,1-i-s,e,s];case 3:return[i,1-t-e,s,e];case 4:return[t,i-e*(o/h),s*(h/o),e*(o/h)];case 5:return[1-i,t,e*(o/h),s*(h/o)];case 6:return[1-t-s*(h/o),1-i,s*(h/o),e*(o/h)];case 7:return[i-e*(o/h),1-t-s*(h/o),e*(o/h),s*(h/o)];case 8:return[t-e,i-s,e,s];case 9:return[1-i,t-e,s,e];case 10:return[1-t,1-i,e,s];case 11:return[i-s,1-t,s,e];case 12:return[t-s*(h/o),i,s*(h/o),e*(o/h)];case 13:return[1-i-e*(o/h),t-s*(h/o),e*(o/h),s*(h/o)];case 14:return[1-t,1-i-e*(o/h),s*(h/o),e*(o/h)];case 15:return[i,1-t,e*(o/h),s*(h/o)];default:return[t,i,e,s]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,Ns._mergeSVGProperties({bbox:this.#Lo()},this.#Eo.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#Oo(this.#Eo.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,i;this._isCopy&&(t=this.x,i=this.y);const e=super.render();e.classList.add("draw");const s=document.createElement("div");e.append(s),s.setAttribute("aria-hidden","true"),s.className="internal";const[n,r]=this.parentDimensions;return this.setDims(this.width*n,this.height*r),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,i),e}static createDrawerInstance(t,i,e,s,n){B("Not implemented")}static startDrawing(t,i,e,s){const{target:n,offsetX:r,offsetY:o,pointerId:h,pointerType:a}=s;if(Ns.#Ro&&Ns.#Ro!==a)return;const{viewport:{rotation:c}}=t,{width:l,height:u}=n.getBoundingClientRect(),d=Ns.#To=new AbortController,f=t.combinedSignal(d);Ns.#Po||=h,Ns.#Ro??=a,window.addEventListener("pointerup",(t=>{Ns.#Po===t.pointerId?this._endDraw(t):Ns.#No?.delete(t.pointerId)}),{signal:f}),window.addEventListener("pointercancel",(t=>{Ns.#Po===t.pointerId?this._currentParent.endDrawingSession():Ns.#No?.delete(t.pointerId)}),{signal:f}),window.addEventListener("pointerdown",(t=>{Ns.#Ro===t.pointerType&&((Ns.#No||=new Set).add(t.pointerId),Ns.#_o.isCancellable()&&(Ns.#_o.removeLastElement(),Ns.#_o.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))}),{capture:!0,passive:!1,signal:f}),window.addEventListener("contextmenu",vt,{signal:f}),n.addEventListener("pointermove",this._drawMove.bind(this),{signal:f}),n.addEventListener("touchmove",(t=>{t.timeStamp===Ns.#Do&&yt(t)}),{signal:f}),t.toggleDrawing(),i._editorUndoBar?.hide(),Ns.#_o?t.drawLayer.updateProperties(this._currentDrawId,Ns.#_o.startNew(r,o,l,u,c)):(i.updateUIForDefaultProperties(this),Ns.#_o=this.createDrawerInstance(r,o,l,u,c),Ns.#Co=this.getDefaultDrawingOptions(),this._currentParent=t,({id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(Ns.#Co.toSVGProperties(),Ns.#_o.defaultSVGProperties),!0,!1)))}static _drawMove(t){if(Ns.#Do=-1,!Ns.#_o)return;const{offsetX:i,offsetY:e,pointerId:s}=t;Ns.#Po===s&&(Ns.#No?.size>=1?this._endDraw(t):(this._currentParent.drawLayer.updateProperties(this._currentDrawId,Ns.#_o.add(i,e)),Ns.#Do=t.timeStamp,yt(t)))}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,Ns.#_o=null,Ns.#Co=null,Ns.#Ro=null,Ns.#Do=NaN),Ns.#To&&(Ns.#To.abort(),Ns.#To=null,Ns.#Po=NaN,Ns.#No=null)}static _endDraw(t){const i=this._currentParent;if(i)if(i.toggleDrawing(!0),this._cleanup(!1),t?.target===i.div&&i.drawLayer.updateProperties(this._currentDrawId,Ns.#_o.end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const t=Ns.#_o,e=this._currentDrawId,s=t.getLastElement();i.addCommands({cmd:()=>{i.drawLayer.updateProperties(e,t.setLastElement(s))},undo:()=>{i.drawLayer.updateProperties(e,t.removeLastElement())},mustExec:!1,type:_.DRAW_STEP})}else this.endDrawing(!1)}static endDrawing(t){const i=this._currentParent;if(!i)return null;if(i.toggleDrawing(!0),i.cleanUndoStack(_.DRAW_STEP),!Ns.#_o.isEmpty()){const{pageDimensions:[e,s],scale:n}=i,r=i.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:Ns.#_o.getOutlines(e*n,s*n,n,this._INNER_MARGIN),drawingOptions:Ns.#Co,mustBeCommitted:!t});return this._cleanup(!0),r}return i.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,i,e,s,n,r){B("Not implemented")}static async deserialize(t,i,e){const{rawDims:{pageWidth:s,pageHeight:n,pageX:r,pageY:o}}=i.viewport,h=this.deserializeDraw(r,o,s,n,this._INNER_MARGIN,t),a=await super.deserialize(t,i,e);return a.createDrawingOptions(t),a.#Io({drawOutlines:h}),a.#uo(),a.onScaleChanging(),a.rotate(),a}serializeDraw(t){const[i,e]=this.pageTranslation,[s,n]=this.pageDimensions;return this.#Eo.serialize([i,e,s,n],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}}class Ds{#or=new Float64Array(6);#Tn;#jo;#rs;#dr;#fr;#Uo="";#zo=0;#Fr=new Is;#Ho;#Go;constructor(t,i,e,s,n,r){this.#Ho=e,this.#Go=s,this.#rs=n,this.#dr=r,[t,i]=this.#Wo(t,i);const o=this.#Tn=[NaN,NaN,NaN,NaN,t,i];this.#fr=[t,i],this.#jo=[{line:o,points:this.#fr}],this.#or.set(o,0)}updateProperty(t,i){"stroke-width"===t&&(this.#dr=i)}#Wo(t,i){return xs._normalizePoint(t,i,this.#Ho,this.#Go,this.#rs)}isEmpty(){return!this.#jo||0===this.#jo.length}isCancellable(){return this.#fr.length<=10}add(t,i){[t,i]=this.#Wo(t,i);const[e,s,n,r]=this.#or.subarray(2,6);return Math.hypot(this.#Ho*(t-n),this.#Go*(i-r))<=2?null:(this.#fr.push(t,i),isNaN(e)?(this.#or.set([n,r,t,i],2),this.#Tn.push(NaN,NaN,NaN,NaN,t,i),{path:{d:this.toSVGPath()}}):(isNaN(this.#or[0])&&this.#Tn.splice(6,6),this.#or.set([e,s,n,r,t,i],0),this.#Tn.push(...xs.createBezierPoints(e,s,n,r,t,i)),{path:{d:this.toSVGPath()}}))}end(t,i){return this.add(t,i)||(2===this.#fr.length?{path:{d:this.toSVGPath()}}:null)}startNew(t,i,e,s,n){this.#Ho=e,this.#Go=s,this.#rs=n,[t,i]=this.#Wo(t,i);const r=this.#Tn=[NaN,NaN,NaN,NaN,t,i];this.#fr=[t,i];const o=this.#jo.at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),this.#jo.push({line:r,points:this.#fr}),this.#or.set(r,0),this.#zo=0,this.toSVGPath(),null}getLastElement(){return this.#jo.at(-1)}setLastElement(t){return this.#jo?(this.#jo.push(t),this.#Tn=t.line,this.#fr=t.points,this.#zo=0,{path:{d:this.toSVGPath()}}):this.#Fr.setLastElement(t)}removeLastElement(){if(!this.#jo)return this.#Fr.removeLastElement();this.#jo.pop(),this.#Uo="";for(let t=0,i=this.#jo.length;t<i;t++){const{line:i,points:e}=this.#jo[t];this.#Tn=i,this.#fr=e,this.#zo=0,this.toSVGPath()}return{path:{d:this.#Uo}}}toSVGPath(){const t=xs.svgRound(this.#Tn[4]),i=xs.svgRound(this.#Tn[5]);if(2===this.#fr.length)return this.#Uo=`${this.#Uo} M ${t} ${i} Z`,this.#Uo;if(this.#fr.length<=6){const e=this.#Uo.lastIndexOf("M");this.#Uo=`${this.#Uo.slice(0,e)} M ${t} ${i}`,this.#zo=6}if(4===this.#fr.length){const t=xs.svgRound(this.#Tn[10]),i=xs.svgRound(this.#Tn[11]);return this.#Uo=`${this.#Uo} L ${t} ${i}`,this.#zo=12,this.#Uo}const e=[];0===this.#zo&&(e.push(`M ${t} ${i}`),this.#zo=6);for(let t=this.#zo,i=this.#Tn.length;t<i;t+=6){const[i,s,n,r,o,h]=this.#Tn.slice(t,t+6).map(xs.svgRound);e.push(`C${i} ${s} ${n} ${r} ${o} ${h}`)}return this.#Uo+=e.join(" "),this.#zo=this.#Tn.length,this.#Uo}getOutlines(t,i,e,s){const n=this.#jo.at(-1);return n.line=new Float32Array(n.line),n.points=new Float32Array(n.points),this.#Fr.build(this.#jo,t,i,e,this.#rs,this.#dr,s),this.#or=null,this.#Tn=null,this.#jo=null,this.#Uo=null,this.#Fr}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}class Is extends xs{#kr;#Vo=0;#sr;#jo;#Ho;#Go;#Xo;#rs;#dr;build(t,i,e,s,n,r,o){this.#Ho=i,this.#Go=e,this.#Xo=s,this.#rs=n,this.#dr=r,this.#sr=o??0,this.#jo=t,this.#Yo()}get thickness(){return this.#dr}setLastElement(t){return this.#jo.push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#jo.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const t=[];for(const{line:i}of this.#jo)if(t.push(`M${xs.svgRound(i[4])} ${xs.svgRound(i[5])}`),6!==i.length)if(12===i.length&&isNaN(i[6]))t.push(`L${xs.svgRound(i[10])} ${xs.svgRound(i[11])}`);else for(let e=6,s=i.length;e<s;e+=6){const[s,n,r,o,h,a]=i.subarray(e,e+6).map(xs.svgRound);t.push(`C${s} ${n} ${r} ${o} ${h} ${a}`)}else t.push("Z");return t.join("")}serialize([t,i,e,s],n){const r=[],o=[],[h,a,c,l]=this.#Qo();let u,d,f,p,g,w,m,A,b;switch(this.#rs){case 0:b=xs._rescale,u=t,d=i+s,f=e,p=-s,g=t+h*e,w=i+(1-a-l)*s,m=t+(h+c)*e,A=i+(1-a)*s;break;case 90:b=xs._rescaleAndSwap,u=t,d=i,f=e,p=s,g=t+a*e,w=i+h*s,m=t+(a+l)*e,A=i+(h+c)*s;break;case 180:b=xs._rescale,u=t+e,d=i,f=-e,p=s,g=t+(1-h-c)*e,w=i+a*s,m=t+(1-h)*e,A=i+(a+l)*s;break;case 270:b=xs._rescaleAndSwap,u=t+e,d=i+s,f=-e,p=-s,g=t+(1-a-l)*e,w=i+(1-h-c)*s,m=t+(1-a)*e,A=i+(1-h)*s}for(const{line:t,points:i}of this.#jo)r.push(b(t,u,d,f,p,n?new Array(t.length):null)),o.push(b(i,u,d,f,p,n?new Array(i.length):null));return{lines:r,points:o,rect:[g,w,m,A]}}static deserialize(t,i,e,s,n,{paths:{lines:r,points:o},rotation:h,thickness:a}){const c=[];let l,u,d,f,p;switch(h){case 0:p=xs._rescale,l=-t/e,u=i/s+1,d=1/e,f=-1/s;break;case 90:p=xs._rescaleAndSwap,l=-i/s,u=-t/e,d=1/s,f=1/e;break;case 180:p=xs._rescale,l=t/e+1,u=-i/s,d=-1/e,f=1/s;break;case 270:p=xs._rescaleAndSwap,l=i/s+1,u=t/e+1,d=-1/s,f=-1/e}if(!r){r=[];for(const t of o){const i=t.length;if(2===i){r.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1]]));continue}if(4===i){r.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1],NaN,NaN,NaN,NaN,t[2],t[3]]));continue}const e=new Float32Array(3*(i-2));r.push(e);let[s,n,o,h]=t.subarray(0,4);e.set([NaN,NaN,NaN,NaN,s,n],0);for(let r=4;r<i;r+=2){const i=t[r],a=t[r+1];e.set(xs.createBezierPoints(s,n,o,h,i,a),3*(r-2)),[s,n,o,h]=[o,h,i,a]}}}for(let t=0,i=r.length;t<i;t++)c.push({line:p(r[t].map((t=>t??NaN)),l,u,d,f),points:p(o[t].map((t=>t??NaN)),l,u,d,f)});const g=new this.prototype.constructor;return g.build(c,e,s,1,h,a,n),g}#qo(t=this.#dr){const i=this.#sr+t/2*this.#Xo;return this.#rs%180==0?[i/this.#Ho,i/this.#Go]:[i/this.#Go,i/this.#Ho]}#Qo(){const[t,i,e,s]=this.#kr,[n,r]=this.#qo(0);return[t+n,i+r,e-2*n,s-2*r]}#Yo(){const t=this.#kr=new Float32Array([1/0,1/0,-1/0,-1/0]);for(const{line:i}of this.#jo){if(i.length<=12){for(let e=4,s=i.length;e<s;e+=6)it.pointBoundingBox(i[e],i[e+1],t);continue}let e=i[4],s=i[5];for(let n=6,r=i.length;n<r;n+=6){const[r,o,h,a,c,l]=i.subarray(n,n+6);it.bezierBoundingBox(e,s,r,o,h,a,c,l,t),e=c,s=l}}const[i,e]=this.#qo();t[0]=ht(t[0]-i,0,1),t[1]=ht(t[1]-e,0,1),t[2]=ht(t[2]+i,0,1),t[3]=ht(t[3]+e,0,1),t[2]-=t[0],t[3]-=t[1]}get box(){return this.#kr}updateProperty(t,i){return"stroke-width"===t?this.#po(i):null}#po(t){const[i,e]=this.#qo();this.#dr=t;const[s,n]=this.#qo(),[r,o]=[s-i,n-e],h=this.#kr;return h[0]-=r,h[1]-=o,h[2]+=2*r,h[3]+=2*o,h}updateParentDimensions([t,i],e){const[s,n]=this.#qo();this.#Ho=t,this.#Go=i,this.#Xo=e;const[r,o]=this.#qo(),h=r-s,a=o-n,c=this.#kr;return c[0]-=h,c[1]-=a,c[2]+=2*h,c[3]+=2*a,c}updateRotation(t){return this.#Vo=t,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#kr.map(xs.svgRound).join(" ")}get defaultProperties(){const[t,i]=this.#kr;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${xs.svgRound(t)} ${xs.svgRound(i)}`}}}get rotationTransform(){const[,,t,i]=this.#kr;let e=0,s=0,n=0,r=0,o=0,h=0;switch(this.#Vo){case 90:s=i/t,n=-t/i,o=t;break;case 180:e=-1,r=-1,o=t,h=i;break;case 270:s=-i/t,n=t/i,h=i;break;default:return""}return`matrix(${e} ${s} ${n} ${r} ${xs.svgRound(o)} ${xs.svgRound(h)})`}getPathResizingSVGProperties([t,i,e,s]){const[n,r]=this.#qo(),[o,h,a,c]=this.#kr;if(Math.abs(a-n)<=xs.PRECISION||Math.abs(c-r)<=xs.PRECISION){const n=t+e/2-(o+a/2),r=i+s/2-(h+c/2);return{path:{"transform-origin":`${xs.svgRound(t)} ${xs.svgRound(i)}`,transform:`${this.rotationTransform} translate(${n} ${r})`}}}const l=(e-2*n)/(a-2*n),u=(s-2*r)/(c-2*r),d=a/e,f=c/s;return{path:{"transform-origin":`${xs.svgRound(o)} ${xs.svgRound(h)}`,transform:`${this.rotationTransform} scale(${d} ${f}) translate(${xs.svgRound(n)} ${xs.svgRound(r)}) scale(${l} ${u}) translate(${xs.svgRound(-n)} ${xs.svgRound(-r)})`}}}getPathResizedSVGProperties([t,i,e,s]){const[n,r]=this.#qo(),o=this.#kr,[h,a,c,l]=o;if(o[0]=t,o[1]=i,o[2]=e,o[3]=s,Math.abs(c-n)<=xs.PRECISION||Math.abs(l-r)<=xs.PRECISION){const n=t+e/2-(h+c/2),r=i+s/2-(a+l/2);for(const{line:t,points:i}of this.#jo)xs._translate(t,n,r,t),xs._translate(i,n,r,i);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${xs.svgRound(t)} ${xs.svgRound(i)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const u=(e-2*n)/(c-2*n),d=(s-2*r)/(l-2*r),f=-u*(h+n)+t+n,p=-d*(a+r)+i+r;if(1!==u||1!==d||0!==f||0!==p)for(const{line:t,points:i}of this.#jo)xs._rescale(t,f,p,u,d,t),xs._rescale(i,f,p,u,d,i);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${xs.svgRound(t)} ${xs.svgRound(i)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([t,i],e){const[s,n]=e,r=this.#kr,o=t-r[0],h=i-r[1];if(this.#Ho===s&&this.#Go===n)for(const{line:t,points:i}of this.#jo)xs._translate(t,o,h,t),xs._translate(i,o,h,i);else{const t=this.#Ho/s,i=this.#Go/n;this.#Ho=s,this.#Go=n;for(const{line:e,points:s}of this.#jo)xs._rescale(e,o,h,t,i,e),xs._rescale(s,o,h,t,i,s);r[2]*=t,r[3]*=i}return r[0]=t,r[1]=i,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${xs.svgRound(t)} ${xs.svgRound(i)}`}}}get defaultSVGProperties(){const t=this.#kr;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${xs.svgRound(t[0])} ${xs.svgRound(t[1])}`,transform:this.rotationTransform||null},bbox:t}}}class Fs extends Rs{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:Ut._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,i){"stroke-width"===t&&(i??=this["stroke-width"],i*=this._viewParameters.realScale),super.updateSVGProperty(t,i)}clone(){const t=new Fs(this._viewParameters);return t.updateAll(this),t}}class Os extends Ns{static _type="ink";static _editorType=S.INK;static _defaultDrawingOptions=null;constructor(t){super({...t,name:"inkEditor"}),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,i){Ut.initialize(t,i),this._defaultDrawingOptions=new Fs(i.viewParameters)}static getDefaultDrawingOptions(t){const i=this._defaultDrawingOptions.clone();return i.updateProperties(t),i}static get supportMultipleDrawings(){return!0}static get typesMap(){return H(this,"typesMap",new Map([[_.INK_THICKNESS,"stroke-width"],[_.INK_COLOR,"stroke"],[_.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,i,e,s,n){return new Ds(t,i,e,s,n,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,i,e,s,n,r){return Is.deserialize(t,i,e,s,n,r)}static async deserialize(t,i,e){let s=null;if(t instanceof ds){const{data:{inkLists:i,rect:e,rotation:n,id:r,color:o,opacity:h,borderStyle:{rawWidth:a},popupRef:c},parent:{page:{pageNumber:l}}}=t;s=t={annotationType:S.INK,color:Array.from(o),thickness:a,opacity:h,paths:{points:i},boxes:null,pageIndex:l-1,rect:e.slice(0),rotation:n,id:r,deleted:!1,popupRef:c}}const n=await super.deserialize(t,i,e);return n.annotationElementId=t.id||null,n._initialData=s,n}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:t,_drawingOptions:i,parent:e}=this;i.updateSVGProperty("stroke-width"),e.drawLayer.updateProperties(t,i.toSVGProperties())}static onScaleChangingWhenDrawing(){const t=this._currentParent;t&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),t.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:i,opacity:e}){this._drawingOptions=Os.getDefaultDrawingOptions({stroke:it.makeHexColor(...t),"stroke-width":i,"stroke-opacity":e})}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:i,points:e,rect:s}=this.serializeDraw(t),{_drawingOptions:{stroke:n,"stroke-opacity":r,"stroke-width":o}}=this,h={annotationType:S.INK,color:Ut._colorManager.convert(n),opacity:r,thickness:o,paths:{lines:i,points:e},pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?(h.isCopy=!0,h):this.annotationElementId&&!this.#tr(h)?null:(h.id=this.annotationElementId,h)}#tr(t){const{color:i,thickness:e,opacity:s,pageIndex:n}=this._initialData;return this._hasBeenMoved||this._hasBeenResized||t.color.some(((t,e)=>t!==i[e]))||t.thickness!==e||t.opacity!==s||t.pageIndex!==n}renderAnnotationElement(t){const{points:i,rect:e}=this.serializeDraw(!1);return t.updateEdited({rect:e,thickness:this._drawingOptions["stroke-width"],points:i}),null}}class $s extends Is{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}}class Ls{static#Ko={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#Jo(t,i,e,s){return s-=i,0==(e-=t)?s>0?0:4:1===e?s+6:2-s}static#Zo=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#th(t,i,e,s,n,r,o){const h=this.#Jo(e,s,n,r);for(let n=0;n<8;n++){const r=(-n+h-o+16)%8;if(0!==t[(e+this.#Zo[2*r])*i+(s+this.#Zo[2*r+1])])return r}return-1}static#ih(t,i,e,s,n,r,o){const h=this.#Jo(e,s,n,r);for(let n=0;n<8;n++){const r=(n+h+o+16)%8;if(0!==t[(e+this.#Zo[2*r])*i+(s+this.#Zo[2*r+1])])return r}return-1}static#eh(t,i,e,s){const n=t.length,r=new Int32Array(n);for(let i=0;i<n;i++)r[i]=t[i]<=s?1:0;for(let t=1;t<e-1;t++)r[t*i]=r[t*i+i-1]=0;for(let t=0;t<i;t++)r[t]=r[i*e-1-t]=0;let o,h=1;const a=[];for(let t=1;t<e-1;t++){o=1;for(let e=1;e<i-1;e++){const s=t*i+e,n=r[s];if(0===n)continue;let c=t,l=e;if(1===n&&0===r[s-1])h+=1,l-=1;else{if(!(n>=1&&0===r[s+1])){1!==n&&(o=Math.abs(n));continue}h+=1,l+=1,n>1&&(o=n)}const u=[e,t],d=l===e+1,f={isHole:d,points:u,id:h,parent:0};let p;a.push(f);for(const t of a)if(t.id===o){p=t;break}f.parent=p?p.isHole?d?p.parent:o:d?o:p.parent:d?o:0;const g=this.#th(r,i,t,e,c,l,0);if(-1===g){r[s]=-h,1!==r[s]&&(o=Math.abs(r[s]));continue}let w=this.#Zo[2*g],m=this.#Zo[2*g+1];const A=t+w,b=e+m;c=A,l=b;let v=t,y=e;for(;;){const n=this.#ih(r,i,v,y,c,l,1);w=this.#Zo[2*n],m=this.#Zo[2*n+1];const a=v+w,d=y+m;u.push(d,a);const f=v*i+y;if(0===r[f+1]?r[f]=-h:1===r[f]&&(r[f]=h),a===t&&d===e&&v===A&&y===b){1!==r[s]&&(o=Math.abs(r[s]));break}c=v,l=y,v=a,y=d}}}return a}static#sh(t,i,e,s){if(e-i<=4){for(let n=i;n<e-2;n+=2)s.push(t[n],t[n+1]);return}const n=t[i],r=t[i+1],o=t[e-4]-n,h=t[e-3]-r,a=Math.hypot(o,h),c=o/a,l=h/a,u=c*r-l*n,d=1/a,f=Math.atan(h/o),p=Math.cos(f),g=Math.sin(f),w=d*(Math.abs(p)+Math.abs(g)),m=d*(1-w+w**2),A=Math.max(Math.atan(Math.abs(g+p)*m),Math.atan(Math.abs(g-p)*m));let b=0,v=i;for(let s=i+2;s<e-2;s+=2){const i=Math.abs(u-c*t[s+1]+l*t[s]);i>b&&(v=s,b=i)}b>(a*A)**2?(this.#sh(t,i,v+2,s),this.#sh(t,v,e,s)):s.push(n,r)}static#nh(t){const i=[],e=t.length;return this.#sh(t,0,e,i),i.push(t[e-2],t[e-1]),i.length<=4?null:i}static#rh(t,i,e,s,n,r){const o=new Float32Array(r**2),h=-2*s**2,a=r>>1;for(let t=0;t<r;t++){const i=(t-a)**2;for(let e=0;e<r;e++)o[t*r+e]=Math.exp((i+(e-a)**2)/h)}const c=new Float32Array(256),l=-2*n**2;for(let t=0;t<256;t++)c[t]=Math.exp(t**2/l);const u=new Uint8Array(t.length),d=new Uint32Array(256);for(let s=0;s<e;s++)for(let n=0;n<i;n++){const h=s*i+n,l=t[h];let f=0,p=0;for(let h=0;h<r;h++){const u=s+h-a;if(!(u<0||u>=e))for(let e=0;e<r;e++){const s=n+e-a;if(s<0||s>=i)continue;const d=t[u*i+s],g=o[h*r+e]*c[Math.abs(d-l)];f+=d*g,p+=g}}d[u[h]=Math.round(f/p)]++}return[u,d]}static#oh(t){const i=new Uint32Array(256);for(const e of t)i[e]++;return i}static#hh(t){const i=t.length,e=new Uint8ClampedArray(i>>2);let s=-1/0,n=1/0;for(let i=0,r=e.length;i<r;i++){if(0===t[3+(i<<2)]){s=e[i]=255;continue}const r=e[i]=t[i<<2];r>s&&(s=r),r<n&&(n=r)}const r=255/(s-n);for(let t=0;t<i;t++)e[t]=(e[t]-n)*r;return e}static#ah(t){let i,e=-1/0,s=-1/0;const n=t.findIndex((t=>0!==t));let r=n,o=n;for(i=n;i<256;i++){const n=t[i];n>e&&(i-r>s&&(s=i-r,o=i-1),e=n,r=i)}for(i=o-1;i>=0&&!(t[i]>t[i+1]);i--);return i}static#ch(t){const i=t,{width:e,height:s}=t,{maxDim:n}=this.#Ko;let r=e,o=s;if(e>n||s>n){let h=e,a=s,c=Math.log2(Math.max(e,s)/n);const l=Math.floor(c);c=c===l?l-1:l;for(let e=0;e<c;e++){r=Math.ceil(h/2),o=Math.ceil(a/2);const e=new OffscreenCanvas(r,o);e.getContext("2d").drawImage(t,0,0,h,a,0,0,r,o),h=r,a=o,t!==i&&t.close(),t=e.transferToImageBitmap()}const u=Math.min(n/r,n/o);r=Math.round(r*u),o=Math.round(o*u)}const h=new OffscreenCanvas(r,o).getContext("2d",{willReadFrequently:!0});h.filter="grayscale(1)",h.drawImage(t,0,0,t.width,t.height,0,0,r,o);const a=h.getImageData(0,0,r,o).data;return[this.#hh(a),r,o]}static extractContoursFromText(t,{fontFamily:i,fontStyle:e,fontWeight:s},n,r,o,h){let a=new OffscreenCanvas(1,1),c=a.getContext("2d",{alpha:!1});const l=c.font=`${e} ${s} 200px ${i}`,{actualBoundingBoxLeft:u,actualBoundingBoxRight:d,actualBoundingBoxAscent:f,actualBoundingBoxDescent:p,fontBoundingBoxAscent:g,fontBoundingBoxDescent:w,width:m}=c.measureText(t),A=Math.ceil(1.5*Math.max(Math.abs(u)+Math.abs(d)||0,m)),b=Math.ceil(1.5*Math.max(Math.abs(f)+Math.abs(p)||200,Math.abs(g)+Math.abs(w)||200));a=new OffscreenCanvas(A,b),c=a.getContext("2d",{alpha:!0,willReadFrequently:!0}),c.font=l,c.filter="grayscale(1)",c.fillStyle="white",c.fillRect(0,0,A,b),c.fillStyle="black",c.fillText(t,.5*A/2,1.5*b/2);const v=this.#hh(c.getImageData(0,0,A,b).data),y=this.#oh(v),x=this.#ah(y),M=this.#eh(v,A,b,x);return this.processDrawnLines({lines:{curves:M,width:A,height:b},pageWidth:n,pageHeight:r,rotation:o,innerMargin:h,mustSmooth:!0,areContours:!0})}static process(t,i,e,s,n){const[r,o,h]=this.#ch(t),[a,c]=this.#rh(r,o,h,Math.hypot(o,h)*this.#Ko.sigmaSFactor,this.#Ko.sigmaR,this.#Ko.kernelSize),l=this.#ah(c),u=this.#eh(a,o,h,l);return this.processDrawnLines({lines:{curves:u,width:o,height:h},pageWidth:i,pageHeight:e,rotation:s,innerMargin:n,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:i,pageHeight:e,rotation:s,innerMargin:n,mustSmooth:r,areContours:o}){s%180!=0&&([i,e]=[e,i]);const{curves:h,width:a,height:c}=t,l=t.thickness??0,u=[],d=Math.min(i/a,e/c),f=d/i,p=d/e,g=[];for(const{points:t}of h){const i=r?this.#nh(t):t;if(!i)continue;g.push(i);const e=i.length,s=new Float32Array(e),n=new Float32Array(3*(2===e?2:e-2));if(u.push({line:n,points:s}),2===e){s[0]=i[0]*f,s[1]=i[1]*p,n.set([NaN,NaN,NaN,NaN,s[0],s[1]],0);continue}let[o,h,a,c]=i;o*=f,h*=p,a*=f,c*=p,s.set([o,h,a,c],0),n.set([NaN,NaN,NaN,NaN,o,h],0);for(let t=4;t<e;t+=2){const e=s[t]=i[t]*f,r=s[t+1]=i[t+1]*p;n.set(xs.createBezierPoints(o,h,a,c,e,r),3*(t-2)),[o,h,a,c]=[a,c,e,r]}}if(0===u.length)return null;const w=o?new $s:new Is;return w.build(u,i,e,1,s,o?0:l,n),{outline:w,newCurves:g,areContours:o,thickness:l,width:a,height:c}}static async compressSignature({outlines:t,areContours:i,thickness:e,width:s,height:n}){let r,o=1/0,h=-1/0,a=0;for(const i of t){a+=i.length;for(let t=2,e=i.length;t<e;t++){const e=i[t]-i[t-2];o=Math.min(o,e),h=Math.max(h,e)}}r=o>=-128&&h<=127?Int8Array:o>=-32768&&h<=32767?Int16Array:Int32Array;const c=t.length,l=8+3*c,u=new Uint32Array(l);let d=0;u[d++]=l*Uint32Array.BYTES_PER_ELEMENT+(a-2*c)*r.BYTES_PER_ELEMENT,u[d++]=0,u[d++]=s,u[d++]=n,u[d++]=i?0:1,u[d++]=Math.max(0,Math.floor(e??0)),u[d++]=c,u[d++]=r.BYTES_PER_ELEMENT;for(const i of t)u[d++]=i.length-2,u[d++]=i[0],u[d++]=i[1];const f=new CompressionStream("deflate-raw"),p=f.writable.getWriter();await p.ready,p.write(u);const g=r.prototype.constructor;for(const i of t){const t=new g(i.length-2);for(let e=2,s=i.length;e<s;e++)t[e-2]=i[e]-i[e-2];p.write(t)}p.close();const w=await new Response(f.readable).arrayBuffer();return at(new Uint8Array(w))}static async decompressSignature(t){try{const e=(i=t,Uint8Array.fromBase64?Uint8Array.fromBase64(i):J(atob(i))),{readable:s,writable:n}=new DecompressionStream("deflate-raw"),r=n.getWriter();await r.ready,r.write(e).then((async()=>{await r.ready,await r.close()})).catch((()=>{}));let o=null,h=0;for await(const t of s)o||=new Uint8Array(new Uint32Array(t.buffer,0,4)[0]),o.set(t,h),h+=t.length;const a=new Uint32Array(o.buffer,0,o.length>>2),c=a[1];if(0!==c)throw new Error(`Invalid version: ${c}`);const l=a[2],u=a[3],d=0===a[4],f=a[5],p=a[6],g=[],w=(8+3*p)*Uint32Array.BYTES_PER_ELEMENT;let m;switch(a[7]){case Int8Array.BYTES_PER_ELEMENT:m=new Int8Array(o.buffer,w);break;case Int16Array.BYTES_PER_ELEMENT:m=new Int16Array(o.buffer,w);break;case Int32Array.BYTES_PER_ELEMENT:m=new Int32Array(o.buffer,w)}h=0;for(let t=0;t<p;t++){const i=a[3*t+8],e=new Float32Array(i+2);g.push(e);for(let i=0;i<2;i++)e[i]=a[3*t+8+i+1];for(let t=0;t<i;t++)e[t+2]=e[t]+m[h++]}return{areContours:d,thickness:f,outlines:g,width:l,height:u}}catch(t){return L(`decompressSignature: ${t}`),null}var i}}class Bs extends Rs{constructor(){super(),super.updateProperties({fill:Ut._defaultLineColor,"stroke-width":0})}clone(){const t=new Bs;return t.updateAll(this),t}}class js extends Fs{constructor(t){super(t),super.updateProperties({stroke:Ut._defaultLineColor,"stroke-width":1})}clone(){const t=new js(this._viewParameters);return t.updateAll(this),t}}class Us extends Ns{#lh=!1;#uh=null;#dh=null;#fh=null;static _type="signature";static _editorType=S.SIGNATURE;static _defaultDrawingOptions=null;constructor(t){super({...t,mustBeCommitted:!0,name:"signatureEditor"}),this._willKeepAspectRatio=!0,this.#dh=t.signatureData||null,this.#uh=null,this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,i){Ut.initialize(t,i),this._defaultDrawingOptions=new Bs,this._defaultDrawnSignatureOptions=new js(i.viewParameters)}static getDefaultDrawingOptions(t){const i=this._defaultDrawingOptions.clone();return i.updateProperties(t),i}static get supportMultipleDrawings(){return!1}static get typesMap(){return H(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!this.#uh}}static computeTelemetryFinalData(t){const i=t.get("hasDescription");return{hasAltText:i.get(!0)??0,hasNoAltText:i.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){null!==this._drawId&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,i;const{_isCopy:e}=this;if(e&&(this._isCopy=!1,t=this.x,i=this.y),super.render(),null===this._drawId)if(this.#dh){const{lines:t,mustSmooth:i,areContours:e,description:s,uuid:n,heightInPage:r}=this.#dh,{rawDims:{pageWidth:o,pageHeight:h},rotation:a}=this.parent.viewport,c=Ls.processDrawnLines({lines:t,pageWidth:o,pageHeight:h,rotation:a,innerMargin:Us._INNER_MARGIN,mustSmooth:i,areContours:e});this.addSignature(c,r,s,n)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);return e&&(this._isCopy=!0,this._moveAfterPaste(t,i)),this.div}setUuid(t){this.#fh=t,this.addEditToolbar()}getUuid(){return this.#fh}get description(){return this.#uh}set description(t){this.#uh=t,super.addEditToolbar().then((i=>{i?.updateEditSignatureButton(t)}))}getSignaturePreview(){const{newCurves:t,areContours:i,thickness:e,width:s,height:n}=this.#dh,r=Math.max(s,n);return{areContours:i,outline:Ls.processDrawnLines({lines:{curves:t.map((t=>({points:t}))),thickness:e,width:s,height:n},pageWidth:r,pageHeight:r,rotation:0,innerMargin:0,mustSmooth:!1,areContours:i}).outline}}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.signatureManager&&null!==this.#uh&&(await t.addEditSignatureButton(this._uiManager.signatureManager,this.#fh,this.#uh),t.show()),t):null}addSignature(t,i,e,s){const{x:n,y:r}=this,{outline:o}=this.#dh=t;let h;this.#lh=o instanceof $s,this.#uh=e,this.div.setAttribute("data-l10n-args",JSON.stringify({description:e})),this.#lh?h=Us.getDefaultDrawingOptions():(h=Us._defaultDrawnSignatureOptions.clone(),h.updateProperties({"stroke-width":o.thickness})),this._addOutlines({drawOutlines:o,drawingOptions:h});const[a,c]=this.parentDimensions,[,l]=this.pageDimensions;let u=i/l;u=u>=1?.5:u,this.width*=u/this.height,this.width>=1&&(u*=.9/this.width,this.width=.9),this.height=u,this.setDims(a*this.width,c*this.height),this.x=n,this.y=r,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(s),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!s,hasDescription:!!e}}),this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:i,pageHeight:e},rotation:s}=this.parent.viewport;return Ls.process(t,i,e,s,Us._INNER_MARGIN)}getFromText(t,i){const{rawDims:{pageWidth:e,pageHeight:s},rotation:n}=this.parent.viewport;return Ls.extractContoursFromText(t,i,e,s,n,Us._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:i,pageHeight:e},rotation:s}=this.parent.viewport;return Ls.processDrawnLines({lines:t,pageWidth:i,pageHeight:e,rotation:s,innerMargin:Us._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:i}){t?this._drawingOptions=Us.getDefaultDrawingOptions():(this._drawingOptions=Us._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":i}))}serialize(t=!1){if(this.isEmpty())return null;const{lines:i,points:e,rect:s}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":n}}=this,r={annotationType:S.SIGNATURE,isSignature:!0,areContours:this.#lh,color:[0,0,0],thickness:this.#lh?0:n,pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?(r.paths={lines:i,points:e},r.uuid=this.#fh,r.isCopy=!0):r.lines=i,this.#uh&&(r.accessibilityData={type:"Figure",alt:this.#uh}),r}static deserializeDraw(t,i,e,s,n,r){return r.areContours?$s.deserialize(t,i,e,s,n,r):Is.deserialize(t,i,e,s,n,r)}static async deserialize(t,i,e){const s=await super.deserialize(t,i,e);return s.#lh=t.areContours,s.#uh=t.accessibilityData?.alt||"",s.#fh=t.uuid,s}}class zs extends Ut{#ph=null;#gh=null;#wh=null;#mh=null;#Ah=null;#bh="";#vh=null;#yh=!1;#xh=null;#Mh=!1;#kh=!1;static _type="stamp";static _editorType=S.STAMP;constructor(t){super({...t,name:"stampEditor"}),this.#mh=t.bitmapUrl,this.#Ah=t.bitmapFile,this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,i){Ut.initialize(t,i)}static isHandlingMimeForPasting(t){return Ct.includes(t)}static paste(t,i){i.pasteEditor({mode:S.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(t){const i=t.get("hasAltText");return{hasAltText:i.get(!0)??0,hasNoAltText:i.get(!1)??0}}#Eh(t,i=!1){t?(this.#ph=t.bitmap,i||(this.#gh=t.id,this.#Mh=t.isSvg),t.file&&(this.#bh=t.file.name),this.#Sh()):this.remove()}#_h(){if(this.#wh=null,this._uiManager.enableWaiting(!1),this.#vh){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#ph)return this._editToolbar.hide(),void this._uiManager.editAltText(this,!0);if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#ph){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(t=null,i=!0){if(this.hasAltTextData())return null;const{mlManager:e}=this._uiManager;if(!e)throw new Error("No ML.");if(!await e.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:s,width:n,height:r}=t||this.copyCanvas(null,null,!0).imageData,o=await e.guess({name:"altText",request:{data:s,width:n,height:r,channels:s.length/(n*r)}});if(!o)throw new Error("No response from the AI service.");if(o.error)throw new Error("Error from the AI service.");if(o.cancel)return null;if(!o.output)throw new Error("No valid response from the AI service.");const h=o.output;return await this.setGuessedAltText(h),i&&!this.hasAltTextData()&&(this.altTextData={alt:h,decorative:!1}),h}#Th(){if(this.#gh)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#gh).then((t=>this.#Eh(t,!0))).finally((()=>this.#_h()));if(this.#mh){const t=this.#mh;return this.#mh=null,this._uiManager.enableWaiting(!0),void(this.#wh=this._uiManager.imageManager.getFromUrl(t).then((t=>this.#Eh(t))).finally((()=>this.#_h())))}if(this.#Ah){const t=this.#Ah;return this.#Ah=null,this._uiManager.enableWaiting(!0),void(this.#wh=this._uiManager.imageManager.getFromFile(t).then((t=>this.#Eh(t))).finally((()=>this.#_h())))}const t=document.createElement("input");t.type="file",t.accept=Ct.join(",");const i=this._uiManager._signal;this.#wh=new Promise((e=>{t.addEventListener("change",(async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const i=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#Eh(i)}else this.remove();e()}),{signal:i}),t.addEventListener("cancel",(()=>{this.remove(),e()}),{signal:i})})).finally((()=>this.#_h())),t.click()}remove(){this.#gh&&(this.#ph=null,this._uiManager.imageManager.deleteId(this.#gh),this.#vh?.remove(),this.#vh=null,this.#xh&&(clearTimeout(this.#xh),this.#xh=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#gh&&null===this.#vh&&this.#Th(),this.isAttachedToDOM||this.parent.add(this))):this.#gh&&this.#Th()}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(this.#wh||this.#ph||this.#mh||this.#Ah||this.#gh||this.#yh)}get isResizable(){return!0}render(){if(this.div)return this.div;let t,i;return this._isCopy&&(t=this.x,i=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),this.#yh||(this.#ph?this.#Sh():this.#Th()),this._isCopy&&this._moveAfterPaste(t,i),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,i){const{id:e,bitmap:s}=this._uiManager.imageManager.getFromCanvas(t,i);i.remove(),e&&this._uiManager.imageManager.isValidId(e)&&(this.#gh=e,s&&(this.#ph=s),this.#yh=!1,this.#Sh())}_onResized(){this.onScaleChanging()}onScaleChanging(){this.parent&&(null!==this.#xh&&clearTimeout(this.#xh),this.#xh=setTimeout((()=>{this.#xh=null,this.#Ch()}),200))}#Sh(){const{div:t}=this;let{width:i,height:e}=this.#ph;const[s,n]=this.pageDimensions,r=.75;if(this.width)i=this.width*s,e=this.height*n;else if(i>r*s||e>r*n){const t=Math.min(r*s/i,r*n/e);i*=t,e*=t}const[o,h]=this.parentDimensions;this.setDims(i*o/s,e*h/n),this._uiManager.enableWaiting(!1);const a=this.#vh=document.createElement("canvas");a.setAttribute("role","img"),this.addContainer(a),this.width=i/s,this.height=e/n,this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(t.hidden=!1),this.#Ch(),this.#kh||(this.parent.addUndoableEditor(this),this.#kh=!0),this._reportTelemetry({action:"inserted_image"}),this.#bh&&this.div.setAttribute("aria-description",this.#bh)}copyCanvas(t,i,e=!1){t||(t=224);const{width:s,height:n}=this.#ph,r=new Tt;let o=this.#ph,h=s,a=n,c=null;if(i){if(s>i||n>i){const t=Math.min(i/s,i/n);h=Math.floor(s*t),a=Math.floor(n*t)}c=document.createElement("canvas");const t=c.width=Math.ceil(h*r.sx),e=c.height=Math.ceil(a*r.sy);this.#Mh||(o=this.#Ph(t,e));const l=c.getContext("2d");l.filter=this._uiManager.hcmFilter;let u="white",d="#cfcfd8";"none"!==this._uiManager.hcmFilter?d="black":window.matchMedia?.("(prefers-color-scheme: dark)").matches&&(u="#8f8f9d",d="#42414d");const f=15,p=f*r.sx,g=f*r.sy,w=new OffscreenCanvas(2*p,2*g),m=w.getContext("2d");m.fillStyle=u,m.fillRect(0,0,2*p,2*g),m.fillStyle=d,m.fillRect(0,0,p,g),m.fillRect(p,g,p,g),l.fillStyle=l.createPattern(w,"repeat"),l.fillRect(0,0,t,e),l.drawImage(o,0,0,o.width,o.height,0,0,t,e)}let l=null;if(e){let i,e;if(r.symmetric&&o.width<t&&o.height<t)i=o.width,e=o.height;else if(o=this.#ph,s>t||n>t){const r=Math.min(t/s,t/n);i=Math.floor(s*r),e=Math.floor(n*r),this.#Mh||(o=this.#Ph(i,e))}const h=new OffscreenCanvas(i,e).getContext("2d",{willReadFrequently:!0});h.drawImage(o,0,0,o.width,o.height,0,0,i,e),l={width:i,height:e,data:h.getImageData(0,0,i,e).data}}return{canvas:c,width:h,height:a,imageData:l}}#Ph(t,i){const{width:e,height:s}=this.#ph;let n=e,r=s,o=this.#ph;for(;n>2*t||r>2*i;){const e=n,s=r;n>2*t&&(n=n>=16384?Math.floor(n/2)-1:Math.ceil(n/2)),r>2*i&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2));const h=new OffscreenCanvas(n,r);h.getContext("2d").drawImage(o,0,0,e,s,0,0,n,r),o=h.transferToImageBitmap()}return o}#Ch(){const[t,i]=this.parentDimensions,{width:e,height:s}=this,n=new Tt,r=Math.ceil(e*t*n.sx),o=Math.ceil(s*i*n.sy),h=this.#vh;if(!h||h.width===r&&h.height===o)return;h.width=r,h.height=o;const a=this.#Mh?this.#ph:this.#Ph(r,o),c=h.getContext("2d");c.filter=this._uiManager.hcmFilter,c.drawImage(a,0,0,a.width,a.height,0,0,r,o)}#Rh(t){if(t){if(this.#Mh){const t=this._uiManager.imageManager.getSvgUrl(this.#gh);if(t)return t}const t=document.createElement("canvas");return({width:t.width,height:t.height}=this.#ph),t.getContext("2d").drawImage(this.#ph,0,0),t.toDataURL()}if(this.#Mh){const[t,i]=this.pageDimensions,e=Math.round(this.width*t*lt.PDF_TO_CSS_UNITS),s=Math.round(this.height*i*lt.PDF_TO_CSS_UNITS),n=new OffscreenCanvas(e,s);return n.getContext("2d").drawImage(this.#ph,0,0,this.#ph.width,this.#ph.height,0,0,e,s),n.transferToImageBitmap()}return structuredClone(this.#ph)}static async deserialize(t,i,e){let s=null,n=!1;if(t instanceof ms){const{data:{rect:r,rotation:o,id:h,structParent:a,popupRef:c},container:l,parent:{page:{pageNumber:u}},canvas:d}=t;let f,p;d?(delete t.canvas,({id:f,bitmap:p}=e.imageManager.getFromCanvas(l.id,d)),d.remove()):(n=!0,t._hasNoCanvas=!0);const g=(await i._structTree.getAriaAttributes(`${ot}${h}`))?.get("aria-label")||"";s=t={annotationType:S.STAMP,bitmapId:f,bitmap:p,pageIndex:u-1,rect:r.slice(0),rotation:o,id:h,deleted:!1,accessibilityData:{decorative:!1,altText:g},isSvg:!1,structParent:a,popupRef:c}}const r=await super.deserialize(t,i,e),{rect:o,bitmap:h,bitmapUrl:a,bitmapId:c,isSvg:l,accessibilityData:u}=t;n?(e.addMissingCanvas(t.id,r),r.#yh=!0):c&&e.imageManager.isValidId(c)?(r.#gh=c,h&&(r.#ph=h)):r.#mh=a,r.#Mh=l;const[d,f]=r.pageDimensions;return r.width=(o[2]-o[0])/d,r.height=(o[3]-o[1])/f,r.annotationElementId=t.id||null,u&&(r.altTextData=u),r._initialData=s,r.#kh=!!s,r}serialize(t=!1,i=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const e={annotationType:S.STAMP,bitmapId:this.#gh,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#Mh,structTreeParentId:this._structTreeParentId};if(t)return e.bitmapUrl=this.#Rh(!0),e.accessibilityData=this.serializeAltText(!0),e.isCopy=!0,e;const{decorative:s,altText:n}=this.serializeAltText(!1);if(!s&&n&&(e.accessibilityData={type:"Figure",alt:n}),this.annotationElementId){const t=this.#tr(e);if(t.isSame)return null;t.isSameAltText?delete e.accessibilityData:e.accessibilityData.structParent=this._initialData.structParent??-1}if(e.id=this.annotationElementId,null===i)return e;i.stamps||=new Map;const r=this.#Mh?(e.rect[2]-e.rect[0])*(e.rect[3]-e.rect[1]):null;if(i.stamps.has(this.#gh)){if(this.#Mh){const t=i.stamps.get(this.#gh);r>t.area&&(t.area=r,t.serialized.bitmap.close(),t.serialized.bitmap=this.#Rh(!1))}}else i.stamps.set(this.#gh,{area:r,serialized:e}),e.bitmap=this.#Rh(!1);return e}#tr(t){const{pageIndex:i,accessibilityData:{altText:e}}=this._initialData,s=t.pageIndex===i,n=(t.accessibilityData?.alt||"")===e;return{isSame:!this._hasBeenMoved&&!this._hasBeenResized&&s&&n,isSameAltText:n}}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}}class Hs{#$n;#Nh=!1;#Dh=null;#Ih=null;#Fh=null;#Oh=new Map;#$h=!1;#Lh=!1;#Bh=!1;#jh=null;#Uh=null;#zh=null;#Hh=null;#w;static _initialized=!1;static#z=new Map([ys,Os,zs,Ps,Us].map((t=>[t._editorType,t])));constructor({uiManager:t,pageIndex:i,div:e,structTreeLayer:s,accessibilityManager:n,annotationLayer:r,drawLayer:o,textLayer:h,viewport:a,l10n:c}){const l=[...Hs.#z.values()];if(!Hs._initialized){Hs._initialized=!0;for(const i of l)i.initialize(c,t)}t.registerEditorTypes(l),this.#w=t,this.pageIndex=i,this.div=e,this.#$n=n,this.#Dh=r,this.viewport=a,this.#zh=h,this.drawLayer=o,this._structTree=s,this.#w.addLayer(this)}get isEmpty(){return 0===this.#Oh.size}get isInvisible(){return this.isEmpty&&this.#w.getMode()===S.NONE}updateToolbar(t){this.#w.updateToolbar(t)}updateMode(t=this.#w.getMode()){switch(this.#Gh(),t){case S.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case S.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case S.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:i}=this.div;for(const e of Hs.#z.values())i.toggle(`${e._type}Editing`,t===e._editorType);this.div.hidden=!1}hasTextLayer(t){return t===this.#zh?.div}setEditingState(t){this.#w.setEditingState(t)}addCommands(t){this.#w.addCommands(t)}cleanUndoStack(t){this.#w.cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){this.#Dh?.div.classList.toggle("disabled",!t)}async enable(){this.#Bh=!0,this.div.tabIndex=0,this.togglePointerEvents(!0);const t=new Set;for(const i of this.#Oh.values())i.enableEditing(),i.show(!0),i.annotationElementId&&(this.#w.removeChangedExistingAnnotation(i),t.add(i.annotationElementId));if(!this.#Dh)return void(this.#Bh=!1);const i=this.#Dh.getEditableAnnotations();for(const e of i){if(e.hide(),this.#w.isDeletedAnnotationElement(e.data.id))continue;if(t.has(e.data.id))continue;const i=await this.deserialize(e);i&&(this.addOrRebuild(i),i.enableEditing())}this.#Bh=!1}disable(){this.#Lh=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1);const t=new Map,i=new Map;for(const e of this.#Oh.values())e.disableEditing(),e.annotationElementId&&(null===e.serialize()?(i.set(e.annotationElementId,e),this.getEditableAnnotation(e.annotationElementId)?.show(),e.remove()):t.set(e.annotationElementId,e));if(this.#Dh){const e=this.#Dh.getEditableAnnotations();for(const s of e){const{id:e}=s.data;if(this.#w.isDeletedAnnotationElement(e))continue;let n=i.get(e);n?(n.resetAnnotationElement(s),n.show(!1),s.show()):(n=t.get(e),n&&(this.#w.addChangedExistingAnnotation(n),n.renderAnnotationElement(s)&&n.show(!1)),s.show())}}this.#Gh(),this.isEmpty&&(this.div.hidden=!0);const{classList:e}=this.div;for(const t of Hs.#z.values())e.remove(`${t._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#Lh=!1}getEditableAnnotation(t){return this.#Dh?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#w.getActive()!==t&&this.#w.setActiveEditor(t)}enableTextSelection(){if(this.div.tabIndex=-1,this.#zh?.div&&!this.#Hh){this.#Hh=new AbortController;const t=this.#w.combinedSignal(this.#Hh);this.#zh.div.addEventListener("pointerdown",this.#Wh.bind(this),{signal:t}),this.#zh.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#zh?.div&&this.#Hh&&(this.#Hh.abort(),this.#Hh=null,this.#zh.div.classList.remove("highlighting"))}#Wh(t){this.#w.unselectAll();const{target:i}=t;if(i===this.#zh.div||("img"===i.getAttribute("role")||i.classList.contains("endOfContent"))&&this.#zh.div.contains(i)){const{isMac:i}=Z.platform;if(0!==t.button||t.ctrlKey&&i)return;this.#w.showAllEditors("highlight",!0,!0),this.#zh.div.classList.add("free"),this.toggleDrawing(),Ps.startHighlighting(this,"ltr"===this.#w.direction,{target:this.#zh.div,x:t.x,y:t.y}),this.#zh.div.addEventListener("pointerup",(()=>{this.#zh.div.classList.remove("free"),this.toggleDrawing(!0)}),{once:!0,signal:this.#w._signal}),t.preventDefault()}}enableClick(){if(this.#Ih)return;this.#Ih=new AbortController;const t=this.#w.combinedSignal(this.#Ih);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const i=this.pointerup.bind(this);this.div.addEventListener("pointerup",i,{signal:t}),this.div.addEventListener("pointercancel",i,{signal:t})}disableClick(){this.#Ih?.abort(),this.#Ih=null}attach(t){this.#Oh.set(t.id,t);const{annotationElementId:i}=t;i&&this.#w.isDeletedAnnotationElement(i)&&this.#w.removeDeletedAnnotationElement(t)}detach(t){this.#Oh.delete(t.id),this.#$n?.removePointerInTextLayer(t.contentDiv),!this.#Lh&&t.annotationElementId&&this.#w.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#w.removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(this.#w.addDeletedAnnotationElement(t.annotationElementId),Ut.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(t.parent!==this||!t.isAttachedToDOM){if(this.changeParent(t),this.#w.addEditor(t),this.attach(t),!t.isAttachedToDOM){const i=t.render();this.div.append(i),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!this.#Bh),this.#w.addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:i}=document;t.div.contains(i)&&!this.#Fh&&(t._focusEventsAllowed=!1,this.#Fh=setTimeout((()=>{this.#Fh=null,t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:this.#w._signal}),i.focus())}),0)),t._structTreeParentId=this.#$n?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||=this,t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return this.#w.getId()}get#Vh(){return Hs.#z.get(this.#w.getMode())}combinedSignal(t){return this.#w.combinedSignal(t)}#Xh(t){const i=this.#Vh;return i?new i.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#Vh?.canCreateNewEmptyEditor()}async pasteEditor(t,i){this.updateToolbar(t),await this.#w.updateMode(t.mode);const{offsetX:e,offsetY:s}=this.#Yh(),n=this.getNextId(),r=this.#Xh({parent:this,id:n,x:e,y:s,uiManager:this.#w,isCentered:!0,...i});r&&this.add(r)}async deserialize(t){return await(Hs.#z.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#w))||null}createAndAddNewEditor(t,i,e={}){const s=this.getNextId(),n=this.#Xh({parent:this,id:s,x:t.offsetX,y:t.offsetY,uiManager:this.#w,isCentered:i,...e});return n&&this.add(n),n}#Yh(){const{x:t,y:i,width:e,height:s}=this.div.getBoundingClientRect(),n=Math.max(0,t),r=Math.max(0,i),o=(n+Math.min(window.innerWidth,t+e))/2-t,h=(r+Math.min(window.innerHeight,i+s))/2-i,[a,c]=this.viewport.rotation%180==0?[o,h]:[h,o];return{offsetX:a,offsetY:c}}addNewEditor(t={}){this.createAndAddNewEditor(this.#Yh(),!0,t)}setSelected(t){this.#w.setSelected(t)}toggleSelected(t){this.#w.toggleSelected(t)}unselect(t){this.#w.unselect(t)}pointerup(t){const{isMac:i}=Z.platform;if(0!==t.button||t.ctrlKey&&i)return;if(t.target!==this.div)return;if(!this.#$h)return;if(this.#$h=!1,this.#Vh?.isDrawer&&this.#Vh.supportMultipleDrawings)return;if(!this.#Nh)return void(this.#Nh=!0);const e=this.#w.getMode();e!==S.STAMP&&e!==S.SIGNATURE?this.createAndAddNewEditor(t,!1):this.#w.unselectAll()}pointerdown(t){if(this.#w.getMode()===S.HIGHLIGHT&&this.enableTextSelection(),this.#$h)return void(this.#$h=!1);const{isMac:i}=Z.platform;if(0!==t.button||t.ctrlKey&&i)return;if(t.target!==this.div)return;if(this.#$h=!0,this.#Vh?.isDrawer)return void this.startDrawingSession(t);const e=this.#w.getActive();this.#Nh=!e||e.isEmpty()}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),this.#jh)return void this.#Vh.startDrawing(this,this.#w,!1,t);this.#w.setCurrentDrawingSession(this),this.#jh=new AbortController;const i=this.#w.combinedSignal(this.#jh);this.div.addEventListener("blur",(({relatedTarget:t})=>{t&&!this.div.contains(t)&&(this.#Uh=null,this.commitOrRemove())}),{signal:i}),this.#Vh.startDrawing(this,this.#w,!1,t)}pause(t){if(t){const{activeElement:t}=document;this.div.contains(t)&&(this.#Uh=t)}else this.#Uh&&setTimeout((()=>{this.#Uh?.focus(),this.#Uh=null}),0)}endDrawingSession(t=!1){return this.#jh?(this.#w.setCurrentDrawingSession(null),this.#jh.abort(),this.#jh=null,this.#Uh=null,this.#Vh.endDrawing(t)):null}findNewParent(t,i,e){const s=this.#w.findParent(i,e);return null!==s&&s!==this&&(s.changeParent(t),!0)}commitOrRemove(){return!!this.#jh&&(this.endDrawingSession(),!0)}onScaleChanging(){this.#jh&&this.#Vh.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#w.getActive()?.parent===this&&(this.#w.commitOrRemove(),this.#w.setActiveEditor(null)),this.#Fh&&(clearTimeout(this.#Fh),this.#Fh=null);for(const t of this.#Oh.values())this.#$n?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#Oh.clear(),this.#w.removeLayer(this)}#Gh(){for(const t of this.#Oh.values())t.isEmpty()&&t.remove()}render({viewport:t}){this.viewport=t,_t(this.div,t);for(const t of this.#w.getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:t}){this.#w.commitOrRemove(),this.#Gh();const i=this.viewport.rotation,e=t.rotation;if(this.viewport=t,_t(this.div,{rotation:e}),i!==e)for(const t of this.#Oh.values())t.rotate(e)}get pageDimensions(){const{pageWidth:t,pageHeight:i}=this.viewport.rawDims;return[t,i]}get scale(){return this.#w.viewParameters.realScale}}class Gs{#gn=null;#Qh=new Map;#qh=new Map;static#v=0;constructor({pageIndex:t}){this.pageIndex=t}setParent(t){if(this.#gn){if(this.#gn!==t){if(this.#Qh.size>0)for(const i of this.#Qh.values())i.remove(),t.append(i);this.#gn=t}}else this.#gn=t}static get _svgFactory(){return H(this,"_svgFactory",new ze)}static#Kh(t,[i,e,s,n]){const{style:r}=t;r.top=100*e+"%",r.left=100*i+"%",r.width=100*s+"%",r.height=100*n+"%"}#Jh(){const t=Gs._svgFactory.create(1,1,!0);return this.#gn.append(t),t.setAttribute("aria-hidden",!0),t}#Zh(t,i){const e=Gs._svgFactory.createElement("clipPath");t.append(e);const s=`clip_${i}`;e.setAttribute("id",s),e.setAttribute("clipPathUnits","objectBoundingBox");const n=Gs._svgFactory.createElement("use");return e.append(n),n.setAttribute("href",`#${i}`),n.classList.add("clip"),s}#ta(t,i){for(const[e,s]of Object.entries(i))null===s?t.removeAttribute(e):t.setAttribute(e,s)}draw(t,i=!1,e=!1){const s=Gs.#v++,n=this.#Jh(),r=Gs._svgFactory.createElement("defs");n.append(r);const o=Gs._svgFactory.createElement("path");r.append(o);const h=`path_p${this.pageIndex}_${s}`;o.setAttribute("id",h),o.setAttribute("vector-effect","non-scaling-stroke"),i&&this.#qh.set(s,o);const a=e?this.#Zh(r,h):null,c=Gs._svgFactory.createElement("use");return n.append(c),c.setAttribute("href",`#${h}`),this.updateProperties(n,t),this.#Qh.set(s,n),{id:s,clipPathId:`url(#${a})`}}drawOutline(t,i){const e=Gs.#v++,s=this.#Jh(),n=Gs._svgFactory.createElement("defs");s.append(n);const r=Gs._svgFactory.createElement("path");n.append(r);const o=`path_p${this.pageIndex}_${e}`;let h;if(r.setAttribute("id",o),r.setAttribute("vector-effect","non-scaling-stroke"),i){const t=Gs._svgFactory.createElement("mask");n.append(t),h=`mask_p${this.pageIndex}_${e}`,t.setAttribute("id",h),t.setAttribute("maskUnits","objectBoundingBox");const i=Gs._svgFactory.createElement("rect");t.append(i),i.setAttribute("width","1"),i.setAttribute("height","1"),i.setAttribute("fill","white");const s=Gs._svgFactory.createElement("use");t.append(s),s.setAttribute("href",`#${o}`),s.setAttribute("stroke","none"),s.setAttribute("fill","black"),s.setAttribute("fill-rule","nonzero"),s.classList.add("mask")}const a=Gs._svgFactory.createElement("use");s.append(a),a.setAttribute("href",`#${o}`),h&&a.setAttribute("mask",`url(#${h})`);const c=a.cloneNode();return s.append(c),a.classList.add("mainOutline"),c.classList.add("secondaryOutline"),this.updateProperties(s,t),this.#Qh.set(e,s),e}finalizeDraw(t,i){this.#qh.delete(t),this.updateProperties(t,i)}updateProperties(t,i){if(!i)return;const{root:e,bbox:s,rootClass:n,path:r}=i,o="number"==typeof t?this.#Qh.get(t):t;if(o){if(e&&this.#ta(o,e),s&&Gs.#Kh(o,s),n){const{classList:t}=o;for(const[i,e]of Object.entries(n))t.toggle(i,e)}r&&this.#ta(o.firstChild.firstChild,r)}}updateParent(t,i){if(i===this)return;const e=this.#Qh.get(t);e&&(i.#gn.append(e),this.#Qh.delete(t),i.#Qh.set(t,e))}remove(t){this.#qh.delete(t),null!==this.#gn&&(this.#Qh.get(t).remove(),this.#Qh.delete(t))}destroy(){this.#gn=null;for(const t of this.#Qh.values())t.remove();this.#Qh.clear(),this.#qh.clear()}}globalThis._pdfjsTestingUtils={HighlightOutliner:Es},globalThis.pdfjsLib={AbortException:q,AnnotationEditorLayer:Hs,AnnotationEditorParamsType:_,AnnotationEditorType:S,AnnotationEditorUIManager:Lt,AnnotationLayer:bs,AnnotationMode:E,AnnotationType:P,build:$e,ColorPicker:Cs,createValidAbsoluteUrl:U,DOMSVGFactory:ze,DrawLayer:Gs,FeatureTest:Z,fetchData:ut,getDocument:_e,getFilenameFromUrl:wt,getPdfFilenameFromUrl:mt,getUuid:rt,getXfaPageViewport:Mt,GlobalWorkerOptions:qi,ImageKind:C,InvalidPDFException:X,isDataScheme:pt,isPdfFile:gt,isValidExplicitDest:ti,MathClamp:ht,noContextMenu:vt,normalizeUnicode:nt,OPS:N,OutputScale:Tt,PasswordResponses:D,PDFDataRangeTransport:Ce,PDFDateString:xt,PDFWorker:Ne,PermissionFlag:T,PixelsPerInch:lt,RenderingCancelledException:ft,ResponseException:Y,setLayerDimensions:_t,shadow:H,SignatureExtractor:Ls,stopEvent:yt,SupportedImageMimeTypes:Ct,TextLayer:Ee,TouchManager:jt,updateUrlHash:z,Util:it,VerbosityLevel:R,version:Oe,XfaLayer:He},window.pdf=Object.freeze({__proto__:null,AbortException:q,AnnotationEditorLayer:Hs,AnnotationEditorParamsType:_,AnnotationEditorType:S,AnnotationEditorUIManager:Lt,AnnotationLayer:bs,AnnotationMode:E,AnnotationType:P,ColorPicker:Cs,DOMSVGFactory:ze,DrawLayer:Gs,FeatureTest:Z,GlobalWorkerOptions:qi,ImageKind:C,InvalidPDFException:X,MathClamp:ht,OPS:N,OutputScale:Tt,PDFDataRangeTransport:Ce,PDFDateString:xt,PDFWorker:Ne,PasswordResponses:D,PermissionFlag:T,PixelsPerInch:lt,RenderingCancelledException:ft,ResponseException:Y,SignatureExtractor:Ls,SupportedImageMimeTypes:Ct,TextLayer:Ee,TouchManager:jt,Util:it,VerbosityLevel:R,XfaLayer:He,build:$e,createValidAbsoluteUrl:U,fetchData:ut,getDocument:_e,getFilenameFromUrl:wt,getPdfFilenameFromUrl:mt,getUuid:rt,getXfaPageViewport:Mt,isDataScheme:pt,isPdfFile:gt,isValidExplicitDest:ti,noContextMenu:vt,normalizeUnicode:nt,setLayerDimensions:_t,shadow:H,stopEvent:yt,updateUrlHash:z,version:Oe});const Ws=class{constructor(e){t(this,e),this.activate=i(this,"activate",7),this.visiblePagesChange=i(this,"visiblePagesChange",7),this.errorMessage="File could not be loaded.",this.viewMode="single",this.workerSrc="/pdfjs/pdf.worker.min.mjs",this.zoom=1,this.currentPage=null,this.loading=!0,this.renderedPages=[],this.singlePageModePage=1,this.visiblePages=[],this.pages=[],this.renderingPageNumbers=[],this.recentScrollPosition={x:0,y:0},this.storeRecentScrollPosition=()=>{this.recentScrollPosition={x:Math.round(this.scrollContainer?.scrollLeft/this.scrollContainer?.scrollWidth*100)/100,y:Math.round(this.scrollContainer?.scrollTop/this.scrollContainer?.scrollHeight*100)/100}},this.onScroll=h((()=>{this.updateVisiblePages(),this.storeRecentScrollPosition()}),60)}componentWillLoad(){window.pdf.GlobalWorkerOptions.workerSrc=this.workerSrc}async componentDidLoad(){await this.getPages(),await this.updateVisiblePages(),this.activate.emit(this.el)}componentDidRender(){this.updateVisiblePages()}disconnectedCallback(){this.doc?.destroy()}async onWindowResize(){this.visiblePages=[],this.renderedPages=[],await this.updateVisiblePages()}async watchProps(){await this.getPages(),await this.updateVisiblePages()}async watchViewMode(){queueMicrotask((async()=>{this.visiblePages=[],this.renderedPages=[],await this.updateVisiblePages()}))}watchZoom(){queueMicrotask((async()=>{this.restoreScrollPosition(),this.visiblePages=[],this.renderedPages=[],await this.updateVisiblePages()}))}async getThumbnails(){return await Promise.all(this.pages.filter(Boolean).map((t=>{const i=t.getViewport({scale:1}),e=document.createElement("canvas");e.width=i.width,e.height=i.height;const s=Math.min(e.width/i.width,e.height/i.height);return t.render({canvasContext:e.getContext("2d"),viewport:t.getViewport({scale:s})}).promise.then((function(){return e}))})))}async print(){this.loading=!0,await this.updateVisiblePages(!0),await this.openPrintDialog(),this.loading=!1}async nextPage(){await this.setPage(this.singlePageModePage+1),await this.updateVisiblePages()}async previousPage(){await this.setPage(this.singlePageModePage-1),await this.updateVisiblePages()}async setPage(t){this.singlePageModePage=Math.min(Math.max(t,1),this.pages.length-1),await this.updateVisiblePages()}async getPages(){this.error=!1,this.loading=!0;try{Boolean(this.doc)&&this.doc.destroy(),this.doc=await _e({isEvalSupported:!1,url:this.file}).promise;const t=[];for(let i=1;i<=this.doc.numPages;i++)t.push(this.doc.getPage(i));this.pages=await Promise.all(t),this.loading=!1}catch(t){this.error=!0,this.loading=!1}}async renderVisiblePages(t){const i=Array.from(this.el.shadowRoot.querySelectorAll("canvas")),e=[];for(const s of i){const i=s.closest(".file-viewer-pdf__page"),n=this.pages.find((t=>t?.pageNumber===+i?.dataset.pageNumber));Boolean(n)&&!this.renderingPageNumbers.includes(n.pageNumber)&&(this.visiblePages.includes(n.pageNumber)||t?!this.renderedPages.includes(n.pageNumber)||t?(await this.renderPage(n,s,t),e.push(n.pageNumber)):e.push(n.pageNumber):this.destroyPage(n))}this.renderedPages=e}async renderPage(t,i,e){const s=i.closest(".file-viewer-pdf__page"),n=s?.querySelector(".file-viewer-pdf__text-container");this.renderingPageNumbers=[...this.renderingPageNumbers,t.pageNumber];const r=e?this.getPrintScale(t):this.getScale(t),o=window.devicePixelRatio||1,h=1!==o?[o,0,0,o,0,0]:null,a=t.getViewport({scale:r}),c=i.getContext("2d");i.height=Math.floor(a.height*o),i.width=Math.floor(a.width*o);const l={canvasContext:c,transform:h,viewport:a};try{await t.render(l).promise,t.cleanup(),n.innerHTML="",this.renderTextLayer(t,n).catch(),this.renderingPageNumbers=this.renderingPageNumbers.filter((i=>i!==t.pageNumber))}catch(t){}}destroyPage(t){const i=this.el.shadowRoot.querySelector(`[data-page-number="${t.pageNumber}"]`),e=i.querySelector("canvas"),s=i.querySelector(".file-viewer-pdf__text-container");e.width=1,e.height=1,e.getContext("2d").clearRect(0,0,e.width,e.height),s.innerHTML=""}async updateVisiblePages(t){const i=Array.from(this.el.shadowRoot.querySelectorAll(".file-viewer-pdf__page"));let e=[],s=null;if(this.singlePageMode)e=[this.singlePageModePage],s=this.singlePageModePage;else if(t)e=i.map((t=>+t.dataset.pageNumber));else{const t=i.map((t=>({pageNumber:+t.dataset.pageNumber,visibleHeight:a(t,this.scrollContainer)}))).filter((({visibleHeight:t})=>t>0));e=t.map((t=>t.pageNumber)),t.length>0&&(s=t.reduce(((t,i)=>i.visibleHeight>t.visibleHeight?i:t),t[0]).pageNumber)}this.visiblePages.length===e.length&&this.visiblePages.every((t=>e.includes(t)))&&this.currentPage===s||(this.visiblePages=e,this.currentPage=s,await this.renderVisiblePages(t),this.visiblePagesChange.emit(this.visiblePages))}async renderTextLayer(t,i){return new Ee({container:i,textContentSource:await t.getTextContent(),viewport:t.getViewport({scale:this.getScale(t)})}).render()}async openPrintDialog(){const t=Array.from(this.scrollContainer.querySelectorAll("canvas"));let i=`\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="UTF-8">\n <meta http-equiv="X-UA-Compatible" content="IE=edge">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <title>${this.file}</title>\n <style>\n *, *:before, *:after {\n margin: 0;\n padding: 0;\n outline: 0;\n }\n\n @page {\n size: a4 !important;\n margin: 0;\n padding: 0;\n }\n\n html, body {\n width: 210mm;\n height: 297mm;\n }\n\n img {\n display: block;\n max-width: 100%;\n max-height: 100%;\n page-break-after: always;\n }\n </style>\n </head>\n <body>\n `;for(const e of t)i+=`<img src="${e.toDataURL()}">`;i+="\n </body>\n </html>\n ";const e=document.createElement("iframe");this.el.append(e);const s=e.contentWindow;s.document.write(i),s.focus(),await new Promise((t=>setTimeout(t,100))),s.print(),e.remove()}getScale(t){const i=c()?0:32;return"auto"===this.zoom?(this.scrollContainer?.clientWidth-i)/t.view[2]:isNaN(this.zoom)?1:this.zoom}getPrintScale(t){return Math.min(Math.min(2480/t.view[2],3508/t.view[3]),2)}restoreScrollPosition(){this.scrollContainer.scrollTop=this.recentScrollPosition.y*this.scrollContainer?.scrollHeight,this.scrollContainer.scrollLeft=this.recentScrollPosition.x*this.scrollContainer?.scrollWidth}render(){const t=!this.error&&!this.loading&&this.visiblePages.length>0,i=this.loading,n=l("file-viewer-pdf",`file-viewer-pdf--view-mode-${this.viewMode}`);return e(s,{key:"17dae0b8e5bf16769a356414071943dc7f8ebec1",class:n,exportparts:"file-viewer-pdf__pagination"},this.error&&e("swirl-inline-error",{key:"472e62e48d63545fef3bddaefe8cc307139b382b",class:"file-viewer-pdf__error",message:this.errorMessage}),e("div",{key:"ae504112d088bd4990b419e787e48c5737f6d552","aria-describedby":"pagination",class:"file-viewer-pdf__pages",onScroll:this.onScroll,ref:t=>this.scrollContainer=t},this.pages.map((t=>{const i=t.getViewport({scale:this.getScale(t)}),s=i.height,n=i.width,r=this.renderedPages.includes(t.pageNumber);return e("div",{"aria-label":t.pageNumber,class:"file-viewer-pdf__page","data-page-number":t.pageNumber,hidden:!(!this.singlePageMode||t.pageNumber===this.singlePageModePage)||void 0,id:`page-${t.pageNumber}`,key:t.pageNumber,role:"region",style:{width:`${n}px`,height:`${s}px`},tabIndex:0},!r&&e("swirl-spinner",{class:"file-viewer-pdf__page-spinner"}),e("canvas",{class:"file-viewer-pdf__canvas",style:{opacity:r?"1":"0"}}),e("div",{class:"file-viewer-pdf__text-container"}))}))),t&&e("span",{key:"0986d71eab6496cd1b588afa28c8ba5cf2a02967",class:"file-viewer-pdf__pagination",id:"pagination",part:"file-viewer-pdf__pagination"},e("span",{key:"b0bd18dd65703cb4d240ab66883e23b03d282265","aria-current":"page"},this.currentPage)," /"," ",this.doc.numPages),i&&e("div",{key:"cb4c58f7641b05e55132ca315e83b7254d2a1d66",class:"file-viewer-pdf__spinner"},e("swirl-spinner",{key:"3a0dc7d43eebc9169928e07959239471d3c8b5ba"})))}get el(){return n(this)}static get watchers(){return{file:["watchProps"],viewMode:["watchViewMode"],zoom:["watchZoom"]}}};Ws.style=":host{position:relative;display:inline-flex;width:100%;height:100%;pointer-events:auto}:host(.file-viewer-pdf--view-mode-side-by-side) .file-viewer-pdf__pages{display:grid;grid-template-columns:repeat(2, 1fr);grid-row-gap:var(--s-space-8);grid-column-gap:var(--s-space-8);grid-auto-rows:auto}:host(.file-viewer-pdf--view-mode-side-by-side) .file-viewer-pdf__page{margin:0}:host(.file-viewer-pdf--view-mode-side-by-side) .file-viewer-pdf__page:nth-child(odd){justify-self:end}:host(.file-viewer-pdf--view-mode-side-by-side) .file-viewer-pdf__page:nth-child(even){justify-self:start}:host *{box-sizing:border-box}.file-viewer-pdf__pages{overflow:auto;width:100%;height:100%}@media (min-width: 768px){.file-viewer-pdf__pages{padding:var(--s-space-16)}}.file-viewer-pdf__page{position:relative;margin-right:auto;margin-left:auto;border-bottom:var(--s-border-width-default) solid var(--s-border-default);background-color:#fff}@media (min-width: 768px){.file-viewer-pdf__page{border:var(--s-border-width-default) solid var(--s-border-default)}.file-viewer-pdf__page:not(:last-of-type){margin-bottom:var(--s-space-8)}}.file-viewer-pdf__page-spinner{position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}.file-viewer-pdf__canvas{display:flex;width:100%;height:100%;margin-right:auto;margin-left:auto}.file-viewer-pdf__text-container{position:absolute;overflow:hidden;line-height:1;text-align:initial;-webkit-user-select:none;-moz-user-select:none;user-select:none;inset:0;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none}.file-viewer-pdf__text-container>*{position:absolute;color:transparent;white-space:pre;cursor:text;transform-origin:0% 0%}.file-viewer-pdf__text-container>*.markedContent{top:0;height:0}.file-viewer-pdf__text-container>*.highlight{margin:-1px;padding:1px;border-radius:4px;background-color:rgba(180, 0, 170, 1)}.file-viewer-pdf__text-container>*.highlight.appended{position:initial}.file-viewer-pdf__text-container>*.highlight.begin{border-radius:4px 0 0 4px}.file-viewer-pdf__text-container>*.highlight.end{border-radius:0 4px 4px 0}.file-viewer-pdf__text-container>*.highlight.middle{border-radius:0}.file-viewer-pdf__text-container>*.highlight.selected{background-color:rgba(0, 100, 0, 1)}.file-viewer-pdf__text-container>*.endOfContent{position:absolute;z-index:-1;top:100%;right:0;bottom:0;left:0;display:block;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.file-viewer-pdf__text-container>*.endOfContent.active{top:0}.file-viewer-pdf__text-container>br::-moz-selection{background:transparent}.file-viewer-pdf__text-container>br::selection{background:transparent}@media (min-width: 768px){.file-viewer-pdf__text-container{-webkit-user-select:auto;-moz-user-select:auto;user-select:auto}}.file-viewer-pdf__spinner{position:absolute;display:flex;justify-content:center;align-items:center;background-color:rgba(0, 0, 0, 0.2);inset:0}.file-viewer-pdf__error{position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}.file-viewer-pdf__pagination{position:absolute;bottom:var(--s-space-16);left:50%;padding:var(--s-space-4) var(--s-space-12);border-radius:var(--s-border-radius-base);color:var(--s-text-on-image);background-color:rgba(0, 0, 0, 0.6);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base);transform:translateX(-50%);pointer-events:none}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.file-viewer-pdf__pagination{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}";const Vs=class{constructor(e){t(this,e),this.activate=i(this,"activate",7),this.errorMessage="File could not be loaded."}componentWillLoad(){this.updateText()}componentDidLoad(){this.activate.emit(this.el)}async updateText(){this.error=!1,this.loading=!0;try{const t=await fetch(this.file);this.text=await t.text(),this.loading=!1}catch(t){this.loading=!1,this.error=!0}}render(){return e(s,{key:"d0560b0a8cdf4b89b5732bf96547ba1f81184fbd",class:"file-viewer-text",exportparts:"file-viewer-text__text"},this.error&&e("swirl-inline-error",{key:"59433c5245010194a511acddf0eb5355e8066d23",class:"file-viewer-text__error",message:this.errorMessage}),e("pre",{key:"4b14aaeaea49be0187c863d05348b60468e9d3f4",class:"file-viewer-text__text",part:"file-viewer-text__text",tabIndex:0},this.text),this.loading&&e("div",{key:"c1c0be759edbeccbada172b874fe83065f2bbbf8",class:"file-viewer-text__spinner"},e("swirl-spinner",{key:"5f0aaf67871b3fc42516e5628da9732208f3feca"})))}get el(){return n(this)}static get watchers(){return{file:["updateText"]}}};Vs.style=":host{position:relative;display:inline-flex;width:100%;max-height:100%;pointer-events:auto}:host *{box-sizing:border-box}.file-viewer-text__text{overflow:auto;width:100%;max-height:100%;margin:0;padding:0;padding:var(--s-space-16);background-color:var(--s-background-default);font-family:var(--s-font-family-code)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.file-viewer-text__text{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.file-viewer-text__spinner{position:absolute;display:flex;justify-content:center;align-items:center;background-color:rgba(0, 0, 0, 0.2);inset:0}.file-viewer-text__error{position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}";const Xs=class{constructor(e){t(this,e),this.activate=i(this,"activate",7)}componentDidLoad(){this.activate.emit(this.el),this.disableDownload&&this.videoEl.setAttribute("controlsList","nodownload")}watchDisableDownload(){this.disableDownload?this.videoEl.setAttribute("controlsList","nodownload"):this.videoEl.removeAttribute("controlsList")}render(){return e(s,{key:"439df8dd08eabf76634be7f539c4610e465cce4e",class:"file-viewer-video"},e("video",{key:"0cbfbbe055fb7682311bf9f87db6ade51bf2e338",autoplay:this.autoplay,class:"file-viewer-video__video",src:this.file,controls:!0,ref:t=>this.videoEl=t}))}get el(){return n(this)}static get watchers(){return{disableDownload:["watchDisableDownload"]}}};Xs.style=":host{display:inline-flex;width:100%;max-height:100%;pointer-events:auto}:host *{box-sizing:border-box}.file-viewer-video__video{width:100%;background-color:rgba(0, 0, 0, 1)}";export{u as swirl_file_viewer,d as swirl_file_viewer_audio,w as swirl_file_viewer_csv,m as swirl_file_viewer_fallback,A as swirl_file_viewer_image,Ws as swirl_file_viewer_pdf,Vs as swirl_file_viewer_text,Xs as swirl_file_viewer_video}