@svgsketch/core 0.4.0 → 0.5.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/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- "use strict";var it=Object.defineProperty;var Xt=Object.getOwnPropertyDescriptor;var Yt=Object.getOwnPropertyNames;var qt=Object.prototype.hasOwnProperty;var Qt=(r,e)=>{for(var t in e)it(r,t,{get:e[t],enumerable:!0})},Zt=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Yt(e))!qt.call(r,s)&&s!==t&&it(r,s,{get:()=>e[s],enumerable:!(n=Xt(e,s))||n.enumerable});return r};var Kt=r=>Zt(it({},"__esModule",{value:!0}),r);var En={};Qt(En,{Arrow:()=>tt,CURRENT_SCHEMA_VERSION:()=>E,Circle:()=>Ue,Cross:()=>Ze,Document:()=>Le,EASING_CURVES:()=>ne,EVENT_TRIGGER_OPTIONS:()=>er,EasingType:()=>at,Ellipse:()=>ze,Gear:()=>et,ImageShape:()=>st,Line:()=>He,LinearGradientBuilder:()=>ee,MARKER_HEIGHT:()=>Me,MARKER_VIEWBOX:()=>ve,MARKER_WIDTH:()=>Pe,MIGRATIONS:()=>lt,NGon:()=>qe,PatternBuilder:()=>re,Polyline:()=>nt,RadialGradientBuilder:()=>te,Rectangle:()=>je,Ring:()=>Ke,ShapeBuilder:()=>C,Spiral:()=>Je,Spline:()=>rt,SplineCurveType:()=>ot,SplinePointType:()=>Ct,Square:()=>We,Star:()=>Qe,Text:()=>Xe,Timeline:()=>Ne,Track:()=>Ve,Triangle:()=>Ye,computeArrowVertices:()=>ge,computeCrossVertices:()=>fe,computeDashArray:()=>X,computeGearPath:()=>be,computeGearVertices:()=>ht,computePolygonVertices:()=>K,computeRectanglePath:()=>xe,computeRingPath:()=>$e,computeSpiralPath:()=>ye,computeSplinePath:()=>_e,computeStarVertices:()=>me,createDocument:()=>ie,createShape:()=>Rt,createViewbox:()=>Z,escXml:()=>M,extractVariables:()=>de,filterAttr:()=>we,generateCode:()=>Be,generateCssCode:()=>De,generateD3Code:()=>Ge,generateId:()=>$,generatePatternSvgContent:()=>Te,generateReactCode:()=>Ie,generateSvgCode:()=>Ee,generateVueCode:()=>Oe,getEasingCubicBezier:()=>Jt,getMarkerDescriptors:()=>Ce,getPatternElements:()=>J,linearGradient:()=>jt,migrateSnapshot:()=>se,parseDocument:()=>oe,parseVariableArgs:()=>At,pattern:()=>Ht,radialGradient:()=>Wt,renderAnimationElements:()=>Ae,renderCircle:()=>mt,renderEllipse:()=>ft,renderFilterDefs:()=>L,renderFilterPrimitivesForType:()=>dt,renderImage:()=>_t,renderLine:()=>$t,renderPolygonShape:()=>St,renderPolyline:()=>xt,renderRectangle:()=>gt,renderShape:()=>F,renderSpline:()=>bt,renderText:()=>yt,renderToSvg:()=>Y,stringifyDocument:()=>ae,substituteString:()=>le,substituteVariables:()=>he,validateSnapshot:()=>Q,verticesToPath:()=>U});module.exports=Kt(En);var at=(S=>(S.LINEAR="linear",S.EASE="ease",S.EASE_IN="ease-in",S.EASE_OUT="ease-out",S.EASE_IN_OUT="ease-in-out",S.EASE_IN_QUAD="ease-in-quad",S.EASE_OUT_QUAD="ease-out-quad",S.EASE_IN_OUT_QUAD="ease-in-out-quad",S.EASE_IN_CUBIC="ease-in-cubic",S.EASE_OUT_CUBIC="ease-out-cubic",S.EASE_IN_OUT_CUBIC="ease-in-out-cubic",S.EASE_IN_QUART="ease-in-quart",S.EASE_OUT_QUART="ease-out-quart",S.EASE_IN_OUT_QUART="ease-in-out-quart",S.EASE_IN_SINE="ease-in-sine",S.EASE_OUT_SINE="ease-out-sine",S.EASE_IN_OUT_SINE="ease-in-out-sine",S.EASE_IN_QUINT="ease-in-quint",S.EASE_OUT_QUINT="ease-out-quint",S.EASE_IN_OUT_QUINT="ease-in-out-quint",S.EASE_IN_EXPO="ease-in-expo",S.EASE_OUT_EXPO="ease-out-expo",S.EASE_IN_OUT_EXPO="ease-in-out-expo",S.EASE_IN_CIRC="ease-in-circ",S.EASE_OUT_CIRC="ease-out-circ",S.EASE_IN_OUT_CIRC="ease-in-out-circ",S.EASE_IN_BACK="ease-in-back",S.EASE_OUT_BACK="ease-out-back",S.EASE_IN_OUT_BACK="ease-in-out-back",S.CUSTOM_BEZIER="custom-bezier",S.LINEAR_FUNCTION="linear-function",S))(at||{}),ne={linear:null,ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1],"ease-in-quad":[.55,.085,.68,.53],"ease-out-quad":[.25,.46,.45,.94],"ease-in-out-quad":[.455,.03,.515,.955],"ease-in-cubic":[.55,.055,.675,.19],"ease-out-cubic":[.215,.61,.355,1],"ease-in-out-cubic":[.645,.045,.355,1],"ease-in-quart":[.895,.03,.685,.22],"ease-out-quart":[.165,.84,.44,1],"ease-in-out-quart":[.77,0,.175,1],"ease-in-sine":[.47,0,.745,.715],"ease-out-sine":[.39,.575,.565,1],"ease-in-out-sine":[.445,.05,.55,.95],"ease-in-quint":[.755,.05,.855,.06],"ease-out-quint":[.23,1,.32,1],"ease-in-out-quint":[.86,0,.07,1],"ease-in-expo":[.95,.05,.795,.035],"ease-out-expo":[.19,1,.22,1],"ease-in-out-expo":[1,0,0,1],"ease-in-circ":[.6,.04,.98,.335],"ease-out-circ":[.075,.82,.165,1],"ease-in-out-circ":[.785,.135,.15,.86],"ease-in-back":[.6,-.28,.735,.045],"ease-out-back":[.175,.885,.32,1.275],"ease-in-out-back":[.68,-.55,.265,1.55],"custom-bezier":null,"linear-function":null};function Jt(r){let e=ne[r];return e?`cubic-bezier(${e.join(", ")})`:"linear"}var er=[{value:"click",label:"Click"},{value:"mouseenter",label:"Mouse Enter"},{value:"mouseleave",label:"Mouse Leave"},{value:"focus",label:"Focus"},{value:"blur",label:"Blur"},{value:"load",label:"Page Load"}];var ot=(l=>(l.LINEAR="linear",l.QUADRATIC="quadratic",l.CUBIC="cubic",l.CATMULL_ROM="catmull-rom",l.ARC="arc",l.BASIS="basis",l.MIXED="mixed",l))(ot||{}),Ct=(n=>(n.SMOOTH="smooth",n.CORNER="corner",n.SYMMETRIC="symmetric",n))(Ct||{});var E=1;var lt=Object.freeze({});function tr(r){let e=r.schemaVersion;return typeof e!="number"||!Number.isFinite(e)||e<1?1:Math.floor(e)}function se(r,e=lt){let t=JSON.parse(JSON.stringify(r)),n=tr(t);if(n>E)return t;if(n===E)return t.schemaVersion=E,t;for(;n<E;){let s=e[n];if(!s)throw new Error(`[svgsketch/core] No migration registered for schema version ${n} \u2192 ${n+1}. Cannot safely upgrade this document to version ${E}.`);t=s(t),n+=1}return t.schemaVersion=E,t}var rr=new Set(["circle","rectangle","square","ellipse","text","triangle","ngon","star","cross","ring","spiral","gear","arrow","line","spline","polyline","image"]);function Q(r){let e=[],t=[];if(r==null||typeof r!="object")return e.push({path:"",message:"Snapshot must be a non-null object",severity:"error"}),{valid:!1,errors:e,warnings:t};let n=r;if(n.schemaVersion!==void 0&&(typeof n.schemaVersion!="number"||!Number.isInteger(n.schemaVersion)?e.push({path:"schemaVersion",message:"schemaVersion must be an integer",severity:"error"}):n.schemaVersion>E&&t.push({path:"schemaVersion",message:`schemaVersion ${n.schemaVersion} is newer than supported (${E})`,severity:"warning"})),!Array.isArray(n.shapes))e.push({path:"shapes",message:"shapes must be an array",severity:"error"});else{let s=new Set;n.shapes.forEach((a,o)=>{nr(a,`shapes[${o}]`,e,t,s)})}if(!Array.isArray(n.viewboxes))e.push({path:"viewboxes",message:"viewboxes must be an array",severity:"error"});else{let s=new Set;n.viewboxes.forEach((a,o)=>{or(a,`viewboxes[${o}]`,e,t,s)})}return n.guides!==void 0&&(Array.isArray(n.guides)?n.guides.forEach((s,a)=>{lr(s,`guides[${a}]`,e,t)}):e.push({path:"guides",message:"guides must be an array",severity:"error"})),n.groups!==void 0&&(Array.isArray(n.groups)?n.groups.forEach((s,a)=>{ur(s,`groups[${a}]`,e)}):e.push({path:"groups",message:"groups must be an array",severity:"error"})),n.clipMaskGroups!==void 0&&(Array.isArray(n.clipMaskGroups)?n.clipMaskGroups.forEach((s,a)=>{cr(s,`clipMaskGroups[${a}]`,e)}):e.push({path:"clipMaskGroups",message:"clipMaskGroups must be an array",severity:"error"})),n.measurements!==void 0&&(Array.isArray(n.measurements)||e.push({path:"measurements",message:"measurements must be an array",severity:"error"})),{valid:e.length===0,errors:e,warnings:t}}function nr(r,e,t,n,s){if(r===null||typeof r!="object"){t.push({path:e,message:"Shape must be a non-null object",severity:"error"});return}let a=r;typeof a.id!="string"||a.id.length===0?t.push({path:`${e}.id`,message:"Shape id must be a non-empty string",severity:"error"}):s.has(a.id)?t.push({path:`${e}.id`,message:`Duplicate shape id: "${a.id}"`,severity:"error"}):s.add(a.id),typeof a.type!="string"?t.push({path:`${e}.type`,message:"Shape type must be a string",severity:"error"}):rr.has(a.type)||n.push({path:`${e}.type`,message:`Unknown shape type: "${a.type}"`,severity:"warning"}),a.state===void 0||a.state===null||typeof a.state!="object"?t.push({path:`${e}.state`,message:"Shape state must be a non-null object",severity:"error"}):ar(a.state,`${e}.state`,t,n)}var sr=/^\s*\{\{\s*[\w.\-]+\s*\}\}\s*$/;function ir(r){return typeof r=="number"?isFinite(r):typeof r=="string"?sr.test(r):!1}function ar(r,e,t,n){let s=["x","y","width","height","radius","rx","ry","rotation","fontSize"];for(let o of s)r[o]!==void 0&&!ir(r[o])&&t.push({path:`${e}.${o}`,message:`${o} must be a finite number or a {{variable}} reference`,severity:"error"});let a=["width","height","radius","fontSize"];for(let o of a){let l=r[o];typeof l=="number"&&l<=0&&n.push({path:`${e}.${o}`,message:`${o} should be positive (got ${l})`,severity:"warning"})}}function or(r,e,t,n,s){if(r===null||typeof r!="object"){t.push({path:e,message:"Viewbox must be a non-null object",severity:"error"});return}let a=r;typeof a.id!="string"||a.id.length===0?t.push({path:`${e}.id`,message:"Viewbox id must be a non-empty string",severity:"error"}):s.has(a.id)?t.push({path:`${e}.id`,message:`Duplicate viewbox id: "${a.id}"`,severity:"error"}):s.add(a.id);for(let o of["x","y","width","height"])(typeof a[o]!="number"||!isFinite(a[o]))&&t.push({path:`${e}.${o}`,message:`${o} must be a finite number`,severity:"error"});typeof a.width=="number"&&a.width<=0&&t.push({path:`${e}.width`,message:"Viewbox width must be positive",severity:"error"}),typeof a.height=="number"&&a.height<=0&&t.push({path:`${e}.height`,message:"Viewbox height must be positive",severity:"error"})}function lr(r,e,t,n){if(r===null||typeof r!="object"){t.push({path:e,message:"Guide must be a non-null object",severity:"error"});return}let s=r;(typeof s.id!="string"||s.id.length===0)&&t.push({path:`${e}.id`,message:"Guide id must be a non-empty string",severity:"error"}),s.orientation!=="horizontal"&&s.orientation!=="vertical"&&t.push({path:`${e}.orientation`,message:'Guide orientation must be "horizontal" or "vertical"',severity:"error"}),(typeof s.position!="number"||!isFinite(s.position))&&t.push({path:`${e}.position`,message:"Guide position must be a finite number",severity:"error"})}function ur(r,e,t){if(r===null||typeof r!="object"){t.push({path:e,message:"Group must be a non-null object",severity:"error"});return}let n=r;(typeof n.id!="string"||n.id.length===0)&&t.push({path:`${e}.id`,message:"Group id must be a non-empty string",severity:"error"}),n.parentId!==null&&typeof n.parentId!="string"&&t.push({path:`${e}.parentId`,message:"Group parentId must be a string or null",severity:"error"})}function cr(r,e,t){if(r===null||typeof r!="object"){t.push({path:e,message:"ClipMaskGroup must be a non-null object",severity:"error"});return}let n=r;(typeof n.id!="string"||n.id.length===0)&&t.push({path:`${e}.id`,message:"ClipMaskGroup id must be a non-empty string",severity:"error"}),n.type!=="clip"&&n.type!=="mask"&&t.push({path:`${e}.type`,message:'ClipMaskGroup type must be "clip" or "mask"',severity:"error"}),(typeof n.clipShapeId!="string"||n.clipShapeId.length===0)&&t.push({path:`${e}.clipShapeId`,message:"clipShapeId must be a non-empty string",severity:"error"}),Array.isArray(n.contentShapeIds)||t.push({path:`${e}.contentShapeIds`,message:"contentShapeIds must be an array",severity:"error"})}function $(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`id-${crypto.randomUUID()}`:`id-${Date.now()}-${Math.random().toString(36).slice(2,11)}`}function ie(r={}){let e={schemaVersion:E,shapes:r.shapes?r.shapes.map(t=>({...t})):[],viewboxes:r.viewboxes?r.viewboxes.map(t=>({...t})):[]};return r.metadata&&(e.documentMetadata={title:"",description:"",author:"",keywords:[],license:"",licenseUrl:"",language:"en",customMetadata:{},...r.metadata}),e}function Rt(r){let{type:e,id:t,...n}=r,s={};for(let[a,o]of Object.entries(n))o!==void 0&&(s[a]=o);return{id:t??$(),type:e,state:s}}function Z(r,e,t,n,s){return{id:s??$(),x:r,y:e,width:t,height:n}}var hr=["schemaVersion","documentMetadata","templateVariables","viewboxes","guides","measurements","groups","clipMaskGroups","customPatterns","symbols","animationTimeline","shapes"];function ae(r,e={}){let{indent:t=2,trailingNewline:n=!0,validate:s=!1}=e;if(s){let l=Q(r);if(!l.valid){let u=l.errors.map(c=>` ${c.path}: ${c.message}`).join(`
1
+ "use strict";var yt=Object.defineProperty;var ln=Object.getOwnPropertyDescriptor;var un=Object.getOwnPropertyNames;var cn=Object.prototype.hasOwnProperty;var hn=(n,e)=>{for(var t in e)yt(n,t,{get:e[t],enumerable:!0})},dn=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of un(e))!cn.call(n,s)&&s!==t&&yt(n,s,{get:()=>e[s],enumerable:!(r=ln(e,s))||r.enumerable});return n};var pn=n=>dn(yt({},"__esModule",{value:!0}),n);var Xr={};hn(Xr,{Arrow:()=>pt,CURRENT_SCHEMA_VERSION:()=>B,Circle:()=>et,Cross:()=>ut,Document:()=>Qe,EASING_CURVES:()=>he,EVENT_TRIGGER_OPTIONS:()=>fn,EasingType:()=>bt,Ellipse:()=>tt,Gear:()=>dt,ImageShape:()=>gt,Line:()=>st,LinearGradientBuilder:()=>le,MARKER_HEIGHT:()=>Ve,MARKER_VIEWBOX:()=>Be,MARKER_WIDTH:()=>Le,MIGRATIONS:()=>St,NGon:()=>ot,PatternBuilder:()=>ce,Polyline:()=>ft,RadialGradientBuilder:()=>ue,Rectangle:()=>nt,Ring:()=>ct,ShapeBuilder:()=>D,Spiral:()=>ht,Spline:()=>mt,SplineCurveType:()=>xt,SplinePointType:()=>Ut,Square:()=>rt,Star:()=>lt,Text:()=>it,Timeline:()=>Je,Track:()=>Ke,Triangle:()=>at,computeArrowVertices:()=>we,computeCloudPath:()=>Me,computeCrossVertices:()=>ke,computeDashArray:()=>ne,computeGearPath:()=>Ae,computeGearVertices:()=>wt,computeHeartPath:()=>Pe,computeLightningVertices:()=>ve,computePolygonVertices:()=>ae,computeRectanglePath:()=>Ee,computeRingPath:()=>Ce,computeSpeechBubbleVertices:()=>Te,computeSpiralPath:()=>Re,computeSplinePath:()=>Fe,computeStarVertices:()=>_e,createDocument:()=>pe,createShape:()=>zt,createViewbox:()=>ie,escXml:()=>G,extractVariables:()=>xe,filterAttr:()=>Ge,generateCode:()=>Ze,generateCssCode:()=>qe,generateD3Code:()=>Ye,generateId:()=>_,generatePatternSvgContent:()=>De,generateReactCode:()=>He,generateSvgCode:()=>We,generateVueCode:()=>Xe,getEasingCubicBezier:()=>mn,getMarkerDescriptors:()=>Ne,getPatternElements:()=>oe,linearGradient:()=>rn,migrateSnapshot:()=>de,parseDocument:()=>fe,parseVariableArgs:()=>Wt,pattern:()=>an,radialGradient:()=>sn,renderAnimationElements:()=>ze,renderCircle:()=>Pt,renderEllipse:()=>Mt,renderFilterDefs:()=>j,renderFilterPrimitivesForType:()=>Tt,renderImage:()=>It,renderLine:()=>Rt,renderPolygonShape:()=>Ot,renderPolyline:()=>Ft,renderRectangle:()=>Ct,renderShape:()=>L,renderSpline:()=>Et,renderText:()=>At,renderToSvg:()=>re,stringifyDocument:()=>me,substituteString:()=>ge,substituteVariables:()=>be,validateSnapshot:()=>se,verticesToPath:()=>U});module.exports=pn(Xr);var bt=(T=>(T.LINEAR="linear",T.EASE="ease",T.EASE_IN="ease-in",T.EASE_OUT="ease-out",T.EASE_IN_OUT="ease-in-out",T.EASE_IN_QUAD="ease-in-quad",T.EASE_OUT_QUAD="ease-out-quad",T.EASE_IN_OUT_QUAD="ease-in-out-quad",T.EASE_IN_CUBIC="ease-in-cubic",T.EASE_OUT_CUBIC="ease-out-cubic",T.EASE_IN_OUT_CUBIC="ease-in-out-cubic",T.EASE_IN_QUART="ease-in-quart",T.EASE_OUT_QUART="ease-out-quart",T.EASE_IN_OUT_QUART="ease-in-out-quart",T.EASE_IN_SINE="ease-in-sine",T.EASE_OUT_SINE="ease-out-sine",T.EASE_IN_OUT_SINE="ease-in-out-sine",T.EASE_IN_QUINT="ease-in-quint",T.EASE_OUT_QUINT="ease-out-quint",T.EASE_IN_OUT_QUINT="ease-in-out-quint",T.EASE_IN_EXPO="ease-in-expo",T.EASE_OUT_EXPO="ease-out-expo",T.EASE_IN_OUT_EXPO="ease-in-out-expo",T.EASE_IN_CIRC="ease-in-circ",T.EASE_OUT_CIRC="ease-out-circ",T.EASE_IN_OUT_CIRC="ease-in-out-circ",T.EASE_IN_BACK="ease-in-back",T.EASE_OUT_BACK="ease-out-back",T.EASE_IN_OUT_BACK="ease-in-out-back",T.CUSTOM_BEZIER="custom-bezier",T.LINEAR_FUNCTION="linear-function",T.STEPS="steps",T))(bt||{}),he={linear:null,ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1],"ease-in-quad":[.55,.085,.68,.53],"ease-out-quad":[.25,.46,.45,.94],"ease-in-out-quad":[.455,.03,.515,.955],"ease-in-cubic":[.55,.055,.675,.19],"ease-out-cubic":[.215,.61,.355,1],"ease-in-out-cubic":[.645,.045,.355,1],"ease-in-quart":[.895,.03,.685,.22],"ease-out-quart":[.165,.84,.44,1],"ease-in-out-quart":[.77,0,.175,1],"ease-in-sine":[.47,0,.745,.715],"ease-out-sine":[.39,.575,.565,1],"ease-in-out-sine":[.445,.05,.55,.95],"ease-in-quint":[.755,.05,.855,.06],"ease-out-quint":[.23,1,.32,1],"ease-in-out-quint":[.86,0,.07,1],"ease-in-expo":[.95,.05,.795,.035],"ease-out-expo":[.19,1,.22,1],"ease-in-out-expo":[1,0,0,1],"ease-in-circ":[.6,.04,.98,.335],"ease-out-circ":[.075,.82,.165,1],"ease-in-out-circ":[.785,.135,.15,.86],"ease-in-back":[.6,-.28,.735,.045],"ease-out-back":[.175,.885,.32,1.275],"ease-in-out-back":[.68,-.55,.265,1.55],"custom-bezier":null,"linear-function":null,steps:null};function mn(n){let e=he[n];return e?`cubic-bezier(${e.join(", ")})`:"linear"}var fn=[{value:"click",label:"Click"},{value:"mouseenter",label:"Mouse Enter"},{value:"mouseleave",label:"Mouse Leave"},{value:"focus",label:"Focus"},{value:"blur",label:"Blur"},{value:"load",label:"Page Load"}];var xt=(l=>(l.LINEAR="linear",l.QUADRATIC="quadratic",l.CUBIC="cubic",l.CATMULL_ROM="catmull-rom",l.ARC="arc",l.BASIS="basis",l.MIXED="mixed",l))(xt||{}),Ut=(r=>(r.SMOOTH="smooth",r.CORNER="corner",r.SYMMETRIC="symmetric",r))(Ut||{});var B=1;var St=Object.freeze({});function gn(n){let e=n.schemaVersion;return typeof e!="number"||!Number.isFinite(e)||e<1?1:Math.floor(e)}function de(n,e=St){let t=JSON.parse(JSON.stringify(n)),r=gn(t);if(r>B)return t;if(r===B)return t.schemaVersion=B,t;for(;r<B;){let s=e[r];if(!s)throw new Error(`[svgsketch/core] No migration registered for schema version ${r} \u2192 ${r+1}. Cannot safely upgrade this document to version ${B}.`);t=s(t),r+=1}return t.schemaVersion=B,t}var $n=new Set(["circle","rectangle","square","ellipse","text","triangle","ngon","star","cross","ring","spiral","gear","arrow","line","spline","polyline","image"]);function se(n){let e=[],t=[];if(n==null||typeof n!="object")return e.push({path:"",message:"Snapshot must be a non-null object",severity:"error"}),{valid:!1,errors:e,warnings:t};let r=n;if(r.schemaVersion!==void 0&&(typeof r.schemaVersion!="number"||!Number.isInteger(r.schemaVersion)?e.push({path:"schemaVersion",message:"schemaVersion must be an integer",severity:"error"}):r.schemaVersion>B&&t.push({path:"schemaVersion",message:`schemaVersion ${r.schemaVersion} is newer than supported (${B})`,severity:"warning"})),!Array.isArray(r.shapes))e.push({path:"shapes",message:"shapes must be an array",severity:"error"});else{let s=new Set;r.shapes.forEach((a,o)=>{yn(a,`shapes[${o}]`,e,t,s)})}if(!Array.isArray(r.viewboxes))e.push({path:"viewboxes",message:"viewboxes must be an array",severity:"error"});else{let s=new Set;r.viewboxes.forEach((a,o)=>{_n(a,`viewboxes[${o}]`,e,t,s)})}return r.guides!==void 0&&(Array.isArray(r.guides)?r.guides.forEach((s,a)=>{kn(s,`guides[${a}]`,e,t)}):e.push({path:"guides",message:"guides must be an array",severity:"error"})),r.groups!==void 0&&(Array.isArray(r.groups)?r.groups.forEach((s,a)=>{wn(s,`groups[${a}]`,e)}):e.push({path:"groups",message:"groups must be an array",severity:"error"})),r.clipMaskGroups!==void 0&&(Array.isArray(r.clipMaskGroups)?r.clipMaskGroups.forEach((s,a)=>{Tn(s,`clipMaskGroups[${a}]`,e)}):e.push({path:"clipMaskGroups",message:"clipMaskGroups must be an array",severity:"error"})),r.measurements!==void 0&&(Array.isArray(r.measurements)||e.push({path:"measurements",message:"measurements must be an array",severity:"error"})),{valid:e.length===0,errors:e,warnings:t}}function yn(n,e,t,r,s){if(n===null||typeof n!="object"){t.push({path:e,message:"Shape must be a non-null object",severity:"error"});return}let a=n;typeof a.id!="string"||a.id.length===0?t.push({path:`${e}.id`,message:"Shape id must be a non-empty string",severity:"error"}):s.has(a.id)?t.push({path:`${e}.id`,message:`Duplicate shape id: "${a.id}"`,severity:"error"}):s.add(a.id),typeof a.type!="string"?t.push({path:`${e}.type`,message:"Shape type must be a string",severity:"error"}):$n.has(a.type)||r.push({path:`${e}.type`,message:`Unknown shape type: "${a.type}"`,severity:"warning"}),a.state===void 0||a.state===null||typeof a.state!="object"?t.push({path:`${e}.state`,message:"Shape state must be a non-null object",severity:"error"}):Sn(a.state,`${e}.state`,t,r)}var bn=/^\s*\{\{\s*[\w.\-]+\s*\}\}\s*$/;function xn(n){return typeof n=="number"?isFinite(n):typeof n=="string"?bn.test(n):!1}function Sn(n,e,t,r){let s=["x","y","width","height","radius","rx","ry","rotation","fontSize"];for(let o of s)n[o]!==void 0&&!xn(n[o])&&t.push({path:`${e}.${o}`,message:`${o} must be a finite number or a {{variable}} reference`,severity:"error"});let a=["width","height","radius","fontSize"];for(let o of a){let l=n[o];typeof l=="number"&&l<=0&&r.push({path:`${e}.${o}`,message:`${o} should be positive (got ${l})`,severity:"warning"})}}function _n(n,e,t,r,s){if(n===null||typeof n!="object"){t.push({path:e,message:"Viewbox must be a non-null object",severity:"error"});return}let a=n;typeof a.id!="string"||a.id.length===0?t.push({path:`${e}.id`,message:"Viewbox id must be a non-empty string",severity:"error"}):s.has(a.id)?t.push({path:`${e}.id`,message:`Duplicate viewbox id: "${a.id}"`,severity:"error"}):s.add(a.id);for(let o of["x","y","width","height"])(typeof a[o]!="number"||!isFinite(a[o]))&&t.push({path:`${e}.${o}`,message:`${o} must be a finite number`,severity:"error"});typeof a.width=="number"&&a.width<=0&&t.push({path:`${e}.width`,message:"Viewbox width must be positive",severity:"error"}),typeof a.height=="number"&&a.height<=0&&t.push({path:`${e}.height`,message:"Viewbox height must be positive",severity:"error"})}function kn(n,e,t,r){if(n===null||typeof n!="object"){t.push({path:e,message:"Guide must be a non-null object",severity:"error"});return}let s=n;(typeof s.id!="string"||s.id.length===0)&&t.push({path:`${e}.id`,message:"Guide id must be a non-empty string",severity:"error"}),s.orientation!=="horizontal"&&s.orientation!=="vertical"&&t.push({path:`${e}.orientation`,message:'Guide orientation must be "horizontal" or "vertical"',severity:"error"}),(typeof s.position!="number"||!isFinite(s.position))&&t.push({path:`${e}.position`,message:"Guide position must be a finite number",severity:"error"})}function wn(n,e,t){if(n===null||typeof n!="object"){t.push({path:e,message:"Group must be a non-null object",severity:"error"});return}let r=n;(typeof r.id!="string"||r.id.length===0)&&t.push({path:`${e}.id`,message:"Group id must be a non-empty string",severity:"error"}),r.parentId!==null&&typeof r.parentId!="string"&&t.push({path:`${e}.parentId`,message:"Group parentId must be a string or null",severity:"error"})}function Tn(n,e,t){if(n===null||typeof n!="object"){t.push({path:e,message:"ClipMaskGroup must be a non-null object",severity:"error"});return}let r=n;(typeof r.id!="string"||r.id.length===0)&&t.push({path:`${e}.id`,message:"ClipMaskGroup id must be a non-empty string",severity:"error"}),r.type!=="clip"&&r.type!=="mask"&&t.push({path:`${e}.type`,message:'ClipMaskGroup type must be "clip" or "mask"',severity:"error"}),(typeof r.clipShapeId!="string"||r.clipShapeId.length===0)&&t.push({path:`${e}.clipShapeId`,message:"clipShapeId must be a non-empty string",severity:"error"}),Array.isArray(r.contentShapeIds)||t.push({path:`${e}.contentShapeIds`,message:"contentShapeIds must be an array",severity:"error"})}function _(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`id-${crypto.randomUUID()}`:`id-${Date.now()}-${Math.random().toString(36).slice(2,11)}`}function pe(n={}){let e={schemaVersion:B,shapes:n.shapes?n.shapes.map(t=>({...t})):[],viewboxes:n.viewboxes?n.viewboxes.map(t=>({...t})):[]};return n.metadata&&(e.documentMetadata={title:"",description:"",author:"",keywords:[],license:"",licenseUrl:"",language:"en",customMetadata:{},...n.metadata}),e}function zt(n){let{type:e,id:t,...r}=n,s={};for(let[a,o]of Object.entries(r))o!==void 0&&(s[a]=o);return{id:t??_(),type:e,state:s}}function ie(n,e,t,r,s){return{id:s??_(),x:n,y:e,width:t,height:r}}var vn=["schemaVersion","documentMetadata","templateVariables","viewboxes","guides","measurements","groups","clipMaskGroups","customPatterns","symbols","animationTimeline","shapes"];function me(n,e={}){let{indent:t=2,trailingNewline:r=!0,validate:s=!1}=e;if(s){let l=se(n);if(!l.valid){let u=l.errors.map(c=>` ${c.path}: ${c.message}`).join(`
2
2
  `);throw new Error(`Invalid document:
3
- ${u}`)}}let a={};for(let l of hr){let u=r[l];if(u!==void 0)switch(l){case"shapes":a[l]=u.map(pr);break;case"viewboxes":case"guides":case"measurements":case"groups":case"clipMaskGroups":case"symbols":case"customPatterns":a[l]=dr(u).map(H);break;case"documentMetadata":a[l]=H(u);break;case"animationTimeline":a[l]=H(u);break;default:a[l]=u}}let o=JSON.stringify(a,null,t);return n?o+`
4
- `:o}function oe(r,e={}){let{validate:t=!0,migrate:n=!0}=e,s;try{s=JSON.parse(r)}catch(o){throw new Error(`Failed to parse .svgs document: ${o.message}`)}if(s===null||typeof s!="object"||Array.isArray(s))throw new Error("Invalid .svgs document: root must be a JSON object");let a=s;if(n&&(a=se(a)),t){let o=Q(a);if(!o.valid){let l=o.errors.map(u=>` ${u.path}: ${u.message}`).join(`
3
+ ${u}`)}}let a={};for(let l of vn){let u=n[l];if(u!==void 0)switch(l){case"shapes":a[l]=u.map(Mn);break;case"viewboxes":case"guides":case"measurements":case"groups":case"clipMaskGroups":case"symbols":case"customPatterns":a[l]=Pn(u).map(te);break;case"documentMetadata":a[l]=te(u);break;case"animationTimeline":a[l]=te(u);break;default:a[l]=u}}let o=JSON.stringify(a,null,t);return r?o+`
4
+ `:o}function fe(n,e={}){let{validate:t=!0,migrate:r=!0}=e,s;try{s=JSON.parse(n)}catch(o){throw new Error(`Failed to parse .svgs document: ${o.message}`)}if(s===null||typeof s!="object"||Array.isArray(s))throw new Error("Invalid .svgs document: root must be a JSON object");let a=s;if(r&&(a=de(a)),t){let o=se(a);if(!o.valid){let l=o.errors.map(u=>` ${u.path}: ${u.message}`).join(`
5
5
  `);throw new Error(`Invalid .svgs document:
6
- ${l}`)}}return a}function dr(r){return[...r].sort((e,t)=>e.id.localeCompare(t.id))}function H(r){if(r==null)return r;if(Array.isArray(r))return r.map(H);if(typeof r!="object")return r;let e={},t=Object.keys(r).sort();for(let n of t)e[n]=H(r[n]);return e}function pr(r){let e={};return e.id=r.id,e.type=r.type,e.state=H(r.state),e}var G=/\{\{\s*([\w.\-]+)\s*\}\}/g;function le(r,e){return r.replace(G,(t,n)=>{let s=e[n];return s!==void 0?String(s):t})}function he(r,e={}){let t={};if(r.templateVariables)for(let s of r.templateVariables)s.defaultValue!==void 0&&s.defaultValue!==""&&(t[s.name]=s.defaultValue);if(Object.assign(t,e),Object.keys(t).length===0)return JSON.parse(JSON.stringify(r));let n=JSON.parse(JSON.stringify(r));for(let s of n.shapes)ue(s.state,t);if(n.documentMetadata){let s=n.documentMetadata;ue(s,t)}return n}function ue(r,e){for(let t of Object.keys(r)){let n=r[t];if(typeof n=="string"){if(G.lastIndex=0,G.test(n)){G.lastIndex=0;let s=le(n,e);if(mr(n)){let a=Number(s);if(!isNaN(a)&&gr(t)){r[t]=a;continue}}r[t]=s}}else if(Array.isArray(n))for(let s=0;s<n.length;s++)typeof n[s]=="string"?(G.lastIndex=0,G.test(n[s])&&(G.lastIndex=0,n[s]=le(n[s],e))):n[s]!==null&&typeof n[s]=="object"&&ue(n[s],e);else n!==null&&typeof n=="object"&&ue(n,e)}}function mr(r){return/^\s*\{\{\s*[\w.\-]+\s*\}\}\s*$/.test(r)}var fr=new Set(["x","y","width","height","radius","rx","ry","cx","cy","x1","y1","x2","y2","fontSize","borderWidth","cornerRadius","opacity","fillOpacity","strokeOpacity","rotation","skewX","skewY","scaleX","scaleY","letterSpacing","wordSpacing","lineHeight","sides","arms","innerRadiusPercent","armWidthPercent","teeth","toothDepthPercent","holeRadiusPercent","turns","thicknessPercent","direction","headWidthPercent","headLengthPercent","shaftWidthPercent","shiftAngle","dashLength","gapLength","textPathStartOffset","imageOpacity"]);function gr(r){return fr.has(r)}function de(r){let e=r.templateVariables??[],t=new Set(e.map(a=>a.name)),n=new Set;for(let a of r.shapes)ce(a.state,n);r.documentMetadata&&ce(r.documentMetadata,n);let s=[...n].filter(a=>!t.has(a)).sort();return{defined:[...e],undeclared:s}}function ce(r,e){for(let t of Object.values(r))if(typeof t=="string"){let n;for(G.lastIndex=0;(n=G.exec(t))!==null;)e.add(n[1])}else if(Array.isArray(t))for(let n of t)if(typeof n=="string"){let s;for(G.lastIndex=0;(s=G.exec(n))!==null;)e.add(s[1])}else n!==null&&typeof n=="object"&&ce(n,e);else t!==null&&typeof t=="object"&&ce(t,e)}function At(r){let e={};for(let t of r){let n=t.indexOf("=");if(n===-1)throw new Error(`Invalid variable format: "${t}". Expected "name=value".`);let s=t.slice(0,n).trim(),a=t.slice(n+1);if(!s)throw new Error(`Invalid variable format: "${t}". Variable name cannot be empty.`);e[s]=a}return e}function K(r,e,t=-90){let n=[],s=t*Math.PI/180;for(let a=0;a<r;a++){let o=s+a*2*Math.PI/r;n.push({x:e*Math.cos(o),y:e*Math.sin(o)})}return n}function me(r,e,t,n=-90){let s=[],a=e*(t/100),o=n*Math.PI/180;for(let l=0;l<r*2;l++){let u=o+l*Math.PI/r,c=l%2===0?e:a;s.push({x:c*Math.cos(u),y:c*Math.sin(u)})}return s}function fe(r,e,t=0){let n=r*(e/100)/2,s=[{x:-n,y:-r},{x:n,y:-r},{x:n,y:-n},{x:r,y:-n},{x:r,y:n},{x:n,y:n},{x:n,y:r},{x:-n,y:r},{x:-n,y:n},{x:-r,y:n},{x:-r,y:-n},{x:-n,y:-n}];if(t===0)return s;let a=Math.cos(t*Math.PI/180),o=Math.sin(t*Math.PI/180);return s.map(l=>({x:l.x*a-l.y*o,y:l.x*o+l.y*a}))}function ge(r,e,t,n,s=-90){let o=r*2*(t/100),l=r*(e/100),u=l*(n/100),c=[{x:r,y:0},{x:r-o,y:-l/2},{x:r-o,y:-u/2},{x:-r,y:-u/2},{x:-r,y:u/2},{x:r-o,y:u/2},{x:r-o,y:l/2}];if(s===0)return c;let h=Math.cos(s*Math.PI/180),p=Math.sin(s*Math.PI/180);return c.map(d=>({x:d.x*h-d.y*p,y:d.x*p+d.y*h}))}function U(r,e=0,t=0){if(r.length<3)return"";if(e<=0)return r.map((a,o)=>(o===0?"M":"L")+`${a.x},${a.y}`).join(" ")+" Z";let n=Math.min(e,t*.4),s="";for(let a=0;a<r.length;a++){let o=r[(a-1+r.length)%r.length],l=r[a],u=r[(a+1)%r.length],c={x:o.x-l.x,y:o.y-l.y},h=Math.hypot(c.x,c.y);c.x/=h,c.y/=h;let p={x:u.x-l.x,y:u.y-l.y},d=Math.hypot(p.x,p.y);p.x/=d,p.y/=d;let f=Math.min(n,h/2),g=Math.min(n,d/2),y={x:l.x+c.x*f,y:l.y+c.y*f},b={x:l.x+p.x*g,y:l.y+p.y*g};s+=a===0?`M${y.x},${y.y}`:` L${y.x},${y.y}`,s+=` Q${l.x},${l.y} ${b.x},${b.y}`}return s+" Z"}function $e(r,e,t="evenodd"){let n=r*(e/100),s=t==="nonzero"?1:0;return`M ${r} 0 A ${r} ${r} 0 1 1 ${-r} 0 A ${r} ${r} 0 1 1 ${r} 0 Z M ${n} 0 A ${n} ${n} 0 1 ${s} ${-n} 0 A ${n} ${n} 0 1 ${s} ${n} 0 Z`}function ye(r,e,t,n=1,s=0){let a=r*(t/100),l=Math.round(e*36),u=e*2*Math.PI,c=(r-a/2)/u,h=s*Math.PI/180,p=[],d=[];for(let y=0;y<=l;y++){let b=y/l,k=b*u*n+h,_=c*(b*u)+a/2,x=a/2;p.push({x:(_+x*.3)*Math.cos(k),y:(_+x*.3)*Math.sin(k)}),d.push({x:Math.max(0,_-x*.3)*Math.cos(k),y:Math.max(0,_-x*.3)*Math.sin(k)})}let f=`M ${p[0].x} ${p[0].y}`;for(let y=1;y<p.length;y++)f+=` L ${p[y].x} ${p[y].y}`;let g=d[d.length-1];f+=` L ${g.x} ${g.y}`;for(let y=d.length-2;y>=0;y--)f+=` L ${d[y].x} ${d[y].y}`;return f+=" Z",f}function ht(r,e,t,n=0){let s=e*(t/100),a=e,o=e-s,l=2*Math.PI/r,u=l*.4,c=l*.1,h=n*Math.PI/180,p=[];for(let d=0;d<r;d++){let f=h+d*l;p.push({x:o*Math.cos(f),y:o*Math.sin(f)}),p.push({x:a*Math.cos(f+c),y:a*Math.sin(f+c)}),p.push({x:a*Math.cos(f+c+u),y:a*Math.sin(f+c+u)}),p.push({x:o*Math.cos(f+l-c),y:o*Math.sin(f+l-c)})}return p}function be(r,e,t,n=0,s=0,a="evenodd",o=0){let l=ht(r,e,t,o),u=Math.min(n,e*.1),c=U(l,u,e);if(s>0){let h=e*(s/100),p=a==="nonzero"?1:0;c+=` M ${h} 0 A ${h} ${h} 0 1 ${p} ${-h} 0 A ${h} ${h} 0 1 ${p} ${h} 0 Z`}return c}function xe(r,e,t,n,s,a="round",o="uniform",l){let u=Math.min(t,n)/2,c,h,p,d,f,g,y,b;if(o==="non-uniform"&&l?(c=Math.min(l.radiusTL??s,u),h=Math.min(l.radiusTR??s,u),p=Math.min(l.radiusBR??s,u),d=Math.min(l.radiusBL??s,u),f=l.shapeTL??a,g=l.shapeTR??a,y=l.shapeBR??a,b=l.shapeBL??a):(c=h=p=d=Math.min(s,u),f=g=y=b=a),!(a!=="round"||o==="non-uniform"||c>0&&f!=="round"||h>0&&g!=="round"||p>0&&y!=="round"||d>0&&b!=="round")&&c===h&&h===p&&p===d)return null;let _=`M${r+c},${e}`;return _+=` L${r+t-h},${e}`,_+=pe(g,h,r+t,e,"tr"),_+=` L${r+t},${e+n-p}`,_+=pe(y,p,r+t,e+n,"br"),_+=` L${r+d},${e+n}`,_+=pe(b,d,r,e+n,"bl"),_+=` L${r},${e+c}`,_+=pe(f,c,r,e,"tl"),_+=" Z",_}function pe(r,e,t,n,s){if(e<=0)return"";switch(r){case"round":switch(s){case"tr":return` A${e},${e} 0 0 1 ${t},${n+e}`;case"br":return` A${e},${e} 0 0 1 ${t-e},${n}`;case"bl":return` A${e},${e} 0 0 1 ${t},${n-e}`;case"tl":return` A${e},${e} 0 0 1 ${t+e},${n}`}break;case"scoop":switch(s){case"tr":return` A${e},${e} 0 0 0 ${t},${n+e}`;case"br":return` A${e},${e} 0 0 0 ${t-e},${n}`;case"bl":return` A${e},${e} 0 0 0 ${t},${n-e}`;case"tl":return` A${e},${e} 0 0 0 ${t+e},${n}`}break;case"bevel":switch(s){case"tr":return` L${t},${n+e}`;case"br":return` L${t-e},${n}`;case"bl":return` L${t},${n-e}`;case"tl":return` L${t+e},${n}`}break;case"notch":switch(s){case"tr":return` L${t-e},${n+e} L${t},${n+e}`;case"br":return` L${t-e},${n-e} L${t-e},${n}`;case"bl":return` L${t+e},${n-e} L${t},${n-e}`;case"tl":return` L${t+e},${n+e} L${t+e},${n}`}break}return""}function _e(r,e,t=!1,n=.5,s){if(r.length<2)return r.length===1?`M ${r[0].x} ${r[0].y}`:"";switch(e){case"LINEAR":case"linear":return Et(r,t);case"QUADRATIC":case"quadratic":return $r(r,t);case"CUBIC":case"cubic":return yr(r,t);case"ARC":case"arc":return br(r,t,s);case"MIXED":case"mixed":return Ft(r,t);case"CATMULL_ROM":case"catmull-rom":return xr(r,t,n);case"BASIS":case"basis":return _r(r,t);default:return r.some(a=>a.segmentType)?Ft(r,t):Et(r,t)}}function Et(r,e){let t=`M ${r[0].x} ${r[0].y}`,n=0;for(let s=1;s<r.length;s++)r[s].isSubpathStart?(e&&s-n>2&&(t+=" Z"),t+=` M ${r[s].x} ${r[s].y}`,n=s):t+=` L ${r[s].x} ${r[s].y}`;return e&&r.length-n>2&&(t+=" Z"),t}function $r(r,e){let t=`M ${r[0].x} ${r[0].y}`,n=0;for(let s=0;s<r.length-1;s++){let a=r[s],o=r[s+1];if(o.isSubpathStart){if(e&&s-n>=1){let u=r[n],c=a.handleOut??{x:(a.x+u.x)/2,y:(a.y+u.y)/2};t+=` Q ${c.x} ${c.y} ${u.x} ${u.y} Z`}t+=` M ${o.x} ${o.y}`,n=s+1;continue}let l=a.handleOut??{x:(a.x+o.x)/2,y:(a.y+o.y)/2};t+=` Q ${l.x} ${l.y} ${o.x} ${o.y}`}if(e&&r.length-n>1){let s=r[r.length-1],a=r[n],o=s.handleOut??{x:(s.x+a.x)/2,y:(s.y+a.y)/2};t+=` Q ${o.x} ${o.y} ${a.x} ${a.y} Z`}return t}function yr(r,e){let t=`M ${r[0].x} ${r[0].y}`,n=0;for(let s=0;s<r.length-1;s++){let a=r[s],o=r[s+1];if(o.isSubpathStart){if(e&&s-n>=1){let c=r[n],h=a.handleOut??{x:a.x,y:a.y},p=c.handleIn??{x:c.x,y:c.y};t+=` C ${h.x} ${h.y} ${p.x} ${p.y} ${c.x} ${c.y} Z`}t+=` M ${o.x} ${o.y}`,n=s+1;continue}let l=a.handleOut??{x:a.x,y:a.y},u=o.handleIn??{x:o.x,y:o.y};t+=` C ${l.x} ${l.y} ${u.x} ${u.y} ${o.x} ${o.y}`}if(e&&r.length-n>1){let s=r[r.length-1],a=r[n],o=s.handleOut??{x:s.x,y:s.y},l=a.handleIn??{x:a.x,y:a.y};t+=` C ${o.x} ${o.y} ${l.x} ${l.y} ${a.x} ${a.y} Z`}return t}function br(r,e,t){let n=`M ${r[0].x} ${r[0].y}`,s=0,a={rx:50,ry:50,rotation:0,largeArc:!1,sweep:!0};for(let o=0;o<r.length-1;o++){let l=r[o+1];if(l.isSubpathStart){if(e&&o-s>=1){let c=r[s],h=t?.[o]??a;n+=` A ${h.rx} ${h.ry} ${h.rotation} ${h.largeArc?1:0} ${h.sweep?1:0} ${c.x} ${c.y} Z`}n+=` M ${l.x} ${l.y}`,s=o+1;continue}let u=t?.[o]??a;n+=` A ${u.rx} ${u.ry} ${u.rotation} ${u.largeArc?1:0} ${u.sweep?1:0} ${l.x} ${l.y}`}if(e&&r.length-s>1){let o=r[s],l=t?.[r.length-1]??a;n+=` A ${l.rx} ${l.ry} ${l.rotation} ${l.largeArc?1:0} ${l.sweep?1:0} ${o.x} ${o.y} Z`}return n}function Ft(r,e){let t=`M ${r[0].x} ${r[0].y}`,n=0;for(let s=0;s<r.length-1;s++){let a=r[s],o=r[s+1];if(o.isSubpathStart){if(e&&s-n>=1){let l=r[n];t+=ut(a,l,l.segmentType),t+=" Z"}t+=` M ${o.x} ${o.y}`,n=s+1;continue}t+=ut(a,o,o.segmentType)}if(e&&r.length-n>1){let s=r[r.length-1],a=r[n];t+=ut(s,a,a.segmentType),t+=" Z"}return t}function ut(r,e,t){let n=(t??(r.handleOut||e.handleIn?"CUBIC":"LINEAR")).toUpperCase();if(n==="LINEAR")return` L ${e.x} ${e.y}`;if(n==="QUADRATIC"){let o=r.handleOut??{x:(r.x+e.x)/2,y:(r.y+e.y)/2};return` Q ${o.x} ${o.y} ${e.x} ${e.y}`}if(n==="ARC"){let o=e.arcParams;return o?` A ${o.rx} ${o.ry} ${o.rotation} ${o.largeArc?1:0} ${o.sweep?1:0} ${e.x} ${e.y}`:` L ${e.x} ${e.y}`}let s=r.handleOut??{x:r.x,y:r.y},a=e.handleIn??{x:e.x,y:e.y};return` C ${s.x} ${s.y} ${a.x} ${a.y} ${e.x} ${e.y}`}function xr(r,e,t){if(r.length<2)return r.length===1?`M ${r[0].x} ${r[0].y}`:"";let n=t,s=e?[r[r.length-1],...r,r[0],r[1]]:[r[0],...r,r[r.length-1]],a=`M ${r[0].x} ${r[0].y}`,o=e?r.length:r.length-1;for(let l=0;l<o;l++){let u=s[l],c=s[l+1],h=s[l+2],p=s[l+3],d=Math.hypot(h.x-c.x,h.y-c.y),f=Math.hypot(c.x-u.x,c.y-u.y),g=Math.hypot(p.x-h.x,p.y-h.y),y=Math.pow(f,n),b=Math.pow(d,n),k=Math.pow(g,n),_=Math.pow(f,2*n),x=Math.pow(d,2*n),P=Math.pow(g,2*n),I,O,T,v;f<1e-8?(I=c.x,O=c.y):(I=(_*h.x-x*u.x+(2*_+3*y*b+x)*c.x)/(3*y*(y+b)),O=(_*h.y-x*u.y+(2*_+3*y*b+x)*c.y)/(3*y*(y+b))),g<1e-8?(T=h.x,v=h.y):(T=(P*c.x-x*p.x+(2*P+3*k*b+x)*h.x)/(3*k*(k+b)),v=(P*c.y-x*p.y+(2*P+3*k*b+x)*h.y)/(3*k*(k+b))),a+=` C ${I} ${O} ${T} ${v} ${h.x} ${h.y}`}return e&&(a+=" Z"),a}function _r(r,e){let t=r.length;if(t<2)return t===1?`M ${r[0].x} ${r[0].y}`:"";if(t===2)return`M ${r[0].x} ${r[0].y} L ${r[1].x} ${r[1].y}`;if(e){let a=(r[0].x+4*r[1].x+r[2].x)/6,o=(r[0].y+4*r[1].y+r[2].y)/6,l=`M ${a} ${o}`;for(let u=0;u<t;u++){let c=r[(u+1)%t],h=r[(u+2)%t],p=r[(u+3)%t];l+=ct(c,h,p)}return l+=" Z",l}let n=r,s=`M ${n[0].x} ${n[0].y}`;s+=` L ${(5*n[0].x+n[1].x)/6} ${(5*n[0].y+n[1].y)/6}`;for(let a=0;a<=t-3;a++)s+=ct(n[a],n[a+1],n[a+2]);return s+=ct(n[t-2],n[t-1],n[t-1]),s+=` L ${n[t-1].x} ${n[t-1].y}`,s}function ct(r,e,t){return` C ${(2*r.x+e.x)/3} ${(2*r.y+e.y)/3} ${(r.x+2*e.x)/3} ${(r.y+2*e.y)/3} ${(r.x+4*e.x+t.x)/6} ${(r.y+4*e.y+t.y)/6}`}function X(r,e,t){let n=Number.isFinite(e)?Math.max(1,e):8,s=Number.isFinite(t)?Math.max(1,t):4;switch(r){case"dashed":case"dotted":case"custom":return`${n} ${s}`;default:return null}}function M(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function Sr(r){let e=r.fillType;return e||(r.fillGradient?r.fillGradient.r!==void 0?"radial-gradient":"linear-gradient":r.linearGradient?"linear-gradient":r.radialGradient?"radial-gradient":"solid")}function Se(r){let e=new Map,t=r.state,n=t;switch(r.type){case"circle":e.set("cx",String(t.x??0)),e.set("cy",String(t.y??0)),e.set("r",String(t.radius??50));break;case"ellipse":e.set("cx",String(t.cx??0)),e.set("cy",String(t.cy??0)),e.set("rx",String(t.rx??50)),e.set("ry",String(t.ry??30));break;case"rectangle":case"square":e.set("x",String(t.x??0)),e.set("y",String(t.y??0)),e.set("width",String(t.width??100)),e.set("height",String(t.height??100)),(t.cornerRadius??0)>0&&e.set("rx",String(t.cornerRadius));break;case"line":e.set("x1",String(t.x1??0)),e.set("y1",String(t.y1??0)),e.set("x2",String(t.x2??0)),e.set("y2",String(t.y2??0));break;case"text":e.set("x",String(t.x??0)),e.set("y",String(t.y??0)),t.fontSize&&e.set("font-size",String(t.fontSize)),t.fontFamily&&e.set("font-family",t.fontFamily),t.fontWeight&&e.set("font-weight",t.fontWeight),t.fontStyle&&e.set("font-style",t.fontStyle),t.textAnchor&&e.set("text-anchor",t.textAnchor),t.letterSpacing&&e.set("letter-spacing",String(t.letterSpacing));break;case"image":e.set("x",String(t.x??0)),e.set("y",String(t.y??0)),e.set("width",String(t.width??100)),e.set("height",String(t.height??100)),n.href&&e.set("href",String(n.href));break}let s=Sr(n);s==="none"?e.set("fill","none"):s==="linear-gradient"||s==="radial-gradient"?e.set("fill",`url(#gradient-fill-${r.id})`):s==="pattern"?e.set("fill",`url(#pattern-fill-${r.id})`):e.set("fill",t.fillColor??"#000000");let a=t.opacity;a!==void 0&&a<1&&e.set("opacity",String(a));let o=t.fillOpacity;o!==void 0&&o<1&&e.set("fill-opacity",String(o)),t.fillRule&&t.fillRule!=="nonzero"&&e.set("fill-rule",t.fillRule);let l=n.strokeType??"solid";if(l==="none")e.set("stroke","none");else if(l==="linear-gradient"||l==="radial-gradient")e.set("stroke",`url(#gradient-stroke-${r.id})`);else{let P=t.borderColor??"none";P!=="none"&&e.set("stroke",P)}let u=t.borderWidth;u!=null&&u!==0&&e.set("stroke-width",String(u));let c=t.strokeOpacity;c!==void 0&&c<1&&e.set("stroke-opacity",String(c));let h=t.lineStyle??"solid",p=t.dashLength??8,d=t.gapLength??4,f=X(h,p,d);f&&(e.set("stroke-dasharray",f),h==="dotted"&&e.set("stroke-linecap","round"));let g=kr(n);g&&e.set("transform",g);let y=n.filters;y&&y.length>0&&e.set("filter",`url(#filter-${r.id})`);let b=t.shapeRendering;b&&b!=="auto"&&e.set("shape-rendering",b);let k=n.startEndpoint,_=n.endEndpoint;k&&k!=="none"&&e.set("marker-start",`url(#line-marker-${k})`),_&&_!=="none"&&e.set("marker-end",`url(#line-marker-${_})`);let x=n.metadata;return x&&(x.role&&e.set("role",x.role),x.ariaLabel&&e.set("aria-label",x.ariaLabel)),e}function It(r){switch(r.type){case"circle":return"circle";case"ellipse":return"ellipse";case"rectangle":case"square":return"rect";case"line":return"line";case"text":return"text";case"image":return"image";case"spline":case"polyline":case"triangle":case"ngon":case"star":case"cross":case"ring":case"spiral":case"gear":case"arrow":return"path";default:return"g"}}function kr(r){let e=r.rotation??0,t=r.skewX??0,n=r.skewY??0,s=r.scaleX??1,a=r.scaleY??1;if(e===0&&t===0&&n===0&&s===1&&a===1)return null;let o=r.customPivot;if(!o)return null;let l=[];return l.push(`translate(${o.x}, ${o.y})`),e!==0&&l.push(`rotate(${e})`),(s!==1||a!==1)&&l.push(`scale(${s}, ${a})`),t!==0&&l.push(`skewX(${t})`),n!==0&&l.push(`skewY(${n})`),l.push(`translate(${-o.x}, ${-o.y})`),l.join(" ")}function B(r,e){let t=r.viewboxes?.[0];return{width:e.width??t?.width??800,height:e.height??t?.height??600}}function i(r,e){return e==null||e===""?"":` ${r}="${M(String(e))}"`}function ke(r){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return e?{r:parseInt(e[1],16)/255,g:parseInt(e[2],16)/255,b:parseInt(e[3],16)/255}:{r:0,g:0,b:0}}function wr(r,e,t){let{offsetX:n,offsetY:s,blurRadius:a,spread:o,color:l,opacity:u}=r,c="";if(o===0)c+=`<feDropShadow${i("in",e)}${i("dx",n)}${i("dy",s)}${i("stdDeviation",a/2)}${i("flood-color",l)}${i("flood-opacity",u)}${i("result",`${t}_shadow`)}/>`,c+=`<feMerge${i("result",t)}><feMergeNode${i("in",`${t}_shadow`)}/><feMergeNode${i("in",e)}/></feMerge>`;else{c+=`<feColorMatrix${i("in",e)}${i("type","matrix")}${i("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0")}${i("result",`${t}_alpha`)}/>`;let h=o>0?"dilate":"erode",p=Math.abs(o);c+=`<feMorphology${i("in",`${t}_alpha`)}${i("operator",h)}${i("radius",p)}${i("result",`${t}_spread`)}/>`,c+=`<feGaussianBlur${i("in",`${t}_spread`)}${i("stdDeviation",a/2)}${i("result",`${t}_blur`)}/>`,c+=`<feOffset${i("in",`${t}_blur`)}${i("dx",n)}${i("dy",s)}${i("result",`${t}_offset`)}/>`,c+=`<feFlood${i("flood-color",l)}${i("flood-opacity",u)}${i("result",`${t}_color`)}/>`,c+=`<feComposite${i("in",`${t}_color`)}${i("in2",`${t}_offset`)}${i("operator","in")}${i("result",`${t}_shadow`)}/>`,c+=`<feMerge${i("result",t)}><feMergeNode${i("in",`${t}_shadow`)}/><feMergeNode${i("in",e)}/></feMerge>`}return c}function Tr(r,e,t){let{offsetX:n,offsetY:s,blurRadius:a,choke:o,color:l,opacity:u}=r,c=a*(1-o/100),h="";return h+=`<feColorMatrix${i("in",e)}${i("type","matrix")}${i("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0")}${i("result",`${t}_alpha`)}/>`,h+=`<feComponentTransfer${i("in",`${t}_alpha`)}${i("result",`${t}_inverted`)}><feFuncA${i("type","table")}${i("tableValues","1 0")}/></feComponentTransfer>`,h+=`<feGaussianBlur${i("in",`${t}_inverted`)}${i("stdDeviation",c/2)}${i("result",`${t}_blur`)}/>`,h+=`<feOffset${i("in",`${t}_blur`)}${i("dx",n)}${i("dy",s)}${i("result",`${t}_offset`)}/>`,h+=`<feFlood${i("flood-color",l)}${i("flood-opacity",u)}${i("result",`${t}_color`)}/>`,h+=`<feComposite${i("in",`${t}_color`)}${i("in2",`${t}_offset`)}${i("operator","in")}${i("result",`${t}_coloredShadow`)}/>`,h+=`<feComposite${i("in",`${t}_coloredShadow`)}${i("in2",`${t}_alpha`)}${i("operator","in")}${i("result",`${t}_innerShadow`)}/>`,h+=`<feComposite${i("in",`${t}_innerShadow`)}${i("in2",e)}${i("operator","over")}${i("result",t)}/>`,h}function vr(r,e,t){let{blurX:n,blurY:s}=r;return n===0&&s===0?w(e,t):`<feGaussianBlur${i("in",e)}${i("stdDeviation",`${n/2} ${s/2}`)}${i("result",t)}/>`}function Pr(r,e,t){let{distance:n,angle:s}=r;if(n===0)return w(e,t);let a=s*Math.PI/180,o=Math.abs(Math.cos(a)*n),l=Math.abs(Math.sin(a)*n);return`<feGaussianBlur${i("in",e)}${i("stdDeviation",`${o/2} ${l/2}`)}${i("result",t)}/>`}function Ot(r,e,t){let{x:n,y:s,z:a,color:o,surfaceScale:l,diffuseConstant:u,specularConstant:c,specularExponent:h}=r,p="";return p+=`<feDiffuseLighting${i("in","SourceAlpha")}${i("surfaceScale",l)}${i("diffuseConstant",u)}${i("lighting-color",o)}${i("result",`${t}_diffuse`)}>`,p+=`<fePointLight${i("x",n)}${i("y",s)}${i("z",a)}/>`,p+="</feDiffuseLighting>",p+=`<feSpecularLighting${i("in","SourceAlpha")}${i("surfaceScale",l)}${i("specularConstant",c)}${i("specularExponent",h)}${i("lighting-color",o)}${i("result",`${t}_specular`)}>`,p+=`<fePointLight${i("x",n)}${i("y",s)}${i("z",a)}/>`,p+="</feSpecularLighting>",p+=`<feComposite${i("in",e)}${i("in2",`${t}_diffuse`)}${i("operator","arithmetic")}${i("k1",1)}${i("k2",0)}${i("k3",0)}${i("k4",0)}${i("result",`${t}_lit`)}/>`,p+=`<feComposite${i("in",`${t}_specular`)}${i("in2",`${t}_lit`)}${i("operator","arithmetic")}${i("k1",0)}${i("k2",1)}${i("k3",1)}${i("k4",0)}${i("result",t)}/>`,p}function Gt(r,e,t){let{x:n,y:s,z:a,pointsAtX:o,pointsAtY:l,pointsAtZ:u,coneAngle:c,color:h,surfaceScale:p,specularConstant:d,specularExponent:f}=r,g="";return g+=`<feSpecularLighting${i("in","SourceAlpha")}${i("surfaceScale",p)}${i("specularConstant",d)}${i("specularExponent",f)}${i("lighting-color",h)}${i("result",`${t}_specular`)}>`,g+=`<feSpotLight${i("x",n)}${i("y",s)}${i("z",a)}${i("pointsAtX",o)}${i("pointsAtY",l)}${i("pointsAtZ",u)}${i("limitingConeAngle",c)}/>`,g+="</feSpecularLighting>",g+=`<feComposite${i("in",`${t}_specular`)}${i("in2","SourceAlpha")}${i("operator","in")}${i("result",`${t}_clipped`)}/>`,g+=`<feComposite${i("in",`${t}_clipped`)}${i("in2",e)}${i("operator","arithmetic")}${i("k1",0)}${i("k2",1)}${i("k3",1)}${i("k4",0)}${i("result",t)}/>`,g}function Mr(r,e,t){let{width:n,color:s,opacity:a,position:o}=r,l="";if(o==="inside")l+=`<feMorphology${i("in","SourceAlpha")}${i("operator","erode")}${i("radius",n)}${i("result",`${t}_eroded`)}/>`,l+=`<feComposite${i("in","SourceAlpha")}${i("in2",`${t}_eroded`)}${i("operator","out")}${i("result",`${t}_outlineAlpha`)}/>`,l+=`<feFlood${i("flood-color",s)}${i("flood-opacity",a)}${i("result",`${t}_color`)}/>`,l+=`<feComposite${i("in",`${t}_color`)}${i("in2",`${t}_outlineAlpha`)}${i("operator","in")}${i("result",`${t}_outline`)}/>`,l+=`<feComposite${i("in",`${t}_outline`)}${i("in2",e)}${i("operator","over")}${i("result",t)}/>`;else{let u=o==="outside"?n:n/2;l+=`<feMorphology${i("in","SourceAlpha")}${i("operator","dilate")}${i("radius",u)}${i("result",`${t}_dilated`)}/>`,l+=`<feComposite${i("in",`${t}_dilated`)}${i("in2","SourceAlpha")}${i("operator","out")}${i("result",`${t}_outlineAlpha`)}/>`,l+=`<feFlood${i("flood-color",s)}${i("flood-opacity",a)}${i("result",`${t}_color`)}/>`,l+=`<feComposite${i("in",`${t}_color`)}${i("in2",`${t}_outlineAlpha`)}${i("operator","in")}${i("result",`${t}_outline`)}/>`,l+=`<feMerge${i("result",t)}><feMergeNode${i("in",`${t}_outline`)}/><feMergeNode${i("in",e)}/></feMerge>`}return l}function Cr(r,e,t){let{amount:n}=r;if(n===0)return w(e,t);let s=1+4*n,a=-n,o=[0,a,0,a,s,a,0,a,0].join(" ");return`<feConvolveMatrix${i("in",e)}${i("order","3")}${i("kernelMatrix",o)}${i("divisor","1")}${i("bias","0")}${i("preserveAlpha","true")}${i("edgeMode","duplicate")}${i("result",t)}/>`}function Rr(r,e,t){let{blockSize:n}=r;if(n<=1)return w(e,t);let s=n/2,a="";return a+=`<feMorphology${i("in",e)}${i("operator","erode")}${i("radius",s)}${i("result",`${t}_eroded`)}/>`,a+=`<feMorphology${i("in",`${t}_eroded`)}${i("operator","dilate")}${i("radius",s)}${i("result",t)}/>`,a}function Ar(r,e,t){let{scale:n,frequency:s,octaves:a,warpType:o}=r;if(n===0)return w(e,t);let l="";return l+=`<feTurbulence${i("type",o)}${i("baseFrequency",s)}${i("numOctaves",a)}${i("seed",0)}${i("result",`${t}_turbulence`)}/>`,l+=`<feDisplacementMap${i("in",e)}${i("in2",`${t}_turbulence`)}${i("scale",n)}${i("xChannelSelector","R")}${i("yChannelSelector","G")}${i("result",t)}/>`,l}function Er(r,e,t){let{operator:n,radiusX:s,radiusY:a}=r;return s===0&&a===0?w(e,t):`<feMorphology${i("in",e)}${i("operator",n)}${i("radius",`${s} ${a}`)}${i("result",t)}/>`}function Fr(r,e,t){let{levels:n}=r;if(n<2)return w(e,t);let s=[];for(let l=0;l<n;l++)s.push(l/(n-1));let a=s.join(" "),o=`<feComponentTransfer${i("in",e)}${i("result",t)}>`;return o+=`<feFuncR${i("type","discrete")}${i("tableValues",a)}/>`,o+=`<feFuncG${i("type","discrete")}${i("tableValues",a)}/>`,o+=`<feFuncB${i("type","discrete")}${i("tableValues",a)}/>`,o+="</feComponentTransfer>",o}function Ir(r,e,t){let{levels:n,contrast:s}=r;if(n<2)return w(e,t);let a=[];for(let u=0;u<n;u++){let c=u/(n-1),h=c;s!==1&&(h=.5+(c-.5)*s,h=Math.max(0,Math.min(1,h))),a.push(h)}let o=a.join(" "),l=`<feComponentTransfer${i("in",e)}${i("result",t)}>`;return l+=`<feFuncR${i("type","table")}${i("tableValues",o)}/>`,l+=`<feFuncG${i("type","table")}${i("tableValues",o)}/>`,l+=`<feFuncB${i("type","table")}${i("tableValues",o)}/>`,l+="</feComponentTransfer>",l}function Or(r,e,t){let{radius:n}=r;if(n===0)return w(e,t);let s="";return s+=`<feGaussianBlur${i("in","SourceAlpha")}${i("stdDeviation",n)}${i("result",`${t}_blurredAlpha`)}/>`,s+=`<feComponentTransfer${i("in",`${t}_blurredAlpha`)}${i("result",`${t}_thresholdAlpha`)}><feFuncA${i("type","linear")}${i("slope",20)}${i("intercept",-9)}/></feComponentTransfer>`,s+=`<feComposite${i("in",e)}${i("in2",`${t}_thresholdAlpha`)}${i("operator","in")}${i("result",t)}/>`,s}function Gr(r,e,t){let{amount:n}=r;if(n===0)return w(e,t);let s=1-n;return`<feColorMatrix${i("in",e)}${i("type","saturate")}${i("values",s)}${i("result",t)}/>`}function Dr(r,e,t){let{red:n,green:s,blue:a}=r;if(n===1&&s===1&&a===1)return w(e,t);let o=`<feComponentTransfer${i("in",e)}${i("result",t)}>`;return o+=`<feFuncR${i("type","linear")}${i("slope",n)}${i("intercept",0)}/>`,o+=`<feFuncG${i("type","linear")}${i("slope",s)}${i("intercept",0)}/>`,o+=`<feFuncB${i("type","linear")}${i("slope",a)}${i("intercept",0)}/>`,o+="</feComponentTransfer>",o}function Br(r,e,t){let{amount:n}=r;if(n===1)return w(e,t);let s=`<feComponentTransfer${i("in",e)}${i("result",t)}>`;return s+=`<feFuncR${i("type","linear")}${i("slope",n)}${i("intercept",0)}/>`,s+=`<feFuncG${i("type","linear")}${i("slope",n)}${i("intercept",0)}/>`,s+=`<feFuncB${i("type","linear")}${i("slope",n)}${i("intercept",0)}/>`,s+="</feComponentTransfer>",s}function Lr(r,e,t){let{amount:n}=r;if(n===1)return w(e,t);let s=.5*(1-n),a=`<feComponentTransfer${i("in",e)}${i("result",t)}>`;return a+=`<feFuncR${i("type","linear")}${i("slope",n)}${i("intercept",s)}/>`,a+=`<feFuncG${i("type","linear")}${i("slope",n)}${i("intercept",s)}/>`,a+=`<feFuncB${i("type","linear")}${i("slope",n)}${i("intercept",s)}/>`,a+="</feComponentTransfer>",a}function Vr(r,e,t){let{amount:n}=r;if(n===1)return w(e,t);let s=`<feComponentTransfer${i("in",e)}${i("result",t)}>`;return s+=`<feFuncA${i("type","linear")}${i("slope",n)}${i("intercept",0)}/>`,s+="</feComponentTransfer>",s}function Nr(r,e,t){let{amount:n}=r;if(n===0)return w(e,t);let s=n,a=1-n,o=`${s} ${a}`,l=`<feComponentTransfer${i("in",e)}${i("result",t)}>`;return l+=`<feFuncR${i("type","table")}${i("tableValues",o)}/>`,l+=`<feFuncG${i("type","table")}${i("tableValues",o)}/>`,l+=`<feFuncB${i("type","table")}${i("tableValues",o)}/>`,l+="</feComponentTransfer>",l}function Ur(r,e,t){let{angle:n}=r;return n===0||n===360?w(e,t):`<feColorMatrix${i("in",e)}${i("type","hueRotate")}${i("values",n)}${i("result",t)}/>`}function zr(r,e,t){let{amount:n}=r;return n===1?w(e,t):`<feColorMatrix${i("in",e)}${i("type","saturate")}${i("values",n)}${i("result",t)}/>`}function jr(r,e,t){let{threshold:n}=r,s="";if(s+=`<feColorMatrix${i("in",e)}${i("type","saturate")}${i("values",0)}${i("result",`${t}_gray`)}/>`,n===.5)s+=`<feComponentTransfer${i("in",`${t}_gray`)}${i("result",t)}>`,s+=`<feFuncR${i("type","discrete")}${i("tableValues","0 1")}/>`,s+=`<feFuncG${i("type","discrete")}${i("tableValues","0 1")}/>`,s+=`<feFuncB${i("type","discrete")}${i("tableValues","0 1")}/>`,s+="</feComponentTransfer>";else{let o=[];for(let u=0;u<256;u++)o.push(u/255<n?0:1);let l=o.join(" ");s+=`<feComponentTransfer${i("in",`${t}_gray`)}${i("result",t)}>`,s+=`<feFuncR${i("type","table")}${i("tableValues",l)}/>`,s+=`<feFuncG${i("type","table")}${i("tableValues",l)}/>`,s+=`<feFuncB${i("type","table")}${i("tableValues",l)}/>`,s+="</feComponentTransfer>"}return s}function Wr(r,e,t){let{amount:n}=r;if(n===0)return w(e,t);let s=[.393,.769,.189,0,0],a=[.349,.686,.168,0,0],o=[.272,.534,.131,0,0],l=[1,0,0,0,0],u=[0,1,0,0,0],c=[0,0,1,0,0],h=(y,b)=>y.map((k,_)=>k*(1-n)+b[_]*n),p=h(l,s),d=h(u,a),f=h(c,o),g=[...p,...d,...f,0,0,0,1,0].join(" ");return`<feColorMatrix${i("in",e)}${i("type","matrix")}${i("values",g)}${i("result",t)}/>`}function Hr(r,e,t){let{shadowColor:n,highlightColor:s}=r,a=ke(n),o=ke(s),l="";return l+=`<feColorMatrix${i("in",e)}${i("type","saturate")}${i("values",0)}${i("result",`${t}_gray`)}/>`,l+=`<feComponentTransfer${i("in",`${t}_gray`)}${i("result",t)}>`,l+=`<feFuncR${i("type","table")}${i("tableValues",`${a.r} ${o.r}`)}/>`,l+=`<feFuncG${i("type","table")}${i("tableValues",`${a.g} ${o.g}`)}/>`,l+=`<feFuncB${i("type","table")}${i("tableValues",`${a.b} ${o.b}`)}/>`,l+="</feComponentTransfer>",l}function Xr(r,e,t){let{intensity:n}=r;if(n===0)return w(e,t);let s="";s+=`<feComponentTransfer${i("in",e)}${i("result",`${t}_invert`)}>`,s+=`<feFuncR${i("type","table")}${i("tableValues","1 0")}/>`,s+=`<feFuncG${i("type","table")}${i("tableValues","1 0")}/>`,s+=`<feFuncB${i("type","table")}${i("tableValues","1 0")}/>`,s+="</feComponentTransfer>",s+=`<feColorMatrix${i("in",`${t}_invert`)}${i("type","saturate")}${i("values",0)}${i("result",`${t}_gray`)}/>`;let a=[.1,.1,.1,0,0],o=[.3,.4,.3,0,0],l=[.5,.5,.8,0,0],u=[1,0,0,0,0],c=[0,1,0,0,0],h=[0,0,1,0,0],p=(b,k)=>b.map((_,x)=>_*(1-n)+k[x]*n),d=p(u,a),f=p(c,o),g=p(h,l),y=[...d,...f,...g,0,0,0,1,0].join(" ");return s+=`<feColorMatrix${i("in",`${t}_gray`)}${i("type","matrix")}${i("values",y)}${i("result",t)}/>`,s}function Yr(r,e,t){let{amount:n,scale:s}=r;if(n===0)return w(e,t);let a=1/s,o="";return o+=`<feTurbulence${i("type","fractalNoise")}${i("baseFrequency",a)}${i("numOctaves",3)}${i("seed",0)}${i("result",`${t}_noise`)}/>`,o+=`<feColorMatrix${i("in",`${t}_noise`)}${i("type","saturate")}${i("values",0)}${i("result",`${t}_noiseGray`)}/>`,o+=`<feBlend${i("in",e)}${i("in2",`${t}_noiseGray`)}${i("mode","overlay")}${i("result",`${t}_blended`)}/>`,o+=`<feComposite${i("in",`${t}_blended`)}${i("in2",e)}${i("operator","arithmetic")}${i("k1",0)}${i("k2",n)}${i("k3",1-n)}${i("k4",0)}${i("result",`${t}_amt`)}/>`,o+=`<feComposite${i("in",`${t}_amt`)}${i("in2",e)}${i("operator","in")}${i("result",t)}/>`,o}function qr(r,e,t){let{strength:n,angle:s}=r;if(n===0)return w(e,t);let a=s*Math.PI/180,o=Math.cos(a),l=Math.sin(a),u=n,c=[-(u*(o+l)),-(u*l),u*(-o+l),-(u*o),1,u*o,u*(o-l),u*l,u*(o+l)].join(" ");return`<feConvolveMatrix${i("in",e)}${i("order","3 3")}${i("kernelMatrix",c)}${i("divisor",1)}${i("bias",.5)}${i("preserveAlpha","true")}${i("result",t)}/>`}function Qr(r,e,t){let{amount:n,size:s}=r;if(n===0)return w(e,t);let a=.5/s,o="";return o+=`<feTurbulence${i("type","fractalNoise")}${i("baseFrequency",`${a} ${a}`)}${i("numOctaves",5)}${i("seed",0)}${i("stitchTiles","stitch")}${i("result",`${t}_grain`)}/>`,o+=`<feColorMatrix${i("in",`${t}_grain`)}${i("type","saturate")}${i("values",0)}${i("result",`${t}_grainGray`)}/>`,o+=`<feBlend${i("in",e)}${i("in2",`${t}_grainGray`)}${i("mode","soft-light")}${i("result",`${t}_blended`)}/>`,o+=`<feComposite${i("in",`${t}_blended`)}${i("in2",e)}${i("operator","arithmetic")}${i("k1",0)}${i("k2",n)}${i("k3",1-n)}${i("k4",0)}${i("result",`${t}_amt`)}/>`,o+=`<feComposite${i("in",`${t}_amt`)}${i("in2",e)}${i("operator","in")}${i("result",t)}/>`,o}function Zr(r,e,t){let{wetness:n,turbulence:s}=r;if(n===0&&s===0)return w(e,t);let a="";return a+=`<feTurbulence${i("type","fractalNoise")}${i("baseFrequency",.02+s*.03)}${i("numOctaves",4)}${i("seed",42)}${i("result",`${t}_turb`)}/>`,a+=`<feDisplacementMap${i("in",e)}${i("in2",`${t}_turb`)}${i("scale",n*15)}${i("xChannelSelector","R")}${i("yChannelSelector","G")}${i("result",`${t}_disp`)}/>`,a+=`<feGaussianBlur${i("in",`${t}_disp`)}${i("stdDeviation",n*2)}${i("result",`${t}_blur`)}/>`,a+=`<feBlend${i("in",`${t}_blur`)}${i("in2",e)}${i("mode","multiply")}${i("result",t)}/>`,a}function Kr(r,e,t){let{thickness:n,texture:s}=r;if(n===0&&s===0)return w(e,t);let a="";a+=`<feTurbulence${i("type","turbulence")}${i("baseFrequency",.03+s*.02)}${i("numOctaves",3)}${i("seed",1e3)}${i("result",`${t}_brush`)}/>`;let o=Math.max(3,8-Math.floor(n*5)),l=Array.from({length:o+1},(u,c)=>c/o).join(" ");a+=`<feComponentTransfer${i("in",e)}${i("result",`${t}_poster`)}>`;for(let u of["R","G","B"])a+=`<feFunc${u}${i("type","discrete")}${i("tableValues",l)}/>`;return a+="</feComponentTransfer>",a+=`<feDisplacementMap${i("in",`${t}_poster`)}${i("in2",`${t}_brush`)}${i("scale",s*4)}${i("xChannelSelector","R")}${i("yChannelSelector","G")}${i("result",`${t}_disp`)}/>`,a+=`<feMorphology${i("in",`${t}_disp`)}${i("operator","dilate")}${i("radius",n*.5)}${i("result",`${t}_thick`)}/>`,a+=`<feComposite${i("in",`${t}_thick`)}${i("in2",e)}${i("operator","in")}${i("result",t)}/>`,a}function Jr(r,e,t){let{spread:n,edges:s}=r;if(n===0&&s===0)return w(e,t);let a="";return a+=`<feTurbulence${i("type","fractalNoise")}${i("baseFrequency",.01+s*.02)}${i("numOctaves",5)}${i("seed",1100)}${i("result",`${t}_ink`)}/>`,a+=`<feMorphology${i("in",e)}${i("operator","dilate")}${i("radius",n*3)}${i("result",`${t}_dilate`)}/>`,a+=`<feDisplacementMap${i("in",`${t}_dilate`)}${i("in2",`${t}_ink`)}${i("scale",s*10)}${i("xChannelSelector","R")}${i("yChannelSelector","G")}${i("result",`${t}_disp`)}/>`,a+=`<feGaussianBlur${i("in",`${t}_disp`)}${i("stdDeviation",n*.5)}${i("result",t)}/>`,a}function en(r,e,t){let{wrinkles:n,shine:s}=r;if(n===0&&s===0)return w(e,t);let a="";return a+=`<feTurbulence${i("type","turbulence")}${i("baseFrequency",.02)}${i("numOctaves",4)}${i("seed",1200)}${i("result",`${t}_wrinkle`)}/>`,a+=`<feDisplacementMap${i("in",e)}${i("in2",`${t}_wrinkle`)}${i("scale",n*15)}${i("xChannelSelector","R")}${i("yChannelSelector","G")}${i("result",`${t}_disp`)}/>`,a+=`<feSpecularLighting${i("in",`${t}_wrinkle`)}${i("surfaceScale",n*2)}${i("specularConstant",s*1.5)}${i("specularExponent",20)}${i("result",`${t}_sheen`)}>`,a+=`<feDistantLight${i("azimuth",45)}${i("elevation",60)}/>`,a+="</feSpecularLighting>",a+=`<feBlend${i("in",`${t}_disp`)}${i("in2",`${t}_sheen`)}${i("mode","screen")}${i("result",`${t}_blend`)}/>`,a+=`<feComposite${i("in",`${t}_blend`)}${i("in2",e)}${i("operator","in")}${i("result",t)}/>`,a}function tn(r,e,t){let{density:n,size:s}=r;if(n===0)return w(e,t);let a="",o=1-n;a+=`<feTurbulence${i("type","turbulence")}${i("baseFrequency",.1/s)}${i("numOctaves",1)}${i("seed",1400)}${i("result",`${t}_hole`)}/>`,a+=`<feComponentTransfer${i("in",`${t}_hole`)}${i("result",`${t}_thresh`)}>`;for(let l of["R","G","B","A"])a+=`<feFunc${l}${i("type","linear")}${i("slope",10)}${i("intercept",-o*10+5)}/>`;a+="</feComponentTransfer>",a+=`<feComponentTransfer${i("in",`${t}_thresh`)}${i("result",`${t}_clamp`)}>`;for(let l of["R","G","B","A"])a+=`<feFunc${l}${i("type","table")}${i("tableValues","0 0 1 1")}/>`;return a+="</feComponentTransfer>",a+=`<feComposite${i("in",e)}${i("in2",`${t}_clamp`)}${i("operator","in")}${i("result",t)}/>`,a}function rn(r,e,t){let{color:n,radius:s,intensity:a}=r;if(a===0||s===0)return w(e,t);let{r:o,g:l,b:u}=ke(n),c="";return c+=`<feColorMatrix${i("in",e)}${i("type","matrix")}${i("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0")}${i("result",`${t}_alpha`)}/>`,c+=`<feGaussianBlur${i("in",`${t}_alpha`)}${i("stdDeviation",s/2)}${i("result",`${t}_blur`)}/>`,c+=`<feColorMatrix${i("in",`${t}_blur`)}${i("type","matrix")}${i("values",`0 0 0 0 ${o} 0 0 0 0 ${l} 0 0 0 0 ${u} 0 0 0 ${a} 0`)}${i("result",`${t}_color`)}/>`,c+=`<feMerge${i("result",t)}><feMergeNode${i("in",`${t}_color`)}/><feMergeNode${i("in",e)}/></feMerge>`,c}function nn(r,e,t){let{color:n,radius:s,intensity:a}=r;if(a===0||s===0)return w(e,t);let{r:o,g:l,b:u}=ke(n),c="";return c+=`<feColorMatrix${i("in",e)}${i("type","matrix")}${i("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0")}${i("result",`${t}_alpha`)}/>`,c+=`<feMorphology${i("in",`${t}_alpha`)}${i("operator","erode")}${i("radius",s/4)}${i("result",`${t}_erode`)}/>`,c+=`<feComposite${i("in",`${t}_alpha`)}${i("in2",`${t}_erode`)}${i("operator","out")}${i("result",`${t}_edge`)}/>`,c+=`<feGaussianBlur${i("in",`${t}_edge`)}${i("stdDeviation",s/3)}${i("result",`${t}_blur`)}/>`,c+=`<feColorMatrix${i("in",`${t}_blur`)}${i("type","matrix")}${i("values",`0 0 0 0 ${o} 0 0 0 0 ${l} 0 0 0 0 ${u} 0 0 0 ${a*2} 0`)}${i("result",`${t}_color`)}/>`,c+=`<feComposite${i("in",`${t}_color`)}${i("in2",`${t}_alpha`)}${i("operator","in")}${i("result",`${t}_clipped`)}/>`,c+=`<feComposite${i("in",`${t}_clipped`)}${i("in2",e)}${i("operator","over")}${i("result",t)}/>`,c}function w(r,e){return`<feMerge${i("result",e)}><feMergeNode${i("in",r)}/></feMerge>`}function dt(r,e,t,n){switch(r.type){case"drop-shadow":return wr(r,e,t);case"inner-shadow":return Tr(r,e,t);case"gaussian-blur":return vr(r,e,t);case"motion-blur":return Pr(r,e,t);case"point-light":{let s=r;return Ot(n?{...s,x:s.x+n.x,y:s.y+n.y}:s,e,t)}case"spot-light":{let s=r;return Gt(n?{...s,x:s.x+n.x,y:s.y+n.y,pointsAtX:s.pointsAtX+n.x,pointsAtY:s.pointsAtY+n.y}:s,e,t)}case"outline":return Mr(r,e,t);case"sharpen":return Cr(r,e,t);case"pixelate":return Rr(r,e,t);case"warp":return Ar(r,e,t);case"morphology":return Er(r,e,t);case"contouring-discrete":return Fr(r,e,t);case"contouring-table":return Ir(r,e,t);case"round-edges":return Or(r,e,t);case"grayscale":return Gr(r,e,t);case"channel-painter":return Dr(r,e,t);case"brightness":return Br(r,e,t);case"contrast":return Lr(r,e,t);case"opacity":return Vr(r,e,t);case"invert":return Nr(r,e,t);case"hue-rotate":return Ur(r,e,t);case"saturate":return zr(r,e,t);case"black-and-white":return jr(r,e,t);case"sepia":return Wr(r,e,t);case"duotone":return Hr(r,e,t);case"xray":return Xr(r,e,t);case"noise":return Yr(r,e,t);case"emboss":return qr(r,e,t);case"film-grain":return Qr(r,e,t);case"watercolor":return Zr(r,e,t);case"gouache":return Kr(r,e,t);case"ink-blot":return Jr(r,e,t);case"crumpled-plastic":return en(r,e,t);case"riddled":return tn(r,e,t);case"glow":return rn(r,e,t);case"inner-glow":return nn(r,e,t);default:return w(e,t)}}function sn(r,e){let t=e.filter(c=>c.enabled);if(t.length===0)return"";let n=t.some(c=>c.type==="gaussian-blur"&&c.quality==="high"||c.type==="motion-blur"&&c.quality==="high"),s=n?"500%":"300%",a=n?"-200%":"-100%",o="",l="SourceGraphic",u=0;for(let c of t){let h=`result${u++}`;o+=dt(c,l,h),l=h}return`<filter${i("id",r)}${i("x",a)}${i("y",a)}${i("width",s)}${i("height",s)}${i("filterUnits","objectBoundingBox")}${i("primitiveUnits","userSpaceOnUse")}>${o}</filter>`}function L(r){let e="";for(let t of r){let n=t.state.filters;if(!n||n.length===0)continue;let s=n.filter(o=>o.enabled);if(s.length===0)continue;let a=`filter-${t.id}`;e+=sn(a,s)}return e}function we(r,e){return!e||e.length===0||e.filter(n=>n.enabled).length===0?"":` filter="url(#filter-${M(r)})"`}function J(r,e,t,n){let s=n?.strokeWidth!=null?Math.max(.5,e*n.strokeWidth):Math.max(1,e/10);switch(r){case"stripes":return[{tag:"rect",attrs:{width:n?.strokeWidth!=null?Math.max(.01,Math.min(1,n.strokeWidth))*e:e/2,height:e,fill:t}}];case"dots":{let a=n?.dotRadius!=null?Math.max(.05,Math.min(.45,n.dotRadius)):.25;return[{tag:"circle",attrs:{cx:e/2,cy:e/2,r:e*a,fill:t}}]}case"grid":return[{tag:"path",attrs:{d:`M ${e} 0 L 0 0 0 ${e}`,fill:"none",stroke:t,"stroke-width":s}}];case"checkerboard":return[{tag:"rect",attrs:{width:e/2,height:e/2,fill:t}},{tag:"rect",attrs:{x:e/2,y:e/2,width:e/2,height:e/2,fill:t}}];case"diagonal":{let a=n?.strokeWidth!=null?Math.max(.5,e*n.strokeWidth):Math.max(1,e/5);return[{tag:"path",attrs:{d:`M 0 ${e} L ${e} 0`,stroke:t,"stroke-width":a}}]}case"crosshatch":return[{tag:"path",attrs:{d:`M 0 ${e} L ${e} 0 M 0 0 L ${e} ${e}`,stroke:t,"stroke-width":s}}];case"zigzag":{let a=n?.amplitude!=null?Math.max(.05,Math.min(.5,n.amplitude)):.25,o=e*a;return[{tag:"path",attrs:{d:`M 0 ${o} L ${e/4} 0 L ${e/2} ${o} L ${e*3/4} 0 L ${e} ${o}`,fill:"none",stroke:t,"stroke-width":s}}]}case"waves":{let a=n?.amplitude!=null?Math.max(.05,Math.min(.5,n.amplitude)):.25,o=e*a,l=e/2;return[{tag:"path",attrs:{d:`M 0 ${l} Q ${e/4} ${l-o} ${e/2} ${l} T ${e} ${l}`,fill:"none",stroke:t,"stroke-width":s}}]}case"triangles":{let a=e*.866;return[{tag:"path",attrs:{d:`M ${e/2} 0 L ${e} ${a} L 0 ${a} Z`,fill:"none",stroke:t,"stroke-width":s}}]}case"hexagons":{let a=e*.866;return[{tag:"path",attrs:{d:`M ${e*.25} 0 L ${e*.75} 0 L ${e} ${a*.5} L ${e*.75} ${a} L ${e*.25} ${a} L 0 ${a*.5} Z`,fill:"none",stroke:t,"stroke-width":s}}]}case"diamonds":return[{tag:"path",attrs:{d:`M ${e/2} 0 L ${e} ${e/2} L ${e/2} ${e} L 0 ${e/2} Z`,fill:"none",stroke:t,"stroke-width":s}}];case"circles":return[{tag:"circle",attrs:{cx:e/2,cy:e/2,r:e/3,fill:"none",stroke:t,"stroke-width":s}}];case"bricks":{let a=n?.strokeWidth!=null?Math.max(.5,e*n.strokeWidth):Math.max(1,e/15);return[{tag:"rect",attrs:{x:0,y:0,width:e,height:e/2,fill:"none",stroke:t,"stroke-width":a}},{tag:"rect",attrs:{x:-e/2,y:e/2,width:e,height:e/2,fill:"none",stroke:t,"stroke-width":a}},{tag:"rect",attrs:{x:e/2,y:e/2,width:e,height:e/2,fill:"none",stroke:t,"stroke-width":a}}]}case"herringbone":return[{tag:"path",attrs:{d:`M 0 0 L ${e/2} ${e/2} L 0 ${e} M ${e/2} ${e/2} L ${e} 0 M ${e/2} ${e/2} L ${e} ${e}`,fill:"none",stroke:t,"stroke-width":s}}];default:return[]}}function an(r){let e=Object.entries(r.attrs).map(([t,n])=>` ${t}="${n}"`).join("");return`<${r.tag}${e}/>`}function Te(r,e,t,n,s){let a=10*e,o="";o+=`<rect width="${a}" height="${a}" fill="${n}"/>`;let l=J(r,a,t,s);for(let u of l)o+=an(u);return{svgContent:o,width:a,height:a}}var ve="0 0 10 10",Pe=6,Me=6;function Ce(){return[{id:"line-marker-arrow",refX:10,refY:5,element:{tag:"path",attrs:{d:"M 0 0 L 10 5 L 0 10 Z",fill:"context-stroke",stroke:"context-stroke"}}},{id:"line-marker-open-arrow",refX:10,refY:5,element:{tag:"path",attrs:{d:"M 0 0 L 10 5 L 0 10",fill:"none",stroke:"context-stroke","stroke-width":1.5,"stroke-linejoin":"round","stroke-linecap":"round"}}},{id:"line-marker-circle",refX:5,refY:5,element:{tag:"circle",attrs:{cx:5,cy:5,r:3.2,fill:"context-stroke",stroke:"context-stroke"}}},{id:"line-marker-diamond",refX:5,refY:5,element:{tag:"path",attrs:{d:"M 5 0 L 10 5 L 5 10 L 0 5 Z",fill:"context-stroke",stroke:"context-stroke"}}},{id:"line-marker-square",refX:5,refY:5,element:{tag:"rect",attrs:{x:1.5,y:1.5,width:7,height:7,fill:"context-stroke",stroke:"context-stroke"}}}]}function m(r,e){return e==null||e===""?"":` ${r}="${M(String(e))}"`}function z(r,e){let t=r.rotation??0,n=r.skewX??0,s=r.skewY??0,a=r.scaleX??1,o=r.scaleY??1;if(t===0&&n===0&&s===0&&a===1&&o===1)return null;let l=r.customPivot??e;if(!l)return null;let u=[];return u.push(`translate(${l.x}, ${l.y})`),t!==0&&u.push(`rotate(${t})`),(a!==1||o!==1)&&u.push(`scale(${a}, ${o})`),n!==0&&u.push(`skewX(${n})`),s!==0&&u.push(`skewY(${s})`),u.push(`translate(${-l.x}, ${-l.y})`),u.join(" ")}function on(r,e,t){let n=r.rotation??0,s=r.skewX??0,a=r.skewY??0,o=r.scaleX??1,l=r.scaleY??1,u=r.customPivot??{x:e,y:t},c=[];return(n!==0||s!==0||a!==0||o!==1||l!==1)&&(c.push(`translate(${u.x}, ${u.y})`),n!==0&&c.push(`rotate(${n})`),(o!==1||l!==1)&&c.push(`scale(${o}, ${l})`),s!==0&&c.push(`skewX(${s})`),a!==0&&c.push(`skewY(${a})`),c.push(`translate(${-u.x}, ${-u.y})`)),c.push(`translate(${e}, ${t})`),c.join(" ")}function ln(r){if(typeof r=="string"){let n=r.trim();return n.length>0?n:void 0}if(!r||typeof r!="object")return;let e=r,t=[];return e.underline&&t.push("underline"),e.strikethrough&&t.push("line-through"),e.overline&&t.push("overline"),t.length>0?t.join(" "):void 0}function un(r){if(typeof r.strokeDasharray=="string")return r.strokeDasharray;let e=r.lineStyle??"solid",t=r.dashLength??8,n=r.gapLength??4;return X(e,t,n)}function Lt(r){let e=r.fillType;return e||(r.fillGradient?r.fillGradient.r!==void 0?"radial-gradient":"linear-gradient":r.linearGradient?"linear-gradient":r.radialGradient?"radial-gradient":"solid")}function cn(r){return r.fillGradient??r.linearGradient??r.radialGradient??void 0}function V(r,e){let t=m("data-shape-id",e),n=Lt(r);n==="none"?t+=m("fill","none"):n==="linear-gradient"||n==="radial-gradient"?t+=m("fill",`url(#gradient-fill-${e})`):n==="pattern"?t+=m("fill",`url(#pattern-fill-${e})`):t+=m("fill",r.fillColor??"#000000");let s=r.opacity;s!==void 0&&s<1&&(t+=m("opacity",s));let a=r.fillOpacity;a!==void 0&&a<1&&(t+=m("fill-opacity",a));let o=r.fillRule;o&&o!=="nonzero"&&(t+=m("fill-rule",o));let l=r.strokeType??"solid";l==="none"?t+=m("stroke","none"):l==="linear-gradient"||l==="radial-gradient"?t+=m("stroke",`url(#gradient-stroke-${e})`):t+=m("stroke",r.borderColor??"none");let u=r.borderWidth;u!=null&&(t+=m("stroke-width",u));let c=r.strokeOpacity;c!==void 0&&c<1&&(t+=m("stroke-opacity",c));let h=un(r);h&&(t+=m("stroke-dasharray",h),!r.strokeDasharray&&r.lineStyle==="dotted"&&(t+=m("stroke-linecap","round")));let p=r.dashOffset;p!==void 0&&p!==0&&(t+=m("stroke-dashoffset",p));let d=r.shapeRendering;d&&d!=="auto"&&(t+=m("shape-rendering",d)),t+=we(e,r.filters);let f=r.metadata;return f&&(f.role&&(t+=m("role",f.role)),f.ariaLabel&&(t+=m("aria-label",f.ariaLabel))),t}function hn(r){let e=r.metadata;if(!e)return"";let t="";return e.title&&(t+=`<title>${M(e.title)}</title>`),e.description&&(t+=`<desc>${M(e.description)}</desc>`),t}function dn(r,e){let t=hn(e);if(!t)return r;let n=r.lastIndexOf("/>");if(n===-1){let o=r.indexOf(">");return o===-1?r:r.slice(0,o+1)+t+r.slice(o+1)}let s=r.match(/^<(\w+)/),a=s?s[1]:"g";return r.slice(0,n)+">"+t+`</${a}>`}function pt(r){let e="",t=r.startEndpoint,n=r.endEndpoint;return t&&t!=="none"&&(e+=m("marker-start",`url(#line-marker-${t})`)),n&&n!=="none"&&(e+=m("marker-end",`url(#line-marker-${n})`)),e}function mt(r){let e=r.state,t=e.x??0,n=e.y??0,s=e.radius??50,a=z(e,{x:t,y:n});return`<circle${m("cx",t)}${m("cy",n)}${m("r",s)}${V(e,r.id)}${a?m("transform",a):""}/>`}function ft(r){let e=r.state,t=e.cx??0,n=e.cy??0,s=e.rx??50,a=e.ry??30,o=z(e,{x:t,y:n});return`<ellipse${m("cx",t)}${m("cy",n)}${m("rx",s)}${m("ry",a)}${V(e,r.id)}${o?m("transform",o):""}/>`}function gt(r){let e=r.state,t=e,n=e.x??0,s=e.y??0,a=e.width??100,o=e.height??100,l=e.cornerRadius??0,u=t.cornerShape??"round",c=t.cornerMode??"uniform",h={x:n+a/2,y:s+o/2},p=z(e,h);if(u!=="round"||c==="non-uniform"){let d=xe(n,s,a,o,l,u,c,c==="non-uniform"?{radiusTL:t.cornerRadiusTL,radiusTR:t.cornerRadiusTR,radiusBR:t.cornerRadiusBR,radiusBL:t.cornerRadiusBL,shapeTL:t.cornerShapeTL,shapeTR:t.cornerShapeTR,shapeBR:t.cornerShapeBR,shapeBL:t.cornerShapeBL}:void 0);if(d)return`<path${m("d",d)}${V(e,r.id)}${p?m("transform",p):""}/>`}return`<rect${m("x",n)}${m("y",s)}${m("width",a)}${m("height",o)}${l>0?m("rx",l):""}${V(e,r.id)}${p?m("transform",p):""}/>`}function $t(r){let e=r.state,t=e.x1??0,n=e.y1??0,s=e.x2??100,a=e.y2??100,o={x:(t+s)/2,y:(n+a)/2},l=z(e,o);return`<line${m("x1",t)}${m("y1",n)}${m("x2",s)}${m("y2",a)}${V(e,r.id)}${pt(e)}${l?m("transform",l):""}/>`}function yt(r){let e=r.state,t=e.x??0,n=e.y??0,s=e.text??"",a=e.fontSize??16,o=e.fontFamily??"sans-serif",l=e.fontWeight??"normal",u=e.fontStyle??"normal",c=e.textAnchor??"start",h=ln(e.textDecoration),p=e.letterSpacing,f=z(e,{x:t,y:n}),g=m("x",t)+m("y",n);g+=m("font-size",a),g+=m("font-family",o),l!=="normal"&&(g+=m("font-weight",l)),u!=="normal"&&(g+=m("font-style",u)),c!=="start"&&(g+=m("text-anchor",c)),h&&(g+=m("text-decoration",h)),p&&(g+=m("letter-spacing",p));let y=e.textDirection;y&&y!=="ltr"&&(g+=m("direction",y));let b=e.unicodeBidi;b&&b!=="normal"&&(g+=m("unicode-bidi",b));let k=e.fontVariationSettings;if(k&&Object.keys(k).length>0){let x=Object.entries(k).map(([P,I])=>`'${P}' ${I}`).join(", ");g+=m("style",`font-variation-settings: ${x}`)}if(g+=V(e,r.id),f&&(g+=m("transform",f)),e.isTextPath&&e.textPathPoints){let x=e.textPathPoints,P=e.textPathStartOffset??0,I=e.textPathSide,O=`text-path-${r.id}`,T="";if(x.length>=2)if(I==="right"){let v=x[x.length-1];T=`M ${v.x} ${v.y}`;for(let R=x.length-1;R>0;R--){let A=x[R],D=x[R-1],q=A.handleIn??A,Mt=D.handleOut??D;T+=` C ${q.x} ${q.y}, ${Mt.x} ${Mt.y}, ${D.x} ${D.y}`}}else{T=`M ${x[0].x} ${x[0].y}`;for(let v=0;v<x.length-1;v++){let R=x[v],A=x[v+1],D=R.handleOut??R,q=A.handleIn??A;T+=` C ${D.x} ${D.y}, ${q.x} ${q.y}, ${A.x} ${A.y}`}}return`<defs><path id="${M(O)}"${m("d",T)} fill="none"/></defs><text${g}><textPath href="#${M(O)}"${m("startOffset",`${P}%`)}>${M(s)}</textPath></text>`}if(e.charOffsets&&Array.isArray(e.charOffsets)&&e.charOffsets.length>0){let x=Array.from(s),P=0,I=0,O="";for(let T=0;T<x.length;T++){let v=e.charOffsets[T]??{x:0,y:0,rotate:0},R=v.x-P,A=v.y-I,D=m("dx",R)+m("dy",A);v.rotate!==0&&(D+=m("rotate",v.rotate)),O+=`<tspan${D}>${M(x[T])}</tspan>`,P=v.x,I=v.y}return`<text${g}>${O}</text>`}return`<text${g}>${M(s)}</text>`}function bt(r){let e=r.state,t=e.splinePoints??[],n=e.splineCurveType??"CUBIC",s=e.splineClosed??!1,a=e.splineTension??.5,o=e.splineArcParams,l=_e(t,n,s,a,o),u=t.length>0?e.customPivot??{x:t[0].x,y:t[0].y}:void 0,c=u?z(e,u):null;return`<path${m("d",l)}${V(e,r.id)}${pt(e)}${c?m("transform",c):""}/>`}function xt(r){let e=r.state,t=e.polylinePoints??[],n=e.polylineClosed??!1,s=t.map(u=>`${u.x},${u.y}`).join(" "),a=t.length>0?e.customPivot??{x:t[0].x,y:t[0].y}:void 0,o=a?z(e,a):null;return`<${n?"polygon":"polyline"}${m("points",s)}${V(e,r.id)}${pt(e)}${o?m("transform",o):""}/>`}function _t(r){let e=r.state,t=e.x??0,n=e.y??0,s=e.width??100,a=e.height??100,o=e.href??"",l=e.imageOpacity,u=e.preserveAspectRatio?"xMidYMid meet":"none",c={x:t+s/2,y:n+a/2},h=z(e,c);return`<image${m("x",t)}${m("y",n)}${m("width",s)}${m("height",a)}${m("href",o)}${m("preserveAspectRatio",u)}${l!==void 0&&l<1?m("opacity",l):""}${V(e,r.id)}${h?m("transform",h):""}/>`}function St(r){let e=r.state,t=e.cx??0,n=e.cy??0,s=e.radius??50,a=e.cornerRadius??0,o=e.shiftAngle??-90,l=e.fillRule??"nonzero",u=on(e,t,n),c="";switch(r.type){case"triangle":c=U(K(3,s,o),a,s);break;case"ngon":{let p=e.sides??6;c=U(K(p,s,o),a,s);break}case"star":{let p=e.arms??5,d=e.innerRadiusPercent??50;c=U(me(p,s,d,o),a,s);break}case"cross":{let p=e.armWidthPercent??40;c=U(fe(s,p,o),a,s);break}case"ring":{let p=e.innerRadiusPercent??50;c=$e(s,p,l);break}case"spiral":{let p=e.turns??3,d=e.thicknessPercent??20,f=e.spiralDirection??1;c=ye(s,p,d,f,o);break}case"gear":{let p=e.teeth??8,d=e.toothDepthPercent??30,f=e.holeRadiusPercent??0;c=be(p,s,d,a,f,l,o);break}case"arrow":{let p=e.headWidthPercent??100,d=e.headLengthPercent??30,f=e.shaftWidthPercent??40;c=U(ge(s,p,d,f,o),a,s);break}default:return`<!-- unsupported polygon shape: ${M(r.type)} -->`}let h="";return(r.type==="ring"||r.type==="gear")&&(h=m("fill-rule",l)),`<path${m("d",c)}${h}${V(e,r.id)}${m("transform",u)}/>`}function F(r){let e;switch(r.type){case"circle":e=mt(r);break;case"ellipse":e=ft(r);break;case"rectangle":case"square":e=gt(r);break;case"line":e=$t(r);break;case"text":e=yt(r);break;case"spline":e=bt(r);break;case"polyline":e=xt(r);break;case"image":e=_t(r);break;case"triangle":case"ngon":case"star":case"cross":case"ring":case"spiral":case"gear":case"arrow":e=St(r);break;default:return`<!-- unsupported shape type: ${M(r.type)} -->`}return dn(e,r.state)}function j(r){let e="";for(let t of r){let n=t.state,s=Lt(n),a=cn(n),o=n.strokeType??"solid";s==="linear-gradient"&&a&&(e+=Dt(`gradient-fill-${t.id}`,a)),s==="radial-gradient"&&a&&(e+=Bt(`gradient-fill-${t.id}`,a)),s==="pattern"&&a&&(e+=pn(`pattern-fill-${t.id}`,a)),o==="linear-gradient"&&n.strokeGradient&&(e+=Dt(`gradient-stroke-${t.id}`,n.strokeGradient)),o==="radial-gradient"&&n.strokeGradient&&(e+=Bt(`gradient-stroke-${t.id}`,n.strokeGradient))}return e}function Dt(r,e){let t=(e.stops??[]).map(n=>{let s=`<stop${m("offset",`${n.offset*100}%`)}${m("stop-color",n.color)}`;return n.opacity!==void 0&&n.opacity<1&&(s+=m("stop-opacity",n.opacity)),s+="/>",s}).join("");return`<linearGradient${m("id",r)}${m("x1",`${e.x1*100}%`)}${m("y1",`${e.y1*100}%`)}${m("x2",`${e.x2*100}%`)}${m("y2",`${e.y2*100}%`)}${e.spreadMethod?m("spreadMethod",e.spreadMethod):""}>${t}</linearGradient>`}function Bt(r,e){let t=(e.stops??[]).map(o=>{let l=`<stop${m("offset",`${o.offset*100}%`)}${m("stop-color",o.color)}`;return o.opacity!==void 0&&o.opacity<1&&(l+=m("stop-opacity",o.opacity)),l+="/>",l}).join(""),n="",s=e.ry!==void 0&&e.ry!==e.r,a=!!e.rotation;if(s||a){let o=e.cx??.5,l=e.cy??.5,u=[];u.push(`translate(${o}, ${l})`),a&&u.push(`rotate(${e.rotation})`),s&&e.ry!==0&&u.push(`scale(1, ${e.ry/e.r})`),u.push(`translate(-${o}, -${l})`),n=m("gradientTransform",u.join(" "))}return`<radialGradient${m("id",r)}${m("cx",`${e.cx*100}%`)}${m("cy",`${e.cy*100}%`)}${m("fx",`${e.fx*100}%`)}${m("fy",`${e.fy*100}%`)}${m("r",`${e.r*100}%`)}${e.spreadMethod?m("spreadMethod",e.spreadMethod):""}${n}>${t}</radialGradient>`}function pn(r,e){if(e.svgContent!=null){let l=e.width??10,u=e.height??10,c=e.patternUnits??"userSpaceOnUse",h=e.patternContentUnits,p=e.patternTransform,d=e.viewBox,f=e.preserveAspectRatio,g=e.x??0,y=e.y??0,b=`<pattern${m("id",r)}`;return b+=m("patternUnits",c),h&&(b+=m("patternContentUnits",h)),g&&(b+=m("x",g)),y&&(b+=m("y",y)),b+=m("width",l),b+=m("height",u),d&&(b+=m("viewBox",d)),f&&(b+=m("preserveAspectRatio",f)),p&&(b+=m("patternTransform",p)),b+=`>${e.svgContent}</pattern>`,b}let t=10*(e.scale??1),n=e.rotation??0,s=e.color||"#000000",a=e.backgroundColor||"#ffffff",o="";return o+=`<rect${m("width",t)}${m("height",t)}${m("fill",a)}/>`,o+=mn(e.patternType,t,s),`<pattern${m("id",r)}${m("patternUnits","userSpaceOnUse")}${m("width",t)}${m("height",t)}${n?m("patternTransform",`rotate(${n})`):""}>${o}</pattern>`}function mn(r,e,t){return J(r,e,t).map(s=>{let a=Object.entries(s.attrs).map(([o,l])=>m(o,l)).join("");return`<${s.tag}${a}/>`}).join("")}function W(r){let e=new Set;for(let s of r){let a=s.state,o=a.startEndpoint,l=a.endEndpoint;o&&o!=="none"&&e.add(o),l&&l!=="none"&&e.add(l)}if(e.size===0)return"";let t=Ce(),n="";for(let s of t){let a=s.id.replace("line-marker-","");if(!e.has(a))continue;let o=s.element,l=Object.entries(o.attrs).map(([c,h])=>m(c,h)).join(""),u=o.tag==="circle"||o.tag==="rect"?`<${o.tag}${l}/>`:`<${o.tag}${l}/>`;n+=`<marker${m("id",s.id)}${m("viewBox",ve)}${m("refX",s.refX)}${m("refY",s.refY)}${m("markerWidth",6)}${m("markerHeight",6)}${m("orient","auto-start-reverse")}>${u}</marker>`}return n}var fn={x:"x",y:"y",cx:"cx",cy:"cy",x1:"x1",y1:"y1",x2:"x2",y2:"y2",posX:"x",posY:"y",radius:"r",r:"r",rx:"rx",ry:"ry",width:"width",height:"height",opacity:"opacity",fillOpacity:"fill-opacity",strokeOpacity:"stroke-opacity",fillColor:"fill",strokeColor:"stroke",strokeWidth:"stroke-width",borderWidth:"stroke-width",cornerRadius:"rx",fontSize:"font-size"},gn=new Set(["rotation","skewX","skewY"]);function $n(r){let t=ne[r];return t?t.join(" "):"0 0 1 1"}function Re(r){return r.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function kt(r){return r.cycleDuration!==void 0&&r.cycleDuration>0?r.cycleDuration:r.keyframes.length===0?0:r.keyframes[r.keyframes.length-1].time}function wt(r,e){let t=r.keyframes;if(t.length===0)return{values:[],keyTimes:[],keySplines:[]};let n=t.map(o=>String(o.value)),s=t.map(o=>e>0?(o.time/e).toFixed(4):"0"),a=[];for(let o=1;o<t.length;o++)a.push($n(t[o].easing));return{values:n,keyTimes:s,keySplines:a}}function Tt(r){let e=r.beginTrigger;if(!e)return"0s";switch(e.type){case"time":return`${e.value}s`;case"event":return e.value;default:return"0s"}}function vt(r){return r.cycleInfinite?"indefinite":r.cycleRepeats&&r.cycleRepeats>1?String(r.cycleRepeats):null}function yn(r){let e=fn[r.property];if(!e)return"";let t=kt(r);if(t<=0)return"";let{values:n,keyTimes:s,keySplines:a}=wt(r,t);if(n.length<2)return"";let o=`<animate attributeName="${Re(e)}"`;o+=` values="${Re(n.join(";"))}"`,o+=` keyTimes="${s.join(";")}"`,a.length>0&&a.some(u=>u!=="0 0 1 1")&&(o+=' calcMode="spline"',o+=` keySplines="${a.join(";")}"`),o+=` dur="${t}s"`,o+=` begin="${Tt(r)}"`;let l=vt(r);return l&&(o+=` repeatCount="${l}"`),o+=' fill="freeze"',o+="/>",o}function bn(r){let e;switch(r.property){case"rotation":e="rotate";break;case"skewX":e="skewX";break;case"skewY":e="skewY";break;default:return""}let t=kt(r);if(t<=0)return"";let{values:n,keyTimes:s,keySplines:a}=wt(r,t);if(n.length<2)return"";let o=e==="rotate"&&r.transformOrigin?n.map(c=>`${c} ${r.transformOrigin.x} ${r.transformOrigin.y}`):n,l='<animateTransform attributeName="transform"';l+=` type="${e}"`,l+=` values="${Re(o.join(";"))}"`,l+=` keyTimes="${s.join(";")}"`,a.length>0&&a.some(c=>c!=="0 0 1 1")&&(l+=' calcMode="spline"',l+=` keySplines="${a.join(";")}"`),l+=` dur="${t}s"`,l+=` begin="${Tt(r)}"`;let u=vt(r);return u&&(l+=` repeatCount="${u}"`),l+=` additive="${r.additive??"sum"}"`,l+=' fill="freeze"',l+="/>",l}function xn(r){if(!r.motionPath)return"";let e=kt(r);if(e<=0)return"";let{keyTimes:t,keySplines:n}=wt(r,e),s=r.keyframes.map(u=>{let c=typeof u.value=="number"?u.value:parseFloat(u.value);return Math.max(0,Math.min(1,c))}),a="<animateMotion";a+=` path="${Re(r.motionPath)}"`,a+=` keyTimes="${t.join(";")}"`,a+=` keyPoints="${s.join(";")}"`,n.length>0&&n.some(u=>u!=="0 0 1 1")&&(a+=' calcMode="spline"',a+=` keySplines="${n.join(";")}"`),a+=` dur="${e}s"`,a+=` begin="${Tt(r)}"`;let o=vt(r);o&&(a+=` repeatCount="${o}"`),a+=' fill="freeze"';let l=r.motionRotate??"auto";return a+=` rotate="${l}"`,a+="/>",a}function Ae(r){let e=new Map;for(let t of r.tracks){if(!t.enabled||t.keyframes.length<2)continue;let n=[...t.keyframes].sort((o,l)=>o.time-l.time),s={...t,locked:t.locked??!1,keyframes:n.map(o=>({time:o.time,value:o.value,easing:o.easing}))},a="";if(t.property==="pathMotion"&&t.motionPath?a=xn(s):gn.has(t.property)?a=bn(s):a=yn(s),a){let o=e.get(t.shapeId)??[];o.push(a),e.set(t.shapeId,o)}}return e}function Y(r,e={}){let{xmlDeclaration:t=!0,backgroundColor:n,indent:s=!0,className:a}=e,o=r.viewboxes?.[0],l=e.width??o?.width??800,u=e.height??o?.height??600,c=e.viewBox??`0 0 ${l} ${u}`,h=s?`
7
- `:"",p=s?" ":"",d=r.shapes??[],f=r.symbols??[],g=j(d),y=W(d),b=L(d),k=Tn(f,d),_=g.length>0||y.length>0||b.length>0||k.length>0,x="";_&&(x=`${h}${p}<defs>${h}`,g.length>0&&(x+=`${p}${p}${g}${h}`),y.length>0&&(x+=`${p}${p}${y}${h}`),b.length>0&&(x+=`${p}${p}${b}${h}`),k.length>0&&(x+=`${p}${p}${k}${h}`),x+=`${p}</defs>`);let P="";n&&(P=`${h}${p}<rect width="${l}" height="${u}" fill="${n}"/>`);let I=r.animationTimeline?Ae(r.animationTimeline):null,O=d.map(v=>{let R=v.type==="symbol-instance"?wn(v,f):F(v),A=I?.get(v.id);return A&&A.length>0&&(R=vn(R,A,p)),`${p}${R}`}).join(h),T="";return t&&(T+=`<?xml version="1.0" encoding="UTF-8"?>${h}`),T+='<svg xmlns="http://www.w3.org/2000/svg"',T+=` width="${l}" height="${u}"`,T+=` viewBox="${c}"`,a&&(T+=` class="${a}"`),T+=">",T+=x,T+=P,d.length>0&&(T+=`${h}${O}`),T+=`${h}</svg>${h}`,T}var Pt=r=>r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),_n=r=>r.replace(/[^a-zA-Z0-9_-]/g,"_");function Vt(r){let e=r.state.symbolId??"",t=r.state.variantKey??"";return r.state.symbolOverrides&&Object.keys(r.state.symbolOverrides).length>0?`${e}--ovr-${r.id}`:t?`${e}--${_n(t)}`:e}function Sn(r,e){return r.map(t=>{let n=e[t.id];return!n||Object.keys(n).length===0?t:{...t,state:{...t.state,...n}}})}function kn(r,e){return e?r.variants?.[e]??r.shapes:r.shapes}function wn(r,e){let t=Vt(r),n=r.state.x??0,s=r.state.y??0,a=r.state.width??100,o=r.state.height??100;return`<use href="#${Pt(t)}" x="${n}" y="${s}" width="${a}" height="${o}"/>`}function Tn(r,e){if(r.length===0)return"";let t=new Map;for(let a of r)t.set(a.id,a);let n=new Map;for(let a of e){if(a.type!=="symbol-instance")continue;let o=a.state.symbolId??"",l=t.get(o);if(!l)continue;let u=Vt(a);if(n.has(u))continue;let c=kn(l,a.state.variantKey??""),h=a.state.symbolOverrides;h&&Object.keys(h).length>0&&(c=Sn(c,h)),n.set(u,{def:l,resolved:c})}if(n.size===0)return"";let s=[];for(let[a,{def:o,resolved:l}]of n){let u=l.map(c=>F(c)).join("");s.push(`<symbol id="${Pt(a)}" viewBox="${Pt(o.viewBox)}">${u}</symbol>`)}return s.join("")}function vn(r,e,t){let n=e.join(""),s=r.lastIndexOf("/>");if(s!==-1){let o=r.match(/^<(\w+)/),l=o?o[1]:"g";return r.slice(0,s)+">"+n+`</${l}>`}let a=r.match(/<\/(\w+)>$/);if(a){let o=r.lastIndexOf(`</${a[1]}>`);return r.slice(0,o)+n+r.slice(o)}return r+n}function Ee(r,e){let t=B(r,e);return Y(r,{width:t.width,height:t.height,xmlDeclaration:e.xmlDeclaration??!1,indent:!0})}function Pn(r){return r==="class"?"className":r==="for"?"htmlFor":r.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function Fe(r){return r.replace(/\s([a-z][a-z-]*?)=/g,(e,t)=>t.startsWith("data-")||t.startsWith("aria-")?e:` ${Pn(t)}=`)}function Ie(r,e){let t=e.componentName??"SvgComponent",n=B(r,e),s=e.indent??" ",a=r.shapes??[],o=e.typescript??!1,l=j(a),u=W(a),c=L(a),h=l.length>0||u.length>0||c.length>0,p=a.map(f=>{let g=F(f);return`${s}${s}${s}${Fe(g)}`}),d=[];d.push("import React from 'react';"),d.push(""),o?(d.push(`interface ${t}Props {`),d.push(`${s}className?: string;`),d.push(`${s}style?: React.CSSProperties;`),d.push("}"),d.push(""),d.push(`const ${t}: React.FC<${t}Props> = ({ className, style }) => {`)):d.push(`const ${t} = ({ className, style }) => {`),d.push(`${s}return (`),d.push(`${s}${s}<svg xmlns="http://www.w3.org/2000/svg" width="${n.width}" height="${n.height}" viewBox="0 0 ${n.width} ${n.height}" className={className} style={style}>`),h&&(d.push(`${s}${s}${s}<defs>`),l.length>0&&d.push(`${s}${s}${s}${s}${Fe(l)}`),u.length>0&&d.push(`${s}${s}${s}${s}${Fe(u)}`),c.length>0&&d.push(`${s}${s}${s}${s}${Fe(c)}`),d.push(`${s}${s}${s}</defs>`));for(let f of p)d.push(f);return d.push(`${s}${s}</svg>`),d.push(`${s});`),d.push("};"),d.push(""),d.push(`export default ${t};`),d.push(""),d.join(`
8
- `)}function Oe(r,e){let t=e.componentName??"SvgComponent",n=B(r,e),s=e.indent??" ",a=r.shapes??[],o=e.typescript??!1,l=j(a),u=W(a),c=L(a),h=l.length>0||u.length>0||c.length>0,p=a.map(f=>`${s}${s}${F(f)}`),d=[];d.push("<template>"),d.push(`${s}<svg xmlns="http://www.w3.org/2000/svg" width="${n.width}" height="${n.height}" viewBox="0 0 ${n.width} ${n.height}" :class="className" :style="style">`),h&&(d.push(`${s}${s}<defs>`),l.length>0&&d.push(`${s}${s}${s}${l}`),u.length>0&&d.push(`${s}${s}${s}${u}`),c.length>0&&d.push(`${s}${s}${s}${c}`),d.push(`${s}${s}</defs>`));for(let f of p)d.push(f);return d.push(`${s}</svg>`),d.push("</template>"),d.push(""),o?d.push('<script setup lang="ts">'):d.push("<script setup>"),d.push(`// ${t}`),o?(d.push("defineProps<{"),d.push(`${s}className?: string;`),d.push(`${s}style?: Record<string, string>;`),d.push("}>();")):(d.push("defineProps({"),d.push(`${s}className: { type: String, default: '' },`),d.push(`${s}style: { type: Object, default: () => ({}) },`),d.push("});")),d.push("</script>"),d.push(""),d.join(`
9
- `)}var Mn=new Set(["circle","ellipse","rectangle","square","line","text","image"]);function Nt(r){return r.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}function Ut(r){return r.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}function Cn(r){if(!Mn.has(r.type))return!0;let e=r.state.metadata;return!!(e?.title||e?.description||r.type==="text"&&r.state.isTextPath)}function Ge(r,e){let t=e.componentName??"createSvg",n=B(r,e),s=e.indent??" ",a=r.shapes??[],o=e.typescript??!1,l=[];l.push("import * as d3 from 'd3';"),l.push(""),o?l.push(`export function ${t}(container: string | HTMLElement): d3.Selection<SVGSVGElement, unknown, HTMLElement, unknown> {`):l.push(`export function ${t}(container) {`),l.push(`${s}const svg = d3.select(container)`),l.push(`${s}${s}.append('svg')`),l.push(`${s}${s}.attr('xmlns', 'http://www.w3.org/2000/svg')`),l.push(`${s}${s}.attr('width', ${n.width})`),l.push(`${s}${s}.attr('height', ${n.height})`),l.push(`${s}${s}.attr('viewBox', '0 0 ${n.width} ${n.height}');`),l.push("");let u=j(a),c=W(a),h=L(a),p=`${u}${c}${h}`;p.length>0&&(l.push(`${s}svg.append('defs').html(\`${Ut(p)}\`);`),l.push(""));for(let d=0;d<a.length;d++){let f=a[d];if(l.push(`${s}// ${f.type}${f.state.metadata?.name?` \u2014 ${f.state.metadata.name}`:""}`),Cn(f)){l.push(`${s}svg.append('g').html(\`${Ut(F(f))}\`);`),l.push("");continue}let g=It(f),y=Se(f),b=`shape${d+1}`;l.push(`${s}const ${b} = svg.append('${g}')`);for(let[k,_]of y)l.push(`${s}${s}.attr('${k}', '${Nt(_)}')`);f.type==="text"&&f.state.text&&l.push(`${s}${s}.text('${Nt(f.state.text)}')`),l[l.length-1]=l[l.length-1]+";",l.push("")}return l.push(`${s}return svg;`),l.push("}"),l.push(""),l.join(`
10
- `)}function zt(r,e){let t=r.state.metadata?.name;return t?t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""):`${r.type}-${e+1}`}var Rn=new Set(["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-dasharray","stroke-linecap","opacity","transform","filter"]);function De(r,e){let t=B(r,e),n=e.indent??" ",s=r.shapes??[],a=[];for(let u=0;u<s.length;u++){let c=s[u],h=zt(c,u),p=Se(c),d=[];for(let[f,g]of p)Rn.has(f)&&d.push(`${n}${f}: ${g};`);d.length>0&&a.push(`.${h} {
11
- ${d.join(`
6
+ ${l}`)}}return a}function Pn(n){return[...n].sort((e,t)=>e.id.localeCompare(t.id))}function te(n){if(n==null)return n;if(Array.isArray(n))return n.map(te);if(typeof n!="object")return n;let e={},t=Object.keys(n).sort();for(let r of t)e[r]=te(n[r]);return e}function Mn(n){let e={};return e.id=n.id,e.type=n.type,e.state=te(n.state),e}var N=/\{\{\s*([\w.\-]+)\s*\}\}/g;function ge(n,e){return n.replace(N,(t,r)=>{let s=e[r];return s!==void 0?String(s):t})}function be(n,e={}){let t={};if(n.templateVariables)for(let s of n.templateVariables)s.defaultValue!==void 0&&s.defaultValue!==""&&(t[s.name]=s.defaultValue);if(Object.assign(t,e),Object.keys(t).length===0)return JSON.parse(JSON.stringify(n));let r=JSON.parse(JSON.stringify(n));for(let s of r.shapes)$e(s.state,t);if(r.documentMetadata){let s=r.documentMetadata;$e(s,t)}return r}function $e(n,e){for(let t of Object.keys(n)){let r=n[t];if(typeof r=="string"){if(N.lastIndex=0,N.test(r)){N.lastIndex=0;let s=ge(r,e);if(Cn(r)){let a=Number(s);if(!isNaN(a)&&An(t)){n[t]=a;continue}}n[t]=s}}else if(Array.isArray(r))for(let s=0;s<r.length;s++)typeof r[s]=="string"?(N.lastIndex=0,N.test(r[s])&&(N.lastIndex=0,r[s]=ge(r[s],e))):r[s]!==null&&typeof r[s]=="object"&&$e(r[s],e);else r!==null&&typeof r=="object"&&$e(r,e)}}function Cn(n){return/^\s*\{\{\s*[\w.\-]+\s*\}\}\s*$/.test(n)}var Rn=new Set(["x","y","width","height","radius","rx","ry","cx","cy","x1","y1","x2","y2","fontSize","borderWidth","cornerRadius","opacity","fillOpacity","strokeOpacity","rotation","skewX","skewY","scaleX","scaleY","letterSpacing","wordSpacing","lineHeight","sides","arms","innerRadiusPercent","armWidthPercent","teeth","toothDepthPercent","holeRadiusPercent","turns","thicknessPercent","direction","headWidthPercent","headLengthPercent","shaftWidthPercent","shiftAngle","dashLength","gapLength","textPathStartOffset","imageOpacity"]);function An(n){return Rn.has(n)}function xe(n){let e=n.templateVariables??[],t=new Set(e.map(a=>a.name)),r=new Set;for(let a of n.shapes)ye(a.state,r);n.documentMetadata&&ye(n.documentMetadata,r);let s=[...r].filter(a=>!t.has(a)).sort();return{defined:[...e],undeclared:s}}function ye(n,e){for(let t of Object.values(n))if(typeof t=="string"){let r;for(N.lastIndex=0;(r=N.exec(t))!==null;)e.add(r[1])}else if(Array.isArray(t))for(let r of t)if(typeof r=="string"){let s;for(N.lastIndex=0;(s=N.exec(r))!==null;)e.add(s[1])}else r!==null&&typeof r=="object"&&ye(r,e);else t!==null&&typeof t=="object"&&ye(t,e)}function Wt(n){let e={};for(let t of n){let r=t.indexOf("=");if(r===-1)throw new Error(`Invalid variable format: "${t}". Expected "name=value".`);let s=t.slice(0,r).trim(),a=t.slice(r+1);if(!s)throw new Error(`Invalid variable format: "${t}". Variable name cannot be empty.`);e[s]=a}return e}function ae(n,e,t=-90){let r=[],s=t*Math.PI/180;for(let a=0;a<n;a++){let o=s+a*2*Math.PI/n;r.push({x:e*Math.cos(o),y:e*Math.sin(o)})}return r}function _e(n,e,t,r=-90){let s=[],a=e*(t/100),o=r*Math.PI/180;for(let l=0;l<n*2;l++){let u=o+l*Math.PI/n,c=l%2===0?e:a;s.push({x:c*Math.cos(u),y:c*Math.sin(u)})}return s}function ke(n,e,t=0){let r=n*(e/100)/2,s=[{x:-r,y:-n},{x:r,y:-n},{x:r,y:-r},{x:n,y:-r},{x:n,y:r},{x:r,y:r},{x:r,y:n},{x:-r,y:n},{x:-r,y:r},{x:-n,y:r},{x:-n,y:-r},{x:-r,y:-r}];if(t===0)return s;let a=Math.cos(t*Math.PI/180),o=Math.sin(t*Math.PI/180);return s.map(l=>({x:l.x*a-l.y*o,y:l.x*o+l.y*a}))}function we(n,e,t,r,s=-90){let o=n*2*(t/100),l=n*(e/100),u=l*(r/100),c=[{x:n,y:0},{x:n-o,y:-l/2},{x:n-o,y:-u/2},{x:-n,y:-u/2},{x:-n,y:u/2},{x:n-o,y:u/2},{x:n-o,y:l/2}];if(s===0)return c;let p=Math.cos(s*Math.PI/180),d=Math.sin(s*Math.PI/180);return c.map(h=>({x:h.x*p-h.y*d,y:h.x*d+h.y*p}))}function Te(n,e,t,r,s=0){let a=n,o=a*(t/100),l=a*(r/100),u=l/2,c=e*Math.PI/180,p=Math.cos(c),d=Math.sin(c),h=Math.abs(p),f=Math.abs(d),y=Math.max(h,f)||1,g={x:p*(a/y),y:d*(a/y)},b={x:g.x+p*o,y:g.y+d*o},w=Math.min(l,a-u),k=-a+u+w,x=a-u-w,M={x:-a,y:-a},R={x:a,y:-a},E={x:a,y:a},$={x:-a,y:a},S;if(h>=f&&p>0){let P=Math.max(k,Math.min(x,g.y)),F={x:a,y:P-u},I={x:a,y:P+u};S=[M,R,F,b,I,E,$]}else if(h>=f&&p<=0){let P=Math.max(k,Math.min(x,g.y)),F={x:-a,y:P+u},I={x:-a,y:P-u};S=[M,R,E,$,F,b,I]}else if(d<0){let P=Math.max(k,Math.min(x,g.x)),F={x:P-u,y:-a},I={x:P+u,y:-a};S=[M,F,b,I,R,E,$]}else{let P=Math.max(k,Math.min(x,g.x)),F={x:P+u,y:a},I={x:P-u,y:a};S=[M,R,E,F,b,I,$]}if(s===0)return S;let v=Math.cos(s*Math.PI/180),A=Math.sin(s*Math.PI/180);return S.map(P=>({x:P.x*v-P.y*A,y:P.x*A+P.y*v}))}function ve(n,e,t,r,s=0){let a=Math.max(2,Math.round(e)),o=n*(t/100),l=n*(r/100)/2,u=a+1,c=[];for(let g=0;g<u;g++){let b=g/(u-1),w=-n+b*2*n,k=0;g>0&&g<u-1&&(k=g%2===1?o:-o),c.push({x:k,y:w})}let p=[],d=[];for(let g=0;g<u;g++){if(g===0||g===u-1){p.push({...c[g]}),d.push({...c[g]});continue}let b=c[g-1],w=c[g],k=c[g+1],x=w.x-b.x,M=w.y-b.y,R=Math.hypot(x,M)||1,E=x/R,$=M/R,S=k.x-w.x,v=k.y-w.y,A=Math.hypot(S,v)||1,P=S/A,F=v/A,I=(E+P)/2,O=($+F)/2,V=Math.hypot(I,O),T,z;V<1e-6?(T=-$,z=E):(T=-O/V,z=I/V),p.push({x:w.x-T*l,y:w.y-z*l}),d.push({x:w.x+T*l,y:w.y+z*l})}let h=[];h.push(p[0]);for(let g=1;g<u-1;g++)h.push(d[g]);h.push(p[u-1]);for(let g=u-2;g>=1;g--)h.push(p[g]);if(s===0)return h;let f=Math.cos(s*Math.PI/180),y=Math.sin(s*Math.PI/180);return h.map(g=>({x:g.x*f-g.y*y,y:g.x*y+g.y*f}))}function Pe(n,e,t,r=0){let s=n,a=Math.max(.3,Math.min(.9,e/100)),o=-s*(t/100),l={x:0,y:s},u={x:0,y:o},c={x:-s*a,y:s*.4},p={x:-s*a,y:-s},d={x:s*a,y:-s},h={x:s*a,y:s*.4},f=[l,c,p,u,d,h,l],y=r===0?f:(()=>{let R=Math.cos(r*Math.PI/180),E=Math.sin(r*Math.PI/180);return f.map($=>({x:$.x*R-$.y*E,y:$.x*E+$.y*R}))})(),[g,b,w,k,x,M]=y;return`M ${g.x} ${g.y} C ${b.x} ${b.y} ${w.x} ${w.y} ${k.x} ${k.y} C ${x.x} ${x.y} ${M.x} ${M.y} ${g.x} ${g.y} Z`}function Me(n,e,t,r=0){let s=Math.max(3,Math.round(e)),a=Math.max(.3,Math.min(1,t/100)),o=n,l=o*1.7,u=o*1.15,c=[];for(let $=0;$<s;$++){let v=(90+$/s*360)*Math.PI/180;c.push({x:l/2*Math.cos(v),y:-(u/2)*Math.sin(v)})}let p=.15,d=0;for(let $=0;$<s;$++){let S=c[$],v=c[($+1)%s];d=Math.max(d,Math.hypot(v.x-S.x,v.y-S.y))}let h=d/(2*(1-p))+.001,f=Math.max(h,d*(.68+a*.35)),y=c.map($=>{let S=$.y/(u/2);return f*(1-p*S)});function g($){let S=c[$],v=c[($+1)%s],A=y[$],P=y[($+1)%s],F=v.x-S.x,I=v.y-S.y,O=Math.hypot(F,I)||1,V=(A*A-P*P+O*O)/(2*O),T=Math.sqrt(Math.max(0,A*A-V*V)),z=S.x+V/O*F,K=S.y+V/O*I,J=-I/O,$t=F/O,ee={x:z+J*T,y:K+$t*T},Y={x:z-J*T,y:K-$t*T};return ee.x*ee.x+ee.y*ee.y>Y.x*Y.x+Y.y*Y.y?ee:Y}let b=[];for(let $=0;$<s;$++)b.push(g($));let w=14,k=[];for(let $=0;$<s;$++){let S=c[$],v=y[$],A=b[($-1+s)%s],P=b[$],F=Math.atan2(A.y-S.y,A.x-S.x),O=Math.atan2(P.y-S.y,P.x-S.x)-F;O<=0&&(O+=2*Math.PI);let V=2*Math.PI-O,T=F+O/2,z=F-V/2,K={x:S.x+v*Math.cos(T),y:S.y+v*Math.sin(T)},J={x:S.x+v*Math.cos(z),y:S.y+v*Math.sin(z)},ee=K.x*K.x+K.y*K.y>J.x*J.x+J.y*J.y?O:-V;for(let Y=0;Y<w;Y++){let on=Y/w,Nt=F+on*ee;k.push({x:S.x+v*Math.cos(Nt),y:S.y+v*Math.sin(Nt)})}}let x=0;for(let $ of k){let S=Math.max(Math.abs($.x),Math.abs($.y));S>x&&(x=S)}if(x>0&&x!==o){let $=o/x;for(let S of k)S.x*=$,S.y*=$}let M=$=>{if(r===0)return $;let S=Math.cos(r*Math.PI/180),v=Math.sin(r*Math.PI/180);return{x:$.x*S-$.y*v,y:$.x*v+$.y*S}},R=k.map(M),E=`M ${R[0].x} ${R[0].y}`;for(let $=1;$<R.length;$++)E+=` L ${R[$].x} ${R[$].y}`;return E+=" Z",E}function U(n,e=0,t=0){if(n.length<3)return"";if(e<=0)return n.map((a,o)=>(o===0?"M":"L")+`${a.x},${a.y}`).join(" ")+" Z";let r=Math.min(e,t*.4),s="";for(let a=0;a<n.length;a++){let o=n[(a-1+n.length)%n.length],l=n[a],u=n[(a+1)%n.length],c={x:o.x-l.x,y:o.y-l.y},p=Math.hypot(c.x,c.y);c.x/=p,c.y/=p;let d={x:u.x-l.x,y:u.y-l.y},h=Math.hypot(d.x,d.y);d.x/=h,d.y/=h;let f=Math.min(r,p/2),y=Math.min(r,h/2),g={x:l.x+c.x*f,y:l.y+c.y*f},b={x:l.x+d.x*y,y:l.y+d.y*y};s+=a===0?`M${g.x},${g.y}`:` L${g.x},${g.y}`,s+=` Q${l.x},${l.y} ${b.x},${b.y}`}return s+" Z"}function Ce(n,e,t="evenodd"){let r=n*(e/100),s=t==="nonzero"?1:0;return`M ${n} 0 A ${n} ${n} 0 1 1 ${-n} 0 A ${n} ${n} 0 1 1 ${n} 0 Z M ${r} 0 A ${r} ${r} 0 1 ${s} ${-r} 0 A ${r} ${r} 0 1 ${s} ${r} 0 Z`}function Re(n,e,t,r=1,s=0){let a=n*(t/100),l=Math.round(e*36),u=e*2*Math.PI,c=(n-a/2)/u,p=s*Math.PI/180,d=[],h=[];for(let g=0;g<=l;g++){let b=g/l,w=b*u*r+p,k=c*(b*u)+a/2,x=a/2;d.push({x:(k+x*.3)*Math.cos(w),y:(k+x*.3)*Math.sin(w)}),h.push({x:Math.max(0,k-x*.3)*Math.cos(w),y:Math.max(0,k-x*.3)*Math.sin(w)})}let f=`M ${d[0].x} ${d[0].y}`;for(let g=1;g<d.length;g++)f+=` L ${d[g].x} ${d[g].y}`;let y=h[h.length-1];f+=` L ${y.x} ${y.y}`;for(let g=h.length-2;g>=0;g--)f+=` L ${h[g].x} ${h[g].y}`;return f+=" Z",f}var En=.2;function wt(n,e,t,r=0){let s=e*(t/100),a=e,o=e-s,l=2*Math.PI/n,u=l*En/2,c=l/4,p=r*Math.PI/180,d=[];for(let h=0;h<n;h++){let f=p+h*l;d.push({x:o*Math.cos(f),y:o*Math.sin(f)}),d.push({x:a*Math.cos(f+c-u),y:a*Math.sin(f+c-u)}),d.push({x:a*Math.cos(f+c+u),y:a*Math.sin(f+c+u)}),d.push({x:o*Math.cos(f+l/2),y:o*Math.sin(f+l/2)})}return d}function Ae(n,e,t,r=0,s=0,a="evenodd",o=0){let l=wt(n,e,t,o),u=Math.min(r,e*.1),c=U(l,u,e);if(s>0){let p=e*(s/100),d=a==="nonzero"?1:0;c+=` M ${p} 0 A ${p} ${p} 0 1 ${d} ${-p} 0 A ${p} ${p} 0 1 ${d} ${p} 0 Z`}return c}function Ee(n,e,t,r,s,a="round",o="uniform",l){let u=Math.min(t,r)/2,c,p,d,h,f,y,g,b;if(o==="non-uniform"&&l?(c=Math.min(l.radiusTL??s,u),p=Math.min(l.radiusTR??s,u),d=Math.min(l.radiusBR??s,u),h=Math.min(l.radiusBL??s,u),f=l.shapeTL??a,y=l.shapeTR??a,g=l.shapeBR??a,b=l.shapeBL??a):(c=p=d=h=Math.min(s,u),f=y=g=b=a),!(a!=="round"||o==="non-uniform"||c>0&&f!=="round"||p>0&&y!=="round"||d>0&&g!=="round"||h>0&&b!=="round")&&c===p&&p===d&&d===h)return null;let k=`M${n+c},${e}`;return k+=` L${n+t-p},${e}`,k+=Se(y,p,n+t,e,"tr"),k+=` L${n+t},${e+r-d}`,k+=Se(g,d,n+t,e+r,"br"),k+=` L${n+h},${e+r}`,k+=Se(b,h,n,e+r,"bl"),k+=` L${n},${e+c}`,k+=Se(f,c,n,e,"tl"),k+=" Z",k}function Se(n,e,t,r,s){if(e<=0)return"";switch(n){case"round":switch(s){case"tr":return` A${e},${e} 0 0 1 ${t},${r+e}`;case"br":return` A${e},${e} 0 0 1 ${t-e},${r}`;case"bl":return` A${e},${e} 0 0 1 ${t},${r-e}`;case"tl":return` A${e},${e} 0 0 1 ${t+e},${r}`}break;case"scoop":switch(s){case"tr":return` A${e},${e} 0 0 0 ${t},${r+e}`;case"br":return` A${e},${e} 0 0 0 ${t-e},${r}`;case"bl":return` A${e},${e} 0 0 0 ${t},${r-e}`;case"tl":return` A${e},${e} 0 0 0 ${t+e},${r}`}break;case"bevel":switch(s){case"tr":return` L${t},${r+e}`;case"br":return` L${t-e},${r}`;case"bl":return` L${t},${r-e}`;case"tl":return` L${t+e},${r}`}break;case"notch":switch(s){case"tr":return` L${t-e},${r+e} L${t},${r+e}`;case"br":return` L${t-e},${r-e} L${t-e},${r}`;case"bl":return` L${t+e},${r-e} L${t},${r-e}`;case"tl":return` L${t+e},${r+e} L${t+e},${r}`}break}return""}function Fe(n,e,t=!1,r=.5,s){if(n.length<2)return n.length===1?`M ${n[0].x} ${n[0].y}`:"";switch(e){case"LINEAR":case"linear":return jt(n,t);case"QUADRATIC":case"quadratic":return Fn(n,t);case"CUBIC":case"cubic":return In(n,t);case"ARC":case"arc":return On(n,t,s);case"MIXED":case"mixed":return Ht(n,t);case"CATMULL_ROM":case"catmull-rom":return Gn(n,t,r);case"BASIS":case"basis":return Dn(n,t);default:return n.some(a=>a.segmentType)?Ht(n,t):jt(n,t)}}function jt(n,e){let t=`M ${n[0].x} ${n[0].y}`,r=0;for(let s=1;s<n.length;s++)n[s].isSubpathStart?(e&&s-r>2&&(t+=" Z"),t+=` M ${n[s].x} ${n[s].y}`,r=s):t+=` L ${n[s].x} ${n[s].y}`;return e&&n.length-r>2&&(t+=" Z"),t}function Fn(n,e){let t=`M ${n[0].x} ${n[0].y}`,r=0;for(let s=0;s<n.length-1;s++){let a=n[s],o=n[s+1];if(o.isSubpathStart){if(e&&s-r>=1){let u=n[r],c=a.handleOut??{x:(a.x+u.x)/2,y:(a.y+u.y)/2};t+=` Q ${c.x} ${c.y} ${u.x} ${u.y} Z`}t+=` M ${o.x} ${o.y}`,r=s+1;continue}let l=a.handleOut??{x:(a.x+o.x)/2,y:(a.y+o.y)/2};t+=` Q ${l.x} ${l.y} ${o.x} ${o.y}`}if(e&&n.length-r>1){let s=n[n.length-1],a=n[r],o=s.handleOut??{x:(s.x+a.x)/2,y:(s.y+a.y)/2};t+=` Q ${o.x} ${o.y} ${a.x} ${a.y} Z`}return t}function In(n,e){let t=`M ${n[0].x} ${n[0].y}`,r=0;for(let s=0;s<n.length-1;s++){let a=n[s],o=n[s+1];if(o.isSubpathStart){if(e&&s-r>=1){let c=n[r],p=a.handleOut??{x:a.x,y:a.y},d=c.handleIn??{x:c.x,y:c.y};t+=` C ${p.x} ${p.y} ${d.x} ${d.y} ${c.x} ${c.y} Z`}t+=` M ${o.x} ${o.y}`,r=s+1;continue}let l=a.handleOut??{x:a.x,y:a.y},u=o.handleIn??{x:o.x,y:o.y};t+=` C ${l.x} ${l.y} ${u.x} ${u.y} ${o.x} ${o.y}`}if(e&&n.length-r>1){let s=n[n.length-1],a=n[r],o=s.handleOut??{x:s.x,y:s.y},l=a.handleIn??{x:a.x,y:a.y};t+=` C ${o.x} ${o.y} ${l.x} ${l.y} ${a.x} ${a.y} Z`}return t}function On(n,e,t){let r=`M ${n[0].x} ${n[0].y}`,s=0,a={rx:50,ry:50,rotation:0,largeArc:!1,sweep:!0};for(let o=0;o<n.length-1;o++){let l=n[o+1];if(l.isSubpathStart){if(e&&o-s>=1){let c=n[s],p=t?.[o]??a;r+=` A ${p.rx} ${p.ry} ${p.rotation} ${p.largeArc?1:0} ${p.sweep?1:0} ${c.x} ${c.y} Z`}r+=` M ${l.x} ${l.y}`,s=o+1;continue}let u=t?.[o]??a;r+=` A ${u.rx} ${u.ry} ${u.rotation} ${u.largeArc?1:0} ${u.sweep?1:0} ${l.x} ${l.y}`}if(e&&n.length-s>1){let o=n[s],l=t?.[n.length-1]??a;r+=` A ${l.rx} ${l.ry} ${l.rotation} ${l.largeArc?1:0} ${l.sweep?1:0} ${o.x} ${o.y} Z`}return r}function Ht(n,e){let t=`M ${n[0].x} ${n[0].y}`,r=0;for(let s=0;s<n.length-1;s++){let a=n[s],o=n[s+1];if(o.isSubpathStart){if(e&&s-r>=1){let l=n[r];t+=_t(a,l,l.segmentType),t+=" Z"}t+=` M ${o.x} ${o.y}`,r=s+1;continue}t+=_t(a,o,o.segmentType)}if(e&&n.length-r>1){let s=n[n.length-1],a=n[r];t+=_t(s,a,a.segmentType),t+=" Z"}return t}function _t(n,e,t){let r=(t??(n.handleOut||e.handleIn?"CUBIC":"LINEAR")).toUpperCase();if(r==="LINEAR")return` L ${e.x} ${e.y}`;if(r==="QUADRATIC"){let o=n.handleOut??{x:(n.x+e.x)/2,y:(n.y+e.y)/2};return` Q ${o.x} ${o.y} ${e.x} ${e.y}`}if(r==="ARC"){let o=e.arcParams;return o?` A ${o.rx} ${o.ry} ${o.rotation} ${o.largeArc?1:0} ${o.sweep?1:0} ${e.x} ${e.y}`:` L ${e.x} ${e.y}`}let s=n.handleOut??{x:n.x,y:n.y},a=e.handleIn??{x:e.x,y:e.y};return` C ${s.x} ${s.y} ${a.x} ${a.y} ${e.x} ${e.y}`}function Gn(n,e,t){if(n.length<2)return n.length===1?`M ${n[0].x} ${n[0].y}`:"";let r=t,s=e?[n[n.length-1],...n,n[0],n[1]]:[n[0],...n,n[n.length-1]],a=`M ${n[0].x} ${n[0].y}`,o=e?n.length:n.length-1;for(let l=0;l<o;l++){let u=s[l],c=s[l+1],p=s[l+2],d=s[l+3],h=Math.hypot(p.x-c.x,p.y-c.y),f=Math.hypot(c.x-u.x,c.y-u.y),y=Math.hypot(d.x-p.x,d.y-p.y),g=Math.pow(f,r),b=Math.pow(h,r),w=Math.pow(y,r),k=Math.pow(f,2*r),x=Math.pow(h,2*r),M=Math.pow(y,2*r),R,E,$,S;f<1e-8?(R=c.x,E=c.y):(R=(k*p.x-x*u.x+(2*k+3*g*b+x)*c.x)/(3*g*(g+b)),E=(k*p.y-x*u.y+(2*k+3*g*b+x)*c.y)/(3*g*(g+b))),y<1e-8?($=p.x,S=p.y):($=(M*c.x-x*d.x+(2*M+3*w*b+x)*p.x)/(3*w*(w+b)),S=(M*c.y-x*d.y+(2*M+3*w*b+x)*p.y)/(3*w*(w+b))),a+=` C ${R} ${E} ${$} ${S} ${p.x} ${p.y}`}return e&&(a+=" Z"),a}function Dn(n,e){let t=n.length;if(t<2)return t===1?`M ${n[0].x} ${n[0].y}`:"";if(t===2)return`M ${n[0].x} ${n[0].y} L ${n[1].x} ${n[1].y}`;if(e){let a=(n[0].x+4*n[1].x+n[2].x)/6,o=(n[0].y+4*n[1].y+n[2].y)/6,l=`M ${a} ${o}`;for(let u=0;u<t;u++){let c=n[(u+1)%t],p=n[(u+2)%t],d=n[(u+3)%t];l+=kt(c,p,d)}return l+=" Z",l}let r=n,s=`M ${r[0].x} ${r[0].y}`;s+=` L ${(5*r[0].x+r[1].x)/6} ${(5*r[0].y+r[1].y)/6}`;for(let a=0;a<=t-3;a++)s+=kt(r[a],r[a+1],r[a+2]);return s+=kt(r[t-2],r[t-1],r[t-1]),s+=` L ${r[t-1].x} ${r[t-1].y}`,s}function kt(n,e,t){return` C ${(2*n.x+e.x)/3} ${(2*n.y+e.y)/3} ${(n.x+2*e.x)/3} ${(n.y+2*e.y)/3} ${(n.x+4*e.x+t.x)/6} ${(n.y+4*e.y+t.y)/6}`}function ne(n,e,t){let r=Number.isFinite(e)?Math.max(1,e):8,s=Number.isFinite(t)?Math.max(1,t):4;switch(n){case"dashed":case"dotted":case"custom":return`${r} ${s}`;default:return null}}function G(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function Bn(n){let e=n.fillType;return e||(n.fillGradient?n.fillGradient.r!==void 0?"radial-gradient":"linear-gradient":n.linearGradient?"linear-gradient":n.radialGradient?"radial-gradient":"solid")}function Ie(n){let e=new Map,t=n.state,r=t;switch(n.type){case"circle":e.set("cx",String(t.x??0)),e.set("cy",String(t.y??0)),e.set("r",String(t.radius??50));break;case"ellipse":e.set("cx",String(t.cx??0)),e.set("cy",String(t.cy??0)),e.set("rx",String(t.rx??50)),e.set("ry",String(t.ry??30));break;case"rectangle":case"square":e.set("x",String(t.x??0)),e.set("y",String(t.y??0)),e.set("width",String(t.width??100)),e.set("height",String(t.height??100)),(t.cornerRadius??0)>0&&e.set("rx",String(t.cornerRadius));break;case"line":e.set("x1",String(t.x1??0)),e.set("y1",String(t.y1??0)),e.set("x2",String(t.x2??0)),e.set("y2",String(t.y2??0));break;case"text":e.set("x",String(t.x??0)),e.set("y",String(t.y??0)),t.fontSize&&e.set("font-size",String(t.fontSize)),t.fontFamily&&e.set("font-family",t.fontFamily),t.fontWeight&&e.set("font-weight",t.fontWeight),t.fontStyle&&e.set("font-style",t.fontStyle),t.textAnchor&&e.set("text-anchor",t.textAnchor),t.letterSpacing&&e.set("letter-spacing",String(t.letterSpacing));break;case"image":e.set("x",String(t.x??0)),e.set("y",String(t.y??0)),e.set("width",String(t.width??100)),e.set("height",String(t.height??100)),r.href&&e.set("href",String(r.href));break}let s=Bn(r);s==="none"?e.set("fill","none"):s==="linear-gradient"||s==="radial-gradient"?e.set("fill",`url(#gradient-fill-${n.id})`):s==="pattern"?e.set("fill",`url(#pattern-fill-${n.id})`):e.set("fill",t.fillColor??"#000000");let a=t.opacity;a!==void 0&&a<1&&e.set("opacity",String(a));let o=t.fillOpacity;o!==void 0&&o<1&&e.set("fill-opacity",String(o)),t.fillRule&&t.fillRule!=="nonzero"&&e.set("fill-rule",t.fillRule);let l=r.strokeType??"solid";if(l==="none")e.set("stroke","none");else if(l==="linear-gradient"||l==="radial-gradient")e.set("stroke",`url(#gradient-stroke-${n.id})`);else{let M=t.borderColor??"none";M!=="none"&&e.set("stroke",M)}let u=t.borderWidth;u!=null&&u!==0&&e.set("stroke-width",String(u));let c=t.strokeOpacity;c!==void 0&&c<1&&e.set("stroke-opacity",String(c));let p=t.lineStyle??"solid",d=t.dashLength??8,h=t.gapLength??4,f=ne(p,d,h);f&&(e.set("stroke-dasharray",f),p==="dotted"&&e.set("stroke-linecap","round"));let y=Ln(r);y&&e.set("transform",y);let g=r.filters;g&&g.length>0&&e.set("filter",`url(#filter-${n.id})`);let b=t.shapeRendering;b&&b!=="auto"&&e.set("shape-rendering",b);let w=r.startEndpoint,k=r.endEndpoint;w&&w!=="none"&&e.set("marker-start",`url(#line-marker-${w})`),k&&k!=="none"&&e.set("marker-end",`url(#line-marker-${k})`);let x=r.metadata;return x&&(x.role&&e.set("role",x.role),x.ariaLabel&&e.set("aria-label",x.ariaLabel)),e}function Xt(n){switch(n.type){case"circle":return"circle";case"ellipse":return"ellipse";case"rectangle":case"square":return"rect";case"line":return"line";case"text":return"text";case"image":return"image";case"spline":case"polyline":case"triangle":case"ngon":case"star":case"cross":case"ring":case"spiral":case"gear":case"arrow":return"path";default:return"g"}}function Ln(n){let e=n.rotation??0,t=n.skewX??0,r=n.skewY??0,s=n.scaleX??1,a=n.scaleY??1;if(e===0&&t===0&&r===0&&s===1&&a===1)return null;let o=n.customPivot;if(!o)return null;let l=[];return l.push(`translate(${o.x}, ${o.y})`),e!==0&&l.push(`rotate(${e})`),(s!==1||a!==1)&&l.push(`scale(${s}, ${a})`),t!==0&&l.push(`skewX(${t})`),r!==0&&l.push(`skewY(${r})`),l.push(`translate(${-o.x}, ${-o.y})`),l.join(" ")}function W(n,e){let t=n.viewboxes?.[0];return{width:e.width??t?.width??800,height:e.height??t?.height??600}}function i(n,e){return e==null||e===""?"":` ${n}="${G(String(e))}"`}function Oe(n){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return e?{r:parseInt(e[1],16)/255,g:parseInt(e[2],16)/255,b:parseInt(e[3],16)/255}:{r:0,g:0,b:0}}function Vn(n,e,t){let{offsetX:r,offsetY:s,blurRadius:a,spread:o,color:l,opacity:u}=n,c="";if(o===0)c+=`<feDropShadow${i("in",e)}${i("dx",r)}${i("dy",s)}${i("stdDeviation",a/2)}${i("flood-color",l)}${i("flood-opacity",u)}${i("result",`${t}_shadow`)}/>`,c+=`<feMerge${i("result",t)}><feMergeNode${i("in",`${t}_shadow`)}/><feMergeNode${i("in",e)}/></feMerge>`;else{c+=`<feColorMatrix${i("in",e)}${i("type","matrix")}${i("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0")}${i("result",`${t}_alpha`)}/>`;let p=o>0?"dilate":"erode",d=Math.abs(o);c+=`<feMorphology${i("in",`${t}_alpha`)}${i("operator",p)}${i("radius",d)}${i("result",`${t}_spread`)}/>`,c+=`<feGaussianBlur${i("in",`${t}_spread`)}${i("stdDeviation",a/2)}${i("result",`${t}_blur`)}/>`,c+=`<feOffset${i("in",`${t}_blur`)}${i("dx",r)}${i("dy",s)}${i("result",`${t}_offset`)}/>`,c+=`<feFlood${i("flood-color",l)}${i("flood-opacity",u)}${i("result",`${t}_color`)}/>`,c+=`<feComposite${i("in",`${t}_color`)}${i("in2",`${t}_offset`)}${i("operator","in")}${i("result",`${t}_shadow`)}/>`,c+=`<feMerge${i("result",t)}><feMergeNode${i("in",`${t}_shadow`)}/><feMergeNode${i("in",e)}/></feMerge>`}return c}function Nn(n,e,t){let{offsetX:r,offsetY:s,blurRadius:a,choke:o,color:l,opacity:u}=n,c=a*(1-o/100),p="";return p+=`<feColorMatrix${i("in",e)}${i("type","matrix")}${i("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0")}${i("result",`${t}_alpha`)}/>`,p+=`<feComponentTransfer${i("in",`${t}_alpha`)}${i("result",`${t}_inverted`)}><feFuncA${i("type","table")}${i("tableValues","1 0")}/></feComponentTransfer>`,p+=`<feGaussianBlur${i("in",`${t}_inverted`)}${i("stdDeviation",c/2)}${i("result",`${t}_blur`)}/>`,p+=`<feOffset${i("in",`${t}_blur`)}${i("dx",r)}${i("dy",s)}${i("result",`${t}_offset`)}/>`,p+=`<feFlood${i("flood-color",l)}${i("flood-opacity",u)}${i("result",`${t}_color`)}/>`,p+=`<feComposite${i("in",`${t}_color`)}${i("in2",`${t}_offset`)}${i("operator","in")}${i("result",`${t}_coloredShadow`)}/>`,p+=`<feComposite${i("in",`${t}_coloredShadow`)}${i("in2",`${t}_alpha`)}${i("operator","in")}${i("result",`${t}_innerShadow`)}/>`,p+=`<feComposite${i("in",`${t}_innerShadow`)}${i("in2",e)}${i("operator","over")}${i("result",t)}/>`,p}function Un(n,e,t){let{blurX:r,blurY:s}=n;return r===0&&s===0?C(e,t):`<feGaussianBlur${i("in",e)}${i("stdDeviation",`${r/2} ${s/2}`)}${i("result",t)}/>`}function zn(n,e,t){let{distance:r,angle:s}=n;if(r===0)return C(e,t);let a=s*Math.PI/180,o=Math.abs(Math.cos(a)*r),l=Math.abs(Math.sin(a)*r);return`<feGaussianBlur${i("in",e)}${i("stdDeviation",`${o/2} ${l/2}`)}${i("result",t)}/>`}function Yt(n,e,t){let{x:r,y:s,z:a,color:o,surfaceScale:l,diffuseConstant:u,specularConstant:c,specularExponent:p}=n,d="";return d+=`<feDiffuseLighting${i("in","SourceAlpha")}${i("surfaceScale",l)}${i("diffuseConstant",u)}${i("lighting-color",o)}${i("result",`${t}_diffuse`)}>`,d+=`<fePointLight${i("x",r)}${i("y",s)}${i("z",a)}/>`,d+="</feDiffuseLighting>",d+=`<feSpecularLighting${i("in","SourceAlpha")}${i("surfaceScale",l)}${i("specularConstant",c)}${i("specularExponent",p)}${i("lighting-color",o)}${i("result",`${t}_specular`)}>`,d+=`<fePointLight${i("x",r)}${i("y",s)}${i("z",a)}/>`,d+="</feSpecularLighting>",d+=`<feComposite${i("in",e)}${i("in2",`${t}_diffuse`)}${i("operator","arithmetic")}${i("k1",1)}${i("k2",0)}${i("k3",0)}${i("k4",0)}${i("result",`${t}_lit`)}/>`,d+=`<feComposite${i("in",`${t}_specular`)}${i("in2",`${t}_lit`)}${i("operator","arithmetic")}${i("k1",0)}${i("k2",1)}${i("k3",1)}${i("k4",0)}${i("result",t)}/>`,d}function qt(n,e,t){let{x:r,y:s,z:a,pointsAtX:o,pointsAtY:l,pointsAtZ:u,coneAngle:c,color:p,surfaceScale:d,specularConstant:h,specularExponent:f}=n,y="";return y+=`<feSpecularLighting${i("in","SourceAlpha")}${i("surfaceScale",d)}${i("specularConstant",h)}${i("specularExponent",f)}${i("lighting-color",p)}${i("result",`${t}_specular`)}>`,y+=`<feSpotLight${i("x",r)}${i("y",s)}${i("z",a)}${i("pointsAtX",o)}${i("pointsAtY",l)}${i("pointsAtZ",u)}${i("limitingConeAngle",c)}/>`,y+="</feSpecularLighting>",y+=`<feComposite${i("in",`${t}_specular`)}${i("in2","SourceAlpha")}${i("operator","in")}${i("result",`${t}_clipped`)}/>`,y+=`<feComposite${i("in",`${t}_clipped`)}${i("in2",e)}${i("operator","arithmetic")}${i("k1",0)}${i("k2",1)}${i("k3",1)}${i("k4",0)}${i("result",t)}/>`,y}function Wn(n,e,t){let{width:r,color:s,opacity:a,position:o}=n,l="";if(o==="inside")l+=`<feMorphology${i("in","SourceAlpha")}${i("operator","erode")}${i("radius",r)}${i("result",`${t}_eroded`)}/>`,l+=`<feComposite${i("in","SourceAlpha")}${i("in2",`${t}_eroded`)}${i("operator","out")}${i("result",`${t}_outlineAlpha`)}/>`,l+=`<feFlood${i("flood-color",s)}${i("flood-opacity",a)}${i("result",`${t}_color`)}/>`,l+=`<feComposite${i("in",`${t}_color`)}${i("in2",`${t}_outlineAlpha`)}${i("operator","in")}${i("result",`${t}_outline`)}/>`,l+=`<feComposite${i("in",`${t}_outline`)}${i("in2",e)}${i("operator","over")}${i("result",t)}/>`;else{let u=o==="outside"?r:r/2;l+=`<feMorphology${i("in","SourceAlpha")}${i("operator","dilate")}${i("radius",u)}${i("result",`${t}_dilated`)}/>`,l+=`<feComposite${i("in",`${t}_dilated`)}${i("in2","SourceAlpha")}${i("operator","out")}${i("result",`${t}_outlineAlpha`)}/>`,l+=`<feFlood${i("flood-color",s)}${i("flood-opacity",a)}${i("result",`${t}_color`)}/>`,l+=`<feComposite${i("in",`${t}_color`)}${i("in2",`${t}_outlineAlpha`)}${i("operator","in")}${i("result",`${t}_outline`)}/>`,l+=`<feMerge${i("result",t)}><feMergeNode${i("in",`${t}_outline`)}/><feMergeNode${i("in",e)}/></feMerge>`}return l}function jn(n,e,t){let{amount:r}=n;if(r===0)return C(e,t);let s=1+4*r,a=-r,o=[0,a,0,a,s,a,0,a,0].join(" ");return`<feConvolveMatrix${i("in",e)}${i("order","3")}${i("kernelMatrix",o)}${i("divisor","1")}${i("bias","0")}${i("preserveAlpha","true")}${i("edgeMode","duplicate")}${i("result",t)}/>`}function Hn(n,e,t){let{blockSize:r}=n;if(r<=1)return C(e,t);let s=r/2,a="";return a+=`<feMorphology${i("in",e)}${i("operator","erode")}${i("radius",s)}${i("result",`${t}_eroded`)}/>`,a+=`<feMorphology${i("in",`${t}_eroded`)}${i("operator","dilate")}${i("radius",s)}${i("result",t)}/>`,a}function Xn(n,e,t){let{scale:r,frequency:s,octaves:a,warpType:o}=n;if(r===0)return C(e,t);let l="";return l+=`<feTurbulence${i("type",o)}${i("baseFrequency",s)}${i("numOctaves",a)}${i("seed",0)}${i("result",`${t}_turbulence`)}/>`,l+=`<feDisplacementMap${i("in",e)}${i("in2",`${t}_turbulence`)}${i("scale",r)}${i("xChannelSelector","R")}${i("yChannelSelector","G")}${i("result",t)}/>`,l}function Yn(n,e,t){let{operator:r,radiusX:s,radiusY:a}=n;return s===0&&a===0?C(e,t):`<feMorphology${i("in",e)}${i("operator",r)}${i("radius",`${s} ${a}`)}${i("result",t)}/>`}function qn(n,e,t){let{levels:r}=n;if(r<2)return C(e,t);let s=[];for(let l=0;l<r;l++)s.push(l/(r-1));let a=s.join(" "),o=`<feComponentTransfer${i("in",e)}${i("result",t)}>`;return o+=`<feFuncR${i("type","discrete")}${i("tableValues",a)}/>`,o+=`<feFuncG${i("type","discrete")}${i("tableValues",a)}/>`,o+=`<feFuncB${i("type","discrete")}${i("tableValues",a)}/>`,o+="</feComponentTransfer>",o}function Zn(n,e,t){let{levels:r,contrast:s}=n;if(r<2)return C(e,t);let a=[];for(let u=0;u<r;u++){let c=u/(r-1),p=c;s!==1&&(p=.5+(c-.5)*s,p=Math.max(0,Math.min(1,p))),a.push(p)}let o=a.join(" "),l=`<feComponentTransfer${i("in",e)}${i("result",t)}>`;return l+=`<feFuncR${i("type","table")}${i("tableValues",o)}/>`,l+=`<feFuncG${i("type","table")}${i("tableValues",o)}/>`,l+=`<feFuncB${i("type","table")}${i("tableValues",o)}/>`,l+="</feComponentTransfer>",l}function Qn(n,e,t){let{radius:r}=n;if(r===0)return C(e,t);let s="";return s+=`<feGaussianBlur${i("in","SourceAlpha")}${i("stdDeviation",r)}${i("result",`${t}_blurredAlpha`)}/>`,s+=`<feComponentTransfer${i("in",`${t}_blurredAlpha`)}${i("result",`${t}_thresholdAlpha`)}><feFuncA${i("type","linear")}${i("slope",20)}${i("intercept",-9)}/></feComponentTransfer>`,s+=`<feComposite${i("in",e)}${i("in2",`${t}_thresholdAlpha`)}${i("operator","in")}${i("result",t)}/>`,s}function Kn(n,e,t){let{amount:r}=n;if(r===0)return C(e,t);let s=1-r;return`<feColorMatrix${i("in",e)}${i("type","saturate")}${i("values",s)}${i("result",t)}/>`}function Jn(n,e,t){let{red:r,green:s,blue:a}=n;if(r===1&&s===1&&a===1)return C(e,t);let o=`<feComponentTransfer${i("in",e)}${i("result",t)}>`;return o+=`<feFuncR${i("type","linear")}${i("slope",r)}${i("intercept",0)}/>`,o+=`<feFuncG${i("type","linear")}${i("slope",s)}${i("intercept",0)}/>`,o+=`<feFuncB${i("type","linear")}${i("slope",a)}${i("intercept",0)}/>`,o+="</feComponentTransfer>",o}function er(n,e,t){let{amount:r}=n;if(r===1)return C(e,t);let s=`<feComponentTransfer${i("in",e)}${i("result",t)}>`;return s+=`<feFuncR${i("type","linear")}${i("slope",r)}${i("intercept",0)}/>`,s+=`<feFuncG${i("type","linear")}${i("slope",r)}${i("intercept",0)}/>`,s+=`<feFuncB${i("type","linear")}${i("slope",r)}${i("intercept",0)}/>`,s+="</feComponentTransfer>",s}function tr(n,e,t){let{amount:r}=n;if(r===1)return C(e,t);let s=.5*(1-r),a=`<feComponentTransfer${i("in",e)}${i("result",t)}>`;return a+=`<feFuncR${i("type","linear")}${i("slope",r)}${i("intercept",s)}/>`,a+=`<feFuncG${i("type","linear")}${i("slope",r)}${i("intercept",s)}/>`,a+=`<feFuncB${i("type","linear")}${i("slope",r)}${i("intercept",s)}/>`,a+="</feComponentTransfer>",a}function nr(n,e,t){let{amount:r}=n;if(r===1)return C(e,t);let s=`<feComponentTransfer${i("in",e)}${i("result",t)}>`;return s+=`<feFuncA${i("type","linear")}${i("slope",r)}${i("intercept",0)}/>`,s+="</feComponentTransfer>",s}function rr(n,e,t){let{amount:r}=n;if(r===0)return C(e,t);let s=r,a=1-r,o=`${s} ${a}`,l=`<feComponentTransfer${i("in",e)}${i("result",t)}>`;return l+=`<feFuncR${i("type","table")}${i("tableValues",o)}/>`,l+=`<feFuncG${i("type","table")}${i("tableValues",o)}/>`,l+=`<feFuncB${i("type","table")}${i("tableValues",o)}/>`,l+="</feComponentTransfer>",l}function sr(n,e,t){let{angle:r}=n;return r===0||r===360?C(e,t):`<feColorMatrix${i("in",e)}${i("type","hueRotate")}${i("values",r)}${i("result",t)}/>`}function ir(n,e,t){let{amount:r}=n;return r===1?C(e,t):`<feColorMatrix${i("in",e)}${i("type","saturate")}${i("values",r)}${i("result",t)}/>`}function ar(n,e,t){let{threshold:r}=n,s="";if(s+=`<feColorMatrix${i("in",e)}${i("type","saturate")}${i("values",0)}${i("result",`${t}_gray`)}/>`,r===.5)s+=`<feComponentTransfer${i("in",`${t}_gray`)}${i("result",t)}>`,s+=`<feFuncR${i("type","discrete")}${i("tableValues","0 1")}/>`,s+=`<feFuncG${i("type","discrete")}${i("tableValues","0 1")}/>`,s+=`<feFuncB${i("type","discrete")}${i("tableValues","0 1")}/>`,s+="</feComponentTransfer>";else{let o=[];for(let u=0;u<256;u++)o.push(u/255<r?0:1);let l=o.join(" ");s+=`<feComponentTransfer${i("in",`${t}_gray`)}${i("result",t)}>`,s+=`<feFuncR${i("type","table")}${i("tableValues",l)}/>`,s+=`<feFuncG${i("type","table")}${i("tableValues",l)}/>`,s+=`<feFuncB${i("type","table")}${i("tableValues",l)}/>`,s+="</feComponentTransfer>"}return s}function or(n,e,t){let{amount:r}=n;if(r===0)return C(e,t);let s=[.393,.769,.189,0,0],a=[.349,.686,.168,0,0],o=[.272,.534,.131,0,0],l=[1,0,0,0,0],u=[0,1,0,0,0],c=[0,0,1,0,0],p=(g,b)=>g.map((w,k)=>w*(1-r)+b[k]*r),d=p(l,s),h=p(u,a),f=p(c,o),y=[...d,...h,...f,0,0,0,1,0].join(" ");return`<feColorMatrix${i("in",e)}${i("type","matrix")}${i("values",y)}${i("result",t)}/>`}function lr(n,e,t){let{shadowColor:r,highlightColor:s}=n,a=Oe(r),o=Oe(s),l="";return l+=`<feColorMatrix${i("in",e)}${i("type","saturate")}${i("values",0)}${i("result",`${t}_gray`)}/>`,l+=`<feComponentTransfer${i("in",`${t}_gray`)}${i("result",t)}>`,l+=`<feFuncR${i("type","table")}${i("tableValues",`${a.r} ${o.r}`)}/>`,l+=`<feFuncG${i("type","table")}${i("tableValues",`${a.g} ${o.g}`)}/>`,l+=`<feFuncB${i("type","table")}${i("tableValues",`${a.b} ${o.b}`)}/>`,l+="</feComponentTransfer>",l}function ur(n,e,t){let{intensity:r}=n;if(r===0)return C(e,t);let s="";s+=`<feComponentTransfer${i("in",e)}${i("result",`${t}_invert`)}>`,s+=`<feFuncR${i("type","table")}${i("tableValues","1 0")}/>`,s+=`<feFuncG${i("type","table")}${i("tableValues","1 0")}/>`,s+=`<feFuncB${i("type","table")}${i("tableValues","1 0")}/>`,s+="</feComponentTransfer>",s+=`<feColorMatrix${i("in",`${t}_invert`)}${i("type","saturate")}${i("values",0)}${i("result",`${t}_gray`)}/>`;let a=[.1,.1,.1,0,0],o=[.3,.4,.3,0,0],l=[.5,.5,.8,0,0],u=[1,0,0,0,0],c=[0,1,0,0,0],p=[0,0,1,0,0],d=(b,w)=>b.map((k,x)=>k*(1-r)+w[x]*r),h=d(u,a),f=d(c,o),y=d(p,l),g=[...h,...f,...y,0,0,0,1,0].join(" ");return s+=`<feColorMatrix${i("in",`${t}_gray`)}${i("type","matrix")}${i("values",g)}${i("result",t)}/>`,s}function cr(n,e,t){let{amount:r,scale:s}=n;if(r===0)return C(e,t);let a=1/s,o="";return o+=`<feTurbulence${i("type","fractalNoise")}${i("baseFrequency",a)}${i("numOctaves",3)}${i("seed",0)}${i("result",`${t}_noise`)}/>`,o+=`<feColorMatrix${i("in",`${t}_noise`)}${i("type","saturate")}${i("values",0)}${i("result",`${t}_noiseGray`)}/>`,o+=`<feBlend${i("in",e)}${i("in2",`${t}_noiseGray`)}${i("mode","overlay")}${i("result",`${t}_blended`)}/>`,o+=`<feComposite${i("in",`${t}_blended`)}${i("in2",e)}${i("operator","arithmetic")}${i("k1",0)}${i("k2",r)}${i("k3",1-r)}${i("k4",0)}${i("result",`${t}_amt`)}/>`,o+=`<feComposite${i("in",`${t}_amt`)}${i("in2",e)}${i("operator","in")}${i("result",t)}/>`,o}function hr(n,e,t){let{strength:r,angle:s}=n;if(r===0)return C(e,t);let a=s*Math.PI/180,o=Math.cos(a),l=Math.sin(a),u=r,c=[-(u*(o+l)),-(u*l),u*(-o+l),-(u*o),1,u*o,u*(o-l),u*l,u*(o+l)].join(" ");return`<feConvolveMatrix${i("in",e)}${i("order","3 3")}${i("kernelMatrix",c)}${i("divisor",1)}${i("bias",.5)}${i("preserveAlpha","true")}${i("result",t)}/>`}function dr(n,e,t){let{amount:r,size:s}=n;if(r===0)return C(e,t);let a=.5/s,o="";return o+=`<feTurbulence${i("type","fractalNoise")}${i("baseFrequency",`${a} ${a}`)}${i("numOctaves",5)}${i("seed",0)}${i("stitchTiles","stitch")}${i("result",`${t}_grain`)}/>`,o+=`<feColorMatrix${i("in",`${t}_grain`)}${i("type","saturate")}${i("values",0)}${i("result",`${t}_grainGray`)}/>`,o+=`<feBlend${i("in",e)}${i("in2",`${t}_grainGray`)}${i("mode","soft-light")}${i("result",`${t}_blended`)}/>`,o+=`<feComposite${i("in",`${t}_blended`)}${i("in2",e)}${i("operator","arithmetic")}${i("k1",0)}${i("k2",r)}${i("k3",1-r)}${i("k4",0)}${i("result",`${t}_amt`)}/>`,o+=`<feComposite${i("in",`${t}_amt`)}${i("in2",e)}${i("operator","in")}${i("result",t)}/>`,o}function pr(n,e,t){let{wetness:r,turbulence:s}=n;if(r===0&&s===0)return C(e,t);let a="";return a+=`<feTurbulence${i("type","fractalNoise")}${i("baseFrequency",.02+s*.03)}${i("numOctaves",4)}${i("seed",42)}${i("result",`${t}_turb`)}/>`,a+=`<feDisplacementMap${i("in",e)}${i("in2",`${t}_turb`)}${i("scale",r*15)}${i("xChannelSelector","R")}${i("yChannelSelector","G")}${i("result",`${t}_disp`)}/>`,a+=`<feGaussianBlur${i("in",`${t}_disp`)}${i("stdDeviation",r*2)}${i("result",`${t}_blur`)}/>`,a+=`<feBlend${i("in",`${t}_blur`)}${i("in2",e)}${i("mode","multiply")}${i("result",t)}/>`,a}function mr(n,e,t){let{thickness:r,texture:s}=n;if(r===0&&s===0)return C(e,t);let a="";a+=`<feTurbulence${i("type","turbulence")}${i("baseFrequency",.03+s*.02)}${i("numOctaves",3)}${i("seed",1e3)}${i("result",`${t}_brush`)}/>`;let o=Math.max(3,8-Math.floor(r*5)),l=Array.from({length:o+1},(u,c)=>c/o).join(" ");a+=`<feComponentTransfer${i("in",e)}${i("result",`${t}_poster`)}>`;for(let u of["R","G","B"])a+=`<feFunc${u}${i("type","discrete")}${i("tableValues",l)}/>`;return a+="</feComponentTransfer>",a+=`<feDisplacementMap${i("in",`${t}_poster`)}${i("in2",`${t}_brush`)}${i("scale",s*4)}${i("xChannelSelector","R")}${i("yChannelSelector","G")}${i("result",`${t}_disp`)}/>`,a+=`<feMorphology${i("in",`${t}_disp`)}${i("operator","dilate")}${i("radius",r*.5)}${i("result",`${t}_thick`)}/>`,a+=`<feComposite${i("in",`${t}_thick`)}${i("in2",e)}${i("operator","in")}${i("result",t)}/>`,a}function fr(n,e,t){let{spread:r,edges:s}=n;if(r===0&&s===0)return C(e,t);let a="";return a+=`<feTurbulence${i("type","fractalNoise")}${i("baseFrequency",.01+s*.02)}${i("numOctaves",5)}${i("seed",1100)}${i("result",`${t}_ink`)}/>`,a+=`<feMorphology${i("in",e)}${i("operator","dilate")}${i("radius",r*3)}${i("result",`${t}_dilate`)}/>`,a+=`<feDisplacementMap${i("in",`${t}_dilate`)}${i("in2",`${t}_ink`)}${i("scale",s*10)}${i("xChannelSelector","R")}${i("yChannelSelector","G")}${i("result",`${t}_disp`)}/>`,a+=`<feGaussianBlur${i("in",`${t}_disp`)}${i("stdDeviation",r*.5)}${i("result",t)}/>`,a}function gr(n,e,t){let{wrinkles:r,shine:s}=n;if(r===0&&s===0)return C(e,t);let a="";return a+=`<feTurbulence${i("type","turbulence")}${i("baseFrequency",.02)}${i("numOctaves",4)}${i("seed",1200)}${i("result",`${t}_wrinkle`)}/>`,a+=`<feDisplacementMap${i("in",e)}${i("in2",`${t}_wrinkle`)}${i("scale",r*15)}${i("xChannelSelector","R")}${i("yChannelSelector","G")}${i("result",`${t}_disp`)}/>`,a+=`<feSpecularLighting${i("in",`${t}_wrinkle`)}${i("surfaceScale",r*2)}${i("specularConstant",s*1.5)}${i("specularExponent",20)}${i("result",`${t}_sheen`)}>`,a+=`<feDistantLight${i("azimuth",45)}${i("elevation",60)}/>`,a+="</feSpecularLighting>",a+=`<feBlend${i("in",`${t}_disp`)}${i("in2",`${t}_sheen`)}${i("mode","screen")}${i("result",`${t}_blend`)}/>`,a+=`<feComposite${i("in",`${t}_blend`)}${i("in2",e)}${i("operator","in")}${i("result",t)}/>`,a}function $r(n,e,t){let{density:r,size:s}=n;if(r===0)return C(e,t);let a="",o=1-r;a+=`<feTurbulence${i("type","turbulence")}${i("baseFrequency",.1/s)}${i("numOctaves",1)}${i("seed",1400)}${i("result",`${t}_hole`)}/>`,a+=`<feComponentTransfer${i("in",`${t}_hole`)}${i("result",`${t}_thresh`)}>`;for(let l of["R","G","B","A"])a+=`<feFunc${l}${i("type","linear")}${i("slope",10)}${i("intercept",-o*10+5)}/>`;a+="</feComponentTransfer>",a+=`<feComponentTransfer${i("in",`${t}_thresh`)}${i("result",`${t}_clamp`)}>`;for(let l of["R","G","B","A"])a+=`<feFunc${l}${i("type","table")}${i("tableValues","0 0 1 1")}/>`;return a+="</feComponentTransfer>",a+=`<feComposite${i("in",e)}${i("in2",`${t}_clamp`)}${i("operator","in")}${i("result",t)}/>`,a}function yr(n,e,t){let{color:r,radius:s,intensity:a}=n;if(a===0||s===0)return C(e,t);let{r:o,g:l,b:u}=Oe(r),c="";return c+=`<feColorMatrix${i("in",e)}${i("type","matrix")}${i("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0")}${i("result",`${t}_alpha`)}/>`,c+=`<feGaussianBlur${i("in",`${t}_alpha`)}${i("stdDeviation",s/2)}${i("result",`${t}_blur`)}/>`,c+=`<feColorMatrix${i("in",`${t}_blur`)}${i("type","matrix")}${i("values",`0 0 0 0 ${o} 0 0 0 0 ${l} 0 0 0 0 ${u} 0 0 0 ${a} 0`)}${i("result",`${t}_color`)}/>`,c+=`<feMerge${i("result",t)}><feMergeNode${i("in",`${t}_color`)}/><feMergeNode${i("in",e)}/></feMerge>`,c}function br(n,e,t){let{color:r,radius:s,intensity:a}=n;if(a===0||s===0)return C(e,t);let{r:o,g:l,b:u}=Oe(r),c="";return c+=`<feColorMatrix${i("in",e)}${i("type","matrix")}${i("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0")}${i("result",`${t}_alpha`)}/>`,c+=`<feMorphology${i("in",`${t}_alpha`)}${i("operator","erode")}${i("radius",s/4)}${i("result",`${t}_erode`)}/>`,c+=`<feComposite${i("in",`${t}_alpha`)}${i("in2",`${t}_erode`)}${i("operator","out")}${i("result",`${t}_edge`)}/>`,c+=`<feGaussianBlur${i("in",`${t}_edge`)}${i("stdDeviation",s/3)}${i("result",`${t}_blur`)}/>`,c+=`<feColorMatrix${i("in",`${t}_blur`)}${i("type","matrix")}${i("values",`0 0 0 0 ${o} 0 0 0 0 ${l} 0 0 0 0 ${u} 0 0 0 ${a*2} 0`)}${i("result",`${t}_color`)}/>`,c+=`<feComposite${i("in",`${t}_color`)}${i("in2",`${t}_alpha`)}${i("operator","in")}${i("result",`${t}_clipped`)}/>`,c+=`<feComposite${i("in",`${t}_clipped`)}${i("in2",e)}${i("operator","over")}${i("result",t)}/>`,c}function C(n,e){return`<feMerge${i("result",e)}><feMergeNode${i("in",n)}/></feMerge>`}function Tt(n,e,t,r){switch(n.type){case"drop-shadow":return Vn(n,e,t);case"inner-shadow":return Nn(n,e,t);case"gaussian-blur":return Un(n,e,t);case"motion-blur":return zn(n,e,t);case"point-light":{let s=n;return Yt(r?{...s,x:s.x+r.x,y:s.y+r.y}:s,e,t)}case"spot-light":{let s=n;return qt(r?{...s,x:s.x+r.x,y:s.y+r.y,pointsAtX:s.pointsAtX+r.x,pointsAtY:s.pointsAtY+r.y}:s,e,t)}case"outline":return Wn(n,e,t);case"sharpen":return jn(n,e,t);case"pixelate":return Hn(n,e,t);case"warp":return Xn(n,e,t);case"morphology":return Yn(n,e,t);case"contouring-discrete":return qn(n,e,t);case"contouring-table":return Zn(n,e,t);case"round-edges":return Qn(n,e,t);case"grayscale":return Kn(n,e,t);case"channel-painter":return Jn(n,e,t);case"brightness":return er(n,e,t);case"contrast":return tr(n,e,t);case"opacity":return nr(n,e,t);case"invert":return rr(n,e,t);case"hue-rotate":return sr(n,e,t);case"saturate":return ir(n,e,t);case"black-and-white":return ar(n,e,t);case"sepia":return or(n,e,t);case"duotone":return lr(n,e,t);case"xray":return ur(n,e,t);case"noise":return cr(n,e,t);case"emboss":return hr(n,e,t);case"film-grain":return dr(n,e,t);case"watercolor":return pr(n,e,t);case"gouache":return mr(n,e,t);case"ink-blot":return fr(n,e,t);case"crumpled-plastic":return gr(n,e,t);case"riddled":return $r(n,e,t);case"glow":return yr(n,e,t);case"inner-glow":return br(n,e,t);default:return C(e,t)}}function xr(n,e){let t=e.filter(c=>c.enabled);if(t.length===0)return"";let r=t.some(c=>c.type==="gaussian-blur"&&c.quality==="high"||c.type==="motion-blur"&&c.quality==="high"),s=r?"500%":"300%",a=r?"-200%":"-100%",o="",l="SourceGraphic",u=0;for(let c of t){let p=`result${u++}`;o+=Tt(c,l,p),l=p}return`<filter${i("id",n)}${i("x",a)}${i("y",a)}${i("width",s)}${i("height",s)}${i("filterUnits","objectBoundingBox")}${i("primitiveUnits","userSpaceOnUse")}>${o}</filter>`}function j(n){let e="";for(let t of n){let r=t.state.filters;if(!r||r.length===0)continue;let s=r.filter(o=>o.enabled);if(s.length===0)continue;let a=`filter-${t.id}`;e+=xr(a,s)}return e}function Ge(n,e){return!e||e.length===0||e.filter(r=>r.enabled).length===0?"":` filter="url(#filter-${G(n)})"`}function oe(n,e,t,r){let s=r?.strokeWidth!=null?Math.max(.5,e*r.strokeWidth):Math.max(1,e/10);switch(n){case"stripes":return[{tag:"rect",attrs:{width:r?.strokeWidth!=null?Math.max(.01,Math.min(1,r.strokeWidth))*e:e/2,height:e,fill:t}}];case"dots":{let a=r?.dotRadius!=null?Math.max(.05,Math.min(.45,r.dotRadius)):.25;return[{tag:"circle",attrs:{cx:e/2,cy:e/2,r:e*a,fill:t}}]}case"grid":return[{tag:"path",attrs:{d:`M ${e} 0 L 0 0 0 ${e}`,fill:"none",stroke:t,"stroke-width":s}}];case"checkerboard":return[{tag:"rect",attrs:{width:e/2,height:e/2,fill:t}},{tag:"rect",attrs:{x:e/2,y:e/2,width:e/2,height:e/2,fill:t}}];case"diagonal":{let a=r?.strokeWidth!=null?Math.max(.5,e*r.strokeWidth):Math.max(1,e/5);return[{tag:"path",attrs:{d:`M 0 ${e} L ${e} 0`,stroke:t,"stroke-width":a}}]}case"crosshatch":return[{tag:"path",attrs:{d:`M 0 ${e} L ${e} 0 M 0 0 L ${e} ${e}`,stroke:t,"stroke-width":s}}];case"zigzag":{let a=r?.amplitude!=null?Math.max(.05,Math.min(.5,r.amplitude)):.25,o=e*a;return[{tag:"path",attrs:{d:`M 0 ${o} L ${e/4} 0 L ${e/2} ${o} L ${e*3/4} 0 L ${e} ${o}`,fill:"none",stroke:t,"stroke-width":s}}]}case"waves":{let a=r?.amplitude!=null?Math.max(.05,Math.min(.5,r.amplitude)):.25,o=e*a,l=e/2;return[{tag:"path",attrs:{d:`M 0 ${l} Q ${e/4} ${l-o} ${e/2} ${l} T ${e} ${l}`,fill:"none",stroke:t,"stroke-width":s}}]}case"triangles":{let a=e*.866;return[{tag:"path",attrs:{d:`M ${e/2} 0 L ${e} ${a} L 0 ${a} Z`,fill:"none",stroke:t,"stroke-width":s}}]}case"hexagons":{let a=e*.866;return[{tag:"path",attrs:{d:`M ${e*.25} 0 L ${e*.75} 0 L ${e} ${a*.5} L ${e*.75} ${a} L ${e*.25} ${a} L 0 ${a*.5} Z`,fill:"none",stroke:t,"stroke-width":s}}]}case"diamonds":return[{tag:"path",attrs:{d:`M ${e/2} 0 L ${e} ${e/2} L ${e/2} ${e} L 0 ${e/2} Z`,fill:"none",stroke:t,"stroke-width":s}}];case"circles":return[{tag:"circle",attrs:{cx:e/2,cy:e/2,r:e/3,fill:"none",stroke:t,"stroke-width":s}}];case"bricks":{let a=r?.strokeWidth!=null?Math.max(.5,e*r.strokeWidth):Math.max(1,e/15);return[{tag:"rect",attrs:{x:0,y:0,width:e,height:e/2,fill:"none",stroke:t,"stroke-width":a}},{tag:"rect",attrs:{x:-e/2,y:e/2,width:e,height:e/2,fill:"none",stroke:t,"stroke-width":a}},{tag:"rect",attrs:{x:e/2,y:e/2,width:e,height:e/2,fill:"none",stroke:t,"stroke-width":a}}]}case"herringbone":return[{tag:"path",attrs:{d:`M 0 0 L ${e/2} ${e/2} L 0 ${e} M ${e/2} ${e/2} L ${e} 0 M ${e/2} ${e/2} L ${e} ${e}`,fill:"none",stroke:t,"stroke-width":s}}];default:return[]}}function Sr(n){let e=Object.entries(n.attrs).map(([t,r])=>` ${t}="${r}"`).join("");return`<${n.tag}${e}/>`}function De(n,e,t,r,s){let a=10*e,o="";o+=`<rect width="${a}" height="${a}" fill="${r}"/>`;let l=oe(n,a,t,s);for(let u of l)o+=Sr(u);return{svgContent:o,width:a,height:a}}var Be="0 0 10 10",Le=6,Ve=6;function Ne(){return[{id:"line-marker-arrow",refX:10,refY:5,element:{tag:"path",attrs:{d:"M 0 0 L 10 5 L 0 10 Z",fill:"context-stroke",stroke:"context-stroke"}}},{id:"line-marker-open-arrow",refX:10,refY:5,element:{tag:"path",attrs:{d:"M 0 0 L 10 5 L 0 10",fill:"none",stroke:"context-stroke","stroke-width":1.5,"stroke-linejoin":"round","stroke-linecap":"round"}}},{id:"line-marker-circle",refX:5,refY:5,element:{tag:"circle",attrs:{cx:5,cy:5,r:3.2,fill:"context-stroke",stroke:"context-stroke"}}},{id:"line-marker-diamond",refX:5,refY:5,element:{tag:"path",attrs:{d:"M 5 0 L 10 5 L 5 10 L 0 5 Z",fill:"context-stroke",stroke:"context-stroke"}}},{id:"line-marker-square",refX:5,refY:5,element:{tag:"rect",attrs:{x:1.5,y:1.5,width:7,height:7,fill:"context-stroke",stroke:"context-stroke"}}}]}function m(n,e){return e==null||e===""?"":` ${n}="${G(String(e))}"`}function q(n,e){let t=n.rotation??0,r=n.skewX??0,s=n.skewY??0,a=n.scaleX??1,o=n.scaleY??1;if(t===0&&r===0&&s===0&&a===1&&o===1)return null;let l=n.customPivot??e;if(!l)return null;let u=[];return u.push(`translate(${l.x}, ${l.y})`),t!==0&&u.push(`rotate(${t})`),(a!==1||o!==1)&&u.push(`scale(${a}, ${o})`),r!==0&&u.push(`skewX(${r})`),s!==0&&u.push(`skewY(${s})`),u.push(`translate(${-l.x}, ${-l.y})`),u.join(" ")}function _r(n,e,t){let r=n.rotation??0,s=n.skewX??0,a=n.skewY??0,o=n.scaleX??1,l=n.scaleY??1,u=n.customPivot??{x:e,y:t},c=[];return(r!==0||s!==0||a!==0||o!==1||l!==1)&&(c.push(`translate(${u.x}, ${u.y})`),r!==0&&c.push(`rotate(${r})`),(o!==1||l!==1)&&c.push(`scale(${o}, ${l})`),s!==0&&c.push(`skewX(${s})`),a!==0&&c.push(`skewY(${a})`),c.push(`translate(${-u.x}, ${-u.y})`)),c.push(`translate(${e}, ${t})`),c.join(" ")}function kr(n){if(typeof n=="string"){let r=n.trim();return r.length>0?r:void 0}if(!n||typeof n!="object")return;let e=n,t=[];return e.underline&&t.push("underline"),e.strikethrough&&t.push("line-through"),e.overline&&t.push("overline"),t.length>0?t.join(" "):void 0}function wr(n){if(typeof n.strokeDasharray=="string")return n.strokeDasharray;let e=n.lineStyle??"solid",t=n.dashLength??8,r=n.gapLength??4;return ne(e,t,r)}function Kt(n){let e=n.fillType;return e||(n.fillGradient?n.fillGradient.r!==void 0?"radial-gradient":"linear-gradient":n.linearGradient?"linear-gradient":n.radialGradient?"radial-gradient":"solid")}function Tr(n){return n.fillGradient??n.linearGradient??n.radialGradient??void 0}function H(n,e){let t=m("data-shape-id",e),r=Kt(n);r==="none"?t+=m("fill","none"):r==="linear-gradient"||r==="radial-gradient"?t+=m("fill",`url(#gradient-fill-${e})`):r==="pattern"?t+=m("fill",`url(#pattern-fill-${e})`):t+=m("fill",n.fillColor??"#000000");let s=n.opacity;s!==void 0&&s<1&&(t+=m("opacity",s));let a=n.fillOpacity;a!==void 0&&a<1&&(t+=m("fill-opacity",a));let o=n.fillRule;o&&o!=="nonzero"&&(t+=m("fill-rule",o));let l=n.strokeType??"solid";l==="none"?t+=m("stroke","none"):l==="linear-gradient"||l==="radial-gradient"?t+=m("stroke",`url(#gradient-stroke-${e})`):t+=m("stroke",n.borderColor??"none");let u=n.borderWidth;u!=null&&(t+=m("stroke-width",u));let c=n.strokeOpacity;c!==void 0&&c<1&&(t+=m("stroke-opacity",c));let p=wr(n);p&&(t+=m("stroke-dasharray",p),!n.strokeDasharray&&n.lineStyle==="dotted"&&(t+=m("stroke-linecap","round")));let d=n.dashOffset;d!==void 0&&d!==0&&(t+=m("stroke-dashoffset",d));let h=n.shapeRendering;h&&h!=="auto"&&(t+=m("shape-rendering",h)),t+=Ge(e,n.filters);let f=n.metadata;return f&&(f.role&&(t+=m("role",f.role)),f.ariaLabel&&(t+=m("aria-label",f.ariaLabel))),t}function vr(n){let e=n.metadata;if(!e)return"";let t="";return e.title&&(t+=`<title>${G(e.title)}</title>`),e.description&&(t+=`<desc>${G(e.description)}</desc>`),t}function Pr(n,e){let t=vr(e);if(!t)return n;let r=n.lastIndexOf("/>");if(r===-1){let o=n.indexOf(">");return o===-1?n:n.slice(0,o+1)+t+n.slice(o+1)}let s=n.match(/^<(\w+)/),a=s?s[1]:"g";return n.slice(0,r)+">"+t+`</${a}>`}function vt(n){let e="",t=n.startEndpoint,r=n.endEndpoint;return t&&t!=="none"&&(e+=m("marker-start",`url(#line-marker-${t})`)),r&&r!=="none"&&(e+=m("marker-end",`url(#line-marker-${r})`)),e}function Pt(n){let e=n.state,t=e.x??0,r=e.y??0,s=e.radius??50,a=q(e,{x:t,y:r});return`<circle${m("cx",t)}${m("cy",r)}${m("r",s)}${H(e,n.id)}${a?m("transform",a):""}/>`}function Mt(n){let e=n.state,t=e.cx??0,r=e.cy??0,s=e.rx??50,a=e.ry??30,o=q(e,{x:t,y:r});return`<ellipse${m("cx",t)}${m("cy",r)}${m("rx",s)}${m("ry",a)}${H(e,n.id)}${o?m("transform",o):""}/>`}function Ct(n){let e=n.state,t=e,r=e.x??0,s=e.y??0,a=e.width??100,o=e.height??100,l=e.cornerRadius??0,u=t.cornerShape??"round",c=t.cornerMode??"uniform",p={x:r+a/2,y:s+o/2},d=q(e,p);if(u!=="round"||c==="non-uniform"){let h=Ee(r,s,a,o,l,u,c,c==="non-uniform"?{radiusTL:t.cornerRadiusTL,radiusTR:t.cornerRadiusTR,radiusBR:t.cornerRadiusBR,radiusBL:t.cornerRadiusBL,shapeTL:t.cornerShapeTL,shapeTR:t.cornerShapeTR,shapeBR:t.cornerShapeBR,shapeBL:t.cornerShapeBL}:void 0);if(h)return`<path${m("d",h)}${H(e,n.id)}${d?m("transform",d):""}/>`}return`<rect${m("x",r)}${m("y",s)}${m("width",a)}${m("height",o)}${l>0?m("rx",l):""}${H(e,n.id)}${d?m("transform",d):""}/>`}function Rt(n){let e=n.state,t=e.x1??0,r=e.y1??0,s=e.x2??100,a=e.y2??100,o={x:(t+s)/2,y:(r+a)/2},l=q(e,o);return`<line${m("x1",t)}${m("y1",r)}${m("x2",s)}${m("y2",a)}${H(e,n.id)}${vt(e)}${l?m("transform",l):""}/>`}function At(n){let e=n.state,t=e.x??0,r=e.y??0,s=e.text??"",a=e.fontSize??16,o=e.fontFamily??"sans-serif",l=e.fontWeight??"normal",u=e.fontStyle??"normal",c=e.textAnchor??"start",p=kr(e.textDecoration),d=e.letterSpacing,f=q(e,{x:t,y:r}),y=m("x",t)+m("y",r);y+=m("font-size",a),y+=m("font-family",o),l!=="normal"&&(y+=m("font-weight",l)),u!=="normal"&&(y+=m("font-style",u)),c!=="start"&&(y+=m("text-anchor",c)),p&&(y+=m("text-decoration",p)),d&&(y+=m("letter-spacing",d));let g=e.textDirection;g&&g!=="ltr"&&(y+=m("direction",g));let b=e.unicodeBidi;b&&b!=="normal"&&(y+=m("unicode-bidi",b));let w=e.fontVariationSettings;if(w&&Object.keys(w).length>0){let x=Object.entries(w).map(([M,R])=>`'${M}' ${R}`).join(", ");y+=m("style",`font-variation-settings: ${x}`)}if(y+=H(e,n.id),f&&(y+=m("transform",f)),e.isTextPath&&e.textPathPoints){let x=e.textPathPoints,M=e.textPathStartOffset??0,R=e.textPathSide,E=`text-path-${n.id}`,$="";if(x.length>=2)if(R==="right"){let S=x[x.length-1];$=`M ${S.x} ${S.y}`;for(let v=x.length-1;v>0;v--){let A=x[v],P=x[v-1],F=A.handleIn??A,I=P.handleOut??P;$+=` C ${F.x} ${F.y}, ${I.x} ${I.y}, ${P.x} ${P.y}`}}else{$=`M ${x[0].x} ${x[0].y}`;for(let S=0;S<x.length-1;S++){let v=x[S],A=x[S+1],P=v.handleOut??v,F=A.handleIn??A;$+=` C ${P.x} ${P.y}, ${F.x} ${F.y}, ${A.x} ${A.y}`}}return`<defs><path id="${G(E)}"${m("d",$)} fill="none"/></defs><text${y}><textPath href="#${G(E)}"${m("startOffset",`${M}%`)}>${G(s)}</textPath></text>`}if(e.charOffsets&&Array.isArray(e.charOffsets)&&e.charOffsets.length>0){let x=Array.from(s),M=0,R=0,E="";for(let $=0;$<x.length;$++){let S=e.charOffsets[$]??{x:0,y:0,rotate:0},v=S.x-M,A=S.y-R,P=m("dx",v)+m("dy",A);S.rotate!==0&&(P+=m("rotate",S.rotate)),E+=`<tspan${P}>${G(x[$])}</tspan>`,M=S.x,R=S.y}return`<text${y}>${E}</text>`}return`<text${y}>${G(s)}</text>`}function Et(n){let e=n.state,t=e.splinePoints??[],r=e.splineCurveType??"CUBIC",s=e.splineClosed??!1,a=e.splineTension??.5,o=e.splineArcParams,l=Fe(t,r,s,a,o),u=t.length>0?e.customPivot??{x:t[0].x,y:t[0].y}:void 0,c=u?q(e,u):null;return`<path${m("d",l)}${H(e,n.id)}${vt(e)}${c?m("transform",c):""}/>`}function Ft(n){let e=n.state,t=e.polylinePoints??[],r=e.polylineClosed??!1,s=t.map(u=>`${u.x},${u.y}`).join(" "),a=t.length>0?e.customPivot??{x:t[0].x,y:t[0].y}:void 0,o=a?q(e,a):null;return`<${r?"polygon":"polyline"}${m("points",s)}${H(e,n.id)}${vt(e)}${o?m("transform",o):""}/>`}function It(n){let e=n.state,t=e.x??0,r=e.y??0,s=e.width??100,a=e.height??100,o=e.href??"",l=e.imageOpacity,u=e.preserveAspectRatio?"xMidYMid meet":"none",c={x:t+s/2,y:r+a/2},p=q(e,c);return`<image${m("x",t)}${m("y",r)}${m("width",s)}${m("height",a)}${m("href",o)}${m("preserveAspectRatio",u)}${l!==void 0&&l<1?m("opacity",l):""}${H(e,n.id)}${p?m("transform",p):""}/>`}function Ot(n){let e=n.state,t=e.cx??0,r=e.cy??0,s=e.radius??50,a=e.cornerRadius??0,o=e.shiftAngle??-90,l=e.fillRule??"nonzero",u=_r(e,t,r),c="";switch(n.type){case"triangle":c=U(ae(3,s,o),a,s);break;case"ngon":{let d=e.sides??6;c=U(ae(d,s,o),a,s);break}case"star":{let d=e.arms??5,h=e.innerRadiusPercent??50;c=U(_e(d,s,h,o),a,s);break}case"cross":{let d=e.armWidthPercent??40;c=U(ke(s,d,o),a,s);break}case"ring":{let d=e.innerRadiusPercent??50;c=Ce(s,d,l);break}case"spiral":{let d=e.turns??3,h=e.thicknessPercent??20,f=e.spiralDirection??1;c=Re(s,d,h,f,o);break}case"gear":{let d=e.teeth??8,h=e.toothDepthPercent??30,f=e.holeRadiusPercent??0;c=Ae(d,s,h,a,f,l,o);break}case"arrow":{let d=e.headWidthPercent??100,h=e.headLengthPercent??30,f=e.shaftWidthPercent??40;c=U(we(s,d,h,f,o),a,s);break}case"speechBubble":{let d=e.tailAngleDeg??45,h=e.tailLengthPercent??40,f=e.tailWidthPercent??25;c=U(Te(s,d,h,f,o),a,s);break}case"lightning":{let d=e.boltSegments??3,h=e.boltJaggednessPercent??40,f=e.boltWidthPercent??30;c=U(ve(s,d,h,f,o),a,s);break}case"heart":{let d=e.lobeRadiusPercent??50,h=e.cleftDepthPercent??25;c=Pe(s,d,h,o);break}case"cloud":{let d=e.cloudBumps??5,h=e.cloudPuffinessPercent??60;c=Me(s,d,h,o);break}default:return`<!-- unsupported polygon shape: ${G(n.type)} -->`}let p="";return(n.type==="ring"||n.type==="gear")&&(p=m("fill-rule",l)),`<path${m("d",c)}${p}${H(e,n.id)}${m("transform",u)}/>`}function L(n){let e;switch(n.type){case"circle":e=Pt(n);break;case"ellipse":e=Mt(n);break;case"rectangle":case"square":e=Ct(n);break;case"line":e=Rt(n);break;case"text":e=At(n);break;case"spline":e=Et(n);break;case"polyline":e=Ft(n);break;case"image":e=It(n);break;case"triangle":case"ngon":case"star":case"cross":case"ring":case"spiral":case"gear":case"arrow":case"speechBubble":case"lightning":case"heart":case"cloud":e=Ot(n);break;default:return`<!-- unsupported shape type: ${G(n.type)} -->`}return Pr(e,n.state)}function Z(n){let e="";for(let t of n){let r=t.state,s=Kt(r),a=Tr(r),o=r.strokeType??"solid";s==="linear-gradient"&&a&&(e+=Zt(`gradient-fill-${t.id}`,a)),s==="radial-gradient"&&a&&(e+=Qt(`gradient-fill-${t.id}`,a)),s==="pattern"&&a&&(e+=Mr(`pattern-fill-${t.id}`,a)),o==="linear-gradient"&&r.strokeGradient&&(e+=Zt(`gradient-stroke-${t.id}`,r.strokeGradient)),o==="radial-gradient"&&r.strokeGradient&&(e+=Qt(`gradient-stroke-${t.id}`,r.strokeGradient))}return e}function Zt(n,e){let t=(e.stops??[]).map(r=>{let s=`<stop${m("offset",`${r.offset*100}%`)}${m("stop-color",r.color)}`;return r.opacity!==void 0&&r.opacity<1&&(s+=m("stop-opacity",r.opacity)),s+="/>",s}).join("");return`<linearGradient${m("id",n)}${m("x1",`${e.x1*100}%`)}${m("y1",`${e.y1*100}%`)}${m("x2",`${e.x2*100}%`)}${m("y2",`${e.y2*100}%`)}${e.spreadMethod?m("spreadMethod",e.spreadMethod):""}>${t}</linearGradient>`}function Qt(n,e){let t=(e.stops??[]).map(o=>{let l=`<stop${m("offset",`${o.offset*100}%`)}${m("stop-color",o.color)}`;return o.opacity!==void 0&&o.opacity<1&&(l+=m("stop-opacity",o.opacity)),l+="/>",l}).join(""),r="",s=e.ry!==void 0&&e.ry!==e.r,a=!!e.rotation;if(s||a){let o=e.cx??.5,l=e.cy??.5,u=[];u.push(`translate(${o}, ${l})`),a&&u.push(`rotate(${e.rotation})`),s&&e.ry!==0&&u.push(`scale(1, ${e.ry/e.r})`),u.push(`translate(-${o}, -${l})`),r=m("gradientTransform",u.join(" "))}return`<radialGradient${m("id",n)}${m("cx",`${e.cx*100}%`)}${m("cy",`${e.cy*100}%`)}${m("fx",`${e.fx*100}%`)}${m("fy",`${e.fy*100}%`)}${m("r",`${e.r*100}%`)}${e.spreadMethod?m("spreadMethod",e.spreadMethod):""}${r}>${t}</radialGradient>`}function Mr(n,e){if(e.svgContent!=null){let l=e.width??10,u=e.height??10,c=e.patternUnits??"userSpaceOnUse",p=e.patternContentUnits,d=e.patternTransform,h=e.viewBox,f=e.preserveAspectRatio,y=e.x??0,g=e.y??0,b=`<pattern${m("id",n)}`;return b+=m("patternUnits",c),p&&(b+=m("patternContentUnits",p)),y&&(b+=m("x",y)),g&&(b+=m("y",g)),b+=m("width",l),b+=m("height",u),h&&(b+=m("viewBox",h)),f&&(b+=m("preserveAspectRatio",f)),d&&(b+=m("patternTransform",d)),b+=`>${e.svgContent}</pattern>`,b}let t=10*(e.scale??1),r=e.rotation??0,s=e.color||"#000000",a=e.backgroundColor||"#ffffff",o="";return o+=`<rect${m("width",t)}${m("height",t)}${m("fill",a)}/>`,o+=Cr(e.patternType,t,s),`<pattern${m("id",n)}${m("patternUnits","userSpaceOnUse")}${m("width",t)}${m("height",t)}${r?m("patternTransform",`rotate(${r})`):""}>${o}</pattern>`}function Cr(n,e,t){return oe(n,e,t).map(s=>{let a=Object.entries(s.attrs).map(([o,l])=>m(o,l)).join("");return`<${s.tag}${a}/>`}).join("")}function Q(n){let e=new Set;for(let s of n){let a=s.state,o=a.startEndpoint,l=a.endEndpoint;o&&o!=="none"&&e.add(o),l&&l!=="none"&&e.add(l)}if(e.size===0)return"";let t=Ne(),r="";for(let s of t){let a=s.id.replace("line-marker-","");if(!e.has(a))continue;let o=s.element,l=Object.entries(o.attrs).map(([c,p])=>m(c,p)).join(""),u=o.tag==="circle"||o.tag==="rect"?`<${o.tag}${l}/>`:`<${o.tag}${l}/>`;r+=`<marker${m("id",s.id)}${m("viewBox",Be)}${m("refX",s.refX)}${m("refY",s.refY)}${m("markerWidth",6)}${m("markerHeight",6)}${m("orient","auto-start-reverse")}>${u}</marker>`}return r}var Rr={x:"x",y:"y",cx:"cx",cy:"cy",x1:"x1",y1:"y1",x2:"x2",y2:"y2",posX:"x",posY:"y",radius:"r",r:"r",rx:"rx",ry:"ry",width:"width",height:"height",opacity:"opacity",fillOpacity:"fill-opacity",strokeOpacity:"stroke-opacity",fillColor:"fill",strokeColor:"stroke",strokeWidth:"stroke-width",borderWidth:"stroke-width",cornerRadius:"rx",fontSize:"font-size"},Ar=new Set(["rotation","skewX","skewY"]);function Er(n){let t=he[n];return t?t.join(" "):"0 0 1 1"}function Ue(n){return n.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Gt(n){return n.cycleDuration!==void 0&&n.cycleDuration>0?n.cycleDuration:n.keyframes.length===0?0:n.keyframes[n.keyframes.length-1].time}function Dt(n,e){let t=n.keyframes;if(t.length===0)return{values:[],keyTimes:[],keySplines:[]};let r=t.map(o=>String(o.value)),s=t.map(o=>e>0?(o.time/e).toFixed(4):"0"),a=[];for(let o=1;o<t.length;o++)a.push(Er(t[o].easing));return{values:r,keyTimes:s,keySplines:a}}function Bt(n){let e=n.beginTrigger;if(!e)return"0s";switch(e.type){case"time":return`${e.value}s`;case"event":return e.value;default:return"0s"}}function Lt(n){return n.cycleInfinite?"indefinite":n.cycleRepeats&&n.cycleRepeats>1?String(n.cycleRepeats):null}function Fr(n){let e=Rr[n.property];if(!e)return"";let t=Gt(n);if(t<=0)return"";let{values:r,keyTimes:s,keySplines:a}=Dt(n,t);if(r.length<2)return"";let o=`<animate attributeName="${Ue(e)}"`;o+=` values="${Ue(r.join(";"))}"`,o+=` keyTimes="${s.join(";")}"`,a.length>0&&a.some(u=>u!=="0 0 1 1")&&(o+=' calcMode="spline"',o+=` keySplines="${a.join(";")}"`),o+=` dur="${t}s"`,o+=` begin="${Bt(n)}"`;let l=Lt(n);return l&&(o+=` repeatCount="${l}"`),o+=' fill="freeze"',o+="/>",o}function Ir(n){let e;switch(n.property){case"rotation":e="rotate";break;case"skewX":e="skewX";break;case"skewY":e="skewY";break;default:return""}let t=Gt(n);if(t<=0)return"";let{values:r,keyTimes:s,keySplines:a}=Dt(n,t);if(r.length<2)return"";let o=e==="rotate"&&n.transformOrigin?r.map(c=>`${c} ${n.transformOrigin.x} ${n.transformOrigin.y}`):r,l='<animateTransform attributeName="transform"';l+=` type="${e}"`,l+=` values="${Ue(o.join(";"))}"`,l+=` keyTimes="${s.join(";")}"`,a.length>0&&a.some(c=>c!=="0 0 1 1")&&(l+=' calcMode="spline"',l+=` keySplines="${a.join(";")}"`),l+=` dur="${t}s"`,l+=` begin="${Bt(n)}"`;let u=Lt(n);return u&&(l+=` repeatCount="${u}"`),l+=` additive="${n.additive??"sum"}"`,l+=' fill="freeze"',l+="/>",l}function Or(n){if(!n.motionPath)return"";let e=Gt(n);if(e<=0)return"";let{keyTimes:t,keySplines:r}=Dt(n,e),s=n.keyframes.map(u=>{let c=typeof u.value=="number"?u.value:parseFloat(u.value);return Math.max(0,Math.min(1,c))}),a="<animateMotion";a+=` path="${Ue(n.motionPath)}"`,a+=` keyTimes="${t.join(";")}"`,a+=` keyPoints="${s.join(";")}"`,r.length>0&&r.some(u=>u!=="0 0 1 1")&&(a+=' calcMode="spline"',a+=` keySplines="${r.join(";")}"`),a+=` dur="${e}s"`,a+=` begin="${Bt(n)}"`;let o=Lt(n);o&&(a+=` repeatCount="${o}"`),a+=' fill="freeze"';let l=n.motionRotate??"auto";return a+=` rotate="${l}"`,a+="/>",a}function ze(n){let e=new Map;for(let t of n.tracks){if(!t.enabled||t.keyframes.length<2)continue;let r=[...t.keyframes].sort((o,l)=>o.time-l.time),s={...t,locked:t.locked??!1,keyframes:r.map(o=>({time:o.time,value:o.value,easing:o.easing}))},a="";if(t.property==="pathMotion"&&t.motionPath?a=Or(s):Ar.has(t.property)?a=Ir(s):a=Fr(s),a){let o=e.get(t.shapeId)??[];o.push(a),e.set(t.shapeId,o)}}return e}function re(n,e={}){let{xmlDeclaration:t=!0,backgroundColor:r,indent:s=!0,className:a}=e,o=n.viewboxes?.[0],l=e.width??o?.width??800,u=e.height??o?.height??600,c=e.viewBox??`0 0 ${l} ${u}`,p=s?`
7
+ `:"",d=s?" ":"",h=n.shapes??[],f=n.symbols??[],y=Z(h),g=Q(h),b=j(h),w=Vr(f,h),k=y.length>0||g.length>0||b.length>0||w.length>0,x="";k&&(x=`${p}${d}<defs>${p}`,y.length>0&&(x+=`${d}${d}${y}${p}`),g.length>0&&(x+=`${d}${d}${g}${p}`),b.length>0&&(x+=`${d}${d}${b}${p}`),w.length>0&&(x+=`${d}${d}${w}${p}`),x+=`${d}</defs>`);let M="";r&&(M=`${p}${d}<rect width="${l}" height="${u}" fill="${r}"/>`);let R=n.animationTimeline?ze(n.animationTimeline):null,E=h.map(S=>{let v=S.type==="symbol-instance"?Lr(S,f):L(S),A=R?.get(S.id);return A&&A.length>0&&(v=Nr(v,A,d)),`${d}${v}`}).join(p),$="";return t&&($+=`<?xml version="1.0" encoding="UTF-8"?>${p}`),$+='<svg xmlns="http://www.w3.org/2000/svg"',$+=` width="${l}" height="${u}"`,$+=` viewBox="${c}"`,a&&($+=` class="${a}"`),$+=">",$+=x,$+=M,h.length>0&&($+=`${p}${E}`),$+=`${p}</svg>${p}`,$}var Vt=n=>n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),Gr=n=>n.replace(/[^a-zA-Z0-9_-]/g,"_");function Jt(n){let e=n.state.symbolId??"",t=n.state.variantKey??"";return n.state.symbolOverrides&&Object.keys(n.state.symbolOverrides).length>0?`${e}--ovr-${n.id}`:t?`${e}--${Gr(t)}`:e}function Dr(n,e){return n.map(t=>{let r=e[t.id];return!r||Object.keys(r).length===0?t:{...t,state:{...t.state,...r}}})}function Br(n,e){return e?n.variants?.[e]??n.shapes:n.shapes}function Lr(n,e){let t=Jt(n),r=n.state.x??0,s=n.state.y??0,a=n.state.width??100,o=n.state.height??100;return`<use href="#${Vt(t)}" x="${r}" y="${s}" width="${a}" height="${o}"/>`}function Vr(n,e){if(n.length===0)return"";let t=new Map;for(let a of n)t.set(a.id,a);let r=new Map;for(let a of e){if(a.type!=="symbol-instance")continue;let o=a.state.symbolId??"",l=t.get(o);if(!l)continue;let u=Jt(a);if(r.has(u))continue;let c=Br(l,a.state.variantKey??""),p=a.state.symbolOverrides;p&&Object.keys(p).length>0&&(c=Dr(c,p)),r.set(u,{def:l,resolved:c})}if(r.size===0)return"";let s=[];for(let[a,{def:o,resolved:l}]of r){let u=l.map(c=>L(c)).join("");s.push(`<symbol id="${Vt(a)}" viewBox="${Vt(o.viewBox)}">${u}</symbol>`)}return s.join("")}function Nr(n,e,t){let r=e.join(""),s=n.lastIndexOf("/>");if(s!==-1){let o=n.match(/^<(\w+)/),l=o?o[1]:"g";return n.slice(0,s)+">"+r+`</${l}>`}let a=n.match(/<\/(\w+)>$/);if(a){let o=n.lastIndexOf(`</${a[1]}>`);return n.slice(0,o)+r+n.slice(o)}return n+r}function We(n,e){let t=W(n,e);return re(n,{width:t.width,height:t.height,xmlDeclaration:e.xmlDeclaration??!1,indent:!0})}function Ur(n){return n==="class"?"className":n==="for"?"htmlFor":n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function je(n){return n.replace(/\s([a-z][a-z-]*?)=/g,(e,t)=>t.startsWith("data-")||t.startsWith("aria-")?e:` ${Ur(t)}=`)}function He(n,e){let t=e.componentName??"SvgComponent",r=W(n,e),s=e.indent??" ",a=n.shapes??[],o=e.typescript??!1,l=Z(a),u=Q(a),c=j(a),p=l.length>0||u.length>0||c.length>0,d=a.map(f=>{let y=L(f);return`${s}${s}${s}${je(y)}`}),h=[];h.push("import React from 'react';"),h.push(""),o?(h.push(`interface ${t}Props {`),h.push(`${s}className?: string;`),h.push(`${s}style?: React.CSSProperties;`),h.push("}"),h.push(""),h.push(`const ${t}: React.FC<${t}Props> = ({ className, style }) => {`)):h.push(`const ${t} = ({ className, style }) => {`),h.push(`${s}return (`),h.push(`${s}${s}<svg xmlns="http://www.w3.org/2000/svg" width="${r.width}" height="${r.height}" viewBox="0 0 ${r.width} ${r.height}" className={className} style={style}>`),p&&(h.push(`${s}${s}${s}<defs>`),l.length>0&&h.push(`${s}${s}${s}${s}${je(l)}`),u.length>0&&h.push(`${s}${s}${s}${s}${je(u)}`),c.length>0&&h.push(`${s}${s}${s}${s}${je(c)}`),h.push(`${s}${s}${s}</defs>`));for(let f of d)h.push(f);return h.push(`${s}${s}</svg>`),h.push(`${s});`),h.push("};"),h.push(""),h.push(`export default ${t};`),h.push(""),h.join(`
8
+ `)}function Xe(n,e){let t=e.componentName??"SvgComponent",r=W(n,e),s=e.indent??" ",a=n.shapes??[],o=e.typescript??!1,l=Z(a),u=Q(a),c=j(a),p=l.length>0||u.length>0||c.length>0,d=a.map(f=>`${s}${s}${L(f)}`),h=[];h.push("<template>"),h.push(`${s}<svg xmlns="http://www.w3.org/2000/svg" width="${r.width}" height="${r.height}" viewBox="0 0 ${r.width} ${r.height}" :class="className" :style="style">`),p&&(h.push(`${s}${s}<defs>`),l.length>0&&h.push(`${s}${s}${s}${l}`),u.length>0&&h.push(`${s}${s}${s}${u}`),c.length>0&&h.push(`${s}${s}${s}${c}`),h.push(`${s}${s}</defs>`));for(let f of d)h.push(f);return h.push(`${s}</svg>`),h.push("</template>"),h.push(""),o?h.push('<script setup lang="ts">'):h.push("<script setup>"),h.push(`// ${t}`),o?(h.push("defineProps<{"),h.push(`${s}className?: string;`),h.push(`${s}style?: Record<string, string>;`),h.push("}>();")):(h.push("defineProps({"),h.push(`${s}className: { type: String, default: '' },`),h.push(`${s}style: { type: Object, default: () => ({}) },`),h.push("});")),h.push("</script>"),h.push(""),h.join(`
9
+ `)}var zr=new Set(["circle","ellipse","rectangle","square","line","text","image"]);function en(n){return n.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}function tn(n){return n.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}function Wr(n){if(!zr.has(n.type))return!0;let e=n.state.metadata;return!!(e?.title||e?.description||n.type==="text"&&n.state.isTextPath)}function Ye(n,e){let t=e.componentName??"createSvg",r=W(n,e),s=e.indent??" ",a=n.shapes??[],o=e.typescript??!1,l=[];l.push("import * as d3 from 'd3';"),l.push(""),o?l.push(`export function ${t}(container: string | HTMLElement): d3.Selection<SVGSVGElement, unknown, HTMLElement, unknown> {`):l.push(`export function ${t}(container) {`),l.push(`${s}const svg = d3.select(container)`),l.push(`${s}${s}.append('svg')`),l.push(`${s}${s}.attr('xmlns', 'http://www.w3.org/2000/svg')`),l.push(`${s}${s}.attr('width', ${r.width})`),l.push(`${s}${s}.attr('height', ${r.height})`),l.push(`${s}${s}.attr('viewBox', '0 0 ${r.width} ${r.height}');`),l.push("");let u=Z(a),c=Q(a),p=j(a),d=`${u}${c}${p}`;d.length>0&&(l.push(`${s}svg.append('defs').html(\`${tn(d)}\`);`),l.push(""));for(let h=0;h<a.length;h++){let f=a[h];if(l.push(`${s}// ${f.type}${f.state.metadata?.name?` \u2014 ${f.state.metadata.name}`:""}`),Wr(f)){l.push(`${s}svg.append('g').html(\`${tn(L(f))}\`);`),l.push("");continue}let y=Xt(f),g=Ie(f),b=`shape${h+1}`;l.push(`${s}const ${b} = svg.append('${y}')`);for(let[w,k]of g)l.push(`${s}${s}.attr('${w}', '${en(k)}')`);f.type==="text"&&f.state.text&&l.push(`${s}${s}.text('${en(f.state.text)}')`),l[l.length-1]=l[l.length-1]+";",l.push("")}return l.push(`${s}return svg;`),l.push("}"),l.push(""),l.join(`
10
+ `)}function nn(n,e){let t=n.state.metadata?.name;return t?t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""):`${n.type}-${e+1}`}var jr=new Set(["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-dasharray","stroke-linecap","opacity","transform","filter"]);function qe(n,e){let t=W(n,e),r=e.indent??" ",s=n.shapes??[],a=[];for(let u=0;u<s.length;u++){let c=s[u],p=nn(c,u),d=Ie(c),h=[];for(let[f,y]of d)jr.has(f)&&h.push(`${r}${f}: ${y};`);h.length>0&&a.push(`.${p} {
11
+ ${h.join(`
12
12
  `)}
13
- }`)}let o=[];for(let u=0;u<s.length;u++){let c=s[u],h=zt(c,u),p=F(c),d=p.indexOf(" ");d!==-1&&(p=p.slice(0,d)+` class="${h}"`+p.slice(d)),o.push(`${n}${p}`)}let l=[];l.push("<style>");for(let u of a)l.push(u);l.push("</style>"),l.push(""),l.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${t.width}" height="${t.height}" viewBox="0 0 ${t.width} ${t.height}">`);for(let u of o)l.push(u);return l.push("</svg>"),l.push(""),l.join(`
14
- `)}function Be(r,e){let t=An(r,e),n={...e};switch(n.format){case"svg":return Ee(t,n);case"react":return Ie(t,n);case"vue":return Oe(t,n);case"d3":return Ge(t,n);case"css":return De(t,n);default:throw new Error(`Unsupported code format: ${n.format}`)}}function An(r,e){return Array.isArray(r)?{shapes:r,viewboxes:[{id:"default",x:0,y:0,width:e.width??800,height:e.height??600}]}:r}var Le=class r{_snapshot;constructor(e={}){let{width:t=800,height:n=600,viewboxId:s}=e,a=Z(0,0,t,n,s);this._snapshot=ie({viewboxes:[a]})}static fromSnapshot(e){let t=new r;return t._snapshot=JSON.parse(JSON.stringify(e)),t}static fromJSON(e,t){let n=oe(e,t),s=new r;return s._snapshot=n,s}add(e){let t="build"in e&&typeof e.build=="function"?e.build():e;return this._snapshot.shapes.push(t),this}addAll(...e){for(let t of e)this.add(t);return this}remove(e){let t=this._snapshot.shapes.length;return this._snapshot.shapes=this._snapshot.shapes.filter(n=>n.id!==e),this._snapshot.shapes.length<t}get shapes(){return this._snapshot.shapes}findShape(e){return this._snapshot.shapes.find(t=>t.id===e)}size(e,t){return this._snapshot.viewboxes.length>0?(this._snapshot.viewboxes[0].width=e,this._snapshot.viewboxes[0].height=t):this._snapshot.viewboxes=[Z(0,0,e,t)],this}get width(){return this._snapshot.viewboxes[0]?.width??800}get height(){return this._snapshot.viewboxes[0]?.height??600}title(e){return this._ensureMetadata(),this._snapshot.documentMetadata.title=e,this}description(e){return this._ensureMetadata(),this._snapshot.documentMetadata.description=e,this}author(e){return this._ensureMetadata(),this._snapshot.documentMetadata.author=e,this}keywords(...e){return this._ensureMetadata(),this._snapshot.documentMetadata.keywords=e,this}license(e,t){return this._ensureMetadata(),this._snapshot.documentMetadata.license=e,t!==void 0&&(this._snapshot.documentMetadata.licenseUrl=t),this}language(e){return this._ensureMetadata(),this._snapshot.documentMetadata.language=e,this}customMetadata(e){return this._ensureMetadata(),this._snapshot.documentMetadata.customMetadata={...this._snapshot.documentMetadata.customMetadata,...e},this}get meta(){return this._snapshot.documentMetadata}defineSymbol(e,t,n){this._snapshot.symbols||(this._snapshot.symbols=[]);let s=$(),a=t.map(l=>"build"in l&&typeof l.build=="function"?l.build():l),o={id:s,name:e,viewBox:n?.viewBox??"0 0 100 100",shapes:a};return n?.groups&&(o.groups=n.groups),n?.thumbnail&&(o.thumbnail=n.thumbnail),this._snapshot.symbols.push(o),s}placeSymbolInstance(e,t,n,s,a){let o={id:$(),type:"symbol-instance",state:{symbolId:e,x:t,y:n,width:s??100,height:a??100}};return this._snapshot.shapes.push(o),this}removeSymbol(e){if(!this._snapshot.symbols)return!1;let t=this._snapshot.symbols.length;return this._snapshot.symbols=this._snapshot.symbols.filter(n=>n.id!==e),this._snapshot.symbols.length<t}get symbols(){return this._snapshot.symbols??[]}addClipGroup(e,t,n){this._snapshot.clipMaskGroups||(this._snapshot.clipMaskGroups=[]);let s=$(),a={id:s,type:"clip",clipShapeIds:e,contentShapeIds:t,parentId:null};return n?.clipPathUnits&&(a.clipPathUnits=n.clipPathUnits),n?.rawDefinition&&(a.rawDefinition=n.rawDefinition),this._snapshot.clipMaskGroups.push(a),s}addMaskGroup(e,t,n){this._snapshot.clipMaskGroups||(this._snapshot.clipMaskGroups=[]);let s=$(),a={id:s,type:"mask",clipShapeIds:e,contentShapeIds:t,parentId:null};return n?.maskUnits&&(a.maskUnits=n.maskUnits),n?.maskContentUnits&&(a.maskContentUnits=n.maskContentUnits),n?.maskBounds&&(a.maskBounds=n.maskBounds),n?.maskType&&(a.maskType=n.maskType),n?.rawDefinition&&(a.rawDefinition=n.rawDefinition),this._snapshot.clipMaskGroups.push(a),s}removeClipMaskGroup(e){if(!this._snapshot.clipMaskGroups)return!1;let t=this._snapshot.clipMaskGroups.length;return this._snapshot.clipMaskGroups=this._snapshot.clipMaskGroups.filter(n=>n.id!==e),this._snapshot.clipMaskGroups.length<t}addGuide(e,t,n){this._snapshot.guides||(this._snapshot.guides=[]);let s=$(),a={id:s,orientation:e,position:t,controlPointOffset:0};return n?.color&&(a.color=n.color),n?.opacity!==void 0&&(a.opacity=n.opacity),this._snapshot.guides.push(a),s}removeGuide(e){if(!this._snapshot.guides)return!1;let t=this._snapshot.guides.length;return this._snapshot.guides=this._snapshot.guides.filter(n=>n.id!==e),this._snapshot.guides.length<t}clearGuides(){return this._snapshot.guides=[],this}get guides(){return this._snapshot.guides??[]}addMeasurement(e,t,n){this._snapshot.measurements||(this._snapshot.measurements=[]);let s=$(),a={id:s,type:e,points:t,visible:n?.visible??!0,snapDivisions:n?.snapDivisions??1};return n?.color&&(a.color=n.color),n?.opacity!==void 0&&(a.opacity=n.opacity),this._snapshot.measurements.push(a),s}removeMeasurement(e){if(!this._snapshot.measurements)return!1;let t=this._snapshot.measurements.length;return this._snapshot.measurements=this._snapshot.measurements.filter(n=>n.id!==e),this._snapshot.measurements.length<t}get measurements(){return this._snapshot.measurements??[]}addCustomPattern(e,t,n,s){this._snapshot.customPatterns||(this._snapshot.customPatterns=[]);let a=$();return this._snapshot.customPatterns.push({id:a,name:e,svgContent:t,width:n,height:s}),a}removeCustomPattern(e){if(!this._snapshot.customPatterns)return!1;let t=this._snapshot.customPatterns.length;return this._snapshot.customPatterns=this._snapshot.customPatterns.filter(n=>n.id!==e),this._snapshot.customPatterns.length<t}get customPatterns(){return this._snapshot.customPatterns??[]}addGroup(e,t){this._snapshot.groups||(this._snapshot.groups=[]);let n=e??$();return this._snapshot.groups.push({id:n,parentId:t??null}),n}removeGroup(e){if(!this._snapshot.groups)return!1;let t=this._snapshot.groups.length;this._snapshot.groups=this._snapshot.groups.filter(n=>n.id!==e);for(let n of this._snapshot.shapes)n.state.groupId===e&&delete n.state.groupId;return this._snapshot.groups.length<t}moveToGroup(e,t){let n=this._snapshot.shapes.find(s=>s.id===e);return n&&(n.state.groupId=t),this}removeFromGroup(e){let t=this._snapshot.shapes.find(n=>n.id===e);return t&&delete t.state.groupId,this}bringToFront(e){let t=this._snapshot.shapes.findIndex(n=>n.id===e);if(t>=0){let[n]=this._snapshot.shapes.splice(t,1);this._snapshot.shapes.push(n)}return this}sendToBack(e){let t=this._snapshot.shapes.findIndex(n=>n.id===e);if(t>=0){let[n]=this._snapshot.shapes.splice(t,1);this._snapshot.shapes.unshift(n)}return this}reorder(e,t){let n=this._snapshot.shapes.findIndex(s=>s.id===e);if(n>=0){let[s]=this._snapshot.shapes.splice(n,1),a=Math.max(0,Math.min(t,this._snapshot.shapes.length));this._snapshot.shapes.splice(a,0,s)}return this}defineVariable(e,t,n,s){this._snapshot.templateVariables||(this._snapshot.templateVariables=[]);let a=this._snapshot.templateVariables.find(o=>o.name===e);if(a)a.type=t,a.defaultValue=n,s?.label!==void 0&&(a.label=s.label),s?.description!==void 0&&(a.description=s.description);else{let o={name:e,type:t,defaultValue:n};s?.label!==void 0&&(o.label=s.label),s?.description!==void 0&&(o.description=s.description),this._snapshot.templateVariables.push(o)}return this}removeVariable(e){return this._snapshot.templateVariables&&(this._snapshot.templateVariables=this._snapshot.templateVariables.filter(t=>t.name!==e)),this}get variables(){return this._snapshot.templateVariables??[]}inspectVariables(){return de(this._snapshot)}setTimeline(e){return"build"in e&&typeof e.build=="function"?this._snapshot.animationTimeline=e.build():this._snapshot.animationTimeline=e,this}clearTimeline(){return delete this._snapshot.animationTimeline,this}get timeline(){return this._snapshot.animationTimeline}toSVG(e){let{variables:t,...n}=e??{},s=he(this._snapshot,t);return Y(s,n)}toJSON(e){return ae(this._snapshot,e)}toSnapshot(){return JSON.parse(JSON.stringify(this._snapshot))}toCode(e,t){return Be(this._snapshot,{...t,format:e})}_ensureMetadata(){this._snapshot.documentMetadata||(this._snapshot.documentMetadata={title:"",description:"",author:"",keywords:[],license:"",licenseUrl:"",language:"en",customMetadata:{}})}};var Ve=class{_track;constructor(e,t){this._track={id:$(),shapeId:e,property:t,keyframes:[],enabled:!0,locked:!1}}id(e){return this._track.id=e,this}keyframe(e,t,n="linear"){return this._track.keyframes.push({time:e,value:t,easing:n}),this}keyframeBezier(e,t,n){return this._track.keyframes.push({time:e,value:t,easing:"custom-bezier",customBezier:n}),this}keyframeLinear(e,t,n){return this._track.keyframes.push({time:e,value:t,easing:"linear-function",linearPoints:n}),this}keyframes(...e){return this._track.keyframes.push(...e),this}disabled(){return this._track.enabled=!1,this}locked(){return this._track.locked=!0,this}motionPath(e){return this._track.motionPath=e,this}beginTrigger(e,t){return this._track.beginTrigger={type:e,value:t},this}endTrigger(e,t){return this._track.endTrigger={type:e,value:t},this}cycleDuration(e){return this._track.cycleDuration=e,this}cycleRepeats(e){return this._track.cycleRepeats=e,this}infinite(){return this._track.cycleInfinite=!0,this}cycle(e){return this._track.cycleBehavior=e,this}transformOrigin(e,t){return this._track.transformOrigin={x:e,y:t},this}motionRotate(e){return this._track.motionRotate=e,this}additive(e){return this._track.additive=e,this}build(){let e=[...this._track.keyframes].sort((t,n)=>t.time-n.time);return{...this._track,keyframes:e}}},Ne=class{_duration;_loop=!1;_playbackSpeed=1;_tracks=[];constructor(e){this._duration=e}loop(e=!0){return this._loop=e,this}speed(e){return this._playbackSpeed=e,this}duration(e){return this._duration=e,this}addTrack(e){return this._tracks.push(e),this}addTracks(...e){return this._tracks.push(...e),this}buildTimeline(){return{duration:this._duration,loop:this._loop,playbackSpeed:this._playbackSpeed,tracks:this._tracks.map(e=>e.build())}}build(){let e=this.buildTimeline();return{duration:e.duration,loop:e.loop,playbackSpeed:e.playbackSpeed,tracks:e.tracks.map(t=>({id:t.id,shapeId:t.shapeId,property:t.property,enabled:t.enabled,locked:t.locked||void 0,motionPath:t.motionPath,beginTrigger:t.beginTrigger,endTrigger:t.endTrigger,cycleDuration:t.cycleDuration,cycleRepeats:t.cycleRepeats,cycleInfinite:t.cycleInfinite,cycleBehavior:t.cycleBehavior,transformOrigin:t.transformOrigin,motionRotate:t.motionRotate,additive:t.additive,keyframes:t.keyframes.map(n=>({time:n.time,value:n.value,easing:n.easing,...n.customBezier?{customBezier:n.customBezier}:{},...n.linearPoints?{linearPoints:n.linearPoints}:{}}))}))}}};var C=class{_id;_type;_state={};constructor(e,t){this._type=e,this._id=t??$()}id(e){return this._id=e,this}locked(e=!0){return this._state.locked=e,this}visible(e=!0){return this._state.visible=e,this}fill(e,t){return this._state.fillColor=e,this._state.fillType="solid",t!==void 0&&(this._state.fillOpacity=t),this}noFill(){return this._state.fillType="none",this}fillGradient(e){let t="build"in e?e.build():e;return this._state.fillType=t.type,this._state.fillGradient=t,this}fillPattern(e){let t="build"in e?e.build():e;return this._state.fillType="pattern",this._state.fillGradient=t,this}fillOpacity(e){return this._state.fillOpacity=e,this}fillRule(e){return this._state.fillRule=e,this}stroke(e,t){return this._state.borderColor=e,t!==void 0&&(this._state.borderWidth=t),this}noStroke(){return this._state.borderColor="none",this._state.borderWidth=0,this}strokeWidth(e){return this._state.borderWidth=e,this}strokeOpacity(e){return this._state.strokeOpacity=e,this}strokeGradient(e){let t="build"in e?e.build():e;return this._state.strokeType=t.type,this._state.strokeGradient=t,this}strokePattern(e){let t="build"in e?e.build():e;return this._state.strokeType="pattern",this._state.strokeGradient=t,this}strokeLinejoin(e){return this._state.strokeLinejoin=e,this}strokeLinecap(e){return this._state.strokeLinecap=e,this}strokeMiterlimit(e){return this._state.strokeMiterlimit=e,this}dashOffset(e){return this._state.dashOffset=e,this}strokeDasharray(e){return this._state.strokeDasharray=e,this}dash(e,t,n){return this._state.lineStyle=e,e==="custom"&&(t!==void 0&&(this._state.dashLength=t),n!==void 0&&(this._state.gapLength=n)),this}opacity(e){return this._state.opacity=e,this}rotate(e){return this._state.rotation=e,this}skew(e,t){return this._state.skewX=e,this._state.skewY=t,this}scale(e,t){return this._state.scaleX=e,this._state.scaleY=t??e,this}pivot(e,t){return this._state.customPivot={x:e,y:t},this}filter(...e){let t=this._state.filters??[];return this._state.filters=[...t,...e],this}dropShadow(e={}){let t={id:`drop-shadow-${$()}`,type:"drop-shadow",enabled:!0,offsetX:e.offsetX??4,offsetY:e.offsetY??4,blurRadius:e.blurRadius??8,spread:e.spread??0,color:e.color??"#000000",opacity:e.opacity??.3};return this.filter(t)}innerShadow(e={}){let t={id:`inner-shadow-${$()}`,type:"inner-shadow",enabled:!0,offsetX:e.offsetX??2,offsetY:e.offsetY??2,blurRadius:e.blurRadius??4,choke:e.choke??0,color:e.color??"#000000",opacity:e.opacity??.5};return this.filter(t)}blur(e,t,n){let s=e??4,a=t??s,o={id:`gaussian-blur-${$()}`,type:"gaussian-blur",enabled:!0,blurX:s,blurY:a,linked:s===a,quality:n?.quality??"normal"};return this.filter(o)}glow(e={}){let t={id:`glow-${$()}`,type:"glow",enabled:!0,color:e.color??"#ffffff",radius:e.radius??10,intensity:e.intensity??.8};return this.filter(t)}innerGlow(e={}){let t={id:`inner-glow-${$()}`,type:"inner-glow",enabled:!0,color:e.color??"#ffffff",radius:e.radius??10,intensity:e.intensity??.8};return this.filter(t)}grayscale(e=1){let t={id:`grayscale-${$()}`,type:"grayscale",enabled:!0,amount:e};return this.filter(t)}sepia(e=1){let t={id:`sepia-${$()}`,type:"sepia",enabled:!0,amount:e};return this.filter(t)}outline(e={}){return this.filter({id:`outline-${$()}`,type:"outline",enabled:!0,width:e.width??3,color:e.color??"#000000",opacity:e.opacity??1,position:e.position??"outside"})}motionBlur(e={}){let t={id:`motion-blur-${$()}`,type:"motion-blur",enabled:!0,distance:e.distance??10,angle:e.angle??0,quality:e.quality??"normal"};return this.filter(t)}pointLight(e={}){let t={id:`point-light-${$()}`,type:"point-light",enabled:!0,x:e.x??100,y:e.y??100,z:e.z??200,color:e.color??"#ffffff",surfaceScale:e.surfaceScale??5,diffuseConstant:e.diffuseConstant??1,specularConstant:e.specularConstant??1,specularExponent:e.specularExponent??20};return this.filter(t)}spotLight(e={}){let t={id:`spot-light-${$()}`,type:"spot-light",enabled:!0,x:e.x??100,y:e.y??0,z:e.z??200,pointsAtX:e.pointsAtX??100,pointsAtY:e.pointsAtY??100,pointsAtZ:e.pointsAtZ??0,coneAngle:e.coneAngle??30,color:e.color??"#ffffff",surfaceScale:e.surfaceScale??5,specularConstant:e.specularConstant??1,specularExponent:e.specularExponent??20};return this.filter(t)}sharpen(e=1){let t={id:`sharpen-${$()}`,type:"sharpen",enabled:!0,amount:e};return this.filter(t)}pixelate(e=8){let t={id:`pixelate-${$()}`,type:"pixelate",enabled:!0,blockSize:e};return this.filter(t)}warp(e={}){let t={id:`warp-${$()}`,type:"warp",enabled:!0,scale:e.scale??10,frequency:e.frequency??.02,octaves:e.octaves??1,warpType:e.warpType??"turbulence"};return this.filter(t)}morphology(e={}){let t=e.radiusX??2,n=e.radiusY??t,s={id:`morphology-${$()}`,type:"morphology",enabled:!0,operator:e.operator??"dilate",radiusX:t,radiusY:n,linked:e.linked??t===n};return this.filter(s)}contouring(e={}){if((e.mode??"discrete")==="table"){let s={id:`contouring-table-${$()}`,type:"contouring-table",enabled:!0,levels:e.levels??4,contrast:e.contrast??1};return this.filter(s)}let n={id:`contouring-discrete-${$()}`,type:"contouring-discrete",enabled:!0,levels:e.levels??4};return this.filter(n)}roundEdges(e=4){let t={id:`round-edges-${$()}`,type:"round-edges",enabled:!0,radius:e};return this.filter(t)}channelPainter(e={}){let t={id:`channel-painter-${$()}`,type:"channel-painter",enabled:!0,red:e.red??1,green:e.green??1,blue:e.blue??1};return this.filter(t)}brightness(e=1){let t={id:`brightness-${$()}`,type:"brightness",enabled:!0,amount:e};return this.filter(t)}contrast(e=1){let t={id:`contrast-${$()}`,type:"contrast",enabled:!0,amount:e};return this.filter(t)}filterOpacity(e=1){let t={id:`opacity-${$()}`,type:"opacity",enabled:!0,amount:e};return this.filter(t)}invert(e=1){let t={id:`invert-${$()}`,type:"invert",enabled:!0,amount:e};return this.filter(t)}hueRotate(e=0){let t={id:`hue-rotate-${$()}`,type:"hue-rotate",enabled:!0,angle:e};return this.filter(t)}saturate(e=1){let t={id:`saturate-${$()}`,type:"saturate",enabled:!0,amount:e};return this.filter(t)}blackAndWhite(e=.5){let t={id:`black-and-white-${$()}`,type:"black-and-white",enabled:!0,threshold:e};return this.filter(t)}duotone(e={}){let t={id:`duotone-${$()}`,type:"duotone",enabled:!0,shadowColor:e.shadowColor??"#000000",highlightColor:e.highlightColor??"#ffffff"};return this.filter(t)}xray(e=1){let t={id:`xray-${$()}`,type:"xray",enabled:!0,intensity:e};return this.filter(t)}noise(e={}){let t={id:`noise-${$()}`,type:"noise",enabled:!0,amount:e.amount??.3,scale:e.scale??1};return this.filter(t)}emboss(e={}){let t={id:`emboss-${$()}`,type:"emboss",enabled:!0,strength:e.strength??1,angle:e.angle??135};return this.filter(t)}filmGrain(e={}){let t={id:`film-grain-${$()}`,type:"film-grain",enabled:!0,amount:e.amount??.3,size:e.size??1};return this.filter(t)}watercolor(e={}){let t={id:`watercolor-${$()}`,type:"watercolor",enabled:!0,wetness:e.wetness??.5,turbulence:e.turbulence??.5};return this.filter(t)}gouache(e={}){let t={id:`gouache-${$()}`,type:"gouache",enabled:!0,thickness:e.thickness??.5,texture:e.texture??.5};return this.filter(t)}inkBlot(e={}){let t={id:`ink-blot-${$()}`,type:"ink-blot",enabled:!0,spread:e.spread??.5,edges:e.edges??.5};return this.filter(t)}crumpledPlastic(e={}){let t={id:`crumpled-plastic-${$()}`,type:"crumpled-plastic",enabled:!0,wrinkles:e.wrinkles??.5,shine:e.shine??.5};return this.filter(t)}riddled(e={}){let t={id:`riddled-${$()}`,type:"riddled",enabled:!0,density:e.density??.5,size:e.size??1};return this.filter(t)}cssClipPath(e){return this._state.cssClipPath=e,this}cssMaskProperties(e){return this._state.cssMaskProperties=e,this}metadata(e){return this._state.metadata={...this._state.metadata,...e},this}group(e){return this._state.groupId=e,this}build(){return{id:this._id,type:this._type,state:{...this._state}}}},Ue=class extends C{constructor(e,t,n){if(n<0)throw new RangeError("Circle radius must be non-negative");super("circle"),this._state.x=e,this._state.y=t,this._state.radius=n}position(e,t){return this._state.x=e,this._state.y=t,this}radius(e){return this._state.radius=e,this}},ze=class extends C{constructor(e,t,n,s){if(n<0||s<0)throw new RangeError("Ellipse radii must be non-negative");super("ellipse"),this._state.cx=e,this._state.cy=t,this._state.rx=n,this._state.ry=s}position(e,t){return this._state.cx=e,this._state.cy=t,this}radii(e,t){return this._state.rx=e,this._state.ry=t,this}},je=class extends C{constructor(e,t,n,s){if(n<0||s<0)throw new RangeError("Rectangle dimensions must be non-negative");super("rectangle"),this._state.x=e,this._state.y=t,this._state.width=n,this._state.height=s}position(e,t){return this._state.x=e,this._state.y=t,this}size(e,t){return this._state.width=e,this._state.height=t,this}cornerRadius(e){return this._state.cornerRadius=e,this}},We=class extends C{constructor(e,t,n){if(n<0)throw new RangeError("Square size must be non-negative");super("square"),this._state.x=e,this._state.y=t,this._state.width=n,this._state.height=n}position(e,t){return this._state.x=e,this._state.y=t,this}size(e){return this._state.width=e,this._state.height=e,this}cornerRadius(e){return this._state.cornerRadius=e,this}},He=class extends C{constructor(e,t,n,s){super("line"),this._state.x1=e,this._state.y1=t,this._state.x2=n,this._state.y2=s}from(e,t){return this._state.x1=e,this._state.y1=t,this}to(e,t){return this._state.x2=e,this._state.y2=t,this}markerStart(e){return this._state.startEndpoint=e,this}markerEnd(e){return this._state.endEndpoint=e,this}markers(e,t){return this._state.startEndpoint=e,this._state.endEndpoint=t,this}},Xe=class extends C{constructor(e,t,n){super("text"),this._state.x=e,this._state.y=t,this._state.text=n}position(e,t){return this._state.x=e,this._state.y=t,this}content(e){return this._state.text=e,this}fontSize(e){return this._state.fontSize=e,this}fontFamily(e){return this._state.fontFamily=e,this}fontWeight(e){return this._state.fontWeight=e,this}fontStyle(e){return this._state.fontStyle=e,this}anchor(e){return this._state.textAnchor=e,this}letterSpacing(e){return this._state.letterSpacing=e,this}lineHeight(e){return this._state.lineHeight=e,this}decoration(e){return this._state.textDecoration=e,this}transform(e){return this._state.textTransform=e,this}textPath(e,t=0){return this._state.isTextPath=!0,this._state.textPathPoints=e,this._state.textPathStartOffset=t,this}textPathOffset(e){return this._state.textPathStartOffset=e,this}textPathSide(e){return this._state.textPathSide=e,this}direction(e){return this._state.textDirection=e,this}unicodeBidi(e){return this._state.unicodeBidi=e,this}dominantBaseline(e){return this._state.dominantBaseline=e,this}writingMode(e){return this._state.writingMode=e,this}wordSpacing(e){return this._state.wordSpacing=e,this}baselineShift(e){return this._state.baselineShift=e,this}inlineSize(e){return this._state.inlineSize=e,this}overflowWrap(e){return this._state.overflowWrap=e,this}whiteSpace(e){return this._state.whiteSpace=e,this}fontVariationSettings(e){return this._state.fontVariationSettings=e,this}charOffsets(e){return this._state.charOffsets=e,this}shapeInsideRef(e){return this._state.shapeInsideRef=e,this}shapePadding(e){return this._state.shapePadding=e,this}richTextData(e){return this._state.richTextData=e,this}},N=class extends C{constructor(e,t,n,s){super(e),this._state.cx=t,this._state.cy=n,this._state.radius=s}position(e,t){return this._state.cx=e,this._state.cy=t,this}radius(e){return this._state.radius=e,this}shiftAngle(e){return this._state.shiftAngle=e,this}cornerRadius(e){return this._state.cornerRadius=e,this}},Ye=class extends N{constructor(e,t,n){super("triangle",e,t,n)}},qe=class extends N{constructor(e,t,n,s=5){super("ngon",e,t,n),this._state.sides=s}sides(e){return this._state.sides=e,this}},Qe=class extends N{constructor(e,t,n){super("star",e,t,n),this._state.arms=5,this._state.innerRadiusPercent=40}arms(e){return this._state.arms=e,this}innerRadius(e){return this._state.innerRadiusPercent=e,this}},Ze=class extends N{constructor(e,t,n){super("cross",e,t,n),this._state.armWidthPercent=35}armWidth(e){return this._state.armWidthPercent=e,this}},Ke=class extends N{constructor(e,t,n){super("ring",e,t,n),this._state.innerRadiusPercent=60}innerRadius(e){return this._state.innerRadiusPercent=e,this}},Je=class extends N{constructor(e,t,n){super("spiral",e,t,n),this._state.turns=3,this._state.thicknessPercent=15,this._state.spiralDirection=1}turns(e){return this._state.turns=e,this}thickness(e){return this._state.thicknessPercent=e,this}direction(e){return this._state.spiralDirection=e,this}},et=class extends N{constructor(e,t,n){super("gear",e,t,n),this._state.teeth=8,this._state.toothDepthPercent=25}teeth(e){return this._state.teeth=e,this}toothDepth(e){return this._state.toothDepthPercent=e,this}holeRadius(e){return this._state.holeRadiusPercent=e,this}},tt=class extends N{constructor(e,t,n){super("arrow",e,t,n),this._state.headWidthPercent=100,this._state.headLengthPercent=35,this._state.shaftWidthPercent=35}headWidth(e){return this._state.headWidthPercent=e,this}headLength(e){return this._state.headLengthPercent=e,this}shaftWidth(e){return this._state.shaftWidthPercent=e,this}},rt=class extends C{constructor(e=[]){super("spline"),this._state.splinePoints=[...e],this._state.splineCurveType="cubic",this._state.splineClosed=!1}points(e){return this._state.splinePoints=[...e],this}addPoint(e,t){let n=this._state.splinePoints??[];return n.push({x:e,y:t}),this._state.splinePoints=n,this}curveType(e){return this._state.splineCurveType=e,this}closed(e=!0){return this._state.splineClosed=e,this}tension(e){return this._state.splineTension=e,this}arcParams(e){return this._state.splineArcParams=e,this}markerStart(e){return this._state.startEndpoint=e,this}markerEnd(e){return this._state.endEndpoint=e,this}markers(e,t){return this._state.startEndpoint=e,this._state.endEndpoint=t,this}},nt=class extends C{constructor(e=[]){super("polyline"),this._state.polylinePoints=[...e],this._state.polylineClosed=!1}points(e){return this._state.polylinePoints=[...e],this}addPoint(e,t){let n=this._state.polylinePoints??[];return n.push({x:e,y:t}),this._state.polylinePoints=n,this}closed(e=!0){return this._state.polylineClosed=e,this}markerStart(e){return this._state.startEndpoint=e,this}markerEnd(e){return this._state.endEndpoint=e,this}markers(e,t){return this._state.startEndpoint=e,this._state.endEndpoint=t,this}},st=class extends C{constructor(e,t,n,s,a){super("image"),this._state.x=e,this._state.y=t,this._state.width=n,this._state.height=s,this._state.href=a}position(e,t){return this._state.x=e,this._state.y=t,this}size(e,t){return this._state.width=e,this._state.height=t,this}src(e){return this._state.href=e,this}preserveAspectRatio(e){return this._state.preserveAspectRatio=e,this}};var ee=class{_x1;_y1;_x2;_y2;_stops=[];_spreadMethod="pad";_opacity=1;_id;constructor(e=0,t=0,n=1,s=0){this._x1=e,this._y1=t,this._x2=n,this._y2=s,this._id=$()}stop(e,t,n=1){return this._stops.push({offset:e,color:t,opacity:n}),this}direction(e,t,n,s){return this._x1=e,this._y1=t,this._x2=n,this._y2=s,this}spread(e){return this._spreadMethod=e,this}opacity(e){return this._opacity=e,this}build(){return{type:"linear-gradient",id:this._id,x1:this._x1,y1:this._y1,x2:this._x2,y2:this._y2,stops:[...this._stops],spreadMethod:this._spreadMethod,opacity:this._opacity}}},te=class{_cx=.5;_cy=.5;_fx=.5;_fy=.5;_r=.5;_ry=.5;_rotation=0;_stops=[];_spreadMethod="pad";_opacity=1;_id;constructor(){this._id=$()}center(e,t){return this._cx=e,this._cy=t,this}focus(e,t){return this._fx=e,this._fy=t,this}radius(e,t){return this._r=e,this._ry=t??e,this}rotation(e){return this._rotation=e,this}stop(e,t,n=1){return this._stops.push({offset:e,color:t,opacity:n}),this}spread(e){return this._spreadMethod=e,this}opacity(e){return this._opacity=e,this}build(){return{type:"radial-gradient",id:this._id,cx:this._cx,cy:this._cy,fx:this._fx,fy:this._fy,r:this._r,ry:this._ry,rotation:this._rotation,stops:[...this._stops],spreadMethod:this._spreadMethod,opacity:this._opacity}}},re=class{_patternType;_color;_backgroundColor;_scale=1;_rotation=0;_opacity=1;_patternParams;_id;_svgContent;_width;_height;_patternUnits;_patternContentUnits;_patternTransform;_viewBox;_preserveAspectRatio;_x;_y;_customPatternId;constructor(e="stripes",t="#000000",n="#ffffff"){this._patternType=e,this._color=t,this._backgroundColor=n,this._id=$()}scale(e){return this._scale=e,this}rotation(e){return this._rotation=e,this}opacity(e){return this._opacity=e,this}params(e){return this._patternParams=e,this}svgContent(e){return this._svgContent=e,this}size(e,t){return this._width=e,this._height=t,this}patternUnits(e){return this._patternUnits=e,this}patternContentUnits(e){return this._patternContentUnits=e,this}patternTransform(e){return this._patternTransform=e,this}viewBox(e){return this._viewBox=e,this}preserveAspectRatio(e){return this._preserveAspectRatio=e,this}position(e,t){return this._x=e,this._y=t,this}customPatternId(e){return this._customPatternId=e,this}build(){let e,t,n;if(this._svgContent!==void 0)e=this._svgContent,t=this._width??10,n=this._height??10;else{let a=Te(this._patternType,this._scale,this._color,this._backgroundColor,this._patternParams);e=a.svgContent,t=this._width??a.width,n=this._height??a.height}let s={type:"pattern",id:this._id,patternType:this._svgContent!==void 0?"custom":this._patternType,color:this._color,backgroundColor:this._backgroundColor,scale:this._scale,rotation:this._rotation,opacity:this._opacity,svgContent:e,width:t,height:n,patternUnits:this._patternUnits??"userSpaceOnUse",patternParams:this._patternParams,patternTransform:this._patternTransform??(this._rotation?`rotate(${this._rotation})`:void 0)};return this._patternContentUnits&&(s.patternContentUnits=this._patternContentUnits),this._viewBox&&(s.viewBox=this._viewBox),this._preserveAspectRatio&&(s.preserveAspectRatio=this._preserveAspectRatio),this._x!==void 0&&(s.x=this._x),this._y!==void 0&&(s.y=this._y),this._customPatternId&&(s.customPatternId=this._customPatternId),s}};function jt(r=0,e=0,t=1,n=0){return new ee(r,e,t,n)}function Wt(){return new te}function Ht(r="stripes",e="#000000",t="#ffffff"){return new re(r,e,t)}0&&(module.exports={Arrow,CURRENT_SCHEMA_VERSION,Circle,Cross,Document,EASING_CURVES,EVENT_TRIGGER_OPTIONS,EasingType,Ellipse,Gear,ImageShape,Line,LinearGradientBuilder,MARKER_HEIGHT,MARKER_VIEWBOX,MARKER_WIDTH,MIGRATIONS,NGon,PatternBuilder,Polyline,RadialGradientBuilder,Rectangle,Ring,ShapeBuilder,Spiral,Spline,SplineCurveType,SplinePointType,Square,Star,Text,Timeline,Track,Triangle,computeArrowVertices,computeCrossVertices,computeDashArray,computeGearPath,computeGearVertices,computePolygonVertices,computeRectanglePath,computeRingPath,computeSpiralPath,computeSplinePath,computeStarVertices,createDocument,createShape,createViewbox,escXml,extractVariables,filterAttr,generateCode,generateCssCode,generateD3Code,generateId,generatePatternSvgContent,generateReactCode,generateSvgCode,generateVueCode,getEasingCubicBezier,getMarkerDescriptors,getPatternElements,linearGradient,migrateSnapshot,parseDocument,parseVariableArgs,pattern,radialGradient,renderAnimationElements,renderCircle,renderEllipse,renderFilterDefs,renderFilterPrimitivesForType,renderImage,renderLine,renderPolygonShape,renderPolyline,renderRectangle,renderShape,renderSpline,renderText,renderToSvg,stringifyDocument,substituteString,substituteVariables,validateSnapshot,verticesToPath});
13
+ }`)}let o=[];for(let u=0;u<s.length;u++){let c=s[u],p=nn(c,u),d=L(c),h=d.indexOf(" ");h!==-1&&(d=d.slice(0,h)+` class="${p}"`+d.slice(h)),o.push(`${r}${d}`)}let l=[];l.push("<style>");for(let u of a)l.push(u);l.push("</style>"),l.push(""),l.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${t.width}" height="${t.height}" viewBox="0 0 ${t.width} ${t.height}">`);for(let u of o)l.push(u);return l.push("</svg>"),l.push(""),l.join(`
14
+ `)}function Ze(n,e){let t=Hr(n,e),r={...e};switch(r.format){case"svg":return We(t,r);case"react":return He(t,r);case"vue":return Xe(t,r);case"d3":return Ye(t,r);case"css":return qe(t,r);default:throw new Error(`Unsupported code format: ${r.format}`)}}function Hr(n,e){return Array.isArray(n)?{shapes:n,viewboxes:[{id:"default",x:0,y:0,width:e.width??800,height:e.height??600}]}:n}var Qe=class n{_snapshot;constructor(e={}){let{width:t=800,height:r=600,viewboxId:s}=e,a=ie(0,0,t,r,s);this._snapshot=pe({viewboxes:[a]})}static fromSnapshot(e){let t=new n;return t._snapshot=JSON.parse(JSON.stringify(e)),t}static fromJSON(e,t){let r=fe(e,t),s=new n;return s._snapshot=r,s}add(e){let t="build"in e&&typeof e.build=="function"?e.build():e;return this._snapshot.shapes.push(t),this}addAll(...e){for(let t of e)this.add(t);return this}remove(e){let t=this._snapshot.shapes.length;return this._snapshot.shapes=this._snapshot.shapes.filter(r=>r.id!==e),this._snapshot.shapes.length<t}get shapes(){return this._snapshot.shapes}findShape(e){return this._snapshot.shapes.find(t=>t.id===e)}size(e,t){return this._snapshot.viewboxes.length>0?(this._snapshot.viewboxes[0].width=e,this._snapshot.viewboxes[0].height=t):this._snapshot.viewboxes=[ie(0,0,e,t)],this}get width(){return this._snapshot.viewboxes[0]?.width??800}get height(){return this._snapshot.viewboxes[0]?.height??600}title(e){return this._ensureMetadata(),this._snapshot.documentMetadata.title=e,this}description(e){return this._ensureMetadata(),this._snapshot.documentMetadata.description=e,this}author(e){return this._ensureMetadata(),this._snapshot.documentMetadata.author=e,this}keywords(...e){return this._ensureMetadata(),this._snapshot.documentMetadata.keywords=e,this}license(e,t){return this._ensureMetadata(),this._snapshot.documentMetadata.license=e,t!==void 0&&(this._snapshot.documentMetadata.licenseUrl=t),this}language(e){return this._ensureMetadata(),this._snapshot.documentMetadata.language=e,this}customMetadata(e){return this._ensureMetadata(),this._snapshot.documentMetadata.customMetadata={...this._snapshot.documentMetadata.customMetadata,...e},this}get meta(){return this._snapshot.documentMetadata}defineSymbol(e,t,r){this._snapshot.symbols||(this._snapshot.symbols=[]);let s=_(),a=t.map(l=>"build"in l&&typeof l.build=="function"?l.build():l),o={id:s,name:e,viewBox:r?.viewBox??"0 0 100 100",shapes:a};return r?.groups&&(o.groups=r.groups),r?.thumbnail&&(o.thumbnail=r.thumbnail),this._snapshot.symbols.push(o),s}placeSymbolInstance(e,t,r,s,a){let o={id:_(),type:"symbol-instance",state:{symbolId:e,x:t,y:r,width:s??100,height:a??100}};return this._snapshot.shapes.push(o),this}removeSymbol(e){if(!this._snapshot.symbols)return!1;let t=this._snapshot.symbols.length;return this._snapshot.symbols=this._snapshot.symbols.filter(r=>r.id!==e),this._snapshot.symbols.length<t}get symbols(){return this._snapshot.symbols??[]}addClipGroup(e,t,r){this._snapshot.clipMaskGroups||(this._snapshot.clipMaskGroups=[]);let s=_(),a={id:s,type:"clip",clipShapeIds:e,contentShapeIds:t,parentId:null};return r?.clipPathUnits&&(a.clipPathUnits=r.clipPathUnits),r?.rawDefinition&&(a.rawDefinition=r.rawDefinition),this._snapshot.clipMaskGroups.push(a),s}addMaskGroup(e,t,r){this._snapshot.clipMaskGroups||(this._snapshot.clipMaskGroups=[]);let s=_(),a={id:s,type:"mask",clipShapeIds:e,contentShapeIds:t,parentId:null};return r?.maskUnits&&(a.maskUnits=r.maskUnits),r?.maskContentUnits&&(a.maskContentUnits=r.maskContentUnits),r?.maskBounds&&(a.maskBounds=r.maskBounds),r?.maskType&&(a.maskType=r.maskType),r?.rawDefinition&&(a.rawDefinition=r.rawDefinition),this._snapshot.clipMaskGroups.push(a),s}removeClipMaskGroup(e){if(!this._snapshot.clipMaskGroups)return!1;let t=this._snapshot.clipMaskGroups.length;return this._snapshot.clipMaskGroups=this._snapshot.clipMaskGroups.filter(r=>r.id!==e),this._snapshot.clipMaskGroups.length<t}addGuide(e,t,r){this._snapshot.guides||(this._snapshot.guides=[]);let s=_(),a={id:s,orientation:e,position:t,controlPointOffset:0};return r?.color&&(a.color=r.color),r?.opacity!==void 0&&(a.opacity=r.opacity),this._snapshot.guides.push(a),s}removeGuide(e){if(!this._snapshot.guides)return!1;let t=this._snapshot.guides.length;return this._snapshot.guides=this._snapshot.guides.filter(r=>r.id!==e),this._snapshot.guides.length<t}clearGuides(){return this._snapshot.guides=[],this}get guides(){return this._snapshot.guides??[]}addMeasurement(e,t,r){this._snapshot.measurements||(this._snapshot.measurements=[]);let s=_(),a={id:s,type:e,points:t,visible:r?.visible??!0,snapDivisions:r?.snapDivisions??1};return r?.color&&(a.color=r.color),r?.opacity!==void 0&&(a.opacity=r.opacity),this._snapshot.measurements.push(a),s}removeMeasurement(e){if(!this._snapshot.measurements)return!1;let t=this._snapshot.measurements.length;return this._snapshot.measurements=this._snapshot.measurements.filter(r=>r.id!==e),this._snapshot.measurements.length<t}get measurements(){return this._snapshot.measurements??[]}addCustomPattern(e,t,r,s){this._snapshot.customPatterns||(this._snapshot.customPatterns=[]);let a=_();return this._snapshot.customPatterns.push({id:a,name:e,svgContent:t,width:r,height:s}),a}removeCustomPattern(e){if(!this._snapshot.customPatterns)return!1;let t=this._snapshot.customPatterns.length;return this._snapshot.customPatterns=this._snapshot.customPatterns.filter(r=>r.id!==e),this._snapshot.customPatterns.length<t}get customPatterns(){return this._snapshot.customPatterns??[]}addGroup(e,t){this._snapshot.groups||(this._snapshot.groups=[]);let r=e??_();return this._snapshot.groups.push({id:r,parentId:t??null}),r}removeGroup(e){if(!this._snapshot.groups)return!1;let t=this._snapshot.groups.length;this._snapshot.groups=this._snapshot.groups.filter(r=>r.id!==e);for(let r of this._snapshot.shapes)r.state.groupId===e&&delete r.state.groupId;return this._snapshot.groups.length<t}moveToGroup(e,t){let r=this._snapshot.shapes.find(s=>s.id===e);return r&&(r.state.groupId=t),this}removeFromGroup(e){let t=this._snapshot.shapes.find(r=>r.id===e);return t&&delete t.state.groupId,this}bringToFront(e){let t=this._snapshot.shapes.findIndex(r=>r.id===e);if(t>=0){let[r]=this._snapshot.shapes.splice(t,1);this._snapshot.shapes.push(r)}return this}sendToBack(e){let t=this._snapshot.shapes.findIndex(r=>r.id===e);if(t>=0){let[r]=this._snapshot.shapes.splice(t,1);this._snapshot.shapes.unshift(r)}return this}reorder(e,t){let r=this._snapshot.shapes.findIndex(s=>s.id===e);if(r>=0){let[s]=this._snapshot.shapes.splice(r,1),a=Math.max(0,Math.min(t,this._snapshot.shapes.length));this._snapshot.shapes.splice(a,0,s)}return this}defineVariable(e,t,r,s){this._snapshot.templateVariables||(this._snapshot.templateVariables=[]);let a=this._snapshot.templateVariables.find(o=>o.name===e);if(a)a.type=t,a.defaultValue=r,s?.label!==void 0&&(a.label=s.label),s?.description!==void 0&&(a.description=s.description);else{let o={name:e,type:t,defaultValue:r};s?.label!==void 0&&(o.label=s.label),s?.description!==void 0&&(o.description=s.description),this._snapshot.templateVariables.push(o)}return this}removeVariable(e){return this._snapshot.templateVariables&&(this._snapshot.templateVariables=this._snapshot.templateVariables.filter(t=>t.name!==e)),this}get variables(){return this._snapshot.templateVariables??[]}inspectVariables(){return xe(this._snapshot)}setTimeline(e){return"build"in e&&typeof e.build=="function"?this._snapshot.animationTimeline=e.build():this._snapshot.animationTimeline=e,this}clearTimeline(){return delete this._snapshot.animationTimeline,this}get timeline(){return this._snapshot.animationTimeline}toSVG(e){let{variables:t,...r}=e??{},s=be(this._snapshot,t);return re(s,r)}toJSON(e){return me(this._snapshot,e)}toSnapshot(){return JSON.parse(JSON.stringify(this._snapshot))}toCode(e,t){return Ze(this._snapshot,{...t,format:e})}_ensureMetadata(){this._snapshot.documentMetadata||(this._snapshot.documentMetadata={title:"",description:"",author:"",keywords:[],license:"",licenseUrl:"",language:"en",customMetadata:{}})}};var Ke=class{_track;constructor(e,t){this._track={id:_(),shapeId:e,property:t,keyframes:[],enabled:!0,locked:!1}}id(e){return this._track.id=e,this}keyframe(e,t,r="linear"){return this._track.keyframes.push({time:e,value:t,easing:r}),this}keyframeBezier(e,t,r){return this._track.keyframes.push({time:e,value:t,easing:"custom-bezier",customBezier:r}),this}keyframeLinear(e,t,r){return this._track.keyframes.push({time:e,value:t,easing:"linear-function",linearPoints:r}),this}keyframes(...e){return this._track.keyframes.push(...e),this}disabled(){return this._track.enabled=!1,this}locked(){return this._track.locked=!0,this}motionPath(e){return this._track.motionPath=e,this}beginTrigger(e,t){return this._track.beginTrigger={type:e,value:t},this}endTrigger(e,t){return this._track.endTrigger={type:e,value:t},this}cycleDuration(e){return this._track.cycleDuration=e,this}cycleRepeats(e){return this._track.cycleRepeats=e,this}infinite(){return this._track.cycleInfinite=!0,this}cycle(e){return this._track.cycleBehavior=e,this}transformOrigin(e,t){return this._track.transformOrigin={x:e,y:t},this}motionRotate(e){return this._track.motionRotate=e,this}additive(e){return this._track.additive=e,this}build(){let e=[...this._track.keyframes].sort((t,r)=>t.time-r.time);return{...this._track,keyframes:e}}},Je=class{_duration;_loop=!1;_playbackSpeed=1;_tracks=[];constructor(e){this._duration=e}loop(e=!0){return this._loop=e,this}speed(e){return this._playbackSpeed=e,this}duration(e){return this._duration=e,this}addTrack(e){return this._tracks.push(e),this}addTracks(...e){return this._tracks.push(...e),this}buildTimeline(){return{duration:this._duration,loop:this._loop,playbackSpeed:this._playbackSpeed,tracks:this._tracks.map(e=>e.build())}}build(){let e=this.buildTimeline();return{duration:e.duration,loop:e.loop,playbackSpeed:e.playbackSpeed,tracks:e.tracks.map(t=>({id:t.id,shapeId:t.shapeId,property:t.property,enabled:t.enabled,locked:t.locked||void 0,motionPath:t.motionPath,beginTrigger:t.beginTrigger,endTrigger:t.endTrigger,cycleDuration:t.cycleDuration,cycleRepeats:t.cycleRepeats,cycleInfinite:t.cycleInfinite,cycleBehavior:t.cycleBehavior,transformOrigin:t.transformOrigin,motionRotate:t.motionRotate,additive:t.additive,keyframes:t.keyframes.map(r=>({time:r.time,value:r.value,easing:r.easing,...r.customBezier?{customBezier:r.customBezier}:{},...r.linearPoints?{linearPoints:r.linearPoints}:{}}))}))}}};var D=class{_id;_type;_state={};constructor(e,t){this._type=e,this._id=t??_()}id(e){return this._id=e,this}locked(e=!0){return this._state.locked=e,this}visible(e=!0){return this._state.visible=e,this}fill(e,t){return this._state.fillColor=e,this._state.fillType="solid",t!==void 0&&(this._state.fillOpacity=t),this}noFill(){return this._state.fillType="none",this}fillGradient(e){let t="build"in e?e.build():e;return this._state.fillType=t.type,this._state.fillGradient=t,this}fillPattern(e){let t="build"in e?e.build():e;return this._state.fillType="pattern",this._state.fillGradient=t,this}fillOpacity(e){return this._state.fillOpacity=e,this}fillRule(e){return this._state.fillRule=e,this}stroke(e,t){return this._state.borderColor=e,t!==void 0&&(this._state.borderWidth=t),this}noStroke(){return this._state.borderColor="none",this._state.borderWidth=0,this}strokeWidth(e){return this._state.borderWidth=e,this}strokeOpacity(e){return this._state.strokeOpacity=e,this}strokeGradient(e){let t="build"in e?e.build():e;return this._state.strokeType=t.type,this._state.strokeGradient=t,this}strokePattern(e){let t="build"in e?e.build():e;return this._state.strokeType="pattern",this._state.strokeGradient=t,this}strokeLinejoin(e){return this._state.strokeLinejoin=e,this}strokeLinecap(e){return this._state.strokeLinecap=e,this}strokeMiterlimit(e){return this._state.strokeMiterlimit=e,this}dashOffset(e){return this._state.dashOffset=e,this}strokeDasharray(e){return this._state.strokeDasharray=e,this}dash(e,t,r){return this._state.lineStyle=e,e==="custom"&&(t!==void 0&&(this._state.dashLength=t),r!==void 0&&(this._state.gapLength=r)),this}opacity(e){return this._state.opacity=e,this}rotate(e){return this._state.rotation=e,this}skew(e,t){return this._state.skewX=e,this._state.skewY=t,this}scale(e,t){return this._state.scaleX=e,this._state.scaleY=t??e,this}pivot(e,t){return this._state.customPivot={x:e,y:t},this}filter(...e){let t=this._state.filters??[];return this._state.filters=[...t,...e],this}dropShadow(e={}){let t={id:`drop-shadow-${_()}`,type:"drop-shadow",enabled:!0,offsetX:e.offsetX??4,offsetY:e.offsetY??4,blurRadius:e.blurRadius??8,spread:e.spread??0,color:e.color??"#000000",opacity:e.opacity??.3};return this.filter(t)}innerShadow(e={}){let t={id:`inner-shadow-${_()}`,type:"inner-shadow",enabled:!0,offsetX:e.offsetX??2,offsetY:e.offsetY??2,blurRadius:e.blurRadius??4,choke:e.choke??0,color:e.color??"#000000",opacity:e.opacity??.5};return this.filter(t)}blur(e,t,r){let s=e??4,a=t??s,o={id:`gaussian-blur-${_()}`,type:"gaussian-blur",enabled:!0,blurX:s,blurY:a,linked:s===a,quality:r?.quality??"normal"};return this.filter(o)}glow(e={}){let t={id:`glow-${_()}`,type:"glow",enabled:!0,color:e.color??"#ffffff",radius:e.radius??10,intensity:e.intensity??.8};return this.filter(t)}innerGlow(e={}){let t={id:`inner-glow-${_()}`,type:"inner-glow",enabled:!0,color:e.color??"#ffffff",radius:e.radius??10,intensity:e.intensity??.8};return this.filter(t)}grayscale(e=1){let t={id:`grayscale-${_()}`,type:"grayscale",enabled:!0,amount:e};return this.filter(t)}sepia(e=1){let t={id:`sepia-${_()}`,type:"sepia",enabled:!0,amount:e};return this.filter(t)}outline(e={}){return this.filter({id:`outline-${_()}`,type:"outline",enabled:!0,width:e.width??3,color:e.color??"#000000",opacity:e.opacity??1,position:e.position??"outside"})}motionBlur(e={}){let t={id:`motion-blur-${_()}`,type:"motion-blur",enabled:!0,distance:e.distance??10,angle:e.angle??0,quality:e.quality??"normal"};return this.filter(t)}pointLight(e={}){let t={id:`point-light-${_()}`,type:"point-light",enabled:!0,x:e.x??100,y:e.y??100,z:e.z??200,color:e.color??"#ffffff",surfaceScale:e.surfaceScale??5,diffuseConstant:e.diffuseConstant??1,specularConstant:e.specularConstant??1,specularExponent:e.specularExponent??20};return this.filter(t)}spotLight(e={}){let t={id:`spot-light-${_()}`,type:"spot-light",enabled:!0,x:e.x??100,y:e.y??0,z:e.z??200,pointsAtX:e.pointsAtX??100,pointsAtY:e.pointsAtY??100,pointsAtZ:e.pointsAtZ??0,coneAngle:e.coneAngle??30,color:e.color??"#ffffff",surfaceScale:e.surfaceScale??5,specularConstant:e.specularConstant??1,specularExponent:e.specularExponent??20};return this.filter(t)}sharpen(e=1){let t={id:`sharpen-${_()}`,type:"sharpen",enabled:!0,amount:e};return this.filter(t)}pixelate(e=8){let t={id:`pixelate-${_()}`,type:"pixelate",enabled:!0,blockSize:e};return this.filter(t)}warp(e={}){let t={id:`warp-${_()}`,type:"warp",enabled:!0,scale:e.scale??10,frequency:e.frequency??.02,octaves:e.octaves??1,warpType:e.warpType??"turbulence"};return this.filter(t)}morphology(e={}){let t=e.radiusX??2,r=e.radiusY??t,s={id:`morphology-${_()}`,type:"morphology",enabled:!0,operator:e.operator??"dilate",radiusX:t,radiusY:r,linked:e.linked??t===r};return this.filter(s)}contouring(e={}){if((e.mode??"discrete")==="table"){let s={id:`contouring-table-${_()}`,type:"contouring-table",enabled:!0,levels:e.levels??4,contrast:e.contrast??1};return this.filter(s)}let r={id:`contouring-discrete-${_()}`,type:"contouring-discrete",enabled:!0,levels:e.levels??4};return this.filter(r)}roundEdges(e=4){let t={id:`round-edges-${_()}`,type:"round-edges",enabled:!0,radius:e};return this.filter(t)}channelPainter(e={}){let t={id:`channel-painter-${_()}`,type:"channel-painter",enabled:!0,red:e.red??1,green:e.green??1,blue:e.blue??1};return this.filter(t)}brightness(e=1){let t={id:`brightness-${_()}`,type:"brightness",enabled:!0,amount:e};return this.filter(t)}contrast(e=1){let t={id:`contrast-${_()}`,type:"contrast",enabled:!0,amount:e};return this.filter(t)}filterOpacity(e=1){let t={id:`opacity-${_()}`,type:"opacity",enabled:!0,amount:e};return this.filter(t)}invert(e=1){let t={id:`invert-${_()}`,type:"invert",enabled:!0,amount:e};return this.filter(t)}hueRotate(e=0){let t={id:`hue-rotate-${_()}`,type:"hue-rotate",enabled:!0,angle:e};return this.filter(t)}saturate(e=1){let t={id:`saturate-${_()}`,type:"saturate",enabled:!0,amount:e};return this.filter(t)}blackAndWhite(e=.5){let t={id:`black-and-white-${_()}`,type:"black-and-white",enabled:!0,threshold:e};return this.filter(t)}duotone(e={}){let t={id:`duotone-${_()}`,type:"duotone",enabled:!0,shadowColor:e.shadowColor??"#000000",highlightColor:e.highlightColor??"#ffffff"};return this.filter(t)}xray(e=1){let t={id:`xray-${_()}`,type:"xray",enabled:!0,intensity:e};return this.filter(t)}noise(e={}){let t={id:`noise-${_()}`,type:"noise",enabled:!0,amount:e.amount??.3,scale:e.scale??1};return this.filter(t)}emboss(e={}){let t={id:`emboss-${_()}`,type:"emboss",enabled:!0,strength:e.strength??1,angle:e.angle??135};return this.filter(t)}filmGrain(e={}){let t={id:`film-grain-${_()}`,type:"film-grain",enabled:!0,amount:e.amount??.3,size:e.size??1};return this.filter(t)}watercolor(e={}){let t={id:`watercolor-${_()}`,type:"watercolor",enabled:!0,wetness:e.wetness??.5,turbulence:e.turbulence??.5};return this.filter(t)}gouache(e={}){let t={id:`gouache-${_()}`,type:"gouache",enabled:!0,thickness:e.thickness??.5,texture:e.texture??.5};return this.filter(t)}inkBlot(e={}){let t={id:`ink-blot-${_()}`,type:"ink-blot",enabled:!0,spread:e.spread??.5,edges:e.edges??.5};return this.filter(t)}crumpledPlastic(e={}){let t={id:`crumpled-plastic-${_()}`,type:"crumpled-plastic",enabled:!0,wrinkles:e.wrinkles??.5,shine:e.shine??.5};return this.filter(t)}riddled(e={}){let t={id:`riddled-${_()}`,type:"riddled",enabled:!0,density:e.density??.5,size:e.size??1};return this.filter(t)}cssClipPath(e){return this._state.cssClipPath=e,this}cssMaskProperties(e){return this._state.cssMaskProperties=e,this}metadata(e){return this._state.metadata={...this._state.metadata,...e},this}group(e){return this._state.groupId=e,this}build(){return{id:this._id,type:this._type,state:{...this._state}}}},et=class extends D{constructor(e,t,r){if(r<0)throw new RangeError("Circle radius must be non-negative");super("circle"),this._state.x=e,this._state.y=t,this._state.radius=r}position(e,t){return this._state.x=e,this._state.y=t,this}radius(e){return this._state.radius=e,this}},tt=class extends D{constructor(e,t,r,s){if(r<0||s<0)throw new RangeError("Ellipse radii must be non-negative");super("ellipse"),this._state.cx=e,this._state.cy=t,this._state.rx=r,this._state.ry=s}position(e,t){return this._state.cx=e,this._state.cy=t,this}radii(e,t){return this._state.rx=e,this._state.ry=t,this}},nt=class extends D{constructor(e,t,r,s){if(r<0||s<0)throw new RangeError("Rectangle dimensions must be non-negative");super("rectangle"),this._state.x=e,this._state.y=t,this._state.width=r,this._state.height=s}position(e,t){return this._state.x=e,this._state.y=t,this}size(e,t){return this._state.width=e,this._state.height=t,this}cornerRadius(e){return this._state.cornerRadius=e,this}},rt=class extends D{constructor(e,t,r){if(r<0)throw new RangeError("Square size must be non-negative");super("square"),this._state.x=e,this._state.y=t,this._state.width=r,this._state.height=r}position(e,t){return this._state.x=e,this._state.y=t,this}size(e){return this._state.width=e,this._state.height=e,this}cornerRadius(e){return this._state.cornerRadius=e,this}},st=class extends D{constructor(e,t,r,s){super("line"),this._state.x1=e,this._state.y1=t,this._state.x2=r,this._state.y2=s}from(e,t){return this._state.x1=e,this._state.y1=t,this}to(e,t){return this._state.x2=e,this._state.y2=t,this}markerStart(e){return this._state.startEndpoint=e,this}markerEnd(e){return this._state.endEndpoint=e,this}markers(e,t){return this._state.startEndpoint=e,this._state.endEndpoint=t,this}},it=class extends D{constructor(e,t,r){super("text"),this._state.x=e,this._state.y=t,this._state.text=r}position(e,t){return this._state.x=e,this._state.y=t,this}content(e){return this._state.text=e,this}fontSize(e){return this._state.fontSize=e,this}fontFamily(e){return this._state.fontFamily=e,this}fontWeight(e){return this._state.fontWeight=e,this}fontStyle(e){return this._state.fontStyle=e,this}anchor(e){return this._state.textAnchor=e,this}letterSpacing(e){return this._state.letterSpacing=e,this}lineHeight(e){return this._state.lineHeight=e,this}decoration(e){return this._state.textDecoration=e,this}transform(e){return this._state.textTransform=e,this}textPath(e,t=0){return this._state.isTextPath=!0,this._state.textPathPoints=e,this._state.textPathStartOffset=t,this}textPathOffset(e){return this._state.textPathStartOffset=e,this}textPathSide(e){return this._state.textPathSide=e,this}direction(e){return this._state.textDirection=e,this}unicodeBidi(e){return this._state.unicodeBidi=e,this}dominantBaseline(e){return this._state.dominantBaseline=e,this}writingMode(e){return this._state.writingMode=e,this}wordSpacing(e){return this._state.wordSpacing=e,this}baselineShift(e){return this._state.baselineShift=e,this}inlineSize(e){return this._state.inlineSize=e,this}overflowWrap(e){return this._state.overflowWrap=e,this}whiteSpace(e){return this._state.whiteSpace=e,this}fontVariationSettings(e){return this._state.fontVariationSettings=e,this}charOffsets(e){return this._state.charOffsets=e,this}shapeInsideRef(e){return this._state.shapeInsideRef=e,this}shapePadding(e){return this._state.shapePadding=e,this}richTextData(e){return this._state.richTextData=e,this}},X=class extends D{constructor(e,t,r,s){super(e),this._state.cx=t,this._state.cy=r,this._state.radius=s}position(e,t){return this._state.cx=e,this._state.cy=t,this}radius(e){return this._state.radius=e,this}shiftAngle(e){return this._state.shiftAngle=e,this}cornerRadius(e){return this._state.cornerRadius=e,this}},at=class extends X{constructor(e,t,r){super("triangle",e,t,r)}},ot=class extends X{constructor(e,t,r,s=5){super("ngon",e,t,r),this._state.sides=s}sides(e){return this._state.sides=e,this}},lt=class extends X{constructor(e,t,r){super("star",e,t,r),this._state.arms=5,this._state.innerRadiusPercent=40}arms(e){return this._state.arms=e,this}innerRadius(e){return this._state.innerRadiusPercent=e,this}},ut=class extends X{constructor(e,t,r){super("cross",e,t,r),this._state.armWidthPercent=35}armWidth(e){return this._state.armWidthPercent=e,this}},ct=class extends X{constructor(e,t,r){super("ring",e,t,r),this._state.innerRadiusPercent=60}innerRadius(e){return this._state.innerRadiusPercent=e,this}},ht=class extends X{constructor(e,t,r){super("spiral",e,t,r),this._state.turns=3,this._state.thicknessPercent=15,this._state.spiralDirection=1}turns(e){return this._state.turns=e,this}thickness(e){return this._state.thicknessPercent=e,this}direction(e){return this._state.spiralDirection=e,this}},dt=class extends X{constructor(e,t,r){super("gear",e,t,r),this._state.teeth=8,this._state.toothDepthPercent=25}teeth(e){return this._state.teeth=e,this}toothDepth(e){return this._state.toothDepthPercent=e,this}holeRadius(e){return this._state.holeRadiusPercent=e,this}},pt=class extends X{constructor(e,t,r){super("arrow",e,t,r),this._state.headWidthPercent=100,this._state.headLengthPercent=35,this._state.shaftWidthPercent=35}headWidth(e){return this._state.headWidthPercent=e,this}headLength(e){return this._state.headLengthPercent=e,this}shaftWidth(e){return this._state.shaftWidthPercent=e,this}},mt=class extends D{constructor(e=[]){super("spline"),this._state.splinePoints=[...e],this._state.splineCurveType="cubic",this._state.splineClosed=!1}points(e){return this._state.splinePoints=[...e],this}addPoint(e,t){let r=this._state.splinePoints??[];return r.push({x:e,y:t}),this._state.splinePoints=r,this}curveType(e){return this._state.splineCurveType=e,this}closed(e=!0){return this._state.splineClosed=e,this}tension(e){return this._state.splineTension=e,this}arcParams(e){return this._state.splineArcParams=e,this}markerStart(e){return this._state.startEndpoint=e,this}markerEnd(e){return this._state.endEndpoint=e,this}markers(e,t){return this._state.startEndpoint=e,this._state.endEndpoint=t,this}},ft=class extends D{constructor(e=[]){super("polyline"),this._state.polylinePoints=[...e],this._state.polylineClosed=!1}points(e){return this._state.polylinePoints=[...e],this}addPoint(e,t){let r=this._state.polylinePoints??[];return r.push({x:e,y:t}),this._state.polylinePoints=r,this}closed(e=!0){return this._state.polylineClosed=e,this}markerStart(e){return this._state.startEndpoint=e,this}markerEnd(e){return this._state.endEndpoint=e,this}markers(e,t){return this._state.startEndpoint=e,this._state.endEndpoint=t,this}},gt=class extends D{constructor(e,t,r,s,a){super("image"),this._state.x=e,this._state.y=t,this._state.width=r,this._state.height=s,this._state.href=a}position(e,t){return this._state.x=e,this._state.y=t,this}size(e,t){return this._state.width=e,this._state.height=t,this}src(e){return this._state.href=e,this}preserveAspectRatio(e){return this._state.preserveAspectRatio=e,this}};var le=class{_x1;_y1;_x2;_y2;_stops=[];_spreadMethod="pad";_opacity=1;_id;constructor(e=0,t=0,r=1,s=0){this._x1=e,this._y1=t,this._x2=r,this._y2=s,this._id=_()}stop(e,t,r=1){return this._stops.push({offset:e,color:t,opacity:r}),this}direction(e,t,r,s){return this._x1=e,this._y1=t,this._x2=r,this._y2=s,this}spread(e){return this._spreadMethod=e,this}opacity(e){return this._opacity=e,this}build(){return{type:"linear-gradient",id:this._id,x1:this._x1,y1:this._y1,x2:this._x2,y2:this._y2,stops:[...this._stops],spreadMethod:this._spreadMethod,opacity:this._opacity}}},ue=class{_cx=.5;_cy=.5;_fx=.5;_fy=.5;_r=.5;_ry=.5;_rotation=0;_stops=[];_spreadMethod="pad";_opacity=1;_id;constructor(){this._id=_()}center(e,t){return this._cx=e,this._cy=t,this}focus(e,t){return this._fx=e,this._fy=t,this}radius(e,t){return this._r=e,this._ry=t??e,this}rotation(e){return this._rotation=e,this}stop(e,t,r=1){return this._stops.push({offset:e,color:t,opacity:r}),this}spread(e){return this._spreadMethod=e,this}opacity(e){return this._opacity=e,this}build(){return{type:"radial-gradient",id:this._id,cx:this._cx,cy:this._cy,fx:this._fx,fy:this._fy,r:this._r,ry:this._ry,rotation:this._rotation,stops:[...this._stops],spreadMethod:this._spreadMethod,opacity:this._opacity}}},ce=class{_patternType;_color;_backgroundColor;_scale=1;_rotation=0;_opacity=1;_patternParams;_id;_svgContent;_width;_height;_patternUnits;_patternContentUnits;_patternTransform;_viewBox;_preserveAspectRatio;_x;_y;_customPatternId;constructor(e="stripes",t="#000000",r="#ffffff"){this._patternType=e,this._color=t,this._backgroundColor=r,this._id=_()}scale(e){return this._scale=e,this}rotation(e){return this._rotation=e,this}opacity(e){return this._opacity=e,this}params(e){return this._patternParams=e,this}svgContent(e){return this._svgContent=e,this}size(e,t){return this._width=e,this._height=t,this}patternUnits(e){return this._patternUnits=e,this}patternContentUnits(e){return this._patternContentUnits=e,this}patternTransform(e){return this._patternTransform=e,this}viewBox(e){return this._viewBox=e,this}preserveAspectRatio(e){return this._preserveAspectRatio=e,this}position(e,t){return this._x=e,this._y=t,this}customPatternId(e){return this._customPatternId=e,this}build(){let e,t,r;if(this._svgContent!==void 0)e=this._svgContent,t=this._width??10,r=this._height??10;else{let a=De(this._patternType,this._scale,this._color,this._backgroundColor,this._patternParams);e=a.svgContent,t=this._width??a.width,r=this._height??a.height}let s={type:"pattern",id:this._id,patternType:this._svgContent!==void 0?"custom":this._patternType,color:this._color,backgroundColor:this._backgroundColor,scale:this._scale,rotation:this._rotation,opacity:this._opacity,svgContent:e,width:t,height:r,patternUnits:this._patternUnits??"userSpaceOnUse",patternParams:this._patternParams,patternTransform:this._patternTransform??(this._rotation?`rotate(${this._rotation})`:void 0)};return this._patternContentUnits&&(s.patternContentUnits=this._patternContentUnits),this._viewBox&&(s.viewBox=this._viewBox),this._preserveAspectRatio&&(s.preserveAspectRatio=this._preserveAspectRatio),this._x!==void 0&&(s.x=this._x),this._y!==void 0&&(s.y=this._y),this._customPatternId&&(s.customPatternId=this._customPatternId),s}};function rn(n=0,e=0,t=1,r=0){return new le(n,e,t,r)}function sn(){return new ue}function an(n="stripes",e="#000000",t="#ffffff"){return new ce(n,e,t)}0&&(module.exports={Arrow,CURRENT_SCHEMA_VERSION,Circle,Cross,Document,EASING_CURVES,EVENT_TRIGGER_OPTIONS,EasingType,Ellipse,Gear,ImageShape,Line,LinearGradientBuilder,MARKER_HEIGHT,MARKER_VIEWBOX,MARKER_WIDTH,MIGRATIONS,NGon,PatternBuilder,Polyline,RadialGradientBuilder,Rectangle,Ring,ShapeBuilder,Spiral,Spline,SplineCurveType,SplinePointType,Square,Star,Text,Timeline,Track,Triangle,computeArrowVertices,computeCloudPath,computeCrossVertices,computeDashArray,computeGearPath,computeGearVertices,computeHeartPath,computeLightningVertices,computePolygonVertices,computeRectanglePath,computeRingPath,computeSpeechBubbleVertices,computeSpiralPath,computeSplinePath,computeStarVertices,createDocument,createShape,createViewbox,escXml,extractVariables,filterAttr,generateCode,generateCssCode,generateD3Code,generateId,generatePatternSvgContent,generateReactCode,generateSvgCode,generateVueCode,getEasingCubicBezier,getMarkerDescriptors,getPatternElements,linearGradient,migrateSnapshot,parseDocument,parseVariableArgs,pattern,radialGradient,renderAnimationElements,renderCircle,renderEllipse,renderFilterDefs,renderFilterPrimitivesForType,renderImage,renderLine,renderPolygonShape,renderPolyline,renderRectangle,renderShape,renderSpline,renderText,renderToSvg,stringifyDocument,substituteString,substituteVariables,validateSnapshot,verticesToPath});