UNPKG

@hmcts/media-viewer

Version:
1 lines 754 kB
{"version":3,"file":"hmcts-media-viewer.mjs","sources":["../../../projects/media-viewer/src/lib/viewers/viewer-exception.model.ts","../../../projects/media-viewer/src/lib/store/actions/document.actions.ts","../../../projects/media-viewer/src/lib/store/actions/tag.actions.ts","../../../projects/media-viewer/src/lib/store/actions/icp.actions.ts","../../../projects/media-viewer/src/lib/store/reducers/document.reducer.ts","../../../projects/media-viewer/src/lib/store/actions/annotation.actions.ts","../../../projects/media-viewer/src/lib/store/store-utils.ts","../../../projects/media-viewer/src/lib/store/reducers/annotations.reducer.ts","../../../projects/media-viewer/src/lib/store/reducers/tags.reducer.ts","../../../projects/media-viewer/src/lib/store/actions/bookmark.actions.ts","../../../projects/media-viewer/src/lib/store/bookmarks-store-utils.ts","../../../projects/media-viewer/src/lib/store/reducers/bookmarks.reducer.ts","../../../projects/media-viewer/src/lib/store/actions/redaction.actions.ts","../../../projects/media-viewer/src/lib/store/reducers/redaction.reducer.ts","../../../projects/media-viewer/src/lib/store/reducers/icp.reducer.ts","../../../projects/media-viewer/src/lib/store/reducers/reducers.ts","../../../projects/media-viewer/src/lib/store/selectors/document.selectors.ts","../../../projects/media-viewer/src/lib/shared/util/helpers/html-templates.helper.ts","../../../projects/media-viewer/src/lib/toolbar/icp-event.service.ts","../../../projects/media-viewer/src/lib/toolbar/toolbar-event.service.ts","../../../projects/media-viewer/src/lib/viewers/viewer-event.service.ts","../../../projects/media-viewer/src/lib/store/selectors/tag.selectors.ts","../../../projects/media-viewer/src/lib/store/selectors/annotation.selectors.ts","../../../projects/media-viewer/src/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.service.ts","../../../projects/media-viewer/src/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.directive.ts","../../../projects/media-viewer/src/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.ts","../../../projects/media-viewer/src/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.provider.ts","../../../projects/media-viewer/src/lib/print.service.ts","../../../projects/media-viewer/src/lib/store/selectors/icp.selectors.ts","../../../projects/media-viewer/src/lib/icp/icp.events.ts","../../../projects/media-viewer/src/lib/icp/socket.service.ts","../../../projects/media-viewer/src/lib/icp/icp-update.service.ts","../../../projects/media-viewer/src/lib/icp/icp-presenter.service.ts","../../../projects/media-viewer/src/lib/icp/icp-follower.service.ts","../../../projects/media-viewer/src/lib/icp/icp.service.ts","../../../projects/media-viewer/src/lib/toolbar/toolbar-button-visibility.service.ts","../../../projects/media-viewer/src/lib/toolbar/redaction-search-bar/redaction-search-bar.component.ts","../../../projects/media-viewer/src/lib/toolbar/redaction-search-bar/redaction-search-bar.component.html","../../../projects/media-viewer/src/lib/annotations/comment-set/comment/comment.service.ts","../../../projects/media-viewer/src/lib/annotations/comment-set/comment-set-render.service.ts","../../../projects/media-viewer/src/lib/annotations/services/tags/tags.services.ts","../../../projects/media-viewer/src/lib/annotations/comment-set/comment/text-highlight/text-highlight.directive.ts","../../../projects/media-viewer/src/lib/annotations/comment-set/comment/textarea-auto-expand/textarea-auto-expand.directive.ts","../../../projects/media-viewer/src/lib/annotations/tags/tags.component.ts","../../../projects/media-viewer/src/lib/annotations/tags/tags.component.html","../../../projects/media-viewer/src/lib/annotations/pipes/date/date.pipe.ts","../../../projects/media-viewer/src/lib/annotations/comment-set/comment/comment.component.ts","../../../projects/media-viewer/src/lib/annotations/comment-set/comment/comment.component.html","../../../projects/media-viewer/src/lib/annotations/comment-set/comment-set.component.ts","../../../projects/media-viewer/src/lib/annotations/comment-set/comment-set.component.html","../../../projects/media-viewer/src/lib/annotations/comment-set/comment-navigate/comments-navigate.component.ts","../../../projects/media-viewer/src/lib/annotations/comment-set/comment-navigate/comments-navigate.component.html","../../../projects/media-viewer/src/lib/annotations/comment-set/comment-set-header/comment-search/comment-search.component.ts","../../../projects/media-viewer/src/lib/annotations/comment-set/comment-set-header/comment-search/comment-search.component.html","../../../projects/media-viewer/src/lib/annotations/pipes/filter/filter.pipe.ts","../../../projects/media-viewer/src/lib/annotations/pipes/unsnake/unsnake.pipe.ts","../../../projects/media-viewer/src/lib/annotations/comment-set/comment-set-header/comment-filter/comment-filter.component.ts","../../../projects/media-viewer/src/lib/annotations/comment-set/comment-set-header/comment-filter/comment-filter.component.html","../../../projects/media-viewer/src/lib/annotations/comment-set/comment-set-header/comment-set-header.component.ts","../../../projects/media-viewer/src/lib/annotations/comment-set/comment-set-header/comment-set-header.component.html","../../../projects/media-viewer/src/lib/store/selectors/bookmark.selectors.ts","../../../projects/media-viewer/src/lib/annotations/annotation-set/ctx-toolbar/ctx-toolbar.component.ts","../../../projects/media-viewer/src/lib/annotations/annotation-set/ctx-toolbar/ctx-toolbar.component.html","../../../projects/media-viewer/src/lib/annotations/annotation-set/annotation-create/box-highlight-create/box-highlight-create.component.ts","../../../projects/media-viewer/src/lib/annotations/annotation-set/annotation-create/box-highlight-create/box-highlight-create.component.html","../../../projects/media-viewer/src/lib/annotations/annotation-set/annotation-view/rectangle/rectangle.component.ts","../../../projects/media-viewer/src/lib/annotations/annotation-set/annotation-view/rectangle/rectangle.component.html","../../../projects/media-viewer/src/lib/annotations/annotation-set/annotation-view/annotation-view.component.ts","../../../projects/media-viewer/src/lib/annotations/annotation-set/annotation-view/annotation-view.component.html","../../../projects/media-viewer/src/lib/annotations/annotation-set/annotation-set.component.ts","../../../projects/media-viewer/src/lib/annotations/annotation-set/annotation-set.component.html","../../../projects/media-viewer/src/lib/annotations/annotation-set/metadata-layer/metadata-layer.component.ts","../../../projects/media-viewer/src/lib/annotations/annotation-set/metadata-layer/metadata-layer.component.html","../../../projects/media-viewer/src/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.ts","../../../projects/media-viewer/src/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.html","../../../projects/media-viewer/src/lib/viewers/pdf-viewer/side-bar/outline-item/outline-item.component.ts","../../../projects/media-viewer/src/lib/viewers/pdf-viewer/side-bar/outline-item/outline-item.component.html","../../../projects/media-viewer/src/lib/viewers/pdf-viewer/side-bar/side-bar.component.ts","../../../projects/media-viewer/src/lib/viewers/pdf-viewer/side-bar/side-bar.component.html","../../../projects/media-viewer/src/lib/viewers/grab-n-drag.directive.ts","../../../projects/media-viewer/src/lib/annotations/annotation-set/annotation-create/highlight-create/keyboard-text-highlight.directive.ts","../../../projects/media-viewer/src/lib/store/selectors/redaction.selectors.ts","../../../projects/media-viewer/src/lib/redaction/components/redaction.component.ts","../../../projects/media-viewer/src/lib/redaction/components/redaction.component.html","../../../projects/media-viewer/src/lib/bookmark/components/bookmark-icons.component.ts","../../../projects/media-viewer/src/lib/bookmark/components/bookmark-icons.component.html","../../../projects/media-viewer/src/lib/icp/participants-list/participants-list.component.ts","../../../projects/media-viewer/src/lib/icp/participants-list/participants-list.component.html","../../../projects/media-viewer/src/lib/viewers/pdf-viewer/pdf-viewer.component.ts","../../../projects/media-viewer/src/lib/viewers/pdf-viewer/pdf-viewer.component.html","../../../projects/media-viewer/src/lib/viewers/viewer-util.service.ts","../../../projects/media-viewer/src/lib/viewers/image-viewer/image-viewer.component.ts","../../../projects/media-viewer/src/lib/viewers/image-viewer/image-viewer.component.html","../../../projects/media-viewer/src/lib/viewers/unsupported-viewer/unsupported-viewer.component.ts","../../../projects/media-viewer/src/lib/viewers/unsupported-viewer/unsupported-viewer.component.html","../../../projects/media-viewer/src/lib/annotations/services/annotation-api/annotation-api.service.ts","../../../projects/media-viewer/src/lib/shared/util/services/number.helper.service.ts","../../../projects/media-viewer/src/lib/toolbar/search-bar/search-bar.component.ts","../../../projects/media-viewer/src/lib/toolbar/search-bar/search-bar.component.html","../../../projects/media-viewer/src/lib/shared/directives/tooltip-dismiss.directive.ts","../../../projects/media-viewer/src/lib/toolbar/main-toolbar/main-toolbar.component.ts","../../../projects/media-viewer/src/lib/toolbar/main-toolbar/main-toolbar.component.html","../../../projects/media-viewer/src/lib/toolbar/redaction-toolbar/redaction-toolbar.component.ts","../../../projects/media-viewer/src/lib/toolbar/redaction-toolbar/redaction-toolbar.component.html","../../../projects/media-viewer/src/lib/toolbar/icp-toolbar/icp-toolbar.component.ts","../../../projects/media-viewer/src/lib/toolbar/icp-toolbar/icp-toolbar.component.html","../../../projects/media-viewer/src/lib/toolbar/highlight-toolbar/highlight-toolbar.component.ts","../../../projects/media-viewer/src/lib/toolbar/highlight-toolbar/highlight-toolbar.component.html","../../../projects/media-viewer/src/lib/shared/gov-uk-error-message/gov-uk-error-message.component.ts","../../../projects/media-viewer/src/lib/shared/gov-uk-fieldset/gov-uk-fieldset.component.ts","../../../projects/media-viewer/src/lib/shared/gov-uk-label/gov-uk-label.component.ts","../../../projects/media-viewer/src/lib/shared/gov-uk-date/gov-uk-date.component.ts","../../../projects/media-viewer/src/lib/shared/gov-uk-date/gov-uk-date.component.html","../../../projects/media-viewer/src/lib/annotations/comments-summary/comments-summary.component.ts","../../../projects/media-viewer/src/lib/annotations/comments-summary/comments-summary.component.html","../../../projects/media-viewer/src/lib/viewers/multimedia-player/multimedia-player.component.ts","../../../projects/media-viewer/src/lib/viewers/multimedia-player/multimedia-player.component.html","../../../projects/media-viewer/src/lib/viewers/convertible-content-viewer/convertible-content-viewer.component.ts","../../../projects/media-viewer/src/lib/viewers/convertible-content-viewer/convertible-content-viewer.component.html","../../../projects/media-viewer/src/lib/viewers/rotation-persist/rotation-persist.directive.ts","../../../projects/media-viewer/src/lib/icp/confirm-exit/confirm-action-dialog.component.ts","../../../projects/media-viewer/src/lib/icp/confirm-exit/confirm-action-dialog.component.html","../../../projects/media-viewer/src/lib/media-viewer.component.ts","../../../projects/media-viewer/src/lib/media-viewer.component.html","../../../projects/media-viewer/src/lib/toolbar/toolbar.module.ts","../../../projects/media-viewer/src/lib/annotations/services/bookmarks-api/bookmarks-api.service.ts","../../../projects/media-viewer/src/lib/shared/shared.module.ts","../../../projects/media-viewer/src/lib/annotations/annotations.module.ts","../../../projects/media-viewer/src/lib/store/effects/annotation.effects.ts","../../../projects/media-viewer/src/lib/store/effects/bookmarks.effects.ts","../../../projects/media-viewer/src/lib/redaction/services/redaction-api.service.ts","../../../projects/media-viewer/src/lib/store/effects/redaction.effects.ts","../../../projects/media-viewer/src/lib/viewers/convertible-content-viewer/document-conversion-api.service.ts","../../../projects/media-viewer/src/lib/viewers/rotation-persist/rotation-api.service.ts","../../../projects/media-viewer/src/lib/store/effects/document.effects.ts","../../../projects/media-viewer/src/lib/icp/icp-session-api.service.ts","../../../projects/media-viewer/src/lib/store/effects/icp.effects.ts","../../../projects/media-viewer/src/lib/store/effects/index.ts","../../../projects/media-viewer/src/lib/media-viewer.module.ts","../../../projects/media-viewer/src/public_api.ts","../../../projects/media-viewer/src/hmcts-media-viewer.ts"],"sourcesContent":["export enum ResponseType {\n SUCCESS = 'SUCCESS',\n FAILURE = 'FAILURE',\n UNSUPPORTED = 'UNSUPPORTED'\n}\n\nexport interface ExceptionDetail {\n httpResponseCode?: string;\n message?: string;\n}\n\nexport class ViewerException {\n exceptionType?: string;\n detail?: ExceptionDetail;\n\n constructor(exceptionType?: string, detail?: ExceptionDetail) {\n this.exceptionType = exceptionType;\n this.detail = detail;\n }\n}\n","import { Action } from '@ngrx/store';\nimport { PageEvent } from '../../viewers/pdf-viewer/pdf-js/pdf-js-wrapper';\nimport { Rotation } from '../../viewers/rotation-persist/rotation.model';\nimport { PdfPosition } from '../reducers/document.reducer';\n\nexport const SET_DOCUMENT_ID = '[Document] Set Document Id';\nexport const POSITION_UPDATED = '[Document] Position Updated';\nexport const ADD_PAGES = '[Document] Add Pages';\nexport const CONVERT = '[Document] Convert';\nexport const CONVERT_SUCCESS = '[Document] Convert Success';\nexport const CONVERT_FAIL = '[Document] Convert Fail';\nexport const CLEAR_CONVERT_DOC_URL = '[Document] Clear Convert Doc Url';\n\nexport const LOAD_ROTATION = '[Document] Load Rotation';\nexport const LOAD_ROTATION_SUCCESS = '[Document] Load Rotation Success';\nexport const LOAD_ROTATION_FAIL = '[Document] Load Rotation Fail';\nexport const SAVE_ROTATION = '[Document] Save Rotation';\nexport const SAVE_ROTATION_SUCCESS = '[Document] Save Rotation Success';\nexport const SAVE_ROTATION_FAIL = '[Document] Save Rotation Fail';\n\nexport class SetDocumentId implements Action {\n readonly type = SET_DOCUMENT_ID;\n constructor(public payload: string) { }\n}\n\nexport class AddPages implements Action {\n readonly type = ADD_PAGES;\n constructor(public payload: PageEvent[]) { }\n}\n\nexport class PdfPositionUpdate implements Action {\n readonly type = POSITION_UPDATED;\n constructor(public payload: PdfPosition) {}\n}\n\nexport class Convert implements Action {\n readonly type = CONVERT;\n constructor(public payload: string ) {}\n}\n\nexport class ConvertSuccess implements Action {\n readonly type = CONVERT_SUCCESS;\n constructor(public payload: string ) {}\n}\n\nexport class ConvertFailure implements Action {\n readonly type = CONVERT_FAIL;\n constructor(public payload: string) {}\n}\n\nexport class ClearConvertDocUrl implements Action {\n readonly type = CLEAR_CONVERT_DOC_URL;\n}\n\nexport class LoadRotation implements Action {\n readonly type = LOAD_ROTATION;\n constructor(public payload: string) {\n }\n}\n\nexport class LoadRotationSuccess implements Action {\n readonly type = LOAD_ROTATION_SUCCESS;\n constructor(public payload: { rotationAngle: number }) {\n }\n}\n\nexport class LoadRotationFailure implements Action {\n readonly type = LOAD_ROTATION_FAIL;\n constructor(public payload: Error) {\n }\n}\n\nexport class SaveRotation implements Action {\n readonly type = SAVE_ROTATION;\n constructor(public payload: Rotation) {\n }\n}\n\nexport class SaveRotationSuccess implements Action {\n readonly type = SAVE_ROTATION_SUCCESS;\n constructor(public payload: { rotationAngle: number }) {\n }\n}\n\nexport class SaveRotationFailure implements Action {\n readonly type = SAVE_ROTATION_FAIL;\n constructor(public payload: Error) {\n }\n}\n\nexport type DocumentActions =\n | AddPages | SetDocumentId | Convert\n | ConvertSuccess | ConvertFailure | ClearConvertDocUrl\n | PdfPositionUpdate | LoadRotation | LoadRotationSuccess\n | LoadRotationFailure | SaveRotation | SaveRotationSuccess\n | SaveRotationFailure;\n","import { Action } from '@ngrx/store';\nimport {TagsModel} from '../../annotations/models/tags.model';\nexport const UPDATE_TAGS = '[Tags] Update Tags';\nexport const ADD_FILTER_TAGS = '[Tags] Add Filter Tags';\nexport const CLEAR_FILTER_TAGS = '[Tags] Clear Filter Tags';\n\nexport class UpdateTags implements Action {\n readonly type = UPDATE_TAGS;\n constructor(public payload: {tags: TagsModel[]; annoId: string}) {}\n}\n\nexport class AddFilterTags implements Action {\n readonly type = ADD_FILTER_TAGS;\n constructor(public payload: {[id: string]: boolean}) {}\n}\n\nexport class ClearFilterTags implements Action {\n readonly type = CLEAR_FILTER_TAGS;\n}\n\n\nexport type TagsActions =\n | UpdateTags\n | AddFilterTags\n | ClearFilterTags;\n","import { Action } from '@ngrx/store';\nimport { IcpParticipant, IcpSession } from '../../icp/icp.interfaces';\n\nexport const SET_CASE_ID = '[Icp] Set Case Id';\nexport const LOAD_ICP_SESSION = '[Icp] Load Session';\nexport const LOAD_ICP_SESSION_FAIL = '[Icp] Load Session Failure';\nexport const JOIN_ICP_SOCKET_SESSION = '[Icp] Join Socket Session';\nexport const ICP_SOCKET_SESSION_JOINED = '[Icp] Socket Session Joined';\nexport const LEAVE_ICP_SOCKET_SESSION = '[Icp] Leave Socket Session';\nexport const ICP_PRESENTER_UPDATED = '[Icp] Presenter Updated';\nexport const ICP_PARTICIPANT_LIST_UPDATED = '[Icp] Participant List Updated';\n\nexport class SetCaseId implements Action {\n readonly type = SET_CASE_ID;\n constructor(public payload: string) { }\n}\n\nexport class LoadIcpSession implements Action {\n readonly type = LOAD_ICP_SESSION;\n constructor(public payload: { caseId: string, documentId: string }) { }\n}\n\nexport class LoadIcpSessionFailure implements Action {\n readonly type = LOAD_ICP_SESSION_FAIL;\n constructor(public payload: Error) { }\n}\n\nexport class JoinIcpSocketSession implements Action {\n readonly type = JOIN_ICP_SOCKET_SESSION;\n constructor(public payload: { username: string, session: IcpSession }) { }\n}\n\nexport class IcpSocketSessionJoined implements Action {\n readonly type = ICP_SOCKET_SESSION_JOINED;\n constructor(public payload: { session: IcpSession, participantInfo: { client: IcpParticipant, presenter: IcpParticipant } }) { }\n}\n\nexport class LeaveIcpSocketSession implements Action {\n readonly type = LEAVE_ICP_SOCKET_SESSION;\n constructor() { }\n}\n\nexport class IcpPresenterUpdated implements Action {\n readonly type = ICP_PRESENTER_UPDATED;\n constructor(public payload: IcpParticipant) { }\n}\n\nexport class IcpParticipantListUpdated implements Action {\n readonly type = ICP_PARTICIPANT_LIST_UPDATED;\n constructor(public payload: any) { }\n}\n\nexport type IcpActions =\n | SetCaseId\n | LoadIcpSession\n | LoadIcpSessionFailure\n | JoinIcpSocketSession\n | IcpSocketSessionJoined\n | LeaveIcpSocketSession\n | IcpPresenterUpdated\n | IcpParticipantListUpdated;\n","import * as fromActions from '../actions/document.actions';\n\nexport interface DocumentState {\n convertedDocument: {\n url: string;\n error: string;\n };\n documentId: string;\n pdfPosition: PdfPosition;\n pages: {[id: string]: DocumentPages};\n hasDifferentPageSize: boolean;\n rotation: number;\n rotationLoaded: boolean;\n loaded: boolean;\n loading: boolean;\n}\n\nexport interface DocumentPages {\n numberOfPages: number;\n styles: { left: number, height: number, width: number };\n scaleRotation: { scale: string; rotation: string };\n viewportScale: number;\n}\n\nexport interface PdfPosition {\n pageNumber: number;\n scale: number;\n top: number;\n left: number;\n rotation: number;\n}\n\nexport const initialDocumentState: DocumentState = {\n convertedDocument: undefined,\n documentId: undefined,\n pdfPosition: undefined,\n pages: {},\n hasDifferentPageSize: false,\n rotation: undefined,\n rotationLoaded: false,\n loading: false,\n loaded: false\n};\n\nexport function docReducer (state = initialDocumentState,\n action: fromActions.DocumentActions): DocumentState {\n\n switch (action.type) {\n\n case fromActions.CONVERT_SUCCESS: {\n const convertedDocument = {\n url: action.payload,\n error: undefined\n };\n return {\n ...state,\n convertedDocument\n };\n }\n\n case fromActions.CONVERT_FAIL: {\n const convertedDocument = {\n url: undefined,\n error: action.payload\n };\n return {\n ...state,\n convertedDocument\n };\n }\n\n case fromActions.CLEAR_CONVERT_DOC_URL: {\n const convertedDocument = undefined;\n return {\n ...state,\n convertedDocument\n };\n }\n\n case fromActions.LOAD_ROTATION: {\n return {\n ...state,\n rotationLoaded: false\n };\n }\n\n case fromActions.LOAD_ROTATION_SUCCESS: {\n const metadata = action.payload;\n const rotation = metadata ? metadata.rotationAngle : 0;\n return {\n ...state,\n rotation,\n rotationLoaded: true\n };\n }\n\n case fromActions.LOAD_ROTATION_FAIL: {\n return {\n ...state,\n rotation: 0,\n rotationLoaded: true\n };\n }\n\n case fromActions.SAVE_ROTATION_SUCCESS: {\n const metadata = action.payload;\n const rotation = metadata.rotationAngle;\n return {\n ...state,\n rotation\n };\n }\n\n case fromActions.SET_DOCUMENT_ID : {\n return {\n ...state,\n documentId: action.payload\n };\n }\n\n case fromActions.ADD_PAGES: {\n const payload = action.payload;\n let pages = {};\n let pageHeight;\n let pageWidth;\n let hasDifferentPageSize = state.hasDifferentPageSize;\n const pageNumberInput = document.getElementById('pageNumber') as HTMLInputElement;\n const pageIndex = pageNumberInput?.value ? parseInt(pageNumberInput.value, 10) - 1 : 0;\n const loadedPage = payload[pageIndex]?.div['attributes']?.style?.value ?? '';\n payload.forEach(page => {\n const sizingValue = page.div?.['attributes']?.style?.value ?? '';\n const widthMatch = sizingValue.match(/width:\\s*round\\(down,\\s*var\\(--scale-factor\\)\\s*\\*\\s*([\\d.]+)([a-z%]+)?,.*var\\(--scale-round-x, ([\\d.]+)([a-z%]+)?\\)\\)/);\n const heightMatch = sizingValue.match(/height:\\s*round\\(down,\\s*var\\(--scale-factor\\)\\s*\\*\\s*([\\d.]+)([a-z%]+)?,.*var\\(--scale-round-y, ([\\d.]+)([a-z%]+)?\\)\\)/);\n const scaleRoundXMatch = loadedPage.match(/--scale-round-x:\\s*([\\d.]+)([a-z%]+)?/);\n const scaleRoundYMatch = loadedPage.match(/--scale-round-y:\\s*([\\d.]+)([a-z%]+)?/);\n // You can now use widthUnit, heightUnit, scaleRoundXUnit, scaleRoundYUnit as needed\n const scaleFactor = page.viewportScale ?? 1;\n const scaleRoundX = scaleRoundXMatch ? parseFloat(scaleRoundXMatch[1]) : 1;\n const scaleRoundY = scaleRoundYMatch ? parseFloat(scaleRoundYMatch[1]) : 1;\n const baseWidth = widthMatch ? parseFloat(widthMatch[1]) : undefined;\n const baseHeight = heightMatch ? parseFloat(heightMatch[1]) : undefined;\n function roundDown(value: number, step: number): number {\n return Math.floor(value / step) * step;\n }\n const computedWidth = baseWidth !== undefined\n ? roundDown(scaleFactor * baseWidth, scaleRoundX)\n : page.div['clientWidth'];\n const computedHeight = baseHeight !== undefined\n ? roundDown(scaleFactor * baseHeight, scaleRoundY)\n : page.div['clientHeight'];\n\n if (!hasDifferentPageSize && pageHeight && pageWidth &&\n (pageHeight !== computedHeight || pageWidth !== computedWidth)) {\n hasDifferentPageSize = true;\n } else {\n pageHeight = computedHeight;\n pageWidth = computedWidth;\n }\n const styles = {\n left: page.div['offsetLeft'],\n height: computedHeight,\n width: computedWidth\n };\n\n const scaleRotation = {\n scale: page.scale,\n rotation: page.rotation\n };\n\n const p = {\n styles,\n scaleRotation,\n viewportScale: page.viewportScale\n };\n\n pages = {\n ...pages,\n [page.id]: p\n };\n\n });\n return {\n ...state,\n pages,\n hasDifferentPageSize\n };\n }\n\n case fromActions.POSITION_UPDATED: {\n const pdfPosition = action.payload;\n return {\n ...state,\n pdfPosition\n };\n }\n }\n return state;\n}\nexport const getDocPages = (state: DocumentState) => state.pages;\nexport const getDocId = (state: DocumentState) => state.documentId;\nexport const getPdfPos = (state: DocumentState) => state.pdfPosition;\nexport const getHasDifferentPageSizes = (state: DocumentState) => state.hasDifferentPageSize;\nexport const getRotation = (state: DocumentState) => state.rotation;\nexport const rotationLoaded = (state: DocumentState) => state.rotationLoaded;\nexport const getConvertedDocument = (state: DocumentState) => state.convertedDocument;\n","import { Action } from '@ngrx/store';\nimport { Annotation } from '../../annotations/annotation-set/annotation-view/annotation.model';\nimport { SelectionAnnotation } from '../../annotations/models/event-select.model';\nimport { AnnotationSet } from '../../annotations/annotation-set/annotation-set.model';\nimport { Filters } from '../models/filters.interface';\nimport { Comment } from '../../annotations/comment-set/comment/comment.model';\n\nexport const LOAD_ANNOTATION_SET = '[Annotations] Load Annotation Set';\nexport const LOAD_ANNOTATION_SET_SUCCESS = '[Annotations] Load Annotation Set Success';\nexport const LOAD_ANNOTATION_SET_FAIL = '[Annotations] Load Annotation Set Fail';\n\nexport const SAVE_ANNOTATION_SET = '[Annotations] Save Annotation Set';\nexport const SAVE_ANNOTATION_SET_SUCCESS = '[Annotations] Save Annotation Set Success';\nexport const SAVE_ANNOTATION_SET_FAIL = '[Annotations] Save Annotation Set Fail';\n\nexport const SAVE_ANNOTATION = '[Annotations] Save Annotation';\nexport const SAVE_ANNOTATION_SUCCESS = '[Annotations] Save Annotation Success';\nexport const SAVE_ANNOTATION_FAIL = '[Annotations] Save Annotation Fail';\nexport const ADD_OR_EDIT_COMMENT = '[Annotations] Add or Edit Comment';\n\nexport const DELETE_ANNOTATION = '[Annotations] Delete Annotation';\nexport const DELETE_ANNOTATION_SUCCESS = '[Annotations] Delete Annotation Success';\nexport const DELETE_ANNOTATION_FAIL = '[Annotations] Delete Annotation Fail';\n\nexport const SELECT_ANNOTATION = '[Annotations] Select Annotation';\nexport const SEARCH_COMMENT = '[Comments] Search Comments';\nexport const APPLY_COMMENT_SUMMARY_FILTER = '[Comments] Apply Comment Summary Filter';\nexport const CLEAR_COMMENT_SUMMARY_FILTER = '[Comments] Clear Comment Summary Filter';\n\nexport class LoadAnnotationSet implements Action {\n readonly type = LOAD_ANNOTATION_SET;\n constructor(public payload: string) { }\n}\n\nexport class SaveAnnotationSet implements Action {\n readonly type = SAVE_ANNOTATION_SET;\n constructor(public payload: AnnotationSet) { }\n}\n\nexport class LoadAnnotationSetSucess implements Action {\n readonly type = LOAD_ANNOTATION_SET_SUCCESS;\n constructor(public payload: { status: number, body: AnnotationSet }) { }\n}\n\nexport class SaveAnnotationSetSuccess implements Action {\n readonly type = SAVE_ANNOTATION_SET_SUCCESS;\n constructor(public payload: AnnotationSet) { }\n}\n\nexport class LoadAnnotationSetFail implements Action {\n readonly type = LOAD_ANNOTATION_SET_FAIL;\n constructor(public payload: { status: number, body: any }) { }\n}\n\nexport class SaveAnnotationSetFail implements Action {\n readonly type = SAVE_ANNOTATION_SET_FAIL;\n constructor(public payload: { status: number, body: any }) { }\n}\n\nexport class SaveAnnotation implements Action {\n readonly type = SAVE_ANNOTATION;\n constructor(public payload: Annotation) { }\n}\n\nexport class SaveAnnotationSuccess implements Action {\n readonly type = SAVE_ANNOTATION_SUCCESS;\n constructor(public payload: any) { }\n}\n\nexport class SaveAnnotationFail implements Action {\n readonly type = SAVE_ANNOTATION_FAIL;\n constructor(public payload: Error) { }\n}\n\nexport class AddOrEditComment implements Action {\n readonly type = ADD_OR_EDIT_COMMENT;\n constructor(public payload: Comment) { }\n}\n\nexport class DeleteAnnotation implements Action {\n readonly type = DELETE_ANNOTATION;\n constructor(public payload: string) { }\n}\n\nexport class DeleteAnnotationSuccess implements Action {\n readonly type = DELETE_ANNOTATION_SUCCESS;\n constructor(public payload: string) { }\n}\n\nexport class DeleteAnnotationFail implements Action {\n readonly type = DELETE_ANNOTATION_FAIL;\n constructor(public payload: Error) { }\n}\n\nexport class SelectedAnnotation implements Action {\n readonly type = SELECT_ANNOTATION;\n constructor(public payload: SelectionAnnotation) { }\n}\n\nexport class SearchComment implements Action {\n readonly type = SEARCH_COMMENT;\n constructor(public payload: string) { }\n}\n\nexport class ApplyCommentSymmaryFilter implements Action {\n readonly type = APPLY_COMMENT_SUMMARY_FILTER;\n constructor(public payload: Filters) { }\n}\n\nexport class ClearCommentSummaryFilters implements Action {\n readonly type = CLEAR_COMMENT_SUMMARY_FILTER;\n}\n\nexport type AnnotationsActions =\n | LoadAnnotationSet\n | LoadAnnotationSetSucess\n | LoadAnnotationSetFail\n | SaveAnnotation\n | SaveAnnotationSuccess\n | SaveAnnotationFail\n | SaveAnnotationSetSuccess\n | AddOrEditComment\n | DeleteAnnotation\n | DeleteAnnotationSuccess\n | DeleteAnnotationFail\n | SelectedAnnotation\n | SearchComment\n | ApplyCommentSymmaryFilter\n | ClearCommentSummaryFilters;\n","import { Annotation } from '../annotations/annotation-set/annotation-view/annotation.model';\nimport moment from 'moment-timezone';\nimport { Redaction } from '../redaction/services/redaction.model';\nimport { Filters } from './models/filters.interface';\nimport { Comment } from '../annotations/comment-set/comment/comment.model';\n\n/*\n @dynamic\n marking class as dynamic to stop compiler throwing error for lambda in static function\n see https://github.com/angular/angular/issues/19698#issuecomment-338340211\n */\nexport class StoreUtils {\n\n static groupByKeyEntities(annotations, key): {[id: string]: any[]} {\n return annotations.reduce((h, obj) =>\n Object.assign(h, { [obj[key]]: ( h[obj[key]] || [] ).concat(obj) }), {});\n }\n\n static generateCommentsEntities(annotations): {[id: string]: Comment} {\n return annotations.reduce(\n (commentEntities: { [id: string]: Annotation }, annotation: Annotation) => {\n if (annotation.comments.length) {\n const comment = {\n ...annotation.comments[0] || '',\n tags: [...annotation.tags || []]\n };\n return {\n ...commentEntities,\n [annotation.id]: comment\n };\n }\n return {\n ...commentEntities\n };\n }, {});\n }\n\n static genTagNameEntities(annotations) {\n const filterAnnoWithoutCommentsTags = annotations.filter(a => (a.comments.length && a.tags.length));\n const allTags = filterAnnoWithoutCommentsTags.map(anno => this.groupByKeyEntities(anno.tags, 'name'));\n const groupedByName = allTags.reduce(\n (tagEntitiy: { [id: string]: Annotation }, tagItem) => {\n return {\n ...tagEntitiy,\n ...tagItem\n };\n }, {});\n\n return this.genNameEnt(annotations, groupedByName);\n }\n\n static genNameEnt(annos, groupedByName) {\n return Object.keys(groupedByName).reduce(\n (tagNameEnt, key) => {\n const readyAnno = annos.filter(anno => anno.tags.find(tag => tag.name === key))\n .map(anno => anno.id)\n .reduce((obj: {[id: string]: string}, anno: string) => ({ ...obj, [anno]: anno }), {});\n\n return {\n ...tagNameEnt,\n [key]: readyAnno\n };\n }, {});\n\n }\n\n static generateAnnotationEntities(anno): {[id: string]: Annotation} {\n return anno.reduce(\n (annoEntities: { [id: string]: Annotation }, annotation: Annotation) => {\n const annot = {\n ...annotation,\n positionTop: annotation.rectangles[0].y // todo remove this\n };\n return {\n ...annoEntities,\n [annotation.id]: annot\n };\n }, {});\n }\n\n static generateRedactionEntities(redactions: Redaction[]): { [id: string]: Redaction } {\n return redactions.reduce(\n (redactEntities: { [id: string]: Redaction }, redaction: Redaction) => {\n return {\n ...redactEntities,\n [redaction.redactionId]: redaction\n };\n }, {});\n }\n\n static resetCommentEntSelect(ent: { [id: string]: Comment }) {\n return Object.keys(ent).reduce((object, key) => {\n object[key] = {\n ...ent[key],\n editable: false,\n selected: false\n };\n return object;\n }, {});\n }\n\n static filterCommentsSummary(comments: Array<Comment>, filters: Filters) {\n if (Object.keys(filters).length) {\n const tagFilterApplied = Object.keys(filters.tagFilters)\n .filter(key => filters.tagFilters[key] === true).length;\n const dateFilterApplied = (filters.dateRangeFrom || filters.dateRangeTo);\n const filteredComments = comments.filter(comment => {\n let hasTagFilter = false;\n let hasDateFilter = false;\n // check tags\n if (filters.hasOwnProperty('tagFilters')) {\n Object.keys(filters.tagFilters).forEach(filter => {\n const label = filters.tagFilters[filter];\n if (label) {\n return comment.tags.forEach(tag => {\n if (tag.name === filter && !hasTagFilter) {\n hasTagFilter = true;\n }\n });\n }});\n }\n // check for dates\n if (dateFilterApplied) {\n const commentDate = moment(comment.lastModifiedDate);\n const dateFrom = filters.dateRangeFrom !== null ? moment(filters.dateRangeFrom) : undefined;\n const dateTo = filters.dateRangeTo !== null ? moment(filters.dateRangeTo) : undefined;\n\n if (dateTo && dateFrom) {\n if (commentDate > dateFrom && commentDate < dateTo) {\n hasDateFilter = true;\n }\n }\n if (dateTo && !dateFrom) {\n if (commentDate <= dateTo) {\n hasDateFilter = true;\n }\n }\n if (dateFrom && !dateTo) {\n if (commentDate > dateFrom) {\n hasDateFilter = true;\n }\n }\n }\n\n return (hasTagFilter || hasDateFilter);\n });\n return (tagFilterApplied || dateFilterApplied) ? filteredComments : comments;\n } else {\n return comments;\n }\n }\n}\n","import { v4 as uuid } from 'uuid';\nimport * as fromAnnotations from '../actions/annotation.actions';\nimport { Annotation } from '../../annotations/annotation-set/annotation-view/annotation.model';\nimport { Comment } from '../../annotations/comment-set/comment/comment.model';\nimport { StoreUtils } from '../store-utils';\nimport { SelectionAnnotation } from '../../annotations/models/event-select.model';\nimport { Filters } from '../models/filters.interface';\n\nexport interface AnnotationSetState {\n annotationSet: any;\n annotationEntities: { [id: string]: any };\n annotationPageEntities: { [id: string]: Annotation[] };\n commentEntities: { [id: string]: Comment };\n selectedAnnotation: SelectionAnnotation;\n commentSearchQueries: { commentSearch: string };\n commentSummaryFilters: { hasFilter: boolean; filters: Filters };\n loaded: boolean;\n loading: boolean;\n}\n\nexport const initialState: AnnotationSetState = {\n annotationSet: {},\n annotationEntities: {},\n commentEntities: {},\n annotationPageEntities: {},\n selectedAnnotation: null,\n commentSearchQueries: { commentSearch: '' },\n commentSummaryFilters: { hasFilter: false, filters: {} },\n loading: false,\n loaded: false,\n};\n\nexport function reducer(\n state = initialState,\n action: fromAnnotations.AnnotationsActions\n): AnnotationSetState {\n switch (action.type) {\n\n case fromAnnotations.LOAD_ANNOTATION_SET: {\n const annotationSet = {\n ...state.annotationSet,\n documentId: action.payload\n };\n return {\n ...initialState,\n annotationSet,\n loading: true\n };\n }\n case fromAnnotations.LOAD_ANNOTATION_SET_SUCCESS:\n case fromAnnotations.LOAD_ANNOTATION_SET_FAIL: {\n const annotationSet = action.payload.status === 200 ? action.payload.body :\n {\n ...state.annotationSet,\n annotations: [],\n id: uuid()\n };\n const annotationEntities = StoreUtils.generateAnnotationEntities(annotationSet.annotations);\n const annotationPageEntities = StoreUtils.groupByKeyEntities(annotationSet.annotations, 'page');\n const commentEntities = StoreUtils.generateCommentsEntities(annotationSet.annotations);\n return {\n ...state,\n annotationSet,\n annotationEntities,\n annotationPageEntities,\n commentEntities,\n loading: false,\n loaded: true\n };\n }\n\n case fromAnnotations.SAVE_ANNOTATION_SET_SUCCESS: {\n const anno = action.payload.annotations;\n const annEntities = {\n ...state.annotationEntities,\n ...anno\n };\n const annotArray = Object.keys(annEntities).map(key => annEntities[key]);\n const annotationEntities = StoreUtils.generateAnnotationEntities(annotArray);\n const annotationPageEntities = StoreUtils.groupByKeyEntities(annotArray, 'page');\n const commentEntities = StoreUtils.generateCommentsEntities(annotArray);\n const selectedAnnotation = {\n ...state.selectedAnnotation,\n ...anno,\n editable: false\n };\n return {\n ...state,\n annotationEntities,\n annotationPageEntities,\n commentEntities,\n selectedAnnotation,\n loading: false,\n loaded: true\n };\n\n }\n\n case fromAnnotations.SAVE_ANNOTATION_SUCCESS: {\n const anno = action.payload;\n const annEntities = {\n ...state.annotationEntities,\n [anno.id]: anno\n };\n const annotArray = Object.keys(annEntities).map(key => annEntities[key]);\n const annotationEntities = StoreUtils.generateAnnotationEntities(annotArray);\n const annotationPageEntities = StoreUtils.groupByKeyEntities(annotArray, 'page');\n const commentEntities = StoreUtils.generateCommentsEntities(annotArray);\n const selectedAnnotation = {\n ...state.selectedAnnotation,\n annotationId: anno.id,\n editable: false\n };\n return {\n ...state,\n annotationEntities,\n annotationPageEntities,\n commentEntities,\n selectedAnnotation,\n loading: false,\n loaded: true\n };\n }\n\n case fromAnnotations.DELETE_ANNOTATION_SUCCESS: {\n const id = action.payload;\n const page = state.annotationEntities[id].page;\n const annotationEntities = {\n ...state.annotationEntities\n };\n delete annotationEntities[id];\n const pageAnnotationsRemoved = [\n ...state.annotationPageEntities[page].filter(anno => anno.id !== id)\n ];\n const annotationPageEntities = {\n ...state.annotationPageEntities,\n [page]: pageAnnotationsRemoved\n };\n const commentEntities = {\n ...state.commentEntities\n };\n if (state.commentEntities[id]) {\n delete commentEntities[id];\n }\n return {\n ...state,\n annotationEntities,\n annotationPageEntities,\n commentEntities\n };\n }\n\n case fromAnnotations.ADD_OR_EDIT_COMMENT: {\n const comment = {\n [action.payload.annotationId]: action.payload\n };\n const comments = {\n ...state.commentEntities,\n ...comment\n };\n return {\n ...state,\n commentEntities: comments\n };\n }\n\n case fromAnnotations.SELECT_ANNOTATION: {\n const payload = action.payload;\n const commentEntity = {\n ...state.commentEntities[payload.annotationId],\n editable: payload.editable,\n selected: payload.selected\n };\n\n const resetCommentEntSelect = StoreUtils.resetCommentEntSelect({ ...state.commentEntities });\n\n const commentEntities = payload.annotationId && state.commentEntities[payload.annotationId] ? {\n ...resetCommentEntSelect,\n [payload.annotationId]: commentEntity\n } : { ...resetCommentEntSelect };\n\n return {\n ...state,\n commentEntities,\n selectedAnnotation: action.payload\n };\n }\n\n case fromAnnotations.SEARCH_COMMENT: {\n const commentSearchQueries = {\n ...state.commentSearchQueries,\n commentSearch: action.payload\n };\n\n const commentEntities = StoreUtils.resetCommentEntSelect({ ...state.commentEntities });\n return {\n ...state,\n commentEntities,\n commentSearchQueries\n };\n }\n\n case fromAnnotations.APPLY_COMMENT_SUMMARY_FILTER: {\n const payload = action.payload;\n const hasTagFilter = () => {\n let isFiltered = false;\n if (payload.tagFilters) {\n Object.keys(payload.tagFilters).map(filter => {\n if (payload.tagFilters[filter] && !isFiltered) {\n isFiltered = true;\n }\n });\n }\n return isFiltered;\n };\n const hasFilter = (hasTagFilter() || !!payload.dateRangeFrom || !!payload.dateRangeTo);\n const commentSummaryFilters = {\n hasFilter,\n filters: payload\n };\n return {\n ...state,\n commentSummaryFilters: commentSummaryFilters\n };\n }\n\n case fromAnnotations.CLEAR_COMMENT_SUMMARY_FILTER: {\n\n return {\n ...state,\n commentSummaryFilters: { ...initialState.commentSummaryFilters }\n };\n }\n }\n\n\n return state;\n}\n\nexport const getAnnoSet = (state: AnnotationSetState) => state.annotationSet;\nexport const getCommentEnts = (state: AnnotationSetState) => state.commentEntities;\nexport const getAnnoPageEnt = (state: AnnotationSetState) => state.annotationPageEntities;\nexport const getAnnoEnt = (state: AnnotationSetState) => state.annotationEntities;\nexport const getSelectedAnno = (state: AnnotationSetState) => state.selectedAnnotation;\nexport const commentSearchQ = (state: AnnotationSetState) => state.commentSearchQueries;\nexport const getSummaryFilters = (state: AnnotationSetState) => state.commentSummaryFilters;\n","import * as fromAnnotations from '../actions/annotation.actions';\nimport * as fromTags from '../actions/tag.actions';\nimport {StoreUtils} from '../store-utils';\nimport {Annotation} from '../../annotations/annotation-set/annotation-view/annotation.model';\n\nexport interface TagsState {\n tagNameEnt: {[id: string]: string[]};\n filteredComments: {[id: string]: string[]};\n filteredPageEntities: {[id: string]: Annotation[]};\n annotations: Annotation[];\n formFilterState: {[id: string]: boolean};\n filters: string[];\n}\n\nexport const initialTagState: TagsState = {\n tagNameEnt: {},\n annotations: [],\n filteredPageEntities: {},\n filteredComments: {},\n formFilterState: {},\n filters: []\n};\n\nexport function tagsReducer (\n state = initialTagState,\n action: fromAnnotations.AnnotationsActions | fromTags.TagsActions\n): TagsState {\n switch (action.type) {\n case fromAnnotations.LOAD_ANNOTATION_SET: {\n\n return {\n ...state,\n ...initialTagState\n };\n }\n case fromAnnotations.LOAD_ANNOTATION_SET_SUCCESS: {\n const annotations = action.payload.body.annotations;\n const tagNameEnt = StoreUtils.genTagNameEntities(annotations);\n return {\n ...state,\n tagNameEnt,\n annotations\n };\n }\n\n case fromAnnotations.SAVE_ANNOTATION_SUCCESS: {\n const payload = action.payload;\n\n const anno = [...state.annotations].filter(a => a.id !== payload.id) || [];\n const annotations = [...anno, payload];\n const tagNameEnt = StoreUtils.genTagNameEntities(annotations);\n return {\n ...state,\n annotations,\n tagNameEnt\n };\n }\n\n case fromAnnotations.DELETE_ANNOTATION_SUCCESS: {\n const id = action.payload;\n const annotations = [...state.annotations].filter(a => a.id !== id);\n const tagNameEnt = StoreUtils.genTagNameEntities(annotations);\n const filteredPageEntities = StoreUtils.groupByKeyEntities(annotations, 'page');\n const filteredComments = {\n ...state.filteredComments\n };\n delete filteredComments[id];\n return {\n ...state,\n annotations,\n tagNameEnt,\n filteredComments,\n filteredPageEntities,\n filters: []\n };\n }\n\n\n case fromTags.ADD_FILTER_TAGS: {\n const formFilterState = action.payload;\n\n const filters = Object.keys(formFilterState).reduce((arr: string[], key: string) => {\n return formFilterState[key] ? [...arr, key] : arr;\n }, []);\n\n const filteredComments = filters.reduce((obj: {[id: string]: any}, f) => {\n return {\n ...obj,\n ...state.tagNameEnt[f]\n };\n }, {});\n\n const annotations = Object.keys(filteredComments).map(key => state.annotations.filter(a => a.id === key)[0]);\n const filteredPageEntities = StoreUtils.groupByKeyEntities(annotations, 'page');\n return {\n ...state,\n filters,\n filteredComments,\n filteredPageEntities,\n };\n }\n\n case fromTags.CLEAR_FILTER_TAGS: {\n return {\n ...state,\n filters: [],\n filteredComments: {},\n filteredPageEntities: {},\n };\n }\n\n }\n\n return state;\n}\n\nexport const getTagNameEnt = (state: TagsState) => state.tagNameEnt;\nexport const getFilters = (state: TagsState) => state.filters;\nexport const getFilteredComments = (state: TagsState) => state.filteredComments;\nexport const getFilteredPageEnt = (state: TagsState) => state.filteredPageEntities;\n","import { Action } from '@ngrx/store';\nimport { Bookmark } from '../../viewers/pdf-viewer/side-bar/bookmarks/bookmarks.interfaces';\n\nexport const LOAD_BOOKMARKS = '[Bookmarks] Load Bookmarks';\nexport const LOAD_BOOKMARKS_SUCCESS = '[Bookmarks] Load Bookmarks Success';\nexport const LOAD_BOOKMARKS_FAIL = '[Bookmarks] Load Bookmarks Failure';\nexport const CREATE_BOOKMARK = '[Bookmarks] Create Bookmark';\nexport const CREATE_BOOKMARK_SUCCESS = '[Bookmarks] Create Bookmark Success';\nexport const CREATE_BOOKMARK_FAIL = '[Bookmarks] Create Bookmark Failure';\nexport const DELETE_BOOKMARK = '[Bookmarks] Delete Bookmark';\nexport const DELETE_BOOKMARK_SUCCESS = '[Bookmarks] Delete Bookmark Success';\nexport const DELETE_BOOKMARK_FAIL = '[Bookmarks] Delete Bookmark Failure';\nexport const MOVE_BOOKMARK = '[Bookmarks] Move Bookmark';\nexport const MOVE_BOOKMARK_SUCCESS = '[Bookmarks] Move Bookmark Success';\nexport const MOVE_BOOKMARK_FAIL = '[Bookmarks] Move Bookmark Failure';\nexport const UPDATE_BOOKMARK = '[Bookmarks] Update Bookmark';\nexport const UPDATE_BOOKMARK_SUCCESS = '[Bookmarks] Update Bookmark Success';\nexport const UPDATE_BOOKMARK_FAIL = '[Bookmarks] Update Bookmark Failure';\nexport const UPDATE_BOOKMARK_SCROLL_TOP = '[Bookmarks] Update Bookmark Scroll Top'\n\nexport class LoadBookmarks implements Action {\n readonly type = LOAD_BOOKMARKS;\n constructor() { }\n}\n\nexport class LoadBookmarksSuccess implements Action {\n readonly type = LOAD_BOOKMARKS_SUCCESS;\n constructor(public payload: { body: Bookmark[], status: number }) { }\n}\n\nexport class LoadBookmarksFailure implements Action {\n readonly type = LOAD_BOOKMARKS_FAIL;\n constructor(public payload: { body: any, status: number }) { }\n}\n\nexport class CreateBookmark implements Action {\n readonly type = CREATE_BOOKMARK;\n constructor(public payload: Bookmark) { }\n}\n\nexport class CreateBookmarkSuccess implements Action {\n readonly type = CREATE_BOOKMARK_SUCCESS;\n constructor(public payload: Bookmark) { }\n}\n\nexport class CreateBookmarkFailure implements Action {\n readonly type = CREATE_BOOKMARK_FAIL;\n constructor(public payload: Bookmark) { }\n}\n\nexport class DeleteBookmark implements Action {\n readonly type = DELETE_BOOKMARK;\n constructor(public payload: { deleted: string[], updated: Bookmark }) { }\n}\n\nexport class DeleteBookmarkSuccess implements Action {\n readonly type = DELETE_BOOKMARK_SUCCESS;\n constructor(public payload: string[]) { }\n}\n\nexport class DeleteBookmarkFailure implements Action {\n readonly type = DELETE_BOOKMARK_FAIL;\n constructor(public payload: string) { }\n}\n\nexport class MoveBookmark implements Action {\n readonly type = MOVE_BOOKMARK;\n constructor(public payload: Bookmark[]) { }\n}\n\nexport class MoveBookmarkSuccess implements Acti