@hmcts/media-viewer 2.8.1 → 2.9.1

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 (562) hide show
  1. package/README.md +0 -1
  2. package/assets/sass/comment.scss +1 -1
  3. package/assets/sass/outline-attachment.scss +6 -1
  4. package/assets/sass/participants-list.scss +1 -1
  5. package/assets/sass/rectangle.scss +1 -4
  6. package/bundles/hmcts-media-viewer.umd.js +3367 -10784
  7. package/bundles/hmcts-media-viewer.umd.js.map +1 -1
  8. package/bundles/hmcts-media-viewer.umd.min.js +1 -16
  9. package/bundles/hmcts-media-viewer.umd.min.js.map +1 -1
  10. package/esm2015/hmcts-media-viewer.js +20 -24
  11. package/esm2015/lib/annotations/annotation-set/annotation-create/box-highlight-create/box-highlight-create.component.js +9 -103
  12. package/esm2015/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.directive.js +14 -111
  13. package/esm2015/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.service.js +4 -49
  14. package/esm2015/lib/annotations/annotation-set/annotation-set.component.js +2 -51
  15. package/esm2015/lib/annotations/annotation-set/annotation-set.model.js +2 -15
  16. package/esm2015/lib/annotations/annotation-set/annotation-view/annotation-view.component.js +4 -74
  17. package/esm2015/lib/annotations/annotation-set/annotation-view/annotation.model.js +2 -29
  18. package/esm2015/lib/annotations/annotation-set/annotation-view/rectangle/rectangle.component.js +5 -114
  19. package/esm2015/lib/annotations/annotation-set/annotation-view/rectangle/rectangle.model.js +2 -21
  20. package/esm2015/lib/annotations/annotation-set/ctx-toolbar/ctx-toolbar.component.js +8 -85
  21. package/esm2015/lib/annotations/annotation-set/metadata-layer/metadata-layer.component.js +9 -105
  22. package/esm2015/lib/annotations/annotations.module.js +1 -5
  23. package/esm2015/lib/annotations/comment-set/comment/comment.component.js +4 -152
  24. package/esm2015/lib/annotations/comment-set/comment/comment.model.js +2 -27
  25. package/esm2015/lib/annotations/comment-set/comment/comment.service.js +3 -53
  26. package/esm2015/lib/annotations/comment-set/comment/text-highlight/text-highlight.directive.js +1 -37
  27. package/esm2015/lib/annotations/comment-set/comment/textarea-auto-expand/textarea-auto-expand.directive.js +1 -25
  28. package/esm2015/lib/annotations/comment-set/comment-navigate/comments-navigate.component.js +5 -63
  29. package/esm2015/lib/annotations/comment-set/comment-set-header/comment-filter/comment-filter.component.js +10 -76
  30. package/esm2015/lib/annotations/comment-set/comment-set-header/comment-search/comment-search.component.js +5 -53
  31. package/esm2015/lib/annotations/comment-set/comment-set-header/comment-set-header.component.js +6 -63
  32. package/esm2015/lib/annotations/comment-set/comment-set-render.service.js +5 -73
  33. package/esm2015/lib/annotations/comment-set/comment-set.component.js +11 -154
  34. package/esm2015/lib/annotations/comments-summary/comments-summary.component.js +8 -111
  35. package/esm2015/lib/annotations/models/api-persisted.model.js +2 -25
  36. package/esm2015/lib/annotations/models/event-select.model.js +2 -17
  37. package/esm2015/lib/annotations/models/tags.model.js +2 -19
  38. package/esm2015/lib/annotations/models/user.model.js +2 -17
  39. package/esm2015/lib/annotations/pipes/date/date.pipe.js +1 -12
  40. package/esm2015/lib/annotations/pipes/filter/filter.pipe.js +3 -17
  41. package/esm2015/lib/annotations/pipes/unsnake/unsnake.pipe.js +1 -9
  42. package/esm2015/lib/annotations/services/annotation-api/annotation-api.service.js +6 -93
  43. package/esm2015/lib/annotations/services/bookmarks-api/bookmarks-api.service.js +6 -69
  44. package/esm2015/lib/annotations/services/tags/tags.services.js +6 -54
  45. package/esm2015/lib/annotations/tags/tags.component.js +4 -50
  46. package/esm2015/lib/bookmark/components/bookmark-icons.component.js +2 -29
  47. package/esm2015/lib/icp/confirm-exit/confirm-action-dialog.component.js +2 -22
  48. package/esm2015/lib/icp/icp-follower.service.js +4 -63
  49. package/esm2015/lib/icp/icp-presenter.service.js +6 -69
  50. package/esm2015/lib/icp/icp-session-api.service.js +2 -26
  51. package/esm2015/lib/icp/icp-update.service.js +18 -92
  52. package/esm2015/lib/icp/icp.events.js +15 -0
  53. package/esm2015/lib/icp/icp.interfaces.js +2 -51
  54. package/esm2015/lib/icp/icp.service.js +18 -155
  55. package/esm2015/lib/icp/participants-list/participants-list.component.js +3 -43
  56. package/esm2015/lib/icp/socket.service.js +92 -86
  57. package/esm2015/lib/media-viewer.component.js +29 -199
  58. package/esm2015/lib/media-viewer.module.js +3 -7
  59. package/esm2015/lib/print.service.js +2 -18
  60. package/esm2015/lib/redaction/components/redaction.component.js +13 -127
  61. package/esm2015/lib/redaction/services/redaction-api.service.js +6 -75
  62. package/esm2015/lib/redaction/services/redaction.model.js +2 -19
  63. package/esm2015/lib/shared/gov-uk-date/gov-uk-date.component.js +2 -14
  64. package/esm2015/lib/shared/gov-uk-error-message/gov-uk-error-message.component.js +3 -14
  65. package/esm2015/lib/shared/gov-uk-fieldset/gov-uk-fieldset.component.js +2 -17
  66. package/esm2015/lib/shared/gov-uk-label/gov-uk-label.component.js +3 -12
  67. package/esm2015/lib/shared/shared.module.js +1 -5
  68. package/esm2015/lib/shared/util/helpers/html-templates.helper.js +1 -10
  69. package/esm2015/lib/shared/util/services/number.helper.service.js +4 -14
  70. package/esm2015/lib/store/actions/annotation.actions.js +1 -140
  71. package/esm2015/lib/store/actions/bookmark.actions.js +1 -150
  72. package/esm2015/lib/store/actions/document.actions.js +1 -130
  73. package/esm2015/lib/store/actions/icp.actions.js +1 -80
  74. package/esm2015/lib/store/actions/redaction.actions.js +1 -155
  75. package/esm2015/lib/store/actions/tag.actions.js +1 -30
  76. package/esm2015/lib/store/bookmarks-store-utils.js +17 -69
  77. package/esm2015/lib/store/effects/annotation.effects.js +16 -90
  78. package/esm2015/lib/store/effects/bookmarks.effects.js +12 -127
  79. package/esm2015/lib/store/effects/document.effects.js +16 -97
  80. package/esm2015/lib/store/effects/icp.effects.js +5 -63
  81. package/esm2015/lib/store/effects/index.js +1 -6
  82. package/esm2015/lib/store/effects/redaction.effects.js +26 -137
  83. package/esm2015/lib/store/models/bookmarks.interface.js +2 -57
  84. package/esm2015/lib/store/models/filters.interface.js +2 -17
  85. package/esm2015/lib/store/reducers/annotations.reducer.js +14 -129
  86. package/esm2015/lib/store/reducers/bookmarks.reducer.js +12 -99
  87. package/esm2015/lib/store/reducers/document.reducer.js +10 -129
  88. package/esm2015/lib/store/reducers/icp.reducer.js +6 -47
  89. package/esm2015/lib/store/reducers/redaction.reducer.js +7 -73
  90. package/esm2015/lib/store/reducers/reducers.js +7 -31
  91. package/esm2015/lib/store/reducers/tags.reducer.js +12 -102
  92. package/esm2015/lib/store/selectors/annotation.selectors.js +29 -118
  93. package/esm2015/lib/store/selectors/bookmark.selectors.js +12 -51
  94. package/esm2015/lib/store/selectors/document.selectors.js +5 -26
  95. package/esm2015/lib/store/selectors/icp.selectors.js +9 -38
  96. package/esm2015/lib/store/selectors/redaction.selectors.js +10 -45
  97. package/esm2015/lib/store/selectors/tag.selectors.js +6 -28
  98. package/esm2015/lib/store/store-utils.js +26 -156
  99. package/esm2015/lib/toolbar/icp-event.service.js +13 -48
  100. package/esm2015/lib/toolbar/icp-toolbar/icp-toolbar.component.js +4 -56
  101. package/esm2015/lib/toolbar/main-toolbar/main-toolbar.component.js +9 -176
  102. package/esm2015/lib/toolbar/redaction-toolbar/redaction-toolbar.component.js +4 -58
  103. package/esm2015/lib/toolbar/search-bar/search-bar.component.js +11 -85
  104. package/esm2015/lib/toolbar/toolbar-button-visibility.service.js +2 -46
  105. package/esm2015/lib/toolbar/toolbar-event.service.js +2 -173
  106. package/esm2015/lib/toolbar/toolbar.module.js +1 -5
  107. package/esm2015/lib/viewers/convertible-content-viewer/convertible-content-viewer.component.js +5 -75
  108. package/esm2015/lib/viewers/convertible-content-viewer/document-conversion-api.service.js +3 -34
  109. package/esm2015/lib/viewers/grab-n-drag.directive.js +1 -38
  110. package/esm2015/lib/viewers/image-viewer/image-viewer.component.js +29 -196
  111. package/esm2015/lib/viewers/multimedia-player/multimedia-player.component.js +3 -55
  112. package/esm2015/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.js +61 -240
  113. package/esm2015/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.provider.js +2 -40
  114. package/esm2015/lib/viewers/pdf-viewer/pdf-viewer.component.js +34 -302
  115. package/esm2015/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.js +12 -107
  116. package/esm2015/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.interfaces.js +2 -39
  117. package/esm2015/lib/viewers/pdf-viewer/side-bar/outline-item/outline-item.component.js +16 -25
  118. package/esm2015/lib/viewers/pdf-viewer/side-bar/outline-item/outline.model.js +2 -31
  119. package/esm2015/lib/viewers/pdf-viewer/side-bar/side-bar.component.js +16 -73
  120. package/esm2015/lib/viewers/rotation-persist/rotation-api.service.js +2 -35
  121. package/esm2015/lib/viewers/rotation-persist/rotation-persist.directive.js +8 -87
  122. package/esm2015/lib/viewers/rotation-persist/rotation.model.js +2 -15
  123. package/esm2015/lib/viewers/unsupported-viewer/unsupported-viewer.component.js +4 -60
  124. package/esm2015/lib/viewers/viewer-event.service.js +2 -41
  125. package/esm2015/lib/viewers/viewer-exception.model.js +7 -32
  126. package/esm2015/lib/viewers/viewer-util.service.js +2 -20
  127. package/esm2015/public_api.js +28 -32
  128. package/fesm2015/hmcts-media-viewer.js +1540 -8065
  129. package/fesm2015/hmcts-media-viewer.js.map +1 -1
  130. package/hmcts-media-viewer-v2.9.1.tgz +0 -0
  131. package/hmcts-media-viewer.d.ts +19 -18
  132. package/hmcts-media-viewer.d.ts.map +1 -0
  133. package/hmcts-media-viewer.metadata.json +1 -1
  134. package/lib/annotations/annotation-set/annotation-create/box-highlight-create/box-highlight-create.component.d.ts +5 -3
  135. package/lib/annotations/annotation-set/annotation-create/box-highlight-create/box-highlight-create.component.d.ts.map +1 -0
  136. package/lib/annotations/annotation-set/annotation-create/box-highlight-create/box-highlight-create.component.ngfactory.d.ts.map +1 -0
  137. package/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.directive.d.ts +1 -0
  138. package/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.directive.d.ts.map +1 -0
  139. package/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.directive.ngfactory.d.ts.map +1 -0
  140. package/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.service.d.ts +1 -0
  141. package/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.service.d.ts.map +1 -0
  142. package/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.service.ngfactory.d.ts.map +1 -0
  143. package/lib/annotations/annotation-set/annotation-set.component.d.ts +1 -0
  144. package/lib/annotations/annotation-set/annotation-set.component.d.ts.map +1 -0
  145. package/lib/annotations/annotation-set/annotation-set.component.ngfactory.d.ts.map +1 -0
  146. package/lib/annotations/annotation-set/annotation-set.model.d.ts +1 -0
  147. package/lib/annotations/annotation-set/annotation-set.model.d.ts.map +1 -0
  148. package/lib/annotations/annotation-set/annotation-view/annotation-view.component.d.ts +4 -3
  149. package/lib/annotations/annotation-set/annotation-view/annotation-view.component.d.ts.map +1 -0
  150. package/lib/annotations/annotation-set/annotation-view/annotation-view.component.ngfactory.d.ts.map +1 -0
  151. package/lib/annotations/annotation-set/annotation-view/annotation.model.d.ts +1 -0
  152. package/lib/annotations/annotation-set/annotation-view/annotation.model.d.ts.map +1 -0
  153. package/lib/annotations/annotation-set/annotation-view/rectangle/rectangle.component.d.ts +5 -2
  154. package/lib/annotations/annotation-set/annotation-view/rectangle/rectangle.component.d.ts.map +1 -0
  155. package/lib/annotations/annotation-set/annotation-view/rectangle/rectangle.component.ngfactory.d.ts.map +1 -0
  156. package/lib/annotations/annotation-set/annotation-view/rectangle/rectangle.model.d.ts +1 -0
  157. package/lib/annotations/annotation-set/annotation-view/rectangle/rectangle.model.d.ts.map +1 -0
  158. package/lib/annotations/annotation-set/ctx-toolbar/ctx-toolbar.component.d.ts +3 -1
  159. package/lib/annotations/annotation-set/ctx-toolbar/ctx-toolbar.component.d.ts.map +1 -0
  160. package/lib/annotations/annotation-set/ctx-toolbar/ctx-toolbar.component.ngfactory.d.ts.map +1 -0
  161. package/lib/annotations/annotation-set/metadata-layer/metadata-layer.component.d.ts +1 -0
  162. package/lib/annotations/annotation-set/metadata-layer/metadata-layer.component.d.ts.map +1 -0
  163. package/lib/annotations/annotation-set/metadata-layer/metadata-layer.component.ngfactory.d.ts.map +1 -0
  164. package/lib/annotations/annotations.module.d.ts +1 -0
  165. package/lib/annotations/annotations.module.d.ts.map +1 -0
  166. package/lib/annotations/annotations.module.ngfactory.d.ts.map +1 -0
  167. package/lib/annotations/comment-set/comment/comment.component.d.ts +7 -5
  168. package/lib/annotations/comment-set/comment/comment.component.d.ts.map +1 -0
  169. package/lib/annotations/comment-set/comment/comment.component.ngfactory.d.ts.map +1 -0
  170. package/lib/annotations/comment-set/comment/comment.model.d.ts +1 -0
  171. package/lib/annotations/comment-set/comment/comment.model.d.ts.map +1 -0
  172. package/lib/annotations/comment-set/comment/comment.service.d.ts +1 -0
  173. package/lib/annotations/comment-set/comment/comment.service.d.ts.map +1 -0
  174. package/lib/annotations/comment-set/comment/comment.service.ngfactory.d.ts.map +1 -0
  175. package/lib/annotations/comment-set/comment/text-highlight/text-highlight.directive.d.ts +1 -0
  176. package/lib/annotations/comment-set/comment/text-highlight/text-highlight.directive.d.ts.map +1 -0
  177. package/lib/annotations/comment-set/comment/text-highlight/text-highlight.directive.ngfactory.d.ts.map +1 -0
  178. package/lib/annotations/comment-set/comment/textarea-auto-expand/textarea-auto-expand.directive.d.ts +1 -0
  179. package/lib/annotations/comment-set/comment/textarea-auto-expand/textarea-auto-expand.directive.d.ts.map +1 -0
  180. package/lib/annotations/comment-set/comment/textarea-auto-expand/textarea-auto-expand.directive.ngfactory.d.ts.map +1 -0
  181. package/lib/annotations/comment-set/comment-navigate/comments-navigate.component.d.ts +1 -0
  182. package/lib/annotations/comment-set/comment-navigate/comments-navigate.component.d.ts.map +1 -0
  183. package/lib/annotations/comment-set/comment-navigate/comments-navigate.component.ngfactory.d.ts.map +1 -0
  184. package/lib/annotations/comment-set/comment-set-header/comment-filter/comment-filter.component.d.ts +1 -0
  185. package/lib/annotations/comment-set/comment-set-header/comment-filter/comment-filter.component.d.ts.map +1 -0
  186. package/lib/annotations/comment-set/comment-set-header/comment-filter/comment-filter.component.ngfactory.d.ts.map +1 -0
  187. package/lib/annotations/comment-set/comment-set-header/comment-search/comment-search.component.d.ts +1 -0
  188. package/lib/annotations/comment-set/comment-set-header/comment-search/comment-search.component.d.ts.map +1 -0
  189. package/lib/annotations/comment-set/comment-set-header/comment-search/comment-search.component.ngfactory.d.ts.map +1 -0
  190. package/lib/annotations/comment-set/comment-set-header/comment-set-header.component.d.ts +1 -0
  191. package/lib/annotations/comment-set/comment-set-header/comment-set-header.component.d.ts.map +1 -0
  192. package/lib/annotations/comment-set/comment-set-header/comment-set-header.component.ngfactory.d.ts.map +1 -0
  193. package/lib/annotations/comment-set/comment-set-render.service.d.ts +1 -0
  194. package/lib/annotations/comment-set/comment-set-render.service.d.ts.map +1 -0
  195. package/lib/annotations/comment-set/comment-set-render.service.ngfactory.d.ts.map +1 -0
  196. package/lib/annotations/comment-set/comment-set.component.d.ts +1 -0
  197. package/lib/annotations/comment-set/comment-set.component.d.ts.map +1 -0
  198. package/lib/annotations/comment-set/comment-set.component.ngfactory.d.ts.map +1 -0
  199. package/lib/annotations/comments-summary/comments-summary.component.d.ts +1 -1
  200. package/lib/annotations/comments-summary/comments-summary.component.d.ts.map +1 -0
  201. package/lib/annotations/comments-summary/comments-summary.component.ngfactory.d.ts.map +1 -0
  202. package/lib/annotations/models/api-persisted.model.d.ts +1 -0
  203. package/lib/annotations/models/api-persisted.model.d.ts.map +1 -0
  204. package/lib/annotations/models/event-select.model.d.ts +1 -0
  205. package/lib/annotations/models/event-select.model.d.ts.map +1 -0
  206. package/lib/annotations/models/tags.model.d.ts +1 -0
  207. package/lib/annotations/models/tags.model.d.ts.map +1 -0
  208. package/lib/annotations/models/user.model.d.ts +1 -0
  209. package/lib/annotations/models/user.model.d.ts.map +1 -0
  210. package/lib/annotations/pipes/date/date.pipe.d.ts +2 -1
  211. package/lib/annotations/pipes/date/date.pipe.d.ts.map +1 -0
  212. package/lib/annotations/pipes/date/date.pipe.ngfactory.d.ts.map +1 -0
  213. package/lib/annotations/pipes/filter/filter.pipe.d.ts +1 -0
  214. package/lib/annotations/pipes/filter/filter.pipe.d.ts.map +1 -0
  215. package/lib/annotations/pipes/filter/filter.pipe.ngfactory.d.ts.map +1 -0
  216. package/lib/annotations/pipes/unsnake/unsnake.pipe.d.ts +1 -0
  217. package/lib/annotations/pipes/unsnake/unsnake.pipe.d.ts.map +1 -0
  218. package/lib/annotations/pipes/unsnake/unsnake.pipe.ngfactory.d.ts.map +1 -0
  219. package/lib/annotations/services/annotation-api/annotation-api.service.d.ts +3 -2
  220. package/lib/annotations/services/annotation-api/annotation-api.service.d.ts.map +1 -0
  221. package/lib/annotations/services/annotation-api/annotation-api.service.ngfactory.d.ts.map +1 -0
  222. package/lib/annotations/services/bookmarks-api/bookmarks-api.service.d.ts +1 -0
  223. package/lib/annotations/services/bookmarks-api/bookmarks-api.service.d.ts.map +1 -0
  224. package/lib/annotations/services/bookmarks-api/bookmarks-api.service.ngfactory.d.ts.map +1 -0
  225. package/lib/annotations/services/tags/tags.services.d.ts +1 -0
  226. package/lib/annotations/services/tags/tags.services.d.ts.map +1 -0
  227. package/lib/annotations/services/tags/tags.services.ngfactory.d.ts.map +1 -0
  228. package/lib/annotations/tags/tags.component.d.ts +3 -2
  229. package/lib/annotations/tags/tags.component.d.ts.map +1 -0
  230. package/lib/annotations/tags/tags.component.ngfactory.d.ts.map +1 -0
  231. package/lib/bookmark/components/bookmark-icons.component.d.ts +1 -0
  232. package/lib/bookmark/components/bookmark-icons.component.d.ts.map +1 -0
  233. package/lib/bookmark/components/bookmark-icons.component.ngfactory.d.ts.map +1 -0
  234. package/lib/icp/confirm-exit/confirm-action-dialog.component.d.ts +1 -0
  235. package/lib/icp/confirm-exit/confirm-action-dialog.component.d.ts.map +1 -0
  236. package/lib/icp/confirm-exit/confirm-action-dialog.component.ngfactory.d.ts.map +1 -0
  237. package/lib/icp/icp-follower.service.d.ts +1 -0
  238. package/lib/icp/icp-follower.service.d.ts.map +1 -0
  239. package/lib/icp/icp-follower.service.ngfactory.d.ts.map +1 -0
  240. package/lib/icp/icp-presenter.service.d.ts +1 -0
  241. package/lib/icp/icp-presenter.service.d.ts.map +1 -0
  242. package/lib/icp/icp-presenter.service.ngfactory.d.ts.map +1 -0
  243. package/lib/icp/icp-session-api.service.d.ts +1 -0
  244. package/lib/icp/icp-session-api.service.d.ts.map +1 -0
  245. package/lib/icp/icp-session-api.service.ngfactory.d.ts.map +1 -0
  246. package/lib/icp/icp-update.service.d.ts +1 -9
  247. package/lib/icp/icp-update.service.d.ts.map +1 -0
  248. package/lib/icp/icp-update.service.ngfactory.d.ts.map +1 -0
  249. package/lib/icp/icp.events.d.ts +14 -0
  250. package/lib/icp/icp.events.d.ts.map +1 -0
  251. package/lib/icp/icp.interfaces.d.ts +2 -0
  252. package/lib/icp/icp.interfaces.d.ts.map +1 -0
  253. package/lib/icp/icp.service.d.ts +1 -0
  254. package/lib/icp/icp.service.d.ts.map +1 -0
  255. package/lib/icp/icp.service.ngfactory.d.ts.map +1 -0
  256. package/lib/icp/participants-list/participants-list.component.d.ts +1 -0
  257. package/lib/icp/participants-list/participants-list.component.d.ts.map +1 -0
  258. package/lib/icp/participants-list/participants-list.component.ngfactory.d.ts.map +1 -0
  259. package/lib/icp/socket.service.d.ts +14 -4
  260. package/lib/icp/socket.service.d.ts.map +1 -0
  261. package/lib/icp/socket.service.ngfactory.d.ts.map +1 -0
  262. package/lib/media-viewer.component.d.ts +2 -0
  263. package/lib/media-viewer.component.d.ts.map +1 -0
  264. package/lib/media-viewer.component.ngfactory.d.ts.map +1 -0
  265. package/lib/media-viewer.module.d.ts +1 -0
  266. package/lib/media-viewer.module.d.ts.map +1 -0
  267. package/lib/media-viewer.module.ngfactory.d.ts.map +1 -0
  268. package/lib/print.service.d.ts +1 -0
  269. package/lib/print.service.d.ts.map +1 -0
  270. package/lib/print.service.ngfactory.d.ts.map +1 -0
  271. package/lib/redaction/components/redaction.component.d.ts +1 -0
  272. package/lib/redaction/components/redaction.component.d.ts.map +1 -0
  273. package/lib/redaction/components/redaction.component.ngfactory.d.ts.map +1 -0
  274. package/lib/redaction/services/redaction-api.service.d.ts +1 -0
  275. package/lib/redaction/services/redaction-api.service.d.ts.map +1 -0
  276. package/lib/redaction/services/redaction-api.service.ngfactory.d.ts.map +1 -0
  277. package/lib/redaction/services/redaction.model.d.ts +1 -0
  278. package/lib/redaction/services/redaction.model.d.ts.map +1 -0
  279. package/lib/shared/gov-uk-date/gov-uk-date.component.d.ts +1 -0
  280. package/lib/shared/gov-uk-date/gov-uk-date.component.d.ts.map +1 -0
  281. package/lib/shared/gov-uk-date/gov-uk-date.component.ngfactory.d.ts.map +1 -0
  282. package/lib/shared/gov-uk-error-message/gov-uk-error-message.component.d.ts +1 -0
  283. package/lib/shared/gov-uk-error-message/gov-uk-error-message.component.d.ts.map +1 -0
  284. package/lib/shared/gov-uk-error-message/gov-uk-error-message.component.ngfactory.d.ts.map +1 -0
  285. package/lib/shared/gov-uk-fieldset/gov-uk-fieldset.component.d.ts +1 -0
  286. package/lib/shared/gov-uk-fieldset/gov-uk-fieldset.component.d.ts.map +1 -0
  287. package/lib/shared/gov-uk-fieldset/gov-uk-fieldset.component.ngfactory.d.ts.map +1 -0
  288. package/lib/shared/gov-uk-label/gov-uk-label.component.d.ts +1 -0
  289. package/lib/shared/gov-uk-label/gov-uk-label.component.d.ts.map +1 -0
  290. package/lib/shared/gov-uk-label/gov-uk-label.component.ngfactory.d.ts.map +1 -0
  291. package/lib/shared/shared.module.d.ts +1 -0
  292. package/lib/shared/shared.module.d.ts.map +1 -0
  293. package/lib/shared/shared.module.ngfactory.d.ts.map +1 -0
  294. package/lib/shared/util/helpers/html-templates.helper.d.ts +1 -0
  295. package/lib/shared/util/helpers/html-templates.helper.d.ts.map +1 -0
  296. package/lib/shared/util/services/number.helper.service.d.ts +1 -0
  297. package/lib/shared/util/services/number.helper.service.d.ts.map +1 -0
  298. package/lib/shared/util/services/number.helper.service.ngfactory.d.ts.map +1 -0
  299. package/lib/store/actions/annotation.actions.d.ts +1 -0
  300. package/lib/store/actions/annotation.actions.d.ts.map +1 -0
  301. package/lib/store/actions/bookmark.actions.d.ts +1 -0
  302. package/lib/store/actions/bookmark.actions.d.ts.map +1 -0
  303. package/lib/store/actions/document.actions.d.ts +1 -0
  304. package/lib/store/actions/document.actions.d.ts.map +1 -0
  305. package/lib/store/actions/icp.actions.d.ts +1 -0
  306. package/lib/store/actions/icp.actions.d.ts.map +1 -0
  307. package/lib/store/actions/redaction.actions.d.ts +1 -0
  308. package/lib/store/actions/redaction.actions.d.ts.map +1 -0
  309. package/lib/store/actions/tag.actions.d.ts +1 -0
  310. package/lib/store/actions/tag.actions.d.ts.map +1 -0
  311. package/lib/store/bookmarks-store-utils.d.ts +1 -0
  312. package/lib/store/bookmarks-store-utils.d.ts.map +1 -0
  313. package/lib/store/effects/annotation.effects.d.ts +1 -0
  314. package/lib/store/effects/annotation.effects.d.ts.map +1 -0
  315. package/lib/store/effects/annotation.effects.ngfactory.d.ts.map +1 -0
  316. package/lib/store/effects/bookmarks.effects.d.ts +1 -0
  317. package/lib/store/effects/bookmarks.effects.d.ts.map +1 -0
  318. package/lib/store/effects/bookmarks.effects.ngfactory.d.ts.map +1 -0
  319. package/lib/store/effects/document.effects.d.ts +1 -0
  320. package/lib/store/effects/document.effects.d.ts.map +1 -0
  321. package/lib/store/effects/document.effects.ngfactory.d.ts.map +1 -0
  322. package/lib/store/effects/icp.effects.d.ts +1 -0
  323. package/lib/store/effects/icp.effects.d.ts.map +1 -0
  324. package/lib/store/effects/icp.effects.ngfactory.d.ts.map +1 -0
  325. package/lib/store/effects/index.d.ts +1 -0
  326. package/lib/store/effects/index.d.ts.map +1 -0
  327. package/lib/store/effects/redaction.effects.d.ts +1 -0
  328. package/lib/store/effects/redaction.effects.d.ts.map +1 -0
  329. package/lib/store/effects/redaction.effects.ngfactory.d.ts.map +1 -0
  330. package/lib/store/models/bookmarks.interface.d.ts +1 -0
  331. package/lib/store/models/bookmarks.interface.d.ts.map +1 -0
  332. package/lib/store/models/filters.interface.d.ts +1 -0
  333. package/lib/store/models/filters.interface.d.ts.map +1 -0
  334. package/lib/store/reducers/annotations.reducer.d.ts +1 -0
  335. package/lib/store/reducers/annotations.reducer.d.ts.map +1 -0
  336. package/lib/store/reducers/bookmarks.reducer.d.ts +1 -0
  337. package/lib/store/reducers/bookmarks.reducer.d.ts.map +1 -0
  338. package/lib/store/reducers/document.reducer.d.ts +1 -0
  339. package/lib/store/reducers/document.reducer.d.ts.map +1 -0
  340. package/lib/store/reducers/icp.reducer.d.ts +1 -0
  341. package/lib/store/reducers/icp.reducer.d.ts.map +1 -0
  342. package/lib/store/reducers/redaction.reducer.d.ts +1 -0
  343. package/lib/store/reducers/redaction.reducer.d.ts.map +1 -0
  344. package/lib/store/reducers/reducers.d.ts +2 -1
  345. package/lib/store/reducers/reducers.d.ts.map +1 -0
  346. package/lib/store/reducers/tags.reducer.d.ts +1 -0
  347. package/lib/store/reducers/tags.reducer.d.ts.map +1 -0
  348. package/lib/store/selectors/annotation.selectors.d.ts +54 -15
  349. package/lib/store/selectors/annotation.selectors.d.ts.map +1 -0
  350. package/lib/store/selectors/bookmark.selectors.d.ts +18 -7
  351. package/lib/store/selectors/bookmark.selectors.d.ts.map +1 -0
  352. package/lib/store/selectors/document.selectors.d.ts +15 -9
  353. package/lib/store/selectors/document.selectors.d.ts.map +1 -0
  354. package/lib/store/selectors/icp.selectors.d.ts +9 -8
  355. package/lib/store/selectors/icp.selectors.d.ts.map +1 -0
  356. package/lib/store/selectors/redaction.selectors.d.ts +18 -7
  357. package/lib/store/selectors/redaction.selectors.d.ts.map +1 -0
  358. package/lib/store/selectors/tag.selectors.d.ts +16 -6
  359. package/lib/store/selectors/tag.selectors.d.ts.map +1 -0
  360. package/lib/store/store-utils.d.ts +1 -0
  361. package/lib/store/store-utils.d.ts.map +1 -0
  362. package/lib/toolbar/icp-event.service.d.ts +1 -0
  363. package/lib/toolbar/icp-event.service.d.ts.map +1 -0
  364. package/lib/toolbar/icp-toolbar/icp-toolbar.component.d.ts +1 -0
  365. package/lib/toolbar/icp-toolbar/icp-toolbar.component.d.ts.map +1 -0
  366. package/lib/toolbar/icp-toolbar/icp-toolbar.component.ngfactory.d.ts.map +1 -0
  367. package/lib/toolbar/main-toolbar/main-toolbar.component.d.ts +1 -0
  368. package/lib/toolbar/main-toolbar/main-toolbar.component.d.ts.map +1 -0
  369. package/lib/toolbar/main-toolbar/main-toolbar.component.ngfactory.d.ts.map +1 -0
  370. package/lib/toolbar/redaction-toolbar/redaction-toolbar.component.d.ts +1 -0
  371. package/lib/toolbar/redaction-toolbar/redaction-toolbar.component.d.ts.map +1 -0
  372. package/lib/toolbar/redaction-toolbar/redaction-toolbar.component.ngfactory.d.ts.map +1 -0
  373. package/lib/toolbar/search-bar/search-bar.component.d.ts +2 -0
  374. package/lib/toolbar/search-bar/search-bar.component.d.ts.map +1 -0
  375. package/lib/toolbar/search-bar/search-bar.component.ngfactory.d.ts.map +1 -0
  376. package/lib/toolbar/toolbar-button-visibility.service.d.ts +1 -0
  377. package/lib/toolbar/toolbar-button-visibility.service.d.ts.map +1 -0
  378. package/lib/toolbar/toolbar-button-visibility.service.ngfactory.d.ts.map +1 -0
  379. package/lib/toolbar/toolbar-event.service.d.ts +1 -0
  380. package/lib/toolbar/toolbar-event.service.d.ts.map +1 -0
  381. package/lib/toolbar/toolbar-event.service.ngfactory.d.ts.map +1 -0
  382. package/lib/toolbar/toolbar.module.d.ts +1 -0
  383. package/lib/toolbar/toolbar.module.d.ts.map +1 -0
  384. package/lib/toolbar/toolbar.module.ngfactory.d.ts.map +1 -0
  385. package/lib/viewers/convertible-content-viewer/convertible-content-viewer.component.d.ts +1 -0
  386. package/lib/viewers/convertible-content-viewer/convertible-content-viewer.component.d.ts.map +1 -0
  387. package/lib/viewers/convertible-content-viewer/convertible-content-viewer.component.ngfactory.d.ts.map +1 -0
  388. package/lib/viewers/convertible-content-viewer/document-conversion-api.service.d.ts +1 -0
  389. package/lib/viewers/convertible-content-viewer/document-conversion-api.service.d.ts.map +1 -0
  390. package/lib/viewers/convertible-content-viewer/document-conversion-api.service.ngfactory.d.ts.map +1 -0
  391. package/lib/viewers/grab-n-drag.directive.d.ts +1 -0
  392. package/lib/viewers/grab-n-drag.directive.d.ts.map +1 -0
  393. package/lib/viewers/grab-n-drag.directive.ngfactory.d.ts.map +1 -0
  394. package/lib/viewers/image-viewer/image-viewer.component.d.ts +5 -1
  395. package/lib/viewers/image-viewer/image-viewer.component.d.ts.map +1 -0
  396. package/lib/viewers/image-viewer/image-viewer.component.ngfactory.d.ts.map +1 -0
  397. package/lib/viewers/multimedia-player/multimedia-player.component.d.ts +1 -0
  398. package/lib/viewers/multimedia-player/multimedia-player.component.d.ts.map +1 -0
  399. package/lib/viewers/multimedia-player/multimedia-player.component.ngfactory.d.ts.map +1 -0
  400. package/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.d.ts +5 -0
  401. package/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.d.ts.map +1 -0
  402. package/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.provider.d.ts +1 -0
  403. package/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.provider.d.ts.map +1 -0
  404. package/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.provider.ngfactory.d.ts.map +1 -0
  405. package/lib/viewers/pdf-viewer/pdf-viewer.component.d.ts +6 -2
  406. package/lib/viewers/pdf-viewer/pdf-viewer.component.d.ts.map +1 -0
  407. package/lib/viewers/pdf-viewer/pdf-viewer.component.ngfactory.d.ts.map +1 -0
  408. package/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.d.ts +2 -1
  409. package/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.d.ts.map +1 -0
  410. package/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.ngfactory.d.ts.map +1 -0
  411. package/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.interfaces.d.ts +1 -0
  412. package/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.interfaces.d.ts.map +1 -0
  413. package/lib/viewers/pdf-viewer/side-bar/outline-item/outline-item.component.d.ts +7 -0
  414. package/lib/viewers/pdf-viewer/side-bar/outline-item/outline-item.component.d.ts.map +1 -0
  415. package/lib/viewers/pdf-viewer/side-bar/outline-item/outline-item.component.ngfactory.d.ts.map +1 -0
  416. package/lib/viewers/pdf-viewer/side-bar/outline-item/outline.model.d.ts +3 -1
  417. package/lib/viewers/pdf-viewer/side-bar/outline-item/outline.model.d.ts.map +1 -0
  418. package/lib/viewers/pdf-viewer/side-bar/side-bar.component.d.ts +4 -0
  419. package/lib/viewers/pdf-viewer/side-bar/side-bar.component.d.ts.map +1 -0
  420. package/lib/viewers/pdf-viewer/side-bar/side-bar.component.ngfactory.d.ts.map +1 -0
  421. package/lib/viewers/rotation-persist/rotation-api.service.d.ts +1 -0
  422. package/lib/viewers/rotation-persist/rotation-api.service.d.ts.map +1 -0
  423. package/lib/viewers/rotation-persist/rotation-api.service.ngfactory.d.ts.map +1 -0
  424. package/lib/viewers/rotation-persist/rotation-persist.directive.d.ts +1 -0
  425. package/lib/viewers/rotation-persist/rotation-persist.directive.d.ts.map +1 -0
  426. package/lib/viewers/rotation-persist/rotation-persist.directive.ngfactory.d.ts.map +1 -0
  427. package/lib/viewers/rotation-persist/rotation.model.d.ts +1 -0
  428. package/lib/viewers/rotation-persist/rotation.model.d.ts.map +1 -0
  429. package/lib/viewers/unsupported-viewer/unsupported-viewer.component.d.ts +1 -0
  430. package/lib/viewers/unsupported-viewer/unsupported-viewer.component.d.ts.map +1 -0
  431. package/lib/viewers/unsupported-viewer/unsupported-viewer.component.ngfactory.d.ts.map +1 -0
  432. package/lib/viewers/viewer-event.service.d.ts +1 -0
  433. package/lib/viewers/viewer-event.service.d.ts.map +1 -0
  434. package/lib/viewers/viewer-event.service.ngfactory.d.ts.map +1 -0
  435. package/lib/viewers/viewer-exception.model.d.ts +1 -0
  436. package/lib/viewers/viewer-exception.model.d.ts.map +1 -0
  437. package/lib/viewers/viewer-util.service.d.ts +1 -0
  438. package/lib/viewers/viewer-util.service.d.ts.map +1 -0
  439. package/lib/viewers/viewer-util.service.ngfactory.d.ts.map +1 -0
  440. package/package.json +16 -17
  441. package/public_api.d.ts +1 -0
  442. package/public_api.d.ts.map +1 -0
  443. package/esm5/hmcts-media-viewer.js +0 -67
  444. package/esm5/lib/annotations/annotation-set/annotation-create/box-highlight-create/box-highlight-create.component.js +0 -215
  445. package/esm5/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.directive.js +0 -236
  446. package/esm5/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.service.js +0 -125
  447. package/esm5/lib/annotations/annotation-set/annotation-set.component.js +0 -109
  448. package/esm5/lib/annotations/annotation-set/annotation-set.model.js +0 -15
  449. package/esm5/lib/annotations/annotation-set/annotation-view/annotation-view.component.js +0 -177
  450. package/esm5/lib/annotations/annotation-set/annotation-view/annotation.model.js +0 -29
  451. package/esm5/lib/annotations/annotation-set/annotation-view/rectangle/rectangle.component.js +0 -250
  452. package/esm5/lib/annotations/annotation-set/annotation-view/rectangle/rectangle.model.js +0 -21
  453. package/esm5/lib/annotations/annotation-set/ctx-toolbar/ctx-toolbar.component.js +0 -216
  454. package/esm5/lib/annotations/annotation-set/metadata-layer/metadata-layer.component.js +0 -200
  455. package/esm5/lib/annotations/annotations.module.js +0 -109
  456. package/esm5/lib/annotations/comment-set/comment/comment.component.js +0 -353
  457. package/esm5/lib/annotations/comment-set/comment/comment.model.js +0 -27
  458. package/esm5/lib/annotations/comment-set/comment/comment.service.js +0 -125
  459. package/esm5/lib/annotations/comment-set/comment/text-highlight/text-highlight.directive.js +0 -98
  460. package/esm5/lib/annotations/comment-set/comment/textarea-auto-expand/textarea-auto-expand.directive.js +0 -63
  461. package/esm5/lib/annotations/comment-set/comment-navigate/comments-navigate.component.js +0 -174
  462. package/esm5/lib/annotations/comment-set/comment-set-header/comment-filter/comment-filter.component.js +0 -145
  463. package/esm5/lib/annotations/comment-set/comment-set-header/comment-search/comment-search.component.js +0 -117
  464. package/esm5/lib/annotations/comment-set/comment-set-header/comment-set-header.component.js +0 -131
  465. package/esm5/lib/annotations/comment-set/comment-set-render.service.js +0 -177
  466. package/esm5/lib/annotations/comment-set/comment-set.component.js +0 -295
  467. package/esm5/lib/annotations/comments-summary/comments-summary.component.js +0 -239
  468. package/esm5/lib/annotations/models/api-persisted.model.js +0 -25
  469. package/esm5/lib/annotations/models/event-select.model.js +0 -17
  470. package/esm5/lib/annotations/models/tags.model.js +0 -19
  471. package/esm5/lib/annotations/models/user.model.js +0 -17
  472. package/esm5/lib/annotations/pipes/date/date.pipe.js +0 -48
  473. package/esm5/lib/annotations/pipes/filter/filter.pipe.js +0 -52
  474. package/esm5/lib/annotations/pipes/unsnake/unsnake.pipe.js +0 -28
  475. package/esm5/lib/annotations/services/annotation-api/annotation-api.service.js +0 -188
  476. package/esm5/lib/annotations/services/bookmarks-api/bookmarks-api.service.js +0 -132
  477. package/esm5/lib/annotations/services/tags/tags.services.js +0 -102
  478. package/esm5/lib/annotations/tags/tags.component.js +0 -112
  479. package/esm5/lib/bookmark/components/bookmark-icons.component.js +0 -55
  480. package/esm5/lib/icp/confirm-exit/confirm-action-dialog.component.js +0 -50
  481. package/esm5/lib/icp/icp-follower.service.js +0 -135
  482. package/esm5/lib/icp/icp-presenter.service.js +0 -135
  483. package/esm5/lib/icp/icp-session-api.service.js +0 -49
  484. package/esm5/lib/icp/icp-update.service.js +0 -165
  485. package/esm5/lib/icp/icp.interfaces.js +0 -51
  486. package/esm5/lib/icp/icp.service.js +0 -261
  487. package/esm5/lib/icp/participants-list/participants-list.component.js +0 -77
  488. package/esm5/lib/icp/socket.service.js +0 -142
  489. package/esm5/lib/media-viewer.component.js +0 -422
  490. package/esm5/lib/media-viewer.module.js +0 -110
  491. package/esm5/lib/print.service.js +0 -53
  492. package/esm5/lib/redaction/components/redaction.component.js +0 -247
  493. package/esm5/lib/redaction/services/redaction-api.service.js +0 -133
  494. package/esm5/lib/redaction/services/redaction.model.js +0 -19
  495. package/esm5/lib/shared/gov-uk-date/gov-uk-date.component.js +0 -37
  496. package/esm5/lib/shared/gov-uk-error-message/gov-uk-error-message.component.js +0 -36
  497. package/esm5/lib/shared/gov-uk-fieldset/gov-uk-fieldset.component.js +0 -49
  498. package/esm5/lib/shared/gov-uk-label/gov-uk-label.component.js +0 -33
  499. package/esm5/lib/shared/shared.module.js +0 -42
  500. package/esm5/lib/shared/util/helpers/html-templates.helper.js +0 -36
  501. package/esm5/lib/shared/util/services/number.helper.service.js +0 -39
  502. package/esm5/lib/store/actions/annotation.actions.js +0 -226
  503. package/esm5/lib/store/actions/bookmark.actions.js +0 -242
  504. package/esm5/lib/store/actions/document.actions.js +0 -210
  505. package/esm5/lib/store/actions/icp.actions.js +0 -130
  506. package/esm5/lib/store/actions/redaction.actions.js +0 -255
  507. package/esm5/lib/store/actions/tag.actions.js +0 -50
  508. package/esm5/lib/store/bookmarks-store-utils.js +0 -110
  509. package/esm5/lib/store/effects/annotation.effects.js +0 -128
  510. package/esm5/lib/store/effects/bookmarks.effects.js +0 -193
  511. package/esm5/lib/store/effects/document.effects.js +0 -138
  512. package/esm5/lib/store/effects/icp.effects.js +0 -97
  513. package/esm5/lib/store/effects/index.js +0 -12
  514. package/esm5/lib/store/effects/redaction.effects.js +0 -190
  515. package/esm5/lib/store/models/bookmarks.interface.js +0 -57
  516. package/esm5/lib/store/models/filters.interface.js +0 -17
  517. package/esm5/lib/store/reducers/annotations.reducer.js +0 -231
  518. package/esm5/lib/store/reducers/bookmarks.reducer.js +0 -170
  519. package/esm5/lib/store/reducers/document.reducer.js +0 -222
  520. package/esm5/lib/store/reducers/icp.reducer.js +0 -83
  521. package/esm5/lib/store/reducers/redaction.reducer.js +0 -134
  522. package/esm5/lib/store/reducers/reducers.js +0 -47
  523. package/esm5/lib/store/reducers/tags.reducer.js +0 -159
  524. package/esm5/lib/store/selectors/annotation.selectors.js +0 -175
  525. package/esm5/lib/store/selectors/bookmark.selectors.js +0 -78
  526. package/esm5/lib/store/selectors/document.selectors.js +0 -37
  527. package/esm5/lib/store/selectors/icp.selectors.js +0 -47
  528. package/esm5/lib/store/selectors/redaction.selectors.js +0 -65
  529. package/esm5/lib/store/selectors/tag.selectors.js +0 -40
  530. package/esm5/lib/store/store-utils.js +0 -296
  531. package/esm5/lib/toolbar/icp-event.service.js +0 -65
  532. package/esm5/lib/toolbar/icp-toolbar/icp-toolbar.component.js +0 -112
  533. package/esm5/lib/toolbar/main-toolbar/main-toolbar.component.js +0 -408
  534. package/esm5/lib/toolbar/redaction-toolbar/redaction-toolbar.component.js +0 -130
  535. package/esm5/lib/toolbar/search-bar/search-bar.component.js +0 -226
  536. package/esm5/lib/toolbar/toolbar-button-visibility.service.js +0 -146
  537. package/esm5/lib/toolbar/toolbar-event.service.js +0 -416
  538. package/esm5/lib/toolbar/toolbar.module.js +0 -50
  539. package/esm5/lib/viewers/convertible-content-viewer/convertible-content-viewer.component.js +0 -168
  540. package/esm5/lib/viewers/convertible-content-viewer/document-conversion-api.service.js +0 -57
  541. package/esm5/lib/viewers/grab-n-drag.directive.js +0 -98
  542. package/esm5/lib/viewers/image-viewer/image-viewer.component.js +0 -402
  543. package/esm5/lib/viewers/multimedia-player/multimedia-player.component.js +0 -125
  544. package/esm5/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.js +0 -446
  545. package/esm5/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.provider.js +0 -87
  546. package/esm5/lib/viewers/pdf-viewer/pdf-viewer.component.js +0 -582
  547. package/esm5/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.js +0 -251
  548. package/esm5/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.interfaces.js +0 -39
  549. package/esm5/lib/viewers/pdf-viewer/side-bar/outline-item/outline-item.component.js +0 -62
  550. package/esm5/lib/viewers/pdf-viewer/side-bar/outline-item/outline.model.js +0 -31
  551. package/esm5/lib/viewers/pdf-viewer/side-bar/side-bar.component.js +0 -146
  552. package/esm5/lib/viewers/rotation-persist/rotation-api.service.js +0 -68
  553. package/esm5/lib/viewers/rotation-persist/rotation-persist.directive.js +0 -163
  554. package/esm5/lib/viewers/rotation-persist/rotation.model.js +0 -15
  555. package/esm5/lib/viewers/unsupported-viewer/unsupported-viewer.component.js +0 -120
  556. package/esm5/lib/viewers/viewer-event.service.js +0 -86
  557. package/esm5/lib/viewers/viewer-exception.model.js +0 -36
  558. package/esm5/lib/viewers/viewer-util.service.js +0 -44
  559. package/esm5/public_api.js +0 -35
  560. package/fesm5/hmcts-media-viewer.js +0 -14158
  561. package/fesm5/hmcts-media-viewer.js.map +0 -1
  562. package/hmcts-media-viewer-v2.8.1.tgz +0 -0
@@ -1,17 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators"),require("@ngrx/store"),require("pdfjs-dist/web/pdf_viewer"),require("pdfjs-dist"),require("pdfjs-dist/build/pdf.worker"),require("uuid/v4"),require("moment-timezone"),require("hammerjs"),require("@angular/cdk/overlay"),require("@angular/router"),require("@angular/cdk/a11y"),require("mutable-div"),require("ngx-chips"),require("@swimlane/ngx-datatable"),require("uuid"),require("@ngrx/effects"),require("socket.io-client/dist/socket.io.js"),require("angular-tree-component")):"function"==typeof define&&define.amd?define("@hmcts/media-viewer",["exports","@angular/core","@angular/common","@angular/forms","@angular/common/http","rxjs","rxjs/operators","@ngrx/store","pdfjs-dist/web/pdf_viewer","pdfjs-dist","pdfjs-dist/build/pdf.worker","uuid/v4","moment-timezone","hammerjs","@angular/cdk/overlay","@angular/router","@angular/cdk/a11y","mutable-div","ngx-chips","@swimlane/ngx-datatable","uuid","@ngrx/effects","socket.io-client/dist/socket.io.js","angular-tree-component"],e):e(((t=t||self).hmcts=t.hmcts||{},t.hmcts["media-viewer"]={}),t.ng.core,t.ng.common,t.ng.forms,t.ng.common.http,t.rxjs,t.rxjs.operators,t.store,t.pdf_viewer,t.pdfjsDist,null,t.uuid,t.moment,null,t.ng.cdk.overlay,t.ng.router,t.ng.cdk.a11y,t.mutableDiv,t.ngxChips,t.ngxDatatable,t.uuid$1,t.effects$1,t.socketio,t.angularTreeComponent)}(this,(function(t,e,n,o,i,a,r,s,c,l,u,p,d,h,m,g,v,f,b,y,w,k,S,C){"use strict";p=p&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p,d=d&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d;var E="default"in w?w.default:w;S=S&&Object.prototype.hasOwnProperty.call(S,"default")?S.default:S;
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */
16
- var I=function(t,e){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var P=function(){return(P=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function x(t,e,n,o){var i,a=arguments.length,r=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(r=(a<3?i(r):a>3?i(e,n,r):i(e,n))||r);return a>3&&r&&Object.defineProperty(e,n,r),r}function D(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function _(t,e,n,o){return new(n||(n=Promise))((function(i,a){function r(t){try{c(o.next(t))}catch(t){a(t)}}function s(t){try{c(o.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}c((o=o.apply(t,e||[])).next())}))}function R(t,e){var n,o,i,a,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=2&a[0]?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(6===a[0]&&r.label<i[1]){r.label=i[1],i=a;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(a);break}i[2]&&r.ops.pop(),r.trys.pop();continue}a=e.call(t,r)}catch(t){a=[6,t],o=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function T(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function B(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,a=n.call(t),r=[];try{for(;(void 0===e||e-- >0)&&!(o=a.next()).done;)r.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return r}function A(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(B(arguments[e]));return t}l.GlobalWorkerOptions.workerSrc="/assets/build/pdf.worker.min.js";var O={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};O[O.FOUND]="FOUND",O[O.NOT_FOUND]="NOT_FOUND",O[O.WRAPPED]="WRAPPED",O[O.PENDING]="PENDING";var M=function(){function t(t,e,n,o,i,a,r,s,c,l){var u=this;this.pdfViewer=t,this.downloadManager=e,this.toolbarEvents=n,this.documentLoadInit=o,this.documentLoadProgress=i,this.documentLoaded=a,this.outlineLoaded=r,this.documentLoadFailed=s,this.pageRendered=c,this.positionUpdated=l,this.pdfViewer.eventBus.on("updateviewarea",(function(t){return l.next(t)})),this.pdfViewer.eventBus.on("pagechanging",(function(t){return u.toolbarEvents.setCurrentPageInputValueSubject.next(t.pageNumber)})),this.pdfViewer.eventBus.on("pagesinit",(function(){return u.pdfViewer.currentScaleValue="1"})),this.pdfViewer.eventBus.on("pagerendered",(function(t){})),this.pdfViewer.eventBus.on("pagesloaded",(function(t){return u.emitDocumentInfo(t)})),this.pdfViewer.eventBus.on("scalechanging",(function(t){return u.emitDocumentInfo(t)})),this.pdfViewer.eventBus.on("rotationchanging",(function(t){return u.emitDocumentInfo(t)})),this.pdfViewer.eventBus.on("updatefindcontrolstate",(function(t){t.state!==O.PENDING&&u.toolbarEvents.searchResultsCountSubject.next(t.matchesCount)})),this.pdfViewer.eventBus.on("updatefindmatchescount",(function(t){u.toolbarEvents.searchResultsCountSubject.next(t.matchesCount)})),this.zoomValue=1}return t.prototype.emitDocumentInfo=function(t){var e=A(this.pdfViewer._pages).map((function(t){return{div:t.div,scale:t.scale,rotation:t.rotation,id:t.id,viewportScale:t.viewport.scale}}));this.pageRendered.next(e)},t.prototype.loadDocument=function(t){return _(this,void 0,void 0,(function(){var e,n,o,i,a,r=this;return R(this,(function(s){switch(s.label){case 0:(e=l.getDocument({url:t,cMapUrl:"assets/minified/cmaps",cMapPacked:!0,withCredentials:!0})).onProgress=function(t){var e=t.loaded,n=t.total;r.documentLoadProgress.next({loaded:e,total:n})},this.documentLoadInit.next(t),s.label=1;case 1:return s.trys.push([1,5,,6]),[4,e.promise];case 2:return n=s.sent(),this.documentLoaded.next(n),this.toolbarEvents.pageCountSubject.next(n.numPages),this.pdfViewer.setDocument(n),this.pdfViewer.linkService.setDocument(n,null),o=this,[4,n.getOutline()];case 3:return o.documentOutline=s.sent(),this.outlineLoaded.next(this.documentOutline),[4,n.getMetadata()];case 4:return i=s.sent(),this.setCurrentPDFTitle(i.info.Title),[3,6];case 5:return a=s.sent(),this.documentLoadFailed.next(a),[3,6];case 6:return[2]}}))}))},t.prototype.downloadFile=function(t,e){this.downloadManager.downloadUrl(t,e)},t.prototype.setPageNumber=function(t){this.pdfViewer.currentPageNumber=t},t.prototype.getPageNumber=function(){return this.pdfViewer.currentPageNumber},t.prototype.changePageNumber=function(t){this.pdfViewer.currentPageNumber+=t},t.prototype.search=function(t){var e=t.reset?"find":"findagain";this.pdfViewer.findController.executeCommand(e,{query:t.searchTerm,phraseSearch:!0,caseSensitive:t.matchCase,entireWord:t.wholeWord,highlightAll:t.highlightAll,findPrevious:t.previous})},t.prototype.clearSearch=function(){this.pdfViewer.eventBus.dispatch("findbarclose")},t.prototype.navigateTo=function(t){t instanceof Object&&(t[1].name.includes("XYZ")||(t[1]={name:"XYZ"},t[2]=t[2]||null,t[3]=t[3]||null),t[4]=this.zoomValue),this.pdfViewer.linkService.navigateTo(t)},t.prototype.setZoom=function(t){this.pdfViewer.currentScaleValue=this.getZoomValue(t),this.zoomValue=this.pdfViewer.currentScaleValue,this.toolbarEvents.zoomValueSubject.next(this.pdfViewer.currentScaleValue)},t.prototype.stepZoom=function(t){this.pdfViewer.currentScaleValue=+this.getZoomValue(+this.pdfViewer.currentScaleValue+t),this.zoomValue=this.pdfViewer.currentScaleValue,this.toolbarEvents.zoomValueSubject.next(this.pdfViewer.currentScaleValue)},t.prototype.getZoomValue=function(t){return isNaN(t)?this.zoomValue:t>5?5:t<.1?.1:+t.toFixed(2)},t.prototype.rotate=function(t){return this.pdfViewer.pagesRotation=(this.pdfViewer.pagesRotation+t)%360},t.prototype.resetRotation=function(t){return this.pdfViewer.pagesRotation=t},t.prototype.getNormalisedPagesRotation=function(){return this.pdfViewer.pagesRotation},t.prototype.getCurrentPDFZoomValue=function(){return this.pdfViewer.currentScaleValue},t.prototype.setCurrentPDFTitle=function(t){this.documentTitle=t},t.prototype.getCurrentPDFTitle=function(){return this.documentTitle},t}();var F=new a.BehaviorSubject(!1),N=new a.Subject,j=new a.Subject,L=new a.Subject,H=new a.BehaviorSubject(!1),$=new a.Subject,V=new a.BehaviorSubject(!1),U=function(){N.next()},z=Object.freeze({__proto__:null,enabled:F,sessionLaunch:N,becomingPresenter:j,stoppingPresenting:L,leavingSession:H,sessionExitConfirmed:$,participantsListVisible:V,launchSession:U,enable:function(){F.next(!0),U()},becomePresenter:function(){j.next()},stopPresenting:function(){L.next()},leaveSession:function(){H.next(!0)},confirmExit:function(){$.next(),V.next(!1),F.next(!1)}});var W=function(){function t(){this.highlightModeSubject=new a.BehaviorSubject(!1),this.drawModeSubject=new a.BehaviorSubject(!1),this.rotateSubject=new a.Subject,this.searchSubject=new a.Subject,this.searchResultsCountSubject=new a.Subject,this.zoomSubject=new a.Subject,this.stepZoomSubject=new a.Subject,this.zoomValueSubject=new a.BehaviorSubject(1),this.pageCountSubject=new a.Subject,this.printSubject=new a.Subject,this.downloadSubject=new a.Subject,this.setCurrentPageSubject=new a.Subject,this.setCurrentPageInputValueSubject=new a.Subject,this.changePageByDeltaSubject=new a.Subject,this.showCommentSummary=new a.BehaviorSubject(!1),this.grabNDrag=new a.BehaviorSubject(!1),this.saveRotationSubject=new a.Subject,this.redactionMode=new a.BehaviorSubject(!1),this.redactionPreview=new a.Subject,this.applyRedactToDocument=new a.Subject,this.clearAllRedactMarkers=new a.Subject,this.sidebarOpen=new a.BehaviorSubject(!1),this.searchBarHidden=new a.BehaviorSubject(!0),this.commentsPanelVisible=new a.BehaviorSubject(!1),this.icp=z}return t.prototype.reset=function(){this.setCurrentPageSubject.next(1),this.zoomValueSubject.next(1),this.highlightModeSubject.next(!1),this.drawModeSubject.next(!1),this.showCommentSummary.next(!1)},t.prototype.toggleHighlightMode=function(){!1===this.highlightModeSubject.getValue()?(this.drawModeSubject.next(!1),this.highlightModeSubject.next(!0)):this.highlightModeSubject.next(!1)},t.prototype.toggleDrawMode=function(){!1===this.drawModeSubject.getValue()?(this.highlightModeSubject.next(!1),this.drawModeSubject.next(!0)):this.drawModeSubject.next(!1)},t.prototype.rotate=function(t){this.rotateSubject.next(t)},t.prototype.search=function(t){this.searchSubject.next(t)},t.prototype.getSearchResultsCount=function(){return this.searchResultsCountSubject.asObservable()},t.prototype.zoom=function(t){this.zoomSubject.next(t)},t.prototype.stepZoom=function(t){this.stepZoomSubject.next(t)},t.prototype.getZoomValue=function(){return this.zoomValueSubject.asObservable()},t.prototype.getPageCount=function(){return this.pageCountSubject.asObservable()},t.prototype.print=function(){this.printSubject.next()},t.prototype.download=function(){this.downloadSubject.next()},t.prototype.setPage=function(t){this.setCurrentPageSubject.next(t)},t.prototype.incrementPage=function(t){this.changePageByDeltaSubject.next(t)},t.prototype.getCurrentPageNumber=function(){return this.setCurrentPageInputValueSubject.asObservable()},t.prototype.getShowCommentSummary=function(){return this.showCommentSummary.asObservable()},t.prototype.toggleCommentsSummary=function(t){this.showCommentSummary.next(t)},t.prototype.saveRotation=function(){this.saveRotationSubject.next()},t.prototype.toggleGrabNDrag=function(){this.grabNDrag.next(!this.grabNDrag.getValue())},t.prototype.toggleSideBar=function(t){this.sidebarOpen.next(t)},t.prototype.toggleRedactionMode=function(){this.redactionMode.next(!this.redactionMode.getValue())},t.prototype.toggleRedactionPreview=function(t){this.redactionPreview.next(t)},t.prototype.unmarkAll=function(){this.clearAllRedactMarkers.next()},t.prototype.applyRedactionToDocument=function(){this.applyRedactToDocument.next()},t.prototype.toggleCommentsPanel=function(t){t&&this.toggleParticipantsList(!t),this.commentsPanelVisible.next(t)},t.prototype.toggleParticipantsList=function(t){t&&this.toggleCommentsPanel(!t),this.icp.participantsListVisible.next(t)},t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}();var q=function(){function t(t){this.toolbarEvents=t,this.linkService=new c.PDFLinkService,this.eventBus=new c.EventBus}return t.prototype.create=function(t){var e=new c.PDFFindController({linkService:this.linkService,eventBus:this.eventBus}),n=new c.PDFViewer({container:t.nativeElement,linkService:this.linkService,findController:e,eventBus:this.eventBus,imageResourcesPath:"/assets/images/",textLayerMode:2});return this.linkService.setViewer(n),this.pdfJsWrapper=new M(n,new c.DownloadManager({}),this.toolbarEvents,new a.Subject,new a.Subject,new a.Subject,new a.Subject,new a.Subject,new a.Subject,new a.Subject),this.pdfJsWrapper},t.prototype.pdfWrapper=function(){return this.pdfJsWrapper},t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:W}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(W))},token:t,providedIn:"root"}),t}();var G=function(){function t(){}return t.prototype.printDocumentNatively=function(t){window.open(t).print()},t.prototype.printElementNatively=function(t,e,n){var o=window.open("","","left=0,top=0,width="+e+",height="+n+",toolbar=0,scrollbars=0,status=0");o.document.write(t.innerHTML),o.document.close(),o.focus(),o.print(),o.close()},t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}(),Z={SUCCESS:"SUCCESS",FAILURE:"FAILURE",UNSUPPORTED:"UNSUPPORTED"};var Y=function(t,e){this.exceptionType=t,this.detail=e};var X=function(){function t(){this.showPrint=!1,this.showDownload=!1,this.showNavigation=!1,this.showZoom=!1,this.showRotate=!1,this.showPresentationMode=!1,this.showRedact=!1,this.showOpenFile=!1,this.showBookmark=!1,this.showHighlightButton=!1,this.showDrawButton=!1,this.showSearchBar=!1,this.showSidebar=!1,this.showCommentSummary=!1,this.showGrabNDragButton=!1,this.showSaveRotationButton=!1}return t.prototype.setup=function(t){for(var e in this.showPrint=!1,this.showDownload=!1,this.showNavigation=!1,this.showZoom=!1,this.showRotate=!1,this.showPresentationMode=!1,this.showRedact=!1,this.showOpenFile=!1,this.showBookmark=!1,this.showHighlightButton=!1,this.showDrawButton=!1,this.showSearchBar=!1,this.showSidebar=!1,this.showCommentSummary=!1,this.showGrabNDragButton=!1,this.showSaveRotationButton=!1,t)this[e]=t[e]},t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}();var K={showPrint:!0,showDownload:!0,showNavigation:!0,showZoom:!0,showRotate:!0,showSearchBar:!0,showSidebar:!0,showGrabNDragButton:!0,showCommentSummary:!0,showPresentationMode:!0,showRedact:!0},J={showPrint:!0,showDownload:!0,showZoom:!0,showRotate:!0,showGrabNDragButton:!0,showCommentSummary:!0,showRedact:!0},Q={showDownload:!0},tt={showDownload:!0,showPrint:!0},et=function(t){this.payload=t,this.type="[Document] Set Document Id"};var nt=function(t){this.payload=t,this.type="[Document] Add Pages"};var ot=function(t){this.payload=t,this.type="[Document] Position Updated"};var it=function(t){this.payload=t,this.type="[Document] Convert"};var at=function(t){this.payload=t,this.type="[Document] Convert Success"};var rt=function(t){this.payload=t,this.type="[Document] Convert Fail"};var st=function(){this.type="[Document] Clear Convert Doc Url"};var ct=function(t){this.payload=t,this.type="[Document] Load Rotation"};var lt=function(t){this.payload=t,this.type="[Document] Load Rotation Success"};var ut=function(t){this.payload=t,this.type="[Document] Load Rotation Fail"};var pt=function(t){this.payload=t,this.type="[Document] Save Rotation"};var dt=function(t){this.payload=t,this.type="[Document] Save Rotation Success"};var ht=function(t){this.payload=t,this.type="[Document] Save Rotation Fail"};var mt=function(t){this.payload=t,this.type="[Tags] Add Filter Tags"};var gt=function(){this.type="[Tags] Clear Filter Tags"};var vt=function(t){this.payload=t,this.type="[Icp] Set Case Id"};var ft=function(t){this.payload=t,this.type="[Icp] Load Session"};var bt=function(t){this.payload=t,this.type="[Icp] Load Session Failure"};var yt=function(t){this.payload=t,this.type="[Icp] Join Socket Session"};var wt=function(t){this.payload=t,this.type="[Icp] Socket Session Joined"};var kt=function(){this.type="[Icp] Leave Socket Session"};var St=function(t){this.payload=t,this.type="[Icp] Presenter Updated"};var Ct=function(t){this.payload=t,this.type="[Icp] Participant List Updated"};var Et={convertedDocument:void 0,documentId:void 0,pdfPosition:void 0,pages:{},hasDifferentPageSize:!1,rotation:void 0,rotationLoaded:!1,loading:!1,loaded:!1};function It(t,e){switch(void 0===t&&(t=Et),e.type){case"[Document] Convert Success":var n={url:e.payload,error:void 0};return P(P({},t),{convertedDocument:n});case"[Document] Convert Fail":n={url:void 0,error:e.payload};return P(P({},t),{convertedDocument:n});case"[Document] Clear Convert Doc Url":n=void 0;return P(P({},t),{convertedDocument:n});case"[Document] Load Rotation":return P(P({},t),{rotationLoaded:!1});case"[Document] Load Rotation Success":var o=(i=e.payload)?i.rotationAngle:0;return P(P({},t),{rotation:o,rotationLoaded:!0});case"[Document] Load Rotation Fail":return P(P({},t),{rotation:0,rotationLoaded:!0});case"[Document] Save Rotation Success":var i;o=(i=e.payload).rotationAngle;return P(P({},t),{rotation:o});case"[Document] Set Document Id":return P(P({},t),{documentId:e.payload});case"[Document] Add Pages":var a,r,s=e.payload,c={},l=t.hasDifferentPageSize;return s.forEach((function(t){var e;l||!a||!r||a===t.div.scrollHeight&&r===t.div.scrollWidth?(a=t.div.scrollHeight,r=t.div.scrollWidth):l=!0;var n={styles:{left:t.div.offsetLeft,height:t.div.scrollHeight,width:t.div.scrollWidth},scaleRotation:{scale:t.scale,rotation:t.rotation},viewportScale:t.viewportScale};c=P(P({},c),((e={})[t.id]=n,e))})),P(P({},t),{pages:c,hasDifferentPageSize:l});case"[Document] Position Updated":var u=e.payload;return P(P({},t),{pdfPosition:u})}return t}var Pt=function(t){return t.pages},xt="[Annotations] Load Annotation Set",Dt="[Annotations] Select Annotation",_t=function(t){this.payload=t,this.type=xt};var Rt=function(t){this.payload=t,this.type="[Annotations] Load Annotation Set Success"};var Tt=function(t){this.payload=t,this.type="[Annotations] Load Annotation Set Fail"};var Bt=function(t){this.payload=t,this.type="[Annotations] Save Annotation"};var At=function(t){this.payload=t,this.type="[Annotations] Save Annotation Success"};var Ot=function(t){this.payload=t,this.type="[Annotations] Save Annotation Fail"};var Mt=function(t){this.payload=t,this.type="[Annotations] Add or Edit Comment"};var Ft=function(t){this.payload=t,this.type="[Annotations] Delete Annotation"};var Nt=function(t){this.payload=t,this.type="[Annotations] Delete Annotation Success"};var jt=function(t){this.payload=t,this.type="[Annotations] Delete Annotation Fail"};var Lt=function(t){this.payload=t,this.type=Dt};var Ht=function(t){this.payload=t,this.type="[Comments] Search Comments"};var $t=function(t){this.payload=t,this.type="[Comments] Apply Comment Summary Filter"};var Vt=function(){this.type="[Comments] Clear Comment Summary Filter"};var Ut=function(){function t(){}return t.groupByKeyEntities=function(t,e){return t.reduce((function(t,n){var o;return Object.assign(t,((o={})[n[e]]=(t[n[e]]||[]).concat(n),o))}),{})},t.generateCommentsEntities=function(t){return t.reduce((function(t,e){var n;if(e.comments.length){var o=P(P({},e.comments[0]||""),{tags:A(e.tags||[])});return P(P({},t),((n={})[e.id]=o,n))}return P({},t)}),{})},t.genTagNameEntities=function(t){var e=this,n=t.filter((function(t){return t.comments.length&&t.tags.length})).map((function(t){return e.groupByKeyEntities(t.tags,"name")})).reduce((function(t,e){return P(P({},t),e)}),{});return this.genNameEnt(t,n)},t.genNameEnt=function(t,e){return Object.keys(e).reduce((function(e,n){var o,i=t.filter((function(t){return t.tags.find((function(t){return t.name===n}))})).map((function(t){return t.id})).reduce((function(t,e){var n;return P(P({},t),((n={})[e]=e,n))}),{});return P(P({},e),((o={})[n]=i,o))}),{})},t.generateAnnotationEntities=function(t){return t.reduce((function(t,e){var n,o=P(P({},e),{positionTop:e.rectangles[0].y});return P(P({},t),((n={})[e.id]=o,n))}),{})},t.generateRedactionEntities=function(t){return t.reduce((function(t,e){var n;return P(P({},t),((n={})[e.redactionId]=e,n))}),{})},t.resetCommentEntSelect=function(t){return Object.keys(t).reduce((function(e,n){return e[n]=P(P({},t[n]),{editable:!1,selected:!1}),e}),{})},t.filterCommentsSummary=function(t,e){if(Object.keys(e).length){var n=Object.keys(e.tagFilters).filter((function(t){return!0===e.tagFilters[t]})).length,o=e.dateRangeFrom||e.dateRangeTo,i=t.filter((function(t){var n=!1,i=!1;if(e.hasOwnProperty("tagFilters")&&Object.keys(e.tagFilters).forEach((function(o){if(e.tagFilters[o])return t.tags.forEach((function(t){t.name!==o||n||(n=!0)}))})),o){var a=d(t.lastModifiedDate),r=null!==e.dateRangeFrom?d(e.dateRangeFrom):void 0,s=null!==e.dateRangeTo?d(e.dateRangeTo):void 0;s&&r&&a>r&&a<s&&(i=!0),s&&!r&&a<=s&&(i=!0),r&&!s&&a>r&&(i=!0)}return n||i}));return n||o?i:t}return t},t}();var zt={annotationSet:{},annotationEntities:{},commentEntities:{},annotationPageEntities:{},selectedAnnotation:null,commentSearchQueries:{commentSearch:""},commentSummaryFilters:{hasFilter:!1,filters:{}},loading:!1,loaded:!1};function Wt(t,e){var n,o,i,a,r;switch(void 0===t&&(t=zt),e.type){case xt:var s=P(P({},t.annotationSet),{documentId:e.payload});return P(P({},zt),{annotationSet:s,loading:!0});case"[Annotations] Load Annotation Set Success":case"[Annotations] Load Annotation Set Fail":s=200===e.payload.status?e.payload.body:P(P({},t.annotationSet),{annotations:[],id:p()});var c=Ut.generateAnnotationEntities(s.annotations),l=Ut.groupByKeyEntities(s.annotations,"page"),u=Ut.generateCommentsEntities(s.annotations);return P(P({},t),{annotationSet:s,annotationEntities:c,annotationPageEntities:l,commentEntities:u,loading:!1,loaded:!0});case"[Annotations] Save Annotation Success":var d=e.payload,h=P(P({},t.annotationEntities),((n={})[d.id]=d,n)),m=Object.keys(h).map((function(t){return h[t]})),g=(c=Ut.generateAnnotationEntities(m),l=Ut.groupByKeyEntities(m,"page"),u=Ut.generateCommentsEntities(m),P(P({},t.selectedAnnotation),{annotationId:d.id,editable:!1}));return P(P({},t),{annotationEntities:c,annotationPageEntities:l,commentEntities:u,selectedAnnotation:g,loading:!1,loaded:!0});case"[Annotations] Delete Annotation Success":var v=e.payload,f=t.annotationEntities[v].page;delete(c=P({},t.annotationEntities))[v];var b=A(t.annotationPageEntities[f].filter((function(t){return t.id!==v})));l=P(P({},t.annotationPageEntities),((o={})[f]=b,o)),u=P({},t.commentEntities);return t.commentEntities[v]&&delete u[v],P(P({},t),{annotationEntities:c,annotationPageEntities:l,commentEntities:u});case"[Annotations] Add or Edit Comment":var y=((i={})[e.payload.annotationId]=e.payload,i),w=P(P({},t.commentEntities),y);return P(P({},t),{commentEntities:w});case Dt:var k=e.payload,S=P(P({},t.commentEntities[k.annotationId]),{editable:k.editable,selected:k.selected}),C=Ut.resetCommentEntSelect(P({},t.commentEntities));u=k.annotationId&&t.commentEntities[k.annotationId]?P(P({},C),((a={})[k.annotationId]=S,a)):P({},C);return P(P({},t),{commentEntities:u,selectedAnnotation:e.payload});case"[Comments] Search Comments":var E=P(P({},t.commentSearchQueries),{commentSearch:e.payload});u=Ut.resetCommentEntSelect(P({},t.commentEntities));return P(P({},t),{commentEntities:u,commentSearchQueries:E});case"[Comments] Apply Comment Summary Filter":var I=e.payload,x={hasFilter:(r=!1,I.tagFilters&&Object.keys(I.tagFilters).map((function(t){I.tagFilters[t]&&!r&&(r=!0)})),r||!!I.dateRangeFrom||!!I.dateRangeTo),filters:I};return P(P({},t),{commentSummaryFilters:x});case"[Comments] Clear Comment Summary Filter":return P(P({},t),{commentSummaryFilters:P({},zt.commentSummaryFilters)})}return t}var qt=function(t){return t.annotationSet},Gt=function(t){return t.commentEntities},Zt=function(t){return t.annotationPageEntities},Yt=function(t){return t.annotationEntities},Xt=function(t){return t.selectedAnnotation},Kt=function(t){return t.commentSearchQueries},Jt=function(t){return t.commentSummaryFilters};var Qt={tagNameEnt:{},annotations:[],filteredPageEntities:{},filteredComments:{},formFilterState:{},filters:[]};function te(t,e){switch(void 0===t&&(t=Qt),e.type){case xt:return P(P({},t),Qt);case"[Annotations] Load Annotation Set Success":var n=e.payload.body.annotations,o=Ut.genTagNameEntities(n);return P(P({},t),{tagNameEnt:o,annotations:n});case"[Annotations] Save Annotation Success":var i=e.payload,a=A(t.annotations).filter((function(t){return t.id!==i.id}))||[];n=A(a,[i]),o=Ut.genTagNameEntities(n);return P(P({},t),{annotations:n,tagNameEnt:o});case"[Annotations] Delete Annotation Success":var r=e.payload,s=(n=A(t.annotations).filter((function(t){return t.id!==r})),o=Ut.genTagNameEntities(n),Ut.groupByKeyEntities(n,"page"));return delete(u=P({},t.filteredComments))[r],P(P({},t),{annotations:n,tagNameEnt:o,filteredComments:u,filteredPageEntities:s,filters:[]});case"[Tags] Add Filter Tags":var c=e.payload,l=Object.keys(c).reduce((function(t,e){return c[e]?A(t,[e]):t}),[]),u=l.reduce((function(e,n){return P(P({},e),t.tagNameEnt[n])}),{});n=Object.keys(u).map((function(e){return t.annotations.filter((function(t){return t.id===e}))[0]})),s=Ut.groupByKeyEntities(n,"page");return P(P({},t),{filters:l,filteredComments:u,filteredPageEntities:s});case"[Tags] Clear Filter Tags":return P(P({},t),{filters:[],filteredComments:{},filteredPageEntities:{}})}return t}var ee=function(t){return t.filteredComments},ne=function(t){return t.filteredPageEntities},oe=function(){this.type="[Bookmarks] Load Bookmarks"};var ie=function(t){this.payload=t,this.type="[Bookmarks] Load Bookmarks Success"};var ae=function(t){this.payload=t,this.type="[Bookmarks] Load Bookmarks Failure"};var re=function(t){this.payload=t,this.type="[Bookmarks] Create Bookmark"};var se=function(t){this.payload=t,this.type="[Bookmarks] Create Bookmark Success"};var ce=function(t){this.payload=t,this.type="[Bookmarks] Create Bookmark Failure"};var le=function(t){this.payload=t,this.type="[Bookmarks] Delete Bookmark"};var ue=function(t){this.payload=t,this.type="[Bookmarks] Delete Bookmark Success"};var pe=function(t){this.payload=t,this.type="[Bookmarks] Delete Bookmark Failure"};var de=function(t){this.payload=t,this.type="[Bookmarks] Move Bookmark"};var he=function(t){this.payload=t,this.type="[Bookmarks] Move Bookmark Success"};var me=function(t){this.payload=t,this.type="[Bookmarks] Move Bookmark Failure"};var ge=function(t){this.payload=t,this.type="[Bookmarks] Update Bookmark"};var ve=function(t){this.payload=t,this.type="[Bookmarks] Update Bookmark Success"};var fe=function(t){this.payload=t,this.type="[Bookmarks] Update Bookmark Failure"};var be=function(t){return t?t.reduce((function(t,e){return e.children&&e.children.length>0?A(t,[e.id],be(e.children)):A(t,[e.id])}),[]):[]},ye=function(t){return t.reduce((function(t,e){var n;return Object.assign(t,((n={})[e.id]=e,n))}),{})},we=function(t){for(var e=Object.keys(t),n=function(n){var o=[];e.forEach((function(i){t[i].previous&&e.includes(t[i].previous.toString())||(t[i].index=n,o.push(i))})),o.forEach((function(t){return e.splice(e.indexOf(t),1)})),o=[]},o=0;e.length>0;o++)n(o)};var ke={bookmarks:[],bookmarkEntities:{},bookmarkPageEntities:{},editableBookmark:void 0,loaded:!1,loading:!1};function Se(t,e){var n,o;switch(void 0===t&&(t=ke),e.type){case"[Bookmarks] Load Bookmarks":return P(P({},t),{loading:!0});case"[Bookmarks] Load Bookmarks Success":case"[Bookmarks] Load Bookmarks Failure":var i=200===e.payload.status?e.payload.body:[],a=ye(i),r=Ut.groupByKeyEntities(i,"pageNumber");return P(P({},t),{bookmarks:i,bookmarkEntities:a,bookmarkPageEntities:r,loaded:!0});case"[Bookmarks] Create Bookmark Success":var s=e.payload,c=P(P({},t.bookmarkEntities),((n={})[s.id]=s,n)),l=Object.keys(c).map((function(t){return c[t]})),u=(r=Ut.groupByKeyEntities(l,"pageNumber"),s.id);return P(P({},t),{bookmarkEntities:c,editableBookmark:u,bookmarkPageEntities:r,loading:!1,loaded:!0});case"[Bookmarks] Move Bookmark Success":var p=ye(e.payload);a=P(P({},t.bookmarkEntities),p);return P(P({},t),{bookmarkEntities:a,loading:!1,loaded:!0});case"[Bookmarks] Delete Bookmark Success":var d=e.payload,h=P({},t.bookmarkEntities),m=P({},t.bookmarkPageEntities),g={};return d.forEach((function(t){void 0!==g[h[t].pageNumber]&&g[h[t].pageNumber].length>0?g[h[t].pageNumber].push(t):g[h[t].pageNumber]=[t],delete h[t]})),Object.entries(g).forEach((function(t){var e=B(t,2),n=e[0],o=e[1];m[n]=m[n].filter((function(t){return o.includes(t)}))})),P(P({},t),{bookmarkEntities:h,bookmarkPageEntities:m,loading:!1,loaded:!0});case"[Bookmarks] Update Bookmark Success":s=e.payload;var v=P(P({},t.bookmarkEntities),((o={})[s.id]=P({},s),o));l=Object.keys(v).map((function(t){return v[t]})),r=Ut.groupByKeyEntities(l,"pageNumber"),u=void 0;return P(P({},t),{bookmarkEntities:v,editableBookmark:u,bookmarkPageEntities:r,loading:!1,loaded:!0})}return t}var Ce=function(t){this.payload=t,this.type="[Redaction] Load Redaction"};var Ee=function(t){this.payload=t,this.type="[Redaction] Load Redaction Success"};var Ie=function(t){this.payload=t,this.type="[Redaction] Load Redaction Fail"};var Pe=function(t){this.payload=t,this.type="[Redaction] Save Redaction"};var xe=function(t){this.payload=t,this.type="[Redaction] Save Redaction Success"};var De=function(t){this.payload=t,this.type="[Redaction] Save Redaction Fail"};var _e=function(t){this.payload=t,this.type="[Redaction] Delete Redaction"};var Re=function(t){this.payload=t,this.type="[Redaction] Delete Redaction Success"};var Te=function(t){this.payload=t,this.type="[Redaction] Delete Redaction Fail"};var Be=function(t){this.payload=t,this.type="[Redaction] Select Redaction"};var Ae=function(t){this.payload=t,this.type="[Redaction] Redact"};var Oe=function(t){this.payload=t,this.type="[Redaction] Redact Success"};var Me=function(t){this.payload=t,this.type="[Redaction] Redact Fail"};var Fe=function(){this.type="[Redaction] Reset Redacted Document"};var Ne=function(t){this.payload=t,this.type="[Redaction] Unmark All"};var je=function(){this.type="[Redaction] Unmark All Success"};var Le={redactionEntities:{},redactionPageEntities:{},selectedRedaction:{},redactedDocumentInfo:void 0,documentId:void 0};function He(t,e){var n,o;switch(void 0===t&&(t=Le),e.type){case"[Redaction] Load Redaction":return P(P({},t),Le);case"[Redaction] Load Redaction Success":if(r=e.payload){var i=Ut.generateRedactionEntities(r),a=Ut.groupByKeyEntities(r,"page");return P(P({},t),{redactionEntities:i,redactionPageEntities:a})}return P({},t);case"[Redaction] Save Redaction Success":var r=e.payload,s=P(P({},t.redactionEntities),((n={})[r.redactionId]=r,n)),c=Object.keys(s).map((function(t){return s[t]}));a=Ut.groupByKeyEntities(c,"page");return P(P({},t),{redactionEntities:s,redactionPageEntities:a});case"[Redaction] Select Redaction":case Dt:return P(P({},t),{selectedRedaction:e.payload});case"[Redaction] Delete Redaction Success":var l=e.payload.page,u=e.payload.redactionId;delete(i=P({},t.redactionEntities))[u];var p=A(t.redactionPageEntities[l].filter((function(t){return t.redactionId!==u})));a=P(P({},t.redactionPageEntities),((o={})[l]=p,o));return P(P({},t),{redactionPageEntities:a,redactionEntities:i});case"[Redaction] Redact Success":var d=e.payload;return P(P(P({},t),Le),{redactedDocumentInfo:d});case"[Redaction] Reset Redacted Document":return P(P({},t),{redactedDocumentInfo:void 0});case"[Redaction] Unmark All Success":return P(P({},t),Le)}return t}var $e={session:null,presenter:null,client:null,participants:[]};function Ve(t,e){switch(void 0===t&&(t=$e),e.type){case"[Icp] Set Case Id":var n=e.payload,o=P(P({},t.session),{caseId:n});return P(P({},t),{session:o});case"[Icp] Socket Session Joined":o=e.payload.session;var i=e.payload.participantInfo;return P(P({},t),{session:o,client:i.client,presenter:i.presenter});case"[Icp] Participant List Updated":var a=e.payload,r=Object.keys(a).map((function(t){return{id:t,username:a[t]}}));return P(P({},t),{participants:r});case"[Icp] Presenter Updated":var s=e.payload;return P(P({},t),{presenter:s});case"[Icp] Leave Socket Session":return P(P({},t),$e)}return t}var Ue={document:It,annotations:Wt,tags:te,bookmarks:Se,redactions:He,icp:Ve},ze=s.createFeatureSelector("media-viewer"),We=s.createSelector(ze,(function(t){return t.document})),qe=s.createSelector(We,Pt),Ge=(s.createSelector(qe,(function(t){return Object.values(t)})),s.createSelector(We,(function(t){return t.documentId}))),Ze=s.createSelector(We,(function(t){return t.pdfPosition})),Ye=s.createSelector(We,(function(t){return t.hasDifferentPageSize})),Xe=s.createSelector(We,(function(t){return t.convertedDocument})),Ke=s.createSelector(We,(function(t){return t.rotation})),Je=s.createSelector(We,(function(t){return t.rotationLoaded}));var Qe=function(){function t(){this.textHighlight=new a.Subject,this.boxHighlight=new a.Subject,this.ctxToolbarCleared=new a.Subject,this.navigationEvent=new a.Subject}return t.prototype.textSelected=function(t){this.textHighlight.next(t)},t.prototype.boxSelected=function(t){this.boxHighlight.next(t)},t.prototype.clearCtxToolbar=function(){this.ctxToolbarCleared.next()},t.prototype.goToDestination=function(t){this.navigationEvent.next(t)},t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}();var tn=function(){function t(t,n,o,i,a,s,c){var l=this;this.store=t,this.icpStore=n,this.pdfJsWrapperFactory=o,this.printService=i,this.toolbarEvents=a,this.viewerEvents=s,this.toolbarButtons=c,this.mediaLoadStatus=new e.EventEmitter,this.pdfViewerException=new e.EventEmitter,this.documentTitle=new e.EventEmitter,this.pageHeights=[],this.rotation=0,this.zoom=1,this.loadingDocument=!1,this.hasDifferentPageSize=!1,this.enableGrabNDrag=!1,this.highlightMode=a.highlightModeSubject.pipe(r.tap((function(){l.store.dispatch(new gt)}))),this.drawMode=a.drawModeSubject}return t.prototype.ngAfterContentInit=function(){return _(this,void 0,void 0,(function(){var t=this;return R(this,(function(e){return this.pdfWrapper.documentLoadProgress.subscribe((function(e){return t.onDocumentLoadProgress(e)})),this.pdfWrapper.documentLoaded.subscribe((function(){return t.onDocumentLoaded()})),this.pdfWrapper.documentLoadFailed.subscribe((function(e){return t.onDocumentLoadFailed(e)})),this.pdfWrapper.outlineLoaded.subscribe((function(e){return t.documentOutline=e})),this.pdfWrapper.pageRendered.subscribe((function(e){return t.updatePages(e)})),this.$subscription=this.toolbarEvents.printSubject.subscribe((function(){return t.printService.printDocumentNatively(t.url)})),this.$subscription.add(this.toolbarEvents.downloadSubject.subscribe((function(){return t.pdfWrapper.downloadFile(t.downloadUrl||t.url,t.downloadFileName)}))),this.$subscription.add(this.toolbarEvents.rotateSubject.subscribe((function(e){return t.rotateDocument(e)}))),this.$subscription.add(this.toolbarEvents.zoomSubject.subscribe((function(e){return t.setZoom(e)}))),this.$subscription.add(this.toolbarEvents.stepZoomSubject.subscribe((function(e){return t.stepZoom(e)}))),this.$subscription.add(this.toolbarEvents.searchSubject.subscribe((function(e){return t.pdfWrapper.search(e)}))),this.$subscription.add(this.toolbarEvents.setCurrentPageSubject.subscribe((function(e){return t.pdfWrapper.setPageNumber(e)}))),this.$subscription.add(this.toolbarEvents.changePageByDeltaSubject.subscribe((function(e){return t.pdfWrapper.changePageNumber(e)}))),this.$subscription.add(this.toolbarEvents.grabNDrag.subscribe((function(e){return t.enableGrabNDrag=e}))),this.$subscription.add(this.toolbarEvents.commentsPanelVisible.subscribe((function(e){t.showCommentsPanel=e}))),this.$subscription.add(this.viewerEvents.navigationEvent.subscribe((function(e){return t.goToDestination(e)}))),this.$subscription.add(this.toolbarEvents.icp.participantsListVisible.subscribe((function(e){return t.showIcpParticipantsList=e}))),this.$subscription.add(this.pdfWrapper.positionUpdated.asObservable().pipe(r.throttleTime(500,a.asyncScheduler,{leading:!0,trailing:!0})).subscribe((function(e){return t.store.dispatch(new ot(e.location))}))),[2]}))}))},t.prototype.ngOnChanges=function(t){return _(this,void 0,void 0,(function(){var e=this;return R(this,(function(n){switch(n.label){case 0:return this.pdfWrapper||(this.pdfWrapper=this.pdfJsWrapperFactory.create(this.viewerContainer)),t.url&&this.pdfWrapper?[4,this.loadDocument()]:[3,2];case 1:n.sent(),this.enableRedactions&&this.toolbarEvents.redactionMode.pipe(r.filter((function(t){return!!t}))).subscribe((function(){return e.resetRotation()})),n.label=2;case 2:return t.caseId&&this.icpStore.dispatch(new vt(this.caseId)),[2]}}))}))},t.prototype.resetRotation=function(){this.hasDifferentPageSize&&(this.pdfWrapper.resetRotation(0),this.rotation=0)},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.loadDocument=function(){return _(this,void 0,void 0,(function(){var t=this;return R(this,(function(e){switch(e.label){case 0:return this.initDocumentProgress(),[4,this.pdfWrapper.loadDocument(this.url)];case 1:return e.sent(),this.documentTitle.emit(this.pdfWrapper.getCurrentPDFTitle()),this.setPageHeights(),this.$subscription.add(this.store.pipe(s.select(Ye)).subscribe((function(e){return t.hasDifferentPageSize=e}))),[2]}}))}))},t.prototype.onDocumentLoadProgress=function(t){t.total&&(this.loadingDocumentProgress=Math.min(100,Math.ceil(t.loaded/t.total*100)))},t.prototype.onDocumentLoaded=function(){this.loadingDocument=!1,this.mediaLoadStatus.emit(Z.SUCCESS)},t.prototype.onDocumentLoadFailed=function(t){this.loadingDocument=!1,this.viewerException=new Y(t.name,{message:t.message}),this.errorMessage='Could not load the document "'+this.url+'"',this.mediaLoadStatus.emit(Z.FAILURE),this.pdfViewerException.emit(this.viewerException)},t.prototype.updatePages=function(t){this.enableAnnotations&&this.store.dispatch(new nt(t))},Object.defineProperty(t.prototype,"searchBarHidden",{set:function(t){this.pdfWrapper&&t&&this.pdfWrapper.clearSearch()},enumerable:!0,configurable:!0}),t.prototype.toggleCommentsSummary=function(){this.toolbarEvents.toggleCommentsSummary(!this.toolbarEvents.showCommentSummary.getValue())},t.prototype.rotateDocument=function(t){var e=this.pdfWrapper.getPageNumber();this.pdfWrapper.rotate(t),this.pdfWrapper.setPageNumber(e),this.rotation=(this.rotation+t)%360,this.setPageHeights()},t.prototype.initDocumentProgress=function(){this.loadingDocument=!0,this.loadingDocumentProgress=null,this.errorMessage=null},t.prototype.setZoom=function(t){isNaN(t)||(this.pdfWrapper.setZoom(t),this.zoom=this.calculateZoomValue(t),this.setPageHeights())},t.prototype.stepZoom=function(t){isNaN(t)||(this.pdfWrapper.stepZoom(t),this.zoom=this.calculateZoomValue(this.zoom,t),this.setPageHeights())},t.prototype.setPageHeights=function(){this.pageHeights=[];for(var t=this.pdfViewer.nativeElement.children,e=0;e<t.length;e++)this.pageHeights.push(t[e].clientHeight)},t.prototype.calculateZoomValue=function(t,e){void 0===e&&(e=0);var n=t+e;return n>5?5:n<.1?.1:+n.toFixed(2)},t.prototype.goToDestination=function(t){this.pdfWrapper.navigateTo(t)},t.decorators=[{type:e.Component,args:[{selector:"mv-pdf-viewer",template:'<mv-side-bar *ngIf="toolbarEvents.sidebarOpen"\n id="sidebarContainer"\n [url]="url"\n [zoom]="zoom"\n [rotate]="rotation"\n [outline]="documentOutline"\n [annotationsEnabled]="enableAnnotations">\n</mv-side-bar>\n<mv-comment-set-header\n *ngIf="enableAnnotations"\n [ngClass]="{\'show-comments-panel\': showCommentsPanel}"\n [showCommentSummary]="toolbarButtons.showCommentSummary"\n (showCommentSummaryDialog)="toggleCommentsSummary()">\n</mv-comment-set-header>\n<mv-participants-list></mv-participants-list>\n<div\n class="pdfContainer"\n [ngStyle]="{ height: height }"\n [ngClass]="{ \'pdfContainer\': true, hidden: errorMessage }">\n <div\n #viewerContainer\n mvGrabNDrag\n [dragX]="viewerContainer"\n [dragEnabled]="enableGrabNDrag"\n id="viewerContainer"\n class="viewer-container"\n [class.annotations]="enableAnnotations"\n [class.show-comments-panel]="(showCommentsPanel || showIcpParticipantsList) && !(toolbarEvents.redactionMode | async)"\n [class.grabNDrag]="enableGrabNDrag">\n <div #pdfViewer\n class="pdfViewer"\n mvCreateTextHighlight\n [ngClass]="{ hidden: loadingDocument, highlightMode: highlightMode | async, drawMode: drawMode | async }">\n </div>\n <mv-redactions *ngIf="(toolbarEvents.redactionMode | async); else annotationTemplate"\n [zoom]="zoom"\n [rotate]="rotation"\n ></mv-redactions>\n <ng-template #annotationTemplate>\n <mv-metadata-layer\n *ngIf="enableAnnotations && annotationSet"\n [zoom]="zoom"\n [rotate]="rotation">\n </mv-metadata-layer>\n <mv-bookmark-icons [zoom]="zoom"\n [rotate]="rotation">\n </mv-bookmark-icons>\n </ng-template>\n </div>\n <mv-comment-set [contentScrollTop]="viewerContainer.scrollTop"\n *ngIf="enableAnnotations && annotationSet && !(toolbarEvents.redactionMode | async)"\n [annotationSet]="annotationSet"\n [zoom]="zoom"\n [rotate]="rotation"\n [height]="pdfViewer.offsetHeight"\n [pageHeights]="pageHeights">\n </mv-comment-set>\n <div class="loadingMessage" *ngIf="loadingDocument">\n <h3 class="govuk-heading-m">Loading...{{ loadingDocumentProgress ? loadingDocumentProgress + \'%\' : \'\' }}</h3>\n </div>\n</div>\n',encapsulation:e.ViewEncapsulation.None}]}],t.ctorParameters=function(){return[{type:s.Store},{type:s.Store},{type:q},{type:G},{type:W},{type:Qe},{type:X}]},t.propDecorators={mediaLoadStatus:[{type:e.Output}],pdfViewerException:[{type:e.Output}],documentTitle:[{type:e.Output}],downloadUrl:[{type:e.Input}],url:[{type:e.Input}],downloadFileName:[{type:e.Input}],enableAnnotations:[{type:e.Input}],enableRedactions:[{type:e.Input}],enableICP:[{type:e.Input}],annotationSet:[{type:e.Input}],height:[{type:e.Input}],caseId:[{type:e.Input}],viewerContainer:[{type:e.ViewChild,args:["viewerContainer",{static:!0}]}],pdfViewer:[{type:e.ViewChild,args:["pdfViewer",{static:!1}]}],searchBarHidden:[{type:e.Input}]},t}();var en=function(){function t(t){this.http=t}return t.prototype.validateFile=function(t){return this.http.head(t)},t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:i.HttpClient}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(i.HttpClient))},token:t,providedIn:"root"}),t}();var nn=function(){function t(t,n,o,i,a){this.store=t,this.printService=n,this.viewerUtilService=o,this.toolbarEvents=i,this.toolbarButtons=a,this.mediaLoadStatus=new e.EventEmitter,this.imageViewerException=new e.EventEmitter,this.rotation=0,this.zoom=1,this.subscriptions=[],this.enableGrabNDrag=!1}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.rotateSubject.subscribe((function(e){return t.rotateImage(e)})),this.toolbarEvents.zoomSubject.subscribe((function(e){return t.setZoom(e)})),this.toolbarEvents.stepZoomSubject.subscribe((function(e){return t.stepZoom(e)})),this.toolbarEvents.printSubject.subscribe((function(){return t.printService.printDocumentNatively(t.url)})),this.toolbarEvents.downloadSubject.subscribe((function(){return t.download()})),this.toolbarEvents.grabNDrag.subscribe((function(e){return t.enableGrabNDrag=e})),this.toolbarEvents.commentsPanelVisible.subscribe((function(e){return t.showCommentsPanel=e})))},t.prototype.ngOnDestroy=function(){this.subscriptions.filter((function(t){return!t.closed})).forEach((function(t){return t.unsubscribe()})),this.response&&this.response.unsubscribe()},t.prototype.ngOnChanges=function(t){t.url&&(this.errorMessage=null,this.toolbarEvents.reset())},t.prototype.rotateImage=function(t){this.rotation=(this.rotation+t)%360,this.initAnnoPage(this.img.nativeElement)},t.prototype.setZoom=function(t){return _(this,void 0,void 0,(function(){return R(this,(function(e){switch(e.label){case 0:return isNaN(t)?[3,2]:[4,this.setZoomValue(this.calculateZoomValue(t))];case 1:e.sent(),this.img.nativeElement.width=this.img.nativeElement.naturalWidth*this.zoom,this.initAnnoPage(this.img.nativeElement),e.label=2;case 2:return[2]}}))}))},t.prototype.stepZoom=function(t){return _(this,void 0,void 0,(function(){return R(this,(function(e){switch(e.label){case 0:return isNaN(t)?[3,2]:[4,this.setZoomValue(this.calculateZoomValue(this.zoom,t))];case 1:e.sent(),this.img.nativeElement.width=this.img.nativeElement.naturalWidth*this.zoom,this.initAnnoPage(this.img.nativeElement),e.label=2;case 2:return[2]}}))}))},t.prototype.download=function(){var t=document.createElement("a");document.body.appendChild(t),t.setAttribute("style","display: none"),t.href=this.url,t.download=this.downloadFileName,t.click(),t.remove()},t.prototype.setZoomValue=function(t){var e=this;return new Promise((function(n){e.zoom=t,e.toolbarEvents.zoomValueSubject.next(t),n(!0)}))},t.prototype.calculateZoomValue=function(t,e){void 0===e&&(e=0);var n=t+e;return n>5?5:n<.1?.1:+n.toFixed(2)},t.prototype.onLoadError=function(t){var e=this;this.response=this.viewerUtilService.validateFile(t).subscribe((function(t){return t}),(function(t){e.viewerException=new Y(t.name,{httpResponseCode:t.status,message:t.message})})),this.errorMessage='Could not load the image "'+this.url+'"',this.mediaLoadStatus.emit(Z.FAILURE),this.imageViewerException.emit(this.viewerException)},t.prototype.onLoad=function(t){this.mediaLoadStatus.emit(Z.SUCCESS),this.initAnnoPage(t)},t.prototype.initAnnoPage=function(t){this.imageHeight=this.rotation%180!=0?t.offsetWidth:t.offsetHeight,this.imageWidth=this.rotation%180!=0?t.offsetHeight:t.offsetWidth,this.imageLeft=this.rotation%180!=0?t.offsetTop:t.offsetLeft,this.imageTop=this.rotation%180!=0?t.offsetLeft:t.offsetTop;var e=[{div:{scrollHeight:this.imageHeight,scrollWidth:this.imageWidth,offsetLeft:this.imageLeft},pageNumber:1,scale:this.zoom,rotation:this.rotation,id:1}];this.store.dispatch(new nt(e))},t.prototype.toggleCommentsSummary=function(){this.toolbarEvents.toggleCommentsSummary(!this.toolbarEvents.showCommentSummary.getValue())},t.decorators=[{type:e.Component,args:[{selector:"mv-image-viewer",template:'<mv-comment-set-header [ngClass]="{\'show-comments-panel\': showCommentsPanel}"\n [showCommentSummary]="toolbarButtons.showCommentSummary"\n (showCommentSummaryDialog)="toggleCommentsSummary()">\n</mv-comment-set-header>\n<div mvGrabNDrag [dragX]="imageContainer" [dragEnabled]="enableGrabNDrag"\n id="viewer-wrapper"\n [ngStyle]="{ height: height }"\n [ngClass]="{ \'grabNDrag\': enableGrabNDrag }"\n *ngIf="url && !errorMessage">\n <div #imageContainer id="image-container"\n [ngClass]="{ \'image-container\': true, \'annotations\': enableAnnotations, \'show-comments-panel\': showCommentsPanel }"\n [style.height.px]="imageHeight">\n <img #img\n [src]="url"\n [ngClass]="\'rot\' + rotation"\n (error)="onLoadError(url)"\n (load)="onLoad(img)"/>\n <mv-redactions *ngIf="(toolbarEvents.redactionMode | async);else annotationTemplate"\n [zoom]="zoom"\n [rotate]="rotation"\n ></mv-redactions>\n <ng-template #annotationTemplate>\n <mv-metadata-layer *ngIf="enableAnnotations && annotationSet"\n [zoom]="zoom"\n [rotate]="rotation">\n </mv-metadata-layer>\n </ng-template>\n </div>\n\n <div class="comments" [style.height.px]="imageHeight">\n <mv-comment-set *ngIf="enableAnnotations && annotationSet && !(toolbarEvents.redactionMode | async)"\n [annotationSet]="annotationSet"\n [zoom]="zoom"\n [rotate]="rotation"\n [height]="imageHeight">\n </mv-comment-set>\n </div>\n</div>\n'}]}],t.ctorParameters=function(){return[{type:s.Store},{type:G},{type:en},{type:W},{type:X}]},t.propDecorators={url:[{type:e.Input}],downloadFileName:[{type:e.Input}],enableAnnotations:[{type:e.Input}],annotationSet:[{type:e.Input}],height:[{type:e.Input}],mediaLoadStatus:[{type:e.Output}],imageViewerException:[{type:e.Output}],img:[{type:e.ViewChild,args:["img",{static:!1}]}]},t}();var on=function(){function t(t,n){this.toolbarEvents=t,this.viewerUtilService=n,this.loadStatus=new e.EventEmitter,this.unsupportedViewerException=new e.EventEmitter,this.subscriptions=[]}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.downloadSubject.subscribe((function(){return t.downloadLink.nativeElement.click()})),this.viewerUtilService.validateFile(this.url).subscribe((function(t){return t}),(function(e){t.viewerException=new Y(e.name,{httpResponseCode:e.status,message:e.message})}))),this.loadStatus.emit(Z.UNSUPPORTED),this.typeException||this.unsupportedViewerException.emit(this.viewerException)},t.prototype.ngOnDestroy=function(){var t,e;try{for(var n=T(this.subscriptions),o=n.next();!o.done;o=n.next()){o.value.unsubscribe()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.decorators=[{type:e.Component,args:[{selector:"mv-unsupported-viewer",template:'<div class="govuk-width-container">\n <div class="govuk-notification-banner__content">\n <p>\n <span *ngIf="typeException, else unsupported">The document could not be displayed, or the file type is unsupported.</span>\n Please <a #downloadLink [href]="url" [download]="downloadFileName">click here to download</a>.\n </p>\n <ng-template #unsupported>\n <span>This file type is not supported by this viewer.</span>\n </ng-template>\n </div>\n</div>\n'}]}],t.ctorParameters=function(){return[{type:W},{type:en}]},t.propDecorators={url:[{type:e.Input}],downloadFileName:[{type:e.Input}],typeException:[{type:e.Input}],loadStatus:[{type:e.Output}],unsupportedViewerException:[{type:e.Output}],downloadLink:[{type:e.ViewChild,args:["downloadLink",{static:!1}]}]},t}();var an=function(){function t(t){this.httpClient=t,this.annotationApiUrl="/em-anno",this.annotationSetBaseUrl="/annotation-sets",this.annotationBaseUrl="/annotations"}return t.prototype.getAnnotationSet=function(t){var e=this.annotationSetsFullUrl+"/filter?documentId="+t;return this.httpClient.get(e,{observe:"response",withCredentials:!0})},t.prototype.postAnnotationSet=function(t){return this.httpClient.post(this.annotationSetsFullUrl,t,{observe:"response",withCredentials:!0}).pipe(r.map((function(t){return t.body})),r.catchError((function(){return[]})))},t.prototype.getComments=function(t){return t.pipe(r.map(this.sortAnnotations),r.map(this.extractComments))},t.prototype.sortAnnotations=function(t){return t.annotations.sort((function(t,e){return t.page!==e.page?t.page-e.page:t.rectangles[0].y-e.rectangles[0].y}))},t.prototype.extractComments=function(t){return[].concat.apply([],A(t.map((function(t){return t.comments}))))},t.prototype.deleteAnnotation=function(t){var e=this.annotationFullsUrl+"/"+t;return this.httpClient.delete(e,{observe:"response",withCredentials:!0}).pipe(r.map((function(t){return t.body})))},t.prototype.postAnnotation=function(t){return this.httpClient.post(this.annotationFullsUrl,t,{observe:"response",withCredentials:!0}).pipe(r.map((function(t){return t.body})))},Object.defineProperty(t.prototype,"annotationSetsFullUrl",{get:function(){return this.annotationApiUrl+this.annotationSetBaseUrl},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"annotationFullsUrl",{get:function(){return this.annotationApiUrl+this.annotationBaseUrl},enumerable:!0,configurable:!0}),t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:i.HttpClient}]},t}();var rn=function(){function t(){this.unsavedChanges=new a.Subject}return t.prototype.setCommentSet=function(t){this.commentSetComponent=t},t.prototype.onCommentChange=function(t){this.unsavedChanges.next(t)},t.prototype.getUnsavedChanges=function(){return this.unsavedChanges.asObservable()},t.prototype.hasUnsavedComments=function(t){return t.comments.length>0&&this.getComment(t).hasUnsavedChanges},t.prototype.updateUnsavedCommentsStatus=function(t,e){this.getComment(t).hasUnsavedChanges=e,this.allCommentsSaved()},t.prototype.getComment=function(t){return this.commentSetComponent.commentComponents.find((function(e){return e.comment.annotationId===t.comments[0].annotationId}))},t.prototype.resetCommentSet=function(){this.commentSetComponent=null},t.prototype.allCommentsSaved=function(){this.onCommentChange(this.commentSetComponent.commentComponents.some((function(t){return!0===t.hasUnsavedChanges})))},t.decorators=[{type:e.Injectable}],t}();var sn=s.createSelector(ze,(function(t){return t.tags})),cn=s.createSelector(sn,(function(t){return t.tagNameEnt})),ln=s.createSelector(sn,(function(t){return t.filters})),un=s.createSelector(sn,ee),pn=s.createSelector(sn,ne),dn=s.createSelector(cn,(function(t){return Object.keys(t).map((function(e){return{key:e,length:Object.keys(t[e]).length}}))})),hn=s.createSelector(ze,(function(t){return t.annotations})),mn=s.createSelector(hn,Yt),gn=s.createSelector(hn,qt),vn=s.createSelector(gn,(function(t){return{documentId:t.documentId,annotationSetId:t.id}})),fn=s.createSelector(mn,gn,(function(t,e){return P(P({},e),{annotations:Object.keys(t).map((function(e){return t[e]}))})})),bn=s.createSelector(hn,Xt),yn=s.createSelector(hn,Gt),wn=s.createSelector(hn,Zt),kn=s.createSelector(hn,Kt),Sn=s.createSelector(kn,(function(t){return t.commentSearch})),Cn=s.createSelector(hn,Jt),En=s.createSelector(qe,wn,pn,(function(t,e,n){var o=!!Object.keys(n).length?n:e;if(t){var i=[];return Object.keys(t).forEach((function(e){i.push({anno:o[e]?o[e]:[],styles:t[e].styles})})),i}})),In=s.createSelector(yn,qe,mn,un,(function(t,e,n,o){if(t&&n&&e[1]){var i=!!Object.keys(o).length?o:t;return Object.keys(i).map((function(o){var i=n[o].page;return P(P({},t[o]),{page:i,pages:e})}))}})),Pn=s.createSelector(In,Cn,(function(t,e){void 0===t&&(t=[]);var n=Ut.filterCommentsSummary(t,e.filters);return n.length?n.map((function(t){return{page:t.page,user:t.createdByDetails.forename.concat(" ").concat(t.createdByDetails.surname),date:d(t.lastModifiedDate).format("D MMMM YYYY"),tags:t.tags,comment:t.content}})):[""]})),xn=s.createSelector(mn,un,(function(t,e){var n=!!Object.keys(e).length?e:t;return Object.keys(n).map((function(e){return t[e]})).filter((function(t){return t.comments&&t.comments.length>0}))})),Dn={PDF:"pdf",IMAGE:"image"},_n={MP4:"mp4",MP3:"mp3"},Rn={EXCEL:"excel",WORD:"word",POWERPOINT:"powerpoint",TXT:"txt",RTF:"rtf"},Tn=function(){function t(t,n,o,i,a,r,s){this.store=t,this.toolbarButtons=n,this.toolbarEvents=o,this.api=i,this.commentService=a,this.elRef=r,this.cdr=s,this.showToolbar=!0,this.toolbarButtonOverrides={},this.width="100%",this.mediaLoadStatus=new e.EventEmitter,this.viewerException=new e.EventEmitter,this.toolbarEventsOutput=new e.EventEmitter,this.unsavedChanges=new e.EventEmitter,this.enableAnnotations=!1,this.enableRedactions=!1,this.enableICP=!1,this.multimediaPlayerEnabled=!1,this.multimediaContent=!1,this.convertibleContent=!1,this.unsupportedContent=!1,this.typeException=!1,this.annotationApiUrl&&(i.annotationApiUrl=this.annotationApiUrl)}return t.prototype.ngAfterContentInit=function(){var t=this;this.annotationSet$=this.store.pipe(s.select(fn)),this.hasDifferentPageSize$=this.store.pipe(s.select(Ye)),this.setToolbarButtons(),this.toolbarEventsOutput.emit(this.toolbarEvents),this.$subscriptions=this.commentService.getUnsavedChanges().subscribe((function(e){return t.onCommentChange(e)})),this.$subscriptions.add(this.toolbarEvents.getShowCommentSummary().subscribe((function(e){return t.showCommentSummary=e})))},t.prototype.ngAfterViewChecked=function(){if(this.height&&this.viewerHeight!==this.height)return this.viewerHeight=this.height,void this.cdr.detectChanges();if(!this.height){var t=this.elRef.nativeElement.getBoundingClientRect().top+this.viewerRef.nativeElement.offsetTop;this.prevOffset!==t&&(this.viewerHeight="calc(100vh - "+t+"px)",this.prevOffset=t,this.cdr.detectChanges())}},t.prototype.ngOnChanges=function(t){if(t.annotationApiUrl&&(this.api.annotationApiUrl=this.annotationApiUrl),t.url){this.toolbarEvents.reset(),this.commentService.resetCommentSet();var e=this.extractDMStoreDocId(this.url);this.store.dispatch(new et(e)),!this.enableAnnotations||this.multimediaContent||this.unsupportedContent||this.store.dispatch(new _t(e)),!this.enableRedactions||this.multimediaContent||this.unsupportedContent||this.store.dispatch(new Ce(e)),"image"===this.contentType&&(this.documentTitle=null)}t.contentType&&(this.convertibleContent=this.needsConverting(),this.multimediaContent=this.isMultimedia(),this.unsupportedContent=!this.isSupported()),this.setToolbarButtons(),this.detectOs(),this.typeException=!1},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.prototype.needsConverting=function(){return null!==this.contentType&&Object.keys(Rn).includes(this.contentType.toUpperCase())},t.prototype.isMultimedia=function(){return null!==this.contentType&&Object.keys(_n).includes(this.contentType.toUpperCase())},t.prototype.isSupported=function(){var t=Object.assign({},_n,Rn,Dn);return null!==this.contentType&&Object.keys(t).includes(this.contentType.toUpperCase())},t.prototype.onMediaLoad=function(t){this.mediaLoadStatus.emit(t)},t.prototype.setToolbarButtons=function(){this.contentType===Dn.PDF||this.needsConverting()?this.toolbarButtons.setup(P(P(P({},K),{showHighlightButton:this.enableAnnotations,showDrawButton:this.enableAnnotations}),this.toolbarButtonOverrides)):this.contentType===Dn.IMAGE?this.toolbarButtons.setup(P(P(P({},J),{showDrawButton:this.enableAnnotations}),this.toolbarButtonOverrides)):this.isMultimedia()?this.toolbarButtons.setup(P(P({},Q),this.toolbarButtonOverrides)):this.toolbarButtons.setup(P(P({},tt),this.toolbarButtonOverrides))},t.prototype.onLoadException=function(t){this.viewerException.emit(t),this.isSupported()?(this.typeException=!0,this.contentType=null,this.setToolbarButtons()):this.typeException=!1},t.prototype.onCommentChange=function(t){this.unsavedChanges.emit(t)},t.prototype.onDocumentTitleChange=function(t){this.documentTitle=t},t.prototype.extractDMStoreDocId=function(t){return(t=t.includes("/documents/")?t.split("/documents/")[1]:t).replace("/binary","")},t.prototype.detectOs=function(){this.hasScrollBar=-1!==window.navigator.userAgent.indexOf("Win")},t.decorators=[{type:e.Component,args:[{selector:"mv-media-viewer",template:'<div id="outerContainer"\n [ngClass]="{\n \'has-redact-bar\': toolbarEvents.redactionMode | async,\n \'icp-mode\': toolbarEvents.icp.enabled | async,\n \'is-redaction-preview\': toolbarEvents.redactionPreview | async,\n sidebarOpen: toolbarEvents.sidebarOpen | async,\n \'has-scroll-bar\': hasScrollBar,\n \'has-different-page-size\': hasDifferentPageSize$ | async\n }"\n [ngStyle]="{ width: width }">\n\n <mv-comments-summary *ngIf="showCommentSummary"\n [title]="documentTitle || \'Comment Summary\'"\n [contentType]="contentType">\n </mv-comments-summary>\n\n <mv-confirm-action *ngIf="toolbarEvents.icp.leavingSession | async"></mv-confirm-action>\n\n <div id="mainContainer">\n <mv-main-toolbar *ngIf="showToolbar"\n [enableAnnotations]="enableAnnotations"\n [enableICP]="enableICP"\n [enableRedactions]="enableRedactions"\n [contentType]="contentType"\n >\n </mv-main-toolbar>\n <mv-redaction-toolbar *ngIf="toolbarEvents.redactionMode | async"></mv-redaction-toolbar>\n <mv-icp-toolbar *ngIf="toolbarEvents.icp.enabled | async"></mv-icp-toolbar>\n\n <div #viewerRef>\n <mv-conversion-viewer *ngIf="convertibleContent"\n (documentTitle)="onDocumentTitleChange($event)"\n (mediaLoadStatus)="onMediaLoad($event)"\n (viewerException)="onLoadException($event)"\n [enableAnnotations]="enableAnnotations"\n [enableRedactions]="enableRedactions"\n [annotationSet]="enableAnnotations ? (annotationSet$ | async) : null"\n [originalUrl]="url"\n [downloadFileName]="downloadFileName"\n [height]="viewerHeight"\n mvRotationPersist>\n </mv-conversion-viewer>\n <mv-pdf-viewer *ngIf="contentType === \'pdf\'"\n #pdfViewer\n (mediaLoadStatus)="onMediaLoad($event)"\n (pdfViewerException)="onLoadException($event)"\n (documentTitle)="onDocumentTitleChange($event)"\n [url]="url"\n [enableAnnotations]="enableAnnotations"\n [enableRedactions]="enableRedactions"\n [enableICP]="enableICP"\n [annotationSet]="enableAnnotations ? (annotationSet$ | async) : null"\n [downloadFileName]="downloadFileName"\n [height]="viewerHeight"\n [caseId]="caseId"\n mvRotationPersist>\n </mv-pdf-viewer>\n <mv-image-viewer *ngIf="contentType === \'image\'"\n (mediaLoadStatus)="onMediaLoad($event)"\n (imageViewerException)="onLoadException($event)"\n [url]="url"\n [enableAnnotations]="enableAnnotations"\n [annotationSet]="enableAnnotations ? (annotationSet$ | async) : null"\n [downloadFileName]="downloadFileName"\n [height]="viewerHeight"\n mvRotationPersist>\n </mv-image-viewer>\n <mv-multimedia-player *ngIf="multimediaContent"\n [multimediaOn]="multimediaPlayerEnabled"\n [url]="url"\n [downloadFileName]="downloadFileName"\n (loadStatus)="onMediaLoad($event)">\n </mv-multimedia-player>\n <mv-unsupported-viewer *ngIf="unsupportedContent"\n [url]="url"\n [typeException]="typeException"\n [downloadFileName]="downloadFileName"\n (loadStatus)="onMediaLoad($event)"\n (unsupportedViewerException)="onLoadException($event)">\n </mv-unsupported-viewer>\n </div>\n </div>\n</div>\n',encapsulation:e.ViewEncapsulation.None}]}],t.ctorParameters=function(){return[{type:s.Store},{type:X},{type:W},{type:an},{type:rn},{type:e.ElementRef},{type:e.ChangeDetectorRef}]},t.propDecorators={viewerRef:[{type:e.ViewChild,args:["viewerRef",{static:!1}]}],url:[{type:e.Input}],downloadFileName:[{type:e.Input}],contentType:[{type:e.Input}],showToolbar:[{type:e.Input}],toolbarButtonOverrides:[{type:e.Input}],height:[{type:e.Input}],width:[{type:e.Input}],mediaLoadStatus:[{type:e.Output}],viewerException:[{type:e.Output}],toolbarEventsOutput:[{type:e.Output}],unsavedChanges:[{type:e.Output}],enableAnnotations:[{type:e.Input}],annotationApiUrl:[{type:e.Input}],enableRedactions:[{type:e.Input}],enableICP:[{type:e.Input}],multimediaPlayerEnabled:[{type:e.Input}],caseId:[{type:e.Input}]},t}();var Bn=function(){function t(){}return t.prototype.isNumber=function(t){return null!=t&&""!==t&&!isNaN(Number(t.toString()))},t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}(),An=function(){function t(t,e,n,o){this.toolbarEvents=t,this.toolbarButtons=e,this.cdr=n,this.numberHelper=o,this.enableAnnotations=!1,this.enableRedactions=!1,this.enableICP=!1,this.contentType=null,this.subscriptions=[],this.icpEnabled=!1,this.redactionEnabled=!1,this.pageNumber=1,this.pageCount=0,this.isDropdownMenuOpen=!1,this.dropdownMenuPositions=[new m.ConnectionPositionPair({originX:"end",originY:"bottom"},{overlayX:"end",overlayY:"top"},0,3)],this.zoomScales=[.1,.25,.5,.75,1,1.25,1.5,2.5,3,5],this.allButtonsWidth=0,this.widthRequiredForBtn={}}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.setCurrentPageSubject.subscribe((function(e){return t.setCurrentPage(e)})),this.toolbarEvents.setCurrentPageInputValueSubject.subscribe((function(e){return t.pageNumber=e})),this.toolbarEvents.getPageCount().subscribe((function(e){return t.pageCount=e})),this.toolbarEvents.icp.enabled.subscribe((function(e){t.icpEnabled=e,t.icpEnabled&&(t.toolbarEvents.toggleCommentsPanel(!e),t.toolbarEvents.sidebarOpen.next(!1))})),this.toolbarEvents.redactionMode.subscribe((function(e){t.redactionEnabled=e})))},t.prototype.ngOnDestroy=function(){var t,e;try{for(var n=T(this.subscriptions),o=n.next();!o.done;o=n.next()){o.value.unsubscribe()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.ngAfterViewInit=function(){var t=this;Array.from(this.mvToolbarMain.nativeElement.children).forEach((function(e){t.allButtonsWidth+=e.getBoundingClientRect().width,t.widthRequiredForBtn[e.id]=t.allButtonsWidth})),this.cdr.detectChanges()},t.prototype.onResize=function(){this.cdr.detectChanges()},t.prototype.onClickHighlightToggle=function(){this.toolbarEvents.toggleHighlightMode()},t.prototype.onClickDrawToggle=function(){this.toolbarEvents.toggleDrawMode()},t.prototype.toggleSideBar=function(){this.toolbarEvents.sidebarOpen.next(!this.toolbarEvents.sidebarOpen.getValue())},t.prototype.togglePresentBar=function(){this.toolbarEvents.searchBarHidden.next(!0),this.toolbarEvents.icp.enable()},t.prototype.increasePageNumber=function(){this.toolbarEvents.incrementPage(1)},t.prototype.decreasePageNumber=function(){this.toolbarEvents.incrementPage(-1)},t.prototype.onPageNumberInputChange=function(t){Number(t)<1&&(t="1"),Number(t)>this.pageCount&&(t=this.pageCount.toString()),this.toolbarEvents.setPage(Number.parseInt(t,10))},t.prototype.setCurrentPage=function(t){this.pageNumber=t},t.prototype.rotate=function(t){this.toolbarEvents.rotate(t)},t.prototype.printFile=function(){this.toolbarEvents.print()},t.prototype.downloadFile=function(){this.toolbarEvents.download()},t.prototype.zoom=function(t){this.toolbarEvents.zoom(+t)},t.prototype.stepZoom=function(t){this.toolbarEvents.stepZoom(t),this.zoomSelect.nativeElement.selected="selected"},t.prototype.toggleCommentsPanel=function(){this.toolbarEvents.toggleCommentsPanel(!this.toolbarEvents.commentsPanelVisible.getValue())},t.prototype.toggleRedactBar=function(){this.toolbarEvents.toggleRedactionMode()},t.prototype.toggleGrabNDrag=function(){this.toolbarEvents.toggleGrabNDrag()},t.prototype.isPdf=function(){return"pdf"===this.contentType},t.prototype.toggleSearchBar=function(){this.toolbarEvents.searchBarHidden.next(!this.toolbarEvents.searchBarHidden.getValue())},t.prototype.toggleMoreOptions=function(){var t=this;this.isDropdownMenuOpen=!this.isDropdownMenuOpen,setTimeout((function(){t.mvMenuItems&&t.mvMenuItems.nativeElement.focus()}),100)},t.decorators=[{type:e.Component,args:[{selector:"mv-main-toolbar",template:'<div class="toolbar">\n <div id="toolbarContainer">\n <div class="mv-toolbar__container">\n <div #mvToolbar class="mv-toolbar" [class.notSupported]="!contentType">\n \x3c!-- The mvToolbarMain div contains all toolbar buttons except the "More options" button. This allows for calculation of the available space to display buttons --\x3e\n <div id="mvToolbarMain" class="mv-toolbar-main" #mvToolbarMain>\n <ng-container *ngTemplateOutlet="menuItems"></ng-container>\n </div>\n \x3c!-- The mvToolbarMoreOptions div contains the "More options" toolbar button (and the overlay template for the dropdown menu).\n The space occupied by the button (if visible) is excluded from the toolbar space available calculation --\x3e\n <div id="mvToolbarMoreOptions" class="mv-toolbar-more-options">\n <button id="mvMoreOptionsBtn" class="mv-button mv-toolbar__menu-button--more-options"\n [class.mv-toolbar__menu-button--more-options__hidden]="mvToolbar.offsetWidth >= allButtonsWidth" aria-pressed="false"\n (click)="toggleMoreOptions()" cdkOverlayOrigin #trigger="cdkOverlayOrigin">\n <span>More options</span>\n </button>\n \x3c!-- This template displays the overlay content for the dropdown menu and is connected to the "More options" button --\x3e\n <ng-template cdkConnectedOverlay [cdkConnectedOverlayOrigin]="trigger"\n [cdkConnectedOverlayOpen]="isDropdownMenuOpen" [cdkConnectedOverlayPositions]="dropdownMenuPositions">\n <div class="dropdown-menu" #dropdownMenu tabindex="0">\n <ng-container *ngTemplateOutlet="menuItems"></ng-container>\n </div>\n </ng-template>\n </div>\n </div>\n\n <div id="mvMenuItems" #mvMenuItems>\n <ng-template #menuItems>\n\n <button *ngIf="toolbarButtons.showSidebar" id="mvIndexBtn" title="Index" data-l10n-id="index" #mvIndexBtn\n class="mv-button mv-toolbar__menu-button--index"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvIndexBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvIndexBtn\']" aria-pressed="false"\n (click)="toggleSideBar(); isDropdownMenuOpen = false">\n <span>Index</span>\n </button>\n\n <button *ngIf="toolbarButtons.showDrawButton" [disabled]="icpEnabled || redactionEnabled" id="mvDrawBtn"\n #mvDrawBtn class="mv-button mv-toolbar__menu-button--draw" title="Draw a box" tabindex="-1"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvDrawBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvDrawBtn\']"\n [class.toggled]="toolbarEvents.drawModeSubject | async" aria-hidden="true" aria-pressed="false"\n data-l10n-id="toggleDrawButton" (click)="onClickDrawToggle(); isDropdownMenuOpen = false">\n <span data-l10n-id="draw_label">Draw a box</span>\n </button>\n\n <button *ngIf="toolbarButtons.showHighlightButton" [disabled]="icpEnabled || redactionEnabled"\n id="mvHighlightBtn" #mvHighlightBtn class="mv-button mv-toolbar__menu-button--highlight" title="Highlight"\n tabindex="-1" [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvHighlightBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvHighlightBtn\']"\n [class.toggled]="toolbarEvents.highlightModeSubject | async" aria-hidden="true" aria-pressed="false"\n (click)="onClickHighlightToggle(); isDropdownMenuOpen = false" data-l10n-id="toggleHighlightButton">\n <span data-l10n-id="highlight_label">Highlight</span>\n </button>\n\n <ng-container *ngIf="toolbarButtons.showNavigation">\n <div id="mvPageBtn" #mvPageBtn class="mv-toolbar__menu-button--page" aria-pressed="false"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvPageBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvPageBtn\']">\n <span>Page</span>\n\n <button id="mvUpBtn" [disabled]="pageNumber === 1" title="Previous Page"\n class="mv-toolbar__menu-button--up button-image" data-l10n-id="previous"\n (click)="decreasePageNumber()"><span></span></button>\n <button id="mvDownBtn" [disabled]="pageNumber === pageCount" title="Next Page"\n class="mv-toolbar__menu-button--down button-image" data-l10n-id="next"\n (click)="increasePageNumber()"><span></span></button>\n\n <input type="number" id="pageNumber" class="hmcts-toolbar-input govuk-input--width-2" title="Page Number"\n value="1" size="4" min="1" [value]="pageNumber" aria-label="page number" tabindex="0"\n data-l10n-id="page" (change)="onPageNumberInputChange(pageNumberInput.value)" #pageNumberInput>\n <span id="numPages" class="toolbarLabel">/ {{ pageCount }}</span>\n </div>\n </ng-container>\n\n <ng-container *ngIf="toolbarButtons.showZoom">\n <div id="mvZoomBtn" #mvZoomBtn class="mv-toolbar__menu-button--zoom" aria-pressed="false"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvZoomBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvZoomBtn\']">\n <span>Zoom</span>\n <button [disabled]="toolbarEvents.zoomValueSubject.value == 0.1" id="mvMinusBtn"\n class="mv-toolbar__menu-button--zoom-out button-image" title="Zoom Out" data-l10n-id="zoom_out"\n (click)="stepZoom(-0.1)"><span></span></button>\n <select id="scaleSelect" class="hmcts-toolbar-select" title="Zoom" tabindex="0" data-l10n-id="zoom"\n (change)="zoom($event.target.value)" aria-label="zoom">\n <option #zoomSelect id="customScaleOption" title="" [value]="toolbarEvents.zoomValueSubject.value">\n {{(toolbarEvents.zoomValueSubject.value) * 100 | number: \'1.0-0\'}}%</option>\n <option *ngFor="let zoomScale of zoomScales" title="" [value]="zoomScale"\n [attr.data-l10n-id]="\'page_scale_percent_\' + zoomScale*100">{{ zoomScale *100 }}%\n </option>\n </select>\n\n <button [disabled]="toolbarEvents.zoomValueSubject.value == 5" id="mvPlusBtn"\n class="mv-toolbar__menu-button--zoom-in button-image" (click)="stepZoom(0.1)" title="Zoom In"\n data-l10n-id="zoom_in"><span></span></button>\n </div>\n </ng-container>\n\n <div *ngIf="toolbarButtons.showRotate" id="mvRotateBtn" #mvRotateBtn class="mv-toolbar__menu-button--rotate"\n aria-pressed="false" [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvRotateBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvRotateBtn\']">\n <button id="mvRotateLeftBtn" class="mv-toolbar__menu-button--rotate_left button-image"\n title="Rotate Counterclockwise" data-l10n-id="page_rotate_ccw" (click)="rotate(270)"><span></span>\n </button>\n <button id="mvRotateRightBtn" class="mv-toolbar__menu-button--rotate_right button-image"\n title="Rotate Clockwise" data-l10n-id="page_rotate_cw" (click)="rotate(90)"><span></span>\n </button>\n <span>Rotate</span>\n </div>\n\n <button *ngIf="toolbarButtons.showSearchBar" [disabled]="icpEnabled" id="mvSearchBtn" #mvSearchBtn\n title="Search" data-l10n-id="searchbar" class="mv-button mv-toolbar__menu-button--search"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvSearchBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvSearchBtn\']" aria-pressed="false"\n (click)="toggleSearchBar(); isDropdownMenuOpen = false">\n <span data-l10n-id="search_label">Search</span>\n </button>\n\n <button *ngIf="enableICP && toolbarButtons.showPresentationMode && isPdf()"\n [disabled]="icpEnabled || !contentType || redactionEnabled" id="mvPresentBtn" #mvPresentBtn\n class="mv-button mv-toolbar__menu-button--present" title="In-Court Presentation Mode"\n data-l10n-id="icpMode_label" [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvPresentBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvPresentBtn\']" aria-pressed="false"\n (click)="togglePresentBar(); isDropdownMenuOpen = false"><span data-l10n-id="icpMode_label">Present</span>\n </button>\n\n <button *ngIf="enableRedactions && toolbarButtons.showRedact" [disabled]="icpEnabled" id="mvRedactBtn"\n #mvRedactBtn title="Redact" data-l10n-id="redact" class="mv-button mv-toolbar__menu-button--redact"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvRedactBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvRedactBtn\']" aria-pressed="false"\n (click)="toggleRedactBar(); isDropdownMenuOpen = false">\n <span>Redact</span>\n </button>\n\n <button *ngIf="toolbarButtons.showGrabNDragButton" [disabled]="icpEnabled" id="mvGrabBtn" #mvGrabBtn\n class="mv-button mv-toolbar__menu-button--grab"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvGrabBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvGrabBtn\']" aria-pressed="false"\n (click)="toggleGrabNDrag(); isDropdownMenuOpen = false">\n <span>Grab and drag</span>\n </button>\n\n <button *ngIf="toolbarButtons.showDownload" [disabled]="icpEnabled || redactionEnabled" id="mvDownloadBtn"\n #mvDownloadBtn class="mv-button mv-toolbar__menu-button--download" title="Download" data-l10n-id="download"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvDownloadBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvDownloadBtn\']" aria-pressed="false"\n (click)="downloadFile(); isDropdownMenuOpen = false">\n <span>Download</span>\n </button>\n\n <button *ngIf="toolbarButtons.showPrint" [disabled]="icpEnabled || redactionEnabled" id="mvPrintBtn"\n #mvPrintBtn title="Print" data-l10n-id="print" class="mv-button mv-toolbar__menu-button--print"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvPrintBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvPrintBtn\']" aria-pressed="false"\n (click)="printFile(); isDropdownMenuOpen = false">\n <span>Print</span>\n </button>\n\n <button *ngIf="enableAnnotations && toolbarButtons.showCommentSummary" [disabled]="redactionEnabled"\n id="mvCommentsBtn" #mvCommentsBtn class="mv-button mv-toolbar__menu-button--comments" title="Comments"\n data-l10n-id="comments" [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvCommentsBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvCommentsBtn\']" aria-pressed="false"\n (click)="toggleCommentsPanel(); isDropdownMenuOpen = false">\n <span>Comments</span>\n </button>\n </ng-template>\n </div>\n <mv-search-bar></mv-search-bar>\n </div>\n\n <div id="loadingBar">\n <div class="progress">\n <div class="glimmer">\n </div>\n </div>\n </div>\n </div>\n</div>\n'}]}],t.ctorParameters=function(){return[{type:W},{type:X},{type:e.ChangeDetectorRef},{type:Bn}]},t.propDecorators={enableAnnotations:[{type:e.Input}],enableRedactions:[{type:e.Input}],enableICP:[{type:e.Input}],contentType:[{type:e.Input}],zoomSelect:[{type:e.ViewChild,args:["zoomSelect",{static:!1}]}],mvToolbarMain:[{type:e.ViewChild,args:["mvToolbarMain",{static:!1}]}],mvMenuItems:[{type:e.ViewChild,args:["dropdownMenu",{static:!1}]}],onResize:[{type:e.HostListener,args:["window:resize",[]]}]},t}();var On=function(){function t(t,e){this.toolbarButtons=t,this.toolbarEvents=e,this.highlightAll=!0,this.matchCase=!1,this.wholeWord=!1,this.resultsText="",this.searchText="",this.resultCount=0,this.subscriptions=[],this.advancedSearchVisible=!1}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.searchResultsCountSubject.subscribe((function(e){return t.setSearchResultsCount(e)})))},t.prototype.ngOnDestroy=function(){var t,e;try{for(var n=T(this.subscriptions),o=n.next();!o.done;o=n.next()){o.value.unsubscribe()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.onWindowKeyDown=function(t){var e=this;("F3"===t.code||t.ctrlKey&&"KeyF"===t.code)&&(t.preventDefault(),this.toolbarEvents.searchBarHidden.next(!1),setTimeout((function(){return e.findInput.nativeElement.focus()}),200))},t.prototype.searchNext=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!1,reset:!1})},t.prototype.searchPrev=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!0,reset:!1})},t.prototype.search=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!1,reset:!0})},t.prototype.setSearchResultsCount=function(t){this.resultCount=t.total,this.resultsText=this.resultCount>0?"Found "+t.current+" of "+t.total:"No results found"},t.prototype.onEscapeKeyPress=function(t){this.toolbarEvents.searchBarHidden.next(!0)},t.prototype.onEnterKeyPress=function(t){this.search()},t.prototype.toggleAdvancedSearch=function(){this.advancedSearchVisible=!this.advancedSearchVisible},t.prototype.toggleSearchBar=function(){this.toolbarEvents.searchBarHidden.next(!this.toolbarEvents.searchBarHidden.getValue())},t.decorators=[{type:e.Component,args:[{selector:"mv-search-bar",template:'<div class="searchbar govuk-!-padding-3" [hidden]="toolbarEvents.searchBarHidden | async">\n <div class="govuk-grid-row">\n <div class="govuk-grid-column-full">\n <input class="govuk-input govuk-!-display-inline-block govuk-!-width-three-quarters govuk-!-margin-bottom-5 govuk-!-margin-top-5"\n type="text" aria-label="Find in document" #findInput [(ngModel)]="searchText" (keydown.escape)="onEscapeKeyPress($event)" (keydown.enter)="onEnterKeyPress($event)" title="Find in document"\n placeholder="Find in document…" tabindex="0" data-l10n-id="find_input" />\n <button class="govuk-button govuk-!-display-inline-block govuk-!-margin-bottom-4" data-module="govuk-button"\n (click)="search()" style=" position: absolute; top: 40px; right: 10px; ">\n Search\n </button>\n <button id="mvCloseBtn" #mvCloseBtn class="mv-button searchbar-button--close" title="Close Search" data-l10n-id="mvRedactBtn"\n (click)="toggleSearchBar()">\n </button>\n </div>\n </div>\n\n <div class="govuk-grid-row">\n <div class="govuk-grid-column-three-quarters">\n <span id="findResultsCount" class="govuk-!-display-inline-block govuk-!-margin-right-4">{{resultsText}}</span>\n <a *ngIf="resultCount > 0" [routerLink]="" class="govuk-link govuk-link--no-visited-state govuk-!-margin-right-2"\n (click)="searchPrev()" title="Find the previous occurrence of the phrase" data-l10n-id="find_previous">Prev</a>\n <a *ngIf="resultCount > 0" [routerLink]="" class="govuk-link govuk-link--no-visited-state" (click)="searchNext()"\n title="Find the next occurrence of the phrase" data-l10n-id="find_next">Next</a>\n </div>\n <div class="govuk-grid-column-one-quarter">\n <a [routerLink]="" class="govuk-link govuk-link--no-visited-state" (click)="toggleAdvancedSearch()" title="Advanced"\n data-l10n-id="find_advanced" style=" position: absolute; top: 95px; right: 15px; ">Advanced</a>\n </div>\n </div>\n\n <div class="govuk-grid-row" *ngIf="advancedSearchVisible">\n <div class="govuk-grid-column-full">\n <div class="govuk-form-group govuk-!-margin-top-3 govuk-!-margin-bottom-1">\n <fieldset class="govuk-fieldset" aria-describedby="advanced">\n <div class="govuk-checkboxes">\n <div class="govuk-checkboxes__item">\n <input class="govuk-checkboxes__input" id="findHighlightAll" name="findHighlightAll" type="checkbox"\n (change)="highlightAll = !highlightAll; search()" [checked]="highlightAll">\n <label class="govuk-label govuk-checkboxes__label" for="findHighlightAll" data-l10n-id="find_highlight">\n Highlight all\n </label>\n </div>\n <div class="govuk-checkboxes__item">\n <input class="govuk-checkboxes__input" id="findMatchCase" name="findMatchCase" type="checkbox"\n (change)="matchCase = !matchCase; search()" [checked]="matchCase">\n <label class="govuk-label govuk-checkboxes__label" for="findMatchCase"\n data-l10n-id="find_match_case_label">\n Match text (exact case)\n </label>\n </div>\n <div class="govuk-checkboxes__item">\n <input class="govuk-checkboxes__input" id="findEntireWord" name="findMatchCase" type="checkbox"\n (change)="wholeWord = !wholeWord; search()" [checked]="wholeWord">\n <label class="govuk-label govuk-checkboxes__label" for="findEntireWord"\n data-l10n-id="find_entire_word_label">\n Match whole words or sentences\n </label>\n </div>\n </div>\n </fieldset>\n </div>\n </div>\n </div>\n</div>\n'}]}],t.ctorParameters=function(){return[{type:X},{type:W}]},t.propDecorators={findInput:[{type:e.ViewChild,args:["findInput",{static:!0}]}],onWindowKeyDown:[{type:e.HostListener,args:["window:keydown",["$event"]]}]},t}();var Mn=s.createSelector(ze,(function(t){return t.redactions})),Fn=s.createSelector(Mn,(function(t){return t.redactionPageEntities})),Nn=s.createSelector(Mn,(function(t){return t.selectedRedaction})),jn=s.createSelector(Mn,(function(t){return t.redactedDocumentInfo})),Ln=s.createSelector(Mn,(function(t){return t.redactionEntities})),Hn=s.createSelector(Ln,Ge,(function(t,e){return{redactions:Object.keys(t).map((function(e){return t[e]})),documentId:e}})),$n=s.createSelector(qe,Fn,(function(t,e){if(t&&e){var n=[];return Object.keys(t).forEach((function(o){n.push({anno:e[o]?e[o]:[],styles:t[o].styles})})),n}})),Vn=function(){function t(t,e,n){this.toolbarEventService=t,this.toolbarButtons=e,this.store=n,this.preview=!1,this.hasRedactions=!1}return t.prototype.ngOnInit=function(){var t=this;this.$subscription=this.store.pipe(s.select(Hn)).subscribe((function(e){t.hasRedactions=!!e.redactions.length}))},t.prototype.toggleTextRedactionMode=function(){this.toolbarEventService.highlightModeSubject.next(!0)},t.prototype.toggleDrawMode=function(){this.toolbarEventService.drawModeSubject.next(!0)},t.prototype.togglePreview=function(){this.preview=!this.preview,this.toolbarEventService.toggleRedactionPreview(this.preview)},t.prototype.unmarkAll=function(){this.toolbarEventService.unmarkAll()},t.prototype.redact=function(){this.toolbarEventService.applyRedactionToDocument()},t.prototype.toggleRedactBar=function(){this.toolbarEventService.toggleRedactionMode()},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.decorators=[{type:e.Component,args:[{selector:"mv-redaction-toolbar",template:'<div class="redaction">\n <label class="govuk-label redaction-title" data-l10n-id="redaction_options">Redaction options</label>\n <button id="toggleDrawButton" class="mv-button redaction-button--draw" title="Draw a box"\n data-l10n-id="toggleDrawButton" (click)="toggleDrawMode()">\n <span data-l10n-id="toggleDrawButton_label">Draw a box</span>\n </button>\n\n <button *ngIf="toolbarButtons.showHighlightButton" id="toggleHighlightButton"\n class="mv-button redaction-button--redact" aria-pressed="false" title="Redact text"\n data-l10n-id="toggleTextRedactionButton" (click)="toggleTextRedactionMode()">\n <span data-l10n-id="toggleTextRedactionButton_label">Redact text</span>\n </button>\n\n <button [disabled]="!hasRedactions" id="mvClearBtn" #mvClearBtn class="mv-button redaction-button--clear" aria-pressed="false" title="Clear all"\n data-l10n-id="toggleClearAllButton" (click)="unmarkAll()">\n <span data-l10n-id="Clear all">Clear all</span>\n </button>\n\n <button [disabled]="!hasRedactions" id="mvPreviewBtn" class="mv-button" [class.redaction-button--preview]="!preview"\n [class.redaction-button--hide-preview]="preview" redaction-button--preview aria-pressed="false" title="Preview"\n data-l10n-id="togglePreviewButton" (click)="togglePreview()">\n <span *ngIf="!preview" data-l10n-id="redaction-preview_label">Preview</span>\n <span *ngIf="preview" data-l10n-id="redaction-hide-preview_label">Hide preview</span>\n </button>\n\n <button [disabled]="!hasRedactions" id="mvRedactBtn" class="mv-button redaction-button--download" aria-pressed="false" title="Redact"\n data-l10n-id="mvRedactBtn" (click)="redact()">\n <span data-l10n-id="Save Document">Save document</span>\n </button>\n\n <button id="mvCloseBtn" #mvCloseBtn class="mv-button redaction-button--close" title="Close Redaction" data-l10n-id="mvRedactBtn"\n (click)="toggleRedactBar()">\n <span data-l10n-id="Close Redaction">Close Redaction</span>\n </button>\n\n</div>\n'}]}],t.ctorParameters=function(){return[{type:W},{type:X},{type:s.Store}]},t}();var Un=s.createSelector(ze,(function(t){return t.icp})),zn=s.createSelector(Un,(function(t){return t.session})),Wn=s.createSelector(zn,(function(t){return null===t?null:t.caseId})),qn=s.createSelector(Un,(function(t){return t.presenter})),Gn=s.createSelector(qn,(function(t){return null===t?null:t.username})),Zn=s.createSelector(Un,(function(t){return t.client})),Yn=s.createSelector(qn,Zn,(function(t,e){return null===t?void 0:t.id===e.id})),Xn=s.createSelector(Un,(function(t){return t.participants})),Kn=function(){function t(t,e){this.toolbarEventService=t,this.store=e}return t.prototype.ngOnInit=function(){var t=this;this.$subscription=this.store.pipe(s.select(Yn)).subscribe((function(e){return t.isPresenter=e})),this.$subscription.add(this.store.pipe(s.select(Gn)).subscribe((function(e){return t.presenterName=e})))},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.present=function(){this.toolbarEventService.icp.becomePresenter()},t.prototype.stopPresenting=function(){this.toolbarEventService.icp.stopPresenting()},t.prototype.leaveIcpSession=function(){this.toolbarEventService.icp.leaveSession()},t.prototype.showParticipantsList=function(){this.toolbarEventService.toggleParticipantsList(!this.toolbarEventService.icp.participantsListVisible.getValue())},t.decorators=[{type:e.Component,args:[{selector:"mv-icp-toolbar",template:'<div id="icp-toolbar" class="icpMode">\n <div id="toolbar-title">\n <label class="govuk-label" data-l10n-id="digitalEvidence_label">Digital evidence presentation</label>\n </div>\n\n <div id="presentation-mode">\n <div class="item-label">\n <label class="govuk-label" data-l10n-id="icpInfo_label">You are in presentation mode</label>\n </div>\n <div class="item-button">\n <button class="govuk-button govuk-button--secondary" data-module="govuk-button" tabindex="0"\n title="Leave presentation" (click)="leaveIcpSession()">\n <span data-l10n-id="icp-leave-presentation_label">Leave presentation</span>\n </button>\n </div>\n </div>\n\n <div id="presenter-info">\n <div class="item-label">\n <label class="govuk-label" *ngIf="!presenterName" data-l10n-id="noPresenter_label">Waiting for presenter</label>\n <label class="govuk-label" *ngIf="presenterName && isPresenter" data-l10n-id="isPresenter_label">You are\n presenting</label>\n <label class="govuk-label" *ngIf="presenterName && !isPresenter"\n data-l10n-id="otherPresenter_label">{{ presenterName | titlecase }}\n is presenting</label>\n </div>\n <div class="item-button">\n <button *ngIf="!presenterName" class="govuk-button" id="icp-present" tabindex="0" title="Present"\n (click)="present()">\n <span data-l10n-id="icp-present_label">Start presenting</span>\n </button>\n <button *ngIf="isPresenter" class="govuk-button govuk-button--warning" id="icp-stop-presenting" tabindex="0"\n title="Stop presenting" (click)="stopPresenting()">\n <span data-l10n-id="icp-stop-presenting_label">Stop Presenting</span>\n </button>\n </div>\n </div>\n\n <div id="participant-list">\n <button class="govuk-button govuk-button--secondary" id="icp-participants-list" tabindex="0"\n title="Participants list" (click)="showParticipantsList()">\n <span\n data-l10n-id="icp-stop-presenting_label">{{(toolbarEventService.icp.participantsListVisible | async) ? \'Hide\': \'Show\'}}\n participants</span>\n </button>\n </div>\n</div>'}]}],t.ctorParameters=function(){return[{type:W},{type:s.Store}]},t}();var Jn=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{declarations:[On,An,Vn,Kn],providers:[X,W],exports:[An,On,Vn,Kn],imports:[n.CommonModule,o.FormsModule,m.OverlayModule,g.RouterModule]}]}],t}(),Qn=function(){function t(t,n){this.toolbarEvents=t,this.store=n,this.update=new e.EventEmitter,this.delete=new e.EventEmitter,this.annotationClick=new e.EventEmitter}return Object.defineProperty(t.prototype,"annotation",{set:function(t){this.anno=P({},t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectedAnnoId",{set:function(t){if(t){var e=this.anno.id||this.anno.redactionId;this.selected=!!t.annotationId&&t.annotationId===e}},enumerable:!0,configurable:!0}),t.prototype.onSelect=function(){var t=this.anno.id||this.anno.redactionId;this.annotationClick.emit({annotationId:t,editable:!1,selected:!0})},t.prototype.onRectangleUpdate=function(t){var e=P({},this.anno);e.rectangles=e.rectangles.filter((function(e){return e.id!==t.id})),e.rectangles.push(t),this.update.emit(e)},t.prototype.deleteHighlight=function(){this.delete.emit(this.anno)},t.prototype.addOrEditComment=function(){if(0===this.anno.comments.length){var t={annotationId:this.anno.id,content:"",createdBy:this.anno.createdBy,createdByDetails:void 0,createdDate:d.utc().tz("Europe/London").toISOString(),id:w.v4(),lastModifiedBy:"",lastModifiedByDetails:void 0,lastModifiedDate:"",tags:[],page:null,pages:{},pageHeight:null,selected:!1,editable:!1};this.store.dispatch(new Mt(t))}this.selected=!0,this.annotationClick.emit({annotationId:this.anno.id,editable:!0,selected:!0}),this.toolbarEvents.toggleCommentsPanel(!0)},t.decorators=[{type:e.Component,args:[{selector:"mv-annotation",template:'<div #container [tabindex]="anno.id">\n <mv-ctx-toolbar *ngIf="selected"\n [canDelete]="true" [canComment]="true"\n [rectangles]="anno.rectangles"\n [zoom]="zoom"\n [rotate]="rotate"\n [pageHeight]="pageHeight"\n [pageWidth]="pageWidth"\n (deleteHighlightEvent)="deleteHighlight()"\n (addOrEditCommentEvent)="addOrEditComment()">\n </mv-ctx-toolbar>\n <ng-container *ngFor="let rectangle of anno.rectangles">\n <mv-anno-rectangle\n (select)="onSelect()"\n (update)="onRectangleUpdate($event)"\n [selected]="selected"\n [zoom]="zoom"\n [rotate]="rotate"\n [pageHeight]="pageHeight"\n [pageWidth]="pageWidth"\n [editable]="anno.rectangles.length <= 1"\n [annoRect]="rectangle"\n [color]="anno.color">\n </mv-anno-rectangle>\n </ng-container>\n</div>\n'}]}],t.ctorParameters=function(){return[{type:W},{type:s.Store}]},t.propDecorators={annotation:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],selectedAnnoId:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}],update:[{type:e.Output}],delete:[{type:e.Output}],annotationClick:[{type:e.Output}],container:[{type:e.ViewChild,args:["container",{static:!1}]}]},t}();var to=function(){function t(t,e){this.store=t,this.commentService=e,this.annotations=[]}return t.prototype.ngOnInit=function(){this.selectedAnnotation$=this.store.pipe(s.select(bn))},t.prototype.onAnnotationUpdate=function(t){this.store.dispatch(new Bt(t))},t.prototype.onAnnotationDelete=function(t){t.comments.length>0&&this.commentService.updateUnsavedCommentsStatus(t,!1),this.store.dispatch(new Ft(t.id))},t.prototype.selectAnnotation=function(t){this.store.dispatch(new Lt(t))},t.decorators=[{type:e.Component,args:[{selector:"mv-annotation-set",template:'<ng-container *ngFor="let annotation of annotations">\n <mv-annotation [annotation]="annotation"\n [zoom]="zoom"\n [rotate]="rotate"\n [selectedAnnoId]="selectedAnnotation$ | async"\n [pageHeight]="pageHeight"\n [pageWidth]="pageWidth"\n (update)="onAnnotationUpdate($event)"\n (delete)="onAnnotationDelete($event)"\n (annotationClick)="selectAnnotation($event)">\n </mv-annotation>\n</ng-container>\n'}]}],t.ctorParameters=function(){return[{type:s.Store},{type:rn}]},t.propDecorators={page:[{type:e.Input}],annotations:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}]},t}();var eo=function(){function t(t,e){this.toolBarEvents=t,this.store=e}return t.prototype.saveAnnotation=function(t,e){var n=this;this.store.pipe(s.select(vn),r.take(1)).subscribe((function(o){var i=P(P({id:E(),color:"FFFF00",comments:[],page:e,rectangles:t,type:"highlight"},o),{createdBy:"",createdByDetails:void 0,createdDate:d.utc().tz("Europe/London").toISOString(),lastModifiedBy:"",lastModifiedByDetails:void 0,lastModifiedDate:"",tags:[]});n.store.dispatch(new Bt(i))}))},t.prototype.applyRotation=function(t,e,n,o,i,a,r,s){var c={x:+(a/s).toFixed(2),y:+(i/s).toFixed(2),width:+(o/s).toFixed(2),height:+(n/s).toFixed(2)},l=c.x,u=c.y,p=c.width,d=c.height,h={x:l,y:u,width:p,height:d};switch(r){case 90:h.width=d,h.height=p,h.x=u,h.y=+(e/s-l-p).toFixed(2);break;case 180:h.x=+(e/s-l-p).toFixed(2),h.y=+(t/s-u-d).toFixed(2);break;case 270:h.width=d,h.height=p,h.x=+(t/s-u-d).toFixed(2),h.y=l}return h},t.prototype.resetHighlight=function(){window.getSelection().removeAllRanges(),this.toolBarEvents.highlightModeSubject.next(!1)},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:W},{type:s.Store}]},t}();var no=function(){function t(t,n){this.toolbarEvents=t,this.highlightService=n,this.select=new e.EventEmitter,this.update=new e.EventEmitter,this.subscriptions=[],this.enableGrabNDrag=!1}return Object.defineProperty(t.prototype,"annoRect",{get:function(){return this._annoRect},set:function(t){this._annoRect=P({},t),this.height=+(t.height*this.zoom).toFixed(2),this.width=+(t.width*this.zoom).toFixed(2),this.left=+(t.x*this.zoom).toFixed(2),this.top=+(t.y*this.zoom).toFixed(2)},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){t.rotate&&this.adjustForRotation(this.rotate)},t.prototype.ngAfterViewInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.grabNDrag.subscribe((function(e){return t.enableGrabNDrag=e})))},t.prototype.ngOnDestroy=function(){this.subscriptions.filter((function(t){return!t.closed})).forEach((function(t){return t.unsubscribe()}))},Object.defineProperty(t.prototype,"selected",{get:function(){return this._selected},set:function(t){this._selected=t,this._selected&&this.viewRect&&this.viewRect.nativeElement.focus()},enumerable:!0,configurable:!0}),t.prototype.onClick=function(){this.select.emit(this.annoRect)},t.prototype.onUpdate=function(t){var e=t.offsetHeight,n=t.offsetWidth,o=t.offsetTop,i=t.offsetLeft;if(this.hasRectangleChanged(t)){var a=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,e,n,o,i,this.rotate,this.zoom);a=P(P({},this.annoRect),a),this.update.emit(P({},a))}},t.prototype.adjustForRotation=function(t){var e=this.top,n=this.left,o=this.height,i=this.width;switch(t){case 90:this.width=o,this.height=i,this.left=this.pageWidth-e-o,this.top=n;break;case 180:this.left=this.pageWidth-n-i,this.top=this.pageHeight-e-o;break;case 270:this.width=o,this.height=i,this.left=e,this.top=this.pageHeight-n-i}},t.prototype.hasRectangleChanged=function(t){return this.left!==t.offsetLeft||this.top!==t.offsetTop||this.width!==t.offsetWidth||this.height!==t.offsetHeight},t.decorators=[{type:e.Component,args:[{selector:"mv-anno-rectangle",template:'<div *ngIf="editable; else nonEditable">\n <div #rectElement\n class="rectangle"\n draggable\n resizable\n [tabindex]="annoRect.id"\n [ngClass]="{ \'selected\': selected, \'grabNDrag\': enableGrabNDrag }"\n [style.backgroundColor]="\'#\' + color"\n [style.width]="width + \'px\'"\n [style.height]="height + \'px\'"\n [style.left]="left + \'px\'"\n [style.top]="top + \'px\'"\n [rotate]="0"\n [selected]="selected"\n (click)="onClick()"\n (stopped)="onUpdate(rectElement)">\n </div>\n</div>\n<ng-template #nonEditable>\n <div #rectElement\n class="rectangle"\n [tabindex]="annoRect.id"\n [ngClass]="{ \'selected\': selected }"\n [style.backgroundColor]="\'#\' + color"\n [style.width]="width + \'px\'"\n [style.height]="height+ \'px\'"\n [style.left]="left + \'px\'"\n [style.top]="top + \'px\'"\n (click)="onClick()">\n </div>\n</ng-template>\n'}]}],t.ctorParameters=function(){return[{type:W},{type:eo}]},t.propDecorators={color:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],editable:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}],select:[{type:e.Output}],update:[{type:e.Output}],viewRect:[{type:e.ViewChild,args:["rectElement",{static:!1}]}],annoRect:[{type:e.Input}],selected:[{type:e.Input}]},t}();var oo=function(){function t(t){this.http=t,this.snakeCase=function(t){return t.replace(/ +/g," ").split(/ |\B(?=[A-Z])/).map((function(t){return t.toLowerCase()})).join("_")}}return t.prototype.getAllTags=function(t){var e="/em-anno/tags/"+t;return this.http.get(e)},t.prototype.getNewTags=function(t){return this.tagItems?this.tagItems[t]:[]},t.prototype.updateTagItems=function(t,e){var n,o=this,i=t.map((function(t){return P(P({},t),{name:o.snakeCase(t.name)})}));this.tagItems=P(P({},this.tagItems),((n={})[e]=i,n))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:i.HttpClient}]},t}();var io=function(){function t(t,n,o){this.store=t,this.commentService=n,this.tagsServices=o,this.CHAR_LIMIT=5e3,this.totalPrevPagesHeight=0,this.hasUnsavedChanges=!1,this.commentClick=new e.EventEmitter,this.renderComments=new e.EventEmitter,this.delete=new e.EventEmitter,this.updated=new e.EventEmitter,this.changes=new e.EventEmitter,this.rotate=0,this.zoom=1}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions=this.store.select(Sn).pipe(r.distinctUntilChanged()).subscribe((function(e){return t.searchString=e})),this.reRenderComments()},t.prototype.ngAfterContentInit=function(){this.tagItems&&this.tagItems.length&&this.tagsServices.updateTagItems(this.tagItems,this._comment.annotationId)},t.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe()},Object.defineProperty(t.prototype,"comment",{get:function(){return this._comment},set:function(t){this._comment=P({},t),this.page=this._comment.page,this.lastUpdate=t.lastModifiedDate?t.lastModifiedDate:t.createdDate,this.author=t.createdByDetails,this.createdBy=t.createdBy,this.editor=t.lastModifiedByDetails,this.originalComment=t.content,this.fullComment=this.originalComment,this.selected=this._comment.selected,this._editable=this._comment.editable,this.tagItems=this._comment.tags;this.totalPrevPagesHeight=0;for(var e=0;e<this.page-1;e++){var n=this._comment.pages[e+1]?this._comment.pages[e+1].styles.height:void 0;n&&(this.totalPrevPagesHeight+=n+10)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"annotation",{set:function(t){this._rectangle=t.rectangles.reduce((function(t,e){return t.y<e.y?t:e}));var e=this._comment.pages[this.page].styles.height/this.zoom;switch(this.rotate){case 90:this.rectTop=this._rectangle.x;break;case 180:this.rectTop=e-(this._rectangle.y+this._rectangle.height);break;case 270:this.rectTop=e-(this._rectangle.x+this._rectangle.width);break;default:this.rectTop=this._rectangle.y}this.rectLeft=this._rectangle.x},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"editable",{get:function(){return this._editable},enumerable:!0,configurable:!0}),t.prototype.onCommentChange=function(t){this.hasUnsavedChanges=this.originalComment.substring(0,this.CHAR_LIMIT)!==t.substring(0,this.CHAR_LIMIT),this.commentService.onCommentChange(this.hasUnsavedChanges)},t.prototype.deleteOrCancel=function(){this.editable?(this.hasUnsavedChanges=!1,this._editable=!1,this.fullComment=this.originalComment,this.changes.emit(!1),this.author||this.fullComment||this.delete.emit(this._comment)):this.delete.emit(this._comment)},t.prototype.editOrSave=function(){if(this.editable){this._comment.content=this.fullComment.substring(0,this.CHAR_LIMIT);var t=this.tagsServices.getNewTags(this._comment.annotationId),e={comment:this._comment,tags:t};this.updated.emit(e),this.hasUnsavedChanges=!1,this._editable=!1,this.changes.emit(!1)}else this._editable=!0},t.prototype.onCommentClick=function(){this.selected||(this.selected=!0,this._editable=!1,this.commentClick.emit({annotationId:this._comment.annotationId,editable:this._editable,selected:!0}))},t.prototype.reRenderComments=function(){this.renderComments.emit(this._comment)},Object.defineProperty(t.prototype,"commentTop",{get:function(){return this.totalPrevPagesHeight+this.rectTop*this.zoom},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.form.nativeElement.getBoundingClientRect().height/this.zoom},enumerable:!0,configurable:!0}),t.decorators=[{type:e.Component,args:[{selector:"mv-anno-comment",template:'<div #form (click)="onCommentClick()" class="aui-comment"\n [style.top.px]="commentTop"\n [style.zIndex]="selected ? 100 : 0">\n <div id="detailsWrapper {{index}}" class="aui-comment__header">\n <span *ngIf="author && !editor" class="aui-comment__author">\n {{ author.forename }} {{ author.surname }}\n </span>\n <span *ngIf="editor" class="aui-comment__author">\n {{ editor.forename }} {{ editor.surname }}\n </span>\n <time [hidden]="!selected && !this.editable" class="aui-comment__meta">\n {{ lastUpdate | momentDate: \'d MMMM y h:mm a\' }}\n </time>\n </div>\n <mv-tags\n [tagItems]="tagItems"\n [userId]="createdBy"\n [editable]="editable"\n [annoId]="_comment.annotationId">\n </mv-tags>\n <textarea *ngIf="selected && editable"\n #editableComment\n mvTextAreaAutoExpand\n type="text"\n required\n name="content"\n [maxlength]="CHAR_LIMIT"\n class="aui-comment__content form-control mimic-focus edit-mode expanded"\n [(ngModel)]="fullComment"\n (ngModelChange)="reRenderComments(); onCommentChange($event);"\n aria-label="comment">\n </textarea>\n <p *ngIf="!editable"\n mvTextHighlight class="commentText" [textToHighlight]="searchString">\n {{ fullComment }}\n </p>\n <div *ngIf="selected || this.editable || (!fullComment.length && (tagItems && !tagItems.length))"\n class="aui-comment__footer commentBtns">\n <button class="govuk-button"\n type="button" role="button"\n (click)="editOrSave()">\n {{ !editable ? \'Edit\' : \'Save\' }}\n </button>\n <button type="button" role="button"\n class="govuk-button govuk-button--secondary"\n (click)="deleteOrCancel()">\n {{ !editable ? \'Delete\' : \'Cancel\' }}\n </button>\n </div>\n <span class="aui-comment__private">private</span>\n</div>\n'}]}],t.ctorParameters=function(){return[{type:s.Store},{type:rn},{type:oo}]},t.propDecorators={commentClick:[{type:e.Output}],renderComments:[{type:e.Output}],delete:[{type:e.Output}],updated:[{type:e.Output}],changes:[{type:e.Output}],rotate:[{type:e.Input}],zoom:[{type:e.Input}],index:[{type:e.Input}],page:[{type:e.Input}],form:[{type:e.ViewChild,args:["form",{static:!1}]}],editableComment:[{type:e.ViewChild,args:["editableComment",{static:!1}]}],comment:[{type:e.Input}],annotation:[{type:e.Input}]},t}();var ao=function(){function t(){this.createHighlightEvent=new e.EventEmitter,this.deleteHighlightEvent=new e.EventEmitter,this.addOrEditCommentEvent=new e.EventEmitter,this.createBookmarkEvent=new e.EventEmitter,this.defaultHeight=70,this.defaultWidth=300}return t.prototype.ngOnChanges=function(t){this.setRectangle(),this.top=this.popupTop(),this.left=this.popupLeft()},Object.defineProperty(t.prototype,"rectangles",{get:function(){return this._rectangles},set:function(t){t&&(this._rectangles=t,this.setRectangle())},enumerable:!0,configurable:!0}),t.prototype.createHighlight=function(){this.createHighlightEvent.emit(),this.rectangle=void 0},t.prototype.deleteHighlight=function(){this.deleteHighlightEvent.emit()},t.prototype.addOrEditComment=function(){this.addOrEditCommentEvent.emit()},t.prototype.createBookmark=function(){this.createBookmarkEvent.emit(this.rectangle),this.rectangle=void 0},t.prototype.setRectangle=function(){var t=this.rectangles.reduce((function(t,e){return t.y<e.y?t:e}));switch(this.rectangle=P({},t),this.rotate){case 90:this.rectangle.width=t.height,this.rectangle.height=t.width,this.rectangle.x=this.pageWidth/this.zoom-t.y-t.height,this.rectangle.y=t.x;break;case 180:this.rectangle.x=this.pageWidth/this.zoom-t.x-t.width,this.rectangle.y=this.pageHeight/this.zoom-t.y-t.height;break;case 270:this.rectangle.width=t.height,this.rectangle.height=t.width,this.rectangle.x=t.y,this.rectangle.y=this.pageHeight/this.zoom-t.x-t.width}},t.prototype.popupTop=function(){var t=this.rectangle.y*this.zoom-this.defaultHeight;return t<=0?this.defaultHeight:t},t.prototype.popupLeft=function(){var t=(this.rectangle.x+this.rectangle.width/2)*this.zoom-this.defaultWidth/2;return t<=0?0:t>=this.pageWidth-this.defaultWidth?this.pageWidth-this.defaultWidth:t},t.decorators=[{type:e.Component,args:[{selector:"mv-ctx-toolbar",template:'<div class="toolbar" *ngIf="rectangle"\n [style.top.px]="top"\n [style.left.px]="left">\n <button *ngIf="canHighlight"\n type="button" title="Highlight"\n class="aui__toolbar-button aui__toolbar-button--comments contextual-btn leftButton aui__toolbar-button-highlight"\n (mousedown)="createHighlight()">\n <span>Highlight</span>\n </button>\n <button *ngIf="canDelete"\n type="button" title="Delete"\n class="aui__toolbar-button aui__toolbar-button--comments contextual-btn leftButton"\n (mousedown)="deleteHighlight()">\n <span>Remove</span>\n </button>\n <button *ngIf="canComment"\n type="button" title="Comment"\n class="aui__toolbar-button aui__toolbar-button--comments contextual-btn rightButton aui__toolbar-button-comment"\n (mousedown)="addOrEditComment()">\n <span>Comment</span></button>\n <button *ngIf="canBookmark"\n type="button" title="Bookmark"\n class="aui__toolbar-button aui__toolbar-button--comments contextual-btn rightButton aui__toolbar-button-bookmark"\n id="bookmarkButton"\n (mousedown)="createBookmark()">\n <span>Bookmark</span></button>\n <div class="arrow-down">\n <div class="inner-triangle"></div>\n </div>\n</div>\n'}]}],t.ctorParameters=function(){return[]},t.propDecorators={zoom:[{type:e.Input}],rotate:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}],canHighlight:[{type:e.Input}],canBookmark:[{type:e.Input}],canComment:[{type:e.Input}],canDelete:[{type:e.Input}],createHighlightEvent:[{type:e.Output}],deleteHighlightEvent:[{type:e.Output}],addOrEditCommentEvent:[{type:e.Output}],createBookmarkEvent:[{type:e.Output}],rectangles:[{type:e.Input}]},t}();var ro=function(){function t(){}return t.prototype.redrawComponents=function(t,e,n,o){var i,a=this;this.sortComponents(t,e,n,o).forEach((function(t){a.adjustIfOverlapping(t,i,o),i=t}))},t.prototype.sortComponents=function(t,e,n,o){var i=this;return t.sort((function(t,a){return t.rectTop=i.top(t._rectangle,e[t.page-1],n,o),a.rectTop=i.top(a._rectangle,e[a.page-1],n,o),i.processSort(t,a)}))},t.prototype.adjustIfOverlapping=function(t,e,n){if(e){var o=e.commentTop+this.height(e);t.commentTop<=o&&(t.rectTop=(o-t.totalPrevPagesHeight)/n)}},t.prototype.processSort=function(t,e){return this.onSameLine(t,e)?t.rectLeft>=e.rectLeft?1:-1:t.commentTop>=e.commentTop?1:-1},t.prototype.onSameLine=function(t,e){return 0===this.difference(t.commentTop,e.commentTop)},t.prototype.top=function(t,e,n,o){var i=e/o;switch(n){case 90:return t.x;case 180:return i-(t.y+t.height);case 270:return i-(t.x+t.width);default:return t.y}},t.prototype.height=function(t){return t.form.nativeElement.getBoundingClientRect().height},t.prototype.difference=function(t,e){return Math.abs(t-e)},t.decorators=[{type:e.Injectable}],t}(),so=function(){function t(t,e,n,o){this.store=t,this.commentService=e,this.renderService=n,this.toolbarEvents=o,this.pageHeights=[],this.subscriptions=[],this.clearSelection()}return t.prototype.ngOnInit=function(){var t=this;this.comments$=this.store.pipe(s.select(In)),this.annoEntities$=this.store.pipe(s.select(mn)),this.subscriptions.push(this.toolbarEvents.commentsPanelVisible.subscribe((function(e){t.redrawComments(),t.showCommentsPanel=e}))),this.subscriptions.push(this.toolbarEvents.rotateSubject.subscribe((function(e){return t.rotateDocument()})))},t.prototype.ngOnChanges=function(t){t.annotationSet&&this.commentService.setCommentSet(this),t.contentScrollTop&&this.container&&this.container.nativeElement.scrollTo(0,this.contentScrollTop)},t.prototype.ngOnDestroy=function(){this.subscriptions.length>0&&this.subscriptions.forEach((function(t){return t.unsubscribe()}))},t.prototype.onSelect=function(t){this.store.dispatch(new Lt(t))},t.prototype.onCommentDelete=function(t){var e=this.annotationSet.annotations.find((function(e){return e.id===t.annotationId})),n=P(P({},e),{comments:[]});this.onAnnotationUpdate(n),this.redrawComments()},t.prototype.redrawComments=function(){var t=this;setTimeout((function(){var e=t.commentComponents.map((function(t){return t}));t.renderService.redrawComponents(e,t.pageHeights,t.rotate,t.zoom)}),0)},t.prototype.rotateDocument=function(){this.panel&&(this.panel.nativeElement.style.height="0")},t.prototype.onCommentUpdate=function(t){var e=this.annotationSet.annotations.find((function(e){return e.id===t.comment.annotationId})),n=[t.comment],o=t.tags,i=P(P({},e),{comments:n,tags:o});this.onAnnotationUpdate(i)},t.prototype.onAnnotationUpdate=function(t){this.store.dispatch(new Bt(t))},t.prototype.onContainerClick=function(t){t.path&&t.path[0]===this.panel.nativeElement&&this.clearSelection()},t.prototype.clearSelection=function(){this.store.dispatch(new Lt({annotationId:"",editable:!1,selected:!1}))},t.prototype.allCommentsSaved=function(){this.commentService.allCommentsSaved()},t.decorators=[{type:e.Component,args:[{selector:"mv-comment-set",template:'<div #container [ngClass]="{\'comments\': showCommentsPanel}">\n <div #panel [ngClass]="{ \'comments-panel comment-container\': true, \'expanded\': showCommentsPanel }"\n [style.height.px]="height"\n (click)="onContainerClick($event)">\n <ng-container *ngFor="let comment of (comments$ | async); let i = index;">\n <mv-anno-comment\n [ngStyle]="showCommentsPanel ? {} : {\'display\':\'none\'}"\n #commentComponent\n (commentClick)="onSelect($event)"\n (delete)="onCommentDelete($event)"\n (updated)="onCommentUpdate($event)"\n (changes)="allCommentsSaved()"\n [zoom]="zoom"\n [rotate]="rotate"\n [index]="i"\n [page]="comment.page"\n [comment]="comment"\n [annotation]="(annoEntities$ | async)[comment.annotationId]"\n (renderComments)="redrawComments()">\n </mv-anno-comment>\n </ng-container>\n </div>\n</div>\n'}]}],t.ctorParameters=function(){return[{type:s.Store},{type:rn},{type:ro},{type:W}]},t.propDecorators={annotationSet:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],height:[{type:e.Input}],pageHeights:[{type:e.Input}],contentScrollTop:[{type:e.Input}],container:[{type:e.ViewChild,args:["container",{static:!1}]}],panel:[{type:e.ViewChild,args:["panel",{static:!1}]}],commentComponents:[{type:e.ViewChildren,args:["commentComponent"]}]},t}();var co=function(){function t(t){this.el=t}return t.prototype.ngAfterContentChecked=function(){this.adjustHeight()},t.prototype.onMouseDown=function(){this.adjustHeight()},t.prototype.adjustHeight=function(){var t=this.el.nativeElement;t.style.overflow="hidden",t.style.height="auto",t.style.height=t.scrollHeight-5+"px"},t.decorators=[{type:e.Directive,args:[{selector:"[mvTextAreaAutoExpand]"}]}],t.ctorParameters=function(){return[{type:e.ElementRef}]},t.propDecorators={onMouseDown:[{type:e.HostListener,args:["input"]}]},t}();var lo=function(){function t(t,e,n,o){this.store=t,this.printService=e,this.toolbarEvents=n,this.fb=o,this.showFilters=!1,this.hasFilter=!1}return t.prototype.ngOnInit=function(){this.filtersFg=this.fb.group({dateRangeFrom:new o.FormGroup({day:new o.FormControl(""),month:new o.FormControl(""),year:new o.FormControl("")}),dateRangeTo:new o.FormGroup({day:new o.FormControl(""),month:new o.FormControl(""),year:new o.FormControl("")}),tagFilters:this.fb.group({})}),this.comments$=this.store.pipe(s.select(Pn)),this.buildCheckBoxForm()},t.prototype.ngAfterViewInit=function(){this.container.nativeElement.focus()},t.prototype.buildCheckBoxForm=function(){var t=this;this.filtersFg.reset();var e=this.filtersFg.get("tagFilters"),n=this.store.pipe(s.select(Cn));this.allTags$=this.store.pipe(s.select(dn)),this.$subscriptions=a.combineLatest([this.allTags$,n]).subscribe((function(n){var i=B(n,2),a=i[0],r=i[1];t.hasFilter=r.hasFilter,a.forEach((function(t){var n=!(!r.filters.tagFilters||!r.filters.tagFilters.hasOwnProperty(t.key))&&r.filters.tagFilters[t.key];e.addControl(t.key,new o.FormControl(n))})),t.filtersFg.updateValueAndValidity()}))},t.prototype.onClearFilters=function(){this.store.dispatch(new Vt),this.buildCheckBoxForm()},t.prototype.onFilter=function(){var t=this.filtersFg.value,e=t.dateRangeFrom.year&&t.dateRangeFrom.month&&t.dateRangeFrom.day,n=t.dateRangeTo.year&&t.dateRangeTo.month&&t.dateRangeTo.day,o=e?new Date(t.dateRangeFrom.year,t.dateRangeFrom.month-1,t.dateRangeFrom.day).getTime():null,i=n?new Date(t.dateRangeTo.year,t.dateRangeTo.month-1,t.dateRangeTo.day).getTime():null;this.store.dispatch(new $t(P(P({},t),{dateRangeFrom:o,dateRangeTo:i})))},t.prototype.onFiltersToggle=function(){this.showFilters=!this.showFilters},t.prototype.onClose=function(){this.toolbarEvents.toggleCommentsSummary(!1)},t.prototype.onPrint=function(){this.printService.printElementNatively(this.commentsTable.nativeElement,1e3,900)},t.prototype.navigateToPage=function(t){"pdf"===this.contentType&&this.toolbarEvents.setPage(t),this.toolbarEvents.toggleCommentsSummary(!1),this.toolbarEvents.toggleCommentsPanel(!0)},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.decorators=[{type:e.Component,args:[{selector:"mv-comments-summary",template:'<div id="modal-background" class="modal" (click)="onClose()">\n <div #outerContainer id="modal" class="modal-content govuk-width-container clearfix" (click)="$event.stopPropagation()" cdkTrapFocus tabindex="0">\n <div id="comment-container" class="comment-container" #commentContainer>\n <h2 class="govuk-heading-m">{{ title }}</h2>\n <ng-container *ngIf="(comments$ | async) as comments">\n <ng-container *ngIf="comments.length">\n <button type="submit" class="govuk-button govuk-!-margin-right-1" (click)="onFiltersToggle()">\n {{ !showFilters ? \'Show Filters\' : \'Hide Filters\'}}\n </button>\n <button type="submit" class="govuk-button govuk-button--secondary" (click)="onClearFilters()" *ngIf="hasFilter">\n Clear Filters\n </button>\n <ng-container *ngIf="showFilters">\n <form [formGroup]="filtersFg" (ngSubmit)="onFilter()" >\n <div class="dates">\n <div class="dates__from">\n <mv-gov-uk-date\n [config]="{id: \'dateRangeFrom\', legend: \'From\'}"\n [formGroup]="filtersFg.controls[\'dateRangeFrom\']"\n [errorMessage]="\'test\'"\n ></mv-gov-uk-date>\n </div>\n <div class="dates__to">\n <mv-gov-uk-date\n [config]="{id: \'dateRangeTo\', legend: \'To\'}"\n [formGroup]="filtersFg.controls[\'dateRangeTo\']"\n [errorMessage]="\'test\'"\n ></mv-gov-uk-date>\n </div>\n <div class="dates__tags">\n <mv-gov-uk-fieldset\n [config]="{legend: \'Tags\', classes: \'govuk-label--m\', id: \'filters\'}"\n [isHeading]="false">\n <div class="govuk-checkboxes--scroll" [formGroup]="filtersFg.controls[\'tagFilters\']">\n <div class="govuk-checkboxes govuk-checkboxes--small">\n <div class="govuk-checkboxes__item" *ngFor="let item of (allTags$ | async)">\n <input [formControlName]="item.key" class="govuk-checkboxes__input" [value]="false" type="checkbox">\n <label class="govuk-label govuk-checkboxes__label">\n {{ item.key | unsnake}} ({{item.length}})\n </label>\n </div>\n </div>\n </div>\n </mv-gov-uk-fieldset>\n </div>\n <div class="dates__cta">\n <button type="submit" class="govuk-button">\n Filter comments\n </button>\n </div>\n </div>\n </form>\n </ng-container>\n <ng-container *ngIf="comments[0]">\n <ngx-datatable\n [rows]="comments"\n rowHeight="auto"\n headerHeight="auto"\n [columnMode]="\'flex\'"\n [sorts]="[{ prop: \'date\', dir: \'desc\' }]">\n <ngx-datatable-column name="User" [flexGrow]="1" [sortable]="false"></ngx-datatable-column>\n <ngx-datatable-column name="Page" [flexGrow]="1">\n <ng-template ngx-datatable-cell-template let-value="value">\n <a [routerLink]="" class="comment-summary_pages" (click)="navigateToPage(value)">{{value}}</a>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column name="Date" [flexGrow]="1"></ngx-datatable-column>\n <ngx-datatable-column name="Comment" [flexGrow]="3" [sortable]="false"></ngx-datatable-column>\n <ngx-datatable-column name="Tags" [flexGrow]="1" [sortable]="false">\n <ng-template ngx-datatable-cell-template let-value="value">\n <span class="hmcts-badge" *ngFor="let tag of value">{{tag.label}}</span>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </ng-container>\n </ng-container>\n <ng-container *ngIf="!comments[0]">\n <h3 class="govuk-heading-s" >No comments available. Select text to add a highlight or comment.</h3>\n </ng-container>\n </ng-container>\n </div>\n\n <div class="button-container">\n <button (click)="onPrint()" class="govuk-button govuk-button--secondary">Print</button>\n <button id="modal-close-button" (click)="onClose()" class="govuk-button">Close</button>\n </div>\n </div>\n</div>\n'}]}],t.ctorParameters=function(){return[{type:s.Store},{type:G},{type:W},{type:o.FormBuilder}]},t.propDecorators={title:[{type:e.Input}],contentType:[{type:e.Input}],container:[{type:e.ViewChild,args:["outerContainer",{static:!1}]}],commentsTable:[{type:e.ViewChild,args:["commentContainer",{static:!1}]}]},t}();var uo=function(){function t(t,n){this.toolbarEvents=t,this.highlightService=n,this.saveSelection=new e.EventEmitter,this.drawStartX=-1,this.drawStartY=-1,this.backgroundColor="none",this.subscriptions=[]}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions=[this.toolbarEvents.drawModeSubject.subscribe((function(e){t.defaultHeight=e?"100%":"0px",t.defaultWidth=e?"100%":"0px"}))]},t.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(t){t.unsubscribe()}))},t.prototype.initHighlight=function(t){var e=t.offsetX,n=t.offsetY;switch(this.position="absolute",this.backgroundColor="yellow",this.drawStartX=e,this.drawStartY=n,this.display="block",this.height=50,this.width=50,this.top=this.drawStartY,this.left=this.drawStartX,this.rotate){case 90:this.top=this.drawStartY-this.height;break;case 180:this.top=this.drawStartY-this.height,this.left=this.drawStartX-this.width;break;case 270:this.left=this.drawStartX-this.width}},t.prototype.updateHighlight=function(t){var e=t.offsetX,n=t.offsetY;this.drawStartX>0&&this.drawStartY>0&&(this.height=Math.abs(n-this.drawStartY),this.width=Math.abs(e-this.drawStartX),this.top=Math.min(n,this.drawStartY),this.left=Math.min(e,this.drawStartX))},t.prototype.createHighlight=function(){if(this.height/this.zoom>5||this.width/this.zoom>5){var t=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,this.height,this.width,this.top,this.left,this.rotate,this.zoom);t=P({id:E()},t),this.saveSelection.emit({rectangles:[t],page:this.page}),this.resetHighlight()}},t.prototype.resetHighlight=function(){this.drawStartX=-1,this.drawStartY=-1,this.display="none",this.width=0,this.height=0},t.decorators=[{type:e.Component,args:[{selector:"mv-box-highlight-create",template:'<div [style.height]="defaultHeight"\n [style.width]="defaultWidth"\n (mousedown)="initHighlight($event)"\n (mousemove)="updateHighlight($event)"\n (mouseup)="createHighlight()">\n <div #boxHighlight\n class="box-highlight"\n [style.display]="display"\n [style.position]="position"\n [style.background-color]="backgroundColor"\n [style.height]="height ? height + \'px\' : \'100%\'"\n [style.width]="width ? width + \'px\' : \'100%\'"\n [style.top]="top + \'px\'"\n [style.left]="left + \'px\'">\n </div>\n</div>\n'}]}],t.ctorParameters=function(){return[{type:W},{type:eo}]},t.propDecorators={page:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}],rotate:[{type:e.Input}],zoom:[{type:e.Input}],container:[{type:e.Input}],saveSelection:[{type:e.Output}],highlight:[{type:e.ViewChild,args:["boxHighlight",{static:!1}]}]},t}();var po=function(){function t(t,n){this.store=t,this.toolbarEvents=n,this.showCommentSummaryDialog=new e.EventEmitter,this.tabs=[],this.tabSelected=""}return t.prototype.ngOnInit=function(){var t=this,e=this.store.pipe(s.select(ln)),n=this.store.pipe(s.select(xn));this.$subscriptions=a.combineLatest([e,n]).subscribe((function(e){var n=B(e,2),o=n[0],i=n[1];t.navigationList=i,t.tabs=t.navigationList.length>0?[{label:"comments"},{label:"filter"},{label:"search"}]:[{label:"comments"}],t.isFiltered=!o.length,t.tabs=A(t.tabs).map((function(e){return t.isFiltered||"filter"!==e.label?P(P({},e),{isFiltered:!1}):P(P({},e),{isFiltered:!0})}))}))},t.prototype.toggleCommentsSummary=function(){this.showCommentSummaryDialog.emit()},t.prototype.selectTab=function(t){this.tabSelected=t!==this.tabSelected?t:void 0},t.prototype.toggleCommentsPanel=function(){this.toolbarEvents.toggleCommentsPanel(!this.toolbarEvents.commentsPanelVisible.getValue())},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.decorators=[{type:e.Component,args:[{selector:"mv-comment-set-header",template:'<div class="govuk-tabs commentSummaryHeader" [ngClass]="{\'icp-mode\': toolbarEvents.icp.enabled | async}" data-module="govuk-tabs">\n <ul class="govuk-tabs__list">\n <li *ngFor="let tab of tabs; let i = index" class="govuk-tabs__list-item govuk-tabs__list-item"\n [ngClass]="{\'govuk-tabs__list-item--selected\': tabSelected === tab.label}">\n <a id="commentSubPane{{ i }}" (click)="selectTab(tab.label)" [routerLink]="" [ngClass]="{\'govuk-tabs__list-item--filtered\': tab.isFiltered}"\n class="govuk-tabs__tab">\n {{ tab.label | titlecase }}\n </a>\n </li>\n <li>\n <button id="mvCloseBtn" #mvCloseBtn class="mv-button commentSummaryHeader-button--close"\n title="Close Comments" (click)="toggleCommentsPanel()">\n </button>\n </li>\n </ul>\n <div class="govuk-tabs__panel" [hidden]="!tabSelected">\n <ng-container *ngIf="tabSelected === \'comments\'">\n <div style="width: 100%">\n <div class="hmcts-banner" *ngIf="navigationList?.length === 0">\n <svg class="hmcts-banner__icon" fill="currentColor" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" height="25" width="25">\n <path d="M13.7,18.5h-2.4v-2.4h2.4V18.5z M12.5,13.7c-0.7,0-1.2-0.5-1.2-1.2V7.7c0-0.7,0.5-1.2,1.2-1.2s1.2,0.5,1.2,1.2v4.8\nC13.7,13.2,13.2,13.7,12.5,13.7z M12.5,0.5c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S19.1,0.5,12.5,0.5z" /></svg>\n <div class="hmcts-banner__message">\n <span class="hmcts-banner__assistive">information</span>\n Select text to add a comment or highlight.\n </div>\n </div>\n <button type="button" class="govuk-button"\n id="commentSummary" tabindex="0"\n data-l10n-id="commentSummary"\n title="Open collate summary"\n (click)="toggleCommentsSummary()">Collate comments</button>\n </div>\n <ng-container *ngIf="navigationList?.length > 0">\n <mv-comments-navigate\n [annotationList]="navigationList">\n </mv-comments-navigate>\n </ng-container>\n <p class="aui-comment__private-text">\n <span class="aui-comment__private">private</span>\n All comments can only be seen by you\n </p>\n </ng-container>\n <div [hidden]="tabSelected !== \'filter\'">\n <div class="govuk-tabs__panel--container">\n <mv-comment-filter></mv-comment-filter>\n <mv-comments-navigate\n *ngIf="navigationList?.length > 0"\n [annotationList]="navigationList">\n </mv-comments-navigate>\n </div>\n </div>\n\n <div [hidden]="tabSelected !== \'search\'">\n <mv-comment-search [annotations]="navigationList"></mv-comment-search>\n </div>\n </div>\n</div>\n',encapsulation:e.ViewEncapsulation.None}]}],t.ctorParameters=function(){return[{type:s.Store},{type:W}]},t.propDecorators={showCommentSummary:[{type:e.Input}],showCommentSummaryDialog:[{type:e.Output}]},t}();var ho=function(){function t(t){this.store=t,this.searchResults=[],this.searchIndex=0}return t.prototype.ngAfterViewInit=function(){this.searchInput&&this.searchInput.nativeElement.focus()},t.prototype.ngOnDestroy=function(){var t=this;setTimeout((function(){t.store.dispatch(new Ht(""))}),250)},t.prototype.searchComments=function(t){var e=this;this.clearSearch(),t.length>2&&(this.searchString=t,this.searchResults=this.annotations.filter((function(t){return t.comments.length>0})).filter((function(t){return t.comments[0].content.toLowerCase().includes(e.searchString.toLowerCase())})),this.searchResults.length>0&&this.store.dispatch(new Ht(t)))},t.prototype.clearSearch=function(){this.searchString=void 0,this.searchResults=[],this.searchIndex=0,this.store.dispatch(new Ht(""))},t.decorators=[{type:e.Component,args:[{selector:"mv-comment-search",template:'<input #searchInput type="text"\n class="govuk-input comment-search__item"\n id="search-comments-input" name="searchString"\n aria-label="search comments input" [ngModel]="searchString">\n<button type="button"\n [class.govuk-button--disabled]="searchInput?.value.length <= 2"\n class="govuk-button comment-search__item"\n (click)="searchComments(searchInput.value.trim())">Search</button>\n<ng-container *ngIf="searchResults.length > 0">\n <mv-comments-navigate [annotationList]="searchResults"></mv-comments-navigate>\n</ng-container>\n<ng-container *ngIf="searchString && searchResults?.length == 0">\n <p class="comment-search__item">\n No matches have been found\n </p>\n</ng-container>\n',encapsulation:e.ViewEncapsulation.None}]}],t.ctorParameters=function(){return[{type:s.Store}]},t.propDecorators={annotations:[{type:e.Input}],searchInput:[{type:e.ViewChild,args:["searchInput",{static:!1}]}]},t}();var mo=function(){function t(t){this.element=t}return t.prototype.ngAfterViewChecked=function(){this.textToHighlight&&this.highlightInputText(this.textToHighlight)},t.prototype.highlightInputText=function(t){this.resetHighlight(),this.textToHighlight=t;var e=new RegExp(t,"gi"),n=this.element.nativeElement;n.innerHTML.match(e)&&(n.innerHTML=n.innerHTML.replace(e,this.highlightPattern("$&"))),this.textToHighlight=void 0},t.prototype.resetHighlight=function(){for(var t=this.element.nativeElement,e=new RegExp(this.highlightPattern("(.*?)"),"gi");t.innerHTML.match(e);){var n=e.exec(t.innerHTML);n&&(t.innerHTML=t.innerHTML.replace(n[0],n[1]))}},t.prototype.highlightPattern=function(t){return'<span class="mvTextHighlight">'+t+"</span>"},t.decorators=[{type:e.Directive,args:[{selector:"[mvTextHighlight]"}]}],t.ctorParameters=function(){return[{type:e.ElementRef}]},t.propDecorators={textToHighlight:[{type:e.Input}]},t}();var go=function(){function t(t){var e=this;this.tagsServices=t,this.validators=[this.minLength,this.maxLength20],this.errorMessages={minLength:"Minimum of 2 characters",maxLength20:"Maximum of 20 characters"},this.requestAutocompleteItems=function(t){return e.tagsServices.getAllTags(e.userId)}}return t.prototype.onUpdateTags=function(t){this.tagsServices.updateTagItems(t,this.annoId)},t.prototype.minLength=function(t){return t.value.length<2?{minLength:!0}:null},t.prototype.maxLength20=function(t){return t.value.length>=20?{maxLength20:!0}:null},t.decorators=[{type:e.Component,args:[{selector:"mv-tags",template:'<div class="tags">\n <tag-input\n *ngIf="editable" class="tags__edit"\n [maxItems]="10"\n [(ngModel)]="tagItems"\n (ngModelChange)="onUpdateTags($event)"\n [ngModelOptions]="{standalone:true}"\n [placeholder]="\'Add tag\'"\n [displayBy]="\'label\'"\n [identifyBy]="\'name\'"\n [onTextChangeDebounce]="250"\n [secondaryPlaceholder]="\'Search or add tags\'"\n [validators]="validators"\n [errorMessages]="errorMessages"\n [onlyFromAutocomplete]="false">\n <tag-input-dropdown\n [autocompleteObservable]="requestAutocompleteItems"\n [displayBy]="\'label\'"\n [identifyBy]="\'name\'"\n [zIndex]="10000"\n [minimumTextLength]="2">\n <ng-template let-item="item" let-index="index">\n {{ item.label }}\n </ng-template>\n </tag-input-dropdown>\n </tag-input>\n\n <div class="tags__renderer" *ngIf="!editable && (tagItems && tagItems.length)">\n <span *ngFor="let tag of tagItems" class="tags__item hmcts-badge">\n {{tag.label}}\n </span>\n </div>\n</div>\n\n',encapsulation:e.ViewEncapsulation.None}]}],t.ctorParameters=function(){return[{type:oo}]},t.propDecorators={tagItems:[{type:e.Input}],userId:[{type:e.Input}],editable:[{type:e.Input}],annoId:[{type:e.Input}]},t}();var vo=function(){function t(t,e){this.store=t,this.toolbarEvents=e,this.autoSelect=!1,this.navigationList=[],this.index=0}return t.prototype.ngOnChanges=function(t){t.annotationList&&this.initNavigationList()},t.prototype.initNavigationList=function(){var t=this;this.index=0,this.navigationList=A(this.annotationList||[]).map((function(e){return{content:e.comments[0].content,annotationId:e.id,page:e.page,rectangle:t.upperRectangle(e.rectangles)}})).sort(this.sortComments),this.autoSelect&&(this.toolbarEvents.setPage(Number.parseInt(this.navigationList[0].page,0)),this.store.dispatch(new Lt({annotationId:this.navigationList[0].annotationId,editable:!1,selected:!0})))},t.prototype.sortComments=function(t,e){if(t.page!==e.page)return t.page-e.page;var n=t.rectangle,o=e.rectangle;return n.y!==o.y?n.y-o.y:n.x-o.x},t.prototype.nextItem=function(){this.index+=1,this.index===this.annotationList.length&&(this.index=0),this.toolbarEvents.setPage(Number.parseInt(this.navigationList[this.index].page,0)),this.store.dispatch(new Lt({annotationId:this.navigationList[this.index].annotationId,editable:!1,selected:!0}))},t.prototype.prevItem=function(){this.index-=1,this.index<0&&(this.index=this.navigationList.length-1),this.toolbarEvents.setPage(Number.parseInt(this.navigationList[this.index].page,0)),this.store.dispatch(new Lt({annotationId:this.navigationList[this.index].annotationId,editable:!1,selected:!0}))},t.prototype.upperRectangle=function(t){return A(t).sort((function(t,e){return t.y-e.y})),{x:t[0].x,y:t[0].y}},t.decorators=[{type:e.Component,args:[{selector:"mv-comments-navigate",template:'<p class="comment-search">\n <span class="comment-search__item">\n Showing {{ index + 1 }} of {{ navigationList.length }}\n </span>\n <a [routerLink]=""\n class="comment-search__item"\n title="Previous comment"\n (click)="prevItem()">Prev</a>\n <a [routerLink]=""\n class="comment-search__item"\n title="Next comment\'"\n (click)="nextItem()">Next</a>\n</p>\n',encapsulation:e.ViewEncapsulation.None}]}],t.ctorParameters=function(){return[{type:s.Store},{type:W}]},t.propDecorators={annotationList:[{type:e.Input}],autoSelect:[{type:e.Input}]},t}();var fo=function(){function t(t,e){this.store=t,this.fb=e,this.isPreview=!1}return t.prototype.ngOnInit=function(){var t=this;this.tagGroup=this.fb.group({tagFilters:this.fb.group({})}),this.filter$=this.store.pipe(s.select(ln)),this.$subscriptions=this.tagGroup.valueChanges.pipe(r.auditTime(5)).subscribe((function(e){var n=e.tagFilters;t.store.dispatch(new mt(n))})),this.buildFrom()},t.prototype.buildFrom=function(){var t=this,e=this.tagGroup.get("tagFilters");this.allTags$=this.store.pipe(s.select(dn)).pipe(r.tap((function(n){t.tagGroup.reset(),n.forEach((function(t){e.addControl(t.key,new o.FormControl(!1))}))})))},t.prototype.onClearFilters=function(){this.tagGroup.reset(),this.store.dispatch(new gt)},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.prototype.onRemoveFilter=function(t){this.tagGroup.get("tagFilters").controls[t].setValue(!1)},t.prototype.onToggleFilterView=function(){this.isPreview=!this.isPreview},t.decorators=[{type:e.Component,args:[{selector:"mv-comment-filter",template:'<div class="comment-filter">\n <div class="hmcts-filter__content">\n <div class="hmcts-filter__toggle-filters">\n <p class="hmcts-filter__toggle-filters-link"\n [ngClass]="{\'govuk-accordion__section--expanded\': isPreview}"\n (click)="onToggleFilterView()"><strong >Filter options</strong><span class="govuk-accordion__icon"></span></p>\n </div>\n\n <ng-container *ngIf="(filter$ | async) as filters">\n <div class="hmcts-filter__selected-heading" *ngIf="filters.length">\n <div class="hmcts-filter__heading-action">\n <p><a (click)="onClearFilters()"\n class="govuk-link govuk-link--no-visited-state"\n [routerLink]="">Clear filters</a></p>\n </div>\n </div>\n\n <h4 class="govuk-heading-s govuk-!-margin-bottom-0" *ngIf="filters.length">Tag filters</h4>\n\n <ul class="hmcts-filter-tags" *ngIf="filters.length">\n <li *ngFor="let tagName of filters">\n <a class="hmcts-filter__tag" [routerLink]="" (click)="onRemoveFilter(tagName)">\n <span class="govuk-visually-hidden">Remove this filter</span>{{tagName | unsnake}}</a>\n </li>\n </ul>\n </ng-container >\n\n <div class="hmcts-filter__options" [ngClass]="{\'isVisible\': isPreview}">\n <div class="govuk-form-group">\n <label class="govuk-label govuk-label--s" for="keywords">\n Search Tags\n </label>\n <input class="govuk-input" id="keywords" name="keywords" type="text" [(ngModel)]="searchValue">\n </div>\n\n <div class="govuk-form-group">\n <div [formGroup]="tagGroup">\n <fieldset class="govuk-fieldset" formGroupName="tagFilters">\n <legend class="govuk-fieldset__legend govuk-fieldset__legend--s">\n Tags\n </legend>\n <div class="govuk-checkboxes--scroll">\n <div class="govuk-checkboxes govuk-checkboxes--small">\n <div class="govuk-checkboxes__item" *ngFor="let item of (allTags$ | async) | filter: searchValue: \'key\'">\n <input [formControlName]="item.key" [id]="item.key" class="govuk-checkboxes__input" [value]="false"\n [attr.aria-describedby]="item.key" type="checkbox">\n <label class="govuk-label govuk-checkboxes__label" [for]="item.key">\n {{ item.key | unsnake}} ({{item.length}})\n </label>\n </div>\n </div>\n </div>\n </fieldset>\n </div>\n </div>\n </div>\n\n\n </div>\n</div>\n',encapsulation:e.ViewEncapsulation.None}]}],t.ctorParameters=function(){return[{type:s.Store},{type:o.FormBuilder}]},t}();var bo=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return function(t,e){function n(){this.constructor=t}I(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(n,t),n.prototype.transform=function(e,n,o){void 0===n&&(n="mediumDate"),void 0===o&&(o="Europe/London");var i=d(e).tz(o).format("Z");return t.prototype.transform.call(this,e,n,i)},n.decorators=[{type:e.Pipe,args:[{name:"momentDate"}]}],n}(n.DatePipe),yo=function(){function t(t){this.httpClient=t,this.ANNOTATIONS_API="/em-anno"}return t.prototype.getBookmarks=function(t){return this.httpClient.get(this.ANNOTATIONS_API+"/"+t+"/bookmarks",{observe:"response",withCredentials:!0})},t.prototype.createBookmark=function(t){return this.httpClient.post(this.ANNOTATIONS_API+"/bookmarks",t,{observe:"response",withCredentials:!0}).pipe(r.map((function(t){return t.body})))},t.prototype.updateBookmark=function(t){return this.httpClient.put(this.ANNOTATIONS_API+"/bookmarks",t,{observe:"response",withCredentials:!0}).pipe(r.map((function(t){return t.body})))},t.prototype.updateMultipleBookmarks=function(t){return this.httpClient.put(this.ANNOTATIONS_API+"/bookmarks_multiple",t,{observe:"response",withCredentials:!0}).pipe(r.map((function(t){return t.body})))},t.prototype.deleteBookmark=function(t){return this.httpClient.delete(this.ANNOTATIONS_API+"/bookmarks/"+t,{observe:"response",withCredentials:!0}).pipe(r.map((function(t){return t.body})))},t.prototype.deleteMultipleBookmarks=function(t){return this.httpClient.request("DELETE",this.ANNOTATIONS_API+"/bookmarks_multiple",{body:t,observe:"response",withCredentials:!0}).pipe(r.map((function(t){return t.body})))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:i.HttpClient}]},t}();var wo=function(){function t(){}return t.prototype.transform=function(t,e,n){return t?e?t.filter((function(t){return!!t&&(t[n]?t[n].toLowerCase().includes(e.toLowerCase()):t.toLowerCase().includes(e.toLowerCase()))})):t:[]},t.decorators=[{type:e.Pipe,args:[{name:"filter"}]}],t}(),ko=function(){function t(){}return t.prototype.transform=function(t){return t.split("_").join(" ")},t.decorators=[{type:e.Pipe,args:[{name:"unsnake"}]}],t}(),So=function(){function t(){}return t.decorators=[{type:e.Component,args:[{selector:"mv-gov-uk-date",template:'<div class="govuk-form-group" [ngClass]="{\'govuk-form-group--error\': errorMessage?.isInvalid}" [formGroup]="formGroup">\n <mv-gov-uk-fieldset\n [config]="{legend: config.legend, classes: \'govuk-label--m\', id: config.id, hint: \' For example, 12 11 2007\'}"\n [isHeading]="false"\n [errorMessage]="errorMessage">\n <mv-gov-uk-error-message\n [config]="{id: \'passport\'}"\n *ngIf="errorMessage"\n [errorMessage]="errorMessage">\n </mv-gov-uk-error-message>\n\n <div class="govuk-date-input" [id]="config.id+\'-date\'">\n <div class="govuk-date-input__item">\n <div class="govuk-form-group">\n <mv-gov-label\n [config]="{label: \'Day\', name: config.id, id: config.id+\'-day\', classes: \'govuk-date-input__label\'}">\n </mv-gov-label>\n <input class="govuk-input govuk-date-input__input govuk-input--width-2"\n [ngClass]="{\'govuk-input--error\': errorMessage?.isInvalid}"\n [id]="config.id"\n [name]="config.id+\'-day\'" type="number" value="" pattern="[0-9]*"\n [formControlName]="\'day\'">\n </div>\n </div>\n <div class="govuk-date-input__item">\n <div class="govuk-form-group">\n <mv-gov-label\n [config]="{label: \'Month\', name: config.id+\'-month\', id: config.id+\'-month\', classes: \'govuk-date-input__label\'}">\n </mv-gov-label>\n <input class="govuk-input govuk-date-input__input govuk-input--width-2"\n [ngClass]="{\'govuk-input--error\': errorMessage?.isInvalid}"\n [id]="config.id+\'-month\'"\n [name]="config.id+\'-month\'" type="number" value="" pattern="[0-9]*"\n [formControlName]="\'month\'">\n </div>\n </div>\n <div class="govuk-date-input__item">\n <div class="govuk-form-group">\n <mv-gov-label\n [config]="{label: \'Year\', name: config.id+\'-year\', id: config.id+\'-year\', classes: \'govuk-date-input__label\'}">\n </mv-gov-label>\n <input class="govuk-input govuk-date-input__input govuk-input--width-4"\n [ngClass]="{\'govuk-input--error\': errorMessage?.isInvalid}"\n [id]="config.id+\'-year\'"\n [name]="config.id+\'-year\'" type="number" value="" pattern="[0-9]*"\n [formControlName]="\'year\'">\n </div>\n </div>\n </div>\n </mv-gov-uk-fieldset>\n</div>\n'}]}],t.propDecorators={config:[{type:e.Input}],errorMessage:[{type:e.Input}],formGroup:[{type:e.Input}]},t}();var Co=function(){function t(){}return t.decorators=[{type:e.Component,args:[{selector:" mv-gov-uk-error-message",template:'\n <span class="govuk-error-message" [id]="config.id + \'-error\'" *ngFor="let message of errorMessage?.messages">\n <span class="govuk-visually-hidden">Error:</span>{{message}}\n </span>\n '}]}],t.ctorParameters=function(){return[]},t.propDecorators={config:[{type:e.Input}],errorMessage:[{type:e.Input}]},t}();var Eo=function(){function t(){}return t.setDescribedBy=function(t,e){return t&&t&&t.isInvalid?e.hint?e.id+"-hint "+e.id+"-error":e.id+"-error":e.hint?e.id+"-hint":null},t}(),Io=function(){function t(){}return t.prototype.setDescribedBy=function(){return Eo.setDescribedBy(this.errorMessage,this.config)},t.decorators=[{type:e.Component,args:[{selector:"mv-gov-uk-fieldset",template:'\n <fieldset class="govuk-fieldset" [attr.aria-describedby]="setDescribedBy()">\n <legend [class]="config.classes + \' govuk-fieldset__legend\'" *ngIf="!isHeading">\n {{config.legend}}\n </legend>\n\n <legend [class]="config.classes + \' govuk-fieldset__legend\'" *ngIf="isHeading">\n <h1>{{config.legend}}</h1>\n </legend>\n\n <span [id]="config.id+\'-hint\'" class="govuk-hint" *ngIf="config.hint">\n {{config.hint}}\n </span>\n <ng-content></ng-content>\n </fieldset>\n '}]}],t.propDecorators={config:[{type:e.Input}],isHeading:[{type:e.Input}],errorMessage:[{type:e.Input}]},t}();var Po=function(){function t(){}return t.decorators=[{type:e.Component,args:[{selector:"mv-gov-label",template:'<h1 *ngIf="config.isPageHeading else noHeading">\n <label *ngIf="config.label" [class]="config.classes + \' govuk-label\'"\n [for]="config.id" [innerHTML]="config.label">\n </label>\n </h1>\n <ng-template #noHeading>\n <label *ngIf="config.label" [class]="config.classes + \' govuk-label\'"\n [for]="config.id" [innerHTML]="config.label">\n </label>\n </ng-template>\n '}]}],t.ctorParameters=function(){return[]},t.propDecorators={config:[{type:e.Input}]},t}();var xo=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,o.FormsModule,o.ReactiveFormsModule,n.CommonModule,g.RouterModule],declarations:[So,Co,Io,Po],exports:[So,Co,Io,Po]}]}],t}(),Do=s.createSelector(ze,(function(t){return t.bookmarks})),_o=s.createSelector(Do,(function(t){return t.bookmarkPageEntities})),Ro=s.createSelector(Do,(function(t){return t.bookmarkEntities})),To=s.createSelector(Ro,(function(t){return function(t){var e=JSON.parse(JSON.stringify(t));return we(e),Object.keys(e).reduce((function(t,n){var o=e[n];if(o.parent){var i=e[o.parent];i.children||(i.children=[]),i.children[o.index]=o}else t[o.index]=o;return t}),[])}(t)})),Bo=s.createSelector(Do,(function(t){return t.editableBookmark})),Ao=s.createSelector(To,Ge,Ze,qe,(function(t,e,n,o){return{pageNumber:n.pageNumber-1,xCoordinate:n.left,yCoordinate:o[n.pageNumber].styles.height-n.top*o[n.pageNumber].viewportScale,previous:t.length>0?t[t.length-1].id:void 0,documentId:e}})),Oo=s.createSelector(qe,_o,(function(t,e){if(t&&e){var n=[];return Object.keys(t).forEach((function(o){var i=Number(o)-1,a=e[i];n.push({bookmark:a||[],styles:t[o].styles})})),n}})),Mo=function(){function t(t,e,n,o){this.store=t,this.highlightService=e,this.toolbarEvents=n,this.viewerEvents=o,this.pages=[],this.drawMode=!1}return t.prototype.ngOnInit=function(){var t=this;this.$subscriptions=this.store.pipe(s.select(qe)).subscribe((function(e){return t.pages=Object.values(e)})),this.annoPages$=this.store.pipe(s.select(wn)),this.$subscriptions.add(this.toolbarEvents.drawModeSubject.subscribe((function(e){return t.drawMode=e}))).add(this.viewerEvents.textHighlight.subscribe((function(e){return t.showContextToolbar(e)}))).add(this.viewerEvents.ctxToolbarCleared.subscribe((function(){return t.clearContextToolbar()})))},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.prototype.showContextToolbar=function(t){this.highlightPage=t.page,this.rectangles=t.rectangles,this.rectangles&&this.toolbarEvents.highlightModeSubject.next(!1)},t.prototype.clearContextToolbar=function(){this.rectangles=void 0},t.prototype.createHighlight=function(){this.highlightService.saveAnnotation(this.rectangles,this.highlightPage),this.highlightService.resetHighlight(),this.rectangles=void 0},t.prototype.createBookmark=function(t){var e=this;this.store.pipe(s.select(Ao),r.take(1)).subscribe((function(n){var o=window.getSelection().toString();e.store.dispatch(new re(P(P({},n),{name:o.length>0?o.substr(0,30):"new bookmark",id:E(),pageNumber:e.highlightPage-1,xCoordinate:t.x,yCoordinate:t.y}))),e.toolbarEvents.toggleSideBar(!0),e.highlightService.resetHighlight(),e.rectangles=void 0}))},t.prototype.saveAnnotation=function(t){var e=t.rectangles,n=t.page;this.highlightService.saveAnnotation(e,n),this.toolbarEvents.drawModeSubject.next(!1)},t.decorators=[{type:e.Component,args:[{selector:"mv-metadata-layer",template:'<div class="pageContainer">\n <div *ngFor="let page of pages; index as i"\n class="pageContainer__page"\n [ngStyle]="{\n \'width.px\': page.styles.width,\n \'height.px\': page.styles.height\n }"\n [ngClass]="{ \'pageContainer__page--draw\' : drawMode }">\n <mv-box-highlight-create\n [page]="i + 1"\n [pageHeight]="page.styles.height"\n [pageWidth]="page.styles.width"\n [rotate]="rotate"\n [zoom]="zoom"\n (saveSelection)="saveAnnotation($event)">\n </mv-box-highlight-create>\n <mv-ctx-toolbar *ngIf="rectangles && highlightPage === (i + 1)"\n [rectangles]="rectangles"\n [canBookmark]="true" [canHighlight]="true"\n [zoom]="zoom"\n [rotate]="rotate"\n [pageHeight]="page.styles.height"\n [pageWidth]="page.styles.width"\n (createBookmarkEvent)="createBookmark($event)"\n (createHighlightEvent)="createHighlight()">\n </mv-ctx-toolbar>\n <div class="pageContainer__page-item">\n <mv-annotation-set *ngIf="(annoPages$ | async) as annoPages"\n [zoom]="zoom"\n [rotate]="rotate"\n [pageHeight]="page.styles.height"\n [pageWidth]="page.styles.width"\n [page]="i" [annotations]="annoPages[i + 1]"></mv-annotation-set>\n </div>\n </div>\n</div>\n'}]}],t.ctorParameters=function(){return[{type:s.Store},{type:eo},{type:W},{type:Qe}]},t.propDecorators={zoom:[{type:e.Input}],rotate:[{type:e.Input}]},t}();var Fo=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[v.A11yModule,n.CommonModule,o.FormsModule,i.HttpClientModule,f.MutableDivModule,b.TagInputModule,g.RouterModule,o.ReactiveFormsModule,y.NgxDatatableModule,xo],declarations:[Mo,Qn,uo,to,no,io,po,ho,mo,ao,so,vo,co,lo,go,bo,fo,wo,ko],entryComponents:[Qn,to,so],providers:[an,yo,ro,eo,oo],exports:[Qn,uo,to,so,po,ho,lo,go,fo,bo,wo,ko,Mo]}]}],t}(),No=function(){function t(t){this.el=t,this.pointerDown=!1,this.dragEnabled=!1}return t.prototype.onPointerDown=function(t){this.dragEnabled&&(t.preventDefault(),this.pointerDown=!0,this.originalPosition={left:t.clientX+this.el.nativeElement.scrollLeft,top:t.clientY+this.el.nativeElement.scrollTop})},t.prototype.onPointerMove=function(t){if(this.pointerDown&&this.dragEnabled){t.preventDefault();var e={left:this.originalPosition.left-(t.clientX+this.el.nativeElement.scrollLeft),top:this.originalPosition.top-(t.clientY+this.el.nativeElement.scrollTop)};this.dragEnabled&&(this.dragX.scrollLeft+=e.left,this.el.nativeElement.scrollTop+=e.top)}},t.prototype.onWindowPointerUp=function(){this.pointerDown=!1},t.decorators=[{type:e.Directive,args:[{selector:"[mvGrabNDrag]"}]}],t.ctorParameters=function(){return[{type:e.ElementRef}]},t.propDecorators={dragEnabled:[{type:e.Input}],dragX:[{type:e.Input}],onPointerDown:[{type:e.HostListener,args:["pointerdown",["$event"]]}],onPointerMove:[{type:e.HostListener,args:["window:pointermove",["$event"]]}],onWindowPointerUp:[{type:e.HostListener,args:["window:pointerup"]}]},t}();var jo=function(){function t(t,e){this.viewerEvents=t,this.store=e,this.selectedView="outline"}return t.prototype.ngOnInit=function(){var t=this;this.bookmarkNodes$=this.store.pipe(s.select(To)),this.$subscription=this.store.pipe(s.select(Bo)).subscribe((function(e){return t.selectedView=e?"bookmarks":t.selectedView}))},t.prototype.ngOnChanges=function(t){t.url&&this.url&&this.store.dispatch(new oe)},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.goToDestination=function(t){this.viewerEvents.goToDestination(t)},t.prototype.toggleSidebarView=function(t){this.selectedView=t},t.prototype.onAddBookmarkClick=function(){var t=this;this.toggleSidebarView("bookmarks"),this.store.pipe(s.select(Ao),r.take(1)).subscribe((function(e){t.store.dispatch(new re(P(P({},e),{name:"new bookmark",id:E()})))}))},t.decorators=[{type:e.Component,args:[{selector:"mv-side-bar",template:'<div id="toolbarSidebar">\n <div class="splitToolbarButton toggled">\n <button id="viewOutline"\n [ngClass]="{ \'toolbarButton\': true, \'toggled\': selectedView === \'outline\' }"\n (click)="toggleSidebarView(\'outline\')"\n title="Show Document Outline" tabindex="1" data-l10n-id="document_outline">\n <span data-l10n-id="document_outline_label">Document Outline</span>\n </button>\n <button *ngIf="annotationsEnabled"\n id="viewBookmark" class="toolbarButton bookmark"\n [ngClass]="{ toggled: selectedView === \'bookmarks\' }"\n (click)="toggleSidebarView(\'bookmarks\')"\n title="Show Bookmarks" tabindex="2" data-l10n-id="bookmarks">\n <span data-l10n-id="bookmarks_label">Bookmarks</span>\n </button>\n </div>\n <div class="splitToolbarButtonSeparator"></div>\n <div *ngIf="annotationsEnabled"\n class="splitToolbarButton right">\n <button id="addBookmark"\n class="toolbarButton addBookmark"\n (click)="onAddBookmarkClick()"\n title="Add bookmark" tabindex="3" data-l10n-id="addBookmark">\n <span data-l10n-id="addBookmark_label">Add bookmark</span>\n </button>\n </div>\n</div>\n<div id="sidebarContent">\n <div id="outlineView" class="outlineWithDeepNesting">\n <div class="outlineItem" *ngIf="selectedView === \'outline\'">\n <mv-outline-item *ngFor="let outlineItem of outline"\n [outline]="outlineItem"\n (navigationEvent)="goToDestination($event)"></mv-outline-item>\n </div>\n <div *ngIf="annotationsEnabled && selectedView === \'bookmarks\'"\n id="bookmarkContainer">\n <mv-bookmarks [bookmarkNodes]="bookmarkNodes$ | async"\n [zoom]="zoom" [rotate]="rotate"\n (goToDestination)="goToDestination($event)"></mv-bookmarks>\n </div>\n </div>\n</div>\n'}]}],t.ctorParameters=function(){return[{type:Qe},{type:s.Store}]},t.propDecorators={annotationsEnabled:[{type:e.Input}],outline:[{type:e.Input}],url:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}]},t}();var Lo=function(){function t(){this.navigationEvent=new e.EventEmitter}return t.prototype.ngOnInit=function(){this.showOutlineItems=!0},t.prototype.goToDestination=function(t){t&&this.navigationEvent.emit(t)},t.prototype.toggleOutline=function(){this.showOutlineItems=!this.showOutlineItems},t.decorators=[{type:e.Component,args:[{selector:"mv-outline-item",template:'<div class="outlineItem">\n <div *ngIf="outline.items.length > 0"\n [ngClass]="{ \'outlineItemToggler\': true, \'outlineItemsHidden\': !showOutlineItems }"\n (click)="toggleOutline()"\n (keyup.enter)="toggleOutline()" tabindex="0"></div>\n <a (click)="goToDestination(outline?.dest)"\n (keyup.enter)="goToDestination(outline?.dest)"\n [style.font-weight]="outline.bold ? \'bold\' : \'\'"\n [style.font-style]="outline.italic ? \'italic\' : \'\'"\n tabindex="0">\n {{ outline.title }}\n </a>\n <div *ngIf="outline.items.length > 0" class="outlineItems">\n <div *ngFor="let outline of outline.items">\n <mv-outline-item\n [outline]="outline" (navigationEvent)="goToDestination($event)">\n </mv-outline-item>\n </div>\n </div>\n</div>\n\n'}]}],t.propDecorators={outline:[{type:e.Input}],navigationEvent:[{type:e.Output}]},t}();var Ho=function(){function t(t,e,n){this.store=t,this.viewerEvents=e,this.toolbarEvents=n}return t.prototype.ngOnInit=function(){var t=this;this.redactionsPerPage$=this.store.pipe(s.select($n)),this.selectedRedaction$=this.store.pipe(s.select(Nn)),this.$subscription=this.toolbarEvents.drawModeSubject.subscribe((function(e){return t.drawMode=e})),this.$subscription.add(this.store.pipe(s.select(jn),r.filter((function(t){return!!t}))).subscribe((function(e){return t.downloadDocument(e)}))),this.$subscription.add(this.store.pipe(s.select(Ge)).subscribe((function(e){return t.documentId=e}))),this.$subscription.add(this.viewerEvents.textHighlight.subscribe((function(e){return t.markTextRedaction(e)}))),this.toolbarEvents.applyRedactToDocument.subscribe((function(){t.store.pipe(s.select(Hn),r.take(1)).subscribe((function(e){t.store.dispatch(new Ae(e))}))})),this.toolbarEvents.clearAllRedactMarkers.subscribe((function(){t.store.dispatch(new Ne(t.documentId))}))},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.markTextRedaction=function(t){var e=t.rectangles;e&&e.length&&this.saveRedaction(t.page,A(e)),this.toolbarEvents.highlightModeSubject.next(!1)},t.prototype.markBoxRedaction=function(t){var e=t.rectangles,n=t.page;this.saveRedaction(n,e),this.toolbarEvents.drawModeSubject.next(!1)},t.prototype.saveRedaction=function(t,e){var n={page:t,rectangles:e,redactionId:E(),documentId:this.documentId};this.store.dispatch(new Pe(n))},t.prototype.onMarkerDelete=function(t){this.store.dispatch(new _e(t))},t.prototype.selectRedaction=function(t){this.store.dispatch(new Be(t))},t.prototype.onMarkerUpdate=function(t){this.store.dispatch(new Pe(t))},t.prototype.downloadDocument=function(t){var e=t.blob,n=t.filename;if(navigator&&navigator.msSaveBlob)navigator.msSaveBlob(e,n);else{var o=URL.createObjectURL(e),i=document.createElement("a");document.body.appendChild(i),i.setAttribute("style","display: none"),i.href=o,i.download=n,i.click(),i.remove(),URL.revokeObjectURL(o)}this.store.dispatch(new Fe)},t.decorators=[{type:e.Component,args:[{selector:"mv-redactions",template:'<div class="pageContainer">\n <div *ngFor="let redaction of (redactionsPerPage$ | async); index as i"\n class="pageContainer__page"\n [ngStyle]="{\n \'width.px\': redaction.styles.width,\n \'height.px\': redaction.styles.height\n }"\n [ngClass]="{ \'pageContainer__page--draw\' : drawMode }">\n <mv-box-highlight-create\n [page]="i + 1"\n [pageHeight]="redaction.styles.height"\n [pageWidth]="redaction.styles.width"\n [rotate]="rotate"\n [zoom]="zoom"\n (saveSelection)="markBoxRedaction($event)">\n </mv-box-highlight-create>\n <div class="pageContainer__page-item">\n <ng-container *ngFor="let anno of redaction.anno">\n \x3c!-- TODO rename this to selection --\x3e\n <mv-annotation [annotation]="anno"\n [zoom]="zoom"\n [rotate]="rotate"\n [selectedAnnoId]="selectedRedaction$ | async"\n [pageHeight]="redaction.styles.height"\n [pageWidth]="redaction.styles.width"\n (update)="onMarkerUpdate($event)"\n (delete)="onMarkerDelete($event)"\n (annotationClick)="selectRedaction($event)">\n </mv-annotation>\n </ng-container>\n </div>\n </div>\n</div>\n'}]}],t.ctorParameters=function(){return[{type:s.Store},{type:Qe},{type:W}]},t.propDecorators={zoom:[{type:e.Input}],rotate:[{type:e.Input}]},t}();var $o=function(){function t(t){this.httpClient=t,this.ICP_SESSION_API="/icp/sessions"}return t.prototype.loadSession=function(t){return this.httpClient.get(this.ICP_SESSION_API+"/"+t,{observe:"response",withCredentials:!0}).pipe(r.map((function(t){return t.body})))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:i.HttpClient}]},t}();var Vo=function(){function t(){this.connected$=new a.BehaviorSubject(!1)}return t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.connect=function(){var t=this;this.socket=this.getSocketClient(),this.socket.on("connect",(function(){return t.connected$.next(!0)})),this.socket.on("disconnect",(function(){return t.connected$.next(!1)}))},t.prototype.join=function(t){var e=this;this.subscription=this.connected$.subscribe((function(n){n&&e.socket.emit("join",t)}))},t.prototype.leave=function(t){this.socket.emit("leave",t),this.subscription.unsubscribe()},t.prototype.emit=function(t,e){this.socket.emit(t,e)},t.prototype.listen=function(t){var e=this;return new a.Observable((function(n){return e.socket.on(t,(function(t){n.next(t)})),function(){return e.socket.off(t)}}))},t.prototype.getSocketClient=function(){return S("/",{path:"/icp/socket.io",agent:!0})},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[]},t}();var Uo=function(){function t(t){this.socket=t,this.SESSION_JOINED="[Icp] Client Joined Session",this.CLIENT_DISCONNECTED="[Icp] Client Disconnected From Session",this.NEW_PARTICIPANT_JOINED="[Icp] New Participant Joined Session",this.REMOVE_PARTICIPANT="[Icp] Remove Participant from List",this.PARTICIPANTS_UPDATED="[Icp] Participants List Updated",this.UPDATE_PRESENTER="[Icp] New Presenter Starts Presenting",this.PRESENTER_UPDATED="[Icp] Presenter Updated",this.UPDATE_SCREEN="[Icp] Update Screen",this.SCREEN_UPDATED="[Icp] Screen Updated"}return t.prototype.joinSession=function(t,e){return this.session=e,this.socket.connect(),this.socket.join(P(P({},this.session),{username:t})),this.socket.listen(this.SESSION_JOINED)},t.prototype.leaveSession=function(){this.socket.leave(this.session)},t.prototype.newParticipantJoined=function(){return this.socket.listen(this.NEW_PARTICIPANT_JOINED)},t.prototype.clientDisconnected=function(){return this.socket.listen(this.CLIENT_DISCONNECTED)},t.prototype.removeParticipant=function(t){this.socket.emit(this.REMOVE_PARTICIPANT,{participantId:t,caseId:this.session.caseId})},t.prototype.participantListUpdated=function(){return this.socket.listen(this.PARTICIPANTS_UPDATED)},t.prototype.updatePresenter=function(t){this.socket.emit(this.UPDATE_PRESENTER,P(P({},this.session),{presenterId:t.id,presenterName:t.username}))},t.prototype.presenterUpdated=function(){return this.socket.listen(this.PRESENTER_UPDATED)},t.prototype.updateScreen=function(t){var e={body:t,sessionId:this.session.sessionId};this.socket.emit(this.UPDATE_SCREEN,e)},t.prototype.screenUpdated=function(){return this.socket.listen(this.SCREEN_UPDATED)},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:Vo}]},t}();var zo=function(){function t(t,e,n){this.toolbarEvents=t,this.socketService=e,this.store=n}return t.prototype.update=function(t){t?this.subscribe():this.unsubscribe()},t.prototype.subscribe=function(){var t=this;this.$subscription||(this.$subscription=this.store.pipe(s.select(Ze)).subscribe((function(e){t.pdfPosition=e,t.onPositionUpdate(e)})),this.$subscription.add(this.store.pipe(s.select(qn)).subscribe((function(e){t.presenter=e}))),this.$subscription.add(this.socketService.newParticipantJoined().subscribe((function(){return t.onNewParticipantJoined()}))))},t.prototype.unsubscribe=function(){this.$subscription&&(this.$subscription.unsubscribe(),this.$subscription=void 0)},t.prototype.onPositionUpdate=function(t){var e={pdfPosition:t,document:void 0};this.socketService.updateScreen(e)},t.prototype.onNewParticipantJoined=function(){this.onPositionUpdate(this.pdfPosition),this.socketService.updatePresenter(this.presenter)},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:W},{type:Uo},{type:s.Store}]},t}();var Wo=function(){function t(t,e,n,o){this.toolbarEvents=t,this.viewerEvents=e,this.socketService=n,this.store=o}return t.prototype.update=function(t){t?this.subscribe():this.unsubscribe()},t.prototype.subscribe=function(){var t=this;this.$subscription||(this.$subscription=this.socketService.screenUpdated().subscribe((function(e){return t.followScreenUpdate(e)})))},t.prototype.unsubscribe=function(){this.$subscription&&(this.$subscription.unsubscribe(),this.$subscription=void 0)},t.prototype.followScreenUpdate=function(t){var e=this,n=t.pdfPosition;n&&this.viewerEvents.goToDestination([n.pageNumber-1,{name:"XYZ"},n.left,n.top]),this.store.pipe(s.select(Ze),r.take(1)).subscribe((function(t){var o=(n.rotation-t.rotation)%360;0!==o&&e.toolbarEvents.rotate(o)}))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:W},{type:Qe},{type:Uo},{type:s.Store}]},t}();var qo=function(){function t(t,e,n,o,i,a){var c=this;this.toolbarEvents=t,this.viewerEvents=e,this.socketService=n,this.presenterSubscriptions=o,this.followerSubscriptions=i,this.store=a,this.subscription=this.store.pipe(s.select(Wn),r.filter((function(t){return!!t}))).subscribe((function(t){c.caseId=t})),this.subscription.add(this.toolbarEvents.icp.sessionLaunch.subscribe((function(){c.caseId&&c.launchSession()})))}return t.prototype.ngOnDestroy=function(){this.unsubscribeSession(),this.subscription.unsubscribe()},t.prototype.launchSession=function(){var t=this;this.store.dispatch(new ft(this.caseId)),this.subscription.add(this.store.pipe(s.select(zn),r.filter((function(t){return!!t&&Object.keys(t).length>1})),r.take(1)).subscribe((function(){t.setUpSessionSubscriptions()})))},t.prototype.setUpSessionSubscriptions=function(){var t=this;this.sessionSubscription=this.toolbarEvents.icp.becomingPresenter.subscribe((function(){return t.becomePresenter()})),this.sessionSubscription.add(this.toolbarEvents.icp.stoppingPresenting.subscribe((function(){return t.stopPresenting()}))),this.sessionSubscription.add(this.toolbarEvents.icp.sessionExitConfirmed.subscribe((function(){return t.leavePresentation()}))),this.sessionSubscription.add(this.store.pipe(s.select(qn)).subscribe((function(e){return t.presenter=e}))),this.sessionSubscription.add(this.store.pipe(s.select(Zn)).subscribe((function(e){return t.client=e}))),this.sessionSubscription.add(this.store.pipe(s.select(Yn)).subscribe((function(e){t.isPresenter=e,t.presenterSubscriptions.update(e),t.followerSubscriptions.update(!e)}))),this.sessionSubscription.add(this.socketService.clientDisconnected().subscribe((function(e){return t.clientDisconnected(e)}))),this.sessionSubscription.add(this.socketService.presenterUpdated().subscribe((function(e){t.store.dispatch(new St(e))}))),this.sessionSubscription.add(this.socketService.participantListUpdated().subscribe((function(e){t.store.dispatch(new Ct(e))})))},t.prototype.unsubscribeSession=function(){this.presenterSubscriptions.update(!1),this.followerSubscriptions.update(!1),this.sessionSubscription.unsubscribe()},t.prototype.leavePresentation=function(){this.isPresenter&&this.stopPresenting(),this.removeParticipant(this.client.id),this.socketService.leaveSession(),this.store.dispatch(new kt),this.unsubscribeSession()},t.prototype.stopPresenting=function(){this.socketService.updatePresenter({username:"",id:""})},t.prototype.becomePresenter=function(){this.socketService.updatePresenter(this.client)},t.prototype.clientDisconnected=function(t){t===this.presenter.id&&this.stopPresenting(),this.removeParticipant(t)},t.prototype.removeParticipant=function(t){this.socketService.removeParticipant(t)},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:W},{type:Qe},{type:Uo},{type:zo},{type:Wo},{type:s.Store}]},t}();var Go=function(){function t(t,e){var n=this;this.actions$=t,this.annotationApiService=e,this.loadAnnotation$=this.actions$.pipe(k.ofType(xt),r.map((function(t){return t.payload})),r.switchMap((function(t){return n.annotationApiService.getAnnotationSet(t).pipe(r.map((function(t){return new Rt(t)})),r.catchError((function(t){return a.of(new Tt(t))})))}))),this.postAnnotation$=this.actions$.pipe(k.ofType("[Annotations] Save Annotation"),r.map((function(t){return t.payload})),r.exhaustMap((function(t){return n.annotationApiService.postAnnotation(t).pipe(r.map((function(t){return new At(t)})),r.catchError((function(t){return a.of(new Tt(t))})))}))),this.deleteAnnotation$=this.actions$.pipe(k.ofType("[Annotations] Delete Annotation"),r.map((function(t){return t.payload})),r.exhaustMap((function(t){return n.annotationApiService.deleteAnnotation(t).pipe(r.map((function(e){return new Nt(t)})),r.catchError((function(t){return a.of(new jt(t))})))})))}return t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:k.Actions},{type:an}]},x([k.Effect(),D("design:type",Object)],t.prototype,"loadAnnotation$",void 0),x([k.Effect(),D("design:type",Object)],t.prototype,"postAnnotation$",void 0),x([k.Effect(),D("design:type",Object)],t.prototype,"deleteAnnotation$",void 0),t}();var Zo=function(){function t(t,e,n){var o=this;this.actions$=t,this.store=e,this.bookmarksApiService=n,this.loadBookmarks$=this.actions$.pipe(k.ofType("[Bookmarks] Load Bookmarks"),r.withLatestFrom(this.store.pipe(s.select(Ge))),r.map((function(t){return B(t,2)[1]})),r.exhaustMap((function(t){return o.bookmarksApiService.getBookmarks(t).pipe(r.map((function(t){return new ie(t)})),r.catchError((function(t){return a.of(new ae(t))})))}))),this.createBookmark$=this.actions$.pipe(k.ofType("[Bookmarks] Create Bookmark"),r.map((function(t){return t.payload})),r.exhaustMap((function(t){return o.bookmarksApiService.createBookmark(t).pipe(r.map((function(t){return new se(t)})),r.catchError((function(t){return a.of(new ce(t))})))}))),this.moveBookmark$=this.actions$.pipe(k.ofType("[Bookmarks] Move Bookmark"),r.map((function(t){return t.payload})),r.exhaustMap((function(t){return o.bookmarksApiService.updateMultipleBookmarks(t).pipe(r.map((function(t){return new he(t)})),r.catchError((function(t){return a.of(new me(t))})))}))),this.deleteBookmark$=this.actions$.pipe(k.ofType("[Bookmarks] Delete Bookmark"),r.map((function(t){return t.payload})),r.exhaustMap((function(t){var e=t.deleted,n=t.updated;return o.bookmarksApiService.deleteMultipleBookmarks({deleted:e,updated:n}).pipe(r.switchMap((function(){return n?[new ue(e),new ve(n)]:[new ue(e)]})),r.catchError((function(t){return a.of(new pe(t))})))}))),this.updateBookmark$=this.actions$.pipe(k.ofType("[Bookmarks] Update Bookmark"),r.map((function(t){return t.payload})),r.switchMap((function(t){return o.bookmarksApiService.updateBookmark(t).pipe(r.map((function(t){return new ve(t)})),r.catchError((function(t){return a.of(new fe(t))})))})))}return t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:k.Actions},{type:s.Store},{type:yo}]},x([k.Effect(),D("design:type",Object)],t.prototype,"loadBookmarks$",void 0),x([k.Effect(),D("design:type",Object)],t.prototype,"createBookmark$",void 0),x([k.Effect(),D("design:type",Object)],t.prototype,"moveBookmark$",void 0),x([k.Effect(),D("design:type",Object)],t.prototype,"deleteBookmark$",void 0),x([k.Effect(),D("design:type",Object)],t.prototype,"updateBookmark$",void 0),t}();var Yo=function(){function t(t){this.httpClient=t,this.markupsApiUrl="/api/markups",this.redactApiUrl="/api/redaction"}return t.prototype.getRedactions=function(t){var e=this.markupsApiUrl+"/"+t;return this.httpClient.get(e,{observe:"response",withCredentials:!0})},t.prototype.saveRedaction=function(t){return this.httpClient.post(this.markupsApiUrl,t,{observe:"response",withCredentials:!0}).pipe(r.map((function(t){return t.body})),r.catchError((function(){return[]})))},t.prototype.deleteRedaction=function(t){var e=this.markupsApiUrl+"/"+t.documentId+"/"+t.redactionId;return this.httpClient.delete(e,{observe:"response",withCredentials:!0}).pipe(r.map((function(t){return t.body})))},t.prototype.deleteAllMarkers=function(t){var e=this.markupsApiUrl+"/"+t;return this.httpClient.delete(e,{observe:"response",withCredentials:!0}).pipe(r.map((function(t){return t.body})))},t.prototype.redact=function(t){return this.httpClient.post(this.redactApiUrl,t,{observe:"response",withCredentials:!0,responseType:"blob"}).pipe(r.map((function(t){return t})),r.catchError((function(){return[]})))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:i.HttpClient}]},t}();var Xo=function(){function t(t,e){var n=this;this.actions$=t,this.redactionApiService=e,this.loadRedactions$=this.actions$.pipe(k.ofType("[Redaction] Load Redaction"),r.map((function(t){return t.payload})),r.switchMap((function(t){return n.redactionApiService.getRedactions(t).pipe(r.map((function(t){return new Ee(t.body)})),r.catchError((function(t){return a.of(new Ie(t))})))}))),this.saveRedaction$=this.actions$.pipe(k.ofType("[Redaction] Save Redaction"),r.map((function(t){return t.payload})),r.exhaustMap((function(t){return n.redactionApiService.saveRedaction(t).pipe(r.map((function(t){return new xe(t)})),r.catchError((function(t){return a.of(new De(t))})))}))),this.deleteRedaction$=this.actions$.pipe(k.ofType("[Redaction] Delete Redaction"),r.map((function(t){return t.payload})),r.exhaustMap((function(t){return n.redactionApiService.deleteRedaction(t).pipe(r.map((function(){return new Re(t)})),r.catchError((function(t){return a.of(new Te(t))})))}))),this.redact$=this.actions$.pipe(k.ofType("[Redaction] Redact"),r.map((function(t){return t.payload})),r.exhaustMap((function(t){return n.redactionApiService.redact(t).pipe(r.map((function(e){var n=e.headers.get("content-disposition").split("filename="),o=n.length>1?n[1].replace(/"/g,""):"redacted-document-"+t.documentId;return new Oe({blob:e.body,filename:o})})),r.catchError((function(t){return a.of(new Me(t))})))}))),this.unmarkAll$=this.actions$.pipe(k.ofType("[Redaction] Unmark All"),r.map((function(t){return t.payload})),r.exhaustMap((function(t){return n.redactionApiService.deleteAllMarkers(t).pipe(r.map((function(t){return new je})),r.catchError((function(t){return a.of(new Te(t))})))})))}return t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:k.Actions},{type:Yo}]},x([k.Effect(),D("design:type",Object)],t.prototype,"loadRedactions$",void 0),x([k.Effect(),D("design:type",Object)],t.prototype,"saveRedaction$",void 0),x([k.Effect(),D("design:type",Object)],t.prototype,"deleteRedaction$",void 0),x([k.Effect(),D("design:type",Object)],t.prototype,"redact$",void 0),x([k.Effect(),D("design:type",Object)],t.prototype,"unmarkAll$",void 0),t}();var Ko=function(){function t(t){this.httpClient=t,this.documentConversionUrl="/doc-assembly/convert"}return t.prototype.convert=function(t){return this.httpClient.post(this.documentConversionUrl+"/"+t,{},{observe:"response",withCredentials:!0,responseType:"blob"}).pipe(r.map((function(t){return t})),r.catchError((function(t){return a.of(t)})))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:i.HttpClient}]},t}();var Jo=function(){function t(t){this.httpClient=t,this.rotationApiUrl="/em-anno/metadata"}return t.prototype.getRotation=function(t){var e=this.rotationApiUrl+"/"+t;return this.httpClient.get(e,{observe:"response",withCredentials:!0})},t.prototype.saveRotation=function(t){var e=this.rotationApiUrl+"/";return this.httpClient.post(e,t,{observe:"response",withCredentials:!0}).pipe(r.map((function(t){return t})),r.catchError((function(){return[]})))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:i.HttpClient}]},t}();var Qo=function(){function t(t,e,n){var o=this;this.actions$=t,this.documentConversionService=e,this.rotationApiService=n,this.convert$=this.actions$.pipe(k.ofType("[Document] Convert"),r.map((function(t){return t.payload})),r.exhaustMap((function(t){return o.documentConversionService.convert(t).pipe(r.map((function(t){var e=URL.createObjectURL(t.body);return new at(e)})),r.catchError((function(t){return a.of(new rt(t))})))}))),this.loadRotation$=this.actions$.pipe(k.ofType("[Document] Load Rotation"),r.map((function(t){return t.payload})),r.switchMap((function(t){return o.rotationApiService.getRotation(t).pipe(r.map((function(t){return new lt(t.body)})),r.catchError((function(t){return a.of(new ut(t))})))}))),this.saveRotation$=this.actions$.pipe(k.ofType("[Document] Save Rotation"),r.map((function(t){return t.payload})),r.switchMap((function(t){return o.rotationApiService.saveRotation(t).pipe(r.map((function(t){return new dt(t.body)})),r.catchError((function(t){return a.of(new ht(t))})))})))}return t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:k.Actions},{type:Ko},{type:Jo}]},x([k.Effect(),D("design:type",Object)],t.prototype,"convert$",void 0),x([k.Effect(),D("design:type",Object)],t.prototype,"loadRotation$",void 0),x([k.Effect(),D("design:type",Object)],t.prototype,"saveRotation$",void 0),t}();var ti=function(){function t(t,e,n){var o=this;this.actions$=t,this.icpApiService=e,this.icpUpdateService=n,this.loadIcpSession$=this.actions$.pipe(k.ofType("[Icp] Load Session"),r.map((function(t){return t.payload})),r.exhaustMap((function(t){return o.icpApiService.loadSession(t).pipe(r.map((function(t){return new yt(t)})),r.catchError((function(t){return a.of(new bt(t))})))}))),this.joinIcpSocketSession$=this.actions$.pipe(k.ofType("[Icp] Join Socket Session"),r.map((function(t){return t.payload})),r.switchMap((function(t){return o.icpUpdateService.joinSession(t.username,t.session).pipe(r.map((function(e){return new wt({session:t.session,participantInfo:e})})))})))}return t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:k.Actions},{type:$o},{type:Uo}]},x([k.Effect(),D("design:type",Object)],t.prototype,"loadIcpSession$",void 0),x([k.Effect(),D("design:type",Object)],t.prototype,"joinIcpSocketSession$",void 0),t}();var ei=[Go,Zo,Xo,Qo,ti],ni=function(){function t(t){this.store=t,this.goToDestination=new e.EventEmitter,this.pageLookup={},this.BOOKMARK_CHAR_LIMIT=30,this.options={allowDrag:!0,allowDrop:!0}}return t.prototype.ngOnInit=function(){var t=this;this.$subscription=this.store.pipe(s.select(Bo)).subscribe((function(e){return t.editableBookmark=e})),this.$subscription.add(this.store.select(qe).subscribe((function(e){Object.keys(e).map((function(n){t.pageLookup[n]=e[n]}))})))},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.editBookmark=function(t){this.editableBookmark=t},t.prototype.onBookmarkMove=function(t){var e=t.node,n=t.from,o=t.to,i=[P(P({},e),{previous:o.index>0?o.parent.children[o.index-1].id:void 0,parent:o.parent.documentId?o.parent.id:void 0})],a=this.getSibling(n,n.index);(a=a&&a.id===e.previous?this.getSibling(n,n.index+1):a)&&(i=A(i,[P(P({},a),{previous:e.previous})]));var r=this.getSibling(o,o.index+1);r&&(i=A(i,[P(P({},r),{previous:e.id})])),this.store.dispatch(new de(i))},t.prototype.deleteBookmark=function(t){var e,n=t.parent.children;n.length>t.index+1&&((e=n[t.index+1].data).previous=t.data.previous),this.store.dispatch(new le({deleted:A([t.data.id],be(t.data.children)),updated:e}))},t.prototype.updateBookmark=function(t,e){var n=P(P({},t),{name:e});this.store.dispatch(new ge(n)),this.editableBookmark=void 0},t.prototype.goToBookmark=function(t){var e=this.pageLookup[t.pageNumber+1],n=e.styles.height,o=this.scaledY(t.yCoordinate,n,e),i=0,a=0;switch(this.rotate){case 90:a=-o;break;case 180:i=this.scaledY(t.yCoordinate,n-24*this.zoom,e);break;case 270:a=o;break;default:i=o}this.goToDestination.emit([t.pageNumber,{name:"XYZ"},a,i])},t.prototype.getSibling=function(t,e){return t.parent.children.length>e?t.parent.children[e]:void 0},t.prototype.scaledY=function(t,e,n){var o=n.viewportScale/this.zoom;return(e/this.zoom-t)/o},t.decorators=[{type:e.Component,args:[{selector:"mv-bookmarks",template:'<tree-root [nodes]="bookmarkNodes"\n class="bookmarks-tree"\n [options]="options"\n (moveNode)="onBookmarkMove($event)">\n <ng-template #treeNodeTemplate let-node let-index="index">\n <div class="outlineItem" *ngIf="node.data.id !== editableBookmark; else inputBookmark">\n <a (click)="goToBookmark(node.data)">\n {{ node.data.name }}\n </a>\n <button class="bookmark__rename" (click)="editBookmark(node.data.id)" ></button>\n <button class="bookmark__delete" (click)="deleteBookmark(node)"></button>\n </div>\n <ng-template #inputBookmark>\n <input #bookmarkName class="bookmark__input" [value]="node.data.name" [maxLength]="BOOKMARK_CHAR_LIMIT">\n <button class="bookmark__save" (click)="updateBookmark(node.data, bookmarkName.value)"></button>\n </ng-template>\n <a *ngIf="bookmarkNodes?.length === 0" class="outlineItem">No bookmarks created yet</a>\n </ng-template>\n</tree-root>\n'}]}],t.ctorParameters=function(){return[{type:s.Store}]},t.propDecorators={bookmarkNodes:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],goToDestination:[{type:e.Output}]},t}();var oi=function(){function t(t){this.store=t,this.mediaLoadStatus=new e.EventEmitter,this.viewerException=new e.EventEmitter,this.documentTitle=new e.EventEmitter}return t.prototype.ngOnInit=function(){var t=this;this.store.dispatch(new it(this.extractDMStoreDocId(this.originalUrl))),this.$subscription=this.store.pipe(s.select(Xe),r.filter((function(t){return!!t}))).subscribe((function(e){e.url?(t.convertedUrl=e.url,t.store.dispatch(new st)):t.onLoadException(new Y(e.error))}))},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.onMediaLoad=function(t){this.mediaLoadStatus.emit(t)},t.prototype.onLoadException=function(t){this.viewerException.emit(t)},t.prototype.onDocumentTitleChange=function(t){this.documentTitle.emit(t)},t.prototype.extractDMStoreDocId=function(t){return t.includes("/documents/")?t=t.split("/documents/")[1]:t.includes("/documentsv2/")&&(t=t.split("/documentsv2/")[1]),t.replace("/binary","")},t.decorators=[{type:e.Component,args:[{selector:"mv-conversion-viewer",template:'<mv-pdf-viewer *ngIf="convertedUrl"\n (mediaLoadStatus)="onMediaLoad($event)"\n (pdfViewerException)="onLoadException($event)"\n (documentTitle)="onDocumentTitleChange($event)"\n [url]="convertedUrl"\n [downloadUrl]="originalUrl"\n [enableAnnotations]="enableAnnotations"\n [enableRedactions]="enableRedactions"\n [annotationSet]="enableAnnotations ? annotationSet : null"\n [downloadFileName]="downloadFileName"\n [height]="height">\n</mv-pdf-viewer>\n',encapsulation:e.ViewEncapsulation.None}]}],t.ctorParameters=function(){return[{type:s.Store}]},t.propDecorators={originalUrl:[{type:e.Input}],downloadFileName:[{type:e.Input}],height:[{type:e.Input}],enableAnnotations:[{type:e.Input}],enableRedactions:[{type:e.Input}],annotationSet:[{type:e.Input}],mediaLoadStatus:[{type:e.Output}],viewerException:[{type:e.Output}],documentTitle:[{type:e.Output}]},t}();var ii=function(){function t(t){this.toolbarEvents=t}return t.prototype.onCancel=function(){this.toolbarEvents.icp.leavingSession.next(!1)},t.prototype.onConfirm=function(){this.toolbarEvents.icp.confirmExit(),this.toolbarEvents.icp.leavingSession.next(!1)},t.decorators=[{type:e.Component,args:[{selector:"mv-confirm-action",template:'<div id="modal-background" class="modal" (click)="onCancel()">\n <div id="modal" class="modal-content govuk-width-container clearfix" (click)="$event.stopPropagation()">\n <h2 class="govuk-heading-s">Are you sure you want to leave the presentation?</h2>\n <div class="button-container">\n <button id="modal-close-button" (click)="onConfirm()" class="govuk-button">Confirm</button>\n <button (click)="onCancel()" class="govuk-button govuk-button--secondary">Cancel</button>\n </div>\n </div>\n</div>\n'}]}],t.ctorParameters=function(){return[{type:W}]},t}();var ai=function(){function t(t){this.store=t}return t.prototype.ngOnInit=function(){this.bookmarksPerPage$=this.store.pipe(s.select(Oo))},t.decorators=[{type:e.Component,args:[{selector:"mv-bookmark-icons",template:'<div class="pageContainer">\n <div *ngFor="let bookmarks of (bookmarksPerPage$ | async); index as i"\n class="pageContainer__page"\n [ngStyle]="{\n \'width.px\': bookmarks.styles.width,\n \'height.px\': bookmarks.styles.height\n }">\n <div class="pageContainer__page-item">\n <ng-container *ngFor="let bMrk of bookmarks.bookmark">\n <div class="bookmark__here"\n [style.width]="16 * zoom + \'px\'"\n [style.height]="24 * zoom + \'px\'"\n [style.top]="bMrk.yCoordinate * zoom + \'px\'"\n [title]="bMrk.name">\n </div>\n </ng-container>\n </div>\n </div>\n</div>\n'}]}],t.ctorParameters=function(){return[{type:s.Store}]},t.propDecorators={zoom:[{type:e.Input}],rotate:[{type:e.Input}]},t}();var ri=function(){function t(t,e,n,o){this.el=t,this.store=e,this.toolbarButtons=n,this.toolbarEvents=o,this.rotation=0,this.savedRotation=0}return t.prototype.ngOnInit=function(){var t=this;this.$subscriptions=this.toolbarEvents.rotateSubject.subscribe((function(e){return t.onRotate(e)})),this.$subscriptions.add(this.toolbarEvents.saveRotationSubject.subscribe((function(){return t.saveRotation()}))).add(this.store.pipe(s.select(Ke)).subscribe((function(e){return t.savedRotation=e}))).add(this.store.pipe(s.select(Ge)).subscribe((function(e){return t.documentId=e})))},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.prototype.onMediaLoad=function(t){var e=this;this.rotation=0,this.store.dispatch(new ct(this.documentId)),this.store.pipe(s.select(Je),r.filter((function(t){return!!t})),r.take(1)).subscribe((function(){e.savedRotation&&e.toolbarEvents.rotateSubject.next(e.savedRotation)}))},t.prototype.onRotate=function(t){this.rotation=(this.rotation+t)%360,this.toolbarButtons.showSaveRotationButton=this.savedRotation!==this.rotation},t.prototype.saveRotation=function(){var t={documentId:this.documentId,rotationAngle:this.rotation};this.store.dispatch(new pt(t))},t.decorators=[{type:e.Directive,args:[{selector:"[mvRotationPersist]"}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:s.Store},{type:X},{type:W}]},t.propDecorators={onMediaLoad:[{type:e.HostListener,args:["mediaLoadStatus",["$event"]]}]},t}();var si=function(){function t(t,e){this.toolbarEvents=t,this.store=e,this.showParticipantsList=!1}return t.prototype.ngOnInit=function(){var t=this;this.participants$=this.store.pipe(s.select(Xn)),this.presenter$=this.store.pipe(s.select(qn)),this.isPresenter$=this.store.pipe(s.select(Yn)),this.subscription=this.toolbarEvents.icp.participantsListVisible.subscribe((function(e){return t.showParticipantsList=e}))},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.decorators=[{type:e.Component,args:[{selector:"mv-participants-list",template:'<div class="comments-panel comment-container icp-mode" [ngClass]="{\'expanded\': showParticipantsList }">\n\n <div class="participant__card no-shadow">\n <p class="participant__name">All Participants</p>\n </div>\n\n <div *ngIf="(presenter$ | async)?.username !== \'\'" class="participant__card">\n <div class="participant__header"> Presenting </div>\n <p class="participant__name">{{(presenter$ | async)?.username}}</p>\n </div>\n\n <div *ngIf="(participants$ | async).length > 1" class="participant__card">\n <div class="participant__header">Following</div>\n <ng-container *ngFor="let participant of (participants$ | async)">\n <p *ngIf="participant.id !== (presenter$ | async)?.id" class="participant__name">{{participant.username}}</p>\n </ng-container>\n </div>\n</div>\n'}]}],t.ctorParameters=function(){return[{type:W},{type:s.Store}]},t}();var ci=function(){function t(t,e,n,o,i){this.element=t,this.toolbarEvents=e,this.viewerEvents=n,this.highlightService=o,this.store=i}return t.prototype.ngOnInit=function(){var t=this;this.$subscription=this.store.select(qe).subscribe((function(e){e[1]&&(t.allPages=e)}))},t.prototype.ngOnDestroy=function(){this.$subscription&&this.$subscription.unsubscribe()},t.prototype.onMouseUp=function(t){var e=t.target.offsetParent.offsetParent,n=parseInt(e.getAttribute("data-page-number"),10);if(this.toolbarEvents.highlightModeSubject.getValue()){var o=this.getRectangles(t,n);this.viewerEvents.textSelected({page:n,rectangles:o})}},t.prototype.onPdfViewerClick=function(t){this.store.dispatch(new Lt({annotationId:"",selected:!1,editable:!1})),this.viewerEvents.clearCtxToolbar()},t.prototype.getRectangles=function(t,e){this.pageHeight=this.allPages[e].styles.height,this.pageWidth=this.allPages[e].styles.width,this.zoom=parseFloat(this.allPages[e].scaleRotation.scale),this.rotate=parseInt(this.allPages[e].scaleRotation.rotation,10);var n=window.getSelection();if(n){var o=t.target;if(this.removeEnhancedTextModeStyling(o),n.rangeCount&&!n.isCollapsed){var i=n.getRangeAt(0).cloneRange().getClientRects();if(i){for(var a=o.parentElement.getBoundingClientRect(),r=[],s=0;s<i.length;s++){var c=this.createTextRectangle(i[s],a);r.push(c)}return r}}}},t.prototype.createTextRectangle=function(t,e){var n=t.bottom-t.top,o=t.right-t.left,i=t.top-e.top,a=t.left-e.left,r=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,n,o,i,a,this.rotate,this.zoom);return r=P({id:E()},r)},t.prototype.removeEnhancedTextModeStyling=function(t){if(t.parentElement.children)for(var e=0;e<t.parentElement.children.length;e++){var n=t.parentElement.children[e];n.style.padding="0";n.style.transform=n.style.transform.replace(/translate[XYZ]\(-?\d*(\.\d+)?(px)?\)/g,"").trim()}},t.decorators=[{type:e.Directive,args:[{selector:"[mvCreateTextHighlight]"}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:W},{type:Qe},{type:eo},{type:s.Store}]},t.propDecorators={onMouseUp:[{type:e.HostListener,args:["mouseup",["$event"]]}],onPdfViewerClick:[{type:e.HostListener,args:["mousedown",["$event"]]}]},t}();var li=function(){function t(t){this.toolbarEvents=t,this.loadStatus=new e.EventEmitter,this.playbackMsg="loading"}return t.prototype.ngOnInit=function(){var t=this;this.subscription=this.toolbarEvents.downloadSubject.subscribe((function(){return t.downloadLink.nativeElement.click()})),this.loadStatus.emit(Z.SUCCESS)},t.prototype.ngOnChanges=function(t){t.url&&this.reloadVideo()},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.reloadVideo=function(){this.videoPlayer&&(this.playbackMsg="loading",this.videoPlayer.nativeElement.load())},t.prototype.onSuccess=function(){this.playbackMsg="success"},t.prototype.onError=function(){this.playbackMsg="error"},t.decorators=[{type:e.Component,args:[{selector:"mv-multimedia-player",template:'<div class="govuk-width-container">\n <div class="govuk-notification-banner__content">\n <p>\n <span *ngIf="multimediaOn && playbackMsg === \'loading\'">Loading multimedia content ... </span>\n <span *ngIf="!multimediaOn">Multimedia playback is not enabled, </span>\n <span *ngIf="multimediaOn && playbackMsg === \'success\'">Use the player to play to the file or </span>\n <span *ngIf="multimediaOn && playbackMsg === \'error\'">Mime type not supported. </span>\n <a *ngIf="!multimediaOn || playbackMsg !== \'loading\'" #downloadLink\n [href]="url" [download]="downloadFileName">Click here to download</a>\n </p>\n <video #videoPlayer *ngIf="multimediaOn"\n width="100%" height="100%" preload="auto" (canplay)="onSuccess()" controls>\n <source (error)="onError()" [src]="url" type="video/mp4">\n <source (error)="onError()" [src]="url" type="video/mp4; codecs=\'avc1, av01, hvc1, hev1, mp4v, mp4a.40.2, opus\'">\n <source (error)="onError()" [src]="url" type="video/ogg">\n <source (error)="onError()" [src]="url" type="video/ogg; codecs=\'theora, vp8, vp9, flac, opus, vorbis\'">\n <source (error)="onError()" [src]="url" type="video/webm">\n <source (error)="onError()" [src]="url" type="video/webm; codecs=\'vp8, vp9, vorbis, opus\'">\n </video>\n </div>\n</div>\n'}]}],t.ctorParameters=function(){return[{type:W}]},t.propDecorators={url:[{type:e.Input}],downloadFileName:[{type:e.Input}],multimediaOn:[{type:e.Input}],loadStatus:[{type:e.Output}],downloadLink:[{type:e.ViewChild,args:["downloadLink",{static:!1}]}],videoPlayer:[{type:e.ViewChild,args:["videoPlayer",{static:!1}]}]},t}();var ui=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,i.HttpClientModule,Jn,Fo,b.TagInputModule,o.FormsModule,o.ReactiveFormsModule,g.RouterModule,s.StoreModule.forFeature("media-viewer",Ue),k.EffectsModule.forFeature(ei),C.TreeModule.forRoot(),f.MutableDivModule],declarations:[tn,jo,ni,Lo,nn,on,li,Tn,oi,No,ri,ci,ii,Ho,ai,si],entryComponents:[tn,nn,on],providers:[q,rn,Yo,$o,Uo,Vo,qo,zo,Wo,Yo,Ko,Jo],exports:[Tn]}]}],t}();t.ADD_OR_EDIT_COMMENT="[Annotations] Add or Edit Comment",t.APPLY_COMMENT_SUMMARY_FILTER="[Comments] Apply Comment Summary Filter",t.AddOrEditComment=Mt,t.AnnotationApiService=an,t.AnnotationEffects=Go,t.AnnotationSetComponent=to,t.AnnotationViewComponent=Qn,t.AnnotationsModule=Fo,t.ApplyCommentSymmaryFilter=$t,t.BoxHighlightCreateComponent=uo,t.CLEAR_COMMENT_SUMMARY_FILTER="[Comments] Clear Comment Summary Filter",t.ClearCommentSummaryFilters=Vt,t.CommentFilterComponent=fo,t.CommentSearchComponent=ho,t.CommentSetComponent=so,t.CommentSetHeaderComponent=po,t.CommentsSummaryComponent=lo,t.DELETE_ANNOTATION="[Annotations] Delete Annotation",t.DELETE_ANNOTATION_FAIL="[Annotations] Delete Annotation Fail",t.DELETE_ANNOTATION_SUCCESS="[Annotations] Delete Annotation Success",t.DeleteAnnotation=Ft,t.DeleteAnnotationFail=jt,t.DeleteAnnotationSuccess=Nt,t.FilterPipe=wo,t.IcpToolbarComponent=Kn,t.LOAD_ANNOTATION_SET=xt,t.LOAD_ANNOTATION_SET_FAIL="[Annotations] Load Annotation Set Fail",t.LOAD_ANNOTATION_SET_SUCCESS="[Annotations] Load Annotation Set Success",t.LoadAnnotationSet=_t,t.LoadAnnotationSetFail=Tt,t.LoadAnnotationSetSucess=Rt,t.MainToolbarComponent=An,t.MediaViewerComponent=Tn,t.MediaViewerModule=ui,t.MetadataLayerComponent=Mo,t.MomentDatePipe=bo,t.RedactionToolbarComponent=Vn,t.ResponseType=Z,t.SAVE_ANNOTATION="[Annotations] Save Annotation",t.SAVE_ANNOTATION_FAIL="[Annotations] Save Annotation Fail",t.SAVE_ANNOTATION_SUCCESS="[Annotations] Save Annotation Success",t.SEARCH_COMMENT="[Comments] Search Comments",t.SELECT_ANNOTATION=Dt,t.SaveAnnotation=Bt,t.SaveAnnotationFail=Ot,t.SaveAnnotationSuccess=At,t.SearchBarComponent=On,t.SearchComment=Ht,t.SelectedAnnotation=Lt,t.TagsComponent=go,t.ToolbarButtonVisibilityService=X,t.ToolbarEventService=W,t.ToolbarModule=Jn,t.UnsnakePipe=ko,t.ViewerException=Y,t.commentSearchQ=Kt,t.getAnnoEnt=Yt,t.getAnnoPageEnt=Zt,t.getAnnoPerPage=En,t.getAnnoSet=qt,t.getAnnotationEntities=mn,t.getAnnotationSet=fn,t.getAnnotationsSetState=hn,t.getCommentEntities=yn,t.getCommentEnts=Gt,t.getCommentSummary=Pn,t.getCommentSummaryFilters=Cn,t.getCommentsArray=In,t.getComponentSearchQueries=kn,t.getComponentSearchText=Sn,t.getDocumentIdSetId=vn,t.getFilteredAnnotations=xn,t.getPageEntities=wn,t.getSelectedAnno=Xt,t.getSelectedAnnotation=bn,t.getSet=gn,t.getSummaryFilters=Jt,t.initialState=zt,t.reducer=Wt,t.ɵa=Bn,t.ɵba=mo,t.ɵbb=ao,t.ɵbc=ro,t.ɵbd=vo,t.ɵbe=co,t.ɵbf=G,t.ɵbg=yo,t.ɵbh=ei,t.ɵbi=Zo,t.ɵbj=Xo,t.ɵbk=Yo,t.ɵbl=Qo,t.ɵbm=Ko,t.ɵbn=Jo,t.ɵbo=ti,t.ɵbp=$o,t.ɵbq=Uo,t.ɵbr=Vo,t.ɵbs=tn,t.ɵbt=q,t.ɵbu=jo,t.ɵbv=ni,t.ɵbw=Lo,t.ɵbx=nn,t.ɵby=en,t.ɵbz=on,t.ɵc=Ue,t.ɵca=li,t.ɵcb=oi,t.ɵcc=No,t.ɵcd=ri,t.ɵce=ci,t.ɵcf=ii,t.ɵcg=Ho,t.ɵch=ai,t.ɵci=si,t.ɵcj=qo,t.ɵck=zo,t.ɵcl=Wo,t.ɵcm=We,t.ɵcn=qe,t.ɵco=sn,t.ɵcp=un,t.ɵcq=pn,t.ɵd=ze,t.ɵf=It,t.ɵg=Pt,t.ɵh=te,t.ɵi=ee,t.ɵj=ne,t.ɵl=Se,t.ɵm=He,t.ɵn=Ve,t.ɵp=xo,t.ɵq=So,t.ɵr=Co,t.ɵs=Io,t.ɵt=Po,t.ɵu=eo,t.ɵv=Qe,t.ɵw=rn,t.ɵx=no,t.ɵy=io,t.ɵz=oo,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators"),require("@ngrx/store"),require("pdfjs-dist/web/pdf_viewer"),require("pdfjs-dist"),require("pdfjs-dist/build/pdf.worker"),require("uuid/v4"),require("moment-timezone"),require("hammerjs"),require("@angular/cdk/overlay"),require("@angular/router"),require("@angular/cdk/a11y"),require("mutable-div"),require("ngx-chips"),require("@swimlane/ngx-datatable"),require("uuid"),require("@ngrx/effects"),require("@circlon/angular-tree-component")):"function"==typeof define&&define.amd?define("@hmcts/media-viewer",["exports","@angular/core","@angular/common","@angular/forms","@angular/common/http","rxjs","rxjs/operators","@ngrx/store","pdfjs-dist/web/pdf_viewer","pdfjs-dist","pdfjs-dist/build/pdf.worker","uuid/v4","moment-timezone","hammerjs","@angular/cdk/overlay","@angular/router","@angular/cdk/a11y","mutable-div","ngx-chips","@swimlane/ngx-datatable","uuid","@ngrx/effects","@circlon/angular-tree-component"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).hmcts=t.hmcts||{},t.hmcts["media-viewer"]={}),t.ng.core,t.ng.common,t.ng.forms,t.ng.common.http,t.rxjs,t.rxjs.operators,t.store,t.pdfjsViewer,t.pdfjsLib,null,t.uuid,t.moment,null,t.ng.cdk.overlay,t.ng.router,t.ng.cdk.a11y,t.mutableDiv,t.ngxChips,t.ngxDatatable,t.uuid$1,t.effects$1,t.angularTreeComponent)}(this,(function(t,e,n,o,i,a,s,r,c,l,u,p,d,h,m,g,b,f,v,y,w,S,k){"use strict";function E(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function C(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var I=C(e),O=C(i),P=C(c),x=C(l),j=E(p),T=E(d),_=E(w),D=function(t,e){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},D(t,e)};function R(t,e,n,o){var i,a=arguments.length,s=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var r=t.length-1;r>=0;r--)(i=t[r])&&(s=(a<3?i(s):a>3?i(e,n,s):i(e,n))||s);return a>3&&s&&Object.defineProperty(e,n,s),s}function B(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function N(t,e,n,o){return new(n||(n=Promise))((function(i,a){function s(t){try{c(o.next(t))}catch(t){a(t)}}function r(t){try{c(o.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,r)}c((o=o.apply(t,e||[])).next())}))}function A(t,e){var n,o,i,a,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function r(r){return function(c){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,r[0]&&(s=0)),s;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,o=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(6===r[0]&&s.label<i[1]){s.label=i[1],i=r;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(r);break}i[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,c])}}}Object.create;function M(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function F(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,a=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=a.next()).done;)s.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return s}function L(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(F(arguments[e]));return t}var $;Object.create;x.GlobalWorkerOptions.workerSrc="/assets/build/pdf.worker.min.js",function(t){t[t.FOUND=0]="FOUND",t[t.NOT_FOUND=1]="NOT_FOUND",t[t.WRAPPED=2]="WRAPPED",t[t.PENDING=3]="PENDING"}($||($={}));var H=function(){function t(t,e,n,o,i,a,s,r,c,l){var u=this;this.pdfViewer=t,this.downloadManager=e,this.toolbarEvents=n,this.documentLoadInit=o,this.documentLoadProgress=i,this.documentLoaded=a,this.outlineLoaded=s,this.documentLoadFailed=r,this.pageRendered=c,this.positionUpdated=l,this.pdfViewer.eventBus.on("updateviewarea",(function(t){return l.next(t)})),this.pdfViewer.eventBus.on("pagechanging",(function(t){return u.toolbarEvents.setCurrentPageInputValueSubject.next(t.pageNumber)})),this.pdfViewer.eventBus.on("pagesinit",(function(){return u.pdfViewer.currentScaleValue="1"})),this.pdfViewer.eventBus.on("pagerendered",(function(t){})),this.pdfViewer.eventBus.on("pagesloaded",(function(t){return u.emitDocumentInfo(t)})),this.pdfViewer.eventBus.on("scalechanging",(function(t){return u.emitDocumentInfo(t)})),this.pdfViewer.eventBus.on("rotationchanging",(function(t){return u.emitDocumentInfo(t)})),this.pdfViewer.eventBus.on("updatefindcontrolstate",(function(t){t.state!==$.PENDING&&u.toolbarEvents.searchResultsCountSubject.next(t.matchesCount)})),this.pdfViewer.eventBus.on("updatefindmatchescount",(function(t){u.toolbarEvents.searchResultsCountSubject.next(t.matchesCount)})),this.zoomValue=1}return t.prototype.emitDocumentInfo=function(t){var e=L(this.pdfViewer._pages).map((function(t){return{div:t.div,scale:t.scale,rotation:t.rotation,id:t.id,viewportScale:t.viewport.scale}}));this.pageRendered.next(e)},t.prototype.loadDocument=function(t){return N(this,void 0,void 0,(function(){var e,n,o,i,a,s=this;return A(this,(function(r){switch(r.label){case 0:(e=this.createLoadingTask(t)).onProgress=function(t){var e=t.loaded,n=t.total;s.documentLoadProgress.next({loaded:e,total:n})},this.documentLoadInit.next(t),r.label=1;case 1:return r.trys.push([1,6,,7]),[4,e.promise];case 2:return n=r.sent(),this.documentLoaded.next(n),this.toolbarEvents.pageCountSubject.next(n.numPages),this.pdfViewer.setDocument(n),this.pdfViewer.linkService.setDocument(n,null),[4,n.getOutline()];case 3:return o=r.sent(),[4,this.setOutlinePageNumbers(n,o)];case 4:return r.sent(),this.documentOutline=o,this.outlineLoaded.next(this.documentOutline),[4,n.getMetadata()];case 5:return i=r.sent(),this.setCurrentPDFTitle(i.info.Title),[3,7];case 6:return a=r.sent(),this.documentLoadFailed.next(a),[3,7];case 7:return[2]}}))}))},t.prototype.createLoadingTask=function(t){return x.getDocument({url:t,cMapUrl:"assets/minified/cmaps",cMapPacked:!0,withCredentials:!0})},t.prototype.setOutlinePageNumbers=function(t,e){return N(this,void 0,void 0,(function(){var n=this;return A(this,(function(o){return e.forEach((function(e){return N(n,void 0,void 0,(function(){return A(this,(function(n){switch(n.label){case 0:return[4,this.setNestedOutlinePageNumbers(t,e)];case 1:return n.sent(),[2]}}))}))})),[2]}))}))},t.prototype.setNestedOutlinePageNumbers=function(t,e){return N(this,void 0,void 0,(function(){var n,o=this;return A(this,(function(i){switch(i.label){case 0:return n=e,[4,this.getOutlinePageNumber(t,e)];case 1:return n.pageNumber=i.sent(),e.items.forEach((function(e){return N(o,void 0,void 0,(function(){var n;return A(this,(function(o){switch(o.label){case 0:return n=e,[4,this.getOutlinePageNumber(t,e)];case 1:return n.pageNumber=o.sent(),this.setNestedOutlinePageNumbers(t,e),[2]}}))}))})),[2]}}))}))},t.prototype.getOutlinePageNumber=function(t,e){return N(this,void 0,void 0,(function(){var n,o;return A(this,(function(i){switch(i.label){case 0:return n=e.dest,[4,t.getPageIndex(n[0])];case 1:return o=i.sent(),[2,Number(o)+1]}}))}))},t.prototype.downloadFile=function(t,e){this.downloadManager.downloadUrl(t,e)},t.prototype.setPageNumber=function(t){this.pdfViewer.currentPageNumber=t},t.prototype.getPageNumber=function(){return this.pdfViewer.currentPageNumber},t.prototype.changePageNumber=function(t){this.pdfViewer.currentPageNumber+=t},t.prototype.search=function(t){var e=t.reset?"find":"findagain";this.pdfViewer.findController.executeCommand(e,{query:t.searchTerm,phraseSearch:!0,caseSensitive:t.matchCase,entireWord:t.wholeWord,highlightAll:t.highlightAll,findPrevious:t.previous})},t.prototype.clearSearch=function(){this.pdfViewer.eventBus.dispatch("findbarclose")},t.prototype.navigateTo=function(t){t instanceof Object&&(t[1].name.includes("XYZ")||(t[1]={name:"XYZ"},t[2]=t[2]||null,t[3]=t[3]||null),t[4]=this.zoomValue),this.pdfViewer.linkService.navigateTo(t)},t.prototype.setZoom=function(t){this.pdfViewer.currentScaleValue=this.getZoomValue(t),this.zoomValue=this.pdfViewer.currentScaleValue,this.toolbarEvents.zoomValueSubject.next(this.pdfViewer.currentScaleValue)},t.prototype.stepZoom=function(t){this.pdfViewer.currentScaleValue=+this.getZoomValue(+this.pdfViewer.currentScaleValue+t),this.zoomValue=this.pdfViewer.currentScaleValue,this.toolbarEvents.zoomValueSubject.next(this.pdfViewer.currentScaleValue)},t.prototype.getZoomValue=function(t){return isNaN(t)?this.zoomValue:t>5?5:t<.1?.1:+t.toFixed(2)},t.prototype.rotate=function(t){return this.pdfViewer.pagesRotation=(this.pdfViewer.pagesRotation+t)%360},t.prototype.resetRotation=function(t){return this.pdfViewer.pagesRotation=t},t.prototype.getNormalisedPagesRotation=function(){return this.pdfViewer.pagesRotation},t.prototype.getCurrentPDFZoomValue=function(){return this.pdfViewer.currentScaleValue},t.prototype.setCurrentPDFTitle=function(t){this.documentTitle=t},t.prototype.getCurrentPDFTitle=function(){return this.documentTitle},t}(),V=new a.BehaviorSubject(!1),U=new a.Subject,z=new a.Subject,W=new a.Subject,q=new a.BehaviorSubject(!1),G=new a.Subject,Z=new a.BehaviorSubject(!1),J=function(){U.next()},Y=Object.freeze({__proto__:null,enabled:V,sessionLaunch:U,becomingPresenter:z,stoppingPresenting:W,leavingSession:q,sessionExitConfirmed:G,participantsListVisible:Z,launchSession:J,enable:function(){V.next(!0),J()},becomePresenter:function(){z.next()},stopPresenting:function(){W.next()},leaveSession:function(){q.next(!0)},confirmExit:function(){G.next(),Z.next(!1),V.next(!1)}}),X=function(){function t(){this.highlightModeSubject=new a.BehaviorSubject(!1),this.drawModeSubject=new a.BehaviorSubject(!1),this.rotateSubject=new a.Subject,this.searchSubject=new a.Subject,this.searchResultsCountSubject=new a.Subject,this.zoomSubject=new a.Subject,this.stepZoomSubject=new a.Subject,this.zoomValueSubject=new a.BehaviorSubject(1),this.pageCountSubject=new a.Subject,this.printSubject=new a.Subject,this.downloadSubject=new a.Subject,this.setCurrentPageSubject=new a.Subject,this.setCurrentPageInputValueSubject=new a.Subject,this.changePageByDeltaSubject=new a.Subject,this.showCommentSummary=new a.BehaviorSubject(!1),this.grabNDrag=new a.BehaviorSubject(!1),this.saveRotationSubject=new a.Subject,this.redactionMode=new a.BehaviorSubject(!1),this.redactionPreview=new a.Subject,this.applyRedactToDocument=new a.Subject,this.clearAllRedactMarkers=new a.Subject,this.sidebarOpen=new a.BehaviorSubject(!1),this.searchBarHidden=new a.BehaviorSubject(!0),this.commentsPanelVisible=new a.BehaviorSubject(!1),this.icp=Y}return t.prototype.reset=function(){this.setCurrentPageSubject.next(1),this.zoomValueSubject.next(1),this.highlightModeSubject.next(!1),this.drawModeSubject.next(!1),this.showCommentSummary.next(!1)},t.prototype.toggleHighlightMode=function(){!1===this.highlightModeSubject.getValue()?(this.drawModeSubject.next(!1),this.highlightModeSubject.next(!0)):this.highlightModeSubject.next(!1)},t.prototype.toggleDrawMode=function(){!1===this.drawModeSubject.getValue()?(this.highlightModeSubject.next(!1),this.drawModeSubject.next(!0)):this.drawModeSubject.next(!1)},t.prototype.rotate=function(t){this.rotateSubject.next(t)},t.prototype.search=function(t){this.searchSubject.next(t)},t.prototype.getSearchResultsCount=function(){return this.searchResultsCountSubject.asObservable()},t.prototype.zoom=function(t){this.zoomSubject.next(t)},t.prototype.stepZoom=function(t){this.stepZoomSubject.next(t)},t.prototype.getZoomValue=function(){return this.zoomValueSubject.asObservable()},t.prototype.getPageCount=function(){return this.pageCountSubject.asObservable()},t.prototype.print=function(){this.printSubject.next()},t.prototype.download=function(){this.downloadSubject.next()},t.prototype.setPage=function(t){this.setCurrentPageSubject.next(t)},t.prototype.incrementPage=function(t){this.changePageByDeltaSubject.next(t)},t.prototype.getCurrentPageNumber=function(){return this.setCurrentPageInputValueSubject.asObservable()},t.prototype.getShowCommentSummary=function(){return this.showCommentSummary.asObservable()},t.prototype.toggleCommentsSummary=function(t){this.showCommentSummary.next(t)},t.prototype.saveRotation=function(){this.saveRotationSubject.next()},t.prototype.toggleGrabNDrag=function(){this.grabNDrag.next(!this.grabNDrag.getValue())},t.prototype.toggleSideBar=function(t){this.sidebarOpen.next(t)},t.prototype.toggleRedactionMode=function(){this.redactionMode.next(!this.redactionMode.getValue())},t.prototype.toggleRedactionPreview=function(t){this.redactionPreview.next(t)},t.prototype.unmarkAll=function(){this.clearAllRedactMarkers.next()},t.prototype.applyRedactionToDocument=function(){this.applyRedactToDocument.next()},t.prototype.toggleCommentsPanel=function(t){t&&this.toggleParticipantsList(!t),this.commentsPanelVisible.next(t)},t.prototype.toggleParticipantsList=function(t){t&&this.toggleCommentsPanel(!t),this.icp.participantsListVisible.next(t)},t}();X.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new X},token:X,providedIn:"root"}),X.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}];var K=function(){function t(t){this.toolbarEvents=t,this.linkService=new P.PDFLinkService,this.eventBus=new P.EventBus}return t.prototype.create=function(t){var e=new P.PDFFindController({linkService:this.linkService,eventBus:this.eventBus}),n=new P.PDFViewer({container:t.nativeElement,linkService:this.linkService,findController:e,eventBus:this.eventBus,imageResourcesPath:"/assets/images/",textLayerMode:2});return this.linkService.setViewer(n),this.pdfJsWrapper=new H(n,new P.DownloadManager({}),this.toolbarEvents,new a.Subject,new a.Subject,new a.Subject,new a.Subject,new a.Subject,new a.Subject,new a.Subject),this.pdfJsWrapper},t.prototype.pdfWrapper=function(){return this.pdfJsWrapper},t}();K.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new K(I.ɵɵinject(X))},token:K,providedIn:"root"}),K.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],K.ctorParameters=function(){return[{type:X}]};var Q,tt=function(){function t(){}return t.prototype.printDocumentNatively=function(t){window.open(t).print()},t.prototype.printElementNatively=function(t,e,n){var o=window.open("","","left=0,top=0,width="+e+",height="+n+",toolbar=0,scrollbars=0,status=0");o.document.write(t.innerHTML),o.document.close(),o.focus(),o.print(),o.close()},t}();tt.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new tt},token:tt,providedIn:"root"}),tt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ResponseType=void 0,(Q=t.ResponseType||(t.ResponseType={})).SUCCESS="SUCCESS",Q.FAILURE="FAILURE",Q.UNSUPPORTED="UNSUPPORTED";var et=function(t,e){this.exceptionType=t,this.detail=e},nt=function(){function t(){this.showPrint=!1,this.showDownload=!1,this.showNavigation=!1,this.showZoom=!1,this.showRotate=!1,this.showPresentationMode=!1,this.showRedact=!1,this.showOpenFile=!1,this.showBookmark=!1,this.showHighlightButton=!1,this.showDrawButton=!1,this.showSearchBar=!1,this.showSidebar=!1,this.showCommentSummary=!1,this.showGrabNDragButton=!1,this.showSaveRotationButton=!1}return t.prototype.setup=function(t){for(var e in this.showPrint=!1,this.showDownload=!1,this.showNavigation=!1,this.showZoom=!1,this.showRotate=!1,this.showPresentationMode=!1,this.showRedact=!1,this.showOpenFile=!1,this.showBookmark=!1,this.showHighlightButton=!1,this.showDrawButton=!1,this.showSearchBar=!1,this.showSidebar=!1,this.showCommentSummary=!1,this.showGrabNDragButton=!1,this.showSaveRotationButton=!1,t)this[e]=t[e]},t}();nt.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new nt},token:nt,providedIn:"root"}),nt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}];var ot={showPrint:!0,showDownload:!0,showNavigation:!0,showZoom:!0,showRotate:!0,showSearchBar:!0,showSidebar:!0,showGrabNDragButton:!0,showCommentSummary:!0,showPresentationMode:!0,showRedact:!0},it={showPrint:!0,showDownload:!0,showZoom:!0,showRotate:!0,showGrabNDragButton:!0,showCommentSummary:!0,showRedact:!0},at={showDownload:!0},st={showDownload:!0,showPrint:!0},rt="[Document] Set Document Id",ct="[Document] Position Updated",lt="[Document] Add Pages",ut="[Document] Convert",pt="[Document] Convert Success",dt="[Document] Convert Fail",ht="[Document] Clear Convert Doc Url",mt="[Document] Load Rotation",gt="[Document] Load Rotation Success",bt="[Document] Load Rotation Fail",ft="[Document] Save Rotation",vt="[Document] Save Rotation Success",yt=function(t){this.payload=t,this.type=rt},wt=function(t){this.payload=t,this.type=lt},St=function(t){this.payload=t,this.type=ct},kt=function(t){this.payload=t,this.type=ut},Et=function(t){this.payload=t,this.type=pt},Ct=function(t){this.payload=t,this.type=dt},It=function(){this.type=ht},Ot=function(t){this.payload=t,this.type=mt},Pt=function(t){this.payload=t,this.type=gt},xt=function(t){this.payload=t,this.type=bt},jt=function(t){this.payload=t,this.type=ft},Tt=function(t){this.payload=t,this.type=vt},_t=function(t){this.payload=t,this.type="[Document] Save Rotation Fail"},Dt="[Tags] Add Filter Tags",Rt="[Tags] Clear Filter Tags",Bt=function(t){this.payload=t,this.type=Dt},Nt=function(){this.type=Rt},At="[Icp] Set Case Id",Mt="[Icp] Load Session",Ft="[Icp] Join Socket Session",Lt="[Icp] Socket Session Joined",$t="[Icp] Leave Socket Session",Ht="[Icp] Presenter Updated",Vt="[Icp] Participant List Updated",Ut=function(t){this.payload=t,this.type=At},zt=function(t){this.payload=t,this.type=Mt},Wt=function(t){this.payload=t,this.type="[Icp] Load Session Failure"},qt=function(t){this.payload=t,this.type=Ft},Gt=function(t){this.payload=t,this.type=Lt},Zt=function(){this.type=$t},Jt=function(t){this.payload=t,this.type=Ht},Yt=function(t){this.payload=t,this.type=Vt},Xt={convertedDocument:void 0,documentId:void 0,pdfPosition:void 0,pages:{},hasDifferentPageSize:!1,rotation:void 0,rotationLoaded:!1,loading:!1,loaded:!1};function Kt(t,e){switch(void 0===t&&(t=Xt),e.type){case pt:var n={url:e.payload,error:void 0};return Object.assign(Object.assign({},t),{convertedDocument:n});case dt:n={url:void 0,error:e.payload};return Object.assign(Object.assign({},t),{convertedDocument:n});case ht:n=void 0;return Object.assign(Object.assign({},t),{convertedDocument:n});case mt:return Object.assign(Object.assign({},t),{rotationLoaded:!1});case gt:var o=(i=e.payload)?i.rotationAngle:0;return Object.assign(Object.assign({},t),{rotation:o,rotationLoaded:!0});case bt:return Object.assign(Object.assign({},t),{rotation:0,rotationLoaded:!0});case vt:var i;o=(i=e.payload).rotationAngle;return Object.assign(Object.assign({},t),{rotation:o});case rt:return Object.assign(Object.assign({},t),{documentId:e.payload});case lt:var a,s,r=e.payload,c={},l=t.hasDifferentPageSize;return r.forEach((function(t){var e;l||!a||!s||a===t.div.scrollHeight&&s===t.div.scrollWidth?(a=t.div.scrollHeight,s=t.div.scrollWidth):l=!0;var n={styles:{left:t.div.offsetLeft,height:t.div.scrollHeight,width:t.div.scrollWidth},scaleRotation:{scale:t.scale,rotation:t.rotation},viewportScale:t.viewportScale};c=Object.assign(Object.assign({},c),((e={})[t.id]=n,e))})),Object.assign(Object.assign({},t),{pages:c,hasDifferentPageSize:l});case ct:var u=e.payload;return Object.assign(Object.assign({},t),{pdfPosition:u})}return t}var Qt=function(t){return t.pages},te="[Annotations] Load Annotation Set",ee="[Annotations] Load Annotation Set Success",ne="[Annotations] Load Annotation Set Fail",oe="[Annotations] Save Annotation",ie="[Annotations] Save Annotation Success",ae="[Annotations] Save Annotation Fail",se="[Annotations] Add or Edit Comment",re="[Annotations] Delete Annotation",ce="[Annotations] Delete Annotation Success",le="[Annotations] Delete Annotation Fail",ue="[Annotations] Select Annotation",pe="[Comments] Search Comments",de="[Comments] Apply Comment Summary Filter",he="[Comments] Clear Comment Summary Filter",me=function(t){this.payload=t,this.type=te},ge=function(t){this.payload=t,this.type=ee},be=function(t){this.payload=t,this.type=ne},fe=function(t){this.payload=t,this.type=oe},ve=function(t){this.payload=t,this.type=ie},ye=function(t){this.payload=t,this.type=ae},we=function(t){this.payload=t,this.type=se},Se=function(t){this.payload=t,this.type=re},ke=function(t){this.payload=t,this.type=ce},Ee=function(t){this.payload=t,this.type=le},Ce=function(t){this.payload=t,this.type=ue},Ie=function(t){this.payload=t,this.type=pe},Oe=function(t){this.payload=t,this.type=de},Pe=function(){this.type=he},xe=function(){function t(){}return t.groupByKeyEntities=function(t,e){return t.reduce((function(t,n){var o;return Object.assign(t,((o={})[n[e]]=(t[n[e]]||[]).concat(n),o))}),{})},t.generateCommentsEntities=function(t){return t.reduce((function(t,e){var n;if(e.comments.length){var o=Object.assign(Object.assign({},e.comments[0]||""),{tags:L(e.tags||[])});return Object.assign(Object.assign({},t),((n={})[e.id]=o,n))}return Object.assign({},t)}),{})},t.genTagNameEntities=function(t){var e=this,n=t.filter((function(t){return t.comments.length&&t.tags.length})).map((function(t){return e.groupByKeyEntities(t.tags,"name")})).reduce((function(t,e){return Object.assign(Object.assign({},t),e)}),{});return this.genNameEnt(t,n)},t.genNameEnt=function(t,e){return Object.keys(e).reduce((function(e,n){var o,i=t.filter((function(t){return t.tags.find((function(t){return t.name===n}))})).map((function(t){return t.id})).reduce((function(t,e){var n;return Object.assign(Object.assign({},t),((n={})[e]=e,n))}),{});return Object.assign(Object.assign({},e),((o={})[n]=i,o))}),{})},t.generateAnnotationEntities=function(t){return t.reduce((function(t,e){var n,o=Object.assign(Object.assign({},e),{positionTop:e.rectangles[0].y});return Object.assign(Object.assign({},t),((n={})[e.id]=o,n))}),{})},t.generateRedactionEntities=function(t){return t.reduce((function(t,e){var n;return Object.assign(Object.assign({},t),((n={})[e.redactionId]=e,n))}),{})},t.resetCommentEntSelect=function(t){return Object.keys(t).reduce((function(e,n){return e[n]=Object.assign(Object.assign({},t[n]),{editable:!1,selected:!1}),e}),{})},t.filterCommentsSummary=function(t,e){if(Object.keys(e).length){var n=Object.keys(e.tagFilters).filter((function(t){return!0===e.tagFilters[t]})).length,o=e.dateRangeFrom||e.dateRangeTo,i=t.filter((function(t){var n=!1,i=!1;if(e.hasOwnProperty("tagFilters")&&Object.keys(e.tagFilters).forEach((function(o){if(e.tagFilters[o])return t.tags.forEach((function(t){t.name!==o||n||(n=!0)}))})),o){var a=T.default(t.lastModifiedDate),s=null!==e.dateRangeFrom?T.default(e.dateRangeFrom):void 0,r=null!==e.dateRangeTo?T.default(e.dateRangeTo):void 0;r&&s&&a>s&&a<r&&(i=!0),r&&!s&&a<=r&&(i=!0),s&&!r&&a>s&&(i=!0)}return n||i}));return n||o?i:t}return t},t}(),je={annotationSet:{},annotationEntities:{},commentEntities:{},annotationPageEntities:{},selectedAnnotation:null,commentSearchQueries:{commentSearch:""},commentSummaryFilters:{hasFilter:!1,filters:{}},loading:!1,loaded:!1};function Te(t,e){var n,o,i,a,s;switch(void 0===t&&(t=je),e.type){case te:var r=Object.assign(Object.assign({},t.annotationSet),{documentId:e.payload});return Object.assign(Object.assign({},je),{annotationSet:r,loading:!0});case ee:case ne:r=200===e.payload.status?e.payload.body:Object.assign(Object.assign({},t.annotationSet),{annotations:[],id:j.default()});var c=xe.generateAnnotationEntities(r.annotations),l=xe.groupByKeyEntities(r.annotations,"page"),u=xe.generateCommentsEntities(r.annotations);return Object.assign(Object.assign({},t),{annotationSet:r,annotationEntities:c,annotationPageEntities:l,commentEntities:u,loading:!1,loaded:!0});case ie:var p=e.payload,d=Object.assign(Object.assign({},t.annotationEntities),((n={})[p.id]=p,n)),h=Object.keys(d).map((function(t){return d[t]})),m=(c=xe.generateAnnotationEntities(h),l=xe.groupByKeyEntities(h,"page"),u=xe.generateCommentsEntities(h),Object.assign(Object.assign({},t.selectedAnnotation),{annotationId:p.id,editable:!1}));return Object.assign(Object.assign({},t),{annotationEntities:c,annotationPageEntities:l,commentEntities:u,selectedAnnotation:m,loading:!1,loaded:!0});case ce:var g=e.payload,b=t.annotationEntities[g].page;delete(c=Object.assign({},t.annotationEntities))[g];var f=L(t.annotationPageEntities[b].filter((function(t){return t.id!==g})));l=Object.assign(Object.assign({},t.annotationPageEntities),((o={})[b]=f,o)),u=Object.assign({},t.commentEntities);return t.commentEntities[g]&&delete u[g],Object.assign(Object.assign({},t),{annotationEntities:c,annotationPageEntities:l,commentEntities:u});case se:var v=((i={})[e.payload.annotationId]=e.payload,i),y=Object.assign(Object.assign({},t.commentEntities),v);return Object.assign(Object.assign({},t),{commentEntities:y});case ue:var w=e.payload,S=Object.assign(Object.assign({},t.commentEntities[w.annotationId]),{editable:w.editable,selected:w.selected}),k=xe.resetCommentEntSelect(Object.assign({},t.commentEntities));u=w.annotationId&&t.commentEntities[w.annotationId]?Object.assign(Object.assign({},k),((a={})[w.annotationId]=S,a)):Object.assign({},k);return Object.assign(Object.assign({},t),{commentEntities:u,selectedAnnotation:e.payload});case pe:var E=Object.assign(Object.assign({},t.commentSearchQueries),{commentSearch:e.payload});u=xe.resetCommentEntSelect(Object.assign({},t.commentEntities));return Object.assign(Object.assign({},t),{commentEntities:u,commentSearchQueries:E});case de:var C=e.payload,I={hasFilter:(s=!1,C.tagFilters&&Object.keys(C.tagFilters).map((function(t){C.tagFilters[t]&&!s&&(s=!0)})),s||!!C.dateRangeFrom||!!C.dateRangeTo),filters:C};return Object.assign(Object.assign({},t),{commentSummaryFilters:I});case he:return Object.assign(Object.assign({},t),{commentSummaryFilters:Object.assign({},je.commentSummaryFilters)})}return t}var _e=function(t){return t.annotationSet},De=function(t){return t.commentEntities},Re=function(t){return t.annotationPageEntities},Be=function(t){return t.annotationEntities},Ne=function(t){return t.selectedAnnotation},Ae=function(t){return t.commentSearchQueries},Me=function(t){return t.commentSummaryFilters},Fe={tagNameEnt:{},annotations:[],filteredPageEntities:{},filteredComments:{},formFilterState:{},filters:[]};function Le(t,e){switch(void 0===t&&(t=Fe),e.type){case te:return Object.assign(Object.assign({},t),Fe);case ee:var n=e.payload.body.annotations,o=xe.genTagNameEntities(n);return Object.assign(Object.assign({},t),{tagNameEnt:o,annotations:n});case ie:var i=e.payload,a=L(t.annotations).filter((function(t){return t.id!==i.id}))||[];n=L(a,[i]),o=xe.genTagNameEntities(n);return Object.assign(Object.assign({},t),{annotations:n,tagNameEnt:o});case ce:var s=e.payload,r=(n=L(t.annotations).filter((function(t){return t.id!==s})),o=xe.genTagNameEntities(n),xe.groupByKeyEntities(n,"page"));return delete(u=Object.assign({},t.filteredComments))[s],Object.assign(Object.assign({},t),{annotations:n,tagNameEnt:o,filteredComments:u,filteredPageEntities:r,filters:[]});case Dt:var c=e.payload,l=Object.keys(c).reduce((function(t,e){return c[e]?L(t,[e]):t}),[]),u=l.reduce((function(e,n){return Object.assign(Object.assign({},e),t.tagNameEnt[n])}),{});n=Object.keys(u).map((function(e){return t.annotations.filter((function(t){return t.id===e}))[0]})),r=xe.groupByKeyEntities(n,"page");return Object.assign(Object.assign({},t),{filters:l,filteredComments:u,filteredPageEntities:r});case Rt:return Object.assign(Object.assign({},t),{filters:[],filteredComments:{},filteredPageEntities:{}})}return t}var $e=function(t){return t.filteredComments},He=function(t){return t.filteredPageEntities},Ve="[Bookmarks] Load Bookmarks",Ue="[Bookmarks] Load Bookmarks Success",ze="[Bookmarks] Load Bookmarks Failure",We="[Bookmarks] Create Bookmark",qe="[Bookmarks] Create Bookmark Success",Ge="[Bookmarks] Delete Bookmark",Ze="[Bookmarks] Delete Bookmark Success",Je="[Bookmarks] Move Bookmark",Ye="[Bookmarks] Move Bookmark Success",Xe="[Bookmarks] Update Bookmark",Ke="[Bookmarks] Update Bookmark Success",Qe=function(){this.type=Ve},tn=function(t){this.payload=t,this.type=Ue},en=function(t){this.payload=t,this.type=ze},nn=function(t){this.payload=t,this.type=We},on=function(t){this.payload=t,this.type=qe},an=function(t){this.payload=t,this.type="[Bookmarks] Create Bookmark Failure"},sn=function(t){this.payload=t,this.type=Ge},rn=function(t){this.payload=t,this.type=Ze},cn=function(t){this.payload=t,this.type="[Bookmarks] Delete Bookmark Failure"},ln=function(t){this.payload=t,this.type=Je},un=function(t){this.payload=t,this.type=Ye},pn=function(t){this.payload=t,this.type="[Bookmarks] Move Bookmark Failure"},dn=function(t){this.payload=t,this.type=Xe},hn=function(t){this.payload=t,this.type=Ke},mn=function(t){this.payload=t,this.type="[Bookmarks] Update Bookmark Failure"},gn=function(t){return t?t.reduce((function(t,e){return e.children&&e.children.length>0?L(t,[e.id],gn(e.children)):L(t,[e.id])}),[]):[]},bn=function(t){return t.reduce((function(t,e){var n;return Object.assign(t,((n={})[e.id]=e,n))}),{})},fn=function(t){for(var e=Object.keys(t),n=function(n){var o=[];e.forEach((function(i){t[i].previous&&e.includes(t[i].previous.toString())||(t[i].index=n,o.push(i))})),o.forEach((function(t){return e.splice(e.indexOf(t),1)})),o=[]},o=0;e.length>0;o++)n(o)},vn={bookmarks:[],bookmarkEntities:{},bookmarkPageEntities:{},editableBookmark:void 0,loaded:!1,loading:!1};function yn(t,e){var n,o;switch(void 0===t&&(t=vn),e.type){case Ve:return Object.assign(Object.assign({},t),{loading:!0});case Ue:case ze:var i=200===e.payload.status?e.payload.body:[],a=bn(i),s=xe.groupByKeyEntities(i,"pageNumber");return Object.assign(Object.assign({},t),{bookmarks:i,bookmarkEntities:a,bookmarkPageEntities:s,loaded:!0});case qe:var r=e.payload,c=Object.assign(Object.assign({},t.bookmarkEntities),((n={})[r.id]=r,n)),l=Object.keys(c).map((function(t){return c[t]})),u=(s=xe.groupByKeyEntities(l,"pageNumber"),r.id);return Object.assign(Object.assign({},t),{bookmarkEntities:c,editableBookmark:u,bookmarkPageEntities:s,loading:!1,loaded:!0});case Ye:var p=bn(e.payload);a=Object.assign(Object.assign({},t.bookmarkEntities),p);return Object.assign(Object.assign({},t),{bookmarkEntities:a,loading:!1,loaded:!0});case Ze:var d=e.payload,h=Object.assign({},t.bookmarkEntities),m=Object.assign({},t.bookmarkPageEntities),g={};return d.forEach((function(t){void 0!==g[h[t].pageNumber]&&g[h[t].pageNumber].length>0?g[h[t].pageNumber].push(t):g[h[t].pageNumber]=[t],delete h[t]})),Object.entries(g).forEach((function(t){var e=F(t,2),n=e[0],o=e[1];m[n]=m[n].filter((function(t){return o.includes(t)}))})),Object.assign(Object.assign({},t),{bookmarkEntities:h,bookmarkPageEntities:m,loading:!1,loaded:!0});case Ke:r=e.payload;var b=Object.assign(Object.assign({},t.bookmarkEntities),((o={})[r.id]=Object.assign({},r),o));l=Object.keys(b).map((function(t){return b[t]})),s=xe.groupByKeyEntities(l,"pageNumber"),u=void 0;return Object.assign(Object.assign({},t),{bookmarkEntities:b,editableBookmark:u,bookmarkPageEntities:s,loading:!1,loaded:!0})}return t}var wn="[Redaction] Load Redaction",Sn="[Redaction] Load Redaction Success",kn="[Redaction] Save Redaction",En="[Redaction] Save Redaction Success",Cn="[Redaction] Delete Redaction",In="[Redaction] Delete Redaction Success",On="[Redaction] Select Redaction",Pn="[Redaction] Redact",xn="[Redaction] Redact Success",jn="[Redaction] Reset Redacted Document",Tn="[Redaction] Unmark All",_n="[Redaction] Unmark All Success",Dn=function(t){this.payload=t,this.type=wn},Rn=function(t){this.payload=t,this.type=Sn},Bn=function(t){this.payload=t,this.type="[Redaction] Load Redaction Fail"},Nn=function(t){this.payload=t,this.type=kn},An=function(t){this.payload=t,this.type=En},Mn=function(t){this.payload=t,this.type="[Redaction] Save Redaction Fail"},Fn=function(t){this.payload=t,this.type=Cn},Ln=function(t){this.payload=t,this.type=In},$n=function(t){this.payload=t,this.type="[Redaction] Delete Redaction Fail"},Hn=function(t){this.payload=t,this.type=On},Vn=function(t){this.payload=t,this.type=Pn},Un=function(t){this.payload=t,this.type=xn},zn=function(t){this.payload=t,this.type="[Redaction] Redact Fail"},Wn=function(){this.type=jn},qn=function(t){this.payload=t,this.type=Tn},Gn=function(){this.type=_n},Zn={redactionEntities:{},redactionPageEntities:{},selectedRedaction:{},redactedDocumentInfo:void 0,documentId:void 0};function Jn(t,e){var n,o;switch(void 0===t&&(t=Zn),e.type){case wn:return Object.assign(Object.assign({},t),Zn);case Sn:if(s=e.payload){var i=xe.generateRedactionEntities(s),a=xe.groupByKeyEntities(s,"page");return Object.assign(Object.assign({},t),{redactionEntities:i,redactionPageEntities:a})}return Object.assign({},t);case En:var s=e.payload,r=Object.assign(Object.assign({},t.redactionEntities),((n={})[s.redactionId]=s,n)),c=Object.keys(r).map((function(t){return r[t]}));a=xe.groupByKeyEntities(c,"page");return Object.assign(Object.assign({},t),{redactionEntities:r,redactionPageEntities:a});case On:case ue:return Object.assign(Object.assign({},t),{selectedRedaction:e.payload});case In:var l=e.payload.page,u=e.payload.redactionId;delete(i=Object.assign({},t.redactionEntities))[u];var p=L(t.redactionPageEntities[l].filter((function(t){return t.redactionId!==u})));a=Object.assign(Object.assign({},t.redactionPageEntities),((o={})[l]=p,o));return Object.assign(Object.assign({},t),{redactionPageEntities:a,redactionEntities:i});case xn:var d=e.payload;return Object.assign(Object.assign(Object.assign({},t),Zn),{redactedDocumentInfo:d});case jn:return Object.assign(Object.assign({},t),{redactedDocumentInfo:void 0});case _n:return Object.assign(Object.assign({},t),Zn)}return t}var Yn={session:null,presenter:null,client:null,participants:[]};function Xn(t,e){switch(void 0===t&&(t=Yn),e.type){case At:var n=e.payload,o=Object.assign(Object.assign({},t.session),{caseId:n});return Object.assign(Object.assign({},t),{session:o});case Lt:o=e.payload.session;var i=e.payload.participantInfo;return Object.assign(Object.assign({},t),{session:o,client:i.client,presenter:i.presenter});case Vt:var a=e.payload,s=Object.keys(a).map((function(t){return{id:t,username:a[t]}}));return Object.assign(Object.assign({},t),{participants:s});case Ht:var r=e.payload;return Object.assign(Object.assign({},t),{presenter:r});case $t:return Object.assign(Object.assign({},t),Yn)}return t}var Kn,Qn={document:Kt,annotations:Te,tags:Le,bookmarks:yn,redactions:Jn,icp:Xn},to=r.createFeatureSelector("media-viewer"),eo=r.createSelector(to,(function(t){return t.document})),no=r.createSelector(eo,Qt),oo=(r.createSelector(no,(function(t){return Object.values(t)})),r.createSelector(eo,(function(t){return t.documentId}))),io=r.createSelector(eo,(function(t){return t.pdfPosition})),ao=r.createSelector(eo,(function(t){return t.hasDifferentPageSize})),so=r.createSelector(eo,(function(t){return t.convertedDocument})),ro=r.createSelector(eo,(function(t){return t.rotation})),co=r.createSelector(eo,(function(t){return t.rotationLoaded})),lo=function(){function t(){this.textHighlight=new a.Subject,this.boxHighlight=new a.Subject,this.ctxToolbarCleared=new a.Subject,this.navigationEvent=new a.Subject}return t.prototype.textSelected=function(t){this.textHighlight.next(t)},t.prototype.boxSelected=function(t){this.boxHighlight.next(t)},t.prototype.clearCtxToolbar=function(){this.ctxToolbarCleared.next()},t.prototype.goToDestination=function(t){this.navigationEvent.next(t)},t}();lo.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new lo},token:lo,providedIn:"root"}),lo.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],lo.ctorParameters=function(){return[]},function(t){t.SESSION_JOINED="IcpClientJoinedSession",t.CLIENT_DISCONNECTED="IcpClientDisconnectedFromSession",t.NEW_PARTICIPANT_JOINED="IcpNewParticipantJoinedSession",t.REMOVE_PARTICIPANT="IcpRemoveParticipantFromList",t.PARTICIPANTS_UPDATED="IcpParticipantsListUpdated",t.UPDATE_PRESENTER="IcpNewPresenterStartsPresenting",t.PRESENTER_UPDATED="IcpPresenterUpdated",t.UPDATE_SCREEN="IcpUpdateScreen",t.SCREEN_UPDATED="IcpScreenUpdated",t.SESSION_JOIN="IcpClientJoinSession",t.SESSION_LEAVE="IcpClientLeaveSession"}(Kn||(Kn={}));var uo=function(){function t(){this.connected$=new a.BehaviorSubject(!1),this.sessionJoined$=new a.Subject,this.presenterUpdated$=new a.Subject,this.clientDisconnected$=new a.Subject,this.participantUpdated$=new a.Subject,this.newParticipantJoined$=new a.Subject,this.screenUpdated$=new a.Subject}return t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.connect=function(t){var e=this;return this.getSocketClient(t).subscribe((function(t){t.onopen=function(t){e.connected$.next(!0)},t.onmessage=function(t){console.log("onmessage");var n=JSON.parse(t.data);n.data&&n.data.eventName&&e.messageEventHandller(n.data.eventName,n.data.data)},t.onerror=function(t){console.log("onerror")},t.onclose=function(t){console.log("onclose")}}))},t.prototype.connected=function(){return this.connected$.asObservable()},t.prototype.join=function(t){this.emit(Kn.SESSION_JOIN,t)},t.prototype.leave=function(t){this.emit(Kn.SESSION_LEAVE,t),this.subscription.unsubscribe()},t.prototype.emit=function(t,e){this.socket.send(JSON.stringify({type:"event",event:t,data:e}))},t.prototype.listen=function(t){switch(t){case Kn.SESSION_JOINED:return this.sessionJoined$.asObservable();case Kn.PRESENTER_UPDATED:return this.presenterUpdated$.asObservable();case Kn.CLIENT_DISCONNECTED:return this.clientDisconnected$.asObservable();case Kn.PARTICIPANTS_UPDATED:return this.participantUpdated$.asObservable();case Kn.NEW_PARTICIPANT_JOINED:return this.newParticipantJoined$.asObservable();case Kn.SCREEN_UPDATED:return this.screenUpdated$.asObservable()}},t.prototype.messageEventHandller=function(t,e){switch(t){case Kn.SESSION_JOINED:this.sessionJoined$.next(e);break;case Kn.PRESENTER_UPDATED:this.presenterUpdated$.next(e);break;case Kn.CLIENT_DISCONNECTED:this.clientDisconnected$.next();break;case Kn.PARTICIPANTS_UPDATED:this.participantUpdated$.next(e);break;case Kn.NEW_PARTICIPANT_JOINED:this.newParticipantJoined$.next();break;case Kn.SCREEN_UPDATED:this.screenUpdated$.next(e)}},t.prototype.getSocketClient=function(t){return this.socket=new WebSocket(t,"json.webpubsub.azure.v1"),a.of(this.socket)},t}();uo.decorators=[{type:e.Injectable}],uo.ctorParameters=function(){return[]};var po=function(){function t(t){this.socket=t}return t.prototype.joinSession=function(t,e){var n=this;return this.session=e,this.socket.connect(e.connectionUrl),this.socket.connected().subscribe((function(e){e&&n.socket.join(Object.assign(Object.assign({},n.session),{username:t}))})),this.socket.listen(Kn.SESSION_JOINED)},t.prototype.leaveSession=function(){this.socket.leave(this.session)},t.prototype.newParticipantJoined=function(){return this.socket.listen(Kn.NEW_PARTICIPANT_JOINED)},t.prototype.clientDisconnected=function(){return this.socket.listen(Kn.CLIENT_DISCONNECTED)},t.prototype.removeParticipant=function(t){this.socket.emit(Kn.REMOVE_PARTICIPANT,{participantId:t,caseId:this.session.caseId})},t.prototype.participantListUpdated=function(){return this.socket.listen(Kn.PARTICIPANTS_UPDATED)},t.prototype.updatePresenter=function(t){this.socket.emit(Kn.UPDATE_PRESENTER,Object.assign(Object.assign({},this.session),{presenterId:t.id,presenterName:t.username}))},t.prototype.presenterUpdated=function(){return this.socket.listen(Kn.PRESENTER_UPDATED)},t.prototype.updateScreen=function(t){var e={body:t,caseId:this.session.caseId};this.socket.emit(Kn.UPDATE_SCREEN,e)},t.prototype.screenUpdated=function(){return this.socket.listen(Kn.SCREEN_UPDATED)},t}();po.decorators=[{type:e.Injectable}],po.ctorParameters=function(){return[{type:uo}]};var ho=r.createSelector(to,(function(t){return t.icp})),mo=r.createSelector(ho,(function(t){return t.session})),go=r.createSelector(mo,(function(t){return null===t?null:t.caseId})),bo=r.createSelector(ho,(function(t){return t.presenter})),fo=r.createSelector(bo,(function(t){return null===t?null:t.username})),vo=r.createSelector(ho,(function(t){return t.client})),yo=r.createSelector(bo,vo,(function(t,e){return null===t?void 0:t.id===e.id})),wo=r.createSelector(ho,(function(t){return t.participants})),So=function(){function t(t,e,n){this.toolbarEvents=t,this.socketService=e,this.store=n}return t.prototype.update=function(t){t?this.subscribe():this.unsubscribe()},t.prototype.subscribe=function(){var t=this;this.$subscription||(this.$subscription=this.store.pipe(r.select(io)).subscribe((function(e){t.pdfPosition=e,t.onPositionUpdate(e)})),this.$subscription.add(this.store.pipe(r.select(bo)).subscribe((function(e){t.presenter=e}))),this.$subscription.add(this.socketService.newParticipantJoined().subscribe((function(){return t.onNewParticipantJoined()}))))},t.prototype.unsubscribe=function(){this.$subscription&&(this.$subscription.unsubscribe(),this.$subscription=void 0)},t.prototype.onPositionUpdate=function(t){var e={pdfPosition:t,document:void 0};this.socketService.updateScreen(e)},t.prototype.onNewParticipantJoined=function(){this.onPositionUpdate(this.pdfPosition),this.socketService.updatePresenter(this.presenter)},t}();So.decorators=[{type:e.Injectable}],So.ctorParameters=function(){return[{type:X},{type:po},{type:r.Store}]};var ko=function(){function t(t,e,n,o){this.toolbarEvents=t,this.viewerEvents=e,this.socketService=n,this.store=o}return t.prototype.update=function(t){t?this.subscribe():this.unsubscribe()},t.prototype.subscribe=function(){var t=this;this.$subscription||(this.$subscription=this.socketService.screenUpdated().subscribe((function(e){return t.followScreenUpdate(e)})))},t.prototype.unsubscribe=function(){this.$subscription&&(this.$subscription.unsubscribe(),this.$subscription=void 0)},t.prototype.followScreenUpdate=function(t){var e=this,n=t.pdfPosition;n&&this.viewerEvents.goToDestination([n.pageNumber-1,{name:"XYZ"},n.left,n.top]),this.store.pipe(r.select(io),s.take(1)).subscribe((function(t){var o=(n.rotation-t.rotation)%360;0!==o&&e.toolbarEvents.rotate(o)}))},t}();ko.decorators=[{type:e.Injectable}],ko.ctorParameters=function(){return[{type:X},{type:lo},{type:po},{type:r.Store}]};var Eo=function(){function t(t,e,n,o,i,a){var c=this;this.toolbarEvents=t,this.viewerEvents=e,this.socketService=n,this.presenterSubscriptions=o,this.followerSubscriptions=i,this.store=a,this.subscription=this.store.pipe(r.select(go),s.filter((function(t){return!!t}))).subscribe((function(t){c.caseId=t})),this.subscription.add(this.toolbarEvents.icp.sessionLaunch.subscribe((function(){c.caseId&&c.launchSession()})))}return t.prototype.ngOnDestroy=function(){this.unsubscribeSession(),this.subscription.unsubscribe()},t.prototype.launchSession=function(){var t=this;this.store.dispatch(new zt(this.caseId)),this.subscription.add(this.store.pipe(r.select(mo),s.filter((function(t){return!!t&&Object.keys(t).length>1})),s.take(1)).subscribe((function(){t.setUpSessionSubscriptions()})))},t.prototype.setUpSessionSubscriptions=function(){var t=this;this.sessionSubscription=this.toolbarEvents.icp.becomingPresenter.subscribe((function(){return t.becomePresenter()})),this.sessionSubscription.add(this.toolbarEvents.icp.stoppingPresenting.subscribe((function(){return t.stopPresenting()}))),this.sessionSubscription.add(this.toolbarEvents.icp.sessionExitConfirmed.subscribe((function(){return t.leavePresentation()}))),this.sessionSubscription.add(this.store.pipe(r.select(bo)).subscribe((function(e){return t.presenter=e}))),this.sessionSubscription.add(this.store.pipe(r.select(vo)).subscribe((function(e){return t.client=e}))),this.sessionSubscription.add(this.store.pipe(r.select(yo)).subscribe((function(e){t.isPresenter=e,t.presenterSubscriptions.update(e),t.followerSubscriptions.update(!e)}))),this.sessionSubscription.add(this.socketService.clientDisconnected().subscribe((function(e){return t.clientDisconnected(e)}))),this.sessionSubscription.add(this.socketService.presenterUpdated().subscribe((function(e){t.store.dispatch(new Jt(e))}))),this.sessionSubscription.add(this.socketService.participantListUpdated().subscribe((function(e){t.store.dispatch(new Yt(e))})))},t.prototype.unsubscribeSession=function(){this.presenterSubscriptions.update(!1),this.followerSubscriptions.update(!1),this.sessionSubscription.unsubscribe()},t.prototype.leavePresentation=function(){this.isPresenter&&this.stopPresenting(),this.removeParticipant(this.client.id),this.socketService.leaveSession(),this.store.dispatch(new Zt),this.unsubscribeSession()},t.prototype.stopPresenting=function(){this.socketService.updatePresenter({username:"",id:""})},t.prototype.becomePresenter=function(){this.socketService.updatePresenter(this.client)},t.prototype.clientDisconnected=function(t){t===this.presenter.id&&this.stopPresenting(),this.removeParticipant(t)},t.prototype.removeParticipant=function(t){this.socketService.removeParticipant(t)},t}();Eo.decorators=[{type:e.Injectable}],Eo.ctorParameters=function(){return[{type:X},{type:lo},{type:po},{type:So},{type:ko},{type:r.Store}]};var Co=function(){function n(t,n,o,i,a,r,c,l){var u=this;this.store=t,this.icpStore=n,this.pdfJsWrapperFactory=o,this.printService=i,this.toolbarEvents=a,this.viewerEvents=r,this.icpService=c,this.toolbarButtons=l,this.mediaLoadStatus=new e.EventEmitter,this.pdfViewerException=new e.EventEmitter,this.documentTitle=new e.EventEmitter,this.pageHeights=[],this.rotation=0,this.zoom=1,this.loadingDocument=!1,this.hasDifferentPageSize=!1,this.enableGrabNDrag=!1,this.highlightMode=a.highlightModeSubject.pipe(s.tap((function(){u.store.dispatch(new Nt)}))),this.drawMode=a.drawModeSubject}return n.prototype.ngAfterContentInit=function(){return N(this,void 0,void 0,(function(){var t=this;return A(this,(function(e){return this.pdfWrapper.documentLoadProgress.subscribe((function(e){return t.onDocumentLoadProgress(e)})),this.pdfWrapper.documentLoaded.subscribe((function(){return t.onDocumentLoaded()})),this.pdfWrapper.documentLoadFailed.subscribe((function(e){return t.onDocumentLoadFailed(e)})),this.pdfWrapper.outlineLoaded.subscribe((function(e){return t.documentOutline=e})),this.pdfWrapper.pageRendered.subscribe((function(e){return t.updatePages(e)})),this.$subscription=this.toolbarEvents.printSubject.subscribe((function(){return t.printService.printDocumentNatively(t.url)})),this.$subscription.add(this.toolbarEvents.downloadSubject.subscribe((function(){return t.pdfWrapper.downloadFile(t.downloadUrl||t.url,t.downloadFileName)}))),this.$subscription.add(this.toolbarEvents.rotateSubject.subscribe((function(e){return t.rotateDocument(e)}))),this.$subscription.add(this.toolbarEvents.zoomSubject.subscribe((function(e){return t.setZoom(e)}))),this.$subscription.add(this.toolbarEvents.stepZoomSubject.subscribe((function(e){return t.stepZoom(e)}))),this.$subscription.add(this.toolbarEvents.searchSubject.subscribe((function(e){return t.pdfWrapper.search(e)}))),this.$subscription.add(this.toolbarEvents.setCurrentPageSubject.subscribe((function(e){return t.pdfWrapper.setPageNumber(e)}))),this.$subscription.add(this.toolbarEvents.changePageByDeltaSubject.subscribe((function(e){return t.pdfWrapper.changePageNumber(e)}))),this.$subscription.add(this.toolbarEvents.grabNDrag.subscribe((function(e){return t.enableGrabNDrag=e}))),this.$subscription.add(this.toolbarEvents.commentsPanelVisible.subscribe((function(e){t.showCommentsPanel=e}))),this.$subscription.add(this.viewerEvents.navigationEvent.subscribe((function(e){return t.goToDestination(e)}))),this.$subscription.add(this.toolbarEvents.icp.participantsListVisible.subscribe((function(e){return t.showIcpParticipantsList=e}))),this.$subscription.add(this.pdfWrapper.positionUpdated.asObservable().pipe(s.throttleTime(500,a.asyncScheduler,{leading:!0,trailing:!0})).subscribe((function(e){return t.store.dispatch(new St(e.location))}))),[2]}))}))},n.prototype.ngOnChanges=function(t){return N(this,void 0,void 0,(function(){var e=this;return A(this,(function(n){switch(n.label){case 0:return this.pdfWrapper||(this.pdfWrapper=this.pdfJsWrapperFactory.create(this.viewerContainer)),t.url&&this.pdfWrapper?[4,this.loadDocument()]:[3,2];case 1:n.sent(),this.enableRedactions&&this.toolbarEvents.redactionMode.pipe(s.filter((function(t){return!!t}))).subscribe((function(){return e.resetRotation()})),n.label=2;case 2:return t.caseId&&this.icpStore.dispatch(new Ut(this.caseId)),[2]}}))}))},n.prototype.resetRotation=function(){this.hasDifferentPageSize&&(this.pdfWrapper.resetRotation(0),this.rotation=0)},n.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},n.prototype.loadDocument=function(){return N(this,void 0,void 0,(function(){var t=this;return A(this,(function(e){switch(e.label){case 0:return this.initDocumentProgress(),[4,this.pdfWrapper.loadDocument(this.url)];case 1:return e.sent(),this.documentTitle.emit(this.pdfWrapper.getCurrentPDFTitle()),this.setPageHeights(),this.$subscription.add(this.store.pipe(r.select(ao)).subscribe((function(e){return t.hasDifferentPageSize=e}))),[2]}}))}))},n.prototype.onDocumentLoadProgress=function(t){t.total&&(this.loadingDocumentProgress=Math.min(100,Math.ceil(t.loaded/t.total*100)))},n.prototype.onDocumentLoaded=function(){this.loadingDocument=!1,this.mediaLoadStatus.emit(t.ResponseType.SUCCESS)},n.prototype.onDocumentLoadFailed=function(e){this.loadingDocument=!1,this.viewerException=new et(e.name,{message:e.message}),this.errorMessage='Could not load the document "'+this.url+'"',this.mediaLoadStatus.emit(t.ResponseType.FAILURE),this.pdfViewerException.emit(this.viewerException)},n.prototype.updatePages=function(t){this.enableAnnotations&&this.store.dispatch(new wt(t))},Object.defineProperty(n.prototype,"searchBarHidden",{set:function(t){this.pdfWrapper&&t&&this.pdfWrapper.clearSearch()},enumerable:!1,configurable:!0}),n.prototype.toggleCommentsSummary=function(){this.toolbarEvents.toggleCommentsSummary(!this.toolbarEvents.showCommentSummary.getValue())},n.prototype.rotateDocument=function(t){var e=this.pdfWrapper.getPageNumber();this.pdfWrapper.rotate(t),this.pdfWrapper.setPageNumber(e),this.rotation=(this.rotation+t)%360,this.setPageHeights()},n.prototype.initDocumentProgress=function(){this.loadingDocument=!0,this.loadingDocumentProgress=null,this.errorMessage=null},n.prototype.setZoom=function(t){isNaN(t)||(this.pdfWrapper.setZoom(t),this.zoom=this.calculateZoomValue(t),this.setPageHeights())},n.prototype.stepZoom=function(t){isNaN(t)||(this.pdfWrapper.stepZoom(t),this.zoom=this.calculateZoomValue(this.zoom,t),this.setPageHeights())},n.prototype.setPageHeights=function(){this.pageHeights=[];for(var t=this.pdfViewer.nativeElement.children,e=0;e<t.length;e++)this.pageHeights.push(t[e].clientHeight)},n.prototype.calculateZoomValue=function(t,e){void 0===e&&(e=0);var n=t+e;return n>5?5:n<.1?.1:+n.toFixed(2)},n.prototype.goToDestination=function(t){this.pdfWrapper.navigateTo(t)},n.prototype.getCurrentPageNumber=function(){return this.pdfWrapper.getPageNumber()},n}();Co.decorators=[{type:e.Component,args:[{selector:"mv-pdf-viewer",template:'<mv-side-bar *ngIf="toolbarEvents.sidebarOpen"\n id="sidebarContainer"\n [url]="url"\n [zoom]="zoom"\n [rotate]="rotation"\n [outline]="documentOutline"\n [annotationsEnabled]="enableAnnotations"\n [currentPageNumber]="getCurrentPageNumber()">\n</mv-side-bar>\n<mv-comment-set-header\n *ngIf="enableAnnotations"\n [ngClass]="{\'show-comments-panel\': showCommentsPanel}"\n [showCommentSummary]="toolbarButtons.showCommentSummary"\n (showCommentSummaryDialog)="toggleCommentsSummary()">\n</mv-comment-set-header>\n<mv-participants-list></mv-participants-list>\n<div\n class="pdfContainer"\n [ngStyle]="{ height: height }"\n [ngClass]="{ \'pdfContainer\': true, hidden: errorMessage }">\n <div\n #viewerContainer\n mvGrabNDrag\n [dragX]="viewerContainer"\n [dragEnabled]="enableGrabNDrag"\n id="viewerContainer"\n class="viewer-container"\n [class.annotations]="enableAnnotations"\n [class.show-comments-panel]="(showCommentsPanel || showIcpParticipantsList) && !(toolbarEvents.redactionMode | async)"\n [class.grabNDrag]="enableGrabNDrag">\n <div #pdfViewer\n class="pdfViewer"\n mvCreateTextHighlight\n [ngClass]="{ hidden: loadingDocument, highlightMode: highlightMode | async, drawMode: drawMode | async }">\n </div>\n <mv-redactions *ngIf="(toolbarEvents.redactionMode | async); else annotationTemplate"\n [zoom]="zoom"\n [rotate]="rotation"\n ></mv-redactions>\n <ng-template #annotationTemplate>\n <mv-metadata-layer\n *ngIf="enableAnnotations && annotationSet"\n [zoom]="zoom"\n [rotate]="rotation">\n </mv-metadata-layer>\n <mv-bookmark-icons [zoom]="zoom"\n [rotate]="rotation">\n </mv-bookmark-icons>\n </ng-template>\n </div>\n <mv-comment-set [contentScrollTop]="viewerContainer.scrollTop"\n *ngIf="enableAnnotations && annotationSet && !(toolbarEvents.redactionMode | async)"\n [annotationSet]="annotationSet"\n [zoom]="zoom"\n [rotate]="rotation"\n [height]="pdfViewer.offsetHeight"\n [pageHeights]="pageHeights">\n </mv-comment-set>\n <div class="loadingMessage" *ngIf="loadingDocument">\n <h3 class="govuk-heading-m">Loading...{{ loadingDocumentProgress ? loadingDocumentProgress + \'%\' : \'\' }}</h3>\n </div>\n</div>\n',encapsulation:e.ViewEncapsulation.None}]}],Co.ctorParameters=function(){return[{type:r.Store},{type:r.Store},{type:K},{type:tt},{type:X},{type:lo},{type:Eo},{type:nt}]},Co.propDecorators={mediaLoadStatus:[{type:e.Output}],pdfViewerException:[{type:e.Output}],documentTitle:[{type:e.Output}],downloadUrl:[{type:e.Input}],url:[{type:e.Input}],downloadFileName:[{type:e.Input}],enableAnnotations:[{type:e.Input}],enableRedactions:[{type:e.Input}],enableICP:[{type:e.Input}],annotationSet:[{type:e.Input}],height:[{type:e.Input}],caseId:[{type:e.Input}],viewerContainer:[{type:e.ViewChild,args:["viewerContainer",{static:!0}]}],pdfViewer:[{type:e.ViewChild,args:["pdfViewer",{static:!1}]}],searchBarHidden:[{type:e.Input}]};var Io=function(){function t(t){this.http=t}return t.prototype.validateFile=function(t){return this.http.head(t)},t}();Io.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new Io(I.ɵɵinject(O.HttpClient))},token:Io,providedIn:"root"}),Io.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Io.ctorParameters=function(){return[{type:i.HttpClient}]};var Oo=function(){function n(t,n,o,i,a,s){this.store=t,this.printService=n,this.viewerUtilService=o,this.toolbarEvents=i,this.toolbarButtons=a,this.viewerEvents=s,this.mediaLoadStatus=new e.EventEmitter,this.imageViewerException=new e.EventEmitter,this.rotation=0,this.zoom=1,this.subscriptions=[],this.enableGrabNDrag=!1}return n.prototype.ngOnInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.rotateSubject.subscribe((function(e){return t.rotateImage(e)})),this.toolbarEvents.zoomSubject.subscribe((function(e){return t.setZoom(e)})),this.toolbarEvents.stepZoomSubject.subscribe((function(e){return t.stepZoom(e)})),this.toolbarEvents.printSubject.subscribe((function(){return t.printService.printDocumentNatively(t.url)})),this.toolbarEvents.downloadSubject.subscribe((function(){return t.download()})),this.toolbarEvents.grabNDrag.subscribe((function(e){return t.enableGrabNDrag=e})),this.toolbarEvents.commentsPanelVisible.subscribe((function(e){return t.showCommentsPanel=e})))},n.prototype.onImageViewerClick=function(t){t.target.className.startsWith("pageContainer")&&(this.store.dispatch(new Ce({annotationId:"",selected:!1,editable:!1})),this.viewerEvents.clearCtxToolbar())},n.prototype.ngOnDestroy=function(){this.subscriptions.filter((function(t){return!t.closed})).forEach((function(t){return t.unsubscribe()})),this.response&&this.response.unsubscribe()},n.prototype.ngOnChanges=function(t){t.url&&(this.errorMessage=null,this.toolbarEvents.reset())},n.prototype.rotateImage=function(t){this.rotation=(this.rotation+t)%360,this.initAnnoPage(this.img.nativeElement)},n.prototype.setZoom=function(t){return N(this,void 0,void 0,(function(){return A(this,(function(e){switch(e.label){case 0:return isNaN(t)?[3,2]:[4,this.setZoomValue(this.calculateZoomValue(t))];case 1:e.sent(),this.img.nativeElement.width=this.img.nativeElement.naturalWidth*this.zoom,this.initAnnoPage(this.img.nativeElement),e.label=2;case 2:return[2]}}))}))},n.prototype.stepZoom=function(t){return N(this,void 0,void 0,(function(){return A(this,(function(e){switch(e.label){case 0:return isNaN(t)?[3,2]:[4,this.setZoomValue(this.calculateZoomValue(this.zoom,t))];case 1:e.sent(),this.img.nativeElement.width=this.img.nativeElement.naturalWidth*this.zoom,this.initAnnoPage(this.img.nativeElement),e.label=2;case 2:return[2]}}))}))},n.prototype.download=function(){var t=document.createElement("a");document.body.appendChild(t),t.setAttribute("style","display: none"),t.href=this.url,t.download=this.downloadFileName,t.click(),t.remove()},n.prototype.setZoomValue=function(t){var e=this;return new Promise((function(n){e.zoom=t,e.toolbarEvents.zoomValueSubject.next(t),n(!0)}))},n.prototype.calculateZoomValue=function(t,e){void 0===e&&(e=0);var n=t+e;return n>5?5:n<.1?.1:+n.toFixed(2)},n.prototype.onLoadError=function(e){var n=this;this.response=this.viewerUtilService.validateFile(e).subscribe((function(t){return t}),(function(t){n.viewerException=new et(t.name,{httpResponseCode:t.status,message:t.message})})),this.errorMessage='Could not load the image "'+this.url+'"',this.mediaLoadStatus.emit(t.ResponseType.FAILURE),this.imageViewerException.emit(this.viewerException)},n.prototype.onLoad=function(e){this.mediaLoadStatus.emit(t.ResponseType.SUCCESS),this.initAnnoPage(e)},n.prototype.initAnnoPage=function(t){this.imageHeight=this.rotation%180!=0?t.offsetWidth:t.offsetHeight,this.imageWidth=this.rotation%180!=0?t.offsetHeight:t.offsetWidth,this.imageLeft=this.rotation%180!=0?t.offsetTop:t.offsetLeft,this.imageTop=this.rotation%180!=0?t.offsetLeft:t.offsetTop;var e=[{div:{scrollHeight:this.imageHeight,scrollWidth:this.imageWidth,offsetLeft:this.imageLeft},pageNumber:1,scale:this.zoom,rotation:this.rotation,id:1}];this.store.dispatch(new wt(e))},n.prototype.toggleCommentsSummary=function(){this.toolbarEvents.toggleCommentsSummary(!this.toolbarEvents.showCommentSummary.getValue())},n}();Oo.decorators=[{type:e.Component,args:[{selector:"mv-image-viewer",template:'<mv-comment-set-header [ngClass]="{\'show-comments-panel\': showCommentsPanel}"\n [showCommentSummary]="toolbarButtons.showCommentSummary"\n (showCommentSummaryDialog)="toggleCommentsSummary()">\n</mv-comment-set-header>\n<div mvGrabNDrag [dragX]="imageContainer" [dragEnabled]="enableGrabNDrag"\n id="viewer-wrapper"\n [ngStyle]="{ height: height }"\n [ngClass]="{ \'grabNDrag\': enableGrabNDrag }"\n *ngIf="url && !errorMessage">\n <div #imageContainer id="image-container"\n [ngClass]="{ \'image-container\': true, \'annotations\': enableAnnotations, \'show-comments-panel\': showCommentsPanel }"\n [style.height.px]="imageHeight">\n <img #img\n [src]="url"\n [ngClass]="\'rot\' + rotation"\n (error)="onLoadError(url)"\n (load)="onLoad(img)"/>\n <mv-redactions *ngIf="(toolbarEvents.redactionMode | async);else annotationTemplate"\n [zoom]="zoom"\n [rotate]="rotation"\n ></mv-redactions>\n <ng-template #annotationTemplate>\n <mv-metadata-layer *ngIf="enableAnnotations && annotationSet"\n [zoom]="zoom"\n [rotate]="rotation">\n </mv-metadata-layer>\n </ng-template>\n </div>\n\n <div class="comments" [style.height.px]="imageHeight">\n <mv-comment-set *ngIf="enableAnnotations && annotationSet && !(toolbarEvents.redactionMode | async)"\n [annotationSet]="annotationSet"\n [zoom]="zoom"\n [rotate]="rotation"\n [height]="imageHeight">\n </mv-comment-set>\n </div>\n</div>\n'}]}],Oo.ctorParameters=function(){return[{type:r.Store},{type:tt},{type:Io},{type:X},{type:nt},{type:lo}]},Oo.propDecorators={url:[{type:e.Input}],downloadFileName:[{type:e.Input}],enableAnnotations:[{type:e.Input}],annotationSet:[{type:e.Input}],height:[{type:e.Input}],mediaLoadStatus:[{type:e.Output}],imageViewerException:[{type:e.Output}],img:[{type:e.ViewChild,args:["img",{static:!1}]}],onImageViewerClick:[{type:e.HostListener,args:["mousedown",["$event"]]}]};var Po=function(){function n(t,n){this.toolbarEvents=t,this.viewerUtilService=n,this.loadStatus=new e.EventEmitter,this.unsupportedViewerException=new e.EventEmitter,this.subscriptions=[]}return n.prototype.ngOnInit=function(){var e=this;this.subscriptions.push(this.toolbarEvents.downloadSubject.subscribe((function(){return e.downloadLink.nativeElement.click()})),this.viewerUtilService.validateFile(this.url).subscribe((function(t){return t}),(function(t){e.viewerException=new et(t.name,{httpResponseCode:t.status,message:t.message})}))),this.loadStatus.emit(t.ResponseType.UNSUPPORTED),this.typeException||this.unsupportedViewerException.emit(this.viewerException)},n.prototype.ngOnDestroy=function(){var t,e;try{for(var n=M(this.subscriptions),o=n.next();!o.done;o=n.next()){o.value.unsubscribe()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},n}();Po.decorators=[{type:e.Component,args:[{selector:"mv-unsupported-viewer",template:'<div class="govuk-width-container">\n <div class="govuk-notification-banner__content">\n <p>\n <span *ngIf="typeException, else unsupported">The document could not be displayed, or the file type is unsupported.</span>\n Please <a #downloadLink [href]="url" [download]="downloadFileName">click here to download</a>.\n </p>\n <ng-template #unsupported>\n <span>This file type is not supported by this viewer.</span>\n </ng-template>\n </div>\n</div>\n'}]}],Po.ctorParameters=function(){return[{type:X},{type:Io}]},Po.propDecorators={url:[{type:e.Input}],downloadFileName:[{type:e.Input}],typeException:[{type:e.Input}],loadStatus:[{type:e.Output}],unsupportedViewerException:[{type:e.Output}],downloadLink:[{type:e.ViewChild,args:["downloadLink",{static:!1}]}]};var xo=function(){function t(t){this.httpClient=t,this.annotationApiUrl="/em-anno",this.annotationSetBaseUrl="/annotation-sets",this.annotationBaseUrl="/annotations"}return t.prototype.getAnnotationSet=function(t){var e=this.annotationSetsFullUrl+"/filter?documentId="+t;return this.httpClient.get(e,{observe:"response",withCredentials:!0})},t.prototype.postAnnotationSet=function(t){return this.httpClient.post(this.annotationSetsFullUrl,t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})),s.catchError((function(){return[]})))},t.prototype.getComments=function(t){return t.pipe(s.map(this.sortAnnotations),s.map(this.extractComments))},t.prototype.sortAnnotations=function(t){return t.annotations.sort((function(t,e){return t.page!==e.page?t.page-e.page:t.rectangles[0].y-e.rectangles[0].y}))},t.prototype.extractComments=function(t){return[].concat.apply([],L(t.map((function(t){return t.comments}))))},t.prototype.deleteAnnotation=function(t){var e=this.annotationFullsUrl+"/"+t;return this.httpClient.delete(e,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.postAnnotation=function(t){return this.httpClient.post(this.annotationFullsUrl,t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},Object.defineProperty(t.prototype,"annotationSetsFullUrl",{get:function(){return this.annotationApiUrl+this.annotationSetBaseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"annotationFullsUrl",{get:function(){return this.annotationApiUrl+this.annotationBaseUrl},enumerable:!1,configurable:!0}),t}();xo.decorators=[{type:e.Injectable}],xo.ctorParameters=function(){return[{type:i.HttpClient}]};var jo=function(){function t(){this.unsavedChanges=new a.Subject}return t.prototype.setCommentSet=function(t){this.commentSetComponent=t},t.prototype.onCommentChange=function(t){this.unsavedChanges.next(t)},t.prototype.getUnsavedChanges=function(){return this.unsavedChanges.asObservable()},t.prototype.hasUnsavedComments=function(t){return t.comments.length>0&&this.getComment(t).hasUnsavedChanges},t.prototype.updateUnsavedCommentsStatus=function(t,e){this.getComment(t).hasUnsavedChanges=e,this.allCommentsSaved()},t.prototype.getComment=function(t){return this.commentSetComponent.commentComponents.find((function(e){return e.comment.annotationId===t.comments[0].annotationId}))},t.prototype.resetCommentSet=function(){this.commentSetComponent=null},t.prototype.allCommentsSaved=function(){this.onCommentChange(this.commentSetComponent.commentComponents.some((function(t){return!0===t.hasUnsavedChanges})))},t}();jo.decorators=[{type:e.Injectable}];var To,_o,Do,Ro=r.createSelector(to,(function(t){return t.tags})),Bo=r.createSelector(Ro,(function(t){return t.tagNameEnt})),No=r.createSelector(Ro,(function(t){return t.filters})),Ao=r.createSelector(Ro,$e),Mo=r.createSelector(Ro,He),Fo=r.createSelector(Bo,(function(t){return Object.keys(t).map((function(e){return{key:e,length:Object.keys(t[e]).length}}))})),Lo=function(t){return t.annotations},$o=r.createSelector(to,Lo),Ho=r.createSelector($o,Be),Vo=r.createSelector($o,_e),Uo=function(t){return{documentId:t.documentId,annotationSetId:t.id}},zo=r.createSelector(Vo,Uo),Wo=function(t,e){return Object.assign(Object.assign({},e),{annotations:Object.keys(t).map((function(e){return t[e]}))})},qo=r.createSelector(Ho,Vo,Wo),Go=r.createSelector($o,Ne),Zo=r.createSelector($o,De),Jo=r.createSelector($o,Re),Yo=r.createSelector($o,Ae),Xo=function(t){return t.commentSearch},Ko=r.createSelector(Yo,Xo),Qo=r.createSelector($o,Me),ti=function(t,e,n){var o=!!Object.keys(n).length?n:e;if(t){var i=[];return Object.keys(t).forEach((function(e){i.push({anno:o[e]?o[e]:[],styles:t[e].styles})})),i}},ei=r.createSelector(no,Jo,Mo,ti),ni=function(t,e,n,o){if(t&&n&&e[1]){var i=!!Object.keys(o).length?o:t;return Object.keys(i).map((function(o){var i=n[o].page;return Object.assign(Object.assign({},t[o]),{page:i,pages:e})}))}},oi=r.createSelector(Zo,no,Ho,Ao,ni),ii=function(t,e){void 0===t&&(t=[]);var n=xe.filterCommentsSummary(t,e.filters);return n.length?n.filter((function(t){return void 0!==t.createdByDetails})).map((function(t){return{page:t.page,user:t.createdByDetails.forename.concat(" ").concat(t.createdByDetails.surname),date:T.default(t.lastModifiedDate).format("D MMMM YYYY"),tags:t.tags,comment:t.content}})):[""]},ai=r.createSelector(oi,Qo,ii),si=function(t,e){var n=!!Object.keys(e).length?e:t;return Object.keys(n).map((function(e){return t[e]})).filter((function(t){return t.comments&&t.comments.length>0}))},ri=r.createSelector(Ho,Ao,si);!function(t){t.PDF="pdf",t.IMAGE="image"}(To||(To={})),function(t){t.MP4="mp4",t.MP3="mp3"}(_o||(_o={})),function(t){t.EXCEL="excel",t.WORD="word",t.POWERPOINT="powerpoint",t.TXT="txt",t.RTF="rtf"}(Do||(Do={}));var ci=function(){function t(t,n,o,i,a,s,r){this.store=t,this.toolbarButtons=n,this.toolbarEvents=o,this.api=i,this.commentService=a,this.elRef=s,this.cdr=r,this.showToolbar=!0,this.toolbarButtonOverrides={},this.width="100%",this.mediaLoadStatus=new e.EventEmitter,this.viewerException=new e.EventEmitter,this.toolbarEventsOutput=new e.EventEmitter,this.unsavedChanges=new e.EventEmitter,this.enableAnnotations=!1,this.enableRedactions=!1,this.enableICP=!1,this.multimediaPlayerEnabled=!1,this.multimediaContent=!1,this.convertibleContent=!1,this.unsupportedContent=!1,this.typeException=!1,this.annotationApiUrl&&(i.annotationApiUrl=this.annotationApiUrl)}return t.prototype.ngAfterContentInit=function(){var t=this;this.annotationSet$=this.store.pipe(r.select(qo)),this.hasDifferentPageSize$=this.store.pipe(r.select(ao)),this.setToolbarButtons(),this.toolbarEventsOutput.emit(this.toolbarEvents),this.$subscriptions=this.commentService.getUnsavedChanges().subscribe((function(e){return t.onCommentChange(e)})),this.$subscriptions.add(this.toolbarEvents.getShowCommentSummary().subscribe((function(e){return t.showCommentSummary=e})))},t.prototype.ngAfterViewChecked=function(){if(this.height&&this.viewerHeight!==this.height)return this.viewerHeight=this.height,void this.cdr.detectChanges();if(!this.height){var t=this.elRef.nativeElement.getBoundingClientRect().top+this.viewerRef.nativeElement.offsetTop;this.prevOffset!==t&&(this.viewerHeight="calc(100vh - "+t+"px)",this.prevOffset=t,this.cdr.detectChanges())}},t.prototype.ngOnChanges=function(t){t.annotationApiUrl&&(this.api.annotationApiUrl=this.annotationApiUrl),t.url&&(this.toolbarEvents.reset(),this.commentService.resetCommentSet(),this.documentId=this.extractDMStoreDocId(this.url),this.store.dispatch(new yt(this.documentId)),!this.enableAnnotations||this.multimediaContent||this.unsupportedContent||this.store.dispatch(new me(this.documentId)),this.enableRedactions&&!this.multimediaContent&&!this.unsupportedContent&&this.documentId&&this.store.dispatch(new Dn(this.documentId)),"image"===this.contentType&&(this.documentTitle=null)),t.contentType&&(this.convertibleContent=this.needsConverting(),this.multimediaContent=this.isMultimedia(),this.unsupportedContent=!this.isSupported()),this.setToolbarButtons(),this.detectOs(),this.typeException=!1},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.prototype.needsConverting=function(){return null!==this.contentType&&Object.keys(Do).includes(this.contentType.toUpperCase())},t.prototype.isMultimedia=function(){return null!==this.contentType&&Object.keys(_o).includes(this.contentType.toUpperCase())},t.prototype.isSupported=function(){var t=Object.assign({},_o,Do,To);return null!==this.contentType&&Object.keys(t).includes(this.contentType.toUpperCase())},t.prototype.onMediaLoad=function(t){this.mediaLoadStatus.emit(t)},t.prototype.setToolbarButtons=function(){this.contentType===To.PDF||this.needsConverting()?this.toolbarButtons.setup(Object.assign(Object.assign(Object.assign({},ot),{showHighlightButton:this.enableAnnotations,showDrawButton:this.enableAnnotations}),this.toolbarButtonOverrides)):this.contentType===To.IMAGE?this.toolbarButtons.setup(Object.assign(Object.assign(Object.assign({},it),{showDrawButton:this.enableAnnotations}),this.toolbarButtonOverrides)):this.isMultimedia()?this.toolbarButtons.setup(Object.assign(Object.assign({},at),this.toolbarButtonOverrides)):this.toolbarButtons.setup(Object.assign(Object.assign({},st),this.toolbarButtonOverrides))},t.prototype.onLoadException=function(t){this.viewerException.emit(t),this.isSupported()?(this.typeException=!0,this.contentType=null,this.setToolbarButtons()):this.typeException=!1},t.prototype.onCommentChange=function(t){this.unsavedChanges.emit(t)},t.prototype.onDocumentTitleChange=function(t){this.documentTitle=t},t.prototype.extractDMStoreDocId=function(t){return(t=(t=t.includes("/documents/")?t.split("/documents/")[1]:t).includes("/documentsv2/")?t.split("/documentsv2/")[1]:t).replace("/binary","")},t.prototype.detectOs=function(){this.hasScrollBar=-1!==window.navigator.userAgent.indexOf("Win")},t}();ci.decorators=[{type:e.Component,args:[{selector:"mv-media-viewer",template:'<div id="outerContainer"\n [ngClass]="{\n \'has-redact-bar\': toolbarEvents.redactionMode | async,\n \'icp-mode\': toolbarEvents.icp.enabled | async,\n \'is-redaction-preview\': toolbarEvents.redactionPreview | async,\n sidebarOpen: toolbarEvents.sidebarOpen | async,\n \'has-scroll-bar\': hasScrollBar,\n \'has-different-page-size\': hasDifferentPageSize$ | async\n }"\n [ngStyle]="{ width: width }">\n\n <mv-comments-summary *ngIf="showCommentSummary"\n [title]="documentTitle || \'Comment Summary\'"\n [contentType]="contentType">\n </mv-comments-summary>\n\n <mv-confirm-action *ngIf="toolbarEvents.icp.leavingSession | async"></mv-confirm-action>\n\n <div id="mainContainer">\n <mv-main-toolbar *ngIf="showToolbar"\n [enableAnnotations]="enableAnnotations"\n [enableICP]="enableICP"\n [enableRedactions]="enableRedactions"\n [contentType]="contentType"\n >\n </mv-main-toolbar>\n <mv-redaction-toolbar *ngIf="toolbarEvents.redactionMode | async"></mv-redaction-toolbar>\n <mv-icp-toolbar *ngIf="toolbarEvents.icp.enabled | async"></mv-icp-toolbar>\n\n <div #viewerRef>\n <mv-conversion-viewer *ngIf="convertibleContent"\n (documentTitle)="onDocumentTitleChange($event)"\n (mediaLoadStatus)="onMediaLoad($event)"\n (viewerException)="onLoadException($event)"\n [enableAnnotations]="enableAnnotations"\n [enableRedactions]="enableRedactions"\n [annotationSet]="enableAnnotations ? (annotationSet$ | async) : null"\n [originalUrl]="url"\n [downloadFileName]="downloadFileName"\n [height]="viewerHeight"\n mvRotationPersist>\n </mv-conversion-viewer>\n <mv-pdf-viewer *ngIf="contentType === \'pdf\'"\n #pdfViewer\n (mediaLoadStatus)="onMediaLoad($event)"\n (pdfViewerException)="onLoadException($event)"\n (documentTitle)="onDocumentTitleChange($event)"\n [url]="url"\n [enableAnnotations]="enableAnnotations"\n [enableRedactions]="enableRedactions"\n [enableICP]="enableICP"\n [annotationSet]="enableAnnotations ? (annotationSet$ | async) : null"\n [downloadFileName]="downloadFileName"\n [height]="viewerHeight"\n [caseId]="caseId"\n mvRotationPersist>\n </mv-pdf-viewer>\n <mv-image-viewer *ngIf="contentType === \'image\'"\n (mediaLoadStatus)="onMediaLoad($event)"\n (imageViewerException)="onLoadException($event)"\n [url]="url"\n [enableAnnotations]="enableAnnotations"\n [annotationSet]="enableAnnotations ? (annotationSet$ | async) : null"\n [downloadFileName]="downloadFileName"\n [height]="viewerHeight"\n mvRotationPersist>\n </mv-image-viewer>\n <mv-multimedia-player *ngIf="multimediaContent"\n [multimediaOn]="multimediaPlayerEnabled"\n [url]="url"\n [downloadFileName]="downloadFileName"\n (loadStatus)="onMediaLoad($event)">\n </mv-multimedia-player>\n <mv-unsupported-viewer *ngIf="unsupportedContent"\n [url]="url"\n [typeException]="typeException"\n [downloadFileName]="downloadFileName"\n (loadStatus)="onMediaLoad($event)"\n (unsupportedViewerException)="onLoadException($event)">\n </mv-unsupported-viewer>\n </div>\n </div>\n</div>\n',encapsulation:e.ViewEncapsulation.None}]}],ci.ctorParameters=function(){return[{type:r.Store},{type:nt},{type:X},{type:xo},{type:jo},{type:e.ElementRef},{type:e.ChangeDetectorRef}]},ci.propDecorators={viewerRef:[{type:e.ViewChild,args:["viewerRef",{static:!1}]}],url:[{type:e.Input}],downloadFileName:[{type:e.Input}],contentType:[{type:e.Input}],showToolbar:[{type:e.Input}],toolbarButtonOverrides:[{type:e.Input}],height:[{type:e.Input}],width:[{type:e.Input}],mediaLoadStatus:[{type:e.Output}],viewerException:[{type:e.Output}],toolbarEventsOutput:[{type:e.Output}],unsavedChanges:[{type:e.Output}],enableAnnotations:[{type:e.Input}],annotationApiUrl:[{type:e.Input}],enableRedactions:[{type:e.Input}],enableICP:[{type:e.Input}],multimediaPlayerEnabled:[{type:e.Input}],caseId:[{type:e.Input}]};var li=function(){function t(){}return t.prototype.isNumber=function(t){return null!=t&&""!==t&&!isNaN(Number(t.toString()))},t}();li.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new li},token:li,providedIn:"root"}),li.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],li.ctorParameters=function(){return[]};var ui=function(){function t(t,e,n,o){this.toolbarEvents=t,this.toolbarButtons=e,this.cdr=n,this.numberHelper=o,this.enableAnnotations=!1,this.enableRedactions=!1,this.enableICP=!1,this.contentType=null,this.subscriptions=[],this.icpEnabled=!1,this.redactionEnabled=!1,this.pageNumber=1,this.pageCount=0,this.isDropdownMenuOpen=!1,this.dropdownMenuPositions=[new m.ConnectionPositionPair({originX:"end",originY:"bottom"},{overlayX:"end",overlayY:"top"},0,3)],this.zoomScales=[.1,.25,.5,.75,1,1.25,1.5,2.5,3,5],this.allButtonsWidth=0,this.widthRequiredForBtn={}}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.setCurrentPageSubject.subscribe((function(e){return t.setCurrentPage(e)})),this.toolbarEvents.setCurrentPageInputValueSubject.subscribe((function(e){return t.pageNumber=e})),this.toolbarEvents.getPageCount().subscribe((function(e){return t.pageCount=e})),this.toolbarEvents.icp.enabled.subscribe((function(e){t.icpEnabled=e,t.icpEnabled&&(t.toolbarEvents.toggleCommentsPanel(!e),t.toolbarEvents.sidebarOpen.next(!1))})),this.toolbarEvents.redactionMode.subscribe((function(e){t.redactionEnabled=e})))},t.prototype.ngOnDestroy=function(){var t,e;try{for(var n=M(this.subscriptions),o=n.next();!o.done;o=n.next()){o.value.unsubscribe()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.ngAfterViewInit=function(){var t=this;Array.from(this.mvToolbarMain.nativeElement.children).forEach((function(e){t.allButtonsWidth+=e.getBoundingClientRect().width,t.widthRequiredForBtn[e.id]=t.allButtonsWidth})),this.cdr.detectChanges()},t.prototype.onResize=function(){this.cdr.detectChanges()},t.prototype.onClickHighlightToggle=function(){this.toolbarEvents.toggleHighlightMode()},t.prototype.onClickDrawToggle=function(){this.toolbarEvents.toggleDrawMode()},t.prototype.toggleSideBar=function(){this.toolbarEvents.sidebarOpen.next(!this.toolbarEvents.sidebarOpen.getValue())},t.prototype.togglePresentBar=function(){this.toolbarEvents.searchBarHidden.next(!0),this.toolbarEvents.icp.enable()},t.prototype.increasePageNumber=function(){this.toolbarEvents.incrementPage(1)},t.prototype.decreasePageNumber=function(){this.toolbarEvents.incrementPage(-1)},t.prototype.onPageNumberInputChange=function(t){Number(t)<1&&(t="1"),Number(t)>this.pageCount&&(t=this.pageCount.toString()),this.toolbarEvents.setPage(Number.parseInt(t,10))},t.prototype.setCurrentPage=function(t){this.pageNumber=t},t.prototype.rotate=function(t){this.toolbarEvents.rotate(t)},t.prototype.printFile=function(){this.toolbarEvents.print()},t.prototype.downloadFile=function(){this.toolbarEvents.download()},t.prototype.zoom=function(t){this.toolbarEvents.zoom(+t)},t.prototype.stepZoom=function(t){this.toolbarEvents.stepZoom(t),this.zoomSelect.nativeElement.selected="selected"},t.prototype.toggleCommentsPanel=function(){this.toolbarEvents.toggleCommentsPanel(!this.toolbarEvents.commentsPanelVisible.getValue())},t.prototype.toggleRedactBar=function(){this.toolbarEvents.toggleRedactionMode()},t.prototype.toggleGrabNDrag=function(){this.toolbarEvents.toggleGrabNDrag()},t.prototype.isPdf=function(){return"pdf"===this.contentType},t.prototype.toggleSearchBar=function(){this.toolbarEvents.searchBarHidden.next(!this.toolbarEvents.searchBarHidden.getValue())},t.prototype.toggleMoreOptions=function(){var t=this;this.isDropdownMenuOpen=!this.isDropdownMenuOpen,setTimeout((function(){t.mvMenuItems&&t.mvMenuItems.nativeElement.focus()}),100)},t}();ui.decorators=[{type:e.Component,args:[{selector:"mv-main-toolbar",template:'<div class="toolbar">\n <div id="toolbarContainer">\n <div class="mv-toolbar__container">\n <div #mvToolbar class="mv-toolbar" [class.notSupported]="!contentType">\n \x3c!-- The mvToolbarMain div contains all toolbar buttons except the "More options" button. This allows for calculation of the available space to display buttons --\x3e\n <div id="mvToolbarMain" class="mv-toolbar-main" #mvToolbarMain>\n <ng-container *ngTemplateOutlet="menuItems"></ng-container>\n </div>\n \x3c!-- The mvToolbarMoreOptions div contains the "More options" toolbar button (and the overlay template for the dropdown menu).\n The space occupied by the button (if visible) is excluded from the toolbar space available calculation --\x3e\n <div id="mvToolbarMoreOptions" class="mv-toolbar-more-options">\n <button id="mvMoreOptionsBtn" class="mv-button mv-toolbar__menu-button--more-options"\n [class.mv-toolbar__menu-button--more-options__hidden]="mvToolbar.offsetWidth >= allButtonsWidth" aria-pressed="false"\n (click)="toggleMoreOptions()" cdkOverlayOrigin #trigger="cdkOverlayOrigin">\n <span>More options</span>\n </button>\n \x3c!-- This template displays the overlay content for the dropdown menu and is connected to the "More options" button --\x3e\n <ng-template cdkConnectedOverlay [cdkConnectedOverlayOrigin]="trigger"\n [cdkConnectedOverlayOpen]="isDropdownMenuOpen" [cdkConnectedOverlayPositions]="dropdownMenuPositions">\n <div class="dropdown-menu" #dropdownMenu tabindex="0">\n <ng-container *ngTemplateOutlet="menuItems"></ng-container>\n </div>\n </ng-template>\n </div>\n </div>\n\n <div id="mvMenuItems" #mvMenuItems>\n <ng-template #menuItems>\n\n <button *ngIf="toolbarButtons.showSidebar" id="mvIndexBtn" title="Index" data-l10n-id="index" #mvIndexBtn\n class="mv-button mv-toolbar__menu-button--index"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvIndexBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvIndexBtn\']" aria-pressed="false"\n (click)="toggleSideBar(); isDropdownMenuOpen = false">\n <span>Index</span>\n </button>\n\n <button *ngIf="toolbarButtons.showDrawButton" [disabled]="icpEnabled || redactionEnabled" id="mvDrawBtn"\n #mvDrawBtn class="mv-button mv-toolbar__menu-button--draw" title="Draw a box" tabindex="-1"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvDrawBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvDrawBtn\']"\n [class.toggled]="toolbarEvents.drawModeSubject | async" aria-hidden="true" aria-pressed="false"\n data-l10n-id="toggleDrawButton" (click)="onClickDrawToggle(); isDropdownMenuOpen = false">\n <span data-l10n-id="draw_label">Draw a box</span>\n </button>\n\n <button *ngIf="toolbarButtons.showHighlightButton" [disabled]="icpEnabled || redactionEnabled"\n id="mvHighlightBtn" #mvHighlightBtn class="mv-button mv-toolbar__menu-button--highlight" title="Highlight"\n tabindex="-1" [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvHighlightBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvHighlightBtn\']"\n [class.toggled]="toolbarEvents.highlightModeSubject | async" aria-hidden="true" aria-pressed="false"\n (click)="onClickHighlightToggle(); isDropdownMenuOpen = false" data-l10n-id="toggleHighlightButton">\n <span data-l10n-id="highlight_label">Highlight</span>\n </button>\n\n <ng-container *ngIf="toolbarButtons.showNavigation">\n <div id="mvPageBtn" #mvPageBtn class="mv-toolbar__menu-button--page" aria-pressed="false"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvPageBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvPageBtn\']">\n <span>Page</span>\n\n <button id="mvUpBtn" [disabled]="pageNumber === 1" title="Previous Page"\n class="mv-toolbar__menu-button--up button-image" data-l10n-id="previous"\n (click)="decreasePageNumber()"><span></span></button>\n <button id="mvDownBtn" [disabled]="pageNumber === pageCount" title="Next Page"\n class="mv-toolbar__menu-button--down button-image" data-l10n-id="next"\n (click)="increasePageNumber()"><span></span></button>\n\n <input type="number" id="pageNumber" class="hmcts-toolbar-input govuk-input--width-2" title="Page Number"\n value="1" size="4" min="1" [value]="pageNumber" aria-label="page number" tabindex="0"\n data-l10n-id="page" (change)="onPageNumberInputChange(pageNumberInput.value)" #pageNumberInput>\n <span id="numPages" class="toolbarLabel">/ {{ pageCount }}</span>\n </div>\n </ng-container>\n\n <ng-container *ngIf="toolbarButtons.showZoom">\n <div id="mvZoomBtn" #mvZoomBtn class="mv-toolbar__menu-button--zoom" aria-pressed="false"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvZoomBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvZoomBtn\']">\n <span>Zoom</span>\n <button [disabled]="toolbarEvents.zoomValueSubject.value == 0.1" id="mvMinusBtn"\n class="mv-toolbar__menu-button--zoom-out button-image" title="Zoom Out" data-l10n-id="zoom_out"\n (click)="stepZoom(-0.1)"><span></span></button>\n <select id="scaleSelect" class="hmcts-toolbar-select" title="Zoom" tabindex="0" data-l10n-id="zoom"\n (change)="zoom($event.target.value)" aria-label="zoom">\n <option #zoomSelect id="customScaleOption" title="" [value]="toolbarEvents.zoomValueSubject.value">\n {{(toolbarEvents.zoomValueSubject.value) * 100 | number: \'1.0-0\'}}%</option>\n <option *ngFor="let zoomScale of zoomScales" title="" [value]="zoomScale"\n [attr.data-l10n-id]="\'page_scale_percent_\' + zoomScale*100">{{ zoomScale *100 }}%\n </option>\n </select>\n\n <button [disabled]="toolbarEvents.zoomValueSubject.value == 5" id="mvPlusBtn"\n class="mv-toolbar__menu-button--zoom-in button-image" (click)="stepZoom(0.1)" title="Zoom In"\n data-l10n-id="zoom_in"><span></span></button>\n </div>\n </ng-container>\n\n <div *ngIf="toolbarButtons.showRotate" id="mvRotateBtn" #mvRotateBtn class="mv-toolbar__menu-button--rotate"\n aria-pressed="false" [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvRotateBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvRotateBtn\']">\n <button id="mvRotateLeftBtn" class="mv-toolbar__menu-button--rotate_left button-image"\n title="Rotate Counterclockwise" data-l10n-id="page_rotate_ccw" (click)="rotate(270)"><span></span>\n </button>\n <button id="mvRotateRightBtn" class="mv-toolbar__menu-button--rotate_right button-image"\n title="Rotate Clockwise" data-l10n-id="page_rotate_cw" (click)="rotate(90)"><span></span>\n </button>\n <span>Rotate</span>\n </div>\n\n <button *ngIf="toolbarButtons.showSearchBar" [disabled]="icpEnabled" id="mvSearchBtn" #mvSearchBtn\n title="Search" data-l10n-id="searchbar" class="mv-button mv-toolbar__menu-button--search"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvSearchBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvSearchBtn\']" aria-pressed="false"\n (click)="toggleSearchBar(); isDropdownMenuOpen = false">\n <span data-l10n-id="search_label">Search</span>\n </button>\n\n <button *ngIf="enableICP && toolbarButtons.showPresentationMode && isPdf()"\n [disabled]="icpEnabled || !contentType || redactionEnabled" id="mvPresentBtn" #mvPresentBtn\n class="mv-button mv-toolbar__menu-button--present" title="In-Court Presentation Mode"\n data-l10n-id="icpMode_label" [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvPresentBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvPresentBtn\']" aria-pressed="false"\n (click)="togglePresentBar(); isDropdownMenuOpen = false"><span data-l10n-id="icpMode_label">Present</span>\n </button>\n\n <button *ngIf="enableRedactions && toolbarButtons.showRedact" [disabled]="icpEnabled" id="mvRedactBtn"\n #mvRedactBtn title="Redact" data-l10n-id="redact" class="mv-button mv-toolbar__menu-button--redact"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvRedactBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvRedactBtn\']" aria-pressed="false"\n (click)="toggleRedactBar(); isDropdownMenuOpen = false">\n <span>Redact</span>\n </button>\n\n <button *ngIf="toolbarButtons.showGrabNDragButton" [disabled]="icpEnabled" id="mvGrabBtn" #mvGrabBtn\n class="mv-button mv-toolbar__menu-button--grab"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvGrabBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvGrabBtn\']" aria-pressed="false"\n (click)="toggleGrabNDrag(); isDropdownMenuOpen = false">\n <span>Grab and drag</span>\n </button>\n\n <button *ngIf="toolbarButtons.showDownload" [disabled]="icpEnabled || redactionEnabled" id="mvDownloadBtn"\n #mvDownloadBtn class="mv-button mv-toolbar__menu-button--download" title="Download" data-l10n-id="download"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvDownloadBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvDownloadBtn\']" aria-pressed="false"\n (click)="downloadFile(); isDropdownMenuOpen = false">\n <span>Download</span>\n </button>\n\n <button *ngIf="toolbarButtons.showPrint" [disabled]="icpEnabled || redactionEnabled" id="mvPrintBtn"\n #mvPrintBtn title="Print" data-l10n-id="print" class="mv-button mv-toolbar__menu-button--print"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvPrintBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvPrintBtn\']" aria-pressed="false"\n (click)="printFile(); isDropdownMenuOpen = false">\n <span>Print</span>\n </button>\n\n <button *ngIf="enableAnnotations && toolbarButtons.showCommentSummary" [disabled]="redactionEnabled"\n id="mvCommentsBtn" #mvCommentsBtn class="mv-button mv-toolbar__menu-button--comments" title="Comments"\n data-l10n-id="comments" [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvCommentsBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvCommentsBtn\']" aria-pressed="false"\n (click)="toggleCommentsPanel(); isDropdownMenuOpen = false">\n <span>Comments</span>\n </button>\n </ng-template>\n </div>\n <mv-search-bar></mv-search-bar>\n </div>\n\n <div id="loadingBar">\n <div class="progress">\n <div class="glimmer">\n </div>\n </div>\n </div>\n </div>\n</div>\n'}]}],ui.ctorParameters=function(){return[{type:X},{type:nt},{type:e.ChangeDetectorRef},{type:li}]},ui.propDecorators={enableAnnotations:[{type:e.Input}],enableRedactions:[{type:e.Input}],enableICP:[{type:e.Input}],contentType:[{type:e.Input}],zoomSelect:[{type:e.ViewChild,args:["zoomSelect",{static:!1}]}],mvToolbarMain:[{type:e.ViewChild,args:["mvToolbarMain",{static:!1}]}],mvMenuItems:[{type:e.ViewChild,args:["dropdownMenu",{static:!1}]}],onResize:[{type:e.HostListener,args:["window:resize",[]]}]};var pi=function(){function t(t,e){this.toolbarButtons=t,this.toolbarEvents=e,this.highlightAll=!0,this.matchCase=!1,this.wholeWord=!1,this.resultsText="",this.searchText="",this.resultCount=0,this.subscriptions=[],this.advancedSearchVisible=!1}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.searchResultsCountSubject.subscribe((function(e){return t.setSearchResultsCount(e)})))},t.prototype.ngOnDestroy=function(){var t,e;try{for(var n=M(this.subscriptions),o=n.next();!o.done;o=n.next()){o.value.unsubscribe()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.onWindowKeyDown=function(t){var e=this;("F3"===t.code||t.ctrlKey&&"KeyF"===t.code)&&(t.preventDefault(),this.toolbarEvents.searchBarHidden.next(!1),setTimeout((function(){return e.findInput.nativeElement.focus()}),200))},t.prototype.searchNext=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!1,reset:!1})},t.prototype.searchPrev=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!0,reset:!1})},t.prototype.search=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!1,reset:!0})},t.prototype.setSearchResultsCount=function(t){var e=this;this.resultCount=t.total,this.resultsText=this.resultCount>0?"Found "+t.current+" of "+t.total:"No results found",this.resultCount&&this.resultCount>0&&setTimeout((function(){e.findNext.nativeElement.focus()}),200)},t.prototype.onEscapeKeyPress=function(t){this.toolbarEvents.searchBarHidden.next(!0)},t.prototype.onEnterKeyPress=function(t){this.search()},t.prototype.toggleAdvancedSearch=function(){this.advancedSearchVisible=!this.advancedSearchVisible},t.prototype.toggleSearchBar=function(){this.toolbarEvents.searchBarHidden.next(!this.toolbarEvents.searchBarHidden.getValue())},t}();pi.decorators=[{type:e.Component,args:[{selector:"mv-search-bar",template:'<div class="searchbar govuk-!-padding-3" [hidden]="toolbarEvents.searchBarHidden | async">\n <div class="govuk-grid-row">\n <div class="govuk-grid-column-full">\n <input class="govuk-input govuk-!-display-inline-block govuk-!-width-three-quarters govuk-!-margin-bottom-5 govuk-!-margin-top-5"\n type="text" aria-label="Find in document" #findInput [(ngModel)]="searchText" (keydown.escape)="onEscapeKeyPress($event)" (keydown.enter)="onEnterKeyPress($event)" title="Find in document"\n placeholder="Find in document…" tabindex="0" data-l10n-id="find_input" />\n <button class="govuk-button govuk-!-display-inline-block govuk-!-margin-bottom-4" data-module="govuk-button"\n (click)="search()" style=" position: absolute; top: 40px; right: 10px; ">\n Search\n </button>\n <button id="mvCloseBtn" #mvCloseBtn class="mv-button searchbar-button--close" title="Close Search" data-l10n-id="mvRedactBtn"\n (click)="toggleSearchBar()">\n </button>\n </div>\n </div>\n\n <div class="govuk-grid-row">\n <div class="govuk-grid-column-three-quarters">\n <span id="findResultsCount" class="govuk-!-display-inline-block govuk-!-margin-right-4">{{resultsText}}</span>\n <a *ngIf="resultCount > 0" [routerLink]="" class="govuk-link govuk-link--no-visited-state govuk-!-margin-right-2"\n (click)="searchPrev()" title="Find the previous occurrence of the phrase" data-l10n-id="find_previous">Prev</a>\n <a *ngIf="resultCount > 0" [routerLink]="" #findNext class="govuk-link govuk-link--no-visited-state" (click)="searchNext()"\n title="Find the next occurrence of the phrase" data-l10n-id="find_next">Next</a>\n </div>\n <div class="govuk-grid-column-one-quarter">\n <a [routerLink]="" class="govuk-link govuk-link--no-visited-state" (click)="toggleAdvancedSearch()" title="Advanced"\n data-l10n-id="find_advanced" style=" position: absolute; top: 95px; right: 15px; ">Advanced</a>\n </div>\n </div>\n\n <div class="govuk-grid-row" *ngIf="advancedSearchVisible">\n <div class="govuk-grid-column-full">\n <div class="govuk-form-group govuk-!-margin-top-3 govuk-!-margin-bottom-1">\n <fieldset class="govuk-fieldset" aria-describedby="advanced">\n <div class="govuk-checkboxes">\n <div class="govuk-checkboxes__item">\n <input class="govuk-checkboxes__input" id="findHighlightAll" name="findHighlightAll" type="checkbox"\n (change)="highlightAll = !highlightAll; search()" [checked]="highlightAll">\n <label class="govuk-label govuk-checkboxes__label" for="findHighlightAll" data-l10n-id="find_highlight">\n Highlight all\n </label>\n </div>\n <div class="govuk-checkboxes__item">\n <input class="govuk-checkboxes__input" id="findMatchCase" name="findMatchCase" type="checkbox"\n (change)="matchCase = !matchCase; search()" [checked]="matchCase">\n <label class="govuk-label govuk-checkboxes__label" for="findMatchCase"\n data-l10n-id="find_match_case_label">\n Match text (exact case)\n </label>\n </div>\n <div class="govuk-checkboxes__item">\n <input class="govuk-checkboxes__input" id="findEntireWord" name="findMatchCase" type="checkbox"\n (change)="wholeWord = !wholeWord; search()" [checked]="wholeWord">\n <label class="govuk-label govuk-checkboxes__label" for="findEntireWord"\n data-l10n-id="find_entire_word_label">\n Match whole words or sentences\n </label>\n </div>\n </div>\n </fieldset>\n </div>\n </div>\n </div>\n</div>\n'}]}],pi.ctorParameters=function(){return[{type:nt},{type:X}]},pi.propDecorators={findInput:[{type:e.ViewChild,args:["findInput",{static:!0}]}],findNext:[{type:e.ViewChild,args:["findNext",{static:!1}]}],onWindowKeyDown:[{type:e.HostListener,args:["window:keydown",["$event"]]}]};var di=r.createSelector(to,(function(t){return t.redactions})),hi=r.createSelector(di,(function(t){return t.redactionPageEntities})),mi=r.createSelector(di,(function(t){return t.selectedRedaction})),gi=r.createSelector(di,(function(t){return t.redactedDocumentInfo})),bi=r.createSelector(di,(function(t){return t.redactionEntities})),fi=r.createSelector(bi,oo,(function(t,e){return{redactions:Object.keys(t).map((function(e){return t[e]})),documentId:e}})),vi=r.createSelector(no,hi,(function(t,e){if(t&&e){var n=[];return Object.keys(t).forEach((function(o){n.push({anno:e[o]?e[o]:[],styles:t[o].styles})})),n}})),yi=function(){function t(t,e,n){this.toolbarEventService=t,this.toolbarButtons=e,this.store=n,this.preview=!1,this.hasRedactions=!1}return t.prototype.ngOnInit=function(){var t=this;this.$subscription=this.store.pipe(r.select(fi)).subscribe((function(e){t.hasRedactions=!!e.redactions.length}))},t.prototype.toggleTextRedactionMode=function(){this.toolbarEventService.highlightModeSubject.next(!0)},t.prototype.toggleDrawMode=function(){this.toolbarEventService.drawModeSubject.next(!0)},t.prototype.togglePreview=function(){this.preview=!this.preview,this.toolbarEventService.toggleRedactionPreview(this.preview)},t.prototype.unmarkAll=function(){this.toolbarEventService.unmarkAll()},t.prototype.redact=function(){this.toolbarEventService.applyRedactionToDocument()},t.prototype.toggleRedactBar=function(){this.toolbarEventService.toggleRedactionMode()},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t}();yi.decorators=[{type:e.Component,args:[{selector:"mv-redaction-toolbar",template:'<div class="redaction">\n <label class="govuk-label redaction-title" data-l10n-id="redaction_options">Redaction options</label>\n <button id="toggleDrawButton" class="mv-button redaction-button--draw" title="Draw a box"\n data-l10n-id="toggleDrawButton" (click)="toggleDrawMode()">\n <span data-l10n-id="toggleDrawButton_label">Draw a box</span>\n </button>\n\n <button *ngIf="toolbarButtons.showHighlightButton" id="toggleHighlightButton"\n class="mv-button redaction-button--redact" aria-pressed="false" title="Redact text"\n data-l10n-id="toggleTextRedactionButton" (click)="toggleTextRedactionMode()">\n <span data-l10n-id="toggleTextRedactionButton_label">Redact text</span>\n </button>\n\n <button [disabled]="!hasRedactions" id="mvClearBtn" #mvClearBtn class="mv-button redaction-button--clear" aria-pressed="false" title="Clear all"\n data-l10n-id="toggleClearAllButton" (click)="unmarkAll()">\n <span data-l10n-id="Clear all">Clear all</span>\n </button>\n\n <button [disabled]="!hasRedactions" id="mvPreviewBtn" class="mv-button" [class.redaction-button--preview]="!preview"\n [class.redaction-button--hide-preview]="preview" redaction-button--preview aria-pressed="false" title="Preview"\n data-l10n-id="togglePreviewButton" (click)="togglePreview()">\n <span *ngIf="!preview" data-l10n-id="redaction-preview_label">Preview</span>\n <span *ngIf="preview" data-l10n-id="redaction-hide-preview_label">Hide preview</span>\n </button>\n\n <button [disabled]="!hasRedactions" id="mvRedactBtn" class="mv-button redaction-button--download" aria-pressed="false" title="Redact"\n data-l10n-id="mvRedactBtn" (click)="redact()">\n <span data-l10n-id="Save Document">Save document</span>\n </button>\n\n <button id="mvCloseBtn" #mvCloseBtn class="mv-button redaction-button--close" title="Close Redaction" data-l10n-id="mvRedactBtn"\n (click)="toggleRedactBar()">\n <span data-l10n-id="Close Redaction">Close Redaction</span>\n </button>\n\n</div>\n'}]}],yi.ctorParameters=function(){return[{type:X},{type:nt},{type:r.Store}]};var wi=function(){function t(t,e){this.toolbarEventService=t,this.store=e}return t.prototype.ngOnInit=function(){var t=this;this.$subscription=this.store.pipe(r.select(yo)).subscribe((function(e){return t.isPresenter=e})),this.$subscription.add(this.store.pipe(r.select(fo)).subscribe((function(e){return t.presenterName=e})))},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.present=function(){this.toolbarEventService.icp.becomePresenter()},t.prototype.stopPresenting=function(){this.toolbarEventService.icp.stopPresenting()},t.prototype.leaveIcpSession=function(){this.toolbarEventService.icp.leaveSession()},t.prototype.showParticipantsList=function(){this.toolbarEventService.toggleParticipantsList(!this.toolbarEventService.icp.participantsListVisible.getValue())},t}();wi.decorators=[{type:e.Component,args:[{selector:"mv-icp-toolbar",template:'<div id="icp-toolbar" class="icpMode">\n <div id="toolbar-title">\n <label class="govuk-label" data-l10n-id="digitalEvidence_label">Digital evidence presentation</label>\n </div>\n\n <div id="presentation-mode">\n <div class="item-label">\n <label class="govuk-label" data-l10n-id="icpInfo_label">You are in presentation mode</label>\n </div>\n <div class="item-button">\n <button class="govuk-button govuk-button--secondary" data-module="govuk-button" tabindex="0"\n title="Leave presentation" (click)="leaveIcpSession()">\n <span data-l10n-id="icp-leave-presentation_label">Leave presentation</span>\n </button>\n </div>\n </div>\n\n <div id="presenter-info">\n <div class="item-label">\n <label class="govuk-label" *ngIf="!presenterName" data-l10n-id="noPresenter_label">Waiting for presenter</label>\n <label class="govuk-label" *ngIf="presenterName && isPresenter" data-l10n-id="isPresenter_label">You are\n presenting</label>\n <label class="govuk-label" *ngIf="presenterName && !isPresenter"\n data-l10n-id="otherPresenter_label">{{ presenterName | titlecase }}\n is presenting</label>\n </div>\n <div class="item-button">\n <button *ngIf="!presenterName" class="govuk-button" id="icp-present" tabindex="0" title="Present"\n (click)="present()">\n <span data-l10n-id="icp-present_label">Start presenting</span>\n </button>\n <button *ngIf="isPresenter" class="govuk-button govuk-button--warning" id="icp-stop-presenting" tabindex="0"\n title="Stop presenting" (click)="stopPresenting()">\n <span data-l10n-id="icp-stop-presenting_label">Stop Presenting</span>\n </button>\n </div>\n </div>\n\n <div id="participant-list">\n <button class="govuk-button govuk-button--secondary" id="icp-participants-list" tabindex="0"\n title="Participants list" (click)="showParticipantsList()">\n <span\n data-l10n-id="icp-stop-presenting_label">{{(toolbarEventService.icp.participantsListVisible | async) ? \'Hide\': \'Show\'}}\n participants</span>\n </button>\n </div>\n</div>'}]}],wi.ctorParameters=function(){return[{type:X},{type:r.Store}]};var Si=function(){};Si.decorators=[{type:e.NgModule,args:[{declarations:[pi,ui,yi,wi],providers:[nt,X],exports:[ui,pi,yi,wi],imports:[n.CommonModule,o.FormsModule,m.OverlayModule,g.RouterModule]}]}];var ki=function(){function t(t,n){this.toolbarEvents=t,this.store=n,this.update=new e.EventEmitter,this.delete=new e.EventEmitter,this.annotationClick=new e.EventEmitter}return Object.defineProperty(t.prototype,"annotation",{set:function(t){this.anno=Object.assign({},t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectedAnnoId",{set:function(t){if(t){var e=this.anno.id||this.anno.redactionId;this.selected=!!t.annotationId&&t.annotationId===e}},enumerable:!1,configurable:!0}),t.prototype.onSelect=function(){var t=this.anno.id||this.anno.redactionId;this.annotationClick.emit({annotationId:t,editable:!1,selected:!0})},t.prototype.onRectangleUpdate=function(t){var e=Object.assign({},this.anno);e.rectangles=e.rectangles.filter((function(e){return e.id!==t.id})),e.rectangles.push(t),this.update.emit(e)},t.prototype.deleteHighlight=function(){this.delete.emit(this.anno)},t.prototype.addOrEditComment=function(){if(0===this.anno.comments.length){var t={annotationId:this.anno.id,content:"",createdBy:this.anno.createdBy,createdByDetails:void 0,createdDate:T.default.utc().tz("Europe/London").toISOString(),id:w.v4(),lastModifiedBy:"",lastModifiedByDetails:void 0,lastModifiedDate:"",tags:[],page:null,pages:{},pageHeight:null,selected:!1,editable:!1};this.store.dispatch(new we(t))}this.selected=!0,this.annotationClick.emit({annotationId:this.anno.id,editable:!0,selected:!0}),this.toolbarEvents.toggleCommentsPanel(!0)},t}();ki.decorators=[{type:e.Component,args:[{selector:"mv-annotation",template:'<div #container [tabindex]="anno.id">\n <mv-ctx-toolbar *ngIf="selected"\n [canDelete]="true" [canComment]="true"\n [rectangles]="anno.rectangles"\n [zoom]="zoom"\n [rotate]="rotate"\n [pageHeight]="pageHeight"\n [pageWidth]="pageWidth"\n (deleteHighlightEvent)="deleteHighlight()"\n (addOrEditCommentEvent)="addOrEditComment()">\n </mv-ctx-toolbar>\n <ng-container *ngFor="let rectangle of anno.rectangles">\n <mv-anno-rectangle\n (select)="onSelect()"\n (update)="onRectangleUpdate($event)"\n [selected]="selected"\n [zoom]="zoom"\n [rotate]="rotate"\n [pageHeight]="pageHeight"\n [pageWidth]="pageWidth"\n [editable]="anno.rectangles.length <= 1"\n [annoRect]="rectangle"\n [color]="anno.color">\n </mv-anno-rectangle>\n </ng-container>\n</div>\n'}]}],ki.ctorParameters=function(){return[{type:X},{type:r.Store}]},ki.propDecorators={annotation:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],selectedAnnoId:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}],update:[{type:e.Output}],delete:[{type:e.Output}],annotationClick:[{type:e.Output}],container:[{type:e.ViewChild,args:["container",{static:!1}]}]};var Ei=function(){function t(t,e){this.store=t,this.commentService=e,this.annotations=[]}return t.prototype.ngOnInit=function(){this.selectedAnnotation$=this.store.pipe(r.select(Go))},t.prototype.onAnnotationUpdate=function(t){this.store.dispatch(new fe(t))},t.prototype.onAnnotationDelete=function(t){t.comments.length>0&&this.commentService.updateUnsavedCommentsStatus(t,!1),this.store.dispatch(new Se(t.id))},t.prototype.selectAnnotation=function(t){this.store.dispatch(new Ce(t))},t}();Ei.decorators=[{type:e.Component,args:[{selector:"mv-annotation-set",template:'<ng-container *ngFor="let annotation of annotations">\n <mv-annotation [annotation]="annotation"\n [zoom]="zoom"\n [rotate]="rotate"\n [selectedAnnoId]="selectedAnnotation$ | async"\n [pageHeight]="pageHeight"\n [pageWidth]="pageWidth"\n (update)="onAnnotationUpdate($event)"\n (delete)="onAnnotationDelete($event)"\n (annotationClick)="selectAnnotation($event)">\n </mv-annotation>\n</ng-container>\n'}]}],Ei.ctorParameters=function(){return[{type:r.Store},{type:jo}]},Ei.propDecorators={page:[{type:e.Input}],annotations:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}]};var Ci=function(){function t(t,e){this.toolBarEvents=t,this.store=e}return t.prototype.saveAnnotation=function(t,e){var n=this;this.store.pipe(r.select(zo),s.take(1)).subscribe((function(o){var i=Object.assign(Object.assign({id:_.default(),color:"FFFF00",comments:[],page:e,rectangles:t,type:"highlight"},o),{createdBy:"",createdByDetails:void 0,createdDate:T.default.utc().tz("Europe/London").toISOString(),lastModifiedBy:"",lastModifiedByDetails:void 0,lastModifiedDate:"",tags:[]});n.store.dispatch(new fe(i))}))},t.prototype.applyRotation=function(t,e,n,o,i,a,s,r){var c={x:+(a/r).toFixed(2),y:+(i/r).toFixed(2),width:+(o/r).toFixed(2),height:+(n/r).toFixed(2)},l=c.x,u=c.y,p=c.width,d=c.height,h={x:l,y:u,width:p,height:d};switch(s){case 90:h.width=d,h.height=p,h.x=u,h.y=+(e/r-l-p).toFixed(2);break;case 180:h.x=+(e/r-l-p).toFixed(2),h.y=+(t/r-u-d).toFixed(2);break;case 270:h.width=d,h.height=p,h.x=+(t/r-u-d).toFixed(2),h.y=l}return h},t.prototype.resetHighlight=function(){window.getSelection().removeAllRanges(),this.toolBarEvents.highlightModeSubject.next(!1)},t}();Ci.decorators=[{type:e.Injectable}],Ci.ctorParameters=function(){return[{type:X},{type:r.Store}]};var Ii=function(){function t(t,n){this.toolbarEvents=t,this.highlightService=n,this.select=new e.EventEmitter,this.update=new e.EventEmitter,this.subscriptions=[],this.enableGrabNDrag=!1}return Object.defineProperty(t.prototype,"annoRect",{get:function(){return this._annoRect},set:function(t){this._annoRect=Object.assign({},t),this.height=+(t.height*this.zoom).toFixed(2),this.width=+(t.width*this.zoom).toFixed(2),this.left=+(t.x*this.zoom).toFixed(2),this.top=+(t.y*this.zoom).toFixed(2)},enumerable:!1,configurable:!0}),t.prototype.ngOnChanges=function(t){t.rotate&&this.adjustForRotation(this.rotate)},t.prototype.ngAfterViewInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.grabNDrag.subscribe((function(e){return t.enableGrabNDrag=e})))},t.prototype.ngOnDestroy=function(){this.subscriptions.filter((function(t){return!t.closed})).forEach((function(t){return t.unsubscribe()}))},Object.defineProperty(t.prototype,"selected",{get:function(){return this._selected},set:function(t){this._selected=t,this._selected&&this.viewRect&&this.viewRect.nativeElement.focus()},enumerable:!1,configurable:!0}),t.prototype.onClick=function(){this.select.emit(this.annoRect)},t.prototype.onUpdate=function(t){var e=t.offsetHeight,n=t.offsetWidth,o=t.offsetTop,i=t.offsetLeft;if(this.hasRectangleChanged(t)){var a=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,e,n,o,i,this.rotate,this.zoom);a=Object.assign(Object.assign({},this.annoRect),a),this.update.emit(Object.assign({},a))}},t.prototype.adjustForRotation=function(t){var e=this,n=e.top,o=e.left,i=e.height,a=e.width;switch(t){case 90:this.width=i,this.height=a,this.left=this.pageWidth-n-i,this.top=o;break;case 180:this.left=this.pageWidth-o-a,this.top=this.pageHeight-n-i;break;case 270:this.width=i,this.height=a,this.left=n,this.top=this.pageHeight-o-a}},t.prototype.hasRectangleChanged=function(t){return this.left!==t.offsetLeft||this.top!==t.offsetTop||this.width!==t.offsetWidth||this.height!==t.offsetHeight},t}();Ii.decorators=[{type:e.Component,args:[{selector:"mv-anno-rectangle",template:'<div *ngIf="editable; else nonEditable">\n <div #rectElement\n class="rectangle"\n draggable\n resizable\n [tabindex]="annoRect.id"\n [ngClass]="{ \'selected\': selected, \'grabNDrag\': enableGrabNDrag }"\n [style.backgroundColor]="\'#\' + color"\n [style.width]="width + \'px\'"\n [style.height]="height + \'px\'"\n [style.left]="left + \'px\'"\n [style.top]="top + \'px\'"\n [rotate]="0"\n [selected]="selected"\n (click)="onClick()"\n (stopped)="onUpdate(rectElement)">\n </div>\n</div>\n<ng-template #nonEditable>\n <div #rectElement\n class="rectangle"\n [tabindex]="annoRect.id"\n [ngClass]="{ \'selected\': selected }"\n [style.backgroundColor]="\'#\' + color"\n [style.width]="width + \'px\'"\n [style.height]="height+ \'px\'"\n [style.left]="left + \'px\'"\n [style.top]="top + \'px\'"\n (click)="onClick()">\n </div>\n</ng-template>\n'}]}],Ii.ctorParameters=function(){return[{type:X},{type:Ci}]},Ii.propDecorators={color:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],editable:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}],select:[{type:e.Output}],update:[{type:e.Output}],viewRect:[{type:e.ViewChild,args:["rectElement",{static:!1}]}],annoRect:[{type:e.Input}],selected:[{type:e.Input}]};var Oi=function(){function t(t){this.http=t,this.snakeCase=function(t){return t.replace(/ +/g," ").split(/ |\B(?=[A-Z])/).map((function(t){return t.toLowerCase()})).join("_")}}return t.prototype.getAllTags=function(t){var e="/em-anno/tags/"+t;return this.http.get(e)},t.prototype.getNewTags=function(t){return this.tagItems?this.tagItems[t]:[]},t.prototype.updateTagItems=function(t,e){var n,o=this,i=t.map((function(t){return Object.assign(Object.assign({},t),{name:o.snakeCase(t.name)})}));this.tagItems=Object.assign(Object.assign({},this.tagItems),((n={})[e]=i,n))},t}();Oi.decorators=[{type:e.Injectable}],Oi.ctorParameters=function(){return[{type:i.HttpClient}]};var Pi=function(){function t(t,n,o){this.store=t,this.commentService=n,this.tagsServices=o,this.CHAR_LIMIT=5e3,this.totalPrevPagesHeight=0,this.hasUnsavedChanges=!1,this.commentClick=new e.EventEmitter,this.renderComments=new e.EventEmitter,this.delete=new e.EventEmitter,this.updated=new e.EventEmitter,this.changes=new e.EventEmitter,this.rotate=0,this.zoom=1}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions=this.store.select(Ko).pipe(s.distinctUntilChanged()).subscribe((function(e){return t.searchString=e})),this.reRenderComments()},t.prototype.ngAfterContentInit=function(){this.tagItems&&this.tagItems.length&&this.tagsServices.updateTagItems(this.tagItems,this._comment.annotationId)},t.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe()},Object.defineProperty(t.prototype,"comment",{get:function(){return this._comment},set:function(t){this._comment=Object.assign({},t),this.page=this._comment.page,this.lastUpdate=t.lastModifiedDate?t.lastModifiedDate:t.createdDate,this.author=t.createdByDetails,this.createdBy=t.createdBy,this.editor=t.lastModifiedByDetails,this.originalComment=t.content,this.fullComment=this.originalComment,this.selected=this._comment.selected,this._editable=this._comment.editable,this.tagItems=this._comment.tags;this.totalPrevPagesHeight=0;for(var e=0;e<this.page-1;e++){var n=this._comment.pages[e+1]?this._comment.pages[e+1].styles.height:void 0;n&&(this.totalPrevPagesHeight+=n+10)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"annotation",{set:function(t){this._rectangle=t.rectangles.reduce((function(t,e){return t.y<e.y?t:e}));var e=this._comment.pages[this.page].styles.height/this.zoom;switch(this.rotate){case 90:this.rectTop=this._rectangle.x;break;case 180:this.rectTop=e-(this._rectangle.y+this._rectangle.height);break;case 270:this.rectTop=e-(this._rectangle.x+this._rectangle.width);break;default:this.rectTop=this._rectangle.y}this.rectLeft=this._rectangle.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"editable",{get:function(){return this._editable},enumerable:!1,configurable:!0}),t.prototype.onCommentChange=function(t){this.hasUnsavedChanges=this.originalComment.substring(0,this.CHAR_LIMIT)!==t.substring(0,this.CHAR_LIMIT),this.commentService.onCommentChange(this.hasUnsavedChanges)},t.prototype.deleteOrCancel=function(){this.editable?(this.hasUnsavedChanges=!1,this._editable=!1,this.fullComment=this.originalComment,this.changes.emit(!1),this.author||this.fullComment||this.delete.emit(this._comment)):this.delete.emit(this._comment)},t.prototype.editOrSave=function(){if(this.editable){this._comment.content=this.fullComment.substring(0,this.CHAR_LIMIT);var t=this.tagsServices.getNewTags(this._comment.annotationId),e={comment:this._comment,tags:t};this.updated.emit(e),this.hasUnsavedChanges=!1,this._editable=!1,this.changes.emit(!1)}else this._editable=!0},t.prototype.onCommentClick=function(){this.selected||(this.selected=!0,this._editable=!1,this.commentClick.emit({annotationId:this._comment.annotationId,editable:this._editable,selected:!0}))},t.prototype.reRenderComments=function(){this.renderComments.emit(this._comment)},Object.defineProperty(t.prototype,"commentTop",{get:function(){return this.totalPrevPagesHeight+this.rectTop*this.zoom},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.form.nativeElement.getBoundingClientRect().height/this.zoom},enumerable:!1,configurable:!0}),t}();Pi.decorators=[{type:e.Component,args:[{selector:"mv-anno-comment",template:'<div #form (click)="onCommentClick()" class="aui-comment"\n [style.top.px]="commentTop"\n [style.zIndex]="selected ? 100 : 0">\n <div id="detailsWrapper {{index}}" class="aui-comment__header">\n <span *ngIf="author && !editor" class="aui-comment__author">\n {{ author.forename }} {{ author.surname }}\n </span>\n <span *ngIf="editor" class="aui-comment__author">\n {{ editor.forename }} {{ editor.surname }}\n </span>\n <time [hidden]="!selected && !this.editable" class="aui-comment__meta">\n {{ lastUpdate | momentDate: \'d MMMM y h:mm a\' }}\n </time>\n </div>\n <mv-tags\n [tagItems]="tagItems"\n [userId]="createdBy"\n [editable]="editable"\n [annoId]="_comment.annotationId">\n </mv-tags>\n <textarea *ngIf="selected && editable"\n #editableComment\n mvTextAreaAutoExpand\n type="text"\n required\n name="content"\n [maxlength]="CHAR_LIMIT"\n class="aui-comment__content form-control mimic-focus edit-mode expanded"\n [(ngModel)]="fullComment"\n (ngModelChange)="reRenderComments(); onCommentChange($event);"\n aria-label="comment">\n </textarea>\n <p *ngIf="!editable"\n mvTextHighlight class="commentText" [textToHighlight]="searchString">\n {{ fullComment }}\n </p>\n <div *ngIf="selected || this.editable || (!fullComment.length && (tagItems && !tagItems.length))"\n class="aui-comment__footer commentBtns">\n <button class="govuk-button"\n type="button" role="button"\n (click)="editOrSave()">\n {{ !editable ? \'Edit\' : \'Save\' }}\n </button>\n <button type="button" role="button"\n class="govuk-button govuk-button--secondary"\n (click)="deleteOrCancel()">\n {{ !editable ? \'Delete\' : \'Cancel\' }}\n </button>\n </div>\n <span class="aui-comment__private">private</span>\n</div>\n'}]}],Pi.ctorParameters=function(){return[{type:r.Store},{type:jo},{type:Oi}]},Pi.propDecorators={commentClick:[{type:e.Output}],renderComments:[{type:e.Output}],delete:[{type:e.Output}],updated:[{type:e.Output}],changes:[{type:e.Output}],rotate:[{type:e.Input}],zoom:[{type:e.Input}],index:[{type:e.Input}],page:[{type:e.Input}],form:[{type:e.ViewChild,args:["form",{static:!1}]}],editableComment:[{type:e.ViewChild,args:["editableComment",{static:!1}]}],comment:[{type:e.Input}],annotation:[{type:e.Input}]};var xi=function(){function t(){this.createHighlightEvent=new e.EventEmitter,this.deleteHighlightEvent=new e.EventEmitter,this.addOrEditCommentEvent=new e.EventEmitter,this.createBookmarkEvent=new e.EventEmitter,this.defaultHeight=70,this.defaultWidth=300}return t.prototype.ngOnChanges=function(t){this.setRectangle(),this.top=this.popupTop(),this.left=this.popupLeft()},Object.defineProperty(t.prototype,"rectangles",{get:function(){return this._rectangles},set:function(t){t&&(this._rectangles=t,this.setRectangle())},enumerable:!1,configurable:!0}),t.prototype.createHighlight=function(){this.createHighlightEvent.emit(),this.rectangle=void 0},t.prototype.deleteHighlight=function(){this.deleteHighlightEvent.emit()},t.prototype.addOrEditComment=function(){this.addOrEditCommentEvent.emit(),setTimeout((function(){location.hash||document.getElementById("viewerContainer").scrollBy(0,1)}),10)},t.prototype.createBookmark=function(){this.createBookmarkEvent.emit(this.rectangle),this.rectangle=void 0},t.prototype.setRectangle=function(){var t=this.rectangles.reduce((function(t,e){return t.y<e.y?t:e}));switch(this.rectangle=Object.assign({},t),this.rotate){case 90:this.rectangle.width=t.height,this.rectangle.height=t.width,this.rectangle.x=this.pageWidth/this.zoom-t.y-t.height,this.rectangle.y=t.x;break;case 180:this.rectangle.x=this.pageWidth/this.zoom-t.x-t.width,this.rectangle.y=this.pageHeight/this.zoom-t.y-t.height;break;case 270:this.rectangle.width=t.height,this.rectangle.height=t.width,this.rectangle.x=t.y,this.rectangle.y=this.pageHeight/this.zoom-t.x-t.width}},t.prototype.popupTop=function(){var t=this.rectangle.y*this.zoom-this.defaultHeight;return t<=0?this.defaultHeight:t},t.prototype.popupLeft=function(){var t=(this.rectangle.x+this.rectangle.width/2)*this.zoom-this.defaultWidth/2;return t<=0?0:t>=this.pageWidth-this.defaultWidth?this.pageWidth-this.defaultWidth:t},t}();xi.decorators=[{type:e.Component,args:[{selector:"mv-ctx-toolbar",template:'<div class="toolbar" *ngIf="rectangle"\n [style.top.px]="top"\n [style.left.px]="left">\n <button *ngIf="canHighlight"\n type="button" title="Highlight"\n class="aui__toolbar-button aui__toolbar-button--comments contextual-btn leftButton aui__toolbar-button-highlight"\n (mousedown)="createHighlight()">\n <span>Highlight</span>\n </button>\n <button *ngIf="canDelete"\n type="button" title="Delete"\n class="aui__toolbar-button aui__toolbar-button--comments contextual-btn leftButton"\n (mousedown)="deleteHighlight()">\n <span>Remove</span>\n </button>\n <button *ngIf="canComment"\n type="button" title="Comment"\n class="aui__toolbar-button aui__toolbar-button--comments contextual-btn rightButton aui__toolbar-button-comment"\n (mousedown)="addOrEditComment()">\n <span>Comment</span></button>\n <button *ngIf="canBookmark"\n type="button" title="Bookmark"\n class="aui__toolbar-button aui__toolbar-button--comments contextual-btn rightButton aui__toolbar-button-bookmark"\n id="bookmarkButton"\n (mousedown)="createBookmark()">\n <span>Bookmark</span></button>\n <div class="arrow-down">\n <div class="inner-triangle"></div>\n </div>\n</div>\n'}]}],xi.ctorParameters=function(){return[]},xi.propDecorators={zoom:[{type:e.Input}],rotate:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}],canHighlight:[{type:e.Input}],canBookmark:[{type:e.Input}],canComment:[{type:e.Input}],canDelete:[{type:e.Input}],createHighlightEvent:[{type:e.Output}],deleteHighlightEvent:[{type:e.Output}],addOrEditCommentEvent:[{type:e.Output}],createBookmarkEvent:[{type:e.Output}],rectangles:[{type:e.Input}]};var ji=function(){function t(){}return t.prototype.redrawComponents=function(t,e,n,o){var i,a=this;this.sortComponents(t,e,n,o).forEach((function(t){a.adjustIfOverlapping(t,i,o),i=t}))},t.prototype.sortComponents=function(t,e,n,o){var i=this;return t.sort((function(t,a){return t.rectTop=i.top(t._rectangle,e[t.page-1],n,o),a.rectTop=i.top(a._rectangle,e[a.page-1],n,o),i.processSort(t,a)}))},t.prototype.adjustIfOverlapping=function(t,e,n){if(e){var o=e.commentTop+this.height(e);t.commentTop<=o&&(t.rectTop=(o-t.totalPrevPagesHeight)/n)}},t.prototype.processSort=function(t,e){return this.onSameLine(t,e)?t.rectLeft>=e.rectLeft?1:-1:t.commentTop>=e.commentTop?1:-1},t.prototype.onSameLine=function(t,e){return 0===this.difference(t.commentTop,e.commentTop)},t.prototype.top=function(t,e,n,o){var i=e/o;switch(n){case 90:return t.x;case 180:return i-(t.y+t.height);case 270:return i-(t.x+t.width);default:return t.y}},t.prototype.height=function(t){return t.form.nativeElement.getBoundingClientRect().height},t.prototype.difference=function(t,e){return Math.abs(t-e)},t}();ji.decorators=[{type:e.Injectable}];var Ti=function(){function t(t,e,n,o){this.store=t,this.commentService=e,this.renderService=n,this.toolbarEvents=o,this.pageHeights=[],this.subscriptions=[],this.clearSelection()}return t.prototype.ngOnInit=function(){var t=this;this.comments$=this.store.pipe(r.select(oi)),this.annoEntities$=this.store.pipe(r.select(Ho)),this.subscriptions.push(this.toolbarEvents.commentsPanelVisible.subscribe((function(e){t.redrawComments(),t.showCommentsPanel=e}))),this.subscriptions.push(this.toolbarEvents.rotateSubject.subscribe((function(e){return t.rotateDocument()})))},t.prototype.ngOnChanges=function(t){t.annotationSet&&this.commentService.setCommentSet(this),t.contentScrollTop&&this.container&&this.container.nativeElement.scrollTo(0,this.contentScrollTop)},t.prototype.ngOnDestroy=function(){this.subscriptions.length>0&&this.subscriptions.forEach((function(t){return t.unsubscribe()}))},t.prototype.onSelect=function(t){this.store.dispatch(new Ce(t))},t.prototype.onCommentDelete=function(t){var e=this.annotationSet.annotations.find((function(e){return e.id===t.annotationId})),n=Object.assign(Object.assign({},e),{comments:[]});this.onAnnotationUpdate(n),this.redrawComments()},t.prototype.redrawComments=function(){var t=this;setTimeout((function(){var e=t.commentComponents.map((function(t){return t}));t.renderService.redrawComponents(e,t.pageHeights,t.rotate,t.zoom)}),0)},t.prototype.rotateDocument=function(){this.panel&&(this.panel.nativeElement.style.height="0")},t.prototype.onCommentUpdate=function(t){var e=this.annotationSet.annotations.find((function(e){return e.id===t.comment.annotationId})),n=[t.comment],o=t.tags,i=Object.assign(Object.assign({},e),{comments:n,tags:o});this.onAnnotationUpdate(i)},t.prototype.onAnnotationUpdate=function(t){this.store.dispatch(new fe(t))},t.prototype.onContainerClick=function(t){t.path&&t.path[0]===this.panel.nativeElement&&this.clearSelection()},t.prototype.clearSelection=function(){this.store.dispatch(new Ce({annotationId:"",editable:!1,selected:!1}))},t.prototype.allCommentsSaved=function(){this.commentService.allCommentsSaved()},t}();Ti.decorators=[{type:e.Component,args:[{selector:"mv-comment-set",template:'<div #container [ngClass]="{\'comments\': showCommentsPanel}">\n <div #panel [ngClass]="{ \'comments-panel comment-container\': true, \'expanded\': showCommentsPanel }"\n [style.height.px]="height"\n (click)="onContainerClick($event)">\n <ng-container *ngFor="let comment of (comments$ | async); let i = index;">\n <mv-anno-comment\n [ngStyle]="showCommentsPanel ? {} : {\'display\':\'none\'}"\n #commentComponent\n (commentClick)="onSelect($event)"\n (delete)="onCommentDelete($event)"\n (updated)="onCommentUpdate($event)"\n (changes)="allCommentsSaved()"\n [zoom]="zoom"\n [rotate]="rotate"\n [index]="i"\n [page]="comment.page"\n [comment]="comment"\n [annotation]="(annoEntities$ | async)[comment.annotationId]"\n (renderComments)="redrawComments()">\n </mv-anno-comment>\n </ng-container>\n </div>\n</div>\n'}]}],Ti.ctorParameters=function(){return[{type:r.Store},{type:jo},{type:ji},{type:X}]},Ti.propDecorators={annotationSet:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],height:[{type:e.Input}],pageHeights:[{type:e.Input}],contentScrollTop:[{type:e.Input}],container:[{type:e.ViewChild,args:["container",{static:!1}]}],panel:[{type:e.ViewChild,args:["panel",{static:!1}]}],commentComponents:[{type:e.ViewChildren,args:["commentComponent"]}]};var _i=function(){function t(t){this.el=t}return t.prototype.ngAfterContentChecked=function(){this.adjustHeight()},t.prototype.onMouseDown=function(){this.adjustHeight()},t.prototype.adjustHeight=function(){var t=this.el.nativeElement;t.style.overflow="hidden",t.style.height="auto",t.style.height=t.scrollHeight-5+"px"},t}();_i.decorators=[{type:e.Directive,args:[{selector:"[mvTextAreaAutoExpand]"}]}],_i.ctorParameters=function(){return[{type:e.ElementRef}]},_i.propDecorators={onMouseDown:[{type:e.HostListener,args:["input"]}]};var Di=function(){function t(t,e,n,o){this.store=t,this.printService=e,this.toolbarEvents=n,this.fb=o,this.showFilters=!1,this.hasFilter=!1}return t.prototype.ngOnInit=function(){this.filtersFg=this.fb.group({dateRangeFrom:new o.FormGroup({day:new o.FormControl(""),month:new o.FormControl(""),year:new o.FormControl("")}),dateRangeTo:new o.FormGroup({day:new o.FormControl(""),month:new o.FormControl(""),year:new o.FormControl("")}),tagFilters:this.fb.group({})}),this.comments$=this.store.pipe(r.select(ai)),this.buildCheckBoxForm(),this.container.nativeElement.focus()},t.prototype.buildCheckBoxForm=function(){var t=this;this.filtersFg.reset();var e=this.filtersFg.get("tagFilters"),n=this.store.pipe(r.select(Qo));this.allTags$=this.store.pipe(r.select(Fo)),this.$subscriptions=a.combineLatest([this.allTags$,n]).subscribe((function(n){var i=F(n,2),a=i[0],s=i[1];t.hasFilter=s.hasFilter,a.forEach((function(t){var n=!(!s.filters.tagFilters||!s.filters.tagFilters.hasOwnProperty(t.key))&&s.filters.tagFilters[t.key];e.addControl(t.key,new o.FormControl(n))})),t.filtersFg.updateValueAndValidity()}))},t.prototype.onClearFilters=function(){this.store.dispatch(new Pe),this.buildCheckBoxForm()},t.prototype.onFilter=function(){var t=this.filtersFg.value,e=t.dateRangeFrom.year&&t.dateRangeFrom.month&&t.dateRangeFrom.day,n=t.dateRangeTo.year&&t.dateRangeTo.month&&t.dateRangeTo.day,o=e?new Date(t.dateRangeFrom.year,t.dateRangeFrom.month-1,t.dateRangeFrom.day).getTime():null,i=n?new Date(t.dateRangeTo.year,t.dateRangeTo.month-1,t.dateRangeTo.day).getTime():null;this.store.dispatch(new Oe(Object.assign(Object.assign({},t),{dateRangeFrom:o,dateRangeTo:i})))},t.prototype.onFiltersToggle=function(){this.showFilters=!this.showFilters},t.prototype.onClose=function(){this.toolbarEvents.toggleCommentsSummary(!1)},t.prototype.onPrint=function(){this.printService.printElementNatively(this.commentsTable.nativeElement,1e3,900)},t.prototype.navigateToPage=function(t){"pdf"===this.contentType&&this.toolbarEvents.setPage(t),this.toolbarEvents.toggleCommentsSummary(!1),this.toolbarEvents.toggleCommentsPanel(!0)},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t}();Di.decorators=[{type:e.Component,args:[{selector:"mv-comments-summary",template:'<div id="modal-background" class="modal" (click)="onClose()">\n <div #outerContainer id="modal" class="modal-content govuk-width-container clearfix" (click)="$event.stopPropagation()" cdkTrapFocus tabindex="0">\n <div id="comment-container" class="comment-container" #commentContainer>\n <h2 class="govuk-heading-m">{{ title }}</h2>\n <ng-container *ngIf="(comments$ | async) as comments">\n <ng-container *ngIf="comments.length">\n <button type="submit" class="govuk-button govuk-!-margin-right-1" (click)="onFiltersToggle()">\n {{ !showFilters ? \'Show Filters\' : \'Hide Filters\'}}\n </button>\n <button type="submit" class="govuk-button govuk-button--secondary" (click)="onClearFilters()" *ngIf="hasFilter">\n Clear Filters\n </button>\n <ng-container *ngIf="showFilters">\n <form [formGroup]="filtersFg" (ngSubmit)="onFilter()" >\n <div class="dates">\n <div class="dates__from">\n <mv-gov-uk-date\n [config]="{id: \'dateRangeFrom\', legend: \'From\'}"\n [formGroup]="filtersFg.controls[\'dateRangeFrom\']"\n [errorMessage]="\'test\'"\n ></mv-gov-uk-date>\n </div>\n <div class="dates__to">\n <mv-gov-uk-date\n [config]="{id: \'dateRangeTo\', legend: \'To\'}"\n [formGroup]="filtersFg.controls[\'dateRangeTo\']"\n [errorMessage]="\'test\'"\n ></mv-gov-uk-date>\n </div>\n <div class="dates__tags">\n <mv-gov-uk-fieldset\n [config]="{legend: \'Tags\', classes: \'govuk-label--m\', id: \'filters\'}"\n [isHeading]="false">\n <div class="govuk-checkboxes--scroll" [formGroup]="filtersFg.controls[\'tagFilters\']">\n <div class="govuk-checkboxes govuk-checkboxes--small">\n <div class="govuk-checkboxes__item" *ngFor="let item of (allTags$ | async)">\n <input [formControlName]="item.key" class="govuk-checkboxes__input" [value]="false" type="checkbox">\n <label class="govuk-label govuk-checkboxes__label">\n {{ item.key | unsnake}} ({{item.length}})\n </label>\n </div>\n </div>\n </div>\n </mv-gov-uk-fieldset>\n </div>\n <div class="dates__cta">\n <button type="submit" class="govuk-button">\n Filter comments\n </button>\n </div>\n </div>\n </form>\n </ng-container>\n <ng-container *ngIf="comments[0]">\n <ngx-datatable\n [rows]="comments"\n rowHeight="auto"\n headerHeight="auto"\n [columnMode]="\'flex\'"\n [sorts]="[{ prop: \'date\', dir: \'desc\' }]">\n <ngx-datatable-column name="User" [flexGrow]="1" [sortable]="false"></ngx-datatable-column>\n <ngx-datatable-column name="Page" [flexGrow]="1">\n <ng-template ngx-datatable-cell-template let-value="value">\n <a [routerLink]="" class="comment-summary_pages" (click)="navigateToPage(value)">{{value}}</a>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column name="Date" [flexGrow]="1"></ngx-datatable-column>\n <ngx-datatable-column name="Comment" [flexGrow]="3" [sortable]="false"></ngx-datatable-column>\n <ngx-datatable-column name="Tags" [flexGrow]="1" [sortable]="false">\n <ng-template ngx-datatable-cell-template let-value="value">\n <span class="hmcts-badge" *ngFor="let tag of value">{{tag.label}}</span>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </ng-container>\n </ng-container>\n <ng-container *ngIf="!comments[0]">\n <h3 class="govuk-heading-s" >No comments available. Select text to add a highlight or comment.</h3>\n </ng-container>\n </ng-container>\n </div>\n\n <div class="button-container">\n <button (click)="onPrint()" class="govuk-button govuk-button--secondary">Print</button>\n <button id="modal-close-button" (click)="onClose()" class="govuk-button">Close</button>\n </div>\n </div>\n</div>\n'}]}],Di.ctorParameters=function(){return[{type:r.Store},{type:tt},{type:X},{type:o.FormBuilder}]},Di.propDecorators={title:[{type:e.Input}],contentType:[{type:e.Input}],container:[{type:e.ViewChild,args:["outerContainer",{static:!0}]}],commentsTable:[{type:e.ViewChild,args:["commentContainer",{static:!1}]}]};var Ri=function(){function t(t,n){this.toolbarEvents=t,this.highlightService=n,this.saveSelection=new e.EventEmitter,this.drawStartX=-1,this.drawStartY=-1,this.backgroundColor="none",this.subscriptions=[]}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions=[this.toolbarEvents.drawModeSubject.subscribe((function(e){t.defaultHeight=e?"100%":"0px",t.defaultWidth=e?"100%":"0px"}))]},t.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(t){t.unsubscribe()}))},t.prototype.initHighlight=function(t){var e=t.offsetX,n=t.offsetY;switch(this.position="absolute",this.backgroundColor="yellow",this.drawStartX=e,this.drawStartY=n,this.display="block",this.height=50,this.width=50,this.top=this.drawStartY,this.left=this.drawStartX,this.rotate){case 90:this.top=this.drawStartY-this.height;break;case 180:this.top=this.drawStartY-this.height,this.left=this.drawStartX-this.width;break;case 270:this.left=this.drawStartX-this.width}},t.prototype.updateHighlight=function(t){var e=t.currentTarget,n=t.clientX,o=t.clientY,i=e.getBoundingClientRect(),a=n-i.left,s=o-i.top;this.drawStartX>0&&this.drawStartY>0&&(this.height=Math.abs(s-this.drawStartY),this.width=Math.abs(a-this.drawStartX),this.top=Math.min(s,this.drawStartY),this.left=Math.min(a,this.drawStartX))},t.prototype.createHighlight=function(){if(this.height/this.zoom>5||this.width/this.zoom>5){var t=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,this.height,this.width,this.top,this.left,this.rotate,this.zoom);t=Object.assign({id:_.default()},t),this.saveSelection.emit({rectangles:[t],page:this.page}),this.resetHighlight()}},t.prototype.resetHighlight=function(){this.drawStartX=-1,this.drawStartY=-1,this.display="none",this.width=0,this.height=0},t}();Ri.decorators=[{type:e.Component,args:[{selector:"mv-box-highlight-create",template:'<div [style.height]="defaultHeight"\n [style.width]="defaultWidth"\n (mousedown)="initHighlight($event)"\n (mousemove)="updateHighlight($event)"\n (mouseup)="createHighlight()">\n <div #boxHighlight\n class="box-highlight"\n [style.display]="display"\n [style.position]="position"\n [style.background-color]="backgroundColor"\n [style.height]="height ? height + \'px\' : \'100%\'"\n [style.width]="width ? width + \'px\' : \'100%\'"\n [style.top]="top + \'px\'"\n [style.left]="left + \'px\'">\n </div>\n</div>\n'}]}],Ri.ctorParameters=function(){return[{type:X},{type:Ci}]},Ri.propDecorators={page:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}],rotate:[{type:e.Input}],zoom:[{type:e.Input}],container:[{type:e.Input}],saveSelection:[{type:e.Output}],highlight:[{type:e.ViewChild,args:["boxHighlight",{static:!1}]}]};var Bi=function(){function t(t,n){this.store=t,this.toolbarEvents=n,this.showCommentSummaryDialog=new e.EventEmitter,this.tabs=[],this.tabSelected=""}return t.prototype.ngOnInit=function(){var t=this,e=this.store.pipe(r.select(No)),n=this.store.pipe(r.select(ri));this.$subscriptions=a.combineLatest([e,n]).subscribe((function(e){var n=F(e,2),o=n[0],i=n[1];t.navigationList=i,t.tabs=t.navigationList.length>0?[{label:"comments"},{label:"filter"},{label:"search"}]:[{label:"comments"}],t.isFiltered=!o.length,t.tabs=L(t.tabs).map((function(e){return t.isFiltered||"filter"!==e.label?Object.assign(Object.assign({},e),{isFiltered:!1}):Object.assign(Object.assign({},e),{isFiltered:!0})}))}))},t.prototype.toggleCommentsSummary=function(){this.showCommentSummaryDialog.emit()},t.prototype.selectTab=function(t){this.tabSelected=t!==this.tabSelected?t:void 0},t.prototype.toggleCommentsPanel=function(){this.toolbarEvents.toggleCommentsPanel(!this.toolbarEvents.commentsPanelVisible.getValue())},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t}();Bi.decorators=[{type:e.Component,args:[{selector:"mv-comment-set-header",template:'<div class="govuk-tabs commentSummaryHeader" [ngClass]="{\'icp-mode\': toolbarEvents.icp.enabled | async}" data-module="govuk-tabs">\n <ul class="govuk-tabs__list">\n <li *ngFor="let tab of tabs; let i = index" class="govuk-tabs__list-item govuk-tabs__list-item"\n [ngClass]="{\'govuk-tabs__list-item--selected\': tabSelected === tab.label}">\n <a id="commentSubPane{{ i }}" (click)="selectTab(tab.label)" [routerLink]="" [ngClass]="{\'govuk-tabs__list-item--filtered\': tab.isFiltered}"\n class="govuk-tabs__tab">\n {{ tab.label | titlecase }}\n </a>\n </li>\n <li>\n <button id="mvCloseBtn" #mvCloseBtn class="mv-button commentSummaryHeader-button--close"\n title="Close Comments" (click)="toggleCommentsPanel()">\n </button>\n </li>\n </ul>\n <div class="govuk-tabs__panel" [hidden]="!tabSelected">\n <ng-container *ngIf="tabSelected === \'comments\'">\n <div style="width: 100%">\n <div class="hmcts-banner" *ngIf="navigationList?.length === 0">\n <svg class="hmcts-banner__icon" fill="currentColor" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" height="25" width="25">\n <path d="M13.7,18.5h-2.4v-2.4h2.4V18.5z M12.5,13.7c-0.7,0-1.2-0.5-1.2-1.2V7.7c0-0.7,0.5-1.2,1.2-1.2s1.2,0.5,1.2,1.2v4.8\nC13.7,13.2,13.2,13.7,12.5,13.7z M12.5,0.5c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S19.1,0.5,12.5,0.5z" /></svg>\n <div class="hmcts-banner__message">\n <span class="hmcts-banner__assistive">information</span>\n Select text to add a comment or highlight.\n </div>\n </div>\n <button type="button" class="govuk-button"\n id="commentSummary" tabindex="0"\n data-l10n-id="commentSummary"\n title="Open collate summary"\n (click)="toggleCommentsSummary()">Collate comments</button>\n </div>\n <ng-container *ngIf="navigationList?.length > 0">\n <mv-comments-navigate\n [annotationList]="navigationList">\n </mv-comments-navigate>\n </ng-container>\n <p class="aui-comment__private-text">\n <span class="aui-comment__private">private</span>\n All comments can only be seen by you\n </p>\n </ng-container>\n <div [hidden]="tabSelected !== \'filter\'">\n <div class="govuk-tabs__panel--container">\n <mv-comment-filter></mv-comment-filter>\n <mv-comments-navigate\n *ngIf="navigationList?.length > 0"\n [annotationList]="navigationList">\n </mv-comments-navigate>\n </div>\n </div>\n\n <div [hidden]="tabSelected !== \'search\'">\n <mv-comment-search [annotations]="navigationList"></mv-comment-search>\n </div>\n </div>\n</div>\n',encapsulation:e.ViewEncapsulation.None}]}],Bi.ctorParameters=function(){return[{type:r.Store},{type:X}]},Bi.propDecorators={showCommentSummary:[{type:e.Input}],showCommentSummaryDialog:[{type:e.Output}]};var Ni=function(){function t(t){this.store=t,this.searchResults=[],this.searchIndex=0}return t.prototype.ngAfterViewInit=function(){this.searchInput&&this.searchInput.nativeElement.focus()},t.prototype.ngOnDestroy=function(){var t=this;setTimeout((function(){t.store.dispatch(new Ie(""))}),250)},t.prototype.searchComments=function(t){var e=this;this.clearSearch(),t.length>2&&(this.searchString=t,this.searchResults=this.annotations.filter((function(t){return t.comments.length>0})).filter((function(t){return t.comments[0].content.toLowerCase().includes(e.searchString.toLowerCase())})),this.searchResults.length>0&&this.store.dispatch(new Ie(t)))},t.prototype.clearSearch=function(){this.searchString=void 0,this.searchResults=[],this.searchIndex=0,this.store.dispatch(new Ie(""))},t}();Ni.decorators=[{type:e.Component,args:[{selector:"mv-comment-search",template:'<input #searchInput type="text"\n class="govuk-input comment-search__item"\n id="search-comments-input" name="searchString"\n aria-label="search comments input" [ngModel]="searchString">\n<button type="button"\n [class.govuk-button--disabled]="searchInput?.value.length <= 2"\n class="govuk-button comment-search__item"\n (click)="searchComments(searchInput.value.trim())">Search</button>\n<ng-container *ngIf="searchResults.length > 0">\n <mv-comments-navigate [annotationList]="searchResults"></mv-comments-navigate>\n</ng-container>\n<ng-container *ngIf="searchString && searchResults?.length == 0">\n <p class="comment-search__item">\n No matches have been found\n </p>\n</ng-container>\n',encapsulation:e.ViewEncapsulation.None}]}],Ni.ctorParameters=function(){return[{type:r.Store}]},Ni.propDecorators={annotations:[{type:e.Input}],searchInput:[{type:e.ViewChild,args:["searchInput",{static:!1}]}]};var Ai=function(){function t(t){this.element=t}return t.prototype.ngAfterViewChecked=function(){this.textToHighlight&&this.highlightInputText(this.textToHighlight)},t.prototype.highlightInputText=function(t){this.resetHighlight(),this.textToHighlight=t;var e=new RegExp(t,"gi"),n=this.element.nativeElement;n.innerHTML.match(e)&&(n.innerHTML=n.innerHTML.replace(e,this.highlightPattern("$&"))),this.textToHighlight=void 0},t.prototype.resetHighlight=function(){for(var t=this.element.nativeElement,e=new RegExp(this.highlightPattern("(.*?)"),"gi");t.innerHTML.match(e);){var n=e.exec(t.innerHTML);n&&(t.innerHTML=t.innerHTML.replace(n[0],n[1]))}},t.prototype.highlightPattern=function(t){return'<span class="mvTextHighlight">'+t+"</span>"},t}();Ai.decorators=[{type:e.Directive,args:[{selector:"[mvTextHighlight]"}]}],Ai.ctorParameters=function(){return[{type:e.ElementRef}]},Ai.propDecorators={textToHighlight:[{type:e.Input}]};var Mi=function(){function t(t){var e=this;this.tagsServices=t,this.validators=[this.minLength,this.maxLength20],this.errorMessages={minLength:"Minimum of 2 characters",maxLength20:"Maximum of 20 characters"},this.requestAutocompleteItems=function(t){return e.tagsServices.getAllTags(e.userId)}}return t.prototype.onUpdateTags=function(t){this.tagsServices.updateTagItems(t,this.annoId)},t.prototype.minLength=function(t){return t.value.length<2?{minLength:!0}:null},t.prototype.maxLength20=function(t){return t.value.length>=20?{maxLength20:!0}:null},t}();Mi.decorators=[{type:e.Component,args:[{selector:"mv-tags",template:'<div class="tags">\n <tag-input\n *ngIf="editable" class="tags__edit"\n [maxItems]="10"\n [(ngModel)]="tagItems"\n (ngModelChange)="onUpdateTags($event)"\n [ngModelOptions]="{standalone:true}"\n [placeholder]="\'Add tag\'"\n [displayBy]="\'label\'"\n [identifyBy]="\'name\'"\n [onTextChangeDebounce]="250"\n [secondaryPlaceholder]="\'Search or add tags\'"\n [validators]="validators"\n [errorMessages]="errorMessages"\n [onlyFromAutocomplete]="false">\n <tag-input-dropdown\n [autocompleteObservable]="requestAutocompleteItems"\n [displayBy]="\'label\'"\n [identifyBy]="\'name\'"\n [zIndex]="10000"\n [minimumTextLength]="2">\n <ng-template let-item="item" let-index="index">\n {{ item.label }}\n </ng-template>\n </tag-input-dropdown>\n </tag-input>\n\n <div class="tags__renderer" *ngIf="!editable && (tagItems && tagItems.length)">\n <span *ngFor="let tag of tagItems" class="tags__item hmcts-badge">\n {{tag.label}}\n </span>\n </div>\n</div>\n\n',encapsulation:e.ViewEncapsulation.None}]}],Mi.ctorParameters=function(){return[{type:Oi}]},Mi.propDecorators={tagItems:[{type:e.Input}],userId:[{type:e.Input}],editable:[{type:e.Input}],annoId:[{type:e.Input}]};var Fi=function(){function t(t,e){this.store=t,this.toolbarEvents=e,this.autoSelect=!1,this.navigationList=[],this.index=0}return t.prototype.ngOnChanges=function(t){t.annotationList&&this.initNavigationList()},t.prototype.initNavigationList=function(){var t=this;this.index=0,this.navigationList=L(this.annotationList||[]).map((function(e){return{content:e.comments[0].content,annotationId:e.id,page:e.page,rectangle:t.upperRectangle(e.rectangles)}})).sort(this.sortComments),this.autoSelect&&(this.toolbarEvents.setPage(Number.parseInt(this.navigationList[0].page,0)),this.store.dispatch(new Ce({annotationId:this.navigationList[0].annotationId,editable:!1,selected:!0})))},t.prototype.sortComments=function(t,e){if(t.page!==e.page)return t.page-e.page;var n=t.rectangle,o=e.rectangle;return n.y!==o.y?n.y-o.y:n.x-o.x},t.prototype.nextItem=function(){this.index+=1,this.index===this.annotationList.length&&(this.index=0),this.toolbarEvents.setPage(Number.parseInt(this.navigationList[this.index].page,0)),this.store.dispatch(new Ce({annotationId:this.navigationList[this.index].annotationId,editable:!1,selected:!0}))},t.prototype.prevItem=function(){this.index-=1,this.index<0&&(this.index=this.navigationList.length-1),this.toolbarEvents.setPage(Number.parseInt(this.navigationList[this.index].page,0)),this.store.dispatch(new Ce({annotationId:this.navigationList[this.index].annotationId,editable:!1,selected:!0}))},t.prototype.upperRectangle=function(t){return L(t).sort((function(t,e){return t.y-e.y})),{x:t[0].x,y:t[0].y}},t}();Fi.decorators=[{type:e.Component,args:[{selector:"mv-comments-navigate",template:'<p class="comment-search">\n <span class="comment-search__item">\n Showing {{ index + 1 }} of {{ navigationList.length }}\n </span>\n <a [routerLink]=""\n class="comment-search__item"\n title="Previous comment"\n (click)="prevItem()">Prev</a>\n <a [routerLink]=""\n class="comment-search__item"\n title="Next comment\'"\n (click)="nextItem()">Next</a>\n</p>\n',encapsulation:e.ViewEncapsulation.None}]}],Fi.ctorParameters=function(){return[{type:r.Store},{type:X}]},Fi.propDecorators={annotationList:[{type:e.Input}],autoSelect:[{type:e.Input}]};var Li=function(){function t(t,e){this.store=t,this.fb=e,this.isPreview=!1}return t.prototype.ngOnInit=function(){var t=this;this.tagGroup=this.fb.group({tagFilters:this.fb.group({})}),this.filter$=this.store.pipe(r.select(No)),this.$subscriptions=this.tagGroup.valueChanges.pipe(s.auditTime(5)).subscribe((function(e){var n=e.tagFilters;t.store.dispatch(new Bt(n))})),this.buildFrom()},t.prototype.buildFrom=function(){var t=this,e=this.tagGroup.get("tagFilters");this.allTags$=this.store.pipe(r.select(Fo)).pipe(s.tap((function(n){t.tagGroup.reset(),n.forEach((function(t){e.addControl(t.key,new o.FormControl(!1))}))})))},t.prototype.onClearFilters=function(){this.tagGroup.reset(),this.store.dispatch(new Nt)},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.prototype.onRemoveFilter=function(t){this.tagGroup.get("tagFilters").controls[t].setValue(!1)},t.prototype.onToggleFilterView=function(){this.isPreview=!this.isPreview},t}();Li.decorators=[{type:e.Component,args:[{selector:"mv-comment-filter",template:'<div class="comment-filter">\n <div class="hmcts-filter__content">\n <div class="hmcts-filter__toggle-filters">\n <p class="hmcts-filter__toggle-filters-link"\n [ngClass]="{\'govuk-accordion__section--expanded\': isPreview}"\n (click)="onToggleFilterView()"><strong >Filter options</strong><span class="govuk-accordion__icon"></span></p>\n </div>\n\n <ng-container *ngIf="(filter$ | async) as filters">\n <div class="hmcts-filter__selected-heading" *ngIf="filters.length">\n <div class="hmcts-filter__heading-action">\n <p><a (click)="onClearFilters()"\n class="govuk-link govuk-link--no-visited-state"\n [routerLink]="">Clear filters</a></p>\n </div>\n </div>\n\n <h4 class="govuk-heading-s govuk-!-margin-bottom-0" *ngIf="filters.length">Tag filters</h4>\n\n <ul class="hmcts-filter-tags" *ngIf="filters.length">\n <li *ngFor="let tagName of filters">\n <a class="hmcts-filter__tag" [routerLink]="" (click)="onRemoveFilter(tagName)">\n <span class="govuk-visually-hidden">Remove this filter</span>{{tagName | unsnake}}</a>\n </li>\n </ul>\n </ng-container >\n\n <div class="hmcts-filter__options" [ngClass]="{\'isVisible\': isPreview}">\n <div class="govuk-form-group">\n <label class="govuk-label govuk-label--s" for="keywords">\n Search Tags\n </label>\n <input class="govuk-input" id="keywords" name="keywords" type="text" [(ngModel)]="searchValue">\n </div>\n\n <div class="govuk-form-group">\n <div [formGroup]="tagGroup">\n <fieldset class="govuk-fieldset" formGroupName="tagFilters">\n <legend class="govuk-fieldset__legend govuk-fieldset__legend--s">\n Tags\n </legend>\n <div class="govuk-checkboxes--scroll">\n <div class="govuk-checkboxes govuk-checkboxes--small">\n <div class="govuk-checkboxes__item" *ngFor="let item of (allTags$ | async) | filter: searchValue: \'key\'">\n <input [formControlName]="item.key" [id]="item.key" class="govuk-checkboxes__input" [value]="false"\n [attr.aria-describedby]="item.key" type="checkbox">\n <label class="govuk-label govuk-checkboxes__label" [for]="item.key">\n {{ item.key | unsnake}} ({{item.length}})\n </label>\n </div>\n </div>\n </div>\n </fieldset>\n </div>\n </div>\n </div>\n\n\n </div>\n</div>\n',encapsulation:e.ViewEncapsulation.None}]}],Li.ctorParameters=function(){return[{type:r.Store},{type:o.FormBuilder}]};var $i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}D(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.transform=function(e,n,o){void 0===n&&(n="mediumDate"),void 0===o&&(o="Europe/London");var i=T.default(e).tz(o).format("Z");return t.prototype.transform.call(this,e,n,i)},e}(n.DatePipe);$i.decorators=[{type:e.Pipe,args:[{name:"momentDate"}]}];var Hi=function(){function t(t){this.httpClient=t,this.ANNOTATIONS_API="/em-anno"}return t.prototype.getBookmarks=function(t){return this.httpClient.get(this.ANNOTATIONS_API+"/"+t+"/bookmarks",{observe:"response",withCredentials:!0})},t.prototype.createBookmark=function(t){return this.httpClient.post(this.ANNOTATIONS_API+"/bookmarks",t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.updateBookmark=function(t){return this.httpClient.put(this.ANNOTATIONS_API+"/bookmarks",t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.updateMultipleBookmarks=function(t){return this.httpClient.put(this.ANNOTATIONS_API+"/bookmarks_multiple",t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.deleteBookmark=function(t){return this.httpClient.delete(this.ANNOTATIONS_API+"/bookmarks/"+t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.deleteMultipleBookmarks=function(t){return this.httpClient.request("DELETE",this.ANNOTATIONS_API+"/bookmarks_multiple",{body:t,observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t}();Hi.decorators=[{type:e.Injectable}],Hi.ctorParameters=function(){return[{type:i.HttpClient}]};var Vi=function(){function t(){}return t.prototype.transform=function(t,e,n){return t?e?t.filter((function(t){return!!t&&(t[n]?t[n].toLowerCase().includes(e.toLowerCase()):t.toLowerCase().includes(e.toLowerCase()))})):t:[]},t}();Vi.decorators=[{type:e.Pipe,args:[{name:"filter"}]}];var Ui=function(){function t(){}return t.prototype.transform=function(t){return t.split("_").join(" ")},t}();Ui.decorators=[{type:e.Pipe,args:[{name:"unsnake"}]}];var zi=function(){};zi.decorators=[{type:e.Component,args:[{selector:"mv-gov-uk-date",template:'<div class="govuk-form-group" [ngClass]="{\'govuk-form-group--error\': errorMessage?.isInvalid}" [formGroup]="formGroup">\n <mv-gov-uk-fieldset\n [config]="{legend: config.legend, classes: \'govuk-label--m\', id: config.id, hint: \' For example, 12 11 2007\'}"\n [isHeading]="false"\n [errorMessage]="errorMessage">\n <mv-gov-uk-error-message\n [config]="{id: \'passport\'}"\n *ngIf="errorMessage"\n [errorMessage]="errorMessage">\n </mv-gov-uk-error-message>\n\n <div class="govuk-date-input" [id]="config.id+\'-date\'">\n <div class="govuk-date-input__item">\n <div class="govuk-form-group">\n <mv-gov-label\n [config]="{label: \'Day\', name: config.id, id: config.id+\'-day\', classes: \'govuk-date-input__label\'}">\n </mv-gov-label>\n <input class="govuk-input govuk-date-input__input govuk-input--width-2"\n [ngClass]="{\'govuk-input--error\': errorMessage?.isInvalid}"\n [id]="config.id"\n [name]="config.id+\'-day\'" type="number" value="" pattern="[0-9]*"\n [formControlName]="\'day\'">\n </div>\n </div>\n <div class="govuk-date-input__item">\n <div class="govuk-form-group">\n <mv-gov-label\n [config]="{label: \'Month\', name: config.id+\'-month\', id: config.id+\'-month\', classes: \'govuk-date-input__label\'}">\n </mv-gov-label>\n <input class="govuk-input govuk-date-input__input govuk-input--width-2"\n [ngClass]="{\'govuk-input--error\': errorMessage?.isInvalid}"\n [id]="config.id+\'-month\'"\n [name]="config.id+\'-month\'" type="number" value="" pattern="[0-9]*"\n [formControlName]="\'month\'">\n </div>\n </div>\n <div class="govuk-date-input__item">\n <div class="govuk-form-group">\n <mv-gov-label\n [config]="{label: \'Year\', name: config.id+\'-year\', id: config.id+\'-year\', classes: \'govuk-date-input__label\'}">\n </mv-gov-label>\n <input class="govuk-input govuk-date-input__input govuk-input--width-4"\n [ngClass]="{\'govuk-input--error\': errorMessage?.isInvalid}"\n [id]="config.id+\'-year\'"\n [name]="config.id+\'-year\'" type="number" value="" pattern="[0-9]*"\n [formControlName]="\'year\'">\n </div>\n </div>\n </div>\n </mv-gov-uk-fieldset>\n</div>\n'}]}],zi.propDecorators={config:[{type:e.Input}],errorMessage:[{type:e.Input}],formGroup:[{type:e.Input}]};var Wi=function(){};Wi.decorators=[{type:e.Component,args:[{selector:" mv-gov-uk-error-message",template:'\n <span class="govuk-error-message" [id]="config.id + \'-error\'" *ngFor="let message of errorMessage?.messages">\n <span class="govuk-visually-hidden">Error:</span>{{message}}\n </span>\n '}]}],Wi.ctorParameters=function(){return[]},Wi.propDecorators={config:[{type:e.Input}],errorMessage:[{type:e.Input}]};var qi=function(){function t(){}return t.setDescribedBy=function(t,e){return t&&t&&t.isInvalid?e.hint?e.id+"-hint "+e.id+"-error":e.id+"-error":e.hint?e.id+"-hint":null},t}(),Gi=function(){function t(){}return t.prototype.setDescribedBy=function(){return qi.setDescribedBy(this.errorMessage,this.config)},t}();Gi.decorators=[{type:e.Component,args:[{selector:"mv-gov-uk-fieldset",template:'\n <fieldset class="govuk-fieldset" [attr.aria-describedby]="setDescribedBy()">\n <legend [class]="config.classes + \' govuk-fieldset__legend\'" *ngIf="!isHeading">\n {{config.legend}}\n </legend>\n\n <legend [class]="config.classes + \' govuk-fieldset__legend\'" *ngIf="isHeading">\n <h1>{{config.legend}}</h1>\n </legend>\n\n <span [id]="config.id+\'-hint\'" class="govuk-hint" *ngIf="config.hint">\n {{config.hint}}\n </span>\n <ng-content></ng-content>\n </fieldset>\n '}]}],Gi.propDecorators={config:[{type:e.Input}],isHeading:[{type:e.Input}],errorMessage:[{type:e.Input}]};var Zi=function(){};Zi.decorators=[{type:e.Component,args:[{selector:"mv-gov-label",template:'<h1 *ngIf="config.isPageHeading else noHeading">\n <label *ngIf="config.label" [class]="config.classes + \' govuk-label\'"\n [for]="config.id" [innerHTML]="config.label">\n </label>\n </h1>\n <ng-template #noHeading>\n <label *ngIf="config.label" [class]="config.classes + \' govuk-label\'"\n [for]="config.id" [innerHTML]="config.label">\n </label>\n </ng-template>\n '}]}],Zi.ctorParameters=function(){return[]},Zi.propDecorators={config:[{type:e.Input}]};var Ji=function(){};Ji.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,o.FormsModule,o.ReactiveFormsModule,n.CommonModule,g.RouterModule],declarations:[zi,Wi,Gi,Zi],exports:[zi,Wi,Gi,Zi]}]}];var Yi=r.createSelector(to,(function(t){return t.bookmarks})),Xi=r.createSelector(Yi,(function(t){return t.bookmarkPageEntities})),Ki=r.createSelector(Yi,(function(t){return t.bookmarkEntities})),Qi=r.createSelector(Ki,(function(t){return function(t){var e=JSON.parse(JSON.stringify(t));return fn(e),Object.keys(e).reduce((function(t,n){var o=e[n];if(o.parent){var i=e[o.parent];i.children||(i.children=[]),i.children[o.index]=o}else t[o.index]=o;return t}),[])}(t)})),ta=r.createSelector(Yi,(function(t){return t.editableBookmark})),ea=r.createSelector(Qi,oo,io,no,(function(t,e,n,o){return{pageNumber:n.pageNumber-1,xCoordinate:n.left,yCoordinate:o[n.pageNumber].styles.height-n.top*o[n.pageNumber].viewportScale,previous:t.length>0?t[t.length-1].id:void 0,documentId:e}})),na=r.createSelector(no,Xi,(function(t,e){if(t&&e){var n=[];return Object.keys(t).forEach((function(o){var i=Number(o)-1,a=e[i];n.push({bookmark:a||[],styles:t[o].styles})})),n}})),oa=function(){function t(t,e,n,o){this.store=t,this.highlightService=e,this.toolbarEvents=n,this.viewerEvents=o,this.pages=[],this.drawMode=!1}return t.prototype.ngOnInit=function(){var t=this;this.$subscriptions=this.store.pipe(r.select(no)).subscribe((function(e){return t.pages=Object.values(e)})),this.annoPages$=this.store.pipe(r.select(Jo)),this.$subscriptions.add(this.toolbarEvents.drawModeSubject.subscribe((function(e){return t.drawMode=e}))).add(this.viewerEvents.textHighlight.subscribe((function(e){return t.showContextToolbar(e)}))).add(this.viewerEvents.ctxToolbarCleared.subscribe((function(){return t.clearContextToolbar()})))},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.prototype.showContextToolbar=function(t){this.highlightPage=t.page,this.rectangles=t.rectangles,this.rectangles&&this.toolbarEvents.highlightModeSubject.next(!1)},t.prototype.clearContextToolbar=function(){this.rectangles=void 0},t.prototype.createHighlight=function(){this.highlightService.saveAnnotation(this.rectangles,this.highlightPage),this.highlightService.resetHighlight(),this.rectangles=void 0},t.prototype.createBookmark=function(t){var e=this;this.store.pipe(r.select(ea),s.take(1)).subscribe((function(n){var o=window.getSelection().toString();e.store.dispatch(new nn(Object.assign(Object.assign({},n),{name:o.length>0?o.substr(0,30):"new bookmark",id:_.default(),pageNumber:e.highlightPage-1,xCoordinate:t.x,yCoordinate:t.y}))),e.toolbarEvents.toggleSideBar(!0),e.highlightService.resetHighlight(),e.rectangles=void 0}))},t.prototype.saveAnnotation=function(t){var e=t.rectangles,n=t.page;this.highlightService.saveAnnotation(e,n),this.toolbarEvents.drawModeSubject.next(!1)},t}();oa.decorators=[{type:e.Component,args:[{selector:"mv-metadata-layer",template:'<div class="pageContainer">\n <div *ngFor="let page of pages; index as i"\n class="pageContainer__page"\n [ngStyle]="{\n \'width.px\': page.styles.width,\n \'height.px\': page.styles.height\n }"\n [ngClass]="{ \'pageContainer__page--draw\' : drawMode }">\n <mv-box-highlight-create\n [page]="i + 1"\n [pageHeight]="page.styles.height"\n [pageWidth]="page.styles.width"\n [rotate]="rotate"\n [zoom]="zoom"\n (saveSelection)="saveAnnotation($event)">\n </mv-box-highlight-create>\n <mv-ctx-toolbar *ngIf="rectangles && highlightPage === (i + 1)"\n [rectangles]="rectangles"\n [canBookmark]="true" [canHighlight]="true"\n [zoom]="zoom"\n [rotate]="rotate"\n [pageHeight]="page.styles.height"\n [pageWidth]="page.styles.width"\n (createBookmarkEvent)="createBookmark($event)"\n (createHighlightEvent)="createHighlight()">\n </mv-ctx-toolbar>\n <div class="pageContainer__page-item">\n <mv-annotation-set *ngIf="(annoPages$ | async) as annoPages"\n [zoom]="zoom"\n [rotate]="rotate"\n [pageHeight]="page.styles.height"\n [pageWidth]="page.styles.width"\n [page]="i" [annotations]="annoPages[i + 1]"></mv-annotation-set>\n </div>\n </div>\n</div>\n'}]}],oa.ctorParameters=function(){return[{type:r.Store},{type:Ci},{type:X},{type:lo}]},oa.propDecorators={zoom:[{type:e.Input}],rotate:[{type:e.Input}]};var ia=function(){};ia.decorators=[{type:e.NgModule,args:[{imports:[b.A11yModule,n.CommonModule,o.FormsModule,i.HttpClientModule,f.MutableDivModule,v.TagInputModule,g.RouterModule,o.ReactiveFormsModule,y.NgxDatatableModule,Ji],declarations:[oa,ki,Ri,Ei,Ii,Pi,Bi,Ni,Ai,xi,Ti,Fi,_i,Di,Mi,$i,Li,Vi,Ui],entryComponents:[ki,Ei,Ti],providers:[xo,Hi,ji,Ci,Oi],exports:[ki,Ri,Ei,Ti,Bi,Ni,Di,Mi,Li,$i,Vi,Ui,oa]}]}];var aa=function(){function t(t){this.el=t,this.pointerDown=!1,this.dragEnabled=!1}return t.prototype.onPointerDown=function(t){this.dragEnabled&&(t.preventDefault(),this.pointerDown=!0,this.originalPosition={left:t.clientX+this.el.nativeElement.scrollLeft,top:t.clientY+this.el.nativeElement.scrollTop})},t.prototype.onPointerMove=function(t){if(this.pointerDown&&this.dragEnabled){t.preventDefault();var e={left:this.originalPosition.left-(t.clientX+this.el.nativeElement.scrollLeft),top:this.originalPosition.top-(t.clientY+this.el.nativeElement.scrollTop)};this.dragEnabled&&(this.dragX.scrollLeft+=e.left,this.el.nativeElement.scrollTop+=e.top)}},t.prototype.onWindowPointerUp=function(){this.pointerDown=!1},t}();aa.decorators=[{type:e.Directive,args:[{selector:"[mvGrabNDrag]"}]}],aa.ctorParameters=function(){return[{type:e.ElementRef}]},aa.propDecorators={dragEnabled:[{type:e.Input}],dragX:[{type:e.Input}],onPointerDown:[{type:e.HostListener,args:["pointerdown",["$event"]]}],onPointerMove:[{type:e.HostListener,args:["window:pointermove",["$event"]]}],onWindowPointerUp:[{type:e.HostListener,args:["window:pointerup"]}]};var sa=function(){function t(t,e){this.viewerEvents=t,this.store=e,this.selectedView="outline"}return t.prototype.ngOnInit=function(){var t=this;this.bookmarkNodes$=this.store.pipe(r.select(Qi)),this.$subscription=this.store.pipe(r.select(ta)).subscribe((function(e){return t.selectedView=e?"bookmarks":t.selectedView}))},t.prototype.ngOnChanges=function(t){t.url&&this.url&&this.store.dispatch(new Qe)},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.goToDestination=function(t){this.viewerEvents.goToDestination(t)},t.prototype.toggleSidebarView=function(t){this.selectedView=t},t.prototype.onAddBookmarkClick=function(){var t=this;this.toggleSidebarView("bookmarks"),this.store.pipe(r.select(ea),s.take(1)).subscribe((function(e){t.store.dispatch(new nn(Object.assign(Object.assign({},e),{name:"",id:_.default()})))}))},t.prototype.isViewedItem=function(t,e){return void 0===e?t.pageNumber<=this.currentPageNumber:t.pageNumber<=this.currentPageNumber&&e.pageNumber>this.currentPageNumber},t.prototype.findEndPage=function(t){return void 0===t?Number.MAX_SAFE_INTEGER:t.pageNumber},t}();sa.decorators=[{type:e.Component,args:[{selector:"mv-side-bar",template:'<div id="toolbarSidebar">\n <div class="splitToolbarButton toggled">\n <button id="viewOutline"\n [ngClass]="{ \'toolbarButton\': true, \'toggled\': selectedView === \'outline\' }"\n (click)="toggleSidebarView(\'outline\')"\n title="Show Document Outline" tabindex="1" data-l10n-id="document_outline">\n <span data-l10n-id="document_outline_label">Document Outline</span>\n </button>\n <button *ngIf="annotationsEnabled"\n id="viewBookmark" class="toolbarButton bookmark"\n [ngClass]="{ toggled: selectedView === \'bookmarks\' }"\n (click)="toggleSidebarView(\'bookmarks\')"\n title="Show Bookmarks" tabindex="2" data-l10n-id="bookmarks">\n <span data-l10n-id="bookmarks_label">Bookmarks</span>\n </button>\n </div>\n <div class="splitToolbarButtonSeparator"></div>\n <div *ngIf="annotationsEnabled"\n class="splitToolbarButton right">\n <button id="addBookmark"\n class="toolbarButton addBookmark"\n (click)="onAddBookmarkClick()"\n title="Add bookmark" tabindex="3" data-l10n-id="addBookmark">\n <span data-l10n-id="addBookmark_label">Add bookmark</span>\n </button>\n </div>\n</div>\n<div id="sidebarContent">\n <div id="outlineView" class="outlineWithDeepNesting">\n <div class="outlineItem" *ngIf="selectedView === \'outline\'">\n <mv-outline-item *ngFor="let outlineItem of outline; index as i"\n [outline]="outlineItem"\n [currentPageNumber]="currentPageNumber"\n [isCurrentSection]= "isViewedItem(outlineItem, outline[i+1])"\n [endPage]="findEndPage(outline[i+1])"\n (navigationEvent)="goToDestination($event)"></mv-outline-item>\n </div>\n <div *ngIf="annotationsEnabled && selectedView === \'bookmarks\'"\n id="bookmarkContainer">\n <mv-bookmarks [bookmarkNodes]="bookmarkNodes$ | async"\n [zoom]="zoom" [rotate]="rotate"\n (goToDestination)="goToDestination($event)"></mv-bookmarks>\n </div>\n </div>\n</div>\n'}]}],sa.ctorParameters=function(){return[{type:lo},{type:r.Store}]},sa.propDecorators={annotationsEnabled:[{type:e.Input}],outline:[{type:e.Input}],url:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],currentPageNumber:[{type:e.Input}]};var ra=function(){function t(){this.navigationEvent=new e.EventEmitter}return t.prototype.ngOnInit=function(){this.showOutlineItems=!0},t.prototype.goToDestination=function(t){t&&this.navigationEvent.emit(t)},t.prototype.toggleOutline=function(){this.showOutlineItems=!this.showOutlineItems},t.prototype.isViewedItem=function(t,e){return void 0===e?t.pageNumber<=this.currentPageNumber&&this.endPage>this.currentPageNumber:t.pageNumber<=this.currentPageNumber&&e.pageNumber>this.currentPageNumber},t.prototype.findEndPage=function(t){return void 0===t?Number.MAX_SAFE_INTEGER:t.pageNumber},t.prototype.showHighlightOutlineCss=function(){return this.isCurrentSection?"highlightedOutlineItem":"outlineItem"},t}();ra.decorators=[{type:e.Component,args:[{selector:"mv-outline-item",template:'<div class="outlineItem">\n <div *ngIf="outline.items.length > 0"\n [ngClass]="{ \'outlineItemToggler\': true, \'outlineItemsHidden\': !showOutlineItems }"\n (click)="toggleOutline()"\n (keyup.enter)="toggleOutline()" tabindex="0"></div>\n <a (click)="goToDestination(outline?.dest)"\n (keyup.enter)="goToDestination(outline?.dest)"\n [style.font-weight]="outline.bold ? \'bold\' : \'\'"\n [style.font-style]="outline.italic ? \'italic\' : \'\'"\n [ngClass]="showHighlightOutlineCss()"\n tabindex="0">\n <div style="text-align:left;" [ngClass]="showHighlightOutlineCss()">\n {{ outline.title }}\n <span style="float:right;">\n {{ outline.pageNumber }}\n </span>\n </div>\n </a>\n \n <div *ngIf="outline.items.length > 0" class="outlineItems">\n <div *ngFor="let outlineItem of outline.items; index as i">\n <mv-outline-item\n [outline]="outlineItem" \n [currentPageNumber]= "currentPageNumber" \n [isCurrentSection]= "isViewedItem(outlineItem, outline.items[i+1])"\n [endPage]="findEndPage(outline.items[i+1])"\n (navigationEvent)="goToDestination($event)">\n </mv-outline-item>\n </div>\n </div>\n</div>\n\n'}]}],ra.propDecorators={outline:[{type:e.Input}],currentPageNumber:[{type:e.Input}],isCurrentSection:[{type:e.Input}],endPage:[{type:e.Input}],navigationEvent:[{type:e.Output}]};var ca=function(){function t(t,e,n){this.store=t,this.viewerEvents=e,this.toolbarEvents=n}return t.prototype.ngOnInit=function(){var t=this;this.redactionsPerPage$=this.store.pipe(r.select(vi)),this.selectedRedaction$=this.store.pipe(r.select(mi)),this.$subscription=this.toolbarEvents.drawModeSubject.subscribe((function(e){return t.drawMode=e})),this.$subscription.add(this.store.pipe(r.select(gi),s.filter((function(t){return!!t}))).subscribe((function(e){return t.downloadDocument(e)}))),this.$subscription.add(this.store.pipe(r.select(oo)).subscribe((function(e){return t.documentId=e}))),this.$subscription.add(this.viewerEvents.textHighlight.subscribe((function(e){return t.markTextRedaction(e)}))),this.toolbarEvents.applyRedactToDocument.subscribe((function(){t.store.pipe(r.select(fi),s.take(1)).subscribe((function(e){t.store.dispatch(new Vn(e))}))})),this.toolbarEvents.clearAllRedactMarkers.subscribe((function(){t.store.dispatch(new qn(t.documentId))}))},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.markTextRedaction=function(t){var e=t.rectangles;e&&e.length&&this.saveRedaction(t.page,L(e)),this.toolbarEvents.highlightModeSubject.next(!1)},t.prototype.markBoxRedaction=function(t){var e=t.rectangles,n=t.page;this.saveRedaction(n,e),this.toolbarEvents.drawModeSubject.next(!1)},t.prototype.saveRedaction=function(t,e){var n={page:t,rectangles:e,redactionId:_.default(),documentId:this.documentId};this.store.dispatch(new Nn(n))},t.prototype.onMarkerDelete=function(t){this.store.dispatch(new Fn(t))},t.prototype.selectRedaction=function(t){this.store.dispatch(new Hn(t))},t.prototype.onMarkerUpdate=function(t){this.store.dispatch(new Nn(t))},t.prototype.downloadDocument=function(t){var e=t.blob,n=t.filename;if(navigator&&navigator.msSaveBlob)navigator.msSaveBlob(e,n);else{var o=URL.createObjectURL(e),i=document.createElement("a");document.body.appendChild(i),i.setAttribute("style","display: none"),i.href=o,i.download=n,i.click(),i.remove(),URL.revokeObjectURL(o)}this.store.dispatch(new Wn)},t}();ca.decorators=[{type:e.Component,args:[{selector:"mv-redactions",template:'<div class="pageContainer">\n <div *ngFor="let redaction of (redactionsPerPage$ | async); index as i"\n class="pageContainer__page"\n [ngStyle]="{\n \'width.px\': redaction.styles.width,\n \'height.px\': redaction.styles.height\n }"\n [ngClass]="{ \'pageContainer__page--draw\' : drawMode }">\n <mv-box-highlight-create\n [page]="i + 1"\n [pageHeight]="redaction.styles.height"\n [pageWidth]="redaction.styles.width"\n [rotate]="rotate"\n [zoom]="zoom"\n (saveSelection)="markBoxRedaction($event)">\n </mv-box-highlight-create>\n <div class="pageContainer__page-item">\n <ng-container *ngFor="let anno of redaction.anno">\n \x3c!-- TODO rename this to selection --\x3e\n <mv-annotation [annotation]="anno"\n [zoom]="zoom"\n [rotate]="rotate"\n [selectedAnnoId]="selectedRedaction$ | async"\n [pageHeight]="redaction.styles.height"\n [pageWidth]="redaction.styles.width"\n (update)="onMarkerUpdate($event)"\n (delete)="onMarkerDelete($event)"\n (annotationClick)="selectRedaction($event)">\n </mv-annotation>\n </ng-container>\n </div>\n </div>\n</div>\n'}]}],ca.ctorParameters=function(){return[{type:r.Store},{type:lo},{type:X}]},ca.propDecorators={zoom:[{type:e.Input}],rotate:[{type:e.Input}]};var la=function(){function t(t){this.httpClient=t,this.ICP_SESSION_API="/icp/sessions"}return t.prototype.loadSession=function(t){return this.httpClient.get(this.ICP_SESSION_API+"/"+t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t}();la.decorators=[{type:e.Injectable}],la.ctorParameters=function(){return[{type:i.HttpClient}]};var ua=function(t,e){var n=this;this.actions$=t,this.annotationApiService=e,this.loadAnnotation$=this.actions$.pipe(S.ofType(te),s.map((function(t){return t.payload})),s.switchMap((function(t){return n.annotationApiService.getAnnotationSet(t).pipe(s.map((function(t){return new ge(t)})),s.catchError((function(t){return a.of(new be(t))})))}))),this.postAnnotation$=this.actions$.pipe(S.ofType(oe),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return n.annotationApiService.postAnnotation(t).pipe(s.map((function(t){return new ve(t)})),s.catchError((function(t){return a.of(new be(t))})))}))),this.deleteAnnotation$=this.actions$.pipe(S.ofType(re),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return n.annotationApiService.deleteAnnotation(t).pipe(s.map((function(e){return new ke(t)})),s.catchError((function(t){return a.of(new Ee(t))})))})))};ua.decorators=[{type:e.Injectable}],ua.ctorParameters=function(){return[{type:S.Actions},{type:xo}]},R([S.Effect(),B("design:type",Object)],ua.prototype,"loadAnnotation$",void 0),R([S.Effect(),B("design:type",Object)],ua.prototype,"postAnnotation$",void 0),R([S.Effect(),B("design:type",Object)],ua.prototype,"deleteAnnotation$",void 0);var pa=function(t,e,n){var o=this;this.actions$=t,this.store=e,this.bookmarksApiService=n,this.loadBookmarks$=this.actions$.pipe(S.ofType(Ve),s.withLatestFrom(this.store.pipe(r.select(oo))),s.map((function(t){return F(t,2)[1]})),s.exhaustMap((function(t){return o.bookmarksApiService.getBookmarks(t).pipe(s.map((function(t){return new tn(t)})),s.catchError((function(t){return a.of(new en(t))})))}))),this.createBookmark$=this.actions$.pipe(S.ofType(We),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.bookmarksApiService.createBookmark(t).pipe(s.map((function(t){return new on(t)})),s.catchError((function(t){return a.of(new an(t))})))}))),this.moveBookmark$=this.actions$.pipe(S.ofType(Je),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.bookmarksApiService.updateMultipleBookmarks(t).pipe(s.map((function(t){return new un(t)})),s.catchError((function(t){return a.of(new pn(t))})))}))),this.deleteBookmark$=this.actions$.pipe(S.ofType(Ge),s.map((function(t){return t.payload})),s.exhaustMap((function(t){var e=t.deleted,n=t.updated;return o.bookmarksApiService.deleteMultipleBookmarks({deleted:e,updated:n}).pipe(s.switchMap((function(){return n?[new rn(e),new hn(n)]:[new rn(e)]})),s.catchError((function(t){return a.of(new cn(t))})))}))),this.updateBookmark$=this.actions$.pipe(S.ofType(Xe),s.map((function(t){return t.payload})),s.switchMap((function(t){return o.bookmarksApiService.updateBookmark(t).pipe(s.map((function(t){return new hn(t)})),s.catchError((function(t){return a.of(new mn(t))})))})))};pa.decorators=[{type:e.Injectable}],pa.ctorParameters=function(){return[{type:S.Actions},{type:r.Store},{type:Hi}]},R([S.Effect(),B("design:type",Object)],pa.prototype,"loadBookmarks$",void 0),R([S.Effect(),B("design:type",Object)],pa.prototype,"createBookmark$",void 0),R([S.Effect(),B("design:type",Object)],pa.prototype,"moveBookmark$",void 0),R([S.Effect(),B("design:type",Object)],pa.prototype,"deleteBookmark$",void 0),R([S.Effect(),B("design:type",Object)],pa.prototype,"updateBookmark$",void 0);var da=function(){function t(t){this.httpClient=t,this.markupsApiUrl="/api/markups",this.redactApiUrl="/api/redaction"}return t.prototype.getRedactions=function(t){var e=this.markupsApiUrl+"/"+t;return this.httpClient.get(e,{observe:"response",withCredentials:!0})},t.prototype.saveRedaction=function(t){return this.httpClient.post(this.markupsApiUrl,t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})),s.catchError((function(){return[]})))},t.prototype.deleteRedaction=function(t){var e=this.markupsApiUrl+"/"+t.documentId+"/"+t.redactionId;return this.httpClient.delete(e,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.deleteAllMarkers=function(t){var e=this.markupsApiUrl+"/"+t;return this.httpClient.delete(e,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.redact=function(t){return this.httpClient.post(this.redactApiUrl,t,{observe:"response",withCredentials:!0,responseType:"blob"}).pipe(s.map((function(t){return t})),s.catchError((function(){return[]})))},t}();da.decorators=[{type:e.Injectable}],da.ctorParameters=function(){return[{type:i.HttpClient}]};var ha=function(t,e){var n=this;this.actions$=t,this.redactionApiService=e,this.loadRedactions$=this.actions$.pipe(S.ofType(wn),s.map((function(t){return t.payload})),s.switchMap((function(t){return n.redactionApiService.getRedactions(t).pipe(s.map((function(t){return new Rn(t.body)})),s.catchError((function(t){return a.of(new Bn(t))})))}))),this.saveRedaction$=this.actions$.pipe(S.ofType(kn),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return n.redactionApiService.saveRedaction(t).pipe(s.map((function(t){return new An(t)})),s.catchError((function(t){return a.of(new Mn(t))})))}))),this.deleteRedaction$=this.actions$.pipe(S.ofType(Cn),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return n.redactionApiService.deleteRedaction(t).pipe(s.map((function(){return new Ln(t)})),s.catchError((function(t){return a.of(new $n(t))})))}))),this.redact$=this.actions$.pipe(S.ofType(Pn),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return n.redactionApiService.redact(t).pipe(s.map((function(e){var n=e.headers.get("content-disposition").split("filename="),o=n.length>1?n[1].replace(/"/g,""):"redacted-document-"+t.documentId;return new Un({blob:e.body,filename:o})})),s.catchError((function(t){return a.of(new zn(t))})))}))),this.unmarkAll$=this.actions$.pipe(S.ofType(Tn),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return n.redactionApiService.deleteAllMarkers(t).pipe(s.map((function(t){return new Gn})),s.catchError((function(t){return a.of(new $n(t))})))})))};ha.decorators=[{type:e.Injectable}],ha.ctorParameters=function(){return[{type:S.Actions},{type:da}]},R([S.Effect(),B("design:type",Object)],ha.prototype,"loadRedactions$",void 0),R([S.Effect(),B("design:type",Object)],ha.prototype,"saveRedaction$",void 0),R([S.Effect(),B("design:type",Object)],ha.prototype,"deleteRedaction$",void 0),R([S.Effect(),B("design:type",Object)],ha.prototype,"redact$",void 0),R([S.Effect(),B("design:type",Object)],ha.prototype,"unmarkAll$",void 0);var ma=function(){function t(t){this.httpClient=t,this.documentConversionUrl="/doc-assembly/convert"}return t.prototype.convert=function(t){return this.httpClient.post(this.documentConversionUrl+"/"+t,{},{observe:"response",withCredentials:!0,responseType:"blob"}).pipe(s.map((function(t){return t})),s.catchError((function(t){return a.of(t)})))},t}();ma.decorators=[{type:e.Injectable}],ma.ctorParameters=function(){return[{type:i.HttpClient}]};var ga=function(){function t(t){this.httpClient=t,this.rotationApiUrl="/em-anno/metadata"}return t.prototype.getRotation=function(t){var e=this.rotationApiUrl+"/"+t;return this.httpClient.get(e,{observe:"response",withCredentials:!0})},t.prototype.saveRotation=function(t){var e=this.rotationApiUrl+"/";return this.httpClient.post(e,t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t})),s.catchError((function(){return[]})))},t}();ga.decorators=[{type:e.Injectable}],ga.ctorParameters=function(){return[{type:i.HttpClient}]};var ba=function(t,e,n){var o=this;this.actions$=t,this.documentConversionService=e,this.rotationApiService=n,this.convert$=this.actions$.pipe(S.ofType(ut),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.documentConversionService.convert(t).pipe(s.map((function(t){var e=URL.createObjectURL(t.body);return new Et(e)})),s.catchError((function(t){return a.of(new Ct(t))})))}))),this.loadRotation$=this.actions$.pipe(S.ofType(mt),s.map((function(t){return t.payload})),s.switchMap((function(t){return o.rotationApiService.getRotation(t).pipe(s.map((function(t){return new Pt(t.body)})),s.catchError((function(t){return a.of(new xt(t))})))}))),this.saveRotation$=this.actions$.pipe(S.ofType(ft),s.map((function(t){return t.payload})),s.switchMap((function(t){return o.rotationApiService.saveRotation(t).pipe(s.map((function(t){return new Tt(t.body)})),s.catchError((function(t){return a.of(new _t(t))})))})))};ba.decorators=[{type:e.Injectable}],ba.ctorParameters=function(){return[{type:S.Actions},{type:ma},{type:ga}]},R([S.Effect(),B("design:type",Object)],ba.prototype,"convert$",void 0),R([S.Effect(),B("design:type",Object)],ba.prototype,"loadRotation$",void 0),R([S.Effect(),B("design:type",Object)],ba.prototype,"saveRotation$",void 0);var fa=function(t,e,n){var o=this;this.actions$=t,this.icpApiService=e,this.icpUpdateService=n,this.loadIcpSession$=this.actions$.pipe(S.ofType(Mt),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.icpApiService.loadSession(t).pipe(s.map((function(t){return new qt(t)})),s.catchError((function(t){return a.of(new Wt(t))})))}))),this.joinIcpSocketSession$=this.actions$.pipe(S.ofType(Ft),s.map((function(t){return t.payload})),s.switchMap((function(t){return o.icpUpdateService.joinSession(t.username,t.session).pipe(s.map((function(e){return new Gt({session:t.session,participantInfo:e})})))})))};fa.decorators=[{type:e.Injectable}],fa.ctorParameters=function(){return[{type:S.Actions},{type:la},{type:po}]},R([S.Effect(),B("design:type",Object)],fa.prototype,"loadIcpSession$",void 0),R([S.Effect(),B("design:type",Object)],fa.prototype,"joinIcpSocketSession$",void 0);var va=[ua,pa,ha,ba,fa],ya=function(){function t(t){this.store=t,this.goToDestination=new e.EventEmitter,this.pageLookup={},this.BOOKMARK_CHAR_LIMIT=30,this.options={allowDrag:!0,allowDrop:!0}}return t.prototype.ngOnInit=function(){var t=this;this.$subscription=this.store.pipe(r.select(ta)).subscribe((function(e){return t.editableBookmark=e})),this.$subscription.add(this.store.select(no).subscribe((function(e){Object.keys(e).map((function(n){t.pageLookup[n]=e[n]}))})))},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.editBookmark=function(t){this.editableBookmark=t},t.prototype.onBookmarkMove=function(t){var e=t.node,n=t.from,o=t.to,i=[Object.assign(Object.assign({},e),{previous:o.index>0?o.parent.children[o.index-1].id:void 0,parent:o.parent.documentId?o.parent.id:void 0})],a=this.getSibling(n,n.index);(a=a&&a.id===e.previous?this.getSibling(n,n.index+1):a)&&(i=L(i,[Object.assign(Object.assign({},a),{previous:e.previous})]));var s=this.getSibling(o,o.index+1);s&&(i=L(i,[Object.assign(Object.assign({},s),{previous:e.id})])),this.store.dispatch(new ln(i))},t.prototype.deleteBookmark=function(t){var e,n=t.parent.children;n.length>t.index+1&&((e=n[t.index+1].data).previous=t.data.previous),this.store.dispatch(new sn({deleted:L([t.data.id],gn(t.data.children)),updated:e}))},t.prototype.updateBookmark=function(t,e){var n=Object.assign(Object.assign({},t),{name:e});e&&(this.store.dispatch(new dn(n)),this.editableBookmark=void 0)},t.prototype.goToBookmark=function(t){var e=this.pageLookup[t.pageNumber+1],n=e.styles.height,o=this.scaledY(t.yCoordinate,n,e),i=0,a=0;switch(this.rotate){case 90:a=-o;break;case 180:i=this.scaledY(t.yCoordinate,n-24*this.zoom,e);break;case 270:a=o;break;default:i=o}this.goToDestination.emit([t.pageNumber,{name:"XYZ"},a,i])},t.prototype.getSibling=function(t,e){return t.parent.children.length>e?t.parent.children[e]:void 0},t.prototype.scaledY=function(t,e,n){var o=n.viewportScale/this.zoom;return(e/this.zoom-t)/o},t}();ya.decorators=[{type:e.Component,args:[{selector:"mv-bookmarks",template:'<tree-root [nodes]="bookmarkNodes"\n class="bookmarks-tree"\n [options]="options"\n (moveNode)="onBookmarkMove($event)">\n <ng-template #treeNodeTemplate let-node let-index="index">\n <div class="outlineItem" *ngIf="node.data.id !== editableBookmark; else inputBookmark">\n <a (click)="goToBookmark(node.data)">\n {{ node.data.name }}\n </a>\n <button class="bookmark__rename" (click)="editBookmark(node.data.id)" ></button>\n <button class="bookmark__delete" (click)="deleteBookmark(node)"></button>\n </div>\n <ng-template #inputBookmark>\n <input #bookmarkName class="bookmark__input" [value]="node.data.name" [maxLength]="BOOKMARK_CHAR_LIMIT">\n <button class="bookmark__save" (click)="updateBookmark(node.data, bookmarkName.value)"></button>\n </ng-template>\n <a *ngIf="bookmarkNodes?.length === 0" class="outlineItem">No bookmarks created yet</a>\n </ng-template>\n</tree-root>\n'}]}],ya.ctorParameters=function(){return[{type:r.Store}]},ya.propDecorators={bookmarkNodes:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],goToDestination:[{type:e.Output}]};var wa=function(){function t(t){this.store=t,this.mediaLoadStatus=new e.EventEmitter,this.viewerException=new e.EventEmitter,this.documentTitle=new e.EventEmitter}return t.prototype.ngOnInit=function(){var t=this;this.store.dispatch(new kt(this.extractDMStoreDocId(this.originalUrl))),this.$subscription=this.store.pipe(r.select(so),s.filter((function(t){return!!t}))).subscribe((function(e){e.url?(t.convertedUrl=e.url,t.store.dispatch(new It)):t.onLoadException(new et(e.error))}))},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.onMediaLoad=function(t){this.mediaLoadStatus.emit(t)},t.prototype.onLoadException=function(t){this.viewerException.emit(t)},t.prototype.onDocumentTitleChange=function(t){this.documentTitle.emit(t)},t.prototype.extractDMStoreDocId=function(t){return t.includes("/documents/")?t=t.split("/documents/")[1]:t.includes("/documentsv2/")&&(t=t.split("/documentsv2/")[1]),t.replace("/binary","")},t}();wa.decorators=[{type:e.Component,args:[{selector:"mv-conversion-viewer",template:'<mv-pdf-viewer *ngIf="convertedUrl"\n (mediaLoadStatus)="onMediaLoad($event)"\n (pdfViewerException)="onLoadException($event)"\n (documentTitle)="onDocumentTitleChange($event)"\n [url]="convertedUrl"\n [downloadUrl]="originalUrl"\n [enableAnnotations]="enableAnnotations"\n [enableRedactions]="enableRedactions"\n [annotationSet]="enableAnnotations ? annotationSet : null"\n [downloadFileName]="downloadFileName"\n [height]="height">\n</mv-pdf-viewer>\n',encapsulation:e.ViewEncapsulation.None}]}],wa.ctorParameters=function(){return[{type:r.Store}]},wa.propDecorators={originalUrl:[{type:e.Input}],downloadFileName:[{type:e.Input}],height:[{type:e.Input}],enableAnnotations:[{type:e.Input}],enableRedactions:[{type:e.Input}],annotationSet:[{type:e.Input}],mediaLoadStatus:[{type:e.Output}],viewerException:[{type:e.Output}],documentTitle:[{type:e.Output}]};var Sa=function(){function t(t){this.toolbarEvents=t}return t.prototype.onCancel=function(){this.toolbarEvents.icp.leavingSession.next(!1)},t.prototype.onConfirm=function(){this.toolbarEvents.icp.confirmExit(),this.toolbarEvents.icp.leavingSession.next(!1)},t}();Sa.decorators=[{type:e.Component,args:[{selector:"mv-confirm-action",template:'<div id="modal-background" class="modal" (click)="onCancel()">\n <div id="modal" class="modal-content govuk-width-container clearfix" (click)="$event.stopPropagation()">\n <h2 class="govuk-heading-s">Are you sure you want to leave the presentation?</h2>\n <div class="button-container">\n <button id="modal-close-button" (click)="onConfirm()" class="govuk-button">Confirm</button>\n <button (click)="onCancel()" class="govuk-button govuk-button--secondary">Cancel</button>\n </div>\n </div>\n</div>\n'}]}],Sa.ctorParameters=function(){return[{type:X}]};var ka=function(){function t(t){this.store=t}return t.prototype.ngOnInit=function(){this.bookmarksPerPage$=this.store.pipe(r.select(na))},t}();ka.decorators=[{type:e.Component,args:[{selector:"mv-bookmark-icons",template:'<div class="pageContainer">\n <div *ngFor="let bookmarks of (bookmarksPerPage$ | async); index as i"\n class="pageContainer__page"\n [ngStyle]="{\n \'width.px\': bookmarks.styles.width,\n \'height.px\': bookmarks.styles.height\n }">\n <div class="pageContainer__page-item">\n <ng-container *ngFor="let bMrk of bookmarks.bookmark">\n <div class="bookmark__here"\n [style.width]="16 * zoom + \'px\'"\n [style.height]="24 * zoom + \'px\'"\n [style.top]="bMrk.yCoordinate * zoom + \'px\'"\n [title]="bMrk.name">\n </div>\n </ng-container>\n </div>\n </div>\n</div>\n'}]}],ka.ctorParameters=function(){return[{type:r.Store}]},ka.propDecorators={zoom:[{type:e.Input}],rotate:[{type:e.Input}]};var Ea=function(){function t(t,e,n,o){this.el=t,this.store=e,this.toolbarButtons=n,this.toolbarEvents=o,this.rotation=0,this.savedRotation=0}return t.prototype.ngOnInit=function(){var t=this;this.$subscriptions=this.toolbarEvents.rotateSubject.subscribe((function(e){return t.onRotate(e)})),this.$subscriptions.add(this.toolbarEvents.saveRotationSubject.subscribe((function(){return t.saveRotation()}))).add(this.store.pipe(r.select(ro)).subscribe((function(e){return t.savedRotation=e}))).add(this.store.pipe(r.select(oo)).subscribe((function(e){return t.documentId=e})))},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.prototype.onMediaLoad=function(t){var e=this;this.rotation=0,this.store.dispatch(new Ot(this.documentId)),this.store.pipe(r.select(co),s.filter((function(t){return!!t})),s.take(1)).subscribe((function(){e.savedRotation&&e.toolbarEvents.rotateSubject.next(e.savedRotation)}))},t.prototype.onRotate=function(t){this.rotation=(this.rotation+t)%360,this.toolbarButtons.showSaveRotationButton=this.savedRotation!==this.rotation},t.prototype.saveRotation=function(){var t={documentId:this.documentId,rotationAngle:this.rotation};this.store.dispatch(new jt(t))},t}();Ea.decorators=[{type:e.Directive,args:[{selector:"[mvRotationPersist]"}]}],Ea.ctorParameters=function(){return[{type:e.ElementRef},{type:r.Store},{type:nt},{type:X}]},Ea.propDecorators={onMediaLoad:[{type:e.HostListener,args:["mediaLoadStatus",["$event"]]}]};var Ca=function(){function t(t,e){this.toolbarEvents=t,this.store=e,this.showParticipantsList=!1}return t.prototype.ngOnInit=function(){var t=this;this.participants$=this.store.pipe(r.select(wo)),this.presenter$=this.store.pipe(r.select(bo)),this.isPresenter$=this.store.pipe(r.select(yo)),this.subscription=this.toolbarEvents.icp.participantsListVisible.subscribe((function(e){return t.showParticipantsList=e}))},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t}();Ca.decorators=[{type:e.Component,args:[{selector:"mv-participants-list",template:'<div class="comments-panel comment-container icp-mode" [ngClass]="{\'expanded\': showParticipantsList }">\n\n <div class="participant__card no-shadow">\n <p class="participant__name">All Participants</p>\n </div>\n\n <div *ngIf="(presenter$ | async)?.username !== \'\'" class="participant__card">\n <div class="participant__header"> Presenting </div>\n <p class="participant__name">{{(presenter$ | async)?.username}}</p>\n </div>\n\n <div *ngIf="(participants$ | async).length > 1" class="participant__card">\n <div class="participant__header">Following</div>\n <ng-container *ngFor="let participant of (participants$ | async)">\n <p *ngIf="participant.id !== (presenter$ | async)?.id" class="participant__name">{{participant.username}}</p>\n </ng-container>\n </div>\n</div>\n'}]}],Ca.ctorParameters=function(){return[{type:X},{type:r.Store}]};var Ia=function(){function t(t,e,n,o,i){this.element=t,this.toolbarEvents=e,this.viewerEvents=n,this.highlightService=o,this.store=i}return t.prototype.ngOnInit=function(){var t=this;this.$subscription=this.store.select(no).subscribe((function(e){e[1]&&(t.allPages=e)}))},t.prototype.ngOnDestroy=function(){this.$subscription&&this.$subscription.unsubscribe()},t.prototype.onMouseUp=function(t){var e=t.target.offsetParent.offsetParent,n=parseInt(e.getAttribute("data-page-number"),10);if(this.toolbarEvents.highlightModeSubject.getValue()){var o=this.getRectangles(t,n);this.viewerEvents.textSelected({page:n,rectangles:o})}},t.prototype.onPdfViewerClick=function(t){this.store.dispatch(new Ce({annotationId:"",selected:!1,editable:!1})),this.viewerEvents.clearCtxToolbar()},t.prototype.getRectangles=function(t,e){this.pageHeight=this.allPages[e].styles.height,this.pageWidth=this.allPages[e].styles.width,this.zoom=parseFloat(this.allPages[e].scaleRotation.scale),this.rotate=parseInt(this.allPages[e].scaleRotation.rotation,10);var n=window.getSelection();if(n){var o=t.target;if(this.removeEnhancedTextModeStyling(o),n.rangeCount&&!n.isCollapsed){var i=n.getRangeAt(0).cloneRange().getClientRects();if(i){for(var a=o.parentElement.getBoundingClientRect(),s=[],r=function(t){var e=c.createTextRectangle(i[t],a);s.find((function(t){return t.width===e.width&&t.x===e.x}))||s.push(e)},c=this,l=0;l<i.length;l++)r(l);return s}}}},t.prototype.createTextRectangle=function(t,e){var n=t.bottom-t.top,o=t.right-t.left,i=t.top-e.top,a=t.left-e.left,s=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,n,o,i,a,this.rotate,this.zoom);return s=Object.assign({id:_.default()},s)},t.prototype.removeEnhancedTextModeStyling=function(t){if(t.parentElement.children)for(var e=0;e<t.parentElement.children.length;e++){var n=t.parentElement.children[e];n.style.padding="0";n.style.transform=n.style.transform.replace(/translate[XYZ]\(-?\d*(\.\d+)?(px)?\)/g,"").trim()}},t}();Ia.decorators=[{type:e.Directive,args:[{selector:"[mvCreateTextHighlight]"}]}],Ia.ctorParameters=function(){return[{type:e.ElementRef},{type:X},{type:lo},{type:Ci},{type:r.Store}]},Ia.propDecorators={onMouseUp:[{type:e.HostListener,args:["mouseup",["$event"]]}],onPdfViewerClick:[{type:e.HostListener,args:["mousedown",["$event"]]}]};var Oa=function(){function n(t){this.toolbarEvents=t,this.loadStatus=new e.EventEmitter,this.playbackMsg="loading"}return n.prototype.ngOnInit=function(){var e=this;this.subscription=this.toolbarEvents.downloadSubject.subscribe((function(){return e.downloadLink.nativeElement.click()})),this.loadStatus.emit(t.ResponseType.SUCCESS)},n.prototype.ngOnChanges=function(t){t.url&&this.reloadVideo()},n.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},n.prototype.reloadVideo=function(){this.videoPlayer&&(this.playbackMsg="loading",this.videoPlayer.nativeElement.load())},n.prototype.onSuccess=function(){this.playbackMsg="success"},n.prototype.onError=function(){this.playbackMsg="error"},n}();Oa.decorators=[{type:e.Component,args:[{selector:"mv-multimedia-player",template:'<div class="govuk-width-container">\n <div class="govuk-notification-banner__content">\n <p>\n <span *ngIf="multimediaOn && playbackMsg === \'loading\'">Loading multimedia content ... </span>\n <span *ngIf="!multimediaOn">Multimedia playback is not enabled, </span>\n <span *ngIf="multimediaOn && playbackMsg === \'success\'">Use the player to play to the file or </span>\n <span *ngIf="multimediaOn && playbackMsg === \'error\'">Mime type not supported. </span>\n <a *ngIf="!multimediaOn || playbackMsg !== \'loading\'" #downloadLink\n [href]="url" [download]="downloadFileName">Click here to download</a>\n </p>\n <video #videoPlayer *ngIf="multimediaOn"\n width="100%" height="100%" preload="auto" (canplay)="onSuccess()" controls>\n <source (error)="onError()" [src]="url" type="video/mp4">\n <source (error)="onError()" [src]="url" type="video/mp4; codecs=\'avc1, av01, hvc1, hev1, mp4v, mp4a.40.2, opus\'">\n <source (error)="onError()" [src]="url" type="video/ogg">\n <source (error)="onError()" [src]="url" type="video/ogg; codecs=\'theora, vp8, vp9, flac, opus, vorbis\'">\n <source (error)="onError()" [src]="url" type="video/webm">\n <source (error)="onError()" [src]="url" type="video/webm; codecs=\'vp8, vp9, vorbis, opus\'">\n </video>\n </div>\n</div>\n'}]}],Oa.ctorParameters=function(){return[{type:X}]},Oa.propDecorators={url:[{type:e.Input}],downloadFileName:[{type:e.Input}],multimediaOn:[{type:e.Input}],loadStatus:[{type:e.Output}],downloadLink:[{type:e.ViewChild,args:["downloadLink",{static:!1}]}],videoPlayer:[{type:e.ViewChild,args:["videoPlayer",{static:!1}]}]};var Pa=function(){};Pa.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,i.HttpClientModule,Si,ia,v.TagInputModule,o.FormsModule,o.ReactiveFormsModule,g.RouterModule,r.StoreModule.forFeature("media-viewer",Qn),S.EffectsModule.forFeature(va),k.TreeModule,f.MutableDivModule],declarations:[Co,sa,ya,ra,Oo,Po,Oa,ci,wa,aa,Ea,Ia,Sa,ca,ka,Ca],entryComponents:[Co,Oo,Po],providers:[K,jo,da,la,po,uo,Eo,So,ko,da,ma,ga],exports:[ci]}]}],t.ADD_OR_EDIT_COMMENT=se,t.APPLY_COMMENT_SUMMARY_FILTER=de,t.AddOrEditComment=we,t.AnnotationApiService=xo,t.AnnotationEffects=ua,t.AnnotationSetComponent=Ei,t.AnnotationViewComponent=ki,t.AnnotationsModule=ia,t.ApplyCommentSymmaryFilter=Oe,t.BoxHighlightCreateComponent=Ri,t.CLEAR_COMMENT_SUMMARY_FILTER=he,t.ClearCommentSummaryFilters=Pe,t.CommentFilterComponent=Li,t.CommentSearchComponent=Ni,t.CommentSetComponent=Ti,t.CommentSetHeaderComponent=Bi,t.CommentsSummaryComponent=Di,t.DELETE_ANNOTATION=re,t.DELETE_ANNOTATION_FAIL=le,t.DELETE_ANNOTATION_SUCCESS=ce,t.DeleteAnnotation=Se,t.DeleteAnnotationFail=Ee,t.DeleteAnnotationSuccess=ke,t.FilterPipe=Vi,t.IcpToolbarComponent=wi,t.LOAD_ANNOTATION_SET=te,t.LOAD_ANNOTATION_SET_FAIL=ne,t.LOAD_ANNOTATION_SET_SUCCESS=ee,t.LoadAnnotationSet=me,t.LoadAnnotationSetFail=be,t.LoadAnnotationSetSucess=ge,t.MainToolbarComponent=ui,t.MediaViewerComponent=ci,t.MediaViewerModule=Pa,t.MetadataLayerComponent=oa,t.MomentDatePipe=$i,t.RedactionToolbarComponent=yi,t.SAVE_ANNOTATION=oe,t.SAVE_ANNOTATION_FAIL=ae,t.SAVE_ANNOTATION_SUCCESS=ie,t.SEARCH_COMMENT=pe,t.SELECT_ANNOTATION=ue,t.SaveAnnotation=fe,t.SaveAnnotationFail=ye,t.SaveAnnotationSuccess=ve,t.SearchBarComponent=pi,t.SearchComment=Ie,t.SelectedAnnotation=Ce,t.TagsComponent=Mi,t.ToolbarButtonVisibilityService=nt,t.ToolbarEventService=X,t.ToolbarModule=Si,t.UnsnakePipe=Ui,t.ViewerException=et,t.commentSearchQ=Ae,t.getAnnoEnt=Be,t.getAnnoPageEnt=Re,t.getAnnoPerPage=ei,t.getAnnoSet=_e,t.getAnnotationEntities=Ho,t.getAnnotationSet=qo,t.getAnnotationsSetState=$o,t.getCommentEntities=Zo,t.getCommentEnts=De,t.getCommentSummary=ai,t.getCommentSummaryFilters=Qo,t.getCommentsArray=oi,t.getComponentSearchQueries=Yo,t.getComponentSearchText=Ko,t.getDocumentIdSetId=zo,t.getFilteredAnnotations=ri,t.getPageEntities=Jo,t.getSelectedAnno=Ne,t.getSelectedAnnotation=Go,t.getSet=Vo,t.getSummaryFilters=Me,t.initialState=je,t.reducer=Te,t["ɵ0"]=Lo,t["ɵ1"]=Uo,t["ɵ2"]=Wo,t["ɵ3"]=Xo,t["ɵ4"]=ti,t["ɵ5"]=ni,t["ɵ6"]=ii,t["ɵ7"]=si,t["ɵa"]=li,t["ɵba"]=Ai,t["ɵbb"]=xi,t["ɵbc"]=ji,t["ɵbd"]=Fi,t["ɵbe"]=_i,t["ɵbf"]=tt,t["ɵbg"]=Hi,t["ɵbh"]=va,t["ɵbi"]=pa,t["ɵbj"]=ha,t["ɵbk"]=da,t["ɵbl"]=ba,t["ɵbm"]=ma,t["ɵbn"]=ga,t["ɵbo"]=fa,t["ɵbp"]=la,t["ɵbq"]=po,t["ɵbr"]=uo,t["ɵbs"]=Co,t["ɵbt"]=K,t["ɵbu"]=Eo,t["ɵbv"]=So,t["ɵbw"]=ko,t["ɵbx"]=sa,t["ɵby"]=ya,t["ɵbz"]=ra,t["ɵc"]=Qn,t["ɵca"]=Oo,t["ɵcb"]=Io,t["ɵcc"]=Po,t["ɵcd"]=Oa,t["ɵce"]=wa,t["ɵcf"]=aa,t["ɵcg"]=Ea,t["ɵch"]=Ia,t["ɵci"]=Sa,t["ɵcj"]=ca,t["ɵck"]=ka,t["ɵcl"]=Ca,t["ɵcm"]=eo,t["ɵcn"]=no,t["ɵco"]=Ro,t["ɵcp"]=Ao,t["ɵcq"]=Mo,t["ɵd"]=to,t["ɵf"]=Kt,t["ɵg"]=Qt,t["ɵh"]=Le,t["ɵi"]=$e,t["ɵj"]=He,t["ɵl"]=yn,t["ɵm"]=Jn,t["ɵn"]=Xn,t["ɵp"]=Ji,t["ɵq"]=zi,t["ɵr"]=Wi,t["ɵs"]=Gi,t["ɵt"]=Zi,t["ɵu"]=Ci,t["ɵv"]=lo,t["ɵw"]=jo,t["ɵx"]=Ii,t["ɵy"]=Pi,t["ɵz"]=Oi,Object.defineProperty(t,"__esModule",{value:!0})}));
17
2
  //# sourceMappingURL=hmcts-media-viewer.umd.min.js.map