1import{bF as At}from"./index-B9Tnya_p.js";import"./vendor-B4gcsg9q.js";const Et={removeMetadata:!0,removeEditorNamespaces:!0,removeHiddenElements:!0,removeEmptyGroups:!0,removeUnusedDefs:!0,minifyWhitespace:!0,coordinatePrecision:1,convertStylesToAttributes:!0,shortenHexColors:!0,removeDefaultAttributes:!0,simplifyPaths:!1,pathSimplificationTolerance:.5,keepIds:!1,keepClasses:!1,preserveAttributes:[]},mt={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",silver:"#c0c0c0",gray:"#808080",grey:"#808080",maroon:"#800000",olive:"#808000",navy:"#000080",purple:"#800080",teal:"#008080",fuchsia:"#ff00ff",aqua:"#00ffff",lime:"#00ff00",orange:"#ffa500",pink:"#ffc0cb",transparent:"transparent",none:"none"},Mt=t=>{const e=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;return e.nodeName==="svg"?e:null},Ct=[{test:t=>t==="none",format:"none"},{test:t=>t==="currentcolor",format:"currentColor"},{test:t=>t==="transparent",format:"none"},{test:t=>!!mt[t],format:"named"},{test:t=>/^#[0-9a-f]{6}$/i.test(t),format:"hex"},{test:t=>/^#[0-9a-f]{3}$/i.test(t),format:"hex-short"},{test:t=>/^rgb\(/i.test(t),format:"rgb"},{test:t=>/^rgba\(/i.test(t),format:"rgba"},{test:t=>/^hsl\(/i.test(t),format:"hsl"},{test:t=>/^hsla\(/i.test(t),format:"hsla"}],Nt=t=>{const e=t.trim().toLowerCase();return Ct.find(r=>r.test(e))?.format??"unknown"},wt=t=>{const e=t.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/);return e?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:t},gt=t=>{const e=t.match(/^#([0-9a-fA-F])\1([0-9a-fA-F])\2([0-9a-fA-F])\3$/i);return e?`#${e[1]}${e[2]}${e[3]}`:t},W=(t,e,r)=>{const a=o=>Math.max(0,Math.min(255,Math.round(o))).toString(16).padStart(2,"0");return`#${a(t)}${a(e)}${a(r)}`},ot=(t,e,r)=>{if(t=t/360,e=e/100,r=r/100,e===0){const n=Math.round(r*255);return{r:n,g:n,b:n}}const a=(n,i,l)=>(l<0&&(l+=1),l>1&&(l-=1),l<1/6?n+(i-n)*6*l:l<1/2?i:l<2/3?n+(i-n)*(2/3-l)*6:n),o=r<.5?r*(1+e):r+e-r*e,s=2*r-o;return{r:Math.round(a(s,o,t+1/3)*255),g:Math.round(a(s,o,t)*255),b:Math.round(a(s,o,t-1/3)*255)}},J=t=>({r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:1}),Pt={none:(t,e)=>{e.isTransparent=!0},currentColor:()=>{},named:(t,e)=>{const r=mt[t.toLowerCase()];r==="transparent"||r==="none"?e.isTransparent=!0:(e.hex=r.toLowerCase(),e.rgba=J(r))},hex:(t,e)=>{e.hex=t.toLowerCase(),e.rgba=J(t)},"hex-short":(t,e)=>{const r=wt(t);e.hex=r.toLowerCase(),e.rgba=J(r)},rgb:(t,e)=>{const r=t.match(/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/i);if(r){const[a,o,s]=[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10)];e.hex=W(a,o,s),e.rgba={r:a,g:o,b:s,a:1}}},rgba:(t,e)=>{const r=t.match(/rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([\d.]+)\s*\)/i);if(r){const[a,o,s,n]=[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),parseFloat(r[4])];e.hex=W(a,o,s),e.rgba={r:a,g:o,b:s,a:n},n===0&&(e.isTransparent=!0)}},hsl:(t,e)=>{const r=t.match(/hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)/i);if(r){const{r:a,g:o,b:s}=ot(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10));e.hex=W(a,o,s),e.rgba={r:a,g:o,b:s,a:1}}},hsla:(t,e)=>{const r=t.match(/hsla\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*,\s*([\d.]+)\s*\)/i);if(r){const{r:a,g:o,b:s}=ot(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10)),n=parseFloat(r[4]);e.hex=W(a,o,s),e.rgba={r:a,g:o,b:s,a:n},n===0&&(e.isTransparent=!0)}},unknown:()=>{}},vt=t=>{const e=t.trim(),r=Nt(e),a={original:t,format:r,hex:null,rgba:null,isTransparent:!1};return Pt[r](e,a),a},Lt=t=>{if(!t)return null;const e=t.trim().split(/[\s,]+/).map(Number);return e.length!==4||e.some(isNaN)?null:{minX:e[0],minY:e[1],width:e[2],height:e[3]}},it=t=>{if(!t)return null;const e=parseFloat(t);return isNaN(e)?null:e},St=t=>{const e=Mt(t);if(!e)return{width:0,height:0,viewBox:""};const r=e.getAttribute("viewBox")||"",a=Lt(r);let o=a?.width||0,s=a?.height||0;const n=it(e.getAttribute("width")),i=it(e.getAttribute("height"));return n!==null&&(o=n),i!==null&&(s=i),{width:o,height:s,viewBox:r}};let K=null;
1async function Tt(){if(!K)try{K=await At(()=>import("./template-editor_false-BWxSAlkH.js"),[])}catch{throw new Error("svgo is required for SVG optimization. Install it: npm install svgo")}return K}const Ft=t=>{const e=["removeDoctype","removeXMLProcInst","removeComments"];return t.removeMetadata&&e.push("removeMetadata","removeTitle","removeDesc"),t.removeEditorNamespaces&&e.push("removeEditorsNSData"),t.removeHiddenElements&&e.push("removeHiddenElems"),t.removeEmptyGroups&&e.push("removeEmptyContainers","collapseGroups"),t.removeUnusedDefs&&e.push("removeUselessDefs"),t.convertStylesToAttributes&&e.push("convertStyleToAttrs"),t.removeDefaultAttributes&&e.push("removeUselessStrokeAndFill","removeUnknownsAndDefaults"),t.keepIds||e.push("cleanupIds"),e.push("removeEmptyAttrs","cleanupNumericValues","convertPathData","convertTransform","sortAttrs","mergePaths"),{multipass:!0,plugins:e,js2svg:{indent:t.minifyWhitespace?0:2,pretty:!t.minifyWhitespace}}},It=t=>t.replace(/#([0-9a-fA-F]{6})\b/g,(e,r)=>gt(`#${r}`)),$t=(t,e)=>{const r=Math.pow(10,e);return t.replace(/(\b(?:x|y|x1|y1|x2|y2|cx|cy|r|rx|ry|width|height)=")([^"]+)(")/g,(a,o,s,n)=>{const i=parseFloat(s);return isNaN(i)?a:`${o}${Math.round(i*r)/r}${n}`})},Rt=t=>t.replace(/>\s+</g,"><").trim().replace(/\s{2,}/g," ").replace(/\s+\/>/g,"/>").replace(/\s*=\s*/g,"="),Yt=async(t,e={})=>{const r={...Et,...e};try{let a=(await Tt()).optimize(t,Ft(r)).data;return r.shortenHexColors&&(a=It(a)),r.coordinatePrecision<3&&(a=$t(a,r.coordinatePrecision)),r.minifyWhitespace&&(a=Rt(a)),a}catch{return t}},k={TOLERANCE:5,CLUSTERING_TOLERANCE:2,ARC_CENTER_TOLERANCE:10,CONCENTRIC_CENTER_TOLERANCE:20,RADIAL_LINE_TOLERANCE:15},q={MIN_PIE_SLICES:2,MIN_PIE_COLORS:2,MIN_BAR_COUNT:4,MIN_BAR_WIDTH:10,MAX_BAR_WIDTH:100},H={BASELINE_TOLERANCE:5,MIN_DATA_POINTS:2},tt={RADIUS_THRESHOLD:15,PROXIMITY:5},et={MIN_CELLS:4,FILL_RATIO:.7},$={PADDING:20,FILL:"#000",TRANSPARENT:"transparent",NONE:"none"},Xt=/-?\d*\.?\d+/g,_t=["defs","metadata","title","desc","style","clipPath","mask","pattern","linearGradient","radialGradient"];let at=0;const kt=()=>{at=0},D=t=>`${t}_${Date.now()}_${++at}`,f=(t,e)=>Math.round(t*Math.pow(10,e))/Math.pow(10,e),b=(t,e,r=0)=>parseFloat(t.getAttribute(e)||String(r))||r,_=t=>{if(!t||t===$.NONE||t===$.TRANSPARENT||t.startsWith("url("))return t;const e=vt(t);return e.hex?gt(e.hex):t},V=(t,e,r,a,o)=>({...t&&t!==$.NONE&&{fillColor:_(t),...r<1&&{fillAlpha:r}},...e&&e!==$.NONE&&{strokeColor:_(e),...o&&{strokeWidth:o},...a<1&&{strokeAlpha:a}}}),Dt=t=>t.replace(/['"]/g,"").split(",")[0].trim(),Ot=t=>{const e=t.toLowerCase().replace(/[^a-z0-9\s]/g,"").split(/\s+/).filter(r=>r.length>0).slice(0,3);return e.length===0?`text_${at}`:e.join("_")},z=t=>{const e={translateX:0,translateY:0,rotate:0,rotateCx:0,rotateCy:0,scaleX:1,scaleY:1};if(!t)return e;const r=t.match(/matrix\(\s*([-\d.]+)[\s,]+([-\d.]+)[\s,]+([-\d.]+)[\s,]+([-\d.]+)[\s,]+([-\d.]+)[\s,]+([-\d.]+)\s*\)/);if(r){const n=parseFloat(r[1]),i=parseFloat(r[2]),l=parseFloat(r[3]),c=parseFloat(r[4]),u=parseFloat(r[5]),m=parseFloat(r[6]);return e.translateX=u,e.translateY=m,e.scaleX=Math.sqrt(n*n+i*i),e.scaleY=Math.sqrt(l*l+c*c),e.rotate=Math.atan2(i,n)*(180/Math.PI),e}const a=t.match(/translate\(\s*([-\d.]+)[\s,]*([-\d.]+)?\s*\)/);a&&(e.translateX=parseFloat(a[1])||0,e.translateY=parseFloat(a[2]||a[1])||0);const o=t.match(/rotate\(\s*([-\d.]+)(?:[\s,]+([-\d.]+)[\s,]+([-\d.]+))?\s*\)/);o&&(e.rotate=parseFloat(o[1])||0,o[2]&&o[3]&&(e.rotateCx=parseFloat(o[2])||0,e.rotateCy=parseFloat(o[3])||0));const s=t.match(/scale\(\s*([-\d.]+)[\s,]*([-\d.]+)?\s*\)/);return s&&(e.scaleX=parseFloat(s[1])||1,e.scaleY=parseFloat(s[2]||s[1])||1),e},qt=t=>{if(!t)return null;const e=t.match(/matrix\(\s*([-\d.]+)[\s,]+([-\d.]+)[\s,]+([-\d.]+)[\s,]+([-\d.]+)[\s,]+([-\d.]+)[\s,]+([-\d.]+)\s*\)/);return e?{a:parseFloat(e[1]),b:parseFloat(e[2]),c:parseFloat(e[3]),d:parseFloat(e[4]),e:parseFloat(e[5]),f:parseFloat(e[6])}:null},zt=(t,e,r)=>({x:t.a*e+t.c*r+t.e,y:t.b*e+t.d*r+t.f}),O=(t,e,r,a)=>Math.sqrt((r-t)**2+(a-e)**2),lt=(t,e,r,a)=>Math.atan2(a-e,r-t),j=t=>({M:(e,r)=>{r.currentX=e[0],r.currentY=e[1],t(r.currentX,r.currentY,r);for(let a=2;a+1<e.length;a+=2)r.currentX=e[a],r.currentY=e[a+1],t(r.currentX,r.currentY,r)},m:(e,r)=>{r.currentX+=e[0],r.currentY+=e[1],t(r.currentX,r.currentY,r);for(let a=2;a+1<e.length;a+=2)r.currentX+=e[a],r.currentY+=e[a+1],t(r.currentX,r.currentY,r)},L:(e,r)=>{for(let a=0;a+1<e.length;a+=2)r.currentX=e[a],r.currentY=e[a+1],t(r.currentX,r.currentY,r)},l:(e,r)=>{for(let a=0;a+1<e.length;a+=2)r.currentX+=e[a],r.currentY+=e[a+1],t(r.currentX,r.currentY,r)},H:(e,r)=>{e.forEach(a=>{r.currentX=a,t(r.currentX,r.currentY,r)})},h:(e,r)=>{e.forEach(a=>{r.currentX+=a,t(r.currentX,r.currentY,r)})},V:(e,r)=>{e.forEach(a=>{r.currentY=a,t(r.currentX,r.currentY,r)})},v:(e,r)=>{e.forEach(a=>{r.currentY+=a,t(r.currentX,r.currentY,r)})},Z:()=>{},z:()=>{}}),st=(t,e,r)=>{const a=/([MmLlHhVvZzCcSsQqTtAa])([^MmLlHhVvZzCcSsQqTtAa]*)/g;let o;for(;(o=a.exec(t))!==null;){const s=o[1],n=(o[2].match(Xt)||[]).map(Number),i=e[s];i&&i(n,r)}return r},Gt=(t,e,r)=>{r.coords.push({x:t,y:e})},Bt={...j(Gt),C:(t,e)=>{for(let r=0;r+5<t.length;r+=6)e.coords.push({x:t[r],y:t[r+1]}),e.coords.push({x:t[r+2],y:t[r+3]}),e.currentX=t[r+4],e.currentY=t[r+5],e.coords.push({x:e.currentX,y:e.currentY})},c:(t,e)=>{for(let r=0;r+5<t.length;r+=6)e.coords.push({x:e.currentX+t[r],y:e.currentY+t[r+1]}),e.coords.push({x:e.currentX+t[r+2],y:e.currentY+t[r+3]}),e.currentX+=t[r+4],e.currentY+=t[r+5],e.coords.push({x:e.currentX,y:e.currentY})}},Wt=(t,e)=>st(t,e,{currentX:0,currentY:0,coords:[]}),Ht={rect:t=>({x:b(t,"x"),y:b(t,"y"),width:b(t,"width"),height:b(t,"height")}),circle:t=>{const e=b(t,"cx"),r=b(t,"cy"),a=b(t,"r");return{x:e-a,y:r-a,width:a*2,height:a*2}},ellipse:t=>{const e=b(t,"cx"),r=b(t,"cy"),a=b(t,"rx"),o=b(t,"ry");return{x:e-a,y:r-o,width:a*2,height:o*2}},path:t=>{const e=t.getAttribute("d")||"",r=Wt(e,Bt).coords.filter(c=>Number.isFinite(c.x)&&Number.isFinite(c.y));if(r.length===0)return{x:0,y:0,width:100,height:100};const a=r.map(c=>c.x),o=r.map(c=>c.y),s=Math.min(...a),n=Math.max(...a),i=Math.min(...o),l=Math.max(...o);return{x:s,y:i,width:n-s||1,height:l-i||1}}},ft=t=>Ht[t.tagName.toLowerCase()]?.(t)??{x:0,y:0,width:100,height:100},U=t=>{const e=[],r=[],a=j(()=>{}),o=(n,i)=>{r.length>0&&(i.currentX=r[0].x,i.currentY=r[0].y)},s={...a,M:(n,i)=>{a.M(n,i),r.push({x:i.currentX,y:i.currentY})},m:(n,i)=>{a.m(n,i),r.push({x:i.currentX,y:i.currentY})},A:(n,i)=>{for(let l=0;l+6<n.length;l+=7){const c=i.currentX,u=i.currentY;e.push({rx:n[l],ry:n[l+1],largeArc:n[l+3]===1,sweep:n[l+4]===1,x:n[l+5],y:n[l+6],startX:c,startY:u}),i.currentX=n[l+5],i.currentY=n[l+6]}},a:(n,i)=>{for(let l=0;l+6<n.length;l+=7){const c=i.currentX,u=i.currentY;e.push({rx:n[l],ry:n[l+1],largeArc:n[l+3]===1,sweep:n[l+4]===1,x:i.currentX+n[l+5],y:i.currentY+n[l+6],startX:c,startY:u}),i.currentX+=n[l+5],i.currentY+=n[l+6]}},Z:o,z:o};return st(t,s,{currentX:0,currentY:0}),{arcs:e,moves:r}},Ut=(t,e,r,a,o,s,n,i)=>{const l=o,c=(t+r)/2,u=(e+a)/2,m=r-t,N=a-e,M=Math.sqrt(m*m+N*N);if(M>2*l)return null;const E=Math.sqrt(l*l-M/2*(M/2)),I=-N/M,v=m/M,F=n!==i?1:-1;return{cx:c+F*E*I,cy:u+F*E*v}},Vt=t=>{const e=t.getAttribute("points");if(!e)return[];const r=[],a=e.trim().split(/[\s,]+/).map(Number);for(let o=0;o+1<a.length;o+=2)Number.isFinite(a[o])&&Number.isFinite(a[o+1])&&r.push({x:a[o],y:a[o+1]});return r},jt=t=>{const e=[],r=(s,n,i)=>{e.push({x:s,y:n}),i.lineCount++},a={...j(r),M:(s,n)=>{n.currentX=s[0],n.currentY=s[1],e.push({x:n.currentX,y:n.currentY});for(let i=2;i+1<s.length;i+=2)n.currentX=s[i],n.currentY=s[i+1],r(n.currentX,n.currentY,n)},m:(s,n)=>{n.currentX+=s[0],n.currentY+=s[1],e.push({x:n.currentX,y:n.currentY});for(let i=2;i+1<s.length;i+=2)n.currentX+=s[i],n.currentY+=s[i+1],r(n.currentX,n.currentY,n)},C:(s,n)=>{n.curveCount++,s.length>=6&&(n.currentX=s[4],n.currentY=s[5],e.push({x:n.currentX,y:n.currentY}))},c:(s,n)=>{n.curveCount++,s.length>=6&&(n.currentX+=s[4],n.currentY+=s[5],e.push({x:n.currentX,y:n.currentY}))},S:(s,n)=>{n.curveCount++},s:(s,n)=>{n.curveCount++},Q:(s,n)=>{n.curveCount++},q:(s,n)=>{n.curveCount++},T:(s,n)=>{n.curveCount++},t:(s,n)=>{n.curveCount++},A:(s,n)=>{n.curveCount++},a:(s,n)=>{n.curveCount++}},o={currentX:0,currentY:0,lineCount:0,curveCount:0};return st(t,a,o),e.length>=3&&o.lineCount>o.curveCount?e:null},ct=t=>{if(t.length<3)return!1;const e=[];for(let a=1;a<t.length;
1a++)e.push(t[a].x-t[a-1].x);if(e.filter(a=>a>0).length<e.length*.7)return!1;const r=e.reduce((a,o)=>a+o,0)/e.length;return e.filter(a=>a>0&&Math.abs(a-r)<r*.5).length>=e.length*.5},Zt=(t,e,r,a)=>{const o=r-t,s=a-e,n=Math.abs(o)>Math.abs(s)*2,i=Math.abs(s)>Math.abs(o)*2;return n?o>0?"to-right":"to-left":i?s>0?"to-bottom":"to-top":o>0&&s>0?"to-bottom-right":o<0&&s>0?"to-bottom-left":o>0&&s<0?"to-top-right":"to-top-left"},ht=t=>{const e=t.querySelectorAll("stop");let r="#000000",a=1,o="#ffffff",s=1;if(e.length>=1){const n=e[0],i=n.getAttribute("stop-color")||n.getAttribute("style")?.match(/stop-color:\s*([^;]+)/)?.[1];i&&(r=_(i));const l=n.getAttribute("stop-opacity");l&&(a=parseFloat(l))}if(e.length>=2){const n=e[e.length-1],i=n.getAttribute("stop-color")||n.getAttribute("style")?.match(/stop-color:\s*([^;]+)/)?.[1];i&&(o=_(i));const l=n.getAttribute("stop-opacity");l&&(s=parseFloat(l))}return{colorStart:r,colorStartAlpha:a,colorEnd:o,colorEndAlpha:s}},Qt=t=>{const e=new Map;return t.querySelectorAll("linearGradient").forEach(r=>{const a=r.getAttribute("id");if(!a)return;const o=parseFloat(r.getAttribute("x1")||"0"),s=parseFloat(r.getAttribute("y1")||"0"),n=parseFloat(r.getAttribute("x2")||"100"),i=parseFloat(r.getAttribute("y2")||"0"),{colorStart:l,colorStartAlpha:c,colorEnd:u,colorEndAlpha:m}=ht(r),N=Zt(o,s,n,i);e.set(a,{id:a,type:"linear",colorStart:l,colorStartAlpha:c,colorEnd:u,colorEndAlpha:m,direction:N})}),t.querySelectorAll("radialGradient").forEach(r=>{const a=r.getAttribute("id");if(!a)return;const{colorStart:o,colorStartAlpha:s,colorEnd:n,colorEndAlpha:i}=ht(r);e.set(a,{id:a,type:"radial",colorStart:o,colorStartAlpha:s,colorEnd:n,colorEndAlpha:i,direction:"to-bottom-right"})}),e},Jt=t=>{if(!t)return null;const e=t.match(/url\(#([^)]+)\)/);return e?e[1]:null},Kt=(t,e,r)=>{const a=ft(t),o=z(t.getAttribute("transform"));return{id:t.id||D(r.idPrefix),type:"overlay",position:{x:f(a.x+o.translateX,r.coordinatePrecision),y:f(a.y+o.translateY,r.coordinatePrecision)},size:{width:f(a.width,r.coordinatePrecision),height:f(a.height,r.coordinatePrecision)},rotation:o.rotate,opacity:b(t,"opacity",1),gradientType:e.type,colorStart:e.colorStart,colorStartAlpha:e.colorStartAlpha,colorEnd:e.colorEnd,colorEndAlpha:e.colorEndAlpha,direction:e.direction}},te=(t,e,r,a,o,s)=>{const n=t.getAttribute("fill"),i=Jt(n);if(i&&e.has(i)){const l=e.get(i),c=Kt(t,l,r);return a.push(c),s.push(`Converted ${l.type} gradient "${i}" to overlay element`),!0}return!1},ut=(t,e)=>{if(t.length===0)return[];const r=[...t].sort((o,s)=>o-s),a=[[r[0]]];for(let o=1;o<r.length;o++){const s=a[a.length-1],n=s[s.length-1];r[o]-n<=e?s.push(r[o]):a.push([r[o]])}return a},dt=t=>t.reduce((e,r)=>e+r,0)/t.length,ee=t=>{if(t.length<3)return null;const e=[];t.forEach(o=>{e.push({x:o.x1,y:o.y1}),e.push({x:o.x2,y:o.y2})});const r=[];for(const o of e){let s=!1;for(const n of r)if(O(o.x,o.y,n.x,n.y)<k.ARC_CENTER_TOLERANCE){n.count++,n.sumX+=o.x,n.sumY+=o.y,n.x=n.sumX/n.count,n.y=n.sumY/n.count,s=!0;break}s||r.push({x:o.x,y:o.y,count:1,sumX:o.x,sumY:o.y})}const a=r.sort((o,s)=>s.count-o.count);return a.length>0&&a[0].count>=t.length*.8?{cx:a[0].x,cy:a[0].y}:null},re=t=>{if(t.length<2)return null;const e=t[0];if(!t.every(s=>O(s.cx,s.cy,e.cx,e.cy)<k.CONCENTRIC_CENTER_TOLERANCE))return null;const r=t.reduce((s,n)=>s+n.cx,0)/t.length,a=t.reduce((s,n)=>s+n.cy,0)/t.length,o=Math.max(...t.map(s=>s.r));return{cx:r,cy:a,maxRadius:o}},Z=(t,e,r,a,o,s={})=>({id:D(o.idPrefix),type:"chart",chartType:t,position:{x:f(e.x,o.coordinatePrecision),y:f(e.y,o.coordinatePrecision)},size:{width:f(e.width,o.coordinatePrecision),height:f(e.height,o.coordinatePrecision)},data:{placeholder:"chart_data"},options:{sampleData:r,dataColors:a,backgroundColor:$.TRANSPARENT,backgroundAlpha:0,...s}}),yt=(t,e,r,a,o={})=>{const s=[],n=o.labelTolerance??50;return t.forEach(i=>{const l=parseFloat(i.getAttribute("x")||"0"),c=parseFloat(i.getAttribute("y")||"0"),u=i.textContent?.trim()||"",m=l<r-10;c>e&&c<e+n&&l>=r-n&&l<=a+n&&!m&&u.length>0&&s.push({element:i,text:u,x:l})}),s.sort((i,l)=>i.x-l.x)},ne=(t,e,r,a,o=[])=>{const s=[],n=new Set(o);return t.forEach(i=>
1{const l=parseFloat(i.getAttribute("x")||"0"),c=parseFloat(i.getAttribute("y")||"0"),u=l<e-5,m=c>=r-20&&c<=a+20;u&&m&&!n.has(i)&&s.push(i)}),s},xt=(t,e,r)=>{const a=[],o=[];return Array.from(t.querySelectorAll("rect")).forEach(s=>{const n=parseFloat(s.getAttribute("x")||"0"),i=parseFloat(s.getAttribute("y")||"0"),l=parseFloat(s.getAttribute("width")||"0"),c=parseFloat(s.getAttribute("height")||"0"),u=s.getAttribute("fill")?.toLowerCase()||"",m=l<=20&&c<=20,N=e.has(_(u).toLowerCase());m&&N&&(a.push(s),r.forEach(M=>{const E=parseFloat(M.getAttribute("x")||"0"),I=parseFloat(M.getAttribute("y")||"0"),v=M.textContent?.trim()||"";E>n&&E<n+150&&Math.abs(I-(i+c/2))<15&&(a.includes(M)||(a.push(M),v.length>0&&o.push(v)))}))}),{legendElements:a,legendLabels:o}},bt=(t,e,r,a=50)=>{const o=[],s=[],{minX:n,maxX:i,minY:l}=e;return t.forEach(c=>{const u=parseFloat(c.getAttribute("x1")||"0"),m=parseFloat(c.getAttribute("y1")||"0"),N=parseFloat(c.getAttribute("x2")||"0"),M=parseFloat(c.getAttribute("y2")||"0"),E=c.getAttribute("stroke")?.toLowerCase()||"",I=Math.abs(u-N)<2,v=Math.abs(m-M)<2,F=I&&u<=n&&u>=n-a&&Math.min(m,M)<=l+a&&Math.max(m,M)>=r-a,R=Math.abs(m-M)<2&&m>=r-a&&m<=r+a&&Math.min(u,N)<=n+a&&Math.max(u,N)>=i-a,y=v&&m>=l-a&&m<=r+a&&Math.min(u,N)<=n+a&&Math.max(u,N)>=i-a&&(E.includes("e")||E.includes("d")||E.includes("c"));F||R?o.push(c):y&&!o.includes(c)&&s.push(c)}),{axisElements:o,gridElements:s}},ae=t=>{const e=[];t.forEach(n=>{const i=n.getAttribute("d")||"",{moves:l}=U(i);e.push(...l)});const r=new Map;e.forEach(n=>{let i=!1;if(r.forEach(l=>{Math.abs(l.x-n.x)<k.CLUSTERING_TOLERANCE&&Math.abs(l.y-n.y)<k.CLUSTERING_TOLERANCE&&(l.count++,i=!0)}),!i){const l=`${Math.round(n.x)},${Math.round(n.y)}`;r.set(l,{x:n.x,y:n.y,count:1})}});let a=0,o=null;if(r.forEach(n=>{n.count>a&&(a=n.count,o={x:n.x,y:n.y})}),!o||a<q.MIN_PIE_SLICES){const n=[];if(t.forEach(i=>{const l=i.getAttribute("d")||"",{arcs:c}=U(l);c.forEach(u=>{if(u.rx>k.ARC_CENTER_TOLERANCE){const m=Ut(u.startX,u.startY,u.x,u.y,u.rx,u.ry,u.largeArc,u.sweep);m&&n.push({x:m.cx,y:m.cy})}})}),n.length>=q.MIN_PIE_SLICES){const i=[];for(const l of n){let c=!1;for(const u of i){const m=u.sumX/u.count,N=u.sumY/u.count;if(Math.abs(m-l.x)<k.TOLERANCE&&Math.abs(N-l.y)<k.TOLERANCE){u.sumX+=l.x,u.sumY+=l.y,u.count++,u.x=u.sumX/u.count,u.y=u.sumY/u.count,c=!0;break}}c||i.push({x:l.x,y:l.y,count:1,sumX:l.x,sumY:l.y})}a=0;for(const l of i)l.count>a&&(a=l.count,o={x:l.x,y:l.y})}}if(!o||a<q.MIN_PIE_SLICES)return null;let s=0;return t.forEach(n=>{const i=n.getAttribute("d")||"",{arcs:l}=U(i);l.forEach(c=>{c.rx>s&&(s=c.rx)})}),{cx:o.x,cy:o.y,radius:s||50}},se=(t,e)=>{const r=Array.from(t.querySelectorAll("path")).filter(v=>{const F=v.getAttribute("d")||"";return/[Aa]/.test(F)});if(r.length<q.MIN_PIE_SLICES)return null;const a=new Set;if(r.forEach(v=>{const F=v.getAttribute("fill");F&&F!==$.NONE&&a.add(F)}),a.size<q.MIN_PIE_COLORS)return null;const o=ae(r);if(!o)return null;const{cx:s,cy:n}=o,i=[];let l=!1,c=0;if(r.forEach(v=>{const F=v.getAttribute("d")||"",R=v.getAttribute("fill")||"#000",{arcs:y}=U(F);if(y.length===0)return;const p=y.reduce((d,g)=>g.rx>d.rx?g:d,y[0]),x=y.filter(d=>d.rx<p.rx*.8&&d.rx>5);x.length>0&&(l=!0,c=Math.max(c,x[0].rx));const C=lt(s,n,p.startX,p.startY),w=lt(s,n,p.x,p.y);i.push({pathElement:v,color:_(R),startAngle:C,endAngle:w,outerRadius:p.rx,innerRadius:x.length>0?x[0].rx:0,centerX:s,centerY:n})}),i.length<2)return null;i.sort((v,F)=>v.startAngle-F.startAngle);const u=Math.max(...i.map(v=>v.outerRadius)),m={x:f(s-u,e.coordinatePrecision),y:f(n-u,e.coordinatePrecision),width:f(u*2,e.coordinatePrecision),height:f(u*2,e.coordinatePrecision)},N=new Set(i.map(v=>v.color.toLowerCase())),M=Array.from(t.querySelectorAll("text")),{legendElements:E,legendLabels:I}=xt(t,N,M);return{type:l?"donut":"pie",slices:i,centerX:s,centerY:n,outerRadius:u,innerRadius:l?c:0,bounds:m,legendElements:E,legendLabels:I}},oe=(t,e)=>{const r=2*Math.PI,a=t.slices.map(s=>{let n=s.endAngle-s.startAngle;return n<0&&(n+=2*Math.PI),Math.round(n/r*100)}),o=t.slices.map(s=>s.color);return Z(t.type,t.bounds,a,o,e,{sampleLabels:t.legendLabels.length>0?[...t.legendLabels,...Array(Math.max(0,a.length-t.legendLabels.length)).fill(!1)]:void 0,showDataLabels:!1,showLegend:t.legendElements.length>0})},ie={priority:20,detect:(t,e)=>{const r=se(t,e);if(!r)return null;const a=oe(r,e),o=new Set;
1return r.slices.forEach(s=>o.add(s.pathElement)),r.legendElements.forEach(s=>o.add(s)),{chartElement:a,skipElements:o,chartType:r.type}}},le=(t,e,r,a)=>{const o=t.getAttribute("points");if(!o)return null;const s=[],n=o.trim().split(/[\s,]+/).map(Number);for(let l=0;l+1<n.length;l+=2)Number.isFinite(n[l])&&Number.isFinite(n[l+1])&&s.push({x:n[l],y:n[l+1]});if(s.length<3||a>0&&Math.abs(s.length-a)>1)return null;const i=[];for(const l of s){const c=O(l.x,l.y,e.x,e.y),u=Math.min(1,c/r);i.push({x:l.x,y:l.y,value:u})}return i},ce=(t,e)=>{const r=Array.from(t.querySelectorAll("circle")),a=[];r.forEach(y=>{const p=parseFloat(y.getAttribute("cx")||"0"),x=parseFloat(y.getAttribute("cy")||"0"),C=parseFloat(y.getAttribute("r")||"0"),w=y.getAttribute("fill");C>0&&(!w||w===$.NONE||w===$.TRANSPARENT)&&a.push({element:y,cx:p,cy:x,r:C})});const o=re(a);if(!o&&a.length<2)return null;const s=Array.from(t.querySelectorAll("line")),n=[];s.forEach(y=>{const p=parseFloat(y.getAttribute("x1")||"0"),x=parseFloat(y.getAttribute("y1")||"0"),C=parseFloat(y.getAttribute("x2")||"0"),w=parseFloat(y.getAttribute("y2")||"0");n.push({element:y,x1:p,y1:x,x2:C,y2:w})});const i=ee(n);let l,c,u;if(o&&i){if(O(o.cx,o.cy,i.cx,i.cy)>k.CONCENTRIC_CENTER_TOLERANCE)return null;l=(o.cx+i.cx)/2,c=(o.cy+i.cy)/2,u=o.maxRadius}else if(o)l=o.cx,c=o.cy,u=o.maxRadius;else if(i){l=i.cx,c=i.cy;const y=n.map(p=>Math.max(O(p.x1,p.y1,l,c),O(p.x2,p.y2,l,c)));u=Math.max(...y)}else return null;const m=[],N=[];if(n.forEach(y=>{const p=O(y.x1,y.y1,l,c),x=O(y.x2,y.y2,l,c);if(p<k.RADIAL_LINE_TOLERANCE||x<k.RADIAL_LINE_TOLERANCE){const C=p>x?{x:y.x1,y:y.y1}:{x:y.x2,y:y.y2},w=Math.atan2(C.y-c,C.x-l);m.push({angle:w}),N.push(y.element)}}),m.length<3)return null;m.sort((y,p)=>y.angle-p.angle);const M=Array.from(t.querySelectorAll("text")),E=[],I=u*.4;m.forEach(y=>{const p=l+Math.cos(y.angle)*u,x=c+Math.sin(y.angle)*u;let C=null,w=I;for(const d of M){const g=parseFloat(d.getAttribute("x")||"0"),h=parseFloat(d.getAttribute("y")||"0"),A=O(g,h,p,x);A<w&&!E.includes(d)&&(w=A,C=d)}C&&(y.label=C.textContent?.trim()||void 0,E.push(C))});const v=Array.from(t.querySelectorAll("polygon")),F=[];if(v.forEach(y=>{const p=y.getAttribute("fill"),x=y.getAttribute("stroke");if(!p&&!x||p===$.NONE&&(!x||x===$.NONE))return;const C=le(y,{x:l,y:c},u,m.length);if(!C||C.length<3)return;const w=C.map(g=>Math.atan2(g.y-c,g.x-l));if(Math.max(...w)-Math.min(...w)<Math.PI)return;const d=parseFloat(y.getAttribute("fill-opacity")||"1");F.push({element:y,points:C,color:x&&x!==$.NONE?_(x):p&&p!==$.NONE?_(p):$.FILL,fillColor:p&&p!==$.NONE?_(p):$.TRANSPARENT,fillAlpha:d})}),F.length===0)return null;const R={x:l-u-$.PADDING,y:c-u-$.PADDING,width:(u+$.PADDING)*2,height:(u+$.PADDING)*2};return{type:"radar",centerX:l,centerY:c,radius:u,axes:m,series:F,gridElements:a.map(y=>y.element),axisElements:N,axisLabelElements:E,bounds:R}},he=(t,e)=>{const r=t.series.map(s=>s.points.map(n=>Math.round(n.value*100))),a=t.series.map(s=>s.fillColor!==$.TRANSPARENT?s.fillColor:s.color),o=t.axes.map(s=>s.label).filter(s=>!!s);return Z(t.type,t.bounds,r.length===1?r[0]:r,a,e,{sampleLabels:o.length>0?o:void 0,showDataLabels:!1})},ue={priority:30,detect:(t,e)=>{const r=ce(t);if(!r)return null;const a=he(r,e),o=new Set;return r.series.forEach(s=>o.add(s.element)),r.gridElements.forEach(s=>o.add(s)),r.axisElements.forEach(s=>o.add(s)),r.axisLabelElements.forEach(s=>o.add(s)),{chartElement:a,skipElements:o,chartType:"radar"}}},de=(t,e)=>{const r=[],a=[];if(Array.from(t.querySelectorAll("polyline")).forEach(p=>{const x=Vt(p),C=p.getAttribute("stroke"),w=p.getAttribute("fill");x.length>=3&&C&&C!=="none"&&(!w||w==="none")&&ct(x)&&r.push({element:p,points:x,color:_(C),strokeWidth:b(p,"stroke-width",2)})}),Array.from(t.querySelectorAll("path")).forEach(p=>{const x=p.getAttribute("d")||"",C=p.getAttribute("stroke"),w=p.getAttribute("fill");if(!C||C===$.NONE||w&&w!==$.NONE)return;const d=jt(x);d&&d.length>=3&&ct(d)&&r.push({element:p,points:d,color:_(C),strokeWidth:b(p,"stroke-width",2)})}),r.length===0)return null;const o=Array.from(t.querySelectorAll("circle")),s=r.flatMap(p=>p.points);o.forEach(p=>{const x=b(p,"cx"),C=b(p,"cy"),w=b(p,"r");w>0&&w<tt.RADIUS_THRESHOLD&&s.some(d=>d.y!==null&&Math.abs(d.x-x)<tt.PROXIMITY&&Math.abs(d.y-C)<tt.PROXIMITY)&&a.push(p)});const n=s.filter(p=>p.y!==null).map(p=>p.x),i=s.filter(p=>p.y!==null).map(p=>p.y),l=Math.min(...n),c=Math.max(...n),u=Math.min(...i),m=Math.max(...i),N=Array.from(t.querySelectorAll("text")),M=yt(N,m,l,c,{labelTolerance:100}),E=Array.from(t.querySelectorAll("line")),{axisElements:I,gridElements:v}=bt(E,{minX:l,maxX:c,minY:u},m),F=[...n,...I.map(p=>{const x=parseFloat(p.getAttribute("x1")||"0"),C=parseFloat(p.getAttribute("x2")||"0");return Math.min(x,C)}),...M.map(p=>parseFloat(p.element.getAttribute("x")||"0"))],R=Math.min(...F),y={x:f(R-$.PADDING,e.coordinatePrecision),y:f(u-$.PADDING,e.coordinatePrecision),width:f(c-R+$.PADD
1ING*2,e.coordinatePrecision),height:f(m-u+$.PADDING*2,e.coordinatePrecision)};return{type:"line",series:r,markers:a,bounds:y,minY:u,maxY:m,axisLabels:M,axisElements:I,gridElements:v}},pe=(t,e)=>{const r=t.maxY-t.minY,a=i=>i===null?null:Math.round((t.maxY-i)/r*100),o=t.series.map(i=>i.points.map(l=>a(l.y))),s=t.series.map(i=>i.color),n=t.axisLabels.length>0?t.axisLabels.map(i=>i.text):void 0;return Z("line",t.bounds,o.length===1?o[0]:o,s,e,{sampleLabels:n,showSymbol:t.markers.length>0,showDataLabels:!1,showGrid:t.gridElements.length>0,showXAxis:t.axisLabels.length>0,showYAxis:!1,showLegend:!1,startFromZero:!1})},me={priority:40,detect:(t,e)=>{const r=de(t,e);if(!r)return null;const a=pe(r,e),o=new Set;return r.series.forEach(s=>o.add(s.element)),r.markers.forEach(s=>o.add(s)),r.axisLabels.forEach(s=>o.add(s.element)),r.axisElements.forEach(s=>o.add(s)),r.gridElements.forEach(s=>o.add(s)),{chartElement:a,skipElements:o,chartType:"line"}}},pt=t=>{const e=t.tagName.toLowerCase(),r=[];if(e==="polygon"){const i=t.getAttribute("points");if(!i)return null;const l=i.trim().split(/[\s,]+/).map(Number);for(let c=0;c+1<l.length;c+=2)Number.isFinite(l[c])&&Number.isFinite(l[c+1])&&r.push({x:l[c],y:l[c+1]})}else if(e==="path"){const i=t.getAttribute("d")||"",l=/([MLHVZCSQTAmlhvzcsqta])([^MLHVZCSQTAmlhvzcsqta]*)/g;let c;const u=j((M,E)=>r.push({x:M,y:E})),m={currentX:0,currentY:0},N=u;for(;(c=l.exec(i))!==null;){const M=c[1],E=(c[2].match(/-?\d*\.?\d+/g)||[]).map(Number),I=N[M];I&&I(E,m)}}if(r.length<4)return null;const a=r.map(i=>i.y),o=Math.max(...a);if(r.filter(i=>Math.abs(i.y-o)<H.BASELINE_TOLERANCE).length<H.MIN_DATA_POINTS)return null;const s=r.filter(i=>Math.abs(i.y-o)>=H.BASELINE_TOLERANCE);if(s.length<H.MIN_DATA_POINTS)return null;s.sort((i,l)=>i.x-l.x);const n=[];for(let i=1;i<s.length;i++)n.push(s[i].x-s[i-1].x);if(n.length>0){const i=n.reduce((l,c)=>l+c,0)/n.length;if(n.filter(l=>l>0&&Math.abs(l-i)<i*.5).length<n.length*.5)return null}return{dataPoints:s,baseline:o}},ge=(t,e)=>{const r=[];if(Array.from(t.querySelectorAll("polygon")).forEach(h=>{const A=h.getAttribute("fill");if(!A||A===$.NONE)return;const P=pt(h);if(!P)return;const L=h.getAttribute("stroke"),S=parseFloat(h.getAttribute("fill-opacity")||"1");r.push({element:h,dataPoints:P.dataPoints,baseline:P.baseline,color:L&&L!==$.NONE?_(L):_(A),fillColor:_(A),fillAlpha:S})}),Array.from(t.querySelectorAll("path")).forEach(h=>{const A=h.getAttribute("d")||"",P=h.getAttribute("fill");if(!P||P===$.NONE||!/[Zz]\s*$/.test(A))return;const L=pt(h);if(!L)return;const S=h.getAttribute("stroke"),T=parseFloat(h.getAttribute("fill-opacity")||"1");r.push({element:h,dataPoints:L.dataPoints,baseline:L.baseline,color:S&&S!==$.NONE?_(S):_(P),fillColor:_(P),fillAlpha:T})}),r.length===0)return null;const a=r.flatMap(h=>h.dataPoints.filter(A=>A.y!==null)),o=a.map(h=>h.x),s=a.map(h=>h.y),n=Math.max(...r.map(h=>h.baseline)),i=Math.min(...o),l=Math.max(...o),c=Math.min(...s),u=Array.from(t.querySelectorAll("text")),m=yt(u,n,i,l),N=new Set(r.map(h=>h.fillColor.toLowerCase())),{legendElements:M,legendLabels:E}=xt(t,N,u),I=Array.from(t.querySelectorAll("line")),{axisElements:v,gridElements:F}=bt(I,{minX:i,maxX:l,minY:c},n),R=[],y=Array.from(t.querySelectorAll("circle")),p=r.flatMap(h=>h.dataPoints);y.forEach(h=>{const A=parseFloat(h.getAttribute("cx")||"0"),P=parseFloat(h.getAttribute("cy")||"0"),L=parseFloat(h.getAttribute("r")||"0");L>0&&L<15&&p.some(S=>S.y!==null&&Math.abs(S.x-A)<10&&Math.abs(S.y-P)<10)&&R.push(h)});const x=[];u.forEach(h=>{const A=parseFloat(h.getAttribute("x")||"0"),P=parseFloat(h.getAttribute("y")||"0"),L=h.textContent?.trim()||"",S=A>=i-20&&A<=l+20&&P>=c-30&&P<=n,T=p.some(X=>X.y!==null&&Math.abs(X.x-A)<30&&Math.abs(X.y-P)<30),Y=/^-?\d+\.?\d*%?$/.test(L);S&&T&&Y&&!m.some(X=>X.element===h)&&x.push(h)});const C=ne(u,i,c,n,M),w=[...o,...v.map(h=>{const A=parseFloat(h.getAttribute("x1")||"0"),P=parseFloat(h.getAttribute("x2")||"0");return Math.min(A,P)}),...C.map(h=>parseFloat(h.getAttribute("x")||"0"))],d=Math.min(...w),g={x:f(d-$.PADDING,e.coordinatePrecision),y:f(c-$.PADDING,e.coordinatePrecision),width:f(l-d+$.PADD
1ING*2,e.coordinatePrecision),height:f(n-c+$.PADDING*2,e.coordinatePrecision)};if(d<i&&r.length>0&&r[0].dataPoints.length>1){const h=r[0];let A=0,P=0;for(let T=1;T<h.dataPoints.length;T++){const Y=h.dataPoints[T].x-h.dataPoints[T-1].x;Y>0&&(A+=Y,P++)}const L=P>0?A/P:0,S=i-d;if(L>0&&S>=L*.5){const T=Math.round(S/L);if(T>0){r.forEach(X=>{const G=[];for(let B=0;B<T;B++)G.push({x:d+B*L,y:null});X.dataPoints=[...G,...X.dataPoints]});const Y=[];for(let X=0;X<T;X++)Y.push({element:M[0]||u[0],text:"",x:d+X*L});m.unshift(...Y)}}}return{type:"area",series:r,bounds:g,minY:c,maxY:n,axisLabels:m,yAxisLabels:C,legendElements:M,legendLabels:E,axisElements:v,gridElements:F,markers:R,dataLabelElements:x}},fe=(t,e)=>{const r=t.maxY-t.minY,a=i=>i===null?null:Math.round((t.maxY-i)/r*100),o=t.series.map(i=>i.dataPoints.map(l=>a(l.y))),s=t.series.map(i=>i.fillColor),n=t.axisLabels.length>0?t.axisLabels.map(i=>i.text):void 0;return Z("area",t.bounds,o.length===1?o[0]:o,s,e,{sampleLabels:n,showSymbol:t.markers.length>0,showDataLabels:t.dataLabelElements.length>0,showXAxis:t.axisLabels.length>0,showYAxis:t.yAxisLabels.length>0,showGrid:t.gridElements.length>0,showLegend:t.legendElements.length>0,legendPosition:t.legendElements.length>0?"top":void 0,legendLabels:t.legendLabels.length>0?t.legendLabels:void 0,startFromZero:!1})},ye={priority:50,detect:(t,e)=>{const r=ge(t,e);if(!r)return null;const a=fe(r,e),o=new Set;return r.series.forEach(s=>
1o.add(s.element)),r.axisLabels.forEach(s=>o.add(s.element)),r.yAxisLabels.forEach(s=>o.add(s)),r.legendElements.forEach(s=>o.add(s)),r.axisElements.forEach(s=>o.add(s)),r.gridElements.forEach(s=>o.add(s)),r.markers.forEach(s=>o.add(s)),r.dataLabelElements.forEach(s=>o.add(s)),{chartElement:a,skipElements:o,chartType:"area"}}};class xe{detectors=new Map;constructor(){this.register("pie",ie),this.register("radar",ue),this.register("line",me),this.register("area",ye)}register(e,r){this.detectors.set(e,r)}unregister(e){this.detectors.delete(e)}get(e){return this.detectors.get(e)}has(e){return this.detectors.has(e)}getAll(){return new Map(this.detectors)}detectCharts(e,r){if(!r.detectCharts)return null;for(const a of this.detectors.values()){const o=a.detect(e,r);if(o)return o}return null}}const be=new xe,Ae=t=>{const e=t.filter(d=>d.type==="shape"&&d.shapeType==="rectangle");if(e.length<q.MIN_BAR_COUNT)return null;const r=new Map;e.forEach(d=>{const g=Math.round(d.size.width);r.has(g)||r.set(g,[]),r.get(g).push(d)});let a=0,o=0;if(r.forEach((d,g)=>{d.length>a&&g>q.MIN_BAR_WIDTH&&g<q.MAX_BAR_WIDTH&&(a=d.length,o=g)}),a<q.MIN_BAR_COUNT)return null;const s=r.get(o)||[],n=new Map;s.forEach(d=>{const g=d.style?.fillColor,h=typeof g=="string"?g:$.FILL;n.has(h)||n.set(h,[]),n.get(h).push(d)});let i=!1;if(n.forEach(d=>{d.length>=3&&(i=!0)}),!i)return null;const l=[];if(n.forEach((d,g)=>{if(d.length<2)return;const h=[...d].sort((S,T)=>S.position.x-T.position.x),A=h.map(S=>S.position.x),P=h.map(S=>S.position.y),L=h.map(S=>S.position.y+S.size.height);l.push({bars:h,color:g,baseline:Math.max(...L),minX:Math.min(...A),maxX:Math.max(...A)+o,minY:Math.min(...P),maxY:Math.max(...L)})}),l.length===0)return null;const c=Math.min(...l.map(d=>d.minX)),u=Math.max(...l.map(d=>d.maxX)),m=Math.min(...l.map(d=>d.minY)),N=Math.max(...l.map(d=>d.maxY)),M=t.filter(d=>d.type==="text"),E=[...M.filter(d=>{const g=d.rotation||0,h=Math.abs(g)>20&&Math.abs(g)<90,A=d.position.y>N-50,P=d.position.x>=c-50&&d.position.x<=u+50;return h&&A&&P})].sort((d,g)=>d.position.x-g.position.x),I=M.filter(d=>{const g=d.rotation||0,h=Math.abs(g)<20,A=d.position.y>N-10,P=d.position.x>=c-50&&d.position.x<=u+50,L=d.position.x<c-10;return h&&A&&P&&!L}),v=E.length>0?E:I.sort((d,g)=>d.position.x-g.position.x),F=M.filter(d=>{const g=d.position.x<c-5,h=d.position.y>=m-50&&d.position.y<=N+50;return g&&h}),R=[],y=[];M.forEach(d=>{const g=typeof d.value=="string"?d.value:"";if(/^-?\d+\.?\d*%?$/.test(g.trim())){const h=d.position.x+d.size.width/2,A=d.position.y;l.forEach((P,L)=>{P.bars.forEach(S=>{const T=S.position.x+S.size.width/2,Y=Math.abs(h-T)<S.size.width*1.5,X=A<S.position.y+30||A>S.position.y+S.size.height-30;Y&&X&&(R.push({value:g,seriesIndex:L}),y.push(d))})})}});const p=t.filter(d=>d.type==="shape"&&d.shapeType==="line"),x=[],C=50;p.forEach(d=>{const g=d.position.x,h=d.position.y,A=d.size.width,P=((d.rotation||0)%180+180)%180,L=Math.abs(P-90)<10,S=P<10||P>170,T=L&&A>50&&g<=c&&g>=c-C,Y=S&&A>50&&h>=N-C&&h<=N+C;(T||Y)&&x.push(d)});const w=[...F];return E.length===0&&w.push(...I),{type:"bar",barGroups:l,labels:v.map(d=>{const g=d.value;return typeof g=="string"?g:g.placeholder}),labelElements:v,labelsRotated:E.length>0,bounds:{x:c-20,y:m-50,width:u-c+40,height:N-m+150},dataLabels:R,dataLabelElements:y,axisElements:x,axisLabelElements:w,yAxisLabels:F}},Ee=(t,e)=>{const r=Math.max(...t.barGroups.flatMap(s=>s.bars.map(n=>n.size.height))),a=t.barGroups.map(s=>s.bars.map(n=>{const i=Math.round(n.size.height/r*100),l=n.position.y+n.size.height;return n.size.height<30&&l>t.barGroups[0].baseline-5?-Math.abs(i):i})),o=t.barGroups.map(s=>s.color);return{id:D(e.idPrefix),type:"chart",chartType:"bar",position:{x:f(t.bounds.x,e.coordinatePrecision),y:f(t.bounds.y,e.coordinatePrecision)},size:{width:f(t.bounds.width,e.coordinatePrecision),height:f(t.bounds.height,e.coordinatePrecision)},data:{placeholder:"chart_data"},options:{sampleData:a.length===1?a[0]:a,sampleLabels:t.labels.length>0?t.labels:void 0,dataColors:o,showDataLabels:t.dataLabels.length>0,showGrid:!1,showXAxis:!0,showYAxis:t.yAxisLabels.length>0,xAxisRotation:t.labelsRotated?-45:void 0,backgroundColor:$.TRANSPARENT,backgroundAlpha:0}}},Me=t=>{const e=t.value.match(/\sd="([^"]+)"/);if(!e)return!1;const r=e[1];return/M[-\d.]+[,\s][-\d.]+h[-\d.]+v[-\d.]+h[-\d.]+/i.test(r)},Ce=(t,e)=>{if(!e.detectCharts)return{elements:t,chartConverted:!1};const r=Ae(t);if(!r)return{elements:t,chartConverted:!1};if(t.filter(n=>n.type==="svg").filter(n=>Me(n)).length>0)return{elements:t,chartConverted:!1};const a=new Set;r.barGroups.forEach(n=>
1{n.bars.forEach(i=>a.add(i.id))}),r.labelElements.forEach(n=>a.add(n.id)),r.dataLabelElements.forEach(n=>a.add(n.id)),r.axisElements.forEach(n=>a.add(n.id)),r.axisLabelElements.forEach(n=>a.add(n.id));const o=t.filter(n=>!a.has(n.id)),s=Ee(r,e);return{elements:[...o,s],chartConverted:!0,chartType:"bar"}},Ne=(t,e,r,a,o,s=k.TOLERANCE)=>{for(const n of t){const i=parseFloat(n.getAttribute("x")||"0"),l=parseFloat(n.getAttribute("y")||"0");if(i>=e-s&&i<=e+a+s&&l>=r-s&&l<=r+o+s)return{text:n.textContent?.trim()||"",element:n}}return null},we=(t,e)=>{const r=Array.from(t.querySelectorAll("rect"));if(r.length<et.MIN_CELLS)return null;const a=[];if(r.forEach(h=>{const A=parseFloat(h.getAttribute("x")||"0"),P=parseFloat(h.getAttribute("y")||"0"),L=parseFloat(h.getAttribute("width")||"0"),S=parseFloat(h.getAttribute("height")||"0"),T=h.getAttribute("fill")??$.NONE,Y=h.getAttribute("stroke")??$.NONE,X=parseFloat(h.getAttribute("stroke-width")||"1");L>0&&S>0&&a.push({element:h,x:A,y:P,width:L,height:S,fill:T,stroke:Y,strokeWidth:X})}),a.length<et.MIN_CELLS)return null;const o=a.map(h=>h.x),s=ut(o,k.TOLERANCE);if(s.length<2)return null;const n=a.map(h=>h.y),i=ut(n,k.TOLERANCE);if(i.length<2)return null;const l=s.map(dt).sort((h,A)=>h-A),c=i.map(dt).sort((h,A)=>h-A),u=l.length*c.length;if(a.length/u<et.FILL_RATIO)return null;const m=[],N=new Set,M=Array.from(t.querySelectorAll("text")),E=new Set;for(let h=0;h<c.length;h++){const A=c[h],P=[];for(let L=0;L<l.length;L++){const S=l[L],T=a.find(Y=>!N.has(Y.element)&&Math.abs(Y.x-S)<=k.TOLERANCE&&Math.abs(Y.y-A)<=k.TOLERANCE);if(T){N.add(T.element);const Y=Ne(M.filter(X=>!E.has(X)),T.x,T.y,T.width,T.height);Y&&E.add(Y.element),P.push({rect:T.element,x:T.x,y:T.y,width:T.width,height:T.height,text:Y?.text||"",textElement:Y?.element})}else{const Y=L>0?P[L-1]:null,X=h>0?m[h-1][L]:null;P.push({rect:null,x:S,y:A,width:Y?.width||X?.width||100,height:X?.height||Y?.height||30,text:""})}}m.push(P)}if(m.length<2||m[0].length<2)return null;const I=Math.min(...a.map(h=>h.x)),v=Math.min(...a.map(h=>h.y)),F=Math.max(...a.map(h=>h.x+h.width)),R=Math.max(...a.map(h=>h.y+h.height)),y=m[0].filter(h=>h.rect).map(h=>h.rect.getAttribute("fill")),p=m.slice(1).flatMap(h=>h.filter(A=>A.rect).map(A=>A.rect.getAttribute("fill"))),x=y[0],C=p[0],w=x&&x!==C,d=a.map(h=>h.stroke).filter(h=>h&&h!=="none")[0],g=a.find(h=>h.stroke&&h.stroke!=="none")?.strokeWidth;return{cells:m,rows:m.length,columns:m[0].length,bounds:{x:f(I,e.coordinatePrecision),y:f(v,e.coordinatePrecision),width:f(F-I,e.coordinatePrecision),height:f(R-v,e.coordinatePrecision)},headerRow:w?m[0]:void 0,rectElements:Array.from(N),textElements:Array.from(E),headerBackgroundColor:w&&x?_(x):void 0,cellBackgroun
1dColor:C?_(C):void 0,borderColor:d?_(d):void 0,borderWidth:g}},Pe=(t,e)=>{const r=t.headerRow?t.headerRow.map((n,i)=>n.text?n.text:{placeholder:`header_${i+1}`}):t.cells[0].map((n,i)=>({placeholder:`header_${i+1}`})),a=t.headerRow?1:0,o=t.cells.slice(a).map((n,i)=>n.map((l,c)=>l.text?l.text:{placeholder:`cell_${i+1}_${c+1}`})),s={borderWidth:t.borderWidth||1,borderColor:t.borderColor||"#000",showOuterBorder:!0,showCellBorders:!0};return t.headerBackgroundColor&&(s.headerBackgroundColor=t.headerBackgroundColor),t.cellBackgroundColor&&(s.cellBackgroundColor=t.cellBackgroundColor),{id:D(e.idPrefix),type:"table",position:{x:t.bounds.x,y:t.bounds.y},size:{width:t.bounds.width,height:t.bounds.height},rows:t.rows,columns:t.columns,data:{headers:r,rows:o},options:s}},ve=(t,e)=>{const r=f(b(t,"x"),e.coordinatePrecision),a=f(b(t,"y"),e.coordinatePrecision),o=f(b(t,"width"),e.coordinatePrecision),s=f(b(t,"height"),e.coordinatePrecision),n=b(t,"rx"),i=b(t,"ry"),l=z(t.getAttribute("transform"));return{id:t.id||D(e.idPrefix),type:"shape",shapeType:"rectangle",position:{x:r+l.translateX,y:a+l.translateY},size:{width:o,height:s},rotation:l.rotate,opacity:b(t,"opacity",1),style:{...V(t.getAttribute("fill"),t.getAttribute("stroke"),b(t,"fill-opacity",1),b(t,"stroke-opacity",1),b(t,"stroke-width")),...(n||i)&&{borderRadius:Math.max(n,i)}}}},Le=(t,e)=>{const r=f(b(t,"cx"),e.coordinatePrecision),a=f(b(t,"cy"),e.coordinatePrecision),o=f(b(t,"r"),e.coordinatePrecision),s=z(t.getAttribute("transform"));return{id:t.id||D(e.idPrefix),type:"shape",shapeType:"circle",position:{x:r-o+s.translateX,y:a-o+s.translateY},size:{width:o*2,height:o*2},rotation:s.rotate,opacity:b(t,"opacity",1),style:V(t.getAttribute("fill"),t.getAttribute("stroke"),b(t,"fill-opacity",1),b(t,"stroke-opacity",1),b(t,"stroke-width"))}},Se=(t,e,r)=>{const a=f(b(t,"cx"),e.coordinatePrecision),o=f(b(t,"cy"),e.coordinatePrecision),s=f(b(t,"rx"),e.coordinatePrecision),n=f(b(t,"ry"),e.coordinatePrecision),i=z(t.getAttribute("transform"));return s!==n&&r.push(`Ellipse ${t.id||"unnamed"} has unequal radii (${s}x${n}), converted to oval shape`),{id:t.id||D(e.idPrefix),type:"shape",shapeType:"circle",position:{x:a-s+i.translateX,y:o-n+i.translateY},size:{width:s*2,height:n*2},rotation:i.rotate,opacity:b(t,"opacity",1),style:V(t.getAttribute("fill"),t.getAttribute("stroke"),b(t,"fill-opacity",1),b(t,"stroke-opacity",1),b(t,"stroke-width"))}},Te=(t,e)=>{const r=f(b(t,"x1"),e.coordinatePrecision),a=f(b(t,"y1"),e.coordinatePrecision),o=f(b(t,"x2"),e.coordinatePrecision),s=f(b(t,"y2"),e.coordinatePrecision),n=z(t.getAttribute("transform")),i=t.getAttribute("stroke")??$.FILL,l=b(t,"stroke-width",1),c=b(t,"stroke-opacity",1),u=o-r,m=s-a,N=Math.sqrt(u*u+m*m),M=Math.atan2(m,u)*(180/Math.PI);return{id:t.id||D(e.idPrefix),type:"shape",shapeType:"line",position:{x:Math.min(r,o)+n.translateX,y:Math.min(a,s)+n.translateY},size:{width:N,height:l},rotation:M+n.rotate,opacity:b(t,"opacity",1),style:{strokeColor:_(i),strokeWidth:l,...c<1&&{strokeAlpha:c}}}},Fe=(t,e,r)=>{const a=t.getAttribute("points");if(!a)return r.push(`Polygon ${t.id||"unnamed"} has no points, skipping`),rt(t,e);const o=a.trim().split(/[\s,]+/).map(Number),s=[];for(let E=0;E<o.length;E+=2)s.push({x:o[E],y:o[E+1]});if(s.length<3)return r.push(`Polygon ${t.id||"unnamed"} has fewer than 3 points`),rt(t,e);const n=s.map(E=>E.x),i=s.map(E=>E.y),l=Math.min(...n),c=Math.max(...n),u=Math.min(...i),m=Math.max(...i),N=z(t.getAttribute("transform"));let M="polygon";if(s.length===3)M="triangle";else if(s.length===4)if(s.every((E,I)=>{const v=s[(I+1)%4],F=Math.abs(v.x-E.x),R=Math.abs(v.y-E.y);return F<.1||R<.1}))M="rectangle";else{const E=[Math.sqrt((s[1].x-s[0].x)**2+(s[1].y-s[0].y)**2),Math.sqrt((s[2].x-s[1].x)**2+(s[2].y-s[1].y)**2),Math.sqrt((s[3].x-s[2].x)**2+(s[3].y-s[2].y)**2),Math.sqrt((s[0].x-s[3].x)**2+(s[0].y-s[3].y)**2)],I=.01*Math.max(...E);E.every((v,F,R)=>Math.abs(v-R[0])<I)&&(M="rhombus")}return{id:t.id||D(e.idPrefix),type:"shape",shapeType:M,position:{x:f(l+N.translateX,e.coordinatePrecision),y:f(u+N.translateY,e.coordinatePrecision)}
1,size:{width:f(c-l,e.coordinatePrecision),height:f(m-u,e.coordinatePrecision)},rotation:N.rotate,opacity:b(t,"opacity",1),style:{sides:s.length,...V(t.getAttribute("fill"),t.getAttribute("stroke"),b(t,"fill-opacity",1),b(t,"stroke-opacity",1),b(t,"stroke-width"))}}},rt=(t,e)=>{const r=ft(t),a=Number.isFinite(r.x)?f(r.x,e.coordinatePrecision):0,o=Number.isFinite(r.y)?f(r.y,e.coordinatePrecision):0,s=Number.isFinite(r.width)&&r.width>0?f(r.width,e.coordinatePrecision):100,n=Number.isFinite(r.height)&&r.height>0?f(r.height,e.coordinatePrecision):100,i=new XMLSerializer().serializeToString(t),l=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${a} ${o} ${s} ${n}">${i}</svg>`;return{id:t.id||D(e.idPrefix),type:"svg",position:{x:a,y:o},size:{width:s,height:n},value:l}},Ie=(t,e)=>{const r=t.getAttribute("transform"),a=z(r),o=qt(r),s=t.hasAttribute("x"),n=t.hasAttribute("y"),i=s?f(b(t,"x"),e.coordinatePrecision):0,l=n?f(b(t,"y"),e.coordinatePrecision):0,c=parseFloat(t.getAttribute("font-size")||"16"),u=t.getAttribute("font-family")||"Arial",m=t.getAttribute("font-weight")||"normal",N=t.getAttribute("fill")||"#000000",M=t.getAttribute("text-anchor"),E={middle:"center",end:"right"},I=t.querySelectorAll("tspan");let v=0,F=0,R=0,y=(t.textContent?.trim()||"").length*c*.6,p="";if(I.length>0){let g=1/0,h=-1/0,A=-1/0;const P=[],L=new Map;I.forEach(T=>{const Y=parseFloat(T.getAttribute("x")||"0"),X=parseFloat(T.getAttribute("y")||"0"),G=(T.textContent||"").replace(/[\u200B-\u200D\uFEFF]/g,"");if(g=Math.min(g,Y),G.length>0){const B=G.length*c*.6;A=Math.max(A,Y+B);const Q=Math.round(X);L.has(Q)||L.set(Q,[]),L.get(Q).push(G)}else h=Math.max(h,Y);P.push(X)}),p=Array.from(L.keys()).sort((T,Y)=>T-Y).map(T=>L.get(T).join("")).join(` 2`);const S=Math.max(h>0?h:-1/0,A>0?A:-1/0);Number.isFinite(g)&&Number.isFinite(S)&&S>g&&(R=g,y=S-g),P.length>0&&(v=Math.min(...P),F=Math.max(...P)+c)}else p=t.textContent?.trim()||"";const x=(I.length>0?new Set(Array.from(I).map(g=>Math.round(parseFloat(g.getAttribute("y")||"0")))).size:1)>1||p.includes(` 3`),C=x?F-v||c*1.5*p.split(` 4`).length:c*1.2;let w,d;if(o){const g=zt(o,i,l+v);w=g.x,d=g.y-c}else if(a.rotate!==0&&(a.rotateCx!==0||a.rotateCy!==0)){const g=a.rotate*Math.PI/180,h=Math.cos(g),A=Math.sin(g),P=a.rotateCx,L=a.rotateCy,S=i,T=l+v;w=P+(S-P)*h-(T-L)*A,d=L+(S-P)*A+(T-L)*h-c}else w=i+a.translateX+R,d=l+v-c+a.translateY;return{id:t.id||D(e.idPrefix),type:"text",position:{x:f(w,e.coordinatePrecision),y:f(d,e.coordinatePrecision)},size:{width:f(y,e.coordinatePrecision),height:f(C,e.coordinatePrecision)},rotation:a.rotate,opacity:b(t,"opacity",1),value:e.generatePlaceholders&&p.length>0?{placeholder:Ot(p)}:p,autoFit:!x,autoHeight:x,style:{fontFamily:Dt(u),fontSize:c,fontWeight:m,color:_(N),textAlign:E[M||""]||"left"}}};let $e=0;const Re=(t,e,r)=>{const a=t.getAttribute("href")||t.getAttributeNS("http://www.w3.org/1999/xlink","href")||"",o=a&&!a.startsWith("http://")&&!a.startsWith("https://")&&!a.startsWith("data:"),s=o&&e.skipExternalImages,n=f(b(t,"x"),e.coordinatePrecision),i=f(b(t,"y"),e.coordinatePrecision),l=b(t,"width"),c=b(t,"height"),u=z(t.getAttribute("transform")),m=f(l*u.scaleX,e.coordinatePrecision),N=f(c*u.scaleY,e.coordinatePrecision),M=f(n*u.scaleX+u.translateX,e.coordinatePrecision),E=f(i*u.scaleY+u.translateY,e.coordinatePrecision);s?r.push(`Image "${a}" - external file not available, created placeholder layer`):a.startsWith("data:")?r.push(`Image ${t.id||"unnamed"} has embedded data, consider using external URL`):o&&r.push(`Image ${t.id||"unnamed"} references external file "${a}" which may not be accessible`);let I;return s?I={placeholder:a.split("/").pop()?.replace(/\.[^/.]+$/,"")||"image"}:e.generatePlaceholders?I={placeholder:`image_${++$e}`}:I=a,{id:t.id||D(e.idPrefix),type:"image",position:{x:M,y:E}
4,size:{width:m,height:N},rotation:u.rotate,opacity:b(t,"opacity",1),url:I}};class Ye{converters=new Map;constructor(){this.register("rect",ve),this.register("circle",Le),this.register("ellipse",Se),this.register("line",Te),this.register("polygon",Fe),this.register("text",Ie),this.register("image",Re)}register(e,r){this.converters.set(e,r)}get(e){return this.converters.get(e)}has(e){return this.converters.has(e)}getAll(){return new Map(this.converters)}}const Xe=new Ye,_e={optimize:!0,coordinatePrecision:2,pathSimplificationThreshold:0,generatePlaceholders:!0,idPrefix:"el",skipExternalImages:!0,detectCharts:!0},ke=(t,e,r,a,o,s,n)=>{const i=Array.from(t.children);if(i.length===1){const l=t.getAttribute("transform");if(l){const c=i[0].getAttribute("transform");i[0].setAttribute("transform",c?`${l} ${c}`:l)}nt(i[0],e,r,a,o,s,n)}else i.forEach(l=>nt(l,e,r,a,o,s,n))},nt=(t,e,r,a,o,s,n)=>{if(n?.has(t))return;const i=t.tagName.toLowerCase();if(_t.includes(i))return;if(i==="g"){ke(t,e,r,a,o,s,n);return}if(s&&s.size>0&&te(t,s,e,r,a,o))return;const l=Xe.get(i);if(l){const c=l(t,e,o);c&&r.push(c)}else r.push(rt(t,e)),a.push(t.id||i)},qe=async(t,e={})=>{const r={..._e,...e},a=t.length,o=[],s=[],n=[],i=r.optimize?await Yt(t):t,l=new DOMParser().parseFromString(i,"image/svg+xml"),c=l.documentElement,u=l.querySelector("parsererror");if(u)throw new Error(`SVG parsing failed: ${u.textContent}`);if(c.tagName!=="svg")throw new Error("Invalid SVG: root element is not <svg>");const m=St(i);kt();const N=Qt(l),M=new Set;let E=null,I=!1,v="";if(r.detectCharts){const p=be.detectCharts(l,r);p&&(I=!0,v=p.chartType,E=p.chartElement,p.skipElements.forEach(x=>M.add(x)),n.push(`Detected ${v} chart pattern - converted to chart element`))}Array.from(c.children).forEach(p=>{M.has(p)||nt(p,r,o,s,n,N,M)}),E&&o.push(E);let F=o;if(!I){const p=Ce(o,r);p.chartConverted&&(F=p.elements,n.push(`Detected ${p.chartType} chart pattern - converted to chart element`))}const R=we(l,r);if(R){const p=Pe(R,r);F.push(p),n.push(`Detected table (${R.rows}x${R.columns}) - converted to table element`);const x=new Set(R.textElements.map(C=>C.id||C.getAttribute("id")).filter(Boolean));F=F.filter(C=>{if(C.type==="shape"){const w=C;return!R.rectElements.some(d=>{const g=parseFloat(d.getAttribute("x")||"0"),h=parseFloat(d.getAttribute("y")||"0");return Math.abs(w.position.x-g)<5&&Math.abs(w.position.y-h)<5})}if(C.type==="text"){const w=C;if(x.has(w.id))return!1;if(w.position.x>=R.bounds.x-k.TOLERANCE&&w.position.x<=R.bounds.x+R.bounds.width+k.TOLERANCE&&w.position.y>=R.bounds.y-k.TOLERANCE&&w.position.y<=R.bounds.y+R.bounds.height+k.TOLERANCE){const d=typeof w.value=="string"?w.value:"";if(R.cells.flat().some(g=>g.text===d))return!1}return!0}return!0})}const y={id:D("template"),name:"Converted SVG Template",width:m.width||800,height:m.height||600,elements:F,placeholders:{},metadata:{tags:["svg-import"],description:"Template converted from SVG",version:1}};return F.forEach(p=>{if(p.type==="text"){const x=p;typeof x.value=="object"&&"placeholder"in x.value&&(y.placeholders[x.value.placeholder]={type:"string",label:x.value.placeholder})}else if(p.type==="image"){const x=p;typeof x.url=="object"&&"placeholder"in x.url&&(y.placeholders[x.url.placeholder]={type:"string",label:x.url.placeholder})}else if(p.type==="chart"){const x=p;y.placeholders[x.data.placeholder]={type:"array",label:"Chart Data"}}}),{template:y,fallbackElements:s,warnings:n,metrics:{originalSvgSize:a,templateSize:JSON.stringify(y).length,elementsConverted:F.length-s.length,elementsFallback:s.length}}};export{Ht as BOUNDS_CALCULATORS,be as ChartDetectorRegistry,_e as DEFAULT_CONVERSION_OPTIONS,Xe as ElementConverterRegistry,Bt as PATH_BOUNDS_HANDLERS,lt as angleFromCenter,zt as applyMatrixToPoint,ye as areaChartDetector,Ut as calculateArcCenter,Dt as cleanFontFamily,dt as clusterRepresentative,ut as clusterValues,fe as convertAreaChartToElement,Le as convertCircle,Se as convertEllipse,Re as convertImage,Te as convertLine,pe as convertLineChartToElement,oe as convertPieChartToElement,Fe as convertPolygon,he as convertRadarChartToElement,ve as convertRect,qe as convertSvgToTemplate,Pe as convertTableToElement,Ie as convertText,Z as createChartElement,rt as createFallbackSvgElement,Ce as detectAndConvertBarChart,ge as detectAreaChartFromSvg,Ae as detectBarChart,de as detectLineChartFromSvg,se as detectPieChartFromSvg,ce as detectRadarChartFromSvg,we as detectTableFromSvg,O as distance,Jt as extractGradientId,re as findConcentricCenter,ee as findR
4adialCenter,D as generateId,Ot as generatePlaceholderName,ft as getElementBounds,b as getNumericAttr,V as getStyleProperties,ct as isEvenlySpacedX,me as lineChartDetector,U as parseArcFromPath,Qt as parseGradientsFromDefs,qt as parseMatrixTransform,jt as parsePathAsLine,Wt as parsePathCommands,Vt as parsePolylinePoints,z as parseTransform,ie as pieChartDetector,te as processElementWithGradients,ue as radarChartDetector,kt as resetIdCounter,f as roundTo,_ as shortenHexColor};
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.