cat-documents-ng 0.3.31 → 0.3.33

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.
@@ -5535,96 +5535,61 @@ class DocumentHistoryService {
5535
5535
  }));
5536
5536
  }
5537
5537
  /**
5538
- * Downloads a document when clicked
5538
+ * Downloads a document when clicked using a robust approach that bypasses Angular Router interception
5539
5539
  * @param documentUrl - The URL of the document to download
5540
5540
  * @param docName - The name of the document
5541
5541
  */
5542
5542
  downloadDocument(documentUrl, docName) {
5543
- console.log('DocumentHistoryService: downloadDocument called with:', { documentUrl, docName });
5544
5543
  if (!documentUrl) {
5545
- console.warn('DocumentHistoryService: No document URL provided');
5546
5544
  console.warn(ERRORS.NO_DOCUMENT_URL);
5547
5545
  return;
5548
5546
  }
5549
- console.log('DocumentHistoryService: Starting download request to:', documentUrl);
5550
- this.http.get(documentUrl, {
5551
- responseType: 'blob',
5552
- observe: 'response'
5553
- }).subscribe({
5554
- next: (response) => {
5555
- console.log('DocumentHistoryService: Download response received:', response);
5556
- console.log('DocumentHistoryService: Response headers:', response.headers);
5557
- console.log('DocumentHistoryService: Response status:', response.status);
5558
- const blob = response.body;
5559
- if (!blob) {
5560
- console.error('DocumentHistoryService: No blob data in response');
5561
- return;
5562
- }
5563
- console.log('DocumentHistoryService: Blob size:', blob.size, 'bytes');
5564
- console.log('DocumentHistoryService: Blob type:', blob.type);
5547
+ this.http.get(documentUrl, { responseType: 'blob' }).subscribe({
5548
+ next: (blob) => {
5565
5549
  try {
5566
5550
  const blobUrl = window.URL.createObjectURL(blob);
5567
- console.log('DocumentHistoryService: Created blob URL:', blobUrl);
5568
5551
  const a = document.createElement('a');
5569
5552
  a.href = blobUrl;
5570
5553
  a.download = docName ?? SHARED.DOCUMENT;
5571
5554
  a.style.display = SHARED.NONE;
5572
- console.log('DocumentHistoryService: Download link created with filename:', a.download);
5555
+ // Set additional attributes to ensure it works
5556
+ a.setAttribute('rel', 'noopener noreferrer');
5573
5557
  document.body.appendChild(a);
5574
5558
  a.click();
5575
5559
  a.remove();
5576
- console.log('DocumentHistoryService: Download initiated successfully');
5577
- // Clean up blob URL
5578
- setTimeout(() => {
5579
- window.URL.revokeObjectURL(blobUrl);
5580
- console.log('DocumentHistoryService: Blob URL cleaned up');
5581
- }, 1000);
5560
+ window.URL.revokeObjectURL(blobUrl);
5582
5561
  }
5583
5562
  catch (error) {
5584
- console.error('DocumentHistoryService: Error creating download link:', error);
5563
+ console.error('Download failed:', error);
5564
+ // Fallback: try to open the original URL in a new tab
5565
+ try {
5566
+ const newWindow = window.open(documentUrl, '_blank', 'noopener,noreferrer');
5567
+ if (!newWindow) {
5568
+ console.warn('Popup blocked, falling back to direct navigation');
5569
+ window.location.href = documentUrl;
5570
+ }
5571
+ }
5572
+ catch (fallbackError) {
5573
+ console.error('All download methods failed:', fallbackError);
5574
+ }
5585
5575
  }
5586
5576
  },
5587
5577
  error: (err) => {
5588
- console.error('DocumentHistoryService: Download request failed:', err);
5589
- console.error('DocumentHistoryService: Error details:', {
5590
- status: err.status,
5591
- statusText: err.statusText,
5592
- message: err.message,
5593
- url: documentUrl
5594
- });
5595
- // Try alternative download method for CORS issues
5596
- console.log('DocumentHistoryService: Attempting alternative download method...');
5597
- this.downloadWithAlternativeMethod(documentUrl, docName);
5578
+ console.error(ERRORS.DOWNLOAD_FAIL, err);
5579
+ // Fallback: try to open the original URL directly
5580
+ try {
5581
+ const newWindow = window.open(documentUrl, '_blank', 'noopener,noreferrer');
5582
+ if (!newWindow) {
5583
+ console.warn('Popup blocked, falling back to direct navigation');
5584
+ window.location.href = documentUrl;
5585
+ }
5586
+ }
5587
+ catch (fallbackError) {
5588
+ console.error('All fallback methods failed:', fallbackError);
5589
+ }
5598
5590
  }
5599
5591
  });
5600
5592
  }
5601
- /**
5602
- * Alternative download method for CORS issues
5603
- * @param documentUrl - The URL of the document to download
5604
- * @param docName - The name of the document
5605
- */
5606
- downloadWithAlternativeMethod(documentUrl, docName) {
5607
- console.log('DocumentHistoryService: Using alternative download method');
5608
- try {
5609
- const a = document.createElement('a');
5610
- a.href = documentUrl;
5611
- a.download = docName ?? SHARED.DOCUMENT;
5612
- a.target = '_blank';
5613
- a.style.display = SHARED.NONE;
5614
- console.log('DocumentHistoryService: Alternative download link created:', {
5615
- href: a.href,
5616
- download: a.download,
5617
- target: a.target
5618
- });
5619
- document.body.appendChild(a);
5620
- a.click();
5621
- a.remove();
5622
- console.log('DocumentHistoryService: Alternative download method completed');
5623
- }
5624
- catch (error) {
5625
- console.error('DocumentHistoryService: Alternative download method failed:', error);
5626
- }
5627
- }
5628
5593
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHistoryService, deps: [{ token: DocumentHistoryStyleService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
5629
5594
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHistoryService, providedIn: 'root' });
5630
5595
  }
@@ -5635,6 +5600,87 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
5635
5600
  }]
5636
5601
  }], ctorParameters: () => [{ type: DocumentHistoryStyleService }, { type: i2.HttpClient }] });
5637
5602
 
