@hmcts/media-viewer 2.9.2 → 2.9.4-RC.7
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/images/icon-bookmarks-custom.png +0 -0
- package/assets/images/icon-bookmarks-position.png +0 -0
- package/assets/images/toolbarButton-bookmarkDark.png +0 -0
- package/assets/sass/comment-set-panel.scss +1 -0
- package/assets/sass/comment.scss +4 -6
- package/assets/sass/image-viewer.scss +2 -1
- package/assets/sass/pdf-viewer.scss +4 -0
- package/assets/sass/toolbar/buttons.scss +24 -0
- package/assets/sass/toolbar/main-toolbar.scss +20 -7
- package/assets/sass/toolbar/side-bar.scss +17 -17
- package/bundles/hmcts-media-viewer.umd.js +748 -325
- 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/hmcts-media-viewer.js +53 -52
- package/esm2015/lib/annotations/annotation-set/annotation-create/box-highlight-create/box-highlight-create.component.js +2 -2
- package/esm2015/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.directive.js +2 -2
- package/esm2015/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.service.js +2 -2
- package/esm2015/lib/annotations/annotation-set/annotation-view/annotation-view.component.js +1 -1
- package/esm2015/lib/annotations/annotation-set/metadata-layer/metadata-layer.component.js +3 -2
- package/esm2015/lib/annotations/annotations.module.js +3 -1
- package/esm2015/lib/annotations/comment-set/comment/comment.component.js +3 -2
- package/esm2015/lib/annotations/comment-set/comment/comment.service.js +6 -2
- package/esm2015/lib/annotations/comment-set/comment-set-header/comment-set-header.component.js +13 -2
- package/esm2015/lib/media-viewer.component.js +4 -2
- package/esm2015/lib/print.service.js +4 -2
- package/esm2015/lib/redaction/components/redaction.component.js +2 -2
- package/esm2015/lib/redaction/services/redaction-api.service.js +7 -1
- package/esm2015/lib/redaction/services/redaction.model.js +1 -1
- package/esm2015/lib/store/actions/redaction.actions.js +22 -1
- package/esm2015/lib/store/effects/redaction.effects.js +18 -4
- package/esm2015/lib/store/reducers/bookmarks.reducer.js +3 -2
- package/esm2015/lib/store/reducers/redaction.reducer.js +9 -1
- package/esm2015/lib/store/selectors/bookmark.selectors.js +2 -2
- package/esm2015/lib/toolbar/main-toolbar/main-toolbar.component.js +19 -4
- package/esm2015/lib/toolbar/redaction-search-bar/redaction-search-bar.component.js +201 -0
- package/esm2015/lib/toolbar/redaction-search-bar/redaction-search.model.js +2 -0
- package/esm2015/lib/toolbar/redaction-toolbar/redaction-toolbar.component.js +18 -6
- package/esm2015/lib/toolbar/toolbar-event.service.js +9 -1
- package/esm2015/lib/toolbar/toolbar.module.js +6 -3
- package/esm2015/lib/viewers/image-viewer/image-viewer.component.js +2 -2
- package/esm2015/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.js +18 -5
- package/esm2015/lib/viewers/pdf-viewer/pdf-viewer.component.js +3 -2
- package/esm2015/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.js +70 -5
- package/esm2015/lib/viewers/pdf-viewer/side-bar/outline-item/outline-item.component.js +4 -1
- package/esm2015/lib/viewers/pdf-viewer/side-bar/side-bar.component.js +24 -19
- package/fesm2015/hmcts-media-viewer.js +605 -221
- package/fesm2015/hmcts-media-viewer.js.map +1 -1
- package/hmcts-media-viewer.d.ts +56 -55
- package/hmcts-media-viewer.d.ts.map +1 -1
- package/hmcts-media-viewer.metadata.json +1 -1
- package/lib/annotations/annotation-set/annotation-create/box-highlight-create/box-highlight-create.component.d.ts.map +1 -1
- package/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.service.d.ts.map +1 -1
- package/lib/annotations/annotation-set/annotation-view/annotation-view.component.d.ts.map +1 -1
- package/lib/annotations/annotation-set/metadata-layer/metadata-layer.component.d.ts.map +1 -1
- package/lib/annotations/annotations.module.d.ts.map +1 -1
- package/lib/annotations/comment-set/comment/comment.component.d.ts +2 -0
- package/lib/annotations/comment-set/comment/comment.component.d.ts.map +1 -1
- package/lib/annotations/comment-set/comment/comment.service.d.ts +3 -1
- package/lib/annotations/comment-set/comment/comment.service.d.ts.map +1 -1
- package/lib/annotations/comment-set/comment-set-header/comment-set-header.component.d.ts +4 -1
- package/lib/annotations/comment-set/comment-set-header/comment-set-header.component.d.ts.map +1 -1
- package/lib/media-viewer.component.d.ts +1 -0
- package/lib/media-viewer.component.d.ts.map +1 -1
- package/lib/media-viewer.module.ngfactory.d.ts.map +1 -1
- package/lib/print.service.d.ts.map +1 -1
- package/lib/redaction/components/redaction.component.d.ts.map +1 -1
- package/lib/redaction/services/redaction-api.service.d.ts +3 -1
- package/lib/redaction/services/redaction-api.service.d.ts.map +1 -1
- package/lib/redaction/services/redaction.model.d.ts +3 -0
- package/lib/redaction/services/redaction.model.d.ts.map +1 -1
- package/lib/store/actions/redaction.actions.d.ts +20 -2
- package/lib/store/actions/redaction.actions.d.ts.map +1 -1
- package/lib/store/effects/redaction.effects.d.ts +4 -1
- package/lib/store/effects/redaction.effects.d.ts.map +1 -1
- package/lib/store/reducers/bookmarks.reducer.d.ts.map +1 -1
- package/lib/store/reducers/redaction.reducer.d.ts.map +1 -1
- package/lib/store/selectors/annotation.selectors.d.ts +5 -5
- package/lib/store/selectors/redaction.selectors.d.ts +1 -1
- package/lib/store/selectors/tag.selectors.d.ts +2 -2
- package/lib/toolbar/main-toolbar/main-toolbar.component.d.ts +3 -1
- package/lib/toolbar/main-toolbar/main-toolbar.component.d.ts.map +1 -1
- package/lib/toolbar/redaction-search-bar/redaction-search-bar.component.d.ts +51 -0
- package/lib/toolbar/redaction-search-bar/redaction-search-bar.component.d.ts.map +1 -0
- package/lib/toolbar/redaction-search-bar/redaction-search-bar.component.ngfactory.d.ts.map +1 -0
- package/lib/toolbar/redaction-search-bar/redaction-search-bar.component.scss.shim.ngstyle.d.ts.map +1 -0
- package/lib/toolbar/redaction-search-bar/redaction-search.model.d.ts +12 -0
- package/lib/toolbar/redaction-search-bar/redaction-search.model.d.ts.map +1 -0
- package/lib/toolbar/redaction-toolbar/redaction-toolbar.component.d.ts +4 -2
- package/lib/toolbar/redaction-toolbar/redaction-toolbar.component.d.ts.map +1 -1
- package/lib/toolbar/toolbar-event.service.d.ts +6 -0
- package/lib/toolbar/toolbar-event.service.d.ts.map +1 -1
- package/lib/toolbar/toolbar.module.d.ts.map +1 -1
- package/lib/toolbar/toolbar.module.ngfactory.d.ts.map +1 -1
- package/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.d.ts +1 -0
- package/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.d.ts.map +1 -1
- package/lib/viewers/pdf-viewer/pdf-viewer.component.d.ts +1 -0
- package/lib/viewers/pdf-viewer/pdf-viewer.component.d.ts.map +1 -1
- package/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.d.ts +17 -4
- package/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.d.ts.map +1 -1
- package/lib/viewers/pdf-viewer/side-bar/outline-item/outline-item.component.d.ts.map +1 -1
- package/lib/viewers/pdf-viewer/side-bar/side-bar.component.d.ts +7 -4
- package/lib/viewers/pdf-viewer/side-bar/side-bar.component.d.ts.map +1 -1
- package/package.json +5 -4
- package/hmcts-media-viewer-v2.9.2.tgz +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators"),require("@ngrx/store"),require("pdfjs-dist/web/pdf_viewer"),require("pdfjs-dist"),require("pdfjs-dist/build/pdf.worker"),require("uuid/v4"),require("moment-timezone"),require("hammerjs"),require("@angular/cdk/overlay"),require("@angular/router"),require("@angular/cdk/a11y"),require("mutable-div"),require("ngx-chips"),require("@swimlane/ngx-datatable"),require("uuid"),require("@ngrx/effects"),require("@circlon/angular-tree-component")):"function"==typeof define&&define.amd?define("@hmcts/media-viewer",["exports","@angular/core","@angular/common","@angular/forms","@angular/common/http","rxjs","rxjs/operators","@ngrx/store","pdfjs-dist/web/pdf_viewer","pdfjs-dist","pdfjs-dist/build/pdf.worker","uuid/v4","moment-timezone","hammerjs","@angular/cdk/overlay","@angular/router","@angular/cdk/a11y","mutable-div","ngx-chips","@swimlane/ngx-datatable","uuid","@ngrx/effects","@circlon/angular-tree-component"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).hmcts=t.hmcts||{},t.hmcts["media-viewer"]={}),t.ng.core,t.ng.common,t.ng.forms,t.ng.common.http,t.rxjs,t.rxjs.operators,t.store,t.pdfjsViewer,t.pdfjsLib,null,t.uuid,t.moment,null,t.ng.cdk.overlay,t.ng.router,t.ng.cdk.a11y,t.mutableDiv,t.ngxChips,t.ngxDatatable,t.uuid$1,t.effects$1,t.angularTreeComponent)}(this,(function(t,e,n,o,i,a,s,r,c,l,u,p,d,h,m,g,b,f,v,y,w,S,k){"use strict";function E(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function C(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var I=C(e),O=C(i),P=C(c),x=C(l),j=E(p),T=E(d),_=E(w),D=function(t,e){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},D(t,e)};function R(t,e,n,o){var i,a=arguments.length,s=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var r=t.length-1;r>=0;r--)(i=t[r])&&(s=(a<3?i(s):a>3?i(e,n,s):i(e,n))||s);return a>3&&s&&Object.defineProperty(e,n,s),s}function B(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function N(t,e,n,o){return new(n||(n=Promise))((function(i,a){function s(t){try{c(o.next(t))}catch(t){a(t)}}function r(t){try{c(o.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,r)}c((o=o.apply(t,e||[])).next())}))}function M(t,e){var n,o,i,a,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function r(r){return function(c){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,r[0]&&(s=0)),s;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,o=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(6===r[0]&&s.label<i[1]){s.label=i[1],i=r;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(r);break}i[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,c])}}}Object.create;function A(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function F(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,a=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=a.next()).done;)s.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return s}function L(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(F(arguments[e]));return t}var $;Object.create;x.GlobalWorkerOptions.workerSrc="/assets/build/pdf.worker.min.js",function(t){t[t.FOUND=0]="FOUND",t[t.NOT_FOUND=1]="NOT_FOUND",t[t.WRAPPED=2]="WRAPPED",t[t.PENDING=3]="PENDING"}($||($={}));var H=function(){function t(t,e,n,o,i,a,s,r,c,l){var u=this;this.pdfViewer=t,this.downloadManager=e,this.toolbarEvents=n,this.documentLoadInit=o,this.documentLoadProgress=i,this.documentLoaded=a,this.outlineLoaded=s,this.documentLoadFailed=r,this.pageRendered=c,this.positionUpdated=l,this.pdfViewer.eventBus.on("updateviewarea",(function(t){return l.next(t)})),this.pdfViewer.eventBus.on("pagechanging",(function(t){return u.toolbarEvents.setCurrentPageInputValueSubject.next(t.pageNumber)})),this.pdfViewer.eventBus.on("pagesinit",(function(){return u.pdfViewer.currentScaleValue="1"})),this.pdfViewer.eventBus.on("pagerendered",(function(t){})),this.pdfViewer.eventBus.on("pagesloaded",(function(t){return u.emitDocumentInfo(t)})),this.pdfViewer.eventBus.on("scalechanging",(function(t){return u.emitDocumentInfo(t)})),this.pdfViewer.eventBus.on("rotationchanging",(function(t){return u.emitDocumentInfo(t)})),this.pdfViewer.eventBus.on("updatefindcontrolstate",(function(t){t.state!==$.PENDING&&u.toolbarEvents.searchResultsCountSubject.next(t.matchesCount)})),this.pdfViewer.eventBus.on("updatefindmatchescount",(function(t){u.toolbarEvents.searchResultsCountSubject.next(t.matchesCount)})),this.zoomValue=1}return t.prototype.emitDocumentInfo=function(t){var e=L(this.pdfViewer._pages).map((function(t){return{div:t.div,scale:t.scale,rotation:t.rotation,id:t.id,viewportScale:t.viewport.scale}}));this.pageRendered.next(e)},t.prototype.loadDocument=function(t){return N(this,void 0,void 0,(function(){var e,n,o,i,a,s=this;return M(this,(function(r){switch(r.label){case 0:(e=this.createLoadingTask(t)).onProgress=function(t){var e=t.loaded,n=t.total;s.documentLoadProgress.next({loaded:e,total:n})},this.documentLoadInit.next(t),r.label=1;case 1:return r.trys.push([1,6,,7]),[4,e.promise];case 2:return n=r.sent(),this.documentLoaded.next(n),this.toolbarEvents.pageCountSubject.next(n.numPages),this.pdfViewer.setDocument(n),this.pdfViewer.linkService.setDocument(n,null),[4,n.getOutline()];case 3:return o=r.sent(),[4,this.setOutlinePageNumbers(n,o)];case 4:return r.sent(),this.documentOutline=o,this.outlineLoaded.next(this.documentOutline),[4,n.getMetadata()];case 5:return i=r.sent(),this.setCurrentPDFTitle(i.info.Title),[3,7];case 6:return a=r.sent(),this.documentLoadFailed.next(a),[3,7];case 7:return[2]}}))}))},t.prototype.createLoadingTask=function(t){return x.getDocument({url:t,cMapUrl:"assets/minified/cmaps",cMapPacked:!0,withCredentials:!0})},t.prototype.setOutlinePageNumbers=function(t,e){return N(this,void 0,void 0,(function(){var n=this;return M(this,(function(o){return e.forEach((function(e){return N(n,void 0,void 0,(function(){return M(this,(function(n){switch(n.label){case 0:return[4,this.setNestedOutlinePageNumbers(t,e)];case 1:return n.sent(),[2]}}))}))})),[2]}))}))},t.prototype.setNestedOutlinePageNumbers=function(t,e){return N(this,void 0,void 0,(function(){var n,o=this;return M(this,(function(i){switch(i.label){case 0:return n=e,[4,this.getOutlinePageNumber(t,e)];case 1:return n.pageNumber=i.sent(),e.items.forEach((function(e){return N(o,void 0,void 0,(function(){var n;return M(this,(function(o){switch(o.label){case 0:return n=e,[4,this.getOutlinePageNumber(t,e)];case 1:return n.pageNumber=o.sent(),this.setNestedOutlinePageNumbers(t,e),[2]}}))}))})),[2]}}))}))},t.prototype.getOutlinePageNumber=function(t,e){return N(this,void 0,void 0,(function(){var n,o;return M(this,(function(i){switch(i.label){case 0:return n=e.dest,[4,t.getPageIndex(n[0])];case 1:return o=i.sent(),[2,Number(o)+1]}}))}))},t.prototype.downloadFile=function(t,e){this.downloadManager.downloadUrl(t,e)},t.prototype.setPageNumber=function(t){this.pdfViewer.currentPageNumber=t},t.prototype.getPageNumber=function(){return this.pdfViewer.currentPageNumber},t.prototype.changePageNumber=function(t){this.pdfViewer.currentPageNumber+=t},t.prototype.search=function(t){var e=t.reset?"find":"findagain";this.pdfViewer.findController.executeCommand(e,{query:t.searchTerm,phraseSearch:!0,caseSensitive:t.matchCase,entireWord:t.wholeWord,highlightAll:t.highlightAll,findPrevious:t.previous})},t.prototype.clearSearch=function(){this.pdfViewer.eventBus.dispatch("findbarclose")},t.prototype.navigateTo=function(t){t instanceof Object&&(t[1].name.includes("XYZ")||(t[1]={name:"XYZ"},t[2]=t[2]||null,t[3]=t[3]||null),t[4]=this.zoomValue),this.pdfViewer.linkService.navigateTo(t)},t.prototype.setZoom=function(t){this.pdfViewer.currentScaleValue=this.getZoomValue(t),this.zoomValue=this.pdfViewer.currentScaleValue,this.toolbarEvents.zoomValueSubject.next(this.pdfViewer.currentScaleValue)},t.prototype.stepZoom=function(t){this.pdfViewer.currentScaleValue=+this.getZoomValue(+this.pdfViewer.currentScaleValue+t),this.zoomValue=this.pdfViewer.currentScaleValue,this.toolbarEvents.zoomValueSubject.next(this.pdfViewer.currentScaleValue)},t.prototype.getZoomValue=function(t){return isNaN(t)?this.zoomValue:t>5?5:t<.1?.1:+t.toFixed(2)},t.prototype.rotate=function(t){return this.pdfViewer.pagesRotation=(this.pdfViewer.pagesRotation+t)%360},t.prototype.resetRotation=function(t){return this.pdfViewer.pagesRotation=t},t.prototype.getNormalisedPagesRotation=function(){return this.pdfViewer.pagesRotation},t.prototype.getCurrentPDFZoomValue=function(){return this.pdfViewer.currentScaleValue},t.prototype.setCurrentPDFTitle=function(t){this.documentTitle=t},t.prototype.getCurrentPDFTitle=function(){return this.documentTitle},t}(),V=new a.BehaviorSubject(!1),U=new a.Subject,z=new a.Subject,W=new a.Subject,q=new a.BehaviorSubject(!1),G=new a.Subject,Z=new a.BehaviorSubject(!1),J=function(){U.next()},Y=Object.freeze({__proto__:null,enabled:V,sessionLaunch:U,becomingPresenter:z,stoppingPresenting:W,leavingSession:q,sessionExitConfirmed:G,participantsListVisible:Z,launchSession:J,enable:function(){V.next(!0),J()},becomePresenter:function(){z.next()},stopPresenting:function(){W.next()},leaveSession:function(){q.next(!0)},confirmExit:function(){G.next(),Z.next(!1),V.next(!1)}}),X=function(){function t(){this.highlightModeSubject=new a.BehaviorSubject(!1),this.drawModeSubject=new a.BehaviorSubject(!1),this.rotateSubject=new a.Subject,this.searchSubject=new a.Subject,this.searchResultsCountSubject=new a.Subject,this.zoomSubject=new a.Subject,this.stepZoomSubject=new a.Subject,this.zoomValueSubject=new a.BehaviorSubject(1),this.pageCountSubject=new a.Subject,this.printSubject=new a.Subject,this.downloadSubject=new a.Subject,this.setCurrentPageSubject=new a.Subject,this.setCurrentPageInputValueSubject=new a.Subject,this.changePageByDeltaSubject=new a.Subject,this.showCommentSummary=new a.BehaviorSubject(!1),this.grabNDrag=new a.BehaviorSubject(!1),this.saveRotationSubject=new a.Subject,this.redactionMode=new a.BehaviorSubject(!1),this.redactionPreview=new a.Subject,this.applyRedactToDocument=new a.Subject,this.clearAllRedactMarkers=new a.Subject,this.redactWholePage=new a.Subject,this.sidebarOpen=new a.BehaviorSubject(!1),this.searchBarHidden=new a.BehaviorSubject(!0),this.commentsPanelVisible=new a.BehaviorSubject(!1),this.icp=Y}return t.prototype.reset=function(){this.setCurrentPageSubject.next(1),this.zoomValueSubject.next(1),this.highlightModeSubject.next(!1),this.drawModeSubject.next(!1),this.showCommentSummary.next(!1),this.grabNDrag.next(!1)},t.prototype.toggleHighlightMode=function(){!1===this.highlightModeSubject.getValue()?(this.drawModeSubject.next(!1),this.grabNDrag.next(!1),this.highlightModeSubject.next(!0)):this.highlightModeSubject.next(!1)},t.prototype.toggleDrawMode=function(){!1===this.drawModeSubject.getValue()?(this.highlightModeSubject.next(!1),this.grabNDrag.next(!1),this.drawModeSubject.next(!0)):this.drawModeSubject.next(!1)},t.prototype.rotate=function(t){this.rotateSubject.next(t)},t.prototype.search=function(t){this.searchSubject.next(t)},t.prototype.getSearchResultsCount=function(){return this.searchResultsCountSubject.asObservable()},t.prototype.zoom=function(t){this.zoomSubject.next(t)},t.prototype.stepZoom=function(t){this.stepZoomSubject.next(t)},t.prototype.getZoomValue=function(){return this.zoomValueSubject.asObservable()},t.prototype.getPageCount=function(){return this.pageCountSubject.asObservable()},t.prototype.print=function(){this.printSubject.next()},t.prototype.download=function(){this.downloadSubject.next()},t.prototype.setPage=function(t){this.setCurrentPageSubject.next(t)},t.prototype.incrementPage=function(t){this.changePageByDeltaSubject.next(t)},t.prototype.getCurrentPageNumber=function(){return this.setCurrentPageInputValueSubject.asObservable()},t.prototype.getShowCommentSummary=function(){return this.showCommentSummary.asObservable()},t.prototype.toggleCommentsSummary=function(t){this.showCommentSummary.next(t)},t.prototype.saveRotation=function(){this.saveRotationSubject.next()},t.prototype.toggleGrabNDrag=function(){this.grabNDrag.next(!this.grabNDrag.getValue())},t.prototype.toggleSideBar=function(t){this.sidebarOpen.next(t)},t.prototype.toggleRedactionMode=function(){!1===this.redactionMode.getValue()?(this.drawModeSubject.next(!1),this.grabNDrag.next(!1),this.redactionMode.next(!0)):this.redactionMode.next(!1)},t.prototype.toggleRedactionPreview=function(t){this.redactionPreview.next(t)},t.prototype.unmarkAll=function(){this.clearAllRedactMarkers.next()},t.prototype.applyRedactionToDocument=function(){this.applyRedactToDocument.next()},t.prototype.redactPage=function(){this.redactWholePage.next()},t.prototype.toggleCommentsPanel=function(t){t&&this.toggleParticipantsList(!t),this.commentsPanelVisible.next(t)},t.prototype.toggleParticipantsList=function(t){t&&this.toggleCommentsPanel(!t),this.icp.participantsListVisible.next(t)},t}();X.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new X},token:X,providedIn:"root"}),X.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}];var K=function(){function t(t){this.toolbarEvents=t,this.linkService=new P.PDFLinkService,this.eventBus=new P.EventBus}return t.prototype.create=function(t){var e=new P.PDFFindController({linkService:this.linkService,eventBus:this.eventBus}),n=new P.PDFViewer({container:t.nativeElement,linkService:this.linkService,findController:e,eventBus:this.eventBus,imageResourcesPath:"/assets/images/",textLayerMode:2});return this.linkService.setViewer(n),this.pdfJsWrapper=new H(n,new P.DownloadManager({}),this.toolbarEvents,new a.Subject,new a.Subject,new a.Subject,new a.Subject,new a.Subject,new a.Subject,new a.Subject),this.pdfJsWrapper},t.prototype.pdfWrapper=function(){return this.pdfJsWrapper},t}();K.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new K(I.ɵɵinject(X))},token:K,providedIn:"root"}),K.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],K.ctorParameters=function(){return[{type:X}]};var Q,tt=function(){function t(){}return t.prototype.printDocumentNatively=function(t){window.open(t).print()},t.prototype.printElementNatively=function(t,e,n){var o=window.open("","","left=0,top=0,width="+e+",height="+n+",toolbar=0,scrollbars=0,status=0");o.document.write(t.innerHTML),o.document.close(),o.focus(),o.print(),o.close()},t}();tt.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new tt},token:tt,providedIn:"root"}),tt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ResponseType=void 0,(Q=t.ResponseType||(t.ResponseType={})).SUCCESS="SUCCESS",Q.FAILURE="FAILURE",Q.UNSUPPORTED="UNSUPPORTED";var et=function(t,e){this.exceptionType=t,this.detail=e},nt=function(){function t(){this.showPrint=!1,this.showDownload=!1,this.showNavigation=!1,this.showZoom=!1,this.showRotate=!1,this.showPresentationMode=!1,this.showRedact=!1,this.showOpenFile=!1,this.showBookmark=!1,this.showHighlightButton=!1,this.showDrawButton=!1,this.showSearchBar=!1,this.showSidebar=!1,this.showCommentSummary=!1,this.showGrabNDragButton=!1,this.showSaveRotationButton=!1}return t.prototype.setup=function(t){for(var e in this.showPrint=!1,this.showDownload=!1,this.showNavigation=!1,this.showZoom=!1,this.showRotate=!1,this.showPresentationMode=!1,this.showRedact=!1,this.showOpenFile=!1,this.showBookmark=!1,this.showHighlightButton=!1,this.showDrawButton=!1,this.showSearchBar=!1,this.showSidebar=!1,this.showCommentSummary=!1,this.showGrabNDragButton=!1,this.showSaveRotationButton=!1,t)this[e]=t[e]},t}();nt.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new nt},token:nt,providedIn:"root"}),nt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}];var ot={showPrint:!0,showDownload:!0,showNavigation:!0,showZoom:!0,showRotate:!0,showSearchBar:!0,showSidebar:!0,showGrabNDragButton:!0,showCommentSummary:!0,showPresentationMode:!0,showRedact:!0},it={showPrint:!0,showDownload:!0,showZoom:!0,showRotate:!0,showGrabNDragButton:!0,showCommentSummary:!0,showRedact:!0},at={showDownload:!0},st={showDownload:!0,showPrint:!0},rt="[Document] Set Document Id",ct="[Document] Position Updated",lt="[Document] Add Pages",ut="[Document] Convert",pt="[Document] Convert Success",dt="[Document] Convert Fail",ht="[Document] Clear Convert Doc Url",mt="[Document] Load Rotation",gt="[Document] Load Rotation Success",bt="[Document] Load Rotation Fail",ft="[Document] Save Rotation",vt="[Document] Save Rotation Success",yt=function(t){this.payload=t,this.type=rt},wt=function(t){this.payload=t,this.type=lt},St=function(t){this.payload=t,this.type=ct},kt=function(t){this.payload=t,this.type=ut},Et=function(t){this.payload=t,this.type=pt},Ct=function(t){this.payload=t,this.type=dt},It=function(){this.type=ht},Ot=function(t){this.payload=t,this.type=mt},Pt=function(t){this.payload=t,this.type=gt},xt=function(t){this.payload=t,this.type=bt},jt=function(t){this.payload=t,this.type=ft},Tt=function(t){this.payload=t,this.type=vt},_t=function(t){this.payload=t,this.type="[Document] Save Rotation Fail"},Dt="[Tags] Add Filter Tags",Rt="[Tags] Clear Filter Tags",Bt=function(t){this.payload=t,this.type=Dt},Nt=function(){this.type=Rt},Mt="[Icp] Set Case Id",At="[Icp] Load Session",Ft="[Icp] Join Socket Session",Lt="[Icp] Socket Session Joined",$t="[Icp] Leave Socket Session",Ht="[Icp] Presenter Updated",Vt="[Icp] Participant List Updated",Ut=function(t){this.payload=t,this.type=Mt},zt=function(t){this.payload=t,this.type=At},Wt=function(t){this.payload=t,this.type="[Icp] Load Session Failure"},qt=function(t){this.payload=t,this.type=Ft},Gt=function(t){this.payload=t,this.type=Lt},Zt=function(){this.type=$t},Jt=function(t){this.payload=t,this.type=Ht},Yt=function(t){this.payload=t,this.type=Vt},Xt={convertedDocument:void 0,documentId:void 0,pdfPosition:void 0,pages:{},hasDifferentPageSize:!1,rotation:void 0,rotationLoaded:!1,loading:!1,loaded:!1};function Kt(t,e){switch(void 0===t&&(t=Xt),e.type){case pt:var n={url:e.payload,error:void 0};return Object.assign(Object.assign({},t),{convertedDocument:n});case dt:n={url:void 0,error:e.payload};return Object.assign(Object.assign({},t),{convertedDocument:n});case ht:n=void 0;return Object.assign(Object.assign({},t),{convertedDocument:n});case mt:return Object.assign(Object.assign({},t),{rotationLoaded:!1});case gt:var o=(i=e.payload)?i.rotationAngle:0;return Object.assign(Object.assign({},t),{rotation:o,rotationLoaded:!0});case bt:return Object.assign(Object.assign({},t),{rotation:0,rotationLoaded:!0});case vt:var i;o=(i=e.payload).rotationAngle;return Object.assign(Object.assign({},t),{rotation:o});case rt:return Object.assign(Object.assign({},t),{documentId:e.payload});case lt:var a,s,r=e.payload,c={},l=t.hasDifferentPageSize;return r.forEach((function(t){var e;l||!a||!s||a===t.div.scrollHeight&&s===t.div.scrollWidth?(a=t.div.scrollHeight,s=t.div.scrollWidth):l=!0;var n={styles:{left:t.div.offsetLeft,height:t.div.scrollHeight,width:t.div.scrollWidth},scaleRotation:{scale:t.scale,rotation:t.rotation},viewportScale:t.viewportScale};c=Object.assign(Object.assign({},c),((e={})[t.id]=n,e))})),Object.assign(Object.assign({},t),{pages:c,hasDifferentPageSize:l});case ct:var u=e.payload;return Object.assign(Object.assign({},t),{pdfPosition:u})}return t}var Qt=function(t){return t.pages},te="[Annotations] Load Annotation Set",ee="[Annotations] Load Annotation Set Success",ne="[Annotations] Load Annotation Set Fail",oe="[Annotations] Save Annotation",ie="[Annotations] Save Annotation Success",ae="[Annotations] Save Annotation Fail",se="[Annotations] Add or Edit Comment",re="[Annotations] Delete Annotation",ce="[Annotations] Delete Annotation Success",le="[Annotations] Delete Annotation Fail",ue="[Annotations] Select Annotation",pe="[Comments] Search Comments",de="[Comments] Apply Comment Summary Filter",he="[Comments] Clear Comment Summary Filter",me=function(t){this.payload=t,this.type=te},ge=function(t){this.payload=t,this.type=ee},be=function(t){this.payload=t,this.type=ne},fe=function(t){this.payload=t,this.type=oe},ve=function(t){this.payload=t,this.type=ie},ye=function(t){this.payload=t,this.type=ae},we=function(t){this.payload=t,this.type=se},Se=function(t){this.payload=t,this.type=re},ke=function(t){this.payload=t,this.type=ce},Ee=function(t){this.payload=t,this.type=le},Ce=function(t){this.payload=t,this.type=ue},Ie=function(t){this.payload=t,this.type=pe},Oe=function(t){this.payload=t,this.type=de},Pe=function(){this.type=he},xe=function(){function t(){}return t.groupByKeyEntities=function(t,e){return t.reduce((function(t,n){var o;return Object.assign(t,((o={})[n[e]]=(t[n[e]]||[]).concat(n),o))}),{})},t.generateCommentsEntities=function(t){return t.reduce((function(t,e){var n;if(e.comments.length){var o=Object.assign(Object.assign({},e.comments[0]||""),{tags:L(e.tags||[])});return Object.assign(Object.assign({},t),((n={})[e.id]=o,n))}return Object.assign({},t)}),{})},t.genTagNameEntities=function(t){var e=this,n=t.filter((function(t){return t.comments.length&&t.tags.length})).map((function(t){return e.groupByKeyEntities(t.tags,"name")})).reduce((function(t,e){return Object.assign(Object.assign({},t),e)}),{});return this.genNameEnt(t,n)},t.genNameEnt=function(t,e){return Object.keys(e).reduce((function(e,n){var o,i=t.filter((function(t){return t.tags.find((function(t){return t.name===n}))})).map((function(t){return t.id})).reduce((function(t,e){var n;return Object.assign(Object.assign({},t),((n={})[e]=e,n))}),{});return Object.assign(Object.assign({},e),((o={})[n]=i,o))}),{})},t.generateAnnotationEntities=function(t){return t.reduce((function(t,e){var n,o=Object.assign(Object.assign({},e),{positionTop:e.rectangles[0].y});return Object.assign(Object.assign({},t),((n={})[e.id]=o,n))}),{})},t.generateRedactionEntities=function(t){return t.reduce((function(t,e){var n;return Object.assign(Object.assign({},t),((n={})[e.redactionId]=e,n))}),{})},t.resetCommentEntSelect=function(t){return Object.keys(t).reduce((function(e,n){return e[n]=Object.assign(Object.assign({},t[n]),{editable:!1,selected:!1}),e}),{})},t.filterCommentsSummary=function(t,e){if(Object.keys(e).length){var n=Object.keys(e.tagFilters).filter((function(t){return!0===e.tagFilters[t]})).length,o=e.dateRangeFrom||e.dateRangeTo,i=t.filter((function(t){var n=!1,i=!1;if(e.hasOwnProperty("tagFilters")&&Object.keys(e.tagFilters).forEach((function(o){if(e.tagFilters[o])return t.tags.forEach((function(t){t.name!==o||n||(n=!0)}))})),o){var a=T.default(t.lastModifiedDate),s=null!==e.dateRangeFrom?T.default(e.dateRangeFrom):void 0,r=null!==e.dateRangeTo?T.default(e.dateRangeTo):void 0;r&&s&&a>s&&a<r&&(i=!0),r&&!s&&a<=r&&(i=!0),s&&!r&&a>s&&(i=!0)}return n||i}));return n||o?i:t}return t},t}(),je={annotationSet:{},annotationEntities:{},commentEntities:{},annotationPageEntities:{},selectedAnnotation:null,commentSearchQueries:{commentSearch:""},commentSummaryFilters:{hasFilter:!1,filters:{}},loading:!1,loaded:!1};function Te(t,e){var n,o,i,a,s;switch(void 0===t&&(t=je),e.type){case te:var r=Object.assign(Object.assign({},t.annotationSet),{documentId:e.payload});return Object.assign(Object.assign({},je),{annotationSet:r,loading:!0});case ee:case ne:r=200===e.payload.status?e.payload.body:Object.assign(Object.assign({},t.annotationSet),{annotations:[],id:j.default()});var c=xe.generateAnnotationEntities(r.annotations),l=xe.groupByKeyEntities(r.annotations,"page"),u=xe.generateCommentsEntities(r.annotations);return Object.assign(Object.assign({},t),{annotationSet:r,annotationEntities:c,annotationPageEntities:l,commentEntities:u,loading:!1,loaded:!0});case ie:var p=e.payload,d=Object.assign(Object.assign({},t.annotationEntities),((n={})[p.id]=p,n)),h=Object.keys(d).map((function(t){return d[t]})),m=(c=xe.generateAnnotationEntities(h),l=xe.groupByKeyEntities(h,"page"),u=xe.generateCommentsEntities(h),Object.assign(Object.assign({},t.selectedAnnotation),{annotationId:p.id,editable:!1}));return Object.assign(Object.assign({},t),{annotationEntities:c,annotationPageEntities:l,commentEntities:u,selectedAnnotation:m,loading:!1,loaded:!0});case ce:var g=e.payload,b=t.annotationEntities[g].page;delete(c=Object.assign({},t.annotationEntities))[g];var f=L(t.annotationPageEntities[b].filter((function(t){return t.id!==g})));l=Object.assign(Object.assign({},t.annotationPageEntities),((o={})[b]=f,o)),u=Object.assign({},t.commentEntities);return t.commentEntities[g]&&delete u[g],Object.assign(Object.assign({},t),{annotationEntities:c,annotationPageEntities:l,commentEntities:u});case se:var v=((i={})[e.payload.annotationId]=e.payload,i),y=Object.assign(Object.assign({},t.commentEntities),v);return Object.assign(Object.assign({},t),{commentEntities:y});case ue:var w=e.payload,S=Object.assign(Object.assign({},t.commentEntities[w.annotationId]),{editable:w.editable,selected:w.selected}),k=xe.resetCommentEntSelect(Object.assign({},t.commentEntities));u=w.annotationId&&t.commentEntities[w.annotationId]?Object.assign(Object.assign({},k),((a={})[w.annotationId]=S,a)):Object.assign({},k);return Object.assign(Object.assign({},t),{commentEntities:u,selectedAnnotation:e.payload});case pe:var E=Object.assign(Object.assign({},t.commentSearchQueries),{commentSearch:e.payload});u=xe.resetCommentEntSelect(Object.assign({},t.commentEntities));return Object.assign(Object.assign({},t),{commentEntities:u,commentSearchQueries:E});case de:var C=e.payload,I={hasFilter:(s=!1,C.tagFilters&&Object.keys(C.tagFilters).map((function(t){C.tagFilters[t]&&!s&&(s=!0)})),s||!!C.dateRangeFrom||!!C.dateRangeTo),filters:C};return Object.assign(Object.assign({},t),{commentSummaryFilters:I});case he:return Object.assign(Object.assign({},t),{commentSummaryFilters:Object.assign({},je.commentSummaryFilters)})}return t}var _e=function(t){return t.annotationSet},De=function(t){return t.commentEntities},Re=function(t){return t.annotationPageEntities},Be=function(t){return t.annotationEntities},Ne=function(t){return t.selectedAnnotation},Me=function(t){return t.commentSearchQueries},Ae=function(t){return t.commentSummaryFilters},Fe={tagNameEnt:{},annotations:[],filteredPageEntities:{},filteredComments:{},formFilterState:{},filters:[]};function Le(t,e){switch(void 0===t&&(t=Fe),e.type){case te:return Object.assign(Object.assign({},t),Fe);case ee:var n=e.payload.body.annotations,o=xe.genTagNameEntities(n);return Object.assign(Object.assign({},t),{tagNameEnt:o,annotations:n});case ie:var i=e.payload,a=L(t.annotations).filter((function(t){return t.id!==i.id}))||[];n=L(a,[i]),o=xe.genTagNameEntities(n);return Object.assign(Object.assign({},t),{annotations:n,tagNameEnt:o});case ce:var s=e.payload,r=(n=L(t.annotations).filter((function(t){return t.id!==s})),o=xe.genTagNameEntities(n),xe.groupByKeyEntities(n,"page"));return delete(u=Object.assign({},t.filteredComments))[s],Object.assign(Object.assign({},t),{annotations:n,tagNameEnt:o,filteredComments:u,filteredPageEntities:r,filters:[]});case Dt:var c=e.payload,l=Object.keys(c).reduce((function(t,e){return c[e]?L(t,[e]):t}),[]),u=l.reduce((function(e,n){return Object.assign(Object.assign({},e),t.tagNameEnt[n])}),{});n=Object.keys(u).map((function(e){return t.annotations.filter((function(t){return t.id===e}))[0]})),r=xe.groupByKeyEntities(n,"page");return Object.assign(Object.assign({},t),{filters:l,filteredComments:u,filteredPageEntities:r});case Rt:return Object.assign(Object.assign({},t),{filters:[],filteredComments:{},filteredPageEntities:{}})}return t}var $e=function(t){return t.filteredComments},He=function(t){return t.filteredPageEntities},Ve="[Bookmarks] Load Bookmarks",Ue="[Bookmarks] Load Bookmarks Success",ze="[Bookmarks] Load Bookmarks Failure",We="[Bookmarks] Create Bookmark",qe="[Bookmarks] Create Bookmark Success",Ge="[Bookmarks] Delete Bookmark",Ze="[Bookmarks] Delete Bookmark Success",Je="[Bookmarks] Move Bookmark",Ye="[Bookmarks] Move Bookmark Success",Xe="[Bookmarks] Update Bookmark",Ke="[Bookmarks] Update Bookmark Success",Qe=function(){this.type=Ve},tn=function(t){this.payload=t,this.type=Ue},en=function(t){this.payload=t,this.type=ze},nn=function(t){this.payload=t,this.type=We},on=function(t){this.payload=t,this.type=qe},an=function(t){this.payload=t,this.type="[Bookmarks] Create Bookmark Failure"},sn=function(t){this.payload=t,this.type=Ge},rn=function(t){this.payload=t,this.type=Ze},cn=function(t){this.payload=t,this.type="[Bookmarks] Delete Bookmark Failure"},ln=function(t){this.payload=t,this.type=Je},un=function(t){this.payload=t,this.type=Ye},pn=function(t){this.payload=t,this.type="[Bookmarks] Move Bookmark Failure"},dn=function(t){this.payload=t,this.type=Xe},hn=function(t){this.payload=t,this.type=Ke},mn=function(t){this.payload=t,this.type="[Bookmarks] Update Bookmark Failure"},gn=function(t){return t?t.reduce((function(t,e){return e.children&&e.children.length>0?L(t,[e.id],gn(e.children)):L(t,[e.id])}),[]):[]},bn=function(t){return t.reduce((function(t,e){var n;return Object.assign(t,((n={})[e.id]=e,n))}),{})},fn=function(t){for(var e=Object.keys(t),n=function(n){var o=[];e.forEach((function(i){t[i].previous&&e.includes(t[i].previous.toString())||(t[i].index=n,o.push(i))})),o.forEach((function(t){return e.splice(e.indexOf(t),1)})),o=[]},o=0;e.length>0;o++)n(o)},vn={bookmarks:[],bookmarkEntities:{},bookmarkPageEntities:{},editableBookmark:void 0,loaded:!1,loading:!1};function yn(t,e){var n,o;switch(void 0===t&&(t=vn),e.type){case Ve:return Object.assign(Object.assign({},t),{loading:!0});case Ue:case ze:var i=200===e.payload.status?e.payload.body:[],a=bn(i),s=xe.groupByKeyEntities(i,"pageNumber");return Object.assign(Object.assign({},t),{bookmarks:i,bookmarkEntities:a,bookmarkPageEntities:s,loaded:!0});case qe:var r=e.payload,c=Object.assign(Object.assign({},t.bookmarkEntities),((n={})[r.id]=r,n)),l=Object.keys(c).map((function(t){return c[t]})),u=(s=xe.groupByKeyEntities(l,"pageNumber"),r.id);return Object.assign(Object.assign({},t),{bookmarkEntities:c,editableBookmark:u,bookmarkPageEntities:s,loading:!1,loaded:!0});case Ye:var p=bn(e.payload);a=Object.assign(Object.assign({},t.bookmarkEntities),p);return Object.assign(Object.assign({},t),{bookmarkEntities:a,loading:!1,loaded:!0});case Ze:var d=e.payload,h=Object.assign({},t.bookmarkEntities),m=Object.assign({},t.bookmarkPageEntities),g={};return d.forEach((function(t){void 0!==g[h[t].pageNumber]&&g[h[t].pageNumber].length>0?g[h[t].pageNumber].push(t):g[h[t].pageNumber]=[t],delete h[t]})),Object.entries(g).forEach((function(t){var e=F(t,2),n=e[0],o=e[1];m[n]=m[n].filter((function(t){return o.includes(t)}))})),Object.assign(Object.assign({},t),{bookmarkEntities:h,bookmarkPageEntities:m,loading:!1,loaded:!0});case Ke:r=e.payload;var b=Object.assign(Object.assign({},t.bookmarkEntities),((o={})[r.id]=Object.assign({},r),o));l=Object.keys(b).map((function(t){return b[t]})),s=xe.groupByKeyEntities(l,"pageNumber"),u=void 0;return Object.assign(Object.assign({},t),{bookmarkEntities:b,editableBookmark:u,bookmarkPageEntities:s,loading:!1,loaded:!0})}return t}var wn="[Redaction] Load Redaction",Sn="[Redaction] Load Redaction Success",kn="[Redaction] Save Redaction",En="[Redaction] Save Redaction Success",Cn="[Redaction] Delete Redaction",In="[Redaction] Delete Redaction Success",On="[Redaction] Select Redaction",Pn="[Redaction] Redact",xn="[Redaction] Redact Success",jn="[Redaction] Reset Redacted Document",Tn="[Redaction] Unmark All",_n="[Redaction] Unmark All Success",Dn=function(t){this.payload=t,this.type=wn},Rn=function(t){this.payload=t,this.type=Sn},Bn=function(t){this.payload=t,this.type="[Redaction] Load Redaction Fail"},Nn=function(t){this.payload=t,this.type=kn},Mn=function(t){this.payload=t,this.type=En},An=function(t){this.payload=t,this.type="[Redaction] Save Redaction Fail"},Fn=function(t){this.payload=t,this.type=Cn},Ln=function(t){this.payload=t,this.type=In},$n=function(t){this.payload=t,this.type="[Redaction] Delete Redaction Fail"},Hn=function(t){this.payload=t,this.type=On},Vn=function(t){this.payload=t,this.type=Pn},Un=function(t){this.payload=t,this.type=xn},zn=function(t){this.payload=t,this.type="[Redaction] Redact Fail"},Wn=function(){this.type=jn},qn=function(t){this.payload=t,this.type=Tn},Gn=function(){this.type=_n},Zn={redactionEntities:{},redactionPageEntities:{},selectedRedaction:{},redactedDocumentInfo:void 0,documentId:void 0};function Jn(t,e){var n,o;switch(void 0===t&&(t=Zn),e.type){case wn:return Object.assign(Object.assign({},t),Zn);case Sn:if(s=e.payload){var i=xe.generateRedactionEntities(s),a=xe.groupByKeyEntities(s,"page");return Object.assign(Object.assign({},t),{redactionEntities:i,redactionPageEntities:a})}return Object.assign({},t);case En:var s=e.payload,r=Object.assign(Object.assign({},t.redactionEntities),((n={})[s.redactionId]=s,n)),c=Object.keys(r).map((function(t){return r[t]}));a=xe.groupByKeyEntities(c,"page");return Object.assign(Object.assign({},t),{redactionEntities:r,redactionPageEntities:a});case On:case ue:return Object.assign(Object.assign({},t),{selectedRedaction:e.payload});case In:var l=e.payload.page,u=e.payload.redactionId;delete(i=Object.assign({},t.redactionEntities))[u];var p=L(t.redactionPageEntities[l].filter((function(t){return t.redactionId!==u})));a=Object.assign(Object.assign({},t.redactionPageEntities),((o={})[l]=p,o));return Object.assign(Object.assign({},t),{redactionPageEntities:a,redactionEntities:i});case xn:var d=e.payload;return Object.assign(Object.assign(Object.assign({},t),Zn),{redactedDocumentInfo:d});case jn:return Object.assign(Object.assign({},t),{redactedDocumentInfo:void 0});case _n:return Object.assign(Object.assign({},t),Zn)}return t}var Yn={session:null,presenter:null,client:null,participants:[]};function Xn(t,e){switch(void 0===t&&(t=Yn),e.type){case Mt:var n=e.payload,o=Object.assign(Object.assign({},t.session),{caseId:n});return Object.assign(Object.assign({},t),{session:o});case Lt:o=e.payload.session;var i=e.payload.participantInfo;return Object.assign(Object.assign({},t),{session:o,client:i.client,presenter:i.presenter});case Vt:var a=e.payload,s=Object.keys(a).map((function(t){return{id:t,username:a[t]}}));return Object.assign(Object.assign({},t),{participants:s});case Ht:var r=e.payload;return Object.assign(Object.assign({},t),{presenter:r});case $t:return Object.assign(Object.assign({},t),Yn)}return t}var Kn,Qn={document:Kt,annotations:Te,tags:Le,bookmarks:yn,redactions:Jn,icp:Xn},to=r.createFeatureSelector("media-viewer"),eo=r.createSelector(to,(function(t){return t.document})),no=r.createSelector(eo,Qt),oo=(r.createSelector(no,(function(t){return Object.values(t)})),r.createSelector(eo,(function(t){return t.documentId}))),io=r.createSelector(eo,(function(t){return t.pdfPosition})),ao=r.createSelector(eo,(function(t){return t.hasDifferentPageSize})),so=r.createSelector(eo,(function(t){return t.convertedDocument})),ro=r.createSelector(eo,(function(t){return t.rotation})),co=r.createSelector(eo,(function(t){return t.rotationLoaded})),lo=function(){function t(){this.textHighlight=new a.Subject,this.boxHighlight=new a.Subject,this.ctxToolbarCleared=new a.Subject,this.navigationEvent=new a.Subject}return t.prototype.textSelected=function(t){this.textHighlight.next(t)},t.prototype.boxSelected=function(t){this.boxHighlight.next(t)},t.prototype.clearCtxToolbar=function(){this.ctxToolbarCleared.next()},t.prototype.goToDestination=function(t){this.navigationEvent.next(t)},t}();lo.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new lo},token:lo,providedIn:"root"}),lo.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],lo.ctorParameters=function(){return[]},function(t){t.SESSION_JOINED="IcpClientJoinedSession",t.CLIENT_DISCONNECTED="IcpClientDisconnectedFromSession",t.NEW_PARTICIPANT_JOINED="IcpNewParticipantJoinedSession",t.REMOVE_PARTICIPANT="IcpRemoveParticipantFromList",t.PARTICIPANTS_UPDATED="IcpParticipantsListUpdated",t.UPDATE_PRESENTER="IcpNewPresenterStartsPresenting",t.PRESENTER_UPDATED="IcpPresenterUpdated",t.UPDATE_SCREEN="IcpUpdateScreen",t.SCREEN_UPDATED="IcpScreenUpdated",t.SESSION_JOIN="IcpClientJoinSession",t.SESSION_LEAVE="IcpClientLeaveSession"}(Kn||(Kn={}));var uo=function(){function t(){this.connected$=new a.BehaviorSubject(!1),this.sessionJoined$=new a.Subject,this.presenterUpdated$=new a.Subject,this.clientDisconnected$=new a.Subject,this.participantUpdated$=new a.Subject,this.newParticipantJoined$=new a.Subject,this.screenUpdated$=new a.Subject}return t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.connect=function(t){var e=this;return this.getSocketClient(t).subscribe((function(t){t.onopen=function(t){e.connected$.next(!0)},t.onmessage=function(t){console.log("onmessage");var n=JSON.parse(t.data);n.data&&n.data.eventName&&e.messageEventHandller(n.data.eventName,n.data.data)},t.onerror=function(t){console.log("onerror")},t.onclose=function(t){console.log("onclose")}}))},t.prototype.connected=function(){return this.connected$.asObservable()},t.prototype.join=function(t){this.emit(Kn.SESSION_JOIN,t)},t.prototype.leave=function(t){this.emit(Kn.SESSION_LEAVE,t),this.subscription.unsubscribe()},t.prototype.emit=function(t,e){this.socket.send(JSON.stringify({type:"event",event:t,data:e}))},t.prototype.listen=function(t){switch(t){case Kn.SESSION_JOINED:return this.sessionJoined$.asObservable();case Kn.PRESENTER_UPDATED:return this.presenterUpdated$.asObservable();case Kn.CLIENT_DISCONNECTED:return this.clientDisconnected$.asObservable();case Kn.PARTICIPANTS_UPDATED:return this.participantUpdated$.asObservable();case Kn.NEW_PARTICIPANT_JOINED:return this.newParticipantJoined$.asObservable();case Kn.SCREEN_UPDATED:return this.screenUpdated$.asObservable()}},t.prototype.messageEventHandller=function(t,e){switch(t){case Kn.SESSION_JOINED:this.sessionJoined$.next(e);break;case Kn.PRESENTER_UPDATED:this.presenterUpdated$.next(e);break;case Kn.CLIENT_DISCONNECTED:this.clientDisconnected$.next();break;case Kn.PARTICIPANTS_UPDATED:this.participantUpdated$.next(e);break;case Kn.NEW_PARTICIPANT_JOINED:this.newParticipantJoined$.next();break;case Kn.SCREEN_UPDATED:this.screenUpdated$.next(e)}},t.prototype.getSocketClient=function(t){return this.socket=new WebSocket(t,"json.webpubsub.azure.v1"),a.of(this.socket)},t}();uo.decorators=[{type:e.Injectable}],uo.ctorParameters=function(){return[]};var po=function(){function t(t){this.socket=t}return t.prototype.joinSession=function(t,e){var n=this;return this.session=e,this.socket.connect(e.connectionUrl),this.socket.connected().subscribe((function(e){e&&n.socket.join(Object.assign(Object.assign({},n.session),{username:t}))})),this.socket.listen(Kn.SESSION_JOINED)},t.prototype.leaveSession=function(){this.socket.leave(this.session)},t.prototype.newParticipantJoined=function(){return this.socket.listen(Kn.NEW_PARTICIPANT_JOINED)},t.prototype.clientDisconnected=function(){return this.socket.listen(Kn.CLIENT_DISCONNECTED)},t.prototype.removeParticipant=function(t){this.socket.emit(Kn.REMOVE_PARTICIPANT,{participantId:t,caseId:this.session.caseId})},t.prototype.participantListUpdated=function(){return this.socket.listen(Kn.PARTICIPANTS_UPDATED)},t.prototype.updatePresenter=function(t){this.socket.emit(Kn.UPDATE_PRESENTER,Object.assign(Object.assign({},this.session),{presenterId:t.id,presenterName:t.username}))},t.prototype.presenterUpdated=function(){return this.socket.listen(Kn.PRESENTER_UPDATED)},t.prototype.updateScreen=function(t){var e={body:t,caseId:this.session.caseId};this.socket.emit(Kn.UPDATE_SCREEN,e)},t.prototype.screenUpdated=function(){return this.socket.listen(Kn.SCREEN_UPDATED)},t}();po.decorators=[{type:e.Injectable}],po.ctorParameters=function(){return[{type:uo}]};var ho=r.createSelector(to,(function(t){return t.icp})),mo=r.createSelector(ho,(function(t){return t.session})),go=r.createSelector(mo,(function(t){return null===t?null:t.caseId})),bo=r.createSelector(ho,(function(t){return t.presenter})),fo=r.createSelector(bo,(function(t){return null===t?null:t.username})),vo=r.createSelector(ho,(function(t){return t.client})),yo=r.createSelector(bo,vo,(function(t,e){return null===t?void 0:t.id===e.id})),wo=r.createSelector(ho,(function(t){return t.participants})),So=function(){function t(t,e,n){this.toolbarEvents=t,this.socketService=e,this.store=n}return t.prototype.update=function(t){t?this.subscribe():this.unsubscribe()},t.prototype.subscribe=function(){var t=this;this.$subscription||(this.$subscription=this.store.pipe(r.select(io)).subscribe((function(e){t.pdfPosition=e,t.onPositionUpdate(e)})),this.$subscription.add(this.store.pipe(r.select(bo)).subscribe((function(e){t.presenter=e}))),this.$subscription.add(this.socketService.newParticipantJoined().subscribe((function(){return t.onNewParticipantJoined()}))))},t.prototype.unsubscribe=function(){this.$subscription&&(this.$subscription.unsubscribe(),this.$subscription=void 0)},t.prototype.onPositionUpdate=function(t){var e={pdfPosition:t,document:void 0};this.socketService.updateScreen(e)},t.prototype.onNewParticipantJoined=function(){this.onPositionUpdate(this.pdfPosition),this.socketService.updatePresenter(this.presenter)},t}();So.decorators=[{type:e.Injectable}],So.ctorParameters=function(){return[{type:X},{type:po},{type:r.Store}]};var ko=function(){function t(t,e,n,o){this.toolbarEvents=t,this.viewerEvents=e,this.socketService=n,this.store=o}return t.prototype.update=function(t){t?this.subscribe():this.unsubscribe()},t.prototype.subscribe=function(){var t=this;this.$subscription||(this.$subscription=this.socketService.screenUpdated().subscribe((function(e){return t.followScreenUpdate(e)})))},t.prototype.unsubscribe=function(){this.$subscription&&(this.$subscription.unsubscribe(),this.$subscription=void 0)},t.prototype.followScreenUpdate=function(t){var e=this,n=t.pdfPosition;n&&this.viewerEvents.goToDestination([n.pageNumber-1,{name:"XYZ"},n.left,n.top]),this.store.pipe(r.select(io),s.take(1)).subscribe((function(t){var o=(n.rotation-t.rotation)%360;0!==o&&e.toolbarEvents.rotate(o)}))},t}();ko.decorators=[{type:e.Injectable}],ko.ctorParameters=function(){return[{type:X},{type:lo},{type:po},{type:r.Store}]};var Eo=function(){function t(t,e,n,o,i,a){var c=this;this.toolbarEvents=t,this.viewerEvents=e,this.socketService=n,this.presenterSubscriptions=o,this.followerSubscriptions=i,this.store=a,this.subscription=this.store.pipe(r.select(go),s.filter((function(t){return!!t}))).subscribe((function(t){c.caseId=t})),this.subscription.add(this.toolbarEvents.icp.sessionLaunch.subscribe((function(){c.caseId&&c.launchSession()})))}return t.prototype.ngOnDestroy=function(){this.unsubscribeSession(),this.subscription.unsubscribe()},t.prototype.launchSession=function(){var t=this;this.store.dispatch(new zt(this.caseId)),this.subscription.add(this.store.pipe(r.select(mo),s.filter((function(t){return!!t&&Object.keys(t).length>1})),s.take(1)).subscribe((function(){t.setUpSessionSubscriptions()})))},t.prototype.setUpSessionSubscriptions=function(){var t=this;this.sessionSubscription=this.toolbarEvents.icp.becomingPresenter.subscribe((function(){return t.becomePresenter()})),this.sessionSubscription.add(this.toolbarEvents.icp.stoppingPresenting.subscribe((function(){return t.stopPresenting()}))),this.sessionSubscription.add(this.toolbarEvents.icp.sessionExitConfirmed.subscribe((function(){return t.leavePresentation()}))),this.sessionSubscription.add(this.store.pipe(r.select(bo)).subscribe((function(e){return t.presenter=e}))),this.sessionSubscription.add(this.store.pipe(r.select(vo)).subscribe((function(e){return t.client=e}))),this.sessionSubscription.add(this.store.pipe(r.select(yo)).subscribe((function(e){t.isPresenter=e,t.presenterSubscriptions.update(e),t.followerSubscriptions.update(!e)}))),this.sessionSubscription.add(this.socketService.clientDisconnected().subscribe((function(e){return t.clientDisconnected(e)}))),this.sessionSubscription.add(this.socketService.presenterUpdated().subscribe((function(e){t.store.dispatch(new Jt(e))}))),this.sessionSubscription.add(this.socketService.participantListUpdated().subscribe((function(e){t.store.dispatch(new Yt(e))})))},t.prototype.unsubscribeSession=function(){this.presenterSubscriptions.update(!1),this.followerSubscriptions.update(!1),this.sessionSubscription.unsubscribe()},t.prototype.leavePresentation=function(){this.isPresenter&&this.stopPresenting(),this.removeParticipant(this.client.id),this.socketService.leaveSession(),this.store.dispatch(new Zt),this.unsubscribeSession()},t.prototype.stopPresenting=function(){this.socketService.updatePresenter({username:"",id:""})},t.prototype.becomePresenter=function(){this.socketService.updatePresenter(this.client)},t.prototype.clientDisconnected=function(t){t===this.presenter.id&&this.stopPresenting(),this.removeParticipant(t)},t.prototype.removeParticipant=function(t){this.socketService.removeParticipant(t)},t}();Eo.decorators=[{type:e.Injectable}],Eo.ctorParameters=function(){return[{type:X},{type:lo},{type:po},{type:So},{type:ko},{type:r.Store}]};var Co=function(){function n(t,n,o,i,a,r,c,l){var u=this;this.store=t,this.icpStore=n,this.pdfJsWrapperFactory=o,this.printService=i,this.toolbarEvents=a,this.viewerEvents=r,this.icpService=c,this.toolbarButtons=l,this.mediaLoadStatus=new e.EventEmitter,this.pdfViewerException=new e.EventEmitter,this.documentTitle=new e.EventEmitter,this.pageHeights=[],this.rotation=0,this.zoom=1,this.loadingDocument=!1,this.hasDifferentPageSize=!1,this.enableGrabNDrag=!1,this.highlightMode=a.highlightModeSubject.pipe(s.tap((function(){u.store.dispatch(new Nt)}))),this.drawMode=a.drawModeSubject}return n.prototype.ngAfterContentInit=function(){return N(this,void 0,void 0,(function(){var t=this;return M(this,(function(e){return this.pdfWrapper.documentLoadProgress.subscribe((function(e){return t.onDocumentLoadProgress(e)})),this.pdfWrapper.documentLoaded.subscribe((function(){return t.onDocumentLoaded()})),this.pdfWrapper.documentLoadFailed.subscribe((function(e){return t.onDocumentLoadFailed(e)})),this.pdfWrapper.outlineLoaded.subscribe((function(e){return t.documentOutline=e})),this.pdfWrapper.pageRendered.subscribe((function(e){return t.updatePages(e)})),this.$subscription=this.toolbarEvents.printSubject.subscribe((function(){return t.printService.printDocumentNatively(t.url)})),this.$subscription.add(this.toolbarEvents.downloadSubject.subscribe((function(){return t.pdfWrapper.downloadFile(t.downloadUrl||t.url,t.downloadFileName)}))),this.$subscription.add(this.toolbarEvents.rotateSubject.subscribe((function(e){return t.rotateDocument(e)}))),this.$subscription.add(this.toolbarEvents.zoomSubject.subscribe((function(e){return t.setZoom(e)}))),this.$subscription.add(this.toolbarEvents.stepZoomSubject.subscribe((function(e){return t.stepZoom(e)}))),this.$subscription.add(this.toolbarEvents.searchSubject.subscribe((function(e){return t.pdfWrapper.search(e)}))),this.$subscription.add(this.toolbarEvents.setCurrentPageSubject.subscribe((function(e){return t.pdfWrapper.setPageNumber(e)}))),this.$subscription.add(this.toolbarEvents.changePageByDeltaSubject.subscribe((function(e){return t.pdfWrapper.changePageNumber(e)}))),this.$subscription.add(this.toolbarEvents.grabNDrag.subscribe((function(e){return t.enableGrabNDrag=e}))),this.$subscription.add(this.toolbarEvents.commentsPanelVisible.subscribe((function(e){t.showCommentsPanel=e}))),this.$subscription.add(this.viewerEvents.navigationEvent.subscribe((function(e){return t.goToDestination(e)}))),this.$subscription.add(this.toolbarEvents.icp.participantsListVisible.subscribe((function(e){return t.showIcpParticipantsList=e}))),this.$subscription.add(this.pdfWrapper.positionUpdated.asObservable().pipe(s.throttleTime(500,a.asyncScheduler,{leading:!0,trailing:!0})).subscribe((function(e){return t.store.dispatch(new St(e.location))}))),[2]}))}))},n.prototype.ngOnChanges=function(t){return N(this,void 0,void 0,(function(){var e=this;return M(this,(function(n){switch(n.label){case 0:return this.pdfWrapper||(this.pdfWrapper=this.pdfJsWrapperFactory.create(this.viewerContainer)),t.url&&this.pdfWrapper?[4,this.loadDocument()]:[3,2];case 1:n.sent(),this.enableRedactions&&this.toolbarEvents.redactionMode.pipe(s.filter((function(t){return!!t}))).subscribe((function(){return e.resetRotation()})),n.label=2;case 2:return t.caseId&&this.icpStore.dispatch(new Ut(this.caseId)),[2]}}))}))},n.prototype.resetRotation=function(){this.hasDifferentPageSize&&(this.pdfWrapper.resetRotation(0),this.rotation=0)},n.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},n.prototype.loadDocument=function(){return N(this,void 0,void 0,(function(){var t=this;return M(this,(function(e){switch(e.label){case 0:return this.initDocumentProgress(),[4,this.pdfWrapper.loadDocument(this.url)];case 1:return e.sent(),this.documentTitle.emit(this.pdfWrapper.getCurrentPDFTitle()),this.setPageHeights(),this.$subscription.add(this.store.pipe(r.select(ao)).subscribe((function(e){return t.hasDifferentPageSize=e}))),[2]}}))}))},n.prototype.onDocumentLoadProgress=function(t){t.total&&(this.loadingDocumentProgress=Math.min(100,Math.ceil(t.loaded/t.total*100)))},n.prototype.onDocumentLoaded=function(){this.loadingDocument=!1,this.mediaLoadStatus.emit(t.ResponseType.SUCCESS)},n.prototype.onDocumentLoadFailed=function(e){this.loadingDocument=!1,this.viewerException=new et(e.name,{message:e.message}),this.errorMessage='Could not load the document "'+this.url+'"',this.mediaLoadStatus.emit(t.ResponseType.FAILURE),this.pdfViewerException.emit(this.viewerException)},n.prototype.updatePages=function(t){this.enableAnnotations&&this.store.dispatch(new wt(t))},Object.defineProperty(n.prototype,"searchBarHidden",{set:function(t){this.pdfWrapper&&t&&this.pdfWrapper.clearSearch()},enumerable:!1,configurable:!0}),n.prototype.toggleCommentsSummary=function(){this.toolbarEvents.toggleCommentsSummary(!this.toolbarEvents.showCommentSummary.getValue())},n.prototype.rotateDocument=function(t){var e=this.pdfWrapper.getPageNumber();this.pdfWrapper.rotate(t),this.pdfWrapper.setPageNumber(e),this.rotation=(this.rotation+t)%360,this.setPageHeights()},n.prototype.initDocumentProgress=function(){this.loadingDocument=!0,this.loadingDocumentProgress=null,this.errorMessage=null},n.prototype.setZoom=function(t){isNaN(t)||(this.pdfWrapper.setZoom(t),this.zoom=this.calculateZoomValue(t),this.setPageHeights())},n.prototype.stepZoom=function(t){isNaN(t)||(this.pdfWrapper.stepZoom(t),this.zoom=this.calculateZoomValue(this.zoom,t),this.setPageHeights())},n.prototype.setPageHeights=function(){this.pageHeights=[];for(var t=this.pdfViewer.nativeElement.children,e=0;e<t.length;e++)this.pageHeights.push(t[e].clientHeight)},n.prototype.calculateZoomValue=function(t,e){void 0===e&&(e=0);var n=t+e;return n>5?5:n<.1?.1:+n.toFixed(2)},n.prototype.goToDestination=function(t){this.pdfWrapper.navigateTo(t)},n.prototype.getCurrentPageNumber=function(){return this.pdfWrapper.getPageNumber()},n}();Co.decorators=[{type:e.Component,args:[{selector:"mv-pdf-viewer",template:'<mv-side-bar *ngIf="toolbarEvents.sidebarOpen"\n id="sidebarContainer"\n [url]="url"\n [zoom]="zoom"\n [rotate]="rotation"\n [outline]="documentOutline"\n [annotationsEnabled]="enableAnnotations"\n [currentPageNumber]="getCurrentPageNumber()">\n</mv-side-bar>\n<mv-comment-set-header\n *ngIf="enableAnnotations"\n [ngClass]="{\'show-comments-panel\': showCommentsPanel}"\n [showCommentSummary]="toolbarButtons.showCommentSummary"\n (showCommentSummaryDialog)="toggleCommentsSummary()">\n</mv-comment-set-header>\n<mv-participants-list></mv-participants-list>\n<div\n class="pdfContainer"\n [ngStyle]="{ height: height }"\n [ngClass]="{ \'pdfContainer\': true, hidden: errorMessage }">\n <div\n #viewerContainer\n mvGrabNDrag\n [dragX]="viewerContainer"\n [dragEnabled]="enableGrabNDrag"\n id="viewerContainer"\n class="viewer-container"\n [class.annotations]="enableAnnotations"\n [class.show-comments-panel]="(showCommentsPanel || showIcpParticipantsList) && !(toolbarEvents.redactionMode | async)"\n [class.grabNDrag]="enableGrabNDrag">\n <div #pdfViewer\n class="pdfViewer"\n mvCreateTextHighlight\n [ngClass]="{ hidden: loadingDocument, highlightMode: highlightMode | async, drawMode: drawMode | async }">\n </div>\n <mv-redactions *ngIf="(toolbarEvents.redactionMode | async); else annotationTemplate"\n [zoom]="zoom"\n [rotate]="rotation"\n ></mv-redactions>\n <ng-template #annotationTemplate>\n <mv-metadata-layer\n *ngIf="enableAnnotations && annotationSet"\n [zoom]="zoom"\n [rotate]="rotation">\n </mv-metadata-layer>\n <mv-bookmark-icons [zoom]="zoom"\n [rotate]="rotation">\n </mv-bookmark-icons>\n </ng-template>\n </div>\n <mv-comment-set [contentScrollTop]="viewerContainer.scrollTop"\n *ngIf="enableAnnotations && annotationSet && !(toolbarEvents.redactionMode | async)"\n [annotationSet]="annotationSet"\n [zoom]="zoom"\n [rotate]="rotation"\n [height]="pdfViewer.offsetHeight"\n [pageHeights]="pageHeights">\n </mv-comment-set>\n <div class="loadingMessage" *ngIf="loadingDocument">\n <h3 class="govuk-heading-m">Loading...{{ loadingDocumentProgress ? loadingDocumentProgress + \'%\' : \'\' }}</h3>\n </div>\n</div>\n',encapsulation:e.ViewEncapsulation.None}]}],Co.ctorParameters=function(){return[{type:r.Store},{type:r.Store},{type:K},{type:tt},{type:X},{type:lo},{type:Eo},{type:nt}]},Co.propDecorators={mediaLoadStatus:[{type:e.Output}],pdfViewerException:[{type:e.Output}],documentTitle:[{type:e.Output}],downloadUrl:[{type:e.Input}],url:[{type:e.Input}],downloadFileName:[{type:e.Input}],enableAnnotations:[{type:e.Input}],enableRedactions:[{type:e.Input}],enableICP:[{type:e.Input}],annotationSet:[{type:e.Input}],height:[{type:e.Input}],caseId:[{type:e.Input}],viewerContainer:[{type:e.ViewChild,args:["viewerContainer",{static:!0}]}],pdfViewer:[{type:e.ViewChild,args:["pdfViewer",{static:!1}]}],searchBarHidden:[{type:e.Input}]};var Io=function(){function t(t){this.http=t}return t.prototype.validateFile=function(t){return this.http.head(t)},t}();Io.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new Io(I.ɵɵinject(O.HttpClient))},token:Io,providedIn:"root"}),Io.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Io.ctorParameters=function(){return[{type:i.HttpClient}]};var Oo=function(){function n(t,n,o,i,a,s){this.store=t,this.printService=n,this.viewerUtilService=o,this.toolbarEvents=i,this.toolbarButtons=a,this.viewerEvents=s,this.mediaLoadStatus=new e.EventEmitter,this.imageViewerException=new e.EventEmitter,this.rotation=0,this.zoom=1,this.subscriptions=[],this.enableGrabNDrag=!1}return n.prototype.ngOnInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.rotateSubject.subscribe((function(e){return t.rotateImage(e)})),this.toolbarEvents.zoomSubject.subscribe((function(e){return t.setZoom(e)})),this.toolbarEvents.stepZoomSubject.subscribe((function(e){return t.stepZoom(e)})),this.toolbarEvents.printSubject.subscribe((function(){return t.printService.printDocumentNatively(t.url)})),this.toolbarEvents.downloadSubject.subscribe((function(){return t.download()})),this.toolbarEvents.grabNDrag.subscribe((function(e){return t.enableGrabNDrag=e})),this.toolbarEvents.commentsPanelVisible.subscribe((function(e){return t.showCommentsPanel=e})))},n.prototype.onImageViewerClick=function(t){t.target.className.startsWith("pageContainer")&&(this.store.dispatch(new Ce({annotationId:"",selected:!1,editable:!1})),this.viewerEvents.clearCtxToolbar())},n.prototype.ngOnDestroy=function(){this.subscriptions.filter((function(t){return!t.closed})).forEach((function(t){return t.unsubscribe()})),this.response&&this.response.unsubscribe()},n.prototype.ngOnChanges=function(t){t.url&&(this.errorMessage=null,this.toolbarEvents.reset())},n.prototype.rotateImage=function(t){this.rotation=(this.rotation+t)%360,this.initAnnoPage(this.img.nativeElement)},n.prototype.setZoom=function(t){return N(this,void 0,void 0,(function(){return M(this,(function(e){switch(e.label){case 0:return isNaN(t)?[3,2]:[4,this.setZoomValue(this.calculateZoomValue(t))];case 1:e.sent(),this.img.nativeElement.width=this.img.nativeElement.naturalWidth*this.zoom,this.initAnnoPage(this.img.nativeElement),e.label=2;case 2:return[2]}}))}))},n.prototype.stepZoom=function(t){return N(this,void 0,void 0,(function(){return M(this,(function(e){switch(e.label){case 0:return isNaN(t)?[3,2]:[4,this.setZoomValue(this.calculateZoomValue(this.zoom,t))];case 1:e.sent(),this.img.nativeElement.width=this.img.nativeElement.naturalWidth*this.zoom,this.initAnnoPage(this.img.nativeElement),e.label=2;case 2:return[2]}}))}))},n.prototype.download=function(){var t=document.createElement("a");document.body.appendChild(t),t.setAttribute("style","display: none"),t.href=this.url,t.download=this.downloadFileName,t.click(),t.remove()},n.prototype.setZoomValue=function(t){var e=this;return new Promise((function(n){e.zoom=t,e.toolbarEvents.zoomValueSubject.next(t),n(!0)}))},n.prototype.calculateZoomValue=function(t,e){void 0===e&&(e=0);var n=t+e;return n>5?5:n<.1?.1:+n.toFixed(2)},n.prototype.onLoadError=function(e){var n=this;this.response=this.viewerUtilService.validateFile(e).subscribe((function(t){return t}),(function(t){n.viewerException=new et(t.name,{httpResponseCode:t.status,message:t.message})})),this.errorMessage='Could not load the image "'+this.url+'"',this.mediaLoadStatus.emit(t.ResponseType.FAILURE),this.imageViewerException.emit(this.viewerException)},n.prototype.onLoad=function(e){this.mediaLoadStatus.emit(t.ResponseType.SUCCESS),this.initAnnoPage(e)},n.prototype.initAnnoPage=function(t){this.imageHeight=this.rotation%180!=0?t.offsetWidth:t.offsetHeight,this.imageWidth=this.rotation%180!=0?t.offsetHeight:t.offsetWidth,this.imageLeft=this.rotation%180!=0?t.offsetTop:t.offsetLeft,this.imageTop=this.rotation%180!=0?t.offsetLeft:t.offsetTop;var e=[{div:{scrollHeight:this.imageHeight,scrollWidth:this.imageWidth,offsetLeft:this.imageLeft},pageNumber:1,scale:this.zoom,rotation:this.rotation,id:1}];this.store.dispatch(new wt(e))},n.prototype.toggleCommentsSummary=function(){this.toolbarEvents.toggleCommentsSummary(!this.toolbarEvents.showCommentSummary.getValue())},n}();Oo.decorators=[{type:e.Component,args:[{selector:"mv-image-viewer",template:'<mv-comment-set-header [ngClass]="{\'show-comments-panel\': showCommentsPanel}"\n [showCommentSummary]="toolbarButtons.showCommentSummary"\n (showCommentSummaryDialog)="toggleCommentsSummary()">\n</mv-comment-set-header>\n<div mvGrabNDrag [dragX]="imageContainer" [dragEnabled]="enableGrabNDrag"\n id="viewer-wrapper"\n [ngStyle]="{ height: height }"\n [ngClass]="{ \'grabNDrag\': enableGrabNDrag }"\n *ngIf="url && !errorMessage">\n <div #imageContainer id="image-container"\n [ngClass]="{ \'image-container\': true, \'annotations\': enableAnnotations, \'show-comments-panel\': showCommentsPanel }"\n [style.height.px]="imageHeight">\n <img #img\n [src]="url"\n [ngClass]="\'rot\' + rotation"\n (error)="onLoadError(url)"\n (load)="onLoad(img)"/>\n <mv-redactions *ngIf="(toolbarEvents.redactionMode | async);else annotationTemplate"\n [zoom]="zoom"\n [rotate]="rotation"\n ></mv-redactions>\n <ng-template #annotationTemplate>\n <mv-metadata-layer *ngIf="enableAnnotations && annotationSet"\n [zoom]="zoom"\n [rotate]="rotation">\n </mv-metadata-layer>\n </ng-template>\n </div>\n\n <div class="comments" [style.height.px]="imageHeight">\n <mv-comment-set *ngIf="enableAnnotations && annotationSet && !(toolbarEvents.redactionMode | async)"\n [annotationSet]="annotationSet"\n [zoom]="zoom"\n [rotate]="rotation"\n [height]="imageHeight">\n </mv-comment-set>\n </div>\n</div>\n'}]}],Oo.ctorParameters=function(){return[{type:r.Store},{type:tt},{type:Io},{type:X},{type:nt},{type:lo}]},Oo.propDecorators={url:[{type:e.Input}],downloadFileName:[{type:e.Input}],enableAnnotations:[{type:e.Input}],annotationSet:[{type:e.Input}],height:[{type:e.Input}],mediaLoadStatus:[{type:e.Output}],imageViewerException:[{type:e.Output}],img:[{type:e.ViewChild,args:["img",{static:!1}]}],onImageViewerClick:[{type:e.HostListener,args:["mousedown",["$event"]]}]};var Po=function(){function n(t,n){this.toolbarEvents=t,this.viewerUtilService=n,this.loadStatus=new e.EventEmitter,this.unsupportedViewerException=new e.EventEmitter,this.subscriptions=[]}return n.prototype.ngOnInit=function(){var e=this;this.subscriptions.push(this.toolbarEvents.downloadSubject.subscribe((function(){return e.downloadLink.nativeElement.click()})),this.viewerUtilService.validateFile(this.url).subscribe((function(t){return t}),(function(t){e.viewerException=new et(t.name,{httpResponseCode:t.status,message:t.message})}))),this.loadStatus.emit(t.ResponseType.UNSUPPORTED),this.typeException||this.unsupportedViewerException.emit(this.viewerException)},n.prototype.ngOnDestroy=function(){var t,e;try{for(var n=A(this.subscriptions),o=n.next();!o.done;o=n.next()){o.value.unsubscribe()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},n}();Po.decorators=[{type:e.Component,args:[{selector:"mv-unsupported-viewer",template:'<div class="govuk-width-container">\n <div class="govuk-notification-banner__content">\n <p>\n <span *ngIf="typeException, else unsupported">The document could not be displayed, or the file type is unsupported.</span>\n Please <a #downloadLink [href]="url" [download]="downloadFileName">click here to download</a>.\n </p>\n <ng-template #unsupported>\n <span>This file type is not supported by this viewer.</span>\n </ng-template>\n </div>\n</div>\n'}]}],Po.ctorParameters=function(){return[{type:X},{type:Io}]},Po.propDecorators={url:[{type:e.Input}],downloadFileName:[{type:e.Input}],typeException:[{type:e.Input}],loadStatus:[{type:e.Output}],unsupportedViewerException:[{type:e.Output}],downloadLink:[{type:e.ViewChild,args:["downloadLink",{static:!1}]}]};var xo=function(){function t(t){this.httpClient=t,this.annotationApiUrl="/em-anno",this.annotationSetBaseUrl="/annotation-sets",this.annotationBaseUrl="/annotations"}return t.prototype.getAnnotationSet=function(t){var e=this.annotationSetsFullUrl+"/filter?documentId="+t;return this.httpClient.get(e,{observe:"response",withCredentials:!0})},t.prototype.postAnnotationSet=function(t){return this.httpClient.post(this.annotationSetsFullUrl,t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})),s.catchError((function(){return[]})))},t.prototype.getComments=function(t){return t.pipe(s.map(this.sortAnnotations),s.map(this.extractComments))},t.prototype.sortAnnotations=function(t){return t.annotations.sort((function(t,e){return t.page!==e.page?t.page-e.page:t.rectangles[0].y-e.rectangles[0].y}))},t.prototype.extractComments=function(t){return[].concat.apply([],L(t.map((function(t){return t.comments}))))},t.prototype.deleteAnnotation=function(t){var e=this.annotationFullsUrl+"/"+t;return this.httpClient.delete(e,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.postAnnotation=function(t){return this.httpClient.post(this.annotationFullsUrl,t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},Object.defineProperty(t.prototype,"annotationSetsFullUrl",{get:function(){return this.annotationApiUrl+this.annotationSetBaseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"annotationFullsUrl",{get:function(){return this.annotationApiUrl+this.annotationBaseUrl},enumerable:!1,configurable:!0}),t}();xo.decorators=[{type:e.Injectable}],xo.ctorParameters=function(){return[{type:i.HttpClient}]};var jo=function(){function t(){this.unsavedChanges=new a.Subject}return t.prototype.setCommentSet=function(t){this.commentSetComponent=t},t.prototype.onCommentChange=function(t){this.unsavedChanges.next(t)},t.prototype.getUnsavedChanges=function(){return this.unsavedChanges.asObservable()},t.prototype.hasUnsavedComments=function(t){return t.comments.length>0&&this.getComment(t).hasUnsavedChanges},t.prototype.updateUnsavedCommentsStatus=function(t,e){this.getComment(t).hasUnsavedChanges=e,this.allCommentsSaved()},t.prototype.getComment=function(t){return this.commentSetComponent.commentComponents.find((function(e){return e.comment.annotationId===t.comments[0].annotationId}))},t.prototype.resetCommentSet=function(){this.commentSetComponent=null},t.prototype.allCommentsSaved=function(){this.onCommentChange(this.commentSetComponent.commentComponents.some((function(t){return!0===t.hasUnsavedChanges})))},t}();jo.decorators=[{type:e.Injectable}];var To,_o,Do,Ro=r.createSelector(to,(function(t){return t.tags})),Bo=r.createSelector(Ro,(function(t){return t.tagNameEnt})),No=r.createSelector(Ro,(function(t){return t.filters})),Mo=r.createSelector(Ro,$e),Ao=r.createSelector(Ro,He),Fo=r.createSelector(Bo,(function(t){return Object.keys(t).map((function(e){return{key:e,length:Object.keys(t[e]).length}}))})),Lo=function(t){return t.annotations},$o=r.createSelector(to,Lo),Ho=r.createSelector($o,Be),Vo=r.createSelector($o,_e),Uo=function(t){return{documentId:t.documentId,annotationSetId:t.id}},zo=r.createSelector(Vo,Uo),Wo=function(t,e){return Object.assign(Object.assign({},e),{annotations:Object.keys(t).map((function(e){return t[e]}))})},qo=r.createSelector(Ho,Vo,Wo),Go=r.createSelector($o,Ne),Zo=r.createSelector($o,De),Jo=r.createSelector($o,Re),Yo=r.createSelector($o,Me),Xo=function(t){return t.commentSearch},Ko=r.createSelector(Yo,Xo),Qo=r.createSelector($o,Ae),ti=function(t,e,n){var o=!!Object.keys(n).length?n:e;if(t){var i=[];return Object.keys(t).forEach((function(e){i.push({anno:o[e]?o[e]:[],styles:t[e].styles})})),i}},ei=r.createSelector(no,Jo,Ao,ti),ni=function(t,e,n,o){if(t&&n&&e[1]){var i=!!Object.keys(o).length?o:t;return Object.keys(i).map((function(o){var i=n[o].page;return Object.assign(Object.assign({},t[o]),{page:i,pages:e})}))}},oi=r.createSelector(Zo,no,Ho,Mo,ni),ii=function(t,e){void 0===t&&(t=[]);var n=xe.filterCommentsSummary(t,e.filters);return n.length?n.filter((function(t){return void 0!==t.createdByDetails})).map((function(t){return{page:t.page,user:t.createdByDetails.forename.concat(" ").concat(t.createdByDetails.surname),date:T.default(t.lastModifiedDate).format("D MMMM YYYY"),tags:t.tags,comment:t.content}})):[""]},ai=r.createSelector(oi,Qo,ii),si=function(t,e){var n=!!Object.keys(e).length?e:t;return Object.keys(n).map((function(e){return t[e]})).filter((function(t){return t.comments&&t.comments.length>0}))},ri=r.createSelector(Ho,Mo,si);!function(t){t.PDF="pdf",t.IMAGE="image"}(To||(To={})),function(t){t.MP4="mp4",t.MP3="mp3"}(_o||(_o={})),function(t){t.EXCEL="excel",t.WORD="word",t.POWERPOINT="powerpoint",t.TXT="txt",t.RTF="rtf"}(Do||(Do={}));var ci=function(){function t(t,n,o,i,a,s,r){this.store=t,this.toolbarButtons=n,this.toolbarEvents=o,this.api=i,this.commentService=a,this.elRef=s,this.cdr=r,this.showToolbar=!0,this.toolbarButtonOverrides={},this.width="100%",this.mediaLoadStatus=new e.EventEmitter,this.viewerException=new e.EventEmitter,this.toolbarEventsOutput=new e.EventEmitter,this.unsavedChanges=new e.EventEmitter,this.enableAnnotations=!1,this.enableRedactions=!1,this.enableICP=!1,this.multimediaPlayerEnabled=!1,this.multimediaContent=!1,this.convertibleContent=!1,this.unsupportedContent=!1,this.typeException=!1,this.annotationApiUrl&&(i.annotationApiUrl=this.annotationApiUrl)}return t.prototype.ngAfterContentInit=function(){var t=this;this.annotationSet$=this.store.pipe(r.select(qo)),this.hasDifferentPageSize$=this.store.pipe(r.select(ao)),this.setToolbarButtons(),this.toolbarEventsOutput.emit(this.toolbarEvents),this.$subscriptions=this.commentService.getUnsavedChanges().subscribe((function(e){return t.onCommentChange(e)})),this.$subscriptions.add(this.toolbarEvents.getShowCommentSummary().subscribe((function(e){return t.showCommentSummary=e})))},t.prototype.ngAfterViewChecked=function(){if(this.height&&this.viewerHeight!==this.height)return this.viewerHeight=this.height,void this.cdr.detectChanges();if(!this.height){var t=this.elRef.nativeElement.getBoundingClientRect().top+this.viewerRef.nativeElement.offsetTop;this.prevOffset!==t&&(this.viewerHeight="calc(100vh - "+t+"px)",this.prevOffset=t,this.cdr.detectChanges())}},t.prototype.ngOnChanges=function(t){t.annotationApiUrl&&(this.api.annotationApiUrl=this.annotationApiUrl),t.url&&(this.toolbarEvents.reset(),this.commentService.resetCommentSet(),this.documentId=this.extractDMStoreDocId(this.url),this.store.dispatch(new yt(this.documentId)),!this.enableAnnotations||this.multimediaContent||this.unsupportedContent||this.store.dispatch(new me(this.documentId)),this.enableRedactions&&!this.multimediaContent&&!this.unsupportedContent&&this.documentId&&this.store.dispatch(new Dn(this.documentId)),"image"===this.contentType&&(this.documentTitle=null)),t.contentType&&(this.convertibleContent=this.needsConverting(),this.multimediaContent=this.isMultimedia(),this.unsupportedContent=!this.isSupported()),this.setToolbarButtons(),this.detectOs(),this.typeException=!1},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.prototype.needsConverting=function(){return null!==this.contentType&&Object.keys(Do).includes(this.contentType.toUpperCase())},t.prototype.isMultimedia=function(){return null!==this.contentType&&Object.keys(_o).includes(this.contentType.toUpperCase())},t.prototype.isSupported=function(){var t=Object.assign({},_o,Do,To);return null!==this.contentType&&Object.keys(t).includes(this.contentType.toUpperCase())},t.prototype.onMediaLoad=function(t){this.mediaLoadStatus.emit(t)},t.prototype.setToolbarButtons=function(){this.contentType===To.PDF||this.needsConverting()?this.toolbarButtons.setup(Object.assign(Object.assign(Object.assign({},ot),{showHighlightButton:this.enableAnnotations,showDrawButton:this.enableAnnotations}),this.toolbarButtonOverrides)):this.contentType===To.IMAGE?this.toolbarButtons.setup(Object.assign(Object.assign(Object.assign({},it),{showDrawButton:this.enableAnnotations}),this.toolbarButtonOverrides)):this.isMultimedia()?this.toolbarButtons.setup(Object.assign(Object.assign({},at),this.toolbarButtonOverrides)):this.toolbarButtons.setup(Object.assign(Object.assign({},st),this.toolbarButtonOverrides))},t.prototype.onLoadException=function(t){this.viewerException.emit(t),this.isSupported()?(this.typeException=!0,this.contentType=null,this.setToolbarButtons()):this.typeException=!1},t.prototype.onCommentChange=function(t){this.unsavedChanges.emit(t)},t.prototype.onDocumentTitleChange=function(t){this.documentTitle=t},t.prototype.extractDMStoreDocId=function(t){return(t=(t=t.includes("/documents/")?t.split("/documents/")[1]:t).includes("/documentsv2/")?t.split("/documentsv2/")[1]:t).replace("/binary","")},t.prototype.detectOs=function(){this.hasScrollBar=-1!==window.navigator.userAgent.indexOf("Win")},t}();ci.decorators=[{type:e.Component,args:[{selector:"mv-media-viewer",template:'<div id="outerContainer"\n [ngClass]="{\n \'has-redact-bar\': toolbarEvents.redactionMode | async,\n \'icp-mode\': toolbarEvents.icp.enabled | async,\n \'is-redaction-preview\': toolbarEvents.redactionPreview | async,\n sidebarOpen: toolbarEvents.sidebarOpen | async,\n \'has-scroll-bar\': hasScrollBar,\n \'has-different-page-size\': hasDifferentPageSize$ | async\n }"\n [ngStyle]="{ width: width }">\n\n <mv-comments-summary *ngIf="showCommentSummary"\n [title]="documentTitle || \'Comment Summary\'"\n [contentType]="contentType">\n </mv-comments-summary>\n\n <mv-confirm-action *ngIf="toolbarEvents.icp.leavingSession | async"></mv-confirm-action>\n\n <div id="mainContainer">\n <mv-main-toolbar *ngIf="showToolbar"\n [enableAnnotations]="enableAnnotations"\n [enableICP]="enableICP"\n [enableRedactions]="enableRedactions"\n [contentType]="contentType"\n >\n </mv-main-toolbar>\n <mv-redaction-toolbar *ngIf="toolbarEvents.redactionMode | async"></mv-redaction-toolbar>\n <mv-icp-toolbar *ngIf="toolbarEvents.icp.enabled | async"></mv-icp-toolbar>\n\n <div #viewerRef>\n <mv-conversion-viewer *ngIf="convertibleContent"\n (documentTitle)="onDocumentTitleChange($event)"\n (mediaLoadStatus)="onMediaLoad($event)"\n (viewerException)="onLoadException($event)"\n [enableAnnotations]="enableAnnotations"\n [enableRedactions]="enableRedactions"\n [annotationSet]="enableAnnotations ? (annotationSet$ | async) : null"\n [originalUrl]="url"\n [downloadFileName]="downloadFileName"\n [height]="viewerHeight"\n mvRotationPersist>\n </mv-conversion-viewer>\n <mv-pdf-viewer *ngIf="contentType === \'pdf\'"\n #pdfViewer\n (mediaLoadStatus)="onMediaLoad($event)"\n (pdfViewerException)="onLoadException($event)"\n (documentTitle)="onDocumentTitleChange($event)"\n [url]="url"\n [enableAnnotations]="enableAnnotations"\n [enableRedactions]="enableRedactions"\n [enableICP]="enableICP"\n [annotationSet]="enableAnnotations ? (annotationSet$ | async) : null"\n [downloadFileName]="downloadFileName"\n [height]="viewerHeight"\n [caseId]="caseId"\n mvRotationPersist>\n </mv-pdf-viewer>\n <mv-image-viewer *ngIf="contentType === \'image\'"\n (mediaLoadStatus)="onMediaLoad($event)"\n (imageViewerException)="onLoadException($event)"\n [url]="url"\n [enableAnnotations]="enableAnnotations"\n [annotationSet]="enableAnnotations ? (annotationSet$ | async) : null"\n [downloadFileName]="downloadFileName"\n [height]="viewerHeight"\n mvRotationPersist>\n </mv-image-viewer>\n <mv-multimedia-player *ngIf="multimediaContent"\n [multimediaOn]="multimediaPlayerEnabled"\n [url]="url"\n [downloadFileName]="downloadFileName"\n (loadStatus)="onMediaLoad($event)">\n </mv-multimedia-player>\n <mv-unsupported-viewer *ngIf="unsupportedContent"\n [url]="url"\n [typeException]="typeException"\n [downloadFileName]="downloadFileName"\n (loadStatus)="onMediaLoad($event)"\n (unsupportedViewerException)="onLoadException($event)">\n </mv-unsupported-viewer>\n </div>\n </div>\n</div>\n',encapsulation:e.ViewEncapsulation.None}]}],ci.ctorParameters=function(){return[{type:r.Store},{type:nt},{type:X},{type:xo},{type:jo},{type:e.ElementRef},{type:e.ChangeDetectorRef}]},ci.propDecorators={viewerRef:[{type:e.ViewChild,args:["viewerRef",{static:!1}]}],url:[{type:e.Input}],downloadFileName:[{type:e.Input}],contentType:[{type:e.Input}],showToolbar:[{type:e.Input}],toolbarButtonOverrides:[{type:e.Input}],height:[{type:e.Input}],width:[{type:e.Input}],mediaLoadStatus:[{type:e.Output}],viewerException:[{type:e.Output}],toolbarEventsOutput:[{type:e.Output}],unsavedChanges:[{type:e.Output}],enableAnnotations:[{type:e.Input}],annotationApiUrl:[{type:e.Input}],enableRedactions:[{type:e.Input}],enableICP:[{type:e.Input}],multimediaPlayerEnabled:[{type:e.Input}],caseId:[{type:e.Input}]};var li=function(){function t(){}return t.prototype.isNumber=function(t){return null!=t&&""!==t&&!isNaN(Number(t.toString()))},t}();li.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new li},token:li,providedIn:"root"}),li.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],li.ctorParameters=function(){return[]};var ui=function(){function t(t,e,n,o){this.toolbarEvents=t,this.toolbarButtons=e,this.cdr=n,this.numberHelper=o,this.enableAnnotations=!1,this.enableRedactions=!1,this.enableICP=!1,this.contentType=null,this.subscriptions=[],this.icpEnabled=!1,this.redactionEnabled=!1,this.pageNumber=1,this.pageCount=0,this.isDropdownMenuOpen=!1,this.dropdownMenuPositions=[new m.ConnectionPositionPair({originX:"end",originY:"bottom"},{overlayX:"end",overlayY:"top"},0,3)],this.zoomScales=[.1,.25,.5,.75,1,1.25,1.5,2.5,3,5],this.allButtonsWidth=0,this.widthRequiredForBtn={}}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.setCurrentPageSubject.subscribe((function(e){return t.setCurrentPage(e)})),this.toolbarEvents.setCurrentPageInputValueSubject.subscribe((function(e){return t.pageNumber=e})),this.toolbarEvents.getPageCount().subscribe((function(e){return t.pageCount=e})),this.toolbarEvents.icp.enabled.subscribe((function(e){t.icpEnabled=e,t.icpEnabled&&(t.toolbarEvents.toggleCommentsPanel(!e),t.toolbarEvents.sidebarOpen.next(!1))})),this.toolbarEvents.redactionMode.subscribe((function(e){t.redactionEnabled=e})))},t.prototype.ngOnDestroy=function(){var t,e;try{for(var n=A(this.subscriptions),o=n.next();!o.done;o=n.next()){o.value.unsubscribe()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.ngAfterViewInit=function(){var t=this;Array.from(this.mvToolbarMain.nativeElement.children).forEach((function(e){t.allButtonsWidth+=e.getBoundingClientRect().width,t.widthRequiredForBtn[e.id]=t.allButtonsWidth})),this.cdr.detectChanges()},t.prototype.onResize=function(){this.cdr.detectChanges()},t.prototype.onClickHighlightToggle=function(){this.toolbarEvents.toggleHighlightMode()},t.prototype.onClickDrawToggle=function(){this.toolbarEvents.toggleDrawMode()},t.prototype.toggleSideBar=function(){this.toolbarEvents.sidebarOpen.next(!this.toolbarEvents.sidebarOpen.getValue())},t.prototype.togglePresentBar=function(){this.toolbarEvents.searchBarHidden.next(!0),this.toolbarEvents.icp.enable()},t.prototype.increasePageNumber=function(){this.toolbarEvents.incrementPage(1)},t.prototype.decreasePageNumber=function(){this.toolbarEvents.incrementPage(-1)},t.prototype.onPageNumberInputChange=function(t){Number(t)<1&&(t="1"),Number(t)>this.pageCount&&(t=this.pageCount.toString()),this.toolbarEvents.setPage(Number.parseInt(t,10))},t.prototype.setCurrentPage=function(t){this.pageNumber=t},t.prototype.rotate=function(t){this.toolbarEvents.rotate(t)},t.prototype.printFile=function(){this.toolbarEvents.print()},t.prototype.downloadFile=function(){this.toolbarEvents.download()},t.prototype.zoom=function(t){this.toolbarEvents.zoom(+t)},t.prototype.stepZoom=function(t){this.toolbarEvents.stepZoom(t),this.zoomSelect.nativeElement.selected="selected"},t.prototype.toggleCommentsPanel=function(){this.toolbarEvents.toggleCommentsPanel(!this.toolbarEvents.commentsPanelVisible.getValue())},t.prototype.toggleRedactBar=function(){this.toolbarEvents.toggleRedactionMode()},t.prototype.toggleGrabNDrag=function(){this.toolbarEvents.toggleGrabNDrag()},t.prototype.isPdf=function(){return"pdf"===this.contentType},t.prototype.toggleSearchBar=function(){this.toolbarEvents.searchBarHidden.next(!this.toolbarEvents.searchBarHidden.getValue())},t.prototype.toggleMoreOptions=function(){var t=this;this.isDropdownMenuOpen=!this.isDropdownMenuOpen,setTimeout((function(){t.mvMenuItems&&t.mvMenuItems.nativeElement.focus()}),100)},t}();ui.decorators=[{type:e.Component,args:[{selector:"mv-main-toolbar",template:'<div class="toolbar">\n <div id="toolbarContainer">\n <div class="mv-toolbar__container">\n <div #mvToolbar class="mv-toolbar" [class.notSupported]="!contentType">\n \x3c!-- The mvToolbarMain div contains all toolbar buttons except the "More options" button. This allows for calculation of the available space to display buttons --\x3e\n <div id="mvToolbarMain" class="mv-toolbar-main" #mvToolbarMain>\n <ng-container *ngTemplateOutlet="menuItems"></ng-container>\n </div>\n \x3c!-- The mvToolbarMoreOptions div contains the "More options" toolbar button (and the overlay template for the dropdown menu).\n The space occupied by the button (if visible) is excluded from the toolbar space available calculation --\x3e\n <div id="mvToolbarMoreOptions" class="mv-toolbar-more-options">\n <button id="mvMoreOptionsBtn" class="mv-button mv-toolbar__menu-button--more-options"\n [class.mv-toolbar__menu-button--more-options__hidden]="mvToolbar.offsetWidth >= allButtonsWidth" aria-pressed="false"\n (click)="toggleMoreOptions()" cdkOverlayOrigin #trigger="cdkOverlayOrigin">\n <span>More options</span>\n </button>\n \x3c!-- This template displays the overlay content for the dropdown menu and is connected to the "More options" button --\x3e\n <ng-template cdkConnectedOverlay [cdkConnectedOverlayOrigin]="trigger"\n [cdkConnectedOverlayOpen]="isDropdownMenuOpen" [cdkConnectedOverlayPositions]="dropdownMenuPositions">\n <div class="dropdown-menu" #dropdownMenu tabindex="0">\n <ng-container *ngTemplateOutlet="menuItems"></ng-container>\n </div>\n </ng-template>\n </div>\n </div>\n\n <div id="mvMenuItems" #mvMenuItems>\n <ng-template #menuItems>\n\n <button *ngIf="toolbarButtons.showSidebar" id="mvIndexBtn" title="Index" data-l10n-id="index" #mvIndexBtn\n class="mv-button mv-toolbar__menu-button--index"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvIndexBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvIndexBtn\']" aria-pressed="false"\n (click)="toggleSideBar(); isDropdownMenuOpen = false">\n <span>Index</span>\n </button>\n\n <button *ngIf="toolbarButtons.showDrawButton" [disabled]="icpEnabled || redactionEnabled" id="mvDrawBtn"\n #mvDrawBtn class="mv-button mv-toolbar__menu-button--draw" title="Draw a box" tabindex="-1"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvDrawBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvDrawBtn\']"\n [class.toggled]="toolbarEvents.drawModeSubject | async" aria-hidden="true" aria-pressed="false"\n data-l10n-id="toggleDrawButton" (click)="onClickDrawToggle(); isDropdownMenuOpen = false">\n <span data-l10n-id="draw_label">Draw a box</span>\n </button>\n\n <button *ngIf="toolbarButtons.showHighlightButton" [disabled]="icpEnabled || redactionEnabled"\n id="mvHighlightBtn" #mvHighlightBtn class="mv-button mv-toolbar__menu-button--highlight" title="Highlight"\n tabindex="-1" [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvHighlightBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvHighlightBtn\']"\n [class.toggled]="toolbarEvents.highlightModeSubject | async" aria-hidden="true" aria-pressed="false"\n (click)="onClickHighlightToggle(); isDropdownMenuOpen = false" data-l10n-id="toggleHighlightButton">\n <span data-l10n-id="highlight_label">Highlight</span>\n </button>\n\n <ng-container *ngIf="toolbarButtons.showNavigation">\n <div id="mvPageBtn" #mvPageBtn class="mv-toolbar__menu-button--page" aria-pressed="false"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvPageBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvPageBtn\']">\n <span>Page</span>\n\n <button id="mvUpBtn" [disabled]="pageNumber === 1" title="Previous Page"\n class="mv-toolbar__menu-button--up button-image" data-l10n-id="previous"\n (click)="decreasePageNumber()"><span></span></button>\n <button id="mvDownBtn" [disabled]="pageNumber === pageCount" title="Next Page"\n class="mv-toolbar__menu-button--down button-image" data-l10n-id="next"\n (click)="increasePageNumber()"><span></span></button>\n\n <input type="number" id="pageNumber" class="hmcts-toolbar-input govuk-input--width-2" title="Page Number"\n value="1" size="4" min="1" [value]="pageNumber" aria-label="page number" tabindex="0"\n data-l10n-id="page" (change)="onPageNumberInputChange(pageNumberInput.value)" #pageNumberInput>\n <span id="numPages" class="toolbarLabel">/ {{ pageCount }}</span>\n </div>\n </ng-container>\n\n <ng-container *ngIf="toolbarButtons.showZoom">\n <div id="mvZoomBtn" #mvZoomBtn class="mv-toolbar__menu-button--zoom" aria-pressed="false"\n [class.button-hidden-on-toolbar]="mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvZoomBtn\']"\n [class.button-hidden-on-dropdown]="mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvZoomBtn\']">\n <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 </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" title="Grab and drag"\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 </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 </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\n </ng-template>\n </div>\n <mv-search-bar></mv-search-bar>\n </div>\n\n <div id="loadingBar">\n <div class="progress">\n <div class="glimmer">\n </div>\n </div>\n </div>\n </div>\n</div>\n'}]}],ui.ctorParameters=function(){return[{type:X},{type:nt},{type:e.ChangeDetectorRef},{type:li}]},ui.propDecorators={enableAnnotations:[{type:e.Input}],enableRedactions:[{type:e.Input}],enableICP:[{type:e.Input}],contentType:[{type:e.Input}],zoomSelect:[{type:e.ViewChild,args:["zoomSelect",{static:!1}]}],mvToolbarMain:[{type:e.ViewChild,args:["mvToolbarMain",{static:!1}]}],mvMenuItems:[{type:e.ViewChild,args:["dropdownMenu",{static:!1}]}],onResize:[{type:e.HostListener,args:["window:resize",[]]}]};var pi=function(){function t(t,e){this.toolbarButtons=t,this.toolbarEvents=e,this.highlightAll=!0,this.matchCase=!1,this.wholeWord=!1,this.resultsText="",this.searchText="",this.resultCount=0,this.subscriptions=[],this.advancedSearchVisible=!1}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.searchResultsCountSubject.subscribe((function(e){return t.setSearchResultsCount(e)})))},t.prototype.ngOnDestroy=function(){var t,e;try{for(var n=A(this.subscriptions),o=n.next();!o.done;o=n.next()){o.value.unsubscribe()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.onWindowKeyDown=function(t){var e=this;("F3"===t.code||t.ctrlKey&&"KeyF"===t.code)&&(t.preventDefault(),this.toolbarEvents.searchBarHidden.next(!1),setTimeout((function(){return e.findInput.nativeElement.focus()}),200))},t.prototype.searchNext=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!1,reset:!1})},t.prototype.searchPrev=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!0,reset:!1})},t.prototype.search=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!1,reset:!0})},t.prototype.setSearchResultsCount=function(t){var e=this;this.resultCount=t.total,this.resultsText=this.resultCount>0?"Found "+t.current+" of "+t.total:"No results found",this.resultCount&&this.resultCount>0&&setTimeout((function(){e.findNext.nativeElement.focus()}),1e3)},t.prototype.onEscapeKeyPress=function(t){this.toolbarEvents.searchBarHidden.next(!0)},t.prototype.onEnterKeyPress=function(t){this.search()},t.prototype.toggleAdvancedSearch=function(){this.advancedSearchVisible=!this.advancedSearchVisible},t.prototype.toggleSearchBar=function(){this.toolbarEvents.searchBarHidden.next(!this.toolbarEvents.searchBarHidden.getValue())},t}();pi.decorators=[{type:e.Component,args:[{selector:"mv-search-bar",template:'<div class="searchbar govuk-!-padding-3" [hidden]="toolbarEvents.searchBarHidden | async">\n <div class="govuk-grid-row">\n <div class="govuk-grid-column-full">\n <input class="govuk-input govuk-!-display-inline-block govuk-!-width-three-quarters govuk-!-margin-bottom-5 govuk-!-margin-top-5"\n type="text" aria-label="Find in document" #findInput [(ngModel)]="searchText" (keydown.escape)="onEscapeKeyPress($event)" (keydown.enter)="onEnterKeyPress($event)" title="Find in document"\n placeholder="Find in document…" tabindex="0" data-l10n-id="find_input" />\n <button class="govuk-button govuk-!-display-inline-block govuk-!-margin-bottom-4" data-module="govuk-button"\n (click)="search()" style=" position: absolute; top: 40px; right: 10px; ">\n Search\n </button>\n <button id="mvCloseBtn" #mvCloseBtn class="mv-button searchbar-button--close" title="Close Search" data-l10n-id="mvRedactBtn"\n (click)="toggleSearchBar()">\n </button>\n </div>\n </div>\n\n <div class="govuk-grid-row">\n <div class="govuk-grid-column-three-quarters">\n <span id="findResultsCount" class="govuk-!-display-inline-block govuk-!-margin-right-4">{{resultsText}}</span>\n <a *ngIf="resultCount > 0" [routerLink]="" class="govuk-link govuk-link--no-visited-state govuk-!-margin-right-2"\n (click)="searchPrev()" title="Find the previous occurrence of the phrase" data-l10n-id="find_previous">Prev</a>\n <a *ngIf="resultCount > 0" [routerLink]="" #findNext class="govuk-link govuk-link--no-visited-state" (click)="searchNext()"\n title="Find the next occurrence of the phrase" data-l10n-id="find_next">Next</a>\n </div>\n <div class="govuk-grid-column-one-quarter">\n <a [routerLink]="" class="govuk-link govuk-link--no-visited-state" (click)="toggleAdvancedSearch()" title="Advanced"\n data-l10n-id="find_advanced" style=" position: absolute; top: 95px; right: 15px; ">Advanced</a>\n </div>\n </div>\n\n <div class="govuk-grid-row" *ngIf="advancedSearchVisible">\n <div class="govuk-grid-column-full">\n <div class="govuk-form-group govuk-!-margin-top-3 govuk-!-margin-bottom-1">\n <fieldset class="govuk-fieldset" aria-describedby="advanced">\n <div class="govuk-checkboxes">\n <div class="govuk-checkboxes__item">\n <input class="govuk-checkboxes__input" id="findHighlightAll" name="findHighlightAll" type="checkbox"\n (change)="highlightAll = !highlightAll; search()" [checked]="highlightAll">\n <label class="govuk-label govuk-checkboxes__label" for="findHighlightAll" data-l10n-id="find_highlight">\n Highlight all\n </label>\n </div>\n <div class="govuk-checkboxes__item">\n <input class="govuk-checkboxes__input" id="findMatchCase" name="findMatchCase" type="checkbox"\n (change)="matchCase = !matchCase; search()" [checked]="matchCase">\n <label class="govuk-label govuk-checkboxes__label" for="findMatchCase"\n data-l10n-id="find_match_case_label">\n Match text (exact case)\n </label>\n </div>\n <div class="govuk-checkboxes__item">\n <input class="govuk-checkboxes__input" id="findEntireWord" name="findMatchCase" type="checkbox"\n (change)="wholeWord = !wholeWord; search()" [checked]="wholeWord">\n <label class="govuk-label govuk-checkboxes__label" for="findEntireWord"\n data-l10n-id="find_entire_word_label">\n Match whole words or sentences\n </label>\n </div>\n </div>\n </fieldset>\n </div>\n </div>\n </div>\n</div>\n'}]}],pi.ctorParameters=function(){return[{type:nt},{type:X}]},pi.propDecorators={findInput:[{type:e.ViewChild,args:["findInput",{static:!0}]}],findNext:[{type:e.ViewChild,args:["findNext",{static:!1}]}],onWindowKeyDown:[{type:e.HostListener,args:["window:keydown",["$event"]]}]};var di=r.createSelector(to,(function(t){return t.redactions})),hi=r.createSelector(di,(function(t){return t.redactionPageEntities})),mi=r.createSelector(di,(function(t){return t.selectedRedaction})),gi=r.createSelector(di,(function(t){return t.redactedDocumentInfo})),bi=r.createSelector(di,(function(t){return t.redactionEntities})),fi=r.createSelector(bi,oo,(function(t,e){return{redactions:Object.keys(t).map((function(e){return t[e]})),documentId:e}})),vi=r.createSelector(no,hi,(function(t,e){if(t&&e){var n=[];return Object.keys(t).forEach((function(o){n.push({anno:e[o]?e[o]:[],styles:t[o].styles})})),n}})),yi=function(){function t(t,e,n){this.toolbarEventService=t,this.toolbarButtons=e,this.store=n,this.preview=!1,this.hasRedactions=!1}return t.prototype.ngOnInit=function(){var t=this;this.$subscription=this.store.pipe(r.select(fi)).subscribe((function(e){t.hasRedactions=!!e.redactions.length}))},t.prototype.toggleTextRedactionMode=function(){this.toolbarEventService.highlightModeSubject.next(!0)},t.prototype.toggleDrawMode=function(){this.toolbarEventService.drawModeSubject.next(!0)},t.prototype.togglePreview=function(){this.preview=!this.preview,this.toolbarEventService.toggleRedactionPreview(this.preview)},t.prototype.unmarkAll=function(){this.toolbarEventService.unmarkAll()},t.prototype.redact=function(){this.toolbarEventService.applyRedactionToDocument()},t.prototype.toggleRedactBar=function(){this.toolbarEventService.toggleRedactionMode()},t.prototype.redactPage=function(){this.toolbarEventService.drawModeSubject.next(!0),this.toolbarEventService.redactPage()},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t}();yi.decorators=[{type:e.Component,args:[{selector:"mv-redaction-toolbar",template:'<div class="redaction">\n <label class="govuk-label redaction-title" data-l10n-id="redaction_options">Redaction options</label>\n <button id="toggleDrawButton" class="mv-button redaction-button--draw" title="Draw a box"\n data-l10n-id="toggleDrawButton" (click)="toggleDrawMode()">\n <span data-l10n-id="toggleDrawButton_label">Draw a box</span>\n </button>\n\n <button id="redactPageButton" class="mv-button redaction-button--redact-page" title="Redact Page"\n data-l10n-id="redactPageButton" (click)="redactPage()">\n <span data-l10n-id="redactPageButton_label">Redact page</span>\n </button>\n\n <button *ngIf="toolbarButtons.showHighlightButton" id="toggleHighlightButton"\n class="mv-button redaction-button--redact" aria-pressed="false" title="Redact text"\n data-l10n-id="toggleTextRedactionButton" (click)="toggleTextRedactionMode()">\n <span data-l10n-id="toggleTextRedactionButton_label">Redact text</span>\n </button>\n\n <button [disabled]="!hasRedactions" id="mvClearBtn" #mvClearBtn class="mv-button redaction-button--clear" aria-pressed="false" title="Clear all"\n data-l10n-id="toggleClearAllButton" (click)="unmarkAll()">\n <span data-l10n-id="Clear all">Clear all</span>\n </button>\n\n <button [disabled]="!hasRedactions" id="mvPreviewBtn" class="mv-button" [class.redaction-button--preview]="!preview"\n [class.redaction-button--hide-preview]="preview" redaction-button--preview aria-pressed="false" title="Preview"\n data-l10n-id="togglePreviewButton" (click)="togglePreview()">\n <span *ngIf="!preview" data-l10n-id="redaction-preview_label">Preview</span>\n <span *ngIf="preview" data-l10n-id="redaction-hide-preview_label">Hide preview</span>\n </button>\n\n <button [disabled]="!hasRedactions" id="mvRedactBtn" class="mv-button redaction-button--download" aria-pressed="false" title="Redact"\n data-l10n-id="mvRedactBtn" (click)="redact()">\n <span data-l10n-id="Save Document">Save document</span>\n </button>\n\n <button id="mvCloseBtn" #mvCloseBtn class="mv-button redaction-button--close" title="Close Redaction" data-l10n-id="mvRedactBtn"\n (click)="toggleRedactBar()">\n <span data-l10n-id="Close Redaction">Close Redaction</span>\n </button>\n\n</div>\n'}]}],yi.ctorParameters=function(){return[{type:X},{type:nt},{type:r.Store}]};var wi=function(){function t(t,e){this.toolbarEventService=t,this.store=e}return t.prototype.ngOnInit=function(){var t=this;this.$subscription=this.store.pipe(r.select(yo)).subscribe((function(e){return t.isPresenter=e})),this.$subscription.add(this.store.pipe(r.select(fo)).subscribe((function(e){return t.presenterName=e})))},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.present=function(){this.toolbarEventService.icp.becomePresenter()},t.prototype.stopPresenting=function(){this.toolbarEventService.icp.stopPresenting()},t.prototype.leaveIcpSession=function(){this.toolbarEventService.icp.leaveSession()},t.prototype.showParticipantsList=function(){this.toolbarEventService.toggleParticipantsList(!this.toolbarEventService.icp.participantsListVisible.getValue())},t}();wi.decorators=[{type:e.Component,args:[{selector:"mv-icp-toolbar",template:'<div id="icp-toolbar" class="icpMode">\n <div id="toolbar-title">\n <label class="govuk-label" data-l10n-id="digitalEvidence_label">Digital evidence presentation</label>\n </div>\n\n <div id="presentation-mode">\n <div class="item-label">\n <label class="govuk-label" data-l10n-id="icpInfo_label">You are in presentation mode</label>\n </div>\n <div class="item-button">\n <button class="govuk-button govuk-button--secondary" data-module="govuk-button" tabindex="0"\n title="Leave presentation" (click)="leaveIcpSession()">\n <span data-l10n-id="icp-leave-presentation_label">Leave presentation</span>\n </button>\n </div>\n </div>\n\n <div id="presenter-info">\n <div class="item-label">\n <label class="govuk-label" *ngIf="!presenterName" data-l10n-id="noPresenter_label">Waiting for presenter</label>\n <label class="govuk-label" *ngIf="presenterName && isPresenter" data-l10n-id="isPresenter_label">You are\n presenting</label>\n <label class="govuk-label" *ngIf="presenterName && !isPresenter"\n data-l10n-id="otherPresenter_label">{{ presenterName | titlecase }}\n is presenting</label>\n </div>\n <div class="item-button">\n <button *ngIf="!presenterName" class="govuk-button" id="icp-present" tabindex="0" title="Present"\n (click)="present()">\n <span data-l10n-id="icp-present_label">Start presenting</span>\n </button>\n <button *ngIf="isPresenter" class="govuk-button govuk-button--warning" id="icp-stop-presenting" tabindex="0"\n title="Stop presenting" (click)="stopPresenting()">\n <span data-l10n-id="icp-stop-presenting_label">Stop Presenting</span>\n </button>\n </div>\n </div>\n\n <div id="participant-list">\n <button class="govuk-button govuk-button--secondary" id="icp-participants-list" tabindex="0"\n title="Participants list" (click)="showParticipantsList()">\n <span\n data-l10n-id="icp-stop-presenting_label">{{(toolbarEventService.icp.participantsListVisible | async) ? \'Hide\': \'Show\'}}\n participants</span>\n </button>\n </div>\n</div>'}]}],wi.ctorParameters=function(){return[{type:X},{type:r.Store}]};var Si=function(){};Si.decorators=[{type:e.NgModule,args:[{declarations:[pi,ui,yi,wi],providers:[nt,X],exports:[ui,pi,yi,wi],imports:[n.CommonModule,o.FormsModule,m.OverlayModule,g.RouterModule]}]}];var ki=function(){function t(t,n){this.toolbarEvents=t,this.store=n,this.update=new e.EventEmitter,this.delete=new e.EventEmitter,this.annotationClick=new e.EventEmitter}return Object.defineProperty(t.prototype,"annotation",{set:function(t){this.anno=Object.assign({},t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectedAnnoId",{set:function(t){if(t){var e=this.anno.id||this.anno.redactionId;this.selected=!!t.annotationId&&t.annotationId===e}},enumerable:!1,configurable:!0}),t.prototype.onSelect=function(){var t=this.anno.id||this.anno.redactionId;this.annotationClick.emit({annotationId:t,editable:!1,selected:!0})},t.prototype.onRectangleUpdate=function(t){var e=Object.assign({},this.anno);e.rectangles=e.rectangles.filter((function(e){return e.id!==t.id})),e.rectangles.push(t),this.update.emit(e)},t.prototype.deleteHighlight=function(){this.delete.emit(this.anno)},t.prototype.addOrEditComment=function(){if(0===this.anno.comments.length){var t={annotationId:this.anno.id,content:"",createdBy:this.anno.createdBy,createdByDetails:void 0,createdDate:T.default.utc().tz("Europe/London").toISOString(),id:w.v4(),lastModifiedBy:"",lastModifiedByDetails:void 0,lastModifiedDate:"",tags:[],page:null,pages:{},pageHeight:null,selected:!1,editable:!1};this.store.dispatch(new we(t))}this.selected=!0,this.annotationClick.emit({annotationId:this.anno.id,editable:!0,selected:!0}),this.toolbarEvents.toggleCommentsPanel(!0)},t}();ki.decorators=[{type:e.Component,args:[{selector:"mv-annotation",template:'<div #container [tabindex]="anno.id">\n <mv-ctx-toolbar *ngIf="selected"\n [canDelete]="true" [canComment]="true"\n [rectangles]="anno.rectangles"\n [zoom]="zoom"\n [rotate]="rotate"\n [pageHeight]="pageHeight"\n [pageWidth]="pageWidth"\n (deleteHighlightEvent)="deleteHighlight()"\n (addOrEditCommentEvent)="addOrEditComment()">\n </mv-ctx-toolbar>\n <ng-container *ngFor="let rectangle of anno.rectangles">\n <mv-anno-rectangle\n (select)="onSelect()"\n (update)="onRectangleUpdate($event)"\n [selected]="selected"\n [zoom]="zoom"\n [rotate]="rotate"\n [pageHeight]="pageHeight"\n [pageWidth]="pageWidth"\n [editable]="anno.rectangles.length <= 1"\n [annoRect]="rectangle"\n [color]="anno.color">\n </mv-anno-rectangle>\n </ng-container>\n</div>\n'}]}],ki.ctorParameters=function(){return[{type:X},{type:r.Store}]},ki.propDecorators={annotation:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],selectedAnnoId:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}],update:[{type:e.Output}],delete:[{type:e.Output}],annotationClick:[{type:e.Output}],container:[{type:e.ViewChild,args:["container",{static:!1}]}]};var Ei=function(){function t(t,e){this.store=t,this.commentService=e,this.annotations=[]}return t.prototype.ngOnInit=function(){this.selectedAnnotation$=this.store.pipe(r.select(Go))},t.prototype.onAnnotationUpdate=function(t){this.store.dispatch(new fe(t))},t.prototype.onAnnotationDelete=function(t){t.comments.length>0&&this.commentService.updateUnsavedCommentsStatus(t,!1),this.store.dispatch(new Se(t.id))},t.prototype.selectAnnotation=function(t){this.store.dispatch(new Ce(t))},t}();Ei.decorators=[{type:e.Component,args:[{selector:"mv-annotation-set",template:'<ng-container *ngFor="let annotation of annotations">\n <mv-annotation [annotation]="annotation"\n [zoom]="zoom"\n [rotate]="rotate"\n [selectedAnnoId]="selectedAnnotation$ | async"\n [pageHeight]="pageHeight"\n [pageWidth]="pageWidth"\n (update)="onAnnotationUpdate($event)"\n (delete)="onAnnotationDelete($event)"\n (annotationClick)="selectAnnotation($event)">\n </mv-annotation>\n</ng-container>\n'}]}],Ei.ctorParameters=function(){return[{type:r.Store},{type:jo}]},Ei.propDecorators={page:[{type:e.Input}],annotations:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}]};var Ci=function(){function t(t,e){this.toolBarEvents=t,this.store=e}return t.prototype.saveAnnotation=function(t,e){var n=this;this.store.pipe(r.select(zo),s.take(1)).subscribe((function(o){var i=Object.assign(Object.assign({id:_.default(),color:"FFFF00",comments:[],page:e,rectangles:t,type:"highlight"},o),{createdBy:"",createdByDetails:void 0,createdDate:T.default.utc().tz("Europe/London").toISOString(),lastModifiedBy:"",lastModifiedByDetails:void 0,lastModifiedDate:"",tags:[]});n.store.dispatch(new fe(i))}))},t.prototype.applyRotation=function(t,e,n,o,i,a,s,r){var c={x:+(a/r).toFixed(2),y:+(i/r).toFixed(2),width:+(o/r).toFixed(2),height:+(n/r).toFixed(2)},l=c.x,u=c.y,p=c.width,d=c.height,h={x:l,y:u,width:p,height:d};switch(s){case 90:h.width=d,h.height=p,h.x=u,h.y=+(e/r-l-p).toFixed(2);break;case 180:h.x=+(e/r-l-p).toFixed(2),h.y=+(t/r-u-d).toFixed(2);break;case 270:h.width=d,h.height=p,h.x=+(t/r-u-d).toFixed(2),h.y=l}return h},t.prototype.resetHighlight=function(){window.getSelection().removeAllRanges(),this.toolBarEvents.highlightModeSubject.next(!1)},t}();Ci.decorators=[{type:e.Injectable}],Ci.ctorParameters=function(){return[{type:X},{type:r.Store}]};var Ii=function(){function t(t,n){this.toolbarEvents=t,this.highlightService=n,this.select=new e.EventEmitter,this.update=new e.EventEmitter,this.subscriptions=[],this.enableGrabNDrag=!1}return Object.defineProperty(t.prototype,"annoRect",{get:function(){return this._annoRect},set:function(t){this._annoRect=Object.assign({},t),this.height=+(t.height*this.zoom).toFixed(2),this.width=+(t.width*this.zoom).toFixed(2),this.left=+(t.x*this.zoom).toFixed(2),this.top=+(t.y*this.zoom).toFixed(2)},enumerable:!1,configurable:!0}),t.prototype.ngOnChanges=function(t){t.rotate&&this.adjustForRotation(this.rotate)},t.prototype.ngAfterViewInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.grabNDrag.subscribe((function(e){return t.enableGrabNDrag=e})))},t.prototype.ngOnDestroy=function(){this.subscriptions.filter((function(t){return!t.closed})).forEach((function(t){return t.unsubscribe()}))},Object.defineProperty(t.prototype,"selected",{get:function(){return this._selected},set:function(t){this._selected=t,this._selected&&this.viewRect&&this.viewRect.nativeElement.focus()},enumerable:!1,configurable:!0}),t.prototype.onClick=function(){this.select.emit(this.annoRect)},t.prototype.onUpdate=function(t){var e=t.offsetHeight,n=t.offsetWidth,o=t.offsetTop,i=t.offsetLeft;if(this.hasRectangleChanged(t)){var a=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,e,n,o,i,this.rotate,this.zoom);a=Object.assign(Object.assign({},this.annoRect),a),this.update.emit(Object.assign({},a))}},t.prototype.adjustForRotation=function(t){var e=this,n=e.top,o=e.left,i=e.height,a=e.width;switch(t){case 90:this.width=i,this.height=a,this.left=this.pageWidth-n-i,this.top=o;break;case 180:this.left=this.pageWidth-o-a,this.top=this.pageHeight-n-i;break;case 270:this.width=i,this.height=a,this.left=n,this.top=this.pageHeight-o-a}},t.prototype.hasRectangleChanged=function(t){return this.left!==t.offsetLeft||this.top!==t.offsetTop||this.width!==t.offsetWidth||this.height!==t.offsetHeight},t}();Ii.decorators=[{type:e.Component,args:[{selector:"mv-anno-rectangle",template:'<div *ngIf="editable; else nonEditable">\n <div #rectElement\n class="rectangle"\n draggable\n resizable\n [tabindex]="annoRect.id"\n [ngClass]="{ \'selected\': selected, \'grabNDrag\': enableGrabNDrag }"\n [style.backgroundColor]="\'#\' + color"\n [style.width]="width + \'px\'"\n [style.height]="height + \'px\'"\n [style.left]="left + \'px\'"\n [style.top]="top + \'px\'"\n [rotate]="0"\n [selected]="selected"\n (click)="onClick()"\n (stopped)="onUpdate(rectElement)">\n </div>\n</div>\n<ng-template #nonEditable>\n <div #rectElement\n class="rectangle"\n [tabindex]="annoRect.id"\n [ngClass]="{ \'selected\': selected }"\n [style.backgroundColor]="\'#\' + color"\n [style.width]="width + \'px\'"\n [style.height]="height+ \'px\'"\n [style.left]="left + \'px\'"\n [style.top]="top + \'px\'"\n (click)="onClick()">\n </div>\n</ng-template>\n'}]}],Ii.ctorParameters=function(){return[{type:X},{type:Ci}]},Ii.propDecorators={color:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],editable:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}],select:[{type:e.Output}],update:[{type:e.Output}],viewRect:[{type:e.ViewChild,args:["rectElement",{static:!1}]}],annoRect:[{type:e.Input}],selected:[{type:e.Input}]};var Oi=function(){function t(t){this.http=t,this.snakeCase=function(t){return t.replace(/ +/g," ").split(/ |\B(?=[A-Z])/).map((function(t){return t.toLowerCase()})).join("_")}}return t.prototype.getAllTags=function(t){var e="/em-anno/tags/"+t;return this.http.get(e)},t.prototype.getNewTags=function(t){return this.tagItems?this.tagItems[t]:[]},t.prototype.updateTagItems=function(t,e){var n,o=this,i=t.map((function(t){return Object.assign(Object.assign({},t),{name:o.snakeCase(t.name)})}));this.tagItems=Object.assign(Object.assign({},this.tagItems),((n={})[e]=i,n))},t}();Oi.decorators=[{type:e.Injectable}],Oi.ctorParameters=function(){return[{type:i.HttpClient}]};var Pi=function(){function t(t,n,o){this.store=t,this.commentService=n,this.tagsServices=o,this.CHAR_LIMIT=5e3,this.totalPrevPagesHeight=0,this.hasUnsavedChanges=!1,this.commentClick=new e.EventEmitter,this.renderComments=new e.EventEmitter,this.delete=new e.EventEmitter,this.updated=new e.EventEmitter,this.changes=new e.EventEmitter,this.rotate=0,this.zoom=1}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions=this.store.select(Ko).pipe(s.distinctUntilChanged()).subscribe((function(e){return t.searchString=e})),this.reRenderComments()},t.prototype.ngAfterContentInit=function(){this.tagItems&&this.tagItems.length&&this.tagsServices.updateTagItems(this.tagItems,this._comment.annotationId)},t.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe()},Object.defineProperty(t.prototype,"comment",{get:function(){return this._comment},set:function(t){this._comment=Object.assign({},t),this.page=this._comment.page,this.lastUpdate=t.lastModifiedDate?t.lastModifiedDate:t.createdDate,this.author=t.createdByDetails,this.createdBy=t.createdBy,this.editor=t.lastModifiedByDetails,this.originalComment=t.content,this.fullComment=this.originalComment,this.selected=this._comment.selected,this._editable=this._comment.editable,this.tagItems=this._comment.tags;this.totalPrevPagesHeight=0;for(var e=0;e<this.page-1;e++){var n=this._comment.pages[e+1]?this._comment.pages[e+1].styles.height:void 0;n&&(this.totalPrevPagesHeight+=n+10)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"annotation",{set:function(t){this._rectangle=t.rectangles.reduce((function(t,e){return t.y<e.y?t:e}));var e=this._comment.pages[this.page].styles.height/this.zoom;switch(this.rotate){case 90:this.rectTop=this._rectangle.x;break;case 180:this.rectTop=e-(this._rectangle.y+this._rectangle.height);break;case 270:this.rectTop=e-(this._rectangle.x+this._rectangle.width);break;default:this.rectTop=this._rectangle.y}this.rectLeft=this._rectangle.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"editable",{get:function(){return this._editable},enumerable:!1,configurable:!0}),t.prototype.onCommentChange=function(t){this.hasUnsavedChanges=this.originalComment.substring(0,this.CHAR_LIMIT)!==t.substring(0,this.CHAR_LIMIT),this.commentService.onCommentChange(this.hasUnsavedChanges)},t.prototype.deleteOrCancel=function(){this.editable?(this.hasUnsavedChanges=!1,this._editable=!1,this.fullComment=this.originalComment,this.changes.emit(!1),this.author||this.fullComment||this.delete.emit(this._comment)):this.delete.emit(this._comment)},t.prototype.editOrSave=function(){if(this.editable){this._comment.content=this.fullComment.substring(0,this.CHAR_LIMIT);var t=this.tagsServices.getNewTags(this._comment.annotationId),e={comment:this._comment,tags:t};this.updated.emit(e),this.hasUnsavedChanges=!1,this._editable=!1,this.changes.emit(!1)}else this._editable=!0},t.prototype.onCommentClick=function(){this.selected||(this.selected=!0,this._editable=!1,this.commentClick.emit({annotationId:this._comment.annotationId,editable:this._editable,selected:!0}))},t.prototype.reRenderComments=function(){this.renderComments.emit(this._comment)},Object.defineProperty(t.prototype,"commentTop",{get:function(){return this.totalPrevPagesHeight+this.rectTop*this.zoom},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.form.nativeElement.getBoundingClientRect().height/this.zoom},enumerable:!1,configurable:!0}),t}();Pi.decorators=[{type:e.Component,args:[{selector:"mv-anno-comment",template:'<div #form (click)="onCommentClick()" class="aui-comment"\n [style.top.px]="commentTop"\n [style.zIndex]="selected ? 100 : 0">\n <div id="detailsWrapper {{index}}" class="aui-comment__header">\n <span *ngIf="author && !editor" class="aui-comment__author">\n {{ author.forename }} {{ author.surname }}\n </span>\n <span *ngIf="editor" class="aui-comment__author">\n {{ editor.forename }} {{ editor.surname }}\n </span>\n <time [hidden]="!selected && !this.editable" class="aui-comment__meta">\n {{ lastUpdate | momentDate: \'d MMMM y h:mm a\' }}\n </time>\n </div>\n <mv-tags\n [tagItems]="tagItems"\n [userId]="createdBy"\n [editable]="editable"\n [annoId]="_comment.annotationId">\n </mv-tags>\n <textarea *ngIf="selected && editable"\n #editableComment\n mvTextAreaAutoExpand\n type="text"\n required\n name="content"\n [maxlength]="CHAR_LIMIT"\n class="aui-comment__content form-control mimic-focus edit-mode expanded"\n [(ngModel)]="fullComment"\n (ngModelChange)="reRenderComments(); onCommentChange($event);"\n aria-label="comment">\n </textarea>\n <p *ngIf="!editable"\n mvTextHighlight class="commentText" [textToHighlight]="searchString">\n {{ fullComment }}\n </p>\n <div *ngIf="selected || this.editable || (!fullComment.length && (tagItems && !tagItems.length))"\n class="aui-comment__footer commentBtns">\n <button class="govuk-button"\n type="button" role="button"\n (click)="editOrSave()">\n {{ !editable ? \'Edit\' : \'Save\' }}\n </button>\n <button type="button" role="button"\n class="govuk-button govuk-button--secondary"\n (click)="deleteOrCancel()">\n {{ !editable ? \'Delete\' : \'Cancel\' }}\n </button>\n </div>\n <span class="aui-comment__private">private</span>\n</div>\n'}]}],Pi.ctorParameters=function(){return[{type:r.Store},{type:jo},{type:Oi}]},Pi.propDecorators={commentClick:[{type:e.Output}],renderComments:[{type:e.Output}],delete:[{type:e.Output}],updated:[{type:e.Output}],changes:[{type:e.Output}],rotate:[{type:e.Input}],zoom:[{type:e.Input}],index:[{type:e.Input}],page:[{type:e.Input}],form:[{type:e.ViewChild,args:["form",{static:!1}]}],editableComment:[{type:e.ViewChild,args:["editableComment",{static:!1}]}],comment:[{type:e.Input}],annotation:[{type:e.Input}]};var xi=function(){function t(){this.createHighlightEvent=new e.EventEmitter,this.deleteHighlightEvent=new e.EventEmitter,this.addOrEditCommentEvent=new e.EventEmitter,this.createBookmarkEvent=new e.EventEmitter,this.defaultHeight=70,this.defaultWidth=300}return t.prototype.ngOnChanges=function(t){this.setRectangle(),this.top=this.popupTop(),this.left=this.popupLeft()},Object.defineProperty(t.prototype,"rectangles",{get:function(){return this._rectangles},set:function(t){t&&(this._rectangles=t,this.setRectangle())},enumerable:!1,configurable:!0}),t.prototype.createHighlight=function(){this.createHighlightEvent.emit(),this.rectangle=void 0},t.prototype.deleteHighlight=function(){this.deleteHighlightEvent.emit()},t.prototype.addOrEditComment=function(){this.addOrEditCommentEvent.emit(),setTimeout((function(){location.hash||document.getElementById("viewerContainer").scrollBy(0,1)}),10)},t.prototype.createBookmark=function(){this.createBookmarkEvent.emit(this.rectangle),this.rectangle=void 0},t.prototype.setRectangle=function(){var t=this.rectangles.reduce((function(t,e){return t.y<e.y?t:e}));switch(this.rectangle=Object.assign({},t),this.rotate){case 90:this.rectangle.width=t.height,this.rectangle.height=t.width,this.rectangle.x=this.pageWidth/this.zoom-t.y-t.height,this.rectangle.y=t.x;break;case 180:this.rectangle.x=this.pageWidth/this.zoom-t.x-t.width,this.rectangle.y=this.pageHeight/this.zoom-t.y-t.height;break;case 270:this.rectangle.width=t.height,this.rectangle.height=t.width,this.rectangle.x=t.y,this.rectangle.y=this.pageHeight/this.zoom-t.x-t.width}},t.prototype.popupTop=function(){var t=this.rectangle.y*this.zoom-this.defaultHeight;return t<=0?this.defaultHeight:t},t.prototype.popupLeft=function(){var t=(this.rectangle.x+this.rectangle.width/2)*this.zoom-this.defaultWidth/2;return t<=0?0:t>=this.pageWidth-this.defaultWidth?this.pageWidth-this.defaultWidth:t},t}();xi.decorators=[{type:e.Component,args:[{selector:"mv-ctx-toolbar",template:'<div class="toolbar" *ngIf="rectangle"\n [style.top.px]="top"\n [style.left.px]="left">\n <button *ngIf="canHighlight"\n type="button" title="Highlight"\n class="aui__toolbar-button aui__toolbar-button--comments contextual-btn leftButton aui__toolbar-button-highlight"\n (mousedown)="createHighlight()">\n <span>Highlight</span>\n </button>\n <button *ngIf="canDelete"\n type="button" title="Delete"\n class="aui__toolbar-button aui__toolbar-button--comments contextual-btn leftButton"\n (mousedown)="deleteHighlight()">\n <span>Remove</span>\n </button>\n <button *ngIf="canComment"\n type="button" title="Comment"\n class="aui__toolbar-button aui__toolbar-button--comments contextual-btn rightButton aui__toolbar-button-comment"\n (mousedown)="addOrEditComment()">\n <span>Comment</span></button>\n <button *ngIf="canBookmark"\n type="button" title="Bookmark"\n class="aui__toolbar-button aui__toolbar-button--comments contextual-btn rightButton aui__toolbar-button-bookmark"\n id="bookmarkButton"\n (mousedown)="createBookmark()">\n <span>Bookmark</span></button>\n <div class="arrow-down">\n <div class="inner-triangle"></div>\n </div>\n</div>\n'}]}],xi.ctorParameters=function(){return[]},xi.propDecorators={zoom:[{type:e.Input}],rotate:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}],canHighlight:[{type:e.Input}],canBookmark:[{type:e.Input}],canComment:[{type:e.Input}],canDelete:[{type:e.Input}],createHighlightEvent:[{type:e.Output}],deleteHighlightEvent:[{type:e.Output}],addOrEditCommentEvent:[{type:e.Output}],createBookmarkEvent:[{type:e.Output}],rectangles:[{type:e.Input}]};var ji=function(){function t(){}return t.prototype.redrawComponents=function(t,e,n,o){var i,a=this;this.sortComponents(t,e,n,o).forEach((function(t){a.adjustIfOverlapping(t,i,o),i=t}))},t.prototype.sortComponents=function(t,e,n,o){var i=this;return t.sort((function(t,a){return t.rectTop=i.top(t._rectangle,e[t.page-1],n,o),a.rectTop=i.top(a._rectangle,e[a.page-1],n,o),i.processSort(t,a)}))},t.prototype.adjustIfOverlapping=function(t,e,n){if(e){var o=e.commentTop+this.height(e);t.commentTop<=o&&(t.rectTop=(o-t.totalPrevPagesHeight)/n)}},t.prototype.processSort=function(t,e){return this.onSameLine(t,e)?t.rectLeft>=e.rectLeft?1:-1:t.commentTop>=e.commentTop?1:-1},t.prototype.onSameLine=function(t,e){return 0===this.difference(t.commentTop,e.commentTop)},t.prototype.top=function(t,e,n,o){var i=e/o;switch(n){case 90:return t.x;case 180:return i-(t.y+t.height);case 270:return i-(t.x+t.width);default:return t.y}},t.prototype.height=function(t){return t.form.nativeElement.getBoundingClientRect().height},t.prototype.difference=function(t,e){return Math.abs(t-e)},t}();ji.decorators=[{type:e.Injectable}];var Ti=function(){function t(t,e,n,o){this.store=t,this.commentService=e,this.renderService=n,this.toolbarEvents=o,this.pageHeights=[],this.subscriptions=[],this.clearSelection()}return t.prototype.ngOnInit=function(){var t=this;this.comments$=this.store.pipe(r.select(oi)),this.annoEntities$=this.store.pipe(r.select(Ho)),this.subscriptions.push(this.toolbarEvents.commentsPanelVisible.subscribe((function(e){t.redrawComments(),t.showCommentsPanel=e}))),this.subscriptions.push(this.toolbarEvents.rotateSubject.subscribe((function(e){return t.rotateDocument()})))},t.prototype.ngOnChanges=function(t){t.annotationSet&&this.commentService.setCommentSet(this),t.contentScrollTop&&this.container&&this.container.nativeElement.scrollTo(0,this.contentScrollTop)},t.prototype.ngOnDestroy=function(){this.subscriptions.length>0&&this.subscriptions.forEach((function(t){return t.unsubscribe()}))},t.prototype.onSelect=function(t){this.store.dispatch(new Ce(t))},t.prototype.onCommentDelete=function(t){var e=this.annotationSet.annotations.find((function(e){return e.id===t.annotationId})),n=Object.assign(Object.assign({},e),{comments:[]});this.onAnnotationUpdate(n),this.redrawComments()},t.prototype.redrawComments=function(){var t=this;setTimeout((function(){var e=t.commentComponents.map((function(t){return t}));t.renderService.redrawComponents(e,t.pageHeights,t.rotate,t.zoom)}),0)},t.prototype.rotateDocument=function(){this.panel&&(this.panel.nativeElement.style.height="0")},t.prototype.onCommentUpdate=function(t){var e=this.annotationSet.annotations.find((function(e){return e.id===t.comment.annotationId})),n=[t.comment],o=t.tags,i=Object.assign(Object.assign({},e),{comments:n,tags:o});this.onAnnotationUpdate(i)},t.prototype.onAnnotationUpdate=function(t){this.store.dispatch(new fe(t))},t.prototype.onContainerClick=function(t){t.path&&t.path[0]===this.panel.nativeElement&&this.clearSelection()},t.prototype.clearSelection=function(){this.store.dispatch(new Ce({annotationId:"",editable:!1,selected:!1}))},t.prototype.allCommentsSaved=function(){this.commentService.allCommentsSaved()},t}();Ti.decorators=[{type:e.Component,args:[{selector:"mv-comment-set",template:'<div #container [ngClass]="{\'comments\': showCommentsPanel}">\n <div #panel [ngClass]="{ \'comments-panel comment-container\': true, \'expanded\': showCommentsPanel }"\n [style.height.px]="height"\n (click)="onContainerClick($event)">\n <ng-container *ngFor="let comment of (comments$ | async); let i = index;">\n <mv-anno-comment\n [ngStyle]="showCommentsPanel ? {} : {\'display\':\'none\'}"\n #commentComponent\n (commentClick)="onSelect($event)"\n (delete)="onCommentDelete($event)"\n (updated)="onCommentUpdate($event)"\n (changes)="allCommentsSaved()"\n [zoom]="zoom"\n [rotate]="rotate"\n [index]="i"\n [page]="comment.page"\n [comment]="comment"\n [annotation]="(annoEntities$ | async)[comment.annotationId]"\n (renderComments)="redrawComments()">\n </mv-anno-comment>\n </ng-container>\n </div>\n</div>\n'}]}],Ti.ctorParameters=function(){return[{type:r.Store},{type:jo},{type:ji},{type:X}]},Ti.propDecorators={annotationSet:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],height:[{type:e.Input}],pageHeights:[{type:e.Input}],contentScrollTop:[{type:e.Input}],container:[{type:e.ViewChild,args:["container",{static:!1}]}],panel:[{type:e.ViewChild,args:["panel",{static:!1}]}],commentComponents:[{type:e.ViewChildren,args:["commentComponent"]}]};var _i=function(){function t(t){this.el=t}return t.prototype.ngAfterContentChecked=function(){this.adjustHeight()},t.prototype.onMouseDown=function(){this.adjustHeight()},t.prototype.adjustHeight=function(){var t=this.el.nativeElement;t.style.overflow="hidden",t.style.height="auto",t.style.height=t.scrollHeight-5+"px"},t}();_i.decorators=[{type:e.Directive,args:[{selector:"[mvTextAreaAutoExpand]"}]}],_i.ctorParameters=function(){return[{type:e.ElementRef}]},_i.propDecorators={onMouseDown:[{type:e.HostListener,args:["input"]}]};var Di=function(){function t(t,e,n,o){this.store=t,this.printService=e,this.toolbarEvents=n,this.fb=o,this.showFilters=!1,this.hasFilter=!1}return t.prototype.ngOnInit=function(){this.filtersFg=this.fb.group({dateRangeFrom:new o.FormGroup({day:new o.FormControl(""),month:new o.FormControl(""),year:new o.FormControl("")}),dateRangeTo:new o.FormGroup({day:new o.FormControl(""),month:new o.FormControl(""),year:new o.FormControl("")}),tagFilters:this.fb.group({})}),this.comments$=this.store.pipe(r.select(ai)),this.buildCheckBoxForm(),this.container.nativeElement.focus()},t.prototype.buildCheckBoxForm=function(){var t=this;this.filtersFg.reset();var e=this.filtersFg.get("tagFilters"),n=this.store.pipe(r.select(Qo));this.allTags$=this.store.pipe(r.select(Fo)),this.$subscriptions=a.combineLatest([this.allTags$,n]).subscribe((function(n){var i=F(n,2),a=i[0],s=i[1];t.hasFilter=s.hasFilter,a.forEach((function(t){var n=!(!s.filters.tagFilters||!s.filters.tagFilters.hasOwnProperty(t.key))&&s.filters.tagFilters[t.key];e.addControl(t.key,new o.FormControl(n))})),t.filtersFg.updateValueAndValidity()}))},t.prototype.onClearFilters=function(){this.store.dispatch(new Pe),this.buildCheckBoxForm()},t.prototype.onFilter=function(){var t=this.filtersFg.value,e=t.dateRangeFrom.year&&t.dateRangeFrom.month&&t.dateRangeFrom.day,n=t.dateRangeTo.year&&t.dateRangeTo.month&&t.dateRangeTo.day,o=e?new Date(t.dateRangeFrom.year,t.dateRangeFrom.month-1,t.dateRangeFrom.day).getTime():null,i=n?new Date(t.dateRangeTo.year,t.dateRangeTo.month-1,t.dateRangeTo.day).getTime():null;this.store.dispatch(new Oe(Object.assign(Object.assign({},t),{dateRangeFrom:o,dateRangeTo:i})))},t.prototype.onFiltersToggle=function(){this.showFilters=!this.showFilters},t.prototype.onClose=function(){this.toolbarEvents.toggleCommentsSummary(!1)},t.prototype.onPrint=function(){this.printService.printElementNatively(this.commentsTable.nativeElement,1e3,900)},t.prototype.navigateToPage=function(t){"pdf"===this.contentType&&this.toolbarEvents.setPage(t),this.toolbarEvents.toggleCommentsSummary(!1),this.toolbarEvents.toggleCommentsPanel(!0)},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t}();Di.decorators=[{type:e.Component,args:[{selector:"mv-comments-summary",template:'<div id="modal-background" class="modal" (click)="onClose()">\n <div #outerContainer id="modal" class="modal-content govuk-width-container clearfix" (click)="$event.stopPropagation()" cdkTrapFocus tabindex="0">\n <div id="comment-container" class="comment-container" #commentContainer>\n <h2 class="govuk-heading-m">{{ title }}</h2>\n <ng-container *ngIf="(comments$ | async) as comments">\n <ng-container *ngIf="comments.length">\n <button type="submit" class="govuk-button govuk-!-margin-right-1" (click)="onFiltersToggle()">\n {{ !showFilters ? \'Show Filters\' : \'Hide Filters\'}}\n </button>\n <button type="submit" class="govuk-button govuk-button--secondary" (click)="onClearFilters()" *ngIf="hasFilter">\n Clear Filters\n </button>\n <ng-container *ngIf="showFilters">\n <form [formGroup]="filtersFg" (ngSubmit)="onFilter()" >\n <div class="dates">\n <div class="dates__from">\n <mv-gov-uk-date\n [config]="{id: \'dateRangeFrom\', legend: \'From\'}"\n [formGroup]="filtersFg.controls[\'dateRangeFrom\']"\n [errorMessage]="\'test\'"\n ></mv-gov-uk-date>\n </div>\n <div class="dates__to">\n <mv-gov-uk-date\n [config]="{id: \'dateRangeTo\', legend: \'To\'}"\n [formGroup]="filtersFg.controls[\'dateRangeTo\']"\n [errorMessage]="\'test\'"\n ></mv-gov-uk-date>\n </div>\n <div class="dates__tags">\n <mv-gov-uk-fieldset\n [config]="{legend: \'Tags\', classes: \'govuk-label--m\', id: \'filters\'}"\n [isHeading]="false">\n <div class="govuk-checkboxes--scroll" [formGroup]="filtersFg.controls[\'tagFilters\']">\n <div class="govuk-checkboxes govuk-checkboxes--small">\n <div class="govuk-checkboxes__item" *ngFor="let item of (allTags$ | async)">\n <input [formControlName]="item.key" class="govuk-checkboxes__input" [value]="false" type="checkbox">\n <label class="govuk-label govuk-checkboxes__label">\n {{ item.key | unsnake}} ({{item.length}})\n </label>\n </div>\n </div>\n </div>\n </mv-gov-uk-fieldset>\n </div>\n <div class="dates__cta">\n <button type="submit" class="govuk-button">\n Filter comments\n </button>\n </div>\n </div>\n </form>\n </ng-container>\n <ng-container *ngIf="comments[0]">\n <ngx-datatable\n [rows]="comments"\n rowHeight="auto"\n headerHeight="auto"\n [columnMode]="\'flex\'"\n [sorts]="[{ prop: \'date\', dir: \'desc\' }]">\n <ngx-datatable-column name="User" [flexGrow]="1" [sortable]="false"></ngx-datatable-column>\n <ngx-datatable-column name="Page" [flexGrow]="1">\n <ng-template ngx-datatable-cell-template let-value="value">\n <a [routerLink]="" class="comment-summary_pages" (click)="navigateToPage(value)">{{value}}</a>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column name="Date" [flexGrow]="1"></ngx-datatable-column>\n <ngx-datatable-column name="Comment" [flexGrow]="3" [sortable]="false"></ngx-datatable-column>\n <ngx-datatable-column name="Tags" [flexGrow]="1" [sortable]="false">\n <ng-template ngx-datatable-cell-template let-value="value">\n <span class="hmcts-badge" *ngFor="let tag of value">{{tag.label}}</span>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </ng-container>\n </ng-container>\n <ng-container *ngIf="!comments[0]">\n <h3 class="govuk-heading-s" >No comments available. Select text to add a highlight or comment.</h3>\n </ng-container>\n </ng-container>\n </div>\n\n <div class="button-container">\n <button (click)="onPrint()" class="govuk-button govuk-button--secondary">Print</button>\n <button id="modal-close-button" (click)="onClose()" class="govuk-button">Close</button>\n </div>\n </div>\n</div>\n'}]}],Di.ctorParameters=function(){return[{type:r.Store},{type:tt},{type:X},{type:o.FormBuilder}]},Di.propDecorators={title:[{type:e.Input}],contentType:[{type:e.Input}],container:[{type:e.ViewChild,args:["outerContainer",{static:!0}]}],commentsTable:[{type:e.ViewChild,args:["commentContainer",{static:!1}]}]};var Ri=function(){function t(t,n){this.toolbarEvents=t,this.highlightService=n,this.saveSelection=new e.EventEmitter,this.drawStartX=-1,this.drawStartY=-1,this.backgroundColor="none",this.subscriptions=[]}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions=[this.toolbarEvents.drawModeSubject.subscribe((function(e){t.defaultHeight=e?"100%":"0px",t.defaultWidth=e?"100%":"0px"})),this.toolbarEvents.redactWholePage.subscribe((function(){t.wholePage=!0}))]},t.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(t){t.unsubscribe()}))},t.prototype.initHighlight=function(t){var e=t.offsetX,n=t.offsetY;if(this.wholePage)this.highlightPage();else switch(this.position="absolute",this.backgroundColor="yellow",this.drawStartX=e,this.drawStartY=n,this.display="block",this.height=50,this.width=50,this.top=this.drawStartY,this.left=this.drawStartX,this.rotate){case 90:this.top=this.drawStartY-this.height;break;case 180:this.top=this.drawStartY-this.height,this.left=this.drawStartX-this.width;break;case 270:this.left=this.drawStartX-this.width}},t.prototype.updateHighlight=function(t){var e=t.currentTarget,n=t.clientX,o=t.clientY,i=e.getBoundingClientRect(),a=n-i.left,s=o-i.top;this.drawStartX>0&&this.drawStartY>0&&(this.height=Math.abs(s-this.drawStartY),this.width=Math.abs(a-this.drawStartX),this.top=Math.min(s,this.drawStartY),this.left=Math.min(a,this.drawStartX))},t.prototype.createHighlight=function(){if(this.height/this.zoom>5||this.width/this.zoom>5){var t=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,this.height,this.width,this.top,this.left,this.rotate,this.zoom);t=Object.assign({id:_.default()},t),this.saveSelection.emit({rectangles:[t],page:this.page}),this.resetHighlight()}},t.prototype.resetHighlight=function(){this.drawStartX=-1,this.drawStartY=-1,this.display="none",this.width=0,this.height=0,this.wholePage=!1},t.prototype.highlightPage=function(){this.height=this.pageHeight,this.width=this.pageWidth,this.top=0,this.left=0,this.createHighlight()},t}();Ri.decorators=[{type:e.Component,args:[{selector:"mv-box-highlight-create",template:'<div [style.height]="defaultHeight"\n [style.width]="defaultWidth"\n (mousedown)="initHighlight($event)"\n (mousemove)="updateHighlight($event)"\n (mouseup)="createHighlight()">\n <div #boxHighlight\n class="box-highlight"\n [style.display]="display"\n [style.position]="position"\n [style.background-color]="backgroundColor"\n [style.height]="height ? height + \'px\' : \'100%\'"\n [style.width]="width ? width + \'px\' : \'100%\'"\n [style.top]="top + \'px\'"\n [style.left]="left + \'px\'">\n </div>\n</div>\n'}]}],Ri.ctorParameters=function(){return[{type:X},{type:Ci}]},Ri.propDecorators={page:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}],rotate:[{type:e.Input}],zoom:[{type:e.Input}],container:[{type:e.Input}],saveSelection:[{type:e.Output}],highlight:[{type:e.ViewChild,args:["boxHighlight",{static:!1}]}]};var Bi=function(){function t(t,n){this.store=t,this.toolbarEvents=n,this.showCommentSummaryDialog=new e.EventEmitter,this.tabs=[],this.tabSelected=""}return t.prototype.ngOnInit=function(){var t=this,e=this.store.pipe(r.select(No)),n=this.store.pipe(r.select(ri));this.$subscriptions=a.combineLatest([e,n]).subscribe((function(e){var n=F(e,2),o=n[0],i=n[1];t.navigationList=i,t.tabs=t.navigationList.length>0?[{label:"comments"},{label:"filter"},{label:"search"}]:[{label:"comments"}],t.isFiltered=!o.length,t.tabs=L(t.tabs).map((function(e){return t.isFiltered||"filter"!==e.label?Object.assign(Object.assign({},e),{isFiltered:!1}):Object.assign(Object.assign({},e),{isFiltered:!0})}))}))},t.prototype.toggleCommentsSummary=function(){this.showCommentSummaryDialog.emit()},t.prototype.selectTab=function(t){this.tabSelected=t!==this.tabSelected?t:void 0},t.prototype.toggleCommentsPanel=function(){this.toolbarEvents.toggleCommentsPanel(!this.toolbarEvents.commentsPanelVisible.getValue())},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t}();Bi.decorators=[{type:e.Component,args:[{selector:"mv-comment-set-header",template:'<div class="govuk-tabs commentSummaryHeader" [ngClass]="{\'icp-mode\': toolbarEvents.icp.enabled | async}" data-module="govuk-tabs">\n <ul class="govuk-tabs__list">\n <li *ngFor="let tab of tabs; let i = index" class="govuk-tabs__list-item govuk-tabs__list-item"\n [ngClass]="{\'govuk-tabs__list-item--selected\': tabSelected === tab.label}">\n <a id="commentSubPane{{ i }}" (click)="selectTab(tab.label)" [routerLink]="" [ngClass]="{\'govuk-tabs__list-item--filtered\': tab.isFiltered}"\n class="govuk-tabs__tab">\n {{ tab.label | titlecase }}\n </a>\n </li>\n <li>\n <button id="mvCloseBtn" #mvCloseBtn class="mv-button commentSummaryHeader-button--close"\n title="Close Comments" (click)="toggleCommentsPanel()">\n </button>\n </li>\n </ul>\n <div class="govuk-tabs__panel" [hidden]="!tabSelected">\n <ng-container *ngIf="tabSelected === \'comments\'">\n <div style="width: 100%">\n <div class="hmcts-banner" *ngIf="navigationList?.length === 0">\n <svg class="hmcts-banner__icon" fill="currentColor" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" height="25" width="25">\n <path d="M13.7,18.5h-2.4v-2.4h2.4V18.5z M12.5,13.7c-0.7,0-1.2-0.5-1.2-1.2V7.7c0-0.7,0.5-1.2,1.2-1.2s1.2,0.5,1.2,1.2v4.8\nC13.7,13.2,13.2,13.7,12.5,13.7z M12.5,0.5c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S19.1,0.5,12.5,0.5z" /></svg>\n <div class="hmcts-banner__message">\n <span class="hmcts-banner__assistive">information</span>\n Select text to add a comment or highlight.\n </div>\n </div>\n <button type="button" class="govuk-button"\n id="commentSummary" tabindex="0"\n data-l10n-id="commentSummary"\n title="Open collate summary"\n (click)="toggleCommentsSummary()">Collate comments</button>\n </div>\n <ng-container *ngIf="navigationList?.length > 0">\n <mv-comments-navigate\n [annotationList]="navigationList">\n </mv-comments-navigate>\n </ng-container>\n <p class="aui-comment__private-text">\n <span class="aui-comment__private">private</span>\n All comments can only be seen by you\n </p>\n </ng-container>\n <div [hidden]="tabSelected !== \'filter\'">\n <div class="govuk-tabs__panel--container">\n <mv-comment-filter></mv-comment-filter>\n <mv-comments-navigate\n *ngIf="navigationList?.length > 0"\n [annotationList]="navigationList">\n </mv-comments-navigate>\n </div>\n </div>\n\n <div [hidden]="tabSelected !== \'search\'">\n <mv-comment-search [annotations]="navigationList"></mv-comment-search>\n </div>\n </div>\n</div>\n',encapsulation:e.ViewEncapsulation.None}]}],Bi.ctorParameters=function(){return[{type:r.Store},{type:X}]},Bi.propDecorators={showCommentSummary:[{type:e.Input}],showCommentSummaryDialog:[{type:e.Output}]};var Ni=function(){function t(t){this.store=t,this.searchResults=[],this.searchIndex=0}return t.prototype.ngAfterViewInit=function(){this.searchInput&&this.searchInput.nativeElement.focus()},t.prototype.ngOnDestroy=function(){var t=this;setTimeout((function(){t.store.dispatch(new Ie(""))}),250)},t.prototype.searchComments=function(t){var e=this;this.clearSearch(),t.length>2&&(this.searchString=t,this.searchResults=this.annotations.filter((function(t){return t.comments.length>0})).filter((function(t){return t.comments[0].content.toLowerCase().includes(e.searchString.toLowerCase())})),this.searchResults.length>0&&this.store.dispatch(new Ie(t)))},t.prototype.clearSearch=function(){this.searchString=void 0,this.searchResults=[],this.searchIndex=0,this.store.dispatch(new Ie(""))},t}();Ni.decorators=[{type:e.Component,args:[{selector:"mv-comment-search",template:'<input #searchInput type="text"\n class="govuk-input comment-search__item"\n id="search-comments-input" name="searchString"\n aria-label="search comments input" [ngModel]="searchString">\n<button type="button"\n [class.govuk-button--disabled]="searchInput?.value.length <= 2"\n class="govuk-button comment-search__item"\n (click)="searchComments(searchInput.value.trim())">Search</button>\n<ng-container *ngIf="searchResults.length > 0">\n <mv-comments-navigate [annotationList]="searchResults"></mv-comments-navigate>\n</ng-container>\n<ng-container *ngIf="searchString && searchResults?.length == 0">\n <p class="comment-search__item">\n No matches have been found\n </p>\n</ng-container>\n',encapsulation:e.ViewEncapsulation.None}]}],Ni.ctorParameters=function(){return[{type:r.Store}]},Ni.propDecorators={annotations:[{type:e.Input}],searchInput:[{type:e.ViewChild,args:["searchInput",{static:!1}]}]};var Mi=function(){function t(t){this.element=t}return t.prototype.ngAfterViewChecked=function(){this.textToHighlight&&this.highlightInputText(this.textToHighlight)},t.prototype.highlightInputText=function(t){this.resetHighlight(),this.textToHighlight=t;var e=new RegExp(t,"gi"),n=this.element.nativeElement;n.innerHTML.match(e)&&(n.innerHTML=n.innerHTML.replace(e,this.highlightPattern("$&"))),this.textToHighlight=void 0},t.prototype.resetHighlight=function(){for(var t=this.element.nativeElement,e=new RegExp(this.highlightPattern("(.*?)"),"gi");t.innerHTML.match(e);){var n=e.exec(t.innerHTML);n&&(t.innerHTML=t.innerHTML.replace(n[0],n[1]))}},t.prototype.highlightPattern=function(t){return'<span class="mvTextHighlight">'+t+"</span>"},t}();Mi.decorators=[{type:e.Directive,args:[{selector:"[mvTextHighlight]"}]}],Mi.ctorParameters=function(){return[{type:e.ElementRef}]},Mi.propDecorators={textToHighlight:[{type:e.Input}]};var Ai=function(){function t(t){var e=this;this.tagsServices=t,this.validators=[this.minLength,this.maxLength20],this.errorMessages={minLength:"Minimum of 2 characters",maxLength20:"Maximum of 20 characters"},this.requestAutocompleteItems=function(t){return e.tagsServices.getAllTags(e.userId)}}return t.prototype.onUpdateTags=function(t){this.tagsServices.updateTagItems(t,this.annoId)},t.prototype.minLength=function(t){return t.value.length<2?{minLength:!0}:null},t.prototype.maxLength20=function(t){return t.value.length>=20?{maxLength20:!0}:null},t}();Ai.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}]}],Ai.ctorParameters=function(){return[{type:Oi}]},Ai.propDecorators={tagItems:[{type:e.Input}],userId:[{type:e.Input}],editable:[{type:e.Input}],annoId:[{type:e.Input}]};var Fi=function(){function t(t,e){this.store=t,this.toolbarEvents=e,this.autoSelect=!1,this.navigationList=[],this.index=0}return t.prototype.ngOnChanges=function(t){t.annotationList&&this.initNavigationList()},t.prototype.initNavigationList=function(){var t=this;this.index=0,this.navigationList=L(this.annotationList||[]).map((function(e){return{content:e.comments[0].content,annotationId:e.id,page:e.page,rectangle:t.upperRectangle(e.rectangles)}})).sort(this.sortComments),this.autoSelect&&(this.toolbarEvents.setPage(Number.parseInt(this.navigationList[0].page,0)),this.store.dispatch(new Ce({annotationId:this.navigationList[0].annotationId,editable:!1,selected:!0})))},t.prototype.sortComments=function(t,e){if(t.page!==e.page)return t.page-e.page;var n=t.rectangle,o=e.rectangle;return n.y!==o.y?n.y-o.y:n.x-o.x},t.prototype.nextItem=function(){this.index+=1,this.index===this.annotationList.length&&(this.index=0),this.toolbarEvents.setPage(Number.parseInt(this.navigationList[this.index].page,0)),this.store.dispatch(new Ce({annotationId:this.navigationList[this.index].annotationId,editable:!1,selected:!0}))},t.prototype.prevItem=function(){this.index-=1,this.index<0&&(this.index=this.navigationList.length-1),this.toolbarEvents.setPage(Number.parseInt(this.navigationList[this.index].page,0)),this.store.dispatch(new Ce({annotationId:this.navigationList[this.index].annotationId,editable:!1,selected:!0}))},t.prototype.upperRectangle=function(t){return L(t).sort((function(t,e){return t.y-e.y})),{x:t[0].x,y:t[0].y}},t}();Fi.decorators=[{type:e.Component,args:[{selector:"mv-comments-navigate",template:'<p class="comment-search">\n <span class="comment-search__item">\n Showing {{ index + 1 }} of {{ navigationList.length }}\n </span>\n <a [routerLink]=""\n class="comment-search__item"\n title="Previous comment"\n (click)="prevItem()">Prev</a>\n <a [routerLink]=""\n class="comment-search__item"\n title="Next comment\'"\n (click)="nextItem()">Next</a>\n</p>\n',encapsulation:e.ViewEncapsulation.None}]}],Fi.ctorParameters=function(){return[{type:r.Store},{type:X}]},Fi.propDecorators={annotationList:[{type:e.Input}],autoSelect:[{type:e.Input}]};var Li=function(){function t(t,e){this.store=t,this.fb=e,this.isPreview=!1}return t.prototype.ngOnInit=function(){var t=this;this.tagGroup=this.fb.group({tagFilters:this.fb.group({})}),this.filter$=this.store.pipe(r.select(No)),this.$subscriptions=this.tagGroup.valueChanges.pipe(s.auditTime(5)).subscribe((function(e){var n=e.tagFilters;t.store.dispatch(new Bt(n))})),this.buildFrom()},t.prototype.buildFrom=function(){var t=this,e=this.tagGroup.get("tagFilters");this.allTags$=this.store.pipe(r.select(Fo)).pipe(s.tap((function(n){t.tagGroup.reset(),n.forEach((function(t){e.addControl(t.key,new o.FormControl(!1))}))})))},t.prototype.onClearFilters=function(){this.tagGroup.reset(),this.store.dispatch(new Nt)},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.prototype.onRemoveFilter=function(t){this.tagGroup.get("tagFilters").controls[t].setValue(!1)},t.prototype.onToggleFilterView=function(){this.isPreview=!this.isPreview},t}();Li.decorators=[{type:e.Component,args:[{selector:"mv-comment-filter",template:'<div class="comment-filter">\n <div class="hmcts-filter__content">\n <div class="hmcts-filter__toggle-filters">\n <p class="hmcts-filter__toggle-filters-link"\n [ngClass]="{\'govuk-accordion__section--expanded\': isPreview}"\n (click)="onToggleFilterView()"><strong >Filter options</strong><span class="govuk-accordion__icon"></span></p>\n </div>\n\n <ng-container *ngIf="(filter$ | async) as filters">\n <div class="hmcts-filter__selected-heading" *ngIf="filters.length">\n <div class="hmcts-filter__heading-action">\n <p><a (click)="onClearFilters()"\n class="govuk-link govuk-link--no-visited-state"\n [routerLink]="">Clear filters</a></p>\n </div>\n </div>\n\n <h4 class="govuk-heading-s govuk-!-margin-bottom-0" *ngIf="filters.length">Tag filters</h4>\n\n <ul class="hmcts-filter-tags" *ngIf="filters.length">\n <li *ngFor="let tagName of filters">\n <a class="hmcts-filter__tag" [routerLink]="" (click)="onRemoveFilter(tagName)">\n <span class="govuk-visually-hidden">Remove this filter</span>{{tagName | unsnake}}</a>\n </li>\n </ul>\n </ng-container >\n\n <div class="hmcts-filter__options" [ngClass]="{\'isVisible\': isPreview}">\n <div class="govuk-form-group">\n <label class="govuk-label govuk-label--s" for="keywords">\n Search Tags\n </label>\n <input class="govuk-input" id="keywords" name="keywords" type="text" [(ngModel)]="searchValue">\n </div>\n\n <div class="govuk-form-group">\n <div [formGroup]="tagGroup">\n <fieldset class="govuk-fieldset" formGroupName="tagFilters">\n <legend class="govuk-fieldset__legend govuk-fieldset__legend--s">\n Tags\n </legend>\n <div class="govuk-checkboxes--scroll">\n <div class="govuk-checkboxes govuk-checkboxes--small">\n <div class="govuk-checkboxes__item" *ngFor="let item of (allTags$ | async) | filter: searchValue: \'key\'">\n <input [formControlName]="item.key" [id]="item.key" class="govuk-checkboxes__input" [value]="false"\n [attr.aria-describedby]="item.key" type="checkbox">\n <label class="govuk-label govuk-checkboxes__label" [for]="item.key">\n {{ item.key | unsnake}} ({{item.length}})\n </label>\n </div>\n </div>\n </div>\n </fieldset>\n </div>\n </div>\n </div>\n\n\n </div>\n</div>\n',encapsulation:e.ViewEncapsulation.None}]}],Li.ctorParameters=function(){return[{type:r.Store},{type:o.FormBuilder}]};var $i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}D(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.transform=function(e,n,o){void 0===n&&(n="mediumDate"),void 0===o&&(o="Europe/London");var i=T.default(e).tz(o).format("Z");return t.prototype.transform.call(this,e,n,i)},e}(n.DatePipe);$i.decorators=[{type:e.Pipe,args:[{name:"momentDate"}]}];var Hi=function(){function t(t){this.httpClient=t,this.ANNOTATIONS_API="/em-anno"}return t.prototype.getBookmarks=function(t){return this.httpClient.get(this.ANNOTATIONS_API+"/"+t+"/bookmarks",{observe:"response",withCredentials:!0})},t.prototype.createBookmark=function(t){return this.httpClient.post(this.ANNOTATIONS_API+"/bookmarks",t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.updateBookmark=function(t){return this.httpClient.put(this.ANNOTATIONS_API+"/bookmarks",t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.updateMultipleBookmarks=function(t){return this.httpClient.put(this.ANNOTATIONS_API+"/bookmarks_multiple",t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.deleteBookmark=function(t){return this.httpClient.delete(this.ANNOTATIONS_API+"/bookmarks/"+t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.deleteMultipleBookmarks=function(t){return this.httpClient.request("DELETE",this.ANNOTATIONS_API+"/bookmarks_multiple",{body:t,observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t}();Hi.decorators=[{type:e.Injectable}],Hi.ctorParameters=function(){return[{type:i.HttpClient}]};var Vi=function(){function t(){}return t.prototype.transform=function(t,e,n){return t?e?t.filter((function(t){return!!t&&(t[n]?t[n].toLowerCase().includes(e.toLowerCase()):t.toLowerCase().includes(e.toLowerCase()))})):t:[]},t}();Vi.decorators=[{type:e.Pipe,args:[{name:"filter"}]}];var Ui=function(){function t(){}return t.prototype.transform=function(t){return t.split("_").join(" ")},t}();Ui.decorators=[{type:e.Pipe,args:[{name:"unsnake"}]}];var zi=function(){};zi.decorators=[{type:e.Component,args:[{selector:"mv-gov-uk-date",template:'<div class="govuk-form-group" [ngClass]="{\'govuk-form-group--error\': errorMessage?.isInvalid}" [formGroup]="formGroup">\n <mv-gov-uk-fieldset\n [config]="{legend: config.legend, classes: \'govuk-label--m\', id: config.id, hint: \' For example, 12 11 2007\'}"\n [isHeading]="false"\n [errorMessage]="errorMessage">\n <mv-gov-uk-error-message\n [config]="{id: \'passport\'}"\n *ngIf="errorMessage"\n [errorMessage]="errorMessage">\n </mv-gov-uk-error-message>\n\n <div class="govuk-date-input" [id]="config.id+\'-date\'">\n <div class="govuk-date-input__item">\n <div class="govuk-form-group">\n <mv-gov-label\n [config]="{label: \'Day\', name: config.id, id: config.id+\'-day\', classes: \'govuk-date-input__label\'}">\n </mv-gov-label>\n <input class="govuk-input govuk-date-input__input govuk-input--width-2"\n [ngClass]="{\'govuk-input--error\': errorMessage?.isInvalid}"\n [id]="config.id"\n [name]="config.id+\'-day\'" type="number" value="" pattern="[0-9]*"\n [formControlName]="\'day\'">\n </div>\n </div>\n <div class="govuk-date-input__item">\n <div class="govuk-form-group">\n <mv-gov-label\n [config]="{label: \'Month\', name: config.id+\'-month\', id: config.id+\'-month\', classes: \'govuk-date-input__label\'}">\n </mv-gov-label>\n <input class="govuk-input govuk-date-input__input govuk-input--width-2"\n [ngClass]="{\'govuk-input--error\': errorMessage?.isInvalid}"\n [id]="config.id+\'-month\'"\n [name]="config.id+\'-month\'" type="number" value="" pattern="[0-9]*"\n [formControlName]="\'month\'">\n </div>\n </div>\n <div class="govuk-date-input__item">\n <div class="govuk-form-group">\n <mv-gov-label\n [config]="{label: \'Year\', name: config.id+\'-year\', id: config.id+\'-year\', classes: \'govuk-date-input__label\'}">\n </mv-gov-label>\n <input class="govuk-input govuk-date-input__input govuk-input--width-4"\n [ngClass]="{\'govuk-input--error\': errorMessage?.isInvalid}"\n [id]="config.id+\'-year\'"\n [name]="config.id+\'-year\'" type="number" value="" pattern="[0-9]*"\n [formControlName]="\'year\'">\n </div>\n </div>\n </div>\n </mv-gov-uk-fieldset>\n</div>\n'}]}],zi.propDecorators={config:[{type:e.Input}],errorMessage:[{type:e.Input}],formGroup:[{type:e.Input}]};var Wi=function(){};Wi.decorators=[{type:e.Component,args:[{selector:" mv-gov-uk-error-message",template:'\n <span class="govuk-error-message" [id]="config.id + \'-error\'" *ngFor="let message of errorMessage?.messages">\n <span class="govuk-visually-hidden">Error:</span>{{message}}\n </span>\n '}]}],Wi.ctorParameters=function(){return[]},Wi.propDecorators={config:[{type:e.Input}],errorMessage:[{type:e.Input}]};var qi=function(){function t(){}return t.setDescribedBy=function(t,e){return t&&t&&t.isInvalid?e.hint?e.id+"-hint "+e.id+"-error":e.id+"-error":e.hint?e.id+"-hint":null},t}(),Gi=function(){function t(){}return t.prototype.setDescribedBy=function(){return qi.setDescribedBy(this.errorMessage,this.config)},t}();Gi.decorators=[{type:e.Component,args:[{selector:"mv-gov-uk-fieldset",template:'\n <fieldset class="govuk-fieldset" [attr.aria-describedby]="setDescribedBy()">\n <legend [class]="config.classes + \' govuk-fieldset__legend\'" *ngIf="!isHeading">\n {{config.legend}}\n </legend>\n\n <legend [class]="config.classes + \' govuk-fieldset__legend\'" *ngIf="isHeading">\n <h1>{{config.legend}}</h1>\n </legend>\n\n <span [id]="config.id+\'-hint\'" class="govuk-hint" *ngIf="config.hint">\n {{config.hint}}\n </span>\n <ng-content></ng-content>\n </fieldset>\n '}]}],Gi.propDecorators={config:[{type:e.Input}],isHeading:[{type:e.Input}],errorMessage:[{type:e.Input}]};var Zi=function(){};Zi.decorators=[{type:e.Component,args:[{selector:"mv-gov-label",template:'<h1 *ngIf="config.isPageHeading else noHeading">\n <label *ngIf="config.label" [class]="config.classes + \' govuk-label\'"\n [for]="config.id" [innerHTML]="config.label">\n </label>\n </h1>\n <ng-template #noHeading>\n <label *ngIf="config.label" [class]="config.classes + \' govuk-label\'"\n [for]="config.id" [innerHTML]="config.label">\n </label>\n </ng-template>\n '}]}],Zi.ctorParameters=function(){return[]},Zi.propDecorators={config:[{type:e.Input}]};var Ji=function(){};Ji.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,o.FormsModule,o.ReactiveFormsModule,n.CommonModule,g.RouterModule],declarations:[zi,Wi,Gi,Zi],exports:[zi,Wi,Gi,Zi]}]}];var Yi=r.createSelector(to,(function(t){return t.bookmarks})),Xi=r.createSelector(Yi,(function(t){return t.bookmarkPageEntities})),Ki=r.createSelector(Yi,(function(t){return t.bookmarkEntities})),Qi=r.createSelector(Ki,(function(t){return function(t){var e=JSON.parse(JSON.stringify(t));return fn(e),Object.keys(e).reduce((function(t,n){var o=e[n];if(o.parent){var i=e[o.parent];i.children||(i.children=[]),i.children[o.index]=o}else t[o.index]=o;return t}),[])}(t)})),ta=r.createSelector(Yi,(function(t){return t.editableBookmark})),ea=r.createSelector(Qi,oo,io,no,(function(t,e,n,o){return{pageNumber:n.pageNumber-1,xCoordinate:n.left,yCoordinate:o[n.pageNumber].styles.height-n.top*o[n.pageNumber].viewportScale,previous:t.length>0?t[t.length-1].id:void 0,documentId:e}})),na=r.createSelector(no,Xi,(function(t,e){if(t&&e){var n=[];return Object.keys(t).forEach((function(o){var i=Number(o)-1,a=e[i];n.push({bookmark:a||[],styles:t[o].styles})})),n}})),oa=function(){function t(t,e,n,o){this.store=t,this.highlightService=e,this.toolbarEvents=n,this.viewerEvents=o,this.pages=[],this.drawMode=!1}return t.prototype.ngOnInit=function(){var t=this;this.$subscriptions=this.store.pipe(r.select(no)).subscribe((function(e){return t.pages=Object.values(e)})),this.annoPages$=this.store.pipe(r.select(Jo)),this.$subscriptions.add(this.toolbarEvents.drawModeSubject.subscribe((function(e){return t.drawMode=e}))).add(this.viewerEvents.textHighlight.subscribe((function(e){return t.showContextToolbar(e)}))).add(this.viewerEvents.ctxToolbarCleared.subscribe((function(){return t.clearContextToolbar()})))},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.prototype.showContextToolbar=function(t){this.highlightPage=t.page,this.rectangles=t.rectangles,this.rectangles&&this.toolbarEvents.highlightModeSubject.next(!1)},t.prototype.clearContextToolbar=function(){this.rectangles=void 0},t.prototype.createHighlight=function(){this.highlightService.saveAnnotation(this.rectangles,this.highlightPage),this.highlightService.resetHighlight(),this.rectangles=void 0},t.prototype.createBookmark=function(t){var e=this;this.store.pipe(r.select(ea),s.take(1)).subscribe((function(n){var o=window.getSelection().toString();e.store.dispatch(new nn(Object.assign(Object.assign({},n),{name:o.length>0?o.substr(0,30):"new bookmark",id:_.default(),pageNumber:e.highlightPage-1,xCoordinate:t.x,yCoordinate:t.y}))),e.toolbarEvents.toggleSideBar(!0),e.highlightService.resetHighlight(),e.rectangles=void 0}))},t.prototype.saveAnnotation=function(t){var e=t.rectangles,n=t.page;this.highlightService.saveAnnotation(e,n),this.toolbarEvents.drawModeSubject.next(!1)},t}();oa.decorators=[{type:e.Component,args:[{selector:"mv-metadata-layer",template:'<div class="pageContainer">\n <div *ngFor="let page of pages; index as i"\n class="pageContainer__page"\n [ngStyle]="{\n \'width.px\': page.styles.width,\n \'height.px\': page.styles.height\n }"\n [ngClass]="{ \'pageContainer__page--draw\' : drawMode }">\n <mv-box-highlight-create\n [page]="i + 1"\n [pageHeight]="page.styles.height"\n [pageWidth]="page.styles.width"\n [rotate]="rotate"\n [zoom]="zoom"\n (saveSelection)="saveAnnotation($event)">\n </mv-box-highlight-create>\n <mv-ctx-toolbar *ngIf="rectangles && highlightPage === (i + 1)"\n [rectangles]="rectangles"\n [canBookmark]="true" [canHighlight]="true"\n [zoom]="zoom"\n [rotate]="rotate"\n [pageHeight]="page.styles.height"\n [pageWidth]="page.styles.width"\n (createBookmarkEvent)="createBookmark($event)"\n (createHighlightEvent)="createHighlight()">\n </mv-ctx-toolbar>\n <div class="pageContainer__page-item">\n <mv-annotation-set *ngIf="(annoPages$ | async) as annoPages"\n [zoom]="zoom"\n [rotate]="rotate"\n [pageHeight]="page.styles.height"\n [pageWidth]="page.styles.width"\n [page]="i" [annotations]="annoPages[i + 1]"></mv-annotation-set>\n </div>\n </div>\n</div>\n'}]}],oa.ctorParameters=function(){return[{type:r.Store},{type:Ci},{type:X},{type:lo}]},oa.propDecorators={zoom:[{type:e.Input}],rotate:[{type:e.Input}]};var ia=function(){};ia.decorators=[{type:e.NgModule,args:[{imports:[b.A11yModule,n.CommonModule,o.FormsModule,i.HttpClientModule,f.MutableDivModule,v.TagInputModule,g.RouterModule,o.ReactiveFormsModule,y.NgxDatatableModule,Ji],declarations:[oa,ki,Ri,Ei,Ii,Pi,Bi,Ni,Mi,xi,Ti,Fi,_i,Di,Ai,$i,Li,Vi,Ui],entryComponents:[ki,Ei,Ti],providers:[xo,Hi,ji,Ci,Oi],exports:[ki,Ri,Ei,Ti,Bi,Ni,Di,Ai,Li,$i,Vi,Ui,oa]}]}];var aa=function(){function t(t){this.el=t,this.pointerDown=!1,this.dragEnabled=!1}return t.prototype.onPointerDown=function(t){this.dragEnabled&&(t.preventDefault(),this.pointerDown=!0,this.originalPosition={left:t.clientX+this.el.nativeElement.scrollLeft,top:t.clientY+this.el.nativeElement.scrollTop})},t.prototype.onPointerMove=function(t){if(this.pointerDown&&this.dragEnabled){t.preventDefault();var e={left:this.originalPosition.left-(t.clientX+this.el.nativeElement.scrollLeft),top:this.originalPosition.top-(t.clientY+this.el.nativeElement.scrollTop)};this.dragEnabled&&(this.dragX.scrollLeft+=e.left,this.el.nativeElement.scrollTop+=e.top)}},t.prototype.onWindowPointerUp=function(){this.pointerDown=!1},t}();aa.decorators=[{type:e.Directive,args:[{selector:"[mvGrabNDrag]"}]}],aa.ctorParameters=function(){return[{type:e.ElementRef}]},aa.propDecorators={dragEnabled:[{type:e.Input}],dragX:[{type:e.Input}],onPointerDown:[{type:e.HostListener,args:["pointerdown",["$event"]]}],onPointerMove:[{type:e.HostListener,args:["window:pointermove",["$event"]]}],onWindowPointerUp:[{type:e.HostListener,args:["window:pointerup"]}]};var sa=function(){function t(t,e){this.viewerEvents=t,this.store=e,this.selectedView="outline"}return t.prototype.ngOnInit=function(){var t=this;this.bookmarkNodes$=this.store.pipe(r.select(Qi)),this.$subscription=this.store.pipe(r.select(ta)).subscribe((function(e){return t.selectedView=e?"bookmarks":t.selectedView}))},t.prototype.ngOnChanges=function(t){t.url&&this.url&&this.store.dispatch(new Qe)},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.goToDestination=function(t){this.viewerEvents.goToDestination(t)},t.prototype.toggleSidebarView=function(t){this.selectedView=t},t.prototype.onAddBookmarkClick=function(){var t=this;this.toggleSidebarView("bookmarks"),this.store.pipe(r.select(ea),s.take(1)).subscribe((function(e){t.store.dispatch(new nn(Object.assign(Object.assign({},e),{name:"",id:_.default()})))}))},t.prototype.isViewedItem=function(t,e){return void 0===e?t.pageNumber<=this.currentPageNumber:t.pageNumber<=this.currentPageNumber&&e.pageNumber>this.currentPageNumber},t.prototype.findEndPage=function(t){return void 0===t?Number.MAX_SAFE_INTEGER:t.pageNumber},t}();sa.decorators=[{type:e.Component,args:[{selector:"mv-side-bar",template:'<div id="toolbarSidebar">\n <div class="splitToolbarButton toggled">\n <button id="viewOutline"\n [ngClass]="{ \'toolbarButton\': true, \'toggled\': selectedView === \'outline\' }"\n (click)="toggleSidebarView(\'outline\')"\n title="Show Document Outline" tabindex="1" data-l10n-id="document_outline">\n <span data-l10n-id="document_outline_label">Document Outline</span>\n </button>\n <button *ngIf="annotationsEnabled"\n id="viewBookmark" class="toolbarButton bookmark"\n [ngClass]="{ toggled: selectedView === \'bookmarks\' }"\n (click)="toggleSidebarView(\'bookmarks\')"\n title="Show Bookmarks" tabindex="2" data-l10n-id="bookmarks">\n <span data-l10n-id="bookmarks_label">Bookmarks</span>\n </button>\n </div>\n <div class="splitToolbarButtonSeparator"></div>\n <div *ngIf="annotationsEnabled"\n class="splitToolbarButton right">\n <button id="addBookmark"\n class="toolbarButton addBookmark"\n (click)="onAddBookmarkClick()"\n title="Add bookmark" tabindex="3" data-l10n-id="addBookmark">\n <span data-l10n-id="addBookmark_label">Add bookmark</span>\n </button>\n </div>\n</div>\n<div id="sidebarContent">\n <div id="outlineView" class="outlineWithDeepNesting">\n <div class="outlineItem" *ngIf="selectedView === \'outline\'">\n <mv-outline-item *ngFor="let outlineItem of outline; index as i"\n [outline]="outlineItem"\n [currentPageNumber]="currentPageNumber"\n [isCurrentSection]= "isViewedItem(outlineItem, outline[i+1])"\n [endPage]="findEndPage(outline[i+1])"\n (navigationEvent)="goToDestination($event)"></mv-outline-item>\n </div>\n <div *ngIf="annotationsEnabled && selectedView === \'bookmarks\'"\n id="bookmarkContainer">\n <mv-bookmarks [bookmarkNodes]="bookmarkNodes$ | async"\n [zoom]="zoom" [rotate]="rotate"\n (goToDestination)="goToDestination($event)"></mv-bookmarks>\n </div>\n </div>\n</div>\n'}]}],sa.ctorParameters=function(){return[{type:lo},{type:r.Store}]},sa.propDecorators={annotationsEnabled:[{type:e.Input}],outline:[{type:e.Input}],url:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],currentPageNumber:[{type:e.Input}]};var ra=function(){function t(){this.navigationEvent=new e.EventEmitter}return t.prototype.ngOnInit=function(){this.showOutlineItems=!0},t.prototype.goToDestination=function(t){t&&this.navigationEvent.emit(t)},t.prototype.toggleOutline=function(){this.showOutlineItems=!this.showOutlineItems},t.prototype.isViewedItem=function(t,e){return void 0===e?t.pageNumber<=this.currentPageNumber&&this.endPage>this.currentPageNumber:t.pageNumber<=this.currentPageNumber&&e.pageNumber>this.currentPageNumber},t.prototype.findEndPage=function(t){return void 0===t?Number.MAX_SAFE_INTEGER:t.pageNumber},t.prototype.showHighlightOutlineCss=function(){return this.isCurrentSection?"highlightedOutlineItem":"outlineItem"},t}();ra.decorators=[{type:e.Component,args:[{selector:"mv-outline-item",template:'<div class="outlineItem">\n <div *ngIf="outline.items.length > 0"\n [ngClass]="{ \'outlineItemToggler\': true, \'outlineItemsHidden\': !showOutlineItems }"\n (click)="toggleOutline()"\n (keyup.enter)="toggleOutline()" tabindex="0"></div>\n <a (click)="goToDestination(outline?.dest)"\n (keyup.enter)="goToDestination(outline?.dest)"\n [style.font-weight]="outline.bold ? \'bold\' : \'\'"\n [style.font-style]="outline.italic ? \'italic\' : \'\'"\n [ngClass]="showHighlightOutlineCss()"\n tabindex="0">\n <div style="text-align:left;" [ngClass]="showHighlightOutlineCss()">\n {{ outline.title }}\n <span style="float:right;">\n {{ outline.pageNumber }}\n </span>\n </div>\n </a>\n \n <div *ngIf="outline.items.length > 0" class="outlineItems">\n <div *ngFor="let outlineItem of outline.items; index as i">\n <mv-outline-item\n [outline]="outlineItem" \n [currentPageNumber]= "currentPageNumber" \n [isCurrentSection]= "isViewedItem(outlineItem, outline.items[i+1])"\n [endPage]="findEndPage(outline.items[i+1])"\n (navigationEvent)="goToDestination($event)">\n </mv-outline-item>\n </div>\n </div>\n</div>\n\n'}]}],ra.propDecorators={outline:[{type:e.Input}],currentPageNumber:[{type:e.Input}],isCurrentSection:[{type:e.Input}],endPage:[{type:e.Input}],navigationEvent:[{type:e.Output}]};var ca=function(){function t(t,e,n){this.store=t,this.viewerEvents=e,this.toolbarEvents=n}return t.prototype.ngOnInit=function(){var t=this;this.redactionsPerPage$=this.store.pipe(r.select(vi)),this.selectedRedaction$=this.store.pipe(r.select(mi)),this.$subscription=this.toolbarEvents.drawModeSubject.subscribe((function(e){return t.drawMode=e})),this.$subscription.add(this.store.pipe(r.select(gi),s.filter((function(t){return!!t}))).subscribe((function(e){return t.downloadDocument(e)}))),this.$subscription.add(this.store.pipe(r.select(oo)).subscribe((function(e){return t.documentId=e}))),this.$subscription.add(this.viewerEvents.textHighlight.subscribe((function(e){return t.markTextRedaction(e)}))),this.toolbarEvents.applyRedactToDocument.subscribe((function(){t.store.pipe(r.select(fi),s.take(1)).subscribe((function(e){t.store.dispatch(new Vn(e))}))})),this.toolbarEvents.clearAllRedactMarkers.subscribe((function(){t.store.dispatch(new qn(t.documentId))}))},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.markTextRedaction=function(t){var e=t.rectangles;e&&e.length&&this.saveRedaction(t.page,L(e)),this.toolbarEvents.highlightModeSubject.next(!1)},t.prototype.markBoxRedaction=function(t){var e=t.rectangles,n=t.page;this.saveRedaction(n,e),this.toolbarEvents.drawModeSubject.next(!1)},t.prototype.saveRedaction=function(t,e){var n={page:t,rectangles:e,redactionId:_.default(),documentId:this.documentId};this.store.dispatch(new Nn(n))},t.prototype.onMarkerDelete=function(t){this.store.dispatch(new Fn(t))},t.prototype.selectRedaction=function(t){this.store.dispatch(new Hn(t))},t.prototype.onMarkerUpdate=function(t){this.store.dispatch(new Nn(t))},t.prototype.downloadDocument=function(t){var e=t.blob,n=t.filename;if(navigator&&navigator.msSaveBlob)navigator.msSaveBlob(e,n);else{var o=URL.createObjectURL(e),i=document.createElement("a");document.body.appendChild(i),i.setAttribute("style","display: none"),i.href=o,i.download=n,i.click(),i.remove(),URL.revokeObjectURL(o)}this.store.dispatch(new Wn)},t}();ca.decorators=[{type:e.Component,args:[{selector:"mv-redactions",template:'<div class="pageContainer">\n <div *ngFor="let redaction of (redactionsPerPage$ | async); index as i"\n class="pageContainer__page"\n [ngStyle]="{\n \'width.px\': redaction.styles.width,\n \'height.px\': redaction.styles.height\n }"\n [ngClass]="{ \'pageContainer__page--draw\' : drawMode }">\n <mv-box-highlight-create\n [page]="i + 1"\n [pageHeight]="redaction.styles.height"\n [pageWidth]="redaction.styles.width"\n [rotate]="rotate"\n [zoom]="zoom"\n (saveSelection)="markBoxRedaction($event)">\n </mv-box-highlight-create>\n <div class="pageContainer__page-item">\n <ng-container *ngFor="let anno of redaction.anno">\n \x3c!-- TODO rename this to selection --\x3e\n <mv-annotation [annotation]="anno"\n [zoom]="zoom"\n [rotate]="rotate"\n [selectedAnnoId]="selectedRedaction$ | async"\n [pageHeight]="redaction.styles.height"\n [pageWidth]="redaction.styles.width"\n (update)="onMarkerUpdate($event)"\n (delete)="onMarkerDelete($event)"\n (annotationClick)="selectRedaction($event)">\n </mv-annotation>\n </ng-container>\n </div>\n </div>\n</div>\n'}]}],ca.ctorParameters=function(){return[{type:r.Store},{type:lo},{type:X}]},ca.propDecorators={zoom:[{type:e.Input}],rotate:[{type:e.Input}]};var la=function(){function t(t){this.httpClient=t,this.ICP_SESSION_API="/icp/sessions"}return t.prototype.loadSession=function(t){return this.httpClient.get(this.ICP_SESSION_API+"/"+t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t}();la.decorators=[{type:e.Injectable}],la.ctorParameters=function(){return[{type:i.HttpClient}]};var ua=function(t,e){var n=this;this.actions$=t,this.annotationApiService=e,this.loadAnnotation$=this.actions$.pipe(S.ofType(te),s.map((function(t){return t.payload})),s.switchMap((function(t){return n.annotationApiService.getAnnotationSet(t).pipe(s.map((function(t){return new ge(t)})),s.catchError((function(t){return a.of(new be(t))})))}))),this.postAnnotation$=this.actions$.pipe(S.ofType(oe),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return n.annotationApiService.postAnnotation(t).pipe(s.map((function(t){return new ve(t)})),s.catchError((function(t){return a.of(new be(t))})))}))),this.deleteAnnotation$=this.actions$.pipe(S.ofType(re),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return n.annotationApiService.deleteAnnotation(t).pipe(s.map((function(e){return new ke(t)})),s.catchError((function(t){return a.of(new Ee(t))})))})))};ua.decorators=[{type:e.Injectable}],ua.ctorParameters=function(){return[{type:S.Actions},{type:xo}]},R([S.Effect(),B("design:type",Object)],ua.prototype,"loadAnnotation$",void 0),R([S.Effect(),B("design:type",Object)],ua.prototype,"postAnnotation$",void 0),R([S.Effect(),B("design:type",Object)],ua.prototype,"deleteAnnotation$",void 0);var pa=function(t,e,n){var o=this;this.actions$=t,this.store=e,this.bookmarksApiService=n,this.loadBookmarks$=this.actions$.pipe(S.ofType(Ve),s.withLatestFrom(this.store.pipe(r.select(oo))),s.map((function(t){return F(t,2)[1]})),s.exhaustMap((function(t){return o.bookmarksApiService.getBookmarks(t).pipe(s.map((function(t){return new tn(t)})),s.catchError((function(t){return a.of(new en(t))})))}))),this.createBookmark$=this.actions$.pipe(S.ofType(We),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.bookmarksApiService.createBookmark(t).pipe(s.map((function(t){return new on(t)})),s.catchError((function(t){return a.of(new an(t))})))}))),this.moveBookmark$=this.actions$.pipe(S.ofType(Je),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.bookmarksApiService.updateMultipleBookmarks(t).pipe(s.map((function(t){return new un(t)})),s.catchError((function(t){return a.of(new pn(t))})))}))),this.deleteBookmark$=this.actions$.pipe(S.ofType(Ge),s.map((function(t){return t.payload})),s.exhaustMap((function(t){var e=t.deleted,n=t.updated;return o.bookmarksApiService.deleteMultipleBookmarks({deleted:e,updated:n}).pipe(s.switchMap((function(){return n?[new rn(e),new hn(n)]:[new rn(e)]})),s.catchError((function(t){return a.of(new cn(t))})))}))),this.updateBookmark$=this.actions$.pipe(S.ofType(Xe),s.map((function(t){return t.payload})),s.switchMap((function(t){return o.bookmarksApiService.updateBookmark(t).pipe(s.map((function(t){return new hn(t)})),s.catchError((function(t){return a.of(new mn(t))})))})))};pa.decorators=[{type:e.Injectable}],pa.ctorParameters=function(){return[{type:S.Actions},{type:r.Store},{type:Hi}]},R([S.Effect(),B("design:type",Object)],pa.prototype,"loadBookmarks$",void 0),R([S.Effect(),B("design:type",Object)],pa.prototype,"createBookmark$",void 0),R([S.Effect(),B("design:type",Object)],pa.prototype,"moveBookmark$",void 0),R([S.Effect(),B("design:type",Object)],pa.prototype,"deleteBookmark$",void 0),R([S.Effect(),B("design:type",Object)],pa.prototype,"updateBookmark$",void 0);var da=function(){function t(t){this.httpClient=t,this.markupsApiUrl="/api/markups",this.redactApiUrl="/api/redaction"}return t.prototype.getRedactions=function(t){var e=this.markupsApiUrl+"/"+t;return this.httpClient.get(e,{observe:"response",withCredentials:!0})},t.prototype.saveRedaction=function(t){return this.httpClient.post(this.markupsApiUrl,t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})),s.catchError((function(){return[]})))},t.prototype.deleteRedaction=function(t){var e=this.markupsApiUrl+"/"+t.documentId+"/"+t.redactionId;return this.httpClient.delete(e,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.deleteAllMarkers=function(t){var e=this.markupsApiUrl+"/"+t;return this.httpClient.delete(e,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.redact=function(t){return this.httpClient.post(this.redactApiUrl,t,{observe:"response",withCredentials:!0,responseType:"blob"}).pipe(s.map((function(t){return t})),s.catchError((function(){return[]})))},t}();da.decorators=[{type:e.Injectable}],da.ctorParameters=function(){return[{type:i.HttpClient}]};var ha=function(t,e){var n=this;this.actions$=t,this.redactionApiService=e,this.loadRedactions$=this.actions$.pipe(S.ofType(wn),s.map((function(t){return t.payload})),s.switchMap((function(t){return n.redactionApiService.getRedactions(t).pipe(s.map((function(t){return new Rn(t.body)})),s.catchError((function(t){return a.of(new Bn(t))})))}))),this.saveRedaction$=this.actions$.pipe(S.ofType(kn),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return n.redactionApiService.saveRedaction(t).pipe(s.map((function(t){return new Mn(t)})),s.catchError((function(t){return a.of(new An(t))})))}))),this.deleteRedaction$=this.actions$.pipe(S.ofType(Cn),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return n.redactionApiService.deleteRedaction(t).pipe(s.map((function(){return new Ln(t)})),s.catchError((function(t){return a.of(new $n(t))})))}))),this.redact$=this.actions$.pipe(S.ofType(Pn),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return n.redactionApiService.redact(t).pipe(s.map((function(e){var n=e.headers.get("content-disposition").split("filename="),o=n.length>1?n[1].replace(/"/g,""):"redacted-document-"+t.documentId;return new Un({blob:e.body,filename:o})})),s.catchError((function(t){return a.of(new zn(t))})))}))),this.unmarkAll$=this.actions$.pipe(S.ofType(Tn),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return n.redactionApiService.deleteAllMarkers(t).pipe(s.map((function(t){return new Gn})),s.catchError((function(t){return a.of(new $n(t))})))})))};ha.decorators=[{type:e.Injectable}],ha.ctorParameters=function(){return[{type:S.Actions},{type:da}]},R([S.Effect(),B("design:type",Object)],ha.prototype,"loadRedactions$",void 0),R([S.Effect(),B("design:type",Object)],ha.prototype,"saveRedaction$",void 0),R([S.Effect(),B("design:type",Object)],ha.prototype,"deleteRedaction$",void 0),R([S.Effect(),B("design:type",Object)],ha.prototype,"redact$",void 0),R([S.Effect(),B("design:type",Object)],ha.prototype,"unmarkAll$",void 0);var ma=function(){function t(t){this.httpClient=t,this.documentConversionUrl="/doc-assembly/convert"}return t.prototype.convert=function(t){return this.httpClient.post(this.documentConversionUrl+"/"+t,{},{observe:"response",withCredentials:!0,responseType:"blob"}).pipe(s.map((function(t){return t})),s.catchError((function(t){return a.of(t)})))},t}();ma.decorators=[{type:e.Injectable}],ma.ctorParameters=function(){return[{type:i.HttpClient}]};var ga=function(){function t(t){this.httpClient=t,this.rotationApiUrl="/em-anno/metadata"}return t.prototype.getRotation=function(t){var e=this.rotationApiUrl+"/"+t;return this.httpClient.get(e,{observe:"response",withCredentials:!0})},t.prototype.saveRotation=function(t){var e=this.rotationApiUrl+"/";return this.httpClient.post(e,t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t})),s.catchError((function(){return[]})))},t}();ga.decorators=[{type:e.Injectable}],ga.ctorParameters=function(){return[{type:i.HttpClient}]};var ba=function(t,e,n){var o=this;this.actions$=t,this.documentConversionService=e,this.rotationApiService=n,this.convert$=this.actions$.pipe(S.ofType(ut),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.documentConversionService.convert(t).pipe(s.map((function(t){var e=URL.createObjectURL(t.body);return new Et(e)})),s.catchError((function(t){return a.of(new Ct(t))})))}))),this.loadRotation$=this.actions$.pipe(S.ofType(mt),s.map((function(t){return t.payload})),s.switchMap((function(t){return o.rotationApiService.getRotation(t).pipe(s.map((function(t){return new Pt(t.body)})),s.catchError((function(t){return a.of(new xt(t))})))}))),this.saveRotation$=this.actions$.pipe(S.ofType(ft),s.map((function(t){return t.payload})),s.switchMap((function(t){return o.rotationApiService.saveRotation(t).pipe(s.map((function(t){return new Tt(t.body)})),s.catchError((function(t){return a.of(new _t(t))})))})))};ba.decorators=[{type:e.Injectable}],ba.ctorParameters=function(){return[{type:S.Actions},{type:ma},{type:ga}]},R([S.Effect(),B("design:type",Object)],ba.prototype,"convert$",void 0),R([S.Effect(),B("design:type",Object)],ba.prototype,"loadRotation$",void 0),R([S.Effect(),B("design:type",Object)],ba.prototype,"saveRotation$",void 0);var fa=function(t,e,n){var o=this;this.actions$=t,this.icpApiService=e,this.icpUpdateService=n,this.loadIcpSession$=this.actions$.pipe(S.ofType(At),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.icpApiService.loadSession(t).pipe(s.map((function(t){return new qt(t)})),s.catchError((function(t){return a.of(new Wt(t))})))}))),this.joinIcpSocketSession$=this.actions$.pipe(S.ofType(Ft),s.map((function(t){return t.payload})),s.switchMap((function(t){return o.icpUpdateService.joinSession(t.username,t.session).pipe(s.map((function(e){return new Gt({session:t.session,participantInfo:e})})))})))};fa.decorators=[{type:e.Injectable}],fa.ctorParameters=function(){return[{type:S.Actions},{type:la},{type:po}]},R([S.Effect(),B("design:type",Object)],fa.prototype,"loadIcpSession$",void 0),R([S.Effect(),B("design:type",Object)],fa.prototype,"joinIcpSocketSession$",void 0);var va=[ua,pa,ha,ba,fa],ya=function(){function t(t){this.store=t,this.goToDestination=new e.EventEmitter,this.pageLookup={},this.BOOKMARK_CHAR_LIMIT=30,this.options={allowDrag:!0,allowDrop:!0}}return t.prototype.ngOnInit=function(){var t=this;this.$subscription=this.store.pipe(r.select(ta)).subscribe((function(e){return t.editableBookmark=e})),this.$subscription.add(this.store.select(no).subscribe((function(e){Object.keys(e).map((function(n){t.pageLookup[n]=e[n]}))})))},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.editBookmark=function(t){this.editableBookmark=t},t.prototype.onBookmarkMove=function(t){var e=t.node,n=t.from,o=t.to,i=[Object.assign(Object.assign({},e),{previous:o.index>0?o.parent.children[o.index-1].id:void 0,parent:o.parent.documentId?o.parent.id:void 0})],a=this.getSibling(n,n.index);(a=a&&a.id===e.previous?this.getSibling(n,n.index+1):a)&&(i=L(i,[Object.assign(Object.assign({},a),{previous:e.previous})]));var s=this.getSibling(o,o.index+1);s&&(i=L(i,[Object.assign(Object.assign({},s),{previous:e.id})])),this.store.dispatch(new ln(i))},t.prototype.deleteBookmark=function(t){var e,n=t.parent.children;n.length>t.index+1&&((e=n[t.index+1].data).previous=t.data.previous),this.store.dispatch(new sn({deleted:L([t.data.id],gn(t.data.children)),updated:e}))},t.prototype.updateBookmark=function(t,e){var n=Object.assign(Object.assign({},t),{name:e});e&&(this.store.dispatch(new dn(n)),this.editableBookmark=void 0)},t.prototype.goToBookmark=function(t){var e=this.pageLookup[t.pageNumber+1],n=e.styles.height,o=this.scaledY(t.yCoordinate,n,e),i=0,a=0;switch(this.rotate){case 90:a=-o;break;case 180:i=this.scaledY(t.yCoordinate,n-24*this.zoom,e);break;case 270:a=o;break;default:i=o}this.goToDestination.emit([t.pageNumber,{name:"XYZ"},a,i])},t.prototype.getSibling=function(t,e){return t.parent.children.length>e?t.parent.children[e]:void 0},t.prototype.scaledY=function(t,e,n){var o=n.viewportScale/this.zoom;return(e/this.zoom-t)/o},t}();ya.decorators=[{type:e.Component,args:[{selector:"mv-bookmarks",template:'<tree-root [nodes]="bookmarkNodes"\n class="bookmarks-tree"\n [options]="options"\n (moveNode)="onBookmarkMove($event)">\n <ng-template #treeNodeTemplate let-node let-index="index">\n <div class="outlineItem" *ngIf="node.data.id !== editableBookmark; else inputBookmark">\n <a (click)="goToBookmark(node.data)">\n {{ node.data.name }}\n </a>\n <button class="bookmark__rename" (click)="editBookmark(node.data.id)" ></button>\n <button class="bookmark__delete" (click)="deleteBookmark(node)"></button>\n </div>\n <ng-template #inputBookmark>\n <input #bookmarkName class="bookmark__input" [value]="node.data.name" [maxLength]="BOOKMARK_CHAR_LIMIT">\n <button class="bookmark__save" (click)="updateBookmark(node.data, bookmarkName.value)"></button>\n </ng-template>\n <a *ngIf="bookmarkNodes?.length === 0" class="outlineItem">No bookmarks created yet</a>\n </ng-template>\n</tree-root>\n'}]}],ya.ctorParameters=function(){return[{type:r.Store}]},ya.propDecorators={bookmarkNodes:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],goToDestination:[{type:e.Output}]};var wa=function(){function t(t){this.store=t,this.mediaLoadStatus=new e.EventEmitter,this.viewerException=new e.EventEmitter,this.documentTitle=new e.EventEmitter}return t.prototype.ngOnInit=function(){var t=this;this.store.dispatch(new kt(this.extractDMStoreDocId(this.originalUrl))),this.$subscription=this.store.pipe(r.select(so),s.filter((function(t){return!!t}))).subscribe((function(e){e.url?(t.convertedUrl=e.url,t.store.dispatch(new It)):t.onLoadException(new et(e.error))}))},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.onMediaLoad=function(t){this.mediaLoadStatus.emit(t)},t.prototype.onLoadException=function(t){this.viewerException.emit(t)},t.prototype.onDocumentTitleChange=function(t){this.documentTitle.emit(t)},t.prototype.extractDMStoreDocId=function(t){return t.includes("/documents/")?t=t.split("/documents/")[1]:t.includes("/documentsv2/")&&(t=t.split("/documentsv2/")[1]),t.replace("/binary","")},t}();wa.decorators=[{type:e.Component,args:[{selector:"mv-conversion-viewer",template:'<mv-pdf-viewer *ngIf="convertedUrl"\n (mediaLoadStatus)="onMediaLoad($event)"\n (pdfViewerException)="onLoadException($event)"\n (documentTitle)="onDocumentTitleChange($event)"\n [url]="convertedUrl"\n [downloadUrl]="originalUrl"\n [enableAnnotations]="enableAnnotations"\n [enableRedactions]="enableRedactions"\n [annotationSet]="enableAnnotations ? annotationSet : null"\n [downloadFileName]="downloadFileName"\n [height]="height">\n</mv-pdf-viewer>\n',encapsulation:e.ViewEncapsulation.None}]}],wa.ctorParameters=function(){return[{type:r.Store}]},wa.propDecorators={originalUrl:[{type:e.Input}],downloadFileName:[{type:e.Input}],height:[{type:e.Input}],enableAnnotations:[{type:e.Input}],enableRedactions:[{type:e.Input}],annotationSet:[{type:e.Input}],mediaLoadStatus:[{type:e.Output}],viewerException:[{type:e.Output}],documentTitle:[{type:e.Output}]};var Sa=function(){function t(t){this.toolbarEvents=t}return t.prototype.onCancel=function(){this.toolbarEvents.icp.leavingSession.next(!1)},t.prototype.onConfirm=function(){this.toolbarEvents.icp.confirmExit(),this.toolbarEvents.icp.leavingSession.next(!1)},t}();Sa.decorators=[{type:e.Component,args:[{selector:"mv-confirm-action",template:'<div id="modal-background" class="modal" (click)="onCancel()">\n <div id="modal" class="modal-content govuk-width-container clearfix" (click)="$event.stopPropagation()">\n <h2 class="govuk-heading-s">Are you sure you want to leave the presentation?</h2>\n <div class="button-container">\n <button id="modal-close-button" (click)="onConfirm()" class="govuk-button">Confirm</button>\n <button (click)="onCancel()" class="govuk-button govuk-button--secondary">Cancel</button>\n </div>\n </div>\n</div>\n'}]}],Sa.ctorParameters=function(){return[{type:X}]};var ka=function(){function t(t){this.store=t}return t.prototype.ngOnInit=function(){this.bookmarksPerPage$=this.store.pipe(r.select(na))},t}();ka.decorators=[{type:e.Component,args:[{selector:"mv-bookmark-icons",template:'<div class="pageContainer">\n <div *ngFor="let bookmarks of (bookmarksPerPage$ | async); index as i"\n class="pageContainer__page"\n [ngStyle]="{\n \'width.px\': bookmarks.styles.width,\n \'height.px\': bookmarks.styles.height\n }">\n <div class="pageContainer__page-item">\n <ng-container *ngFor="let bMrk of bookmarks.bookmark">\n <div class="bookmark__here"\n [style.width]="16 * zoom + \'px\'"\n [style.height]="24 * zoom + \'px\'"\n [style.top]="bMrk.yCoordinate * zoom + \'px\'"\n [title]="bMrk.name">\n </div>\n </ng-container>\n </div>\n </div>\n</div>\n'}]}],ka.ctorParameters=function(){return[{type:r.Store}]},ka.propDecorators={zoom:[{type:e.Input}],rotate:[{type:e.Input}]};var Ea=function(){function t(t,e,n,o){this.el=t,this.store=e,this.toolbarButtons=n,this.toolbarEvents=o,this.rotation=0,this.savedRotation=0}return t.prototype.ngOnInit=function(){var t=this;this.$subscriptions=this.toolbarEvents.rotateSubject.subscribe((function(e){return t.onRotate(e)})),this.$subscriptions.add(this.toolbarEvents.saveRotationSubject.subscribe((function(){return t.saveRotation()}))).add(this.store.pipe(r.select(ro)).subscribe((function(e){return t.savedRotation=e}))).add(this.store.pipe(r.select(oo)).subscribe((function(e){return t.documentId=e})))},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.prototype.onMediaLoad=function(t){var e=this;this.rotation=0,this.store.dispatch(new Ot(this.documentId)),this.store.pipe(r.select(co),s.filter((function(t){return!!t})),s.take(1)).subscribe((function(){e.savedRotation&&e.toolbarEvents.rotateSubject.next(e.savedRotation)}))},t.prototype.onRotate=function(t){this.rotation=(this.rotation+t)%360,this.toolbarButtons.showSaveRotationButton=this.savedRotation!==this.rotation},t.prototype.saveRotation=function(){var t={documentId:this.documentId,rotationAngle:this.rotation};this.store.dispatch(new jt(t))},t}();Ea.decorators=[{type:e.Directive,args:[{selector:"[mvRotationPersist]"}]}],Ea.ctorParameters=function(){return[{type:e.ElementRef},{type:r.Store},{type:nt},{type:X}]},Ea.propDecorators={onMediaLoad:[{type:e.HostListener,args:["mediaLoadStatus",["$event"]]}]};var Ca=function(){function t(t,e){this.toolbarEvents=t,this.store=e,this.showParticipantsList=!1}return t.prototype.ngOnInit=function(){var t=this;this.participants$=this.store.pipe(r.select(wo)),this.presenter$=this.store.pipe(r.select(bo)),this.isPresenter$=this.store.pipe(r.select(yo)),this.subscription=this.toolbarEvents.icp.participantsListVisible.subscribe((function(e){return t.showParticipantsList=e}))},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t}();Ca.decorators=[{type:e.Component,args:[{selector:"mv-participants-list",template:'<div class="comments-panel comment-container icp-mode" [ngClass]="{\'expanded\': showParticipantsList }">\n\n <div class="participant__card no-shadow">\n <p class="participant__name">All Participants</p>\n </div>\n\n <div *ngIf="(presenter$ | async)?.username !== \'\'" class="participant__card">\n <div class="participant__header"> Presenting </div>\n <p class="participant__name">{{(presenter$ | async)?.username}}</p>\n </div>\n\n <div *ngIf="(participants$ | async).length > 1" class="participant__card">\n <div class="participant__header">Following</div>\n <ng-container *ngFor="let participant of (participants$ | async)">\n <p *ngIf="participant.id !== (presenter$ | async)?.id" class="participant__name">{{participant.username}}</p>\n </ng-container>\n </div>\n</div>\n'}]}],Ca.ctorParameters=function(){return[{type:X},{type:r.Store}]};var Ia=function(){function t(t,e,n,o,i){this.element=t,this.toolbarEvents=e,this.viewerEvents=n,this.highlightService=o,this.store=i}return t.prototype.ngOnInit=function(){var t=this;this.$subscription=this.store.select(no).subscribe((function(e){e[1]&&(t.allPages=e)}))},t.prototype.ngOnDestroy=function(){this.$subscription&&this.$subscription.unsubscribe()},t.prototype.onMouseUp=function(t){var e=t.target.offsetParent.offsetParent,n=parseInt(e.getAttribute("data-page-number"),10);if(this.toolbarEvents.highlightModeSubject.getValue()){var o=this.getRectangles(t,n);this.viewerEvents.textSelected({page:n,rectangles:o})}},t.prototype.onPdfViewerClick=function(t){this.store.dispatch(new Ce({annotationId:"",selected:!1,editable:!1})),this.viewerEvents.clearCtxToolbar()},t.prototype.getRectangles=function(t,e){this.pageHeight=this.allPages[e].styles.height,this.pageWidth=this.allPages[e].styles.width,this.zoom=parseFloat(this.allPages[e].scaleRotation.scale),this.rotate=parseInt(this.allPages[e].scaleRotation.rotation,10);var n=window.getSelection();if(n){var o=t.target;if(this.removeEnhancedTextModeStyling(o),n.rangeCount&&!n.isCollapsed){var i=n.getRangeAt(0).cloneRange().getClientRects();if(i){for(var a=o.parentElement.getBoundingClientRect(),s=[],r=function(t){var e=c.createTextRectangle(i[t],a);s.find((function(t){return t.width===e.width&&t.x===e.x}))||s.push(e)},c=this,l=0;l<i.length;l++)r(l);return s}}}},t.prototype.createTextRectangle=function(t,e){var n=t.bottom-t.top,o=t.right-t.left,i=t.top-e.top,a=t.left-e.left,s=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,n,o,i,a,this.rotate,this.zoom);return s=Object.assign({id:_.default()},s)},t.prototype.removeEnhancedTextModeStyling=function(t){if(t.parentElement.children)for(var e=0;e<t.parentElement.children.length;e++){var n=t.parentElement.children[e];n.style.padding="0";n.style.transform=n.style.transform.replace(/translate[XYZ]\(-?\d*(\.\d+)?(px)?\)/g,"").trim()}},t}();Ia.decorators=[{type:e.Directive,args:[{selector:"[mvCreateTextHighlight]"}]}],Ia.ctorParameters=function(){return[{type:e.ElementRef},{type:X},{type:lo},{type:Ci},{type:r.Store}]},Ia.propDecorators={onMouseUp:[{type:e.HostListener,args:["mouseup",["$event"]]}],onPdfViewerClick:[{type:e.HostListener,args:["mousedown",["$event"]]}]};var Oa=function(){function n(t){this.toolbarEvents=t,this.loadStatus=new e.EventEmitter,this.playbackMsg="loading"}return n.prototype.ngOnInit=function(){var e=this;this.subscription=this.toolbarEvents.downloadSubject.subscribe((function(){return e.downloadLink.nativeElement.click()})),this.loadStatus.emit(t.ResponseType.SUCCESS)},n.prototype.ngOnChanges=function(t){t.url&&this.reloadVideo()},n.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},n.prototype.reloadVideo=function(){this.videoPlayer&&(this.playbackMsg="loading",this.videoPlayer.nativeElement.load())},n.prototype.onSuccess=function(){this.playbackMsg="success"},n.prototype.onError=function(){this.playbackMsg="error"},n}();Oa.decorators=[{type:e.Component,args:[{selector:"mv-multimedia-player",template:'<div class="govuk-width-container">\n <div class="govuk-notification-banner__content">\n <p>\n <span *ngIf="multimediaOn && playbackMsg === \'loading\'">Loading multimedia content ... </span>\n <span *ngIf="!multimediaOn">Multimedia playback is not enabled, </span>\n <span *ngIf="multimediaOn && playbackMsg === \'success\'">Use the player to play to the file or </span>\n <span *ngIf="multimediaOn && playbackMsg === \'error\'">Mime type not supported. </span>\n <a *ngIf="!multimediaOn || playbackMsg !== \'loading\'" #downloadLink\n [href]="url" [download]="downloadFileName">Click here to download</a>\n </p>\n <video #videoPlayer *ngIf="multimediaOn"\n width="100%" height="100%" preload="auto" (canplay)="onSuccess()" controls>\n <source (error)="onError()" [src]="url" type="video/mp4">\n <source (error)="onError()" [src]="url" type="video/mp4; codecs=\'avc1, av01, hvc1, hev1, mp4v, mp4a.40.2, opus\'">\n <source (error)="onError()" [src]="url" type="video/ogg">\n <source (error)="onError()" [src]="url" type="video/ogg; codecs=\'theora, vp8, vp9, flac, opus, vorbis\'">\n <source (error)="onError()" [src]="url" type="video/webm">\n <source (error)="onError()" [src]="url" type="video/webm; codecs=\'vp8, vp9, vorbis, opus\'">\n </video>\n </div>\n</div>\n'}]}],Oa.ctorParameters=function(){return[{type:X}]},Oa.propDecorators={url:[{type:e.Input}],downloadFileName:[{type:e.Input}],multimediaOn:[{type:e.Input}],loadStatus:[{type:e.Output}],downloadLink:[{type:e.ViewChild,args:["downloadLink",{static:!1}]}],videoPlayer:[{type:e.ViewChild,args:["videoPlayer",{static:!1}]}]};var Pa=function(){};Pa.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,i.HttpClientModule,Si,ia,v.TagInputModule,o.FormsModule,o.ReactiveFormsModule,g.RouterModule,r.StoreModule.forFeature("media-viewer",Qn),S.EffectsModule.forFeature(va),k.TreeModule,f.MutableDivModule],declarations:[Co,sa,ya,ra,Oo,Po,Oa,ci,wa,aa,Ea,Ia,Sa,ca,ka,Ca],entryComponents:[Co,Oo,Po],providers:[K,jo,da,la,po,uo,Eo,So,ko,da,ma,ga],exports:[ci]}]}],t.ADD_OR_EDIT_COMMENT=se,t.APPLY_COMMENT_SUMMARY_FILTER=de,t.AddOrEditComment=we,t.AnnotationApiService=xo,t.AnnotationEffects=ua,t.AnnotationSetComponent=Ei,t.AnnotationViewComponent=ki,t.AnnotationsModule=ia,t.ApplyCommentSymmaryFilter=Oe,t.BoxHighlightCreateComponent=Ri,t.CLEAR_COMMENT_SUMMARY_FILTER=he,t.ClearCommentSummaryFilters=Pe,t.CommentFilterComponent=Li,t.CommentSearchComponent=Ni,t.CommentSetComponent=Ti,t.CommentSetHeaderComponent=Bi,t.CommentsSummaryComponent=Di,t.DELETE_ANNOTATION=re,t.DELETE_ANNOTATION_FAIL=le,t.DELETE_ANNOTATION_SUCCESS=ce,t.DeleteAnnotation=Se,t.DeleteAnnotationFail=Ee,t.DeleteAnnotationSuccess=ke,t.FilterPipe=Vi,t.IcpToolbarComponent=wi,t.LOAD_ANNOTATION_SET=te,t.LOAD_ANNOTATION_SET_FAIL=ne,t.LOAD_ANNOTATION_SET_SUCCESS=ee,t.LoadAnnotationSet=me,t.LoadAnnotationSetFail=be,t.LoadAnnotationSetSucess=ge,t.MainToolbarComponent=ui,t.MediaViewerComponent=ci,t.MediaViewerModule=Pa,t.MetadataLayerComponent=oa,t.MomentDatePipe=$i,t.RedactionToolbarComponent=yi,t.SAVE_ANNOTATION=oe,t.SAVE_ANNOTATION_FAIL=ae,t.SAVE_ANNOTATION_SUCCESS=ie,t.SEARCH_COMMENT=pe,t.SELECT_ANNOTATION=ue,t.SaveAnnotation=fe,t.SaveAnnotationFail=ye,t.SaveAnnotationSuccess=ve,t.SearchBarComponent=pi,t.SearchComment=Ie,t.SelectedAnnotation=Ce,t.TagsComponent=Ai,t.ToolbarButtonVisibilityService=nt,t.ToolbarEventService=X,t.ToolbarModule=Si,t.UnsnakePipe=Ui,t.ViewerException=et,t.commentSearchQ=Me,t.getAnnoEnt=Be,t.getAnnoPageEnt=Re,t.getAnnoPerPage=ei,t.getAnnoSet=_e,t.getAnnotationEntities=Ho,t.getAnnotationSet=qo,t.getAnnotationsSetState=$o,t.getCommentEntities=Zo,t.getCommentEnts=De,t.getCommentSummary=ai,t.getCommentSummaryFilters=Qo,t.getCommentsArray=oi,t.getComponentSearchQueries=Yo,t.getComponentSearchText=Ko,t.getDocumentIdSetId=zo,t.getFilteredAnnotations=ri,t.getPageEntities=Jo,t.getSelectedAnno=Ne,t.getSelectedAnnotation=Go,t.getSet=Vo,t.getSummaryFilters=Ae,t.initialState=je,t.reducer=Te,t["ɵ0"]=Lo,t["ɵ1"]=Uo,t["ɵ2"]=Wo,t["ɵ3"]=Xo,t["ɵ4"]=ti,t["ɵ5"]=ni,t["ɵ6"]=ii,t["ɵ7"]=si,t["ɵa"]=li,t["ɵba"]=Mi,t["ɵbb"]=xi,t["ɵbc"]=ji,t["ɵbd"]=Fi,t["ɵbe"]=_i,t["ɵbf"]=tt,t["ɵbg"]=Hi,t["ɵbh"]=va,t["ɵbi"]=pa,t["ɵbj"]=ha,t["ɵbk"]=da,t["ɵbl"]=ba,t["ɵbm"]=ma,t["ɵbn"]=ga,t["ɵbo"]=fa,t["ɵbp"]=la,t["ɵbq"]=po,t["ɵbr"]=uo,t["ɵbs"]=Co,t["ɵbt"]=K,t["ɵbu"]=Eo,t["ɵbv"]=So,t["ɵbw"]=ko,t["ɵbx"]=sa,t["ɵby"]=ya,t["ɵbz"]=ra,t["ɵc"]=Qn,t["ɵca"]=Oo,t["ɵcb"]=Io,t["ɵcc"]=Po,t["ɵcd"]=Oa,t["ɵce"]=wa,t["ɵcf"]=aa,t["ɵcg"]=Ea,t["ɵch"]=Ia,t["ɵci"]=Sa,t["ɵcj"]=ca,t["ɵck"]=ka,t["ɵcl"]=Ca,t["ɵcm"]=eo,t["ɵcn"]=no,t["ɵco"]=Ro,t["ɵcp"]=Mo,t["ɵcq"]=Ao,t["ɵd"]=to,t["ɵf"]=Kt,t["ɵg"]=Qt,t["ɵh"]=Le,t["ɵi"]=$e,t["ɵj"]=He,t["ɵl"]=yn,t["ɵm"]=Jn,t["ɵn"]=Xn,t["ɵp"]=Ji,t["ɵq"]=zi,t["ɵr"]=Wi,t["ɵs"]=Gi,t["ɵt"]=Zi,t["ɵu"]=Ci,t["ɵv"]=lo,t["ɵw"]=jo,t["ɵx"]=Ii,t["ɵy"]=Pi,t["ɵz"]=Oi,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators"),require("@ngrx/store"),require("pdfjs-dist/web/pdf_viewer"),require("pdfjs-dist"),require("pdfjs-dist/build/pdf.worker"),require("uuid/v4"),require("moment-timezone"),require("hammerjs"),require("uuid"),require("@angular/cdk/overlay"),require("@angular/router"),require("@angular/cdk/a11y"),require("mutable-div"),require("ngx-chips"),require("@swimlane/ngx-datatable"),require("@circlon/angular-tree-component"),require("@ngrx/effects")):"function"==typeof define&&define.amd?define("@hmcts/media-viewer",["exports","@angular/core","@angular/common","@angular/forms","@angular/common/http","rxjs","rxjs/operators","@ngrx/store","pdfjs-dist/web/pdf_viewer","pdfjs-dist","pdfjs-dist/build/pdf.worker","uuid/v4","moment-timezone","hammerjs","uuid","@angular/cdk/overlay","@angular/router","@angular/cdk/a11y","mutable-div","ngx-chips","@swimlane/ngx-datatable","@circlon/angular-tree-component","@ngrx/effects"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).hmcts=t.hmcts||{},t.hmcts["media-viewer"]={}),t.ng.core,t.ng.common,t.ng.forms,t.ng.common.http,t.rxjs,t.rxjs.operators,t.store,t.pdfjsViewer,t.pdfjsLib,null,t.uuid,t.moment,null,t.uuid$1,t.ng.cdk.overlay,t.ng.router,t.ng.cdk.a11y,t.mutableDiv,t.ngxChips,t.ngxDatatable,t.angularTreeComponent,t.effects$1)}(this,(function(t,e,n,o,i,a,s,r,c,l,u,p,d,h,m,g,b,v,f,y,w,S,k){"use strict";function E(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function C(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var I=C(e),P=C(i),O=C(c),x=C(l),j=E(p),T=E(d),R=E(m),_=function(t,e){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},_(t,e)};function B(t,e,n,o){var i,a=arguments.length,s=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var r=t.length-1;r>=0;r--)(i=t[r])&&(s=(a<3?i(s):a>3?i(e,n,s):i(e,n))||s);return a>3&&s&&Object.defineProperty(e,n,s),s}function D(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function A(t,e,n,o){return new(n||(n=Promise))((function(i,a){function s(t){try{c(o.next(t))}catch(t){a(t)}}function r(t){try{c(o.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,r)}c((o=o.apply(t,e||[])).next())}))}function N(t,e){var n,o,i,a,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function r(r){return function(c){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,r[0]&&(s=0)),s;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,o=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(6===r[0]&&s.label<i[1]){s.label=i[1],i=r;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(r);break}i[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,c])}}}Object.create;function M(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function F(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,a=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=a.next()).done;)s.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return s}function L(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(F(arguments[e]));return t}var $;Object.create;x.GlobalWorkerOptions.workerSrc="/assets/build/pdf.worker.min.js",function(t){t[t.FOUND=0]="FOUND",t[t.NOT_FOUND=1]="NOT_FOUND",t[t.WRAPPED=2]="WRAPPED",t[t.PENDING=3]="PENDING"}($||($={}));var H=function(){function t(t,e,n,o,i,a,s,r,c,l){var u=this;this.pdfViewer=t,this.downloadManager=e,this.toolbarEvents=n,this.documentLoadInit=o,this.documentLoadProgress=i,this.documentLoaded=a,this.outlineLoaded=s,this.documentLoadFailed=r,this.pageRendered=c,this.positionUpdated=l,this.pdfViewer.eventBus.on("updateviewarea",(function(t){return l.next(t)})),this.pdfViewer.eventBus.on("pagechanging",(function(t){return u.toolbarEvents.setCurrentPageInputValueSubject.next(t.pageNumber)})),this.pdfViewer.eventBus.on("pagesinit",(function(){return u.pdfViewer.currentScaleValue="1"})),this.pdfViewer.eventBus.on("pagerendered",(function(t){})),this.pdfViewer.eventBus.on("pagesloaded",(function(t){return u.emitDocumentInfo(t)})),this.pdfViewer.eventBus.on("scalechanging",(function(t){return u.emitDocumentInfo(t)})),this.pdfViewer.eventBus.on("rotationchanging",(function(t){return u.emitDocumentInfo(t)})),this.pdfViewer.eventBus.on("updatefindcontrolstate",(function(t){u.sendSearchDetails(t)})),this.pdfViewer.eventBus.on("updatefindmatchescount",(function(t){u.toolbarEvents.searchResultsCountSubject.next(t.matchesCount)})),this.zoomValue=1}return t.prototype.sendSearchDetails=function(t){var e,n,o,i,a,s;t.state!==$.PENDING&&(this.toolbarEvents.searchResultsCountSubject.next(t.matchesCount),-1!==(null===(n=null===(e=null==t?void 0:t.source)||void 0===e?void 0:e.selected)||void 0===n?void 0:n.pageIdx)&&t.matchesCount.total>0&&this.toolbarEvents.redactionSerachSubject.next({page:null===(i=null===(o=null==t?void 0:t.source)||void 0===o?void 0:o.selected)||void 0===i?void 0:i.pageIdx,matchedIndex:null===(s=null===(a=null==t?void 0:t.source)||void 0===a?void 0:a.selected)||void 0===s?void 0:s.matchIdx,matchesCount:t.matchesCount.total}))},t.prototype.emitDocumentInfo=function(t){var e=L(this.pdfViewer._pages).map((function(t){return{div:t.div,scale:t.scale,rotation:t.rotation,id:t.id,viewportScale:t.viewport.scale}}));this.pageRendered.next(e)},t.prototype.loadDocument=function(t){return A(this,void 0,void 0,(function(){var e,n,o,i,a,s=this;return N(this,(function(r){switch(r.label){case 0:(e=this.createLoadingTask(t)).onProgress=function(t){var e=t.loaded,n=t.total;s.documentLoadProgress.next({loaded:e,total:n})},this.documentLoadInit.next(t),r.label=1;case 1:return r.trys.push([1,7,,8]),[4,e.promise];case 2:return n=r.sent(),this.documentLoaded.next(n),this.toolbarEvents.pageCountSubject.next(n.numPages),this.pdfViewer.setDocument(n),this.pdfViewer.linkService.setDocument(n,null),[4,n.getOutline()];case 3:return(o=r.sent())?[4,this.setOutlinePageNumbers(n,o)]:[3,5];case 4:r.sent(),r.label=5;case 5:return this.documentOutline=o,this.outlineLoaded.next(this.documentOutline),[4,n.getMetadata()];case 6:return i=r.sent(),this.setCurrentPDFTitle(i.info.Title),[3,8];case 7:return a=r.sent(),this.documentLoadFailed.next(a),[3,8];case 8:return[2]}}))}))},t.prototype.createLoadingTask=function(t){return x.getDocument({url:t,cMapUrl:"assets/minified/cmaps",cMapPacked:!0,withCredentials:!0})},t.prototype.setOutlinePageNumbers=function(t,e){return A(this,void 0,void 0,(function(){var n=this;return N(this,(function(o){return e.forEach((function(e){return A(n,void 0,void 0,(function(){return N(this,(function(n){switch(n.label){case 0:return[4,this.setNestedOutlinePageNumbers(t,e)];case 1:return n.sent(),[2]}}))}))})),[2]}))}))},t.prototype.setNestedOutlinePageNumbers=function(t,e){return A(this,void 0,void 0,(function(){var n,o=this;return N(this,(function(i){switch(i.label){case 0:return n=e,[4,this.getOutlinePageNumber(t,e)];case 1:return n.pageNumber=i.sent(),e.items.forEach((function(e){return A(o,void 0,void 0,(function(){var n;return N(this,(function(o){switch(o.label){case 0:return n=e,[4,this.getOutlinePageNumber(t,e)];case 1:return n.pageNumber=o.sent(),this.setNestedOutlinePageNumbers(t,e),[2]}}))}))})),[2]}}))}))},t.prototype.getOutlinePageNumber=function(t,e){return A(this,void 0,void 0,(function(){var n,o;return N(this,(function(i){switch(i.label){case 0:return n=e.dest,[4,t.getPageIndex(n[0])];case 1:return o=i.sent(),[2,Number(o)+1]}}))}))},t.prototype.downloadFile=function(t,e){this.downloadManager.downloadUrl(t,e)},t.prototype.setPageNumber=function(t){this.pdfViewer.currentPageNumber=t},t.prototype.getPageNumber=function(){return this.pdfViewer.currentPageNumber},t.prototype.changePageNumber=function(t){this.pdfViewer.currentPageNumber+=t},t.prototype.search=function(t){var e=t.reset?"find":"findagain";this.pdfViewer.findController.executeCommand(e,{query:t.searchTerm,phraseSearch:!0,caseSensitive:t.matchCase,entireWord:t.wholeWord,highlightAll:t.highlightAll,findPrevious:t.previous})},t.prototype.clearSearch=function(){this.pdfViewer.eventBus.dispatch("findbarclose")},t.prototype.navigateTo=function(t){t instanceof Object&&(t[1].name.includes("XYZ")||(t[1]={name:"XYZ"},t[2]=t[2]||null,t[3]=t[3]||null),t[4]=this.zoomValue),this.pdfViewer.linkService.navigateTo(t)},t.prototype.setZoom=function(t){this.pdfViewer.currentScaleValue=this.getZoomValue(t),this.zoomValue=this.pdfViewer.currentScaleValue,this.toolbarEvents.zoomValueSubject.next(this.pdfViewer.currentScaleValue)},t.prototype.stepZoom=function(t){this.pdfViewer.currentScaleValue=+this.getZoomValue(+this.pdfViewer.currentScaleValue+t),this.zoomValue=this.pdfViewer.currentScaleValue,this.toolbarEvents.zoomValueSubject.next(this.pdfViewer.currentScaleValue)},t.prototype.getZoomValue=function(t){return isNaN(t)?this.zoomValue:t>5?5:t<.1?.1:+t.toFixed(2)},t.prototype.rotate=function(t){return this.pdfViewer.pagesRotation=(this.pdfViewer.pagesRotation+t)%360},t.prototype.resetRotation=function(t){return this.pdfViewer.pagesRotation=t},t.prototype.getNormalisedPagesRotation=function(){return this.pdfViewer.pagesRotation},t.prototype.getCurrentPDFZoomValue=function(){return this.pdfViewer.currentScaleValue},t.prototype.setCurrentPDFTitle=function(t){this.documentTitle=t},t.prototype.getCurrentPDFTitle=function(){return this.documentTitle},t}(),V=new a.BehaviorSubject(!1),U=new a.Subject,z=new a.Subject,W=new a.Subject,q=new a.BehaviorSubject(!1),G=new a.Subject,Z=new a.BehaviorSubject(!1),J=function(){U.next()},Y=Object.freeze({__proto__:null,enabled:V,sessionLaunch:U,becomingPresenter:z,stoppingPresenting:W,leavingSession:q,sessionExitConfirmed:G,participantsListVisible:Z,launchSession:J,enable:function(){V.next(!0),J()},becomePresenter:function(){z.next()},stopPresenting:function(){W.next()},leaveSession:function(){q.next(!0)},confirmExit:function(){G.next(),Z.next(!1),V.next(!1)}}),K=function(){function t(){this.highlightModeSubject=new a.BehaviorSubject(!1),this.drawModeSubject=new a.BehaviorSubject(!1),this.rotateSubject=new a.Subject,this.searchSubject=new a.Subject,this.searchResultsCountSubject=new a.Subject,this.zoomSubject=new a.Subject,this.stepZoomSubject=new a.Subject,this.zoomValueSubject=new a.BehaviorSubject(1),this.pageCountSubject=new a.Subject,this.printSubject=new a.Subject,this.downloadSubject=new a.Subject,this.setCurrentPageSubject=new a.Subject,this.setCurrentPageInputValueSubject=new a.Subject,this.changePageByDeltaSubject=new a.Subject,this.showCommentSummary=new a.BehaviorSubject(!1),this.grabNDrag=new a.BehaviorSubject(!1),this.saveRotationSubject=new a.Subject,this.redactionMode=new a.BehaviorSubject(!1),this.redactionPreview=new a.Subject,this.applyRedactToDocument=new a.Subject,this.clearAllRedactMarkers=new a.Subject,this.redactWholePage=new a.Subject,this.redactionSerachSubject=new a.Subject,this.redactAllInProgressSubject=new a.BehaviorSubject(!1),this.openRedactionSearch=new a.Subject,this.sidebarOpen=new a.BehaviorSubject(!1),this.sidebarOutlineView=new a.BehaviorSubject(!0),this.searchBarHidden=new a.BehaviorSubject(!0),this.commentsPanelVisible=new a.BehaviorSubject(!1),this.icp=Y}return t.prototype.reset=function(){this.setCurrentPageSubject.next(1),this.zoomValueSubject.next(1),this.highlightModeSubject.next(!1),this.drawModeSubject.next(!1),this.showCommentSummary.next(!1),this.grabNDrag.next(!1)},t.prototype.toggleHighlightMode=function(){!1===this.highlightModeSubject.getValue()?(this.drawModeSubject.next(!1),this.grabNDrag.next(!1),this.highlightModeSubject.next(!0)):this.highlightModeSubject.next(!1)},t.prototype.toggleDrawMode=function(){!1===this.drawModeSubject.getValue()?(this.highlightModeSubject.next(!1),this.grabNDrag.next(!1),this.drawModeSubject.next(!0)):this.drawModeSubject.next(!1)},t.prototype.rotate=function(t){this.rotateSubject.next(t)},t.prototype.search=function(t){this.searchSubject.next(t)},t.prototype.getSearchResultsCount=function(){return this.searchResultsCountSubject.asObservable()},t.prototype.zoom=function(t){this.zoomSubject.next(t)},t.prototype.stepZoom=function(t){this.stepZoomSubject.next(t)},t.prototype.getZoomValue=function(){return this.zoomValueSubject.asObservable()},t.prototype.getPageCount=function(){return this.pageCountSubject.asObservable()},t.prototype.print=function(){this.printSubject.next()},t.prototype.download=function(){this.downloadSubject.next()},t.prototype.setPage=function(t){this.setCurrentPageSubject.next(t)},t.prototype.incrementPage=function(t){this.changePageByDeltaSubject.next(t)},t.prototype.getCurrentPageNumber=function(){return this.setCurrentPageInputValueSubject.asObservable()},t.prototype.getShowCommentSummary=function(){return this.showCommentSummary.asObservable()},t.prototype.toggleCommentsSummary=function(t){this.showCommentSummary.next(t)},t.prototype.saveRotation=function(){this.saveRotationSubject.next()},t.prototype.toggleGrabNDrag=function(){this.grabNDrag.next(!this.grabNDrag.getValue())},t.prototype.toggleSideBar=function(t){this.sidebarOpen.next(t)},t.prototype.toggleSideBarView=function(t){this.sidebarOutlineView.next(t)},t.prototype.toggleRedactionMode=function(){!1===this.redactionMode.getValue()?(this.drawModeSubject.next(!1),this.grabNDrag.next(!1),this.redactionMode.next(!0)):this.redactionMode.next(!1),this.openRedactionSearch.next(!1)},t.prototype.toggleRedactionPreview=function(t){this.redactionPreview.next(t)},t.prototype.unmarkAll=function(){this.clearAllRedactMarkers.next()},t.prototype.applyRedactionToDocument=function(){this.applyRedactToDocument.next()},t.prototype.redactPage=function(){this.redactWholePage.next()},t.prototype.toggleCommentsPanel=function(t){t&&this.toggleParticipantsList(!t),this.commentsPanelVisible.next(t)},t.prototype.toggleParticipantsList=function(t){t&&this.toggleCommentsPanel(!t),this.icp.participantsListVisible.next(t)},t}();K.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new K},token:K,providedIn:"root"}),K.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}];var X=function(){function t(t){this.toolbarEvents=t,this.linkService=new O.PDFLinkService,this.eventBus=new O.EventBus}return t.prototype.create=function(t){var e=new O.PDFFindController({linkService:this.linkService,eventBus:this.eventBus}),n=new O.PDFViewer({container:t.nativeElement,linkService:this.linkService,findController:e,eventBus:this.eventBus,imageResourcesPath:"/assets/images/",textLayerMode:2});return this.linkService.setViewer(n),this.pdfJsWrapper=new H(n,new O.DownloadManager({}),this.toolbarEvents,new a.Subject,new a.Subject,new a.Subject,new a.Subject,new a.Subject,new a.Subject,new a.Subject),this.pdfJsWrapper},t.prototype.pdfWrapper=function(){return this.pdfJsWrapper},t}();X.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new X(I.ɵɵinject(K))},token:X,providedIn:"root"}),X.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],X.ctorParameters=function(){return[{type:K}]};var Q,tt=function(){function t(){}return t.prototype.printDocumentNatively=function(t){window.open(t).print()},t.prototype.printElementNatively=function(t,e,n){var o=window.open("","","left=0,top=0,width="+e+",height="+n+",toolbar=0,scrollbars=0,status=0"),i=document.head;o.document.body.appendChild(i.cloneNode(!0)),o.document.body.appendChild(t.cloneNode(!0)),o.document.close(),o.focus(),o.print(),o.close()},t}();tt.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new tt},token:tt,providedIn:"root"}),tt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ResponseType=void 0,(Q=t.ResponseType||(t.ResponseType={})).SUCCESS="SUCCESS",Q.FAILURE="FAILURE",Q.UNSUPPORTED="UNSUPPORTED";var et=function(t,e){this.exceptionType=t,this.detail=e},nt=function(){function t(){this.showPrint=!1,this.showDownload=!1,this.showNavigation=!1,this.showZoom=!1,this.showRotate=!1,this.showPresentationMode=!1,this.showRedact=!1,this.showOpenFile=!1,this.showBookmark=!1,this.showHighlightButton=!1,this.showDrawButton=!1,this.showSearchBar=!1,this.showSidebar=!1,this.showCommentSummary=!1,this.showGrabNDragButton=!1,this.showSaveRotationButton=!1}return t.prototype.setup=function(t){for(var e in this.showPrint=!1,this.showDownload=!1,this.showNavigation=!1,this.showZoom=!1,this.showRotate=!1,this.showPresentationMode=!1,this.showRedact=!1,this.showOpenFile=!1,this.showBookmark=!1,this.showHighlightButton=!1,this.showDrawButton=!1,this.showSearchBar=!1,this.showSidebar=!1,this.showCommentSummary=!1,this.showGrabNDragButton=!1,this.showSaveRotationButton=!1,t)this[e]=t[e]},t}();nt.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new nt},token:nt,providedIn:"root"}),nt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}];var ot={showPrint:!0,showDownload:!0,showNavigation:!0,showZoom:!0,showRotate:!0,showSearchBar:!0,showSidebar:!0,showGrabNDragButton:!0,showCommentSummary:!0,showPresentationMode:!0,showRedact:!0},it={showPrint:!0,showDownload:!0,showZoom:!0,showRotate:!0,showGrabNDragButton:!0,showCommentSummary:!0,showRedact:!0},at={showDownload:!0},st={showDownload:!0,showPrint:!0},rt="[Document] Set Document Id",ct="[Document] Position Updated",lt="[Document] Add Pages",ut="[Document] Convert",pt="[Document] Convert Success",dt="[Document] Convert Fail",ht="[Document] Clear Convert Doc Url",mt="[Document] Load Rotation",gt="[Document] Load Rotation Success",bt="[Document] Load Rotation Fail",vt="[Document] Save Rotation",ft="[Document] Save Rotation Success",yt=function(t){this.payload=t,this.type=rt},wt=function(t){this.payload=t,this.type=lt},St=function(t){this.payload=t,this.type=ct},kt=function(t){this.payload=t,this.type=ut},Et=function(t){this.payload=t,this.type=pt},Ct=function(t){this.payload=t,this.type=dt},It=function(){this.type=ht},Pt=function(t){this.payload=t,this.type=mt},Ot=function(t){this.payload=t,this.type=gt},xt=function(t){this.payload=t,this.type=bt},jt=function(t){this.payload=t,this.type=vt},Tt=function(t){this.payload=t,this.type=ft},Rt=function(t){this.payload=t,this.type="[Document] Save Rotation Fail"},_t="[Tags] Add Filter Tags",Bt="[Tags] Clear Filter Tags",Dt=function(t){this.payload=t,this.type=_t},At=function(){this.type=Bt},Nt="[Icp] Set Case Id",Mt="[Icp] Load Session",Ft="[Icp] Join Socket Session",Lt="[Icp] Socket Session Joined",$t="[Icp] Leave Socket Session",Ht="[Icp] Presenter Updated",Vt="[Icp] Participant List Updated",Ut=function(t){this.payload=t,this.type=Nt},zt=function(t){this.payload=t,this.type=Mt},Wt=function(t){this.payload=t,this.type="[Icp] Load Session Failure"},qt=function(t){this.payload=t,this.type=Ft},Gt=function(t){this.payload=t,this.type=Lt},Zt=function(){this.type=$t},Jt=function(t){this.payload=t,this.type=Ht},Yt=function(t){this.payload=t,this.type=Vt},Kt={convertedDocument:void 0,documentId:void 0,pdfPosition:void 0,pages:{},hasDifferentPageSize:!1,rotation:void 0,rotationLoaded:!1,loading:!1,loaded:!1};function Xt(t,e){switch(void 0===t&&(t=Kt),e.type){case pt:var n={url:e.payload,error:void 0};return Object.assign(Object.assign({},t),{convertedDocument:n});case dt:n={url:void 0,error:e.payload};return Object.assign(Object.assign({},t),{convertedDocument:n});case ht:n=void 0;return Object.assign(Object.assign({},t),{convertedDocument:n});case mt:return Object.assign(Object.assign({},t),{rotationLoaded:!1});case gt:var o=(i=e.payload)?i.rotationAngle:0;return Object.assign(Object.assign({},t),{rotation:o,rotationLoaded:!0});case bt:return Object.assign(Object.assign({},t),{rotation:0,rotationLoaded:!0});case ft:var i;o=(i=e.payload).rotationAngle;return Object.assign(Object.assign({},t),{rotation:o});case rt:return Object.assign(Object.assign({},t),{documentId:e.payload});case lt:var a,s,r=e.payload,c={},l=t.hasDifferentPageSize;return r.forEach((function(t){var e;l||!a||!s||a===t.div.scrollHeight&&s===t.div.scrollWidth?(a=t.div.scrollHeight,s=t.div.scrollWidth):l=!0;var n={styles:{left:t.div.offsetLeft,height:t.div.scrollHeight,width:t.div.scrollWidth},scaleRotation:{scale:t.scale,rotation:t.rotation},viewportScale:t.viewportScale};c=Object.assign(Object.assign({},c),((e={})[t.id]=n,e))})),Object.assign(Object.assign({},t),{pages:c,hasDifferentPageSize:l});case ct:var u=e.payload;return Object.assign(Object.assign({},t),{pdfPosition:u})}return t}var Qt=function(t){return t.pages},te="[Annotations] Load Annotation Set",ee="[Annotations] Load Annotation Set Success",ne="[Annotations] Load Annotation Set Fail",oe="[Annotations] Save Annotation",ie="[Annotations] Save Annotation Success",ae="[Annotations] Save Annotation Fail",se="[Annotations] Add or Edit Comment",re="[Annotations] Delete Annotation",ce="[Annotations] Delete Annotation Success",le="[Annotations] Delete Annotation Fail",ue="[Annotations] Select Annotation",pe="[Comments] Search Comments",de="[Comments] Apply Comment Summary Filter",he="[Comments] Clear Comment Summary Filter",me=function(t){this.payload=t,this.type=te},ge=function(t){this.payload=t,this.type=ee},be=function(t){this.payload=t,this.type=ne},ve=function(t){this.payload=t,this.type=oe},fe=function(t){this.payload=t,this.type=ie},ye=function(t){this.payload=t,this.type=ae},we=function(t){this.payload=t,this.type=se},Se=function(t){this.payload=t,this.type=re},ke=function(t){this.payload=t,this.type=ce},Ee=function(t){this.payload=t,this.type=le},Ce=function(t){this.payload=t,this.type=ue},Ie=function(t){this.payload=t,this.type=pe},Pe=function(t){this.payload=t,this.type=de},Oe=function(){this.type=he},xe=function(){function t(){}return t.groupByKeyEntities=function(t,e){return t.reduce((function(t,n){var o;return Object.assign(t,((o={})[n[e]]=(t[n[e]]||[]).concat(n),o))}),{})},t.generateCommentsEntities=function(t){return t.reduce((function(t,e){var n;if(e.comments.length){var o=Object.assign(Object.assign({},e.comments[0]||""),{tags:L(e.tags||[])});return Object.assign(Object.assign({},t),((n={})[e.id]=o,n))}return Object.assign({},t)}),{})},t.genTagNameEntities=function(t){var e=this,n=t.filter((function(t){return t.comments.length&&t.tags.length})).map((function(t){return e.groupByKeyEntities(t.tags,"name")})).reduce((function(t,e){return Object.assign(Object.assign({},t),e)}),{});return this.genNameEnt(t,n)},t.genNameEnt=function(t,e){return Object.keys(e).reduce((function(e,n){var o,i=t.filter((function(t){return t.tags.find((function(t){return t.name===n}))})).map((function(t){return t.id})).reduce((function(t,e){var n;return Object.assign(Object.assign({},t),((n={})[e]=e,n))}),{});return Object.assign(Object.assign({},e),((o={})[n]=i,o))}),{})},t.generateAnnotationEntities=function(t){return t.reduce((function(t,e){var n,o=Object.assign(Object.assign({},e),{positionTop:e.rectangles[0].y});return Object.assign(Object.assign({},t),((n={})[e.id]=o,n))}),{})},t.generateRedactionEntities=function(t){return t.reduce((function(t,e){var n;return Object.assign(Object.assign({},t),((n={})[e.redactionId]=e,n))}),{})},t.resetCommentEntSelect=function(t){return Object.keys(t).reduce((function(e,n){return e[n]=Object.assign(Object.assign({},t[n]),{editable:!1,selected:!1}),e}),{})},t.filterCommentsSummary=function(t,e){if(Object.keys(e).length){var n=Object.keys(e.tagFilters).filter((function(t){return!0===e.tagFilters[t]})).length,o=e.dateRangeFrom||e.dateRangeTo,i=t.filter((function(t){var n=!1,i=!1;if(e.hasOwnProperty("tagFilters")&&Object.keys(e.tagFilters).forEach((function(o){if(e.tagFilters[o])return t.tags.forEach((function(t){t.name!==o||n||(n=!0)}))})),o){var a=T.default(t.lastModifiedDate),s=null!==e.dateRangeFrom?T.default(e.dateRangeFrom):void 0,r=null!==e.dateRangeTo?T.default(e.dateRangeTo):void 0;r&&s&&a>s&&a<r&&(i=!0),r&&!s&&a<=r&&(i=!0),s&&!r&&a>s&&(i=!0)}return n||i}));return n||o?i:t}return t},t}(),je={annotationSet:{},annotationEntities:{},commentEntities:{},annotationPageEntities:{},selectedAnnotation:null,commentSearchQueries:{commentSearch:""},commentSummaryFilters:{hasFilter:!1,filters:{}},loading:!1,loaded:!1};function Te(t,e){var n,o,i,a,s;switch(void 0===t&&(t=je),e.type){case te:var r=Object.assign(Object.assign({},t.annotationSet),{documentId:e.payload});return Object.assign(Object.assign({},je),{annotationSet:r,loading:!0});case ee:case ne:r=200===e.payload.status?e.payload.body:Object.assign(Object.assign({},t.annotationSet),{annotations:[],id:j.default()});var c=xe.generateAnnotationEntities(r.annotations),l=xe.groupByKeyEntities(r.annotations,"page"),u=xe.generateCommentsEntities(r.annotations);return Object.assign(Object.assign({},t),{annotationSet:r,annotationEntities:c,annotationPageEntities:l,commentEntities:u,loading:!1,loaded:!0});case ie:var p=e.payload,d=Object.assign(Object.assign({},t.annotationEntities),((n={})[p.id]=p,n)),h=Object.keys(d).map((function(t){return d[t]})),m=(c=xe.generateAnnotationEntities(h),l=xe.groupByKeyEntities(h,"page"),u=xe.generateCommentsEntities(h),Object.assign(Object.assign({},t.selectedAnnotation),{annotationId:p.id,editable:!1}));return Object.assign(Object.assign({},t),{annotationEntities:c,annotationPageEntities:l,commentEntities:u,selectedAnnotation:m,loading:!1,loaded:!0});case ce:var g=e.payload,b=t.annotationEntities[g].page;delete(c=Object.assign({},t.annotationEntities))[g];var v=L(t.annotationPageEntities[b].filter((function(t){return t.id!==g})));l=Object.assign(Object.assign({},t.annotationPageEntities),((o={})[b]=v,o)),u=Object.assign({},t.commentEntities);return t.commentEntities[g]&&delete u[g],Object.assign(Object.assign({},t),{annotationEntities:c,annotationPageEntities:l,commentEntities:u});case se:var f=((i={})[e.payload.annotationId]=e.payload,i),y=Object.assign(Object.assign({},t.commentEntities),f);return Object.assign(Object.assign({},t),{commentEntities:y});case ue:var w=e.payload,S=Object.assign(Object.assign({},t.commentEntities[w.annotationId]),{editable:w.editable,selected:w.selected}),k=xe.resetCommentEntSelect(Object.assign({},t.commentEntities));u=w.annotationId&&t.commentEntities[w.annotationId]?Object.assign(Object.assign({},k),((a={})[w.annotationId]=S,a)):Object.assign({},k);return Object.assign(Object.assign({},t),{commentEntities:u,selectedAnnotation:e.payload});case pe:var E=Object.assign(Object.assign({},t.commentSearchQueries),{commentSearch:e.payload});u=xe.resetCommentEntSelect(Object.assign({},t.commentEntities));return Object.assign(Object.assign({},t),{commentEntities:u,commentSearchQueries:E});case de:var C=e.payload,I={hasFilter:(s=!1,C.tagFilters&&Object.keys(C.tagFilters).map((function(t){C.tagFilters[t]&&!s&&(s=!0)})),s||!!C.dateRangeFrom||!!C.dateRangeTo),filters:C};return Object.assign(Object.assign({},t),{commentSummaryFilters:I});case he:return Object.assign(Object.assign({},t),{commentSummaryFilters:Object.assign({},je.commentSummaryFilters)})}return t}var Re=function(t){return t.annotationSet},_e=function(t){return t.commentEntities},Be=function(t){return t.annotationPageEntities},De=function(t){return t.annotationEntities},Ae=function(t){return t.selectedAnnotation},Ne=function(t){return t.commentSearchQueries},Me=function(t){return t.commentSummaryFilters},Fe={tagNameEnt:{},annotations:[],filteredPageEntities:{},filteredComments:{},formFilterState:{},filters:[]};function Le(t,e){switch(void 0===t&&(t=Fe),e.type){case te:return Object.assign(Object.assign({},t),Fe);case ee:var n=e.payload.body.annotations,o=xe.genTagNameEntities(n);return Object.assign(Object.assign({},t),{tagNameEnt:o,annotations:n});case ie:var i=e.payload,a=L(t.annotations).filter((function(t){return t.id!==i.id}))||[];n=L(a,[i]),o=xe.genTagNameEntities(n);return Object.assign(Object.assign({},t),{annotations:n,tagNameEnt:o});case ce:var s=e.payload,r=(n=L(t.annotations).filter((function(t){return t.id!==s})),o=xe.genTagNameEntities(n),xe.groupByKeyEntities(n,"page"));return delete(u=Object.assign({},t.filteredComments))[s],Object.assign(Object.assign({},t),{annotations:n,tagNameEnt:o,filteredComments:u,filteredPageEntities:r,filters:[]});case _t:var c=e.payload,l=Object.keys(c).reduce((function(t,e){return c[e]?L(t,[e]):t}),[]),u=l.reduce((function(e,n){return Object.assign(Object.assign({},e),t.tagNameEnt[n])}),{});n=Object.keys(u).map((function(e){return t.annotations.filter((function(t){return t.id===e}))[0]})),r=xe.groupByKeyEntities(n,"page");return Object.assign(Object.assign({},t),{filters:l,filteredComments:u,filteredPageEntities:r});case Bt:return Object.assign(Object.assign({},t),{filters:[],filteredComments:{},filteredPageEntities:{}})}return t}var $e=function(t){return t.filteredComments},He=function(t){return t.filteredPageEntities},Ve="[Bookmarks] Load Bookmarks",Ue="[Bookmarks] Load Bookmarks Success",ze="[Bookmarks] Load Bookmarks Failure",We="[Bookmarks] Create Bookmark",qe="[Bookmarks] Create Bookmark Success",Ge="[Bookmarks] Delete Bookmark",Ze="[Bookmarks] Delete Bookmark Success",Je="[Bookmarks] Move Bookmark",Ye="[Bookmarks] Move Bookmark Success",Ke="[Bookmarks] Update Bookmark",Xe="[Bookmarks] Update Bookmark Success",Qe=function(){this.type=Ve},tn=function(t){this.payload=t,this.type=Ue},en=function(t){this.payload=t,this.type=ze},nn=function(t){this.payload=t,this.type=We},on=function(t){this.payload=t,this.type=qe},an=function(t){this.payload=t,this.type="[Bookmarks] Create Bookmark Failure"},sn=function(t){this.payload=t,this.type=Ge},rn=function(t){this.payload=t,this.type=Ze},cn=function(t){this.payload=t,this.type="[Bookmarks] Delete Bookmark Failure"},ln=function(t){this.payload=t,this.type=Je},un=function(t){this.payload=t,this.type=Ye},pn=function(t){this.payload=t,this.type="[Bookmarks] Move Bookmark Failure"},dn=function(t){this.payload=t,this.type=Ke},hn=function(t){this.payload=t,this.type=Xe},mn=function(t){this.payload=t,this.type="[Bookmarks] Update Bookmark Failure"},gn=function(t){return t?t.reduce((function(t,e){return e.children&&e.children.length>0?L(t,[e.id],gn(e.children)):L(t,[e.id])}),[]):[]},bn=function(t){return t.reduce((function(t,e){var n;return Object.assign(t,((n={})[e.id]=e,n))}),{})},vn=function(t){for(var e=Object.keys(t),n=function(n){var o=[];e.forEach((function(i){t[i].previous&&e.includes(t[i].previous.toString())||(t[i].index=n,o.push(i))})),o.forEach((function(t){return e.splice(e.indexOf(t),1)})),o=[]},o=0;e.length>0;o++)n(o)},fn={bookmarks:[],bookmarkEntities:{},bookmarkPageEntities:{},editableBookmark:void 0,loaded:!1,loading:!1};function yn(t,e){var n,o;switch(void 0===t&&(t=fn),e.type){case Ve:return Object.assign(Object.assign({},t),{loading:!0});case Ue:case ze:var i=200===e.payload.status?e.payload.body:[],a=bn(i),s=xe.groupByKeyEntities(i,"pageNumber");return Object.assign(Object.assign({},t),{bookmarks:i,bookmarkEntities:a,bookmarkPageEntities:s,loaded:!0});case qe:var r=e.payload,c=Object.assign(Object.assign({},t.bookmarkEntities),((n={})[r.id]=r,n)),l=Object.keys(c).map((function(t){return c[t]})),u=(s=xe.groupByKeyEntities(l,"pageNumber"),r.id);return Object.assign(Object.assign({},t),{bookmarkEntities:c,editableBookmark:u,bookmarkPageEntities:s,loading:!1,loaded:!0});case Ye:var p=bn(e.payload);a=Object.assign(Object.assign({},t.bookmarkEntities),p);return Object.assign(Object.assign({},t),{bookmarkEntities:a,loading:!1,loaded:!0});case Ze:var d=e.payload,h=Object.assign({},t.bookmarkEntities),m=Object.assign({},t.bookmarkPageEntities),g={};return d.forEach((function(t){void 0!==g[h[t].pageNumber]&&g[h[t].pageNumber].length>0?g[h[t].pageNumber].push(t):g[h[t].pageNumber]=[t],delete h[t]})),Object.entries(g).forEach((function(t){var e=F(t,2),n=e[0],o=e[1];m[n]=m[n].filter((function(t){return!o.includes(t.id)}))})),Object.assign(Object.assign({},t),{bookmarkEntities:h,bookmarkPageEntities:m,loading:!1,loaded:!0});case Xe:r=e.payload;var b=Object.assign(Object.assign({},t.bookmarkEntities),((o={})[r.id]=Object.assign({},r),o));l=Object.keys(b).map((function(t){return b[t]})),s=xe.groupByKeyEntities(l,"pageNumber"),u=void 0;return Object.assign(Object.assign({},t),{bookmarkEntities:b,editableBookmark:u,bookmarkPageEntities:s,loading:!1,loaded:!0})}return t}var wn="[Redaction] Load Redaction",Sn="[Redaction] Load Redaction Success",kn="[Redaction] Save Redaction",En="[Redaction] Save Redaction Success",Cn="[Redaction] Save bulk Redaction",In="[Redaction] Save bulk Redaction Success",Pn="[Redaction] Delete Redaction",On="[Redaction] Delete Redaction Success",xn="[Redaction] Select Redaction",jn="[Redaction] Redact",Tn="[Redaction] Redact Success",Rn="[Redaction] Reset Redacted Document",_n="[Redaction] Unmark All",Bn="[Redaction] Unmark All Success",Dn=function(t){this.payload=t,this.type=wn},An=function(t){this.payload=t,this.type=Sn},Nn=function(t){this.payload=t,this.type="[Redaction] Load Redaction Fail"},Mn=function(t){this.payload=t,this.type=kn},Fn=function(t){this.payload=t,this.type=En},Ln=function(t){this.payload=t,this.type="[Redaction] Save Redaction Fail"},$n=function(t){this.payload=t,this.type="[Redaction] Save bulk Redaction Fail"},Hn=function(t){this.payload=t,this.type=Cn},Vn=function(t){this.payload=t,this.type=In},Un=function(t){this.payload=t,this.type=Pn},zn=function(t){this.payload=t,this.type=On},Wn=function(t){this.payload=t,this.type="[Redaction] Delete Redaction Fail"},qn=function(t){this.payload=t,this.type=xn},Gn=function(t){this.payload=t,this.type=jn},Zn=function(t){this.payload=t,this.type=Tn},Jn=function(t){this.payload=t,this.type="[Redaction] Redact Fail"},Yn=function(){this.type=Rn},Kn=function(t){this.payload=t,this.type=_n},Xn=function(){this.type=Bn},Qn={redactionEntities:{},redactionPageEntities:{},selectedRedaction:{},redactedDocumentInfo:void 0,documentId:void 0};function to(t,e){var n,o;switch(void 0===t&&(t=Qn),e.type){case wn:return Object.assign(Object.assign({},t),Qn);case Sn:if(s=e.payload){var i=xe.generateRedactionEntities(s),a=xe.groupByKeyEntities(s,"page");return Object.assign(Object.assign({},t),{redactionEntities:i,redactionPageEntities:a})}return Object.assign({},t);case En:var s=e.payload,r=Object.assign(Object.assign({},t.redactionEntities),((n={})[s.redactionId]=s,n)),c=Object.keys(r).map((function(t){return r[t]}));a=xe.groupByKeyEntities(c,"page");return Object.assign(Object.assign({},t),{redactionEntities:r,redactionPageEntities:a});case In:var l=Object.assign.apply(Object,L([{}],e.payload.searchRedactions.map((function(t){var e;return(e={})[t.redactionId]=t,e})))),u=Object.assign(Object.assign({},t.redactionEntities),l);c=Object.keys(u).map((function(t){return u[t]})),a=xe.groupByKeyEntities(c,"page");return Object.assign(Object.assign({},t),{redactionEntities:u,redactionPageEntities:a});case xn:case ue:return Object.assign(Object.assign({},t),{selectedRedaction:e.payload});case On:var p=e.payload.page,d=e.payload.redactionId;delete(i=Object.assign({},t.redactionEntities))[d];var h=L(t.redactionPageEntities[p].filter((function(t){return t.redactionId!==d})));a=Object.assign(Object.assign({},t.redactionPageEntities),((o={})[p]=h,o));return Object.assign(Object.assign({},t),{redactionPageEntities:a,redactionEntities:i});case Tn:var m=e.payload;return Object.assign(Object.assign(Object.assign({},t),Qn),{redactedDocumentInfo:m});case Rn:return Object.assign(Object.assign({},t),{redactedDocumentInfo:void 0});case Bn:return Object.assign(Object.assign({},t),Qn)}return t}var eo={session:null,presenter:null,client:null,participants:[]};function no(t,e){switch(void 0===t&&(t=eo),e.type){case Nt:var n=e.payload,o=Object.assign(Object.assign({},t.session),{caseId:n});return Object.assign(Object.assign({},t),{session:o});case Lt:o=e.payload.session;var i=e.payload.participantInfo;return Object.assign(Object.assign({},t),{session:o,client:i.client,presenter:i.presenter});case Vt:var a=e.payload,s=Object.keys(a).map((function(t){return{id:t,username:a[t]}}));return Object.assign(Object.assign({},t),{participants:s});case Ht:var r=e.payload;return Object.assign(Object.assign({},t),{presenter:r});case $t:return Object.assign(Object.assign({},t),eo)}return t}var oo,io={document:Xt,annotations:Te,tags:Le,bookmarks:yn,redactions:to,icp:no},ao=r.createFeatureSelector("media-viewer"),so=r.createSelector(ao,(function(t){return t.document})),ro=r.createSelector(so,Qt),co=(r.createSelector(ro,(function(t){return Object.values(t)})),r.createSelector(so,(function(t){return t.documentId}))),lo=r.createSelector(so,(function(t){return t.pdfPosition})),uo=r.createSelector(so,(function(t){return t.hasDifferentPageSize})),po=r.createSelector(so,(function(t){return t.convertedDocument})),ho=r.createSelector(so,(function(t){return t.rotation})),mo=r.createSelector(so,(function(t){return t.rotationLoaded})),go=function(){function t(){this.textHighlight=new a.Subject,this.boxHighlight=new a.Subject,this.ctxToolbarCleared=new a.Subject,this.navigationEvent=new a.Subject}return t.prototype.textSelected=function(t){this.textHighlight.next(t)},t.prototype.boxSelected=function(t){this.boxHighlight.next(t)},t.prototype.clearCtxToolbar=function(){this.ctxToolbarCleared.next()},t.prototype.goToDestination=function(t){this.navigationEvent.next(t)},t}();go.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new go},token:go,providedIn:"root"}),go.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],go.ctorParameters=function(){return[]},function(t){t.SESSION_JOINED="IcpClientJoinedSession",t.CLIENT_DISCONNECTED="IcpClientDisconnectedFromSession",t.NEW_PARTICIPANT_JOINED="IcpNewParticipantJoinedSession",t.REMOVE_PARTICIPANT="IcpRemoveParticipantFromList",t.PARTICIPANTS_UPDATED="IcpParticipantsListUpdated",t.UPDATE_PRESENTER="IcpNewPresenterStartsPresenting",t.PRESENTER_UPDATED="IcpPresenterUpdated",t.UPDATE_SCREEN="IcpUpdateScreen",t.SCREEN_UPDATED="IcpScreenUpdated",t.SESSION_JOIN="IcpClientJoinSession",t.SESSION_LEAVE="IcpClientLeaveSession"}(oo||(oo={}));var bo=function(){function t(){this.connected$=new a.BehaviorSubject(!1),this.sessionJoined$=new a.Subject,this.presenterUpdated$=new a.Subject,this.clientDisconnected$=new a.Subject,this.participantUpdated$=new a.Subject,this.newParticipantJoined$=new a.Subject,this.screenUpdated$=new a.Subject}return t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.connect=function(t){var e=this;return this.getSocketClient(t).subscribe((function(t){t.onopen=function(t){e.connected$.next(!0)},t.onmessage=function(t){console.log("onmessage");var n=JSON.parse(t.data);n.data&&n.data.eventName&&e.messageEventHandller(n.data.eventName,n.data.data)},t.onerror=function(t){console.log("onerror")},t.onclose=function(t){console.log("onclose")}}))},t.prototype.connected=function(){return this.connected$.asObservable()},t.prototype.join=function(t){this.emit(oo.SESSION_JOIN,t)},t.prototype.leave=function(t){this.emit(oo.SESSION_LEAVE,t),this.subscription.unsubscribe()},t.prototype.emit=function(t,e){this.socket.send(JSON.stringify({type:"event",event:t,data:e}))},t.prototype.listen=function(t){switch(t){case oo.SESSION_JOINED:return this.sessionJoined$.asObservable();case oo.PRESENTER_UPDATED:return this.presenterUpdated$.asObservable();case oo.CLIENT_DISCONNECTED:return this.clientDisconnected$.asObservable();case oo.PARTICIPANTS_UPDATED:return this.participantUpdated$.asObservable();case oo.NEW_PARTICIPANT_JOINED:return this.newParticipantJoined$.asObservable();case oo.SCREEN_UPDATED:return this.screenUpdated$.asObservable()}},t.prototype.messageEventHandller=function(t,e){switch(t){case oo.SESSION_JOINED:this.sessionJoined$.next(e);break;case oo.PRESENTER_UPDATED:this.presenterUpdated$.next(e);break;case oo.CLIENT_DISCONNECTED:this.clientDisconnected$.next();break;case oo.PARTICIPANTS_UPDATED:this.participantUpdated$.next(e);break;case oo.NEW_PARTICIPANT_JOINED:this.newParticipantJoined$.next();break;case oo.SCREEN_UPDATED:this.screenUpdated$.next(e)}},t.prototype.getSocketClient=function(t){return this.socket=new WebSocket(t,"json.webpubsub.azure.v1"),a.of(this.socket)},t}();bo.decorators=[{type:e.Injectable}],bo.ctorParameters=function(){return[]};var vo=function(){function t(t){this.socket=t}return t.prototype.joinSession=function(t,e){var n=this;return this.session=e,this.socket.connect(e.connectionUrl),this.socket.connected().subscribe((function(e){e&&n.socket.join(Object.assign(Object.assign({},n.session),{username:t}))})),this.socket.listen(oo.SESSION_JOINED)},t.prototype.leaveSession=function(){this.socket.leave(this.session)},t.prototype.newParticipantJoined=function(){return this.socket.listen(oo.NEW_PARTICIPANT_JOINED)},t.prototype.clientDisconnected=function(){return this.socket.listen(oo.CLIENT_DISCONNECTED)},t.prototype.removeParticipant=function(t){this.socket.emit(oo.REMOVE_PARTICIPANT,{participantId:t,caseId:this.session.caseId})},t.prototype.participantListUpdated=function(){return this.socket.listen(oo.PARTICIPANTS_UPDATED)},t.prototype.updatePresenter=function(t){this.socket.emit(oo.UPDATE_PRESENTER,Object.assign(Object.assign({},this.session),{presenterId:t.id,presenterName:t.username}))},t.prototype.presenterUpdated=function(){return this.socket.listen(oo.PRESENTER_UPDATED)},t.prototype.updateScreen=function(t){var e={body:t,caseId:this.session.caseId};this.socket.emit(oo.UPDATE_SCREEN,e)},t.prototype.screenUpdated=function(){return this.socket.listen(oo.SCREEN_UPDATED)},t}();vo.decorators=[{type:e.Injectable}],vo.ctorParameters=function(){return[{type:bo}]};var fo=r.createSelector(ao,(function(t){return t.icp})),yo=r.createSelector(fo,(function(t){return t.session})),wo=r.createSelector(yo,(function(t){return null===t?null:t.caseId})),So=r.createSelector(fo,(function(t){return t.presenter})),ko=r.createSelector(So,(function(t){return null===t?null:t.username})),Eo=r.createSelector(fo,(function(t){return t.client})),Co=r.createSelector(So,Eo,(function(t,e){return null===t?void 0:t.id===e.id})),Io=r.createSelector(fo,(function(t){return t.participants})),Po=function(){function t(t,e,n){this.toolbarEvents=t,this.socketService=e,this.store=n}return t.prototype.update=function(t){t?this.subscribe():this.unsubscribe()},t.prototype.subscribe=function(){var t=this;this.$subscription||(this.$subscription=this.store.pipe(r.select(lo)).subscribe((function(e){t.pdfPosition=e,t.onPositionUpdate(e)})),this.$subscription.add(this.store.pipe(r.select(So)).subscribe((function(e){t.presenter=e}))),this.$subscription.add(this.socketService.newParticipantJoined().subscribe((function(){return t.onNewParticipantJoined()}))))},t.prototype.unsubscribe=function(){this.$subscription&&(this.$subscription.unsubscribe(),this.$subscription=void 0)},t.prototype.onPositionUpdate=function(t){var e={pdfPosition:t,document:void 0};this.socketService.updateScreen(e)},t.prototype.onNewParticipantJoined=function(){this.onPositionUpdate(this.pdfPosition),this.socketService.updatePresenter(this.presenter)},t}();Po.decorators=[{type:e.Injectable}],Po.ctorParameters=function(){return[{type:K},{type:vo},{type:r.Store}]};var Oo=function(){function t(t,e,n,o){this.toolbarEvents=t,this.viewerEvents=e,this.socketService=n,this.store=o}return t.prototype.update=function(t){t?this.subscribe():this.unsubscribe()},t.prototype.subscribe=function(){var t=this;this.$subscription||(this.$subscription=this.socketService.screenUpdated().subscribe((function(e){return t.followScreenUpdate(e)})))},t.prototype.unsubscribe=function(){this.$subscription&&(this.$subscription.unsubscribe(),this.$subscription=void 0)},t.prototype.followScreenUpdate=function(t){var e=this,n=t.pdfPosition;n&&this.viewerEvents.goToDestination([n.pageNumber-1,{name:"XYZ"},n.left,n.top]),this.store.pipe(r.select(lo),s.take(1)).subscribe((function(t){var o=(n.rotation-t.rotation)%360;0!==o&&e.toolbarEvents.rotate(o)}))},t}();Oo.decorators=[{type:e.Injectable}],Oo.ctorParameters=function(){return[{type:K},{type:go},{type:vo},{type:r.Store}]};var xo=function(){function t(t,e,n,o,i,a){var c=this;this.toolbarEvents=t,this.viewerEvents=e,this.socketService=n,this.presenterSubscriptions=o,this.followerSubscriptions=i,this.store=a,this.subscription=this.store.pipe(r.select(wo),s.filter((function(t){return!!t}))).subscribe((function(t){c.caseId=t})),this.subscription.add(this.toolbarEvents.icp.sessionLaunch.subscribe((function(){c.caseId&&c.launchSession()})))}return t.prototype.ngOnDestroy=function(){this.unsubscribeSession(),this.subscription.unsubscribe()},t.prototype.launchSession=function(){var t=this;this.store.dispatch(new zt(this.caseId)),this.subscription.add(this.store.pipe(r.select(yo),s.filter((function(t){return!!t&&Object.keys(t).length>1})),s.take(1)).subscribe((function(){t.setUpSessionSubscriptions()})))},t.prototype.setUpSessionSubscriptions=function(){var t=this;this.sessionSubscription=this.toolbarEvents.icp.becomingPresenter.subscribe((function(){return t.becomePresenter()})),this.sessionSubscription.add(this.toolbarEvents.icp.stoppingPresenting.subscribe((function(){return t.stopPresenting()}))),this.sessionSubscription.add(this.toolbarEvents.icp.sessionExitConfirmed.subscribe((function(){return t.leavePresentation()}))),this.sessionSubscription.add(this.store.pipe(r.select(So)).subscribe((function(e){return t.presenter=e}))),this.sessionSubscription.add(this.store.pipe(r.select(Eo)).subscribe((function(e){return t.client=e}))),this.sessionSubscription.add(this.store.pipe(r.select(Co)).subscribe((function(e){t.isPresenter=e,t.presenterSubscriptions.update(e),t.followerSubscriptions.update(!e)}))),this.sessionSubscription.add(this.socketService.clientDisconnected().subscribe((function(e){return t.clientDisconnected(e)}))),this.sessionSubscription.add(this.socketService.presenterUpdated().subscribe((function(e){t.store.dispatch(new Jt(e))}))),this.sessionSubscription.add(this.socketService.participantListUpdated().subscribe((function(e){t.store.dispatch(new Yt(e))})))},t.prototype.unsubscribeSession=function(){this.presenterSubscriptions.update(!1),this.followerSubscriptions.update(!1),this.sessionSubscription.unsubscribe()},t.prototype.leavePresentation=function(){this.isPresenter&&this.stopPresenting(),this.removeParticipant(this.client.id),this.socketService.leaveSession(),this.store.dispatch(new Zt),this.unsubscribeSession()},t.prototype.stopPresenting=function(){this.socketService.updatePresenter({username:"",id:""})},t.prototype.becomePresenter=function(){this.socketService.updatePresenter(this.client)},t.prototype.clientDisconnected=function(t){t===this.presenter.id&&this.stopPresenting(),this.removeParticipant(t)},t.prototype.removeParticipant=function(t){this.socketService.removeParticipant(t)},t}();xo.decorators=[{type:e.Injectable}],xo.ctorParameters=function(){return[{type:K},{type:go},{type:vo},{type:Po},{type:Oo},{type:r.Store}]};var jo=function(){function n(t,n,o,i,a,r,c,l){var u=this;this.store=t,this.icpStore=n,this.pdfJsWrapperFactory=o,this.printService=i,this.toolbarEvents=a,this.viewerEvents=r,this.icpService=c,this.toolbarButtons=l,this.mediaLoadStatus=new e.EventEmitter,this.pdfViewerException=new e.EventEmitter,this.documentTitle=new e.EventEmitter,this.pageHeights=[],this.rotation=0,this.zoom=1,this.loadingDocument=!1,this.hasDifferentPageSize=!1,this.enableGrabNDrag=!1,this.highlightMode=a.highlightModeSubject.pipe(s.tap((function(){u.store.dispatch(new At)}))),this.drawMode=a.drawModeSubject}return n.prototype.ngAfterContentInit=function(){return A(this,void 0,void 0,(function(){var t=this;return N(this,(function(e){return this.pdfWrapper.documentLoadProgress.subscribe((function(e){return t.onDocumentLoadProgress(e)})),this.pdfWrapper.documentLoaded.subscribe((function(){return t.onDocumentLoaded()})),this.pdfWrapper.documentLoadFailed.subscribe((function(e){return t.onDocumentLoadFailed(e)})),this.pdfWrapper.outlineLoaded.subscribe((function(e){return t.documentOutline=e})),this.pdfWrapper.pageRendered.subscribe((function(e){return t.updatePages(e)})),this.$subscription=this.toolbarEvents.printSubject.subscribe((function(){return t.printService.printDocumentNatively(t.url)})),this.$subscription.add(this.toolbarEvents.downloadSubject.subscribe((function(){return t.pdfWrapper.downloadFile(t.downloadUrl||t.url,t.downloadFileName)}))),this.$subscription.add(this.toolbarEvents.rotateSubject.subscribe((function(e){return t.rotateDocument(e)}))),this.$subscription.add(this.toolbarEvents.zoomSubject.subscribe((function(e){return t.setZoom(e)}))),this.$subscription.add(this.toolbarEvents.stepZoomSubject.subscribe((function(e){return t.stepZoom(e)}))),this.$subscription.add(this.toolbarEvents.searchSubject.subscribe((function(e){return t.pdfWrapper.search(e)}))),this.$subscription.add(this.toolbarEvents.setCurrentPageSubject.subscribe((function(e){return t.pdfWrapper.setPageNumber(e)}))),this.$subscription.add(this.toolbarEvents.changePageByDeltaSubject.subscribe((function(e){return t.pdfWrapper.changePageNumber(e)}))),this.$subscription.add(this.toolbarEvents.grabNDrag.subscribe((function(e){return t.enableGrabNDrag=e}))),this.$subscription.add(this.toolbarEvents.commentsPanelVisible.subscribe((function(e){t.showCommentsPanel=e}))),this.$subscription.add(this.viewerEvents.navigationEvent.subscribe((function(e){return t.goToDestination(e)}))),this.$subscription.add(this.toolbarEvents.icp.participantsListVisible.subscribe((function(e){return t.showIcpParticipantsList=e}))),this.$subscription.add(this.pdfWrapper.positionUpdated.asObservable().pipe(s.throttleTime(500,a.asyncScheduler,{leading:!0,trailing:!0})).subscribe((function(e){return t.store.dispatch(new St(e.location))}))),[2]}))}))},n.prototype.ngOnChanges=function(t){return A(this,void 0,void 0,(function(){var e=this;return N(this,(function(n){switch(n.label){case 0:return this.pdfWrapper||(this.pdfWrapper=this.pdfJsWrapperFactory.create(this.viewerContainer)),t.url&&this.pdfWrapper?[4,this.loadDocument()]:[3,2];case 1:n.sent(),this.enableRedactions&&this.toolbarEvents.redactionMode.pipe(s.filter((function(t){return!!t}))).subscribe((function(){return e.resetRotation()})),n.label=2;case 2:return t.caseId&&this.icpStore.dispatch(new Ut(this.caseId)),[2]}}))}))},n.prototype.resetRotation=function(){this.hasDifferentPageSize&&(this.pdfWrapper.resetRotation(0),this.rotation=0)},n.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},n.prototype.loadDocument=function(){return A(this,void 0,void 0,(function(){var t=this;return N(this,(function(e){switch(e.label){case 0:return this.initDocumentProgress(),[4,this.pdfWrapper.loadDocument(this.url)];case 1:return e.sent(),this.documentTitle.emit(this.pdfWrapper.getCurrentPDFTitle()),this.setPageHeights(),this.$subscription.add(this.store.pipe(r.select(uo)).subscribe((function(e){return t.hasDifferentPageSize=e}))),[2]}}))}))},n.prototype.onDocumentLoadProgress=function(t){t.total&&(this.loadingDocumentProgress=Math.min(100,Math.ceil(t.loaded/t.total*100)))},n.prototype.onDocumentLoaded=function(){this.loadingDocument=!1,this.mediaLoadStatus.emit(t.ResponseType.SUCCESS)},n.prototype.onDocumentLoadFailed=function(e){this.loadingDocument=!1,this.viewerException=new et(e.name,{message:e.message}),this.errorMessage='Could not load the document "'+this.url+'"',this.mediaLoadStatus.emit(t.ResponseType.FAILURE),this.pdfViewerException.emit(this.viewerException)},n.prototype.updatePages=function(t){this.enableAnnotations&&this.store.dispatch(new wt(t))},Object.defineProperty(n.prototype,"searchBarHidden",{set:function(t){this.pdfWrapper&&t&&this.pdfWrapper.clearSearch()},enumerable:!1,configurable:!0}),n.prototype.toggleCommentsSummary=function(){this.toolbarEvents.toggleCommentsSummary(!this.toolbarEvents.showCommentSummary.getValue())},n.prototype.rotateDocument=function(t){var e=this.pdfWrapper.getPageNumber();this.pdfWrapper.rotate(t),this.pdfWrapper.setPageNumber(e),this.rotation=(this.rotation+t)%360,this.setPageHeights()},n.prototype.initDocumentProgress=function(){this.loadingDocument=!0,this.loadingDocumentProgress=null,this.errorMessage=null},n.prototype.setZoom=function(t){isNaN(t)||(this.pdfWrapper.setZoom(t),this.zoom=this.calculateZoomValue(t),this.setPageHeights())},n.prototype.stepZoom=function(t){isNaN(t)||(this.pdfWrapper.stepZoom(t),this.zoom=this.calculateZoomValue(this.zoom,t),this.setPageHeights())},n.prototype.setPageHeights=function(){this.pageHeights=[];for(var t=this.pdfViewer.nativeElement.children,e=0;e<t.length;e++)this.pageHeights.push(t[e].clientHeight)},n.prototype.calculateZoomValue=function(t,e){void 0===e&&(e=0);var n=t+e;return n>5?5:n<.1?.1:+n.toFixed(2)},n.prototype.goToDestination=function(t){this.pdfWrapper.navigateTo(t)},n.prototype.getCurrentPageNumber=function(){return this.pdfWrapper.getPageNumber()},n}();jo.decorators=[{type:e.Component,args:[{selector:"mv-pdf-viewer",template:'<mv-side-bar\n *ngIf="toolbarEvents.sidebarOpen"\n id="sidebarContainer"\n [url]="url"\n [zoom]="zoom"\n [rotate]="rotation"\n [outline]="documentOutline"\n [annotationsEnabled]="enableAnnotations"\n [currentPageNumber]="getCurrentPageNumber()"\n>\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>\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>\n <mv-redaction-search-bar></mv-redaction-search-bar>\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]="\n (showCommentsPanel || showIcpParticipantsList) &&\n !(toolbarEvents.redactionMode | async)\n "\n [class.grabNDrag]="enableGrabNDrag"\n >\n <div\n #pdfViewer\n class="pdfViewer"\n mvCreateTextHighlight\n [ngClass]="{\n hidden: loadingDocument,\n highlightMode: highlightMode | async,\n drawMode: drawMode | async\n }"\n ></div>\n <mv-redactions\n *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 >\n </mv-metadata-layer>\n <mv-bookmark-icons [zoom]="zoom" [rotate]="rotation"> </mv-bookmark-icons>\n </ng-template>\n </div>\n <mv-comment-set\n [contentScrollTop]="viewerContainer.scrollTop"\n *ngIf="\n enableAnnotations &&\n annotationSet &&\n !(toolbarEvents.redactionMode | async)\n "\n [annotationSet]="annotationSet"\n [zoom]="zoom"\n [rotate]="rotation"\n [height]="pdfViewer.offsetHeight"\n [pageHeights]="pageHeights"\n >\n </mv-comment-set>\n <div class="loadingMessage" *ngIf="loadingDocument">\n <h3 class="govuk-heading-m">\n Loading...{{\n loadingDocumentProgress ? loadingDocumentProgress + "%" : ""\n }}\n </h3>\n </div>\n</div>\n',encapsulation:e.ViewEncapsulation.None}]}],jo.ctorParameters=function(){return[{type:r.Store},{type:r.Store},{type:X},{type:tt},{type:K},{type:go},{type:xo},{type:nt}]},jo.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}],enableRedactSearch:[{type:e.Input}],height:[{type:e.Input}],caseId:[{type:e.Input}],viewerContainer:[{type:e.ViewChild,args:["viewerContainer",{static:!0}]}],pdfViewer:[{type:e.ViewChild,args:["pdfViewer",{static:!1}]}],searchBarHidden:[{type:e.Input}]};var To=function(){function t(t){this.http=t}return t.prototype.validateFile=function(t){return this.http.head(t)},t}();To.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new To(I.ɵɵinject(P.HttpClient))},token:To,providedIn:"root"}),To.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],To.ctorParameters=function(){return[{type:i.HttpClient}]};var Ro=function(){function n(t,n,o,i,a,s){this.store=t,this.printService=n,this.viewerUtilService=o,this.toolbarEvents=i,this.toolbarButtons=a,this.viewerEvents=s,this.mediaLoadStatus=new e.EventEmitter,this.imageViewerException=new e.EventEmitter,this.rotation=0,this.zoom=1,this.subscriptions=[],this.enableGrabNDrag=!1}return n.prototype.ngOnInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.rotateSubject.subscribe((function(e){return t.rotateImage(e)})),this.toolbarEvents.zoomSubject.subscribe((function(e){return t.setZoom(e)})),this.toolbarEvents.stepZoomSubject.subscribe((function(e){return t.stepZoom(e)})),this.toolbarEvents.printSubject.subscribe((function(){return t.printService.printDocumentNatively(t.url)})),this.toolbarEvents.downloadSubject.subscribe((function(){return t.download()})),this.toolbarEvents.grabNDrag.subscribe((function(e){return t.enableGrabNDrag=e})),this.toolbarEvents.commentsPanelVisible.subscribe((function(e){return t.showCommentsPanel=e})))},n.prototype.onImageViewerClick=function(t){t.target.className.startsWith("pageContainer")&&(this.store.dispatch(new Ce({annotationId:"",selected:!1,editable:!1})),this.viewerEvents.clearCtxToolbar())},n.prototype.ngOnDestroy=function(){this.subscriptions.filter((function(t){return!t.closed})).forEach((function(t){return t.unsubscribe()})),this.response&&this.response.unsubscribe()},n.prototype.ngOnChanges=function(t){t.url&&(this.errorMessage=null,this.toolbarEvents.reset())},n.prototype.rotateImage=function(t){this.rotation=(this.rotation+t)%360,this.initAnnoPage(this.img.nativeElement)},n.prototype.setZoom=function(t){return A(this,void 0,void 0,(function(){return N(this,(function(e){switch(e.label){case 0:return isNaN(t)?[3,2]:[4,this.setZoomValue(this.calculateZoomValue(t))];case 1:e.sent(),this.img.nativeElement.width=this.img.nativeElement.naturalWidth*this.zoom,this.initAnnoPage(this.img.nativeElement),e.label=2;case 2:return[2]}}))}))},n.prototype.stepZoom=function(t){return A(this,void 0,void 0,(function(){return N(this,(function(e){switch(e.label){case 0:return isNaN(t)?[3,2]:[4,this.setZoomValue(this.calculateZoomValue(this.zoom,t))];case 1:e.sent(),this.img.nativeElement.width=this.img.nativeElement.naturalWidth*this.zoom,this.initAnnoPage(this.img.nativeElement),e.label=2;case 2:return[2]}}))}))},n.prototype.download=function(){var t=document.createElement("a");document.body.appendChild(t),t.setAttribute("style","display: none"),t.href=this.url,t.download=this.downloadFileName,t.click(),t.remove()},n.prototype.setZoomValue=function(t){var e=this;return new Promise((function(n){e.zoom=t,e.toolbarEvents.zoomValueSubject.next(t),n(!0)}))},n.prototype.calculateZoomValue=function(t,e){void 0===e&&(e=0);var n=t+e;return n>5?5:n<.1?.1:+n.toFixed(2)},n.prototype.onLoadError=function(e){var n=this;this.response=this.viewerUtilService.validateFile(e).subscribe((function(t){return t}),(function(t){n.viewerException=new et(t.name,{httpResponseCode:t.status,message:t.message})})),this.errorMessage='Could not load the image "'+this.url+'"',this.mediaLoadStatus.emit(t.ResponseType.FAILURE),this.imageViewerException.emit(this.viewerException)},n.prototype.onLoad=function(e){this.mediaLoadStatus.emit(t.ResponseType.SUCCESS),this.initAnnoPage(e)},n.prototype.initAnnoPage=function(t){this.imageHeight=this.rotation%180!=0?t.offsetWidth:t.offsetHeight,this.imageWidth=this.rotation%180!=0?t.offsetHeight:t.offsetWidth,this.imageLeft=this.rotation%180!=0?t.offsetTop:t.offsetLeft,this.imageTop=this.rotation%180!=0?t.offsetLeft:t.offsetTop;var e=[{div:{scrollHeight:this.imageHeight,scrollWidth:this.imageWidth,offsetLeft:this.imageLeft},pageNumber:1,scale:this.zoom,rotation:this.rotation,id:1}];this.store.dispatch(new wt(e))},n.prototype.toggleCommentsSummary=function(){this.toolbarEvents.toggleCommentsSummary(!this.toolbarEvents.showCommentSummary.getValue())},n}();Ro.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 id="viewer-wrapper"\n [ngStyle]="{ height: height }"\n [ngClass]="{ \'grabNDrag\': enableGrabNDrag }"\n *ngIf="url && !errorMessage">\n <div #imageContainer id="image-container"\n mvGrabNDrag [dragX]="imageContainer" [dragEnabled]="enableGrabNDrag"\n (scroll)="$event"\n [ngClass]="{ \'image-container\': true, \'annotations\': enableAnnotations, \'show-comments-panel\': showCommentsPanel }">\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 <mv-comment-set [contentScrollTop]="imageContainer.scrollTop"\n *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'}]}],Ro.ctorParameters=function(){return[{type:r.Store},{type:tt},{type:To},{type:K},{type:nt},{type:go}]},Ro.propDecorators={url:[{type:e.Input}],downloadFileName:[{type:e.Input}],enableAnnotations:[{type:e.Input}],annotationSet:[{type:e.Input}],height:[{type:e.Input}],mediaLoadStatus:[{type:e.Output}],imageViewerException:[{type:e.Output}],img:[{type:e.ViewChild,args:["img",{static:!1}]}],onImageViewerClick:[{type:e.HostListener,args:["mousedown",["$event"]]}]};var _o=function(){function n(t,n){this.toolbarEvents=t,this.viewerUtilService=n,this.loadStatus=new e.EventEmitter,this.unsupportedViewerException=new e.EventEmitter,this.subscriptions=[]}return n.prototype.ngOnInit=function(){var e=this;this.subscriptions.push(this.toolbarEvents.downloadSubject.subscribe((function(){return e.downloadLink.nativeElement.click()})),this.viewerUtilService.validateFile(this.url).subscribe((function(t){return t}),(function(t){e.viewerException=new et(t.name,{httpResponseCode:t.status,message:t.message})}))),this.loadStatus.emit(t.ResponseType.UNSUPPORTED),this.typeException||this.unsupportedViewerException.emit(this.viewerException)},n.prototype.ngOnDestroy=function(){var t,e;try{for(var n=M(this.subscriptions),o=n.next();!o.done;o=n.next()){o.value.unsubscribe()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},n}();_o.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'}]}],_o.ctorParameters=function(){return[{type:K},{type:To}]},_o.propDecorators={url:[{type:e.Input}],downloadFileName:[{type:e.Input}],typeException:[{type:e.Input}],loadStatus:[{type:e.Output}],unsupportedViewerException:[{type:e.Output}],downloadLink:[{type:e.ViewChild,args:["downloadLink",{static:!1}]}]};var Bo=function(){function t(t){this.httpClient=t,this.annotationApiUrl="/em-anno",this.annotationSetBaseUrl="/annotation-sets",this.annotationBaseUrl="/annotations"}return t.prototype.getAnnotationSet=function(t){var e=this.annotationSetsFullUrl+"/filter?documentId="+t;return this.httpClient.get(e,{observe:"response",withCredentials:!0})},t.prototype.postAnnotationSet=function(t){return this.httpClient.post(this.annotationSetsFullUrl,t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})),s.catchError((function(){return[]})))},t.prototype.getComments=function(t){return t.pipe(s.map(this.sortAnnotations),s.map(this.extractComments))},t.prototype.sortAnnotations=function(t){return t.annotations.sort((function(t,e){return t.page!==e.page?t.page-e.page:t.rectangles[0].y-e.rectangles[0].y}))},t.prototype.extractComments=function(t){return[].concat.apply([],L(t.map((function(t){return t.comments}))))},t.prototype.deleteAnnotation=function(t){var e=this.annotationFullsUrl+"/"+t;return this.httpClient.delete(e,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.postAnnotation=function(t){return this.httpClient.post(this.annotationFullsUrl,t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},Object.defineProperty(t.prototype,"annotationSetsFullUrl",{get:function(){return this.annotationApiUrl+this.annotationSetBaseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"annotationFullsUrl",{get:function(){return this.annotationApiUrl+this.annotationBaseUrl},enumerable:!1,configurable:!0}),t}();Bo.decorators=[{type:e.Injectable}],Bo.ctorParameters=function(){return[{type:i.HttpClient}]};var Do=function(){function t(){this.unsavedChanges=new a.Subject,this.marginToCommentEmitter=new a.BehaviorSubject(!1)}return t.prototype.setCommentSet=function(t){this.commentSetComponent=t},t.prototype.onCommentChange=function(t){this.unsavedChanges.next(t)},t.prototype.getUnsavedChanges=function(){return this.unsavedChanges.asObservable()},t.prototype.hasUnsavedComments=function(t){return t.comments.length>0&&this.getComment(t).hasUnsavedChanges},t.prototype.updateUnsavedCommentsStatus=function(t,e){this.getComment(t).hasUnsavedChanges=e,this.allCommentsSaved()},t.prototype.getComment=function(t){return this.commentSetComponent.commentComponents.find((function(e){return e.comment.annotationId===t.comments[0].annotationId}))},t.prototype.resetCommentSet=function(){this.commentSetComponent=null},t.prototype.allCommentsSaved=function(){this.onCommentChange(this.commentSetComponent.commentComponents.some((function(t){return!0===t.hasUnsavedChanges})))},t.prototype.createMarginToCommentEvent=function(t){this.marginToCommentEmitter.next(t)},t}();Do.decorators=[{type:e.Injectable}];var Ao,No,Mo,Fo=r.createSelector(ao,(function(t){return t.tags})),Lo=r.createSelector(Fo,(function(t){return t.tagNameEnt})),$o=r.createSelector(Fo,(function(t){return t.filters})),Ho=r.createSelector(Fo,$e),Vo=r.createSelector(Fo,He),Uo=r.createSelector(Lo,(function(t){return Object.keys(t).map((function(e){return{key:e,length:Object.keys(t[e]).length}}))})),zo=function(t){return t.annotations},Wo=r.createSelector(ao,zo),qo=r.createSelector(Wo,De),Go=r.createSelector(Wo,Re),Zo=function(t){return{documentId:t.documentId,annotationSetId:t.id}},Jo=r.createSelector(Go,Zo),Yo=function(t,e){return Object.assign(Object.assign({},e),{annotations:Object.keys(t).map((function(e){return t[e]}))})},Ko=r.createSelector(qo,Go,Yo),Xo=r.createSelector(Wo,Ae),Qo=r.createSelector(Wo,_e),ti=r.createSelector(Wo,Be),ei=r.createSelector(Wo,Ne),ni=function(t){return t.commentSearch},oi=r.createSelector(ei,ni),ii=r.createSelector(Wo,Me),ai=function(t,e,n){var o=!!Object.keys(n).length?n:e;if(t){var i=[];return Object.keys(t).forEach((function(e){i.push({anno:o[e]?o[e]:[],styles:t[e].styles})})),i}},si=r.createSelector(ro,ti,Vo,ai),ri=function(t,e,n,o){if(t&&n&&e[1]){var i=!!Object.keys(o).length?o:t;return Object.keys(i).map((function(o){var i=n[o].page;return Object.assign(Object.assign({},t[o]),{page:i,pages:e})}))}},ci=r.createSelector(Qo,ro,qo,Ho,ri),li=function(t,e){void 0===t&&(t=[]);var n=xe.filterCommentsSummary(t,e.filters);return n.length?n.filter((function(t){return void 0!==t.createdByDetails})).map((function(t){return{page:t.page,user:t.createdByDetails.forename.concat(" ").concat(t.createdByDetails.surname),date:T.default(t.lastModifiedDate).format("D MMMM YYYY"),tags:t.tags,comment:t.content}})):[""]},ui=r.createSelector(ci,ii,li),pi=function(t,e){var n=!!Object.keys(e).length?e:t;return Object.keys(n).map((function(e){return t[e]})).filter((function(t){return t.comments&&t.comments.length>0}))},di=r.createSelector(qo,Ho,pi);!function(t){t.PDF="pdf",t.IMAGE="image"}(Ao||(Ao={})),function(t){t.MP4="mp4",t.MP3="mp3"}(No||(No={})),function(t){t.EXCEL="excel",t.WORD="word",t.POWERPOINT="powerpoint",t.TXT="txt",t.RTF="rtf"}(Mo||(Mo={}));var hi=function(){function t(t,n,o,i,a,s,r){this.store=t,this.toolbarButtons=n,this.toolbarEvents=o,this.api=i,this.commentService=a,this.elRef=s,this.cdr=r,this.showToolbar=!0,this.toolbarButtonOverrides={},this.width="100%",this.mediaLoadStatus=new e.EventEmitter,this.viewerException=new e.EventEmitter,this.toolbarEventsOutput=new e.EventEmitter,this.unsavedChanges=new e.EventEmitter,this.enableAnnotations=!1,this.enableRedactions=!1,this.enableICP=!1,this.multimediaPlayerEnabled=!1,this.enableRedactSearch=!1,this.multimediaContent=!1,this.convertibleContent=!1,this.unsupportedContent=!1,this.typeException=!1,this.annotationApiUrl&&(i.annotationApiUrl=this.annotationApiUrl)}return t.prototype.ngAfterContentInit=function(){var t=this;this.annotationSet$=this.store.pipe(r.select(Ko)),this.hasDifferentPageSize$=this.store.pipe(r.select(uo)),this.setToolbarButtons(),this.toolbarEventsOutput.emit(this.toolbarEvents),this.$subscriptions=this.commentService.getUnsavedChanges().subscribe((function(e){return t.onCommentChange(e)})),this.$subscriptions.add(this.toolbarEvents.getShowCommentSummary().subscribe((function(e){return t.showCommentSummary=e})))},t.prototype.ngAfterViewChecked=function(){if(this.height&&this.viewerHeight!==this.height)return this.viewerHeight=this.height,void this.cdr.detectChanges();if(!this.height){var t=this.elRef.nativeElement.getBoundingClientRect().top+this.viewerRef.nativeElement.offsetTop;this.prevOffset!==t&&(this.viewerHeight="calc(100vh - "+t+"px)",this.prevOffset=t,this.cdr.detectChanges())}},t.prototype.ngOnChanges=function(t){t.annotationApiUrl&&(this.api.annotationApiUrl=this.annotationApiUrl),t.url&&(this.toolbarEvents.reset(),this.commentService.resetCommentSet(),this.documentId=this.extractDMStoreDocId(this.url),this.store.dispatch(new yt(this.documentId)),!this.enableAnnotations||this.multimediaContent||this.unsupportedContent||this.store.dispatch(new me(this.documentId)),this.enableRedactions&&!this.multimediaContent&&!this.unsupportedContent&&this.documentId&&this.store.dispatch(new Dn(this.documentId)),"image"===this.contentType&&(this.documentTitle=null)),t.contentType&&(this.convertibleContent=this.needsConverting(),this.multimediaContent=this.isMultimedia(),this.unsupportedContent=!this.isSupported()),this.setToolbarButtons(),this.detectOs(),this.typeException=!1},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.prototype.needsConverting=function(){return null!==this.contentType&&Object.keys(Mo).includes(this.contentType.toUpperCase())},t.prototype.isMultimedia=function(){return null!==this.contentType&&Object.keys(No).includes(this.contentType.toUpperCase())},t.prototype.isSupported=function(){var t=Object.assign({},No,Mo,Ao);return null!==this.contentType&&Object.keys(t).includes(this.contentType.toUpperCase())},t.prototype.onMediaLoad=function(t){this.mediaLoadStatus.emit(t)},t.prototype.setToolbarButtons=function(){this.contentType===Ao.PDF||this.needsConverting()?this.toolbarButtons.setup(Object.assign(Object.assign(Object.assign({},ot),{showHighlightButton:this.enableAnnotations,showDrawButton:this.enableAnnotations}),this.toolbarButtonOverrides)):this.contentType===Ao.IMAGE?this.toolbarButtons.setup(Object.assign(Object.assign(Object.assign({},it),{showDrawButton:this.enableAnnotations}),this.toolbarButtonOverrides)):this.isMultimedia()?this.toolbarButtons.setup(Object.assign(Object.assign({},at),this.toolbarButtonOverrides)):this.toolbarButtons.setup(Object.assign(Object.assign({},st),this.toolbarButtonOverrides))},t.prototype.onLoadException=function(t){this.viewerException.emit(t),this.isSupported()?(this.typeException=!0,this.contentType=null,this.setToolbarButtons()):this.typeException=!1},t.prototype.onCommentChange=function(t){this.unsavedChanges.emit(t)},t.prototype.onDocumentTitleChange=function(t){this.documentTitle=t},t.prototype.extractDMStoreDocId=function(t){return(t=(t=t.includes("/documents/")?t.split("/documents/")[1]:t).includes("/documentsv2/")?t.split("/documentsv2/")[1]:t).replace("/binary","")},t.prototype.detectOs=function(){this.hasScrollBar=-1!==window.navigator.userAgent.indexOf("Win")},t}();hi.decorators=[{type:e.Component,args:[{selector:"mv-media-viewer",template:'<div\n 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\n *ngIf="showCommentSummary"\n [title]="documentTitle || \'Comment Summary\'"\n [contentType]="contentType"\n >\n </mv-comments-summary>\n\n <mv-confirm-action\n *ngIf="toolbarEvents.icp.leavingSession | async"\n ></mv-confirm-action>\n\n <div id="mainContainer">\n <mv-main-toolbar\n *ngIf="showToolbar"\n [enableAnnotations]="enableAnnotations"\n [enableICP]="enableICP"\n [enableRedactions]="enableRedactions"\n [contentType]="contentType"\n >\n </mv-main-toolbar>\n <mv-redaction-toolbar\n [showRedactSearch]="enableRedactSearch"\n *ngIf="toolbarEvents.redactionMode | async"\n ></mv-redaction-toolbar>\n <mv-icp-toolbar *ngIf="toolbarEvents.icp.enabled | async"></mv-icp-toolbar>\n\n <div #viewerRef>\n <mv-conversion-viewer\n *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 >\n </mv-conversion-viewer>\n <mv-pdf-viewer\n *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 >\n </mv-pdf-viewer>\n <mv-image-viewer\n *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 >\n </mv-image-viewer>\n <mv-multimedia-player\n *ngIf="multimediaContent"\n [multimediaOn]="multimediaPlayerEnabled"\n [url]="url"\n [downloadFileName]="downloadFileName"\n (loadStatus)="onMediaLoad($event)"\n >\n </mv-multimedia-player>\n <mv-unsupported-viewer\n *ngIf="unsupportedContent"\n [url]="url"\n [typeException]="typeException"\n [downloadFileName]="downloadFileName"\n (loadStatus)="onMediaLoad($event)"\n (unsupportedViewerException)="onLoadException($event)"\n >\n </mv-unsupported-viewer>\n </div>\n </div>\n</div>\n',encapsulation:e.ViewEncapsulation.None}]}],hi.ctorParameters=function(){return[{type:r.Store},{type:nt},{type:K},{type:Bo},{type:Do},{type:e.ElementRef},{type:e.ChangeDetectorRef}]},hi.propDecorators={viewerRef:[{type:e.ViewChild,args:["viewerRef",{static:!1}]}],url:[{type:e.Input}],downloadFileName:[{type:e.Input}],contentType:[{type:e.Input}],showToolbar:[{type:e.Input}],toolbarButtonOverrides:[{type:e.Input}],height:[{type:e.Input}],width:[{type:e.Input}],mediaLoadStatus:[{type:e.Output}],viewerException:[{type:e.Output}],toolbarEventsOutput:[{type:e.Output}],unsavedChanges:[{type:e.Output}],enableAnnotations:[{type:e.Input}],annotationApiUrl:[{type:e.Input}],enableRedactions:[{type:e.Input}],enableICP:[{type:e.Input}],multimediaPlayerEnabled:[{type:e.Input}],enableRedactSearch:[{type:e.Input}],caseId:[{type:e.Input}]};var mi=function(){function t(t,e){this.toolBarEvents=t,this.store=e}return t.prototype.saveAnnotation=function(t,e){var n=this;this.store.pipe(r.select(Jo),s.take(1)).subscribe((function(o){var i=Object.assign(Object.assign({id:m.v4(),color:"FFFF00",comments:[],page:e,rectangles:t,type:"highlight"},o),{createdBy:"",createdByDetails:void 0,createdDate:T.default.utc().tz("Europe/London").toISOString(),lastModifiedBy:"",lastModifiedByDetails:void 0,lastModifiedDate:"",tags:[]});n.store.dispatch(new ve(i))}))},t.prototype.applyRotation=function(t,e,n,o,i,a,s,r){var c={x:+(a/r).toFixed(2),y:+(i/r).toFixed(2),width:+(o/r).toFixed(2),height:+(n/r).toFixed(2)},l=c.x,u=c.y,p=c.width,d=c.height,h={x:l,y:u,width:p,height:d};switch(s){case 90:h.width=d,h.height=p,h.x=u,h.y=+(e/r-l-p).toFixed(2);break;case 180:h.x=+(e/r-l-p).toFixed(2),h.y=+(t/r-u-d).toFixed(2);break;case 270:h.width=d,h.height=p,h.x=+(t/r-u-d).toFixed(2),h.y=l}return h},t.prototype.resetHighlight=function(){window.getSelection().removeAllRanges(),this.toolBarEvents.highlightModeSubject.next(!1)},t}();mi.decorators=[{type:e.Injectable}],mi.ctorParameters=function(){return[{type:K},{type:r.Store}]};var gi=function(){function t(t,e,n,o){this.store=t,this.toolbarButtons=e,this.toolbarEvents=n,this.highlightService=o,this.highlightAll=!0,this.matchCase=!1,this.wholeWord=!1,this.resultsText="",this.searchText="",this.resultCount=0,this.redactElements=[],this.advancedSearchVisible=!1}return t.prototype.ngOnInit=function(){var t=this;this.subscription=this.toolbarEvents.redactionSerachSubject.subscribe((function(e){return t.redactAllSearched(e)})),this.subscription.add(this.store.pipe(r.select(co)).subscribe((function(e){return t.documentId=e}))),this.subscription.add(this.store.pipe(r.select(ro)).subscribe((function(e){e[1]&&(t.allPages=e)}))),this.subscription.add(this.toolbarEvents.searchResultsCountSubject.subscribe((function(e){return t.setSearchResultsCount(e)}))),this.subscription.add(this.toolbarEvents.openRedactionSearch.subscribe((function(e){return t.openSearchModal=e}))),this.subscription.add(this.toolbarEvents.redactAllInProgressSubject.subscribe((function(e){return t.redactAllInProgress=e})))},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.onWindowKeyDown=function(t){var e=this;("F3"===t.code||t.ctrlKey&&"KeyF"===t.code)&&(t.preventDefault(),this.toolbarEvents.searchBarHidden.next(!1),setTimeout((function(){return e.findInput.nativeElement.focus()}),200))},t.prototype.search=function(t){void 0===t&&(t=!0),this.redactAll=!t,this.redactAll&&this.toolbarEvents.redactAllInProgressSubject.next(!0),t&&(this.redactElements=[]),this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!1,reset:t})},t.prototype.saveRedaction=function(t){var e=this,n=t.map((function(t){return{page:t.page,rectangles:t.rectangles,redactionId:R.default(),documentId:e.documentId}}));this.store.dispatch(new Hn({searchRedactions:n}))},t.prototype.existInRedactElements=function(t,e,n){if(this.redactElements&&this.redactElements.length>0){var o=this.redactElements.find((function(n){return n.page===t&&n.matchedIndex===e})),i=null==o?void 0:o.rectangles;if(!i||i.length<=0)return!1;for(var a=0,s=function(t){var e=i[t];n.find((function(t){return t.width===e.width&&t.height===e.height&&t.x===e.x&&t.y===e.y}))&&a++},r=0;r<i.length;r++)s(r);return i.length===a}return!1},t.prototype.onCloseSearchModal=function(){this.toolbarEvents.openRedactionSearch.next(!1)},t.prototype.setSearchResultsCount=function(t){this.resultCount=t.total,this.resultsText=this.resultCount>0?t.total+" results founds":"No results found"},t.prototype.redactAllSearched=function(t){var e=this,n=setInterval((function(){var o=document.getElementsByClassName("highlight selected");o&&o.length>0&&(clearInterval(n),e.redactAllSearchedTick(t))}),100)},t.prototype.redactAllSearchedTick=function(t){var e=document.getElementsByClassName("highlight selected");if(e&&e.length>0){this.resultCount=t.matchesCount;var n=t.page+1,o=this.getRectangles(n);o&&this.redactElements.length<=this.resultCount&&!this.existInRedactElements(n,t.matchedIndex,o)&&(this.redactElements.push({page:n,matchedIndex:null==t?void 0:t.matchedIndex,rectangles:o}),this.CreateRedactAllText()),this.redactAll&&this.resultCount&&this.resultCount>0&&o&&this.redactElements.length<this.resultCount&&this.search(!1),this.redactAll&&this.resultCount&&this.redactElements.length===this.resultCount&&(this.redactAll=!1,this.redactAllText=null,this.saveRedaction(this.redactElements))}},t.prototype.CreateRedactAllText=function(){this.redactAllText=this.redactElements.length+" of "+this.resultCount},t.prototype.onEscapeKeyPress=function(t){this.toolbarEvents.searchBarHidden.next(!0)},t.prototype.onEnterKeyPress=function(t){this.search()},t.prototype.toggleSearchBar=function(){this.toolbarEvents.searchBarHidden.next(!this.toolbarEvents.searchBarHidden.getValue())},t.prototype.getRectangles=function(t){this.pageHeight=this.allPages[t].styles.height,this.pageWidth=this.allPages[t].styles.width,this.zoom=parseFloat(this.allPages[t].scaleRotation.scale),this.rotate=parseInt(this.allPages[t].scaleRotation.rotation,10);var e=document.getElementsByClassName("highlight selected");if(e&&e.length>0){var n=document.createRange();n.selectNodeContents(e[0]);var o=window.getSelection();if(null==o||o.removeAllRanges(),null==o||o.addRange(n),o.rangeCount&&!o.isCollapsed){var i=o.getRangeAt(0).cloneRange().getClientRects();if(i){for(var a=e[0].parentElement.parentElement.getBoundingClientRect(),s=[],r=function(t){var e=c.createTextRectangle(i[t],a);s.find((function(t){return t.width===e.width&&t.x===e.x}))||s.push(e)},c=this,l=0;l<i.length;l++)r(l);return s}}}},t.prototype.createTextRectangle=function(t,e){var n=t.bottom-t.top,o=t.right-t.left,i=t.top-e.top,a=t.left-e.left,s=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,n,o,i,a,this.rotate,this.zoom);return s=Object.assign({id:R.default()},s)},t}();gi.decorators=[{type:e.Component,args:[{selector:"mv-redaction-search-bar",template:'<div\n *ngIf="openSearchModal"\n class="searchbar redaction-search-bar govuk-!-padding-3"\n>\n <div class="govuk-grid-row">\n <div class="govuk-grid-column-full govuk-!-padding-right-0">\n <div class="redaction-search-buttons-area">\n <button\n id="mvCloseBtn"\n #mvCloseBtn\n class="mv-button searchbar-button--close"\n title="Close Search"\n data-l10n-id="mvRedactBtn"\n (click)="onCloseSearchModal()"\n ></button>\n </div>\n <input\n id="search_input"\n class="govuk-input govuk-!-width-three-quarters govuk-!-display-inline-block govuk-!-margin-top-5"\n type="text"\n aria-label="Find in document"\n #findInput\n title="Find in document"\n placeholder="Redact from search..."\n tabindex="0"\n data-l10n-id="search_input"\n [(ngModel)]="searchText"\n (keydown.escape)="onEscapeKeyPress($event)"\n (keydown.enter)="onEnterKeyPress($event)"\n />\n <div class="redaction-search-buttons-area">\n <button\n id="mvSearchAllBtn"\n class="govuk-button govuk-!-margin-bottom-0"\n data-module="govuk-button"\n (click)="search()"\n [disabled]="redactAllInProgress"\n >\n Search\n </button>\n <button\n id="mvRedactAllBtn"\n class="govuk-button govuk-!-margin-left-2 govuk-!-margin-bottom-0"\n data-module="govuk-button"\n (click)="search(false)"\n [disabled]="redactAllInProgress"\n >\n Redact all\n </button>\n </div>\n <div\n class="govuk-grid-column-three-quarters govuk-!-padding-left-0 govuk-!-padding-top-2 redaction-status-text"\n >\n <span\n id="findRedactResultsCount"\n class="govuk-grid-column-full govuk-!-margin-right-4 govuk-!-margin-left-0 govuk-!-padding-left-0"\n ><h4\n class="govuk-!-display-inline-block govuk-!-margin-top-0 govuk-!-margin-bottom-1"\n *ngIf="redactAllInProgress"\n >\n Redacting in progress\n </h4>\n {{ redactAllInProgress ? "" : resultsText }}</span\n >\n <span>\n <h5\n id="redactAllInProgressCount"\n class="govuk-!-display-inline-block govuk-!-margin-top-0 govuk-!-margin-bottom-1"\n >\n {{ redactAllInProgress ? redactAllText : "" }}\n </h5>\n </span>\n </div>\n </div>\n </div>\n</div>\n',styles:[".redaction-search-buttons-area{display:flex;flex-direction:row;padding-top:.5rem}.redaction-search-bar{width:20rem;left:73%;top:2%}.redaction-status-text{height:2.6rem}"]}]}],gi.ctorParameters=function(){return[{type:r.Store},{type:nt},{type:K},{type:mi}]},gi.propDecorators={findInput:[{type:e.ViewChild,args:["findInput",{static:!0}]}],onWindowKeyDown:[{type:e.HostListener,args:["window:keydown",["$event"]]}]};var bi=function(){function t(){}return t.prototype.isNumber=function(t){return null!=t&&""!==t&&!isNaN(Number(t.toString()))},t}();bi.ɵprov=I.ɵɵdefineInjectable({factory:function(){return new bi},token:bi,providedIn:"root"}),bi.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],bi.ctorParameters=function(){return[]};var vi=function(){function t(t,e,n,o){this.toolbarEvents=t,this.toolbarButtons=e,this.cdr=n,this.numberHelper=o,this.enableAnnotations=!1,this.enableRedactions=!1,this.enableICP=!1,this.contentType=null,this.subscriptions=[],this.icpEnabled=!1,this.redactionEnabled=!1,this.pageNumber=1,this.pageCount=0,this.isDropdownMenuOpen=!1,this.dropdownMenuPositions=[new g.ConnectionPositionPair({originX:"end",originY:"bottom"},{overlayX:"end",overlayY:"top"},0,3)],this.zoomScales=[.1,.25,.5,.75,1,1.25,1.5,2.5,3,5],this.allButtonsWidth=0,this.widthRequiredForBtn={}}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.setCurrentPageSubject.subscribe((function(e){return t.setCurrentPage(e)})),this.toolbarEvents.setCurrentPageInputValueSubject.subscribe((function(e){return t.pageNumber=e})),this.toolbarEvents.getPageCount().subscribe((function(e){return t.pageCount=e})),this.toolbarEvents.icp.enabled.subscribe((function(e){t.icpEnabled=e,t.icpEnabled&&(t.toolbarEvents.toggleCommentsPanel(!e),t.toolbarEvents.sidebarOpen.next(!1))})),this.toolbarEvents.redactionMode.subscribe((function(e){t.redactionEnabled=e})),this.toolbarEvents.redactAllInProgressSubject.subscribe((function(e){t.redactAllInProgress=e})))},t.prototype.ngOnDestroy=function(){var t,e;try{for(var n=M(this.subscriptions),o=n.next();!o.done;o=n.next()){o.value.unsubscribe()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.ngAfterViewInit=function(){var t=this;Array.from(this.mvToolbarMain.nativeElement.children).forEach((function(e){t.allButtonsWidth+=e.getBoundingClientRect().width,t.widthRequiredForBtn[e.id]=t.allButtonsWidth})),this.cdr.detectChanges()},t.prototype.onResize=function(){this.cdr.detectChanges()},t.prototype.onClickHighlightToggle=function(){this.toolbarEvents.toggleHighlightMode()},t.prototype.onClickDrawToggle=function(){this.toolbarEvents.toggleDrawMode()},t.prototype.toggleIndexSideBar=function(){var t=this.toolbarEvents.sidebarOpen.getValue(),e=this.toolbarEvents.sidebarOutlineView.getValue();t&&!e||this.toolbarEvents.toggleSideBar(!t),this.toolbarEvents.toggleSideBarView(!0)},t.prototype.toggleBookmarksSideBar=function(){var t=this.toolbarEvents.sidebarOpen.getValue(),e=this.toolbarEvents.sidebarOutlineView.getValue();t&&e||this.toolbarEvents.toggleSideBar(!t),this.toolbarEvents.toggleSideBarView(!1)},t.prototype.togglePresentBar=function(){this.toolbarEvents.searchBarHidden.next(!0),this.toolbarEvents.icp.enable()},t.prototype.increasePageNumber=function(){this.toolbarEvents.incrementPage(1)},t.prototype.decreasePageNumber=function(){this.toolbarEvents.incrementPage(-1)},t.prototype.onPageNumberInputChange=function(t){Number(t)<1&&(t="1"),Number(t)>this.pageCount&&(t=this.pageCount.toString()),this.toolbarEvents.setPage(Number.parseInt(t,10))},t.prototype.setCurrentPage=function(t){this.pageNumber=t},t.prototype.rotate=function(t){this.toolbarEvents.rotate(t)},t.prototype.printFile=function(){this.toolbarEvents.print()},t.prototype.downloadFile=function(){this.toolbarEvents.download()},t.prototype.zoom=function(t){this.toolbarEvents.zoom(+t)},t.prototype.stepZoom=function(t){this.toolbarEvents.stepZoom(t),this.zoomSelect.nativeElement.selected="selected"},t.prototype.toggleCommentsPanel=function(){this.toolbarEvents.toggleCommentsPanel(!this.toolbarEvents.commentsPanelVisible.getValue())},t.prototype.toggleRedactBar=function(){this.toolbarEvents.toggleRedactionMode()},t.prototype.toggleGrabNDrag=function(){this.toolbarEvents.toggleGrabNDrag()},t.prototype.isPdf=function(){return"pdf"===this.contentType},t.prototype.toggleSearchBar=function(){this.toolbarEvents.searchBarHidden.next(!this.toolbarEvents.searchBarHidden.getValue())},t.prototype.toggleMoreOptions=function(){var t=this;this.isDropdownMenuOpen=!this.isDropdownMenuOpen,setTimeout((function(){t.mvMenuItems&&t.mvMenuItems.nativeElement.focus()}),100)},t}();vi.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\n id="mvMoreOptionsBtn"\n class="mv-button mv-toolbar__menu-button--more-options"\n [class.mv-toolbar__menu-button--more-options__hidden]="\n mvToolbar.offsetWidth >= allButtonsWidth\n "\n aria-pressed="false"\n (click)="toggleMoreOptions()"\n cdkOverlayOrigin\n #trigger="cdkOverlayOrigin"\n [disabled]="redactAllInProgress"\n >\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\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]="trigger"\n [cdkConnectedOverlayOpen]="isDropdownMenuOpen"\n [cdkConnectedOverlayPositions]="dropdownMenuPositions"\n >\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 <button\n *ngIf="toolbarButtons.showSidebar"\n id="mvIndexBtn"\n title="Index"\n data-l10n-id="index"\n #mvIndexBtn\n class="mv-button mv-toolbar__menu-button--index"\n [class.button-hidden-on-toolbar]="\n mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvIndexBtn\']\n "\n [class.button-hidden-on-dropdown]="\n mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvIndexBtn\']\n "\n aria-pressed="false"\n [disabled]="redactAllInProgress"\n (click)="toggleIndexSideBar(); isDropdownMenuOpen = false"\n >\n <span>Index</span>\n </button>\n \n <button \n *ngIf="toolbarButtons.showSidebar" \n id="mvBookmarksBtn" \n title="Bookmarks" \n data-l10n-id="bookmarks"\n #mvBookmarksBtn \n [ngClass]="{ \n \'mv-button mv-toolbar__menu-button--bookmarks\' : true,\n \'button-hidden-on-toolbar\': mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvBookmarksBtn\'],\n \'button-hidden-on-dropdown\': mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvBookmarksBtn\']\n }"\n aria-pressed="false"\n [disabled]="redactAllInProgress"\n (click)="toggleBookmarksSideBar(); isDropdownMenuOpen = false"\n >\n <span>Bookmarks</span>\n </button>\n\n <button\n *ngIf="toolbarButtons.showDrawButton"\n [disabled]="icpEnabled || redactionEnabled"\n id="mvDrawBtn"\n #mvDrawBtn\n class="mv-button mv-toolbar__menu-button--draw"\n title="Draw a box"\n tabindex="-1"\n [class.button-hidden-on-toolbar]="\n mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvDrawBtn\']\n "\n [class.button-hidden-on-dropdown]="\n mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvDrawBtn\']\n "\n [class.toggled]="toolbarEvents.drawModeSubject | async"\n aria-hidden="true"\n aria-pressed="false"\n data-l10n-id="toggleDrawButton"\n (click)="onClickDrawToggle(); isDropdownMenuOpen = false"\n >\n <span data-l10n-id="draw_label">Draw a box</span>\n </button>\n\n <button\n *ngIf="toolbarButtons.showHighlightButton"\n [disabled]="icpEnabled || redactionEnabled"\n id="mvHighlightBtn"\n #mvHighlightBtn\n class="mv-button mv-toolbar__menu-button--highlight"\n title="Highlight"\n tabindex="-1"\n [class.button-hidden-on-toolbar]="\n mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvHighlightBtn\']\n "\n [class.button-hidden-on-dropdown]="\n mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvHighlightBtn\']\n "\n [class.toggled]="toolbarEvents.highlightModeSubject | async"\n aria-hidden="true"\n aria-pressed="false"\n (click)="onClickHighlightToggle(); isDropdownMenuOpen = false"\n data-l10n-id="toggleHighlightButton"\n >\n <span data-l10n-id="highlight_label">Highlight</span>\n </button>\n\n <ng-container *ngIf="toolbarButtons.showNavigation">\n <div\n id="mvPageBtn"\n #mvPageBtn\n class="mv-toolbar__menu-button--page"\n aria-pressed="false"\n [class.button-hidden-on-toolbar]="\n mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvPageBtn\']\n "\n [class.button-hidden-on-dropdown]="\n mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvPageBtn\']\n "\n >\n <span>Page</span>\n\n <button\n id="mvUpBtn"\n [disabled]="pageNumber === 1 || redactAllInProgress"\n title="Previous Page"\n class="mv-toolbar__menu-button--up button-image"\n data-l10n-id="previous"\n (click)="decreasePageNumber()"\n [disabled]="redactAllInProgress"\n >\n <span></span>\n </button>\n <button\n id="mvDownBtn"\n [disabled]="pageNumber === pageCount || redactAllInProgress"\n title="Next Page"\n class="mv-toolbar__menu-button--down button-image"\n data-l10n-id="next"\n (click)="increasePageNumber()"\n >\n <span></span>\n </button>\n\n <input\n type="number"\n id="pageNumber"\n class="hmcts-toolbar-input govuk-input--width-2"\n title="Page Number"\n value="1"\n size="4"\n min="1"\n [value]="pageNumber"\n aria-label="page number"\n tabindex="0"\n data-l10n-id="page"\n (change)="onPageNumberInputChange(pageNumberInput.value)"\n [disabled]="redactAllInProgress"\n #pageNumberInput\n />\n <span id="numPages" class="toolbarLabel">/ {{ pageCount }}</span>\n </div>\n </ng-container>\n\n <ng-container *ngIf="toolbarButtons.showZoom">\n <div\n id="mvZoomBtn"\n #mvZoomBtn\n class="mv-toolbar__menu-button--zoom"\n aria-pressed="false"\n [class.button-hidden-on-toolbar]="\n mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvZoomBtn\']\n "\n [class.button-hidden-on-dropdown]="\n mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvZoomBtn\']\n "\n >\n <button\n [disabled]="\n toolbarEvents.zoomValueSubject.value == 0.1 ||\n redactAllInProgress\n "\n id="mvMinusBtn"\n class="mv-toolbar__menu-button--zoom-out button-image"\n title="Zoom Out"\n data-l10n-id="zoom_out"\n (click)="stepZoom(-0.1)"\n >\n <span></span>\n </button>\n <select\n id="scaleSelect"\n class="hmcts-toolbar-select"\n title="Zoom"\n tabindex="0"\n data-l10n-id="zoom"\n (change)="zoom($event.target.value)"\n aria-label="zoom"\n [disabled]="redactAllInProgress"\n >\n <option\n #zoomSelect\n id="customScaleOption"\n title=""\n [value]="toolbarEvents.zoomValueSubject.value"\n >\n {{\n toolbarEvents.zoomValueSubject.value * 100\n | number : "1.0-0"\n }}%\n </option>\n <option\n *ngFor="let zoomScale of zoomScales"\n title=""\n [value]="zoomScale"\n [attr.data-l10n-id]="\'page_scale_percent_\' + zoomScale * 100"\n >\n {{ zoomScale * 100 }}%\n </option>\n </select>\n\n <button\n [disabled]="\n toolbarEvents.zoomValueSubject.value == 5 ||\n redactAllInProgress\n "\n id="mvPlusBtn"\n class="mv-toolbar__menu-button--zoom-in button-image"\n (click)="stepZoom(0.1)"\n title="Zoom In"\n data-l10n-id="zoom_in"\n >\n <span></span>\n </button>\n </div>\n </ng-container>\n\n <div\n *ngIf="toolbarButtons.showRotate"\n id="mvRotateBtn"\n #mvRotateBtn\n class="mv-toolbar__menu-button--rotate"\n aria-pressed="false"\n [class.button-hidden-on-toolbar]="\n mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvRotateBtn\']\n "\n [class.button-hidden-on-dropdown]="\n mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvRotateBtn\']\n "\n >\n <button\n id="mvRotateLeftBtn"\n class="mv-toolbar__menu-button--rotate_left button-image"\n title="Rotate Counterclockwise"\n data-l10n-id="page_rotate_ccw"\n (click)="rotate(270)"\n [disabled]="redactAllInProgress"\n >\n <span></span>\n </button>\n <button\n id="mvRotateRightBtn"\n class="mv-toolbar__menu-button--rotate_right button-image"\n title="Rotate Clockwise"\n data-l10n-id="page_rotate_cw"\n (click)="rotate(90)"\n [disabled]="redactAllInProgress"\n >\n <span></span>\n </button>\n <span>Rotate</span>\n </div>\n\n <button\n *ngIf="toolbarButtons.showSearchBar"\n [disabled]="icpEnabled || redactAllInProgress"\n id="mvSearchBtn"\n #mvSearchBtn\n title="Search"\n data-l10n-id="searchbar"\n class="mv-button mv-toolbar__menu-button--search"\n [class.button-hidden-on-toolbar]="\n mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvSearchBtn\']\n "\n [class.button-hidden-on-dropdown]="\n mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvSearchBtn\']\n "\n aria-pressed="false"\n (click)="toggleSearchBar(); isDropdownMenuOpen = false"\n ></button>\n\n <button\n *ngIf="enableICP && toolbarButtons.showPresentationMode && isPdf()"\n [disabled]="icpEnabled || !contentType || redactionEnabled"\n id="mvPresentBtn"\n #mvPresentBtn\n class="mv-button mv-toolbar__menu-button--present"\n title="In-Court Presentation Mode"\n data-l10n-id="icpMode_label"\n [class.button-hidden-on-toolbar]="\n mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvPresentBtn\']\n "\n [class.button-hidden-on-dropdown]="\n mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvPresentBtn\']\n "\n aria-pressed="false"\n (click)="togglePresentBar(); isDropdownMenuOpen = false"\n >\n <span data-l10n-id="icpMode_label">Present</span>\n </button>\n\n <button\n *ngIf="enableRedactions && toolbarButtons.showRedact"\n [disabled]="icpEnabled || redactAllInProgress"\n id="mvRedactBtn"\n #mvRedactBtn\n title="Redact"\n data-l10n-id="redact"\n class="mv-button mv-toolbar__menu-button--redact"\n [class.button-hidden-on-toolbar]="\n mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvRedactBtn\']\n "\n [class.button-hidden-on-dropdown]="\n mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvRedactBtn\']\n "\n aria-pressed="false"\n (click)="toggleRedactBar(); isDropdownMenuOpen = false"\n >\n <span>Redact</span>\n </button>\n\n <button\n *ngIf="toolbarButtons.showGrabNDragButton"\n [disabled]="icpEnabled || redactAllInProgress"\n id="mvGrabBtn"\n #mvGrabBtn\n class="mv-button mv-toolbar__menu-button--grab"\n title="Grab and drag"\n [class.button-hidden-on-toolbar]="\n mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvGrabBtn\']\n "\n [class.button-hidden-on-dropdown]="\n mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvGrabBtn\']\n "\n aria-pressed="false"\n (click)="toggleGrabNDrag(); isDropdownMenuOpen = false"\n >\n <span>Grab and drag</span>\n </button>\n\n <button\n *ngIf="toolbarButtons.showDownload"\n [disabled]="icpEnabled || redactionEnabled"\n id="mvDownloadBtn"\n #mvDownloadBtn\n class="mv-button mv-toolbar__menu-button--download"\n title="Download"\n data-l10n-id="download"\n [class.button-hidden-on-toolbar]="\n mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvDownloadBtn\']\n "\n [class.button-hidden-on-dropdown]="\n mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvDownloadBtn\']\n "\n aria-pressed="false"\n (click)="downloadFile(); isDropdownMenuOpen = false"\n ></button>\n\n <button\n *ngIf="toolbarButtons.showPrint"\n [disabled]="icpEnabled || redactionEnabled"\n id="mvPrintBtn"\n #mvPrintBtn\n title="Print"\n data-l10n-id="print"\n class="mv-button mv-toolbar__menu-button--print"\n [class.button-hidden-on-toolbar]="\n mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvPrintBtn\']\n "\n [class.button-hidden-on-dropdown]="\n mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvPrintBtn\']\n "\n aria-pressed="false"\n (click)="printFile(); isDropdownMenuOpen = false"\n ></button>\n\n <button\n *ngIf="enableAnnotations && toolbarButtons.showCommentSummary"\n [disabled]="redactionEnabled"\n id="mvCommentsBtn"\n #mvCommentsBtn\n class="mv-button mv-toolbar__menu-button--comments"\n title="Comments"\n data-l10n-id="comments"\n [class.button-hidden-on-toolbar]="\n mvToolbarMain.offsetWidth < widthRequiredForBtn[\'mvCommentsBtn\']\n "\n [class.button-hidden-on-dropdown]="\n mvToolbarMain.offsetWidth >= widthRequiredForBtn[\'mvCommentsBtn\']\n "\n aria-pressed="false"\n (click)="toggleCommentsPanel(); isDropdownMenuOpen = false"\n >\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"></div>\n </div>\n </div>\n </div>\n</div>\n'}]}],vi.ctorParameters=function(){return[{type:K},{type:nt},{type:e.ChangeDetectorRef},{type:bi}]},vi.propDecorators={enableAnnotations:[{type:e.Input}],enableRedactions:[{type:e.Input}],enableICP:[{type:e.Input}],contentType:[{type:e.Input}],zoomSelect:[{type:e.ViewChild,args:["zoomSelect",{static:!1}]}],mvToolbarMain:[{type:e.ViewChild,args:["mvToolbarMain",{static:!1}]}],mvMenuItems:[{type:e.ViewChild,args:["dropdownMenu",{static:!1}]}],onResize:[{type:e.HostListener,args:["window:resize",[]]}]};var fi=function(){function t(t,e){this.toolbarButtons=t,this.toolbarEvents=e,this.highlightAll=!0,this.matchCase=!1,this.wholeWord=!1,this.resultsText="",this.searchText="",this.resultCount=0,this.subscriptions=[],this.advancedSearchVisible=!1}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.searchResultsCountSubject.subscribe((function(e){return t.setSearchResultsCount(e)})))},t.prototype.ngOnDestroy=function(){var t,e;try{for(var n=M(this.subscriptions),o=n.next();!o.done;o=n.next()){o.value.unsubscribe()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.onWindowKeyDown=function(t){var e=this;("F3"===t.code||t.ctrlKey&&"KeyF"===t.code)&&(t.preventDefault(),this.toolbarEvents.searchBarHidden.next(!1),setTimeout((function(){return e.findInput.nativeElement.focus()}),200))},t.prototype.searchNext=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!1,reset:!1})},t.prototype.searchPrev=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!0,reset:!1})},t.prototype.search=function(){this.toolbarEvents.search({searchTerm:this.searchText,highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWord:this.wholeWord,previous:!1,reset:!0})},t.prototype.setSearchResultsCount=function(t){var e=this;this.resultCount=t.total,this.resultsText=this.resultCount>0?"Found "+t.current+" of "+t.total:"No results found",this.resultCount&&this.resultCount>0&&setTimeout((function(){e.findNext.nativeElement.focus()}),1e3)},t.prototype.onEscapeKeyPress=function(t){this.toolbarEvents.searchBarHidden.next(!0)},t.prototype.onEnterKeyPress=function(t){this.search()},t.prototype.toggleAdvancedSearch=function(){this.advancedSearchVisible=!this.advancedSearchVisible},t.prototype.toggleSearchBar=function(){this.toolbarEvents.searchBarHidden.next(!this.toolbarEvents.searchBarHidden.getValue())},t}();fi.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'}]}],fi.ctorParameters=function(){return[{type:nt},{type:K}]},fi.propDecorators={findInput:[{type:e.ViewChild,args:["findInput",{static:!0}]}],findNext:[{type:e.ViewChild,args:["findNext",{static:!1}]}],onWindowKeyDown:[{type:e.HostListener,args:["window:keydown",["$event"]]}]};var yi=r.createSelector(ao,(function(t){return t.redactions})),wi=r.createSelector(yi,(function(t){return t.redactionPageEntities})),Si=r.createSelector(yi,(function(t){return t.selectedRedaction})),ki=r.createSelector(yi,(function(t){return t.redactedDocumentInfo})),Ei=r.createSelector(yi,(function(t){return t.redactionEntities})),Ci=r.createSelector(Ei,co,(function(t,e){return{redactions:Object.keys(t).map((function(e){return t[e]})),documentId:e}})),Ii=r.createSelector(ro,wi,(function(t,e){if(t&&e){var n=[];return Object.keys(t).forEach((function(o){n.push({anno:e[o]?e[o]:[],styles:t[o].styles})})),n}})),Pi=function(){function t(t,e,n){this.toolbarEventService=t,this.toolbarButtons=e,this.store=n,this.preview=!1,this.hasRedactions=!1,this.subscriptions=[]}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions.push(this.store.pipe(r.select(Ci)).subscribe((function(e){t.hasRedactions=!!e.redactions.length}))),this.subscriptions.push(this.toolbarEventService.redactAllInProgressSubject.subscribe((function(e){t.redactionAllInProgress=e})))},t.prototype.onRedactAllSearch=function(){this.toolbarEventService.openRedactionSearch.next(!0)},t.prototype.toggleTextRedactionMode=function(){this.toolbarEventService.highlightModeSubject.next(!0)},t.prototype.toggleDrawMode=function(){this.toolbarEventService.drawModeSubject.next(!0)},t.prototype.togglePreview=function(){this.preview=!this.preview,this.toolbarEventService.toggleRedactionPreview(this.preview)},t.prototype.unmarkAll=function(){this.toolbarEventService.unmarkAll()},t.prototype.redact=function(){this.toolbarEventService.applyRedactionToDocument()},t.prototype.toggleRedactBar=function(){this.toolbarEventService.toggleRedactionMode()},t.prototype.redactPage=function(){this.toolbarEventService.drawModeSubject.next(!0),this.toolbarEventService.redactPage()},t.prototype.ngOnDestroy=function(){var t,e;try{for(var n=M(this.subscriptions),o=n.next();!o.done;o=n.next()){o.value.unsubscribe()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t}();Pi.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"\n >Redaction options</label\n >\n <button\n id="toggleDrawButton"\n class="mv-button redaction-button--draw"\n title="Draw a box"\n data-l10n-id="toggleDrawButton"\n (click)="toggleDrawMode()"\n [disabled]="redactionAllInProgress"\n >\n <span data-l10n-id="toggleDrawButton_label">Draw a box</span>\n </button>\n\n <button\n id="redactPageButton"\n class="mv-button redaction-button--redact-page"\n title="Redact Page"\n data-l10n-id="redactPageButton"\n (click)="redactPage()"\n [disabled]="redactionAllInProgress"\n >\n <span data-l10n-id="redactPageButton_label">Redact page</span>\n </button>\n <button\n *ngIf="showRedactSearch"\n id="mvRedactFromSearchBtn"\n title="From search"\n data-l10n-id="fromSearchButton"\n class="mv-button redaction-button--search"\n (click)="onRedactAllSearch()"\n [disabled]="redactionAllInProgress"\n >\n <span style="width: 5rem" data-l10n-id="fromSearchButton_label"\n >From search</span\n >\n </button>\n\n <button\n *ngIf="toolbarButtons.showHighlightButton"\n id="toggleHighlightButton"\n class="mv-button redaction-button--redact"\n aria-pressed="false"\n title="Redact text"\n data-l10n-id="toggleTextRedactionButton"\n (click)="toggleTextRedactionMode()"\n [disabled]="redactionAllInProgress"\n >\n <span data-l10n-id="toggleTextRedactionButton_label">Redact text</span>\n </button>\n\n <button\n [disabled]="!hasRedactions || redactionAllInProgress"\n id="mvClearBtn"\n #mvClearBtn\n class="mv-button redaction-button--clear"\n aria-pressed="false"\n title="Clear all"\n data-l10n-id="toggleClearAllButton"\n (click)="unmarkAll()"\n >\n <span data-l10n-id="Clear all">Clear all</span>\n </button>\n\n <button\n [disabled]="!hasRedactions || redactionAllInProgress"\n id="mvPreviewBtn"\n class="mv-button"\n [class.redaction-button--preview]="!preview"\n [class.redaction-button--hide-preview]="preview"\n redaction-button--preview\n aria-pressed="false"\n title="Preview"\n data-l10n-id="togglePreviewButton"\n (click)="togglePreview()"\n >\n <span *ngIf="!preview" data-l10n-id="redaction-preview_label">Preview</span>\n <span *ngIf="preview" data-l10n-id="redaction-hide-preview_label"\n >Hide preview</span\n >\n </button>\n\n <button\n [disabled]="!hasRedactions || redactionAllInProgress"\n id="mvRedactBtn"\n class="mv-button redaction-button--download"\n aria-pressed="false"\n title="Redact"\n data-l10n-id="mvRedactBtn"\n (click)="redact()"\n >\n <span data-l10n-id="Save Document">Save document</span>\n </button>\n\n <button\n id="mvCloseBtn"\n #mvCloseBtn\n class="mv-button redaction-button--close"\n title="Close Redaction"\n data-l10n-id="mvRedactBtn"\n (click)="toggleRedactBar()"\n [disabled]="redactionAllInProgress"\n >\n <span data-l10n-id="Close Redaction">Close Redaction</span>\n </button>\n</div>\n'}]}],Pi.ctorParameters=function(){return[{type:K},{type:nt},{type:r.Store}]},Pi.propDecorators={showRedactSearch:[{type:e.Input}]};var Oi=function(){function t(t,e){this.toolbarEventService=t,this.store=e}return t.prototype.ngOnInit=function(){var t=this;this.$subscription=this.store.pipe(r.select(Co)).subscribe((function(e){return t.isPresenter=e})),this.$subscription.add(this.store.pipe(r.select(ko)).subscribe((function(e){return t.presenterName=e})))},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.present=function(){this.toolbarEventService.icp.becomePresenter()},t.prototype.stopPresenting=function(){this.toolbarEventService.icp.stopPresenting()},t.prototype.leaveIcpSession=function(){this.toolbarEventService.icp.leaveSession()},t.prototype.showParticipantsList=function(){this.toolbarEventService.toggleParticipantsList(!this.toolbarEventService.icp.participantsListVisible.getValue())},t}();Oi.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>'}]}],Oi.ctorParameters=function(){return[{type:K},{type:r.Store}]};var xi=function(){};xi.decorators=[{type:e.NgModule,args:[{declarations:[fi,vi,Pi,Oi,gi],providers:[nt,K],exports:[vi,fi,Pi,Oi,gi],imports:[n.CommonModule,o.FormsModule,g.OverlayModule,b.RouterModule]}]}];var ji=function(){function t(t,n){this.toolbarEvents=t,this.store=n,this.update=new e.EventEmitter,this.delete=new e.EventEmitter,this.annotationClick=new e.EventEmitter}return Object.defineProperty(t.prototype,"annotation",{set:function(t){this.anno=Object.assign({},t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectedAnnoId",{set:function(t){if(t){var e=this.anno.id||this.anno.redactionId;this.selected=!!t.annotationId&&t.annotationId===e}},enumerable:!1,configurable:!0}),t.prototype.onSelect=function(){var t=this.anno.id||this.anno.redactionId;this.annotationClick.emit({annotationId:t,editable:!1,selected:!0})},t.prototype.onRectangleUpdate=function(t){var e=Object.assign({},this.anno);e.rectangles=e.rectangles.filter((function(e){return e.id!==t.id})),e.rectangles.push(t),this.update.emit(e)},t.prototype.deleteHighlight=function(){this.delete.emit(this.anno)},t.prototype.addOrEditComment=function(){if(0===this.anno.comments.length){var t={annotationId:this.anno.id,content:"",createdBy:this.anno.createdBy,createdByDetails:void 0,createdDate:T.default.utc().tz("Europe/London").toISOString(),id:m.v4(),lastModifiedBy:"",lastModifiedByDetails:void 0,lastModifiedDate:"",tags:[],page:null,pages:{},pageHeight:null,selected:!1,editable:!1};this.store.dispatch(new we(t))}this.selected=!0,this.annotationClick.emit({annotationId:this.anno.id,editable:!0,selected:!0}),this.toolbarEvents.toggleCommentsPanel(!0)},t}();ji.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'}]}],ji.ctorParameters=function(){return[{type:K},{type:r.Store}]},ji.propDecorators={annotation:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],selectedAnnoId:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}],update:[{type:e.Output}],delete:[{type:e.Output}],annotationClick:[{type:e.Output}],container:[{type:e.ViewChild,args:["container",{static:!1}]}]};var Ti=function(){function t(t,e){this.store=t,this.commentService=e,this.annotations=[]}return t.prototype.ngOnInit=function(){this.selectedAnnotation$=this.store.pipe(r.select(Xo))},t.prototype.onAnnotationUpdate=function(t){this.store.dispatch(new ve(t))},t.prototype.onAnnotationDelete=function(t){t.comments.length>0&&this.commentService.updateUnsavedCommentsStatus(t,!1),this.store.dispatch(new Se(t.id))},t.prototype.selectAnnotation=function(t){this.store.dispatch(new Ce(t))},t}();Ti.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'}]}],Ti.ctorParameters=function(){return[{type:r.Store},{type:Do}]},Ti.propDecorators={page:[{type:e.Input}],annotations:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}]};var Ri=function(){function t(t,n){this.toolbarEvents=t,this.highlightService=n,this.select=new e.EventEmitter,this.update=new e.EventEmitter,this.subscriptions=[],this.enableGrabNDrag=!1}return Object.defineProperty(t.prototype,"annoRect",{get:function(){return this._annoRect},set:function(t){this._annoRect=Object.assign({},t),this.height=+(t.height*this.zoom).toFixed(2),this.width=+(t.width*this.zoom).toFixed(2),this.left=+(t.x*this.zoom).toFixed(2),this.top=+(t.y*this.zoom).toFixed(2)},enumerable:!1,configurable:!0}),t.prototype.ngOnChanges=function(t){t.rotate&&this.adjustForRotation(this.rotate)},t.prototype.ngAfterViewInit=function(){var t=this;this.subscriptions.push(this.toolbarEvents.grabNDrag.subscribe((function(e){return t.enableGrabNDrag=e})))},t.prototype.ngOnDestroy=function(){this.subscriptions.filter((function(t){return!t.closed})).forEach((function(t){return t.unsubscribe()}))},Object.defineProperty(t.prototype,"selected",{get:function(){return this._selected},set:function(t){this._selected=t,this._selected&&this.viewRect&&this.viewRect.nativeElement.focus()},enumerable:!1,configurable:!0}),t.prototype.onClick=function(){this.select.emit(this.annoRect)},t.prototype.onUpdate=function(t){var e=t.offsetHeight,n=t.offsetWidth,o=t.offsetTop,i=t.offsetLeft;if(this.hasRectangleChanged(t)){var a=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,e,n,o,i,this.rotate,this.zoom);a=Object.assign(Object.assign({},this.annoRect),a),this.update.emit(Object.assign({},a))}},t.prototype.adjustForRotation=function(t){var e=this,n=e.top,o=e.left,i=e.height,a=e.width;switch(t){case 90:this.width=i,this.height=a,this.left=this.pageWidth-n-i,this.top=o;break;case 180:this.left=this.pageWidth-o-a,this.top=this.pageHeight-n-i;break;case 270:this.width=i,this.height=a,this.left=n,this.top=this.pageHeight-o-a}},t.prototype.hasRectangleChanged=function(t){return this.left!==t.offsetLeft||this.top!==t.offsetTop||this.width!==t.offsetWidth||this.height!==t.offsetHeight},t}();Ri.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'}]}],Ri.ctorParameters=function(){return[{type:K},{type:mi}]},Ri.propDecorators={color:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],editable:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}],select:[{type:e.Output}],update:[{type:e.Output}],viewRect:[{type:e.ViewChild,args:["rectElement",{static:!1}]}],annoRect:[{type:e.Input}],selected:[{type:e.Input}]};var _i=function(){function t(t){this.http=t,this.snakeCase=function(t){return t.replace(/ +/g," ").split(/ |\B(?=[A-Z])/).map((function(t){return t.toLowerCase()})).join("_")}}return t.prototype.getAllTags=function(t){var e="/em-anno/tags/"+t;return this.http.get(e)},t.prototype.getNewTags=function(t){return this.tagItems?this.tagItems[t]:[]},t.prototype.updateTagItems=function(t,e){var n,o=this,i=t.map((function(t){return Object.assign(Object.assign({},t),{name:o.snakeCase(t.name)})}));this.tagItems=Object.assign(Object.assign({},this.tagItems),((n={})[e]=i,n))},t}();_i.decorators=[{type:e.Injectable}],_i.ctorParameters=function(){return[{type:i.HttpClient}]};var Bi=function(){function t(t,n,o){this.store=t,this.commentService=n,this.tagsServices=o,this.CHAR_LIMIT=5e3,this.totalPrevPagesHeight=0,this.hasUnsavedChanges=!1,this.commentClick=new e.EventEmitter,this.renderComments=new e.EventEmitter,this.delete=new e.EventEmitter,this.updated=new e.EventEmitter,this.changes=new e.EventEmitter,this.rotate=0,this.zoom=1}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions=this.store.select(oi).pipe(s.distinctUntilChanged()).subscribe((function(e){return t.searchString=e})),this.reRenderComments(),this.marginToComment$=this.commentService.marginToCommentEmitter.asObservable()},t.prototype.ngAfterContentInit=function(){this.tagItems&&this.tagItems.length&&this.tagsServices.updateTagItems(this.tagItems,this._comment.annotationId)},t.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe()},Object.defineProperty(t.prototype,"comment",{get:function(){return this._comment},set:function(t){this._comment=Object.assign({},t),this.page=this._comment.page,this.lastUpdate=t.lastModifiedDate?t.lastModifiedDate:t.createdDate,this.author=t.createdByDetails,this.createdBy=t.createdBy,this.editor=t.lastModifiedByDetails,this.originalComment=t.content,this.fullComment=this.originalComment,this.selected=this._comment.selected,this._editable=this._comment.editable,this.tagItems=this._comment.tags;this.totalPrevPagesHeight=0;for(var e=0;e<this.page-1;e++){var n=this._comment.pages[e+1]?this._comment.pages[e+1].styles.height:void 0;n&&(this.totalPrevPagesHeight+=n+10)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"annotation",{set:function(t){this._rectangle=t.rectangles.reduce((function(t,e){return t.y<e.y?t:e}));var e=this._comment.pages[this.page].styles.height/this.zoom;switch(this.rotate){case 90:this.rectTop=this._rectangle.x;break;case 180:this.rectTop=e-(this._rectangle.y+this._rectangle.height);break;case 270:this.rectTop=e-(this._rectangle.x+this._rectangle.width);break;default:this.rectTop=this._rectangle.y}this.rectLeft=this._rectangle.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"editable",{get:function(){return this._editable},enumerable:!1,configurable:!0}),t.prototype.onCommentChange=function(t){this.hasUnsavedChanges=this.originalComment.substring(0,this.CHAR_LIMIT)!==t.substring(0,this.CHAR_LIMIT),this.commentService.onCommentChange(this.hasUnsavedChanges)},t.prototype.deleteOrCancel=function(){this.editable?(this.hasUnsavedChanges=!1,this._editable=!1,this.fullComment=this.originalComment,this.changes.emit(!1),this.author||this.fullComment||this.delete.emit(this._comment)):this.delete.emit(this._comment)},t.prototype.editOrSave=function(){if(this.editable){this._comment.content=this.fullComment.substring(0,this.CHAR_LIMIT);var t=this.tagsServices.getNewTags(this._comment.annotationId),e={comment:this._comment,tags:t};this.updated.emit(e),this.hasUnsavedChanges=!1,this._editable=!1,this.changes.emit(!1)}else this._editable=!0},t.prototype.onCommentClick=function(){this.selected||(this.selected=!0,this._editable=!1,this.commentClick.emit({annotationId:this._comment.annotationId,editable:this._editable,selected:!0}))},t.prototype.reRenderComments=function(){this.renderComments.emit(this._comment)},Object.defineProperty(t.prototype,"commentTop",{get:function(){return this.totalPrevPagesHeight+this.rectTop*this.zoom},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.form.nativeElement.getBoundingClientRect().height/this.zoom},enumerable:!1,configurable:!0}),t}();Bi.decorators=[{type:e.Component,args:[{selector:"mv-anno-comment",template:'<div #form (click)="onCommentClick()" class="aui-comment"\n [ngClass]="{\'stylestoggle\' : (marginToComment$ | async ) }"\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'}]}],Bi.ctorParameters=function(){return[{type:r.Store},{type:Do},{type:_i}]},Bi.propDecorators={commentClick:[{type:e.Output}],renderComments:[{type:e.Output}],delete:[{type:e.Output}],updated:[{type:e.Output}],changes:[{type:e.Output}],rotate:[{type:e.Input}],zoom:[{type:e.Input}],index:[{type:e.Input}],page:[{type:e.Input}],form:[{type:e.ViewChild,args:["form",{static:!1}]}],editableComment:[{type:e.ViewChild,args:["editableComment",{static:!1}]}],comment:[{type:e.Input}],annotation:[{type:e.Input}]};var Di=function(){function t(){this.createHighlightEvent=new e.EventEmitter,this.deleteHighlightEvent=new e.EventEmitter,this.addOrEditCommentEvent=new e.EventEmitter,this.createBookmarkEvent=new e.EventEmitter,this.defaultHeight=70,this.defaultWidth=300}return t.prototype.ngOnChanges=function(t){this.setRectangle(),this.top=this.popupTop(),this.left=this.popupLeft()},Object.defineProperty(t.prototype,"rectangles",{get:function(){return this._rectangles},set:function(t){t&&(this._rectangles=t,this.setRectangle())},enumerable:!1,configurable:!0}),t.prototype.createHighlight=function(){this.createHighlightEvent.emit(),this.rectangle=void 0},t.prototype.deleteHighlight=function(){this.deleteHighlightEvent.emit()},t.prototype.addOrEditComment=function(){this.addOrEditCommentEvent.emit(),setTimeout((function(){location.hash||document.getElementById("viewerContainer").scrollBy(0,1)}),10)},t.prototype.createBookmark=function(){this.createBookmarkEvent.emit(this.rectangle),this.rectangle=void 0},t.prototype.setRectangle=function(){var t=this.rectangles.reduce((function(t,e){return t.y<e.y?t:e}));switch(this.rectangle=Object.assign({},t),this.rotate){case 90:this.rectangle.width=t.height,this.rectangle.height=t.width,this.rectangle.x=this.pageWidth/this.zoom-t.y-t.height,this.rectangle.y=t.x;break;case 180:this.rectangle.x=this.pageWidth/this.zoom-t.x-t.width,this.rectangle.y=this.pageHeight/this.zoom-t.y-t.height;break;case 270:this.rectangle.width=t.height,this.rectangle.height=t.width,this.rectangle.x=t.y,this.rectangle.y=this.pageHeight/this.zoom-t.x-t.width}},t.prototype.popupTop=function(){var t=this.rectangle.y*this.zoom-this.defaultHeight;return t<=0?this.defaultHeight:t},t.prototype.popupLeft=function(){var t=(this.rectangle.x+this.rectangle.width/2)*this.zoom-this.defaultWidth/2;return t<=0?0:t>=this.pageWidth-this.defaultWidth?this.pageWidth-this.defaultWidth:t},t}();Di.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'}]}],Di.ctorParameters=function(){return[]},Di.propDecorators={zoom:[{type:e.Input}],rotate:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}],canHighlight:[{type:e.Input}],canBookmark:[{type:e.Input}],canComment:[{type:e.Input}],canDelete:[{type:e.Input}],createHighlightEvent:[{type:e.Output}],deleteHighlightEvent:[{type:e.Output}],addOrEditCommentEvent:[{type:e.Output}],createBookmarkEvent:[{type:e.Output}],rectangles:[{type:e.Input}]};var Ai=function(){function t(){}return t.prototype.redrawComponents=function(t,e,n,o){var i,a=this;this.sortComponents(t,e,n,o).forEach((function(t){a.adjustIfOverlapping(t,i,o),i=t}))},t.prototype.sortComponents=function(t,e,n,o){var i=this;return t.sort((function(t,a){return t.rectTop=i.top(t._rectangle,e[t.page-1],n,o),a.rectTop=i.top(a._rectangle,e[a.page-1],n,o),i.processSort(t,a)}))},t.prototype.adjustIfOverlapping=function(t,e,n){if(e){var o=e.commentTop+this.height(e);t.commentTop<=o&&(t.rectTop=(o-t.totalPrevPagesHeight)/n)}},t.prototype.processSort=function(t,e){return this.onSameLine(t,e)?t.rectLeft>=e.rectLeft?1:-1:t.commentTop>=e.commentTop?1:-1},t.prototype.onSameLine=function(t,e){return 0===this.difference(t.commentTop,e.commentTop)},t.prototype.top=function(t,e,n,o){var i=e/o;switch(n){case 90:return t.x;case 180:return i-(t.y+t.height);case 270:return i-(t.x+t.width);default:return t.y}},t.prototype.height=function(t){return t.form.nativeElement.getBoundingClientRect().height},t.prototype.difference=function(t,e){return Math.abs(t-e)},t}();Ai.decorators=[{type:e.Injectable}];var Ni=function(){function t(t,e,n,o){this.store=t,this.commentService=e,this.renderService=n,this.toolbarEvents=o,this.pageHeights=[],this.subscriptions=[],this.clearSelection()}return t.prototype.ngOnInit=function(){var t=this;this.comments$=this.store.pipe(r.select(ci)),this.annoEntities$=this.store.pipe(r.select(qo)),this.subscriptions.push(this.toolbarEvents.commentsPanelVisible.subscribe((function(e){t.redrawComments(),t.showCommentsPanel=e}))),this.subscriptions.push(this.toolbarEvents.rotateSubject.subscribe((function(e){return t.rotateDocument()})))},t.prototype.ngOnChanges=function(t){t.annotationSet&&this.commentService.setCommentSet(this),t.contentScrollTop&&this.container&&this.container.nativeElement.scrollTo(0,this.contentScrollTop)},t.prototype.ngOnDestroy=function(){this.subscriptions.length>0&&this.subscriptions.forEach((function(t){return t.unsubscribe()}))},t.prototype.onSelect=function(t){this.store.dispatch(new Ce(t))},t.prototype.onCommentDelete=function(t){var e=this.annotationSet.annotations.find((function(e){return e.id===t.annotationId})),n=Object.assign(Object.assign({},e),{comments:[]});this.onAnnotationUpdate(n),this.redrawComments()},t.prototype.redrawComments=function(){var t=this;setTimeout((function(){var e=t.commentComponents.map((function(t){return t}));t.renderService.redrawComponents(e,t.pageHeights,t.rotate,t.zoom)}),0)},t.prototype.rotateDocument=function(){this.panel&&(this.panel.nativeElement.style.height="0")},t.prototype.onCommentUpdate=function(t){var e=this.annotationSet.annotations.find((function(e){return e.id===t.comment.annotationId})),n=[t.comment],o=t.tags,i=Object.assign(Object.assign({},e),{comments:n,tags:o});this.onAnnotationUpdate(i)},t.prototype.onAnnotationUpdate=function(t){this.store.dispatch(new ve(t))},t.prototype.onContainerClick=function(t){t.path&&t.path[0]===this.panel.nativeElement&&this.clearSelection()},t.prototype.clearSelection=function(){this.store.dispatch(new Ce({annotationId:"",editable:!1,selected:!1}))},t.prototype.allCommentsSaved=function(){this.commentService.allCommentsSaved()},t}();Ni.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'}]}],Ni.ctorParameters=function(){return[{type:r.Store},{type:Do},{type:Ai},{type:K}]},Ni.propDecorators={annotationSet:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],height:[{type:e.Input}],pageHeights:[{type:e.Input}],contentScrollTop:[{type:e.Input}],container:[{type:e.ViewChild,args:["container",{static:!1}]}],panel:[{type:e.ViewChild,args:["panel",{static:!1}]}],commentComponents:[{type:e.ViewChildren,args:["commentComponent"]}]};var Mi=function(){function t(t){this.el=t}return t.prototype.ngAfterContentChecked=function(){this.adjustHeight()},t.prototype.onMouseDown=function(){this.adjustHeight()},t.prototype.adjustHeight=function(){var t=this.el.nativeElement;t.style.overflow="hidden",t.style.height="auto",t.style.height=t.scrollHeight-5+"px"},t}();Mi.decorators=[{type:e.Directive,args:[{selector:"[mvTextAreaAutoExpand]"}]}],Mi.ctorParameters=function(){return[{type:e.ElementRef}]},Mi.propDecorators={onMouseDown:[{type:e.HostListener,args:["input"]}]};var Fi=function(){function t(t,e,n,o){this.store=t,this.printService=e,this.toolbarEvents=n,this.fb=o,this.showFilters=!1,this.hasFilter=!1}return t.prototype.ngOnInit=function(){this.filtersFg=this.fb.group({dateRangeFrom:new o.FormGroup({day:new o.FormControl(""),month:new o.FormControl(""),year:new o.FormControl("")}),dateRangeTo:new o.FormGroup({day:new o.FormControl(""),month:new o.FormControl(""),year:new o.FormControl("")}),tagFilters:this.fb.group({})}),this.comments$=this.store.pipe(r.select(ui)),this.buildCheckBoxForm(),this.container.nativeElement.focus()},t.prototype.buildCheckBoxForm=function(){var t=this;this.filtersFg.reset();var e=this.filtersFg.get("tagFilters"),n=this.store.pipe(r.select(ii));this.allTags$=this.store.pipe(r.select(Uo)),this.$subscriptions=a.combineLatest([this.allTags$,n]).subscribe((function(n){var i=F(n,2),a=i[0],s=i[1];t.hasFilter=s.hasFilter,a.forEach((function(t){var n=!(!s.filters.tagFilters||!s.filters.tagFilters.hasOwnProperty(t.key))&&s.filters.tagFilters[t.key];e.addControl(t.key,new o.FormControl(n))})),t.filtersFg.updateValueAndValidity()}))},t.prototype.onClearFilters=function(){this.store.dispatch(new Oe),this.buildCheckBoxForm()},t.prototype.onFilter=function(){var t=this.filtersFg.value,e=t.dateRangeFrom.year&&t.dateRangeFrom.month&&t.dateRangeFrom.day,n=t.dateRangeTo.year&&t.dateRangeTo.month&&t.dateRangeTo.day,o=e?new Date(t.dateRangeFrom.year,t.dateRangeFrom.month-1,t.dateRangeFrom.day).getTime():null,i=n?new Date(t.dateRangeTo.year,t.dateRangeTo.month-1,t.dateRangeTo.day).getTime():null;this.store.dispatch(new Pe(Object.assign(Object.assign({},t),{dateRangeFrom:o,dateRangeTo:i})))},t.prototype.onFiltersToggle=function(){this.showFilters=!this.showFilters},t.prototype.onClose=function(){this.toolbarEvents.toggleCommentsSummary(!1)},t.prototype.onPrint=function(){this.printService.printElementNatively(this.commentsTable.nativeElement,1e3,900)},t.prototype.navigateToPage=function(t){"pdf"===this.contentType&&this.toolbarEvents.setPage(t),this.toolbarEvents.toggleCommentsSummary(!1),this.toolbarEvents.toggleCommentsPanel(!0)},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t}();Fi.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'}]}],Fi.ctorParameters=function(){return[{type:r.Store},{type:tt},{type:K},{type:o.FormBuilder}]},Fi.propDecorators={title:[{type:e.Input}],contentType:[{type:e.Input}],container:[{type:e.ViewChild,args:["outerContainer",{static:!0}]}],commentsTable:[{type:e.ViewChild,args:["commentContainer",{static:!1}]}]};var Li=function(){function t(t,n){this.toolbarEvents=t,this.highlightService=n,this.saveSelection=new e.EventEmitter,this.drawStartX=-1,this.drawStartY=-1,this.backgroundColor="none",this.subscriptions=[]}return t.prototype.ngOnInit=function(){var t=this;this.subscriptions=[this.toolbarEvents.drawModeSubject.subscribe((function(e){t.defaultHeight=e?"100%":"0px",t.defaultWidth=e?"100%":"0px"})),this.toolbarEvents.redactWholePage.subscribe((function(){t.wholePage=!0}))]},t.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(t){t.unsubscribe()}))},t.prototype.initHighlight=function(t){var e=t.offsetX,n=t.offsetY;if(this.wholePage)this.highlightPage();else switch(this.position="absolute",this.backgroundColor="yellow",this.drawStartX=e,this.drawStartY=n,this.display="block",this.height=50,this.width=50,this.top=this.drawStartY,this.left=this.drawStartX,this.rotate){case 90:this.top=this.drawStartY-this.height;break;case 180:this.top=this.drawStartY-this.height,this.left=this.drawStartX-this.width;break;case 270:this.left=this.drawStartX-this.width}},t.prototype.updateHighlight=function(t){var e=t.currentTarget,n=t.clientX,o=t.clientY,i=e.getBoundingClientRect(),a=n-i.left,s=o-i.top;this.drawStartX>0&&this.drawStartY>0&&(this.height=Math.abs(s-this.drawStartY),this.width=Math.abs(a-this.drawStartX),this.top=Math.min(s,this.drawStartY),this.left=Math.min(a,this.drawStartX))},t.prototype.createHighlight=function(){if(this.height/this.zoom>5||this.width/this.zoom>5){var t=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,this.height,this.width,this.top,this.left,this.rotate,this.zoom);t=Object.assign({id:m.v4()},t),this.saveSelection.emit({rectangles:[t],page:this.page}),this.resetHighlight()}},t.prototype.resetHighlight=function(){this.drawStartX=-1,this.drawStartY=-1,this.display="none",this.width=0,this.height=0,this.wholePage=!1},t.prototype.highlightPage=function(){this.height=this.pageHeight,this.width=this.pageWidth,this.top=0,this.left=0,this.createHighlight()},t}();Li.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'}]}],Li.ctorParameters=function(){return[{type:K},{type:mi}]},Li.propDecorators={page:[{type:e.Input}],pageHeight:[{type:e.Input}],pageWidth:[{type:e.Input}],rotate:[{type:e.Input}],zoom:[{type:e.Input}],container:[{type:e.Input}],saveSelection:[{type:e.Output}],highlight:[{type:e.ViewChild,args:["boxHighlight",{static:!1}]}]};var $i=function(){function t(t,n,o){this.store=t,this.commentService=n,this.toolbarEvents=o,this.showCommentSummaryDialog=new e.EventEmitter,this.tabs=[],this.tabSelected=""}return t.prototype.ngOnInit=function(){var t=this,e=this.store.pipe(r.select($o)),n=this.store.pipe(r.select(di));this.$subscriptions=a.combineLatest([e,n]).subscribe((function(e){var n=F(e,2),o=n[0],i=n[1];t.navigationList=i,t.tabs=t.navigationList.length>0?[{label:"comments"},{label:"filter"},{label:"search"}]:[{label:"comments"}],t.isFiltered=!o.length,t.tabs=L(t.tabs).map((function(e){return t.isFiltered||"filter"!==e.label?Object.assign(Object.assign({},e),{isFiltered:!1}):Object.assign(Object.assign({},e),{isFiltered:!0})}))}))},t.prototype.toggleCommentsSummary=function(){this.showCommentSummaryDialog.emit()},t.prototype.selectTab=function(t){this.tabSelected=t!==this.tabSelected?t:void 0,this.tabSelected?(this.marginToComment=!0,this.commentService.createMarginToCommentEvent(this.marginToComment)):(this.marginToComment=!1,this.commentService.createMarginToCommentEvent(this.marginToComment))},t.prototype.toggleCommentsPanel=function(){this.toolbarEvents.toggleCommentsPanel(!this.toolbarEvents.commentsPanelVisible.getValue())},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t}();$i.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}]}],$i.ctorParameters=function(){return[{type:r.Store},{type:Do},{type:K}]},$i.propDecorators={showCommentSummary:[{type:e.Input}],showCommentSummaryDialog:[{type:e.Output}]};var Hi=function(){function t(t){this.store=t,this.searchResults=[],this.searchIndex=0}return t.prototype.ngAfterViewInit=function(){this.searchInput&&this.searchInput.nativeElement.focus()},t.prototype.ngOnDestroy=function(){var t=this;setTimeout((function(){t.store.dispatch(new Ie(""))}),250)},t.prototype.searchComments=function(t){var e=this;this.clearSearch(),t.length>2&&(this.searchString=t,this.searchResults=this.annotations.filter((function(t){return t.comments.length>0})).filter((function(t){return t.comments[0].content.toLowerCase().includes(e.searchString.toLowerCase())})),this.searchResults.length>0&&this.store.dispatch(new Ie(t)))},t.prototype.clearSearch=function(){this.searchString=void 0,this.searchResults=[],this.searchIndex=0,this.store.dispatch(new Ie(""))},t}();Hi.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}]}],Hi.ctorParameters=function(){return[{type:r.Store}]},Hi.propDecorators={annotations:[{type:e.Input}],searchInput:[{type:e.ViewChild,args:["searchInput",{static:!1}]}]};var Vi=function(){function t(t){this.element=t}return t.prototype.ngAfterViewChecked=function(){this.textToHighlight&&this.highlightInputText(this.textToHighlight)},t.prototype.highlightInputText=function(t){this.resetHighlight(),this.textToHighlight=t;var e=new RegExp(t,"gi"),n=this.element.nativeElement;n.innerHTML.match(e)&&(n.innerHTML=n.innerHTML.replace(e,this.highlightPattern("$&"))),this.textToHighlight=void 0},t.prototype.resetHighlight=function(){for(var t=this.element.nativeElement,e=new RegExp(this.highlightPattern("(.*?)"),"gi");t.innerHTML.match(e);){var n=e.exec(t.innerHTML);n&&(t.innerHTML=t.innerHTML.replace(n[0],n[1]))}},t.prototype.highlightPattern=function(t){return'<span class="mvTextHighlight">'+t+"</span>"},t}();Vi.decorators=[{type:e.Directive,args:[{selector:"[mvTextHighlight]"}]}],Vi.ctorParameters=function(){return[{type:e.ElementRef}]},Vi.propDecorators={textToHighlight:[{type:e.Input}]};var Ui=function(){function t(t){var e=this;this.tagsServices=t,this.validators=[this.minLength,this.maxLength20],this.errorMessages={minLength:"Minimum of 2 characters",maxLength20:"Maximum of 20 characters"},this.requestAutocompleteItems=function(t){return e.tagsServices.getAllTags(e.userId)}}return t.prototype.onUpdateTags=function(t){this.tagsServices.updateTagItems(t,this.annoId)},t.prototype.minLength=function(t){return t.value.length<2?{minLength:!0}:null},t.prototype.maxLength20=function(t){return t.value.length>=20?{maxLength20:!0}:null},t}();Ui.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}]}],Ui.ctorParameters=function(){return[{type:_i}]},Ui.propDecorators={tagItems:[{type:e.Input}],userId:[{type:e.Input}],editable:[{type:e.Input}],annoId:[{type:e.Input}]};var zi=function(){function t(t,e){this.store=t,this.toolbarEvents=e,this.autoSelect=!1,this.navigationList=[],this.index=0}return t.prototype.ngOnChanges=function(t){t.annotationList&&this.initNavigationList()},t.prototype.initNavigationList=function(){var t=this;this.index=0,this.navigationList=L(this.annotationList||[]).map((function(e){return{content:e.comments[0].content,annotationId:e.id,page:e.page,rectangle:t.upperRectangle(e.rectangles)}})).sort(this.sortComments),this.autoSelect&&(this.toolbarEvents.setPage(Number.parseInt(this.navigationList[0].page,0)),this.store.dispatch(new Ce({annotationId:this.navigationList[0].annotationId,editable:!1,selected:!0})))},t.prototype.sortComments=function(t,e){if(t.page!==e.page)return t.page-e.page;var n=t.rectangle,o=e.rectangle;return n.y!==o.y?n.y-o.y:n.x-o.x},t.prototype.nextItem=function(){this.index+=1,this.index===this.annotationList.length&&(this.index=0),this.toolbarEvents.setPage(Number.parseInt(this.navigationList[this.index].page,0)),this.store.dispatch(new Ce({annotationId:this.navigationList[this.index].annotationId,editable:!1,selected:!0}))},t.prototype.prevItem=function(){this.index-=1,this.index<0&&(this.index=this.navigationList.length-1),this.toolbarEvents.setPage(Number.parseInt(this.navigationList[this.index].page,0)),this.store.dispatch(new Ce({annotationId:this.navigationList[this.index].annotationId,editable:!1,selected:!0}))},t.prototype.upperRectangle=function(t){return L(t).sort((function(t,e){return t.y-e.y})),{x:t[0].x,y:t[0].y}},t}();zi.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}]}],zi.ctorParameters=function(){return[{type:r.Store},{type:K}]},zi.propDecorators={annotationList:[{type:e.Input}],autoSelect:[{type:e.Input}]};var Wi=function(){function t(t,e){this.store=t,this.fb=e,this.isPreview=!1}return t.prototype.ngOnInit=function(){var t=this;this.tagGroup=this.fb.group({tagFilters:this.fb.group({})}),this.filter$=this.store.pipe(r.select($o)),this.$subscriptions=this.tagGroup.valueChanges.pipe(s.auditTime(5)).subscribe((function(e){var n=e.tagFilters;t.store.dispatch(new Dt(n))})),this.buildFrom()},t.prototype.buildFrom=function(){var t=this,e=this.tagGroup.get("tagFilters");this.allTags$=this.store.pipe(r.select(Uo)).pipe(s.tap((function(n){t.tagGroup.reset(),n.forEach((function(t){e.addControl(t.key,new o.FormControl(!1))}))})))},t.prototype.onClearFilters=function(){this.tagGroup.reset(),this.store.dispatch(new At)},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.prototype.onRemoveFilter=function(t){this.tagGroup.get("tagFilters").controls[t].setValue(!1)},t.prototype.onToggleFilterView=function(){this.isPreview=!this.isPreview},t}();Wi.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}]}],Wi.ctorParameters=function(){return[{type:r.Store},{type:o.FormBuilder}]};var qi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}_(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.transform=function(e,n,o){void 0===n&&(n="mediumDate"),void 0===o&&(o="Europe/London");var i=T.default(e).tz(o).format("Z");return t.prototype.transform.call(this,e,n,i)},e}(n.DatePipe);qi.decorators=[{type:e.Pipe,args:[{name:"momentDate"}]}];var Gi=function(){function t(t){this.httpClient=t,this.ANNOTATIONS_API="/em-anno"}return t.prototype.getBookmarks=function(t){return this.httpClient.get(this.ANNOTATIONS_API+"/"+t+"/bookmarks",{observe:"response",withCredentials:!0})},t.prototype.createBookmark=function(t){return this.httpClient.post(this.ANNOTATIONS_API+"/bookmarks",t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.updateBookmark=function(t){return this.httpClient.put(this.ANNOTATIONS_API+"/bookmarks",t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.updateMultipleBookmarks=function(t){return this.httpClient.put(this.ANNOTATIONS_API+"/bookmarks_multiple",t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.deleteBookmark=function(t){return this.httpClient.delete(this.ANNOTATIONS_API+"/bookmarks/"+t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.deleteMultipleBookmarks=function(t){return this.httpClient.request("DELETE",this.ANNOTATIONS_API+"/bookmarks_multiple",{body:t,observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t}();Gi.decorators=[{type:e.Injectable}],Gi.ctorParameters=function(){return[{type:i.HttpClient}]};var Zi=function(){function t(){}return t.prototype.transform=function(t,e,n){return t?e?t.filter((function(t){return!!t&&(t[n]?t[n].toLowerCase().includes(e.toLowerCase()):t.toLowerCase().includes(e.toLowerCase()))})):t:[]},t}();Zi.decorators=[{type:e.Pipe,args:[{name:"filter"}]}];var Ji=function(){function t(){}return t.prototype.transform=function(t){return t.split("_").join(" ")},t}();Ji.decorators=[{type:e.Pipe,args:[{name:"unsnake"}]}];var Yi=function(){};Yi.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'}]}],Yi.propDecorators={config:[{type:e.Input}],errorMessage:[{type:e.Input}],formGroup:[{type:e.Input}]};var Ki=function(){};Ki.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 '}]}],Ki.ctorParameters=function(){return[]},Ki.propDecorators={config:[{type:e.Input}],errorMessage:[{type:e.Input}]};var Xi=function(){function t(){}return t.setDescribedBy=function(t,e){return t&&t&&t.isInvalid?e.hint?e.id+"-hint "+e.id+"-error":e.id+"-error":e.hint?e.id+"-hint":null},t}(),Qi=function(){function t(){}return t.prototype.setDescribedBy=function(){return Xi.setDescribedBy(this.errorMessage,this.config)},t}();Qi.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 '}]}],Qi.propDecorators={config:[{type:e.Input}],isHeading:[{type:e.Input}],errorMessage:[{type:e.Input}]};var ta=function(){};ta.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 '}]}],ta.ctorParameters=function(){return[]},ta.propDecorators={config:[{type:e.Input}]};var ea=function(){};ea.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,o.FormsModule,o.ReactiveFormsModule,n.CommonModule,b.RouterModule],declarations:[Yi,Ki,Qi,ta],exports:[Yi,Ki,Qi,ta]}]}];var na=r.createSelector(ao,(function(t){return t.bookmarks})),oa=r.createSelector(na,(function(t){return t.bookmarkPageEntities})),ia=r.createSelector(na,(function(t){return t.bookmarkEntities})),aa=r.createSelector(ia,(function(t){return function(t){var e=JSON.parse(JSON.stringify(t));return vn(e),Object.keys(e).reduce((function(t,n){var o=e[n];if(o.parent){var i=e[o.parent];i.children||(i.children=[]),i.children[o.index]=o}else t[o.index]=o;return t}),[])}(t)})),sa=r.createSelector(na,(function(t){return t.editableBookmark})),ra=r.createSelector(aa,co,lo,ro,(function(t,e,n,o){return{pageNumber:n.pageNumber-1,xCoordinate:n.left,yCoordinate:o[n.pageNumber].styles.height-n.top*o[n.pageNumber].viewportScale,previous:t.length>0?t.sort((function(t,e){return t.index-e.index}))[t.length-1].id:void 0,documentId:e}})),ca=r.createSelector(ro,oa,(function(t,e){if(t&&e){var n=[];return Object.keys(t).forEach((function(o){var i=Number(o)-1,a=e[i];n.push({bookmark:a||[],styles:t[o].styles})})),n}})),la=function(){function t(t,e,n,o){this.store=t,this.highlightService=e,this.toolbarEvents=n,this.viewerEvents=o,this.pages=[],this.drawMode=!1}return t.prototype.ngOnInit=function(){var t=this;this.$subscriptions=this.store.pipe(r.select(ro)).subscribe((function(e){return t.pages=Object.values(e)})),this.annoPages$=this.store.pipe(r.select(ti)),this.$subscriptions.add(this.toolbarEvents.drawModeSubject.subscribe((function(e){return t.drawMode=e}))).add(this.viewerEvents.textHighlight.subscribe((function(e){return t.showContextToolbar(e)}))).add(this.viewerEvents.ctxToolbarCleared.subscribe((function(){return t.clearContextToolbar()})))},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.prototype.showContextToolbar=function(t){this.highlightPage=t.page,this.rectangles=t.rectangles,this.rectangles&&this.toolbarEvents.highlightModeSubject.next(!1)},t.prototype.clearContextToolbar=function(){this.rectangles=void 0},t.prototype.createHighlight=function(){this.highlightService.saveAnnotation(this.rectangles,this.highlightPage),this.highlightService.resetHighlight(),this.rectangles=void 0},t.prototype.createBookmark=function(t){var e=this;this.store.pipe(r.select(ra),s.take(1)).subscribe((function(n){var o=window.getSelection().toString();e.store.dispatch(new nn(Object.assign(Object.assign({},n),{name:o.length>0?o.substr(0,30):"new bookmark",id:m.v4(),pageNumber:e.highlightPage-1,xCoordinate:t.x,yCoordinate:t.y}))),e.toolbarEvents.toggleSideBar(!0),e.toolbarEvents.toggleSideBarView(!1),e.highlightService.resetHighlight(),e.rectangles=void 0}))},t.prototype.saveAnnotation=function(t){var e=t.rectangles,n=t.page;this.highlightService.saveAnnotation(e,n),this.toolbarEvents.drawModeSubject.next(!1)},t}();la.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'}]}],la.ctorParameters=function(){return[{type:r.Store},{type:mi},{type:K},{type:go}]},la.propDecorators={zoom:[{type:e.Input}],rotate:[{type:e.Input}]};var ua=function(){};ua.decorators=[{type:e.NgModule,args:[{imports:[v.A11yModule,n.CommonModule,o.FormsModule,i.HttpClientModule,f.MutableDivModule,y.TagInputModule,b.RouterModule,o.ReactiveFormsModule,w.NgxDatatableModule,ea],declarations:[la,ji,Li,Ti,Ri,Bi,$i,Hi,Vi,Di,Ni,zi,Mi,Fi,Ui,qi,Wi,Zi,Ji],entryComponents:[ji,Ti,Ni],providers:[Bo,Gi,Ai,mi,Do,_i],exports:[ji,Li,Ti,Ni,$i,Hi,Fi,Ui,Wi,qi,Zi,Ji,la]}]}];var pa=function(){function t(t){this.el=t,this.pointerDown=!1,this.dragEnabled=!1}return t.prototype.onPointerDown=function(t){this.dragEnabled&&(t.preventDefault(),this.pointerDown=!0,this.originalPosition={left:t.clientX+this.el.nativeElement.scrollLeft,top:t.clientY+this.el.nativeElement.scrollTop})},t.prototype.onPointerMove=function(t){if(this.pointerDown&&this.dragEnabled){t.preventDefault();var e={left:this.originalPosition.left-(t.clientX+this.el.nativeElement.scrollLeft),top:this.originalPosition.top-(t.clientY+this.el.nativeElement.scrollTop)};this.dragEnabled&&(this.dragX.scrollLeft+=e.left,this.el.nativeElement.scrollTop+=e.top)}},t.prototype.onWindowPointerUp=function(){this.pointerDown=!1},t}();pa.decorators=[{type:e.Directive,args:[{selector:"[mvGrabNDrag]"}]}],pa.ctorParameters=function(){return[{type:e.ElementRef}]},pa.propDecorators={dragEnabled:[{type:e.Input}],dragX:[{type:e.Input}],onPointerDown:[{type:e.HostListener,args:["pointerdown",["$event"]]}],onPointerMove:[{type:e.HostListener,args:["window:pointermove",["$event"]]}],onWindowPointerUp:[{type:e.HostListener,args:["window:pointerup"]}]};var da=function(){function t(t){this.store=t,this.goToDestination=new e.EventEmitter,this.pageLookup={},this.BOOKMARK_CHAR_LIMIT=30,this.options={allowDrag:!0,allowDrop:!0},this._customSort="CUSTOM",this._positionSort="POSITION"}return t.prototype.ngOnInit=function(){var t=this;this.sortMode=this.customSort,this.$subscription=this.store.pipe(r.select(sa)).subscribe((function(e){return t.editableBookmark=e})),this.$subscription.add(this.store.select(ro).subscribe((function(e){Object.keys(e).map((function(n){t.pageLookup[n]=e[n]}))})))},t.prototype.ngOnChanges=function(t){t.bookmarkNodes&&this.sortMode!==this.customSort&&this.sortBookmarks()},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.editBookmark=function(t){this.editableBookmark=t},t.prototype.onAddBookmarkClick=function(){var t=this;this.store.pipe(r.select(ra),s.take(1)).subscribe((function(e){t.store.dispatch(new nn(Object.assign(Object.assign({},e),{name:"",id:R.default()})))}))},t.prototype.onBookmarkMove=function(t){var e=t.node,n=t.from,o=t.to,i=[Object.assign(Object.assign({},e),{previous:o.index>0?o.parent.children[o.index-1].id:void 0,parent:o.parent.documentId?o.parent.id:void 0})],a=this.getSibling(n,n.index);(a=a&&a.id===e.previous?this.getSibling(n,n.index+1):a)&&(i=L(i,[Object.assign(Object.assign({},a),{previous:e.previous})]));var s=this.getSibling(o,o.index+1);s&&(i=L(i,[Object.assign(Object.assign({},s),{previous:e.id})])),this.store.dispatch(new ln(i))},t.prototype.deleteBookmark=function(t){var e;this.customSortBookmarks(),(t=this.tree.treeModel.getNodeById(t.id)).parent||(t.parent=this.tree.treeModel.virtualRoot);var n=t.parent.children;n.length>t.index+1&&((e=n[t.index+1].data).previous=t.data.previous),this.store.dispatch(new sn({deleted:L([t.data.id],gn(t.data.children)),updated:e}))},t.prototype.updateBookmark=function(t,e){var n=Object.assign(Object.assign({},t),{name:e});e&&(this.store.dispatch(new dn(n)),this.editableBookmark=void 0)},t.prototype.goToBookmark=function(t){var e=this.pageLookup[t.pageNumber+1],n=e.styles.height,o=this.scaledY(t.yCoordinate,n,e),i=0,a=0;switch(this.rotate){case 90:a=-o;break;case 180:i=this.scaledY(t.yCoordinate,n-24*this.zoom,e);break;case 270:a=o;break;default:i=o}this.goToDestination.emit([t.pageNumber,{name:"XYZ"},a,i])},Object.defineProperty(t.prototype,"customSort",{get:function(){return this._customSort},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"positionSort",{get:function(){return this._positionSort},enumerable:!1,configurable:!0}),t.prototype.sort=function(t){this.sortMode=t,this.sortBookmarks()},t.prototype.sortBookmarks=function(){switch(this.sortMode){case this.customSort:this.customSortBookmarks();break;case this.positionSort:this.positionSortBookmarks();break;default:this.customSortBookmarks()}},t.prototype.positionSortBookmarks=function(){this.bookmarkNodes.sort((function(t,e){return t.pageNumber===e.pageNumber?t.yCoordinate-e.yCoordinate:t.pageNumber-e.pageNumber})),this.tree.treeModel.update(),this.setDragNDrop(!1)},t.prototype.customSortBookmarks=function(){this.bookmarkNodes.sort((function(t,e){return t.index-e.index})),this.tree.treeModel.update(),this.setDragNDrop(!0)},t.prototype.setDragNDrop=function(t){this.options={allowDrag:t,allowDrop:t}},t.prototype.getSibling=function(t,e){return t.parent.children.length>e?t.parent.children[e]:void 0},t.prototype.scaledY=function(t,e,n){var o=n.viewportScale/this.zoom;return(e/this.zoom-t)/o},t}();da.decorators=[{type:e.Component,args:[{selector:"mv-bookmarks",template:'<a *ngIf="bookmarkNodes?.length === 0" class="highlightedOutlineItem">No bookmarks created yet</a>\n<tree-root [nodes]="bookmarkNodes" class="bookmarks-tree" [options]="options" (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 </ng-template>\n</tree-root>\n'}]}],da.ctorParameters=function(){return[{type:r.Store}]},da.propDecorators={bookmarkNodes:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],goToDestination:[{type:e.Output}],tree:[{type:e.ViewChild,args:[S.TreeComponent]}]};var ha=function(){function t(t,e,n){this.viewerEvents=t,this.store=e,this.toolbarEvents=n,this.selectedView="outline",this.subscriptions=[]}return t.prototype.ngOnInit=function(){var t=this;this.bookmarkNodes$=this.store.pipe(r.select(aa)),this.subscriptions.push(this.store.pipe(r.select(sa)).subscribe((function(e){return t.selectedView=e?"bookmarks":t.selectedView}))),this.subscriptions.push(this.toolbarEvents.sidebarOutlineView.subscribe((function(e){t.selectedView=e?"outline":"bookmarks"})))},t.prototype.ngOnChanges=function(t){t.url&&this.url&&this.store.dispatch(new Qe)},t.prototype.ngOnDestroy=function(){this.subscriptions.length>0&&this.subscriptions.forEach((function(t){return t.unsubscribe()}))},t.prototype.goToDestination=function(t){this.viewerEvents.goToDestination(t)},t.prototype.toggleSidebarView=function(t){this.selectedView=t},t.prototype.isViewedItem=function(t,e){return t.pageNumber===this.currentPageNumber||(void 0===e?t.pageNumber<=this.currentPageNumber:t.pageNumber<=this.currentPageNumber&&e.pageNumber>this.currentPageNumber)},t.prototype.findEndPage=function(t){return void 0===t?Number.MAX_SAFE_INTEGER:t.pageNumber},t}();ha.decorators=[{type:e.Component,args:[{selector:"mv-side-bar",template:'<div id="toolbarSidebar">\n <div *ngIf="annotationsEnabled && selectedView == \'bookmarks\'"\n class="splitToolbarButton toggled">\n <button id="sortBookmarkPosition" class="splitToolbarButton left bookmark__sort__position"\n (click)="bookmarks.sort(bookmarks.positionSort)" title="Order by place in document"></button>\n <button id="sortBookmarkCustom" class="splitToolbarButton left bookmark__sort__custom"\n (click)="bookmarks.sort(bookmarks.customSort)" title="Order manually"></button></div>\n <div class="splitToolbarButtonSeparator"></div>\n <div *ngIf="annotationsEnabled && selectedView == \'bookmarks\'"\n class="splitToolbarButton right">\n <button id="addBookmark"\n class="toolbarButton addBookmark"\n (click)="bookmarks.onAddBookmarkClick()"\n title="Add bookmark" tabindex="3" data-l10n-id="addBookmark">\n <span data-l10n-id="addBookmark_label">Add bookmark</span>\n </button>\n </div>\n</div>\n<div id="sidebarContent">\n <div id="outlineView" class="outlineWithDeepNesting">\n <div class="outlineItem" *ngIf="selectedView === \'outline\'">\n <mv-outline-item *ngFor="let outlineItem of outline; index as i"\n [outline]="outlineItem"\n [currentPageNumber]="currentPageNumber"\n [isCurrentSection]= "isViewedItem(outlineItem, outline[i+1])"\n [endPage]="findEndPage(outline[i+1])"\n (navigationEvent)="goToDestination($event)"></mv-outline-item>\n </div>\n <div *ngIf="annotationsEnabled && selectedView === \'bookmarks\'"\n id="bookmarkContainer">\n <mv-bookmarks [bookmarkNodes]="bookmarkNodes$ | async"\n [zoom]="zoom" [rotate]="rotate"\n (goToDestination)="goToDestination($event)"></mv-bookmarks>\n </div>\n </div>\n</div>\n'}]}],ha.ctorParameters=function(){return[{type:go},{type:r.Store},{type:K}]},ha.propDecorators={annotationsEnabled:[{type:e.Input}],outline:[{type:e.Input}],url:[{type:e.Input}],zoom:[{type:e.Input}],rotate:[{type:e.Input}],currentPageNumber:[{type:e.Input}],bookmarks:[{type:e.ViewChild,args:[da]}]};var ma=function(){function t(){this.navigationEvent=new e.EventEmitter}return t.prototype.ngOnInit=function(){this.showOutlineItems=!0},t.prototype.goToDestination=function(t){t&&this.navigationEvent.emit(t)},t.prototype.toggleOutline=function(){this.showOutlineItems=!this.showOutlineItems},t.prototype.isViewedItem=function(t,e){return t.pageNumber===this.currentPageNumber||(void 0===e?t.pageNumber<=this.currentPageNumber&&this.endPage>this.currentPageNumber:t.pageNumber<=this.currentPageNumber&&e.pageNumber>this.currentPageNumber)},t.prototype.findEndPage=function(t){return void 0===t?Number.MAX_SAFE_INTEGER:t.pageNumber},t.prototype.showHighlightOutlineCss=function(){return this.isCurrentSection?"highlightedOutlineItem":"outlineItem"},t}();ma.decorators=[{type:e.Component,args:[{selector:"mv-outline-item",template:'<div class="outlineItem">\n <div *ngIf="outline.items.length > 0"\n [ngClass]="{ \'outlineItemToggler\': true, \'outlineItemsHidden\': !showOutlineItems }"\n (click)="toggleOutline()"\n (keyup.enter)="toggleOutline()" tabindex="0"></div>\n <a (click)="goToDestination(outline?.dest)"\n (keyup.enter)="goToDestination(outline?.dest)"\n [style.font-weight]="outline.bold ? \'bold\' : \'\'"\n [style.font-style]="outline.italic ? \'italic\' : \'\'"\n [ngClass]="showHighlightOutlineCss()"\n tabindex="0">\n <div style="text-align:left;" [ngClass]="showHighlightOutlineCss()">\n {{ outline.title }}\n <span style="float:right;">\n {{ outline.pageNumber }}\n </span>\n </div>\n </a>\n \n <div *ngIf="outline.items.length > 0" class="outlineItems">\n <div *ngFor="let outlineItem of outline.items; index as i">\n <mv-outline-item\n [outline]="outlineItem" \n [currentPageNumber]= "currentPageNumber" \n [isCurrentSection]= "isViewedItem(outlineItem, outline.items[i+1])"\n [endPage]="findEndPage(outline.items[i+1])"\n (navigationEvent)="goToDestination($event)">\n </mv-outline-item>\n </div>\n </div>\n</div>\n\n'}]}],ma.propDecorators={outline:[{type:e.Input}],currentPageNumber:[{type:e.Input}],isCurrentSection:[{type:e.Input}],endPage:[{type:e.Input}],navigationEvent:[{type:e.Output}]};var ga=function(){function t(t,e,n){this.store=t,this.viewerEvents=e,this.toolbarEvents=n}return t.prototype.ngOnInit=function(){var t=this;this.redactionsPerPage$=this.store.pipe(r.select(Ii)),this.selectedRedaction$=this.store.pipe(r.select(Si)),this.$subscription=this.toolbarEvents.drawModeSubject.subscribe((function(e){return t.drawMode=e})),this.$subscription.add(this.store.pipe(r.select(ki),s.filter((function(t){return!!t}))).subscribe((function(e){return t.downloadDocument(e)}))),this.$subscription.add(this.store.pipe(r.select(co)).subscribe((function(e){return t.documentId=e}))),this.$subscription.add(this.viewerEvents.textHighlight.subscribe((function(e){return t.markTextRedaction(e)}))),this.toolbarEvents.applyRedactToDocument.subscribe((function(){t.store.pipe(r.select(Ci),s.take(1)).subscribe((function(e){t.store.dispatch(new Gn(e))}))})),this.toolbarEvents.clearAllRedactMarkers.subscribe((function(){t.store.dispatch(new Kn(t.documentId))}))},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.markTextRedaction=function(t){var e=t.rectangles;e&&e.length&&this.saveRedaction(t.page,L(e)),this.toolbarEvents.highlightModeSubject.next(!1)},t.prototype.markBoxRedaction=function(t){var e=t.rectangles,n=t.page;this.saveRedaction(n,e),this.toolbarEvents.drawModeSubject.next(!1)},t.prototype.saveRedaction=function(t,e){var n={page:t,rectangles:e,redactionId:m.v4(),documentId:this.documentId};this.store.dispatch(new Mn(n))},t.prototype.onMarkerDelete=function(t){this.store.dispatch(new Un(t))},t.prototype.selectRedaction=function(t){this.store.dispatch(new qn(t))},t.prototype.onMarkerUpdate=function(t){this.store.dispatch(new Mn(t))},t.prototype.downloadDocument=function(t){var e=t.blob,n=t.filename;if(navigator&&navigator.msSaveBlob)navigator.msSaveBlob(e,n);else{var o=URL.createObjectURL(e),i=document.createElement("a");document.body.appendChild(i),i.setAttribute("style","display: none"),i.href=o,i.download=n,i.click(),i.remove(),URL.revokeObjectURL(o)}this.store.dispatch(new Yn)},t}();ga.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'}]}],ga.ctorParameters=function(){return[{type:r.Store},{type:go},{type:K}]},ga.propDecorators={zoom:[{type:e.Input}],rotate:[{type:e.Input}]};var ba=function(){function t(t){this.httpClient=t,this.ICP_SESSION_API="/icp/sessions"}return t.prototype.loadSession=function(t){return this.httpClient.get(this.ICP_SESSION_API+"/"+t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t}();ba.decorators=[{type:e.Injectable}],ba.ctorParameters=function(){return[{type:i.HttpClient}]};var va=function(t,e){var n=this;this.actions$=t,this.annotationApiService=e,this.loadAnnotation$=this.actions$.pipe(k.ofType(te),s.map((function(t){return t.payload})),s.switchMap((function(t){return n.annotationApiService.getAnnotationSet(t).pipe(s.map((function(t){return new ge(t)})),s.catchError((function(t){return a.of(new be(t))})))}))),this.postAnnotation$=this.actions$.pipe(k.ofType(oe),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return n.annotationApiService.postAnnotation(t).pipe(s.map((function(t){return new fe(t)})),s.catchError((function(t){return a.of(new be(t))})))}))),this.deleteAnnotation$=this.actions$.pipe(k.ofType(re),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return n.annotationApiService.deleteAnnotation(t).pipe(s.map((function(e){return new ke(t)})),s.catchError((function(t){return a.of(new Ee(t))})))})))};va.decorators=[{type:e.Injectable}],va.ctorParameters=function(){return[{type:k.Actions},{type:Bo}]},B([k.Effect(),D("design:type",Object)],va.prototype,"loadAnnotation$",void 0),B([k.Effect(),D("design:type",Object)],va.prototype,"postAnnotation$",void 0),B([k.Effect(),D("design:type",Object)],va.prototype,"deleteAnnotation$",void 0);var fa=function(t,e,n){var o=this;this.actions$=t,this.store=e,this.bookmarksApiService=n,this.loadBookmarks$=this.actions$.pipe(k.ofType(Ve),s.withLatestFrom(this.store.pipe(r.select(co))),s.map((function(t){return F(t,2)[1]})),s.exhaustMap((function(t){return o.bookmarksApiService.getBookmarks(t).pipe(s.map((function(t){return new tn(t)})),s.catchError((function(t){return a.of(new en(t))})))}))),this.createBookmark$=this.actions$.pipe(k.ofType(We),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.bookmarksApiService.createBookmark(t).pipe(s.map((function(t){return new on(t)})),s.catchError((function(t){return a.of(new an(t))})))}))),this.moveBookmark$=this.actions$.pipe(k.ofType(Je),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.bookmarksApiService.updateMultipleBookmarks(t).pipe(s.map((function(t){return new un(t)})),s.catchError((function(t){return a.of(new pn(t))})))}))),this.deleteBookmark$=this.actions$.pipe(k.ofType(Ge),s.map((function(t){return t.payload})),s.exhaustMap((function(t){var e=t.deleted,n=t.updated;return o.bookmarksApiService.deleteMultipleBookmarks({deleted:e,updated:n}).pipe(s.switchMap((function(){return n?[new rn(e),new hn(n)]:[new rn(e)]})),s.catchError((function(t){return a.of(new cn(t))})))}))),this.updateBookmark$=this.actions$.pipe(k.ofType(Ke),s.map((function(t){return t.payload})),s.switchMap((function(t){return o.bookmarksApiService.updateBookmark(t).pipe(s.map((function(t){return new hn(t)})),s.catchError((function(t){return a.of(new mn(t))})))})))};fa.decorators=[{type:e.Injectable}],fa.ctorParameters=function(){return[{type:k.Actions},{type:r.Store},{type:Gi}]},B([k.Effect(),D("design:type",Object)],fa.prototype,"loadBookmarks$",void 0),B([k.Effect(),D("design:type",Object)],fa.prototype,"createBookmark$",void 0),B([k.Effect(),D("design:type",Object)],fa.prototype,"moveBookmark$",void 0),B([k.Effect(),D("design:type",Object)],fa.prototype,"deleteBookmark$",void 0),B([k.Effect(),D("design:type",Object)],fa.prototype,"updateBookmark$",void 0);var ya=function(){function t(t){this.httpClient=t,this.markupsApiUrl="/api/markups",this.redactApiUrl="/api/redaction",this.markupsSearchApiUrl="/api/markups/search"}return t.prototype.getRedactions=function(t){var e=this.markupsApiUrl+"/"+t;return this.httpClient.get(e,{observe:"response",withCredentials:!0})},t.prototype.saveRedaction=function(t){return this.httpClient.post(this.markupsApiUrl,t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})),s.catchError((function(){return[]})))},t.prototype.saveBulkRedaction=function(t){return this.httpClient.post(this.markupsSearchApiUrl,t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})),s.catchError((function(){return[]})))},t.prototype.deleteRedaction=function(t){var e=this.markupsApiUrl+"/"+t.documentId+"/"+t.redactionId;return this.httpClient.delete(e,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.deleteAllMarkers=function(t){var e=this.markupsApiUrl+"/"+t;return this.httpClient.delete(e,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t.body})))},t.prototype.redact=function(t){return this.httpClient.post(this.redactApiUrl,t,{observe:"response",withCredentials:!0,responseType:"blob"}).pipe(s.map((function(t){return t})),s.catchError((function(){return[]})))},t}();ya.decorators=[{type:e.Injectable}],ya.ctorParameters=function(){return[{type:i.HttpClient}]};var wa=function(t,e,n){var o=this;this.actions$=t,this.redactionApiService=e,this.toolbarEvents=n,this.loadRedactions$=this.actions$.pipe(k.ofType(wn),s.map((function(t){return t.payload})),s.switchMap((function(t){return o.redactionApiService.getRedactions(t).pipe(s.map((function(t){return new An(t.body)})),s.catchError((function(t){return a.of(new Nn(t))})))}))),this.saveRedaction$=this.actions$.pipe(k.ofType(kn),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.redactionApiService.saveRedaction(t).pipe(s.map((function(t){return new Fn(t)})),s.catchError((function(t){return a.of(new Ln(t))})))}))),this.saveBulkRedaction$=this.actions$.pipe(k.ofType(Cn),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.redactionApiService.saveBulkRedaction(t).pipe(s.tap((function(){return o.toolbarEvents.redactAllInProgressSubject.next(!1)}))).pipe(s.map((function(t){return new Vn(t)})),s.catchError((function(t){return a.of(new $n(t))})))}))),this.deleteRedaction$=this.actions$.pipe(k.ofType(Pn),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.redactionApiService.deleteRedaction(t).pipe(s.map((function(){return new zn(t)})),s.catchError((function(t){return a.of(new Wn(t))})))}))),this.redact$=this.actions$.pipe(k.ofType(jn),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.redactionApiService.redact(t).pipe(s.map((function(e){var n=e.headers.get("content-disposition").split("filename="),o=n.length>1?n[1].replace(/"/g,""):"redacted-document-"+t.documentId;return new Zn({blob:e.body,filename:o})})),s.catchError((function(t){return a.of(new Jn(t))})))}))),this.unmarkAll$=this.actions$.pipe(k.ofType(_n),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.redactionApiService.deleteAllMarkers(t).pipe(s.map((function(t){return new Xn})),s.catchError((function(t){return a.of(new Wn(t))})))})))};wa.decorators=[{type:e.Injectable}],wa.ctorParameters=function(){return[{type:k.Actions},{type:ya},{type:K}]},B([k.Effect(),D("design:type",Object)],wa.prototype,"loadRedactions$",void 0),B([k.Effect(),D("design:type",Object)],wa.prototype,"saveRedaction$",void 0),B([k.Effect(),D("design:type",Object)],wa.prototype,"saveBulkRedaction$",void 0),B([k.Effect(),D("design:type",Object)],wa.prototype,"deleteRedaction$",void 0),B([k.Effect(),D("design:type",Object)],wa.prototype,"redact$",void 0),B([k.Effect(),D("design:type",Object)],wa.prototype,"unmarkAll$",void 0);var Sa=function(){function t(t){this.httpClient=t,this.documentConversionUrl="/doc-assembly/convert"}return t.prototype.convert=function(t){return this.httpClient.post(this.documentConversionUrl+"/"+t,{},{observe:"response",withCredentials:!0,responseType:"blob"}).pipe(s.map((function(t){return t})),s.catchError((function(t){return a.of(t)})))},t}();Sa.decorators=[{type:e.Injectable}],Sa.ctorParameters=function(){return[{type:i.HttpClient}]};var ka=function(){function t(t){this.httpClient=t,this.rotationApiUrl="/em-anno/metadata"}return t.prototype.getRotation=function(t){var e=this.rotationApiUrl+"/"+t;return this.httpClient.get(e,{observe:"response",withCredentials:!0})},t.prototype.saveRotation=function(t){var e=this.rotationApiUrl+"/";return this.httpClient.post(e,t,{observe:"response",withCredentials:!0}).pipe(s.map((function(t){return t})),s.catchError((function(){return[]})))},t}();ka.decorators=[{type:e.Injectable}],ka.ctorParameters=function(){return[{type:i.HttpClient}]};var Ea=function(t,e,n){var o=this;this.actions$=t,this.documentConversionService=e,this.rotationApiService=n,this.convert$=this.actions$.pipe(k.ofType(ut),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.documentConversionService.convert(t).pipe(s.map((function(t){var e=URL.createObjectURL(t.body);return new Et(e)})),s.catchError((function(t){return a.of(new Ct(t))})))}))),this.loadRotation$=this.actions$.pipe(k.ofType(mt),s.map((function(t){return t.payload})),s.switchMap((function(t){return o.rotationApiService.getRotation(t).pipe(s.map((function(t){return new Ot(t.body)})),s.catchError((function(t){return a.of(new xt(t))})))}))),this.saveRotation$=this.actions$.pipe(k.ofType(vt),s.map((function(t){return t.payload})),s.switchMap((function(t){return o.rotationApiService.saveRotation(t).pipe(s.map((function(t){return new Tt(t.body)})),s.catchError((function(t){return a.of(new Rt(t))})))})))};Ea.decorators=[{type:e.Injectable}],Ea.ctorParameters=function(){return[{type:k.Actions},{type:Sa},{type:ka}]},B([k.Effect(),D("design:type",Object)],Ea.prototype,"convert$",void 0),B([k.Effect(),D("design:type",Object)],Ea.prototype,"loadRotation$",void 0),B([k.Effect(),D("design:type",Object)],Ea.prototype,"saveRotation$",void 0);var Ca=function(t,e,n){var o=this;this.actions$=t,this.icpApiService=e,this.icpUpdateService=n,this.loadIcpSession$=this.actions$.pipe(k.ofType(Mt),s.map((function(t){return t.payload})),s.exhaustMap((function(t){return o.icpApiService.loadSession(t).pipe(s.map((function(t){return new qt(t)})),s.catchError((function(t){return a.of(new Wt(t))})))}))),this.joinIcpSocketSession$=this.actions$.pipe(k.ofType(Ft),s.map((function(t){return t.payload})),s.switchMap((function(t){return o.icpUpdateService.joinSession(t.username,t.session).pipe(s.map((function(e){return new Gt({session:t.session,participantInfo:e})})))})))};Ca.decorators=[{type:e.Injectable}],Ca.ctorParameters=function(){return[{type:k.Actions},{type:ba},{type:vo}]},B([k.Effect(),D("design:type",Object)],Ca.prototype,"loadIcpSession$",void 0),B([k.Effect(),D("design:type",Object)],Ca.prototype,"joinIcpSocketSession$",void 0);var Ia=[va,fa,wa,Ea,Ca],Pa=function(){function t(t){this.store=t,this.mediaLoadStatus=new e.EventEmitter,this.viewerException=new e.EventEmitter,this.documentTitle=new e.EventEmitter}return t.prototype.ngOnInit=function(){var t=this;this.store.dispatch(new kt(this.extractDMStoreDocId(this.originalUrl))),this.$subscription=this.store.pipe(r.select(po),s.filter((function(t){return!!t}))).subscribe((function(e){e.url?(t.convertedUrl=e.url,t.store.dispatch(new It)):t.onLoadException(new et(e.error))}))},t.prototype.ngOnDestroy=function(){this.$subscription.unsubscribe()},t.prototype.onMediaLoad=function(t){this.mediaLoadStatus.emit(t)},t.prototype.onLoadException=function(t){this.viewerException.emit(t)},t.prototype.onDocumentTitleChange=function(t){this.documentTitle.emit(t)},t.prototype.extractDMStoreDocId=function(t){return t.includes("/documents/")?t=t.split("/documents/")[1]:t.includes("/documentsv2/")&&(t=t.split("/documentsv2/")[1]),t.replace("/binary","")},t}();Pa.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}]}],Pa.ctorParameters=function(){return[{type:r.Store}]},Pa.propDecorators={originalUrl:[{type:e.Input}],downloadFileName:[{type:e.Input}],height:[{type:e.Input}],enableAnnotations:[{type:e.Input}],enableRedactions:[{type:e.Input}],annotationSet:[{type:e.Input}],mediaLoadStatus:[{type:e.Output}],viewerException:[{type:e.Output}],documentTitle:[{type:e.Output}]};var Oa=function(){function t(t){this.toolbarEvents=t}return t.prototype.onCancel=function(){this.toolbarEvents.icp.leavingSession.next(!1)},t.prototype.onConfirm=function(){this.toolbarEvents.icp.confirmExit(),this.toolbarEvents.icp.leavingSession.next(!1)},t}();Oa.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'}]}],Oa.ctorParameters=function(){return[{type:K}]};var xa=function(){function t(t){this.store=t}return t.prototype.ngOnInit=function(){this.bookmarksPerPage$=this.store.pipe(r.select(ca))},t}();xa.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'}]}],xa.ctorParameters=function(){return[{type:r.Store}]},xa.propDecorators={zoom:[{type:e.Input}],rotate:[{type:e.Input}]};var ja=function(){function t(t,e,n,o){this.el=t,this.store=e,this.toolbarButtons=n,this.toolbarEvents=o,this.rotation=0,this.savedRotation=0}return t.prototype.ngOnInit=function(){var t=this;this.$subscriptions=this.toolbarEvents.rotateSubject.subscribe((function(e){return t.onRotate(e)})),this.$subscriptions.add(this.toolbarEvents.saveRotationSubject.subscribe((function(){return t.saveRotation()}))).add(this.store.pipe(r.select(ho)).subscribe((function(e){return t.savedRotation=e}))).add(this.store.pipe(r.select(co)).subscribe((function(e){return t.documentId=e})))},t.prototype.ngOnDestroy=function(){this.$subscriptions.unsubscribe()},t.prototype.onMediaLoad=function(t){var e=this;this.rotation=0,this.store.dispatch(new Pt(this.documentId)),this.store.pipe(r.select(mo),s.filter((function(t){return!!t})),s.take(1)).subscribe((function(){e.savedRotation&&e.toolbarEvents.rotateSubject.next(e.savedRotation)}))},t.prototype.onRotate=function(t){this.rotation=(this.rotation+t)%360,this.toolbarButtons.showSaveRotationButton=this.savedRotation!==this.rotation},t.prototype.saveRotation=function(){var t={documentId:this.documentId,rotationAngle:this.rotation};this.store.dispatch(new jt(t))},t}();ja.decorators=[{type:e.Directive,args:[{selector:"[mvRotationPersist]"}]}],ja.ctorParameters=function(){return[{type:e.ElementRef},{type:r.Store},{type:nt},{type:K}]},ja.propDecorators={onMediaLoad:[{type:e.HostListener,args:["mediaLoadStatus",["$event"]]}]};var Ta=function(){function t(t,e){this.toolbarEvents=t,this.store=e,this.showParticipantsList=!1}return t.prototype.ngOnInit=function(){var t=this;this.participants$=this.store.pipe(r.select(Io)),this.presenter$=this.store.pipe(r.select(So)),this.isPresenter$=this.store.pipe(r.select(Co)),this.subscription=this.toolbarEvents.icp.participantsListVisible.subscribe((function(e){return t.showParticipantsList=e}))},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t}();Ta.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'}]}],Ta.ctorParameters=function(){return[{type:K},{type:r.Store}]};var Ra=function(){function t(t,e,n,o,i){this.element=t,this.toolbarEvents=e,this.viewerEvents=n,this.highlightService=o,this.store=i}return t.prototype.ngOnInit=function(){var t=this;this.$subscription=this.store.select(ro).subscribe((function(e){e[1]&&(t.allPages=e)}))},t.prototype.ngOnDestroy=function(){this.$subscription&&this.$subscription.unsubscribe()},t.prototype.onMouseUp=function(t){var e=t.target.offsetParent.offsetParent,n=parseInt(e.getAttribute("data-page-number"),10);if(this.toolbarEvents.highlightModeSubject.getValue()){var o=this.getRectangles(t,n);this.viewerEvents.textSelected({page:n,rectangles:o})}},t.prototype.onPdfViewerClick=function(t){this.store.dispatch(new Ce({annotationId:"",selected:!1,editable:!1})),this.viewerEvents.clearCtxToolbar()},t.prototype.getRectangles=function(t,e){this.pageHeight=this.allPages[e].styles.height,this.pageWidth=this.allPages[e].styles.width,this.zoom=parseFloat(this.allPages[e].scaleRotation.scale),this.rotate=parseInt(this.allPages[e].scaleRotation.rotation,10);var n=window.getSelection();if(n){var o=t.target;if(this.removeEnhancedTextModeStyling(o),n.rangeCount&&!n.isCollapsed){var i=n.getRangeAt(0).cloneRange().getClientRects();if(i){for(var a=o.parentElement.getBoundingClientRect(),s=[],r=function(t){var e=c.createTextRectangle(i[t],a);s.find((function(t){return t.width===e.width&&t.x===e.x}))||s.push(e)},c=this,l=0;l<i.length;l++)r(l);return s}}}},t.prototype.createTextRectangle=function(t,e){var n=t.bottom-t.top,o=t.right-t.left,i=t.top-e.top,a=t.left-e.left,s=this.highlightService.applyRotation(this.pageHeight,this.pageWidth,n,o,i,a,this.rotate,this.zoom);return s=Object.assign({id:m.v4()},s)},t.prototype.removeEnhancedTextModeStyling=function(t){if(t.parentElement.children)for(var e=0;e<t.parentElement.children.length;e++){var n=t.parentElement.children[e];n.style.padding="0";n.style.transform=n.style.transform.replace(/translate[XYZ]\(-?\d*(\.\d+)?(px)?\)/g,"").trim()}},t}();Ra.decorators=[{type:e.Directive,args:[{selector:"[mvCreateTextHighlight]"}]}],Ra.ctorParameters=function(){return[{type:e.ElementRef},{type:K},{type:go},{type:mi},{type:r.Store}]},Ra.propDecorators={onMouseUp:[{type:e.HostListener,args:["mouseup",["$event"]]}],onPdfViewerClick:[{type:e.HostListener,args:["mousedown",["$event"]]}]};var _a=function(){function n(t){this.toolbarEvents=t,this.loadStatus=new e.EventEmitter,this.playbackMsg="loading"}return n.prototype.ngOnInit=function(){var e=this;this.subscription=this.toolbarEvents.downloadSubject.subscribe((function(){return e.downloadLink.nativeElement.click()})),this.loadStatus.emit(t.ResponseType.SUCCESS)},n.prototype.ngOnChanges=function(t){t.url&&this.reloadVideo()},n.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},n.prototype.reloadVideo=function(){this.videoPlayer&&(this.playbackMsg="loading",this.videoPlayer.nativeElement.load())},n.prototype.onSuccess=function(){this.playbackMsg="success"},n.prototype.onError=function(){this.playbackMsg="error"},n}();_a.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'}]}],_a.ctorParameters=function(){return[{type:K}]},_a.propDecorators={url:[{type:e.Input}],downloadFileName:[{type:e.Input}],multimediaOn:[{type:e.Input}],loadStatus:[{type:e.Output}],downloadLink:[{type:e.ViewChild,args:["downloadLink",{static:!1}]}],videoPlayer:[{type:e.ViewChild,args:["videoPlayer",{static:!1}]}]};var Ba=function(){};Ba.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,i.HttpClientModule,xi,ua,y.TagInputModule,o.FormsModule,o.ReactiveFormsModule,b.RouterModule,r.StoreModule.forFeature("media-viewer",io),k.EffectsModule.forFeature(Ia),S.TreeModule,f.MutableDivModule],declarations:[jo,ha,da,ma,Ro,_o,_a,hi,Pa,pa,ja,Ra,Oa,ga,xa,Ta],entryComponents:[jo,Ro,_o],providers:[X,Do,ya,ba,vo,bo,xo,Po,Oo,ya,Sa,ka],exports:[hi]}]}],t.ADD_OR_EDIT_COMMENT=se,t.APPLY_COMMENT_SUMMARY_FILTER=de,t.AddOrEditComment=we,t.AnnotationApiService=Bo,t.AnnotationEffects=va,t.AnnotationSetComponent=Ti,t.AnnotationViewComponent=ji,t.AnnotationsModule=ua,t.ApplyCommentSymmaryFilter=Pe,t.BoxHighlightCreateComponent=Li,t.CLEAR_COMMENT_SUMMARY_FILTER=he,t.ClearCommentSummaryFilters=Oe,t.CommentFilterComponent=Wi,t.CommentSearchComponent=Hi,t.CommentSetComponent=Ni,t.CommentSetHeaderComponent=$i,t.CommentsSummaryComponent=Fi,t.DELETE_ANNOTATION=re,t.DELETE_ANNOTATION_FAIL=le,t.DELETE_ANNOTATION_SUCCESS=ce,t.DeleteAnnotation=Se,t.DeleteAnnotationFail=Ee,t.DeleteAnnotationSuccess=ke,t.FilterPipe=Zi,t.IcpToolbarComponent=Oi,t.LOAD_ANNOTATION_SET=te,t.LOAD_ANNOTATION_SET_FAIL=ne,t.LOAD_ANNOTATION_SET_SUCCESS=ee,t.LoadAnnotationSet=me,t.LoadAnnotationSetFail=be,t.LoadAnnotationSetSucess=ge,t.MainToolbarComponent=vi,t.MediaViewerComponent=hi,t.MediaViewerModule=Ba,t.MetadataLayerComponent=la,t.MomentDatePipe=qi,t.RedactionToolbarComponent=Pi,t.SAVE_ANNOTATION=oe,t.SAVE_ANNOTATION_FAIL=ae,t.SAVE_ANNOTATION_SUCCESS=ie,t.SEARCH_COMMENT=pe,t.SELECT_ANNOTATION=ue,t.SaveAnnotation=ve,t.SaveAnnotationFail=ye,t.SaveAnnotationSuccess=fe,t.SearchBarComponent=fi,t.SearchComment=Ie,t.SelectedAnnotation=Ce,t.TagsComponent=Ui,t.ToolbarButtonVisibilityService=nt,t.ToolbarEventService=K,t.ToolbarModule=xi,t.UnsnakePipe=Ji,t.ViewerException=et,t.commentSearchQ=Ne,t.getAnnoEnt=De,t.getAnnoPageEnt=Be,t.getAnnoPerPage=si,t.getAnnoSet=Re,t.getAnnotationEntities=qo,t.getAnnotationSet=Ko,t.getAnnotationsSetState=Wo,t.getCommentEntities=Qo,t.getCommentEnts=_e,t.getCommentSummary=ui,t.getCommentSummaryFilters=ii,t.getCommentsArray=ci,t.getComponentSearchQueries=ei,t.getComponentSearchText=oi,t.getDocumentIdSetId=Jo,t.getFilteredAnnotations=di,t.getPageEntities=ti,t.getSelectedAnno=Ae,t.getSelectedAnnotation=Xo,t.getSet=Go,t.getSummaryFilters=Me,t.initialState=je,t.reducer=Te,t["ɵ0"]=zo,t["ɵ1"]=Zo,t["ɵ2"]=Yo,t["ɵ3"]=ni,t["ɵ4"]=ai,t["ɵ5"]=ri,t["ɵ6"]=li,t["ɵ7"]=pi,t["ɵa"]=bi,t["ɵba"]=_i,t["ɵbb"]=Vi,t["ɵbc"]=Di,t["ɵbd"]=Ai,t["ɵbe"]=zi,t["ɵbf"]=Mi,t["ɵbg"]=tt,t["ɵbh"]=Gi,t["ɵbi"]=Ia,t["ɵbj"]=fa,t["ɵbk"]=wa,t["ɵbl"]=ya,t["ɵbm"]=Ea,t["ɵbn"]=Sa,t["ɵbo"]=ka,t["ɵbp"]=Ca,t["ɵbq"]=ba,t["ɵbr"]=vo,t["ɵbs"]=bo,t["ɵbt"]=jo,t["ɵbu"]=X,t["ɵbv"]=xo,t["ɵbw"]=Po,t["ɵbx"]=Oo,t["ɵby"]=ha,t["ɵbz"]=da,t["ɵc"]=io,t["ɵca"]=ma,t["ɵcb"]=Ro,t["ɵcc"]=To,t["ɵcd"]=_o,t["ɵce"]=_a,t["ɵcf"]=Pa,t["ɵcg"]=pa,t["ɵch"]=ja,t["ɵci"]=Ra,t["ɵcj"]=Oa,t["ɵck"]=ga,t["ɵcl"]=xa,t["ɵcm"]=Ta,t["ɵcn"]=so,t["ɵco"]=ro,t["ɵcp"]=Fo,t["ɵcq"]=Ho,t["ɵcr"]=Vo,t["ɵd"]=ao,t["ɵf"]=Xt,t["ɵg"]=Qt,t["ɵh"]=Le,t["ɵi"]=$e,t["ɵj"]=He,t["ɵl"]=yn,t["ɵm"]=to,t["ɵn"]=no,t["ɵp"]=gi,t["ɵq"]=mi,t["ɵr"]=ea,t["ɵs"]=Yi,t["ɵt"]=Ki,t["ɵu"]=Qi,t["ɵv"]=ta,t["ɵw"]=go,t["ɵx"]=Do,t["ɵy"]=Ri,t["ɵz"]=Bi,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=hmcts-media-viewer.umd.min.js.map
|