@d3plus/export 3.0.0-alpha.0
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.
- package/README.md +44 -0
- package/es/index.js +1 -0
- package/es/src/saveElement.js +41 -0
- package/package.json +40 -0
- package/umd/d3plus-export.full.js +1145 -0
- package/umd/d3plus-export.full.js.map +1 -0
- package/umd/d3plus-export.full.min.js +90 -0
- package/umd/d3plus-export.js +157 -0
- package/umd/d3plus-export.js.map +1 -0
- package/umd/d3plus-export.min.js +20 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"d3plus-export.full.js","sources":["../../../node_modules/html-to-image/es/util.js","../../../node_modules/html-to-image/es/clone-pseudos.js","../../../node_modules/html-to-image/es/mimes.js","../../../node_modules/html-to-image/es/dataurl.js","../../../node_modules/html-to-image/es/clone-node.js","../../../node_modules/html-to-image/es/embed-resources.js","../../../node_modules/html-to-image/es/embed-images.js","../../../node_modules/html-to-image/es/apply-style.js","../../../node_modules/html-to-image/es/embed-webfonts.js","../../../node_modules/html-to-image/es/index.js","../../../node_modules/file-saver/FileSaver.js","../src/saveElement.js"],"sourcesContent":["export function resolveUrl(url, baseUrl) {\n // url is absolute already\n if (url.match(/^[a-z]+:\\/\\//i)) {\n return url;\n }\n // url is absolute already, without protocol\n if (url.match(/^\\/\\//)) {\n return window.location.protocol + url;\n }\n // dataURI, mailto:, tel:, etc.\n if (url.match(/^[a-z]+:/i)) {\n return url;\n }\n const doc = document.implementation.createHTMLDocument();\n const base = doc.createElement('base');\n const a = doc.createElement('a');\n doc.head.appendChild(base);\n doc.body.appendChild(a);\n if (baseUrl) {\n base.href = baseUrl;\n }\n a.href = url;\n return a.href;\n}\nexport const uuid = (() => {\n // generate uuid for className of pseudo elements.\n // We should not use GUIDs, otherwise pseudo elements sometimes cannot be captured.\n let counter = 0;\n // ref: http://stackoverflow.com/a/6248722/2519373\n const random = () => \n // eslint-disable-next-line no-bitwise\n `0000${((Math.random() * 36 ** 4) << 0).toString(36)}`.slice(-4);\n return () => {\n counter += 1;\n return `u${random()}${counter}`;\n };\n})();\nexport function delay(ms) {\n return (args) => new Promise((resolve) => {\n setTimeout(() => resolve(args), ms);\n });\n}\nexport function toArray(arrayLike) {\n const arr = [];\n for (let i = 0, l = arrayLike.length; i < l; i++) {\n arr.push(arrayLike[i]);\n }\n return arr;\n}\nlet styleProps = null;\nexport function getStyleProperties(options = {}) {\n if (styleProps) {\n return styleProps;\n }\n if (options.includeStyleProperties) {\n styleProps = options.includeStyleProperties;\n return styleProps;\n }\n styleProps = toArray(window.getComputedStyle(document.documentElement));\n return styleProps;\n}\nfunction px(node, styleProperty) {\n const win = node.ownerDocument.defaultView || window;\n const val = win.getComputedStyle(node).getPropertyValue(styleProperty);\n return val ? parseFloat(val.replace('px', '')) : 0;\n}\nfunction getNodeWidth(node) {\n const leftBorder = px(node, 'border-left-width');\n const rightBorder = px(node, 'border-right-width');\n return node.clientWidth + leftBorder + rightBorder;\n}\nfunction getNodeHeight(node) {\n const topBorder = px(node, 'border-top-width');\n const bottomBorder = px(node, 'border-bottom-width');\n return node.clientHeight + topBorder + bottomBorder;\n}\nexport function getImageSize(targetNode, options = {}) {\n const width = options.width || getNodeWidth(targetNode);\n const height = options.height || getNodeHeight(targetNode);\n return { width, height };\n}\nexport function getPixelRatio() {\n let ratio;\n let FINAL_PROCESS;\n try {\n FINAL_PROCESS = process;\n }\n catch (e) {\n // pass\n }\n const val = FINAL_PROCESS && FINAL_PROCESS.env\n ? FINAL_PROCESS.env.devicePixelRatio\n : null;\n if (val) {\n ratio = parseInt(val, 10);\n if (Number.isNaN(ratio)) {\n ratio = 1;\n }\n }\n return ratio || window.devicePixelRatio || 1;\n}\n// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas#maximum_canvas_size\nconst canvasDimensionLimit = 16384;\nexport function checkCanvasDimensions(canvas) {\n if (canvas.width > canvasDimensionLimit ||\n canvas.height > canvasDimensionLimit) {\n if (canvas.width > canvasDimensionLimit &&\n canvas.height > canvasDimensionLimit) {\n if (canvas.width > canvas.height) {\n canvas.height *= canvasDimensionLimit / canvas.width;\n canvas.width = canvasDimensionLimit;\n }\n else {\n canvas.width *= canvasDimensionLimit / canvas.height;\n canvas.height = canvasDimensionLimit;\n }\n }\n else if (canvas.width > canvasDimensionLimit) {\n canvas.height *= canvasDimensionLimit / canvas.width;\n canvas.width = canvasDimensionLimit;\n }\n else {\n canvas.width *= canvasDimensionLimit / canvas.height;\n canvas.height = canvasDimensionLimit;\n }\n }\n}\nexport function canvasToBlob(canvas, options = {}) {\n if (canvas.toBlob) {\n return new Promise((resolve) => {\n canvas.toBlob(resolve, options.type ? options.type : 'image/png', options.quality ? options.quality : 1);\n });\n }\n return new Promise((resolve) => {\n const binaryString = window.atob(canvas\n .toDataURL(options.type ? options.type : undefined, options.quality ? options.quality : undefined)\n .split(',')[1]);\n const len = binaryString.length;\n const binaryArray = new Uint8Array(len);\n for (let i = 0; i < len; i += 1) {\n binaryArray[i] = binaryString.charCodeAt(i);\n }\n resolve(new Blob([binaryArray], {\n type: options.type ? options.type : 'image/png',\n }));\n });\n}\nexport function createImage(url) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => {\n img.decode().then(() => {\n requestAnimationFrame(() => resolve(img));\n });\n };\n img.onerror = reject;\n img.crossOrigin = 'anonymous';\n img.decoding = 'async';\n img.src = url;\n });\n}\nexport async function svgToDataURL(svg) {\n return Promise.resolve()\n .then(() => new XMLSerializer().serializeToString(svg))\n .then(encodeURIComponent)\n .then((html) => `data:image/svg+xml;charset=utf-8,${html}`);\n}\nexport async function nodeToDataURL(node, width, height) {\n const xmlns = 'http://www.w3.org/2000/svg';\n const svg = document.createElementNS(xmlns, 'svg');\n const foreignObject = document.createElementNS(xmlns, 'foreignObject');\n svg.setAttribute('width', `${width}`);\n svg.setAttribute('height', `${height}`);\n svg.setAttribute('viewBox', `0 0 ${width} ${height}`);\n foreignObject.setAttribute('width', '100%');\n foreignObject.setAttribute('height', '100%');\n foreignObject.setAttribute('x', '0');\n foreignObject.setAttribute('y', '0');\n foreignObject.setAttribute('externalResourcesRequired', 'true');\n svg.appendChild(foreignObject);\n foreignObject.appendChild(node);\n return svgToDataURL(svg);\n}\nexport const isInstanceOfElement = (node, instance) => {\n if (node instanceof instance)\n return true;\n const nodePrototype = Object.getPrototypeOf(node);\n if (nodePrototype === null)\n return false;\n return (nodePrototype.constructor.name === instance.name ||\n isInstanceOfElement(nodePrototype, instance));\n};\n//# sourceMappingURL=util.js.map","import { uuid, getStyleProperties } from './util';\nfunction formatCSSText(style) {\n const content = style.getPropertyValue('content');\n return `${style.cssText} content: '${content.replace(/'|\"/g, '')}';`;\n}\nfunction formatCSSProperties(style, options) {\n return getStyleProperties(options)\n .map((name) => {\n const value = style.getPropertyValue(name);\n const priority = style.getPropertyPriority(name);\n return `${name}: ${value}${priority ? ' !important' : ''};`;\n })\n .join(' ');\n}\nfunction getPseudoElementStyle(className, pseudo, style, options) {\n const selector = `.${className}:${pseudo}`;\n const cssText = style.cssText\n ? formatCSSText(style)\n : formatCSSProperties(style, options);\n return document.createTextNode(`${selector}{${cssText}}`);\n}\nfunction clonePseudoElement(nativeNode, clonedNode, pseudo, options) {\n const style = window.getComputedStyle(nativeNode, pseudo);\n const content = style.getPropertyValue('content');\n if (content === '' || content === 'none') {\n return;\n }\n const className = uuid();\n try {\n clonedNode.className = `${clonedNode.className} ${className}`;\n }\n catch (err) {\n return;\n }\n const styleElement = document.createElement('style');\n styleElement.appendChild(getPseudoElementStyle(className, pseudo, style, options));\n clonedNode.appendChild(styleElement);\n}\nexport function clonePseudoElements(nativeNode, clonedNode, options) {\n clonePseudoElement(nativeNode, clonedNode, ':before', options);\n clonePseudoElement(nativeNode, clonedNode, ':after', options);\n}\n//# sourceMappingURL=clone-pseudos.js.map","const WOFF = 'application/font-woff';\nconst JPEG = 'image/jpeg';\nconst mimes = {\n woff: WOFF,\n woff2: WOFF,\n ttf: 'application/font-truetype',\n eot: 'application/vnd.ms-fontobject',\n png: 'image/png',\n jpg: JPEG,\n jpeg: JPEG,\n gif: 'image/gif',\n tiff: 'image/tiff',\n svg: 'image/svg+xml',\n webp: 'image/webp',\n};\nfunction getExtension(url) {\n const match = /\\.([^./]*?)$/g.exec(url);\n return match ? match[1] : '';\n}\nexport function getMimeType(url) {\n const extension = getExtension(url).toLowerCase();\n return mimes[extension] || '';\n}\n//# sourceMappingURL=mimes.js.map","function getContentFromDataUrl(dataURL) {\n return dataURL.split(/,/)[1];\n}\nexport function isDataUrl(url) {\n return url.search(/^(data:)/) !== -1;\n}\nexport function makeDataUrl(content, mimeType) {\n return `data:${mimeType};base64,${content}`;\n}\nexport async function fetchAsDataURL(url, init, process) {\n const res = await fetch(url, init);\n if (res.status === 404) {\n throw new Error(`Resource \"${res.url}\" not found`);\n }\n const blob = await res.blob();\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onerror = reject;\n reader.onloadend = () => {\n try {\n resolve(process({ res, result: reader.result }));\n }\n catch (error) {\n reject(error);\n }\n };\n reader.readAsDataURL(blob);\n });\n}\nconst cache = {};\nfunction getCacheKey(url, contentType, includeQueryParams) {\n let key = url.replace(/\\?.*/, '');\n if (includeQueryParams) {\n key = url;\n }\n // font resource\n if (/ttf|otf|eot|woff2?/i.test(key)) {\n key = key.replace(/.*\\//, '');\n }\n return contentType ? `[${contentType}]${key}` : key;\n}\nexport async function resourceToDataURL(resourceUrl, contentType, options) {\n const cacheKey = getCacheKey(resourceUrl, contentType, options.includeQueryParams);\n if (cache[cacheKey] != null) {\n return cache[cacheKey];\n }\n // ref: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache\n if (options.cacheBust) {\n // eslint-disable-next-line no-param-reassign\n resourceUrl += (/\\?/.test(resourceUrl) ? '&' : '?') + new Date().getTime();\n }\n let dataURL;\n try {\n const content = await fetchAsDataURL(resourceUrl, options.fetchRequestInit, ({ res, result }) => {\n if (!contentType) {\n // eslint-disable-next-line no-param-reassign\n contentType = res.headers.get('Content-Type') || '';\n }\n return getContentFromDataUrl(result);\n });\n dataURL = makeDataUrl(content, contentType);\n }\n catch (error) {\n dataURL = options.imagePlaceholder || '';\n let msg = `Failed to fetch resource: ${resourceUrl}`;\n if (error) {\n msg = typeof error === 'string' ? error : error.message;\n }\n if (msg) {\n console.warn(msg);\n }\n }\n cache[cacheKey] = dataURL;\n return dataURL;\n}\n//# sourceMappingURL=dataurl.js.map","import { clonePseudoElements } from './clone-pseudos';\nimport { createImage, toArray, isInstanceOfElement, getStyleProperties, } from './util';\nimport { getMimeType } from './mimes';\nimport { resourceToDataURL } from './dataurl';\nasync function cloneCanvasElement(canvas) {\n const dataURL = canvas.toDataURL();\n if (dataURL === 'data:,') {\n return canvas.cloneNode(false);\n }\n return createImage(dataURL);\n}\nasync function cloneVideoElement(video, options) {\n if (video.currentSrc) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n canvas.width = video.clientWidth;\n canvas.height = video.clientHeight;\n ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);\n const dataURL = canvas.toDataURL();\n return createImage(dataURL);\n }\n const poster = video.poster;\n const contentType = getMimeType(poster);\n const dataURL = await resourceToDataURL(poster, contentType, options);\n return createImage(dataURL);\n}\nasync function cloneIFrameElement(iframe, options) {\n var _a;\n try {\n if ((_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentDocument) === null || _a === void 0 ? void 0 : _a.body) {\n return (await cloneNode(iframe.contentDocument.body, options, true));\n }\n }\n catch (_b) {\n // Failed to clone iframe\n }\n return iframe.cloneNode(false);\n}\nasync function cloneSingleNode(node, options) {\n if (isInstanceOfElement(node, HTMLCanvasElement)) {\n return cloneCanvasElement(node);\n }\n if (isInstanceOfElement(node, HTMLVideoElement)) {\n return cloneVideoElement(node, options);\n }\n if (isInstanceOfElement(node, HTMLIFrameElement)) {\n return cloneIFrameElement(node, options);\n }\n return node.cloneNode(isSVGElement(node));\n}\nconst isSlotElement = (node) => node.tagName != null && node.tagName.toUpperCase() === 'SLOT';\nconst isSVGElement = (node) => node.tagName != null && node.tagName.toUpperCase() === 'SVG';\nasync function cloneChildren(nativeNode, clonedNode, options) {\n var _a, _b;\n if (isSVGElement(clonedNode)) {\n return clonedNode;\n }\n let children = [];\n if (isSlotElement(nativeNode) && nativeNode.assignedNodes) {\n children = toArray(nativeNode.assignedNodes());\n }\n else if (isInstanceOfElement(nativeNode, HTMLIFrameElement) &&\n ((_a = nativeNode.contentDocument) === null || _a === void 0 ? void 0 : _a.body)) {\n children = toArray(nativeNode.contentDocument.body.childNodes);\n }\n else {\n children = toArray(((_b = nativeNode.shadowRoot) !== null && _b !== void 0 ? _b : nativeNode).childNodes);\n }\n if (children.length === 0 ||\n isInstanceOfElement(nativeNode, HTMLVideoElement)) {\n return clonedNode;\n }\n await children.reduce((deferred, child) => deferred\n .then(() => cloneNode(child, options))\n .then((clonedChild) => {\n if (clonedChild) {\n clonedNode.appendChild(clonedChild);\n }\n }), Promise.resolve());\n return clonedNode;\n}\nfunction cloneCSSStyle(nativeNode, clonedNode, options) {\n const targetStyle = clonedNode.style;\n if (!targetStyle) {\n return;\n }\n const sourceStyle = window.getComputedStyle(nativeNode);\n if (sourceStyle.cssText) {\n targetStyle.cssText = sourceStyle.cssText;\n targetStyle.transformOrigin = sourceStyle.transformOrigin;\n }\n else {\n getStyleProperties(options).forEach((name) => {\n let value = sourceStyle.getPropertyValue(name);\n if (name === 'font-size' && value.endsWith('px')) {\n const reducedFont = Math.floor(parseFloat(value.substring(0, value.length - 2))) - 0.1;\n value = `${reducedFont}px`;\n }\n if (isInstanceOfElement(nativeNode, HTMLIFrameElement) &&\n name === 'display' &&\n value === 'inline') {\n value = 'block';\n }\n if (name === 'd' && clonedNode.getAttribute('d')) {\n value = `path(${clonedNode.getAttribute('d')})`;\n }\n targetStyle.setProperty(name, value, sourceStyle.getPropertyPriority(name));\n });\n }\n}\nfunction cloneInputValue(nativeNode, clonedNode) {\n if (isInstanceOfElement(nativeNode, HTMLTextAreaElement)) {\n clonedNode.innerHTML = nativeNode.value;\n }\n if (isInstanceOfElement(nativeNode, HTMLInputElement)) {\n clonedNode.setAttribute('value', nativeNode.value);\n }\n}\nfunction cloneSelectValue(nativeNode, clonedNode) {\n if (isInstanceOfElement(nativeNode, HTMLSelectElement)) {\n const clonedSelect = clonedNode;\n const selectedOption = Array.from(clonedSelect.children).find((child) => nativeNode.value === child.getAttribute('value'));\n if (selectedOption) {\n selectedOption.setAttribute('selected', '');\n }\n }\n}\nfunction decorate(nativeNode, clonedNode, options) {\n if (isInstanceOfElement(clonedNode, Element)) {\n cloneCSSStyle(nativeNode, clonedNode, options);\n clonePseudoElements(nativeNode, clonedNode, options);\n cloneInputValue(nativeNode, clonedNode);\n cloneSelectValue(nativeNode, clonedNode);\n }\n return clonedNode;\n}\nasync function ensureSVGSymbols(clone, options) {\n const uses = clone.querySelectorAll ? clone.querySelectorAll('use') : [];\n if (uses.length === 0) {\n return clone;\n }\n const processedDefs = {};\n for (let i = 0; i < uses.length; i++) {\n const use = uses[i];\n const id = use.getAttribute('xlink:href');\n if (id) {\n const exist = clone.querySelector(id);\n const definition = document.querySelector(id);\n if (!exist && definition && !processedDefs[id]) {\n // eslint-disable-next-line no-await-in-loop\n processedDefs[id] = (await cloneNode(definition, options, true));\n }\n }\n }\n const nodes = Object.values(processedDefs);\n if (nodes.length) {\n const ns = 'http://www.w3.org/1999/xhtml';\n const svg = document.createElementNS(ns, 'svg');\n svg.setAttribute('xmlns', ns);\n svg.style.position = 'absolute';\n svg.style.width = '0';\n svg.style.height = '0';\n svg.style.overflow = 'hidden';\n svg.style.display = 'none';\n const defs = document.createElementNS(ns, 'defs');\n svg.appendChild(defs);\n for (let i = 0; i < nodes.length; i++) {\n defs.appendChild(nodes[i]);\n }\n clone.appendChild(svg);\n }\n return clone;\n}\nexport async function cloneNode(node, options, isRoot) {\n if (!isRoot && options.filter && !options.filter(node)) {\n return null;\n }\n return Promise.resolve(node)\n .then((clonedNode) => cloneSingleNode(clonedNode, options))\n .then((clonedNode) => cloneChildren(node, clonedNode, options))\n .then((clonedNode) => decorate(node, clonedNode, options))\n .then((clonedNode) => ensureSVGSymbols(clonedNode, options));\n}\n//# sourceMappingURL=clone-node.js.map","import { resolveUrl } from './util';\nimport { getMimeType } from './mimes';\nimport { isDataUrl, makeDataUrl, resourceToDataURL } from './dataurl';\nconst URL_REGEX = /url\\((['\"]?)([^'\"]+?)\\1\\)/g;\nconst URL_WITH_FORMAT_REGEX = /url\\([^)]+\\)\\s*format\\(([\"']?)([^\"']+)\\1\\)/g;\nconst FONT_SRC_REGEX = /src:\\s*(?:url\\([^)]+\\)\\s*format\\([^)]+\\)[,;]\\s*)+/g;\nfunction toRegex(url) {\n // eslint-disable-next-line no-useless-escape\n const escaped = url.replace(/([.*+?^${}()|\\[\\]\\/\\\\])/g, '\\\\$1');\n return new RegExp(`(url\\\\(['\"]?)(${escaped})(['\"]?\\\\))`, 'g');\n}\nexport function parseURLs(cssText) {\n const urls = [];\n cssText.replace(URL_REGEX, (raw, quotation, url) => {\n urls.push(url);\n return raw;\n });\n return urls.filter((url) => !isDataUrl(url));\n}\nexport async function embed(cssText, resourceURL, baseURL, options, getContentFromUrl) {\n try {\n const resolvedURL = baseURL ? resolveUrl(resourceURL, baseURL) : resourceURL;\n const contentType = getMimeType(resourceURL);\n let dataURL;\n if (getContentFromUrl) {\n const content = await getContentFromUrl(resolvedURL);\n dataURL = makeDataUrl(content, contentType);\n }\n else {\n dataURL = await resourceToDataURL(resolvedURL, contentType, options);\n }\n return cssText.replace(toRegex(resourceURL), `$1${dataURL}$3`);\n }\n catch (error) {\n // pass\n }\n return cssText;\n}\nfunction filterPreferredFontFormat(str, { preferredFontFormat }) {\n return !preferredFontFormat\n ? str\n : str.replace(FONT_SRC_REGEX, (match) => {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const [src, , format] = URL_WITH_FORMAT_REGEX.exec(match) || [];\n if (!format) {\n return '';\n }\n if (format === preferredFontFormat) {\n return `src: ${src};`;\n }\n }\n });\n}\nexport function shouldEmbed(url) {\n return url.search(URL_REGEX) !== -1;\n}\nexport async function embedResources(cssText, baseUrl, options) {\n if (!shouldEmbed(cssText)) {\n return cssText;\n }\n const filteredCSSText = filterPreferredFontFormat(cssText, options);\n const urls = parseURLs(filteredCSSText);\n return urls.reduce((deferred, url) => deferred.then((css) => embed(css, url, baseUrl, options)), Promise.resolve(filteredCSSText));\n}\n//# sourceMappingURL=embed-resources.js.map","import { embedResources } from './embed-resources';\nimport { toArray, isInstanceOfElement } from './util';\nimport { isDataUrl, resourceToDataURL } from './dataurl';\nimport { getMimeType } from './mimes';\nasync function embedProp(propName, node, options) {\n var _a;\n const propValue = (_a = node.style) === null || _a === void 0 ? void 0 : _a.getPropertyValue(propName);\n if (propValue) {\n const cssString = await embedResources(propValue, null, options);\n node.style.setProperty(propName, cssString, node.style.getPropertyPriority(propName));\n return true;\n }\n return false;\n}\nasync function embedBackground(clonedNode, options) {\n ;\n (await embedProp('background', clonedNode, options)) ||\n (await embedProp('background-image', clonedNode, options));\n (await embedProp('mask', clonedNode, options)) ||\n (await embedProp('-webkit-mask', clonedNode, options)) ||\n (await embedProp('mask-image', clonedNode, options)) ||\n (await embedProp('-webkit-mask-image', clonedNode, options));\n}\nasync function embedImageNode(clonedNode, options) {\n const isImageElement = isInstanceOfElement(clonedNode, HTMLImageElement);\n if (!(isImageElement && !isDataUrl(clonedNode.src)) &&\n !(isInstanceOfElement(clonedNode, SVGImageElement) &&\n !isDataUrl(clonedNode.href.baseVal))) {\n return;\n }\n const url = isImageElement ? clonedNode.src : clonedNode.href.baseVal;\n const dataURL = await resourceToDataURL(url, getMimeType(url), options);\n await new Promise((resolve, reject) => {\n clonedNode.onload = resolve;\n clonedNode.onerror = options.onImageErrorHandler\n ? (...attributes) => {\n try {\n resolve(options.onImageErrorHandler(...attributes));\n }\n catch (error) {\n reject(error);\n }\n }\n : reject;\n const image = clonedNode;\n if (image.decode) {\n image.decode = resolve;\n }\n if (image.loading === 'lazy') {\n image.loading = 'eager';\n }\n if (isImageElement) {\n clonedNode.srcset = '';\n clonedNode.src = dataURL;\n }\n else {\n clonedNode.href.baseVal = dataURL;\n }\n });\n}\nasync function embedChildren(clonedNode, options) {\n const children = toArray(clonedNode.childNodes);\n const deferreds = children.map((child) => embedImages(child, options));\n await Promise.all(deferreds).then(() => clonedNode);\n}\nexport async function embedImages(clonedNode, options) {\n if (isInstanceOfElement(clonedNode, Element)) {\n await embedBackground(clonedNode, options);\n await embedImageNode(clonedNode, options);\n await embedChildren(clonedNode, options);\n }\n}\n//# sourceMappingURL=embed-images.js.map","export function applyStyle(node, options) {\n const { style } = node;\n if (options.backgroundColor) {\n style.backgroundColor = options.backgroundColor;\n }\n if (options.width) {\n style.width = `${options.width}px`;\n }\n if (options.height) {\n style.height = `${options.height}px`;\n }\n const manual = options.style;\n if (manual != null) {\n Object.keys(manual).forEach((key) => {\n style[key] = manual[key];\n });\n }\n return node;\n}\n//# sourceMappingURL=apply-style.js.map","import { toArray } from './util';\nimport { fetchAsDataURL } from './dataurl';\nimport { shouldEmbed, embedResources } from './embed-resources';\nconst cssFetchCache = {};\nasync function fetchCSS(url) {\n let cache = cssFetchCache[url];\n if (cache != null) {\n return cache;\n }\n const res = await fetch(url);\n const cssText = await res.text();\n cache = { url, cssText };\n cssFetchCache[url] = cache;\n return cache;\n}\nasync function embedFonts(data, options) {\n let cssText = data.cssText;\n const regexUrl = /url\\([\"']?([^\"')]+)[\"']?\\)/g;\n const fontLocs = cssText.match(/url\\([^)]+\\)/g) || [];\n const loadFonts = fontLocs.map(async (loc) => {\n let url = loc.replace(regexUrl, '$1');\n if (!url.startsWith('https://')) {\n url = new URL(url, data.url).href;\n }\n return fetchAsDataURL(url, options.fetchRequestInit, ({ result }) => {\n cssText = cssText.replace(loc, `url(${result})`);\n return [loc, result];\n });\n });\n return Promise.all(loadFonts).then(() => cssText);\n}\nfunction parseCSS(source) {\n if (source == null) {\n return [];\n }\n const result = [];\n const commentsRegex = /(\\/\\*[\\s\\S]*?\\*\\/)/gi;\n // strip out comments\n let cssText = source.replace(commentsRegex, '');\n // eslint-disable-next-line prefer-regex-literals\n const keyframesRegex = new RegExp('((@.*?keyframes [\\\\s\\\\S]*?){([\\\\s\\\\S]*?}\\\\s*?)})', 'gi');\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const matches = keyframesRegex.exec(cssText);\n if (matches === null) {\n break;\n }\n result.push(matches[0]);\n }\n cssText = cssText.replace(keyframesRegex, '');\n const importRegex = /@import[\\s\\S]*?url\\([^)]*\\)[\\s\\S]*?;/gi;\n // to match css & media queries together\n const combinedCSSRegex = '((\\\\s*?(?:\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\/)?\\\\s*?@media[\\\\s\\\\S]' +\n '*?){([\\\\s\\\\S]*?)}\\\\s*?})|(([\\\\s\\\\S]*?){([\\\\s\\\\S]*?)})';\n // unified regex\n const unifiedRegex = new RegExp(combinedCSSRegex, 'gi');\n // eslint-disable-next-line no-constant-condition\n while (true) {\n let matches = importRegex.exec(cssText);\n if (matches === null) {\n matches = unifiedRegex.exec(cssText);\n if (matches === null) {\n break;\n }\n else {\n importRegex.lastIndex = unifiedRegex.lastIndex;\n }\n }\n else {\n unifiedRegex.lastIndex = importRegex.lastIndex;\n }\n result.push(matches[0]);\n }\n return result;\n}\nasync function getCSSRules(styleSheets, options) {\n const ret = [];\n const deferreds = [];\n // First loop inlines imports\n styleSheets.forEach((sheet) => {\n if ('cssRules' in sheet) {\n try {\n toArray(sheet.cssRules || []).forEach((item, index) => {\n if (item.type === CSSRule.IMPORT_RULE) {\n let importIndex = index + 1;\n const url = item.href;\n const deferred = fetchCSS(url)\n .then((metadata) => embedFonts(metadata, options))\n .then((cssText) => parseCSS(cssText).forEach((rule) => {\n try {\n sheet.insertRule(rule, rule.startsWith('@import')\n ? (importIndex += 1)\n : sheet.cssRules.length);\n }\n catch (error) {\n console.error('Error inserting rule from remote css', {\n rule,\n error,\n });\n }\n }))\n .catch((e) => {\n console.error('Error loading remote css', e.toString());\n });\n deferreds.push(deferred);\n }\n });\n }\n catch (e) {\n const inline = styleSheets.find((a) => a.href == null) || document.styleSheets[0];\n if (sheet.href != null) {\n deferreds.push(fetchCSS(sheet.href)\n .then((metadata) => embedFonts(metadata, options))\n .then((cssText) => parseCSS(cssText).forEach((rule) => {\n inline.insertRule(rule, inline.cssRules.length);\n }))\n .catch((err) => {\n console.error('Error loading remote stylesheet', err);\n }));\n }\n console.error('Error inlining remote css file', e);\n }\n }\n });\n return Promise.all(deferreds).then(() => {\n // Second loop parses rules\n styleSheets.forEach((sheet) => {\n if ('cssRules' in sheet) {\n try {\n toArray(sheet.cssRules || []).forEach((item) => {\n ret.push(item);\n });\n }\n catch (e) {\n console.error(`Error while reading CSS rules from ${sheet.href}`, e);\n }\n }\n });\n return ret;\n });\n}\nfunction getWebFontRules(cssRules) {\n return cssRules\n .filter((rule) => rule.type === CSSRule.FONT_FACE_RULE)\n .filter((rule) => shouldEmbed(rule.style.getPropertyValue('src')));\n}\nasync function parseWebFontRules(node, options) {\n if (node.ownerDocument == null) {\n throw new Error('Provided element is not within a Document');\n }\n const styleSheets = toArray(node.ownerDocument.styleSheets);\n const cssRules = await getCSSRules(styleSheets, options);\n return getWebFontRules(cssRules);\n}\nfunction normalizeFontFamily(font) {\n return font.trim().replace(/[\"']/g, '');\n}\nfunction getUsedFonts(node) {\n const fonts = new Set();\n function traverse(node) {\n const fontFamily = node.style.fontFamily || getComputedStyle(node).fontFamily;\n fontFamily.split(',').forEach((font) => {\n fonts.add(normalizeFontFamily(font));\n });\n Array.from(node.children).forEach((child) => {\n if (child instanceof HTMLElement) {\n traverse(child);\n }\n });\n }\n traverse(node);\n return fonts;\n}\nexport async function getWebFontCSS(node, options) {\n const rules = await parseWebFontRules(node, options);\n const usedFonts = getUsedFonts(node);\n const cssTexts = await Promise.all(rules\n .filter((rule) => usedFonts.has(normalizeFontFamily(rule.style.fontFamily)))\n .map((rule) => {\n const baseUrl = rule.parentStyleSheet\n ? rule.parentStyleSheet.href\n : null;\n return embedResources(rule.cssText, baseUrl, options);\n }));\n return cssTexts.join('\\n');\n}\nexport async function embedWebFonts(clonedNode, options) {\n const cssText = options.fontEmbedCSS != null\n ? options.fontEmbedCSS\n : options.skipFonts\n ? null\n : await getWebFontCSS(clonedNode, options);\n if (cssText) {\n const styleNode = document.createElement('style');\n const sytleContent = document.createTextNode(cssText);\n styleNode.appendChild(sytleContent);\n if (clonedNode.firstChild) {\n clonedNode.insertBefore(styleNode, clonedNode.firstChild);\n }\n else {\n clonedNode.appendChild(styleNode);\n }\n }\n}\n//# sourceMappingURL=embed-webfonts.js.map","import { cloneNode } from './clone-node';\nimport { embedImages } from './embed-images';\nimport { applyStyle } from './apply-style';\nimport { embedWebFonts, getWebFontCSS } from './embed-webfonts';\nimport { getImageSize, getPixelRatio, createImage, canvasToBlob, nodeToDataURL, checkCanvasDimensions, } from './util';\nexport async function toSvg(node, options = {}) {\n const { width, height } = getImageSize(node, options);\n const clonedNode = (await cloneNode(node, options, true));\n await embedWebFonts(clonedNode, options);\n await embedImages(clonedNode, options);\n applyStyle(clonedNode, options);\n const datauri = await nodeToDataURL(clonedNode, width, height);\n return datauri;\n}\nexport async function toCanvas(node, options = {}) {\n const { width, height } = getImageSize(node, options);\n const svg = await toSvg(node, options);\n const img = await createImage(svg);\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n const ratio = options.pixelRatio || getPixelRatio();\n const canvasWidth = options.canvasWidth || width;\n const canvasHeight = options.canvasHeight || height;\n canvas.width = canvasWidth * ratio;\n canvas.height = canvasHeight * ratio;\n if (!options.skipAutoScale) {\n checkCanvasDimensions(canvas);\n }\n canvas.style.width = `${canvasWidth}`;\n canvas.style.height = `${canvasHeight}`;\n if (options.backgroundColor) {\n context.fillStyle = options.backgroundColor;\n context.fillRect(0, 0, canvas.width, canvas.height);\n }\n context.drawImage(img, 0, 0, canvas.width, canvas.height);\n return canvas;\n}\nexport async function toPixelData(node, options = {}) {\n const { width, height } = getImageSize(node, options);\n const canvas = await toCanvas(node, options);\n const ctx = canvas.getContext('2d');\n return ctx.getImageData(0, 0, width, height).data;\n}\nexport async function toPng(node, options = {}) {\n const canvas = await toCanvas(node, options);\n return canvas.toDataURL();\n}\nexport async function toJpeg(node, options = {}) {\n const canvas = await toCanvas(node, options);\n return canvas.toDataURL('image/jpeg', options.quality || 1);\n}\nexport async function toBlob(node, options = {}) {\n const canvas = await toCanvas(node, options);\n const blob = await canvasToBlob(canvas);\n return blob;\n}\nexport async function getFontEmbedCSS(node, options = {}) {\n return getWebFontCSS(node, options);\n}\n//# sourceMappingURL=index.js.map","/* FileSaver.js\n * A saveAs() FileSaver implementation.\n * 1.3.2\n * 2016-06-16 18:25:19\n *\n * By Eli Grey, http://eligrey.com\n * License: MIT\n * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md\n */\n\n/*global self */\n/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */\n\n/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */\n\nvar saveAs = saveAs || (function(view) {\n\t\"use strict\";\n\t// IE <10 is explicitly unsupported\n\tif (typeof view === \"undefined\" || typeof navigator !== \"undefined\" && /MSIE [1-9]\\./.test(navigator.userAgent)) {\n\t\treturn;\n\t}\n\tvar\n\t\t doc = view.document\n\t\t // only get URL when necessary in case Blob.js hasn't overridden it yet\n\t\t, get_URL = function() {\n\t\t\treturn view.URL || view.webkitURL || view;\n\t\t}\n\t\t, save_link = doc.createElementNS(\"http://www.w3.org/1999/xhtml\", \"a\")\n\t\t, can_use_save_link = \"download\" in save_link\n\t\t, click = function(node) {\n\t\t\tvar event = new MouseEvent(\"click\");\n\t\t\tnode.dispatchEvent(event);\n\t\t}\n\t\t, is_safari = /constructor/i.test(view.HTMLElement) || view.safari\n\t\t, is_chrome_ios =/CriOS\\/[\\d]+/.test(navigator.userAgent)\n\t\t, throw_outside = function(ex) {\n\t\t\t(view.setImmediate || view.setTimeout)(function() {\n\t\t\t\tthrow ex;\n\t\t\t}, 0);\n\t\t}\n\t\t, force_saveable_type = \"application/octet-stream\"\n\t\t// the Blob API is fundamentally broken as there is no \"downloadfinished\" event to subscribe to\n\t\t, arbitrary_revoke_timeout = 1000 * 40 // in ms\n\t\t, revoke = function(file) {\n\t\t\tvar revoker = function() {\n\t\t\t\tif (typeof file === \"string\") { // file is an object URL\n\t\t\t\t\tget_URL().revokeObjectURL(file);\n\t\t\t\t} else { // file is a File\n\t\t\t\t\tfile.remove();\n\t\t\t\t}\n\t\t\t};\n\t\t\tsetTimeout(revoker, arbitrary_revoke_timeout);\n\t\t}\n\t\t, dispatch = function(filesaver, event_types, event) {\n\t\t\tevent_types = [].concat(event_types);\n\t\t\tvar i = event_types.length;\n\t\t\twhile (i--) {\n\t\t\t\tvar listener = filesaver[\"on\" + event_types[i]];\n\t\t\t\tif (typeof listener === \"function\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlistener.call(filesaver, event || filesaver);\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tthrow_outside(ex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t, auto_bom = function(blob) {\n\t\t\t// prepend BOM for UTF-8 XML and text/* types (including HTML)\n\t\t\t// note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF\n\t\t\tif (/^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(blob.type)) {\n\t\t\t\treturn new Blob([String.fromCharCode(0xFEFF), blob], {type: blob.type});\n\t\t\t}\n\t\t\treturn blob;\n\t\t}\n\t\t, FileSaver = function(blob, name, no_auto_bom) {\n\t\t\tif (!no_auto_bom) {\n\t\t\t\tblob = auto_bom(blob);\n\t\t\t}\n\t\t\t// First try a.download, then web filesystem, then object URLs\n\t\t\tvar\n\t\t\t\t filesaver = this\n\t\t\t\t, type = blob.type\n\t\t\t\t, force = type === force_saveable_type\n\t\t\t\t, object_url\n\t\t\t\t, dispatch_all = function() {\n\t\t\t\t\tdispatch(filesaver, \"writestart progress write writeend\".split(\" \"));\n\t\t\t\t}\n\t\t\t\t// on any filesys errors revert to saving with object URLs\n\t\t\t\t, fs_error = function() {\n\t\t\t\t\tif ((is_chrome_ios || (force && is_safari)) && view.FileReader) {\n\t\t\t\t\t\t// Safari doesn't allow downloading of blob urls\n\t\t\t\t\t\tvar reader = new FileReader();\n\t\t\t\t\t\treader.onloadend = function() {\n\t\t\t\t\t\t\tvar url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;');\n\t\t\t\t\t\t\tvar popup = view.open(url, '_blank');\n\t\t\t\t\t\t\tif(!popup) view.location.href = url;\n\t\t\t\t\t\t\turl=undefined; // release reference before dispatching\n\t\t\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t\t\t\tdispatch_all();\n\t\t\t\t\t\t};\n\t\t\t\t\t\treader.readAsDataURL(blob);\n\t\t\t\t\t\tfilesaver.readyState = filesaver.INIT;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// don't create more object URLs than needed\n\t\t\t\t\tif (!object_url) {\n\t\t\t\t\t\tobject_url = get_URL().createObjectURL(blob);\n\t\t\t\t\t}\n\t\t\t\t\tif (force) {\n\t\t\t\t\t\tview.location.href = object_url;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar opened = view.open(object_url, \"_blank\");\n\t\t\t\t\t\tif (!opened) {\n\t\t\t\t\t\t\t// Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html\n\t\t\t\t\t\t\tview.location.href = object_url;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t\tdispatch_all();\n\t\t\t\t\trevoke(object_url);\n\t\t\t\t}\n\t\t\t;\n\t\t\tfilesaver.readyState = filesaver.INIT;\n\n\t\t\tif (can_use_save_link) {\n\t\t\t\tobject_url = get_URL().createObjectURL(blob);\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tsave_link.href = object_url;\n\t\t\t\t\tsave_link.download = name;\n\t\t\t\t\tclick(save_link);\n\t\t\t\t\tdispatch_all();\n\t\t\t\t\trevoke(object_url);\n\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfs_error();\n\t\t}\n\t\t, FS_proto = FileSaver.prototype\n\t\t, saveAs = function(blob, name, no_auto_bom) {\n\t\t\treturn new FileSaver(blob, name || blob.name || \"download\", no_auto_bom);\n\t\t}\n\t;\n\t// IE 10+ (native saveAs)\n\tif (typeof navigator !== \"undefined\" && navigator.msSaveOrOpenBlob) {\n\t\treturn function(blob, name, no_auto_bom) {\n\t\t\tname = name || blob.name || \"download\";\n\n\t\t\tif (!no_auto_bom) {\n\t\t\t\tblob = auto_bom(blob);\n\t\t\t}\n\t\t\treturn navigator.msSaveOrOpenBlob(blob, name);\n\t\t};\n\t}\n\n\tFS_proto.abort = function(){};\n\tFS_proto.readyState = FS_proto.INIT = 0;\n\tFS_proto.WRITING = 1;\n\tFS_proto.DONE = 2;\n\n\tFS_proto.error =\n\tFS_proto.onwritestart =\n\tFS_proto.onprogress =\n\tFS_proto.onwrite =\n\tFS_proto.onabort =\n\tFS_proto.onerror =\n\tFS_proto.onwriteend =\n\t\tnull;\n\n\treturn saveAs;\n}(\n\t typeof self !== \"undefined\" && self\n\t|| typeof window !== \"undefined\" && window\n\t|| this.content\n));\n// `self` is undefined in Firefox for Android content script context\n// while `this` is nsIContentFrameMessageManager\n// with an attribute `content` that corresponds to the window\n\nif (typeof module !== \"undefined\" && module.exports) {\n module.exports.saveAs = saveAs;\n} else if ((typeof define !== \"undefined\" && define !== null) && (define.amd !== null)) {\n define(\"FileSaver.js\", function() {\n return saveAs;\n });\n}\n","import {toBlob, toSvg} from \"html-to-image\";\nimport {saveAs} from \"file-saver\";\n\nconst defaultOptions = {\n filename: \"download\",\n type: \"png\"\n};\n\n/**\n @function saveElement\n @desc Downloads an HTML Element as a bitmap PNG image.\n @param {HTMLElement} elem A single element to be saved to one file.\n @param {Object} [options] Additional options to specify.\n @param {String} [options.filename = \"download\"] Filename for the downloaded file, without the extension.\n @param {String} [options.type = \"png\"] File type of the saved document. Accepted values are `\"png\"` and `\"jpg\"`.\n @param {Function} [options.callback] Function to be invoked after saving is complete.\n @param {Object} [renderOptions] Custom options to be passed to the html-to-image function.\n*/\nexport default function(elem, options = {}, renderOptions = {}) {\n\n if (!elem) return;\n options = Object.assign({}, defaultOptions, options);\n\n // rename renderOptions.background to backgroundColor for backwards compatibility\n renderOptions = Object.assign({backgroundColor: renderOptions.background}, renderOptions);\n\n function finish(blob) {\n saveAs(blob, `${options.filename}.${options.type}`);\n if (options.callback) options.callback();\n }\n\n if (options.type === \"svg\") {\n\n toSvg(elem, renderOptions)\n .then(dataUrl => {\n\n const xhr = new XMLHttpRequest();\n xhr.open(\"GET\", dataUrl);\n xhr.responseType = \"blob\";\n xhr.onload = () => finish(xhr.response);\n xhr.send();\n\n });\n\n }\n else {\n\n toBlob(elem, renderOptions)\n .then(finish);\n\n }\n\n}\n"],"names":["saveAs","view","navigator","test","userAgent","doc","document","get_URL","URL","webkitURL","save_link","createElementNS","can_use_save_link","click","node","event","MouseEvent","dispatchEvent","is_safari","HTMLElement","safari","is_chrome_ios","throw_outside","ex","setImmediate","setTimeout","force_saveable_type","arbitrary_revoke_timeout","revoke","file","revoker","revokeObjectURL","remove","dispatch","filesaver","event_types","concat","i","length","listener","call","auto_bom","blob","type","Blob","String","fromCharCode","FileSaver","name","no_auto_bom","force","object_url","dispatch_all","split","fs_error","FileReader","reader","onloadend","url","result","replace","popup","open","location","href","undefined","readyState","DONE","readAsDataURL","INIT","createObjectURL","opened","download","FS_proto","prototype","msSaveOrOpenBlob","abort","WRITING","error","onwritestart","onprogress","onwrite","onabort","onerror","onwriteend","self","window","this","content","module","exports","defaultOptions","filename","elem","options","renderOptions","Object","assign","backgroundColor","background","finish","callback","toSvg","then","dataUrl","xhr","XMLHttpRequest","responseType","onload","response","send","toBlob"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEM,SAAU,UAAU,CAAC,GAAW,EAAE,OAAsB,EAAA;;IAE5D,IAAA,IAAI,GAAG,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE;IAC9B,QAAA,OAAO,GAAG;IACX;;IAGD,IAAA,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;IACtB,QAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,GAAG;IACtC;;IAGD,IAAA,IAAI,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;IAC1B,QAAA,OAAO,GAAG;IACX;QAED,MAAM,GAAG,GAAG,QAAQ,CAAC,cAAc,CAAC,kBAAkB,EAAE;QACxD,MAAM,IAAI,GAAG,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC;QACtC,MAAM,CAAC,GAAG,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC;IAEhC,IAAA,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC1B,IAAA,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAEvB,IAAA,IAAI,OAAO,EAAE;IACX,QAAA,IAAI,CAAC,IAAI,GAAG,OAAO;IACpB;IAED,IAAA,CAAC,CAAC,IAAI,GAAG,GAAG;QAEZ,OAAO,CAAC,CAAC,IAAI;IACf;IAEO,M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AA,CAAA;SAGC,MAAA;YAEHC,MAAOlB,CAAAA,IAAAA,EAAME,aACVQ,CAAAA,CAAAA,IAAI,CAACH,MAAAA,CAAAA;IAEV;IAEF;;;;;;;;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10]}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*
|
|
2
|
+
@d3plus/export v3.0.0
|
|
3
|
+
Export methods for transforming and downloading SVG.
|
|
4
|
+
Copyright (c) 2025 D3plus - https://d3plus.org
|
|
5
|
+
@license MIT
|
|
6
|
+
*/
|
|
7
|
+
(e=>{"function"==typeof define&&define.amd?define(e):e()})(function(){if("undefined"!=typeof window){try{if("undefined"==typeof SVGElement||Boolean(SVGElement.prototype.innerHTML))return}catch(e){return}function n(e){switch(e.nodeType){case 1:var t=e,r="";return r+="<"+t.tagName,t.hasAttributes()&&[].forEach.call(t.attributes,function(e){r+=" "+e.name+'="'+e.value+'"'}),r+=">",t.hasChildNodes()&&[].forEach.call(t.childNodes,function(e){r+=n(e)}),r+="</"+t.tagName+">";case 3:return e.textContent.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");case 8:return"\x3c!--"+e.nodeValue+"--\x3e"}}Object.defineProperty(SVGElement.prototype,"innerHTML",{get:function(){var t="";return[].forEach.call(this.childNodes,function(e){t+=n(e)}),t},set:function(e){for(;this.firstChild;)this.removeChild(this.firstChild);try{var t=new DOMParser,r=(t.async=!1,"<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>"+e+"</svg>"),n=t.parseFromString(r,"text/xml").documentElement;[].forEach.call(n.childNodes,function(e){this.appendChild(this.ownerDocument.importNode(e,!0))}.bind(this))}catch(e){throw new Error("Error parsing markup string")}}}),Object.defineProperty(SVGElement.prototype,"innerSVG",{get:function(){return this.innerHTML},set:function(e){this.innerHTML=e}})}}),((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define("@d3plus/export",["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).d3plus={})})(this,function(e){let i=(()=>{
|
|
8
|
+
// generate uuid for className of pseudo elements.
|
|
9
|
+
// We should not use GUIDs, otherwise pseudo elements sometimes cannot be captured.
|
|
10
|
+
let e=0;
|
|
11
|
+
// ref: http://stackoverflow.com/a/6248722/2519373
|
|
12
|
+
return()=>(e+=1,"u"+// eslint-disable-next-line no-bitwise
|
|
13
|
+
("0000"+(Math.random()*36**4<<0).toString(36)).slice(-4)+e)})();function s(r){var n=[];for(let e=0,t=r.length;e<t;e++)n.push(r[e]);return n}let t=null;function c(e={}){if(!t){if(e.includeStyleProperties)return t=e.includeStyleProperties;t=s(window.getComputedStyle(document.documentElement))}return t}function o(e,t){e=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return e?parseFloat(e.replace("px","")):0}function l(e,t={}){var r,n,a;return{width:t.width||(n=o(r=e,"border-left-width"),a=o(r,"border-right-width"),r.clientWidth+n+a),height:t.height||(n=o(r=e,"border-top-width"),a=o(r,"border-bottom-width"),r.clientHeight+n+a)}}
|
|
14
|
+
// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas#maximum_canvas_size
|
|
15
|
+
let u=16384;function d(n){return new Promise((e,t)=>{let r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>e(r))})},r.onerror=t,r.crossOrigin="anonymous",r.decoding="async",r.src=n})}async function h(e,t,r){var n="http://www.w3.org/2000/svg",a=document.createElementNS(n,"svg"),n=document.createElementNS(n,"foreignObject");return a.setAttribute("width",""+t),a.setAttribute("height",""+r),a.setAttribute("viewBox",`0 0 ${t} `+r),n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("x","0"),n.setAttribute("y","0"),n.setAttribute("externalResourcesRequired","true"),a.appendChild(n),n.appendChild(e),(async e=>Promise.resolve().then(()=>(new XMLSerializer).serializeToString(e)).then(encodeURIComponent).then(e=>"data:image/svg+xml;charset=utf-8,"+e))(a)}let f=(e,t)=>e instanceof t||null!==(e=Object.getPrototypeOf(e))&&(e.constructor.name===t.name||f(e,t));function p(e,t,r,n){var a,o,e=`.${e}:`+t,t=r.cssText?(o=(t=r).getPropertyValue("content"),`${t.cssText} content: '${o.replace(/'|"/g,"")}';`):(a=r,c(n).map(e=>e+`: ${a.getPropertyValue(e)}${a.getPropertyPriority(e)?" !important":""};`).join(" "));return document.createTextNode(e+`{${t}}`)}function m(e,t,r,n){var e=window.getComputedStyle(e,r),a=e.getPropertyValue("content");if(""!==a&&"none"!==a){a=i();try{t.className=t.className+" "+a}catch(e){return}var o=document.createElement("style");o.appendChild(p(a,r,e,n)),t.appendChild(o)}}var r="application/font-woff",n="image/jpeg";let a={woff:r,woff2:r,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:n,jpeg:n,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function g(e){e=((e=/\.([^./]*?)$/g.exec(e=e))?e[1]:"").toLowerCase();return a[e]||""}function w(e){return-1!==e.search(/^(data:)/)}async function y(e,t,n){let a=await fetch(e,t);if(404===a.status)throw new Error(`Resource "${a.url}" not found`);let o=await a.blob();return new Promise((e,t)=>{let r=new FileReader;r.onerror=t,r.onloadend=()=>{try{e(n({res:a,result:r.result}))}catch(e){t(e)}},r.readAsDataURL(o)})}let v={};async function b(r,n,a){var e=((e,t,r)=>{let n=e.replace(/\?.*/,"");return r&&(n=e),
|
|
16
|
+
// font resource
|
|
17
|
+
/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]`+n:n})(r,n,a.includeQueryParams);if(null!=v[e])return v[e];
|
|
18
|
+
// ref: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache
|
|
19
|
+
a.cacheBust&&(
|
|
20
|
+
// eslint-disable-next-line no-param-reassign
|
|
21
|
+
r+=(/\?/.test(r)?"&":"?")+(new Date).getTime());let o;try{var t=await y(r,a.fetchRequestInit,({res:e,result:t})=>(n=n||e.headers.get("Content-Type")||"",t.split(/,/)[1]));o=`data:${n};base64,`+t}catch(e){o=a.imagePlaceholder||"";let t="Failed to fetch resource: "+r;(t=e?"string"==typeof e?e:e.message:t)&&console.warn(t)}return v[e]=o}async function E(e,t){return f(e,HTMLCanvasElement)?(async e=>{var t=e.toDataURL();return"data:,"===t?e.cloneNode(!1):d(t)})(e):f(e,HTMLVideoElement)?(async(t,e)=>{if(t.currentSrc){var r=document.createElement("canvas"),n=r.getContext("2d");r.width=t.clientWidth,r.height=t.clientHeight,null!=n&&n.drawImage(t,0,0,r.width,r.height);let e=r.toDataURL();return d(e)}let a=await b(n=t.poster,g(n),e);return d(a)})(e,t):f(e,HTMLIFrameElement)?(async(e,t)=>{var r;try{if(null!=(r=null==e?void 0:e.contentDocument)&&r.body)return await x(e.contentDocument.body,t,!0)}catch(e){
|
|
22
|
+
// Failed to clone iframe
|
|
23
|
+
}return e.cloneNode(!1)})(e,t):e.cloneNode(S(e))}let D=e=>null!=e.tagName&&"SLOT"===e.tagName.toUpperCase(),S=e=>null!=e.tagName&&"SVG"===e.tagName.toUpperCase();function V(e,t,r){if(f(t,Element)){{var o=e;var i=t;var l=r;let a=i.style;if(a){let n=window.getComputedStyle(o);n.cssText?(a.cssText=n.cssText,a.transformOrigin=n.transformOrigin):c(l).forEach(e=>{let t=n.getPropertyValue(e);var r;"font-size"===e&&t.endsWith("px")&&(r=Math.floor(parseFloat(t.substring(0,t.length-2)))-.1,t=r+"px"),f(o,HTMLIFrameElement)&&"display"===e&&"inline"===t&&(t="block"),"d"===e&&i.getAttribute("d")&&(t=`path(${i.getAttribute("d")})`),a.setProperty(e,t,n.getPropertyPriority(e))})}}m(l=e,a=t,":before",r=r),m(l,a,":after",r),l=e,a=t,f(l,HTMLTextAreaElement)&&(a.innerHTML=l.value),f(l,HTMLInputElement)&&a.setAttribute("value",l.value),n=e,r=t,f(n,HTMLSelectElement)&&(r=Array.from(r.children).find(e=>n.value===e.getAttribute("value")))&&r.setAttribute("selected","")}var n,a;return t}async function x(t,r,e){return e||!r.filter||r.filter(t)?Promise.resolve(t).then(e=>E(e,r)).then(e=>(async(t,r,n)=>{var a;if(!S(r)){let e=[];0===(e=D(t)&&t.assignedNodes?s(t.assignedNodes()):f(t,HTMLIFrameElement)&&null!=(a=t.contentDocument)&&a.body?s(t.contentDocument.body.childNodes):s((null!=(a=t.shadowRoot)?a:t).childNodes)).length||f(t,HTMLVideoElement)||await e.reduce((e,t)=>e.then(()=>x(t,n)).then(e=>{e&&r.appendChild(e)}),Promise.resolve())}return r})(t,e,r)).then(e=>V(t,e,r)).then(e=>(async(t,r)=>{var n=t.querySelectorAll?t.querySelectorAll("use"):[];if(0!==n.length){var a={};for(let e=0;e<n.length;e++){var o,i,l=n[e].getAttribute("xlink:href");l&&(o=t.querySelector(l),i=document.querySelector(l),o||!i||a[l]||(
|
|
24
|
+
// eslint-disable-next-line no-await-in-loop
|
|
25
|
+
a[l]=await x(i,r,!0)))}var s=Object.values(a);if(s.length){var e="http://www.w3.org/1999/xhtml",c=document.createElementNS(e,"svg"),u=(c.setAttribute("xmlns",e),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none",document.createElementNS(e,"defs"));c.appendChild(u);for(let e=0;e<s.length;e++)u.appendChild(s[e]);t.appendChild(c)}}return t})(e,r)):null}let C=/url\((['"]?)([^'"]+?)\1\)/g,$=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,F=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;async function j(t,r,n,a,o){try{var i=n?(u=n,
|
|
26
|
+
// url is absolute already
|
|
27
|
+
(c=r).match(/^[a-z]+:\/\//i)?c:
|
|
28
|
+
// url is absolute already, without protocol
|
|
29
|
+
c.match(/^\/\//)?window.location.protocol+c:
|
|
30
|
+
// dataURI, mailto:, tel:, etc.
|
|
31
|
+
c.match(/^[a-z]+:/i)?c:(h=(d=document.implementation.createHTMLDocument()).createElement("base"),f=d.createElement("a"),d.head.appendChild(h),d.body.appendChild(f),u&&(h.href=u),f.href=c,f.href)):r,l=g(r);let e;return o||(e=await b(i,l,a)),t.replace((s=(s=r).replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1"),new RegExp(`(url\\(['"]?)(${s})(['"]?\\))`,"g")),`$1${e}$3`)}catch(e){
|
|
32
|
+
// pass
|
|
33
|
+
}var s,c,u,d,h,f;return t}function T(e){return-1!==e.search(C)}async function R(e,r,n){var t,a;return T(e)?([t,a]=[e,n.preferredFontFormat],(e=>{let n=[];return e.replace(C,(e,t,r)=>(n.push(r),e)),n.filter(e=>!w(e))})(t=a?t.replace(F,e=>{
|
|
34
|
+
// eslint-disable-next-line no-constant-condition
|
|
35
|
+
for(;;){var[t,,r]=$.exec(e)||[];if(!r)return"";if(r===a)return`src: ${t};`}}):t).reduce((e,t)=>e.then(e=>j(e,t,r,n)),Promise.resolve(t))):e}async function N(e,t,r){var n=null==(n=t.style)?void 0:n.getPropertyValue(e);return!!n&&(n=await R(n,null,r),t.style.setProperty(e,n,t.style.getPropertyPriority(e)),!0)}async function P(e,t){if(f(e,Element)){await N("background",l=e,a=t)||await N("background-image",l,a),await!(await N("mask",l,a)||await N("-webkit-mask",l,a)||await N("mask-image",l,a)||await N("-webkit-mask-image",l,a));{var o=e;var i=t;let a=f(o,HTMLImageElement);if(a&&!w(o.src)||f(o,SVGImageElement)&&!w(o.href.baseVal)){l=a?o.src:o.href.baseVal;let n=await b(l,g(l),i);await new Promise((t,r)=>{o.onload=t,o.onerror=i.onImageErrorHandler?(...e)=>{try{t(i.onImageErrorHandler(...e))}catch(e){r(e)}}:r;var e=o;e.decode&&(e.decode=t),"lazy"===e.loading&&(e.loading="eager"),a?(o.srcset="",o.src=n):o.href.baseVal=n})}}await 0,n=t,a=s((r=e).childNodes).map(e=>P(e,n)),await Promise.all(a).then(()=>r)}var r,n,l,a}let L={};async function k(e){var t=L[e];return null==t&&(t={url:e,cssText:await(await fetch(e)).text()},L[e]=t),t}async function A(r,n){let a=r.cssText,o=/url\(["']?([^"')]+)["']?\)/g;var e=(a.match(/url\([^)]+\)/g)||[]).map(async t=>{let e=t.replace(o,"$1");return y(e=e.startsWith("https://")?e:new URL(e,r.url).href,n.fetchRequestInit,({result:e})=>(a=a.replace(t,`url(${e})`),[t,e]))});return Promise.all(e).then(()=>a)}function I(e){if(null==e)return[];var t=[];
|
|
36
|
+
// strip out comments
|
|
37
|
+
let r=e.replace(/(\/\*[\s\S]*?\*\/)/gi,"");
|
|
38
|
+
// eslint-disable-next-line prefer-regex-literals
|
|
39
|
+
// eslint-disable-next-line no-constant-condition
|
|
40
|
+
for(var n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");;){var a=n.exec(r);if(null===a)break;t.push(a[0])}r=r.replace(n,"");
|
|
41
|
+
// eslint-disable-next-line no-constant-condition
|
|
42
|
+
for(var o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi")
|
|
43
|
+
// to match css & media queries together
|
|
44
|
+
;;){let e=o.exec(r);if(null===e){if(null===(e=i.exec(r)))break;o.lastIndex=i.lastIndex}else i.lastIndex=o.lastIndex;t.push(e[0])}return t}async function U(e,t){if(null==e.ownerDocument)throw new Error("Provided element is not within a Document");return(await(async(r,a)=>{let n=[],o=[];
|
|
45
|
+
// First loop inlines imports
|
|
46
|
+
return r.forEach(n=>{if("cssRules"in n)try{s(n.cssRules||[]).forEach((e,t)=>{if(e.type===CSSRule.IMPORT_RULE){let r=t+1;t=k(e.href).then(e=>A(e,a)).then(e=>I(e).forEach(t=>{try{n.insertRule(t,t.startsWith("@import")?r+=1:n.cssRules.length)}catch(e){console.error("Error inserting rule from remote css",{rule:t,error:e})}})).catch(e=>{console.error("Error loading remote css",e.toString())});o.push(t)}})}catch(e){let t=r.find(e=>null==e.href)||document.styleSheets[0];null!=n.href&&o.push(k(n.href).then(e=>A(e,a)).then(e=>I(e).forEach(e=>{t.insertRule(e,t.cssRules.length)})).catch(e=>{console.error("Error loading remote stylesheet",e)})),console.error("Error inlining remote css file",e)}}),Promise.all(o).then(()=>(
|
|
47
|
+
// Second loop parses rules
|
|
48
|
+
r.forEach(t=>{if("cssRules"in t)try{s(t.cssRules||[]).forEach(e=>{n.push(e)})}catch(e){console.error("Error while reading CSS rules from "+t.href,e)}}),n))})(s(e.ownerDocument.styleSheets),t)).filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>T(e.style.getPropertyValue("src")))}function O(e){return e.trim().replace(/["']/g,"")}function q(e){let r=new Set;return function t(e){(e.style.fontFamily||getComputedStyle(e).fontFamily).split(",").forEach(e=>{r.add(O(e))}),Array.from(e.children).forEach(e=>{e instanceof HTMLElement&&t(e)})}(e),r}async function B(e,t){var r,t=null!=t.fontEmbedCSS?t.fontEmbedCSS:t.skipFonts?null:await(async(e,r)=>{var t=await U(e,r);let n=q(e);return(await Promise.all(t.filter(e=>n.has(O(e.style.fontFamily))).map(e=>{var t=e.parentStyleSheet?e.parentStyleSheet.href:null;return R(e.cssText,t,r)}))).join("\n")})(e,t);t&&(r=document.createElement("style"),t=document.createTextNode(t),r.appendChild(t),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r))}async function M(e,n={}){var{width:t,height:r}=l(e,n),e=await x(e,n,!0);await B(e,n),await P(e,n);{var a=e;let t=a.style,r=(n.backgroundColor&&(t.backgroundColor=n.backgroundColor),n.width&&(t.width=n.width+"px"),n.height&&(t.height=n.height+"px"),n.style);null!=r&&Object.keys(r).forEach(e=>{t[e]=r[e]})}return await h(e,t,r)}async function G(e,t={}){var{width:r,height:n}=l(e,t),e=await d(await M(e,t)),a=document.createElement("canvas"),o=a.getContext("2d"),i=t.pixelRatio||(()=>{let e,t;try{t=process}catch(e){
|
|
49
|
+
// pass
|
|
50
|
+
}var r=t&&t.env?t.env.devicePixelRatio:null;return(e=r&&(e=parseInt(r,10),Number.isNaN(e))?1:e)||window.devicePixelRatio||1})(),r=t.canvasWidth||r,n=t.canvasHeight||n;return a.width=r*i,a.height=n*i,t.skipAutoScale||((i=a).width>u||i.height>u)&&(i.width>u&&i.height>u?i.width>i.height?(i.height*=u/i.width,i.width=u):(i.width*=u/i.height,i.height=u):i.width>u?(i.height*=u/i.width,i.width=u):(i.width*=u/i.height,i.height=u)),a.style.width=""+r,a.style.height=""+n,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(e,0,0,a.width,a.height),a}async function W(e,t={}){var a,o,e=await G(e,t);return o={},await((a=e).toBlob?new Promise(e=>{a.toBlob(e,o.type||"image/png",o.quality||1)}):new Promise(e=>{var t=window.atob(a.toDataURL(o.type||void 0,o.quality||void 0).split(",")[1]),r=t.length,n=new Uint8Array(r);for(let e=0;e<r;e+=1)n[e]=t.charCodeAt(e);e(new Blob([n],{type:o.type||"image/png"}))}))}r={exports:{}};
|
|
51
|
+
/* FileSaver.js
|
|
52
|
+
* A saveAs() FileSaver implementation.
|
|
53
|
+
* 1.3.2
|
|
54
|
+
* 2016-06-16 18:25:19
|
|
55
|
+
*
|
|
56
|
+
* By Eli Grey, http://eligrey.com
|
|
57
|
+
* License: MIT
|
|
58
|
+
* See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md
|
|
59
|
+
*/H||(H=1,n=r,H=(l=>{
|
|
60
|
+
// IE <10 is explicitly unsupported
|
|
61
|
+
var s,c,u,d,h,f,o,p,t,m,g,w,n,e;if(!(void 0===l||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)))
|
|
62
|
+
// IE 10+ (native saveAs)
|
|
63
|
+
return e=l.document,s=function(){return l.URL||l.webkitURL||l},c=e.createElementNS("http://www.w3.org/1999/xhtml","a"),u="download"in c,d=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},h=/constructor/i.test(l.HTMLElement)||l.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),o=function(e){(l.setImmediate||l.setTimeout)(function(){throw e},0)},p="application/octet-stream",t=4e4,m=function(e){setTimeout(function(){"string"==typeof e?s().revokeObjectURL(e):e.remove()},t)},g=function(e,t,r){for(var n=(t=[].concat(t)).length;n--;){var a=e["on"+t[n]];if("function"==typeof a)try{a.call(e,r||e)}catch(e){o(e)}}},w=function(e){
|
|
64
|
+
// prepend BOM for UTF-8 XML and text/* types (including HTML)
|
|
65
|
+
// note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF
|
|
66
|
+
return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},e=(n=function(e,t,r){r||(e=w(e));
|
|
67
|
+
// First try a.download, then web filesystem, then object URLs
|
|
68
|
+
var n,a,o=this,r=e.type===p,i=function(){g(o,"writestart progress write writeend".split(" "))};o.readyState=o.INIT,u?(n=s().createObjectURL(e),setTimeout(function(){c.href=n,c.download=t,d(c),i(),m(n),o.readyState=o.DONE})):(f||r&&h)&&l.FileReader?((a=new FileReader).onloadend=function(){var e=f?a.result:a.result.replace(/^data:[^;]*;/,"data:attachment/file;");l.open(e,"_blank")||(l.location.href=e),// release reference before dispatching
|
|
69
|
+
o.readyState=o.DONE,i()},a.readAsDataURL(e),o.readyState=o.INIT):(
|
|
70
|
+
// don't create more object URLs than needed
|
|
71
|
+
n=n||s().createObjectURL(e),!r&&l.open(n,"_blank")||(
|
|
72
|
+
// Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html
|
|
73
|
+
l.location.href=n),o.readyState=o.DONE,i(),m(n))}).prototype,"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,r){return t=t||e.name||"download",r||(e=w(e)),navigator.msSaveOrOpenBlob(e,t)}:(e.abort=function(){},e.readyState=e.INIT=0,e.WRITING=1,e.DONE=2,e.error=e.onwritestart=e.onprogress=e.onwrite=e.onabort=e.onerror=e.onwriteend=null,function(e,t,r){return new n(e,t||e.name||"download",r)})})("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||r.exports.content),
|
|
74
|
+
// `self` is undefined in Firefox for Android content script context
|
|
75
|
+
// while `this` is nsIContentFrameMessageManager
|
|
76
|
+
// with an attribute `content` that corresponds to the window
|
|
77
|
+
n.exports&&(n.exports.saveAs=H));var H,z=r.exports;let _={filename:"download",type:"png"};
|
|
78
|
+
/**
|
|
79
|
+
@function saveElement
|
|
80
|
+
@desc Downloads an HTML Element as a bitmap PNG image.
|
|
81
|
+
@param {HTMLElement} elem A single element to be saved to one file.
|
|
82
|
+
@param {Object} [options] Additional options to specify.
|
|
83
|
+
@param {String} [options.filename = "download"] Filename for the downloaded file, without the extension.
|
|
84
|
+
@param {String} [options.type = "png"] File type of the saved document. Accepted values are `"png"` and `"jpg"`.
|
|
85
|
+
@param {Function} [options.callback] Function to be invoked after saving is complete.
|
|
86
|
+
@param {Object} [renderOptions] Custom options to be passed to the html-to-image function.
|
|
87
|
+
*/e.saveElement=function(e,t={},r={}){function n(e){z.saveAs(e,t.filename+"."+t.type),t.callback&&t.callback()}e&&(t=Object.assign({},_,t),
|
|
88
|
+
// rename renderOptions.background to backgroundColor for backwards compatibility
|
|
89
|
+
r=Object.assign({backgroundColor:r.background},r),"svg"===t.type?M(e,r).then(e=>{let t=new XMLHttpRequest;t.open("GET",e),t.responseType="blob",t.onload=()=>n(t.response),t.send()}):W(e,r).then(n))}});
|
|
90
|
+
//# sourceMappingURL=d3plus-export.full.js.map
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/*
|
|
2
|
+
@d3plus/export v3.0.0
|
|
3
|
+
Export methods for transforming and downloading SVG.
|
|
4
|
+
Copyright (c) 2025 D3plus - https://d3plus.org
|
|
5
|
+
@license MIT
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
(function (factory) {
|
|
9
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
|
10
|
+
factory();
|
|
11
|
+
})((function () { 'use strict';
|
|
12
|
+
|
|
13
|
+
if (typeof window !== "undefined") {
|
|
14
|
+
(function () {
|
|
15
|
+
try {
|
|
16
|
+
if (typeof SVGElement === 'undefined' || Boolean(SVGElement.prototype.innerHTML)) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
} catch (e) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function serializeNode (node) {
|
|
24
|
+
switch (node.nodeType) {
|
|
25
|
+
case 1:
|
|
26
|
+
return serializeElementNode(node);
|
|
27
|
+
case 3:
|
|
28
|
+
return serializeTextNode(node);
|
|
29
|
+
case 8:
|
|
30
|
+
return serializeCommentNode(node);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function serializeTextNode (node) {
|
|
35
|
+
return node.textContent.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function serializeCommentNode (node) {
|
|
39
|
+
return '<!--' + node.nodeValue + '-->'
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function serializeElementNode (node) {
|
|
43
|
+
var output = '';
|
|
44
|
+
|
|
45
|
+
output += '<' + node.tagName;
|
|
46
|
+
|
|
47
|
+
if (node.hasAttributes()) {
|
|
48
|
+
[].forEach.call(node.attributes, function(attrNode) {
|
|
49
|
+
output += ' ' + attrNode.name + '="' + attrNode.value + '"';
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
output += '>';
|
|
54
|
+
|
|
55
|
+
if (node.hasChildNodes()) {
|
|
56
|
+
[].forEach.call(node.childNodes, function(childNode) {
|
|
57
|
+
output += serializeNode(childNode);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
output += '</' + node.tagName + '>';
|
|
62
|
+
|
|
63
|
+
return output;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
Object.defineProperty(SVGElement.prototype, 'innerHTML', {
|
|
67
|
+
get: function () {
|
|
68
|
+
var output = '';
|
|
69
|
+
|
|
70
|
+
[].forEach.call(this.childNodes, function(childNode) {
|
|
71
|
+
output += serializeNode(childNode);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
return output;
|
|
75
|
+
},
|
|
76
|
+
set: function (markup) {
|
|
77
|
+
while (this.firstChild) {
|
|
78
|
+
this.removeChild(this.firstChild);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
try {
|
|
82
|
+
var dXML = new DOMParser();
|
|
83
|
+
dXML.async = false;
|
|
84
|
+
|
|
85
|
+
var sXML = '<svg xmlns=\'http://www.w3.org/2000/svg\' xmlns:xlink=\'http://www.w3.org/1999/xlink\'>' + markup + '</svg>';
|
|
86
|
+
var svgDocElement = dXML.parseFromString(sXML, 'text/xml').documentElement;
|
|
87
|
+
|
|
88
|
+
[].forEach.call(svgDocElement.childNodes, function(childNode) {
|
|
89
|
+
this.appendChild(this.ownerDocument.importNode(childNode, true));
|
|
90
|
+
}.bind(this));
|
|
91
|
+
} catch (e) {
|
|
92
|
+
throw new Error('Error parsing markup string');
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
Object.defineProperty(SVGElement.prototype, 'innerSVG', {
|
|
98
|
+
get: function () {
|
|
99
|
+
return this.innerHTML;
|
|
100
|
+
},
|
|
101
|
+
set: function (markup) {
|
|
102
|
+
this.innerHTML = markup;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
})();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
}));
|
|
110
|
+
|
|
111
|
+
(function (global, factory) {
|
|
112
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('html-to-image'), require('file-saver')) :
|
|
113
|
+
typeof define === 'function' && define.amd ? define('@d3plus/export', ['exports', 'html-to-image', 'file-saver'], factory) :
|
|
114
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3plus = {}, global.htmlToImage, global.fileSaver));
|
|
115
|
+
})(this, (function (exports, htmlToImage, fileSaver) { 'use strict';
|
|
116
|
+
|
|
117
|
+
const defaultOptions = {
|
|
118
|
+
filename: "download",
|
|
119
|
+
type: "png"
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
@function saveElement
|
|
123
|
+
@desc Downloads an HTML Element as a bitmap PNG image.
|
|
124
|
+
@param {HTMLElement} elem A single element to be saved to one file.
|
|
125
|
+
@param {Object} [options] Additional options to specify.
|
|
126
|
+
@param {String} [options.filename = "download"] Filename for the downloaded file, without the extension.
|
|
127
|
+
@param {String} [options.type = "png"] File type of the saved document. Accepted values are `"png"` and `"jpg"`.
|
|
128
|
+
@param {Function} [options.callback] Function to be invoked after saving is complete.
|
|
129
|
+
@param {Object} [renderOptions] Custom options to be passed to the html-to-image function.
|
|
130
|
+
*/ function saveElement(elem, options = {}, renderOptions = {}) {
|
|
131
|
+
if (!elem) return;
|
|
132
|
+
options = Object.assign({}, defaultOptions, options);
|
|
133
|
+
// rename renderOptions.background to backgroundColor for backwards compatibility
|
|
134
|
+
renderOptions = Object.assign({
|
|
135
|
+
backgroundColor: renderOptions.background
|
|
136
|
+
}, renderOptions);
|
|
137
|
+
function finish(blob) {
|
|
138
|
+
fileSaver.saveAs(blob, `${options.filename}.${options.type}`);
|
|
139
|
+
if (options.callback) options.callback();
|
|
140
|
+
}
|
|
141
|
+
if (options.type === "svg") {
|
|
142
|
+
htmlToImage.toSvg(elem, renderOptions).then((dataUrl)=>{
|
|
143
|
+
const xhr = new XMLHttpRequest();
|
|
144
|
+
xhr.open("GET", dataUrl);
|
|
145
|
+
xhr.responseType = "blob";
|
|
146
|
+
xhr.onload = ()=>finish(xhr.response);
|
|
147
|
+
xhr.send();
|
|
148
|
+
});
|
|
149
|
+
} else {
|
|
150
|
+
htmlToImage.toBlob(elem, renderOptions).then(finish);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
exports.saveElement = saveElement;
|
|
155
|
+
|
|
156
|
+
}));
|
|
157
|
+
//# sourceMappingURL=d3plus-export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"d3plus-export.js","sources":["../src/saveElement.js"],"sourcesContent":["import {toBlob, toSvg} from \"html-to-image\";\nimport {saveAs} from \"file-saver\";\n\nconst defaultOptions = {\n filename: \"download\",\n type: \"png\"\n};\n\n/**\n @function saveElement\n @desc Downloads an HTML Element as a bitmap PNG image.\n @param {HTMLElement} elem A single element to be saved to one file.\n @param {Object} [options] Additional options to specify.\n @param {String} [options.filename = \"download\"] Filename for the downloaded file, without the extension.\n @param {String} [options.type = \"png\"] File type of the saved document. Accepted values are `\"png\"` and `\"jpg\"`.\n @param {Function} [options.callback] Function to be invoked after saving is complete.\n @param {Object} [renderOptions] Custom options to be passed to the html-to-image function.\n*/\nexport default function(elem, options = {}, renderOptions = {}) {\n\n if (!elem) return;\n options = Object.assign({}, defaultOptions, options);\n\n // rename renderOptions.background to backgroundColor for backwards compatibility\n renderOptions = Object.assign({backgroundColor: renderOptions.background}, renderOptions);\n\n function finish(blob) {\n saveAs(blob, `${options.filename}.${options.type}`);\n if (options.callback) options.callback();\n }\n\n if (options.type === \"svg\") {\n\n toSvg(elem, renderOptions)\n .then(dataUrl => {\n\n const xhr = new XMLHttpRequest();\n xhr.open(\"GET\", dataUrl);\n xhr.responseType = \"blob\";\n xhr.onload = () => finish(xhr.response);\n xhr.send();\n\n });\n\n }\n else {\n\n toBlob(elem, renderOptions)\n .then(finish);\n\n }\n\n}\n"],"names":["defaultOptions","filename","type","elem","options","renderOptions","Object","assign","backgroundColor","background","finish","blob","saveAs","callback","toSvg","then","dataUrl","xhr","XML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,CAAA;EACtCL,YAAAA,GAAAA,CAAIM,IAAI,EAAA;EAEV,SAAA,CAAA;OAGC,MAAA;UAEHC,kBAAOrB,CAAAA,IAAAA,EAAME,aACVU,CAAAA,CAAAA,IAAI,CAACL,MAAAA,CAAAA;EAEV;EAEF;;;;;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
@d3plus/export v3.0.0
|
|
3
|
+
Export methods for transforming and downloading SVG.
|
|
4
|
+
Copyright (c) 2025 D3plus - https://d3plus.org
|
|
5
|
+
@license MIT
|
|
6
|
+
*/
|
|
7
|
+
(e=>{"function"==typeof define&&define.amd?define(e):e()})(function(){if("undefined"!=typeof window){try{if("undefined"==typeof SVGElement||Boolean(SVGElement.prototype.innerHTML))return}catch(e){return}function o(e){switch(e.nodeType){case 1:var t=e,n="";return n+="<"+t.tagName,t.hasAttributes()&&[].forEach.call(t.attributes,function(e){n+=" "+e.name+'="'+e.value+'"'}),n+=">",t.hasChildNodes()&&[].forEach.call(t.childNodes,function(e){n+=o(e)}),n+="</"+t.tagName+">";case 3:return e.textContent.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");case 8:return"\x3c!--"+e.nodeValue+"--\x3e"}}Object.defineProperty(SVGElement.prototype,"innerHTML",{get:function(){var t="";return[].forEach.call(this.childNodes,function(e){t+=o(e)}),t},set:function(e){for(;this.firstChild;)this.removeChild(this.firstChild);try{var t=new DOMParser,n=(t.async=!1,"<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>"+e+"</svg>"),o=t.parseFromString(n,"text/xml").documentElement;[].forEach.call(o.childNodes,function(e){this.appendChild(this.ownerDocument.importNode(e,!0))}.bind(this))}catch(e){throw new Error("Error parsing markup string")}}}),Object.defineProperty(SVGElement.prototype,"innerSVG",{get:function(){return this.innerHTML},set:function(e){this.innerHTML=e}})}}),((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("html-to-image"),require("file-saver")):"function"==typeof define&&define.amd?define("@d3plus/export",["exports","html-to-image","file-saver"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).d3plus={},e.htmlToImage,e.fileSaver)})(this,function(e,r,i){let a={filename:"download",type:"png"};
|
|
8
|
+
/**
|
|
9
|
+
@function saveElement
|
|
10
|
+
@desc Downloads an HTML Element as a bitmap PNG image.
|
|
11
|
+
@param {HTMLElement} elem A single element to be saved to one file.
|
|
12
|
+
@param {Object} [options] Additional options to specify.
|
|
13
|
+
@param {String} [options.filename = "download"] Filename for the downloaded file, without the extension.
|
|
14
|
+
@param {String} [options.type = "png"] File type of the saved document. Accepted values are `"png"` and `"jpg"`.
|
|
15
|
+
@param {Function} [options.callback] Function to be invoked after saving is complete.
|
|
16
|
+
@param {Object} [renderOptions] Custom options to be passed to the html-to-image function.
|
|
17
|
+
*/e.saveElement=function(e,t={},n={}){function o(e){i.saveAs(e,t.filename+"."+t.type),t.callback&&t.callback()}e&&(t=Object.assign({},a,t),
|
|
18
|
+
// rename renderOptions.background to backgroundColor for backwards compatibility
|
|
19
|
+
n=Object.assign({backgroundColor:n.background},n),"svg"===t.type?r.toSvg(e,n).then(e=>{let t=new XMLHttpRequest;t.open("GET",e),t.responseType="blob",t.onload=()=>o(t.response),t.send()}):r.toBlob(e,n).then(o))}});
|
|
20
|
+
//# sourceMappingURL=d3plus-export.js.map
|