5603
+ /**
5604
+ * Directive to handle external links and ensure they work regardless of Angular Router configuration.
5605
+ * This bypasses any router interception and ensures the link opens as expected.
5606
+ */
5607
+ class ExternalLinkDirective {
5608
+ el;
5609
+ renderer;
5610
+ externalLink = '';
5611
+ target = '_blank';
5612
+ download;
5613
+ constructor(el, renderer) {
5614
+ this.el = el;
5615
+ this.renderer = renderer;
5616
+ }
5617
+ onClick(event) {
5618
+ // Prevent the default Angular behavior
5619
+ event.preventDefault();
5620
+ event.stopPropagation();
5621
+ const url = this.externalLink || this.el.nativeElement.href;
5622
+ if (!url) {
5623
+ console.warn('ExternalLinkDirective: No URL provided');
5624
+ return;
5625
+ }
5626
+ try {
5627
+ // For downloads, use the download attribute approach
5628
+ if (this.download) {
5629
+ this.handleDownload(url, this.download);
5630
+ }
5631
+ else {
5632
+ // For regular links, open in new tab
5633
+ this.openInNewTab(url);
5634
+ }
5635
+ }
5636
+ catch (error) {
5637
+ console.error('ExternalLinkDirective: Failed to open link:', error);
5638
+ // Fallback: try to open directly
5639
+ this.openInNewTab(url);
5640
+ }
5641
+ }
5642
+ handleDownload(url, filename) {
5643
+ // Create a temporary link element
5644
+ const link = document.createElement('a');
5645
+ link.href = url;
5646
+ link.download = filename;
5647
+ link.target = this.target;
5648
+ // Set additional attributes to ensure it works
5649
+ link.setAttribute('rel', 'noopener noreferrer');
5650
+ // Append to DOM, click, and remove
5651
+ document.body.appendChild(link);
5652
+ link.click();
5653
+ document.body.removeChild(link);
5654
+ }
5655
+ openInNewTab(url) {
5656
+ // Use window.open with proper parameters
5657
+ const newWindow = window.open(url, this.target, 'noopener,noreferrer');
5658
+ // If popup blocked, fallback to location change
5659
+ if (!newWindow) {
5660
+ console.warn('Popup blocked, falling back to direct navigation');
5661
+ window.location.href = url;
5662
+ }
5663
+ }
5664
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ExternalLinkDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
5665
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: ExternalLinkDirective, isStandalone: true, selector: "[externalLink]", inputs: { externalLink: "externalLink", target: "target", download: "download" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 });
5666
+ }
5667
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ExternalLinkDirective, decorators: [{
5668
+ type: Directive,
5669
+ args: [{
5670
+ selector: '[externalLink]',
5671
+ standalone: true
5672
+ }]
5673
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { externalLink: [{
5674
+ type: Input
5675
+ }], target: [{
5676
+ type: Input
5677
+ }], download: [{
5678
+ type: Input
5679
+ }], onClick: [{
5680
+ type: HostListener,
5681
+ args: ['click', ['$event']]
5682
+ }] } });
5683
+
5638
5684
  /**
5639
5685
  * Component for displaying document history in a timeline format.
5640
5686
  */
@@ -5685,62 +5731,17 @@ class DocumentHistoryComponent {
5685
5731
  }
5686
5732
  }
5687
5733
  /**
5688
- * Process history data to add computed properties
5689
- */
5734
+ * Process history data to add computed properties
5735
+ */
5690
5736
  get processedHistoryData() {
5691
5737
  return this.documentHistoryService.processHistoryData(this.historyData);
5692
5738
  }
