Your IP : 18.117.183.206


Current Path : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/ui/viewer/dist/
Upload File :
Current File : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/ui/viewer/dist/viewer.bundle.js.map

{"version":3,"file":"viewer.bundle.js","sources":["../src/item-document.js","../src/single-document-controller.js"],"sourcesContent":["import {Text, Uri, Loc, Dom, Reflection, Event, Runtime, ajax as Ajax, Type} from 'main.core';\nimport {EventEmitter} from 'main.core.events';\n\nconst Item = Reflection.namespace('BX.UI.Viewer.Item');\nconst Util = Reflection.namespace('BX.util');\nconst BXPromise = Reflection.namespace('BX.Promise');\n\nconst DEFAULT_SCALE = 1.4;\nconst PAGES_TO_PRELOAD = 3;\n\n// noinspection JSClosureCompilerSyntax\n/**\n * @memberof BX.UI.Viewer\n * @extends BX.UI.Viewer.Item\n */\nexport class Document extends Item\n{\n\tstatic #loadingLibraryPromise = null;\n\t#pageNumber: number = 1;\n\t#loadingDocumentPromise: Promise = null;\n\n\tpdfDocument;\n\tpdfPages: Object<number,Object> = {};\n\tscale: number = DEFAULT_SCALE;\n\tpdfRenderedPages: Object<number,Object> = {};\n\tlastRenderedPdfPage: number = 0;\n\tcontentNode: Element;\n\tpreviewHtml: Element;\n\tdisableAnnotationLayer: boolean = false;\n\n\tconstructor (options)\n\t{\n\t\tsuper(options);\n\n\t\toptions = options || {};\n\n\t\tthis.scale = options.scale || DEFAULT_SCALE;\n\t}\n\n\tsetPropertiesByNode(node:HTMLElement): void\n\t{\n\t\tsuper.setPropertiesByNode(node);\n\n\t\tthis.disableAnnotationLayer = node.dataset.hasOwnProperty('disableAnnotationLayer');\n\t}\n\n\tapplyReloadOptions(options)\n\t{\n\t\tthis.controller.unsetCachedData(this.src);\n\t}\n\n\tlistContainerModifiers(): Array<string>\n\t{\n\t\tconst result = [\n\t\t\t'ui-viewer-document',\n\t\t];\n\t\tif (this.controller.stretch)\n\t\t{\n\t\t\tresult.push('--stretch');\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tsetSrc(src: string|Uri): this\n\t{\n\t\tthis.src = src;\n\t\tthis._pdfSrc = null;\n\n\t\treturn this.#resetState();\n\t}\n\n\tsetPdfSource(pdfSource: string|Uri|ArrayBuffer): this\n\t{\n\t\tthis._pdfSrc = pdfSource;\n\n\t\treturn this.#resetState();\n\t}\n\n\t#resetState(): this\n\t{\n\t\tthis.pdfRenderedPages = {};\n\t\tthis.lastRenderedPdfPage = null;\n\t\tthis.pdfDocument = null;\n\t\tthis.pdfPages = {};\n\t\tthis.setPageNumber(1);\n\t\tif (this.printer)\n\t\t{\n\t\t\tthis.hidePrintProgress();\n\t\t\tthis.printer.destroy();\n\t\t}\n\t}\n\n\tloadLibrary(): Promise\n\t{\n\t\tif (Document.#loadingLibraryPromise !== null)\n\t\t{\n\t\t\treturn Document.#loadingLibraryPromise;\n\t\t}\n\t\tDocument.#loadingLibraryPromise = new Promise((resolve, reject) => {\n\t\t\tRuntime.loadExtension('ui.pdfjs').then(() => {\n\t\t\t\tif (!pdfjsLib.GlobalWorkerOptions.workerSrc)\n\t\t\t\t{\n\t\t\t\t\tpdfjsLib.GlobalWorkerOptions.workerSrc = '/bitrix/js/ui/pdfjs/pdf.worker.js';\n\t\t\t\t}\n\n\t\t\t\tDocument.#loadingLibraryPromise = null;\n\n\t\t\t\tresolve();\n\t\t\t})\n\t\t\t.catch(reject);\n\t\t});\n\n\t\treturn Document.#loadingLibraryPromise;\n\t}\n\n\tloadData(): BXPromise\n\t{\n\t\tconst promise = new BXPromise();\n\n\t\tif (this._pdfSrc)\n\t\t{\n\t\t\tthis.loadLibrary().then(() => {\n\t\t\t\tpromise.fulfill(this);\n\t\t\t});\n\n\t\t\treturn promise;\n\t\t}\n\n\t\tconsole.log('loadData pdf');\n\t\tconst ajaxPromise = Ajax.promise({\n\t\t\turl: Uri.addParam(this.src, {ts: 'bxviewer'}),\n\t\t\tmethod: 'GET',\n\t\t\tdataType: 'json',\n\t\t\theaders: [\n\t\t\t\t{\n\t\t\t\t\tname: 'BX-Viewer-src',\n\t\t\t\t\tvalue: this.src\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'BX-Viewer',\n\t\t\t\t\tvalue: 'document'\n\t\t\t\t}\n\t\t\t]\n\t\t});\n\n\t\tajaxPromise.then((response) => {\n\t\t\tif (!response || !response.data)\n\t\t\t{\n\t\t\t\tthis.isTransforming = false;\n\t\t\t\tpromise.reject({\n\t\t\t\t\titem: this,\n\t\t\t\t\tmessage: Loc.getMessage(\"JS_UI_VIEWER_ITEM_TRANSFORMATION_ERROR_1\").replace('#DOWNLOAD_LINK#', this.getSrc()),\n\t\t\t\t\ttype: 'error'\n\t\t\t\t});\n\n\t\t\t\treturn promise;\n\t\t\t}\n\n\t\t\tif (response.data.hasOwnProperty('pullTag'))\n\t\t\t{\n\t\t\t\tif (!this.isTransforming)\n\t\t\t\t{\n\t\t\t\t\tthis.transformationPromise = promise;\n\t\t\t\t\tthis.registerTransformationHandler(response.data.pullTag);\n\t\t\t\t}\n\t\t\t\tthis.isTransforming = true;\n\t\t\t}\n\n\t\t\tif (response.data.data && response.data.data.src)\n\t\t\t{\n\t\t\t\tthis.isTransforming = false;\n\t\t\t\tthis._pdfSrc = response.data.data.src;\n\t\t\t\tthis.loadLibrary().then(() => {\n\t\t\t\t\tpromise.fulfill(this);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\treturn promise;\n\t}\n\n\trender(): HTMLDivElement\n\t{\n\t\tthis.controller.showLoading();\n\n\t\tthis.contentNode = Dom.create('div', {\n\t\t\tprops: {\n\t\t\t\tclassName: 'ui-viewer-item-document-content',\n\t\t\t\ttabIndex: 2208\n\t\t\t},\n\t\t});\n\n\t\tEvent.bind(this.contentNode, 'scroll', Runtime.throttle(this.handleScrollDocument.bind(this), 100));\n\n\t\treturn this.contentNode;\n\t}\n\n\tgetNakedActions(): Array\n\t{\n\t\tconst nakedActions = super.getNakedActions();\n\n\t\treturn this.insertPrintBeforeInfo(nakedActions);\n\t}\n\n\tinsertPrintBeforeInfo(actions: Array): Array<{type: string, action: Function}>\n\t{\n\t\tactions = actions || [];\n\n\t\tlet infoIndex = null;\n\t\tfor (let i = 0; i < actions.length; i++)\n\t\t{\n\t\t\tif (actions[i].type === 'info')\n\t\t\t{\n\t\t\t\tinfoIndex = i;\n\t\t\t}\n\t\t}\n\n\t\tconst printAction = {\n\t\t\ttype: 'print',\n\t\t\taction: this.print.bind(this)\n\t\t};\n\n\t\tif (infoIndex === null)\n\t\t{\n\t\t\tactions.push(printAction);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tactions = Util.insertIntoArray(actions, infoIndex, printAction);\n\t\t}\n\n\t\treturn actions;\n\t}\n\n\tgetFirstDocumentPageHeight(): Promise<number>\n\t{\n\t\tif (this._height)\n\t\t{\n\t\t\treturn Promise.resolve(this._height);\n\t\t}\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.getDocumentPage(this.pdfDocument, 1).then((page) => {\n\t\t\t\tconst viewport = page.getViewport(this.scale);\n\t\t\t\tthis._height = viewport.height;\n\n\t\t\t\tresolve(this._height);\n\t\t\t});\n\t\t});\n\t}\n\n\thandleScrollDocument(event): void\n\t{\n\t\tthis.getFirstDocumentPageHeight().then((height) => {\n\t\t\tconst scrollBottom = this.contentNode.scrollHeight - this.contentNode.scrollTop - this.contentNode.clientHeight;\n\t\t\tif (scrollBottom < height * PAGES_TO_PRELOAD && this.pdfDocument.numPages > this.lastRenderedPdfPage)\n\t\t\t{\n\t\t\t\tfor (let i = this.lastRenderedPdfPage + 1; i <= Math.min(this.pdfDocument.numPages, this.lastRenderedPdfPage + PAGES_TO_PRELOAD); i++)\n\t\t\t\t{\n\t\t\t\t\tthis.renderDocumentPage(this.pdfDocument, i);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.setPageNumber((this.contentNode.scrollTop / height) + 1);\n\t\t});\n\t}\n\n\tloadDocument(): Promise<Object>\n\t{\n\t\tif (this.pdfDocument)\n\t\t{\n\t\t\treturn Promise.resolve(this.pdfDocument);\n\t\t}\n\n\t\tif (this.#loadingDocumentPromise)\n\t\t{\n\t\t\treturn this.#loadingDocumentPromise;\n\t\t}\n\n\t\tthis.#loadingDocumentPromise = new Promise((resolve) => {\n\t\t\tthis.loadData().then(() => {\n\t\t\t\tpdfjsLib.getDocument(this._pdfSrc).promise.then((pdf) => {\n\t\t\t\t\tthis.pdfDocument = pdf;\n\t\t\t\t\tthis.#loadingDocumentPromise = null;\n\n\t\t\t\t\tresolve(this.pdfDocument);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\treturn this.#loadingDocumentPromise;\n\t}\n\n\tgetDocumentPage(pdf, pageNumber): Promise<Object>\n\t{\n\t\tif (this.pdfPages[pageNumber])\n\t\t{\n\t\t\treturn Promise.resolve(this.pdfPages[pageNumber]);\n\t\t}\n\n\t\treturn new Promise((resolve) => {\n\t\t\tpdf.getPage(pageNumber).then((page) => {\n\t\t\t\tthis.pdfPages[pageNumber] = page;\n\n\t\t\t\tresolve(this.pdfPages[pageNumber]);\n\t\t\t});\n\t\t});\n\t}\n\n\trenderDocumentPage(pdf, pageNumber): Promise<Object>\n\t{\n\t\tconst pagePromise = this.pdfRenderedPages[pageNumber];\n\t\tif (pagePromise instanceof Promise)\n\t\t{\n\t\t\treturn pagePromise;\n\t\t}\n\t\telse if(!!pagePromise)\n\t\t{\n\t\t\treturn Promise.resolve(pagePromise);\n\t\t}\n\n\t\tthis.pdfRenderedPages[pageNumber] = new Promise((resolve) => {\n\t\t\tthis.getDocumentPage(pdf, pageNumber).then((page) =>  {\n\t\t\t\tconst canvas = this.createCanvasPage();\n\t\t\t\tconst viewport = page.getViewport(this.scale);\n\t\t\t\tcanvas.height = viewport.height;\n\t\t\t\tcanvas.width = viewport.width;\n\t\t\t\tconst renderPromise = page.render({canvasContext: canvas.getContext('2d'), viewport: viewport});\n\n\t\t\t\tif (!this.disableAnnotationLayer)\n\t\t\t\t{\n\t\t\t\t\trenderPromise.then(function () {\n\t\t\t\t\t\treturn page.getAnnotations();\n\t\t\t\t\t}).then(function (annotationData) {\n\t\t\t\t\t\tconst annotationLayer = Dom.create('div', {\n\t\t\t\t\t\t\tprops: {className: 'ui-viewer-pdf-annotation-layer'}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tDom.insertAfter(annotationLayer, canvas);\n\t\t\t\t\t\tDom.adjust(annotationLayer, {\n\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\tmargin: '-' + canvas.offsetHeight + 'px auto 0 auto',\n\t\t\t\t\t\t\t\theight: canvas.height + 'px',\n\t\t\t\t\t\t\t\twidth: canvas.width + 'px'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tpdfjsLib.AnnotationLayer.render({\n\t\t\t\t\t\t\tviewport: viewport.clone({dontFlip: true}),\n\t\t\t\t\t\t\tlinkService: pdfjsLib.SimpleLinkService,\n\t\t\t\t\t\t\tdiv: annotationLayer,\n\t\t\t\t\t\t\tannotations: annotationData,\n\t\t\t\t\t\t\tpage: page\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\trenderPromise.then(function () {\n\t\t\t\t\treturn page.getTextContent();\n\t\t\t\t}).then(function (textContent) {\n\t\t\t\t\tconst textLayer = Dom.create('div', {\n\t\t\t\t\t\tprops: {className: 'ui-viewer-pdf-text-layer'}\n\t\t\t\t\t});\n\n\t\t\t\t\tDom.insertAfter(textLayer, canvas);\n\t\t\t\t\tDom.adjust(textLayer, {\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tmargin: '-' + canvas.offsetHeight + 'px auto 0 auto',\n\t\t\t\t\t\t\theight: canvas.height + 'px',\n\t\t\t\t\t\t\twidth: canvas.width + 'px'\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tpdfjsLib.renderTextLayer({\n\t\t\t\t\t\ttextContent: textContent,\n\t\t\t\t\t\tcontainer: textLayer,\n\t\t\t\t\t\tviewport: viewport,\n\t\t\t\t\t\ttextDivs: []\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\tthis.lastRenderedPdfPage = Math.max(pageNumber, this.lastRenderedPdfPage);\n\n\t\t\t\tif (pageNumber === 1)\n\t\t\t\t{\n\t\t\t\t\tthis.firstWidthDocumentPage = canvas.width;\n\t\t\t\t}\n\n\t\t\t\trenderPromise.then(() => {\n\t\t\t\t\tthis.controller.hideLoading();\n\t\t\t\t\tthis.pdfRenderedPages[pageNumber] = page;\n\n\t\t\t\t\tresolve(page, canvas);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\treturn this.pdfRenderedPages[pageNumber];\n\t}\n\n\tcreateCanvasPage(): HTMLCanvasElement\n\t{\n\t\tconst canvas = document.createElement('canvas');\n\t\tcanvas.className = 'ui-viewer-document-page-canvas';\n\t\tthis.contentNode.appendChild(canvas);\n\n\t\treturn canvas;\n\t}\n\n\tgetContentWidth (): Promise<Number>\n\t{\n\t\tif (this.firstWidthDocumentPage)\n\t\t{\n\t\t\treturn Promise.resolve(this.firstWidthDocumentPage);\n\t\t}\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.loadDocument().then(() => {\n\t\t\t\tthis.renderDocumentPage(this.pdfDocument, 1).then((page) => {\n\t\t\t\t\tresolve(page.getViewport(this.scale).width);\n\t\t\t\t})\n\t\t\t});\n\t\t});\n\t}\n\n\tafterRender(): void\n\t{\n\t\tthis.loadDocument().then((pdf) => {\n\t\t\tfor (let i = 1; i <= Math.min(pdf.numPages, PAGES_TO_PRELOAD); i++)\n\t\t\t{\n\t\t\t\tif (i === 1)\n\t\t\t\t{\n\t\t\t\t\tthis._handleControls = this.controller.handleVisibleControls.bind(this.controller);\n\t\t\t\t\tthis.controller.enableReadingMode(true);\n\n\t\t\t\t\tconst printAction = this.controller.actionPanel.getItemById('print');\n\t\t\t\t\tif (printAction)\n\t\t\t\t\t{\n\t\t\t\t\t\tprintAction.layout.container.classList.remove('ui-btn-disabled');\n\t\t\t\t\t}\n\n\t\t\t\t\tRuntime.throttle(Event.bind(window, 'mousemove', this._handleControls), 20);\n\t\t\t\t}\n\n\t\t\t\tthis.renderDocumentPage(pdf, i);\n\t\t\t}\n\t\t});\n\t}\n\n\tbeforeHide(): void\n\t{\n\t\tthis.pdfRenderedPages = {};\n\t\tEvent.unbind(window, 'mousemove', this._handleControls);\n\t\tif (this.printer)\n\t\t{\n\t\t\tthis.hidePrintProgress();\n\t\t\tthis.printer.destroy();\n\t\t}\n\t}\n\n\tupdatePrintProgressMessage(index: number, total: number): void\n\t{\n\t\tconst progress = Math.round((index / total) * 100);\n\t\tthis.controller.setTextOnLoading(Loc.getMessage('JS_UI_VIEWER_ITEM_PREPARING_TO_PRINT').replace('#PROGRESS#', progress));\n\t}\n\n\tshowPrintProgress(index: number, total: number): void\n\t{\n\t\tthis.contentNode.style.opacity = 0.7;\n\t\tthis.contentNode.style.filter = 'blur(2px)';\n\n\t\tthis.controller.showLoading({\n\t\t\tzIndex: 1\n\t\t});\n\n\t\tthis.updatePrintProgressMessage(index, total);\n\t}\n\n\thidePrintProgress(): void\n\t{\n\t\tthis.contentNode.style.opacity = null;\n\t\tthis.contentNode.style.filter = null;\n\n\t\tthis.controller.hideLoading();\n\t}\n\n\tprint(): void\n\t{\n\t\tif (!this.pdfDocument)\n\t\t{\n\t\t\tconsole.warn('Where is pdf document to print?');\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.showPrintProgress(0, this.pdfDocument.numPages);\n\n\t\tthis.printer = new PrintService({\n\t\t\tpdf: this.pdfDocument\n\t\t});\n\n\t\tthis.printer.init().then(() => {\n\t\t\tthis.printer.prepare({\n\t\t\t\tonProgress: this.updatePrintProgressMessage.bind(this)\n\t\t\t}).then(() => {\n\t\t\t\tthis.hidePrintProgress();\n\t\t\t\tthis.printer.performPrint();\n\t\t\t});\n\t\t});\n\t}\n\n\thandleKeyPress(event): void\n\t{\n\t\tswitch (event.code)\n\t\t{\n\t\t\tcase 'PageDown':\n\t\t\tcase 'PageUp':\n\t\t\tcase 'ArrowDown':\n\t\t\tcase 'ArrowUp':\n\t\t\t\tBX.focus(this.contentNode);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tgetScale(): number\n\t{\n\t\treturn this.scale;\n\t}\n\n\tsetScale(scale: number): this\n\t{\n\t\tthis.scale = scale;\n\n\t\treturn this;\n\t}\n\n\tupdateScale(scale: number): Promise<void>\n\t{\n\t\tscale = Number(scale);\n\t\tif (this.scale === scale)\n\t\t{\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tconst ratio = scale / this.scale;\n\n\t\tconst updatePageScale = ((\n\t\t\tpage,\n\t\t\tcanvases: Array<number, HTMLCanvasElement>,\n\t\t\ttextLayers: Array<number,HTMLDivElement>\n\t\t): Promise => {\n\t\t\tconst canvas = canvases[page.pageIndex];\n\t\t\tif (!canvas)\n\t\t\t{\n\t\t\t\treturn Promise.resolve();\n\t\t\t}\n\t\t\treturn new Promise((resolve) => {\n\t\t\t\tconst viewport = page.getViewport(this.scale);\n\t\t\t\tcanvas.width = viewport.width;\n\t\t\t\tcanvas.height = viewport.height;\n\t\t\t\tpage.render({\n\t\t\t\t\tcanvasContext: canvas.getContext('2d'),\n\t\t\t\t\tviewport: viewport,\n\t\t\t\t}).then(() => {\n\t\t\t\t\tconst textLayer = textLayers[page.pageIndex];\n\t\t\t\t\tif (textLayer)\n\t\t\t\t\t{\n\t\t\t\t\t\tDom.clean(textLayer);\n\t\t\t\t\t\tDom.adjust(textLayer, {\n\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\tmargin: '-' + canvas.offsetHeight + 'px auto 0 auto',\n\t\t\t\t\t\t\t\theight: viewport.height + 'px',\n\t\t\t\t\t\t\t\twidth: viewport.width + 'px'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tpage.getTextContent().then((textContent) => {\n\t\t\t\t\t\t\tpdfjsLib.renderTextLayer({\n\t\t\t\t\t\t\t\ttextContent: textContent,\n\t\t\t\t\t\t\t\tcontainer: textLayer,\n\t\t\t\t\t\t\t\tviewport: viewport,\n\t\t\t\t\t\t\t\ttextDivs: []\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\tconst promises = [];\n\t\tthis.scale = scale;\n\t\tconst canvases = Array.from(this.contentNode.querySelectorAll('canvas[class=\"ui-viewer-document-page-canvas\"]'));\n\t\tconst textLayers = Array.from(this.contentNode.querySelectorAll('div[class=\"ui-viewer-pdf-text-layer\"]'));\n\t\tObject.values(this.pdfRenderedPages).forEach((renderedPage) => {\n\t\t\tif (renderedPage instanceof Promise)\n\t\t\t{\n\t\t\t\tpromises.push(new Promise((resolve) => {\n\t\t\t\t\trenderedPage.then((page) => {\n\t\t\t\t\t\tupdatePageScale(page, canvases, textLayers).then(resolve);\n\t\t\t\t\t});\n\t\t\t\t}));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpromises.push(updatePageScale(renderedPage, canvases, textLayers));\n\t\t\t}\n\t\t});\n\n\t\tconst scrollTop = this.contentNode.scrollTop * ratio;\n\t\tthis.contentNode.scrollTo(this.contentNode.scrollLeft, scrollTop);\n\n\t\treturn Promise.all(promises);\n\t}\n\n\tgetPagesNumber(): ?number\n\t{\n\t\tif (!this.pdfDocument)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\treturn Text.toInteger(this.pdfDocument._pdfInfo.numPages);\n\t}\n\n\tscrollToPage(pageNumber: number): Promise<void>\n\t{\n\t\tconst isChanged = this.setPageNumber(pageNumber) !== null;\n\t\tif (!isChanged)\n\t\t{\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\treturn new Promise((resolve) => {\n\t\t\tconst renderPromises = [];\n\t\t\tfor (let i = 1; i < pageNumber; i++)\n\t\t\t{\n\t\t\t\trenderPromises.push(this.renderDocumentPage(this.pdfDocument, i));\n\t\t\t}\n\t\t\tPromise.all(renderPromises).then((pages) => {\n\t\t\t\tlet height = 0;\n\n\t\t\t\tpages.forEach((page) => {\n\t\t\t\t\tconst viewport = page.getViewport(this.scale);\n\t\t\t\t\theight += viewport.height + 7;\n\t\t\t\t});\n\n\t\t\t\tthis.contentNode.scrollTo(this.contentNode.scrollLeft, height);\n\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t}\n\n\tgetPageNumber(): number\n\t{\n\t\treturn this.#pageNumber;\n\t}\n\n\tsetPageNumber(pageNumber: number): this|null\n\t{\n\t\tpageNumber = Text.toInteger(pageNumber);\n\t\tif (pageNumber < 0)\n\t\t{\n\t\t\tpageNumber = 1;\n\t\t}\n\n\t\tlet numPages = this.getPagesNumber();\n\t\tif (!numPages)\n\t\t{\n\t\t\tnumPages = 1;\n\t\t}\n\n\t\tif (pageNumber > numPages)\n\t\t{\n\t\t\tpageNumber = numPages;\n\t\t}\n\n\t\tif (this.#pageNumber !== pageNumber)\n\t\t{\n\t\t\tthis.#pageNumber = pageNumber;\n\t\t\tEventEmitter.emit(this, 'BX.UI.Viewer.Item.Document:updatePageNumber');\n\n\t\t\treturn this;\n\t\t}\n\n\t\treturn null;\n\t}\n}\n\nconst PRINT_SCALE = 1;\n\nexport class PrintService\n{\n\tconstructor(options)\n\t{\n\t\toptions = options || {};\n\t\tthis.pdf = options.pdf;\n\t\tthis.iframe = null;\n\t\tthis.documentOverview = {};\n\t}\n\n\tinit()\n\t{\n\t\tif (this.documentOverview)\n\t\t{\n\t\t\treturn Promise.resolve(this.documentOverview);\n\t\t}\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.pdf.getPage(1).then((page) => {\n\t\t\t\tconst viewport = page.getViewport(PRINT_SCALE);\n\n\t\t\t\tthis.documentOverview = {\n\t\t\t\t\twidth: viewport.width, height: viewport.height, rotation: viewport.rotation\n\t\t\t\t};\n\n\t\t\t\tresolve(this.documentOverview);\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * @param {?Object} options\n\t * @param {Function} [options.onProgress]\n\t * @return {BXPromise}\n\t */\n\tprepare(options)\n\t{\n\t\toptions = options || {};\n\t\tconst pageCount = this.pdf.numPages;\n\t\tlet currentPage = -1;\n\t\tconst promise = new BXPromise();\n\t\tlet onProgress = null;\n\t\tif (Type.isFunction(options.onProgress))\n\t\t{\n\t\t\tonProgress = options.onProgress;\n\t\t}\n\n\t\tthis.frame = this.createIframe();\n\n\t\tconst process = () => {\n\t\t\tif (++currentPage >= pageCount)\n\t\t\t{\n\t\t\t\tconsole.log('finish', this.frame.contentWindow.document);\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tpromise.fulfill();\n\t\t\t\t}, 1000);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.renderPage(currentPage + 1).then(function () {\n\t\t\t\tif (onProgress)\n\t\t\t\t{\n\t\t\t\t\tonProgress(currentPage + 1, pageCount);\n\t\t\t\t}\n\t\t\t\tprocess();\n\t\t\t});\n\t\t};\n\n\t\tprocess();\n\n\t\treturn promise;\n\t}\n\n\trenderPage(pageNumber)\n\t{\n\t\treturn this.pdf.getPage(pageNumber).then(function (page) {\n\t\t\tconst scratchCanvas = document.createElement('canvas');\n\t\t\tconst viewport = page.getViewport(1);\n\t\t\t// The size of the canvas in pixels for printing.\n\t\t\tconst PRINT_RESOLUTION = 150;\n\t\t\tconst PRINT_UNITS = PRINT_RESOLUTION / 72.0;\n\t\t\tscratchCanvas.width = Math.floor(viewport.width * PRINT_UNITS);\n\t\t\tscratchCanvas.height = Math.floor(viewport.height * PRINT_UNITS);\n\n\t\t\t// The physical size of the img as specified by the PDF document.\n\t\t\tconst CSS_UNITS = 96.0 / 72.0;\n\t\t\tconst width = Math.floor(viewport.width * CSS_UNITS) + 'px';\n\t\t\tconst height = Math.floor(viewport.height * CSS_UNITS) + 'px';\n\n\t\t\tconst ctx = scratchCanvas.getContext('2d');\n\t\t\tctx.save();\n\t\t\tctx.fillStyle = 'rgb(255, 255, 255)';\n\t\t\tctx.fillRect(0, 0, scratchCanvas.width, scratchCanvas.height);\n\t\t\tctx.restore();\n\n\t\t\tconst renderContext = {\n\t\t\t\tcanvasContext: ctx,\n\t\t\t\ttransform: [PRINT_UNITS, 0, 0, PRINT_UNITS, 0, 0],\n\t\t\t\tviewport: page.getViewport(1, viewport.rotation),\n\t\t\t\tintent: 'print'\n\t\t\t};\n\n\t\t\treturn page.render(renderContext).promise.then(function () {\n\t\t\t\treturn {\n\t\t\t\t\tscratchCanvas: scratchCanvas, width: width, height: height\n\t\t\t\t}\n\t\t\t});\n\t\t}).then((printItem) => {\n\n\t\t\tconst img = document.createElement('img');\n\t\t\timg.style.width = printItem.width;\n\t\t\timg.style.height = printItem.height;\n\n\t\t\tconst scratchCanvas = printItem.scratchCanvas;\n\t\t\tif (('toBlob' in scratchCanvas) && !this.disableCreateObjectURL)\n\t\t\t{\n\t\t\t\tscratchCanvas.toBlob(function (blob) {\n\t\t\t\t\timg.src = URL.createObjectURL(blob);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\timg.src = scratchCanvas.toDataURL();\n\t\t\t}\n\n\t\t\tconst wrapper = document.createElement('div');\n\t\t\twrapper.appendChild(img);\n\n\t\t\tthis.frame.contentWindow.document.body.appendChild(wrapper);\n\t\t});\n\t}\n\n\tdestroy()\n\t{\n\t\tif (this.frame)\n\t\t{\n\t\t\tDom.remove(this.frame);\n\t\t}\n\t}\n\n\tcreateIframe()\n\t{\n\t\tconst frame = document.createElement(\"iframe\");\n\t\tframe.src = \"about:blank\";\n\t\tframe.name = \"document-print-frame\";\n\t\tframe.style.display = \"none\";\n\t\tdocument.body.appendChild(frame);\n\n\t\tconst frameWindow = frame.contentWindow;\n\t\tconst frameDoc = frameWindow.document;\n\t\tframeDoc.open();\n\t\tframeDoc.write('<html><head>');\n\n\t\tconst pageSize = this.getDocumentOverview();\n\t\tlet headTags = \"<style>\";\n\t\theadTags += \"html, body { background: #fff !important; height: 100%; }\";\n\t\theadTags += '@supports ((size:A4) and (size:1pt 1pt)) {' + '@page { size: ' + pageSize.width + 'pt ' + pageSize.height + 'pt;}' + '}';\n\t\theadTags += '#ad{ display:none;}';\n\t\theadTags += '#leftbar{ display:none;}';\n\t\theadTags += \"</style>\";\n\n\t\tframeDoc.write(headTags);\n\n\t\tframeDoc.write('</head><body>');\n\t\tframeDoc.write('</body></html>');\n\t\tframeDoc.close();\n\n\t\treturn frame;\n\t}\n\n\tperformPrint()\n\t{\n\t\tthis.frame.contentWindow.focus();\n\t\tthis.frame.contentWindow.print();\n\t}\n\n\tgetDocumentOverview()\n\t{\n\t\treturn this.documentOverview;\n\t}\n}\n","import {Dom, Text, Loc, Tag, Reflection, Uri} from 'main.core';\nimport {EventEmitter} from 'main.core.events';\nimport {Document} from './item-document';\n\nconst InlineController = Reflection.namespace('BX.UI.Viewer.InlineController');\n\n/**\n * @memberof BX.UI.Viewer\n * @extends BX.UI.Viewer.InlineController\n */\nexport class SingleDocumentController extends InlineController\n{\n\tlistingControl: ListingControl;\n\tscaleControl: ScaleControl;\n\n\tbindEvents(): void\n\t{\n\t\tif (!this.eventsAlreadyBinded && this.getDocumentItem())\n\t\t{\n\t\t\tEventEmitter.subscribe(this.getDocumentItem(), 'BX.UI.Viewer.Item.Document:updatePageNumber', () => {\n\t\t\t\tthis.getListingControl().update(this.getDocumentItem().getPageNumber());\n\t\t\t});\n\t\t}\n\n\t\tsuper.bindEvents();\n\t}\n\n\tgetDocumentItem(): ?Document\n\t{\n\t\treturn this.items[0];\n\t}\n\n\tupdateControls(): void\n\t{\n\t\tsuper.updateControls();\n\n\t\tthis.updateListingControl();\n\t}\n\n\tgetViewerContainer(): HTMLElement\n\t{\n\t\tif (!this.layout.container)\n\t\t{\n\t\t\tthis.layout.inner = Tag.render`<div class=\"ui-viewer__single-document--container \">${this.getItemContainer()}</div>`;\n\t\t\tif (this.stretch)\n\t\t\t{\n\t\t\t\tDom.addClass(this.layout.inner, '--stretch');\n\t\t\t}\n\t\t\tthis.layout.container = Tag.render`<div class=\"\">${this.layout.inner}${this.getControlsContainer()}</div>`;\n\t\t}\n\n\t\treturn this.layout.container;\n\t}\n\n\tgetControlsContainer(): HTMLElement\n\t{\n\t\tif (!this.layout.controlsContainer)\n\t\t{\n\t\t\treturn Tag.render`<div class=\"ui-viewer__single-document--controls\">\n\t\t\t\t${this.getListingControl().render()}\n\t\t\t\t${this.getScaleControl().render()}\n\t\t\t</div>`;\n\t\t}\n\n\t\treturn this.layout.controlsContainer;\n\t}\n\n\tgetListingControl(): ListingControl\n\t{\n\t\tif (!this.listingControl)\n\t\t{\n\t\t\tthis.listingControl = new ListingControl();\n\t\t\tthis.listingControl.subscribe('pageUpdated', () => {\n\t\t\t\tthis.getDocumentItem()?.scrollToPage(this.listingControl.getCurrent());\n\t\t\t});\n\t\t\tthis.updateListingControl();\n\t\t}\n\n\t\treturn this.listingControl;\n\t}\n\n\tgetScaleControl(): ScaleControl\n\t{\n\t\tif (!this.scaleControl)\n\t\t{\n\t\t\tthis.scaleControl = new ScaleControl();\n\t\t\tthis.scaleControl.subscribe('scaleUpdated', () => {\n\t\t\t\tthis.getDocumentItem()?.updateScale(this.scaleControl.getScale());\n\t\t\t});\n\t\t}\n\n\t\treturn this.scaleControl;\n\t}\n\n\tupdateListingControl(): void\n\t{\n\t\tconst item = this.getDocumentItem();\n\t\tif (item)\n\t\t{\n\t\t\titem.loadDocument().then(() => {\n\t\t\t\tthis.listingControl.update(1, item.getPagesNumber());\n\t\t\t});\n\t\t}\n\t}\n\n\tsetScale(scale: number): this\n\t{\n\t\tthis.getDocumentItem()?.setScale(scale);\n\t\tthis.getScaleControl().update(scale);\n\n\t\treturn this;\n\t}\n\n\tsetPdfSource(pdfSource: string|Uri|ArrayBuffer): this\n\t{\n\t\tthis.getDocumentItem()?.setPdfSource(pdfSource);\n\n\t\treturn this;\n\t}\n\n\tprint(): void\n\t{\n\t\tthis.getDocumentItem()?.print();\n\t}\n}\n\nclass ListingControl extends EventEmitter\n{\n\tpages: number;\n\tcurrent: number;\n\tcontainer: HTMLElement = null;\n\tpagesContainer: HTMLElement = null;\n\n\tconstructor(current:number = 1, pages:number = 1)\n\t{\n\t\tsuper();\n\t\tthis.setEventNamespace('BX.UI.Viewer.SingleDocumentController.ListingControl');\n\t\tthis.pages = Text.toInteger(pages);\n\t\tthis.current = Text.toInteger(current);\n\t\tthis.arrowClickHandler = this.handleArrowClick.bind(this);\n\t}\n\n\tupdate(current: number, pages: number = null): void\n\t{\n\t\tcurrent = Text.toInteger(current);\n\t\tpages = Text.toInteger(pages);\n\t\tif (pages >= 1)\n\t\t{\n\t\t\tthis.pages = pages;\n\t\t}\n\t\tif (current < 1)\n\t\t{\n\t\t\tcurrent = 1;\n\t\t}\n\t\tif (current > this.pages)\n\t\t{\n\t\t\tcurrent = this.pages;\n\t\t}\n\t\tif (current !== this.current)\n\t\t{\n\t\t\tthis.current = current;\n\t\t\tthis.emit('pageUpdated', {page: this.current});\n\t\t}\n\t\tthis.adjust();\n\t}\n\n\tadjust(): void\n\t{\n\t\tthis.pagesContainer.innerHTML = this.renderPages();\n\t}\n\n\tgetCurrent(): number\n\t{\n\t\treturn this.current;\n\t}\n\n\trender(): HTMLElement\n\t{\n\t\tif (!this.container)\n\t\t{\n\t\t\tthis.pagesContainer = Tag.render`<div class=\"ui-viewer__single-document--listing-info\">\n\t\t\t\t${this.renderPages()}\n\t\t\t</div>`;\n\n\t\t\tthis.container = Tag.render`<div class=\"ui-viewer__single-document--listing\">\n\t\t\t\t<div class=\"ui-viewer__single-document--listing--btn --prev\" onclick=\"${this.arrowClickHandler}\"></div>\n\t\t\t\t${this.pagesContainer}\n\t\t\t\t<div class=\"ui-viewer__single-document--listing--btn --next\" onclick=\"${this.arrowClickHandler}\"></div>\n\t\t\t</div>`\n\t\t}\n\n\t\treturn this.container;\n\t}\n\n\trenderPages(): string\n\t{\n\t\treturn Loc.getMessage('JS_UI_VIEWER_SINGLE_DOCUMENT_LISTING_PAGES')\n\t\t\t.replace('#CURRENT#', this.current)\n\t\t\t.replace('#ALL#', this.pages)\n\t\t;\n\t}\n\n\thandleArrowClick(event: MouseEvent): void\n\t{\n\t\tif (event.target.classList.contains('--prev'))\n\t\t{\n\t\t\tthis.update(this.current - 1);\n\t\t}\n\t\tif (event.target.classList.contains('--next'))\n\t\t{\n\t\t\tthis.update(this.current + 1);\n\t\t}\n\t}\n}\n\n// const SCALE_MIN = 0.92;\nconst SCALE_MIN = 0.5;\nconst SCALE_MAX = 3;\n\nclass ScaleControl extends EventEmitter\n{\n\tscale: number = SCALE_MIN;\n\tcontainer: HTMLElement = null;\n\tzoomInContainer: HTMLElement = null;\n\tzoomOutContainer: HTMLElement = null;\n\tzoomValueNode: HTMLElement = null;\n\n\tconstructor()\n\t{\n\t\tsuper();\n\t\tthis.scale = SCALE_MIN;\n\t\tthis.setEventNamespace('BX.UI.Viewer.SingleDocumentController.ScaleControl');\n\t\tthis.scaleClickHandler = this.handleScaleClick.bind(this);\n\t}\n\n\tgetScale(): number\n\t{\n\t\treturn this.scale;\n\t}\n\n\tsetDefaultScale(): void\n\t{\n\t\tthis.update(SCALE_MIN);\n\t}\n\n\tadjust()\n\t{\n\t\tif (this.scale <= SCALE_MIN)\n\t\t{\n\t\t\tDom.hide(this.getZoomOutContainer());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tDom.show(this.getZoomOutContainer());\n\t\t}\n\t\tif (this.scale >= SCALE_MAX)\n\t\t{\n\t\t\tDom.hide(this.getZoomInContainer());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tDom.show(this.getZoomInContainer());\n\t\t}\n\n\t\tthis.getZoomValueNode().innerText = Math.round(this.scale * 100);\n\t}\n\n\tupdate(scale: number): void\n\t{\n\t\tscale = Text.toNumber(scale);\n\t\tif (scale < SCALE_MIN)\n\t\t{\n\t\t\tscale = SCALE_MIN;\n\t\t}\n\t\tif (scale > SCALE_MAX)\n\t\t{\n\t\t\tscale = SCALE_MAX;\n\t\t}\n\t\tif (scale !== this.scale)\n\t\t{\n\t\t\tthis.scale = scale;\n\t\t\tthis.emit('scaleUpdated');\n\t\t\tthis.adjust();\n\t\t}\n\t}\n\n\trender(): HTMLElement\n\t{\n\t\tif (!this.container)\n\t\t{\n\t\t\tthis.container = Tag.render`<div class=\"ui-viewer__single-document--zoom\">\n\t\t\t\t${this.getZoomOutContainer()}\n\t\t\t\t${this.getZoomValueNode()}\n\t\t\t\t${this.getZoomInContainer()}\n\t\t\t</div>`;\n\n\t\t\tthis.adjust();\n\t\t}\n\n\t\treturn this.container;\n\t}\n\n\tgetZoomInContainer(): HTMLElement\n\t{\n\t\tif (!this.zoomInContainer)\n\t\t{\n\t\t\tthis.zoomInContainer = Tag.render`<div\n\t\t\t\tclass=\"ui-viewer__single-document--zoom-control --zoom-in\"\n\t\t\t\tonclick=\"${this.scaleClickHandler}\"\n\t\t\t>\n<!--\t\t\t\t${Loc.getMessage('JS_UI_VIEWER_SINGLE_DOCUMENT_SCALE_ZOOM_IN')}-->\n\t\t\t</div>`;\n\t\t}\n\n\t\treturn this.zoomInContainer;\n\t}\n\n\tgetZoomOutContainer(): HTMLElement\n\t{\n\t\tif (!this.zoomOutContainer)\n\t\t{\n\t\t\tthis.zoomOutContainer = Tag.render`<div \n\t\t\t\tclass=\"ui-viewer__single-document--zoom-control --zoom-out\"\n\t\t\t\tonclick=\"${this.scaleClickHandler}\"\n\t\t\t>\n<!--\t\t\t\t${Loc.getMessage('JS_UI_VIEWER_SINGLE_DOCUMENT_SCALE_ZOOM_OUT')}-->\n\t\t\t</div>`;\n\t\t}\n\n\t\treturn this.zoomOutContainer;\n\t}\n\n\tgetZoomValueNode(): HTMLElement\n\t{\n\t\tif (!this.zoomValueNode)\n\t\t{\n\t\t\tthis.zoomValueNode = Tag.render`<span class=\"ui-viewer__single-document--zoom-value\">100</span>`;\n\t\t}\n\n\t\treturn this.zoomValueNode;\n\t}\n\n\thandleScaleClick(event: MouseEvent): void\n\t{\n\t\tlet scale = this.scale;\n\t\tif (event.target.classList.contains('--zoom-in'))\n\t\t{\n\t\t\tscale = this.scale * 1.1;\n\t\t}\n\t\tif (event.target.classList.contains('--zoom-out'))\n\t\t{\n\t\t\tscale = this.scale * 0.9;\n\t\t}\n\t\tthis.update(scale);\n\t}\n}\n"],"names":["Item","Reflection","namespace","Util","BXPromise","DEFAULT_SCALE","PAGES_TO_PRELOAD","Document","constructor","options","pdfPages","scale","pdfRenderedPages","lastRenderedPdfPage","disableAnnotationLayer","setPropertiesByNode","node","dataset","hasOwnProperty","applyReloadOptions","controller","unsetCachedData","src","listContainerModifiers","result","stretch","push","setSrc","_pdfSrc","setPdfSource","pdfSource","loadLibrary","Promise","resolve","reject","Runtime","loadExtension","then","pdfjsLib","GlobalWorkerOptions","workerSrc","catch","loadData","promise","fulfill","console","log","ajaxPromise","Ajax","url","Uri","addParam","ts","method","dataType","headers","name","value","response","data","isTransforming","item","message","Loc","getMessage","replace","getSrc","type","transformationPromise","registerTransformationHandler","pullTag","render","showLoading","contentNode","Dom","create","props","className","tabIndex","Event","bind","throttle","handleScrollDocument","getNakedActions","nakedActions","insertPrintBeforeInfo","actions","infoIndex","i","length","printAction","action","print","insertIntoArray","getFirstDocumentPageHeight","_height","getDocumentPage","pdfDocument","page","viewport","getViewport","height","event","scrollBottom","scrollHeight","scrollTop","clientHeight","numPages","Math","min","renderDocumentPage","setPageNumber","loadDocument","getDocument","pdf","pageNumber","getPage","pagePromise","canvas","createCanvasPage","width","renderPromise","canvasContext","getContext","getAnnotations","annotationData","annotationLayer","insertAfter","adjust","style","margin","offsetHeight","AnnotationLayer","clone","dontFlip","linkService","SimpleLinkService","div","annotations","getTextContent","textContent","textLayer","renderTextLayer","container","textDivs","max","firstWidthDocumentPage","hideLoading","document","createElement","appendChild","getContentWidth","afterRender","_handleControls","handleVisibleControls","enableReadingMode","actionPanel","getItemById","layout","classList","remove","window","beforeHide","unbind","printer","hidePrintProgress","destroy","updatePrintProgressMessage","index","total","progress","round","setTextOnLoading","showPrintProgress","opacity","filter","zIndex","warn","PrintService","init","prepare","onProgress","performPrint","handleKeyPress","code","BX","focus","getScale","setScale","updateScale","Number","ratio","updatePageScale","canvases","textLayers","pageIndex","clean","promises","Array","from","querySelectorAll","Object","values","forEach","renderedPage","scrollTo","scrollLeft","all","getPagesNumber","Text","toInteger","_pdfInfo","scrollToPage","isChanged","renderPromises","pages","getPageNumber","EventEmitter","emit","PRINT_SCALE","iframe","documentOverview","rotation","pageCount","currentPage","Type","isFunction","frame","createIframe","process","contentWindow","setTimeout","renderPage","scratchCanvas","PRINT_RESOLUTION","PRINT_UNITS","floor","CSS_UNITS","ctx","save","fillStyle","fillRect","restore","renderContext","transform","intent","printItem","img","disableCreateObjectURL","toBlob","blob","URL","createObjectURL","toDataURL","wrapper","body","display","frameWindow","frameDoc","open","write","pageSize","getDocumentOverview","headTags","close","InlineController","SingleDocumentController","bindEvents","eventsAlreadyBinded","getDocumentItem","subscribe","getListingControl","update","items","updateControls","updateListingControl","getViewerContainer","inner","Tag","getItemContainer","addClass","getControlsContainer","controlsContainer","getScaleControl","listingControl","ListingControl","getCurrent","scaleControl","ScaleControl","current","pagesContainer","setEventNamespace","arrowClickHandler","handleArrowClick","innerHTML","renderPages","target","contains","SCALE_MIN","SCALE_MAX","zoomInContainer","zoomOutContainer","zoomValueNode","scaleClickHandler","handleScaleClick","setDefaultScale","hide","getZoomOutContainer","show","getZoomInContainer","getZoomValueNode","innerText","toNumber"],"mappings":";;;;;;CAGA,MAAMA,IAAI,GAAGC,oBAAU,CAACC,SAAS,CAAC,mBAAmB,CAAC;CACtD,MAAMC,IAAI,GAAGF,oBAAU,CAACC,SAAS,CAAC,SAAS,CAAC;CAC5C,MAAME,SAAS,GAAGH,oBAAU,CAACC,SAAS,CAAC,YAAY,CAAC;CAEpD,MAAMG,aAAa,GAAG,GAAG;CAC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