PageSourceSearch

https://www.svgai.org/_next/static/chunks/1662.04116ea0a7676637.js

js svgai.org collected 2026-10-04 08:37:16 UTC 4,361 bytes, 53 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1662],{10651:(e,t,s)=>{s.d(t,{JX:()=>c,N$:()=>a,OD:()=>r,pc:()=>n,zx:()=>o});class i extends Error{constructor(e,t,s=400){super(e),this.name=this.constructor.name,this.code=t,this.statusCode=s,Object.setPrototypeOf(this,new.target.prototype)}}class r extends i{constructor(e,t="FILE_VALIDATION_FAILED"){super(e,t,400)}}class o extends i{constructor(e,t="CONVERSION_FAILED"){super(e,t,500)}}class a extends i{constructor(e,t,s){super(s||(e?`Format '${e}' is not supported`:"Unsupported file format"),"UNSUPPORTED_FORMAT",400),this.format=e,this.supportedFormats=t}}class n extends i{constructor(e,t){super(e?`The ${e.toUpperCase()} file appears to be corrupted or invalid. ${t||"Please try with a different file."}`:`The file appears to be corrupted or invalid. ${t||"Please try with a different file."}`,"CORRUPTED_FILE",400)}}let l={NETWORK_ERROR:"Network error occurred during conversion",TIMEOUT:"Conversion timed out. Please try with a smaller file",ENCODING_ERROR:"Unable to process the file encoding. Please ensure the file is not corrupted."};function c(e){if(e instanceof i)return e.message;if(e instanceof Error){let t=e.message.toLowerCase();return t.includes("memory")||t.includes("heap")?"The file is too large to process. Please try with a smaller file or reduce its dimensions.":t.includes("timeout")?l.TIMEOUT:t.includes("network")||t.includes("fetch")?l.NETWORK_ERROR:t.includes("encoding")||t.includes("decode")?l.ENCODING_ERROR:e.message}return"An unexpected error occurred. Please try again."}},21662:(e,t,s)=>{s.d(t,{svgToHtmlHandler:()=>n});var i=s(10651),r=s(119),o=s(44134).Buffer;function a(e,t){let s=e?`#${e}`:t?`.${t}`:".svg-container";return`
2    <style>
3      ${s} {
4        max-width: 100%;
5        height: auto;
6      }
7      ${s} svg {
8        max-width: 100%;
9        height: auto;
10        display: block;
11      }
12      ${s}.svg-responsive {
13        position: relative;
14        width: 100%;
15        padding-bottom: 75%; /* 4:3 aspect ratio */
16        height: 0;
17        overflow: hidden;
18      }
19      ${s}.svg-responsive svg {
20        position: absolute;
21        top: 0;
22        left: 0;
23        width: 100%;
24        height: 100%;
25      }
26    </style>`}let n=async(e,t={})=>{try{let s=function(e){if("string"==typeof e){let t=e.trim();if(!t.includes("<svg")&&!t.includes("<?xml"))throw new i.OD("Invalid SVG: Missing SVG tag");return t}let t=(0,r.ST)(e);if("svg"!==t)throw new i.N$(t||"unknown",["svg"],`Expected SVG format but received ${t||"unknown format"}`);return e.toString("utf8")}(e),{embedMethod:n="inline",fullDocument:l=!1,includeStyles:c=!0,responsive:d=!0,accessible:u=!0,className:h="svg-container",id:m}=t,g=s;u&&!s.includes("role=")&&(g=s.replace("<svg",'<svg role="img"'));let f=s.match(/<title>([^<]+)<\/title>/),p=f?f[1]:"SVG Image",$="";switch(n){case"inline":$=`<div${m?` id="${m}"`:""} class="${h}${d?" svg-responsive":""}">
27  ${g}
28</div>`;break;case"img":let v=`data:image/svg+xml;base64,${o.from(g).toString("base64")}`;$=`<img${m?` id="${m}"`:""} 
29  class="${h}" 
30  src="${v}" 
31  alt="${p}"${d?' style="max-width: 100%; height: auto;"':""} />`;break;case"object":$=`<object${m?` id="${m}"`:""} 
32  class="${h}" 
33  type="image/svg+xml" 
34  data="image.svg"${d?' style="max-width: 100%; height: auto;"':""}>
35  ${g}
36</object>`;break;case"embed":$=`<embed${m?` id="${m}"`:""} 
37  class="${h}" 
38  type="image/svg+xml" 
39  src="image.svg"${d?' style="max-width: 100%; height: auto;"':""} />`;break;case"iframe":$=`<iframe${m?` id="${m}"`:""} 
40  class="${h}" 
41  src="image.svg" 
42  title="${p}"${d?' style="max-width: 100%; height: auto; border: none;"':""}>
43</iframe>`}if(l){let e=c?a(m,h):"";$=`<!DOCTYPE html>
44<html lang="en">
45<head>
46    <meta charset="UTF-8">
47    <meta name="viewport" content="width=device-width, initial-scale=1.0">
48    <title>${p}</title>${e}
49</head>
50<body>
51    ${$}
52</body>
53</html>`}else c&&"inline"===n&&($=a(m,h)+"\n"+$);let w=o.from($,"utf8");return{success:!0,data:w,mimeType:"text/html",metadata:{format:"html",size:w.length,embedMethod:n}}}catch(e){if(e instanceof i.OD||e instanceof i.N$)throw e;if(e instanceof Error)throw new i.zx(`SVG to HTML conversion failed: ${e.message}`,"SVG_TO_HTML_FAILED");throw new i.zx("An unexpected error occurred during SVG to HTML conversion","SVG_TO_HTML_UNKNOWN_ERROR")}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.