{"version":3,"file":"svgDownload-dphRJogV.cjs","names":[],"sources":["../src/Utils/svgDownload.ts"],"sourcesContent":["import { elementToSVG } from 'dom-to-svg';\r\n/**\r\n * Downloads an SVG representation of a specified HTML element.\r\n *\r\n * Converts the HTML element into an SVG format using the `dom-to-svg` library, serializes it to a string,\r\n * and creates a downloadable `.svg` file.\r\n *\r\n * @param node - The HTMLElement to convert to SVG and download.\r\n * @param filename - The desired filename for the downloaded SVG file (without extension).\r\n *\r\n * @example\r\n * const element = document.getElementById('myElement');\r\n * svgDownload(element, 'downloaded-svg');\r\n */\r\nexport function svgDownload(node: HTMLElement, filename: string) {\r\n  const svgDocument = elementToSVG(node);\r\n  const serializer = new XMLSerializer();\r\n  const xmlString = serializer.serializeToString(svgDocument);\r\n  const blob = new Blob([xmlString], { type: 'application/xml' });\r\n  const link = document.createElement('a');\r\n  link.href = window.URL.createObjectURL(blob);\r\n  link.download = `${filename}.svg`;\r\n  document.body.appendChild(link);\r\n  link.click();\r\n  document.body.removeChild(link);\r\n}\r\n"],"mappings":"4BAcA,SAAgB,EAAY,EAAmB,EAAkB,CAC/D,IAAM,GAAA,EAAA,EAAA,cAA2B,CAAI,EAE/B,EAAY,IADK,cACL,EAAW,kBAAkB,CAAW,EACpD,EAAO,IAAI,KAAK,CAAC,CAAS,EAAG,CAAE,KAAM,iBAAkB,CAAC,EACxD,EAAO,SAAS,cAAc,GAAG,EACvC,EAAK,KAAO,OAAO,IAAI,gBAAgB,CAAI,EAC3C,EAAK,SAAW,GAAG,EAAS,MAC5B,SAAS,KAAK,YAAY,CAAI,EAC9B,EAAK,MAAM,EACX,SAAS,KAAK,YAAY,CAAI,CAChC"}