@hmcts/media-viewer 2.7.19 → 2.7.21
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.
- package/assets/sass/rectangle.scss +1 -4
- package/bundles/hmcts-media-viewer.umd.js +33 -9
- package/bundles/hmcts-media-viewer.umd.js.map +1 -1
- package/bundles/hmcts-media-viewer.umd.min.js +1 -1
- package/bundles/hmcts-media-viewer.umd.min.js.map +1 -1
- package/esm2015/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.directive.js +14 -4
- package/esm2015/lib/toolbar/search-bar/search-bar.component.js +13 -2
- package/esm2015/lib/viewers/image-viewer/image-viewer.component.js +2 -2
- package/esm2015/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.js +5 -3
- package/esm2015/lib/viewers/pdf-viewer/side-bar/side-bar.component.js +2 -2
- package/esm5/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.directive.js +19 -5
- package/esm5/lib/toolbar/search-bar/search-bar.component.js +14 -2
- package/esm5/lib/viewers/image-viewer/image-viewer.component.js +2 -2
- package/esm5/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.js +5 -3
- package/esm5/lib/viewers/pdf-viewer/side-bar/side-bar.component.js +2 -2
- package/fesm2015/hmcts-media-viewer.js +29 -8
- package/fesm2015/hmcts-media-viewer.js.map +1 -1
- package/fesm5/hmcts-media-viewer.js +35 -9
- package/fesm5/hmcts-media-viewer.js.map +1 -1
- package/hmcts-media-viewer-v2.7.21.tgz +0 -0
- package/hmcts-media-viewer.metadata.json +1 -1
- package/lib/toolbar/search-bar/search-bar.component.d.ts +1 -0
- package/package.json +1 -1
- package/hmcts-media-viewer-v2.7.19.tgz +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("pdfjs-dist/web/pdf_viewer"),require("pdfjs-dist"),require("pdfjs-dist/build/pdf.worker"),require("uuid/v4"),require("hammerjs"),require("@angular/cdk/overlay"),require("@angular/cdk/a11y"),require("@swimlane/ngx-datatable"),require("moment-timezone"),require("@angular/common"),require("@angular/forms"),require("ngx-chips"),require("@angular/router"),require("socket.io-client/dist/socket.io.js"),require("@angular/common/http"),require("@ngrx/effects"),require("rxjs"),require("mutable-div"),require("angular-tree-component"),require("rxjs/operators"),require("uuid"),require("@ngrx/store"),require("@angular/core")):"function"==typeof define&&define.amd?define("@hmcts/media-viewer",["exports","pdfjs-dist/web/pdf_viewer","pdfjs-dist","pdfjs-dist/build/pdf.worker","uuid/v4","hammerjs","@angular/cdk/overlay","@angular/cdk/a11y","@swimlane/ngx-datatable","moment-timezone","@angular/common","@angular/forms","ngx-chips","@angular/router","socket.io-client/dist/socket.io.js","@angular/common/http","@ngrx/effects","rxjs","mutable-div","angular-tree-component","rxjs/operators","uuid","@ngrx/store","@angular/core"],e):e((t.hmcts=t.hmcts||{},t.hmcts["media-viewer"]={}),t.pdfjsViewer,t.pdfjsLib,0,t.uuid,0,t.ng.cdk.overlay,t.ng.cdk.a11y,t.ngxDatatable,t.moment,t.ng.common,t.ng.forms,t.ngxChips,t.ng.router,t.socketio,t.ng.common.http,t.effects,t.rxjs,t.mutableDiv,t.angularTreeComponent,t.rxjs.operators,t.uuid$1,t.store,t.ng.core)}(this,function(t,n,s,e,f,o,i,a,r,c,l,u,p,d,h,m,g,b,v,y,w,k,S,E){"use strict";f=f&&f.hasOwnProperty("default")?f["default"]:f,c=c&&c.hasOwnProperty("default")?c["default"]:c,h=h&&h.hasOwnProperty("default")?h["default"]:h;var C="default"in k?k["default"]:k,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 P(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;0<=s;s--)(i=t[s])&&(r=(a<3?i(r):3<a?i(e,n,r):i(e,n))||r);return 3<a&&r&&Object.defineProperty(e,n,r),r}function _(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function T(t,e,s,c){return new(s=s||Promise)(function(n,o){function i(t){try{r(c.next(t))}catch(e){o(e)}}function a(t){try{r(c["throw"](t))}catch(e){o(e)}}function r(t){var e;t.done?n(t.value):((e=t.value)instanceof s?e:new s(function(t){t(e)})).then(i,a)}r((c=c.apply(t,e||[])).next())})}function D(n,o){var i,a,r,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},t={next:e(0),"throw":e(1),"return":e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return c([e,t])}}function c(t){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,a&&(r=2&t[0]?a["return"]:t[0]?a["throw"]||((r=a["return"])&&r.call(a),0):a.next)&&!(r=r.call(a,t[1])).done)return r;switch(a=0,(t=r?[2&t[0],r.value]:t)[0]){case 0:case 1:r=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(r=0<(r=s.trys).length&&r[r.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!r||t[1]>r[0]&&t[1]<r[3])){s.label=t[1];break}if(6===t[0]&&s.label<r[1]){s.label=r[1],r=t;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(t);break}r[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=r=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}function B(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{value:(t=t&&o>=t.length?void 0:t)&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function R(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||0<e--)&&!(o=a.next()).done;)r.push(o.value)}catch(s){i={error:s}}finally{try{o&&!o.done&&(n=a["return"])&&n.call(a)}finally{if(i)throw i.error}}return r}function O(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(R(arguments[e]));return t}s.GlobalWorkerOptions.workerSrc="/assets/build/pdf.worker.min.js";var M={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};M[M.FOUND]="FOUND",M[M.NOT_FOUND]="NOT_FOUND",M[M.WRAPPED]="WRAPPED",M[M.PENDING]="PENDING";var A=(N.prototype.emitDocumentInfo=function(t){var e=O(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)},N.prototype.loadDocument=function(r){return T(this,void 0,void 0,function(){var e,n,o,i,a=this;return D(this,function(t){switch(t.label){case 0:(e=s.getDocument({url:r,cMapUrl:"assets/minified/cmaps",cMapPacked:!0,withCredentials:!0})).onProgress=function(t){var e=t.loaded,t=t.total;a.documentLoadProgress.next({loaded:e,total:t})},this.documentLoadInit.next(r),t.label=1;case 1:return t.trys.push([1,5,,6]),[4,e.promise];case 2:return n=t.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=t.sent(),this.outlineLoaded.next(this.documentOutline),[4,n.getMetadata()];case 4:return i=t.sent(),this.setCurrentPDFTitle(i.info.Title),[3,6];case 5:return i=t.sent(),this.documentLoadFailed.next(i),[3,6];case 6:return[2]}})})},N.prototype.downloadFile=function(t,e){this.downloadManager.downloadUrl(t,e)},N.prototype.setPageNumber=function(t){this.pdfViewer.currentPageNumber=t},N.prototype.getPageNumber=function(){return this.pdfViewer.currentPageNumber},N.prototype.changePageNumber=function(t){this.pdfViewer.currentPageNumber+=t},N.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})},N.prototype.clearSearch=function(){this.pdfViewer.eventBus.dispatch("findbarclose")},N.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)},N.prototype.setZoom=function(t){this.pdfViewer.currentScaleValue=this.getZoomValue(t),this.zoomValue=this.pdfViewer.currentScaleValue,this.toolbarEvents.zoomValueSubject.next(this.pdfViewer.currentScaleValue)},N.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)},N.prototype.getZoomValue=function(t){return isNaN(t)?this.zoomValue:5<t?5:t<.1?.1:+t.toFixed(2)},N.prototype.rotate=function(t){return this.pdfViewer.pagesRotation=(this.pdfViewer.pagesRotation+t)%360},N.prototype.resetRotation=function(t){return this.pdfViewer.pagesRotation=t},N.prototype.getNormalisedPagesRotation=function(){return this.pdfViewer.pagesRotation},N.prototype.getCurrentPDFZoomValue=function(){return this.pdfViewer.currentScaleValue},N.prototype.setCurrentPDFTitle=function(t){this.documentTitle=t},N.prototype.getCurrentPDFTitle=function(){return this.documentTitle},N);function N(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!==M.PENDING&&u.toolbarEvents.searchResultsCountSubject.next(t.matchesCount)}),this.pdfViewer.eventBus.on("updatefindmatchescount",function(t){u.toolbarEvents.searchResultsCountSubject.next(t.matchesCount)}),this.zoomValue=1}var j=new b.BehaviorSubject(!1),F=new b.Subject,L=new b.Subject,H=new b.Subject,$=new b.BehaviorSubject(!1),V=new b.Subject,U=new b.BehaviorSubject(!1),z=function(){F.next()},W=Object.freeze({enabled:j,sessionLaunch:F,becomingPresenter:L,stoppingPresenting:H,leavingSession:$,sessionExitConfirmed:V,participantsListVisible:U,launchSession:z,enable:function(){j.next(!0),z()},becomePresenter:function(){L.next()},stopPresenting:function(){H.next()},leaveSession:function(){$.next(!0)},confirmExit:function(){V.next(),U.next(!1),j.next(!1)}}),q=(G.prototype.reset=function(){this.setCurrentPageSubject.next(1),this.zoomValueSubject.next(1),this.highlightModeSubject.next(!1),this.drawModeSubject.next(!1),this.showCommentSummary.next(!1)},G.prototype.toggleHighlightMode=function(){!1===this.highlightModeSubject.getValue()?(this.drawModeSubject.next(!1),this.highlightModeSubject.next(!0)):this.highlightModeSubject.next(!1)},G.prototype.toggleDrawMode=function(){!1===this.drawModeSubject.getValue()?(this.highlightModeSubject.next(!1),this.drawModeSubject.next(!0)):this.drawModeSubject.next(!1)},G.prototype.rotate=function(t){this.rotateSubject.next(t)},G.prototype.search=function(t){this.searchSubject.next(t)},G.prototype.getSearchResultsCount=function(){return this.searchResultsCountSubject.asObservable()},G.prototype.zoom=function(t){this.zoomSubject.next(t)},G.prototype.stepZoom=function(t){this.stepZoomSubject.next(t)},G.prototype.getZoomValue=function(){return this.zoomValueSubject.asObservable()},G.prototype.getPageCount=function(){return this.pageCountSubject.asObservable()},G.prototype.print=function(){this.printSubject.next()},G.prototype.download=function(){this.downloadSubject.next()},G.prototype.setPage=function(t){this.setCurrentPageSubject.next(t)},G.prototype.incrementPage=function(t){this.changePageByDeltaSubject.next(t)},G.prototype.getCurrentPageNumber=function(){return this.setCurrentPageInputValueSubject.asObservable()},G.prototype.getShowCommentSummary=function(){return this.showCommentSummary.asObservable()},G.prototype.toggleCommentsSummary=function(t){this.showCommentSummary.next(t)},G.prototype.saveRotation=function(){this.saveRotationSubject.next()},G.prototype.toggleGrabNDrag=function(){this.grabNDrag.next(!this.grabNDrag.getValue())},G.prototype.toggleSideBar=function(t){this.sidebarOpen.next(t)},G.prototype.toggleRedactionMode=function(){this.redactionMode.next(!this.redactionMode.getValue())},G.prototype.toggleRedactionPreview=function(t){this.redactionPreview.next(t)},G.prototype.unmarkAll=function(){this.clearAllRedactMarkers.next()},G.prototype.applyRedactionToDocument=function(){this.applyRedactToDocument.next()},G.prototype.toggleCommentsPanel=function(t){t&&this.toggleParticipantsList(!t),this.commentsPanelVisible.next(t)},G.prototype.toggleParticipantsList=function(t){t&&this.toggleCommentsPanel(!t),this.icp.participantsListVisible.next(t)},G.decorators=[{type:E.Injectable,args:[{providedIn:"root"}]}],G.ngInjectableDef=E.defineInjectable({factory:function(){return new G},token:G,providedIn:"root"}),G);function G(){this.highlightModeSubject=new b.BehaviorSubject(!1),this.drawModeSubject=new b.BehaviorSubject(!1),this.rotateSubject=new b.Subject,this.searchSubject=new b.Subject,this.searchResultsCountSubject=new b.Subject,this.zoomSubject=new b.Subject,this.stepZoomSubject=new b.Subject,this.zoomValueSubject=new b.BehaviorSubject(1),this.pageCountSubject=new b.Subject,this.printSubject=new b.Subject,this.downloadSubject=new b.Subject,this.setCurrentPageSubject=new b.Subject,this.setCurrentPageInputValueSubject=new b.Subject,this.changePageByDeltaSubject=new b.Subject,this.showCommentSummary=new b.BehaviorSubject(!1),this.grabNDrag=new b.BehaviorSubject(!1),this.saveRotationSubject=new b.Subject,this.redactionMode=new b.BehaviorSubject(!1),this.redactionPreview=new b.Subject,this.applyRedactToDocument=new b.Subject,this.clearAllRedactMarkers=new b.Subject,this.sidebarOpen=new b.BehaviorSubject(!1),this.searchBarHidden=new b.BehaviorSubject(!0),this.commentsPanelVisible=new b.BehaviorSubject(!1),this.icp=W}var Z=(Y.prototype.create=function(t){var e=new n.PDFFindController({linkService:this.linkService,eventBus:this.eventBus}),e=new n.PDFViewer({container:t.nativeElement,linkService:this.linkService,findController:e,eventBus:this.eventBus,imageResourcesPath:"/assets/images/",textLayerMode:2});return this.linkService.setViewer(e),this.pdfJsWrapper=new A(e,new n.DownloadManager({}),this.toolbarEvents,new b.Subject,new b.Subject,new b.Subject,new b.Subject,new b.Subject,new b.Subject,new b.Subject),this.pdfJsWrapper},Y.prototype.pdfWrapper=function(){return this.pdfJsWrapper},Y.decorators=[{type:E.Injectable,args:[{providedIn:"root"}]}],Y.ctorParameters=function(){return[{type:q}]},Y.ngInjectableDef=E.defineInjectable({factory:function(){return new Y(E.inject(q))},token:Y,providedIn:"root"}),Y);function Y(t){this.toolbarEvents=t,this.linkService=new n.PDFLinkService,this.eventBus=new n.EventBus}var X=(K.prototype.printDocumentNatively=function(t){window.open(t).print()},K.prototype.printElementNatively=function(t,e,n){n=window.open("","","left=0,top=0,width="+e+",height="+n+",toolbar=0,scrollbars=0,status=0");n.document.write(t.innerHTML),n.document.close(),n.focus(),n.print(),n.close()},K.decorators=[{type:E.Injectable,args:[{providedIn:"root"}]}],K.ngInjectableDef=E.defineInjectable({factory:function(){return new K},token:K,providedIn:"root"}),K);function K(){}var J={SUCCESS:"SUCCESS",FAILURE:"FAILURE",UNSUPPORTED:"UNSUPPORTED"},Q=function(t,e){this.exceptionType=t,this.detail=e},tt=(et.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]},et.decorators=[{type:E.Injectable,args:[{providedIn:"root"}]}],et.ngInjectableDef=E.defineInjectable({factory:function(){return new et},token:et,providedIn:"root"}),et);function et(){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}var nt={showPrint:!0,showDownload:!0,showNavigation:!0,showZoom:!0,showRotate:!0,showSearchBar:!0,showSidebar:!0,showGrabNDragButton:!0,showCommentSummary:!0,showPresentationMode:!0,showRedact:!0},ot={showPrint:!0,showDownload:!0,showZoom:!0,showRotate:!0,showGrabNDragButton:!0,showCommentSummary:!0,showRedact:!0},it={showDownload:!0},at={showDownload:!0,showPrint:!0},rt="[Document] Set Document Id",st="[Document] Position Updated",ct="[Document] Add Pages",lt="[Document] Convert",ut="[Document] Convert Success",pt="[Document] Convert Fail",dt="[Document] Clear Convert Doc Url",ht="[Document] Load Rotation",mt="[Document] Load Rotation Success",gt="[Document] Load Rotation Fail",bt="[Document] Save Rotation",ft="[Document] Save Rotation Success",vt=function(t){this.payload=t,this.type=rt},yt=function(t){this.payload=t,this.type=ct},wt=function(t){this.payload=t,this.type=st},kt=function(t){this.payload=t,this.type=lt},St=function(t){this.payload=t,this.type=ut},Et=function(t){this.payload=t,this.type=pt},Ct=function(){this.type=dt},It=function(t){this.payload=t,this.type=ht},Pt=function(t){this.payload=t,this.type=mt},xt=function(t){this.payload=t,this.type=gt},_t=function(t){this.payload=t,this.type=bt},Tt=function(t){this.payload=t,this.type=ft},Dt=function(t){this.payload=t,this.type="[Document] Save Rotation Fail"},Bt="[Tags] Add Filter Tags",Rt="[Tags] Clear Filter Tags",Ot=function(t){this.payload=t,this.type=Bt},Mt=function(){this.type=Rt},At="[Icp] Set Case Id",Nt="[Icp] Load Session",jt="[Icp] Join Socket Session",Ft="[Icp] Socket Session Joined",Lt="[Icp] Leave Socket Session",Ht="[Icp] Presenter Updated",$t="[Icp] Participant List Updated",Vt=function(t){this.payload=t,this.type=At},Ut=function(t){this.payload=t,this.type=Nt},zt=function(t){this.payload=t,this.type="[Icp] Load Session Failure"},Wt=function(t){this.payload=t,this.type=jt},qt=function(t){this.payload=t,this.type=Ft},Gt=function(){this.type=Lt},Zt=function(t){this.payload=t,this.type=Ht},Yt=function(t){this.payload=t,this.type=$t},Xt={convertedDocument:undefined,documentId:undefined,pdfPosition:undefined,pages:{},hasDifferentPageSize:!1,rotation:undefined,rotationLoaded:!1,loading:!1,loaded:!1};function Kt(t,e){switch(void 0===t&&(t=Xt),e.type){case ut:var n={url:e.payload,error:undefined};return P({},t,{convertedDocument:n});case pt:n={url:undefined,error:e.payload};return P({},t,{convertedDocument:n});case dt:n=undefined;return P({},t,{convertedDocument:n});case ht:return P({},t,{rotationLoaded:!1});case mt:var o=(i=e.payload)?i.rotationAngle:0;return P({},t,{rotation:o,rotationLoaded:!0});case gt:return P({},t,{rotation:0,rotationLoaded:!0});case ft:var i,o=(i=e.payload).rotationAngle;return P({},t,{rotation:o});case rt:return P({},t,{documentId:e.payload});case ct: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({},c,((e={})[t.id]=n,e))}),P({},t,{pages:c,hasDifferentPageSize:l});case st:s=e.payload;return P({},t,{pdfPosition:s})}return t}var Jt=function(t){return t.pages},Qt="[Annotations] Load Annotation Set",te="[Annotations] Load Annotation Set Success",ee="[Annotations] Load Annotation Set Fail",ne="[Annotations] Save Annotation",oe="[Annotations] Save Annotation Success",ie="[Annotations] Save Annotation Fail",ae="[Annotations] Add or Edit Comment",re="[Annotations] Delete Annotation",se="[Annotations] Delete Annotation Success",ce="[Annotations] Delete Annotation Fail",le="[Annotations] Select Annotation",ue="[Comments] Search Comments",pe="[Comments] Apply Comment Summary Filter",de="[Comments] Clear Comment Summary Filter",he=function(t){this.payload=t,this.type=Qt},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=re},ke=function(t){this.payload=t,this.type=se},Se=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},Pe=function(){this.type=de},xe=(_e.groupByKeyEntities=function(t,o){return t.reduce(function(t,e){var n;return Object.assign(t,((n={})[e[o]]=(t[e[o]]||[]).concat(e),n))},{})},_e.generateCommentsEntities=function(t){return t.reduce(function(t,e){var n;if(e.comments.length){var o=P({},e.comments[0]||"",{tags:O(e.tags||[])});return P({},t,((n={})[e.id]=o,n))}return P({},t)},{})},_e.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({},t,e)},{});return this.genNameEnt(t,n)},_e.genNameEnt=function(o,t){return Object.keys(t).reduce(function(t,e){var n=o.filter(function(t){return t.tags.find(function(t){return t.name===e})}).map(function(t){return t.id}).reduce(function(t,e){return P({},t,((t={})[e]=e,t))},{});return P({},t,((t={})[e]=n,t))},{})},_e.generateAnnotationEntities=function(t){return t.reduce(function(t,e){var n=P({},e,{positionTop:e.rectangles[0].y});return P({},t,((t={})[e.id]=n,t))},{})},_e.generateRedactionEntities=function(t){return t.reduce(function(t,e){return P({},t,((t={})[e.redactionId]=e,t))},{})},_e.resetCommentEntSelect=function(n){return Object.keys(n).reduce(function(t,e){return t[e]=P({},n[e],{editable:!1,selected:!1}),t},{})},_e.filterCommentsSummary=function(t,r){if(Object.keys(r).length){var e=Object.keys(r.tagFilters).filter(function(t){return!0===r.tagFilters[t]}).length,s=r.dateRangeFrom||r.dateRangeTo,n=t.filter(function(t){var e,n,o,i=!1,a=!1;return r.hasOwnProperty("tagFilters")&&Object.keys(r.tagFilters).forEach(function(e){if(r.tagFilters[e])return t.tags.forEach(function(t){t.name!==e||i||(i=!0)})}),s&&(e=c(t.lastModifiedDate),n=null!==r.dateRangeFrom?c(r.dateRangeFrom):undefined,(o=null!==r.dateRangeTo?c(r.dateRangeTo):undefined)&&n&&n<e&&e<o&&(a=!0),o&&!n&&e<=o&&(a=!0),n&&!o&&n<e&&(a=!0)),i||a});return e||s?n:t}return t},_e);function _e(){}var Te={annotationSet:{},annotationEntities:{},commentEntities:{},annotationPageEntities:{},selectedAnnotation:null,commentSearchQueries:{commentSearch:""},commentSummaryFilters:{hasFilter:!1,filters:{}},loading:!1,loaded:!1};function De(t,e){var n;switch(void 0===t&&(t=Te),e.type){case Qt:var o=P({},t.annotationSet,{documentId:e.payload});return P({},Te,{annotationSet:o,loading:!0});case te:case ee:var o=200===e.payload.status?e.payload.body:P({},t.annotationSet,{annotations:[],id:f()}),i=xe.generateAnnotationEntities(o.annotations),a=xe.groupByKeyEntities(o.annotations,"page"),r=xe.generateCommentsEntities(o.annotations);return P({},t,{annotationSet:o,annotationEntities:i,annotationPageEntities:a,commentEntities:r,loading:!1,loaded:!0});case oe:var s=e.payload,c=P({},t.annotationEntities,((u={})[s.id]=s,u)),l=Object.keys(c).map(function(t){return c[t]}),i=xe.generateAnnotationEntities(l),a=xe.groupByKeyEntities(l,"page"),r=xe.generateCommentsEntities(l),u=P({},t.selectedAnnotation,{annotationId:s.id,editable:!1});return P({},t,{annotationEntities:i,annotationPageEntities:a,commentEntities:r,selectedAnnotation:u,loading:!1,loaded:!0});case se:var p=e.payload,l=t.annotationEntities[p].page;delete(i=P({},t.annotationEntities))[p];s=O(t.annotationPageEntities[l].filter(function(t){return t.id!==p})),a=P({},t.annotationPageEntities,((u={})[l]=s,u)),r=P({},t.commentEntities);return t.commentEntities[p]&&delete r[p],P({},t,{annotationEntities:i,annotationPageEntities:a,commentEntities:r});case ae:var d=((m={})[e.payload.annotationId]=e.payload,m),h=P({},t.commentEntities,d);return P({},t,{commentEntities:h});case le:var a=e.payload,m=P({},t.commentEntities[a.annotationId],{editable:a.editable,selected:a.selected}),d=xe.resetCommentEntSelect(P({},t.commentEntities)),r=a.annotationId&&t.commentEntities[a.annotationId]?P({},d,((h={})[a.annotationId]=m,h)):P({},d);return P({},t,{commentEntities:r,selectedAnnotation:e.payload});case ue:var g=P({},t.commentSearchQueries,{commentSearch:e.payload}),r=xe.resetCommentEntSelect(P({},t.commentEntities));return P({},t,{commentEntities:r,commentSearchQueries:g});case pe:var b=e.payload,g=(n=!1,b.tagFilters&&Object.keys(b.tagFilters).map(function(t){b.tagFilters[t]&&!n&&(n=!0)}),n||!!b.dateRangeFrom||!!b.dateRangeTo);return P({},t,{commentSummaryFilters:{hasFilter:g,filters:b}});case de:return P({},t,{commentSummaryFilters:P({},Te.commentSummaryFilters)})}return t}var Be=function(t){return t.annotationSet},Re=function(t){return t.commentEntities},Oe=function(t){return t.annotationPageEntities},Me=function(t){return t.annotationEntities},Ae=function(t){return t.selectedAnnotation},Ne=function(t){return t.commentSearchQueries},je=function(t){return t.commentSummaryFilters},Fe={tagNameEnt:{},annotations:[],filteredPageEntities:{},filteredComments:{},formFilterState:{},filters:[]};function Le(n,t){switch(void 0===n&&(n=Fe),t.type){case Qt:return P({},n,Fe);case te:var e=t.payload.body.annotations,o=xe.genTagNameEntities(e);return P({},n,{tagNameEnt:o,annotations:e});case oe:var i=t.payload,a=O(n.annotations).filter(function(t){return t.id!==i.id})||[],e=O(a,[i]),o=xe.genTagNameEntities(e);return P({},n,{annotations:e,tagNameEnt:o});case se:var r=t.payload,e=O(n.annotations).filter(function(t){return t.id!==r}),o=xe.genTagNameEntities(e),s=xe.groupByKeyEntities(e,"page");return delete(l=P({},n.filteredComments))[r],P({},n,{annotations:e,tagNameEnt:o,filteredComments:l,filteredPageEntities:s,filters:[]});case Bt:var c=t.payload,o=Object.keys(c).reduce(function(t,e){return c[e]?O(t,[e]):t},[]),l=o.reduce(function(t,e){return P({},t,n.tagNameEnt[e])},{}),e=Object.keys(l).map(function(e){return n.annotations.filter(function(t){return t.id===e})[0]}),s=xe.groupByKeyEntities(e,"page");return P({},n,{filters:o,filteredComments:l,filteredPageEntities:s});case Rt:return P({},n,{filters:[],filteredComments:{},filteredPageEntities:{}})}return n}var He=function(t){return t.filteredComments},$e=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",Ye="[Bookmarks] Move Bookmark",Xe="[Bookmarks] Move Bookmark Success",Ke="[Bookmarks] Update Bookmark",Je="[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"},rn=function(t){this.payload=t,this.type=Ge},sn=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=Ye},un=function(t){this.payload=t,this.type=Xe},pn=function(t){this.payload=t,this.type="[Bookmarks] Move Bookmark Failure"},dn=function(t){this.payload=t,this.type=Ke},hn=function(t){this.payload=t,this.type=Je},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&&0<e.children.length?O(t,[e.id],gn(e.children)):O(t,[e.id])},[]):[]},bn=function(t){return t.reduce(function(t,e){return Object.assign(t,((t={})[e.id]=e,t))},{})},fn=function(o){for(var i=Object.keys(o),t=0;0<i.length;t++)!function(e){var n=[];i.forEach(function(t){o[t].previous&&i.includes(o[t].previous.toString())||(o[t].index=e,n.push(t))}),n.forEach(function(t){return i.splice(i.indexOf(t),1)}),n=[]}(t)},vn={bookmarks:[],bookmarkEntities:{},bookmarkPageEntities:{},editableBookmark:undefined,loaded:!1,loading:!1};function yn(t,e){switch(void 0===t&&(t=vn),e.type){case Ve:return P({},t,{loading:!0});case Ue:case ze:var n=200===e.payload.status?e.payload.body:[],o=bn(n),i=xe.groupByKeyEntities(n,"pageNumber");return P({},t,{bookmarks:n,bookmarkEntities:o,bookmarkPageEntities:i,loaded:!0});case qe:var a=e.payload,r=P({},t.bookmarkEntities,((l={})[a.id]=a,l)),s=Object.keys(r).map(function(t){return r[t]}),i=xe.groupByKeyEntities(s,"pageNumber"),c=a.id;return P({},t,{bookmarkEntities:r,editableBookmark:c,bookmarkPageEntities:i,loading:!1,loaded:!0});case Xe:var l=bn(e.payload),o=P({},t.bookmarkEntities,l);return P({},t,{bookmarkEntities:o,loading:!1,loaded:!0});case Ze:var u=e.payload,p=P({},t.bookmarkEntities),d=P({},t.bookmarkPageEntities),h={};return u.forEach(function(t){h[p[t].pageNumber]!==undefined&&0<h[p[t].pageNumber].length?h[p[t].pageNumber].push(t):h[p[t].pageNumber]=[t],delete p[t]}),Object.entries(h).forEach(function(t){var e=R(t,2),t=e[0],n=e[1];d[t]=d[t].filter(function(t){return n.includes(t)})}),P({},t,{bookmarkEntities:p,bookmarkPageEntities:d,loading:!1,loaded:!0});case Je:var a=e.payload,m=P({},t.bookmarkEntities,((u={})[a.id]=P({},a),u)),s=Object.keys(m).map(function(t){return m[t]}),i=xe.groupByKeyEntities(s,"pageNumber"),c=undefined;return P({},t,{bookmarkEntities:m,editableBookmark:c,bookmarkPageEntities:i,loading:!1,loaded:!0})}return t}var wn="[Redaction] Load Redaction",kn="[Redaction] Load Redaction Success",Sn="[Redaction] Save Redaction",En="[Redaction] Save Redaction Success",Cn="[Redaction] Delete Redaction",In="[Redaction] Delete Redaction Success",Pn="[Redaction] Select Redaction",xn="[Redaction] Redact",_n="[Redaction] Redact Success",Tn="[Redaction] Reset Redacted Document",Dn="[Redaction] Unmark All",Bn="[Redaction] Unmark All Success",Rn=function(t){this.payload=t,this.type=wn},On=function(t){this.payload=t,this.type=kn},Mn=function(t){this.payload=t,this.type="[Redaction] Load Redaction Fail"},An=function(t){this.payload=t,this.type=Sn},Nn=function(t){this.payload=t,this.type=En},jn=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},Hn=function(t){this.payload=t,this.type="[Redaction] Delete Redaction Fail"},$n=function(t){this.payload=t,this.type=Pn},Vn=function(t){this.payload=t,this.type=xn},Un=function(t){this.payload=t,this.type=_n},zn=function(t){this.payload=t,this.type="[Redaction] Redact Fail"},Wn=function(){this.type=Tn},qn=function(t){this.payload=t,this.type=Dn},Gn=function(){this.type=Bn},Zn={redactionEntities:{},redactionPageEntities:{},selectedRedaction:{},redactedDocumentInfo:undefined,documentId:undefined};function Yn(t,e){switch(void 0===t&&(t=Zn),e.type){case wn:return P({},t,Zn);case kn:if(i=e.payload){var n=xe.generateRedactionEntities(i),o=xe.groupByKeyEntities(i,"page");return P({},t,{redactionEntities:n,redactionPageEntities:o})}return P({},t);case En:var i=e.payload,a=P({},t.redactionEntities,((c={})[i.redactionId]=i,c)),r=Object.keys(a).map(function(t){return a[t]}),o=xe.groupByKeyEntities(r,"page");return P({},t,{redactionEntities:a,redactionPageEntities:o});case Pn:case le:return P({},t,{selectedRedaction:e.payload});case In:var i=e.payload.page,s=e.payload.redactionId;delete(n=P({},t.redactionEntities))[s];var c=O(t.redactionPageEntities[i].filter(function(t){return t.redactionId!==s})),o=P({},t.redactionPageEntities,((r={})[i]=c,r));return P({},t,{redactionPageEntities:o,redactionEntities:n});case _n:n=e.payload;return P({},t,Zn,{redactedDocumentInfo:n});case Tn:return P({},t,{redactedDocumentInfo:undefined});case Bn:return P({},t,Zn)}return t}var Xn={session:null,presenter:null,client:null,participants:[]};function Kn(t,e){switch(void 0===t&&(t=Xn),e.type){case At:var n=e.payload,o=P({},t.session,{caseId:n});return P({},t,{session:o});case Ft:o=e.payload.session,n=e.payload.participantInfo;return P({},t,{session:o,client:n.client,presenter:n.presenter});case $t:var i=e.payload,a=Object.keys(i).map(function(t){return{id:t,username:i[t]}});return P({},t,{participants:a});case Ht:a=e.payload;return P({},t,{presenter:a});case Lt:return P({},t,Xn)}return t}var Jn={document:Kt,annotations:De,tags:Le,bookmarks:yn,redactions:Yn,icp:Kn},Qn=S.createFeatureSelector("media-viewer"),to=S.createSelector(Qn,function(t){return t.document}),eo=S.createSelector(to,Jt),no=(S.createSelector(eo,function(t){return Object.values(t)}),S.createSelector(to,function(t){return t.documentId})),oo=S.createSelector(to,function(t){return t.pdfPosition}),io=S.createSelector(to,function(t){return t.hasDifferentPageSize}),ao=S.createSelector(to,function(t){return t.convertedDocument}),ro=S.createSelector(to,function(t){return t.rotation}),so=S.createSelector(to,function(t){return t.rotationLoaded}),co=(lo.prototype.textSelected=function(t){this.textHighlight.next(t)},lo.prototype.boxSelected=function(t){this.boxHighlight.next(t)},lo.prototype.clearCtxToolbar=function(){this.ctxToolbarCleared.next()},lo.prototype.goToDestination=function(t){this.navigationEvent.next(t)},lo.decorators=[{type:E.Injectable,args:[{providedIn:"root"}]}],lo.ctorParameters=function(){return[]},lo.ngInjectableDef=E.defineInjectable({factory:function(){return new lo},token:lo,providedIn:"root"}),lo);function lo(){this.textHighlight=new b.Subject,this.boxHighlight=new b.Subject,this.ctxToolbarCleared=new b.Subject,this.navigationEvent=new b.Subject}var uo=(po.prototype.ngAfterContentInit=function(){return T(this,void 0,void 0,function(){var e=this;return D(this,function(t){return this.pdfWrapper.documentLoadProgress.subscribe(function(t){return e.onDocumentLoadProgress(t)}),this.pdfWrapper.documentLoaded.subscribe(function(){return e.onDocumentLoaded()}),this.pdfWrapper.documentLoadFailed.subscribe(function(t){return e.onDocumentLoadFailed(t)}),this.pdfWrapper.outlineLoaded.subscribe(function(t){return e.documentOutline=t}),this.pdfWrapper.pageRendered.subscribe(function(t){return e.updatePages(t)}),this.$subscription=this.toolbarEvents.printSubject.subscribe(function(){return e.printService.printDocumentNatively(e.url)}),this.$subscription.add(this.toolbarEvents.downloadSubject.subscribe(function(){return e.pdfWrapper.downloadFile(e.downloadUrl||e.url,e.downloadFileName)})),this.$subscription.add(this.toolbarEvents.rotateSubject.subscribe(function(t){return e.rotateDocument(t)})),this.$subscription.add(this.toolbarEvents.zoomSubject.subscribe(function(t){return e.setZoom(t)})),this.$subscription.add(this.toolbarEvents.stepZoomSubject.subscribe(function(t){return e.stepZoom(t)})),this.$subscription.add(this.toolbarEvents.searchSubject.subscribe(function(t){return e.pdfWrapper.search(t)})),this.$subscription.add(this.toolbarEvents.setCurrentPageSubject.subscribe(function(t){return e.pdfWrapper.setPageNumber(t)})),this.$subscription.add(this.toolbarEvents.changePageByDeltaSubject.subscribe(function(t){return e.pdfWrapper.changePageNumber(t)})),this.$subscription.add(this.toolbarEvents.grabNDrag.subscribe(function(t){return e.enableGrabNDrag=t})),this.$subscription.add(this.toolbarEvents.commentsPanelVisible.subscribe(function(t){e.showCommentsPanel=t})),this.$subscription.add(this.viewerEvents.navigationEvent.subscribe(function(t){return e.goToDestination(t)})),this.$subscription.add(this.toolbarEvents.icp.participantsListVisible.subscribe(function(t){return e.showIcpParticipantsList=t})),this.$subscription.add(this.pdfWrapper.positionUpdated.asObservable().pipe(w.throttleTime(500,b.asyncScheduler,{leading:!0,trailing:!0})).subscribe(function(t){return e.store.dispatch(new wt(t.location))})),[2]})})},po.prototype.ngOnChanges=function(n){return T(this,void 0,void 0,function(){var e=this;return D(this,function(t){switch(t.label){case 0:return this.pdfWrapper||(this.pdfWrapper=this.pdfJsWrapperFactory.create(this.viewerContainer)),n.url&&this.pdfWrapper?[4,this.loadDocument()]:[3,2];case 1:t.sent(),this.enableRedactions&&this.toolbarEvents.redactionMode.pipe(w.filter(function(t){return!!t})).subscribe(function(){return e.resetRotation()}),t.label=2;case 2:return n.caseId&&this.icpStore.dispatch(new Vt(this.caseId)),[2]}})})},po.prototype.resetRotation=function(){this.hasDifferentPageSize&&(this.pdfWrapper.resetRotation(0),this.rotation=0)},po.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},po.prototype.loadDocument=function(){return T(this,void 0,void 0,function(){var e=this;return D(this,function(t){switch(t.label){case 0:return this.initDocumentProgress(),[4,this.pdfWrapper.loadDocument(this.url)];case 1:return t.sent(),this.documentTitle.emit(this.pdfWrapper.getCurrentPDFTitle()),this.setPageHeights(),this.$subscription.add(this.store.pipe(S.select(io)).subscribe(function(t){return e.hasDifferentPageSize=t})),[2]}})})},po.prototype.onDocumentLoadProgress=function(t){t.total&&(this.loadingDocumentProgress=Math.min(100,Math.ceil(t.loaded/t.total*100)))},po.prototype.onDocumentLoaded=function(){this.loadingDocument=!1,this.mediaLoadStatus.emit(J.SUCCESS)},po.prototype.onDocumentLoadFailed=function(t){this.loadingDocument=!1,this.viewerException=new Q(t.name,{message:t.message}),this.errorMessage='Could not load the document "'+this.url+'"',this.mediaLoadStatus.emit(J.FAILURE),this.pdfViewerException.emit(this.viewerException)},po.prototype.updatePages=function(t){this.enableAnnotations&&this.store.dispatch(new yt(t))},Object.defineProperty(po.prototype,"searchBarHidden",{set:function(t){this.pdfWrapper&&t&&this.pdfWrapper.clearSearch()},enumerable:!0,configurable:!0}),po.prototype.toggleCommentsSummary=function(){this.toolbarEvents.toggleCommentsSummary(!this.toolbarEvents.showCommentSummary.getValue())},po.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()},po.prototype.initDocumentProgress=function(){this.loadingDocument=!0,this.loadingDocumentProgress=null,this.errorMessage=null},po.prototype.setZoom=function(t){isNaN(t)||(this.pdfWrapper.setZoom(t),this.zoom=this.calculateZoomValue(t),this.setPageHeights())},po.prototype.stepZoom=function(t){isNaN(t)||(this.pdfWrapper.stepZoom(t),this.zoom=this.calculateZoomValue(this.zoom,t),this.setPageHeights())},po.prototype.setPageHeights=function(){this.pageHeights=[];for(var t=this.pdfViewer.nativeElement.children,e=0;e<t.length;e++)this.pageHeights.push(t[e].clientHeight)},po.prototype.calculateZoomValue=function(t,e){e=t+(e=void 0===e?0:e);return 5<e?5:e<.1?.1:+e.toFixed(2)},po.prototype.goToDestination=function(t){this.pdfWrapper.navigateTo(t)},po.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}]}],po.ctorParameters=function(){return[{type:S.Store},{type:S.Store},{type:Z},{type:X},{type:q},{type:co},{type:tt}]},po.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"]}],pdfViewer:[{type:E.ViewChild,args:["pdfViewer"]}],searchBarHidden:[{type:E.Input}]},po);function po(t,e,n,o,i,a,r){var s=this;this.store=t,this.icpStore=e,this.pdfJsWrapperFactory=n,this.printService=o,this.toolbarEvents=i,this.viewerEvents=a,this.toolbarButtons=r,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=i.highlightModeSubject.pipe(w.tap(function(){s.store.dispatch(new Mt)})),this.drawMode=i.drawModeSubject}var ho=(mo.prototype.validateFile=function(t){return this.http.head(t)},mo.decorators=[{type:E.Injectable,args:[{providedIn:"root"}]}],mo.ctorParameters=function(){return[{type:m.HttpClient}]},mo.ngInjectableDef=E.defineInjectable({factory:function(){return new mo(E.inject(m.HttpClient))},token:mo,providedIn:"root"}),mo);function mo(t){this.http=t}var go=(bo.prototype.ngOnInit=function(){var e=this;this.subscriptions.push(this.toolbarEvents.rotateSubject.subscribe(function(t){return e.rotateImage(t)}),this.toolbarEvents.zoomSubject.subscribe(function(t){return e.setZoom(t)}),this.toolbarEvents.stepZoomSubject.subscribe(function(t){return e.stepZoom(t)}),this.toolbarEvents.printSubject.subscribe(function(){return e.printService.printDocumentNatively(e.url)}),this.toolbarEvents.downloadSubject.subscribe(function(){return e.download()}),this.toolbarEvents.grabNDrag.subscribe(function(t){return e.enableGrabNDrag=t}),this.toolbarEvents.commentsPanelVisible.subscribe(function(t){return e.showCommentsPanel=t}))},bo.prototype.ngOnDestroy=function(){this.subscriptions.filter(function(t){return!t.closed}).forEach(function(t){return t.unsubscribe()}),this.response&&this.response.unsubscribe()},bo.prototype.ngOnChanges=function(t){t.url&&(this.errorMessage=null,this.toolbarEvents.reset())},bo.prototype.rotateImage=function(t){this.rotation=(this.rotation+t)%360,this.initAnnoPage(this.img.nativeElement)},bo.prototype.setZoom=function(e){return T(this,void 0,void 0,function(){return D(this,function(t){switch(t.label){case 0:return isNaN(e)?[3,2]:[4,this.setZoomValue(this.calculateZoomValue(e))];case 1:t.sent(),this.img.nativeElement.width=this.img.nativeElement.naturalWidth*this.zoom,this.initAnnoPage(this.img.nativeElement),t.label=2;case 2:return[2]}})})},bo.prototype.stepZoom=function(e){return T(this,void 0,void 0,function(){return D(this,function(t){switch(t.label){case 0:return isNaN(e)?[3,2]:[4,this.setZoomValue(this.calculateZoomValue(this.zoom,e))];case 1:t.sent(),this.img.nativeElement.width=this.img.nativeElement.naturalWidth*this.zoom,this.initAnnoPage(this.img.nativeElement),t.label=2;case 2:return[2]}})})},bo.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()},bo.prototype.setZoomValue=function(e){var n=this;return new Promise(function(t){n.zoom=e,n.toolbarEvents.zoomValueSubject.next(e),t(!0)})},bo.prototype.calculateZoomValue=function(t,e){e=t+(e=void 0===e?0:e);return 5<e?5:e<.1?.1:+e.toFixed(2)},bo.prototype.onLoadError=function(t){var e=this;this.response=this.viewerUtilService.validateFile(t).subscribe(function(t){return t},function(t){e.viewerException=new Q(t.name,{httpResponseCode:t.status,message:t.message})}),this.errorMessage='Could not load the image "'+this.url+'"',this.mediaLoadStatus.emit(J.FAILURE),this.imageViewerException.emit(this.viewerException)},bo.prototype.onLoad=function(t){this.mediaLoadStatus.emit(J.SUCCESS),this.initAnnoPage(t)},bo.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;t=[{div:{scrollHeight:this.imageHeight,scrollWidth:this.imageWidth,offsetLeft:this.imageLeft},pageNumber:1,scale:this.zoom,rotation:this.rotation,id:1}];this.store.dispatch(new yt(t))},bo.prototype.toggleCommentsSummary=function(){this.toolbarEvents.toggleCommentsSummary(!this.toolbarEvents.showCommentSummary.getValue())},bo.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'}]}],bo.ctorParameters=function(){return[{type:S.Store},{type:X},{type:ho},{type:q},{type:tt}]},bo.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"]}]},bo);function bo(t,e,n,o,i){this.store=t,this.printService=e,this.viewerUtilService=n,this.toolbarEvents=o,this.toolbarButtons=i,this.mediaLoadStatus=new E.EventEmitter,this.imageViewerException=new E.EventEmitter,this.rotation=0,this.zoom=1,this.subscriptions=[],this.enableGrabNDrag=!1}var fo=(vo.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 Q(t.name,{httpResponseCode:t.status,message:t.message})})),this.loadStatus.emit(J.UNSUPPORTED),this.typeException||this.unsupportedViewerException.emit(this.viewerException)},vo.prototype.ngOnDestroy=function(){var t,e;try{for(var n=B(this.subscriptions),o=n.next();!o.done;o=n.next())o.value.unsubscribe()}catch(i){t={error:i}}finally{try{o&&!o.done&&(e=n["return"])&&e.call(n)}finally{if(t)throw t.error}}},vo.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'}]}],vo.ctorParameters=function(){return[{type:q},{type:ho}]},vo.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"]}]},vo);function vo(t,e){this.toolbarEvents=t,this.viewerUtilService=e,this.loadStatus=new E.EventEmitter,this.unsupportedViewerException=new E.EventEmitter,this.subscriptions=[]}var yo=(wo.prototype.getAnnotationSet=function(t){t=this.annotationSetsFullUrl+"/filter?documentId="+t;return this.httpClient.get(t,{observe:"response",withCredentials:!0})},wo.prototype.postAnnotationSet=function(t){return this.httpClient.post(this.annotationSetsFullUrl,t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}),w.catchError(function(){return[]}))},wo.prototype.getComments=function(t){return t.pipe(w.map(this.sortAnnotations),w.map(this.extractComments))},wo.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})},wo.prototype.extractComments=function(t){return[].concat.apply([],O(t.map(function(t){return t.comments})))},wo.prototype.deleteAnnotation=function(t){t=this.annotationFullsUrl+"/"+t;return this.httpClient["delete"](t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},wo.prototype.postAnnotation=function(t){return this.httpClient.post(this.annotationFullsUrl,t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},Object.defineProperty(wo.prototype,"annotationSetsFullUrl",{get:function(){return this.annotationApiUrl+this.annotationSetBaseUrl},enumerable:!0,configurable:!0}),Object.defineProperty(wo.prototype,"annotationFullsUrl",{get:function(){return this.annotationApiUrl+this.annotationBaseUrl},enumerable:!0,configurable:!0}),wo.decorators=[{type:E.Injectable}],wo.ctorParameters=function(){return[{type:m.HttpClient}]},wo);function wo(t){this.httpClient=t,this.annotationApiUrl="/em-anno",this.annotationSetBaseUrl="/annotation-sets",this.annotationBaseUrl="/annotations"}var ko=(So.prototype.setCommentSet=function(t){this.commentSetComponent=t},So.prototype.onCommentChange=function(t){this.unsavedChanges.next(t)},So.prototype.getUnsavedChanges=function(){return this.unsavedChanges.asObservable()},So.prototype.hasUnsavedComments=function(t){return 0<t.comments.length&&this.getComment(t).hasUnsavedChanges},So.prototype.updateUnsavedCommentsStatus=function(t,e){this.getComment(t).hasUnsavedChanges=e,this.allCommentsSaved()},So.prototype.getComment=function(e){return this.commentSetComponent.commentComponents.find(function(t){return t.comment.annotationId===e.comments[0].annotationId})},So.prototype.resetCommentSet=function(){this.commentSetComponent=null},So.prototype.allCommentsSaved=function(){this.onCommentChange(this.commentSetComponent.commentComponents.some(function(t){return!0===t.hasUnsavedChanges}))},So.decorators=[{type:E.Injectable}],So);function So(){this.unsavedChanges=new b.Subject}var Eo=S.createSelector(Qn,function(t){return t.tags}),Co=S.createSelector(Eo,function(t){return t.tagNameEnt}),Io=S.createSelector(Eo,function(t){return t.filters}),Po=S.createSelector(Eo,He),xo=S.createSelector(Eo,$e),_o=S.createSelector(Co,function(e){return Object.keys(e).map(function(t){return{key:t,length:Object.keys(e[t]).length}})}),To=S.createSelector(Qn,function(t){return t.annotations}),Do=S.createSelector(To,Me),Bo=S.createSelector(To,Be),Ro=S.createSelector(Bo,function(t){return{documentId:t.documentId,annotationSetId:t.id}}),Oo=S.createSelector(Do,Bo,function(e,t){return P({},t,{annotations:Object.keys(e).map(function(t){return e[t]})})}),Mo=S.createSelector(To,Ae),Ao=S.createSelector(To,Re),No=S.createSelector(To,Oe),jo=S.createSelector(To,Ne),Fo=S.createSelector(jo,function(t){return t.commentSearch}),Lo=S.createSelector(To,je),Ho=S.createSelector(eo,No,xo,function(e,t,n){var o=!!Object.keys(n).length?n:t;if(e){var i=[];return Object.keys(e).forEach(function(t){i.push({anno:o[t]||[],styles:e[t].styles})}),i}}),$o=S.createSelector(Ao,eo,Do,Po,function(n,o,i,t){if(n&&i&&o[1]){var e=!!Object.keys(t).length;return Object.keys(e?t:n).map(function(t){var e=i[t].page;return P({},n[t],{page:e,pages:o})})}}),Vo=S.createSelector($o,Lo,function(t,e){e=xe.filterCommentsSummary(t=void 0===t?[]:t,e.filters);return e.length?e.map(function(t){return{page:t.page,user:t.createdByDetails.forename.concat(" ").concat(t.createdByDetails.surname),date:c(t.lastModifiedDate).format("D MMMM YYYY"),tags:t.tags,comment:t.content}}):[""]}),Uo=S.createSelector(Do,Po,function(e,t){var n=!!Object.keys(t).length;return Object.keys(n?t:e).map(function(t){return e[t]}).filter(function(t){return t.comments&&0<t.comments.length})}),zo={PDF:"pdf",IMAGE:"image"},Wo={MP4:"mp4",MP3:"mp3"},qo={EXCEL:"excel",WORD:"word",POWERPOINT:"powerpoint",TXT:"txt",RTF:"rtf"},Go=(Zo.prototype.ngAfterContentInit=function(){var e=this;this.annotationSet$=this.store.pipe(S.select(Oo)),this.hasDifferentPageSize$=this.store.pipe(S.select(io)),this.setToolbarButtons(),this.toolbarEventsOutput.emit(this.toolbarEvents),this.$subscriptions=this.commentService.getUnsavedChanges().subscribe(function(t){return e.onCommentChange(t)}),this.$subscriptions.add(this.toolbarEvents.getShowCommentSummary().subscribe(function(t){return e.showCommentSummary=t}))},Zo.prototype.ngAfterViewChecked=function(){if(this.height&&this.viewerHeight!==this.height)return this.viewerHeight=this.height,void this.cdr.detectChanges();var t;this.height||(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()))},Zo.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 vt(this.documentId)),!this.enableAnnotations||this.multimediaContent||this.unsupportedContent||this.store.dispatch(new he(this.documentId)),!this.enableRedactions||this.multimediaContent||this.unsupportedContent||this.store.dispatch(new Rn(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},Zo.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},Zo.prototype.needsConverting=function(){return null!==this.contentType&&Object.keys(qo).includes(this.contentType.toUpperCase())},Zo.prototype.isMultimedia=function(){return null!==this.contentType&&Object.keys(Wo).includes(this.contentType.toUpperCase())},Zo.prototype.isSupported=function(){var t=Object.assign({},Wo,qo,zo);return null!==this.contentType&&Object.keys(t).includes(this.contentType.toUpperCase())},Zo.prototype.onMediaLoad=function(t){this.mediaLoadStatus.emit(t)},Zo.prototype.setToolbarButtons=function(){this.contentType===zo.PDF||this.needsConverting()?this.toolbarButtons.setup(P({},nt,{showHighlightButton:this.enableAnnotations,showDrawButton:this.enableAnnotations},this.toolbarButtonOverrides)):this.contentType===zo.IMAGE?this.toolbarButtons.setup(P({},ot,{showDrawButton:this.enableAnnotations},this.toolbarButtonOverrides)):this.isMultimedia()?this.toolbarButtons.setup(P({},it,this.toolbarButtonOverrides)):this.toolbarButtons.setup(P({},at,this.toolbarButtonOverrides))},Zo.prototype.onLoadException=function(t){this.viewerException.emit(t),this.isSupported()?(this.typeException=!0,this.contentType=null,this.setToolbarButtons()):this.typeException=!1},Zo.prototype.onCommentChange=function(t){this.unsavedChanges.emit(t)},Zo.prototype.onDocumentTitleChange=function(t){this.documentTitle=t},Zo.prototype.extractDMStoreDocId=function(t){return(t=(t=t.includes("/documents/")?t.split("/documents/")[1]:t).includes("/documentsv2/")?t.split("/documentsv2/")[1]:t).replace("/binary","")},Zo.prototype.detectOs=function(){this.hasScrollBar=-1!==window.navigator.userAgent.indexOf("Win")},Zo.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}]}],Zo.ctorParameters=function(){return[{type:S.Store},{type:tt},{type:q},{type:yo},{type:ko},{type:E.ElementRef},{type:E.ChangeDetectorRef}]},Zo.propDecorators={viewerRef:[{type:E.ViewChild,args:["viewerRef"]}],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}]},Zo);function Zo(t,e,n,o,i,a,r){this.store=t,this.toolbarButtons=e,this.toolbarEvents=n,this.api=o,this.commentService=i,this.elRef=a,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&&(o.annotationApiUrl=this.annotationApiUrl)}var Yo=(Xo.prototype.isNumber=function(t){return null!==t&&t!==undefined&&""!==t&&!isNaN(Number(t.toString()))},Xo.decorators=[{type:E.Injectable,args:[{providedIn:"root"}]}],Xo.ctorParameters=function(){return[]},Xo.ngInjectableDef=E.defineInjectable({factory:function(){return new Xo},token:Xo,providedIn:"root"}),Xo);function Xo(){}var Ko=(Jo.prototype.ngOnInit=function(){var e=this;this.subscriptions.push(this.toolbarEvents.setCurrentPageSubject.subscribe(function(t){return e.setCurrentPage(t)}),this.toolbarEvents.setCurrentPageInputValueSubject.subscribe(function(t){return e.pageNumber=t}),this.toolbarEvents.getPageCount().subscribe(function(t){return e.pageCount=t}),this.toolbarEvents.icp.enabled.subscribe(function(t){e.icpEnabled=t,e.icpEnabled&&(e.toolbarEvents.toggleCommentsPanel(!t),e.toolbarEvents.sidebarOpen.next(!1))}),this.toolbarEvents.redactionMode.subscribe(function(t){e.redactionEnabled=t}))},Jo.prototype.ngOnDestroy=function(){var t,e;try{for(var n=B(this.subscriptions),o=n.next();!o.done;o=n.next())o.value.unsubscribe()}catch(i){t={error:i}}finally{try{o&&!o.done&&(e=n["return"])&&e.call(n)}finally{if(t)throw t.error}}},Jo.prototype.ngAfterViewInit=function(){var e=this;Array.from(this.mvToolbarMain.nativeElement.children).forEach(function(t){e.allButtonsWidth+=t.getBoundingClientRect().width,e.widthRequiredForBtn[t.id]=e.allButtonsWidth}),this.cdr.detectChanges()},Jo.prototype.onResize=function(){this.cdr.detectChanges()},Jo.prototype.onClickHighlightToggle=function(){this.toolbarEvents.toggleHighlightMode()},Jo.prototype.onClickDrawToggle=function(){this.toolbarEvents.toggleDrawMode()},Jo.prototype.toggleSideBar=function(){this.toolbarEvents.sidebarOpen.next(!this.toolbarEvents.sidebarOpen.getValue())},Jo.prototype.togglePresentBar=function(){this.toolbarEvents.searchBarHidden.next(!0),this.toolbarEvents.icp.enable()},Jo.prototype.increasePageNumber=function(){this.toolbarEvents.incrementPage(1)},Jo.prototype.decreasePageNumber=function(){this.toolbarEvents.incrementPage(-1)},Jo.prototype.onPageNumberInputChange=function(t){Number(t)<1&&(t="1"),Number(t)>this.pageCount&&(t=this.pageCount.toString()),this.toolbarEvents.setPage(Number.parseInt(t,10))},Jo.prototype.setCurrentPage=function(t){this.pageNumber=t},Jo.prototype.rotate=function(t){this.toolbarEvents.rotate(t)},Jo.prototype.printFile=function(){this.toolbarEvents.print()},Jo.prototype.downloadFile=function(){this.toolbarEvents.download()},Jo.prototype.zoom=function(t){this.toolbarEvents.zoom(+t)},Jo.prototype.stepZoom=function(t){this.toolbarEvents.stepZoom(t),this.zoomSelect.nativeElement.selected="selected"},Jo.prototype.toggleCommentsPanel=function(){this.toolbarEvents.toggleCommentsPanel(!this.toolbarEvents.commentsPanelVisible.getValue())},Jo.prototype.toggleRedactBar=function(){this.toolbarEvents.toggleRedactionMode()},Jo.prototype.toggleGrabNDrag=function(){this.toolbarEvents.toggleGrabNDrag()},Jo.prototype.isPdf=function(){return"pdf"===this.contentType},Jo.prototype.toggleSearchBar=function(){this.toolbarEvents.searchBarHidden.next(!this.toolbarEvents.searchBarHidden.getValue())},Jo.prototype.toggleMoreOptions=function(){var t=this;this.isDropdownMenuOpen=!this.isDropdownMenuOpen,setTimeout(function(){t.mvMenuItems&&t.mvMenuItems.nativeElement.focus()},100)},Jo.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'}]}],Jo.ctorParameters=function(){return[{type:q},{type:tt},{type:E.ChangeDetectorRef},{type:Yo}]},Jo.propDecorators={enableAnnotations:[{type:E.Input}],enableRedactions:[{type:E.Input}],enableICP:[{type:E.Input}],contentType:[{type:E.Input}],zoomSelect:[{type:E.ViewChild,args:["zoomSelect"]}],mvToolbarMain:[{type:E.ViewChild,args:["mvToolbarMain"]}],mvMenuItems:[{type:E.ViewChild,args:["dropdownMenu"]}],onResize:[{type:E.HostListener,args:["window:resize",[]]}]},Jo);function Jo(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 i.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={}}var Qo=(ti.prototype.ngOnInit=function(){var e=this;this.subscriptions.push(this.toolbarEvents.searchResultsCountSubject.subscribe(function(t){return e.setSearchResultsCount(t)}))},ti.prototype.ngOnDestroy=function(){var t,e;try{for(var n=B(this.subscriptions),o=n.next();!o.done;o=n.next())o.value.unsubscribe()}catch(i){t={error:i}}finally{try{o&&!o.done&&(e=n["return"])&&e.call(n)}finally{if(t)throw t.error}}},ti.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))},ti.prototype.searchNext=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!1,reset:!1})},ti.prototype.searchPrev=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!0,reset:!1})},ti.prototype.search=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!1,reset:!0})},ti.prototype.setSearchResultsCount=function(t){this.resultCount=t.total,this.resultsText=0<this.resultCount?"Found "+t.current+" of "+t.total:"No results found"},ti.prototype.onEscapeKeyPress=function(t){this.toolbarEvents.searchBarHidden.next(!0)},ti.prototype.onEnterKeyPress=function(t){this.search()},ti.prototype.toggleAdvancedSearch=function(){this.advancedSearchVisible=!this.advancedSearchVisible},ti.prototype.toggleSearchBar=function(){this.toolbarEvents.searchBarHidden.next(!this.toolbarEvents.searchBarHidden.getValue())},ti.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'}]}],ti.ctorParameters=function(){return[{type:tt},{type:q}]},ti.propDecorators={findInput:[{type:E.ViewChild,args:["findInput"]}],onWindowKeyDown:[{type:E.HostListener,args:["window:keydown",["$event"]]}]},ti);function ti(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}var ei=S.createSelector(Qn,function(t){return t.redactions}),ni=S.createSelector(ei,function(t){return t.redactionPageEntities}),oi=S.createSelector(ei,function(t){return t.selectedRedaction}),ii=S.createSelector(ei,function(t){return t.redactedDocumentInfo}),ai=S.createSelector(ei,function(t){return t.redactionEntities}),ri=S.createSelector(ai,no,function(e,t){return{redactions:Object.keys(e).map(function(t){return e[t]}),documentId:t}}),si=S.createSelector(eo,ni,function(e,n){if(e&&n){var o=[];return Object.keys(e).forEach(function(t){o.push({anno:n[t]||[],styles:e[t].styles})}),o}}),ci=(li.prototype.ngOnInit=function(){var e=this;this.$subscription=this.store.pipe(S.select(ri)).subscribe(function(t){e.hasRedactions=!!t.redactions.length})},li.prototype.toggleTextRedactionMode=function(){this.toolbarEventService.highlightModeSubject.next(!0)},li.prototype.toggleDrawMode=function(){this.toolbarEventService.drawModeSubject.next(!0)},li.prototype.togglePreview=function(){this.preview=!this.preview,this.toolbarEventService.toggleRedactionPreview(this.preview)},li.prototype.unmarkAll=function(){this.toolbarEventService.unmarkAll()},li.prototype.redact=function(){this.toolbarEventService.applyRedactionToDocument()},li.prototype.toggleRedactBar=function(){this.toolbarEventService.toggleRedactionMode()},li.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},li.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'}]}],li.ctorParameters=function(){return[{type:q},{type:tt},{type:S.Store}]},li);function li(t,e,n){this.toolbarEventService=t,this.toolbarButtons=e,this.store=n,this.preview=!1,this.hasRedactions=!1}var ui=S.createSelector(Qn,function(t){return t.icp}),pi=S.createSelector(ui,function(t){return t.session}),di=S.createSelector(pi,function(t){return null===t?null:t.caseId}),hi=S.createSelector(ui,function(t){return t.presenter}),mi=S.createSelector(hi,function(t){return null===t?null:t.username}),gi=S.createSelector(ui,function(t){return t.client}),bi=S.createSelector(hi,gi,function(t,e){return null===t?undefined:t.id===e.id}),fi=S.createSelector(ui,function(t){return t.participants}),vi=(yi.prototype.ngOnInit=function(){var e=this;this.$subscription=this.store.pipe(S.select(bi)).subscribe(function(t){return e.isPresenter=t}),this.$subscription.add(this.store.pipe(S.select(mi)).subscribe(function(t){return e.presenterName=t}))},yi.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},yi.prototype.present=function(){this.toolbarEventService.icp.becomePresenter()},yi.prototype.stopPresenting=function(){this.toolbarEventService.icp.stopPresenting()},yi.prototype.leaveIcpSession=function(){this.toolbarEventService.icp.leaveSession()},yi.prototype.showParticipantsList=function(){this.toolbarEventService.toggleParticipantsList(!this.toolbarEventService.icp.participantsListVisible.getValue())},yi.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>'}]}],yi.ctorParameters=function(){return[{type:q},{type:S.Store}]},yi);function yi(t,e){this.toolbarEventService=t,this.store=e}var wi=(ki.decorators=[{type:E.NgModule,args:[{declarations:[Qo,Ko,ci,vi],providers:[tt,q],exports:[Ko,Qo,ci,vi],imports:[l.CommonModule,u.FormsModule,i.OverlayModule,d.RouterModule]}]}],ki);function ki(){}var Si=(Object.defineProperty(Ei.prototype,"annotation",{set:function(t){this.anno=P({},t)},enumerable:!0,configurable:!0}),Object.defineProperty(Ei.prototype,"selectedAnnoId",{set:function(t){var e;t&&(e=this.anno.id||this.anno.redactionId,this.selected=!!t.annotationId&&t.annotationId===e)},enumerable:!0,configurable:!0}),Ei.prototype.onSelect=function(){var t=this.anno.id||this.anno.redactionId;this.annotationClick.emit({annotationId:t,editable:!1,selected:!0})},Ei.prototype.onRectangleUpdate=function(e){var t=P({},this.anno);t.rectangles=t.rectangles.filter(function(t){return t.id!==e.id}),t.rectangles.push(e),this.update.emit(t)},Ei.prototype.deleteHighlight=function(){this["delete"].emit(this.anno)},Ei.prototype.addOrEditComment=function(){var t;0===this.anno.comments.length&&(t={annotationId:this.anno.id,content:"",createdBy:this.anno.createdBy,createdByDetails:undefined,createdDate:c.utc().tz("Europe/London").toISOString(),id:k.v4(),lastModifiedBy:"",lastModifiedByDetails:undefined,lastModifiedDate:"",tags:[],page:null,pages:{},pageHeight:null,selected:!1,editable:!1},this.store.dispatch(new ye(t))),this.selected=!0,this.annotationClick.emit({annotationId:this.anno.id,editable:!0,selected:!0}),this.toolbarEvents.toggleCommentsPanel(!0)},Ei.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'}]}],Ei.ctorParameters=function(){return[{type:q},{type:S.Store}]},Ei.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"]}]},Ei);function Ei(t,e){this.toolbarEvents=t,this.store=e,this.update=new E.EventEmitter,this["delete"]=new E.EventEmitter,this.annotationClick=new E.EventEmitter}var Ci=(Ii.prototype.ngOnInit=function(){this.selectedAnnotation$=this.store.pipe(S.select(Mo))},Ii.prototype.onAnnotationUpdate=function(t){this.store.dispatch(new be(t))},Ii.prototype.onAnnotationDelete=function(t){0<t.comments.length&&this.commentService.updateUnsavedCommentsStatus(t,!1),this.store.dispatch(new we(t.id))},Ii.prototype.selectAnnotation=function(t){this.store.dispatch(new Ee(t))},Ii.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'}]}],Ii.ctorParameters=function(){return[{type:S.Store},{type:ko}]},Ii.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}]},Ii);function Ii(t,e){this.store=t,this.commentService=e,this.annotations=[]}var Pi=(xi.prototype.saveAnnotation=function(e,n){var o=this;this.store.pipe(S.select(Ro),w.take(1)).subscribe(function(t){t=P({id:C(),color:"FFFF00",comments:[],page:n,rectangles:e,type:"highlight"},t,{createdBy:"",createdByDetails:undefined,createdDate:c.utc().tz("Europe/London").toISOString(),lastModifiedBy:"",lastModifiedByDetails:undefined,lastModifiedDate:"",tags:[]});o.store.dispatch(new be(t))})},xi.prototype.applyRotation=function(t,e,n,o,i,a,r,s){var n={x:+(a/s).toFixed(2),y:+(i/s).toFixed(2),width:+(o/s).toFixed(2),height:+(n/s).toFixed(2)},c=n.x,l=n.y,u=n.width,p=n.height,d={x:c,y:l,width:u,height:p};switch(r){case 90:d.width=p,d.height=u,d.x=l,d.y=+(e/s-c-u).toFixed(2);break;case 180:d.x=+(e/s-c-u).toFixed(2),d.y=+(t/s-l-p).toFixed(2);break;case 270:d.width=p,d.height=u,d.x=+(t/s-l-p).toFixed(2),d.y=c}return d},xi.prototype.resetHighlight=function(){window.getSelection().removeAllRanges(),this.toolBarEvents.highlightModeSubject.next(!1)},xi.decorators=[{type:E.Injectable}],xi.ctorParameters=function(){return[{type:q},{type:S.Store}]},xi);function xi(t,e){this.toolBarEvents=t,this.store=e}var _i=(Object.defineProperty(Ti.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}),Ti.prototype.ngOnChanges=function(t){t.rotate&&this.adjustForRotation(this.rotate)},Ti.prototype.ngAfterViewInit=function(){var e=this;this.subscriptions.push(this.toolbarEvents.grabNDrag.subscribe(function(t){return e.enableGrabNDrag=t}))},Ti.prototype.ngOnDestroy=function(){this.subscriptions.filter(function(t){return!t.closed}).forEach(function(t){return t.unsubscribe()})},Object.defineProperty(Ti.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}),Ti.prototype.onClick=function(){this.select.emit(this.annoRect)},Ti.prototype.onUpdate=function(t){var e=t.offsetHeight,n=t.offsetWidth,o=t.offsetTop,i=t.offsetLeft;this.hasRectangleChanged(t)&&(i=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,e,n,o,i,this.rotate,this.zoom),i=P({},this.annoRect,i),this.update.emit(P({},i)))},Ti.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}},Ti.prototype.hasRectangleChanged=function(t){return this.left!==t.offsetLeft||this.top!==t.offsetTop||this.width!==t.offsetWidth||this.height!==t.offsetHeight},Ti.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'}]}],Ti.ctorParameters=function(){return[{type:q},{type:Pi}]},Ti.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"]}],annoRect:[{type:E.Input}],selected:[{type:E.Input}]},Ti);function Ti(t,e){this.toolbarEvents=t,this.highlightService=e,this.select=new E.EventEmitter,this.update=new E.EventEmitter,this.subscriptions=[],this.enableGrabNDrag=!1}var Di=(Bi.prototype.getAllTags=function(t){return this.http.get("/em-anno/tags/"+t)},Bi.prototype.getNewTags=function(t){return this.tagItems?this.tagItems[t]:[]},Bi.prototype.updateTagItems=function(t,e){var n=this,o=t.map(function(t){return P({},t,{name:n.snakeCase(t.name)})});this.tagItems=P({},this.tagItems,((t={})[e]=o,t))},Bi.decorators=[{type:E.Injectable}],Bi.ctorParameters=function(){return[{type:m.HttpClient}]},Bi);function Bi(t){this.http=t,this.snakeCase=function(t){return t.replace(/ +/g," ").split(/ |\B(?=[A-Z])/).map(function(t){return t.toLowerCase()}).join("_")}}var Ri=(Oi.prototype.ngOnInit=function(){var e=this;this.subscriptions=this.store.select(Fo).pipe(w.distinctUntilChanged()).subscribe(function(t){return e.searchString=t}),this.reRenderComments()},Oi.prototype.ngAfterContentInit=function(){this.tagItems&&this.tagItems.length&&this.tagsServices.updateTagItems(this.tagItems,this._comment.annotationId)},Oi.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe()},Object.defineProperty(Oi.prototype,"comment",{get:function(){return this._comment},set:function(t){this._comment=P({},t),this.page=this._comment.page,this.lastUpdate=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;for(var e=this.totalPrevPagesHeight=0;e<this.page-1;e++){var n=this._comment.pages[e+1]?this._comment.pages[e+1].styles.height:undefined;n&&(this.totalPrevPagesHeight+=n+10)}},enumerable:!0,configurable:!0}),Object.defineProperty(Oi.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(Oi.prototype,"editable",{get:function(){return this._editable},enumerable:!0,configurable:!0}),Oi.prototype.onCommentChange=function(t){this.hasUnsavedChanges=this.originalComment.substring(0,this.CHAR_LIMIT)!==t.substring(0,this.CHAR_LIMIT),this.commentService.onCommentChange(this.hasUnsavedChanges)},Oi.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)},Oi.prototype.editOrSave=function(){var t;this.editable?(this._comment.content=this.fullComment.substring(0,this.CHAR_LIMIT),t=this.tagsServices.getNewTags(this._comment.annotationId),t={comment:this._comment,tags:t},this.updated.emit(t),this.hasUnsavedChanges=!1,this._editable=!1,this.changes.emit(!1)):this._editable=!0},Oi.prototype.onCommentClick=function(){this.selected||(this.selected=!0,this._editable=!1,this.commentClick.emit({annotationId:this._comment.annotationId,editable:this._editable,selected:!0}))},Oi.prototype.reRenderComments=function(){this.renderComments.emit(this._comment)},Object.defineProperty(Oi.prototype,"commentTop",{get:function(){return this.totalPrevPagesHeight+this.rectTop*this.zoom},enumerable:!0,configurable:!0}),Object.defineProperty(Oi.prototype,"height",{get:function(){return this.form.nativeElement.getBoundingClientRect().height/this.zoom},enumerable:!0,configurable:!0}),Oi.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'}]}],Oi.ctorParameters=function(){return[{type:S.Store},{type:ko},{type:Di}]},Oi.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"]}],editableComment:[{type:E.ViewChild,args:["editableComment"]}],comment:[{type:E.Input}],annotation:[{type:E.Input}]},Oi);function Oi(t,e,n){this.store=t,this.commentService=e,this.tagsServices=n,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}var Mi=(Ai.prototype.ngOnChanges=function(t){this.setRectangle(),this.top=this.popupTop(),this.left=this.popupLeft()},Object.defineProperty(Ai.prototype,"rectangles",{get:function(){return this._rectangles},set:function(t){t&&(this._rectangles=t,this.setRectangle())},enumerable:!0,configurable:!0}),Ai.prototype.createHighlight=function(){this.createHighlightEvent.emit(),this.rectangle=undefined},Ai.prototype.deleteHighlight=function(){this.deleteHighlightEvent.emit()},Ai.prototype.addOrEditComment=function(){this.addOrEditCommentEvent.emit(),setTimeout(function(){location.hash||document.getElementById("viewerContainer").scrollBy(0,1)},10)},Ai.prototype.createBookmark=function(){this.createBookmarkEvent.emit(this.rectangle),this.rectangle=undefined},Ai.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}},Ai.prototype.popupTop=function(){var t=this.rectangle.y*this.zoom-this.defaultHeight;return t<=0?this.defaultHeight:t},Ai.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},Ai.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'}]}],Ai.ctorParameters=function(){return[]},Ai.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}]},Ai);function Ai(){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}var Ni=(ji.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})},ji.prototype.sortComponents=function(t,n,o,i){var a=this;return t.sort(function(t,e){return t.rectTop=a.top(t._rectangle,n[t.page-1],o,i),e.rectTop=a.top(e._rectangle,n[e.page-1],o,i),a.processSort(t,e)})},ji.prototype.adjustIfOverlapping=function(t,e,n){e&&(e=e.commentTop+this.height(e),t.commentTop<=e&&(t.rectTop=(e-t.totalPrevPagesHeight)/n))},ji.prototype.processSort=function(t,e){return this.onSameLine(t,e)?t.rectLeft>=e.rectLeft?1:-1:t.commentTop>=e.commentTop?1:-1},ji.prototype.onSameLine=function(t,e){return 0===this.difference(t.commentTop,e.commentTop)},ji.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}},ji.prototype.height=function(t){return t.form.nativeElement.getBoundingClientRect().height},ji.prototype.difference=function(t,e){return Math.abs(t-e)},ji.decorators=[{type:E.Injectable}],ji);function ji(){}var Fi=(Li.prototype.ngOnInit=function(){var e=this;this.comments$=this.store.pipe(S.select($o)),this.annoEntities$=this.store.pipe(S.select(Do)),this.subscriptions.push(this.toolbarEvents.commentsPanelVisible.subscribe(function(t){e.redrawComments(),e.showCommentsPanel=t})),this.subscriptions.push(this.toolbarEvents.rotateSubject.subscribe(function(t){return e.rotateDocument()}))},Li.prototype.ngOnChanges=function(t){t.annotationSet&&this.commentService.setCommentSet(this),t.contentScrollTop&&this.container&&this.container.nativeElement.scrollTo(0,this.contentScrollTop)},Li.prototype.ngOnDestroy=function(){0<this.subscriptions.length&&this.subscriptions.forEach(function(t){return t.unsubscribe()})},Li.prototype.onSelect=function(t){this.store.dispatch(new Ee(t))},Li.prototype.onCommentDelete=function(e){var t=this.annotationSet.annotations.find(function(t){return t.id===e.annotationId}),t=P({},t,{comments:[]});this.onAnnotationUpdate(t),this.redrawComments()},Li.prototype.redrawComments=function(){var e=this;setTimeout(function(){var t=e.commentComponents.map(function(t){return t});e.renderService.redrawComponents(t,e.pageHeights,e.rotate,e.zoom)},0)},Li.prototype.rotateDocument=function(){this.panel&&(this.panel.nativeElement.style.height="0")},Li.prototype.onCommentUpdate=function(e){var t=this.annotationSet.annotations.find(function(t){return t.id===e.comment.annotationId}),n=[e.comment],o=e.tags,o=P({},t,{comments:n,tags:o});this.onAnnotationUpdate(o)},Li.prototype.onAnnotationUpdate=function(t){this.store.dispatch(new be(t))},Li.prototype.onContainerClick=function(t){t.path&&t.path[0]===this.panel.nativeElement&&this.clearSelection()},Li.prototype.clearSelection=function(){this.store.dispatch(new Ee({annotationId:"",editable:!1,selected:!1}))},Li.prototype.allCommentsSaved=function(){this.commentService.allCommentsSaved()},Li.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'}]}],Li.ctorParameters=function(){return[{type:S.Store},{type:ko},{type:Ni},{type:q}]},Li.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"]}],panel:[{type:E.ViewChild,args:["panel"]}],commentComponents:[{type:E.ViewChildren,args:["commentComponent"]}]},Li);function Li(t,e,n,o){this.store=t,this.commentService=e,this.renderService=n,this.toolbarEvents=o,this.pageHeights=[],this.subscriptions=[],this.clearSelection()}var Hi=($i.prototype.ngAfterContentChecked=function(){this.adjustHeight()},$i.prototype.onMouseDown=function(){this.adjustHeight()},$i.prototype.adjustHeight=function(){var t=this.el.nativeElement;t.style.overflow="hidden",t.style.height="auto",t.style.height=t.scrollHeight-5+"px"},$i.decorators=[{type:E.Directive,args:[{selector:"[mvTextAreaAutoExpand]"}]}],$i.ctorParameters=function(){return[{type:E.ElementRef}]},$i.propDecorators={onMouseDown:[{type:E.HostListener,args:["input"]}]},$i);function $i(t){this.el=t}var Vi=(Ui.prototype.ngOnInit=function(){this.filtersFg=this.fb.group({dateRangeFrom:new u.FormGroup({day:new u.FormControl(""),month:new u.FormControl(""),year:new u.FormControl("")}),dateRangeTo:new u.FormGroup({day:new u.FormControl(""),month:new u.FormControl(""),year:new u.FormControl("")}),tagFilters:this.fb.group({})}),this.comments$=this.store.pipe(S.select(Vo)),this.buildCheckBoxForm(),this.container.nativeElement.focus()},Ui.prototype.buildCheckBoxForm=function(){var o=this;this.filtersFg.reset();var i=this.filtersFg.get("tagFilters"),t=this.store.pipe(S.select(Lo));this.allTags$=this.store.pipe(S.select(_o)),this.$subscriptions=b.combineLatest([this.allTags$,t]).subscribe(function(t){var e=R(t,2),t=e[0],n=e[1];o.hasFilter=n.hasFilter,t.forEach(function(t){var e=!(!n.filters.tagFilters||!n.filters.tagFilters.hasOwnProperty(t.key))&&n.filters.tagFilters[t.key];i.addControl(t.key,new u.FormControl(e))}),o.filtersFg.updateValueAndValidity()})},Ui.prototype.onClearFilters=function(){this.store.dispatch(new Pe),this.buildCheckBoxForm()},Ui.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,e=e?new Date(t.dateRangeFrom.year,t.dateRangeFrom.month-1,t.dateRangeFrom.day).getTime():null,n=n?new Date(t.dateRangeTo.year,t.dateRangeTo.month-1,t.dateRangeTo.day).getTime():null;this.store.dispatch(new Ie(P({},t,{dateRangeFrom:e,dateRangeTo:n})))},Ui.prototype.onFiltersToggle=function(){this.showFilters=!this.showFilters},Ui.prototype.onClose=function(){this.toolbarEvents.toggleCommentsSummary(!1)},Ui.prototype.onPrint=function(){this.printService.printElementNatively(this.commentsTable.nativeElement,1e3,900)},Ui.prototype.navigateToPage=function(t){"pdf"===this.contentType&&this.toolbarEvents.setPage(t),this.toolbarEvents.toggleCommentsSummary(!1),this.toolbarEvents.toggleCommentsPanel(!0)},Ui.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},Ui.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'}]}],Ui.ctorParameters=function(){return[{type:S.Store},{type:X},{type:q},{type:u.FormBuilder}]},Ui.propDecorators={title:[{type:E.Input}],contentType:[{type:E.Input}],container:[{type:E.ViewChild,args:["outerContainer"]}],commentsTable:[{type:E.ViewChild,args:["commentContainer"]}]},Ui);function Ui(t,e,n,o){this.store=t,this.printService=e,this.toolbarEvents=n,this.fb=o,this.showFilters=!1,this.hasFilter=!1}var zi=(Wi.prototype.ngOnInit=function(){var e=this;this.subscriptions=[this.toolbarEvents.drawModeSubject.subscribe(function(t){e.defaultHeight=t?"100%":"0px",e.defaultWidth=t?"100%":"0px"})]},Wi.prototype.ngOnDestroy=function(){this.subscriptions.forEach(function(t){t.unsubscribe()})},Wi.prototype.initHighlight=function(t){var e=t.offsetX,t=t.offsetY;switch(this.position="absolute",this.backgroundColor="yellow",this.drawStartX=e,this.drawStartY=t,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}},Wi.prototype.updateHighlight=function(t){var e=t.offsetX,t=t.offsetY;0<this.drawStartX&&0<this.drawStartY&&(this.height=Math.abs(t-this.drawStartY),this.width=Math.abs(e-this.drawStartX),this.top=Math.min(t,this.drawStartY),this.left=Math.min(e,this.drawStartX))},Wi.prototype.createHighlight=function(){var t;(5<this.height/this.zoom||5<this.width/this.zoom)&&(t=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,this.height,this.width,this.top,this.left,this.rotate,this.zoom),t=P({id:C()},t),this.saveSelection.emit({rectangles:[t],page:this.page}),this.resetHighlight())},Wi.prototype.resetHighlight=function(){this.drawStartX=-1,this.drawStartY=-1,this.display="none",this.width=0,this.height=0},Wi.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'}]}],Wi.ctorParameters=function(){return[{type:q},{type:Pi}]},Wi.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"]}]},Wi);function Wi(t,e){this.toolbarEvents=t,this.highlightService=e,this.saveSelection=new E.EventEmitter,this.drawStartX=-1,this.drawStartY=-1,this.backgroundColor="none",this.subscriptions=[]}var qi=(Gi.prototype.ngOnInit=function(){var n=this,t=this.store.pipe(S.select(Io)),e=this.store.pipe(S.select(Uo));this.$subscriptions=b.combineLatest([t,e]).subscribe(function(t){var e=R(t,2),t=e[0],e=e[1];n.navigationList=e,n.tabs=0<n.navigationList.length?[{label:"comments"},{label:"filter"},{label:"search"}]:[{label:"comments"}],n.isFiltered=!t.length,n.tabs=O(n.tabs).map(function(t){return n.isFiltered||"filter"!==t.label?P({},t,{isFiltered:!1}):P({},t,{isFiltered:!0})})})},Gi.prototype.toggleCommentsSummary=function(){this.showCommentSummaryDialog.emit()},Gi.prototype.selectTab=function(t){this.tabSelected=t!==this.tabSelected?t:undefined},Gi.prototype.toggleCommentsPanel=function(){this.toolbarEvents.toggleCommentsPanel(!this.toolbarEvents.commentsPanelVisible.getValue())},Gi.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},Gi.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}]}],Gi.ctorParameters=function(){return[{type:S.Store},{type:q}]},Gi.propDecorators={showCommentSummary:[{type:E.Input}],showCommentSummaryDialog:[{type:E.Output}]},Gi);function Gi(t,e){this.store=t,this.toolbarEvents=e,this.showCommentSummaryDialog=new E.EventEmitter,this.tabs=[],this.tabSelected=""}var Zi=(Yi.prototype.ngAfterViewInit=function(){this.searchInput&&this.searchInput.nativeElement.focus()},Yi.prototype.ngOnDestroy=function(){var t=this;setTimeout(function(){t.store.dispatch(new Ce(""))},250)},Yi.prototype.searchComments=function(t){var e=this;this.clearSearch(),2<t.length&&(this.searchString=t,this.searchResults=this.annotations.filter(function(t){return 0<t.comments.length}).filter(function(t){return t.comments[0].content.toLowerCase().includes(e.searchString.toLowerCase())}),0<this.searchResults.length&&this.store.dispatch(new Ce(t)))},Yi.prototype.clearSearch=function(){this.searchString=undefined,this.searchResults=[],this.searchIndex=0,this.store.dispatch(new Ce(""))},Yi.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}]}],Yi.ctorParameters=function(){return[{type:S.Store}]},Yi.propDecorators={annotations:[{type:E.Input}],searchInput:[{type:E.ViewChild,args:["searchInput"]}]},Yi);function Yi(t){this.store=t,this.searchResults=[],this.searchIndex=0}var Xi=(Ki.prototype.ngAfterViewChecked=function(){this.textToHighlight&&this.highlightInputText(this.textToHighlight)},Ki.prototype.highlightInputText=function(t){this.resetHighlight(),this.textToHighlight=t;var e=new RegExp(t,"gi"),t=this.element.nativeElement;t.innerHTML.match(e)&&(t.innerHTML=t.innerHTML.replace(e,this.highlightPattern("$&"))),this.textToHighlight=undefined},Ki.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]))}},Ki.prototype.highlightPattern=function(t){return'<span class="mvTextHighlight">'+t+"</span>"},Ki.decorators=[{type:E.Directive,args:[{selector:"[mvTextHighlight]"}]}],Ki.ctorParameters=function(){return[{type:E.ElementRef}]},Ki.propDecorators={textToHighlight:[{type:E.Input}]},Ki);function Ki(t){this.element=t}var Ji=(Qi.prototype.onUpdateTags=function(t){this.tagsServices.updateTagItems(t,this.annoId)},Qi.prototype.minLength=function(t){return t.value.length<2?{minLength:!0}:null},Qi.prototype.maxLength20=function(t){return 20<=t.value.length?{maxLength20:!0}:null},Qi.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}]}],Qi.ctorParameters=function(){return[{type:Di}]},Qi.propDecorators={tagItems:[{type:E.Input}],userId:[{type:E.Input}],editable:[{type:E.Input}],annoId:[{type:E.Input}]},Qi);function Qi(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)}}var ta=(ea.prototype.ngOnChanges=function(t){t.annotationList&&this.initNavigationList()},ea.prototype.initNavigationList=function(){var e=this;this.index=0,this.navigationList=O(this.annotationList||[]).map(function(t){return{content:t.comments[0].content,annotationId:t.id,page:t.page,rectangle:e.upperRectangle(t.rectangles)}}).sort(this.sortComments),this.autoSelect&&(this.toolbarEvents.setPage(Number.parseInt(this.navigationList[0].page,0)),this.store.dispatch(new Ee({annotationId:this.navigationList[0].annotationId,editable:!1,selected:!0})))},ea.prototype.sortComments=function(t,e){if(t.page!==e.page)return t.page-e.page;t=t.rectangle,e=e.rectangle;return t.y!==e.y?t.y-e.y:t.x-e.x},ea.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 Ee({annotationId:this.navigationList[this.index].annotationId,editable:!1,selected:!0}))},ea.prototype.prevItem=function(){--this.index,this.index<0&&(this.index=this.navigationList.length-1),this.toolbarEvents.setPage(Number.parseInt(this.navigationList[this.index].page,0)),this.store.dispatch(new Ee({annotationId:this.navigationList[this.index].annotationId,editable:!1,selected:!0}))},ea.prototype.upperRectangle=function(t){return O(t).sort(function(t,e){return t.y-e.y}),{x:t[0].x,y:t[0].y}},ea.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}]}],ea.ctorParameters=function(){return[{type:S.Store},{type:q}]},ea.propDecorators={annotationList:[{type:E.Input}],autoSelect:[{type:E.Input}]},ea);function ea(t,e){this.store=t,this.toolbarEvents=e,this.autoSelect=!1,this.navigationList=[],this.index=0}var na=(oa.prototype.ngOnInit=function(){var e=this;this.tagGroup=this.fb.group({tagFilters:this.fb.group({})}),this.filter$=this.store.pipe(S.select(Io)),this.$subscriptions=this.tagGroup.valueChanges.pipe(w.auditTime(5)).subscribe(function(t){t=t.tagFilters;e.store.dispatch(new Ot(t))}),this.buildFrom()},oa.prototype.buildFrom=function(){var e=this,n=this.tagGroup.get("tagFilters");this.allTags$=this.store.pipe(S.select(_o)).pipe(w.tap(function(t){e.tagGroup.reset(),t.forEach(function(t){n.addControl(t.key,new u.FormControl(!1))})}))},oa.prototype.onClearFilters=function(){this.tagGroup.reset(),this.store.dispatch(new Mt)},oa.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},oa.prototype.onRemoveFilter=function(t){this.tagGroup.get("tagFilters").controls[t].setValue(!1)},oa.prototype.onToggleFilterView=function(){this.isPreview=!this.isPreview},oa.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}]}],oa.ctorParameters=function(){return[{type:S.Store},{type:u.FormBuilder}]},oa);function oa(t,e){this.store=t,this.fb=e,this.isPreview=!1}var ia,aa,ra=(ia=l.DatePipe,I(aa=ca,wr=ia),aa.prototype=null===wr?Object.create(wr):(sa.prototype=wr.prototype,new sa),ca.prototype.transform=function(t,e,n){void 0===e&&(e="mediumDate"),void 0===n&&(n="Europe/London");n=c(t).tz(n).format("Z");return ia.prototype.transform.call(this,t,e,n)},ca.decorators=[{type:E.Pipe,args:[{name:"momentDate"}]}],ca);function sa(){this.constructor=aa}function ca(){return null!==ia&&ia.apply(this,arguments)||this}var la=(ua.prototype.getBookmarks=function(t){return this.httpClient.get(this.ANNOTATIONS_API+"/"+t+"/bookmarks",{observe:"response",withCredentials:!0})},ua.prototype.createBookmark=function(t){return this.httpClient.post(this.ANNOTATIONS_API+"/bookmarks",t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},ua.prototype.updateBookmark=function(t){return this.httpClient.put(this.ANNOTATIONS_API+"/bookmarks",t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},ua.prototype.updateMultipleBookmarks=function(t){return this.httpClient.put(this.ANNOTATIONS_API+"/bookmarks_multiple",t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},ua.prototype.deleteBookmark=function(t){return this.httpClient["delete"](this.ANNOTATIONS_API+"/bookmarks/"+t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},ua.prototype.deleteMultipleBookmarks=function(t){return this.httpClient.request("DELETE",this.ANNOTATIONS_API+"/bookmarks_multiple",{body:t,observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},ua.decorators=[{type:E.Injectable}],ua.ctorParameters=function(){return[{type:m.HttpClient}]},ua);function ua(t){this.httpClient=t,this.ANNOTATIONS_API="/em-anno"}var pa=(da.prototype.transform=function(t,e,n){return t?e?t.filter(function(t){return!!t&&(t[n]||t).toLowerCase().includes(e.toLowerCase())}):t:[]},da.decorators=[{type:E.Pipe,args:[{name:"filter"}]}],da);function da(){}var ha=(ma.prototype.transform=function(t){return t.split("_").join(" ")},ma.decorators=[{type:E.Pipe,args:[{name:"unsnake"}]}],ma);function ma(){}var ga=(ba.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'}]}],ba.propDecorators={config:[{type:E.Input}],errorMessage:[{type:E.Input}],formGroup:[{type:E.Input}]},ba);function ba(){}var fa=(va.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 '}]}],va.ctorParameters=function(){return[]},va.propDecorators={config:[{type:E.Input}],errorMessage:[{type:E.Input}]},va);function va(){}var ya=(wa.setDescribedBy=function(t,e){return t&&t.isInvalid?e.hint?e.id+"-hint "+e.id+"-error":e.id+"-error":e.hint?e.id+"-hint":null},wa);function wa(){}var ka=(Sa.prototype.setDescribedBy=function(){return ya.setDescribedBy(this.errorMessage,this.config)},Sa.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 '}]}],Sa.propDecorators={config:[{type:E.Input}],isHeading:[{type:E.Input}],errorMessage:[{type:E.Input}]},Sa);function Sa(){}var Ea=(Ca.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 '}]}],Ca.ctorParameters=function(){return[]},Ca.propDecorators={config:[{type:E.Input}]},Ca);function Ca(){}var Ia=(Pa.decorators=[{type:E.NgModule,args:[{imports:[l.CommonModule,u.FormsModule,u.ReactiveFormsModule,l.CommonModule,d.RouterModule],declarations:[ga,fa,ka,Ea],exports:[ga,fa,ka,Ea]}]}],Pa);function Pa(){}var xa=S.createSelector(Qn,function(t){return t.bookmarks}),_a=S.createSelector(xa,function(t){return t.bookmarkPageEntities}),Ta=S.createSelector(xa,function(t){return t.bookmarkEntities}),Da=S.createSelector(Ta,function(t){return o=JSON.parse(JSON.stringify(t)),fn(o),Object.keys(o).reduce(function(t,e){var n=o[e];return n.parent?((e=o[n.parent]).children||(e.children=[]),e.children[n.index]=n):t[n.index]=n,t},[]);var o}),Ba=S.createSelector(xa,function(t){return t.editableBookmark}),Ra=S.createSelector(Da,no,oo,eo,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:0<t.length?t[t.length-1].id:undefined,documentId:e}}),Oa=S.createSelector(eo,_a,function(n,o){if(n&&o){var i=[];return Object.keys(n).forEach(function(t){var e=Number(t)-1,e=o[e];i.push({bookmark:e||[],styles:n[t].styles})}),i}}),Ma=(Aa.prototype.ngOnInit=function(){var e=this;this.$subscriptions=this.store.pipe(S.select(eo)).subscribe(function(t){return e.pages=Object.values(t)}),this.annoPages$=this.store.pipe(S.select(No)),this.$subscriptions.add(this.toolbarEvents.drawModeSubject.subscribe(function(t){return e.drawMode=t})).add(this.viewerEvents.textHighlight.subscribe(function(t){return e.showContextToolbar(t)})).add(this.viewerEvents.ctxToolbarCleared.subscribe(function(){return e.clearContextToolbar()}))},Aa.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},Aa.prototype.showContextToolbar=function(t){this.highlightPage=t.page,this.rectangles=t.rectangles,this.rectangles&&this.toolbarEvents.highlightModeSubject.next(!1)},Aa.prototype.clearContextToolbar=function(){this.rectangles=undefined},Aa.prototype.createHighlight=function(){this.highlightService.saveAnnotation(this.rectangles,this.highlightPage),this.highlightService.resetHighlight(),this.rectangles=undefined},Aa.prototype.createBookmark=function(n){var o=this;this.store.pipe(S.select(Ra),w.take(1)).subscribe(function(t){var e=window.getSelection().toString();o.store.dispatch(new nn(P({},t,{name:0<e.length?e.substr(0,30):"new bookmark",id:C(),pageNumber:o.highlightPage-1,xCoordinate:n.x,yCoordinate:n.y}))),o.toolbarEvents.toggleSideBar(!0),o.highlightService.resetHighlight(),o.rectangles=undefined})},Aa.prototype.saveAnnotation=function(t){var e=t.rectangles,t=t.page;this.highlightService.saveAnnotation(e,t),this.toolbarEvents.drawModeSubject.next(!1)},Aa.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'}]}],Aa.ctorParameters=function(){return[{type:S.Store},{type:Pi},{type:q},{type:co}]},Aa.propDecorators={zoom:[{type:E.Input}],rotate:[{type:E.Input}]},Aa);function Aa(t,e,n,o){this.store=t,this.highlightService=e,this.toolbarEvents=n,this.viewerEvents=o,this.pages=[],this.drawMode=!1}var Na=(ja.decorators=[{type:E.NgModule,args:[{imports:[a.A11yModule,l.CommonModule,u.FormsModule,m.HttpClientModule,v.MutableDivModule,p.TagInputModule,d.RouterModule,u.ReactiveFormsModule,r.NgxDatatableModule,Ia],declarations:[Ma,Si,zi,Ci,_i,Ri,qi,Zi,Xi,Mi,Fi,ta,Hi,Vi,Ji,ra,na,pa,ha],entryComponents:[Si,Ci,Fi],providers:[yo,la,Ni,Pi,Di],exports:[Si,zi,Ci,Fi,qi,Zi,Vi,Ji,na,ra,pa,ha,Ma]}]}],ja);function ja(){}var Fa=(La.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})},La.prototype.onPointerMove=function(t){var e;this.pointerDown&&this.dragEnabled&&(t.preventDefault(),e=this.originalPosition.left-(t.clientX+this.el.nativeElement.scrollLeft),t=this.originalPosition.top-(t.clientY+this.el.nativeElement.scrollTop),this.dragEnabled&&(this.dragX.scrollLeft+=e,this.el.nativeElement.scrollTop+=t))},La.prototype.onWindowPointerUp=function(){this.pointerDown=!1},La.decorators=[{type:E.Directive,args:[{selector:"[mvGrabNDrag]"}]}],La.ctorParameters=function(){return[{type:E.ElementRef}]},La.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"]}]},La);function La(t){this.el=t,this.pointerDown=!1,this.dragEnabled=!1}var Ha=($a.prototype.ngOnInit=function(){var e=this;this.bookmarkNodes$=this.store.pipe(S.select(Da)),this.$subscription=this.store.pipe(S.select(Ba)).subscribe(function(t){return e.selectedView=t?"bookmarks":e.selectedView})},$a.prototype.ngOnChanges=function(t){t.url&&this.url&&this.store.dispatch(new Qe)},$a.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},$a.prototype.goToDestination=function(t){this.viewerEvents.goToDestination(t)},$a.prototype.toggleSidebarView=function(t){this.selectedView=t},$a.prototype.onAddBookmarkClick=function(){var e=this;this.toggleSidebarView("bookmarks"),this.store.pipe(S.select(Ra),w.take(1)).subscribe(function(t){e.store.dispatch(new nn(P({},t,{name:"new bookmark",id:C()})))})},$a.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'}]}],$a.ctorParameters=function(){return[{type:co},{type:S.Store}]},$a.propDecorators={annotationsEnabled:[{type:E.Input}],outline:[{type:E.Input}],url:[{type:E.Input}],zoom:[{type:E.Input}],rotate:[{type:E.Input}]},$a);function $a(t,e){this.viewerEvents=t,this.store=e,this.selectedView="outline"}var Va=(Ua.prototype.ngOnInit=function(){this.showOutlineItems=!0},Ua.prototype.goToDestination=function(t){t&&this.navigationEvent.emit(t)},Ua.prototype.toggleOutline=function(){this.showOutlineItems=!this.showOutlineItems},Ua.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'}]}],Ua.propDecorators={outline:[{type:E.Input}],navigationEvent:[{type:E.Output}]},Ua);function Ua(){this.navigationEvent=new E.EventEmitter}var za=(Wa.prototype.ngOnInit=function(){var e=this;this.redactionsPerPage$=this.store.pipe(S.select(si)),this.selectedRedaction$=this.store.pipe(S.select(oi)),this.$subscription=this.toolbarEvents.drawModeSubject.subscribe(function(t){return e.drawMode=t}),this.$subscription.add(this.store.pipe(S.select(ii),w.filter(function(t){return!!t})).subscribe(function(t){return e.downloadDocument(t)})),this.$subscription.add(this.store.pipe(S.select(no)).subscribe(function(t){return e.documentId=t})),this.$subscription.add(this.viewerEvents.textHighlight.subscribe(function(t){return e.markTextRedaction(t)})),this.toolbarEvents.applyRedactToDocument.subscribe(function(){e.store.pipe(S.select(ri),w.take(1)).subscribe(function(t){e.store.dispatch(new Vn(t))})}),this.toolbarEvents.clearAllRedactMarkers.subscribe(function(){e.store.dispatch(new qn(e.documentId))})},Wa.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},Wa.prototype.markTextRedaction=function(t){var e=t.rectangles;e&&e.length&&this.saveRedaction(t.page,O(e)),this.toolbarEvents.highlightModeSubject.next(!1)},Wa.prototype.markBoxRedaction=function(t){var e=t.rectangles,t=t.page;this.saveRedaction(t,e),this.toolbarEvents.drawModeSubject.next(!1)},Wa.prototype.saveRedaction=function(t,e){e={page:t,rectangles:e,redactionId:C(),documentId:this.documentId};this.store.dispatch(new An(e))},Wa.prototype.onMarkerDelete=function(t){this.store.dispatch(new Fn(t))},Wa.prototype.selectRedaction=function(t){this.store.dispatch(new $n(t))},Wa.prototype.onMarkerUpdate=function(t){this.store.dispatch(new An(t))},Wa.prototype.downloadDocument=function(t){var e=t.blob,n=t.filename;navigator&&navigator.msSaveBlob?navigator.msSaveBlob(e,n):(t=URL.createObjectURL(e),e=document.createElement("a"),document.body.appendChild(e),e.setAttribute("style","display: none"),e.href=t,e.download=n,e.click(),e.remove(),URL.revokeObjectURL(t)),this.store.dispatch(new Wn)},Wa.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'}]}],Wa.ctorParameters=function(){return[{type:S.Store},{type:co},{type:q}]},Wa.propDecorators={zoom:[{type:E.Input}],rotate:[{type:E.Input}]},Wa);function Wa(t,e,n){this.store=t,this.viewerEvents=e,this.toolbarEvents=n}var qa=(Ga.prototype.loadSession=function(t){return this.httpClient.get(this.ICP_SESSION_API+"/"+t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},Ga.decorators=[{type:E.Injectable}],Ga.ctorParameters=function(){return[{type:m.HttpClient}]},Ga);function Ga(t){this.httpClient=t,this.ICP_SESSION_API="/icp/sessions"}var Za=(Ya.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},Ya.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)})},Ya.prototype.join=function(e){var n=this;this.subscription=this.connected$.subscribe(function(t){t&&n.socket.emit("join",e)})},Ya.prototype.leave=function(t){this.socket.emit("leave",t),this.subscription.unsubscribe()},Ya.prototype.emit=function(t,e){this.socket.emit(t,e)},Ya.prototype.listen=function(t){var n=this;return new b.Observable(function(e){return n.socket.on(t,function(t){e.next(t)}),function(){return n.socket.off(t)}})},Ya.prototype.getSocketClient=function(){return h("/",{path:"/icp/socket.io",agent:!0})},Ya.decorators=[{type:E.Injectable}],Ya.ctorParameters=function(){return[]},Ya);function Ya(){this.connected$=new b.BehaviorSubject(!1)}var Xa=(Ka.prototype.joinSession=function(t,e){return this.session=e,this.socket.connect(),this.socket.join(P({},this.session,{username:t})),this.socket.listen(this.SESSION_JOINED)},Ka.prototype.leaveSession=function(){this.socket.leave(this.session)},Ka.prototype.newParticipantJoined=function(){return this.socket.listen(this.NEW_PARTICIPANT_JOINED)},Ka.prototype.clientDisconnected=function(){return this.socket.listen(this.CLIENT_DISCONNECTED)},Ka.prototype.removeParticipant=function(t){this.socket.emit(this.REMOVE_PARTICIPANT,{participantId:t,caseId:this.session.caseId})},Ka.prototype.participantListUpdated=function(){return this.socket.listen(this.PARTICIPANTS_UPDATED)},Ka.prototype.updatePresenter=function(t){this.socket.emit(this.UPDATE_PRESENTER,P({},this.session,{presenterId:t.id,presenterName:t.username}))},Ka.prototype.presenterUpdated=function(){return this.socket.listen(this.PRESENTER_UPDATED)},Ka.prototype.updateScreen=function(t){t={body:t,sessionId:this.session.sessionId};this.socket.emit(this.UPDATE_SCREEN,t)},Ka.prototype.screenUpdated=function(){return this.socket.listen(this.SCREEN_UPDATED)},Ka.decorators=[{type:E.Injectable}],Ka.ctorParameters=function(){return[{type:Za}]},Ka);function Ka(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"}var Ja=(Qa.prototype.update=function(t){t?this.subscribe():this.unsubscribe()},Qa.prototype.subscribe=function(){var e=this;this.$subscription||(this.$subscription=this.store.pipe(S.select(oo)).subscribe(function(t){e.pdfPosition=t,e.onPositionUpdate(t)}),this.$subscription.add(this.store.pipe(S.select(hi)).subscribe(function(t){e.presenter=t})),this.$subscription.add(this.socketService.newParticipantJoined().subscribe(function(){return e.onNewParticipantJoined()})))},Qa.prototype.unsubscribe=function(){this.$subscription&&(this.$subscription.unsubscribe(),this.$subscription=undefined)},Qa.prototype.onPositionUpdate=function(t){t={pdfPosition:t,document:undefined};this.socketService.updateScreen(t)},Qa.prototype.onNewParticipantJoined=function(){this.onPositionUpdate(this.pdfPosition),this.socketService.updatePresenter(this.presenter)},Qa.decorators=[{type:E.Injectable}],Qa.ctorParameters=function(){return[{type:q},{type:Xa},{type:S.Store}]},Qa);function Qa(t,e,n){this.toolbarEvents=t,this.socketService=e,this.store=n}var tr=(er.prototype.update=function(t){t?this.subscribe():this.unsubscribe()},er.prototype.subscribe=function(){var e=this;this.$subscription||(this.$subscription=this.socketService.screenUpdated().subscribe(function(t){return e.followScreenUpdate(t)}))},er.prototype.unsubscribe=function(){this.$subscription&&(this.$subscription.unsubscribe(),this.$subscription=undefined)},er.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(oo),w.take(1)).subscribe(function(t){t=(n.rotation-t.rotation)%360;0!=t&&e.toolbarEvents.rotate(t)})},er.decorators=[{type:E.Injectable}],er.ctorParameters=function(){return[{type:q},{type:co},{type:Xa},{type:S.Store}]},er);function er(t,e,n,o){this.toolbarEvents=t,this.viewerEvents=e,this.socketService=n,this.store=o}var nr=(or.prototype.ngOnDestroy=function(){this.unsubscribeSession(),this.subscription.unsubscribe()},or.prototype.launchSession=function(){var t=this;this.store.dispatch(new Ut(this.caseId)),this.subscription.add(this.store.pipe(S.select(pi),w.filter(function(t){return!!t&&1<Object.keys(t).length}),w.take(1)).subscribe(function(){t.setUpSessionSubscriptions()}))},or.prototype.setUpSessionSubscriptions=function(){var e=this;this.sessionSubscription=this.toolbarEvents.icp.becomingPresenter.subscribe(function(){return e.becomePresenter()}),this.sessionSubscription.add(this.toolbarEvents.icp.stoppingPresenting.subscribe(function(){return e.stopPresenting()})),this.sessionSubscription.add(this.toolbarEvents.icp.sessionExitConfirmed.subscribe(function(){return e.leavePresentation()})),this.sessionSubscription.add(this.store.pipe(S.select(hi)).subscribe(function(t){return e.presenter=t})),this.sessionSubscription.add(this.store.pipe(S.select(gi)).subscribe(function(t){return e.client=t})),this.sessionSubscription.add(this.store.pipe(S.select(bi)).subscribe(function(t){e.isPresenter=t,e.presenterSubscriptions.update(t),e.followerSubscriptions.update(!t)})),this.sessionSubscription.add(this.socketService.clientDisconnected().subscribe(function(t){return e.clientDisconnected(t)})),this.sessionSubscription.add(this.socketService.presenterUpdated().subscribe(function(t){e.store.dispatch(new Zt(t))})),this.sessionSubscription.add(this.socketService.participantListUpdated().subscribe(function(t){e.store.dispatch(new Yt(t))}))},or.prototype.unsubscribeSession=function(){this.presenterSubscriptions.update(!1),this.followerSubscriptions.update(!1),this.sessionSubscription.unsubscribe()},or.prototype.leavePresentation=function(){this.isPresenter&&this.stopPresenting(),this.removeParticipant(this.client.id),this.socketService.leaveSession(),this.store.dispatch(new Gt),this.unsubscribeSession()},or.prototype.stopPresenting=function(){this.socketService.updatePresenter({username:"",id:""})},or.prototype.becomePresenter=function(){this.socketService.updatePresenter(this.client)},or.prototype.clientDisconnected=function(t){t===this.presenter.id&&this.stopPresenting(),this.removeParticipant(t)},or.prototype.removeParticipant=function(t){this.socketService.removeParticipant(t)},or.decorators=[{type:E.Injectable}],or.ctorParameters=function(){return[{type:q},{type:co},{type:Xa},{type:Ja},{type:tr},{type:S.Store}]},or);function or(t,e,n,o,i,a){var r=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(di),w.filter(function(t){return!!t})).subscribe(function(t){r.caseId=t}),this.subscription.add(this.toolbarEvents.icp.sessionLaunch.subscribe(function(){r.caseId&&r.launchSession()}))}var ir=(ar.decorators=[{type:E.Injectable}],ar.ctorParameters=function(){return[{type:g.Actions},{type:yo}]},x([g.Effect(),_("design:type",Object)],ar.prototype,"loadAnnotation$",void 0),x([g.Effect(),_("design:type",Object)],ar.prototype,"postAnnotation$",void 0),x([g.Effect(),_("design:type",Object)],ar.prototype,"deleteAnnotation$",void 0),ar);function ar(t,e){var n=this;this.actions$=t,this.annotationApiService=e,this.loadAnnotation$=this.actions$.pipe(g.ofType(Qt),w.map(function(t){return t.payload}),w.switchMap(function(t){return n.annotationApiService.getAnnotationSet(t).pipe(w.map(function(t){return new me(t)}),w.catchError(function(t){return b.of(new ge(t))}))})),this.postAnnotation$=this.actions$.pipe(g.ofType(ne),w.map(function(t){return t.payload}),w.exhaustMap(function(t){return n.annotationApiService.postAnnotation(t).pipe(w.map(function(t){return new fe(t)}),w.catchError(function(t){return b.of(new ge(t))}))})),this.deleteAnnotation$=this.actions$.pipe(g.ofType(re),w.map(function(t){return t.payload}),w.exhaustMap(function(e){return n.annotationApiService.deleteAnnotation(e).pipe(w.map(function(t){return new ke(e)}),w.catchError(function(t){return b.of(new Se(t))}))}))}var rr=(sr.decorators=[{type:E.Injectable}],sr.ctorParameters=function(){return[{type:g.Actions},{type:S.Store},{type:la}]},x([g.Effect(),_("design:type",Object)],sr.prototype,"loadBookmarks$",void 0),x([g.Effect(),_("design:type",Object)],sr.prototype,"createBookmark$",void 0),x([g.Effect(),_("design:type",Object)],sr.prototype,"moveBookmark$",void 0),x([g.Effect(),_("design:type",Object)],sr.prototype,"deleteBookmark$",void 0),x([g.Effect(),_("design:type",Object)],sr.prototype,"updateBookmark$",void 0),sr);function sr(t,e,n){var o=this;this.actions$=t,this.store=e,this.bookmarksApiService=n,this.loadBookmarks$=this.actions$.pipe(g.ofType(Ve),w.withLatestFrom(this.store.pipe(S.select(no))),w.map(function(t){return R(t,2)[1]}),w.exhaustMap(function(t){return o.bookmarksApiService.getBookmarks(t).pipe(w.map(function(t){return new tn(t)}),w.catchError(function(t){return b.of(new en(t))}))})),this.createBookmark$=this.actions$.pipe(g.ofType(We),w.map(function(t){return t.payload}),w.exhaustMap(function(t){return o.bookmarksApiService.createBookmark(t).pipe(w.map(function(t){return new on(t)}),w.catchError(function(t){return b.of(new an(t))}))})),this.moveBookmark$=this.actions$.pipe(g.ofType(Ye),w.map(function(t){return t.payload}),w.exhaustMap(function(t){return o.bookmarksApiService.updateMultipleBookmarks(t).pipe(w.map(function(t){return new un(t)}),w.catchError(function(t){return b.of(new pn(t))}))})),this.deleteBookmark$=this.actions$.pipe(g.ofType(Ge),w.map(function(t){return t.payload}),w.exhaustMap(function(t){var e=t.deleted,n=t.updated;return o.bookmarksApiService.deleteMultipleBookmarks({deleted:e,updated:n}).pipe(w.switchMap(function(){return n?[new sn(e),new hn(n)]:[new sn(e)]}),w.catchError(function(t){return b.of(new cn(t))}))})),this.updateBookmark$=this.actions$.pipe(g.ofType(Ke),w.map(function(t){return t.payload}),w.switchMap(function(t){return o.bookmarksApiService.updateBookmark(t).pipe(w.map(function(t){return new hn(t)}),w.catchError(function(t){return b.of(new mn(t))}))}))}var cr=(lr.prototype.getRedactions=function(t){t=this.markupsApiUrl+"/"+t;return this.httpClient.get(t,{observe:"response",withCredentials:!0})},lr.prototype.saveRedaction=function(t){return this.httpClient.post(this.markupsApiUrl,t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}),w.catchError(function(){return[]}))},lr.prototype.deleteRedaction=function(t){t=this.markupsApiUrl+"/"+t.documentId+"/"+t.redactionId;return this.httpClient["delete"](t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},lr.prototype.deleteAllMarkers=function(t){t=this.markupsApiUrl+"/"+t;return this.httpClient["delete"](t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},lr.prototype.redact=function(t){return this.httpClient.post(this.redactApiUrl,t,{observe:"response",withCredentials:!0,responseType:"blob"}).pipe(w.map(function(t){return t}),w.catchError(function(){return[]}))},lr.decorators=[{type:E.Injectable}],lr.ctorParameters=function(){return[{type:m.HttpClient}]},lr);function lr(t){this.httpClient=t,this.markupsApiUrl="/api/markups",this.redactApiUrl="/api/redaction"}var ur=(pr.decorators=[{type:E.Injectable}],pr.ctorParameters=function(){return[{type:g.Actions},{type:cr}]},x([g.Effect(),_("design:type",Object)],pr.prototype,"loadRedactions$",void 0),x([g.Effect(),_("design:type",Object)],pr.prototype,"saveRedaction$",void 0),x([g.Effect(),_("design:type",Object)],pr.prototype,"deleteRedaction$",void 0),x([g.Effect(),_("design:type",Object)],pr.prototype,"redact$",void 0),x([g.Effect(),_("design:type",Object)],pr.prototype,"unmarkAll$",void 0),pr);function pr(t,e){var o=this;this.actions$=t,this.redactionApiService=e,this.loadRedactions$=this.actions$.pipe(g.ofType(wn),w.map(function(t){return t.payload}),w.switchMap(function(t){return o.redactionApiService.getRedactions(t).pipe(w.map(function(t){return new On(t.body)}),w.catchError(function(t){return b.of(new Mn(t))}))})),this.saveRedaction$=this.actions$.pipe(g.ofType(Sn),w.map(function(t){return t.payload}),w.exhaustMap(function(t){return o.redactionApiService.saveRedaction(t).pipe(w.map(function(t){return new Nn(t)}),w.catchError(function(t){return b.of(new jn(t))}))})),this.deleteRedaction$=this.actions$.pipe(g.ofType(Cn),w.map(function(t){return t.payload}),w.exhaustMap(function(t){return o.redactionApiService.deleteRedaction(t).pipe(w.map(function(){return new Ln(t)}),w.catchError(function(t){return b.of(new Hn(t))}))})),this.redact$=this.actions$.pipe(g.ofType(xn),w.map(function(t){return t.payload}),w.exhaustMap(function(n){return o.redactionApiService.redact(n).pipe(w.map(function(t){var e=t.headers.get("content-disposition").split("filename="),e=1<e.length?e[1].replace(/"/g,""):"redacted-document-"+n.documentId;return new Un({blob:t.body,filename:e})}),w.catchError(function(t){return b.of(new zn(t))}))})),this.unmarkAll$=this.actions$.pipe(g.ofType(Dn),w.map(function(t){return t.payload}),w.exhaustMap(function(t){return o.redactionApiService.deleteAllMarkers(t).pipe(w.map(function(t){return new Gn}),w.catchError(function(t){return b.of(new Hn(t))}))}))}var dr=(hr.prototype.convert=function(t){return this.httpClient.post(this.documentConversionUrl+"/"+t,{},{observe:"response",withCredentials:!0,responseType:"blob"}).pipe(w.map(function(t){return t}),w.catchError(function(t){return b.of(t)}))},hr.decorators=[{type:E.Injectable}],hr.ctorParameters=function(){return[{type:m.HttpClient}]},hr);function hr(t){this.httpClient=t,this.documentConversionUrl="/doc-assembly/convert"}var mr=(gr.prototype.getRotation=function(t){t=this.rotationApiUrl+"/"+t;return this.httpClient.get(t,{observe:"response",withCredentials:!0})},gr.prototype.saveRotation=function(t){var e=this.rotationApiUrl+"/";return this.httpClient.post(e,t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t}),w.catchError(function(){return[]}))},gr.decorators=[{type:E.Injectable}],gr.ctorParameters=function(){return[{type:m.HttpClient}]},gr);function gr(t){this.httpClient=t,this.rotationApiUrl="/em-anno/metadata"}br.decorators=[{type:E.Injectable}],br.ctorParameters=function(){return[{type:g.Actions},{type:dr},{type:mr}]},x([g.Effect(),_("design:type",Object)],br.prototype,"convert$",void 0),x([g.Effect(),_("design:type",Object)],br.prototype,"loadRotation$",void 0),x([g.Effect(),_("design:type",Object)],br.prototype,"saveRotation$",void 0),Co=br;function br(t,e,n){var o=this;this.actions$=t,this.documentConversionService=e,this.rotationApiService=n,this.convert$=this.actions$.pipe(g.ofType(lt),w.map(function(t){return t.payload}),w.exhaustMap(function(t){return o.documentConversionService.convert(t).pipe(w.map(function(t){t=URL.createObjectURL(t.body);return new St(t)}),w.catchError(function(t){return b.of(new Et(t))}))})),this.loadRotation$=this.actions$.pipe(g.ofType(ht),w.map(function(t){return t.payload}),w.switchMap(function(t){return o.rotationApiService.getRotation(t).pipe(w.map(function(t){return new Pt(t.body)}),w.catchError(function(t){return b.of(new xt(t))}))})),this.saveRotation$=this.actions$.pipe(g.ofType(bt),w.map(function(t){return t.payload}),w.switchMap(function(t){return o.rotationApiService.saveRotation(t).pipe(w.map(function(t){return new Tt(t.body)}),w.catchError(function(t){return b.of(new Dt(t))}))}))}fr.decorators=[{type:E.Injectable}],fr.ctorParameters=function(){return[{type:g.Actions},{type:qa},{type:Xa}]},x([g.Effect(),_("design:type",Object)],fr.prototype,"loadIcpSession$",void 0),x([g.Effect(),_("design:type",Object)],fr.prototype,"joinIcpSocketSession$",void 0),ei=fr;function fr(t,e,n){var o=this;this.actions$=t,this.icpApiService=e,this.icpUpdateService=n,this.loadIcpSession$=this.actions$.pipe(g.ofType(Nt),w.map(function(t){return t.payload}),w.exhaustMap(function(t){return o.icpApiService.loadSession(t).pipe(w.map(function(t){return new Wt(t)}),w.catchError(function(t){return b.of(new zt(t))}))})),this.joinIcpSocketSession$=this.actions$.pipe(g.ofType(jt),w.map(function(t){return t.payload}),w.switchMap(function(e){return o.icpUpdateService.joinSession(e.username,e.session).pipe(w.map(function(t){return new qt({session:e.session,participantInfo:t})}))}))}ai=[ir,rr,ur,Co,ei],vr.prototype.ngOnInit=function(){var n=this;this.$subscription=this.store.pipe(S.select(Ba)).subscribe(function(t){return n.editableBookmark=t}),this.$subscription.add(this.store.select(eo).subscribe(function(e){Object.keys(e).map(function(t){n.pageLookup[t]=e[t]})}))},vr.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},vr.prototype.editBookmark=function(t){this.editableBookmark=t},vr.prototype.onBookmarkMove=function(t){var e=t.node,n=t.from,o=t.to,i=[P({},e,{previous:0<o.index?o.parent.children[o.index-1].id:undefined,parent:o.parent.documentId?o.parent.id:undefined})],t=this.getSibling(n,n.index);(t=t&&t.id===e.previous?this.getSibling(n,n.index+1):t)&&(i=O(i,[P({},t,{previous:e.previous})]));o=this.getSibling(o,o.index+1);o&&(i=O(i,[P({},o,{previous:e.id})])),this.store.dispatch(new ln(i))},vr.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 rn({deleted:O([t.data.id],gn(t.data.children)),updated:e}))},vr.prototype.updateBookmark=function(t,e){e=P({},t,{name:e});this.store.dispatch(new dn(e)),this.editableBookmark=undefined},vr.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])},vr.prototype.getSibling=function(t,e){return t.parent.children.length>e?t.parent.children[e]:undefined},vr.prototype.scaledY=function(t,e,n){n=n.viewportScale/this.zoom;return(e/this.zoom-t)/n},vr.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'}]}],vr.ctorParameters=function(){return[{type:S.Store}]},vr.propDecorators={bookmarkNodes:[{type:E.Input}],zoom:[{type:E.Input}],rotate:[{type:E.Input}],goToDestination:[{type:E.Output}]},ni=vr;function vr(t){this.store=t,this.goToDestination=new E.EventEmitter,this.pageLookup={},this.BOOKMARK_CHAR_LIMIT=30,this.options={allowDrag:!0,allowDrop:!0}}yr.prototype.ngOnInit=function(){var e=this;this.store.dispatch(new kt(this.extractDMStoreDocId(this.originalUrl))),this.$subscription=this.store.pipe(S.select(ao),w.filter(function(t){return!!t})).subscribe(function(t){t.url?(e.convertedUrl=t.url,e.store.dispatch(new Ct)):e.onLoadException(new Q(t.error))})},yr.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},yr.prototype.onMediaLoad=function(t){this.mediaLoadStatus.emit(t)},yr.prototype.onLoadException=function(t){this.viewerException.emit(t)},yr.prototype.onDocumentTitleChange=function(t){this.documentTitle.emit(t)},yr.prototype.extractDMStoreDocId=function(t){return t.includes("/documents/")?t=t.split("/documents/")[1]:t.includes("/documentsv2/")&&(t=t.split("/documentsv2/")[1]),t.replace("/binary","")},yr.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}]}],yr.ctorParameters=function(){return[{type:S.Store}]},yr.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}]},ui=yr;function yr(t){this.store=t,this.mediaLoadStatus=new E.EventEmitter,this.viewerException=new E.EventEmitter,this.documentTitle=new E.EventEmitter}var wr=(kr.prototype.onCancel=function(){this.toolbarEvents.icp.leavingSession.next(!1)},kr.prototype.onConfirm=function(){this.toolbarEvents.icp.confirmExit(),this.toolbarEvents.icp.leavingSession.next(!1)},kr.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'}]}],kr.ctorParameters=function(){return[{type:q}]},kr);function kr(t){this.toolbarEvents=t}Sr.prototype.ngOnInit=function(){this.bookmarksPerPage$=this.store.pipe(S.select(Oa))},Sr.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'}]}],Sr.ctorParameters=function(){return[{type:S.Store}]},Sr.propDecorators={zoom:[{type:E.Input}],rotate:[{type:E.Input}]},Ta=Sr;function Sr(t){this.store=t}Er.prototype.ngOnInit=function(){var e=this;this.$subscriptions=this.toolbarEvents.rotateSubject.subscribe(function(t){return e.onRotate(t)}),this.$subscriptions.add(this.toolbarEvents.saveRotationSubject.subscribe(function(){return e.saveRotation()})).add(this.store.pipe(S.select(ro)).subscribe(function(t){return e.savedRotation=t})).add(this.store.pipe(S.select(no)).subscribe(function(t){return e.documentId=t}))},Er.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},Er.prototype.onMediaLoad=function(t){var e=this;this.rotation=0,this.store.dispatch(new It(this.documentId)),this.store.pipe(S.select(so),w.filter(function(t){return!!t}),w.take(1)).subscribe(function(){e.savedRotation&&e.toolbarEvents.rotateSubject.next(e.savedRotation)})},Er.prototype.onRotate=function(t){this.rotation=(this.rotation+t)%360,this.toolbarButtons.showSaveRotationButton=this.savedRotation!==this.rotation},Er.prototype.saveRotation=function(){var t={documentId:this.documentId,rotationAngle:this.rotation};this.store.dispatch(new _t(t))},Er.decorators=[{type:E.Directive,args:[{selector:"[mvRotationPersist]"}]}],Er.ctorParameters=function(){return[{type:E.ElementRef},{type:S.Store},{type:tt},{type:q}]},Er.propDecorators={onMediaLoad:[{type:E.HostListener,args:["mediaLoadStatus",["$event"]]}]},xa=Er;function Er(t,e,n,o){this.el=t,this.store=e,this.toolbarButtons=n,this.toolbarEvents=o,this.rotation=0,this.savedRotation=0}Cr.prototype.ngOnInit=function(){var e=this;this.participants$=this.store.pipe(S.select(fi)),this.presenter$=this.store.pipe(S.select(hi)),this.isPresenter$=this.store.pipe(S.select(bi)),this.subscription=this.toolbarEvents.icp.participantsListVisible.subscribe(function(t){return e.showParticipantsList=t})},Cr.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},Cr.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'}]}],Cr.ctorParameters=function(){return[{type:q},{type:S.Store}]},_a=Cr;function Cr(t,e){this.toolbarEvents=t,this.store=e,this.showParticipantsList=!1}Ir.prototype.ngOnInit=function(){var e=this;this.$subscription=this.store.select(eo).subscribe(function(t){t[1]&&(e.allPages=t)})},Ir.prototype.ngOnDestroy=function(){this.$subscription&&this.$subscription.unsubscribe()},Ir.prototype.onMouseUp=function(t){var e=t.target.offsetParent.offsetParent,e=parseInt(e.getAttribute("data-page-number"),10);this.toolbarEvents.highlightModeSubject.getValue()&&(t=this.getRectangles(t,e),this.viewerEvents.textSelected({page:e,rectangles:t}))},Ir.prototype.onPdfViewerClick=function(t){this.store.dispatch(new Ee({annotationId:"",selected:!1,editable:!1})),this.viewerEvents.clearCtxToolbar()},Ir.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);e=window.getSelection();if(e){t=t.target;if(this.removeEnhancedTextModeStyling(t),e.rangeCount&&!e.isCollapsed){var n=e.getRangeAt(0).cloneRange().getClientRects();if(n){for(var o=t.parentElement.getBoundingClientRect(),i=[],a=0;a<n.length;a++){var r=this.createTextRectangle(n[a],o);i.push(r)}return i}}}},Ir.prototype.createTextRectangle=function(t,e){var n=t.bottom-t.top,o=t.right-t.left,i=t.top-e.top,e=t.left-e.left,e=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,n,o,i,e,this.rotate,this.zoom);return e=P({id:C()},e)},Ir.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()}},Ir.decorators=[{type:E.Directive,args:[{selector:"[mvCreateTextHighlight]"}]}],Ir.ctorParameters=function(){return[{type:E.ElementRef},{type:q},{type:co},{type:Pi},{type:S.Store}]},Ir.propDecorators={onMouseUp:[{type:E.HostListener,args:["mouseup",["$event"]]}],onPdfViewerClick:[{type:E.HostListener,args:["mousedown",["$event"]]}]},a=Ir;function Ir(t,e,n,o,i){this.element=t,this.toolbarEvents=e,this.viewerEvents=n,this.highlightService=o,this.store=i}Pr.prototype.ngOnInit=function(){var t=this;this.subscription=this.toolbarEvents.downloadSubject.subscribe(function(){return t.downloadLink.nativeElement.click()}),this.loadStatus.emit(J.SUCCESS)},Pr.prototype.ngOnChanges=function(t){t.url&&this.reloadVideo()},Pr.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},Pr.prototype.reloadVideo=function(){this.videoPlayer&&(this.playbackMsg="loading",this.videoPlayer.nativeElement.load())},Pr.prototype.onSuccess=function(){this.playbackMsg="success"},Pr.prototype.onError=function(){this.playbackMsg="error"},Pr.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'}]}],Pr.ctorParameters=function(){return[{type:q}]},Pr.propDecorators={url:[{type:E.Input}],downloadFileName:[{type:E.Input}],multimediaOn:[{type:E.Input}],loadStatus:[{type:E.Output}],downloadLink:[{type:E.ViewChild,args:["downloadLink"]}],videoPlayer:[{type:E.ViewChild,args:["videoPlayer"]}]},r=Pr;function Pr(t){this.toolbarEvents=t,this.loadStatus=new E.EventEmitter,this.playbackMsg="loading"}xr.decorators=[{type:E.NgModule,args:[{imports:[l.CommonModule,m.HttpClientModule,wi,Na,p.TagInputModule,u.FormsModule,u.ReactiveFormsModule,d.RouterModule,S.StoreModule.forFeature("media-viewer",Jn),g.EffectsModule.forFeature(ai),y.TreeModule.forRoot(),v.MutableDivModule],declarations:[uo,Ha,ni,Va,go,fo,r,Go,ui,Fa,xa,a,wr,za,Ta,_a],entryComponents:[uo,go,fo],providers:[Z,ko,cr,qa,Xa,Za,nr,Ja,tr,cr,dr,mr],exports:[Go]}]}],v=xr;function xr(){}t.MediaViewerModule=v,t.ToolbarButtonVisibilityService=tt,t.ToolbarEventService=q,t.ToolbarModule=wi,t.AnnotationApiService=yo,t.AnnotationsModule=Na,t.ResponseType=J,t.ViewerException=Q,t.reducer=De,t.initialState=Te,t.getAnnoSet=Be,t.getCommentEnts=Re,t.getAnnoPageEnt=Oe,t.getAnnoEnt=Me,t.getSelectedAnno=Ae,t.commentSearchQ=Ne,t.getSummaryFilters=je,t.getAnnotationsSetState=To,t.getAnnotationEntities=Do,t.getSet=Bo,t.getDocumentIdSetId=Ro,t.getAnnotationSet=Oo,t.getSelectedAnnotation=Mo,t.getCommentEntities=Ao,t.getPageEntities=No,t.getComponentSearchQueries=jo,t.getComponentSearchText=Fo,t.getCommentSummaryFilters=Lo,t.getAnnoPerPage=Ho,t.getCommentsArray=$o,t.getCommentSummary=Vo,t.getFilteredAnnotations=Uo,t.LOAD_ANNOTATION_SET=Qt,t.LOAD_ANNOTATION_SET_SUCCESS=te,t.LOAD_ANNOTATION_SET_FAIL=ee,t.SAVE_ANNOTATION=ne,t.SAVE_ANNOTATION_SUCCESS=oe,t.SAVE_ANNOTATION_FAIL=ie,t.ADD_OR_EDIT_COMMENT=ae,t.DELETE_ANNOTATION=re,t.DELETE_ANNOTATION_SUCCESS=se,t.DELETE_ANNOTATION_FAIL=ce,t.SELECT_ANNOTATION=le,t.SEARCH_COMMENT=ue,t.APPLY_COMMENT_SUMMARY_FILTER=pe,t.CLEAR_COMMENT_SUMMARY_FILTER=de,t.LoadAnnotationSet=he,t.LoadAnnotationSetSucess=me,t.LoadAnnotationSetFail=ge,t.SaveAnnotation=be,t.SaveAnnotationSuccess=fe,t.SaveAnnotationFail=ve,t.AddOrEditComment=ye,t.DeleteAnnotation=we,t.DeleteAnnotationSuccess=ke,t.DeleteAnnotationFail=Se,t.SelectedAnnotation=Ee,t.SearchComment=Ce,t.ApplyCommentSymmaryFilter=Ie,t.ClearCommentSummaryFilters=Pe,t.AnnotationEffects=ir,t.ɵbc=zi,t.ɵcw=a,t.ɵz=Pi,t.ɵbd=Ci,t.ɵbb=Si,t.ɵbf=_i,t.ɵbl=Mi,t.ɵy=Ma,t.ɵbo=ta,t.ɵbu=na,t.ɵbj=Zi,t.ɵbi=qi,t.ɵbn=Ni,t.ɵbm=Fi,t.ɵbg=Ri,t.ɵbe=ko,t.ɵbk=Xi,t.ɵbp=Hi,t.ɵbq=Vi,t.ɵbt=ra,t.ɵbv=pa,t.ɵbw=ha,t.ɵbx=la,t.ɵbh=Di,t.ɵbs=Ji,t.ɵcz=Ta,t.ɵcx=wr,t.ɵdd=tr,t.ɵdc=Ja,t.ɵcg=qa,t.ɵch=Xa,t.ɵdb=nr,t.ɵda=_a,t.ɵci=Za,t.ɵcs=Go,t.ɵbr=X,t.ɵcy=za,t.ɵcb=cr,t.ɵu=ga,t.ɵv=fa,t.ɵw=ka,t.ɵx=Ea,t.ɵt=Ia,t.ɵc=Yo,t.ɵbz=rr,t.ɵcc=Co,t.ɵcf=ei,t.ɵby=ai,t.ɵca=ur,t.ɵo=yn,t.ɵi=Kt,t.ɵj=Jt,t.ɵq=Kn,t.ɵp=Yn,t.ɵg=Qn,t.ɵf=Jn,t.ɵl=He,t.ɵm=$e,t.ɵk=Le,t.ɵde=to,t.ɵdf=eo,t.ɵdi=xo,t.ɵdh=Po,t.ɵdg=Eo,t.ɵr=vi,t.ɵb=Ko,t.ɵd=ci,t.ɵa=Qo,t.ɵct=ui,t.ɵcd=dr,t.ɵcu=Fa,t.ɵco=go,t.ɵcr=r,t.ɵck=Z,t.ɵcj=uo,t.ɵcm=ni,t.ɵcn=Va,t.ɵcl=Ha,t.ɵce=mr,t.ɵcv=xa,t.ɵcq=fo,t.ɵba=co,t.ɵcp=ho,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("pdfjs-dist/web/pdf_viewer"),require("pdfjs-dist"),require("pdfjs-dist/build/pdf.worker"),require("uuid/v4"),require("hammerjs"),require("@angular/cdk/overlay"),require("@angular/cdk/a11y"),require("@swimlane/ngx-datatable"),require("moment-timezone"),require("@angular/common"),require("@angular/forms"),require("ngx-chips"),require("@angular/router"),require("socket.io-client/dist/socket.io.js"),require("@angular/common/http"),require("@ngrx/effects"),require("rxjs"),require("mutable-div"),require("angular-tree-component"),require("rxjs/operators"),require("uuid"),require("@ngrx/store"),require("@angular/core")):"function"==typeof define&&define.amd?define("@hmcts/media-viewer",["exports","pdfjs-dist/web/pdf_viewer","pdfjs-dist","pdfjs-dist/build/pdf.worker","uuid/v4","hammerjs","@angular/cdk/overlay","@angular/cdk/a11y","@swimlane/ngx-datatable","moment-timezone","@angular/common","@angular/forms","ngx-chips","@angular/router","socket.io-client/dist/socket.io.js","@angular/common/http","@ngrx/effects","rxjs","mutable-div","angular-tree-component","rxjs/operators","uuid","@ngrx/store","@angular/core"],e):e((t.hmcts=t.hmcts||{},t.hmcts["media-viewer"]={}),t.pdfjsViewer,t.pdfjsLib,0,t.uuid,0,t.ng.cdk.overlay,t.ng.cdk.a11y,t.ngxDatatable,t.moment,t.ng.common,t.ng.forms,t.ngxChips,t.ng.router,t.socketio,t.ng.common.http,t.effects,t.rxjs,t.mutableDiv,t.angularTreeComponent,t.rxjs.operators,t.uuid$1,t.store,t.ng.core)}(this,function(t,n,s,e,b,o,i,a,r,c,l,u,p,d,h,m,g,f,v,y,w,k,S,E){"use strict";b=b&&b.hasOwnProperty("default")?b["default"]:b,c=c&&c.hasOwnProperty("default")?c["default"]:c,h=h&&h.hasOwnProperty("default")?h["default"]:h;var C="default"in k?k["default"]:k,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 P(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;0<=s;s--)(i=t[s])&&(r=(a<3?i(r):3<a?i(e,n,r):i(e,n))||r);return 3<a&&r&&Object.defineProperty(e,n,r),r}function _(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function T(t,e,s,c){return new(s=s||Promise)(function(n,o){function i(t){try{r(c.next(t))}catch(e){o(e)}}function a(t){try{r(c["throw"](t))}catch(e){o(e)}}function r(t){var e;t.done?n(t.value):((e=t.value)instanceof s?e:new s(function(t){t(e)})).then(i,a)}r((c=c.apply(t,e||[])).next())})}function D(n,o){var i,a,r,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},t={next:e(0),"throw":e(1),"return":e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return c([e,t])}}function c(t){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,a&&(r=2&t[0]?a["return"]:t[0]?a["throw"]||((r=a["return"])&&r.call(a),0):a.next)&&!(r=r.call(a,t[1])).done)return r;switch(a=0,(t=r?[2&t[0],r.value]:t)[0]){case 0:case 1:r=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(r=0<(r=s.trys).length&&r[r.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!r||t[1]>r[0]&&t[1]<r[3])){s.label=t[1];break}if(6===t[0]&&s.label<r[1]){s.label=r[1],r=t;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(t);break}r[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=r=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}function B(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{value:(t=t&&o>=t.length?void 0:t)&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function R(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||0<e--)&&!(o=a.next()).done;)r.push(o.value)}catch(s){i={error:s}}finally{try{o&&!o.done&&(n=a["return"])&&n.call(a)}finally{if(i)throw i.error}}return r}function O(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(R(arguments[e]));return t}s.GlobalWorkerOptions.workerSrc="/assets/build/pdf.worker.min.js";var M={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};M[M.FOUND]="FOUND",M[M.NOT_FOUND]="NOT_FOUND",M[M.WRAPPED]="WRAPPED",M[M.PENDING]="PENDING";var A=(N.prototype.emitDocumentInfo=function(t){var e=O(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)},N.prototype.loadDocument=function(r){return T(this,void 0,void 0,function(){var e,n,o,i,a=this;return D(this,function(t){switch(t.label){case 0:(e=s.getDocument({url:r,cMapUrl:"assets/minified/cmaps",cMapPacked:!0,withCredentials:!0})).onProgress=function(t){var e=t.loaded,t=t.total;a.documentLoadProgress.next({loaded:e,total:t})},this.documentLoadInit.next(r),t.label=1;case 1:return t.trys.push([1,5,,6]),[4,e.promise];case 2:return n=t.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=t.sent(),this.outlineLoaded.next(this.documentOutline),[4,n.getMetadata()];case 4:return i=t.sent(),this.setCurrentPDFTitle(i.info.Title),[3,6];case 5:return i=t.sent(),this.documentLoadFailed.next(i),[3,6];case 6:return[2]}})})},N.prototype.downloadFile=function(t,e){this.downloadManager.downloadUrl(t,e)},N.prototype.setPageNumber=function(t){this.pdfViewer.currentPageNumber=t},N.prototype.getPageNumber=function(){return this.pdfViewer.currentPageNumber},N.prototype.changePageNumber=function(t){this.pdfViewer.currentPageNumber+=t},N.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})},N.prototype.clearSearch=function(){this.pdfViewer.eventBus.dispatch("findbarclose")},N.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)},N.prototype.setZoom=function(t){this.pdfViewer.currentScaleValue=this.getZoomValue(t),this.zoomValue=this.pdfViewer.currentScaleValue,this.toolbarEvents.zoomValueSubject.next(this.pdfViewer.currentScaleValue)},N.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)},N.prototype.getZoomValue=function(t){return isNaN(t)?this.zoomValue:5<t?5:t<.1?.1:+t.toFixed(2)},N.prototype.rotate=function(t){return this.pdfViewer.pagesRotation=(this.pdfViewer.pagesRotation+t)%360},N.prototype.resetRotation=function(t){return this.pdfViewer.pagesRotation=t},N.prototype.getNormalisedPagesRotation=function(){return this.pdfViewer.pagesRotation},N.prototype.getCurrentPDFZoomValue=function(){return this.pdfViewer.currentScaleValue},N.prototype.setCurrentPDFTitle=function(t){this.documentTitle=t},N.prototype.getCurrentPDFTitle=function(){return this.documentTitle},N);function N(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!==M.PENDING&&u.toolbarEvents.searchResultsCountSubject.next(t.matchesCount)}),this.pdfViewer.eventBus.on("updatefindmatchescount",function(t){u.toolbarEvents.searchResultsCountSubject.next(t.matchesCount)}),this.zoomValue=1}var j=new f.BehaviorSubject(!1),F=new f.Subject,L=new f.Subject,H=new f.Subject,$=new f.BehaviorSubject(!1),V=new f.Subject,U=new f.BehaviorSubject(!1),z=function(){F.next()},W=Object.freeze({enabled:j,sessionLaunch:F,becomingPresenter:L,stoppingPresenting:H,leavingSession:$,sessionExitConfirmed:V,participantsListVisible:U,launchSession:z,enable:function(){j.next(!0),z()},becomePresenter:function(){L.next()},stopPresenting:function(){H.next()},leaveSession:function(){$.next(!0)},confirmExit:function(){V.next(),U.next(!1),j.next(!1)}}),q=(G.prototype.reset=function(){this.setCurrentPageSubject.next(1),this.zoomValueSubject.next(1),this.highlightModeSubject.next(!1),this.drawModeSubject.next(!1),this.showCommentSummary.next(!1)},G.prototype.toggleHighlightMode=function(){!1===this.highlightModeSubject.getValue()?(this.drawModeSubject.next(!1),this.highlightModeSubject.next(!0)):this.highlightModeSubject.next(!1)},G.prototype.toggleDrawMode=function(){!1===this.drawModeSubject.getValue()?(this.highlightModeSubject.next(!1),this.drawModeSubject.next(!0)):this.drawModeSubject.next(!1)},G.prototype.rotate=function(t){this.rotateSubject.next(t)},G.prototype.search=function(t){this.searchSubject.next(t)},G.prototype.getSearchResultsCount=function(){return this.searchResultsCountSubject.asObservable()},G.prototype.zoom=function(t){this.zoomSubject.next(t)},G.prototype.stepZoom=function(t){this.stepZoomSubject.next(t)},G.prototype.getZoomValue=function(){return this.zoomValueSubject.asObservable()},G.prototype.getPageCount=function(){return this.pageCountSubject.asObservable()},G.prototype.print=function(){this.printSubject.next()},G.prototype.download=function(){this.downloadSubject.next()},G.prototype.setPage=function(t){this.setCurrentPageSubject.next(t)},G.prototype.incrementPage=function(t){this.changePageByDeltaSubject.next(t)},G.prototype.getCurrentPageNumber=function(){return this.setCurrentPageInputValueSubject.asObservable()},G.prototype.getShowCommentSummary=function(){return this.showCommentSummary.asObservable()},G.prototype.toggleCommentsSummary=function(t){this.showCommentSummary.next(t)},G.prototype.saveRotation=function(){this.saveRotationSubject.next()},G.prototype.toggleGrabNDrag=function(){this.grabNDrag.next(!this.grabNDrag.getValue())},G.prototype.toggleSideBar=function(t){this.sidebarOpen.next(t)},G.prototype.toggleRedactionMode=function(){this.redactionMode.next(!this.redactionMode.getValue())},G.prototype.toggleRedactionPreview=function(t){this.redactionPreview.next(t)},G.prototype.unmarkAll=function(){this.clearAllRedactMarkers.next()},G.prototype.applyRedactionToDocument=function(){this.applyRedactToDocument.next()},G.prototype.toggleCommentsPanel=function(t){t&&this.toggleParticipantsList(!t),this.commentsPanelVisible.next(t)},G.prototype.toggleParticipantsList=function(t){t&&this.toggleCommentsPanel(!t),this.icp.participantsListVisible.next(t)},G.decorators=[{type:E.Injectable,args:[{providedIn:"root"}]}],G.ngInjectableDef=E.defineInjectable({factory:function(){return new G},token:G,providedIn:"root"}),G);function G(){this.highlightModeSubject=new f.BehaviorSubject(!1),this.drawModeSubject=new f.BehaviorSubject(!1),this.rotateSubject=new f.Subject,this.searchSubject=new f.Subject,this.searchResultsCountSubject=new f.Subject,this.zoomSubject=new f.Subject,this.stepZoomSubject=new f.Subject,this.zoomValueSubject=new f.BehaviorSubject(1),this.pageCountSubject=new f.Subject,this.printSubject=new f.Subject,this.downloadSubject=new f.Subject,this.setCurrentPageSubject=new f.Subject,this.setCurrentPageInputValueSubject=new f.Subject,this.changePageByDeltaSubject=new f.Subject,this.showCommentSummary=new f.BehaviorSubject(!1),this.grabNDrag=new f.BehaviorSubject(!1),this.saveRotationSubject=new f.Subject,this.redactionMode=new f.BehaviorSubject(!1),this.redactionPreview=new f.Subject,this.applyRedactToDocument=new f.Subject,this.clearAllRedactMarkers=new f.Subject,this.sidebarOpen=new f.BehaviorSubject(!1),this.searchBarHidden=new f.BehaviorSubject(!0),this.commentsPanelVisible=new f.BehaviorSubject(!1),this.icp=W}var Z=(Y.prototype.create=function(t){var e=new n.PDFFindController({linkService:this.linkService,eventBus:this.eventBus}),e=new n.PDFViewer({container:t.nativeElement,linkService:this.linkService,findController:e,eventBus:this.eventBus,imageResourcesPath:"/assets/images/",textLayerMode:2});return this.linkService.setViewer(e),this.pdfJsWrapper=new A(e,new n.DownloadManager({}),this.toolbarEvents,new f.Subject,new f.Subject,new f.Subject,new f.Subject,new f.Subject,new f.Subject,new f.Subject),this.pdfJsWrapper},Y.prototype.pdfWrapper=function(){return this.pdfJsWrapper},Y.decorators=[{type:E.Injectable,args:[{providedIn:"root"}]}],Y.ctorParameters=function(){return[{type:q}]},Y.ngInjectableDef=E.defineInjectable({factory:function(){return new Y(E.inject(q))},token:Y,providedIn:"root"}),Y);function Y(t){this.toolbarEvents=t,this.linkService=new n.PDFLinkService,this.eventBus=new n.EventBus}var X=(K.prototype.printDocumentNatively=function(t){window.open(t).print()},K.prototype.printElementNatively=function(t,e,n){n=window.open("","","left=0,top=0,width="+e+",height="+n+",toolbar=0,scrollbars=0,status=0");n.document.write(t.innerHTML),n.document.close(),n.focus(),n.print(),n.close()},K.decorators=[{type:E.Injectable,args:[{providedIn:"root"}]}],K.ngInjectableDef=E.defineInjectable({factory:function(){return new K},token:K,providedIn:"root"}),K);function K(){}var J={SUCCESS:"SUCCESS",FAILURE:"FAILURE",UNSUPPORTED:"UNSUPPORTED"},Q=function(t,e){this.exceptionType=t,this.detail=e},tt=(et.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]},et.decorators=[{type:E.Injectable,args:[{providedIn:"root"}]}],et.ngInjectableDef=E.defineInjectable({factory:function(){return new et},token:et,providedIn:"root"}),et);function et(){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}var nt={showPrint:!0,showDownload:!0,showNavigation:!0,showZoom:!0,showRotate:!0,showSearchBar:!0,showSidebar:!0,showGrabNDragButton:!0,showCommentSummary:!0,showPresentationMode:!0,showRedact:!0},ot={showPrint:!0,showDownload:!0,showZoom:!0,showRotate:!0,showGrabNDragButton:!0,showCommentSummary:!0,showRedact:!0},it={showDownload:!0},at={showDownload:!0,showPrint:!0},rt="[Document] Set Document Id",st="[Document] Position Updated",ct="[Document] Add Pages",lt="[Document] Convert",ut="[Document] Convert Success",pt="[Document] Convert Fail",dt="[Document] Clear Convert Doc Url",ht="[Document] Load Rotation",mt="[Document] Load Rotation Success",gt="[Document] Load Rotation Fail",ft="[Document] Save Rotation",bt="[Document] Save Rotation Success",vt=function(t){this.payload=t,this.type=rt},yt=function(t){this.payload=t,this.type=ct},wt=function(t){this.payload=t,this.type=st},kt=function(t){this.payload=t,this.type=lt},St=function(t){this.payload=t,this.type=ut},Et=function(t){this.payload=t,this.type=pt},Ct=function(){this.type=dt},It=function(t){this.payload=t,this.type=ht},Pt=function(t){this.payload=t,this.type=mt},xt=function(t){this.payload=t,this.type=gt},_t=function(t){this.payload=t,this.type=ft},Tt=function(t){this.payload=t,this.type=bt},Dt=function(t){this.payload=t,this.type="[Document] Save Rotation Fail"},Bt="[Tags] Add Filter Tags",Rt="[Tags] Clear Filter Tags",Ot=function(t){this.payload=t,this.type=Bt},Mt=function(){this.type=Rt},At="[Icp] Set Case Id",Nt="[Icp] Load Session",jt="[Icp] Join Socket Session",Ft="[Icp] Socket Session Joined",Lt="[Icp] Leave Socket Session",Ht="[Icp] Presenter Updated",$t="[Icp] Participant List Updated",Vt=function(t){this.payload=t,this.type=At},Ut=function(t){this.payload=t,this.type=Nt},zt=function(t){this.payload=t,this.type="[Icp] Load Session Failure"},Wt=function(t){this.payload=t,this.type=jt},qt=function(t){this.payload=t,this.type=Ft},Gt=function(){this.type=Lt},Zt=function(t){this.payload=t,this.type=Ht},Yt=function(t){this.payload=t,this.type=$t},Xt={convertedDocument:undefined,documentId:undefined,pdfPosition:undefined,pages:{},hasDifferentPageSize:!1,rotation:undefined,rotationLoaded:!1,loading:!1,loaded:!1};function Kt(t,e){switch(void 0===t&&(t=Xt),e.type){case ut:var n={url:e.payload,error:undefined};return P({},t,{convertedDocument:n});case pt:n={url:undefined,error:e.payload};return P({},t,{convertedDocument:n});case dt:n=undefined;return P({},t,{convertedDocument:n});case ht:return P({},t,{rotationLoaded:!1});case mt:var o=(i=e.payload)?i.rotationAngle:0;return P({},t,{rotation:o,rotationLoaded:!0});case gt:return P({},t,{rotation:0,rotationLoaded:!0});case bt:var i,o=(i=e.payload).rotationAngle;return P({},t,{rotation:o});case rt:return P({},t,{documentId:e.payload});case ct: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({},c,((e={})[t.id]=n,e))}),P({},t,{pages:c,hasDifferentPageSize:l});case st:s=e.payload;return P({},t,{pdfPosition:s})}return t}var Jt=function(t){return t.pages},Qt="[Annotations] Load Annotation Set",te="[Annotations] Load Annotation Set Success",ee="[Annotations] Load Annotation Set Fail",ne="[Annotations] Save Annotation",oe="[Annotations] Save Annotation Success",ie="[Annotations] Save Annotation Fail",ae="[Annotations] Add or Edit Comment",re="[Annotations] Delete Annotation",se="[Annotations] Delete Annotation Success",ce="[Annotations] Delete Annotation Fail",le="[Annotations] Select Annotation",ue="[Comments] Search Comments",pe="[Comments] Apply Comment Summary Filter",de="[Comments] Clear Comment Summary Filter",he=function(t){this.payload=t,this.type=Qt},me=function(t){this.payload=t,this.type=te},ge=function(t){this.payload=t,this.type=ee},fe=function(t){this.payload=t,this.type=ne},be=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=re},ke=function(t){this.payload=t,this.type=se},Se=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},Pe=function(){this.type=de},xe=(_e.groupByKeyEntities=function(t,o){return t.reduce(function(t,e){var n;return Object.assign(t,((n={})[e[o]]=(t[e[o]]||[]).concat(e),n))},{})},_e.generateCommentsEntities=function(t){return t.reduce(function(t,e){var n;if(e.comments.length){var o=P({},e.comments[0]||"",{tags:O(e.tags||[])});return P({},t,((n={})[e.id]=o,n))}return P({},t)},{})},_e.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({},t,e)},{});return this.genNameEnt(t,n)},_e.genNameEnt=function(o,t){return Object.keys(t).reduce(function(t,e){var n=o.filter(function(t){return t.tags.find(function(t){return t.name===e})}).map(function(t){return t.id}).reduce(function(t,e){return P({},t,((t={})[e]=e,t))},{});return P({},t,((t={})[e]=n,t))},{})},_e.generateAnnotationEntities=function(t){return t.reduce(function(t,e){var n=P({},e,{positionTop:e.rectangles[0].y});return P({},t,((t={})[e.id]=n,t))},{})},_e.generateRedactionEntities=function(t){return t.reduce(function(t,e){return P({},t,((t={})[e.redactionId]=e,t))},{})},_e.resetCommentEntSelect=function(n){return Object.keys(n).reduce(function(t,e){return t[e]=P({},n[e],{editable:!1,selected:!1}),t},{})},_e.filterCommentsSummary=function(t,r){if(Object.keys(r).length){var e=Object.keys(r.tagFilters).filter(function(t){return!0===r.tagFilters[t]}).length,s=r.dateRangeFrom||r.dateRangeTo,n=t.filter(function(t){var e,n,o,i=!1,a=!1;return r.hasOwnProperty("tagFilters")&&Object.keys(r.tagFilters).forEach(function(e){if(r.tagFilters[e])return t.tags.forEach(function(t){t.name!==e||i||(i=!0)})}),s&&(e=c(t.lastModifiedDate),n=null!==r.dateRangeFrom?c(r.dateRangeFrom):undefined,(o=null!==r.dateRangeTo?c(r.dateRangeTo):undefined)&&n&&n<e&&e<o&&(a=!0),o&&!n&&e<=o&&(a=!0),n&&!o&&n<e&&(a=!0)),i||a});return e||s?n:t}return t},_e);function _e(){}var Te={annotationSet:{},annotationEntities:{},commentEntities:{},annotationPageEntities:{},selectedAnnotation:null,commentSearchQueries:{commentSearch:""},commentSummaryFilters:{hasFilter:!1,filters:{}},loading:!1,loaded:!1};function De(t,e){var n;switch(void 0===t&&(t=Te),e.type){case Qt:var o=P({},t.annotationSet,{documentId:e.payload});return P({},Te,{annotationSet:o,loading:!0});case te:case ee:var o=200===e.payload.status?e.payload.body:P({},t.annotationSet,{annotations:[],id:b()}),i=xe.generateAnnotationEntities(o.annotations),a=xe.groupByKeyEntities(o.annotations,"page"),r=xe.generateCommentsEntities(o.annotations);return P({},t,{annotationSet:o,annotationEntities:i,annotationPageEntities:a,commentEntities:r,loading:!1,loaded:!0});case oe:var s=e.payload,c=P({},t.annotationEntities,((u={})[s.id]=s,u)),l=Object.keys(c).map(function(t){return c[t]}),i=xe.generateAnnotationEntities(l),a=xe.groupByKeyEntities(l,"page"),r=xe.generateCommentsEntities(l),u=P({},t.selectedAnnotation,{annotationId:s.id,editable:!1});return P({},t,{annotationEntities:i,annotationPageEntities:a,commentEntities:r,selectedAnnotation:u,loading:!1,loaded:!0});case se:var p=e.payload,l=t.annotationEntities[p].page;delete(i=P({},t.annotationEntities))[p];s=O(t.annotationPageEntities[l].filter(function(t){return t.id!==p})),a=P({},t.annotationPageEntities,((u={})[l]=s,u)),r=P({},t.commentEntities);return t.commentEntities[p]&&delete r[p],P({},t,{annotationEntities:i,annotationPageEntities:a,commentEntities:r});case ae:var d=((m={})[e.payload.annotationId]=e.payload,m),h=P({},t.commentEntities,d);return P({},t,{commentEntities:h});case le:var a=e.payload,m=P({},t.commentEntities[a.annotationId],{editable:a.editable,selected:a.selected}),d=xe.resetCommentEntSelect(P({},t.commentEntities)),r=a.annotationId&&t.commentEntities[a.annotationId]?P({},d,((h={})[a.annotationId]=m,h)):P({},d);return P({},t,{commentEntities:r,selectedAnnotation:e.payload});case ue:var g=P({},t.commentSearchQueries,{commentSearch:e.payload}),r=xe.resetCommentEntSelect(P({},t.commentEntities));return P({},t,{commentEntities:r,commentSearchQueries:g});case pe:var f=e.payload,g=(n=!1,f.tagFilters&&Object.keys(f.tagFilters).map(function(t){f.tagFilters[t]&&!n&&(n=!0)}),n||!!f.dateRangeFrom||!!f.dateRangeTo);return P({},t,{commentSummaryFilters:{hasFilter:g,filters:f}});case de:return P({},t,{commentSummaryFilters:P({},Te.commentSummaryFilters)})}return t}var Be=function(t){return t.annotationSet},Re=function(t){return t.commentEntities},Oe=function(t){return t.annotationPageEntities},Me=function(t){return t.annotationEntities},Ae=function(t){return t.selectedAnnotation},Ne=function(t){return t.commentSearchQueries},je=function(t){return t.commentSummaryFilters},Fe={tagNameEnt:{},annotations:[],filteredPageEntities:{},filteredComments:{},formFilterState:{},filters:[]};function Le(n,t){switch(void 0===n&&(n=Fe),t.type){case Qt:return P({},n,Fe);case te:var e=t.payload.body.annotations,o=xe.genTagNameEntities(e);return P({},n,{tagNameEnt:o,annotations:e});case oe:var i=t.payload,a=O(n.annotations).filter(function(t){return t.id!==i.id})||[],e=O(a,[i]),o=xe.genTagNameEntities(e);return P({},n,{annotations:e,tagNameEnt:o});case se:var r=t.payload,e=O(n.annotations).filter(function(t){return t.id!==r}),o=xe.genTagNameEntities(e),s=xe.groupByKeyEntities(e,"page");return delete(l=P({},n.filteredComments))[r],P({},n,{annotations:e,tagNameEnt:o,filteredComments:l,filteredPageEntities:s,filters:[]});case Bt:var c=t.payload,o=Object.keys(c).reduce(function(t,e){return c[e]?O(t,[e]):t},[]),l=o.reduce(function(t,e){return P({},t,n.tagNameEnt[e])},{}),e=Object.keys(l).map(function(e){return n.annotations.filter(function(t){return t.id===e})[0]}),s=xe.groupByKeyEntities(e,"page");return P({},n,{filters:o,filteredComments:l,filteredPageEntities:s});case Rt:return P({},n,{filters:[],filteredComments:{},filteredPageEntities:{}})}return n}var He=function(t){return t.filteredComments},$e=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",Ye="[Bookmarks] Move Bookmark",Xe="[Bookmarks] Move Bookmark Success",Ke="[Bookmarks] Update Bookmark",Je="[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"},rn=function(t){this.payload=t,this.type=Ge},sn=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=Ye},un=function(t){this.payload=t,this.type=Xe},pn=function(t){this.payload=t,this.type="[Bookmarks] Move Bookmark Failure"},dn=function(t){this.payload=t,this.type=Ke},hn=function(t){this.payload=t,this.type=Je},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&&0<e.children.length?O(t,[e.id],gn(e.children)):O(t,[e.id])},[]):[]},fn=function(t){return t.reduce(function(t,e){return Object.assign(t,((t={})[e.id]=e,t))},{})},bn=function(o){for(var i=Object.keys(o),t=0;0<i.length;t++)!function(e){var n=[];i.forEach(function(t){o[t].previous&&i.includes(o[t].previous.toString())||(o[t].index=e,n.push(t))}),n.forEach(function(t){return i.splice(i.indexOf(t),1)}),n=[]}(t)},vn={bookmarks:[],bookmarkEntities:{},bookmarkPageEntities:{},editableBookmark:undefined,loaded:!1,loading:!1};function yn(t,e){switch(void 0===t&&(t=vn),e.type){case Ve:return P({},t,{loading:!0});case Ue:case ze:var n=200===e.payload.status?e.payload.body:[],o=fn(n),i=xe.groupByKeyEntities(n,"pageNumber");return P({},t,{bookmarks:n,bookmarkEntities:o,bookmarkPageEntities:i,loaded:!0});case qe:var a=e.payload,r=P({},t.bookmarkEntities,((l={})[a.id]=a,l)),s=Object.keys(r).map(function(t){return r[t]}),i=xe.groupByKeyEntities(s,"pageNumber"),c=a.id;return P({},t,{bookmarkEntities:r,editableBookmark:c,bookmarkPageEntities:i,loading:!1,loaded:!0});case Xe:var l=fn(e.payload),o=P({},t.bookmarkEntities,l);return P({},t,{bookmarkEntities:o,loading:!1,loaded:!0});case Ze:var u=e.payload,p=P({},t.bookmarkEntities),d=P({},t.bookmarkPageEntities),h={};return u.forEach(function(t){h[p[t].pageNumber]!==undefined&&0<h[p[t].pageNumber].length?h[p[t].pageNumber].push(t):h[p[t].pageNumber]=[t],delete p[t]}),Object.entries(h).forEach(function(t){var e=R(t,2),t=e[0],n=e[1];d[t]=d[t].filter(function(t){return n.includes(t)})}),P({},t,{bookmarkEntities:p,bookmarkPageEntities:d,loading:!1,loaded:!0});case Je:var a=e.payload,m=P({},t.bookmarkEntities,((u={})[a.id]=P({},a),u)),s=Object.keys(m).map(function(t){return m[t]}),i=xe.groupByKeyEntities(s,"pageNumber"),c=undefined;return P({},t,{bookmarkEntities:m,editableBookmark:c,bookmarkPageEntities:i,loading:!1,loaded:!0})}return t}var wn="[Redaction] Load Redaction",kn="[Redaction] Load Redaction Success",Sn="[Redaction] Save Redaction",En="[Redaction] Save Redaction Success",Cn="[Redaction] Delete Redaction",In="[Redaction] Delete Redaction Success",Pn="[Redaction] Select Redaction",xn="[Redaction] Redact",_n="[Redaction] Redact Success",Tn="[Redaction] Reset Redacted Document",Dn="[Redaction] Unmark All",Bn="[Redaction] Unmark All Success",Rn=function(t){this.payload=t,this.type=wn},On=function(t){this.payload=t,this.type=kn},Mn=function(t){this.payload=t,this.type="[Redaction] Load Redaction Fail"},An=function(t){this.payload=t,this.type=Sn},Nn=function(t){this.payload=t,this.type=En},jn=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},Hn=function(t){this.payload=t,this.type="[Redaction] Delete Redaction Fail"},$n=function(t){this.payload=t,this.type=Pn},Vn=function(t){this.payload=t,this.type=xn},Un=function(t){this.payload=t,this.type=_n},zn=function(t){this.payload=t,this.type="[Redaction] Redact Fail"},Wn=function(){this.type=Tn},qn=function(t){this.payload=t,this.type=Dn},Gn=function(){this.type=Bn},Zn={redactionEntities:{},redactionPageEntities:{},selectedRedaction:{},redactedDocumentInfo:undefined,documentId:undefined};function Yn(t,e){switch(void 0===t&&(t=Zn),e.type){case wn:return P({},t,Zn);case kn:if(i=e.payload){var n=xe.generateRedactionEntities(i),o=xe.groupByKeyEntities(i,"page");return P({},t,{redactionEntities:n,redactionPageEntities:o})}return P({},t);case En:var i=e.payload,a=P({},t.redactionEntities,((c={})[i.redactionId]=i,c)),r=Object.keys(a).map(function(t){return a[t]}),o=xe.groupByKeyEntities(r,"page");return P({},t,{redactionEntities:a,redactionPageEntities:o});case Pn:case le:return P({},t,{selectedRedaction:e.payload});case In:var i=e.payload.page,s=e.payload.redactionId;delete(n=P({},t.redactionEntities))[s];var c=O(t.redactionPageEntities[i].filter(function(t){return t.redactionId!==s})),o=P({},t.redactionPageEntities,((r={})[i]=c,r));return P({},t,{redactionPageEntities:o,redactionEntities:n});case _n:n=e.payload;return P({},t,Zn,{redactedDocumentInfo:n});case Tn:return P({},t,{redactedDocumentInfo:undefined});case Bn:return P({},t,Zn)}return t}var Xn={session:null,presenter:null,client:null,participants:[]};function Kn(t,e){switch(void 0===t&&(t=Xn),e.type){case At:var n=e.payload,o=P({},t.session,{caseId:n});return P({},t,{session:o});case Ft:o=e.payload.session,n=e.payload.participantInfo;return P({},t,{session:o,client:n.client,presenter:n.presenter});case $t:var i=e.payload,a=Object.keys(i).map(function(t){return{id:t,username:i[t]}});return P({},t,{participants:a});case Ht:a=e.payload;return P({},t,{presenter:a});case Lt:return P({},t,Xn)}return t}var Jn={document:Kt,annotations:De,tags:Le,bookmarks:yn,redactions:Yn,icp:Kn},Qn=S.createFeatureSelector("media-viewer"),to=S.createSelector(Qn,function(t){return t.document}),eo=S.createSelector(to,Jt),no=(S.createSelector(eo,function(t){return Object.values(t)}),S.createSelector(to,function(t){return t.documentId})),oo=S.createSelector(to,function(t){return t.pdfPosition}),io=S.createSelector(to,function(t){return t.hasDifferentPageSize}),ao=S.createSelector(to,function(t){return t.convertedDocument}),ro=S.createSelector(to,function(t){return t.rotation}),so=S.createSelector(to,function(t){return t.rotationLoaded}),co=(lo.prototype.textSelected=function(t){this.textHighlight.next(t)},lo.prototype.boxSelected=function(t){this.boxHighlight.next(t)},lo.prototype.clearCtxToolbar=function(){this.ctxToolbarCleared.next()},lo.prototype.goToDestination=function(t){this.navigationEvent.next(t)},lo.decorators=[{type:E.Injectable,args:[{providedIn:"root"}]}],lo.ctorParameters=function(){return[]},lo.ngInjectableDef=E.defineInjectable({factory:function(){return new lo},token:lo,providedIn:"root"}),lo);function lo(){this.textHighlight=new f.Subject,this.boxHighlight=new f.Subject,this.ctxToolbarCleared=new f.Subject,this.navigationEvent=new f.Subject}var uo=(po.prototype.ngAfterContentInit=function(){return T(this,void 0,void 0,function(){var e=this;return D(this,function(t){return this.pdfWrapper.documentLoadProgress.subscribe(function(t){return e.onDocumentLoadProgress(t)}),this.pdfWrapper.documentLoaded.subscribe(function(){return e.onDocumentLoaded()}),this.pdfWrapper.documentLoadFailed.subscribe(function(t){return e.onDocumentLoadFailed(t)}),this.pdfWrapper.outlineLoaded.subscribe(function(t){return e.documentOutline=t}),this.pdfWrapper.pageRendered.subscribe(function(t){return e.updatePages(t)}),this.$subscription=this.toolbarEvents.printSubject.subscribe(function(){return e.printService.printDocumentNatively(e.url)}),this.$subscription.add(this.toolbarEvents.downloadSubject.subscribe(function(){return e.pdfWrapper.downloadFile(e.downloadUrl||e.url,e.downloadFileName)})),this.$subscription.add(this.toolbarEvents.rotateSubject.subscribe(function(t){return e.rotateDocument(t)})),this.$subscription.add(this.toolbarEvents.zoomSubject.subscribe(function(t){return e.setZoom(t)})),this.$subscription.add(this.toolbarEvents.stepZoomSubject.subscribe(function(t){return e.stepZoom(t)})),this.$subscription.add(this.toolbarEvents.searchSubject.subscribe(function(t){return e.pdfWrapper.search(t)})),this.$subscription.add(this.toolbarEvents.setCurrentPageSubject.subscribe(function(t){return e.pdfWrapper.setPageNumber(t)})),this.$subscription.add(this.toolbarEvents.changePageByDeltaSubject.subscribe(function(t){return e.pdfWrapper.changePageNumber(t)})),this.$subscription.add(this.toolbarEvents.grabNDrag.subscribe(function(t){return e.enableGrabNDrag=t})),this.$subscription.add(this.toolbarEvents.commentsPanelVisible.subscribe(function(t){e.showCommentsPanel=t})),this.$subscription.add(this.viewerEvents.navigationEvent.subscribe(function(t){return e.goToDestination(t)})),this.$subscription.add(this.toolbarEvents.icp.participantsListVisible.subscribe(function(t){return e.showIcpParticipantsList=t})),this.$subscription.add(this.pdfWrapper.positionUpdated.asObservable().pipe(w.throttleTime(500,f.asyncScheduler,{leading:!0,trailing:!0})).subscribe(function(t){return e.store.dispatch(new wt(t.location))})),[2]})})},po.prototype.ngOnChanges=function(n){return T(this,void 0,void 0,function(){var e=this;return D(this,function(t){switch(t.label){case 0:return this.pdfWrapper||(this.pdfWrapper=this.pdfJsWrapperFactory.create(this.viewerContainer)),n.url&&this.pdfWrapper?[4,this.loadDocument()]:[3,2];case 1:t.sent(),this.enableRedactions&&this.toolbarEvents.redactionMode.pipe(w.filter(function(t){return!!t})).subscribe(function(){return e.resetRotation()}),t.label=2;case 2:return n.caseId&&this.icpStore.dispatch(new Vt(this.caseId)),[2]}})})},po.prototype.resetRotation=function(){this.hasDifferentPageSize&&(this.pdfWrapper.resetRotation(0),this.rotation=0)},po.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},po.prototype.loadDocument=function(){return T(this,void 0,void 0,function(){var e=this;return D(this,function(t){switch(t.label){case 0:return this.initDocumentProgress(),[4,this.pdfWrapper.loadDocument(this.url)];case 1:return t.sent(),this.documentTitle.emit(this.pdfWrapper.getCurrentPDFTitle()),this.setPageHeights(),this.$subscription.add(this.store.pipe(S.select(io)).subscribe(function(t){return e.hasDifferentPageSize=t})),[2]}})})},po.prototype.onDocumentLoadProgress=function(t){t.total&&(this.loadingDocumentProgress=Math.min(100,Math.ceil(t.loaded/t.total*100)))},po.prototype.onDocumentLoaded=function(){this.loadingDocument=!1,this.mediaLoadStatus.emit(J.SUCCESS)},po.prototype.onDocumentLoadFailed=function(t){this.loadingDocument=!1,this.viewerException=new Q(t.name,{message:t.message}),this.errorMessage='Could not load the document "'+this.url+'"',this.mediaLoadStatus.emit(J.FAILURE),this.pdfViewerException.emit(this.viewerException)},po.prototype.updatePages=function(t){this.enableAnnotations&&this.store.dispatch(new yt(t))},Object.defineProperty(po.prototype,"searchBarHidden",{set:function(t){this.pdfWrapper&&t&&this.pdfWrapper.clearSearch()},enumerable:!0,configurable:!0}),po.prototype.toggleCommentsSummary=function(){this.toolbarEvents.toggleCommentsSummary(!this.toolbarEvents.showCommentSummary.getValue())},po.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()},po.prototype.initDocumentProgress=function(){this.loadingDocument=!0,this.loadingDocumentProgress=null,this.errorMessage=null},po.prototype.setZoom=function(t){isNaN(t)||(this.pdfWrapper.setZoom(t),this.zoom=this.calculateZoomValue(t),this.setPageHeights())},po.prototype.stepZoom=function(t){isNaN(t)||(this.pdfWrapper.stepZoom(t),this.zoom=this.calculateZoomValue(this.zoom,t),this.setPageHeights())},po.prototype.setPageHeights=function(){this.pageHeights=[];for(var t=this.pdfViewer.nativeElement.children,e=0;e<t.length;e++)this.pageHeights.push(t[e].clientHeight)},po.prototype.calculateZoomValue=function(t,e){e=t+(e=void 0===e?0:e);return 5<e?5:e<.1?.1:+e.toFixed(2)},po.prototype.goToDestination=function(t){this.pdfWrapper.navigateTo(t)},po.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}]}],po.ctorParameters=function(){return[{type:S.Store},{type:S.Store},{type:Z},{type:X},{type:q},{type:co},{type:tt}]},po.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"]}],pdfViewer:[{type:E.ViewChild,args:["pdfViewer"]}],searchBarHidden:[{type:E.Input}]},po);function po(t,e,n,o,i,a,r){var s=this;this.store=t,this.icpStore=e,this.pdfJsWrapperFactory=n,this.printService=o,this.toolbarEvents=i,this.viewerEvents=a,this.toolbarButtons=r,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=i.highlightModeSubject.pipe(w.tap(function(){s.store.dispatch(new Mt)})),this.drawMode=i.drawModeSubject}var ho=(mo.prototype.validateFile=function(t){return this.http.head(t)},mo.decorators=[{type:E.Injectable,args:[{providedIn:"root"}]}],mo.ctorParameters=function(){return[{type:m.HttpClient}]},mo.ngInjectableDef=E.defineInjectable({factory:function(){return new mo(E.inject(m.HttpClient))},token:mo,providedIn:"root"}),mo);function mo(t){this.http=t}var go=(fo.prototype.ngOnInit=function(){var e=this;this.subscriptions.push(this.toolbarEvents.rotateSubject.subscribe(function(t){return e.rotateImage(t)}),this.toolbarEvents.zoomSubject.subscribe(function(t){return e.setZoom(t)}),this.toolbarEvents.stepZoomSubject.subscribe(function(t){return e.stepZoom(t)}),this.toolbarEvents.printSubject.subscribe(function(){return e.printService.printDocumentNatively(e.url)}),this.toolbarEvents.downloadSubject.subscribe(function(){return e.download()}),this.toolbarEvents.grabNDrag.subscribe(function(t){return e.enableGrabNDrag=t}),this.toolbarEvents.commentsPanelVisible.subscribe(function(t){return e.showCommentsPanel=t}))},fo.prototype.ngOnDestroy=function(){this.subscriptions.filter(function(t){return!t.closed}).forEach(function(t){return t.unsubscribe()}),this.response&&this.response.unsubscribe()},fo.prototype.ngOnChanges=function(t){t.url&&(this.errorMessage=null,this.toolbarEvents.reset())},fo.prototype.rotateImage=function(t){this.rotation=(this.rotation+t)%360,this.initAnnoPage(this.img.nativeElement)},fo.prototype.setZoom=function(e){return T(this,void 0,void 0,function(){return D(this,function(t){switch(t.label){case 0:return isNaN(e)?[3,2]:[4,this.setZoomValue(this.calculateZoomValue(e))];case 1:t.sent(),this.img.nativeElement.width=this.img.nativeElement.naturalWidth*this.zoom,this.initAnnoPage(this.img.nativeElement),t.label=2;case 2:return[2]}})})},fo.prototype.stepZoom=function(e){return T(this,void 0,void 0,function(){return D(this,function(t){switch(t.label){case 0:return isNaN(e)?[3,2]:[4,this.setZoomValue(this.calculateZoomValue(this.zoom,e))];case 1:t.sent(),this.img.nativeElement.width=this.img.nativeElement.naturalWidth*this.zoom,this.initAnnoPage(this.img.nativeElement),t.label=2;case 2:return[2]}})})},fo.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()},fo.prototype.setZoomValue=function(e){var n=this;return new Promise(function(t){n.zoom=e,n.toolbarEvents.zoomValueSubject.next(e),t(!0)})},fo.prototype.calculateZoomValue=function(t,e){e=t+(e=void 0===e?0:e);return 5<e?5:e<.1?.1:+e.toFixed(2)},fo.prototype.onLoadError=function(t){var e=this;this.response=this.viewerUtilService.validateFile(t).subscribe(function(t){return t},function(t){e.viewerException=new Q(t.name,{httpResponseCode:t.status,message:t.message})}),this.errorMessage='Could not load the image "'+this.url+'"',this.mediaLoadStatus.emit(J.FAILURE),this.imageViewerException.emit(this.viewerException)},fo.prototype.onLoad=function(t){this.mediaLoadStatus.emit(J.SUCCESS),this.initAnnoPage(t)},fo.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;t=[{div:{scrollHeight:this.imageHeight,scrollWidth:this.imageWidth,offsetLeft:this.imageLeft},pageNumber:1,scale:this.zoom,rotation:this.rotation,id:1}];this.store.dispatch(new yt(t))},fo.prototype.toggleCommentsSummary=function(){this.toolbarEvents.toggleCommentsSummary(!this.toolbarEvents.showCommentSummary.getValue())},fo.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 mvCreateTextHighlight 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'}]}],fo.ctorParameters=function(){return[{type:S.Store},{type:X},{type:ho},{type:q},{type:tt}]},fo.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"]}]},fo);function fo(t,e,n,o,i){this.store=t,this.printService=e,this.viewerUtilService=n,this.toolbarEvents=o,this.toolbarButtons=i,this.mediaLoadStatus=new E.EventEmitter,this.imageViewerException=new E.EventEmitter,this.rotation=0,this.zoom=1,this.subscriptions=[],this.enableGrabNDrag=!1}var bo=(vo.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 Q(t.name,{httpResponseCode:t.status,message:t.message})})),this.loadStatus.emit(J.UNSUPPORTED),this.typeException||this.unsupportedViewerException.emit(this.viewerException)},vo.prototype.ngOnDestroy=function(){var t,e;try{for(var n=B(this.subscriptions),o=n.next();!o.done;o=n.next())o.value.unsubscribe()}catch(i){t={error:i}}finally{try{o&&!o.done&&(e=n["return"])&&e.call(n)}finally{if(t)throw t.error}}},vo.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'}]}],vo.ctorParameters=function(){return[{type:q},{type:ho}]},vo.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"]}]},vo);function vo(t,e){this.toolbarEvents=t,this.viewerUtilService=e,this.loadStatus=new E.EventEmitter,this.unsupportedViewerException=new E.EventEmitter,this.subscriptions=[]}var yo=(wo.prototype.getAnnotationSet=function(t){t=this.annotationSetsFullUrl+"/filter?documentId="+t;return this.httpClient.get(t,{observe:"response",withCredentials:!0})},wo.prototype.postAnnotationSet=function(t){return this.httpClient.post(this.annotationSetsFullUrl,t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}),w.catchError(function(){return[]}))},wo.prototype.getComments=function(t){return t.pipe(w.map(this.sortAnnotations),w.map(this.extractComments))},wo.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})},wo.prototype.extractComments=function(t){return[].concat.apply([],O(t.map(function(t){return t.comments})))},wo.prototype.deleteAnnotation=function(t){t=this.annotationFullsUrl+"/"+t;return this.httpClient["delete"](t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},wo.prototype.postAnnotation=function(t){return this.httpClient.post(this.annotationFullsUrl,t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},Object.defineProperty(wo.prototype,"annotationSetsFullUrl",{get:function(){return this.annotationApiUrl+this.annotationSetBaseUrl},enumerable:!0,configurable:!0}),Object.defineProperty(wo.prototype,"annotationFullsUrl",{get:function(){return this.annotationApiUrl+this.annotationBaseUrl},enumerable:!0,configurable:!0}),wo.decorators=[{type:E.Injectable}],wo.ctorParameters=function(){return[{type:m.HttpClient}]},wo);function wo(t){this.httpClient=t,this.annotationApiUrl="/em-anno",this.annotationSetBaseUrl="/annotation-sets",this.annotationBaseUrl="/annotations"}var ko=(So.prototype.setCommentSet=function(t){this.commentSetComponent=t},So.prototype.onCommentChange=function(t){this.unsavedChanges.next(t)},So.prototype.getUnsavedChanges=function(){return this.unsavedChanges.asObservable()},So.prototype.hasUnsavedComments=function(t){return 0<t.comments.length&&this.getComment(t).hasUnsavedChanges},So.prototype.updateUnsavedCommentsStatus=function(t,e){this.getComment(t).hasUnsavedChanges=e,this.allCommentsSaved()},So.prototype.getComment=function(e){return this.commentSetComponent.commentComponents.find(function(t){return t.comment.annotationId===e.comments[0].annotationId})},So.prototype.resetCommentSet=function(){this.commentSetComponent=null},So.prototype.allCommentsSaved=function(){this.onCommentChange(this.commentSetComponent.commentComponents.some(function(t){return!0===t.hasUnsavedChanges}))},So.decorators=[{type:E.Injectable}],So);function So(){this.unsavedChanges=new f.Subject}var Eo=S.createSelector(Qn,function(t){return t.tags}),Co=S.createSelector(Eo,function(t){return t.tagNameEnt}),Io=S.createSelector(Eo,function(t){return t.filters}),Po=S.createSelector(Eo,He),xo=S.createSelector(Eo,$e),_o=S.createSelector(Co,function(e){return Object.keys(e).map(function(t){return{key:t,length:Object.keys(e[t]).length}})}),To=S.createSelector(Qn,function(t){return t.annotations}),Do=S.createSelector(To,Me),Bo=S.createSelector(To,Be),Ro=S.createSelector(Bo,function(t){return{documentId:t.documentId,annotationSetId:t.id}}),Oo=S.createSelector(Do,Bo,function(e,t){return P({},t,{annotations:Object.keys(e).map(function(t){return e[t]})})}),Mo=S.createSelector(To,Ae),Ao=S.createSelector(To,Re),No=S.createSelector(To,Oe),jo=S.createSelector(To,Ne),Fo=S.createSelector(jo,function(t){return t.commentSearch}),Lo=S.createSelector(To,je),Ho=S.createSelector(eo,No,xo,function(e,t,n){var o=!!Object.keys(n).length?n:t;if(e){var i=[];return Object.keys(e).forEach(function(t){i.push({anno:o[t]||[],styles:e[t].styles})}),i}}),$o=S.createSelector(Ao,eo,Do,Po,function(n,o,i,t){if(n&&i&&o[1]){var e=!!Object.keys(t).length;return Object.keys(e?t:n).map(function(t){var e=i[t].page;return P({},n[t],{page:e,pages:o})})}}),Vo=S.createSelector($o,Lo,function(t,e){e=xe.filterCommentsSummary(t=void 0===t?[]:t,e.filters);return e.length?e.map(function(t){return{page:t.page,user:t.createdByDetails.forename.concat(" ").concat(t.createdByDetails.surname),date:c(t.lastModifiedDate).format("D MMMM YYYY"),tags:t.tags,comment:t.content}}):[""]}),Uo=S.createSelector(Do,Po,function(e,t){var n=!!Object.keys(t).length;return Object.keys(n?t:e).map(function(t){return e[t]}).filter(function(t){return t.comments&&0<t.comments.length})}),zo={PDF:"pdf",IMAGE:"image"},Wo={MP4:"mp4",MP3:"mp3"},qo={EXCEL:"excel",WORD:"word",POWERPOINT:"powerpoint",TXT:"txt",RTF:"rtf"},Go=(Zo.prototype.ngAfterContentInit=function(){var e=this;this.annotationSet$=this.store.pipe(S.select(Oo)),this.hasDifferentPageSize$=this.store.pipe(S.select(io)),this.setToolbarButtons(),this.toolbarEventsOutput.emit(this.toolbarEvents),this.$subscriptions=this.commentService.getUnsavedChanges().subscribe(function(t){return e.onCommentChange(t)}),this.$subscriptions.add(this.toolbarEvents.getShowCommentSummary().subscribe(function(t){return e.showCommentSummary=t}))},Zo.prototype.ngAfterViewChecked=function(){if(this.height&&this.viewerHeight!==this.height)return this.viewerHeight=this.height,void this.cdr.detectChanges();var t;this.height||(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()))},Zo.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 vt(this.documentId)),!this.enableAnnotations||this.multimediaContent||this.unsupportedContent||this.store.dispatch(new he(this.documentId)),!this.enableRedactions||this.multimediaContent||this.unsupportedContent||this.store.dispatch(new Rn(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},Zo.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},Zo.prototype.needsConverting=function(){return null!==this.contentType&&Object.keys(qo).includes(this.contentType.toUpperCase())},Zo.prototype.isMultimedia=function(){return null!==this.contentType&&Object.keys(Wo).includes(this.contentType.toUpperCase())},Zo.prototype.isSupported=function(){var t=Object.assign({},Wo,qo,zo);return null!==this.contentType&&Object.keys(t).includes(this.contentType.toUpperCase())},Zo.prototype.onMediaLoad=function(t){this.mediaLoadStatus.emit(t)},Zo.prototype.setToolbarButtons=function(){this.contentType===zo.PDF||this.needsConverting()?this.toolbarButtons.setup(P({},nt,{showHighlightButton:this.enableAnnotations,showDrawButton:this.enableAnnotations},this.toolbarButtonOverrides)):this.contentType===zo.IMAGE?this.toolbarButtons.setup(P({},ot,{showDrawButton:this.enableAnnotations},this.toolbarButtonOverrides)):this.isMultimedia()?this.toolbarButtons.setup(P({},it,this.toolbarButtonOverrides)):this.toolbarButtons.setup(P({},at,this.toolbarButtonOverrides))},Zo.prototype.onLoadException=function(t){this.viewerException.emit(t),this.isSupported()?(this.typeException=!0,this.contentType=null,this.setToolbarButtons()):this.typeException=!1},Zo.prototype.onCommentChange=function(t){this.unsavedChanges.emit(t)},Zo.prototype.onDocumentTitleChange=function(t){this.documentTitle=t},Zo.prototype.extractDMStoreDocId=function(t){return(t=(t=t.includes("/documents/")?t.split("/documents/")[1]:t).includes("/documentsv2/")?t.split("/documentsv2/")[1]:t).replace("/binary","")},Zo.prototype.detectOs=function(){this.hasScrollBar=-1!==window.navigator.userAgent.indexOf("Win")},Zo.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}]}],Zo.ctorParameters=function(){return[{type:S.Store},{type:tt},{type:q},{type:yo},{type:ko},{type:E.ElementRef},{type:E.ChangeDetectorRef}]},Zo.propDecorators={viewerRef:[{type:E.ViewChild,args:["viewerRef"]}],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}]},Zo);function Zo(t,e,n,o,i,a,r){this.store=t,this.toolbarButtons=e,this.toolbarEvents=n,this.api=o,this.commentService=i,this.elRef=a,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&&(o.annotationApiUrl=this.annotationApiUrl)}var Yo=(Xo.prototype.isNumber=function(t){return null!==t&&t!==undefined&&""!==t&&!isNaN(Number(t.toString()))},Xo.decorators=[{type:E.Injectable,args:[{providedIn:"root"}]}],Xo.ctorParameters=function(){return[]},Xo.ngInjectableDef=E.defineInjectable({factory:function(){return new Xo},token:Xo,providedIn:"root"}),Xo);function Xo(){}var Ko=(Jo.prototype.ngOnInit=function(){var e=this;this.subscriptions.push(this.toolbarEvents.setCurrentPageSubject.subscribe(function(t){return e.setCurrentPage(t)}),this.toolbarEvents.setCurrentPageInputValueSubject.subscribe(function(t){return e.pageNumber=t}),this.toolbarEvents.getPageCount().subscribe(function(t){return e.pageCount=t}),this.toolbarEvents.icp.enabled.subscribe(function(t){e.icpEnabled=t,e.icpEnabled&&(e.toolbarEvents.toggleCommentsPanel(!t),e.toolbarEvents.sidebarOpen.next(!1))}),this.toolbarEvents.redactionMode.subscribe(function(t){e.redactionEnabled=t}))},Jo.prototype.ngOnDestroy=function(){var t,e;try{for(var n=B(this.subscriptions),o=n.next();!o.done;o=n.next())o.value.unsubscribe()}catch(i){t={error:i}}finally{try{o&&!o.done&&(e=n["return"])&&e.call(n)}finally{if(t)throw t.error}}},Jo.prototype.ngAfterViewInit=function(){var e=this;Array.from(this.mvToolbarMain.nativeElement.children).forEach(function(t){e.allButtonsWidth+=t.getBoundingClientRect().width,e.widthRequiredForBtn[t.id]=e.allButtonsWidth}),this.cdr.detectChanges()},Jo.prototype.onResize=function(){this.cdr.detectChanges()},Jo.prototype.onClickHighlightToggle=function(){this.toolbarEvents.toggleHighlightMode()},Jo.prototype.onClickDrawToggle=function(){this.toolbarEvents.toggleDrawMode()},Jo.prototype.toggleSideBar=function(){this.toolbarEvents.sidebarOpen.next(!this.toolbarEvents.sidebarOpen.getValue())},Jo.prototype.togglePresentBar=function(){this.toolbarEvents.searchBarHidden.next(!0),this.toolbarEvents.icp.enable()},Jo.prototype.increasePageNumber=function(){this.toolbarEvents.incrementPage(1)},Jo.prototype.decreasePageNumber=function(){this.toolbarEvents.incrementPage(-1)},Jo.prototype.onPageNumberInputChange=function(t){Number(t)<1&&(t="1"),Number(t)>this.pageCount&&(t=this.pageCount.toString()),this.toolbarEvents.setPage(Number.parseInt(t,10))},Jo.prototype.setCurrentPage=function(t){this.pageNumber=t},Jo.prototype.rotate=function(t){this.toolbarEvents.rotate(t)},Jo.prototype.printFile=function(){this.toolbarEvents.print()},Jo.prototype.downloadFile=function(){this.toolbarEvents.download()},Jo.prototype.zoom=function(t){this.toolbarEvents.zoom(+t)},Jo.prototype.stepZoom=function(t){this.toolbarEvents.stepZoom(t),this.zoomSelect.nativeElement.selected="selected"},Jo.prototype.toggleCommentsPanel=function(){this.toolbarEvents.toggleCommentsPanel(!this.toolbarEvents.commentsPanelVisible.getValue())},Jo.prototype.toggleRedactBar=function(){this.toolbarEvents.toggleRedactionMode()},Jo.prototype.toggleGrabNDrag=function(){this.toolbarEvents.toggleGrabNDrag()},Jo.prototype.isPdf=function(){return"pdf"===this.contentType},Jo.prototype.toggleSearchBar=function(){this.toolbarEvents.searchBarHidden.next(!this.toolbarEvents.searchBarHidden.getValue())},Jo.prototype.toggleMoreOptions=function(){var t=this;this.isDropdownMenuOpen=!this.isDropdownMenuOpen,setTimeout(function(){t.mvMenuItems&&t.mvMenuItems.nativeElement.focus()},100)},Jo.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'}]}],Jo.ctorParameters=function(){return[{type:q},{type:tt},{type:E.ChangeDetectorRef},{type:Yo}]},Jo.propDecorators={enableAnnotations:[{type:E.Input}],enableRedactions:[{type:E.Input}],enableICP:[{type:E.Input}],contentType:[{type:E.Input}],zoomSelect:[{type:E.ViewChild,args:["zoomSelect"]}],mvToolbarMain:[{type:E.ViewChild,args:["mvToolbarMain"]}],mvMenuItems:[{type:E.ViewChild,args:["dropdownMenu"]}],onResize:[{type:E.HostListener,args:["window:resize",[]]}]},Jo);function Jo(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 i.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={}}var Qo=(ti.prototype.ngOnInit=function(){var e=this;this.subscriptions.push(this.toolbarEvents.searchResultsCountSubject.subscribe(function(t){return e.setSearchResultsCount(t)}))},ti.prototype.ngOnDestroy=function(){var t,e;try{for(var n=B(this.subscriptions),o=n.next();!o.done;o=n.next())o.value.unsubscribe()}catch(i){t={error:i}}finally{try{o&&!o.done&&(e=n["return"])&&e.call(n)}finally{if(t)throw t.error}}},ti.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))},ti.prototype.searchNext=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!1,reset:!1})},ti.prototype.searchPrev=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!0,reset:!1})},ti.prototype.search=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!1,reset:!0})},ti.prototype.setSearchResultsCount=function(t){var e=this;this.resultCount=t.total,this.resultsText=0<this.resultCount?"Found "+t.current+" of "+t.total:"No results found",this.resultCount&&0<this.resultCount&&setTimeout(function(){e.findNext.nativeElement.focus()},200)},ti.prototype.onEscapeKeyPress=function(t){this.toolbarEvents.searchBarHidden.next(!0)},ti.prototype.onEnterKeyPress=function(t){this.search()},ti.prototype.toggleAdvancedSearch=function(){this.advancedSearchVisible=!this.advancedSearchVisible},ti.prototype.toggleSearchBar=function(){this.toolbarEvents.searchBarHidden.next(!this.toolbarEvents.searchBarHidden.getValue())},ti.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'}]}],ti.ctorParameters=function(){return[{type:tt},{type:q}]},ti.propDecorators={findInput:[{type:E.ViewChild,args:["findInput"]}],findNext:[{type:E.ViewChild,args:["findNext"]}],onWindowKeyDown:[{type:E.HostListener,args:["window:keydown",["$event"]]}]},ti);function ti(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}var ei=S.createSelector(Qn,function(t){return t.redactions}),ni=S.createSelector(ei,function(t){return t.redactionPageEntities}),oi=S.createSelector(ei,function(t){return t.selectedRedaction}),ii=S.createSelector(ei,function(t){return t.redactedDocumentInfo}),ai=S.createSelector(ei,function(t){return t.redactionEntities}),ri=S.createSelector(ai,no,function(e,t){return{redactions:Object.keys(e).map(function(t){return e[t]}),documentId:t}}),si=S.createSelector(eo,ni,function(e,n){if(e&&n){var o=[];return Object.keys(e).forEach(function(t){o.push({anno:n[t]||[],styles:e[t].styles})}),o}}),ci=(li.prototype.ngOnInit=function(){var e=this;this.$subscription=this.store.pipe(S.select(ri)).subscribe(function(t){e.hasRedactions=!!t.redactions.length})},li.prototype.toggleTextRedactionMode=function(){this.toolbarEventService.highlightModeSubject.next(!0)},li.prototype.toggleDrawMode=function(){this.toolbarEventService.drawModeSubject.next(!0)},li.prototype.togglePreview=function(){this.preview=!this.preview,this.toolbarEventService.toggleRedactionPreview(this.preview)},li.prototype.unmarkAll=function(){this.toolbarEventService.unmarkAll()},li.prototype.redact=function(){this.toolbarEventService.applyRedactionToDocument()},li.prototype.toggleRedactBar=function(){this.toolbarEventService.toggleRedactionMode()},li.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},li.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'}]}],li.ctorParameters=function(){return[{type:q},{type:tt},{type:S.Store}]},li);function li(t,e,n){this.toolbarEventService=t,this.toolbarButtons=e,this.store=n,this.preview=!1,this.hasRedactions=!1}var ui=S.createSelector(Qn,function(t){return t.icp}),pi=S.createSelector(ui,function(t){return t.session}),di=S.createSelector(pi,function(t){return null===t?null:t.caseId}),hi=S.createSelector(ui,function(t){return t.presenter}),mi=S.createSelector(hi,function(t){return null===t?null:t.username}),gi=S.createSelector(ui,function(t){return t.client}),fi=S.createSelector(hi,gi,function(t,e){return null===t?undefined:t.id===e.id}),bi=S.createSelector(ui,function(t){return t.participants}),vi=(yi.prototype.ngOnInit=function(){var e=this;this.$subscription=this.store.pipe(S.select(fi)).subscribe(function(t){return e.isPresenter=t}),this.$subscription.add(this.store.pipe(S.select(mi)).subscribe(function(t){return e.presenterName=t}))},yi.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},yi.prototype.present=function(){this.toolbarEventService.icp.becomePresenter()},yi.prototype.stopPresenting=function(){this.toolbarEventService.icp.stopPresenting()},yi.prototype.leaveIcpSession=function(){this.toolbarEventService.icp.leaveSession()},yi.prototype.showParticipantsList=function(){this.toolbarEventService.toggleParticipantsList(!this.toolbarEventService.icp.participantsListVisible.getValue())},yi.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>'}]}],yi.ctorParameters=function(){return[{type:q},{type:S.Store}]},yi);function yi(t,e){this.toolbarEventService=t,this.store=e}var wi=(ki.decorators=[{type:E.NgModule,args:[{declarations:[Qo,Ko,ci,vi],providers:[tt,q],exports:[Ko,Qo,ci,vi],imports:[l.CommonModule,u.FormsModule,i.OverlayModule,d.RouterModule]}]}],ki);function ki(){}var Si=(Object.defineProperty(Ei.prototype,"annotation",{set:function(t){this.anno=P({},t)},enumerable:!0,configurable:!0}),Object.defineProperty(Ei.prototype,"selectedAnnoId",{set:function(t){var e;t&&(e=this.anno.id||this.anno.redactionId,this.selected=!!t.annotationId&&t.annotationId===e)},enumerable:!0,configurable:!0}),Ei.prototype.onSelect=function(){var t=this.anno.id||this.anno.redactionId;this.annotationClick.emit({annotationId:t,editable:!1,selected:!0})},Ei.prototype.onRectangleUpdate=function(e){var t=P({},this.anno);t.rectangles=t.rectangles.filter(function(t){return t.id!==e.id}),t.rectangles.push(e),this.update.emit(t)},Ei.prototype.deleteHighlight=function(){this["delete"].emit(this.anno)},Ei.prototype.addOrEditComment=function(){var t;0===this.anno.comments.length&&(t={annotationId:this.anno.id,content:"",createdBy:this.anno.createdBy,createdByDetails:undefined,createdDate:c.utc().tz("Europe/London").toISOString(),id:k.v4(),lastModifiedBy:"",lastModifiedByDetails:undefined,lastModifiedDate:"",tags:[],page:null,pages:{},pageHeight:null,selected:!1,editable:!1},this.store.dispatch(new ye(t))),this.selected=!0,this.annotationClick.emit({annotationId:this.anno.id,editable:!0,selected:!0}),this.toolbarEvents.toggleCommentsPanel(!0)},Ei.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'}]}],Ei.ctorParameters=function(){return[{type:q},{type:S.Store}]},Ei.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"]}]},Ei);function Ei(t,e){this.toolbarEvents=t,this.store=e,this.update=new E.EventEmitter,this["delete"]=new E.EventEmitter,this.annotationClick=new E.EventEmitter}var Ci=(Ii.prototype.ngOnInit=function(){this.selectedAnnotation$=this.store.pipe(S.select(Mo))},Ii.prototype.onAnnotationUpdate=function(t){this.store.dispatch(new fe(t))},Ii.prototype.onAnnotationDelete=function(t){0<t.comments.length&&this.commentService.updateUnsavedCommentsStatus(t,!1),this.store.dispatch(new we(t.id))},Ii.prototype.selectAnnotation=function(t){this.store.dispatch(new Ee(t))},Ii.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'}]}],Ii.ctorParameters=function(){return[{type:S.Store},{type:ko}]},Ii.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}]},Ii);function Ii(t,e){this.store=t,this.commentService=e,this.annotations=[]}var Pi=(xi.prototype.saveAnnotation=function(e,n){var o=this;this.store.pipe(S.select(Ro),w.take(1)).subscribe(function(t){t=P({id:C(),color:"FFFF00",comments:[],page:n,rectangles:e,type:"highlight"},t,{createdBy:"",createdByDetails:undefined,createdDate:c.utc().tz("Europe/London").toISOString(),lastModifiedBy:"",lastModifiedByDetails:undefined,lastModifiedDate:"",tags:[]});o.store.dispatch(new fe(t))})},xi.prototype.applyRotation=function(t,e,n,o,i,a,r,s){var n={x:+(a/s).toFixed(2),y:+(i/s).toFixed(2),width:+(o/s).toFixed(2),height:+(n/s).toFixed(2)},c=n.x,l=n.y,u=n.width,p=n.height,d={x:c,y:l,width:u,height:p};switch(r){case 90:d.width=p,d.height=u,d.x=l,d.y=+(e/s-c-u).toFixed(2);break;case 180:d.x=+(e/s-c-u).toFixed(2),d.y=+(t/s-l-p).toFixed(2);break;case 270:d.width=p,d.height=u,d.x=+(t/s-l-p).toFixed(2),d.y=c}return d},xi.prototype.resetHighlight=function(){window.getSelection().removeAllRanges(),this.toolBarEvents.highlightModeSubject.next(!1)},xi.decorators=[{type:E.Injectable}],xi.ctorParameters=function(){return[{type:q},{type:S.Store}]},xi);function xi(t,e){this.toolBarEvents=t,this.store=e}var _i=(Object.defineProperty(Ti.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}),Ti.prototype.ngOnChanges=function(t){t.rotate&&this.adjustForRotation(this.rotate)},Ti.prototype.ngAfterViewInit=function(){var e=this;this.subscriptions.push(this.toolbarEvents.grabNDrag.subscribe(function(t){return e.enableGrabNDrag=t}))},Ti.prototype.ngOnDestroy=function(){this.subscriptions.filter(function(t){return!t.closed}).forEach(function(t){return t.unsubscribe()})},Object.defineProperty(Ti.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}),Ti.prototype.onClick=function(){this.select.emit(this.annoRect)},Ti.prototype.onUpdate=function(t){var e=t.offsetHeight,n=t.offsetWidth,o=t.offsetTop,i=t.offsetLeft;this.hasRectangleChanged(t)&&(i=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,e,n,o,i,this.rotate,this.zoom),i=P({},this.annoRect,i),this.update.emit(P({},i)))},Ti.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}},Ti.prototype.hasRectangleChanged=function(t){return this.left!==t.offsetLeft||this.top!==t.offsetTop||this.width!==t.offsetWidth||this.height!==t.offsetHeight},Ti.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'}]}],Ti.ctorParameters=function(){return[{type:q},{type:Pi}]},Ti.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"]}],annoRect:[{type:E.Input}],selected:[{type:E.Input}]},Ti);function Ti(t,e){this.toolbarEvents=t,this.highlightService=e,this.select=new E.EventEmitter,this.update=new E.EventEmitter,this.subscriptions=[],this.enableGrabNDrag=!1}var Di=(Bi.prototype.getAllTags=function(t){return this.http.get("/em-anno/tags/"+t)},Bi.prototype.getNewTags=function(t){return this.tagItems?this.tagItems[t]:[]},Bi.prototype.updateTagItems=function(t,e){var n=this,o=t.map(function(t){return P({},t,{name:n.snakeCase(t.name)})});this.tagItems=P({},this.tagItems,((t={})[e]=o,t))},Bi.decorators=[{type:E.Injectable}],Bi.ctorParameters=function(){return[{type:m.HttpClient}]},Bi);function Bi(t){this.http=t,this.snakeCase=function(t){return t.replace(/ +/g," ").split(/ |\B(?=[A-Z])/).map(function(t){return t.toLowerCase()}).join("_")}}var Ri=(Oi.prototype.ngOnInit=function(){var e=this;this.subscriptions=this.store.select(Fo).pipe(w.distinctUntilChanged()).subscribe(function(t){return e.searchString=t}),this.reRenderComments()},Oi.prototype.ngAfterContentInit=function(){this.tagItems&&this.tagItems.length&&this.tagsServices.updateTagItems(this.tagItems,this._comment.annotationId)},Oi.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe()},Object.defineProperty(Oi.prototype,"comment",{get:function(){return this._comment},set:function(t){this._comment=P({},t),this.page=this._comment.page,this.lastUpdate=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;for(var e=this.totalPrevPagesHeight=0;e<this.page-1;e++){var n=this._comment.pages[e+1]?this._comment.pages[e+1].styles.height:undefined;n&&(this.totalPrevPagesHeight+=n+10)}},enumerable:!0,configurable:!0}),Object.defineProperty(Oi.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(Oi.prototype,"editable",{get:function(){return this._editable},enumerable:!0,configurable:!0}),Oi.prototype.onCommentChange=function(t){this.hasUnsavedChanges=this.originalComment.substring(0,this.CHAR_LIMIT)!==t.substring(0,this.CHAR_LIMIT),this.commentService.onCommentChange(this.hasUnsavedChanges)},Oi.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)},Oi.prototype.editOrSave=function(){var t;this.editable?(this._comment.content=this.fullComment.substring(0,this.CHAR_LIMIT),t=this.tagsServices.getNewTags(this._comment.annotationId),t={comment:this._comment,tags:t},this.updated.emit(t),this.hasUnsavedChanges=!1,this._editable=!1,this.changes.emit(!1)):this._editable=!0},Oi.prototype.onCommentClick=function(){this.selected||(this.selected=!0,this._editable=!1,this.commentClick.emit({annotationId:this._comment.annotationId,editable:this._editable,selected:!0}))},Oi.prototype.reRenderComments=function(){this.renderComments.emit(this._comment)},Object.defineProperty(Oi.prototype,"commentTop",{get:function(){return this.totalPrevPagesHeight+this.rectTop*this.zoom},enumerable:!0,configurable:!0}),Object.defineProperty(Oi.prototype,"height",{get:function(){return this.form.nativeElement.getBoundingClientRect().height/this.zoom},enumerable:!0,configurable:!0}),Oi.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'}]}],Oi.ctorParameters=function(){return[{type:S.Store},{type:ko},{type:Di}]},Oi.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"]}],editableComment:[{type:E.ViewChild,args:["editableComment"]}],comment:[{type:E.Input}],annotation:[{type:E.Input}]},Oi);function Oi(t,e,n){this.store=t,this.commentService=e,this.tagsServices=n,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}var Mi=(Ai.prototype.ngOnChanges=function(t){this.setRectangle(),this.top=this.popupTop(),this.left=this.popupLeft()},Object.defineProperty(Ai.prototype,"rectangles",{get:function(){return this._rectangles},set:function(t){t&&(this._rectangles=t,this.setRectangle())},enumerable:!0,configurable:!0}),Ai.prototype.createHighlight=function(){this.createHighlightEvent.emit(),this.rectangle=undefined},Ai.prototype.deleteHighlight=function(){this.deleteHighlightEvent.emit()},Ai.prototype.addOrEditComment=function(){this.addOrEditCommentEvent.emit(),setTimeout(function(){location.hash||document.getElementById("viewerContainer").scrollBy(0,1)},10)},Ai.prototype.createBookmark=function(){this.createBookmarkEvent.emit(this.rectangle),this.rectangle=undefined},Ai.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}},Ai.prototype.popupTop=function(){var t=this.rectangle.y*this.zoom-this.defaultHeight;return t<=0?this.defaultHeight:t},Ai.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},Ai.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'}]}],Ai.ctorParameters=function(){return[]},Ai.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}]},Ai);function Ai(){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}var Ni=(ji.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})},ji.prototype.sortComponents=function(t,n,o,i){var a=this;return t.sort(function(t,e){return t.rectTop=a.top(t._rectangle,n[t.page-1],o,i),e.rectTop=a.top(e._rectangle,n[e.page-1],o,i),a.processSort(t,e)})},ji.prototype.adjustIfOverlapping=function(t,e,n){e&&(e=e.commentTop+this.height(e),t.commentTop<=e&&(t.rectTop=(e-t.totalPrevPagesHeight)/n))},ji.prototype.processSort=function(t,e){return this.onSameLine(t,e)?t.rectLeft>=e.rectLeft?1:-1:t.commentTop>=e.commentTop?1:-1},ji.prototype.onSameLine=function(t,e){return 0===this.difference(t.commentTop,e.commentTop)},ji.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}},ji.prototype.height=function(t){return t.form.nativeElement.getBoundingClientRect().height},ji.prototype.difference=function(t,e){return Math.abs(t-e)},ji.decorators=[{type:E.Injectable}],ji);function ji(){}var Fi=(Li.prototype.ngOnInit=function(){var e=this;this.comments$=this.store.pipe(S.select($o)),this.annoEntities$=this.store.pipe(S.select(Do)),this.subscriptions.push(this.toolbarEvents.commentsPanelVisible.subscribe(function(t){e.redrawComments(),e.showCommentsPanel=t})),this.subscriptions.push(this.toolbarEvents.rotateSubject.subscribe(function(t){return e.rotateDocument()}))},Li.prototype.ngOnChanges=function(t){t.annotationSet&&this.commentService.setCommentSet(this),t.contentScrollTop&&this.container&&this.container.nativeElement.scrollTo(0,this.contentScrollTop)},Li.prototype.ngOnDestroy=function(){0<this.subscriptions.length&&this.subscriptions.forEach(function(t){return t.unsubscribe()})},Li.prototype.onSelect=function(t){this.store.dispatch(new Ee(t))},Li.prototype.onCommentDelete=function(e){var t=this.annotationSet.annotations.find(function(t){return t.id===e.annotationId}),t=P({},t,{comments:[]});this.onAnnotationUpdate(t),this.redrawComments()},Li.prototype.redrawComments=function(){var e=this;setTimeout(function(){var t=e.commentComponents.map(function(t){return t});e.renderService.redrawComponents(t,e.pageHeights,e.rotate,e.zoom)},0)},Li.prototype.rotateDocument=function(){this.panel&&(this.panel.nativeElement.style.height="0")},Li.prototype.onCommentUpdate=function(e){var t=this.annotationSet.annotations.find(function(t){return t.id===e.comment.annotationId}),n=[e.comment],o=e.tags,o=P({},t,{comments:n,tags:o});this.onAnnotationUpdate(o)},Li.prototype.onAnnotationUpdate=function(t){this.store.dispatch(new fe(t))},Li.prototype.onContainerClick=function(t){t.path&&t.path[0]===this.panel.nativeElement&&this.clearSelection()},Li.prototype.clearSelection=function(){this.store.dispatch(new Ee({annotationId:"",editable:!1,selected:!1}))},Li.prototype.allCommentsSaved=function(){this.commentService.allCommentsSaved()},Li.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'}]}],Li.ctorParameters=function(){return[{type:S.Store},{type:ko},{type:Ni},{type:q}]},Li.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"]}],panel:[{type:E.ViewChild,args:["panel"]}],commentComponents:[{type:E.ViewChildren,args:["commentComponent"]}]},Li);function Li(t,e,n,o){this.store=t,this.commentService=e,this.renderService=n,this.toolbarEvents=o,this.pageHeights=[],this.subscriptions=[],this.clearSelection()}var Hi=($i.prototype.ngAfterContentChecked=function(){this.adjustHeight()},$i.prototype.onMouseDown=function(){this.adjustHeight()},$i.prototype.adjustHeight=function(){var t=this.el.nativeElement;t.style.overflow="hidden",t.style.height="auto",t.style.height=t.scrollHeight-5+"px"},$i.decorators=[{type:E.Directive,args:[{selector:"[mvTextAreaAutoExpand]"}]}],$i.ctorParameters=function(){return[{type:E.ElementRef}]},$i.propDecorators={onMouseDown:[{type:E.HostListener,args:["input"]}]},$i);function $i(t){this.el=t}var Vi=(Ui.prototype.ngOnInit=function(){this.filtersFg=this.fb.group({dateRangeFrom:new u.FormGroup({day:new u.FormControl(""),month:new u.FormControl(""),year:new u.FormControl("")}),dateRangeTo:new u.FormGroup({day:new u.FormControl(""),month:new u.FormControl(""),year:new u.FormControl("")}),tagFilters:this.fb.group({})}),this.comments$=this.store.pipe(S.select(Vo)),this.buildCheckBoxForm(),this.container.nativeElement.focus()},Ui.prototype.buildCheckBoxForm=function(){var o=this;this.filtersFg.reset();var i=this.filtersFg.get("tagFilters"),t=this.store.pipe(S.select(Lo));this.allTags$=this.store.pipe(S.select(_o)),this.$subscriptions=f.combineLatest([this.allTags$,t]).subscribe(function(t){var e=R(t,2),t=e[0],n=e[1];o.hasFilter=n.hasFilter,t.forEach(function(t){var e=!(!n.filters.tagFilters||!n.filters.tagFilters.hasOwnProperty(t.key))&&n.filters.tagFilters[t.key];i.addControl(t.key,new u.FormControl(e))}),o.filtersFg.updateValueAndValidity()})},Ui.prototype.onClearFilters=function(){this.store.dispatch(new Pe),this.buildCheckBoxForm()},Ui.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,e=e?new Date(t.dateRangeFrom.year,t.dateRangeFrom.month-1,t.dateRangeFrom.day).getTime():null,n=n?new Date(t.dateRangeTo.year,t.dateRangeTo.month-1,t.dateRangeTo.day).getTime():null;this.store.dispatch(new Ie(P({},t,{dateRangeFrom:e,dateRangeTo:n})))},Ui.prototype.onFiltersToggle=function(){this.showFilters=!this.showFilters},Ui.prototype.onClose=function(){this.toolbarEvents.toggleCommentsSummary(!1)},Ui.prototype.onPrint=function(){this.printService.printElementNatively(this.commentsTable.nativeElement,1e3,900)},Ui.prototype.navigateToPage=function(t){"pdf"===this.contentType&&this.toolbarEvents.setPage(t),this.toolbarEvents.toggleCommentsSummary(!1),this.toolbarEvents.toggleCommentsPanel(!0)},Ui.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},Ui.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'}]}],Ui.ctorParameters=function(){return[{type:S.Store},{type:X},{type:q},{type:u.FormBuilder}]},Ui.propDecorators={title:[{type:E.Input}],contentType:[{type:E.Input}],container:[{type:E.ViewChild,args:["outerContainer"]}],commentsTable:[{type:E.ViewChild,args:["commentContainer"]}]},Ui);function Ui(t,e,n,o){this.store=t,this.printService=e,this.toolbarEvents=n,this.fb=o,this.showFilters=!1,this.hasFilter=!1}var zi=(Wi.prototype.ngOnInit=function(){var e=this;this.subscriptions=[this.toolbarEvents.drawModeSubject.subscribe(function(t){e.defaultHeight=t?"100%":"0px",e.defaultWidth=t?"100%":"0px"})]},Wi.prototype.ngOnDestroy=function(){this.subscriptions.forEach(function(t){t.unsubscribe()})},Wi.prototype.initHighlight=function(t){var e=t.offsetX,t=t.offsetY;switch(this.position="absolute",this.backgroundColor="yellow",this.drawStartX=e,this.drawStartY=t,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}},Wi.prototype.updateHighlight=function(t){var e=t.offsetX,t=t.offsetY;0<this.drawStartX&&0<this.drawStartY&&(this.height=Math.abs(t-this.drawStartY),this.width=Math.abs(e-this.drawStartX),this.top=Math.min(t,this.drawStartY),this.left=Math.min(e,this.drawStartX))},Wi.prototype.createHighlight=function(){var t;(5<this.height/this.zoom||5<this.width/this.zoom)&&(t=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,this.height,this.width,this.top,this.left,this.rotate,this.zoom),t=P({id:C()},t),this.saveSelection.emit({rectangles:[t],page:this.page}),this.resetHighlight())},Wi.prototype.resetHighlight=function(){this.drawStartX=-1,this.drawStartY=-1,this.display="none",this.width=0,this.height=0},Wi.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'}]}],Wi.ctorParameters=function(){return[{type:q},{type:Pi}]},Wi.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"]}]},Wi);function Wi(t,e){this.toolbarEvents=t,this.highlightService=e,this.saveSelection=new E.EventEmitter,this.drawStartX=-1,this.drawStartY=-1,this.backgroundColor="none",this.subscriptions=[]}var qi=(Gi.prototype.ngOnInit=function(){var n=this,t=this.store.pipe(S.select(Io)),e=this.store.pipe(S.select(Uo));this.$subscriptions=f.combineLatest([t,e]).subscribe(function(t){var e=R(t,2),t=e[0],e=e[1];n.navigationList=e,n.tabs=0<n.navigationList.length?[{label:"comments"},{label:"filter"},{label:"search"}]:[{label:"comments"}],n.isFiltered=!t.length,n.tabs=O(n.tabs).map(function(t){return n.isFiltered||"filter"!==t.label?P({},t,{isFiltered:!1}):P({},t,{isFiltered:!0})})})},Gi.prototype.toggleCommentsSummary=function(){this.showCommentSummaryDialog.emit()},Gi.prototype.selectTab=function(t){this.tabSelected=t!==this.tabSelected?t:undefined},Gi.prototype.toggleCommentsPanel=function(){this.toolbarEvents.toggleCommentsPanel(!this.toolbarEvents.commentsPanelVisible.getValue())},Gi.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},Gi.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}]}],Gi.ctorParameters=function(){return[{type:S.Store},{type:q}]},Gi.propDecorators={showCommentSummary:[{type:E.Input}],showCommentSummaryDialog:[{type:E.Output}]},Gi);function Gi(t,e){this.store=t,this.toolbarEvents=e,this.showCommentSummaryDialog=new E.EventEmitter,this.tabs=[],this.tabSelected=""}var Zi=(Yi.prototype.ngAfterViewInit=function(){this.searchInput&&this.searchInput.nativeElement.focus()},Yi.prototype.ngOnDestroy=function(){var t=this;setTimeout(function(){t.store.dispatch(new Ce(""))},250)},Yi.prototype.searchComments=function(t){var e=this;this.clearSearch(),2<t.length&&(this.searchString=t,this.searchResults=this.annotations.filter(function(t){return 0<t.comments.length}).filter(function(t){return t.comments[0].content.toLowerCase().includes(e.searchString.toLowerCase())}),0<this.searchResults.length&&this.store.dispatch(new Ce(t)))},Yi.prototype.clearSearch=function(){this.searchString=undefined,this.searchResults=[],this.searchIndex=0,this.store.dispatch(new Ce(""))},Yi.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}]}],Yi.ctorParameters=function(){return[{type:S.Store}]},Yi.propDecorators={annotations:[{type:E.Input}],searchInput:[{type:E.ViewChild,args:["searchInput"]}]},Yi);function Yi(t){this.store=t,this.searchResults=[],this.searchIndex=0}var Xi=(Ki.prototype.ngAfterViewChecked=function(){this.textToHighlight&&this.highlightInputText(this.textToHighlight)},Ki.prototype.highlightInputText=function(t){this.resetHighlight(),this.textToHighlight=t;var e=new RegExp(t,"gi"),t=this.element.nativeElement;t.innerHTML.match(e)&&(t.innerHTML=t.innerHTML.replace(e,this.highlightPattern("$&"))),this.textToHighlight=undefined},Ki.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]))}},Ki.prototype.highlightPattern=function(t){return'<span class="mvTextHighlight">'+t+"</span>"},Ki.decorators=[{type:E.Directive,args:[{selector:"[mvTextHighlight]"}]}],Ki.ctorParameters=function(){return[{type:E.ElementRef}]},Ki.propDecorators={textToHighlight:[{type:E.Input}]},Ki);function Ki(t){this.element=t}var Ji=(Qi.prototype.onUpdateTags=function(t){this.tagsServices.updateTagItems(t,this.annoId)},Qi.prototype.minLength=function(t){return t.value.length<2?{minLength:!0}:null},Qi.prototype.maxLength20=function(t){return 20<=t.value.length?{maxLength20:!0}:null},Qi.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}]}],Qi.ctorParameters=function(){return[{type:Di}]},Qi.propDecorators={tagItems:[{type:E.Input}],userId:[{type:E.Input}],editable:[{type:E.Input}],annoId:[{type:E.Input}]},Qi);function Qi(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)}}var ta=(ea.prototype.ngOnChanges=function(t){t.annotationList&&this.initNavigationList()},ea.prototype.initNavigationList=function(){var e=this;this.index=0,this.navigationList=O(this.annotationList||[]).map(function(t){return{content:t.comments[0].content,annotationId:t.id,page:t.page,rectangle:e.upperRectangle(t.rectangles)}}).sort(this.sortComments),this.autoSelect&&(this.toolbarEvents.setPage(Number.parseInt(this.navigationList[0].page,0)),this.store.dispatch(new Ee({annotationId:this.navigationList[0].annotationId,editable:!1,selected:!0})))},ea.prototype.sortComments=function(t,e){if(t.page!==e.page)return t.page-e.page;t=t.rectangle,e=e.rectangle;return t.y!==e.y?t.y-e.y:t.x-e.x},ea.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 Ee({annotationId:this.navigationList[this.index].annotationId,editable:!1,selected:!0}))},ea.prototype.prevItem=function(){--this.index,this.index<0&&(this.index=this.navigationList.length-1),this.toolbarEvents.setPage(Number.parseInt(this.navigationList[this.index].page,0)),this.store.dispatch(new Ee({annotationId:this.navigationList[this.index].annotationId,editable:!1,selected:!0}))},ea.prototype.upperRectangle=function(t){return O(t).sort(function(t,e){return t.y-e.y}),{x:t[0].x,y:t[0].y}},ea.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}]}],ea.ctorParameters=function(){return[{type:S.Store},{type:q}]},ea.propDecorators={annotationList:[{type:E.Input}],autoSelect:[{type:E.Input}]},ea);function ea(t,e){this.store=t,this.toolbarEvents=e,this.autoSelect=!1,this.navigationList=[],this.index=0}var na=(oa.prototype.ngOnInit=function(){var e=this;this.tagGroup=this.fb.group({tagFilters:this.fb.group({})}),this.filter$=this.store.pipe(S.select(Io)),this.$subscriptions=this.tagGroup.valueChanges.pipe(w.auditTime(5)).subscribe(function(t){t=t.tagFilters;e.store.dispatch(new Ot(t))}),this.buildFrom()},oa.prototype.buildFrom=function(){var e=this,n=this.tagGroup.get("tagFilters");this.allTags$=this.store.pipe(S.select(_o)).pipe(w.tap(function(t){e.tagGroup.reset(),t.forEach(function(t){n.addControl(t.key,new u.FormControl(!1))})}))},oa.prototype.onClearFilters=function(){this.tagGroup.reset(),this.store.dispatch(new Mt)},oa.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},oa.prototype.onRemoveFilter=function(t){this.tagGroup.get("tagFilters").controls[t].setValue(!1)},oa.prototype.onToggleFilterView=function(){this.isPreview=!this.isPreview},oa.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}]}],oa.ctorParameters=function(){return[{type:S.Store},{type:u.FormBuilder}]},oa);function oa(t,e){this.store=t,this.fb=e,this.isPreview=!1}var ia,aa,ra=(ia=l.DatePipe,I(aa=ca,wr=ia),aa.prototype=null===wr?Object.create(wr):(sa.prototype=wr.prototype,new sa),ca.prototype.transform=function(t,e,n){void 0===e&&(e="mediumDate"),void 0===n&&(n="Europe/London");n=c(t).tz(n).format("Z");return ia.prototype.transform.call(this,t,e,n)},ca.decorators=[{type:E.Pipe,args:[{name:"momentDate"}]}],ca);function sa(){this.constructor=aa}function ca(){return null!==ia&&ia.apply(this,arguments)||this}var la=(ua.prototype.getBookmarks=function(t){return this.httpClient.get(this.ANNOTATIONS_API+"/"+t+"/bookmarks",{observe:"response",withCredentials:!0})},ua.prototype.createBookmark=function(t){return this.httpClient.post(this.ANNOTATIONS_API+"/bookmarks",t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},ua.prototype.updateBookmark=function(t){return this.httpClient.put(this.ANNOTATIONS_API+"/bookmarks",t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},ua.prototype.updateMultipleBookmarks=function(t){return this.httpClient.put(this.ANNOTATIONS_API+"/bookmarks_multiple",t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},ua.prototype.deleteBookmark=function(t){return this.httpClient["delete"](this.ANNOTATIONS_API+"/bookmarks/"+t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},ua.prototype.deleteMultipleBookmarks=function(t){return this.httpClient.request("DELETE",this.ANNOTATIONS_API+"/bookmarks_multiple",{body:t,observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},ua.decorators=[{type:E.Injectable}],ua.ctorParameters=function(){return[{type:m.HttpClient}]},ua);function ua(t){this.httpClient=t,this.ANNOTATIONS_API="/em-anno"}var pa=(da.prototype.transform=function(t,e,n){return t?e?t.filter(function(t){return!!t&&(t[n]||t).toLowerCase().includes(e.toLowerCase())}):t:[]},da.decorators=[{type:E.Pipe,args:[{name:"filter"}]}],da);function da(){}var ha=(ma.prototype.transform=function(t){return t.split("_").join(" ")},ma.decorators=[{type:E.Pipe,args:[{name:"unsnake"}]}],ma);function ma(){}var ga=(fa.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'}]}],fa.propDecorators={config:[{type:E.Input}],errorMessage:[{type:E.Input}],formGroup:[{type:E.Input}]},fa);function fa(){}var ba=(va.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 '}]}],va.ctorParameters=function(){return[]},va.propDecorators={config:[{type:E.Input}],errorMessage:[{type:E.Input}]},va);function va(){}var ya=(wa.setDescribedBy=function(t,e){return t&&t.isInvalid?e.hint?e.id+"-hint "+e.id+"-error":e.id+"-error":e.hint?e.id+"-hint":null},wa);function wa(){}var ka=(Sa.prototype.setDescribedBy=function(){return ya.setDescribedBy(this.errorMessage,this.config)},Sa.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 '}]}],Sa.propDecorators={config:[{type:E.Input}],isHeading:[{type:E.Input}],errorMessage:[{type:E.Input}]},Sa);function Sa(){}var Ea=(Ca.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 '}]}],Ca.ctorParameters=function(){return[]},Ca.propDecorators={config:[{type:E.Input}]},Ca);function Ca(){}var Ia=(Pa.decorators=[{type:E.NgModule,args:[{imports:[l.CommonModule,u.FormsModule,u.ReactiveFormsModule,l.CommonModule,d.RouterModule],declarations:[ga,ba,ka,Ea],exports:[ga,ba,ka,Ea]}]}],Pa);function Pa(){}var xa=S.createSelector(Qn,function(t){return t.bookmarks}),_a=S.createSelector(xa,function(t){return t.bookmarkPageEntities}),Ta=S.createSelector(xa,function(t){return t.bookmarkEntities}),Da=S.createSelector(Ta,function(t){return o=JSON.parse(JSON.stringify(t)),bn(o),Object.keys(o).reduce(function(t,e){var n=o[e];return n.parent?((e=o[n.parent]).children||(e.children=[]),e.children[n.index]=n):t[n.index]=n,t},[]);var o}),Ba=S.createSelector(xa,function(t){return t.editableBookmark}),Ra=S.createSelector(Da,no,oo,eo,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:0<t.length?t[t.length-1].id:undefined,documentId:e}}),Oa=S.createSelector(eo,_a,function(n,o){if(n&&o){var i=[];return Object.keys(n).forEach(function(t){var e=Number(t)-1,e=o[e];i.push({bookmark:e||[],styles:n[t].styles})}),i}}),Ma=(Aa.prototype.ngOnInit=function(){var e=this;this.$subscriptions=this.store.pipe(S.select(eo)).subscribe(function(t){return e.pages=Object.values(t)}),this.annoPages$=this.store.pipe(S.select(No)),this.$subscriptions.add(this.toolbarEvents.drawModeSubject.subscribe(function(t){return e.drawMode=t})).add(this.viewerEvents.textHighlight.subscribe(function(t){return e.showContextToolbar(t)})).add(this.viewerEvents.ctxToolbarCleared.subscribe(function(){return e.clearContextToolbar()}))},Aa.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},Aa.prototype.showContextToolbar=function(t){this.highlightPage=t.page,this.rectangles=t.rectangles,this.rectangles&&this.toolbarEvents.highlightModeSubject.next(!1)},Aa.prototype.clearContextToolbar=function(){this.rectangles=undefined},Aa.prototype.createHighlight=function(){this.highlightService.saveAnnotation(this.rectangles,this.highlightPage),this.highlightService.resetHighlight(),this.rectangles=undefined},Aa.prototype.createBookmark=function(n){var o=this;this.store.pipe(S.select(Ra),w.take(1)).subscribe(function(t){var e=window.getSelection().toString();o.store.dispatch(new nn(P({},t,{name:0<e.length?e.substr(0,30):"new bookmark",id:C(),pageNumber:o.highlightPage-1,xCoordinate:n.x,yCoordinate:n.y}))),o.toolbarEvents.toggleSideBar(!0),o.highlightService.resetHighlight(),o.rectangles=undefined})},Aa.prototype.saveAnnotation=function(t){var e=t.rectangles,t=t.page;this.highlightService.saveAnnotation(e,t),this.toolbarEvents.drawModeSubject.next(!1)},Aa.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'}]}],Aa.ctorParameters=function(){return[{type:S.Store},{type:Pi},{type:q},{type:co}]},Aa.propDecorators={zoom:[{type:E.Input}],rotate:[{type:E.Input}]},Aa);function Aa(t,e,n,o){this.store=t,this.highlightService=e,this.toolbarEvents=n,this.viewerEvents=o,this.pages=[],this.drawMode=!1}var Na=(ja.decorators=[{type:E.NgModule,args:[{imports:[a.A11yModule,l.CommonModule,u.FormsModule,m.HttpClientModule,v.MutableDivModule,p.TagInputModule,d.RouterModule,u.ReactiveFormsModule,r.NgxDatatableModule,Ia],declarations:[Ma,Si,zi,Ci,_i,Ri,qi,Zi,Xi,Mi,Fi,ta,Hi,Vi,Ji,ra,na,pa,ha],entryComponents:[Si,Ci,Fi],providers:[yo,la,Ni,Pi,Di],exports:[Si,zi,Ci,Fi,qi,Zi,Vi,Ji,na,ra,pa,ha,Ma]}]}],ja);function ja(){}var Fa=(La.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})},La.prototype.onPointerMove=function(t){var e;this.pointerDown&&this.dragEnabled&&(t.preventDefault(),e=this.originalPosition.left-(t.clientX+this.el.nativeElement.scrollLeft),t=this.originalPosition.top-(t.clientY+this.el.nativeElement.scrollTop),this.dragEnabled&&(this.dragX.scrollLeft+=e,this.el.nativeElement.scrollTop+=t))},La.prototype.onWindowPointerUp=function(){this.pointerDown=!1},La.decorators=[{type:E.Directive,args:[{selector:"[mvGrabNDrag]"}]}],La.ctorParameters=function(){return[{type:E.ElementRef}]},La.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"]}]},La);function La(t){this.el=t,this.pointerDown=!1,this.dragEnabled=!1}var Ha=($a.prototype.ngOnInit=function(){var e=this;this.bookmarkNodes$=this.store.pipe(S.select(Da)),this.$subscription=this.store.pipe(S.select(Ba)).subscribe(function(t){return e.selectedView=t?"bookmarks":e.selectedView})},$a.prototype.ngOnChanges=function(t){t.url&&this.url&&this.store.dispatch(new Qe)},$a.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},$a.prototype.goToDestination=function(t){this.viewerEvents.goToDestination(t)},$a.prototype.toggleSidebarView=function(t){this.selectedView=t},$a.prototype.onAddBookmarkClick=function(){var e=this;this.toggleSidebarView("bookmarks"),this.store.pipe(S.select(Ra),w.take(1)).subscribe(function(t){e.store.dispatch(new nn(P({},t,{name:"",id:C()})))})},$a.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'}]}],$a.ctorParameters=function(){return[{type:co},{type:S.Store}]},$a.propDecorators={annotationsEnabled:[{type:E.Input}],outline:[{type:E.Input}],url:[{type:E.Input}],zoom:[{type:E.Input}],rotate:[{type:E.Input}]},$a);function $a(t,e){this.viewerEvents=t,this.store=e,this.selectedView="outline"}var Va=(Ua.prototype.ngOnInit=function(){this.showOutlineItems=!0},Ua.prototype.goToDestination=function(t){t&&this.navigationEvent.emit(t)},Ua.prototype.toggleOutline=function(){this.showOutlineItems=!this.showOutlineItems},Ua.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'}]}],Ua.propDecorators={outline:[{type:E.Input}],navigationEvent:[{type:E.Output}]},Ua);function Ua(){this.navigationEvent=new E.EventEmitter}var za=(Wa.prototype.ngOnInit=function(){var e=this;this.redactionsPerPage$=this.store.pipe(S.select(si)),this.selectedRedaction$=this.store.pipe(S.select(oi)),this.$subscription=this.toolbarEvents.drawModeSubject.subscribe(function(t){return e.drawMode=t}),this.$subscription.add(this.store.pipe(S.select(ii),w.filter(function(t){return!!t})).subscribe(function(t){return e.downloadDocument(t)})),this.$subscription.add(this.store.pipe(S.select(no)).subscribe(function(t){return e.documentId=t})),this.$subscription.add(this.viewerEvents.textHighlight.subscribe(function(t){return e.markTextRedaction(t)})),this.toolbarEvents.applyRedactToDocument.subscribe(function(){e.store.pipe(S.select(ri),w.take(1)).subscribe(function(t){e.store.dispatch(new Vn(t))})}),this.toolbarEvents.clearAllRedactMarkers.subscribe(function(){e.store.dispatch(new qn(e.documentId))})},Wa.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},Wa.prototype.markTextRedaction=function(t){var e=t.rectangles;e&&e.length&&this.saveRedaction(t.page,O(e)),this.toolbarEvents.highlightModeSubject.next(!1)},Wa.prototype.markBoxRedaction=function(t){var e=t.rectangles,t=t.page;this.saveRedaction(t,e),this.toolbarEvents.drawModeSubject.next(!1)},Wa.prototype.saveRedaction=function(t,e){e={page:t,rectangles:e,redactionId:C(),documentId:this.documentId};this.store.dispatch(new An(e))},Wa.prototype.onMarkerDelete=function(t){this.store.dispatch(new Fn(t))},Wa.prototype.selectRedaction=function(t){this.store.dispatch(new $n(t))},Wa.prototype.onMarkerUpdate=function(t){this.store.dispatch(new An(t))},Wa.prototype.downloadDocument=function(t){var e=t.blob,n=t.filename;navigator&&navigator.msSaveBlob?navigator.msSaveBlob(e,n):(t=URL.createObjectURL(e),e=document.createElement("a"),document.body.appendChild(e),e.setAttribute("style","display: none"),e.href=t,e.download=n,e.click(),e.remove(),URL.revokeObjectURL(t)),this.store.dispatch(new Wn)},Wa.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'}]}],Wa.ctorParameters=function(){return[{type:S.Store},{type:co},{type:q}]},Wa.propDecorators={zoom:[{type:E.Input}],rotate:[{type:E.Input}]},Wa);function Wa(t,e,n){this.store=t,this.viewerEvents=e,this.toolbarEvents=n}var qa=(Ga.prototype.loadSession=function(t){return this.httpClient.get(this.ICP_SESSION_API+"/"+t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},Ga.decorators=[{type:E.Injectable}],Ga.ctorParameters=function(){return[{type:m.HttpClient}]},Ga);function Ga(t){this.httpClient=t,this.ICP_SESSION_API="/icp/sessions"}var Za=(Ya.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},Ya.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)})},Ya.prototype.join=function(e){var n=this;this.subscription=this.connected$.subscribe(function(t){t&&n.socket.emit("join",e)})},Ya.prototype.leave=function(t){this.socket.emit("leave",t),this.subscription.unsubscribe()},Ya.prototype.emit=function(t,e){this.socket.emit(t,e)},Ya.prototype.listen=function(t){var n=this;return new f.Observable(function(e){return n.socket.on(t,function(t){e.next(t)}),function(){return n.socket.off(t)}})},Ya.prototype.getSocketClient=function(){return h("/",{path:"/icp/socket.io",agent:!0})},Ya.decorators=[{type:E.Injectable}],Ya.ctorParameters=function(){return[]},Ya);function Ya(){this.connected$=new f.BehaviorSubject(!1)}var Xa=(Ka.prototype.joinSession=function(t,e){return this.session=e,this.socket.connect(),this.socket.join(P({},this.session,{username:t})),this.socket.listen(this.SESSION_JOINED)},Ka.prototype.leaveSession=function(){this.socket.leave(this.session)},Ka.prototype.newParticipantJoined=function(){return this.socket.listen(this.NEW_PARTICIPANT_JOINED)},Ka.prototype.clientDisconnected=function(){return this.socket.listen(this.CLIENT_DISCONNECTED)},Ka.prototype.removeParticipant=function(t){this.socket.emit(this.REMOVE_PARTICIPANT,{participantId:t,caseId:this.session.caseId})},Ka.prototype.participantListUpdated=function(){return this.socket.listen(this.PARTICIPANTS_UPDATED)},Ka.prototype.updatePresenter=function(t){this.socket.emit(this.UPDATE_PRESENTER,P({},this.session,{presenterId:t.id,presenterName:t.username}))},Ka.prototype.presenterUpdated=function(){return this.socket.listen(this.PRESENTER_UPDATED)},Ka.prototype.updateScreen=function(t){t={body:t,sessionId:this.session.sessionId};this.socket.emit(this.UPDATE_SCREEN,t)},Ka.prototype.screenUpdated=function(){return this.socket.listen(this.SCREEN_UPDATED)},Ka.decorators=[{type:E.Injectable}],Ka.ctorParameters=function(){return[{type:Za}]},Ka);function Ka(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"}var Ja=(Qa.prototype.update=function(t){t?this.subscribe():this.unsubscribe()},Qa.prototype.subscribe=function(){var e=this;this.$subscription||(this.$subscription=this.store.pipe(S.select(oo)).subscribe(function(t){e.pdfPosition=t,e.onPositionUpdate(t)}),this.$subscription.add(this.store.pipe(S.select(hi)).subscribe(function(t){e.presenter=t})),this.$subscription.add(this.socketService.newParticipantJoined().subscribe(function(){return e.onNewParticipantJoined()})))},Qa.prototype.unsubscribe=function(){this.$subscription&&(this.$subscription.unsubscribe(),this.$subscription=undefined)},Qa.prototype.onPositionUpdate=function(t){t={pdfPosition:t,document:undefined};this.socketService.updateScreen(t)},Qa.prototype.onNewParticipantJoined=function(){this.onPositionUpdate(this.pdfPosition),this.socketService.updatePresenter(this.presenter)},Qa.decorators=[{type:E.Injectable}],Qa.ctorParameters=function(){return[{type:q},{type:Xa},{type:S.Store}]},Qa);function Qa(t,e,n){this.toolbarEvents=t,this.socketService=e,this.store=n}var tr=(er.prototype.update=function(t){t?this.subscribe():this.unsubscribe()},er.prototype.subscribe=function(){var e=this;this.$subscription||(this.$subscription=this.socketService.screenUpdated().subscribe(function(t){return e.followScreenUpdate(t)}))},er.prototype.unsubscribe=function(){this.$subscription&&(this.$subscription.unsubscribe(),this.$subscription=undefined)},er.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(oo),w.take(1)).subscribe(function(t){t=(n.rotation-t.rotation)%360;0!=t&&e.toolbarEvents.rotate(t)})},er.decorators=[{type:E.Injectable}],er.ctorParameters=function(){return[{type:q},{type:co},{type:Xa},{type:S.Store}]},er);function er(t,e,n,o){this.toolbarEvents=t,this.viewerEvents=e,this.socketService=n,this.store=o}var nr=(or.prototype.ngOnDestroy=function(){this.unsubscribeSession(),this.subscription.unsubscribe()},or.prototype.launchSession=function(){var t=this;this.store.dispatch(new Ut(this.caseId)),this.subscription.add(this.store.pipe(S.select(pi),w.filter(function(t){return!!t&&1<Object.keys(t).length}),w.take(1)).subscribe(function(){t.setUpSessionSubscriptions()}))},or.prototype.setUpSessionSubscriptions=function(){var e=this;this.sessionSubscription=this.toolbarEvents.icp.becomingPresenter.subscribe(function(){return e.becomePresenter()}),this.sessionSubscription.add(this.toolbarEvents.icp.stoppingPresenting.subscribe(function(){return e.stopPresenting()})),this.sessionSubscription.add(this.toolbarEvents.icp.sessionExitConfirmed.subscribe(function(){return e.leavePresentation()})),this.sessionSubscription.add(this.store.pipe(S.select(hi)).subscribe(function(t){return e.presenter=t})),this.sessionSubscription.add(this.store.pipe(S.select(gi)).subscribe(function(t){return e.client=t})),this.sessionSubscription.add(this.store.pipe(S.select(fi)).subscribe(function(t){e.isPresenter=t,e.presenterSubscriptions.update(t),e.followerSubscriptions.update(!t)})),this.sessionSubscription.add(this.socketService.clientDisconnected().subscribe(function(t){return e.clientDisconnected(t)})),this.sessionSubscription.add(this.socketService.presenterUpdated().subscribe(function(t){e.store.dispatch(new Zt(t))})),this.sessionSubscription.add(this.socketService.participantListUpdated().subscribe(function(t){e.store.dispatch(new Yt(t))}))},or.prototype.unsubscribeSession=function(){this.presenterSubscriptions.update(!1),this.followerSubscriptions.update(!1),this.sessionSubscription.unsubscribe()},or.prototype.leavePresentation=function(){this.isPresenter&&this.stopPresenting(),this.removeParticipant(this.client.id),this.socketService.leaveSession(),this.store.dispatch(new Gt),this.unsubscribeSession()},or.prototype.stopPresenting=function(){this.socketService.updatePresenter({username:"",id:""})},or.prototype.becomePresenter=function(){this.socketService.updatePresenter(this.client)},or.prototype.clientDisconnected=function(t){t===this.presenter.id&&this.stopPresenting(),this.removeParticipant(t)},or.prototype.removeParticipant=function(t){this.socketService.removeParticipant(t)},or.decorators=[{type:E.Injectable}],or.ctorParameters=function(){return[{type:q},{type:co},{type:Xa},{type:Ja},{type:tr},{type:S.Store}]},or);function or(t,e,n,o,i,a){var r=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(di),w.filter(function(t){return!!t})).subscribe(function(t){r.caseId=t}),this.subscription.add(this.toolbarEvents.icp.sessionLaunch.subscribe(function(){r.caseId&&r.launchSession()}))}var ir=(ar.decorators=[{type:E.Injectable}],ar.ctorParameters=function(){return[{type:g.Actions},{type:yo}]},x([g.Effect(),_("design:type",Object)],ar.prototype,"loadAnnotation$",void 0),x([g.Effect(),_("design:type",Object)],ar.prototype,"postAnnotation$",void 0),x([g.Effect(),_("design:type",Object)],ar.prototype,"deleteAnnotation$",void 0),ar);function ar(t,e){var n=this;this.actions$=t,this.annotationApiService=e,this.loadAnnotation$=this.actions$.pipe(g.ofType(Qt),w.map(function(t){return t.payload}),w.switchMap(function(t){return n.annotationApiService.getAnnotationSet(t).pipe(w.map(function(t){return new me(t)}),w.catchError(function(t){return f.of(new ge(t))}))})),this.postAnnotation$=this.actions$.pipe(g.ofType(ne),w.map(function(t){return t.payload}),w.exhaustMap(function(t){return n.annotationApiService.postAnnotation(t).pipe(w.map(function(t){return new be(t)}),w.catchError(function(t){return f.of(new ge(t))}))})),this.deleteAnnotation$=this.actions$.pipe(g.ofType(re),w.map(function(t){return t.payload}),w.exhaustMap(function(e){return n.annotationApiService.deleteAnnotation(e).pipe(w.map(function(t){return new ke(e)}),w.catchError(function(t){return f.of(new Se(t))}))}))}var rr=(sr.decorators=[{type:E.Injectable}],sr.ctorParameters=function(){return[{type:g.Actions},{type:S.Store},{type:la}]},x([g.Effect(),_("design:type",Object)],sr.prototype,"loadBookmarks$",void 0),x([g.Effect(),_("design:type",Object)],sr.prototype,"createBookmark$",void 0),x([g.Effect(),_("design:type",Object)],sr.prototype,"moveBookmark$",void 0),x([g.Effect(),_("design:type",Object)],sr.prototype,"deleteBookmark$",void 0),x([g.Effect(),_("design:type",Object)],sr.prototype,"updateBookmark$",void 0),sr);function sr(t,e,n){var o=this;this.actions$=t,this.store=e,this.bookmarksApiService=n,this.loadBookmarks$=this.actions$.pipe(g.ofType(Ve),w.withLatestFrom(this.store.pipe(S.select(no))),w.map(function(t){return R(t,2)[1]}),w.exhaustMap(function(t){return o.bookmarksApiService.getBookmarks(t).pipe(w.map(function(t){return new tn(t)}),w.catchError(function(t){return f.of(new en(t))}))})),this.createBookmark$=this.actions$.pipe(g.ofType(We),w.map(function(t){return t.payload}),w.exhaustMap(function(t){return o.bookmarksApiService.createBookmark(t).pipe(w.map(function(t){return new on(t)}),w.catchError(function(t){return f.of(new an(t))}))})),this.moveBookmark$=this.actions$.pipe(g.ofType(Ye),w.map(function(t){return t.payload}),w.exhaustMap(function(t){return o.bookmarksApiService.updateMultipleBookmarks(t).pipe(w.map(function(t){return new un(t)}),w.catchError(function(t){return f.of(new pn(t))}))})),this.deleteBookmark$=this.actions$.pipe(g.ofType(Ge),w.map(function(t){return t.payload}),w.exhaustMap(function(t){var e=t.deleted,n=t.updated;return o.bookmarksApiService.deleteMultipleBookmarks({deleted:e,updated:n}).pipe(w.switchMap(function(){return n?[new sn(e),new hn(n)]:[new sn(e)]}),w.catchError(function(t){return f.of(new cn(t))}))})),this.updateBookmark$=this.actions$.pipe(g.ofType(Ke),w.map(function(t){return t.payload}),w.switchMap(function(t){return o.bookmarksApiService.updateBookmark(t).pipe(w.map(function(t){return new hn(t)}),w.catchError(function(t){return f.of(new mn(t))}))}))}var cr=(lr.prototype.getRedactions=function(t){t=this.markupsApiUrl+"/"+t;return this.httpClient.get(t,{observe:"response",withCredentials:!0})},lr.prototype.saveRedaction=function(t){return this.httpClient.post(this.markupsApiUrl,t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}),w.catchError(function(){return[]}))},lr.prototype.deleteRedaction=function(t){t=this.markupsApiUrl+"/"+t.documentId+"/"+t.redactionId;return this.httpClient["delete"](t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},lr.prototype.deleteAllMarkers=function(t){t=this.markupsApiUrl+"/"+t;return this.httpClient["delete"](t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t.body}))},lr.prototype.redact=function(t){return this.httpClient.post(this.redactApiUrl,t,{observe:"response",withCredentials:!0,responseType:"blob"}).pipe(w.map(function(t){return t}),w.catchError(function(){return[]}))},lr.decorators=[{type:E.Injectable}],lr.ctorParameters=function(){return[{type:m.HttpClient}]},lr);function lr(t){this.httpClient=t,this.markupsApiUrl="/api/markups",this.redactApiUrl="/api/redaction"}var ur=(pr.decorators=[{type:E.Injectable}],pr.ctorParameters=function(){return[{type:g.Actions},{type:cr}]},x([g.Effect(),_("design:type",Object)],pr.prototype,"loadRedactions$",void 0),x([g.Effect(),_("design:type",Object)],pr.prototype,"saveRedaction$",void 0),x([g.Effect(),_("design:type",Object)],pr.prototype,"deleteRedaction$",void 0),x([g.Effect(),_("design:type",Object)],pr.prototype,"redact$",void 0),x([g.Effect(),_("design:type",Object)],pr.prototype,"unmarkAll$",void 0),pr);function pr(t,e){var o=this;this.actions$=t,this.redactionApiService=e,this.loadRedactions$=this.actions$.pipe(g.ofType(wn),w.map(function(t){return t.payload}),w.switchMap(function(t){return o.redactionApiService.getRedactions(t).pipe(w.map(function(t){return new On(t.body)}),w.catchError(function(t){return f.of(new Mn(t))}))})),this.saveRedaction$=this.actions$.pipe(g.ofType(Sn),w.map(function(t){return t.payload}),w.exhaustMap(function(t){return o.redactionApiService.saveRedaction(t).pipe(w.map(function(t){return new Nn(t)}),w.catchError(function(t){return f.of(new jn(t))}))})),this.deleteRedaction$=this.actions$.pipe(g.ofType(Cn),w.map(function(t){return t.payload}),w.exhaustMap(function(t){return o.redactionApiService.deleteRedaction(t).pipe(w.map(function(){return new Ln(t)}),w.catchError(function(t){return f.of(new Hn(t))}))})),this.redact$=this.actions$.pipe(g.ofType(xn),w.map(function(t){return t.payload}),w.exhaustMap(function(n){return o.redactionApiService.redact(n).pipe(w.map(function(t){var e=t.headers.get("content-disposition").split("filename="),e=1<e.length?e[1].replace(/"/g,""):"redacted-document-"+n.documentId;return new Un({blob:t.body,filename:e})}),w.catchError(function(t){return f.of(new zn(t))}))})),this.unmarkAll$=this.actions$.pipe(g.ofType(Dn),w.map(function(t){return t.payload}),w.exhaustMap(function(t){return o.redactionApiService.deleteAllMarkers(t).pipe(w.map(function(t){return new Gn}),w.catchError(function(t){return f.of(new Hn(t))}))}))}var dr=(hr.prototype.convert=function(t){return this.httpClient.post(this.documentConversionUrl+"/"+t,{},{observe:"response",withCredentials:!0,responseType:"blob"}).pipe(w.map(function(t){return t}),w.catchError(function(t){return f.of(t)}))},hr.decorators=[{type:E.Injectable}],hr.ctorParameters=function(){return[{type:m.HttpClient}]},hr);function hr(t){this.httpClient=t,this.documentConversionUrl="/doc-assembly/convert"}var mr=(gr.prototype.getRotation=function(t){t=this.rotationApiUrl+"/"+t;return this.httpClient.get(t,{observe:"response",withCredentials:!0})},gr.prototype.saveRotation=function(t){var e=this.rotationApiUrl+"/";return this.httpClient.post(e,t,{observe:"response",withCredentials:!0}).pipe(w.map(function(t){return t}),w.catchError(function(){return[]}))},gr.decorators=[{type:E.Injectable}],gr.ctorParameters=function(){return[{type:m.HttpClient}]},gr);function gr(t){this.httpClient=t,this.rotationApiUrl="/em-anno/metadata"}fr.decorators=[{type:E.Injectable}],fr.ctorParameters=function(){return[{type:g.Actions},{type:dr},{type:mr}]},x([g.Effect(),_("design:type",Object)],fr.prototype,"convert$",void 0),x([g.Effect(),_("design:type",Object)],fr.prototype,"loadRotation$",void 0),x([g.Effect(),_("design:type",Object)],fr.prototype,"saveRotation$",void 0),Co=fr;function fr(t,e,n){var o=this;this.actions$=t,this.documentConversionService=e,this.rotationApiService=n,this.convert$=this.actions$.pipe(g.ofType(lt),w.map(function(t){return t.payload}),w.exhaustMap(function(t){return o.documentConversionService.convert(t).pipe(w.map(function(t){t=URL.createObjectURL(t.body);return new St(t)}),w.catchError(function(t){return f.of(new Et(t))}))})),this.loadRotation$=this.actions$.pipe(g.ofType(ht),w.map(function(t){return t.payload}),w.switchMap(function(t){return o.rotationApiService.getRotation(t).pipe(w.map(function(t){return new Pt(t.body)}),w.catchError(function(t){return f.of(new xt(t))}))})),this.saveRotation$=this.actions$.pipe(g.ofType(ft),w.map(function(t){return t.payload}),w.switchMap(function(t){return o.rotationApiService.saveRotation(t).pipe(w.map(function(t){return new Tt(t.body)}),w.catchError(function(t){return f.of(new Dt(t))}))}))}br.decorators=[{type:E.Injectable}],br.ctorParameters=function(){return[{type:g.Actions},{type:qa},{type:Xa}]},x([g.Effect(),_("design:type",Object)],br.prototype,"loadIcpSession$",void 0),x([g.Effect(),_("design:type",Object)],br.prototype,"joinIcpSocketSession$",void 0),ei=br;function br(t,e,n){var o=this;this.actions$=t,this.icpApiService=e,this.icpUpdateService=n,this.loadIcpSession$=this.actions$.pipe(g.ofType(Nt),w.map(function(t){return t.payload}),w.exhaustMap(function(t){return o.icpApiService.loadSession(t).pipe(w.map(function(t){return new Wt(t)}),w.catchError(function(t){return f.of(new zt(t))}))})),this.joinIcpSocketSession$=this.actions$.pipe(g.ofType(jt),w.map(function(t){return t.payload}),w.switchMap(function(e){return o.icpUpdateService.joinSession(e.username,e.session).pipe(w.map(function(t){return new qt({session:e.session,participantInfo:t})}))}))}ai=[ir,rr,ur,Co,ei],vr.prototype.ngOnInit=function(){var n=this;this.$subscription=this.store.pipe(S.select(Ba)).subscribe(function(t){return n.editableBookmark=t}),this.$subscription.add(this.store.select(eo).subscribe(function(e){Object.keys(e).map(function(t){n.pageLookup[t]=e[t]})}))},vr.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},vr.prototype.editBookmark=function(t){this.editableBookmark=t},vr.prototype.onBookmarkMove=function(t){var e=t.node,n=t.from,o=t.to,i=[P({},e,{previous:0<o.index?o.parent.children[o.index-1].id:undefined,parent:o.parent.documentId?o.parent.id:undefined})],t=this.getSibling(n,n.index);(t=t&&t.id===e.previous?this.getSibling(n,n.index+1):t)&&(i=O(i,[P({},t,{previous:e.previous})]));o=this.getSibling(o,o.index+1);o&&(i=O(i,[P({},o,{previous:e.id})])),this.store.dispatch(new ln(i))},vr.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 rn({deleted:O([t.data.id],gn(t.data.children)),updated:e}))},vr.prototype.updateBookmark=function(t,e){t=P({},t,{name:e});e&&(this.store.dispatch(new dn(t)),this.editableBookmark=undefined)},vr.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])},vr.prototype.getSibling=function(t,e){return t.parent.children.length>e?t.parent.children[e]:undefined},vr.prototype.scaledY=function(t,e,n){n=n.viewportScale/this.zoom;return(e/this.zoom-t)/n},vr.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'}]}],vr.ctorParameters=function(){return[{type:S.Store}]},vr.propDecorators={bookmarkNodes:[{type:E.Input}],zoom:[{type:E.Input}],rotate:[{type:E.Input}],goToDestination:[{type:E.Output}]},ni=vr;function vr(t){this.store=t,this.goToDestination=new E.EventEmitter,this.pageLookup={},this.BOOKMARK_CHAR_LIMIT=30,this.options={allowDrag:!0,allowDrop:!0}}yr.prototype.ngOnInit=function(){var e=this;this.store.dispatch(new kt(this.extractDMStoreDocId(this.originalUrl))),this.$subscription=this.store.pipe(S.select(ao),w.filter(function(t){return!!t})).subscribe(function(t){t.url?(e.convertedUrl=t.url,e.store.dispatch(new Ct)):e.onLoadException(new Q(t.error))})},yr.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},yr.prototype.onMediaLoad=function(t){this.mediaLoadStatus.emit(t)},yr.prototype.onLoadException=function(t){this.viewerException.emit(t)},yr.prototype.onDocumentTitleChange=function(t){this.documentTitle.emit(t)},yr.prototype.extractDMStoreDocId=function(t){return t.includes("/documents/")?t=t.split("/documents/")[1]:t.includes("/documentsv2/")&&(t=t.split("/documentsv2/")[1]),t.replace("/binary","")},yr.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}]}],yr.ctorParameters=function(){return[{type:S.Store}]},yr.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}]},ui=yr;function yr(t){this.store=t,this.mediaLoadStatus=new E.EventEmitter,this.viewerException=new E.EventEmitter,this.documentTitle=new E.EventEmitter}var wr=(kr.prototype.onCancel=function(){this.toolbarEvents.icp.leavingSession.next(!1)},kr.prototype.onConfirm=function(){this.toolbarEvents.icp.confirmExit(),this.toolbarEvents.icp.leavingSession.next(!1)},kr.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'}]}],kr.ctorParameters=function(){return[{type:q}]},kr);function kr(t){this.toolbarEvents=t}Sr.prototype.ngOnInit=function(){this.bookmarksPerPage$=this.store.pipe(S.select(Oa))},Sr.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'}]}],Sr.ctorParameters=function(){return[{type:S.Store}]},Sr.propDecorators={zoom:[{type:E.Input}],rotate:[{type:E.Input}]},Ta=Sr;function Sr(t){this.store=t}Er.prototype.ngOnInit=function(){var e=this;this.$subscriptions=this.toolbarEvents.rotateSubject.subscribe(function(t){return e.onRotate(t)}),this.$subscriptions.add(this.toolbarEvents.saveRotationSubject.subscribe(function(){return e.saveRotation()})).add(this.store.pipe(S.select(ro)).subscribe(function(t){return e.savedRotation=t})).add(this.store.pipe(S.select(no)).subscribe(function(t){return e.documentId=t}))},Er.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},Er.prototype.onMediaLoad=function(t){var e=this;this.rotation=0,this.store.dispatch(new It(this.documentId)),this.store.pipe(S.select(so),w.filter(function(t){return!!t}),w.take(1)).subscribe(function(){e.savedRotation&&e.toolbarEvents.rotateSubject.next(e.savedRotation)})},Er.prototype.onRotate=function(t){this.rotation=(this.rotation+t)%360,this.toolbarButtons.showSaveRotationButton=this.savedRotation!==this.rotation},Er.prototype.saveRotation=function(){var t={documentId:this.documentId,rotationAngle:this.rotation};this.store.dispatch(new _t(t))},Er.decorators=[{type:E.Directive,args:[{selector:"[mvRotationPersist]"}]}],Er.ctorParameters=function(){return[{type:E.ElementRef},{type:S.Store},{type:tt},{type:q}]},Er.propDecorators={onMediaLoad:[{type:E.HostListener,args:["mediaLoadStatus",["$event"]]}]},xa=Er;function Er(t,e,n,o){this.el=t,this.store=e,this.toolbarButtons=n,this.toolbarEvents=o,this.rotation=0,this.savedRotation=0}Cr.prototype.ngOnInit=function(){var e=this;this.participants$=this.store.pipe(S.select(bi)),this.presenter$=this.store.pipe(S.select(hi)),this.isPresenter$=this.store.pipe(S.select(fi)),this.subscription=this.toolbarEvents.icp.participantsListVisible.subscribe(function(t){return e.showParticipantsList=t})},Cr.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},Cr.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'}]}],Cr.ctorParameters=function(){return[{type:q},{type:S.Store}]},_a=Cr;function Cr(t,e){this.toolbarEvents=t,this.store=e,this.showParticipantsList=!1}Ir.prototype.ngOnInit=function(){var e=this;this.$subscription=this.store.select(eo).subscribe(function(t){t[1]&&(e.allPages=t)})},Ir.prototype.ngOnDestroy=function(){this.$subscription&&this.$subscription.unsubscribe()},Ir.prototype.onMouseUp=function(t){var e=t.target.offsetParent.offsetParent,e=parseInt(e.getAttribute("data-page-number"),10);this.toolbarEvents.highlightModeSubject.getValue()&&(t=this.getRectangles(t,e),this.viewerEvents.textSelected({page:e,rectangles:t}))},Ir.prototype.onPdfViewerClick=function(t){this.store.dispatch(new Ee({annotationId:"",selected:!1,editable:!1})),this.viewerEvents.clearCtxToolbar()},Ir.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);e=window.getSelection();if(e){t=t.target;if(this.removeEnhancedTextModeStyling(t),e.rangeCount&&!e.isCollapsed){var n=e.getRangeAt(0).cloneRange().getClientRects();if(n){for(var o=t.parentElement.getBoundingClientRect(),i=[],a=this,r=0;r<n.length;r++)!function(t){var e=a.createTextRectangle(n[t],o);i.find(function(t){return t.width===e.width&&t.x===e.x})||i.push(e)}(r);return i}}}},Ir.prototype.createTextRectangle=function(t,e){var n=t.bottom-t.top,o=t.right-t.left,i=t.top-e.top,e=t.left-e.left,e=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,n,o,i,e,this.rotate,this.zoom);return e=P({id:C()},e)},Ir.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()}},Ir.decorators=[{type:E.Directive,args:[{selector:"[mvCreateTextHighlight]"}]}],Ir.ctorParameters=function(){return[{type:E.ElementRef},{type:q},{type:co},{type:Pi},{type:S.Store}]},Ir.propDecorators={onMouseUp:[{type:E.HostListener,args:["mouseup",["$event"]]}],onPdfViewerClick:[{type:E.HostListener,args:["mousedown",["$event"]]}]},a=Ir;function Ir(t,e,n,o,i){this.element=t,this.toolbarEvents=e,this.viewerEvents=n,this.highlightService=o,this.store=i}Pr.prototype.ngOnInit=function(){var t=this;this.subscription=this.toolbarEvents.downloadSubject.subscribe(function(){return t.downloadLink.nativeElement.click()}),this.loadStatus.emit(J.SUCCESS)},Pr.prototype.ngOnChanges=function(t){t.url&&this.reloadVideo()},Pr.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},Pr.prototype.reloadVideo=function(){this.videoPlayer&&(this.playbackMsg="loading",this.videoPlayer.nativeElement.load())},Pr.prototype.onSuccess=function(){this.playbackMsg="success"},Pr.prototype.onError=function(){this.playbackMsg="error"},Pr.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'}]}],Pr.ctorParameters=function(){return[{type:q}]},Pr.propDecorators={url:[{type:E.Input}],downloadFileName:[{type:E.Input}],multimediaOn:[{type:E.Input}],loadStatus:[{type:E.Output}],downloadLink:[{type:E.ViewChild,args:["downloadLink"]}],videoPlayer:[{type:E.ViewChild,args:["videoPlayer"]}]},r=Pr;function Pr(t){this.toolbarEvents=t,this.loadStatus=new E.EventEmitter,this.playbackMsg="loading"}xr.decorators=[{type:E.NgModule,args:[{imports:[l.CommonModule,m.HttpClientModule,wi,Na,p.TagInputModule,u.FormsModule,u.ReactiveFormsModule,d.RouterModule,S.StoreModule.forFeature("media-viewer",Jn),g.EffectsModule.forFeature(ai),y.TreeModule.forRoot(),v.MutableDivModule],declarations:[uo,Ha,ni,Va,go,bo,r,Go,ui,Fa,xa,a,wr,za,Ta,_a],entryComponents:[uo,go,bo],providers:[Z,ko,cr,qa,Xa,Za,nr,Ja,tr,cr,dr,mr],exports:[Go]}]}],v=xr;function xr(){}t.MediaViewerModule=v,t.ToolbarButtonVisibilityService=tt,t.ToolbarEventService=q,t.ToolbarModule=wi,t.AnnotationApiService=yo,t.AnnotationsModule=Na,t.ResponseType=J,t.ViewerException=Q,t.reducer=De,t.initialState=Te,t.getAnnoSet=Be,t.getCommentEnts=Re,t.getAnnoPageEnt=Oe,t.getAnnoEnt=Me,t.getSelectedAnno=Ae,t.commentSearchQ=Ne,t.getSummaryFilters=je,t.getAnnotationsSetState=To,t.getAnnotationEntities=Do,t.getSet=Bo,t.getDocumentIdSetId=Ro,t.getAnnotationSet=Oo,t.getSelectedAnnotation=Mo,t.getCommentEntities=Ao,t.getPageEntities=No,t.getComponentSearchQueries=jo,t.getComponentSearchText=Fo,t.getCommentSummaryFilters=Lo,t.getAnnoPerPage=Ho,t.getCommentsArray=$o,t.getCommentSummary=Vo,t.getFilteredAnnotations=Uo,t.LOAD_ANNOTATION_SET=Qt,t.LOAD_ANNOTATION_SET_SUCCESS=te,t.LOAD_ANNOTATION_SET_FAIL=ee,t.SAVE_ANNOTATION=ne,t.SAVE_ANNOTATION_SUCCESS=oe,t.SAVE_ANNOTATION_FAIL=ie,t.ADD_OR_EDIT_COMMENT=ae,t.DELETE_ANNOTATION=re,t.DELETE_ANNOTATION_SUCCESS=se,t.DELETE_ANNOTATION_FAIL=ce,t.SELECT_ANNOTATION=le,t.SEARCH_COMMENT=ue,t.APPLY_COMMENT_SUMMARY_FILTER=pe,t.CLEAR_COMMENT_SUMMARY_FILTER=de,t.LoadAnnotationSet=he,t.LoadAnnotationSetSucess=me,t.LoadAnnotationSetFail=ge,t.SaveAnnotation=fe,t.SaveAnnotationSuccess=be,t.SaveAnnotationFail=ve,t.AddOrEditComment=ye,t.DeleteAnnotation=we,t.DeleteAnnotationSuccess=ke,t.DeleteAnnotationFail=Se,t.SelectedAnnotation=Ee,t.SearchComment=Ce,t.ApplyCommentSymmaryFilter=Ie,t.ClearCommentSummaryFilters=Pe,t.AnnotationEffects=ir,t.ɵbc=zi,t.ɵcw=a,t.ɵz=Pi,t.ɵbd=Ci,t.ɵbb=Si,t.ɵbf=_i,t.ɵbl=Mi,t.ɵy=Ma,t.ɵbo=ta,t.ɵbu=na,t.ɵbj=Zi,t.ɵbi=qi,t.ɵbn=Ni,t.ɵbm=Fi,t.ɵbg=Ri,t.ɵbe=ko,t.ɵbk=Xi,t.ɵbp=Hi,t.ɵbq=Vi,t.ɵbt=ra,t.ɵbv=pa,t.ɵbw=ha,t.ɵbx=la,t.ɵbh=Di,t.ɵbs=Ji,t.ɵcz=Ta,t.ɵcx=wr,t.ɵdd=tr,t.ɵdc=Ja,t.ɵcg=qa,t.ɵch=Xa,t.ɵdb=nr,t.ɵda=_a,t.ɵci=Za,t.ɵcs=Go,t.ɵbr=X,t.ɵcy=za,t.ɵcb=cr,t.ɵu=ga,t.ɵv=ba,t.ɵw=ka,t.ɵx=Ea,t.ɵt=Ia,t.ɵc=Yo,t.ɵbz=rr,t.ɵcc=Co,t.ɵcf=ei,t.ɵby=ai,t.ɵca=ur,t.ɵo=yn,t.ɵi=Kt,t.ɵj=Jt,t.ɵq=Kn,t.ɵp=Yn,t.ɵg=Qn,t.ɵf=Jn,t.ɵl=He,t.ɵm=$e,t.ɵk=Le,t.ɵde=to,t.ɵdf=eo,t.ɵdi=xo,t.ɵdh=Po,t.ɵdg=Eo,t.ɵr=vi,t.ɵb=Ko,t.ɵd=ci,t.ɵa=Qo,t.ɵct=ui,t.ɵcd=dr,t.ɵcu=Fa,t.ɵco=go,t.ɵcr=r,t.ɵck=Z,t.ɵcj=uo,t.ɵcm=ni,t.ɵcn=Va,t.ɵcl=Ha,t.ɵce=mr,t.ɵcv=xa,t.ɵcq=bo,t.ɵba=co,t.ɵcp=ho,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=hmcts-media-viewer.umd.min.js.map
|