5693
- /**
5694
- * Downloads a document when clicked
5695
- * @param documentUrl - The URL of the document to download
5696
- * @param docName - The name of the document
5697
- */
5698
- downloadDocument(documentUrl, docName) {
5699
- console.log('DocumentHistoryComponent: downloadDocument called with:', { documentUrl, docName });
5700
- console.log('DocumentHistoryComponent: Calling service download method...');
5701
- this.documentHistoryService.downloadDocument(documentUrl, docName);
5702
- }
5703
- /**
5704
- * Test method to verify click events are working
5705
- */
5706
- testClick() {
5707
- console.log('DocumentHistoryComponent: testClick method called successfully!');
5708
- alert('Click event is working!');
5709
- }
5710
- /**
5711
- * Test method to verify download functionality
5712
- */
5713
- testDownload() {
5714
- console.log('DocumentHistoryComponent: testDownload called');
5715
- const testUrl = 'https://httpbin.org/pdf';
5716
- const testName = 'test-document.pdf';
5717
- console.log('DocumentHistoryComponent: Testing download with:', { testUrl, testName });
5718
- this.downloadDocument(testUrl, testName);
5719
- }
5720
- /**
5721
- * Debug method for mouse down events
5722
- */
5723
- onMouseDown(itemName) {
5724
- console.log('DocumentHistoryComponent: Mouse down on filename:', itemName);
5725
- }
5726
- /**
5727
- * Debug method for mouse up events
5728
- */
5729
- onMouseUp(itemName) {
5730
- console.log('DocumentHistoryComponent: Mouse up on filename:', itemName);
5731
- }
5732
- /**
5733
- * Debug method for click events
5734
- */
5735
- onElementClick(itemName, documentUrl) {
5736
- console.log('DocumentHistoryComponent: Element clicked:', { itemName, documentUrl });
5737
- }
5738
5739
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHistoryComponent, deps: [{ token: DocumentHistoryService }], target: i0.ɵɵFactoryTarget.Component });
5739
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentHistoryComponent, isStandalone: false, selector: "document-history", inputs: { historyData: "historyData", showHistory: "showHistory" }, ngImport: i0, template: "<div class=\"document-history-container\" *ngIf=\"showHistory && historyData.length > 0\">\r\n <!-- Test button to verify click events are working -->\r\n <div class=\"test-section\" style=\"margin-bottom: 10px; padding: 10px; background: #f0f0f0; border: 1px solid #ccc;\">\r\n <button (click)=\"testClick()\" style=\"padding: 5px 10px; background: #007bff; color: white; border: none; border-radius: 3px; margin-right: 10px;\">\r\n Test Click Event\r\n </button>\r\n <button (click)=\"testDownload()\" style=\"padding: 5px 10px; background: #28a745; color: white; border: none; border-radius: 3px;\">\r\n Test Download\r\n </button>\r\n <span style=\"margin-left: 10px; font-size: 12px; color: #666;\">Click these to test if events are working</span>\r\n </div>\r\n \r\n <div class=\"history-sections\">\r\n <div class=\"history-section\" *ngFor=\"let section of processedHistoryData\">\r\n <div *ngIf=\"section.header === 'Initial Request' && section.hasValidContent\" \r\n class=\"initial-request-section\"\r\n [ngClass]=\"section.accordionClass\">\r\n <p-accordion [activeIndex]=\"activeAccordionIndex\" \r\n (onOpen)=\"onAccordionOpen()\" \r\n (onClose)=\"onAccordionClose()\">\r\n <p-accordionTab [header]=\"section.header\">\r\n <div class=\"history-timeline\" *ngIf=\"section.hasValidContent\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription ?? 'No Request' }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename clickable\" \r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\"\r\n (mousedown)=\"onMouseDown(item.docName)\"\r\n (mouseup)=\"onMouseUp(item.docName)\"\r\n title=\"Click to download\"\r\n data-debug=\"filename-clickable\"\r\n style=\"cursor: pointer; padding: 5px; border: 1px solid #ddd; border-radius: 3px; background: #f8f9fa; display: inline-block; min-width: 100px;\">\r\n {{ item.docName || 'Document' }}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"document-actions\">\r\n <button class=\"action-btn download-btn\" \r\n title=\"Download\"\r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\"\r\n (mousedown)=\"onMouseDown(item.docName)\"\r\n (mouseup)=\"onMouseUp(item.docName)\"\r\n data-debug=\"download-button\">\r\n <i class=\"pi pi-download\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- Show message if no valid content -->\r\n <div class=\"no-content-message\" *ngIf=\"!section.hasValidContent\">\r\n <p>No initial request details available.</p>\r\n </div>\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n \r\n <!-- Document History as regular timeline -->\r\n <div *ngIf=\"section.header !== 'Initial Request'\" class=\"document-history-section\">\r\n <div class=\"section-header\" *ngIf=\"section.header\">\r\n <h4 class=\"section-title\">{{ section.header }}</h4>\r\n </div>\r\n \r\n <div class=\"history-timeline\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <!-- Header with icon and timestamp -->\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename clickable\" \r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\"\r\n (mousedown)=\"onMouseDown(item.docName)\"\r\n (mouseup)=\"onMouseUp(item.docName)\"\r\n title=\"Click to download\"\r\n data-debug=\"filename-clickable-2\"\r\n style=\"cursor: pointer; padding: 5px; border: 1px solid #ddd; border-radius: 3px; background: #f8f9fa; display: inline-block; min-width: 100px;\">\r\n {{ item.docName || 'Document' }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- Test button to verify click events are working -->\r\n <div class=\"test-section\" style=\"margin-bottom: 10px; padding: 10px; background: #f0f0f0; border: 1px solid #ccc;\">\r\n <button (click)=\"testClick()\" style=\"padding: 5px 10px; background: #007bff; color: white; border: none; border-radius: 3px; margin-right: 10px;\">\r\n Test Click Event\r\n </button>\r\n <button (click)=\"testDownload()\" style=\"padding: 5px 10px; background: #28a745; color: white; border: none; border-radius: 3px;\">\r\n Test Download\r\n </button>\r\n <span style=\"margin-left: 10px; font-size: 12px; color: #666;\">Click these to test if events are working</span>\r\n </div>", styles: [".document-history-container{padding:.75rem;background:#fff;border-radius:8px;box-shadow:0 2px 4px #0000001a;max-height:none;overflow-y:auto;min-width:0}.document-history-container .history-header{margin-bottom:1rem}.document-history-container .history-header .history-title{font-size:1.25rem;font-weight:600;color:#374151;margin:0}.document-history-container .history-sections .history-section{margin-bottom:1.5rem}.document-history-container .history-sections .history-section .initial-request-section{margin-bottom:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{background:#fff;border-top:1px solid;border-top-left-radius:8px;border-top-right-radius:8px;border-bottom:none;padding:.75rem 1rem;font-weight:600;color:#1f2937;font-size:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link:focus{box-shadow:none}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link .p-accordion-header-icon{color:#6b7280;font-size:.875rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header.p-highlight .p-accordion-header-link{background:#fff}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content{background:#fff;border:1px solid;border-top:none;border-radius:0 0 8px 8px;padding:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item{margin-bottom:0}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:.75rem;border-right:3px solid}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{background:#7d879b;color:#fff;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{color:#1f2937;font-weight:600;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .timestamp{color:#6b7280;font-size:.75rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-description .description-text{color:#374151;line-height:1.5;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-name{color:#1f2937;font-weight:500;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-content{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-content{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .document-history-section .section-header{margin-bottom:.75rem}.document-history-container .history-sections .history-section .document-history-section .section-header .section-title{font-size:1.25rem;font-weight:500;color:#374151;margin:0}.document-history-container .history-sections .history-section .history-timeline .timeline-item{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card{border-radius:8px;border:1px solid;padding:1rem;position:relative;border-right:3px solid}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-green-50{background-color:#f0fdf4;border-color:#bbf7d0;border-right-color:#10b981}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-red-50{background-color:#fef2f2;border-color:#fecaca;border-right-color:#ef4444}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-blue-50{background-color:#eff6ff;border-color:#bfdbfe;border-right-color:#3b82f6}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-gray-50{background-color:#f8fafc;border-color:#e2e8f0;border-right-color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{font-weight:600;font-size:.875rem;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .timestamp{font-size:.75rem;color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description .description-text{margin:0;color:#374151;font-size:.875rem;line-height:1.4;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card{background:#fff;border-radius:6px;padding:.75rem;display:flex;justify-content:space-between;align-items:center;border:1px solid #e5e7eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-icon{color:#3b82f6;font-size:1.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-title{font-weight:500;color:#374151;font-size:.875rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename{color:#3b82f6;font-size:.75rem;word-break:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename.clickable{cursor:pointer;text-decoration:underline}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename.clickable:hover{color:#2563eb;text-decoration:none}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions{display:flex;gap:.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn{width:24px;height:24px;border:none;border-radius:4px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn{background:#3b82f6;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn:hover{background:#2563eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn{background:#ef4444;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn:hover{background:#dc2626}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn{background:#10b981;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn:hover{background:#059669}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info{text-align:right;font-size:.75rem;color:#374151}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-name{font-weight:500;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280;word-wrap:break-word;overflow-wrap:break-word}.text-green-600{color:#059669}.text-red-600{color:#dc2626}.text-blue-600{color:#2563eb}.text-gray-600{color:#4b5563}.bg-green-50{background-color:#f0fdf4}.bg-red-50{background-color:#fef2f2}.bg-blue-50{background-color:#eff6ff}.bg-gray-50{background-color:#f8fafc}.border-green-200{border-color:#bbf7d0}.border-red-200{border-color:#fecaca}.border-blue-200{border-color:#bfdbfe}.border-gray-200{border-color:#e2e8f0}.icon-bg-green{background-color:#10b981}.icon-bg-red{background-color:#ef4444}.icon-bg-blue{background-color:#3b82f6}.icon-bg-gray{background-color:#6b7280}.no-content-message{text-align:center;padding:2rem;color:#6b7280;font-style:italic}.no-content-message p{margin:0;font-size:.875rem}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.Accordion, selector: "p-accordion", inputs: ["multiple", "style", "styleClass", "expandIcon", "collapseIcon", "activeIndex", "selectOnFocus", "headerAriaLevel"], outputs: ["onClose", "onOpen", "activeIndexChange"] }, { kind: "component", type: i3$2.AccordionTab, selector: "p-accordionTab", inputs: ["id", "header", "headerStyle", "tabStyle", "contentStyle", "tabStyleClass", "headerStyleClass", "contentStyleClass", "disabled", "cache", "transitionOptions", "iconPos", "selected", "headerAriaLevel"], outputs: ["selectedChange"] }] });
5740
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentHistoryComponent, isStandalone: false, selector: "document-history", inputs: { historyData: "historyData", showHistory: "showHistory" }, ngImport: i0, template: "<div class=\"document-history-container\" *ngIf=\"showHistory && historyData.length > 0\">\r\n <div class=\"history-sections\">\r\n <div class=\"history-section\" *ngFor=\"let section of processedHistoryData\">\r\n <div *ngIf=\"section.header === 'Initial Request' && section.hasValidContent\" \r\n class=\"initial-request-section\"\r\n [ngClass]=\"section.accordionClass\">\r\n <p-accordion [activeIndex]=\"activeAccordionIndex\" \r\n (onOpen)=\"onAccordionOpen()\" \r\n (onClose)=\"onAccordionClose()\">\r\n <p-accordionTab [header]=\"section.header\">\r\n <div class=\"history-timeline\" *ngIf=\"section.hasValidContent\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription ?? 'No Request' }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename\">\r\n <a [href]=\"item.documentUrl\" \r\n target=\"_blank\" \r\n [title]=\"'Download ' + (item.docName || 'Document')\"\r\n [download]=\"item.docName || 'document'\"\r\n [attr.download]=\"item.docName || 'document'\"\r\n class=\"document-link\"\r\n externalLink\r\n [externalLink]=\"item.documentUrl\"\r\n [download]=\"item.docName || 'document'\">\r\n {{ item.docName || 'Document' }}\r\n </a>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"document-actions\">\r\n <a [href]=\"item.documentUrl\" \r\n target=\"_blank\" \r\n [title]=\"'Download ' + (item.docName || 'Document')\"\r\n [download]=\"item.docName || 'document'\"\r\n [attr.download]=\"item.docName || 'document'\"\r\n class=\"action-btn download-btn\"\r\n externalLink\r\n [externalLink]=\"item.documentUrl\"\r\n [download]=\"item.docName || 'document'\">\r\n <i class=\"pi pi-download\"></i>\r\n </a>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- Show message if no valid content -->\r\n <div class=\"no-content-message\" *ngIf=\"!section.hasValidContent\">\r\n <p>No initial request details available.</p>\r\n </div>\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n \r\n <!-- Document History as regular timeline -->\r\n <div *ngIf=\"section.header !== 'Initial Request'\" class=\"document-history-section\">\r\n <div class=\"section-header\" *ngIf=\"section.header\">\r\n <h4 class=\"section-title\">{{ section.header }}</h4>\r\n </div>\r\n \r\n <div class=\"history-timeline\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <!-- Header with icon and timestamp -->\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename\">\r\n <a [href]=\"item.documentUrl\" \r\n target=\"_blank\" \r\n [title]=\"'Download ' + (item.docName || 'Document')\"\r\n [download]=\"item.docName || 'document'\"\r\n [attr.download]=\"item.docName || 'document'\"\r\n class=\"document-link\"\r\n externalLink\r\n [externalLink]=\"item.documentUrl\"\r\n [download]=\"item.docName || 'document'\">\r\n {{ item.docName || 'Document' }}\r\n </a>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>", styles: [".document-history-container{padding:.75rem;background:#fff;border-radius:8px;box-shadow:0 2px 4px #0000001a;max-height:none;overflow-y:auto;min-width:0}.document-history-container .history-header{margin-bottom:1rem}.document-history-container .history-header .history-title{font-size:1.25rem;font-weight:600;color:#374151;margin:0}.document-history-container .history-sections .history-section{margin-bottom:1.5rem}.document-history-container .history-sections .history-section .initial-request-section{margin-bottom:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{background:#fff;border-top:1px solid;border-top-left-radius:8px;border-top-right-radius:8px;border-bottom:none;padding:.75rem 1rem;font-weight:600;color:#1f2937;font-size:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link:focus{box-shadow:none}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link .p-accordion-header-icon{color:#6b7280;font-size:.875rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header.p-highlight .p-accordion-header-link{background:#fff}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content{background:#fff;border:1px solid;border-top:none;border-radius:0 0 8px 8px;padding:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item{margin-bottom:0}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:.75rem;border-right:3px solid}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{background:#7d879b;color:#fff;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{color:#1f2937;font-weight:600;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .timestamp{color:#6b7280;font-size:.75rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-description .description-text{color:#374151;line-height:1.5;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-name{color:#1f2937;font-weight:500;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-content{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-content{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .document-history-section .section-header{margin-bottom:.75rem}.document-history-container .history-sections .history-section .document-history-section .section-header .section-title{font-size:1.25rem;font-weight:500;color:#374151;margin:0}.document-history-container .history-sections .history-section .history-timeline .timeline-item{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card{border-radius:8px;border:1px solid;padding:1rem;position:relative;border-right:3px solid}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-green-50{background-color:#f0fdf4;border-color:#bbf7d0;border-right-color:#10b981}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-red-50{background-color:#fef2f2;border-color:#fecaca;border-right-color:#ef4444}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-blue-50{background-color:#eff6ff;border-color:#bfdbfe;border-right-color:#3b82f6}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-gray-50{background-color:#f8fafc;border-color:#e2e8f0;border-right-color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{font-weight:600;font-size:.875rem;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .timestamp{font-size:.75rem;color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description .description-text{margin:0;color:#374151;font-size:.875rem;line-height:1.4;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card{background:#fff;border-radius:6px;padding:.75rem;display:flex;justify-content:space-between;align-items:center;border:1px solid #e5e7eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-icon{color:#3b82f6;font-size:1.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-title{font-weight:500;color:#374151;font-size:.875rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename{color:#3b82f6;font-size:.75rem;word-break:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename .document-link{color:#3b82f6;text-decoration:underline;cursor:pointer;display:inline-block}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename .document-link:hover{color:#2563eb;text-decoration:none}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename .document-link:active{color:#1d4ed8}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions{display:flex;gap:.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn{width:24px;height:24px;border:none;border-radius:4px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:.75rem;text-decoration:none}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn{background:#3b82f6;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn:hover{background:#2563eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn{background:#ef4444;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn:hover{background:#dc2626}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn{background:#10b981;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn:hover{background:#059669}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info{text-align:right;font-size:.75rem;color:#374151}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-name{font-weight:500;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280;word-wrap:break-word;overflow-wrap:break-word}.text-green-600{color:#059669}.text-red-600{color:#dc2626}.text-blue-600{color:#2563eb}.text-gray-600{color:#4b5563}.bg-green-50{background-color:#f0fdf4}.bg-red-50{background-color:#fef2f2}.bg-blue-50{background-color:#eff6ff}.bg-gray-50{background-color:#f8fafc}.border-green-200{border-color:#bbf7d0}.border-red-200{border-color:#fecaca}.border-blue-200{border-color:#bfdbfe}.border-gray-200{border-color:#e2e8f0}.icon-bg-green{background-color:#10b981}.icon-bg-red{background-color:#ef4444}.icon-bg-blue{background-color:#3b82f6}.icon-bg-gray{background-color:#6b7280}.no-content-message{text-align:center;padding:2rem;color:#6b7280;font-style:italic}.no-content-message p{margin:0;font-size:.875rem}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.Accordion, selector: "p-accordion", inputs: ["multiple", "style", "styleClass", "expandIcon", "collapseIcon", "activeIndex", "selectOnFocus", "headerAriaLevel"], outputs: ["onClose", "onOpen", "activeIndexChange"] }, { kind: "component", type: i3$2.AccordionTab, selector: "p-accordionTab", inputs: ["id", "header", "headerStyle", "tabStyle", "contentStyle", "tabStyleClass", "headerStyleClass", "contentStyleClass", "disabled", "cache", "transitionOptions", "iconPos", "selected", "headerAriaLevel"], outputs: ["selectedChange"] }, { kind: "directive", type: ExternalLinkDirective, selector: "[externalLink]", inputs: ["externalLink", "target", "download"] }] });
5740
5741
  }
5741
5742
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHistoryComponent, decorators: [{
5742
5743
  type: Component,
5743
- args: [{ selector: 'document-history', standalone: false, template: "<div class=\"document-history-container\" *ngIf=\"showHistory && historyData.length > 0\">\r\n <!-- Test button to verify click events are working -->\r\n <div class=\"test-section\" style=\"margin-bottom: 10px; padding: 10px; background: #f0f0f0; border: 1px solid #ccc;\">\r\n <button (click)=\"testClick()\" style=\"padding: 5px 10px; background: #007bff; color: white; border: none; border-radius: 3px; margin-right: 10px;\">\r\n Test Click Event\r\n </button>\r\n <button (click)=\"testDownload()\" style=\"padding: 5px 10px; background: #28a745; color: white; border: none; border-radius: 3px;\">\r\n Test Download\r\n </button>\r\n <span style=\"margin-left: 10px; font-size: 12px; color: #666;\">Click these to test if events are working</span>\r\n </div>\r\n \r\n <div class=\"history-sections\">\r\n <div class=\"history-section\" *ngFor=\"let section of processedHistoryData\">\r\n <div *ngIf=\"section.header === 'Initial Request' && section.hasValidContent\" \r\n class=\"initial-request-section\"\r\n [ngClass]=\"section.accordionClass\">\r\n <p-accordion [activeIndex]=\"activeAccordionIndex\" \r\n (onOpen)=\"onAccordionOpen()\" \r\n (onClose)=\"onAccordionClose()\">\r\n <p-accordionTab [header]=\"section.header\">\r\n <div class=\"history-timeline\" *ngIf=\"section.hasValidContent\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription ?? 'No Request' }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename clickable\" \r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\"\r\n (mousedown)=\"onMouseDown(item.docName)\"\r\n (mouseup)=\"onMouseUp(item.docName)\"\r\n title=\"Click to download\"\r\n data-debug=\"filename-clickable\"\r\n style=\"cursor: pointer; padding: 5px; border: 1px solid #ddd; border-radius: 3px; background: #f8f9fa; display: inline-block; min-width: 100px;\">\r\n {{ item.docName || 'Document' }}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"document-actions\">\r\n <button class=\"action-btn download-btn\" \r\n title=\"Download\"\r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\"\r\n (mousedown)=\"onMouseDown(item.docName)\"\r\n (mouseup)=\"onMouseUp(item.docName)\"\r\n data-debug=\"download-button\">\r\n <i class=\"pi pi-download\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- Show message if no valid content -->\r\n <div class=\"no-content-message\" *ngIf=\"!section.hasValidContent\">\r\n <p>No initial request details available.</p>\r\n </div>\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n \r\n <!-- Document History as regular timeline -->\r\n <div *ngIf=\"section.header !== 'Initial Request'\" class=\"document-history-section\">\r\n <div class=\"section-header\" *ngIf=\"section.header\">\r\n <h4 class=\"section-title\">{{ section.header }}</h4>\r\n </div>\r\n \r\n <div class=\"history-timeline\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <!-- Header with icon and timestamp -->\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename clickable\" \r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\"\r\n (mousedown)=\"onMouseDown(item.docName)\"\r\n (mouseup)=\"onMouseUp(item.docName)\"\r\n title=\"Click to download\"\r\n data-debug=\"filename-clickable-2\"\r\n style=\"cursor: pointer; padding: 5px; border: 1px solid #ddd; border-radius: 3px; background: #f8f9fa; display: inline-block; min-width: 100px;\">\r\n {{ item.docName || 'Document' }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- Test button to verify click events are working -->\r\n <div class=\"test-section\" style=\"margin-bottom: 10px; padding: 10px; background: #f0f0f0; border: 1px solid #ccc;\">\r\n <button (click)=\"testClick()\" style=\"padding: 5px 10px; background: #007bff; color: white; border: none; border-radius: 3px; margin-right: 10px;\">\r\n Test Click Event\r\n </button>\r\n <button (click)=\"testDownload()\" style=\"padding: 5px 10px; background: #28a745; color: white; border: none; border-radius: 3px;\">\r\n Test Download\r\n </button>\r\n <span style=\"margin-left: 10px; font-size: 12px; color: #666;\">Click these to test if events are working</span>\r\n </div>", styles: [".document-history-container{padding:.75rem;background:#fff;border-radius:8px;box-shadow:0 2px 4px #0000001a;max-height:none;overflow-y:auto;min-width:0}.document-history-container .history-header{margin-bottom:1rem}.document-history-container .history-header .history-title{font-size:1.25rem;font-weight:600;color:#374151;margin:0}.document-history-container .history-sections .history-section{margin-bottom:1.5rem}.document-history-container .history-sections .history-section .initial-request-section{margin-bottom:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{background:#fff;border-top:1px solid;border-top-left-radius:8px;border-top-right-radius:8px;border-bottom:none;padding:.75rem 1rem;font-weight:600;color:#1f2937;font-size:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link:focus{box-shadow:none}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link .p-accordion-header-icon{color:#6b7280;font-size:.875rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header.p-highlight .p-accordion-header-link{background:#fff}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content{background:#fff;border:1px solid;border-top:none;border-radius:0 0 8px 8px;padding:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item{margin-bottom:0}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:.75rem;border-right:3px solid}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{background:#7d879b;color:#fff;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{color:#1f2937;font-weight:600;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .timestamp{color:#6b7280;font-size:.75rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-description .description-text{color:#374151;line-height:1.5;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-name{color:#1f2937;font-weight:500;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-content{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-content{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .document-history-section .section-header{margin-bottom:.75rem}.document-history-container .history-sections .history-section .document-history-section .section-header .section-title{font-size:1.25rem;font-weight:500;color:#374151;margin:0}.document-history-container .history-sections .history-section .history-timeline .timeline-item{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card{border-radius:8px;border:1px solid;padding:1rem;position:relative;border-right:3px solid}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-green-50{background-color:#f0fdf4;border-color:#bbf7d0;border-right-color:#10b981}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-red-50{background-color:#fef2f2;border-color:#fecaca;border-right-color:#ef4444}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-blue-50{background-color:#eff6ff;border-color:#bfdbfe;border-right-color:#3b82f6}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-gray-50{background-color:#f8fafc;border-color:#e2e8f0;border-right-color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{font-weight:600;font-size:.875rem;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .timestamp{font-size:.75rem;color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description .description-text{margin:0;color:#374151;font-size:.875rem;line-height:1.4;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card{background:#fff;border-radius:6px;padding:.75rem;display:flex;justify-content:space-between;align-items:center;border:1px solid #e5e7eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-icon{color:#3b82f6;font-size:1.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-title{font-weight:500;color:#374151;font-size:.875rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename{color:#3b82f6;font-size:.75rem;word-break:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename.clickable{cursor:pointer;text-decoration:underline}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename.clickable:hover{color:#2563eb;text-decoration:none}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions{display:flex;gap:.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn{width:24px;height:24px;border:none;border-radius:4px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn{background:#3b82f6;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn:hover{background:#2563eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn{background:#ef4444;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn:hover{background:#dc2626}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn{background:#10b981;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn:hover{background:#059669}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info{text-align:right;font-size:.75rem;color:#374151}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-name{font-weight:500;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280;word-wrap:break-word;overflow-wrap:break-word}.text-green-600{color:#059669}.text-red-600{color:#dc2626}.text-blue-600{color:#2563eb}.text-gray-600{color:#4b5563}.bg-green-50{background-color:#f0fdf4}.bg-red-50{background-color:#fef2f2}.bg-blue-50{background-color:#eff6ff}.bg-gray-50{background-color:#f8fafc}.border-green-200{border-color:#bbf7d0}.border-red-200{border-color:#fecaca}.border-blue-200{border-color:#bfdbfe}.border-gray-200{border-color:#e2e8f0}.icon-bg-green{background-color:#10b981}.icon-bg-red{background-color:#ef4444}.icon-bg-blue{background-color:#3b82f6}.icon-bg-gray{background-color:#6b7280}.no-content-message{text-align:center;padding:2rem;color:#6b7280;font-style:italic}.no-content-message p{margin:0;font-size:.875rem}\n"] }]
5744
+ args: [{ selector: 'document-history', standalone: false, template: "<div class=\"document-history-container\" *ngIf=\"showHistory && historyData.length > 0\">\r\n <div class=\"history-sections\">\r\n <div class=\"history-section\" *ngFor=\"let section of processedHistoryData\">\r\n <div *ngIf=\"section.header === 'Initial Request' && section.hasValidContent\" \r\n class=\"initial-request-section\"\r\n [ngClass]=\"section.accordionClass\">\r\n <p-accordion [activeIndex]=\"activeAccordionIndex\" \r\n (onOpen)=\"onAccordionOpen()\" \r\n (onClose)=\"onAccordionClose()\">\r\n <p-accordionTab [header]=\"section.header\">\r\n <div class=\"history-timeline\" *ngIf=\"section.hasValidContent\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription ?? 'No Request' }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename\">\r\n <a [href]=\"item.documentUrl\" \r\n target=\"_blank\" \r\n [title]=\"'Download ' + (item.docName || 'Document')\"\r\n [download]=\"item.docName || 'document'\"\r\n [attr.download]=\"item.docName || 'document'\"\r\n class=\"document-link\"\r\n externalLink\r\n [externalLink]=\"item.documentUrl\"\r\n [download]=\"item.docName || 'document'\">\r\n {{ item.docName || 'Document' }}\r\n </a>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"document-actions\">\r\n <a [href]=\"item.documentUrl\" \r\n target=\"_blank\" \r\n [title]=\"'Download ' + (item.docName || 'Document')\"\r\n [download]=\"item.docName || 'document'\"\r\n [attr.download]=\"item.docName || 'document'\"\r\n class=\"action-btn download-btn\"\r\n externalLink\r\n [externalLink]=\"item.documentUrl\"\r\n [download]=\"item.docName || 'document'\">\r\n <i class=\"pi pi-download\"></i>\r\n </a>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- Show message if no valid content -->\r\n <div class=\"no-content-message\" *ngIf=\"!section.hasValidContent\">\r\n <p>No initial request details available.</p>\r\n </div>\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n \r\n <!-- Document History as regular timeline -->\r\n <div *ngIf=\"section.header !== 'Initial Request'\" class=\"document-history-section\">\r\n <div class=\"section-header\" *ngIf=\"section.header\">\r\n <h4 class=\"section-title\">{{ section.header }}</h4>\r\n </div>\r\n \r\n <div class=\"history-timeline\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <!-- Header with icon and timestamp -->\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename\">\r\n <a [href]=\"item.documentUrl\" \r\n target=\"_blank\" \r\n [title]=\"'Download ' + (item.docName || 'Document')\"\r\n [download]=\"item.docName || 'document'\"\r\n [attr.download]=\"item.docName || 'document'\"\r\n class=\"document-link\"\r\n externalLink\r\n [externalLink]=\"item.documentUrl\"\r\n [download]=\"item.docName || 'document'\">\r\n {{ item.docName || 'Document' }}\r\n </a>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>", styles: [".document-history-container{padding:.75rem;background:#fff;border-radius:8px;box-shadow:0 2px 4px #0000001a;max-height:none;overflow-y:auto;min-width:0}.document-history-container .history-header{margin-bottom:1rem}.document-history-container .history-header .history-title{font-size:1.25rem;font-weight:600;color:#374151;margin:0}.document-history-container .history-sections .history-section{margin-bottom:1.5rem}.document-history-container .history-sections .history-section .initial-request-section{margin-bottom:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{background:#fff;border-top:1px solid;border-top-left-radius:8px;border-top-right-radius:8px;border-bottom:none;padding:.75rem 1rem;font-weight:600;color:#1f2937;font-size:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link:focus{box-shadow:none}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link .p-accordion-header-icon{color:#6b7280;font-size:.875rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header.p-highlight .p-accordion-header-link{background:#fff}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content{background:#fff;border:1px solid;border-top:none;border-radius:0 0 8px 8px;padding:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item{margin-bottom:0}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:.75rem;border-right:3px solid}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{background:#7d879b;color:#fff;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{color:#1f2937;font-weight:600;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .timestamp{color:#6b7280;font-size:.75rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-description .description-text{color:#374151;line-height:1.5;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-name{color:#1f2937;font-weight:500;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-content{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-content{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .document-history-section .section-header{margin-bottom:.75rem}.document-history-container .history-sections .history-section .document-history-section .section-header .section-title{font-size:1.25rem;font-weight:500;color:#374151;margin:0}.document-history-container .history-sections .history-section .history-timeline .timeline-item{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card{border-radius:8px;border:1px solid;padding:1rem;position:relative;border-right:3px solid}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-green-50{background-color:#f0fdf4;border-color:#bbf7d0;border-right-color:#10b981}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-red-50{background-color:#fef2f2;border-color:#fecaca;border-right-color:#ef4444}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-blue-50{background-color:#eff6ff;border-color:#bfdbfe;border-right-color:#3b82f6}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-gray-50{background-color:#f8fafc;border-color:#e2e8f0;border-right-color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{font-weight:600;font-size:.875rem;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .timestamp{font-size:.75rem;color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description .description-text{margin:0;color:#374151;font-size:.875rem;line-height:1.4;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card{background:#fff;border-radius:6px;padding:.75rem;display:flex;justify-content:space-between;align-items:center;border:1px solid #e5e7eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-icon{color:#3b82f6;font-size:1.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-title{font-weight:500;color:#374151;font-size:.875rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename{color:#3b82f6;font-size:.75rem;word-break:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename .document-link{color:#3b82f6;text-decoration:underline;cursor:pointer;display:inline-block}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename .document-link:hover{color:#2563eb;text-decoration:none}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename .document-link:active{color:#1d4ed8}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions{display:flex;gap:.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn{width:24px;height:24px;border:none;border-radius:4px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:.75rem;text-decoration:none}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn{background:#3b82f6;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn:hover{background:#2563eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn{background:#ef4444;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn:hover{background:#dc2626}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn{background:#10b981;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn:hover{background:#059669}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info{text-align:right;font-size:.75rem;color:#374151}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-name{font-weight:500;word-wrap:break-word;overflow-wrap:break-word}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280;word-wrap:break-word;overflow-wrap:break-word}.text-green-600{color:#059669}.text-red-600{color:#dc2626}.text-blue-600{color:#2563eb}.text-gray-600{color:#4b5563}.bg-green-50{background-color:#f0fdf4}.bg-red-50{background-color:#fef2f2}.bg-blue-50{background-color:#eff6ff}.bg-gray-50{background-color:#f8fafc}.border-green-200{border-color:#bbf7d0}.border-red-200{border-color:#fecaca}.border-blue-200{border-color:#bfdbfe}.border-gray-200{border-color:#e2e8f0}.icon-bg-green{background-color:#10b981}.icon-bg-red{background-color:#ef4444}.icon-bg-blue{background-color:#3b82f6}.icon-bg-gray{background-color:#6b7280}.no-content-message{text-align:center;padding:2rem;color:#6b7280;font-style:italic}.no-content-message p{margin:0;font-size:.875rem}\n"] }]
5744
5745
  }], ctorParameters: () => [{ type: DocumentHistoryService }], propDecorators: { historyData: [{
5745
5746
  type: Input
5746
5747
  }], showHistory: [{
@@ -6663,25 +6664,58 @@ class DocumentContentViewerComponent {
6663
6664
  this.loadCsvData();
6664
6665
  }
6665
6666
  /**
6666
- * Downloads the document
6667
+ * Downloads the document using a robust approach that bypasses Angular Router interception
6667
6668
  */
6668
6669
  downloadDocument() {
6669
6670
  if (this.documentUrl) {
6670
- const link = document.createElement('a');
6671
- link.href = this.documentUrl;
6672
- link.download = this.documentName || 'document';
6673
- link.target = '_blank';
6674
- document.body.appendChild(link);
6675
- link.click();
6676
- document.body.removeChild(link);
6671
+ try {
6672
+ // Create a temporary link element
6673
+ const link = document.createElement('a');
6674
+ link.href = this.documentUrl;
6675
+ link.download = this.documentName || 'document';
6676
+ link.target = '_blank';
6677
+ // Set additional attributes to ensure it works
6678
+ link.setAttribute('rel', 'noopener noreferrer');
6679
+ // Append to DOM, click, and remove
6680
+ document.body.appendChild(link);
6681
+ link.click();
6682
+ document.body.removeChild(link);
6683
+ }
6684
+ catch (error) {
6685
+ console.error('Download failed:', error);
6686
+ // Fallback: try to open in new tab
6687
+ try {
6688
+ const newWindow = window.open(this.documentUrl, '_blank', 'noopener,noreferrer');
6689
+ if (!newWindow) {
6690
+ console.warn('Popup blocked, falling back to direct navigation');
6691
+ window.location.href = this.documentUrl;
6692
+ }
6693
+ }
6694
+ catch (fallbackError) {
6695
+ console.error('All download methods failed:', fallbackError);
6696
+ }
6697
+ }
6677
6698
  }
6678
6699
  }
6679
6700
  /**
6680
- * Opens the document in a new tab
6701
+ * Opens the document in a new tab using a robust approach that bypasses Angular Router interception
6681
6702
  */
6682
6703
  openInNewTab() {
6683
6704
  if (this.documentUrl) {
6684
- window.open(this.documentUrl, '_blank');
6705
+ try {
6706
+ // Use window.open with proper parameters
6707
+ const newWindow = window.open(this.documentUrl, '_blank', 'noopener,noreferrer');
6708
+ // If popup blocked, fallback to location change
6709
+ if (!newWindow) {
6710
+ console.warn('Popup blocked, falling back to direct navigation');
6711
+ window.location.href = this.documentUrl;
6712
+ }
6713
+ }
6714
+ catch (error) {
6715
+ console.error('Failed to open in new tab:', error);
6716
+ // Final fallback
6717
+ window.location.href = this.documentUrl;
6718
+ }
6685
6719
  }
6686
6720
  }
6687
6721
  /**
@@ -9076,6 +9110,10 @@ class DocumentModule {
9076
9110
  * FormsModule to handle the forms.
9077
9111
  */
9078
9112
  FormsModule,
9113
+ /**
9114
+ * A directive to handle external links and bypass router interception.
9115
+ */
9116
+ ExternalLinkDirective,
9079
9117
  /**
9080
9118
  * PdfViewerModule to handle and make visible the pdf.
9081
9119
  */
@@ -9390,6 +9428,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
9390
9428
  * FormsModule to handle the forms.
9391
9429
  */
9392
9430
  FormsModule,
9431
+ /**
9432
+ * A directive to handle external links and bypass router interception.
9433
+ */
9434
+ ExternalLinkDirective,
9393
9435
  /**
9394
9436
  * PdfViewerModule to handle and make visible the pdf.
9395
9437
  */
@@ -9511,5 +9553,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
9511
9553
  * Generated bundle index. Do not edit.
9512
9554
  */
9513
9555
 
9514
- export { COUNTRIES, ConfirmationDialogComponent, DOCUMENTTYPES, DUMMYDOCUMENTLIST, DUMMYSUMMARY, DUMMY_DOCUMENT_SECTIONS, DocumentActionsComponent, DocumentAlertList, DocumentContainerComponent, DocumentContentTypeService, DocumentContentViewerComponent, DocumentDirective, DocumentHistoryComponent, DocumentListComponent, DocumentModule, DocumentSearchComponent, DocumentTableBuilderService, DocumentViewerComponent, HasPermissionDirective, SAMPLE_STATUS_DATA, SHARED, SUPPORTED_IMAGE_TYPES, SharedModule, SidebarComponent, TablePrimaryComponent, USERLIST };
9556
+ export { COUNTRIES, ConfirmationDialogComponent, DOCUMENTTYPES, DUMMYDOCUMENTLIST, DUMMYSUMMARY, DUMMY_DOCUMENT_SECTIONS, DocumentActionsComponent, DocumentAlertList, DocumentContainerComponent, DocumentContentTypeService, DocumentContentViewerComponent, DocumentDirective, DocumentHistoryComponent, DocumentListComponent, DocumentModule, DocumentSearchComponent, DocumentTableBuilderService, DocumentViewerComponent, ExternalLinkDirective, HasPermissionDirective, SAMPLE_STATUS_DATA, SHARED, SUPPORTED_IMAGE_TYPES, SharedModule, SidebarComponent, TablePrimaryComponent, USERLIST };
9515
9557
  //# sourceMappingURL=cat-documents-ng.mjs.map