{"version":3,"file":"ngx-print.mjs","names":[],"sources":["../../../src/lib/print-options.ts","../../../src/lib/ngx-print.base.ts","../../../src/lib/ngx-print.directive.ts","../../../src/lib/ngx-print.module.ts","../../../src/lib/ngx-print.service.ts"],"sourcesContent":["export class PrintOptions {\r\n  printSectionId = '';\r\n  printTitle = '';\r\n  useExistingCss = false;\r\n  bodyClass = '';\r\n  printMethod: 'window' | 'tab' | 'iframe' = 'window';\r\n  previewOnly = false;\r\n  closeWindow = true;\r\n  printDelay = 0;\r\n\r\n  constructor(options?: Partial<PrintOptions>) {\r\n    if (options) {\r\n      Object.assign(this, options);\r\n    }\r\n  }\r\n}\r\n","import { CSP_NONCE, DOCUMENT, inject, Service } from '@angular/core';\r\nimport { Subject } from 'rxjs';\r\nimport { PrintOptions } from './print-options';\r\n\r\n/** For example:\r\n * {\r\n *     'h2': { 'border': 'solid 1px' },\r\n *     'h1': { 'color': 'red', 'border': '1px solid' },\r\n *   */\r\nexport type PrintStyle = Record<string, Record<string, string>>;\r\n\r\n/**\r\n * Either a {@link PrintStyle} object, or a raw CSS string (e.g. `'h1 { color: red; }'`)\r\n * to be injected into the print document's <style> tag as-is.\r\n */\r\nexport type PrintStyleInput = PrintStyle | string;\r\n\r\n/** Everything copied from the host document into the print document. */\r\ninterface DocumentComponents {\r\n  styles: string;\r\n  links: string;\r\n  baseTag: string;\r\n  printContents: string | null;\r\n}\r\n\r\n/**\r\n * A document to print into, plus the parts of printing that differ per print method.\r\n * Completion detection is wired up by the factory that creates the target.\r\n */\r\ninterface PrintTarget {\r\n  doc: Document;\r\n  /** Runs `callback` once the written document has loaded. */\r\n  onLoad(callback: () => void): void;\r\n  /** Opens the print dialog. */\r\n  print(): void;\r\n}\r\n\r\n@Service()\r\nexport class PrintBase {\r\n  private document = inject(DOCUMENT);\r\n  private nonce = inject(CSP_NONCE, { optional: true });\r\n\r\n  private _iframeElement: HTMLIFrameElement | undefined;\r\n  private _printStyle: string[] = [];\r\n  private _styleSheetFile = '';\r\n  protected printComplete = new Subject<void>();\r\n\r\n  //#region Getters and Setters\r\n  /**\r\n   * Sets the print styles based on the provided values.\r\n   *\r\n   * @param values - Either a key-value pairs object representing print styles, or a raw CSS string.\r\n   * @protected\r\n   */\r\n  protected setPrintStyle(values: PrintStyleInput) {\r\n    if (typeof values === 'string') {\r\n      this._printStyle = values ? [values] : [];\r\n      return;\r\n    }\r\n\r\n    this._printStyle = [];\r\n    for (const [selector, declarations] of Object.entries(values)) {\r\n      // Built declaration-by-declaration (rather than via JSON.stringify + a quote-stripping\r\n      // regex) so that quotes and commas that are part of a CSS value (e.g. quoted font names,\r\n      // comma-separated font-family fallback lists) survive instead of being stripped/mangled.\r\n      const body = Object.entries(declarations)\r\n        .map(([property, value]) => `${property}:${value}`)\r\n        .join(';');\r\n      this._printStyle.push(`${selector}{${body}}`);\r\n    }\r\n  }\r\n\r\n  /**\r\n   * @returns the string that create the stylesheet which will be injected\r\n   * later within <style></style> tag.\r\n   */\r\n  public returnStyleValues(): string {\r\n    const styleNonce = this.nonce ? ` nonce=\"${this.nonce}\"` : '';\r\n    return `<style${styleNonce}> ${this._printStyle.join(' ')} </style>`;\r\n  }\r\n\r\n  /**\r\n   * @returns string which contains the link tags containing the css which will\r\n   * be injected later within <head></head> tag.\r\n   *\r\n   */\r\n  private returnStyleSheetLinkTags(): string {\r\n    return this._styleSheetFile;\r\n  }\r\n\r\n  /**\r\n   * Sets the style sheet file based on the provided CSS list.\r\n   *\r\n   * @param {string} cssList - CSS file or list of CSS files.\r\n   * @protected\r\n   */\r\n  // prettier-ignore\r\n  protected setStyleSheetFile(cssList: string): void {\r\n    if (!cssList) {\r\n      this._styleSheetFile = '';\r\n      return;\r\n    }\r\n    const files = cssList.split(',').map(f => f.trim());\r\n    const nonceAttr = this.nonce ? ` nonce=\"${this.nonce}\"` : '';\r\n    this._styleSheetFile = files\r\n      .map(url => `<link${nonceAttr} rel=\"stylesheet\" type=\"text/css\" href=\"${url}\">`)\r\n      .join('');\r\n  }\r\n\r\n  //#endregion\r\n\r\n  //#region Private methods used by PrintBase\r\n\r\n  private syncFormValues(source: HTMLElement, clone: HTMLElement): void {\r\n    // Select all form elements\r\n    const selector = 'input, select, textarea';\r\n    const sourceEls = source.querySelectorAll(selector);\r\n    const cloneEls = clone.querySelectorAll(selector);\r\n\r\n    for (let i = 0; i < sourceEls.length; i++) {\r\n      const srcNode = sourceEls[i] as HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;\r\n      const cloneNode = cloneEls[i] as typeof srcNode;\r\n\r\n      if (srcNode instanceof HTMLInputElement) {\r\n        if (srcNode.type === 'checkbox' || srcNode.type === 'radio') {\r\n          if (srcNode.checked) cloneNode.setAttribute('checked', '');\r\n          else cloneNode.removeAttribute('checked'); // Remove if unchecked\r\n        } else if (srcNode.type === 'file') {\r\n          // File inputs can't be set programmatically for security\r\n          continue;\r\n        } else {\r\n          cloneNode.setAttribute('value', srcNode.value);\r\n        }\r\n      } else if (srcNode instanceof HTMLTextAreaElement) {\r\n        cloneNode.textContent = srcNode.value; // Use textContent, not innerHTML\r\n      } else if (srcNode instanceof HTMLSelectElement) {\r\n        Array.from((cloneNode as HTMLSelectElement).options).forEach((opt, idx) => {\r\n          if (idx === srcNode.selectedIndex) {\r\n            opt.setAttribute('selected', '');\r\n          } else {\r\n            opt.removeAttribute('selected'); // Remove from non-selected\r\n          }\r\n        });\r\n      }\r\n    }\r\n  }\r\n\r\n  /**\r\n   * Converts a canvas element to an image and returns its HTML string.\r\n   *\r\n   * @param {HTMLCanvasElement} canvasElm - The canvas element to convert.\r\n   * @returns {HTMLImageElement | null} - HTML Element of the image.\r\n   * @private\r\n   */\r\n  private canvasToImageHtml(canvasElm: HTMLCanvasElement): HTMLImageElement | null {\r\n    try {\r\n      const dataUrl = canvasElm.toDataURL(); // may throw if canvas is tainted\r\n      const img = this.document.createElement('img');\r\n      img.src = dataUrl;\r\n      img.style.maxWidth = '100%';\r\n\r\n      // Preserve displayed size (not just bitmap size)\r\n      const rect = canvasElm.getBoundingClientRect();\r\n      if (rect.width) img.style.width = `${rect.width}px`;\r\n      if (rect.height) img.style.height = `${rect.height}px`;\r\n\r\n      return img;\r\n    } catch (err) {\r\n      console.warn(`Canvas conversion failed for ${canvasElm}. Likely the canvas is tainted:`, err);\r\n      // If toDataURL() fails (e.g., tainted canvas), keep canvas as-is in print output\r\n      return null;\r\n    }\r\n  }\r\n\r\n  /**\r\n   * Includes canvas contents in the print section via img tags.\r\n   *\r\n   * @private\r\n   * @param source\r\n   * @param clone\r\n   */\r\n  private updateCanvasToImage(source: HTMLElement, clone: HTMLElement): void {\r\n    const sourceCanvases = source.querySelectorAll('canvas');\r\n    const cloneCanvases = clone.querySelectorAll('canvas');\r\n\r\n    for (let i = 0; i < sourceCanvases.length; i++) {\r\n      const srcCanvas = sourceCanvases[i];\r\n      const cloneCanvas = cloneCanvases[i];\r\n      const img = this.canvasToImageHtml(srcCanvas);\r\n      if (img) {\r\n        cloneCanvas.replaceWith(img);\r\n      }\r\n    }\r\n  }\r\n\r\n  /**\r\n   * Retrieves the HTML content of a specified printing section.\r\n   *\r\n   * @param {string} printSectionId - Id of the printing section.\r\n   * @returns {string | null} - HTML content of the printing section, or null if not found.\r\n   * @private\r\n   */\r\n  private getHtmlContents(printSectionId: string): string | null {\r\n    const sourceElm = this.document.getElementById(printSectionId);\r\n    if (!sourceElm) return null;\r\n\r\n    const cloneElm = sourceElm.cloneNode(true) as HTMLElement; // cloneNode(true) deep clones subtree\r\n\r\n    this.syncFormValues(sourceElm, cloneElm);\r\n    this.updateCanvasToImage(sourceElm, cloneElm);\r\n\r\n    return cloneElm.outerHTML;\r\n  }\r\n\r\n  /**\r\n   * Retrieves the HTML content of elements with the specified tag.\r\n   *\r\n   * @param {keyof HTMLElementTagNameMap} tag - HTML tag name.\r\n   * @returns {string} - Concatenated outerHTML of elements with the specified tag.\r\n   * @private\r\n   */\r\n  private getElementTag(tag: keyof HTMLElementTagNameMap): string {\r\n    const html: string[] = [];\r\n    const elements = this.document.getElementsByTagName(tag);\r\n    for (const el of Array.from(elements)) {\r\n      html.push((el as Element).outerHTML);\r\n    }\r\n    return html.join('\\r\\n');\r\n  }\r\n\r\n  //#endregion\r\n\r\n  /**\r\n   * Prints the specified content using the provided print options.\r\n   *\r\n   * @public\r\n   * @param printOptionInput - Options for printing.\r\n   * @returns a Promise that resolves once this print job completes (the print dialog / window was closed).\r\n   * It never settles if printing could not be started, or with `previewOnly` in iframe mode.\r\n   */\r\n  protected print(printOptionInput?: Partial<PrintOptions>): Promise<void> {\r\n    const printOptions = new PrintOptions(printOptionInput);\r\n    return new Promise<void>(resolve => {\r\n      const onComplete = () => {\r\n        this.printComplete.next(); // legacy\r\n        resolve();\r\n      };\r\n\r\n      // Collected before any window/iframe is created, so a missing section never leaves an empty popup behind.\r\n      const components = this.prepareDocumentComponents(printOptions);\r\n      if (!components.printContents) {\r\n        console.error(`Print section with id \"${printOptions.printSectionId}\" not found.`);\r\n        return;\r\n      }\r\n\r\n      const target = printOptions.printMethod === 'iframe' ? this.createIframeTarget(printOptions, onComplete) : this.createWindowTarget(printOptions, onComplete);\r\n      if (target) {\r\n        this.runPrint(target, printOptions, components);\r\n      }\r\n    });\r\n  }\r\n\r\n  /**\r\n   * The steps shared by every print method: write the document, wait for it to load,\r\n   * then open the print dialog after `printDelay` (unless `previewOnly`).\r\n   */\r\n  private runPrint(target: PrintTarget, printOptions: PrintOptions, components: DocumentComponents): void {\r\n    target.doc.open();\r\n    this.buildPrintDocument(target.doc, printOptions, components);\r\n    target.doc.close();\r\n\r\n    target.onLoad(() => {\r\n      if (printOptions.previewOnly) return;\r\n      setTimeout(() => target.print(), printOptions.printDelay || 0);\r\n    });\r\n  }\r\n\r\n  private createWindowTarget(printOptions: PrintOptions, onComplete: () => void): PrintTarget | null {\r\n    // An empty features string makes the browser open a new tab instead of a popup window.\r\n    const popOut = printOptions.printMethod === 'tab' ? '' : 'top=0,left=0,height=auto,width=auto';\r\n    const popupWin = window.open('', '_blank', popOut);\r\n\r\n    if (!popupWin) {\r\n      // the popup window could not be opened.\r\n      console.error('Could not open print window.');\r\n      return null;\r\n    }\r\n\r\n    // Started right away (not when printing) so that closing a previewOnly window also completes.\r\n    const checkClosedInterval = setInterval(() => {\r\n      if (popupWin.closed) {\r\n        clearInterval(checkClosedInterval);\r\n        onComplete();\r\n      }\r\n    }, 500);\r\n\r\n    return {\r\n      doc: popupWin.document,\r\n      onLoad: callback => popupWin.addEventListener('load', callback),\r\n      print: () => {\r\n        popupWin.print();\r\n        if (printOptions.closeWindow) popupWin.close();\r\n      },\r\n    };\r\n  }\r\n\r\n  private createIframeTarget(printOptions: PrintOptions, onComplete: () => void): PrintTarget | null {\r\n    this._iframeElement?.remove();\r\n    this._iframeElement = this.document.createElement('iframe');\r\n    const iframe = this._iframeElement;\r\n    iframe.id = 'print-iframe-' + new Date().getTime();\r\n    iframe.style.position = 'absolute';\r\n    iframe.style.left = '-9999px';\r\n    iframe.style.top = '-9999px';\r\n    iframe.style.width = '0px';\r\n    iframe.style.height = '0px';\r\n    iframe.ariaHidden = 'true';\r\n\r\n    this.document.body.appendChild(iframe);\r\n\r\n    const printWindow = iframe.contentWindow;\r\n    const iframeDoc = iframe.contentDocument || printWindow?.document;\r\n    if (!printWindow || !iframeDoc) {\r\n      console.error('Could not access iframe document.');\r\n      iframe.remove();\r\n      return null;\r\n    }\r\n\r\n    return {\r\n      doc: iframeDoc,\r\n      onLoad: callback => (iframe.onload = callback),\r\n      print: () => {\r\n        // Browsers derive the suggested \"Save as PDF\" filename from the host page's\r\n        // document.title, not the iframe's own <title> (unlike window/tab printing, where the popup/tab is itself the top-level context).\r\n        // Swap it temporarily so printTitle is used as the suggested filename here too, restoring it once printing is done.\r\n        const originalTitle = this.document.title;\r\n        if (printOptions.printTitle) {\r\n          this.document.title = printOptions.printTitle;\r\n        }\r\n\r\n        // Registered BEFORE print() is called: window.print() blocks script execution.\r\n        // Registered only now (not at creation) so that printing the host page while a previewOnly iframe exists doesn't count as completion.\r\n        const mediaQueryList = printWindow.matchMedia('print');\r\n        const listener = (mql: MediaQueryListEvent) => {\r\n          if (!mql.matches) {\r\n            this.document.title = originalTitle;\r\n            onComplete();\r\n            mediaQueryList.removeEventListener('change', listener);\r\n          }\r\n        };\r\n        mediaQueryList.addEventListener('change', listener);\r\n\r\n        printWindow.focus();\r\n        printWindow.print();\r\n      },\r\n    };\r\n  }\r\n\r\n  private prepareDocumentComponents(printOptions: PrintOptions): DocumentComponents {\r\n    let styles = '';\r\n    let links = '';\r\n    const baseTag = this.getElementTag('base');\r\n\r\n    if (printOptions.useExistingCss) {\r\n      styles = this.getElementTag('style');\r\n      links = this.getElementTag('link');\r\n    }\r\n\r\n    const printContents = this.getHtmlContents(printOptions.printSectionId);\r\n\r\n    return { styles, links, baseTag, printContents };\r\n  }\r\n\r\n  private buildPrintDocument(doc: Document, printOptions: PrintOptions, components: DocumentComponents): void {\r\n    const html = doc.createElement('html');\r\n    const head = doc.createElement('head');\r\n    const body = doc.createElement('body');\r\n\r\n    // Set title\r\n    const title = doc.createElement('title');\r\n    title.textContent = printOptions.printTitle || '';\r\n    head.appendChild(title);\r\n\r\n    // Add all head content\r\n    if (components.baseTag) {\r\n      head.innerHTML += components.baseTag;\r\n    }\r\n    head.innerHTML += this.returnStyleValues();\r\n    head.innerHTML += this.returnStyleSheetLinkTags();\r\n    head.innerHTML += components.styles;\r\n    head.innerHTML += components.links;\r\n\r\n    // Set body class and content\r\n    if (printOptions.bodyClass) body.className = printOptions.bodyClass;\r\n    body.innerHTML += components.printContents;\r\n\r\n    // Assemble document\r\n    html.appendChild(head);\r\n    html.appendChild(body);\r\n    doc.appendChild(html);\r\n  }\r\n}\r\n","import { Directive, input, output } from '@angular/core';\r\nimport { PrintBase, PrintStyleInput } from './ngx-print.base';\r\nimport { PrintOptions } from './print-options';\r\n\r\n@Directive({\r\n  selector: '[ngxPrint]',\r\n  standalone: true,\r\n  host: {\r\n    '(click)': 'print()',\r\n  },\r\n})\r\nexport class NgxPrintDirective extends PrintBase {\r\n  /**\r\n   * Prevents the print dialog from opening on the window\r\n   */\r\n  readonly previewOnly = input(false);\r\n\r\n  readonly printSectionId = input('');\r\n\r\n  readonly printTitle = input('');\r\n\r\n  readonly useExistingCss = input(false);\r\n\r\n  /**\r\n   * A delay in milliseconds to force the print dialog to wait before opened. Default: 0\r\n   */\r\n  readonly printDelay = input(0);\r\n\r\n  /**\r\n   * Whether to close the window after print() returns.\r\n   */\r\n  readonly closeWindow = input(true);\r\n\r\n  /**\r\n   * Class attribute to apply to the body element.\r\n   */\r\n  readonly bodyClass = input('');\r\n\r\n  /**\r\n   * Which PrintMethod (iframe/window/tab) to use.\r\n   */\r\n  readonly printMethod = input<PrintOptions['printMethod']>('window');\r\n\r\n  readonly printStyle = input<PrintStyleInput>({});\r\n\r\n  readonly styleSheetFile = input('');\r\n\r\n  readonly printCompleted = output<void>();\r\n\r\n  public override print(): Promise<void> {\r\n    // Inputs carry side effects on PrintBase's internal style state, so they're applied\r\n    // synchronously here rather than via effect() (effects shouldn't propagate state).\r\n    super.setPrintStyle(this.printStyle());\r\n    super.setStyleSheetFile(this.styleSheetFile());\r\n\r\n    const printed = super.print({\r\n      printSectionId: this.printSectionId(),\r\n      printTitle: this.printTitle(),\r\n      useExistingCss: this.useExistingCss(),\r\n      bodyClass: this.bodyClass(),\r\n      printMethod: this.printMethod(),\r\n      previewOnly: this.previewOnly(),\r\n      closeWindow: this.closeWindow(),\r\n      printDelay: this.printDelay(),\r\n    });\r\n\r\n    return printed.then(() => this.printCompleted.emit());\r\n  }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { NgxPrintDirective } from './ngx-print.directive';\r\n\r\n@NgModule({\r\n  imports: [NgxPrintDirective],\r\n  exports: [NgxPrintDirective],\r\n})\r\nexport class NgxPrintModule {}\r\n","import { Service } from '@angular/core';\r\nimport { PrintBase, PrintStyleInput } from './ngx-print.base';\r\nimport { PrintOptions } from './print-options';\r\n\r\n/**\r\n * Service for handling printing functionality in Angular applications.\r\n * Extends the base printing class (PrintBase).\r\n *\r\n * @export\r\n * @class NgxPrintService\r\n * @extends {PrintBase}\r\n */\r\n@Service()\r\nexport class NgxPrintService extends PrintBase {\r\n  /**\r\n   * Emits every time a print job completes.\r\n   *\r\n   * @deprecated The RxJS-based API will be removed in the next major version.\r\n   * Use the Promise returned by {@link NgxPrintService.print} instead, which resolves when that print job completes:\r\n   *\r\n   * ```ts\r\n   * // Before\r\n   * this.printService.printComplete$.pipe(take(1)).subscribe(() => onDone());\r\n   * this.printService.print(options);\r\n   *\r\n   * // After\r\n   * await this.printService.print(options);\r\n   * onDone();\r\n   * // or: this.printService.print(options).then(() => onDone());\r\n   * ```\r\n   *\r\n   * If you still need an Observable, wrap the Promise yourself: `from(this.printService.print(options))`.\r\n   */\r\n  printComplete$ = this.printComplete.asObservable();\r\n\r\n  /**\r\n   * Initiates the printing process using the provided print options.\r\n   *\r\n   * @param {PrintOptions} printOptions - Options for configuring the printing process.\r\n   * @memberof NgxPrintService\r\n   * @returns {Promise<void>} Resolves once this print job completes (the print dialog / window was closed).\r\n   * It cannot tell whether the user printed or cancelled, and it never settles if printing\r\n   * could not be started (e.g. blocked popup, missing print section).\r\n   */\r\n  public override print(printOptions?: Partial<PrintOptions>): Promise<void> {\r\n    // Call the print method in the parent class\r\n    return super.print(printOptions);\r\n  }\r\n\r\n  /**\r\n   * Sets the print style for the printing process.\r\n   *\r\n   * @param values - Either a dictionary representing the print styles, or a raw CSS string.\r\n   * @memberof NgxPrintService\r\n   * @setter\r\n   */\r\n  set printStyle(values: PrintStyleInput) {\r\n    super.setPrintStyle(values);\r\n  }\r\n\r\n  /**\r\n   * Sets the stylesheet file for the printing process.\r\n   *\r\n   * @param {string} cssList - A string representing the path to the stylesheet file.\r\n   * @memberof NgxPrintService\r\n   * @setter\r\n   */\r\n  set styleSheetFile(cssList: string) {\r\n    super.setStyleSheetFile(cssList);\r\n  }\r\n}\r\n"],"mappings":";;;AAAA,IAAa,eAAb,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