{
  "version": 3,
  "sources": ["../src/index.js", "../src/excel.js", "../src/powerpoint.js", "../src/word.js"],
  "sourcesContent": ["// office/src/index.js\n/**\n * @file Main entry point for the @daitanjs/office package.\n * @module @daitanjs/office\n *\n * @description\n * This package provides a suite of utilities for creating, manipulating, and reading\n * common office document formats: Excel (.xlsx), PowerPoint (.pptx), and Word (.docx).\n * It leverages popular libraries like ExcelJS, PptxGenJS, docx, and Mammoth.\n *\n * Key Features:\n * - **Excel**: Generate Excel files from table data, with support for styling and auto-filtering.\n * - **PowerPoint**: Create presentations, add slides with text and images, add charts, and save/read PPTX files.\n * - **Word**: Generate .docx documents, add paragraphs and tables with styling, save documents, and extract text content.\n *\n * All operations are designed to be asynchronous where appropriate and use DaitanJS\n * custom error types for consistent error handling. Logging is provided via `@daitanjs/development`.\n */\n\nimport { getLogger } from '@daitanjs/development';\n\nconst officeIndexLogger = getLogger('daitan-office-index');\n\nofficeIndexLogger.debug('Exporting DaitanJS Office module functionalities...');\n\n// --- Excel Utilities ---\nexport { downloadTableAsExcel } from './excel.js';\n\n// --- PowerPoint Utilities ---\nexport {\n  createPresentation,\n  addSlide,\n  addImageToSlide,\n  addChartToSlide,\n  savePresentation,\n  readPresentation,\n} from './powerpoint.js';\n\n// --- Word Document Utilities ---\nexport {\n  createWordDocument,\n  addWordParagraph,\n  addWordTable,\n  saveWordDocument,\n  readWordDocument,\n} from './word.js';\n\nofficeIndexLogger.info('DaitanJS Office module exports ready.');\n", "// office/src/excel.js\n/**\n * @file Excel (XLSX) document generation and manipulation utilities using ExcelJS.\n * @module @daitanjs/office/excel\n */\nimport ExcelJS from 'exceljs';\nimport { getLogger } from '@daitanjs/development';\nimport {\n  DaitanInvalidInputError,\n  DaitanFileOperationError,\n  DaitanBrowserSpecificError,\n  DaitanOperationError, // For general operational errors\n} from '@daitanjs/error';\nimport { Buffer } from 'buffer'; // Node.js Buffer, ensure available in environment for Node.js use cases\n\nconst logger = getLogger('daitan-office-excel');\n\n/**\n * @typedef {Object} ExcelCellStyling\n * @property {Partial<ExcelJS.Font>} [font] - Font styling (e.g., { bold: true, color: { argb: 'FFFF0000' }, size: 12 }).\n * @property {Partial<ExcelJS.Fill>} [fill] - Cell fill styling (e.g., { type: 'pattern', pattern:'solid', fgColor:{argb:'FFC0C0C0'} }).\n * @property {Partial<ExcelJS.Alignment>} [alignment] - Text alignment (e.g., { vertical: 'middle', horizontal: 'center', wrapText: true }).\n * @property {Partial<ExcelJS.Borders>} [border] - Cell borders (e.g., { top: {style:'thin'}, left: {style:'thin'}, ... }).\n * @property {string} [numFmt] - Number format string (e.g., '0.00%', '$#,##0.00', 'dd/mm/yyyy').\n */\n\n/**\n * @typedef {Object} ColumnDefinition\n * @property {string} header - The display text for the column header.\n * @property {string} key - The key in the data objects corresponding to this column.\n * @property {number} [width] - Optional width for the column.\n * @property {ExcelCellStyling} [headerStyle] - Optional specific style for this header cell.\n * @property {ExcelCellStyling} [cellStyle] - Optional default style for data cells in this column.\n * @property {(value: any, rowData: object) => any} [transform] - Optional function to transform cell value before adding.\n */\n\n/**\n * Converts a table of data (array of objects) to an Excel file (XLSX format).\n * Returns a buffer in Node.js or triggers a download in the browser.\n *\n * @public\n * @async\n * @param {object} params - Parameters for Excel generation.\n * @param {Array<object>} params.data - Array of objects representing table rows.\n * @param {string} [params.filename='data-export.xlsx'] - Desired name for the downloaded file (browser) or output file (Node.js, if `outputPath` is also set).\n * @param {string} [params.sheetName='Sheet1'] - Name of the worksheet.\n * @param {Array<ColumnDefinition | string>} [params.columns] - Optional: Array of column definitions or string keys.\n *        If not provided, columns are inferred from the keys of the first data object.\n *        If strings, they are used as both header text and data keys.\n * @param {boolean} [params.autoFilter=false] - Apply autofilter to the header row.\n * @param {ExcelCellStyling} [params.defaultHeaderStyle] - Default style for all header cells.\n * @param {ExcelCellStyling} [params.defaultCellStyle] - Default style for all data cells.\n * @param {Function} [params.rowStyler] - Optional function `(rowData, rowIndex) => ExcelCellStyling` to dynamically style entire rows.\n * @returns {Promise<{success: boolean, message: string, buffer?: ArrayBuffer, blob?: Blob}>}\n *          Result object. In Node.js, `buffer` contains the ArrayBuffer.\n *          In browser, `blob` is populated, and download is triggered.\n * @throws {DaitanInvalidInputError} If `data` is empty or invalid.\n * @throws {DaitanOperationError} For general Excel generation errors.\n * @throws {DaitanBrowserSpecificError} If browser-only operations are attempted in Node.js (related to direct download).\n */\nexport const downloadTableAsExcel = async ({\n  data, // Renamed from 'table' for clarity\n  filename = 'data-export.xlsx', // More descriptive default filename\n  sheetName = 'Sheet1',\n  columns, // Enhanced column definition\n  autoFilter = false,\n  defaultHeaderStyle = { font: { bold: true } }, // Sensible default for headers\n  defaultCellStyle = {},\n  rowStyler, // (rowData, rowIndex) => ExcelCellStyling for the row's cells\n}) => {\n  const callId = `excelGen-${Date.now().toString(36)}`;\n  logger.info(\n    `[${callId}] downloadTableAsExcel: Initiated for filename \"${filename}\".`,\n    { numRows: data?.length, sheetName }\n  );\n\n  if (!Array.isArray(data) || data.length === 0) {\n    const errMsg = 'Input `data` must be a non-empty array of objects.';\n    logger.error(`[${callId}] ${errMsg}`);\n    throw new DaitanInvalidInputError(errMsg, {\n      inputType: typeof data,\n      length: data?.length,\n    });\n  }\n  if (!data.every((item) => typeof item === 'object' && item !== null)) {\n    const errMsg = 'All items in the `data` array must be objects.';\n    logger.error(`[${callId}] ${errMsg}`);\n    throw new DaitanInvalidInputError(errMsg, {\n      firstItemType: typeof data[0],\n    });\n  }\n\n  try {\n    const workbook = new ExcelJS.Workbook();\n    workbook.creator = 'DaitanJS Office Module';\n    workbook.lastModifiedBy = 'DaitanJS Office Module';\n    workbook.created = new Date();\n    workbook.modified = new Date();\n\n    const worksheet = workbook.addWorksheet(sheetName);\n\n    // Determine and set columns\n    let columnDefs;\n    if (Array.isArray(columns) && columns.length > 0) {\n      columnDefs = columns.map((col) =>\n        typeof col === 'string' ? { header: col, key: col } : col\n      );\n    } else {\n      // Infer from first data object\n      const firstItemKeys = Object.keys(data[0]);\n      columnDefs = firstItemKeys.map((key) => ({ header: key, key: key }));\n    }\n    worksheet.columns = columnDefs.map((cd) => ({\n      header: cd.header,\n      key: cd.key,\n      width: cd.width || (cd.header.length > 15 ? cd.header.length * 1.2 : 15), // Auto-width based on header\n      style: cd.headerStyle\n        ? { ...defaultHeaderStyle, ...cd.headerStyle }\n        : defaultHeaderStyle, // For header cell style\n    }));\n\n    // Style header row (ExcelJS applies header style from column defs)\n    const headerRow = worksheet.getRow(1);\n    headerRow.font = defaultHeaderStyle.font || { bold: true }; // Apply default bold if not overridden\n    if (defaultHeaderStyle.fill) headerRow.fill = defaultHeaderStyle.fill;\n    if (defaultHeaderStyle.alignment)\n      headerRow.alignment = defaultHeaderStyle.alignment;\n    // Individual column header styles are applied via worksheet.columns.style\n\n    if (autoFilter && columnDefs.length > 0) {\n      worksheet.autoFilter = {\n        from: { row: 1, column: 1 },\n        to: { row: 1, column: columnDefs.length },\n      };\n    }\n\n    // Add data rows and apply styles\n    data.forEach((rowData, rowIndex) => {\n      const row = {};\n      columnDefs.forEach((cd) => {\n        const rawValue = rowData[cd.key];\n        row[cd.key] = cd.transform\n          ? cd.transform(rawValue, rowData)\n          : rawValue ?? '';\n      });\n      const addedRow = worksheet.addRow(row);\n\n      // Apply default cell styles and column-specific cell styles\n      addedRow.eachCell((cell, colNumber) => {\n        const colDefForCell = columnDefs[colNumber - 1]; // colNumber is 1-based\n        const cellSpecificStyle = colDefForCell?.cellStyle || {};\n        cell.style = { ...defaultCellStyle, ...cellSpecificStyle };\n      });\n\n      // Apply dynamic row styler if provided\n      if (typeof rowStyler === 'function') {\n        const dynamicRowStyle = rowStyler(rowData, rowIndex);\n        if (dynamicRowStyle && typeof dynamicRowStyle === 'object') {\n          addedRow.eachCell((cell) => {\n            cell.style = { ...cell.style, ...dynamicRowStyle };\n          });\n        }\n      }\n    });\n\n    logger.debug(\n      `[${callId}] Excel worksheet populated with ${data.length} data rows and ${columnDefs.length} columns.`\n    );\n\n    const buffer = await workbook.xlsx.writeBuffer(); // Returns ArrayBuffer\n    logger.info(\n      `[${callId}] Excel file buffer generated. Size: ${buffer.byteLength} bytes.`\n    );\n\n    if (\n      typeof window !== 'undefined' &&\n      typeof Blob !== 'undefined' &&\n      document?.createElement\n    ) {\n      const blob = new Blob([buffer], {\n        type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n      });\n      const link = document.createElement('a');\n      link.href = URL.createObjectURL(blob);\n      link.download = filename.endsWith('.xlsx')\n        ? filename\n        : `${filename}.xlsx`;\n      document.body.appendChild(link);\n      link.click();\n      document.body.removeChild(link);\n      URL.revokeObjectURL(link.href);\n      logger.info(\n        `[${callId}] Excel download triggered in browser for \"${link.download}\".`\n      );\n      return {\n        success: true,\n        message: 'File download initiated in browser.',\n        buffer,\n        blob,\n      };\n    } else {\n      logger.info(\n        `[${callId}] Running in Node.js or non-browser environment. Returning buffer.`\n      );\n      return {\n        success: true,\n        message: 'Excel buffer generated (Node.js).',\n        buffer,\n      };\n    }\n  } catch (error) {\n    logger.error(\n      `[${callId}] Error generating Excel file \"${filename}\": ${error.message}`,\n      { errorName: error.name, stackPreview: error.stack?.substring(0, 200) }\n    );\n    if (error instanceof DaitanInvalidInputError) throw error;\n    if (\n      typeof window === 'undefined' &&\n      (error.message.includes('document is not defined') ||\n        error.message.includes('Blob is not defined'))\n    ) {\n      throw new DaitanBrowserSpecificError(\n        `Excel generation/download failed: Browser-specific operation used in Node.js. Error: ${error.message}`,\n        {},\n        error\n      );\n    }\n    throw new DaitanOperationError(\n      `Failed to generate Excel file \"${filename}\": ${error.message}`,\n      { filename, operation: 'generateExcel' },\n      error\n    );\n  }\n};\n", "// office/src/powerpoint.js\n/**\n * @file PowerPoint (PPTX) document generation and manipulation utilities using PptxGenJS and pptx-parser.\n * @module @daitanjs/office/powerpoint\n */\nimport fs from 'fs/promises';\nimport path from 'path';\nimport PptxGenJS from 'pptxgenjs';\nimport PptxParser from 'pptx-parser';\nimport { getLogger } from '@daitanjs/development';\nimport {\n  DaitanInvalidInputError,\n  DaitanFileOperationError,\n  DaitanOperationError,\n  DaitanBrowserSpecificError,\n  DaitanConfigurationError,\n} from '@daitanjs/error';\nimport { Buffer } from 'buffer';\n\nconst logger = getLogger('daitan-office-powerpoint');\n\n/**\n * Creates a new PowerPoint presentation instance.\n * @public\n * @returns {PptxGenJS} A new PptxGenJS presentation instance.\n */\nexport function createPresentation() {\n  logger.debug('Creating new PptxGenJS presentation instance.');\n  const pres = new PptxGenJS();\n  pres.author = 'DaitanJS Office Module';\n  pres.company = 'DaitanJS';\n  pres.layout = 'LAYOUT_16X9';\n  return pres;\n}\n\n/**\n * Adds a new slide to the presentation.\n * @public\n * @param {PptxGenJS} pres\n * @param {object} [options={}]\n * @returns {PptxGenJS.Slide} The newly created slide object.\n */\nexport function addSlide(pres, options = {}) {\n  if (!pres || typeof pres.addSlide !== 'function') {\n    throw new DaitanInvalidInputError(\n      'Invalid PptxGenJS presentation instance provided to addSlide.'\n    );\n  }\n  const {\n    masterName,\n    title,\n    mainContent,\n    titleOptions = {},\n    contentOptions = {},\n    slideLayoutOptions = {},\n  } = options;\n  logger.debug('Adding new slide.', {\n    masterName,\n    titlePreview: String(title).substring(0, 30),\n  });\n\n  const slide = pres.addSlide({ masterName, ...slideLayoutOptions });\n  if (title) {\n    slide.addText(title, {\n      placeholder: 'title',\n      x: 0.5,\n      y: 0.25,\n      fontSize: 32,\n      bold: true,\n      w: '90%',\n      h: 1.0,\n      ...titleOptions,\n    });\n  }\n  if (mainContent) {\n    slide.addText(mainContent, {\n      placeholder: 'body',\n      x: 0.5,\n      y: 1.5,\n      fontSize: 18,\n      w: '90%',\n      h: '75%',\n      ...contentOptions,\n    });\n  }\n  return slide;\n}\n\n/**\n * Adds an image to a slide.\n * @public\n * @param {PptxGenJS.Slide} slide\n * @param {string} imageSource - Path (Node.js) or base64 data URL.\n * @param {PptxGenJS.ImageProps} [options={}]\n */\nexport function addImageToSlide(slide, imageSource, options = {}) {\n  if (!slide || typeof slide.addImage !== 'function') {\n    throw new DaitanInvalidInputError(\n      'Invalid PptxGenJS slide object provided to addImageToSlide.'\n    );\n  }\n  if (!imageSource || typeof imageSource !== 'string' || !imageSource.trim()) {\n    throw new DaitanInvalidInputError(\n      'Image source (path or data URL) must be a non-empty string.'\n    );\n  }\n\n  const imageOpts = { x: 1.0, y: 1.0, w: '50%', h: '50%', ...options };\n  if (imageSource.startsWith('data:image')) {\n    imageOpts.data = imageSource;\n  } else {\n    if (typeof window !== 'undefined') {\n      throw new DaitanConfigurationError(\n        'Local image file paths are not supported in browser for addImageToSlide. Use data URL.'\n      );\n    }\n    imageOpts.path = imageSource;\n  }\n  slide.addImage(imageOpts);\n}\n\n/**\n * Adds a chart to a slide.\n * @public\n * @param {PptxGenJS.Slide} slide\n * @param {PptxGenJS.CHART_NAME | PptxGenJS.ChartType} type\n * @param {Array<PptxGenJS.ChartData>} data\n * @param {PptxGenJS.OptsChartData} [options={}]\n */\nexport function addChartToSlide(slide, type, data, options = {}) {\n  if (!slide || typeof slide.addChart !== 'function') {\n    throw new DaitanInvalidInputError(\n      'Invalid PptxGenJS slide object provided to addChartToSlide.'\n    );\n  }\n  if (!type || typeof type !== 'string') {\n    throw new DaitanInvalidInputError(\n      'Chart type must be a valid PptxGenJS chart type string.'\n    );\n  }\n  if (!Array.isArray(data)) {\n    throw new DaitanInvalidInputError(\n      'Chart data must be an array of series objects.'\n    );\n  }\n  const chartOpts = { x: 0.5, y: 2.0, w: '90%', h: '70%', ...options };\n  slide.addChart(type, data, chartOpts);\n}\n\n/**\n * Saves the presentation to a file or triggers a download.\n * @public\n * @async\n * @param {PptxGenJS} pres\n * @param {string} [filename] - If provided, saves to this file path in Node.js or uses it as the download name in browser.\n * @returns {Promise<{success: boolean, message: string, buffer?: ArrayBuffer }>}\n */\nexport async function savePresentation(pres, filename) {\n  if (!pres || typeof pres.writeFile !== 'function') {\n    throw new DaitanInvalidInputError(\n      'Invalid PptxGenJS presentation instance provided to savePresentation.'\n    );\n  }\n  const finalFilename = filename\n    ? filename.endsWith('.pptx')\n      ? filename\n      : `${filename}.pptx`\n    : null;\n\n  try {\n    if (typeof window !== 'undefined' && typeof Blob !== 'undefined') {\n      if (!finalFilename)\n        throw new DaitanConfigurationError(\n          'Filename is required for browser download.'\n        );\n      await pres.writeFile({ fileName: finalFilename });\n      return {\n        success: true,\n        message: `Download of \"${finalFilename}\" initiated.`,\n      };\n    } else {\n      if (finalFilename) {\n        const outputDir = path.dirname(path.resolve(finalFilename));\n        await fs.mkdir(outputDir, { recursive: true });\n      }\n      const buffer = await pres.write({ outputType: 'arraybuffer' });\n      if (finalFilename) await fs.writeFile(finalFilename, Buffer.from(buffer));\n      return {\n        success: true,\n        message: finalFilename\n          ? `File \"${finalFilename}\" saved.`\n          : 'Buffer generated.',\n        buffer,\n      };\n    }\n  } catch (error) {\n    throw new DaitanFileOperationError(\n      `Failed to save PowerPoint file \"${finalFilename || ''}\": ${\n        error.message\n      }`,\n      { path: finalFilename },\n      error\n    );\n  }\n}\n\n/**\n * Reads a PowerPoint presentation and extracts text content.\n * @public\n * @async\n * @param {string | Buffer | ArrayBuffer} fileSource\n * @returns {Promise<Array<{ slideNumber: number, title?: string, content: string }>>}\n */\nexport async function readPresentation(fileSource) {\n  if (!fileSource) {\n    throw new DaitanInvalidInputError(\n      'File source is required for readPresentation.'\n    );\n  }\n  let bufferToParse;\n  if (typeof fileSource === 'string') {\n    if (typeof window !== 'undefined') {\n      throw new DaitanConfigurationError(\n        'Reading local PPTX paths is not supported in browser.'\n      );\n    }\n    bufferToParse = await fs.readFile(fileSource);\n  } else if (\n    fileSource instanceof Buffer ||\n    fileSource instanceof ArrayBuffer\n  ) {\n    bufferToParse = fileSource;\n  } else {\n    throw new DaitanInvalidInputError('Invalid fileSource type.');\n  }\n\n  try {\n    const presentationData = await PptxParser.parse(bufferToParse);\n    if (!presentationData?.slides) {\n      throw new DaitanOperationError(\n        'Failed to parse PPTX: Invalid structure returned.'\n      );\n    }\n    return presentationData.slides.map((slide, index) => {\n      const slideTitle =\n        typeof slide.title === 'string' ? slide.title.trim() : undefined;\n      let slideContentText = '';\n      if (Array.isArray(slide.content)) {\n        slideContentText = slide.content\n          .map((item) =>\n            typeof item?.text === 'string'\n              ? item.text\n              : typeof item === 'string'\n              ? item\n              : ''\n          )\n          .join('\\n')\n          .trim();\n      } else if (typeof slide.content === 'string') {\n        slideContentText = slide.content.trim();\n      }\n      return {\n        slideNumber: index + 1,\n        title: slideTitle,\n        content: slideContentText,\n      };\n    });\n  } catch (error) {\n    throw new DaitanOperationError(\n      `Error parsing PowerPoint presentation: ${error.message}`,\n      {},\n      error\n    );\n  }\n}\n", "// office/src/word.js\n/**\n * @file Word (.docx) document generation and manipulation utilities using the `docx` library.\n * @module @daitanjs/office/word\n */\nimport fs from 'fs/promises';\nimport path from 'path';\nimport {\n  Document,\n  Paragraph,\n  TextRun,\n  Table,\n  TableRow,\n  TableCell,\n  HeadingLevel,\n  Packer,\n  AlignmentType,\n  WidthType,\n  BorderStyle,\n  VerticalAlign,\n} from 'docx';\nimport mammoth from 'mammoth';\nimport { getLogger } from '@daitanjs/development';\nimport {\n  DaitanInvalidInputError,\n  DaitanFileOperationError,\n  DaitanOperationError,\n  DaitanBrowserSpecificError,\n  DaitanConfigurationError,\n} from '@daitanjs/error';\nimport { Buffer } from 'buffer';\n\nconst logger = getLogger('daitan-office-word');\n\n/**\n * Creates a new Word document (.docx) instance.\n * @public\n * @param {object} [options={}]\n * @returns {Document} A new `docx` Document object.\n */\nexport function createWordDocument(options = {}) {\n  const {\n    title,\n    creator = 'DaitanJS Office Module',\n    description = 'Document created with @daitanjs/office',\n    addDefaultStyles = true,\n    sections = [],\n    ...docOptions\n  } = options;\n  const initialSections = [...sections];\n  if (title) {\n    const titleParagraph = new Paragraph({\n      text: title,\n      heading: HeadingLevel.TITLE,\n      alignment: AlignmentType.CENTER,\n    });\n    if (initialSections.length > 0) {\n      initialSections[0].children = [\n        titleParagraph,\n        ...(initialSections[0].children || []),\n      ];\n    } else {\n      initialSections.push({ properties: {}, children: [titleParagraph] });\n    }\n  }\n\n  return new Document({\n    creator,\n    description,\n    title: title || 'Untitled DaitanJS Document',\n    sections: initialSections,\n    ...(addDefaultStyles && {\n      styles: {\n        default: {\n          document: {\n            run: { size: '11pt', font: 'Calibri' },\n            paragraph: { spacing: { after: 120 } },\n          },\n          heading1: {\n            run: { size: '16pt', bold: true },\n            paragraph: { spacing: { before: 240, after: 120 } },\n          },\n        },\n      },\n    }),\n    ...docOptions,\n  });\n}\n\n/**\n * Adds a paragraph to the last section of the document.\n * @public\n * @param {Document} doc\n * @param {string | TextRun | Array<string | TextRun>} content\n * @param {object} [options={}]\n */\nexport function addWordParagraph(doc, content, options = {}) {\n  if (!doc || typeof doc.addSection !== 'function') {\n    throw new DaitanInvalidInputError(\n      'Invalid Document object provided to addWordParagraph.'\n    );\n  }\n  const { bold, color, size, font, italics, ...paraOpts } = options;\n  const textRuns = (Array.isArray(content) ? content : [content]).map((item) =>\n    item instanceof TextRun\n      ? item\n      : new TextRun({\n          text: String(item ?? ''),\n          bold,\n          color,\n          size,\n          font,\n          italics,\n        })\n  );\n  const paragraph = new Paragraph({ children: textRuns, ...paraOpts });\n  if (doc.Sections.length > 0) {\n    doc.Sections[doc.Sections.length - 1].addParagraph(paragraph);\n  } else {\n    doc.addSection({ children: [paragraph] });\n  }\n}\n\n/**\n * Adds a table to the last section of the document.\n * @public\n * @param {Document} doc\n * @param {object} params\n */\nexport function addWordTable(\n  doc,\n  {\n    rowsData,\n    headersData,\n    tableOptions = { width: { size: 100, type: WidthType.PERCENTAGE } },\n    ...stylingOptions\n  }\n) {\n  if (!doc || typeof doc.addSection !== 'function') {\n    throw new DaitanInvalidInputError(\n      'Invalid Document object provided to addWordTable.'\n    );\n  }\n  if (!Array.isArray(rowsData)) {\n    throw new DaitanInvalidInputError(\n      'Table `rowsData` must be an array of arrays.'\n    );\n  }\n\n  const createCell = (content, defaultOptions) =>\n    new TableCell({\n      ...defaultOptions,\n      children: [new Paragraph(String(content ?? ''))],\n    });\n  const tableRows = [];\n  if (headersData) {\n    tableRows.push(\n      new TableRow({\n        tableHeader: true,\n        children: headersData.map((h) =>\n          createCell(h, stylingOptions.headerCellOptions)\n        ),\n      })\n    );\n  }\n  rowsData.forEach((rowData) => {\n    tableRows.push(\n      new TableRow({\n        children: rowData.map((c) =>\n          createCell(c, stylingOptions.dataCellOptions)\n        ),\n      })\n    );\n  });\n\n  if (tableRows.length === 0) return;\n\n  const table = new Table({ ...tableOptions, rows: tableRows });\n  if (doc.Sections.length > 0) {\n    doc.Sections[doc.Sections.length - 1].addTable(table);\n  } else {\n    doc.addSection({ children: [table] });\n  }\n}\n\n/**\n * Saves the `docx` Document object to a file or returns a buffer.\n * @public\n * @async\n * @param {Document} doc\n * @param {string} [filename]\n * @returns {Promise<Buffer | void>}\n */\nexport async function saveWordDocument(doc, filename) {\n  if (!doc || typeof doc.addSection !== 'function') {\n    throw new DaitanInvalidInputError(\n      'Invalid Document object provided to saveWordDocument.'\n    );\n  }\n  const finalFilename = filename\n    ? filename.endsWith('.docx')\n      ? filename\n      : `${filename}.docx`\n    : null;\n\n  try {\n    if (typeof window !== 'undefined' && typeof Blob !== 'undefined') {\n      if (!finalFilename)\n        throw new DaitanConfigurationError(\n          'Filename is required for browser download.'\n        );\n      const blob = await Packer.toBlob(doc);\n      const link = document.createElement('a');\n      link.href = URL.createObjectURL(blob);\n      link.download = finalFilename;\n      document.body.appendChild(link);\n      link.click();\n      document.body.removeChild(link);\n      URL.revokeObjectURL(link.href);\n    } else {\n      const buffer = await Packer.toBuffer(doc);\n      if (finalFilename) {\n        await fs.mkdir(path.dirname(finalFilename), { recursive: true });\n        await fs.writeFile(finalFilename, buffer);\n      } else {\n        return buffer;\n      }\n    }\n  } catch (error) {\n    throw new DaitanFileOperationError(\n      `Error saving Word document \"${finalFilename || ''}\": ${error.message}`,\n      { path: finalFilename },\n      error\n    );\n  }\n}\n\n/**\n * Reads a Word document (.docx) and extracts its text content.\n * @public\n * @async\n * @param {string | Buffer | ArrayBuffer} fileSource\n * @returns {Promise<string>}\n */\nexport async function readWordDocument(fileSource) {\n  if (!fileSource) {\n    throw new DaitanInvalidInputError(\n      'File source is required for readWordDocument.'\n    );\n  }\n  let mammothInputOptions = {};\n  if (typeof fileSource === 'string') {\n    if (typeof window !== 'undefined')\n      throw new DaitanConfigurationError(\n        'Reading local DOCX paths not supported in browser.'\n      );\n    mammothInputOptions.path = fileSource;\n  } else if (\n    fileSource instanceof Buffer ||\n    fileSource instanceof ArrayBuffer\n  ) {\n    mammothInputOptions.buffer = fileSource;\n  } else {\n    throw new DaitanInvalidInputError(\n      'Invalid fileSource type for readWordDocument.'\n    );\n  }\n\n  try {\n    const result = await mammoth.extractRawText(mammothInputOptions);\n    return result.value || '';\n  } catch (error) {\n    throw new DaitanFileOperationError(\n      `Error reading/parsing Word document: ${error.message}`,\n      { path: mammothInputOptions.path },\n      error\n    );\n  }\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBA,IAAAA,sBAA0B;;;ACd1B,qBAAoB;AACpB,yBAA0B;AAC1B,mBAKO;AAGP,IAAM,aAAS,8BAAU,qBAAqB;AA6CvC,IAAM,uBAAuB,OAAO;AAAA,EACzC;AAAA;AAAA,EACA,WAAW;AAAA;AAAA,EACX,YAAY;AAAA,EACZ;AAAA;AAAA,EACA,aAAa;AAAA,EACb,qBAAqB,EAAE,MAAM,EAAE,MAAM,KAAK,EAAE;AAAA;AAAA,EAC5C,mBAAmB,CAAC;AAAA,EACpB;AAAA;AACF,MAAM;AACJ,QAAM,SAAS,YAAY,KAAK,IAAI,EAAE,SAAS,EAAE,CAAC;AAClD,SAAO;AAAA,IACL,IAAI,MAAM,mDAAmD,QAAQ;AAAA,IACrE,EAAE,SAAS,MAAM,QAAQ,UA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AA,MACrE,EAAE,MAAM,cAAc;AAAA,MACtB;AAAA,IACF;AAAA,EACF;AACF;AASA,eAAsB,iBAAiB,YAAY;AACjD,MAAI,CAAC,YAAY;AACf,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,MAAI,sBAAsB,CAAC;AAC3B,MAAI,OAAO,eAAe,UAAU;AAClC,QAAI,OAAO,WAAW;AACpB,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AACF,wBAAoB,OAAO;AAAA,EAC7B,WACE,sBAAsB,yBACtB,sBAAsB,aACtB;AACA,wBAAoB,SAAS;AAAA,EAC/B,OAAO;AACL,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,MAAI;AACF,UAAM,SAAS,MAAM,eAAAE,QAAQ,eAAe,mBAAmB;AAC/D,WAAO,OAAO,SAAS;AAAA,EACzB,SAAS,OAAO;AACd,UAAM,IAAI;AAAA,MACR,wCAAwC,MAAM,OAAO;AAAA,MACrD,EAAE,MAAM,oBAAoB,KAAK;AAAA,MACjC;AAAA,IACF;AAAA,EACF;AACF;;;AHjQA,IAAM,wBAAoB,+BAAU,qBAAqB;AAEzD,kBAAkB,MAAM,qDAAqD;AAwB7E,kBAAkB,KAAK,uCAAuC;",
  "names": ["import_development", "ExcelJS", "import_development", "import_error", "logger", "PptxGenJS", "path", "fs", "PptxParser", "import_promises", "import_path", "import_development", "import_error", "import_buffer", "logger", "fs", "path", "mammoth"]
}
