{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { ownerDocument } from '@mui/material/utils';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { gridVisibleRowCountSelector } from '../filter/gridFilterSelector';\nimport { gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector } from '../columns/gridColumnsSelector';\nimport { gridDensityTotalHeaderHeightSelector } from '../density/densitySelector';\nimport { gridClasses } from '../../../constants/gridClasses';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';\nimport { getColumnsToExport } from './utils';\nimport { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';\nimport { GridPrintExportMenuItem } from '../../../components/toolbar/GridToolbarExport';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction raf() {\n return new Promise(resolve => {\n requestAnimationFrame(() => {\n resolve();\n });\n });\n}\nfunction getChromeVersion() {\n const raw = navigator.userAgent.match(/Chrom(e|ium)\\/([0-9]+)\\./);\n return raw ? parseInt(raw[2], 10) : null;\n}\n\n/**\n * @requires useGridColumns (state)\n * @requires useGridFilter (state)\n * @requires useGridSorting (state)\n * @requires useGridParamsApi (method)\n */\nexport const useGridPrintExport = (apiRef, props) => {\n const logger = useGridLogger(apiRef, 'useGridPrintExport');\n const doc = React.useRef(null);\n const previousGridState = React.useRef(null);\n const previousColumnVisibility = React.useRef({});\n React.useEffect(() => {\n doc.current = ownerDocument(apiRef.current.rootElementRef.current);\n }, [apiRef]); // Returns a promise because updateColumns triggers state update and\n // the new state needs to be in place before the grid can be sized correctly\n\n const updateGridColumnsForPrint = React.useCallback((fields, allColumns) => new Promise(resolve => {\n // TODO remove unused Promise\n if (!fields && !allColumns) {\n resolve();\n return;\n }\n const exportedColumnFields = getColumnsToExport({\n apiRef,\n options: {\n fields,\n allColumns\n }\n }).map(column => column.field);\n const columns = gridColumnDefinitionsSelector(apiRef);\n const newColumnVisibilityModel = {};\n columns.forEach(column => {\n newColumnVisibilityModel[column.field] = exportedColumnFields.includes(column.field);\n });\n apiRef.current.setColumnVisibilityModel(newColumnVisibilityModel);\n resolve();\n }), [apiRef]); // TODO move outside of this scope and remove React.useCallback\n\n const buildPrintWindow = React.useCallback(title => {\n const iframeEl = document.createElement('iframe');\n iframeEl.style.position = 'absolute';\n iframeEl.style.width = '0px';\n iframeEl.style.height = '0px';\n iframeEl.title = title || document.title;\n return iframeEl;\n }, []);\n const handlePrintWindowLoad = React.useCallback((printWindow, options) => {\n var _querySelector, _querySelector2;\n const normalizeOptions = _extends({\n copyStyles: true,\n hideToolbar: false,\n hideFooter: false\n }, options);\n const printDoc = printWindow.contentDocument;\n if (!printDoc) {\n return;\n }\n const totalHeaderHeight = gridDensityTotalHeaderHeightSelector(apiRef);\n const rowsMeta = gridRowsMetaSelector(apiRef.current.state);\n const gridRootElement = apiRef.current.rootElementRef.current;\n const gridClone = gridRootElement.cloneNode(true);\n const gridCloneViewport = gridClone.querySelector(`.${gridClasses.virtualScroller}`); // Expand the viewport window to prevent clipping\n\n gridCloneViewport.style.height = 'auto';\n gridCloneViewport.style.width = 'auto';\n gridCloneViewport.parentElement.style.width = 'auto';\n gridCloneViewport.parentElement.style.height = 'auto'; // Allow to overflow to not hide the border of the last row\n\n const gridMain = gridClone.querySelector(`.${gridClasses.main}`);\n gridMain.style.overflow = 'visible';\n const chromeVersion = getChromeVersion();\n if (chromeVersion && chromeVersion >= 108) {\n // See https://support.google.com/chrome/thread/191619088?hl=en&msgid=193009642\n gridClone.style.contain = 'size';\n }\n const columnHeaders = gridClone.querySelector(`.${gridClasses.columnHeaders}`);\n const columnHeadersInner = columnHeaders.querySelector(`.${gridClasses.columnHeadersInner}`);\n columnHeadersInner.style.width = '100%';\n let gridToolbarElementHeight = ((_querySelector = gridRootElement.querySelector(`.${gridClasses.toolbarContainer}`)) == null ? void 0 : _querySelector.clientHeight) || 0;\n let gridFooterElementHeight = ((_querySelector2 = gridRootElement.querySelector(`.${gridClasses.footerContainer}`)) == null ? void 0 : _querySelector2.clientHeight) || 0;\n if (normalizeOptions.hideToolbar) {\n var _gridClone$querySelec;\n (_gridClone$querySelec = gridClone.querySelector(`.${gridClasses.toolbarContainer}`)) == null ? void 0 : _gridClone$querySelec.remove();\n gridToolbarElementHeight = 0;\n }\n if (normalizeOptions.hideFooter) {\n var _gridClone$querySelec2;\n (_gridClone$querySelec2 = gridClone.querySelector(`.${gridClasses.footerContainer}`)) == null ? void 0 : _gridClone$querySelec2.remove();\n gridFooterElementHeight = 0;\n } // Expand container height to accommodate all rows\n\n gridClone.style.height = `${rowsMeta.currentPageTotalHeight + totalHeaderHeight + gridToolbarElementHeight + gridFooterElementHeight}px`; // printDoc.body.appendChild(gridClone); should be enough but a clone isolation bug in Safari\n // prevents us to do it\n\n const container = document.createElement('div');\n container.appendChild(gridClone);\n printDoc.body.innerHTML = container.innerHTML;\n const defaultPageStyle = typeof normalizeOptions.pageStyle === 'function' ? normalizeOptions.pageStyle() : normalizeOptions.pageStyle;\n if (typeof defaultPageStyle === 'string') {\n // TODO custom styles should always win\n const styleElement = printDoc.createElement('style');\n styleElement.appendChild(printDoc.createTextNode(defaultPageStyle));\n printDoc.head.appendChild(styleElement);\n }\n if (normalizeOptions.bodyClassName) {\n printDoc.body.classList.add(...normalizeOptions.bodyClassName.split(' '));\n }\n if (normalizeOptions.copyStyles) {\n const headStyleElements = doc.current.querySelectorAll(\"style, link[rel='stylesheet']\");\n for (let i = 0; i < headStyleElements.length; i += 1) {\n const node = headStyleElements[i];\n if (node.tagName === 'STYLE') {\n const newHeadStyleElements = printDoc.createElement(node.tagName);\n const sheet = node.sheet;\n if (sheet) {\n let styleCSS = ''; // NOTE: for-of is not supported by IE\n\n for (let j = 0; j < sheet.cssRules.length; j += 1) {\n if (typeof sheet.cssRules[j].cssText === 'string') {\n styleCSS += `${sheet.cssRules[j].cssText}\\r\\n`;\n }\n }\n newHeadStyleElements.appendChild(printDoc.createTextNode(styleCSS));\n printDoc.head.appendChild(newHeadStyleElements);\n }\n } else if (node.getAttribute('href')) {\n // If `href` tag is empty, avoid loading these links\n const newHeadStyleElements = printDoc.createElement(node.tagName);\n for (let j = 0; j < node.attributes.length; j += 1) {\n const attr = node.attributes[j];\n if (attr) {\n newHeadStyleElements.setAttribute(attr.nodeName, attr.nodeValue || '');\n }\n }\n printDoc.head.appendChild(newHeadStyleElements);\n }\n }\n } // Trigger print\n\n if (process.env.NODE_ENV !== 'test') {\n printWindow.contentWindow.print();\n }\n }, [apiRef, doc]);\n const handlePrintWindowAfterPrint = React.useCallback(printWindow => {\n var _previousGridState$cu, _previousGridState$cu2;\n\n // Remove the print iframe\n doc.current.body.removeChild(printWindow); // Revert grid to previous state\n\n apiRef.current.restoreState(previousGridState.current || {});\n if (!((_previousGridState$cu = previousGridState.current) != null && (_previousGridState$cu2 = _previousGridState$cu.columns) != null && _previousGridState$cu2.columnVisibilityModel)) {\n // if the apiRef.current.exportState(); did not exported the column visibility, we update it\n apiRef.current.setColumnVisibilityModel(previousColumnVisibility.current);\n }\n apiRef.current.unstable_enableVirtualization(); // Clear local state\n\n previousGridState.current = null;\n previousColumnVisibility.current = {};\n }, [apiRef]);\n const exportDataAsPrint = React.useCallback(async options => {\n logger.debug(`Export data as Print`);\n if (!apiRef.current.rootElementRef.current) {\n throw new Error('MUI: No grid root element available.');\n }\n previousGridState.current = apiRef.current.exportState(); // It appends that the visibility model is not exported, especially if columnVisibility is not controlled\n\n previousColumnVisibility.current = gridColumnVisibilityModelSelector(apiRef);\n if (props.pagination) {\n const visibleRowCount = gridVisibleRowCountSelector(apiRef);\n apiRef.current.setPageSize(visibleRowCount);\n }\n await updateGridColumnsForPrint(options == null ? void 0 : options.fields, options == null ? void 0 : options.allColumns);\n apiRef.current.unstable_disableVirtualization();\n await raf(); // wait for the state changes to take action\n\n const printWindow = buildPrintWindow(options == null ? void 0 : options.fileName);\n if (process.env.NODE_ENV === 'test') {\n doc.current.body.appendChild(printWindow); // In test env, run the all pipeline without waiting for loading\n\n handlePrintWindowLoad(printWindow, options);\n handlePrintWindowAfterPrint(printWindow);\n } else {\n printWindow.onload = () => {\n handlePrintWindowLoad(printWindow, options);\n const mediaQueryList = printWindow.contentWindow.matchMedia('print');\n mediaQueryList.addEventListener('change', mql => {\n const isAfterPrint = mql.matches === false;\n if (isAfterPrint) {\n handlePrintWindowAfterPrint(printWindow);\n }\n });\n };\n doc.current.body.appendChild(printWindow);\n }\n }, [props, logger, apiRef, buildPrintWindow, handlePrintWindowLoad, handlePrintWindowAfterPrint, updateGridColumnsForPrint]);\n const printExportApi = {\n exportDataAsPrint\n };\n useGridApiMethod(apiRef, printExportApi, 'GridPrintExportApi');\n /**\n * PRE-PROCESSING\n */\n\n const addExportMenuButtons = React.useCallback((initialValue, options) => {\n var _options$printOptions;\n if ((_options$printOptions = options.printOptions) != null && _options$printOptions.disableToolbarButton) {\n return initialValue;\n }\n return [...initialValue, {\n component: /*#__PURE__*/_jsx(GridPrintExportMenuItem, {\n options: options.printOptions\n }),\n componentName: 'printExport'\n }];\n }, []);\n useGridRegisterPipeProcessor(apiRef, 'exportMenu', addExportMenuButtons);\n};","map":{"version":3,"names":["_extends","React","ownerDocument","useGridLogger","gridVisibleRowCountSelector","gridColumnDefinitionsSelector","gridColumnVisibilityModelSelector","gridDensityTotalHeaderHeightSelector","gridClasses","useGridApiMethod","gridRowsMetaSelector","getColumnsToExport","useGridRegisterPipeProcessor","GridPrintExportMenuItem","jsx","_jsx","raf","Promise","resolve","requestAnimationFrame","getChromeVersion","raw","navigator","userAgent","match","parseInt","useGridPrintExport","apiRef","props","logger","doc","useRef","previousGridState","previousColumnVisibility","useEffect","current","rootElementRef","updateGridColumnsForPrint","useCallback","fields","allColumns","exportedColumnFields","options","map","column","field","columns","newColumnVisibilityModel","forEach","includes","setColumnVisibilityModel","buildPrintWindow","title","iframeEl","document","createElement","style","position","width","height","handlePrintWindowLoad","printWindow","_querySelector","_querySelector2","normalizeOptions","copyStyles","hideToolbar","hideFooter","printDoc","contentDocument","totalHeaderHeight","rowsMeta","state","gridRootElement","gridClone","cloneNode","gridCloneViewport","querySelector","virtualScroller","parentElement","gridMain","main","overflow","chromeVersion","contain","columnHeaders","columnHeadersInner","gridToolbarElementHeight","toolbarContainer","clientHeight","gridFooterElementHeight","footerContainer","_gridClone$querySelec","remove","_gridClone$querySelec2","currentPageTotalHeight","container","appendChild","body","innerHTML","defaultPageStyle","pageStyle","styleElement","createTextNode","head","bodyClassName","classList","add","split","headStyleElements","querySelectorAll","i","length","node","tagName","newHeadStyleElements","sheet","styleCSS","j","cssRules","cssText","getAttribute","attributes","attr","setAttribute","nodeName","nodeValue","process","env","NODE_ENV","contentWindow","print","handlePrintWindowAfterPrint","_previousGridState$cu","_previousGridState$cu2","removeChild","restoreState","columnVisibilityModel","unstable_enableVirtualization","exportDataAsPrint","debug","Error","exportState","pagination","visibleRowCount","setPageSize","unstable_disableVirtualization","fileName","onload","mediaQueryList","matchMedia","addEventListener","mql","isAfterPrint","matches","printExportApi","addExportMenuButtons","initialValue","_options$printOptions","printOptions","disableToolbarButton","component","componentName"],"sources":["/home/gnx/Desktop/ETB/ETB-FrontEnd/node_modules/@mui/x-data-grid/hooks/features/export/useGridPrintExport.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { ownerDocument } from '@mui/material/utils';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { gridVisibleRowCountSelector } from '../filter/gridFilterSelector';\nimport { gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector } from '../columns/gridColumnsSelector';\nimport { gridDensityTotalHeaderHeightSelector } from '../density/densitySelector';\nimport { gridClasses } from '../../../constants/gridClasses';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';\nimport { getColumnsToExport } from './utils';\nimport { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';\nimport { GridPrintExportMenuItem } from '../../../components/toolbar/GridToolbarExport';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nfunction raf() {\n return new Promise(resolve => {\n requestAnimationFrame(() => {\n resolve();\n });\n });\n}\n\nfunction getChromeVersion() {\n const raw = navigator.userAgent.match(/Chrom(e|ium)\\/([0-9]+)\\./);\n return raw ? parseInt(raw[2], 10) : null;\n}\n\n/**\n * @requires useGridColumns (state)\n * @requires useGridFilter (state)\n * @requires useGridSorting (state)\n * @requires useGridParamsApi (method)\n */\nexport const useGridPrintExport = (apiRef, props) => {\n const logger = useGridLogger(apiRef, 'useGridPrintExport');\n const doc = React.useRef(null);\n const previousGridState = React.useRef(null);\n const previousColumnVisibility = React.useRef({});\n React.useEffect(() => {\n doc.current = ownerDocument(apiRef.current.rootElementRef.current);\n }, [apiRef]); // Returns a promise because updateColumns triggers state update and\n // the new state needs to be in place before the grid can be sized correctly\n\n const updateGridColumnsForPrint = React.useCallback((fields, allColumns) => new Promise(resolve => {\n // TODO remove unused Promise\n if (!fields && !allColumns) {\n resolve();\n return;\n }\n\n const exportedColumnFields = getColumnsToExport({\n apiRef,\n options: {\n fields,\n allColumns\n }\n }).map(column => column.field);\n const columns = gridColumnDefinitionsSelector(apiRef);\n const newColumnVisibilityModel = {};\n columns.forEach(column => {\n newColumnVisibilityModel[column.field] = exportedColumnFields.includes(column.field);\n });\n apiRef.current.setColumnVisibilityModel(newColumnVisibilityModel);\n resolve();\n }), [apiRef]); // TODO move outside of this scope and remove React.useCallback\n\n const buildPrintWindow = React.useCallback(title => {\n const iframeEl = document.createElement('iframe');\n iframeEl.style.position = 'absolute';\n iframeEl.style.width = '0px';\n iframeEl.style.height = '0px';\n iframeEl.title = title || document.title;\n return iframeEl;\n }, []);\n const handlePrintWindowLoad = React.useCallback((printWindow, options) => {\n var _querySelector, _querySelector2;\n\n const normalizeOptions = _extends({\n copyStyles: true,\n hideToolbar: false,\n hideFooter: false\n }, options);\n\n const printDoc = printWindow.contentDocument;\n\n if (!printDoc) {\n return;\n }\n\n const totalHeaderHeight = gridDensityTotalHeaderHeightSelector(apiRef);\n const rowsMeta = gridRowsMetaSelector(apiRef.current.state);\n const gridRootElement = apiRef.current.rootElementRef.current;\n const gridClone = gridRootElement.cloneNode(true);\n const gridCloneViewport = gridClone.querySelector(`.${gridClasses.virtualScroller}`); // Expand the viewport window to prevent clipping\n\n gridCloneViewport.style.height = 'auto';\n gridCloneViewport.style.width = 'auto';\n gridCloneViewport.parentElement.style.width = 'auto';\n gridCloneViewport.parentElement.style.height = 'auto'; // Allow to overflow to not hide the border of the last row\n\n const gridMain = gridClone.querySelector(`.${gridClasses.main}`);\n gridMain.style.overflow = 'visible';\n const chromeVersion = getChromeVersion();\n\n if (chromeVersion && chromeVersion >= 108) {\n // See https://support.google.com/chrome/thread/191619088?hl=en&msgid=193009642\n gridClone.style.contain = 'size';\n }\n\n const columnHeaders = gridClone.querySelector(`.${gridClasses.columnHeaders}`);\n const columnHeadersInner = columnHeaders.querySelector(`.${gridClasses.columnHeadersInner}`);\n columnHeadersInner.style.width = '100%';\n let gridToolbarElementHeight = ((_querySelector = gridRootElement.querySelector(`.${gridClasses.toolbarContainer}`)) == null ? void 0 : _querySelector.clientHeight) || 0;\n let gridFooterElementHeight = ((_querySelector2 = gridRootElement.querySelector(`.${gridClasses.footerContainer}`)) == null ? void 0 : _querySelector2.clientHeight) || 0;\n\n if (normalizeOptions.hideToolbar) {\n var _gridClone$querySelec;\n\n (_gridClone$querySelec = gridClone.querySelector(`.${gridClasses.toolbarContainer}`)) == null ? void 0 : _gridClone$querySelec.remove();\n gridToolbarElementHeight = 0;\n }\n\n if (normalizeOptions.hideFooter) {\n var _gridClone$querySelec2;\n\n (_gridClone$querySelec2 = gridClone.querySelector(`.${gridClasses.footerContainer}`)) == null ? void 0 : _gridClone$querySelec2.remove();\n gridFooterElementHeight = 0;\n } // Expand container height to accommodate all rows\n\n\n gridClone.style.height = `${rowsMeta.currentPageTotalHeight + totalHeaderHeight + gridToolbarElementHeight + gridFooterElementHeight}px`; // printDoc.body.appendChild(gridClone); should be enough but a clone isolation bug in Safari\n // prevents us to do it\n\n const container = document.createElement('div');\n container.appendChild(gridClone);\n printDoc.body.innerHTML = container.innerHTML;\n const defaultPageStyle = typeof normalizeOptions.pageStyle === 'function' ? normalizeOptions.pageStyle() : normalizeOptions.pageStyle;\n\n if (typeof defaultPageStyle === 'string') {\n // TODO custom styles should always win\n const styleElement = printDoc.createElement('style');\n styleElement.appendChild(printDoc.createTextNode(defaultPageStyle));\n printDoc.head.appendChild(styleElement);\n }\n\n if (normalizeOptions.bodyClassName) {\n printDoc.body.classList.add(...normalizeOptions.bodyClassName.split(' '));\n }\n\n if (normalizeOptions.copyStyles) {\n const headStyleElements = doc.current.querySelectorAll(\"style, link[rel='stylesheet']\");\n\n for (let i = 0; i < headStyleElements.length; i += 1) {\n const node = headStyleElements[i];\n\n if (node.tagName === 'STYLE') {\n const newHeadStyleElements = printDoc.createElement(node.tagName);\n const sheet = node.sheet;\n\n if (sheet) {\n let styleCSS = ''; // NOTE: for-of is not supported by IE\n\n for (let j = 0; j < sheet.cssRules.length; j += 1) {\n if (typeof sheet.cssRules[j].cssText === 'string') {\n styleCSS += `${sheet.cssRules[j].cssText}\\r\\n`;\n }\n }\n\n newHeadStyleElements.appendChild(printDoc.createTextNode(styleCSS));\n printDoc.head.appendChild(newHeadStyleElements);\n }\n } else if (node.getAttribute('href')) {\n // If `href` tag is empty, avoid loading these links\n const newHeadStyleElements = printDoc.createElement(node.tagName);\n\n for (let j = 0; j < node.attributes.length; j += 1) {\n const attr = node.attributes[j];\n\n if (attr) {\n newHeadStyleElements.setAttribute(attr.nodeName, attr.nodeValue || '');\n }\n }\n\n printDoc.head.appendChild(newHeadStyleElements);\n }\n }\n } // Trigger print\n\n\n if (process.env.NODE_ENV !== 'test') {\n printWindow.contentWindow.print();\n }\n }, [apiRef, doc]);\n const handlePrintWindowAfterPrint = React.useCallback(printWindow => {\n var _previousGridState$cu, _previousGridState$cu2;\n\n // Remove the print iframe\n doc.current.body.removeChild(printWindow); // Revert grid to previous state\n\n apiRef.current.restoreState(previousGridState.current || {});\n\n if (!((_previousGridState$cu = previousGridState.current) != null && (_previousGridState$cu2 = _previousGridState$cu.columns) != null && _previousGridState$cu2.columnVisibilityModel)) {\n // if the apiRef.current.exportState(); did not exported the column visibility, we update it\n apiRef.current.setColumnVisibilityModel(previousColumnVisibility.current);\n }\n\n apiRef.current.unstable_enableVirtualization(); // Clear local state\n\n previousGridState.current = null;\n previousColumnVisibility.current = {};\n }, [apiRef]);\n const exportDataAsPrint = React.useCallback(async options => {\n logger.debug(`Export data as Print`);\n\n if (!apiRef.current.rootElementRef.current) {\n throw new Error('MUI: No grid root element available.');\n }\n\n previousGridState.current = apiRef.current.exportState(); // It appends that the visibility model is not exported, especially if columnVisibility is not controlled\n\n previousColumnVisibility.current = gridColumnVisibilityModelSelector(apiRef);\n\n if (props.pagination) {\n const visibleRowCount = gridVisibleRowCountSelector(apiRef);\n apiRef.current.setPageSize(visibleRowCount);\n }\n\n await updateGridColumnsForPrint(options == null ? void 0 : options.fields, options == null ? void 0 : options.allColumns);\n apiRef.current.unstable_disableVirtualization();\n await raf(); // wait for the state changes to take action\n\n const printWindow = buildPrintWindow(options == null ? void 0 : options.fileName);\n\n if (process.env.NODE_ENV === 'test') {\n doc.current.body.appendChild(printWindow); // In test env, run the all pipeline without waiting for loading\n\n handlePrintWindowLoad(printWindow, options);\n handlePrintWindowAfterPrint(printWindow);\n } else {\n printWindow.onload = () => {\n handlePrintWindowLoad(printWindow, options);\n const mediaQueryList = printWindow.contentWindow.matchMedia('print');\n mediaQueryList.addEventListener('change', mql => {\n const isAfterPrint = mql.matches === false;\n\n if (isAfterPrint) {\n handlePrintWindowAfterPrint(printWindow);\n }\n });\n };\n\n doc.current.body.appendChild(printWindow);\n }\n }, [props, logger, apiRef, buildPrintWindow, handlePrintWindowLoad, handlePrintWindowAfterPrint, updateGridColumnsForPrint]);\n const printExportApi = {\n exportDataAsPrint\n };\n useGridApiMethod(apiRef, printExportApi, 'GridPrintExportApi');\n /**\n * PRE-PROCESSING\n */\n\n const addExportMenuButtons = React.useCallback((initialValue, options) => {\n var _options$printOptions;\n\n if ((_options$printOptions = options.printOptions) != null && _options$printOptions.disableToolbarButton) {\n return initialValue;\n }\n\n return [...initialValue, {\n component: /*#__PURE__*/_jsx(GridPrintExportMenuItem, {\n options: options.printOptions\n }),\n componentName: 'printExport'\n }];\n }, []);\n useGridRegisterPipeProcessor(apiRef, 'exportMenu', addExportMenuButtons);\n};"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,2BAA2B,QAAQ,8BAA8B;AAC1E,SAASC,6BAA6B,EAAEC,iCAAiC,QAAQ,gCAAgC;AACjH,SAASC,oCAAoC,QAAQ,4BAA4B;AACjF,SAASC,WAAW,QAAQ,gCAAgC;AAC5D,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,oBAAoB,QAAQ,8BAA8B;AACnE,SAASC,kBAAkB,QAAQ,SAAS;AAC5C,SAASC,4BAA4B,QAAQ,2BAA2B;AACxE,SAASC,uBAAuB,QAAQ,+CAA+C;AACvF,SAASC,GAAG,IAAIC,IAAI,QAAQ,mBAAmB;AAE/C,SAASC,GAAGA,CAAA,EAAG;EACb,OAAO,IAAIC,OAAO,CAACC,OAAO,IAAI;IAC5BC,qBAAqB,CAAC,MAAM;MAC1BD,OAAO,CAAC,CAAC;IACX,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ;AAEA,SAASE,gBAAgBA,CAAA,EAAG;EAC1B,MAAMC,GAAG,GAAGC,SAAS,CAACC,SAAS,CAACC,KAAK,CAAC,0BAA0B,CAAC;EACjE,OAAOH,GAAG,GAAGI,QAAQ,CAACJ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC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