Socket
Socket
Sign inDemoInstall

satori

Package Overview
Dependencies
Maintainers
2
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

satori - npm Package Compare versions

Comparing version 0.0.32 to 0.0.33

LICENSE

8

dist/esm/index.js

@@ -1,5 +0,5 @@

import*as Mt from"yoga-layout-prebuilt";var dt=Mt;var $e;$e=dt.default;function Wt(e){$e=e}function ee(){return $e}function We(e){let t=typeof e;return!(t==="number"||t==="bigint"||t==="string"||t==="boolean")}function pt(e){return/^class\s/.test(Function.prototype.toString.call(e))}function gt(e){let t=typeof e>"u"?[]:[].concat(e).flat(1/0),n=[];for(let i=0;i<t.length;i++){let a=t[i];typeof a>"u"||typeof a=="boolean"||a===null||(typeof a=="number"&&(a=String(a)),typeof a=="string"&&n.length&&typeof n[n.length-1]=="string"?n[n.length-1]+=a:n.push(a))}return n}function pe(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function K(e,t,n){let i=t[e];return typeof i>"u"?n:i}var mt=void 0,Ne=typeof Intl<"u"&&"Segmenter"in Intl;if(!Ne)throw new Error("Intl.Segmenter does not exist, please use import a polyfill.");var Nt=Ne?new Intl.Segmenter(mt,{granularity:"word"}):null,Gt=Ne?new Intl.Segmenter(mt,{granularity:"grapheme"}):null,Re=[32,160,4961,65792,65793,4153,4241,10].map(e=>String.fromCodePoint(e));function ae(e,t){return t==="word"?[...Nt.segment(e)].map(n=>n.segment):[...Gt.segment(e)].map(n=>n.segment)}function y(e,t,n){let i="";for(let[a,o]of Object.entries(t))typeof o<"u"&&(i+=` ${a}="${o}"`);return n?`<${e}${i}>${n}</${e}>`:`<${e}${i}/>`}function ht(e=20){let t=new Map;function n(a,o){if(t.size>=e){let r=t.keys().next().value;t.delete(r)}t.set(a,o)}function i(a){if(!t.has(a))return;let r=t.get(a);return t.delete(a),t.set(a,r),r}return{set:n,get:i}}var bt={accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",allowReorder:"allowreorder",arabicForm:"arabic-form",attributeName:"attributename",attributeType:"attributetype",autoReverse:"autoreverse",baseFrequency:"basefrequency",baseProfile:"baseprofile",baselineShift:"baseline-shift",calcMode:"calcmode",capHeight:"cap-height",clipPath:"clip-path",clipPathUnits:"clippathunits",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentscripttype",contentStyleType:"contentstyletype",diffuseConstant:"diffuseconstant",dominantBaseline:"dominant-baseline",edgeMode:"edgemode",enableBackground:"enable-background",externalResourcesRequired:"externalresourcesrequired",fillOpacity:"fill-opacity",fillRule:"fill-rule",filterRes:"filterres",filterUnits:"filterunits",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphref",gradientTransform:"gradienttransform",gradientUnits:"gradientunits",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",kernelMatrix:"kernelmatrix",kernelUnitLength:"kernelunitlength",keyPoints:"keypoints",keySplines:"keysplines",keyTimes:"keytimes",lengthAdjust:"lengthadjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingconeangle",markerEnd:"marker-end",markerHeight:"markerheight",markerMid:"marker-mid",markerStart:"marker-start",markerUnits:"markerunits",markerWidth:"markerwidth",maskContentUnits:"maskcontentunits",maskUnits:"maskunits",numOctaves:"numoctaves",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathlength",patternContentUnits:"patterncontentunits",patternTransform:"patterntransform",patternUnits:"patternunits",pointerEvents:"pointer-events",pointsAtX:"pointsatx",pointsAtY:"pointsaty",pointsAtZ:"pointsatz",preserveAlpha:"preservealpha",preserveAspectRatio:"preserveaspectratio",primitiveUnits:"primitiveunits",refX:"refx",refY:"refy",renderingIntent:"rendering-intent",repeatCount:"repeatcount",repeatDur:"repeatdur",requiredExtensions:"requiredextensions",requiredFeatures:"requiredfeatures",shapeRendering:"shape-rendering",specularConstant:"specularconstant",specularExponent:"specularexponent",spreadMethod:"spreadmethod",startOffset:"startoffset",stdDeviation:"stddeviation",stitchTiles:"stitchtiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",suppressContentEditableWarning:"suppresscontenteditablewarning",suppressHydrationWarning:"suppresshydrationwarning",surfaceScale:"surfacescale",systemLanguage:"systemlanguage",tableValues:"tablevalues",targetX:"targetx",targetY:"targety",textAnchor:"text-anchor",textDecoration:"text-decoration",textLength:"textlength",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewbox",viewTarget:"viewtarget",wordSpacing:"word-spacing",writingMode:"writing-mode",xChannelSelector:"xchannelselector",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlLang:"xml:lang",xmlSpace:"xmlspace",xmlnsXlink:"xmlns:xlink",yChannelSelector:"ychannelselector",zoomAndPan:"zoomandpan"},Dt=/[\r\n%#()<>?[\\\]^`{|}"']/g;function Me(e){if(!e)return"";if(Array.isArray(e))return e.map(Me).join("");if(typeof e!="object")return String(e);let t=e.type;if(t==="text")throw new Error("<text> nodes are not currently supported, please convert them to <path>");let{children:n,...i}=e.props||{};return`<${t}${Object.entries(i).map(([a,o])=>` ${bt[a]||a}="${o}"`).join("")}>${Me(n)}</${t}>`}function yt(e){let{viewBox:t,viewbox:n,width:i,height:a,className:o,style:r,children:s,...l}=e.props||{};t||(t=n);let m=t.split(" ").map(p=>parseInt(p,10));return l.xmlns="http://www.w3.org/2000/svg",l.viewBox=t,l.width=m[2],l.height=m[3],`data:image/svg+xml;utf8,${`<svg${Object.entries(l).map(([p,d])=>` ${bt[p]||p}="${d}"`).join("")}>${Me(s)}</svg>`.replace(Dt,encodeURIComponent)}`}var xt={p:{display:"block",marginTop:"1em",marginBottom:"1em"},div:{display:"block"},blockquote:{display:"block",marginTop:"1em",marginBottom:"1em",marginLeft:40,marginRight:40},center:{display:"block",textAlign:"center"},hr:{display:"block",marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"auto",marginRight:"auto",borderWidth:1,borderStyle:"inset"},h1:{display:"block",fontSize:"2em",marginTop:"0.67em",marginBottom:"0.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h2:{display:"block",fontSize:"1.5em",marginTop:"0.83em",marginBottom:"0.83em",marginLeft:0,marginRight:0,fontWeight:"bold"},h3:{display:"block",fontSize:"1.17em",marginTop:"1em",marginBottom:"1em",marginLeft:0,marginRight:0,fontWeight:"bold"},h4:{display:"block",marginTop:"1.33em",marginBottom:"1.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},h5:{display:"block",fontSize:"0.83em",marginTop:"1.67em",marginBottom:"1.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h6:{display:"block",fontSize:"0.67em",marginTop:"2.33em",marginBottom:"2.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},u:{textDecoration:"underline"},strong:{fontWeight:"bold"},b:{fontWeight:"bold"},i:{fontStyle:"italic"},em:{fontStyle:"italic"},code:{fontFamily:"monospace"},kbd:{fontFamily:"monospace"},pre:{display:"block",fontFamily:"monospace",whiteSpace:"pre",marginTop:"1em",marginBottom:"1em"},mark:{backgroundColor:"yellow",color:"black"},big:{fontSize:"larger"},small:{fontSize:"smaller"},s:{textDecoration:"line-through"}};var Bt=new Set(["color","font","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","textAlign","textTransform","textShadowOffset","textShadowColor","textShadowRadius","textDecorationLine","textDecorationStyle","textDecorationColor","whiteSpace","transform","wordBreak","opacity","filter","_viewportWidth","_viewportHeight","_inheritedClipPathId","_inheritedBackgroundClipTextPath"]);function Ge(e){let t={};for(let n in e)Bt.has(n)&&(t[n]=e[n]);return t}import{getPropertyName as tn,getStylesForProperty as nn}from"css-to-react-native";import{parseElementStyle as rn}from"css-background-parser";var he=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ut=he((e,t)=>{t.exports=["em","ex","ch","rem","vh","vw","vmin","vmax","px","mm","cm","in","pt","pc","mozmm"]}),zt=he((e,t)=>{t.exports=["deg","grad","rad","turn"]}),Yt=he((e,t)=>{t.exports=["dpi","dpcm","dppx"]}),Ht=he((e,t)=>{t.exports=["Hz","kHz"]}),Xt=he((e,t)=>{t.exports=["s","ms"]}),jt=Ut(),wt=zt(),Et=Yt(),vt=Ht(),kt=Xt();function Be(e){if(/\.\D?$/.test(e))throw new Error("The dot should be followed by a number");if(/^[+-]{2}/.test(e))throw new Error("Only one leading +/- is allowed");if(Vt(e)>1)throw new Error("Only one dot is allowed");if(/%$/.test(e)){this.type="percentage",this.value=De(e),this.unit="%";return}var t=qt(e);if(!t){this.type="number",this.value=De(e);return}this.type=Zt(t),this.value=De(e.substr(0,e.length-t.length)),this.unit=t}Be.prototype.valueOf=function(){return this.value};Be.prototype.toString=function(){return this.value+(this.unit||"")};function se(e){return new Be(e)}function Vt(e){var t=e.match(/\./g);return t?t.length:0}function De(e){var t=parseFloat(e);if(isNaN(t))throw new Error("Invalid number: "+e);return t}var Jt=[].concat(wt,vt,jt,Et,kt);function qt(e){var t=e.match(/\D+$/),n=t&&t[0];if(n&&Jt.indexOf(n)===-1)throw new Error("Invalid unit: "+n);return n}var Kt=Object.assign(_e(wt,"angle"),_e(vt,"frequency"),_e(Et,"resolution"),_e(kt,"time"));function _e(e,t){return Object.fromEntries(e.map(n=>[n,t]))}function Zt(e){return Kt[e]||"length"}import Qt from"postcss-value-parser";function en(e,t){try{let n=new se(e);switch(n.unit){case"px":return{absolute:n.value};case"em":return{absolute:n.value*t};case"rem":return{absolute:n.value*16};case"%":return{relative:n.value};default:return{}}}catch{return{}}}function Ue(e,t,n){switch(e){case"top":return{yRelative:0};case"left":return{xRelative:0};case"right":return{xRelative:100};case"bottom":return{yRelative:100};case"center":return{};default:let i=en(e,t);return i.absolute?{[n?"xAbsolute":"yAbsolute"]:i.absolute}:i.relative?{[n?"xRelative":"yRelative"]:i.relative}:{}}}function ze(e,t){if(typeof e=="number")return{xAbsolute:e};let n;try{n=Qt(e).nodes.filter(i=>i.type==="word").map(i=>i.value)}catch{return{}}return n.length===1?Ue(n[0],t,!0):n.length===2?((n[0]==="top"||n[0]==="bottom"||n[1]==="left"||n[1]==="right")&&n.reverse(),{...Ue(n[0],t,!0),...Ue(n[1],t,!1)}):{}}var on=new Set(["flex","flexGrow","flexShrink","flexBasis","fontWeight","lineHeight","opacity","scale","scaleX","scaleY"]),an=new Set(["lineHeight"]),St=[1,0,0,1,0,0];function sn(e,t,n,i){return e==="border"&&!n.includes(t.borderColor)?t.borderColor=i:e==="borderColor"?t.borderColor=t.borderTopColor:e==="textDecoration"&&!n.includes(t.textDecorationColor)&&(t.textDecorationColor=i),t}function Tt(e,t){return typeof t=="number"?on.has(e)?an.has(e)?t:String(t):t+"px":t}function ln(e,t){return e==="lineHeight"?{lineHeight:Tt(e,t)}:e==="fontFamily"?{fontFamily:t.split(",").map(n=>n.trim().replace(/(^['"])|(['"]$)/g,"").toLocaleLowerCase())}:null}function Ye(e,t,n,{percentage:i}={percentage:!1}){if(typeof e=="number")return e;try{let a=new se(e);if(a.type==="length")switch(a.unit){case"em":return a.value*t;case"rem":return a.value*16;case"vw":return~~(a.value*n._viewportWidth/100);case"vh":return~~(a.value*n._viewportHeight/100);default:return a.value}else if(a.type==="angle")switch(a.unit){case"deg":return a.value;case"rad":return a.value*180/Math.PI;default:return a.value}else if(a.type==="percentage"&&i)return a.value/100*t}catch{}}function Ce(e,t){let n={};for(let a in e){if(a.startsWith("_")){n[a]=e[a];continue}let o=tn(a);Object.assign(n,ln(o,e[a])||sn(o,nn(o,Tt(o,e[a]),!0),e[a],e.color||t.color))}if(n.backgroundImage){let{backgrounds:a}=rn(n);n.backgroundImage=a}let i=typeof n.fontSize=="number"?n.fontSize:t.fontSize;if(typeof i=="string")try{let a=new se(i);switch(a.unit){case"em":i=a.value*t.fontSize;break;case"rem":i=a.value*16;break}}catch{i=16}typeof n.fontSize<"u"&&(n.fontSize=i),n.transformOrigin&&(n.transformOrigin=ze(n.transformOrigin,i));for(let a in n){let o=n[a];if(a==="lineHeight")typeof o=="string"&&(o=n[a]=Ye(o,i,t,{percentage:!0})/i);else if(typeof o=="string"){let r=Ye(o,i,t);typeof r<"u"&&(n[a]=r),o=n[a]}if(a==="opacity"&&(o=n[a]=o*t.opacity),a==="transform"){let r=[...St],s=o;for(let l of s){let m=Object.keys(l)[0],p=l[m],d=typeof p=="string"?Ye(p,i,t):p,g=[...St];switch(m){case"translateX":g[4]=d;break;case"translateY":g[5]=d;break;case"scale":g[0]=d,g[3]=d;break;case"scaleX":g[0]=d;break;case"scaleY":g[3]=d;break;case"rotate":let h=d*Math.PI/180,f=Math.cos(h),u=Math.sin(h);g[0]=f,g[1]=u,g[2]=-u,g[3]=f;break;case"skewX":g[2]=Math.tan(d*Math.PI/180);break;case"skewY":g[1]=Math.tan(d*Math.PI/180);break}r=pe(g,r)}n.transform=r}}return n}function He(e,t,n,i,a){let o=ee(),r={...n,...Ce(xt[t],n),...Ce(i,n)};if(t==="img"){let s=parseInt(a.width),m=parseInt(a.height)/s;r.width||(r.width=s),r.height||(r.height=m*r.width)}if(t==="svg"){let l=(a.viewBox||a.viewbox).split(" ").map(g=>parseInt(g,10)),m=l[3]/l[2],{width:p,height:d}=a;typeof p>"u"&&d?typeof d=="string"&&d.endsWith("%")?p=parseInt(d)/m+"%":p=parseInt(d)/m:typeof d>"u"&&p?typeof p=="string"&&p.endsWith("%")?d=parseInt(p)*m+"%":d=parseInt(p)*m:(p||(p=l[2]),d||(d=l[3])),r.width||(r.width=p),r.height||(r.height=d)}return e.setDisplay(K(r.display,{flex:o.DISPLAY_FLEX,none:o.DISPLAY_NONE},o.DISPLAY_FLEX)),e.setAlignContent(K(r.alignContent,{stretch:o.ALIGN_STRETCH,center:o.ALIGN_CENTER,"flex-start":o.ALIGN_FLEX_START,"flex-end":o.ALIGN_FLEX_END,"space-between":o.ALIGN_SPACE_BETWEEN,"space-around":o.ALIGN_SPACE_AROUND,baseline:o.ALIGN_BASELINE,normal:o.ALIGN_AUTO},o.ALIGN_AUTO)),e.setAlignItems(K(r.alignItems,{stretch:o.ALIGN_STRETCH,center:o.ALIGN_CENTER,"flex-start":o.ALIGN_FLEX_START,"flex-end":o.ALIGN_FLEX_END,baseline:o.ALIGN_BASELINE,normal:o.ALIGN_AUTO},o.ALIGN_FLEX_START)),e.setAlignSelf(K(r.alignSelf,{stretch:o.ALIGN_STRETCH,center:o.ALIGN_CENTER,"flex-start":o.ALIGN_FLEX_START,"flex-end":o.ALIGN_FLEX_END,baseline:o.ALIGN_BASELINE,normal:o.ALIGN_AUTO},o.ALIGN_AUTO)),e.setJustifyContent(K(r.justifyContent,{center:o.JUSTIFY_CENTER,"flex-start":o.JUSTIFY_FLEX_START,"flex-end":o.JUSTIFY_FLEX_END,"space-between":o.JUSTIFY_SPACE_BETWEEN,"space-around":o.JUSTIFY_SPACE_AROUND},o.JUSTIFY_FLEX_START)),e.setFlexDirection(K(r.flexDirection,{row:o.FLEX_DIRECTION_ROW,column:o.FLEX_DIRECTION_COLUMN,"row-reverse":o.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":o.FLEX_DIRECTION_COLUMN_REVERSE},o.FLEX_DIRECTION_ROW)),e.setFlexWrap(K(r.flexWrap,{wrap:o.WRAP_WRAP,nowrap:o.WRAP_NO_WRAP,"wrap-reverse":o.WRAP_WRAP_REVERSE},o.WRAP_NO_WRAP)),typeof r.flexBasis<"u"&&e.setFlexBasis(r.flexBasis),e.setFlexGrow(typeof r.flexGrow>"u"?0:r.flexGrow),e.setFlexShrink(typeof r.flexShrink>"u"?0:r.flexShrink),typeof r.maxHeight<"u"&&e.setMaxHeight(r.maxHeight),typeof r.maxWidth<"u"&&e.setMaxWidth(r.maxWidth),typeof r.minHeight<"u"&&e.setMinHeight(r.minHeight),typeof r.minWidth<"u"&&e.setMinWidth(r.minWidth),e.setOverflow(K(r.overflow,{visible:o.OVERFLOW_VISIBLE,hidden:o.OVERFLOW_HIDDEN},o.OVERFLOW_VISIBLE)),e.setMargin(o.EDGE_TOP,r.marginTop||0),e.setMargin(o.EDGE_BOTTOM,r.marginBottom||0),e.setMargin(o.EDGE_LEFT,r.marginLeft||0),e.setMargin(o.EDGE_RIGHT,r.marginRight||0),e.setBorder(o.EDGE_TOP,r.borderWidth||0),e.setBorder(o.EDGE_BOTTOM,r.borderWidth||0),e.setBorder(o.EDGE_LEFT,r.borderWidth||0),e.setBorder(o.EDGE_RIGHT,r.borderWidth||0),e.setPadding(o.EDGE_TOP,r.paddingTop||0),e.setPadding(o.EDGE_BOTTOM,r.paddingBottom||0),e.setPadding(o.EDGE_LEFT,r.paddingLeft||0),e.setPadding(o.EDGE_RIGHT,r.paddingRight||0),e.setPositionType(K(r.position,{absolute:o.POSITION_TYPE_ABSOLUTE,relative:o.POSITION_TYPE_RELATIVE},o.POSITION_TYPE_RELATIVE)),typeof r.top<"u"&&e.setPosition(o.EDGE_TOP,r.top),typeof r.bottom<"u"&&e.setPosition(o.EDGE_BOTTOM,r.bottom),typeof r.left<"u"&&e.setPosition(o.EDGE_LEFT,r.left),typeof r.right<"u"&&e.setPosition(o.EDGE_RIGHT,r.right),typeof r.height<"u"?e.setHeight(r.height):e.setHeightAuto(),typeof r.width<"u"?e.setWidth(r.width):e.setWidthAuto(),[r,Ge(r)]}function le({left:e,top:t,width:n,height:i},a,o,r){var l,m,p,d;let s;if(o)s=a;else{let g=(m=r==null?void 0:r.xAbsolute)!=null?m:((l=r==null?void 0:r.xRelative)!=null?l:50)*n/100,h=(d=r==null?void 0:r.yAbsolute)!=null?d:((p=r==null?void 0:r.yRelative)!=null?p:50)*i/100,f=e+g,u=t+h;s=pe([1,0,0,1,f,u],pe(a,[1,0,0,1,-f,-u])),a.__parent&&(s=pe(a.__parent,s)),a.splice(0,6,...s)}return`matrix(${s.map(g=>g.toFixed(2)).join(",")})`}function Rt({left:e,top:t,width:n,height:i,isInheritingTransform:a},o){let r="",s=1;return o.transform&&(r=le({left:e,top:t,width:n,height:i},o.transform,a,o.transformOrigin)),o.opacity&&(s=+o.opacity),{matrix:r,opacity:s}}function Xe({id:e,content:t,filter:n,left:i,top:a,width:o,height:r,matrix:s,opacity:l,image:m,clipPathId:p,debug:d,shape:g,decorationShape:h},f){let u="";if(d&&(u=y("rect",{x:i,y:a-r,width:o,height:r,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:s||void 0,"clip-path":p?`url(#${p})`:void 0})),m){let x={href:m,x:i,y:a,width:o,height:r,transform:s||void 0,"clip-path":p?`url(#${p})`:void 0,style:f.filter?`filter:${f.filter}`:void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+y("image",{...x,opacity:l!==1?l:void 0})+(h||"")+(n?"</g>":"")+u,""]}let b={x:i,y:a,width:o,height:r,"font-weight":f.fontWeight,"font-style":f.fontStyle,"font-size":f.fontSize,"font-family":f.fontFamily,"letter-spacing":f.letterSpacing||void 0,transform:s||void 0,"clip-path":p?`url(#${p})`:void 0,style:f.filter?`filter:${f.filter}`:void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+y("text",{...b,fill:f.color,opacity:l!==1?l:void 0},t)+(h||"")+(n?"</g>":"")+u,g?y("text",b,t):""]}function fe({id:e,width:t,height:n},i){if(!i.shadowColor||!i.shadowOffset||typeof i.shadowRadius>"u")return"";let a=i.shadowRadius*i.shadowRadius/4,o=Math.min(i.shadowOffset.width-a,0),r=Math.max(i.shadowOffset.width+a+t,t),s=Math.min(i.shadowOffset.height-a,0),l=Math.max(i.shadowOffset.height+a+n,n);return`<defs><filter id="satori_s-${e}" x="${o/t*100}%" y="${s/n*100}%" width="${(r-o)/t*100}%" height="${(l-s)/n*100}%"><feDropShadow dx="${i.shadowOffset.width}" dy="${i.shadowOffset.height}" stdDeviation="${i.shadowRadius/2}" flood-color="${i.shadowColor}" flood-opacity="1"/></filter></defs>`}function je({width:e,left:t,top:n,ascender:i,clipPathId:a},o){let{textDecorationColor:r,textDecorationStyle:s,textDecorationLine:l,fontSize:m}=o;if(!l||l==="none")return"";let p=Math.max(1,m*.1),d=l==="line-through"?n+i*.5:l==="underline"?n+i*1.1:n,g=s==="dashed"?`${p*1.2} ${p*2}`:s==="dotted"?`0 ${p*2}`:void 0;return y("line",{x1:t,y1:d,x2:t+e,y2:d,stroke:r,"stroke-width":p,"stroke-dasharray":g,"stroke-linecap":s==="dotted"?"round":"square","clip-path":a?`url(#${a})`:void 0})}var Ve=void 0;async function*Je(e,t){var ft;let n=ee(),{parentStyle:i,inheritedStyle:a,parent:o,font:r,id:s,isInheritingTransform:l,debug:m,embedFont:p,graphemeImages:d,canLoadAdditionalAssets:g}=t;i.textTransform==="uppercase"?e=e.toLocaleUpperCase(Ve):i.textTransform==="lowercase"?e=e.toLocaleLowerCase(Ve):i.textTransform==="capitalize"&&(e=ae(e,"word").map(_=>ae(_,"grapheme").map((I,L)=>L===0?I.toLocaleUpperCase(Ve):I).join("")).join(""));let h=K(i.wordBreak,{normal:"word","break-all":"grapheme","break-word":"grapheme","keep-all":"word"},"word"),f=ae(e,h),u=n.Node.create();u.setAlignItems(n.ALIGN_BASELINE),i.textAlign==="left"?u.setJustifyContent(n.JUSTIFY_FLEX_START):i.textAlign==="center"?u.setJustifyContent(n.JUSTIFY_CENTER):i.textAlign==="right"?u.setJustifyContent(n.JUSTIFY_FLEX_END):i.textAlign==="justify"&&u.setJustifyContent(n.JUSTIFY_SPACE_BETWEEN),o.insertChild(u,o.getChildCount());let{textAlign:b,textOverflow:x,whiteSpace:E,lineHeight:F,filter:$,_inheritedBackgroundClipTextPath:N}=i,W=i.fontSize,R=r.getEngine(W,F,i),V=g?f.filter(_=>!R.check(_)):[];yield V,V.length&&(R=r.getEngine(W,F,i));let A=[],v=[],M=[],G=[],z=new Map,k=_=>{let I=0;for(let L of _){if(z.has(L)){I+=z.get(L);continue}let U=R.measure(L,i);z.set(L,U),I+=U}return I},O=0,J=[],c=0;for(let _ of f){let I=!1,L=d&&d[_];E==="pre"?I=_[0]===`
`:E!=="nowrap"&&(L||Re.includes(_[0]))&&(I=!0),I?(E==="nowrap"?c+=k(J)+i.fontSize:(O=Math.max(O,k(J)),L&&(O=Math.max(O,i.fontSize))),J=[]):(!Re.includes(_[0])||!J.length)&&J.push(_===`
`?" ":_)}O=Math.max(O,k(J)+c);let w=o.getMinWidth(),C=o.getMaxWidth(),Z=o.getWidth();isNaN(Z.value)&&(isNaN(w.value)||w.unit===1&&w.value>O)&&(isNaN(C.value)||C.unit===1&&(O=Math.min(O,C.value)),o.setMinWidth(O)),typeof i.flexShrink>"u"&&o.setFlexShrink(1);let ge=E==="pre-wrap"||E==="pre";u.setMeasureFunc(_=>{let I=0,L="",U=0,Y=0,H=0,X=-1,re=0,P=0,ie=0;A=[],M=[0];for(let ne=0;ne<f.length;ne++){let D=f[ne];if(!ge&&Re.includes(D[0]))L||(L=" "),U=k([L]),G[ne]=null;else{let oe=ge&&D===`
`,j=oe?0:d&&d[D]?i.fontSize:k([D]);Y||(L="",U=0);let B=U||",.!?:-@)>]}%#".indexOf(D[0])<0,q=!Y||!!U;if(oe||ne&&B&&Y+U+j>_&&E!=="nowrap"&&E!=="pre")A.push(Y),v.push(ie),I++,re+=P,Y=j,P=j?R.height(D):0,ie=j?R.baseline(D):0,M.push(1),X=-1,oe||(H=Math.max(H,_));else{Y+=U+j;let de=R.height(D);de>P&&(P=de,ie=R.baseline(D)),q&&M[M.length-1]++}L="",U=0,q&&X++,H=Math.max(H,Y),G[ne]={y:re,x:Y-j,width:j,line:I,lineIndex:X}}}return Y&&(I++,A.push(Y),v.push(ie),re+=P),{width:H,height:re}});let[Ft,Pt]=yield,Oe="",we="",te=a._inheritedClipPathId,{left:it,top:ot,width:Ee,height:at}=u.getComputedLayout(),Fe=o.getComputedWidth()-o.getComputedPadding(n.EDGE_LEFT)-o.getComputedPadding(n.EDGE_RIGHT)-o.getComputedBorder(n.EDGE_LEFT)-o.getComputedBorder(n.EDGE_RIGHT),ue=Ft+it,ce=Pt+ot,{matrix:Q,opacity:ve}=Rt({left:it,top:ot,width:Ee,height:at,isInheritingTransform:l},i),ke="";i.textShadowOffset&&(ke=fe({width:Ee,height:at,id:s},{shadowColor:i.textShadowColor,shadowOffset:i.textShadowOffset,shadowRadius:i.textShadowRadius}));let me="",Se="",st="",Pe=-1,lt=x==="ellipsis"?k(["\u2026"]):0,$t=x==="ellipsis"?k([" "]):0,Te={};for(let _=0;_<f.length;_++){if(!G[_])continue;let I=G[_],L=f[_],U=null,Y=d?d[L]:null,H=I.y,X=I.x,re=I.width,P=I.line;if(P===Pe)continue;let ie=!1;if(A.length>1){let B=Ee-A[P];if(b==="right"||b==="end")X+=B;else if(b==="center")X+=B/2;else if(b==="justify"&&P<A.length-1){let q=M[P];X+=(q>1?B/(q-1):0)*I.lineIndex,ie=!0}}if(Te[P]||(Te[P]=[X,ie?Ee:A[P]]),x==="ellipsis"&&A[P]>Fe&&I.x+re+lt+$t>Fe){let B=ae(L,"grapheme"),q="",de=0;for(let ut of B){let ct=I.x+k([q+ut]);if(q&&ct+lt>Fe)break;q+=ut,de=ct}L=q+"\u2026",Pe=P,Te[P][1]=de}let ne=v[P],D=R.baseline(L),oe=R.height(L),j=ne-D;if(Y?H+=0:p?(U=R.getSVG(L,{...i,left:ue+X,top:ce+H+D+j,letterSpacing:i.letterSpacing}),m&&(st+=y("rect",{x:ue+X,y:ce+H+j,width:I.width,height:oe,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:Q||void 0,"clip-path":te?`url(#${te})`:void 0})+y("line",{x1:ue+X,x2:ue+X+I.width,y1:ce+H+j+D,y2:ce+H+j+D,stroke:"#14c000","stroke-width":1,transform:Q||void 0,"clip-path":te?`url(#${te})`:void 0}))):H+=D+j,i.textDecorationLine&&(P!==((ft=G[_+1])==null?void 0:ft.line)||Pe===P)){let B=Te[P];B&&!B[2]&&(me+=je({left:ue+B[0],top:ce+oe*+P,width:B[1],ascender:R.baseline(L),clipPathId:te},i),B[2]=1)}if(U!==null)Se+=U+" ";else{let[B,q]=Xe({content:L,filter:ke,id:s,left:ue+X,top:ce+H,width:re,height:oe,matrix:Q,opacity:ve,image:Y,clipPathId:te,debug:m,shape:!!N,decorationShape:me},i);Oe+=B,we+=q,me=""}}if(Se){let _=i.color!=="transparent"&&ve!==0?y("path",{fill:i.color,d:Se,transform:Q||void 0,opacity:ve!==1?ve:void 0,"clip-path":te?`url(#${te})`:void 0,style:$?`filter:${$}`:void 0}):"";N&&(we=y("path",{d:Se,transform:Q||void 0})),Oe+=(ke?ke+y("g",{filter:`url(#satori_s-${s})`},_+me):_+me)+st}return we&&(i._inheritedBackgroundClipTextPath.value+=we),Oe}var qe=qe||{};qe.parse=function(){var e={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function n(c){var w=new Error(t+": "+c);throw w.source=t,w}function i(){var c=a();return t.length>0&&n("Invalid input not EOF"),c}function a(){return F(o)}function o(){return r("linear-gradient",e.linearGradient,l)||r("repeating-linear-gradient",e.repeatingLinearGradient,l)||r("radial-gradient",e.radialGradient,d)||r("repeating-radial-gradient",e.repeatingRadialGradient,d)}function r(c,w,C){return s(w,function(Z){var ge=C();return ge&&(O(e.comma)||n("Missing comma before color stops")),{type:c,orientation:ge,colorStops:F($)}})}function s(c,w){var C=O(c);if(C){O(e.startCall)||n("Missing (");var Z=w(C);return O(e.endCall)||n("Missing )"),Z}}function l(){return m()||p()}function m(){return k("directional",e.sideOrCorner,1)}function p(){return k("angular",e.angleValue,1)}function d(){var c,w=g(),C;return w&&(c=[],c.push(w),C=t,O(e.comma)&&(w=g(),w?c.push(w):t=C)),c}function g(){var c=h()||f();if(c)c.at=b();else{var w=u();if(w){c=w;var C=b();C&&(c.at=C)}else{var Z=x();Z&&(c={type:"default-radial",at:Z})}}return c}function h(){var c=k("shape",/^(circle)/i,0);return c&&(c.style=z()||u()),c}function f(){var c=k("shape",/^(ellipse)/i,0);return c&&(c.style=M()||u()),c}function u(){return k("extent-keyword",e.extentKeywords,1)}function b(){if(k("position",/^at/,0)){var c=x();return c||n("Missing positioning value"),c}}function x(){var c=E();if(c.x||c.y)return{type:"position",value:c}}function E(){return{x:M(),y:M()}}function F(c){var w=c(),C=[];if(w)for(C.push(w);O(e.comma);)w=c(),w?C.push(w):n("One extra comma");return C}function $(){var c=N();return c||n("Expected color definition"),c.length=M(),c}function N(){return R()||A()||V()||W()}function W(){return k("literal",e.literalColor,0)}function R(){return k("hex",e.hexColor,1)}function V(){return s(e.rgbColor,function(){return{type:"rgb",value:F(v)}})}function A(){return s(e.rgbaColor,function(){return{type:"rgba",value:F(v)}})}function v(){return O(e.number)[1]}function M(){return k("%",e.percentageValue,1)||G()||z()}function G(){return k("position-keyword",e.positionKeywords,1)}function z(){return k("px",e.pixelValue,1)||k("em",e.emValue,1)}function k(c,w,C){var Z=O(w);if(Z)return{type:c,value:Z[C]}}function O(c){var w,C;return C=/^[\n\r\t\s]+/.exec(t),C&&J(C[0].length),w=c.exec(t),w&&J(w[0].length),w}function J(c){t=t.substr(c)}return function(c){return t=c.toString(),i()}}();var Ke=qe;var _t=ht(100),Ze=new Map,fn=["image/png","image/jpeg","image/gif","image/svg+xml"];function un(e){let t="",n=new Uint8Array(e);for(let i=0;i<n.byteLength;i++)t+=String.fromCharCode(n[i]);return btoa(t)}async function Ie(e){if(!e)throw new Error("Image URL is not provided");if(e.startsWith("data:"))return e;if(!globalThis.fetch)throw new Error("`fetch` is required to be polyfilled to load images.");if(Ze.has(e))return Ze.get(e);let t=_t.get(e);if(t)return t;let n=new Promise((i,a)=>{let o;fetch(e).then(r=>(o=(r.headers.get("content-type")||"").toLowerCase(),r.arrayBuffer())).then(r=>{if(!o)switch([...new Uint8Array(r.slice(0,4))].map(p=>p.toString(16)).join("")){case"89504e47":o="image/png";break;case"47494638":o="image/gif";break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":o="image/jpeg";break}if(!fn.includes(o))throw new Error(`Unsupported image type: ${o||"unknown"}`);let s=`data:${o};base64,${un(r)}`;_t.set(e,s),i(s)}).catch(a)});return Ze.set(e,n),n}function cn(e){return e.type==="literal"?e.value:e.type==="hex"?`#${e.value}`:e.type==="rgb"?`rgb(${e.value.join(",")})`:e.type==="rgba"?`rgba(${e.value.join(",")})`:"transparent"}function dn(e,t){return typeof e=="string"&&e.endsWith("%")?t*parseFloat(e)/100:+e}function Ct(e,{x:t,y:n,defaultX:i,defaultY:a}){return(e?e.split(" ").map(o=>{try{let r=new se(o);return r.type==="length"||r.type==="number"?r.value:r.value+r.unit}catch{return null}}).filter(o=>o!==null):[i,a]).map((o,r)=>dn(o,[t,n][r]))}function It(e,t){let n=[];for(let r of t){let s=cn(r);if(!n.length&&(n.push({offset:0,color:s}),typeof r.length>"u"||r.length.value==="0"))continue;let l=typeof r.length>"u"?void 0:r.length.type==="%"?r.length.value/100:r.length.value/e;n.push({offset:l,color:s})}n.length||n.push({offset:0,color:"transparent"});let i=n[n.length-1];i.offset!==1&&(typeof i.offset>"u"?i.offset=1:n.push({offset:1,color:i.color}));let a=0,o=1;for(let r=0;r<n.length;r++)if(typeof n[r].offset>"u"){for(o<r&&(o=r);typeof n[o].offset>"u";)o++;n[r].offset=(n[o].offset-n[a].offset)/(o-a)*(r-a)+n[a].offset}else a=r;return n}async function Qe({id:e,width:t,height:n},{image:i,size:a,position:o,repeat:r}){r=r||"repeat";let s=r==="repeat-x"||r==="repeat",l=r==="repeat-y"||r==="repeat",m=Ct(a,{x:t,y:n,defaultX:t,defaultY:n}),p=Ct(o,{x:t,y:n,defaultX:0,defaultY:0});if(i.startsWith("linear-gradient(")){let d=Ke.parse(i)[0],g,h,f,u;if(d.orientation.type==="directional")[g,h,f,u]={top:[0,1,0,0],bottom:[0,0,0,1],left:[1,0,0,0],right:[0,0,1,0]}[d.orientation.value];else if(d.orientation.type==="angular"){let x=+d.orientation.value/180*Math.PI-Math.PI/2,E=Math.cos(x),F=Math.sin(x);g=0,h=0,f=E,u=F,f<0&&(g-=f,f=0),u<0&&(h-=u,u=0)}let b=It(t,d.colorStops);return[`satori_bi${e}`,`<linearGradient id="satori_bi${e}" x1="${g}" y1="${h}" x2="${f}" y2="${u}">${b.map(x=>`<stop offset="${x.offset*100}%" stop-color="${x.color}"/>`).join("")}</linearGradient>`]}if(i.startsWith("radial-gradient(")){let d=Ke.parse(i)[0],g=d.orientation[0],[h,f]=m,u="circle",b=h/2,x=f/2;if(g.type==="shape"){if(u=g.value,g.at)if(g.at.type==="position")b=g.at.value.x.value,x=g.at.value.y.value;else throw new Error("orientation.at.type not implemented: "+g.at.type)}else throw new Error("orientation.type not implemented: "+g.type);let E=It(t,d.colorStops),F=`satori_radial_${e}`,$=`satori_pattern_${e}`,N={},W=Math.max(Math.abs(h-b),Math.abs(b)),R=Math.max(Math.abs(f-x),Math.abs(x));if(u==="circle")N.r=Math.sqrt(W*W+R*R);else if(u==="ellipse"){let v=R!==0?W/R:1;N.ry=Math.sqrt(W*W+R*R*v*v)/v,N.rx=N.ry*v}let V=y("pattern",{id:$,x:p[0],y:p[1],width:s?h:"100%",height:l?f:"100%",patternUnits:"userSpaceOnUse"},y("radialGradient",{id:F},E.map(v=>y("stop",{offset:v.offset,"stop-color":v.color})).join(""))+y(u,{cx:b,cy:x,width:h,height:f,...N,fill:`url(#${F})`}));return[$,V]}if(i.startsWith("url(")){let d=await Ie(i.slice(4,-1));return[`satori_bi${e}`,y("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:p[0],y:p[1],width:s?m[0]:"100%",height:l?m[1]:"100%"},y("image",{x:0,y:0,width:m[0],height:m[1],href:d}))]}}function Le(e,t,n){return n<e+t&&(n/2<e&&n/2<t?e=t=n/2:n/2<e?e=n-t:n/2<t&&(t=n-e)),[e,t]}function be({left:e,top:t,width:n,height:i},a){let{borderTopLeftRadius:o,borderTopRightRadius:r,borderBottomLeftRadius:s,borderBottomRightRadius:l}=a;return o=Math.min(o||0,n,i),r=Math.min(r||0,n,i),s=Math.min(s||0,n,i),l=Math.min(l||0,n,i),!o&&!r&&!s&&!l?"":([o,r]=Le(o,r,n),[o,s]=Le(o,s,i),[r,l]=Le(r,l,i),[s,l]=Le(s,l,n),`M${e+o},${t} h${n-o-r} a${r},${r} 0 0 1 ${r},${r} v${i-r-l} a${l},${l} 0 0 1 ${-l},${l} h${l+s-n} a${s},${s} 0 0 1 ${-s},${-s} v${s+o-i} a${o},${o} 0 0 1 ${o},${-o}`)}function et({left:e,top:t,width:n,height:i,path:a,id:o},r){return r.overflow!=="hidden"?"":a?y("clipPath",{id:`satori_cp-${o}`,"clip-path":r._inheritedClipPathId?`url(#${r._inheritedClipPathId})`:void 0},y("path",{x:e,y:t,width:n,height:i,d:a})):y("clipPath",{id:`satori_cp-${o}`,"clip-path":r._inheritedClipPathId?`url(#${r._inheritedClipPathId})`:void 0},y("rect",{x:e,y:t,width:n,height:i}))}async function tt({id:e,left:t,top:n,width:i,height:a,isInheritingTransform:o,debug:r},s){if(s.display==="none")return"";let l="rect",m="transparent",p="",d=0,g="",h="",f=[],u=1,b="";s.backgroundColor&&f.push(s.backgroundColor),s.borderWidth&&(d=s.borderWidth,m=s.borderColor,s.borderStyle==="dashed"&&(p=d*2+" "+d)),s.opacity&&(u=+s.opacity),s.transform&&(g=le({left:t,top:n,width:i,height:a},s.transform,o,s.transformOrigin));let x="";if(s.backgroundImage){let A=[];for(let v=0;v<s.backgroundImage.length;v++){let M=s.backgroundImage[v],G=await Qe({id:e+"_"+v,width:i,height:a},M);G&&A.push(G)}for(let v of A)f.push(`url(#${v[0]})`),h+=v[1],v[2]&&(x+=v[2])}let E=be({left:t,top:n,width:i,height:a},s);E&&(l="path");let F=et({left:t,top:n,width:i,height:a,path:E,id:e},s),$=s._inheritedClipPathId,N=fe({width:i,height:a,id:e},s);r&&(b=y("rect",{x:t,y:n,width:i,height:a,fill:"transparent",stroke:"#ff5757","stroke-width":1,"stroke-dasharray":p||void 0,transform:g||void 0,"clip-path":$?`url(#${$})`:void 0})),f.length||f.push("transparent");let{backgroundClip:W,filter:R}=s,V=f.map((A,v)=>{if(A==="transparent"&&!(v===f.length-1&&d))return"";let M=!!d,G=v===f.length-1&&M&&W!=="text",z=W==="text"?`url(#satori_bct-${e})`:$?`url(#${$})`:void 0;return G&&(h+=y("clipPath",{id:`satori_bc-${e}`,"clip-path":z},y(l,{x:t,y:n,width:i,height:a,d:E||void 0})),z=`url(#satori_bc-${e})`),y(l,{x:t,y:n,width:i,height:a,fill:A,stroke:G||M?m:void 0,"stroke-width":G?d*2:M?1:void 0,"stroke-dasharray":p||void 0,d:E||void 0,transform:g||void 0,"clip-path":z,style:R?`filter:${R}`:void 0})}).join("");return W==="text"&&d&&(V=y(l,{x:t,y:n,width:i,height:a,fill:"transparent",stroke:m,"stroke-width":d*2,"stroke-dasharray":p||void 0,d:E||void 0,transform:g||void 0,"clip-path":$?`url(#${$})`:void 0})+V),(h?`<defs>${h}</defs>`:"")+F+(N?`${N}<g filter="url(#satori_s-${e})">`:"")+(u!==1?`<g opacity="${u}">`:"")+(x||V)+(u!==1?"</g>":"")+(N?"</g>":"")+b}function Ae({id:e,left:t,top:n,width:i,height:a,src:o,debug:r,isInheritingTransform:s},l){if(l.display==="none")return"";let m="",p=1,d="",g=l.objectFit==="contain"?"xMidYMid":l.objectFit==="cover"?"xMidYMid slice":"none",h=be({left:t,top:n,width:i,height:a},l),f=l._inheritedClipPathId;h&&(m=y("clipPath",{id:`satori_c-${e}`,"clip-path":f?`url(#${f})`:void 0},y("path",{x:t,y:n,width:i,height:a,d:h}))),l.opacity&&(p=+l.opacity);let u=fe({width:i,height:a,id:e},l);return l.transform&&(d=le({left:t,top:n,width:i,height:a},l.transform,s,l.transformOrigin)),u+(u?`<g filter="url(#satori_s-${e})">`:"")+m+y("image",{x:t,y:n,width:i,height:a,href:o,preserveAspectRatio:g,transform:d||void 0,"clip-path":m?`url(#satori_c-${e})`:f?`url(#${f})`:void 0})+(u?"</g>":"")}async function*ye(e,t){var J;let n=ee(),{id:i,inheritedStyle:a,parent:o,font:r,debug:s,embedFont:l=!0,graphemeImages:m,canLoadAdditionalAssets:p}=t;if(e===null||typeof e>"u")return yield,yield,"";if(!We(e)||typeof e.type=="function"){let c;if(!We(e))c=Je(String(e),t),yield(await c.next()).value;else{if(pt(e.type))throw new Error("Class component is not supported.");c=ye(e.type(e.props),t),yield(await c.next()).value}await c.next();let w=yield;return(await c.next(w)).value}let{type:d,props:g}=e,{style:h,children:f}=g||{},u=n.Node.create();o.insertChild(u,o.getChildCount());let[b,x]=He(u,d,a,h,g),E=b.transform===a.transform;if(E||(b.transform.__parent=a.transform),b.overflow==="hidden"&&(x._inheritedClipPathId=`satori_cp-${i}`),b.backgroundClip==="text"){let c={value:""};x._inheritedBackgroundClipTextPath=c,b._inheritedBackgroundClipTextPath=c}let F=gt(f),$=[],N=0,W=[];for(let c of F){let w=ye(c,{id:i+"-"+N++,parentStyle:b,inheritedStyle:x,isInheritingTransform:!0,parent:u,font:r,embedFont:l,debug:s,graphemeImages:m,canLoadAdditionalAssets:p});p?W.push(...(await w.next()).value||[]):await w.next(),$.push(w)}yield W;for(let c of $)await c.next();let[R,V]=yield,{left:A,top:v,width:M,height:G}=u.getComputedLayout();A+=R,v+=V;let z="",k="",O="";if(d==="img"){let c=await Ie(g.src);k=Ae({id:i,left:A,top:v,width:M,height:G,src:c,isInheritingTransform:E,debug:s},b)}else if(d==="svg"){let c=yt(e);k=Ae({id:i,left:A,top:v,width:M,height:G,src:c,isInheritingTransform:E,debug:s},b)}else{let c=(J=h==null?void 0:h.display)!=null?J:"block";if(d==="div"&&f&&typeof f!="string"&&c!=="flex"&&c!=="none")throw new Error(`Expected <div> to have style={{display: 'flex'}} but received style={{display: '${c}'}}`);k=await tt({id:i,left:A,top:v,width:M,height:G,isInheritingTransform:E,debug:s},b)}for(let c of $)z+=(await c.next([A,v])).value;return b._inheritedBackgroundClipTextPath&&(O+=y("clipPath",{id:`satori_bct-${i}`,"clip-path":b._inheritedClipPathId?`url(#${b._inheritedClipPathId})`:void 0},b._inheritedBackgroundClipTextPath.value)),O+k+z}import pn from"@shuding/opentype.js";function gn(e,t,[n,i],[a,o]){if(n!==a)return n?!a||n===e?-1:a===e?1:e===400&&n===500||e===500&&n===400?-1:e===400&&a===500||e===500&&a===400?1:e<400?n<e&&a<e?a-n:n<e?-1:a<e?1:n-a:e<n&&e<a?n-a:e<n?-1:e<a?1:a-n:1;if(i!==o){if(i===t)return-1;if(o===t)return 1}return-1}var xe=class{constructor(t){this.fonts=new Map;this.addFonts(t)}get({name:t,weight:n,style:i}){if(!this.fonts.has(t))return null;n==="normal"&&(n=400),n==="bold"&&(n=700);let a=[...this.fonts.get(t)],o=a[0];for(let r=1;r<a.length;r++){let[,s,l]=o,[,m,p]=a[r];gn(n,i,[s,l],[m,p])>0&&(o=a[r])}return o[0]}addFonts(t){for(let n of t){let i=n.data,a=pn.parse("buffer"in i?i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength):i,{lowMemory:!0}),o=a.charToGlyphIndex;a.charToGlyphIndex=s=>{let l=o.call(a,s);return l===0&&a._trackBrokenChars&&a._trackBrokenChars.push(s),l},this.defaultFont||(this.defaultFont=a);let r=n.name.toLowerCase();this.fonts.has(r)||this.fonts.set(r,[]),this.fonts.get(r).push([a,n.weight,n.style])}}getEngine(t=16,n=1.2,{fontFamily:i,fontWeight:a=400,fontStyle:o="normal"}){if(!this.fonts.size)throw new Error("No fonts are loaded. At least one font is required to calculate the layout.");i=(Array.isArray(i)?i:[i]).map(f=>f.toLowerCase());let r=i.map(f=>this.get({name:f,weight:a,style:o})).filter(Boolean),s=Array.from(this.fonts.keys());for(let f of s)i.includes(f)||r.push(this.get({name:f,weight:a,style:o}));let l=new Map,m=(f,u=!0)=>{let b=f.charCodeAt(0);if(l.has(b))return l.get(b);let x=r.find((E,F)=>!!E.charToGlyphIndex(f)||u&&F===r.length-1);return x&&l.set(b,x),x},p=(f,u=!1)=>{var x,E;return((u?(E=(x=f.tables)==null?void 0:x.os2)==null?void 0:E.sTypoAscender:0)||f.ascender)/f.unitsPerEm*t},d=(f,u=!1)=>{var x,E;return((u?(E=(x=f.tables)==null?void 0:x.os2)==null?void 0:E.sTypoDescender:0)||f.descender)/f.unitsPerEm*t},g=f=>m(f,!1),h={check:f=>{let u=g(f);return u?(u._trackBrokenChars=[],u.stringToGlyphs(f),u._trackBrokenChars.length?(u._trackBrokenChars=void 0,!1):!0):!1},baseline:(f,u=typeof f>"u"?r[0]:m(f))=>{let b=p(u,!0),x=d(u,!0),E=h.height(f,u),{yMax:F,yMin:$}=u.tables.head,N=b-x,W=(F/(F-$)-1)*N;return E*((1.2/n+1)/2)+W},height:(f,u=typeof f>"u"?r[0]:m(f))=>(p(u)-d(u))*(n/1.2),measure:(f,u)=>this.measure(m,f,u),getSVG:(f,u)=>this.getSVG(m,f,u)};return h}patchFontFallbackResolver(t,n){let i=[];t._trackBrokenChars=i;let a=t.stringToGlyphs;return t.stringToGlyphs=(o,...r)=>{let s=a.call(t,o,...r);for(let l=0;l<s.length;l++)if(s[l].unicode===void 0){let m=i.shift(),p=n(m);p!==t&&(s[l]=p.charToGlyph(m))}return s},()=>{t.stringToGlyphs=a,t._trackBrokenChars=void 0}}measure(t,n,{fontSize:i,letterSpacing:a=0}){let o=t(n),r=this.patchFontFallbackResolver(o,t);try{return o.getAdvanceWidth(n,i,{letterSpacing:a/i})}finally{r()}}getSVG(t,n,{fontSize:i,top:a,left:o,letterSpacing:r=0}){let s=t(n),l=this.patchFontFallbackResolver(s,t);try{return i===0?"":s.getPath(n,o,a,i,{letterSpacing:r/i}).toPathData(1)}finally{l()}}};function nt({width:e,height:t,content:n}){return y("svg",{width:e,height:t,viewBox:`0 0 ${e} ${t}`,xmlns:"http://www.w3.org/2000/svg"},n)}var Lt={emoji:/\p{RI}\p{RI}|\p{Emoji}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?(\u{200D}\p{Emoji}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?)+|\p{EPres}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?|\p{Emoji}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})/u,ja:/\p{scx=Hira}|\p{scx=Kana}|[,;:]/u,ko:/\p{scx=Hangul}/u,zh:/\p{scx=Han}/u,th:/\p{scx=Thai}/u,bn:/\p{scx=Bengali}/u,ar:/\p{scx=Arabic}/u,ta:/\p{scx=Tamil}/u,ml:/\p{scx=Malayalam}/u,he:/\p{scx=Hebrew}/u,te:/\p{scx=Telugu}/u,devanagari:/\p{scx=Devanagari}/u};function At(e){for(let t in Lt)if(Lt[t].test(e))return t;return"unknown"}var rt=new WeakMap;async function Ot(e,t){let n=ee();if(!n)throw new Error("Satori is not initialized.");let i;rt.has(t.fonts)?i=rt.get(t.fonts):rt.set(t.fonts,i=new xe(t.fonts));let a=n.Node.create();a.setWidth(t.width),a.setHeight(t.height),a.setFlexDirection(n.FLEX_DIRECTION_ROW),a.setFlexWrap(n.WRAP_WRAP),a.setAlignContent(n.ALIGN_AUTO),a.setAlignItems(n.ALIGN_FLEX_START),a.setJustifyContent(n.JUSTIFY_FLEX_START),a.setOverflow(n.OVERFLOW_HIDDEN);let o={...t.graphemeImages},r=ye(e,{id:"id",parentStyle:{},inheritedStyle:{fontSize:16,fontWeight:"normal",fontFamily:"serif",fontStyle:"normal",lineHeight:1.2,color:"black",opacity:1,whiteSpace:"normal",_viewportWidth:t.width,_viewportHeight:t.height},parent:a,font:i,embedFont:t.embedFont,debug:t.debug,graphemeImages:o,canLoadAdditionalAssets:!!t.loadAdditionalAsset}),s=(await r.next()).value;if(t.loadAdditionalAsset&&s.length){s=Array.from(new Set(ae(s.join(""),"grapheme")));let m={};s.forEach(g=>{let h=At(g);m[h]=m[h]||[],h==="emoji"?m[h].push(g):m[h][0]=(m[h][0]||"")+g});let p=[],d={};await Promise.all(Object.entries(m).flatMap(([g,h])=>h.map(f=>t.loadAdditionalAsset(g,f).then(u=>{typeof u=="string"?d[f]=u:u&&p.push(u)})))),i.addFonts(p),Object.assign(o,d)}await r.next(),a.calculateLayout(t.width,t.height,n.DIRECTION_LTR);let l=(await r.next([0,0])).value;return a.freeRecursive(),nt({width:t.width,height:t.height,content:l})}export{Ot as default,Wt as init};
import*as Nt from"yoga-layout-prebuilt";var mt=Nt;var $e;$e=mt.default;function Gt(e){$e=e}function ee(){return $e}function Ge(e){let t=typeof e;return!(t==="number"||t==="bigint"||t==="string"||t==="boolean")}function bt(e){return/^class\s/.test(Function.prototype.toString.call(e))}function yt(e){let t=typeof e>"u"?[]:[].concat(e).flat(1/0),n=[];for(let o=0;o<t.length;o++){let a=t[o];typeof a>"u"||typeof a=="boolean"||a===null||(typeof a=="number"&&(a=String(a)),typeof a=="string"&&n.length&&typeof n[n.length-1]=="string"?n[n.length-1]+=a:n.push(a))}return n}function pe(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function K(e,t,n){let o=t[e];return typeof o>"u"?n:o}var ht=void 0,Me,We,Re=[32,160,4961,65792,65793,4153,4241,10].map(e=>String.fromCodePoint(e));function ae(e,t){if(!Me||!We){if(!(typeof Intl<"u"&&"Segmenter"in Intl))throw new Error("Intl.Segmenter does not exist, please use import a polyfill.");Me=new Intl.Segmenter(ht,{granularity:"word"}),We=new Intl.Segmenter(ht,{granularity:"grapheme"})}return t==="word"?[...Me.segment(e)].map(n=>n.segment):[...We.segment(e)].map(n=>n.segment)}function x(e,t,n){let o="";for(let[a,i]of Object.entries(t))typeof i<"u"&&(o+=` ${a}="${i}"`);return n?`<${e}${o}>${n}</${e}>`:`<${e}${o}/>`}function xt(e=20){let t=new Map;function n(a,i){if(t.size>=e){let r=t.keys().next().value;t.delete(r)}t.set(a,i)}function o(a){if(!t.has(a))return;let r=t.get(a);return t.delete(a),t.set(a,r),r}return{set:n,get:o}}var wt={accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",allowReorder:"allowreorder",arabicForm:"arabic-form",attributeName:"attributename",attributeType:"attributetype",autoReverse:"autoreverse",baseFrequency:"basefrequency",baseProfile:"baseprofile",baselineShift:"baseline-shift",calcMode:"calcmode",capHeight:"cap-height",clipPath:"clip-path",clipPathUnits:"clippathunits",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentscripttype",contentStyleType:"contentstyletype",diffuseConstant:"diffuseconstant",dominantBaseline:"dominant-baseline",edgeMode:"edgemode",enableBackground:"enable-background",externalResourcesRequired:"externalresourcesrequired",fillOpacity:"fill-opacity",fillRule:"fill-rule",filterRes:"filterres",filterUnits:"filterunits",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphref",gradientTransform:"gradienttransform",gradientUnits:"gradientunits",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",kernelMatrix:"kernelmatrix",kernelUnitLength:"kernelunitlength",keyPoints:"keypoints",keySplines:"keysplines",keyTimes:"keytimes",lengthAdjust:"lengthadjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingconeangle",markerEnd:"marker-end",markerHeight:"markerheight",markerMid:"marker-mid",markerStart:"marker-start",markerUnits:"markerunits",markerWidth:"markerwidth",maskContentUnits:"maskcontentunits",maskUnits:"maskunits",numOctaves:"numoctaves",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathlength",patternContentUnits:"patterncontentunits",patternTransform:"patterntransform",patternUnits:"patternunits",pointerEvents:"pointer-events",pointsAtX:"pointsatx",pointsAtY:"pointsaty",pointsAtZ:"pointsatz",preserveAlpha:"preservealpha",preserveAspectRatio:"preserveaspectratio",primitiveUnits:"primitiveunits",refX:"refx",refY:"refy",renderingIntent:"rendering-intent",repeatCount:"repeatcount",repeatDur:"repeatdur",requiredExtensions:"requiredextensions",requiredFeatures:"requiredfeatures",shapeRendering:"shape-rendering",specularConstant:"specularconstant",specularExponent:"specularexponent",spreadMethod:"spreadmethod",startOffset:"startoffset",stdDeviation:"stddeviation",stitchTiles:"stitchtiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",suppressContentEditableWarning:"suppresscontenteditablewarning",suppressHydrationWarning:"suppresshydrationwarning",surfaceScale:"surfacescale",systemLanguage:"systemlanguage",tableValues:"tablevalues",targetX:"targetx",targetY:"targety",textAnchor:"text-anchor",textDecoration:"text-decoration",textLength:"textlength",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewbox",viewTarget:"viewtarget",wordSpacing:"word-spacing",writingMode:"writing-mode",xChannelSelector:"xchannelselector",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlLang:"xml:lang",xmlSpace:"xmlspace",xmlnsXlink:"xmlns:xlink",yChannelSelector:"ychannelselector",zoomAndPan:"zoomandpan"},Dt=/[\r\n%#()<>?[\\\]^`{|}"']/g;function Ne(e){if(!e)return"";if(Array.isArray(e))return e.map(Ne).join("");if(typeof e!="object")return String(e);let t=e.type;if(t==="text")throw new Error("<text> nodes are not currently supported, please convert them to <path>");let{children:n,...o}=e.props||{};return`<${t}${Object.entries(o).map(([a,i])=>` ${wt[a]||a}="${i}"`).join("")}>${Ne(n)}</${t}>`}function vt(e){let{viewBox:t,viewbox:n,width:o,height:a,className:i,style:r,children:s,...l}=e.props||{};t||(t=n);let m=t.split(" ").map(g=>parseInt(g,10));return l.xmlns="http://www.w3.org/2000/svg",l.viewBox=t,l.width=m[2],l.height=m[3],`data:image/svg+xml;utf8,${`<svg${Object.entries(l).map(([g,u])=>` ${wt[g]||g}="${u}"`).join("")}>${Ne(s)}</svg>`.replace(Dt,encodeURIComponent)}`}var Et={p:{display:"block",marginTop:"1em",marginBottom:"1em"},div:{display:"block"},blockquote:{display:"block",marginTop:"1em",marginBottom:"1em",marginLeft:40,marginRight:40},center:{display:"block",textAlign:"center"},hr:{display:"block",marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"auto",marginRight:"auto",borderWidth:1,borderStyle:"inset"},h1:{display:"block",fontSize:"2em",marginTop:"0.67em",marginBottom:"0.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h2:{display:"block",fontSize:"1.5em",marginTop:"0.83em",marginBottom:"0.83em",marginLeft:0,marginRight:0,fontWeight:"bold"},h3:{display:"block",fontSize:"1.17em",marginTop:"1em",marginBottom:"1em",marginLeft:0,marginRight:0,fontWeight:"bold"},h4:{display:"block",marginTop:"1.33em",marginBottom:"1.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},h5:{display:"block",fontSize:"0.83em",marginTop:"1.67em",marginBottom:"1.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h6:{display:"block",fontSize:"0.67em",marginTop:"2.33em",marginBottom:"2.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},u:{textDecoration:"underline"},strong:{fontWeight:"bold"},b:{fontWeight:"bold"},i:{fontStyle:"italic"},em:{fontStyle:"italic"},code:{fontFamily:"monospace"},kbd:{fontFamily:"monospace"},pre:{display:"block",fontFamily:"monospace",whiteSpace:"pre",marginTop:"1em",marginBottom:"1em"},mark:{backgroundColor:"yellow",color:"black"},big:{fontSize:"larger"},small:{fontSize:"smaller"},s:{textDecoration:"line-through"}};var Bt=new Set(["color","font","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","textAlign","textTransform","textShadowOffset","textShadowColor","textShadowRadius","textDecorationLine","textDecorationStyle","textDecorationColor","whiteSpace","transform","wordBreak","opacity","filter","_viewportWidth","_viewportHeight","_inheritedClipPathId","_inheritedBackgroundClipTextPath"]);function De(e){let t={};for(let n in e)Bt.has(n)&&(t[n]=e[n]);return t}import{getPropertyName as tn,getStylesForProperty as nn}from"css-to-react-native";import{parseElementStyle as rn}from"css-background-parser";var he=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ut=he((e,t)=>{t.exports=["em","ex","ch","rem","vh","vw","vmin","vmax","px","mm","cm","in","pt","pc","mozmm"]}),zt=he((e,t)=>{t.exports=["deg","grad","rad","turn"]}),Ht=he((e,t)=>{t.exports=["dpi","dpcm","dppx"]}),Yt=he((e,t)=>{t.exports=["Hz","kHz"]}),Xt=he((e,t)=>{t.exports=["s","ms"]}),jt=Ut(),kt=zt(),St=Ht(),Tt=Yt(),Rt=Xt();function Ue(e){if(/\.\D?$/.test(e))throw new Error("The dot should be followed by a number");if(/^[+-]{2}/.test(e))throw new Error("Only one leading +/- is allowed");if(Vt(e)>1)throw new Error("Only one dot is allowed");if(/%$/.test(e)){this.type="percentage",this.value=Be(e),this.unit="%";return}var t=qt(e);if(!t){this.type="number",this.value=Be(e);return}this.type=Zt(t),this.value=Be(e.substr(0,e.length-t.length)),this.unit=t}Ue.prototype.valueOf=function(){return this.value};Ue.prototype.toString=function(){return this.value+(this.unit||"")};function se(e){return new Ue(e)}function Vt(e){var t=e.match(/\./g);return t?t.length:0}function Be(e){var t=parseFloat(e);if(isNaN(t))throw new Error("Invalid number: "+e);return t}var Jt=[].concat(kt,Tt,jt,St,Rt);function qt(e){var t=e.match(/\D+$/),n=t&&t[0];if(n&&Jt.indexOf(n)===-1)throw new Error("Invalid unit: "+n);return n}var Kt=Object.assign(_e(kt,"angle"),_e(Tt,"frequency"),_e(St,"resolution"),_e(Rt,"time"));function _e(e,t){return Object.fromEntries(e.map(n=>[n,t]))}function Zt(e){return Kt[e]||"length"}import Qt from"postcss-value-parser";function en(e,t){try{let n=new se(e);switch(n.unit){case"px":return{absolute:n.value};case"em":return{absolute:n.value*t};case"rem":return{absolute:n.value*16};case"%":return{relative:n.value};default:return{}}}catch{return{}}}function ze(e,t,n){switch(e){case"top":return{yRelative:0};case"left":return{xRelative:0};case"right":return{xRelative:100};case"bottom":return{yRelative:100};case"center":return{};default:let o=en(e,t);return o.absolute?{[n?"xAbsolute":"yAbsolute"]:o.absolute}:o.relative?{[n?"xRelative":"yRelative"]:o.relative}:{}}}function He(e,t){if(typeof e=="number")return{xAbsolute:e};let n;try{n=Qt(e).nodes.filter(o=>o.type==="word").map(o=>o.value)}catch{return{}}return n.length===1?ze(n[0],t,!0):n.length===2?((n[0]==="top"||n[0]==="bottom"||n[1]==="left"||n[1]==="right")&&n.reverse(),{...ze(n[0],t,!0),...ze(n[1],t,!1)}):{}}var on=new Set(["flex","flexGrow","flexShrink","flexBasis","fontWeight","lineHeight","opacity","scale","scaleX","scaleY"]),an=new Set(["lineHeight"]),_t=[1,0,0,1,0,0];function sn(e,t,n,o){return e==="border"&&!n.includes(t.borderColor)?t.borderColor=o:e==="borderColor"?t.borderColor=t.borderTopColor:e==="textDecoration"&&!n.includes(t.textDecorationColor)&&(t.textDecorationColor=o),t}function It(e,t){return typeof t=="number"?on.has(e)?an.has(e)?t:String(t):t+"px":t}function ln(e,t){return e==="lineHeight"?{lineHeight:It(e,t)}:e==="fontFamily"?{fontFamily:t.split(",").map(n=>n.trim().replace(/(^['"])|(['"]$)/g,"").toLocaleLowerCase())}:null}function fn(e){return e==="transform"?" Only absolute lengths such as `10px` are supported.":""}function Ye(e,t,n,{percentage:o}={percentage:!1}){if(typeof e=="number")return e;try{let a=new se(e);if(a.type==="length")switch(a.unit){case"em":return a.value*t;case"rem":return a.value*16;case"vw":return~~(a.value*n._viewportWidth/100);case"vh":return~~(a.value*n._viewportHeight/100);default:return a.value}else if(a.type==="angle")switch(a.unit){case"deg":return a.value;case"rad":return a.value*180/Math.PI;default:return a.value}else if(a.type==="percentage"&&o)return a.value/100*t}catch{}}function Ie(e,t){let n={};for(let a in e){if(a.startsWith("_")){n[a]=e[a];continue}let i=tn(a);try{Object.assign(n,ln(i,e[a])||sn(i,nn(i,It(i,e[a]),!0),e[a],e.color||t.color))}catch(r){throw console.error(r),new Error(`Failed to parse CSS \`${i}: ${e[a]}\`.${fn(i)}`)}}if(n.backgroundImage){let{backgrounds:a}=rn(n);n.backgroundImage=a}let o=typeof n.fontSize=="number"?n.fontSize:t.fontSize;if(typeof o=="string")try{let a=new se(o);switch(a.unit){case"em":o=a.value*t.fontSize;break;case"rem":o=a.value*16;break}}catch{o=16}typeof n.fontSize<"u"&&(n.fontSize=o),n.transformOrigin&&(n.transformOrigin=He(n.transformOrigin,o));for(let a in n){let i=n[a];if(a==="lineHeight")typeof i=="string"&&(i=n[a]=Ye(i,o,t,{percentage:!0})/o);else if(typeof i=="string"){let r=Ye(i,o,t);typeof r<"u"&&(n[a]=r),i=n[a]}if(a==="opacity"&&(i=n[a]=i*t.opacity),a==="transform"){let r=[..._t],s=i;for(let l of s){let m=Object.keys(l)[0],g=l[m],u=typeof g=="string"?Ye(g,o,t):g,d=[..._t];switch(m){case"translateX":d[4]=u;break;case"translateY":d[5]=u;break;case"scale":d[0]=u,d[3]=u;break;case"scaleX":d[0]=u;break;case"scaleY":d[3]=u;break;case"rotate":let h=u*Math.PI/180,f=Math.cos(h),c=Math.sin(h);d[0]=f,d[1]=c,d[2]=-c,d[3]=f;break;case"skewX":d[2]=Math.tan(u*Math.PI/180);break;case"skewY":d[1]=Math.tan(u*Math.PI/180);break}r=pe(d,r)}n.transform=r}}return n}function un(e){let t=new DataView(e),n=4,o=t.byteLength;for(;n<o;){let a=t.getUint16(n,!1);if(a>o)throw new TypeError("Invalid JPEG");let i=t.getUint8(a+1+n);if(i===192||i===193||i===194)return[t.getUint16(a+7+n,!1),t.getUint16(a+5+n,!1)];n+=a+2}throw new TypeError("Invalid JPEG")}function cn(e){let t=new Uint8Array(e.slice(6,10));return[t[0]|t[1]<<8,t[2]|t[3]<<8]}function dn(e){let t=new DataView(e);return[t.getUint16(18,!1),t.getUint16(22,!1)]}var Ct=xt(100),Xe=new Map,pn=["image/png","image/jpeg","image/gif","image/svg+xml"];function gn(e){let t="",n=new Uint8Array(e);for(let o=0;o<n.byteLength;o++)t+=String.fromCharCode(n[o]);return btoa(t)}async function Ce(e){if(!e)throw new Error("Image source is not provided.");if(e.startsWith("data:"))return[e];if(!globalThis.fetch)throw new Error("`fetch` is required to be polyfilled to load images.");if(Xe.has(e))return Xe.get(e);let t=Ct.get(e);if(t)return t;let n=new Promise((o,a)=>{fetch(e).then(i=>i.arrayBuffer()).then(i=>{let r,s;switch([...new Uint8Array(i.slice(0,4))].map(u=>u.toString(16)).join("")){case"89504e47":r="image/png",s=dn(i);break;case"47494638":r="image/gif",s=cn(i);break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":r="image/jpeg",s=un(i);break}if(!pn.includes(r))throw new Error(`Unsupported image type: ${r||"unknown"}`);let g=`data:${r};base64,${gn(i)}`;Ct.set(e,[g,...s]),o([g,...s])}).catch(a)});return Xe.set(e,n),n}async function je(e,t,n,o,a){let i=ee(),r={...n,...Ie(Et[t],n),...Ie(o,n)};if(t==="img"){let[s,l,m]=await Ce(a.src);if(l===void 0&&m===void 0){if(a.width===void 0||a.height===void 0)throw new Error("Image size cannot be determined. Please provide the width and height of the image.");l=parseInt(a.width),m=parseInt(a.height)}let g=m/l,u=r.width||a.width,d=r.height||a.height;!u&&!d&&(u=l,d=m),u||(u=d/g),d||(d=u*g),r.width=u,r.height=d,r.__src=s}if(t==="svg"){let l=(a.viewBox||a.viewbox).split(" ").map(d=>parseInt(d,10)),m=l[3]/l[2],{width:g,height:u}=a;typeof g>"u"&&u?typeof u=="string"&&u.endsWith("%")?g=parseInt(u)/m+"%":g=parseInt(u)/m:typeof u>"u"&&g?typeof g=="string"&&g.endsWith("%")?u=parseInt(g)*m+"%":u=parseInt(g)*m:(g||(g=l[2]),u||(u=l[3])),r.width||(r.width=g),r.height||(r.height=u)}return e.setDisplay(K(r.display,{flex:i.DISPLAY_FLEX,none:i.DISPLAY_NONE},i.DISPLAY_FLEX)),e.setAlignContent(K(r.alignContent,{stretch:i.ALIGN_STRETCH,center:i.ALIGN_CENTER,"flex-start":i.ALIGN_FLEX_START,"flex-end":i.ALIGN_FLEX_END,"space-between":i.ALIGN_SPACE_BETWEEN,"space-around":i.ALIGN_SPACE_AROUND,baseline:i.ALIGN_BASELINE,normal:i.ALIGN_AUTO},i.ALIGN_AUTO)),e.setAlignItems(K(r.alignItems,{stretch:i.ALIGN_STRETCH,center:i.ALIGN_CENTER,"flex-start":i.ALIGN_FLEX_START,"flex-end":i.ALIGN_FLEX_END,baseline:i.ALIGN_BASELINE,normal:i.ALIGN_AUTO},i.ALIGN_FLEX_START)),e.setAlignSelf(K(r.alignSelf,{stretch:i.ALIGN_STRETCH,center:i.ALIGN_CENTER,"flex-start":i.ALIGN_FLEX_START,"flex-end":i.ALIGN_FLEX_END,baseline:i.ALIGN_BASELINE,normal:i.ALIGN_AUTO},i.ALIGN_AUTO)),e.setJustifyContent(K(r.justifyContent,{center:i.JUSTIFY_CENTER,"flex-start":i.JUSTIFY_FLEX_START,"flex-end":i.JUSTIFY_FLEX_END,"space-between":i.JUSTIFY_SPACE_BETWEEN,"space-around":i.JUSTIFY_SPACE_AROUND},i.JUSTIFY_FLEX_START)),e.setFlexDirection(K(r.flexDirection,{row:i.FLEX_DIRECTION_ROW,column:i.FLEX_DIRECTION_COLUMN,"row-reverse":i.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":i.FLEX_DIRECTION_COLUMN_REVERSE},i.FLEX_DIRECTION_ROW)),e.setFlexWrap(K(r.flexWrap,{wrap:i.WRAP_WRAP,nowrap:i.WRAP_NO_WRAP,"wrap-reverse":i.WRAP_WRAP_REVERSE},i.WRAP_NO_WRAP)),typeof r.flexBasis<"u"&&e.setFlexBasis(r.flexBasis),e.setFlexGrow(typeof r.flexGrow>"u"?0:r.flexGrow),e.setFlexShrink(typeof r.flexShrink>"u"?0:r.flexShrink),typeof r.maxHeight<"u"&&e.setMaxHeight(r.maxHeight),typeof r.maxWidth<"u"&&e.setMaxWidth(r.maxWidth),typeof r.minHeight<"u"&&e.setMinHeight(r.minHeight),typeof r.minWidth<"u"&&e.setMinWidth(r.minWidth),e.setOverflow(K(r.overflow,{visible:i.OVERFLOW_VISIBLE,hidden:i.OVERFLOW_HIDDEN},i.OVERFLOW_VISIBLE)),e.setMargin(i.EDGE_TOP,r.marginTop||0),e.setMargin(i.EDGE_BOTTOM,r.marginBottom||0),e.setMargin(i.EDGE_LEFT,r.marginLeft||0),e.setMargin(i.EDGE_RIGHT,r.marginRight||0),e.setBorder(i.EDGE_TOP,r.borderWidth||0),e.setBorder(i.EDGE_BOTTOM,r.borderWidth||0),e.setBorder(i.EDGE_LEFT,r.borderWidth||0),e.setBorder(i.EDGE_RIGHT,r.borderWidth||0),e.setPadding(i.EDGE_TOP,r.paddingTop||0),e.setPadding(i.EDGE_BOTTOM,r.paddingBottom||0),e.setPadding(i.EDGE_LEFT,r.paddingLeft||0),e.setPadding(i.EDGE_RIGHT,r.paddingRight||0),e.setPositionType(K(r.position,{absolute:i.POSITION_TYPE_ABSOLUTE,relative:i.POSITION_TYPE_RELATIVE},i.POSITION_TYPE_RELATIVE)),typeof r.top<"u"&&e.setPosition(i.EDGE_TOP,r.top),typeof r.bottom<"u"&&e.setPosition(i.EDGE_BOTTOM,r.bottom),typeof r.left<"u"&&e.setPosition(i.EDGE_LEFT,r.left),typeof r.right<"u"&&e.setPosition(i.EDGE_RIGHT,r.right),typeof r.height<"u"?e.setHeight(r.height):e.setHeightAuto(),typeof r.width<"u"?e.setWidth(r.width):e.setWidthAuto(),[r,De(r)]}function le({left:e,top:t,width:n,height:o},a,i,r){var l,m,g,u;let s;if(i)s=a;else{let d=(m=r==null?void 0:r.xAbsolute)!=null?m:((l=r==null?void 0:r.xRelative)!=null?l:50)*n/100,h=(u=r==null?void 0:r.yAbsolute)!=null?u:((g=r==null?void 0:r.yRelative)!=null?g:50)*o/100,f=e+d,c=t+h;s=pe([1,0,0,1,f,c],pe(a,[1,0,0,1,-f,-c])),a.__parent&&(s=pe(a.__parent,s)),a.splice(0,6,...s)}return`matrix(${s.map(d=>d.toFixed(2)).join(",")})`}function At({left:e,top:t,width:n,height:o,isInheritingTransform:a},i){let r="",s=1;return i.transform&&(r=le({left:e,top:t,width:n,height:o},i.transform,a,i.transformOrigin)),i.opacity&&(s=+i.opacity),{matrix:r,opacity:s}}function Ve({id:e,content:t,filter:n,left:o,top:a,width:i,height:r,matrix:s,opacity:l,image:m,clipPathId:g,debug:u,shape:d,decorationShape:h},f){let c="";if(u&&(c=x("rect",{x:o,y:a-r,width:i,height:r,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:s||void 0,"clip-path":g?`url(#${g})`:void 0})),m){let y={href:m,x:o,y:a,width:i,height:r,transform:s||void 0,"clip-path":g?`url(#${g})`:void 0,style:f.filter?`filter:${f.filter}`:void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+x("image",{...y,opacity:l!==1?l:void 0})+(h||"")+(n?"</g>":"")+c,""]}let b={x:o,y:a,width:i,height:r,"font-weight":f.fontWeight,"font-style":f.fontStyle,"font-size":f.fontSize,"font-family":f.fontFamily,"letter-spacing":f.letterSpacing||void 0,transform:s||void 0,"clip-path":g?`url(#${g})`:void 0,style:f.filter?`filter:${f.filter}`:void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+x("text",{...b,fill:f.color,opacity:l!==1?l:void 0},t)+(h||"")+(n?"</g>":"")+c,d?x("text",b,t):""]}function fe({id:e,width:t,height:n},o){if(!o.shadowColor||!o.shadowOffset||typeof o.shadowRadius>"u")return"";let a=o.shadowRadius*o.shadowRadius/4,i=Math.min(o.shadowOffset.width-a,0),r=Math.max(o.shadowOffset.width+a+t,t),s=Math.min(o.shadowOffset.height-a,0),l=Math.max(o.shadowOffset.height+a+n,n);return`<defs><filter id="satori_s-${e}" x="${i/t*100}%" y="${s/n*100}%" width="${(r-i)/t*100}%" height="${(l-s)/n*100}%"><feDropShadow dx="${o.shadowOffset.width}" dy="${o.shadowOffset.height}" stdDeviation="${o.shadowRadius/2}" flood-color="${o.shadowColor}" flood-opacity="1"/></filter></defs>`}function Je({width:e,left:t,top:n,ascender:o,clipPathId:a},i){let{textDecorationColor:r,textDecorationStyle:s,textDecorationLine:l,fontSize:m}=i;if(!l||l==="none")return"";let g=Math.max(1,m*.1),u=l==="line-through"?n+o*.5:l==="underline"?n+o*1.1:n,d=s==="dashed"?`${g*1.2} ${g*2}`:s==="dotted"?`0 ${g*2}`:void 0;return x("line",{x1:t,y1:u,x2:t+e,y2:u,stroke:r,"stroke-width":g,"stroke-dasharray":d,"stroke-linecap":s==="dotted"?"round":"square","clip-path":a?`url(#${a})`:void 0})}var qe=void 0;async function*Ke(e,t){var dt;let n=ee(),{parentStyle:o,inheritedStyle:a,parent:i,font:r,id:s,isInheritingTransform:l,debug:m,embedFont:g,graphemeImages:u,canLoadAdditionalAssets:d}=t;o.textTransform==="uppercase"?e=e.toLocaleUpperCase(qe):o.textTransform==="lowercase"?e=e.toLocaleLowerCase(qe):o.textTransform==="capitalize"&&(e=ae(e,"word").map(_=>ae(_,"grapheme").map((C,A)=>A===0?C.toLocaleUpperCase(qe):C).join("")).join(""));let h=K(o.wordBreak,{normal:"word","break-all":"grapheme","break-word":"grapheme","keep-all":"word"},"word"),f=ae(e,h),c=n.Node.create();c.setAlignItems(n.ALIGN_BASELINE),o.textAlign==="left"?c.setJustifyContent(n.JUSTIFY_FLEX_START):o.textAlign==="center"?c.setJustifyContent(n.JUSTIFY_CENTER):o.textAlign==="right"?c.setJustifyContent(n.JUSTIFY_FLEX_END):o.textAlign==="justify"&&c.setJustifyContent(n.JUSTIFY_SPACE_BETWEEN),i.insertChild(c,i.getChildCount());let{textAlign:b,textOverflow:y,whiteSpace:v,lineHeight:O,filter:$,_inheritedBackgroundClipTextPath:N}=o,W=o.fontSize,R=r.getEngine(W,O,o),V=d?f.filter(_=>!R.check(_)):[];yield V,V.length&&(R=r.getEngine(W,O,o));let L=[],E=[],M=[],G=[],z=new Map,k=_=>{let C=0;for(let A of _){if(z.has(A)){C+=z.get(A);continue}let U=R.measure(A,o);z.set(A,U),C+=U}return C},P=0,J=[],p=0;for(let _ of f){let C=!1,A=u&&u[_];v==="pre"?C=_[0]===`
`:v!=="nowrap"&&(A||Re.includes(_[0]))&&(C=!0),C?(v==="nowrap"?p+=k(J)+o.fontSize:(P=Math.max(P,k(J)),A&&(P=Math.max(P,o.fontSize))),J=[]):(!Re.includes(_[0])||!J.length)&&J.push(_===`
`?" ":_)}P=Math.max(P,k(J)+p);let w=i.getMinWidth(),I=i.getMaxWidth(),Z=i.getWidth();isNaN(Z.value)&&(isNaN(w.value)||w.unit===1&&w.value>P)&&(isNaN(I.value)||I.unit===1&&(P=Math.min(P,I.value)),i.setMinWidth(P)),typeof o.flexShrink>"u"&&i.setFlexShrink(1);let ge=v==="pre-wrap"||v==="pre";c.setMeasureFunc(_=>{let C=0,A="",U=0,H=0,Y=0,X=-1,re=0,F=0,ie=0;L=[],M=[0];for(let ne=0;ne<f.length;ne++){let D=f[ne];if(!ge&&Re.includes(D[0]))A||(A=" "),U=k([A]),G[ne]=null;else{let oe=ge&&D===`
`,j=oe?0:u&&u[D]?o.fontSize:k([D]);H||(A="",U=0);let B=U||",.!?:-@)>]}%#".indexOf(D[0])<0,q=!H||!!U;if(oe||ne&&B&&H+U+j>_&&v!=="nowrap"&&v!=="pre")L.push(H),E.push(ie),C++,re+=F,H=j,F=j?R.height(D):0,ie=j?R.baseline(D):0,M.push(1),X=-1,oe||(Y=Math.max(Y,_));else{H+=U+j;let de=R.height(D);de>F&&(F=de,ie=R.baseline(D)),q&&M[M.length-1]++}A="",U=0,q&&X++,Y=Math.max(Y,H),G[ne]={y:re,x:H-j,width:j,line:C,lineIndex:X}}}return H&&(C++,L.push(H),E.push(ie),re+=F),{width:Y,height:re}});let[$t,Mt]=yield,Pe="",we="",te=a._inheritedClipPathId,{left:st,top:lt,width:ve,height:ft}=c.getComputedLayout(),Oe=i.getComputedWidth()-i.getComputedPadding(n.EDGE_LEFT)-i.getComputedPadding(n.EDGE_RIGHT)-i.getComputedBorder(n.EDGE_LEFT)-i.getComputedBorder(n.EDGE_RIGHT),ue=$t+st,ce=Mt+lt,{matrix:Q,opacity:Ee}=At({left:st,top:lt,width:ve,height:ft,isInheritingTransform:l},o),ke="";o.textShadowOffset&&(ke=fe({width:ve,height:ft,id:s},{shadowColor:o.textShadowColor,shadowOffset:o.textShadowOffset,shadowRadius:o.textShadowRadius}));let me="",Se="",ut="",Fe=-1,ct=y==="ellipsis"?k(["\u2026"]):0,Wt=y==="ellipsis"?k([" "]):0,Te={};for(let _=0;_<f.length;_++){if(!G[_])continue;let C=G[_],A=f[_],U=null,H=u?u[A]:null,Y=C.y,X=C.x,re=C.width,F=C.line;if(F===Fe)continue;let ie=!1;if(L.length>1){let B=ve-L[F];if(b==="right"||b==="end")X+=B;else if(b==="center")X+=B/2;else if(b==="justify"&&F<L.length-1){let q=M[F];X+=(q>1?B/(q-1):0)*C.lineIndex,ie=!0}}if(Te[F]||(Te[F]=[X,ie?ve:L[F]]),y==="ellipsis"&&L[F]>Oe&&C.x+re+ct+Wt>Oe){let B=ae(A,"grapheme"),q="",de=0;for(let pt of B){let gt=C.x+k([q+pt]);if(q&&gt+ct>Oe)break;q+=pt,de=gt}A=q+"\u2026",Fe=F,Te[F][1]=de}let ne=E[F],D=R.baseline(A),oe=R.height(A),j=ne-D;if(H?Y+=0:g?(U=R.getSVG(A,{...o,left:ue+X,top:ce+Y+D+j,letterSpacing:o.letterSpacing}),m&&(ut+=x("rect",{x:ue+X,y:ce+Y+j,width:C.width,height:oe,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:Q||void 0,"clip-path":te?`url(#${te})`:void 0})+x("line",{x1:ue+X,x2:ue+X+C.width,y1:ce+Y+j+D,y2:ce+Y+j+D,stroke:"#14c000","stroke-width":1,transform:Q||void 0,"clip-path":te?`url(#${te})`:void 0}))):Y+=D+j,o.textDecorationLine&&(F!==((dt=G[_+1])==null?void 0:dt.line)||Fe===F)){let B=Te[F];B&&!B[2]&&(me+=Je({left:ue+B[0],top:ce+oe*+F,width:B[1],ascender:R.baseline(A),clipPathId:te},o),B[2]=1)}if(U!==null)Se+=U+" ";else{let[B,q]=Ve({content:A,filter:ke,id:s,left:ue+X,top:ce+Y,width:re,height:oe,matrix:Q,opacity:Ee,image:H,clipPathId:te,debug:m,shape:!!N,decorationShape:me},o);Pe+=B,we+=q,me=""}}if(Se){let _=o.color!=="transparent"&&Ee!==0?x("path",{fill:o.color,d:Se,transform:Q||void 0,opacity:Ee!==1?Ee:void 0,"clip-path":te?`url(#${te})`:void 0,style:$?`filter:${$}`:void 0}):"";N&&(we=x("path",{d:Se,transform:Q||void 0})),Pe+=(ke?ke+x("g",{filter:`url(#satori_s-${s})`},_+me):_+me)+ut}return we&&(o._inheritedBackgroundClipTextPath.value+=we),Pe}var Ze=Ze||{};Ze.parse=function(){var e={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function n(p){var w=new Error(t+": "+p);throw w.source=t,w}function o(){var p=a();return t.length>0&&n("Invalid input not EOF"),p}function a(){return O(i)}function i(){return r("linear-gradient",e.linearGradient,l)||r("repeating-linear-gradient",e.repeatingLinearGradient,l)||r("radial-gradient",e.radialGradient,u)||r("repeating-radial-gradient",e.repeatingRadialGradient,u)}function r(p,w,I){return s(w,function(Z){var ge=I();return ge&&(P(e.comma)||n("Missing comma before color stops")),{type:p,orientation:ge,colorStops:O($)}})}function s(p,w){var I=P(p);if(I){P(e.startCall)||n("Missing (");var Z=w(I);return P(e.endCall)||n("Missing )"),Z}}function l(){return m()||g()}function m(){return k("directional",e.sideOrCorner,1)}function g(){return k("angular",e.angleValue,1)}function u(){var p,w=d(),I;return w&&(p=[],p.push(w),I=t,P(e.comma)&&(w=d(),w?p.push(w):t=I)),p}function d(){var p=h()||f();if(p)p.at=b();else{var w=c();if(w){p=w;var I=b();I&&(p.at=I)}else{var Z=y();Z&&(p={type:"default-radial",at:Z})}}return p}function h(){var p=k("shape",/^(circle)/i,0);return p&&(p.style=z()||c()),p}function f(){var p=k("shape",/^(ellipse)/i,0);return p&&(p.style=M()||c()),p}function c(){return k("extent-keyword",e.extentKeywords,1)}function b(){if(k("position",/^at/,0)){var p=y();return p||n("Missing positioning value"),p}}function y(){var p=v();if(p.x||p.y)return{type:"position",value:p}}function v(){return{x:M(),y:M()}}function O(p){var w=p(),I=[];if(w)for(I.push(w);P(e.comma);)w=p(),w?I.push(w):n("One extra comma");return I}function $(){var p=N();return p||n("Expected color definition"),p.length=M(),p}function N(){return R()||L()||V()||W()}function W(){return k("literal",e.literalColor,0)}function R(){return k("hex",e.hexColor,1)}function V(){return s(e.rgbColor,function(){return{type:"rgb",value:O(E)}})}function L(){return s(e.rgbaColor,function(){return{type:"rgba",value:O(E)}})}function E(){return P(e.number)[1]}function M(){return k("%",e.percentageValue,1)||G()||z()}function G(){return k("position-keyword",e.positionKeywords,1)}function z(){return k("px",e.pixelValue,1)||k("em",e.emValue,1)}function k(p,w,I){var Z=P(w);if(Z)return{type:p,value:Z[I]}}function P(p){var w,I;return I=/^[\n\r\t\s]+/.exec(t),I&&J(I[0].length),w=p.exec(t),w&&J(w[0].length),w}function J(p){t=t.substr(p)}return function(p){return t=p.toString(),o()}}();var Qe=Ze;function mn(e){return e.type==="literal"?e.value:e.type==="hex"?`#${e.value}`:e.type==="rgb"?`rgb(${e.value.join(",")})`:e.type==="rgba"?`rgba(${e.value.join(",")})`:"transparent"}function hn(e,t){return typeof e=="string"&&e.endsWith("%")?t*parseFloat(e)/100:+e}function et(e,{x:t,y:n,defaultX:o,defaultY:a}){return(e?e.split(" ").map(i=>{try{let r=new se(i);return r.type==="length"||r.type==="number"?r.value:r.value+r.unit}catch{return null}}).filter(i=>i!==null):[o,a]).map((i,r)=>hn(i,[t,n][r]))}function Lt(e,t){let n=[];for(let r of t){let s=mn(r);if(!n.length&&(n.push({offset:0,color:s}),typeof r.length>"u"||r.length.value==="0"))continue;let l=typeof r.length>"u"?void 0:r.length.type==="%"?r.length.value/100:r.length.value/e;n.push({offset:l,color:s})}n.length||n.push({offset:0,color:"transparent"});let o=n[n.length-1];o.offset!==1&&(typeof o.offset>"u"?o.offset=1:n.push({offset:1,color:o.color}));let a=0,i=1;for(let r=0;r<n.length;r++)if(typeof n[r].offset>"u"){for(i<r&&(i=r);typeof n[i].offset>"u";)i++;n[r].offset=(n[i].offset-n[a].offset)/(i-a)*(r-a)+n[a].offset}else a=r;return n}async function tt({id:e,width:t,height:n},{image:o,size:a,position:i,repeat:r}){r=r||"repeat";let s=r==="repeat-x"||r==="repeat",l=r==="repeat-y"||r==="repeat",m=et(a,{x:t,y:n,defaultX:t,defaultY:n}),g=et(i,{x:t,y:n,defaultX:0,defaultY:0});if(o.startsWith("linear-gradient(")){let u=Qe.parse(o)[0],d,h,f,c;if(u.orientation.type==="directional")[d,h,f,c]={top:[0,1,0,0],bottom:[0,0,0,1],left:[1,0,0,0],right:[0,0,1,0]}[u.orientation.value];else if(u.orientation.type==="angular"){let y=+u.orientation.value/180*Math.PI-Math.PI/2,v=Math.cos(y),O=Math.sin(y);d=0,h=0,f=v,c=O,f<0&&(d-=f,f=0),c<0&&(h-=c,c=0)}let b=Lt(t,u.colorStops);return[`satori_bi${e}`,`<linearGradient id="satori_bi${e}" x1="${d}" y1="${h}" x2="${f}" y2="${c}">${b.map(y=>`<stop offset="${y.offset*100}%" stop-color="${y.color}"/>`).join("")}</linearGradient>`]}if(o.startsWith("radial-gradient(")){let u=Qe.parse(o)[0],d=u.orientation[0],[h,f]=m,c="circle",b=h/2,y=f/2;if(d.type==="shape"){if(c=d.value,d.at)if(d.at.type==="position")b=d.at.value.x.value,y=d.at.value.y.value;else throw new Error("orientation.at.type not implemented: "+d.at.type)}else throw new Error("orientation.type not implemented: "+d.type);let v=Lt(t,u.colorStops),O=`satori_radial_${e}`,$=`satori_pattern_${e}`,N={},W=Math.max(Math.abs(h-b),Math.abs(b)),R=Math.max(Math.abs(f-y),Math.abs(y));if(c==="circle")N.r=Math.sqrt(W*W+R*R);else if(c==="ellipse"){let E=R!==0?W/R:1;N.ry=Math.sqrt(W*W+R*R*E*E)/E,N.rx=N.ry*E}let V=x("pattern",{id:$,x:g[0],y:g[1],width:s?h:"100%",height:l?f:"100%",patternUnits:"userSpaceOnUse"},x("radialGradient",{id:O},v.map(E=>x("stop",{offset:E.offset,"stop-color":E.color})).join(""))+x(c,{cx:b,cy:y,width:h,height:f,...N,fill:`url(#${O})`}));return[$,V]}if(o.startsWith("url(")){let u=et(a,{x:t,y:n,defaultX:0,defaultY:0}),[d,h,f]=await Ce(o.slice(4,-1)),c=u[0]||h,b=u[1]||f;return[`satori_bi${e}`,x("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:g[0],y:g[1],width:s?c:"100%",height:l?b:"100%"},x("image",{x:0,y:0,width:c,height:b,href:d}))]}}function Ae(e,t,n){return n<e+t&&(n/2<e&&n/2<t?e=t=n/2:n/2<e?e=n-t:n/2<t&&(t=n-e)),[e,t]}function be({left:e,top:t,width:n,height:o},a){let{borderTopLeftRadius:i,borderTopRightRadius:r,borderBottomLeftRadius:s,borderBottomRightRadius:l}=a;return i=Math.min(i||0,n,o),r=Math.min(r||0,n,o),s=Math.min(s||0,n,o),l=Math.min(l||0,n,o),!i&&!r&&!s&&!l?"":([i,r]=Ae(i,r,n),[i,s]=Ae(i,s,o),[r,l]=Ae(r,l,o),[s,l]=Ae(s,l,n),`M${e+i},${t} h${n-i-r} a${r},${r} 0 0 1 ${r},${r} v${o-r-l} a${l},${l} 0 0 1 ${-l},${l} h${l+s-n} a${s},${s} 0 0 1 ${-s},${-s} v${s+i-o} a${i},${i} 0 0 1 ${i},${-i}`)}function nt({left:e,top:t,width:n,height:o,path:a,id:i},r){return r.overflow!=="hidden"?"":a?x("clipPath",{id:`satori_cp-${i}`,"clip-path":r._inheritedClipPathId?`url(#${r._inheritedClipPathId})`:void 0},x("path",{x:e,y:t,width:n,height:o,d:a})):x("clipPath",{id:`satori_cp-${i}`,"clip-path":r._inheritedClipPathId?`url(#${r._inheritedClipPathId})`:void 0},x("rect",{x:e,y:t,width:n,height:o}))}async function rt({id:e,left:t,top:n,width:o,height:a,isInheritingTransform:i,debug:r},s){if(s.display==="none")return"";let l="rect",m="transparent",g="",u=0,d="",h="",f=[],c=1,b="";s.backgroundColor&&f.push(s.backgroundColor),s.borderWidth&&(u=s.borderWidth,m=s.borderColor,s.borderStyle==="dashed"&&(g=u*2+" "+u)),s.opacity&&(c=+s.opacity),s.transform&&(d=le({left:t,top:n,width:o,height:a},s.transform,i,s.transformOrigin));let y="";if(s.backgroundImage){let L=[];for(let E=0;E<s.backgroundImage.length;E++){let M=s.backgroundImage[E],G=await tt({id:e+"_"+E,width:o,height:a},M);G&&L.push(G)}for(let E of L)f.push(`url(#${E[0]})`),h+=E[1],E[2]&&(y+=E[2])}let v=be({left:t,top:n,width:o,height:a},s);v&&(l="path");let O=nt({left:t,top:n,width:o,height:a,path:v,id:e},s),$=s._inheritedClipPathId,N=fe({width:o,height:a,id:e},s);r&&(b=x("rect",{x:t,y:n,width:o,height:a,fill:"transparent",stroke:"#ff5757","stroke-width":1,"stroke-dasharray":g||void 0,transform:d||void 0,"clip-path":$?`url(#${$})`:void 0})),f.length||f.push("transparent");let{backgroundClip:W,filter:R}=s,V=f.map((L,E)=>{if(L==="transparent"&&!(E===f.length-1&&u))return"";let M=!!u,G=E===f.length-1&&M&&W!=="text",z=W==="text"?`url(#satori_bct-${e})`:$?`url(#${$})`:void 0;return G&&(h+=x("clipPath",{id:`satori_bc-${e}`,"clip-path":z},x(l,{x:t,y:n,width:o,height:a,d:v||void 0})),z=`url(#satori_bc-${e})`),x(l,{x:t,y:n,width:o,height:a,fill:L,stroke:G||M?m:void 0,"stroke-width":G?u*2:M?1:void 0,"stroke-dasharray":g||void 0,d:v||void 0,transform:d||void 0,"clip-path":z,style:R?`filter:${R}`:void 0})}).join("");return W==="text"&&u&&(V=x(l,{x:t,y:n,width:o,height:a,fill:"transparent",stroke:m,"stroke-width":u*2,"stroke-dasharray":g||void 0,d:v||void 0,transform:d||void 0,"clip-path":$?`url(#${$})`:void 0})+V),(h?`<defs>${h}</defs>`:"")+O+(N?`${N}<g filter="url(#satori_s-${e})">`:"")+(c!==1?`<g opacity="${c}">`:"")+(y||V)+(c!==1?"</g>":"")+(N?"</g>":"")+b}function Le({id:e,left:t,top:n,width:o,height:a,src:i,debug:r,isInheritingTransform:s},l){if(l.display==="none")return"";let m="",g=1,u="",d=l.objectFit==="contain"?"xMidYMid":l.objectFit==="cover"?"xMidYMid slice":"none",h=be({left:t,top:n,width:o,height:a},l),f=l._inheritedClipPathId;h&&(m=x("clipPath",{id:`satori_c-${e}`,"clip-path":f?`url(#${f})`:void 0},x("path",{x:t,y:n,width:o,height:a,d:h}))),l.opacity&&(g=+l.opacity);let c=fe({width:o,height:a,id:e},l);return l.transform&&(u=le({left:t,top:n,width:o,height:a},l.transform,s,l.transformOrigin)),c+(c?`<g filter="url(#satori_s-${e})">`:"")+m+x("image",{x:t,y:n,width:o,height:a,href:i,preserveAspectRatio:d,transform:u||void 0,"clip-path":m?`url(#satori_c-${e})`:f?`url(#${f})`:void 0})+(c?"</g>":"")}async function*ye(e,t){var J;let n=ee(),{id:o,inheritedStyle:a,parent:i,font:r,debug:s,embedFont:l=!0,graphemeImages:m,canLoadAdditionalAssets:g}=t;if(e===null||typeof e>"u")return yield,yield,"";if(!Ge(e)||typeof e.type=="function"){let p;if(!Ge(e))p=Ke(String(e),t),yield(await p.next()).value;else{if(bt(e.type))throw new Error("Class component is not supported.");p=ye(e.type(e.props),t),yield(await p.next()).value}await p.next();let w=yield;return(await p.next(w)).value}let{type:u,props:d}=e,{style:h,children:f}=d||{},c=n.Node.create();i.insertChild(c,i.getChildCount());let[b,y]=await je(c,u,a,h,d),v=b.transform===a.transform;if(v||(b.transform.__parent=a.transform),b.overflow==="hidden"&&(y._inheritedClipPathId=`satori_cp-${o}`),b.backgroundClip==="text"){let p={value:""};y._inheritedBackgroundClipTextPath=p,b._inheritedBackgroundClipTextPath=p}let O=yt(f),$=[],N=0,W=[];for(let p of O){let w=ye(p,{id:o+"-"+N++,parentStyle:b,inheritedStyle:y,isInheritingTransform:!0,parent:c,font:r,embedFont:l,debug:s,graphemeImages:m,canLoadAdditionalAssets:g});g?W.push(...(await w.next()).value||[]):await w.next(),$.push(w)}yield W;for(let p of $)await p.next();let[R,V]=yield,{left:L,top:E,width:M,height:G}=c.getComputedLayout();L+=R,E+=V;let z="",k="",P="";if(u==="img"){let p=b.__src;k=Le({id:o,left:L,top:E,width:M,height:G,src:p,isInheritingTransform:v,debug:s},b)}else if(u==="svg"){let p=vt(e);k=Le({id:o,left:L,top:E,width:M,height:G,src:p,isInheritingTransform:v,debug:s},b)}else{let p=(J=h==null?void 0:h.display)!=null?J:"block";if(u==="div"&&f&&typeof f!="string"&&p!=="flex"&&p!=="none")throw new Error(`Expected <div> to have style={{display: 'flex'}} but received style={{display: '${p}'}}`);k=await rt({id:o,left:L,top:E,width:M,height:G,isInheritingTransform:v,debug:s},b)}for(let p of $)z+=(await p.next([L,E])).value;return b._inheritedBackgroundClipTextPath&&(P+=x("clipPath",{id:`satori_bct-${o}`,"clip-path":b._inheritedClipPathId?`url(#${b._inheritedClipPathId})`:void 0},b._inheritedBackgroundClipTextPath.value)),P+k+z}import it from"@shuding/opentype.js";function bn(e,t,[n,o],[a,i]){if(n!==a)return n?!a||n===e?-1:a===e?1:e===400&&n===500||e===500&&n===400?-1:e===400&&a===500||e===500&&a===400?1:e<400?n<e&&a<e?a-n:n<e?-1:a<e?1:n-a:e<n&&e<a?n-a:e<n?-1:e<a?1:a-n:1;if(o!==i){if(o===t)return-1;if(i===t)return 1}return-1}var xe=class{constructor(t){this.fonts=new Map;this.addFonts(t)}get({name:t,weight:n,style:o}){if(!this.fonts.has(t))return null;n==="normal"&&(n=400),n==="bold"&&(n=700);let a=[...this.fonts.get(t)],i=a[0];for(let r=1;r<a.length;r++){let[,s,l]=i,[,m,g]=a[r];bn(n,o,[s,l],[m,g])>0&&(i=a[r])}return i[0]}addFonts(t){for(let n of t){let o=n.data,a=it.parse("buffer"in o?o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength):o,{lowMemory:!0}),i=a.charToGlyphIndex;a.charToGlyphIndex=s=>{let l=i.call(a,s);return l===0&&a._trackBrokenChars&&a._trackBrokenChars.push(s),l},this.defaultFont||(this.defaultFont=a);let r=n.name.toLowerCase();this.fonts.has(r)||this.fonts.set(r,[]),this.fonts.get(r).push([a,n.weight,n.style])}}getEngine(t=16,n=1.2,{fontFamily:o,fontWeight:a=400,fontStyle:i="normal"}){if(!this.fonts.size)throw new Error("No fonts are loaded. At least one font is required to calculate the layout.");o=(Array.isArray(o)?o:[o]).map(f=>f.toLowerCase());let r=o.map(f=>this.get({name:f,weight:a,style:i})).filter(Boolean),s=Array.from(this.fonts.keys());for(let f of s)o.includes(f)||r.push(this.get({name:f,weight:a,style:i}));let l=new Map,m=(f,c=!0)=>{let b=f.charCodeAt(0);if(l.has(b))return l.get(b);let y=r.find((v,O)=>!!v.charToGlyphIndex(f)||c&&O===r.length-1);return y&&l.set(b,y),y},g=(f,c=!1)=>{var y,v;return((c?(v=(y=f.tables)==null?void 0:y.os2)==null?void 0:v.sTypoAscender:0)||f.ascender)/f.unitsPerEm*t},u=(f,c=!1)=>{var y,v;return((c?(v=(y=f.tables)==null?void 0:y.os2)==null?void 0:v.sTypoDescender:0)||f.descender)/f.unitsPerEm*t},d=f=>m(f,!1),h={check:f=>{let c=d(f);return c?(c._trackBrokenChars=[],c.stringToGlyphs(f),c._trackBrokenChars.length?(c._trackBrokenChars=void 0,!1):!0):!1},baseline:(f,c=typeof f>"u"?r[0]:m(f))=>{let b=g(c,!0),y=u(c,!0),v=h.height(f,c),{yMax:O,yMin:$}=c.tables.head,N=b-y,W=(O/(O-$)-1)*N;return v*((1.2/n+1)/2)+W},height:(f,c=typeof f>"u"?r[0]:m(f))=>(g(c)-u(c))*(n/1.2),measure:(f,c)=>this.measure(m,f,c),getSVG:(f,c)=>this.getSVG(m,f,c)};return h}patchFontFallbackResolver(t,n){let o=[];t._trackBrokenChars=o;let a=t.stringToGlyphs;return t.stringToGlyphs=(i,...r)=>{let s=a.call(t,i,...r);for(let l=0;l<s.length;l++)if(s[l].unicode===void 0){let m=o.shift(),g=n(m);if(g!==t){let u=g.charToGlyph(m),d=t.unitsPerEm/g.unitsPerEm,h=new it.Path;h.unitsPerEm=t.unitsPerEm,h.commands=u.path.commands.map(c=>{let b={...c};for(let y in b)typeof b[y]=="number"&&(b[y]*=d);return b});let f=new it.Glyph({...u,advanceWidth:u.advanceWidth*d,xMin:u.xMin*d,xMax:u.xMax*d,yMin:u.yMin*d,yMax:u.yMax*d,path:h});s[l]=f}}return s},()=>{t.stringToGlyphs=a,t._trackBrokenChars=void 0}}measure(t,n,{fontSize:o,letterSpacing:a=0}){let i=t(n),r=this.patchFontFallbackResolver(i,t);try{return i.getAdvanceWidth(n,o,{letterSpacing:a/o})}finally{r()}}getSVG(t,n,{fontSize:o,top:a,left:i,letterSpacing:r=0}){let s=t(n),l=this.patchFontFallbackResolver(s,t);try{return o===0?"":s.getPath(n,i,a,o,{letterSpacing:r/o}).toPathData(1)}finally{l()}}};function ot({width:e,height:t,content:n}){return x("svg",{width:e,height:t,viewBox:`0 0 ${e} ${t}`,xmlns:"http://www.w3.org/2000/svg"},n)}var Pt={emoji:/\p{RI}\p{RI}|\p{Emoji}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?(\u{200D}\p{Emoji}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?)+|\p{EPres}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?|\p{Emoji}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})/u,ja:/\p{scx=Hira}|\p{scx=Kana}|[,;:]/u,ko:/\p{scx=Hangul}/u,zh:/\p{scx=Han}/u,th:/\p{scx=Thai}/u,bn:/\p{scx=Bengali}/u,ar:/\p{scx=Arabic}/u,ta:/\p{scx=Tamil}/u,ml:/\p{scx=Malayalam}/u,he:/\p{scx=Hebrew}/u,te:/\p{scx=Telugu}/u,devanagari:/\p{scx=Devanagari}/u};function Ot(e){for(let t in Pt)if(Pt[t].test(e))return t;return"unknown"}var at=new WeakMap;async function Ft(e,t){let n=ee();if(!n)throw new Error("Satori is not initialized.");let o;at.has(t.fonts)?o=at.get(t.fonts):at.set(t.fonts,o=new xe(t.fonts));let a=n.Node.create();a.setWidth(t.width),a.setHeight(t.height),a.setFlexDirection(n.FLEX_DIRECTION_ROW),a.setFlexWrap(n.WRAP_WRAP),a.setAlignContent(n.ALIGN_AUTO),a.setAlignItems(n.ALIGN_FLEX_START),a.setJustifyContent(n.JUSTIFY_FLEX_START),a.setOverflow(n.OVERFLOW_HIDDEN);let i={...t.graphemeImages},r=ye(e,{id:"id",parentStyle:{},inheritedStyle:{fontSize:16,fontWeight:"normal",fontFamily:"serif",fontStyle:"normal",lineHeight:1.2,color:"black",opacity:1,whiteSpace:"normal",_viewportWidth:t.width,_viewportHeight:t.height},parent:a,font:o,embedFont:t.embedFont,debug:t.debug,graphemeImages:i,canLoadAdditionalAssets:!!t.loadAdditionalAsset}),s=(await r.next()).value;if(t.loadAdditionalAsset&&s.length){s=Array.from(new Set(ae(s.join(""),"grapheme")));let m={};s.forEach(d=>{let h=Ot(d);m[h]=m[h]||[],h==="emoji"?m[h].push(d):m[h][0]=(m[h][0]||"")+d});let g=[],u={};await Promise.all(Object.entries(m).flatMap(([d,h])=>h.map(f=>t.loadAdditionalAsset(d,f).then(c=>{typeof c=="string"?u[f]=c:c&&g.push(c)})))),o.addFonts(g),Object.assign(i,u)}await r.next(),a.calculateLayout(t.width,t.height,n.DIRECTION_LTR);let l=(await r.next([0,0])).value;return a.freeRecursive(),ot({width:t.width,height:t.height,content:l})}export{Ft as default,Gt as init};
//# sourceMappingURL=index.js.map

@@ -1,5 +0,5 @@

var dt={};var $e;$e=dt.default;function Mt(e){$e=e}function ee(){return $e}function We(e){let t=typeof e;return!(t==="number"||t==="bigint"||t==="string"||t==="boolean")}function pt(e){return/^class\s/.test(Function.prototype.toString.call(e))}function gt(e){let t=typeof e>"u"?[]:[].concat(e).flat(1/0),n=[];for(let i=0;i<t.length;i++){let a=t[i];typeof a>"u"||typeof a=="boolean"||a===null||(typeof a=="number"&&(a=String(a)),typeof a=="string"&&n.length&&typeof n[n.length-1]=="string"?n[n.length-1]+=a:n.push(a))}return n}function pe(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function K(e,t,n){let i=t[e];return typeof i>"u"?n:i}var mt=void 0,Ne=typeof Intl<"u"&&"Segmenter"in Intl;if(!Ne)throw new Error("Intl.Segmenter does not exist, please use import a polyfill.");var Wt=Ne?new Intl.Segmenter(mt,{granularity:"word"}):null,Nt=Ne?new Intl.Segmenter(mt,{granularity:"grapheme"}):null,Re=[32,160,4961,65792,65793,4153,4241,10].map(e=>String.fromCodePoint(e));function ae(e,t){return t==="word"?[...Wt.segment(e)].map(n=>n.segment):[...Nt.segment(e)].map(n=>n.segment)}function y(e,t,n){let i="";for(let[a,o]of Object.entries(t))typeof o<"u"&&(i+=` ${a}="${o}"`);return n?`<${e}${i}>${n}</${e}>`:`<${e}${i}/>`}function ht(e=20){let t=new Map;function n(a,o){if(t.size>=e){let r=t.keys().next().value;t.delete(r)}t.set(a,o)}function i(a){if(!t.has(a))return;let r=t.get(a);return t.delete(a),t.set(a,r),r}return{set:n,get:i}}var bt={accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",allowReorder:"allowreorder",arabicForm:"arabic-form",attributeName:"attributename",attributeType:"attributetype",autoReverse:"autoreverse",baseFrequency:"basefrequency",baseProfile:"baseprofile",baselineShift:"baseline-shift",calcMode:"calcmode",capHeight:"cap-height",clipPath:"clip-path",clipPathUnits:"clippathunits",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentscripttype",contentStyleType:"contentstyletype",diffuseConstant:"diffuseconstant",dominantBaseline:"dominant-baseline",edgeMode:"edgemode",enableBackground:"enable-background",externalResourcesRequired:"externalresourcesrequired",fillOpacity:"fill-opacity",fillRule:"fill-rule",filterRes:"filterres",filterUnits:"filterunits",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphref",gradientTransform:"gradienttransform",gradientUnits:"gradientunits",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",kernelMatrix:"kernelmatrix",kernelUnitLength:"kernelunitlength",keyPoints:"keypoints",keySplines:"keysplines",keyTimes:"keytimes",lengthAdjust:"lengthadjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingconeangle",markerEnd:"marker-end",markerHeight:"markerheight",markerMid:"marker-mid",markerStart:"marker-start",markerUnits:"markerunits",markerWidth:"markerwidth",maskContentUnits:"maskcontentunits",maskUnits:"maskunits",numOctaves:"numoctaves",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathlength",patternContentUnits:"patterncontentunits",patternTransform:"patterntransform",patternUnits:"patternunits",pointerEvents:"pointer-events",pointsAtX:"pointsatx",pointsAtY:"pointsaty",pointsAtZ:"pointsatz",preserveAlpha:"preservealpha",preserveAspectRatio:"preserveaspectratio",primitiveUnits:"primitiveunits",refX:"refx",refY:"refy",renderingIntent:"rendering-intent",repeatCount:"repeatcount",repeatDur:"repeatdur",requiredExtensions:"requiredextensions",requiredFeatures:"requiredfeatures",shapeRendering:"shape-rendering",specularConstant:"specularconstant",specularExponent:"specularexponent",spreadMethod:"spreadmethod",startOffset:"startoffset",stdDeviation:"stddeviation",stitchTiles:"stitchtiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",suppressContentEditableWarning:"suppresscontenteditablewarning",suppressHydrationWarning:"suppresshydrationwarning",surfaceScale:"surfacescale",systemLanguage:"systemlanguage",tableValues:"tablevalues",targetX:"targetx",targetY:"targety",textAnchor:"text-anchor",textDecoration:"text-decoration",textLength:"textlength",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewbox",viewTarget:"viewtarget",wordSpacing:"word-spacing",writingMode:"writing-mode",xChannelSelector:"xchannelselector",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlLang:"xml:lang",xmlSpace:"xmlspace",xmlnsXlink:"xmlns:xlink",yChannelSelector:"ychannelselector",zoomAndPan:"zoomandpan"},Gt=/[\r\n%#()<>?[\\\]^`{|}"']/g;function Me(e){if(!e)return"";if(Array.isArray(e))return e.map(Me).join("");if(typeof e!="object")return String(e);let t=e.type;if(t==="text")throw new Error("<text> nodes are not currently supported, please convert them to <path>");let{children:n,...i}=e.props||{};return`<${t}${Object.entries(i).map(([a,o])=>` ${bt[a]||a}="${o}"`).join("")}>${Me(n)}</${t}>`}function yt(e){let{viewBox:t,viewbox:n,width:i,height:a,className:o,style:r,children:s,...l}=e.props||{};t||(t=n);let m=t.split(" ").map(p=>parseInt(p,10));return l.xmlns="http://www.w3.org/2000/svg",l.viewBox=t,l.width=m[2],l.height=m[3],`data:image/svg+xml;utf8,${`<svg${Object.entries(l).map(([p,d])=>` ${bt[p]||p}="${d}"`).join("")}>${Me(s)}</svg>`.replace(Gt,encodeURIComponent)}`}var xt={p:{display:"block",marginTop:"1em",marginBottom:"1em"},div:{display:"block"},blockquote:{display:"block",marginTop:"1em",marginBottom:"1em",marginLeft:40,marginRight:40},center:{display:"block",textAlign:"center"},hr:{display:"block",marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"auto",marginRight:"auto",borderWidth:1,borderStyle:"inset"},h1:{display:"block",fontSize:"2em",marginTop:"0.67em",marginBottom:"0.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h2:{display:"block",fontSize:"1.5em",marginTop:"0.83em",marginBottom:"0.83em",marginLeft:0,marginRight:0,fontWeight:"bold"},h3:{display:"block",fontSize:"1.17em",marginTop:"1em",marginBottom:"1em",marginLeft:0,marginRight:0,fontWeight:"bold"},h4:{display:"block",marginTop:"1.33em",marginBottom:"1.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},h5:{display:"block",fontSize:"0.83em",marginTop:"1.67em",marginBottom:"1.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h6:{display:"block",fontSize:"0.67em",marginTop:"2.33em",marginBottom:"2.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},u:{textDecoration:"underline"},strong:{fontWeight:"bold"},b:{fontWeight:"bold"},i:{fontStyle:"italic"},em:{fontStyle:"italic"},code:{fontFamily:"monospace"},kbd:{fontFamily:"monospace"},pre:{display:"block",fontFamily:"monospace",whiteSpace:"pre",marginTop:"1em",marginBottom:"1em"},mark:{backgroundColor:"yellow",color:"black"},big:{fontSize:"larger"},small:{fontSize:"smaller"},s:{textDecoration:"line-through"}};var Dt=new Set(["color","font","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","textAlign","textTransform","textShadowOffset","textShadowColor","textShadowRadius","textDecorationLine","textDecorationStyle","textDecorationColor","whiteSpace","transform","wordBreak","opacity","filter","_viewportWidth","_viewportHeight","_inheritedClipPathId","_inheritedBackgroundClipTextPath"]);function Ge(e){let t={};for(let n in e)Dt.has(n)&&(t[n]=e[n]);return t}import{getPropertyName as en,getStylesForProperty as tn}from"css-to-react-native";import{parseElementStyle as nn}from"css-background-parser";var he=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bt=he((e,t)=>{t.exports=["em","ex","ch","rem","vh","vw","vmin","vmax","px","mm","cm","in","pt","pc","mozmm"]}),Ut=he((e,t)=>{t.exports=["deg","grad","rad","turn"]}),zt=he((e,t)=>{t.exports=["dpi","dpcm","dppx"]}),Yt=he((e,t)=>{t.exports=["Hz","kHz"]}),Ht=he((e,t)=>{t.exports=["s","ms"]}),Xt=Bt(),wt=Ut(),Et=zt(),vt=Yt(),kt=Ht();function Be(e){if(/\.\D?$/.test(e))throw new Error("The dot should be followed by a number");if(/^[+-]{2}/.test(e))throw new Error("Only one leading +/- is allowed");if(jt(e)>1)throw new Error("Only one dot is allowed");if(/%$/.test(e)){this.type="percentage",this.value=De(e),this.unit="%";return}var t=Jt(e);if(!t){this.type="number",this.value=De(e);return}this.type=Kt(t),this.value=De(e.substr(0,e.length-t.length)),this.unit=t}Be.prototype.valueOf=function(){return this.value};Be.prototype.toString=function(){return this.value+(this.unit||"")};function se(e){return new Be(e)}function jt(e){var t=e.match(/\./g);return t?t.length:0}function De(e){var t=parseFloat(e);if(isNaN(t))throw new Error("Invalid number: "+e);return t}var Vt=[].concat(wt,vt,Xt,Et,kt);function Jt(e){var t=e.match(/\D+$/),n=t&&t[0];if(n&&Vt.indexOf(n)===-1)throw new Error("Invalid unit: "+n);return n}var qt=Object.assign(_e(wt,"angle"),_e(vt,"frequency"),_e(Et,"resolution"),_e(kt,"time"));function _e(e,t){return Object.fromEntries(e.map(n=>[n,t]))}function Kt(e){return qt[e]||"length"}import Zt from"postcss-value-parser";function Qt(e,t){try{let n=new se(e);switch(n.unit){case"px":return{absolute:n.value};case"em":return{absolute:n.value*t};case"rem":return{absolute:n.value*16};case"%":return{relative:n.value};default:return{}}}catch{return{}}}function Ue(e,t,n){switch(e){case"top":return{yRelative:0};case"left":return{xRelative:0};case"right":return{xRelative:100};case"bottom":return{yRelative:100};case"center":return{};default:let i=Qt(e,t);return i.absolute?{[n?"xAbsolute":"yAbsolute"]:i.absolute}:i.relative?{[n?"xRelative":"yRelative"]:i.relative}:{}}}function ze(e,t){if(typeof e=="number")return{xAbsolute:e};let n;try{n=Zt(e).nodes.filter(i=>i.type==="word").map(i=>i.value)}catch{return{}}return n.length===1?Ue(n[0],t,!0):n.length===2?((n[0]==="top"||n[0]==="bottom"||n[1]==="left"||n[1]==="right")&&n.reverse(),{...Ue(n[0],t,!0),...Ue(n[1],t,!1)}):{}}var rn=new Set(["flex","flexGrow","flexShrink","flexBasis","fontWeight","lineHeight","opacity","scale","scaleX","scaleY"]),on=new Set(["lineHeight"]),St=[1,0,0,1,0,0];function an(e,t,n,i){return e==="border"&&!n.includes(t.borderColor)?t.borderColor=i:e==="borderColor"?t.borderColor=t.borderTopColor:e==="textDecoration"&&!n.includes(t.textDecorationColor)&&(t.textDecorationColor=i),t}function Tt(e,t){return typeof t=="number"?rn.has(e)?on.has(e)?t:String(t):t+"px":t}function sn(e,t){return e==="lineHeight"?{lineHeight:Tt(e,t)}:e==="fontFamily"?{fontFamily:t.split(",").map(n=>n.trim().replace(/(^['"])|(['"]$)/g,"").toLocaleLowerCase())}:null}function Ye(e,t,n,{percentage:i}={percentage:!1}){if(typeof e=="number")return e;try{let a=new se(e);if(a.type==="length")switch(a.unit){case"em":return a.value*t;case"rem":return a.value*16;case"vw":return~~(a.value*n._viewportWidth/100);case"vh":return~~(a.value*n._viewportHeight/100);default:return a.value}else if(a.type==="angle")switch(a.unit){case"deg":return a.value;case"rad":return a.value*180/Math.PI;default:return a.value}else if(a.type==="percentage"&&i)return a.value/100*t}catch{}}function Ce(e,t){let n={};for(let a in e){if(a.startsWith("_")){n[a]=e[a];continue}let o=en(a);Object.assign(n,sn(o,e[a])||an(o,tn(o,Tt(o,e[a]),!0),e[a],e.color||t.color))}if(n.backgroundImage){let{backgrounds:a}=nn(n);n.backgroundImage=a}let i=typeof n.fontSize=="number"?n.fontSize:t.fontSize;if(typeof i=="string")try{let a=new se(i);switch(a.unit){case"em":i=a.value*t.fontSize;break;case"rem":i=a.value*16;break}}catch{i=16}typeof n.fontSize<"u"&&(n.fontSize=i),n.transformOrigin&&(n.transformOrigin=ze(n.transformOrigin,i));for(let a in n){let o=n[a];if(a==="lineHeight")typeof o=="string"&&(o=n[a]=Ye(o,i,t,{percentage:!0})/i);else if(typeof o=="string"){let r=Ye(o,i,t);typeof r<"u"&&(n[a]=r),o=n[a]}if(a==="opacity"&&(o=n[a]=o*t.opacity),a==="transform"){let r=[...St],s=o;for(let l of s){let m=Object.keys(l)[0],p=l[m],d=typeof p=="string"?Ye(p,i,t):p,g=[...St];switch(m){case"translateX":g[4]=d;break;case"translateY":g[5]=d;break;case"scale":g[0]=d,g[3]=d;break;case"scaleX":g[0]=d;break;case"scaleY":g[3]=d;break;case"rotate":let h=d*Math.PI/180,f=Math.cos(h),u=Math.sin(h);g[0]=f,g[1]=u,g[2]=-u,g[3]=f;break;case"skewX":g[2]=Math.tan(d*Math.PI/180);break;case"skewY":g[1]=Math.tan(d*Math.PI/180);break}r=pe(g,r)}n.transform=r}}return n}function He(e,t,n,i,a){let o=ee(),r={...n,...Ce(xt[t],n),...Ce(i,n)};if(t==="img"){let s=parseInt(a.width),m=parseInt(a.height)/s;r.width||(r.width=s),r.height||(r.height=m*r.width)}if(t==="svg"){let l=(a.viewBox||a.viewbox).split(" ").map(g=>parseInt(g,10)),m=l[3]/l[2],{width:p,height:d}=a;typeof p>"u"&&d?typeof d=="string"&&d.endsWith("%")?p=parseInt(d)/m+"%":p=parseInt(d)/m:typeof d>"u"&&p?typeof p=="string"&&p.endsWith("%")?d=parseInt(p)*m+"%":d=parseInt(p)*m:(p||(p=l[2]),d||(d=l[3])),r.width||(r.width=p),r.height||(r.height=d)}return e.setDisplay(K(r.display,{flex:o.DISPLAY_FLEX,none:o.DISPLAY_NONE},o.DISPLAY_FLEX)),e.setAlignContent(K(r.alignContent,{stretch:o.ALIGN_STRETCH,center:o.ALIGN_CENTER,"flex-start":o.ALIGN_FLEX_START,"flex-end":o.ALIGN_FLEX_END,"space-between":o.ALIGN_SPACE_BETWEEN,"space-around":o.ALIGN_SPACE_AROUND,baseline:o.ALIGN_BASELINE,normal:o.ALIGN_AUTO},o.ALIGN_AUTO)),e.setAlignItems(K(r.alignItems,{stretch:o.ALIGN_STRETCH,center:o.ALIGN_CENTER,"flex-start":o.ALIGN_FLEX_START,"flex-end":o.ALIGN_FLEX_END,baseline:o.ALIGN_BASELINE,normal:o.ALIGN_AUTO},o.ALIGN_FLEX_START)),e.setAlignSelf(K(r.alignSelf,{stretch:o.ALIGN_STRETCH,center:o.ALIGN_CENTER,"flex-start":o.ALIGN_FLEX_START,"flex-end":o.ALIGN_FLEX_END,baseline:o.ALIGN_BASELINE,normal:o.ALIGN_AUTO},o.ALIGN_AUTO)),e.setJustifyContent(K(r.justifyContent,{center:o.JUSTIFY_CENTER,"flex-start":o.JUSTIFY_FLEX_START,"flex-end":o.JUSTIFY_FLEX_END,"space-between":o.JUSTIFY_SPACE_BETWEEN,"space-around":o.JUSTIFY_SPACE_AROUND},o.JUSTIFY_FLEX_START)),e.setFlexDirection(K(r.flexDirection,{row:o.FLEX_DIRECTION_ROW,column:o.FLEX_DIRECTION_COLUMN,"row-reverse":o.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":o.FLEX_DIRECTION_COLUMN_REVERSE},o.FLEX_DIRECTION_ROW)),e.setFlexWrap(K(r.flexWrap,{wrap:o.WRAP_WRAP,nowrap:o.WRAP_NO_WRAP,"wrap-reverse":o.WRAP_WRAP_REVERSE},o.WRAP_NO_WRAP)),typeof r.flexBasis<"u"&&e.setFlexBasis(r.flexBasis),e.setFlexGrow(typeof r.flexGrow>"u"?0:r.flexGrow),e.setFlexShrink(typeof r.flexShrink>"u"?0:r.flexShrink),typeof r.maxHeight<"u"&&e.setMaxHeight(r.maxHeight),typeof r.maxWidth<"u"&&e.setMaxWidth(r.maxWidth),typeof r.minHeight<"u"&&e.setMinHeight(r.minHeight),typeof r.minWidth<"u"&&e.setMinWidth(r.minWidth),e.setOverflow(K(r.overflow,{visible:o.OVERFLOW_VISIBLE,hidden:o.OVERFLOW_HIDDEN},o.OVERFLOW_VISIBLE)),e.setMargin(o.EDGE_TOP,r.marginTop||0),e.setMargin(o.EDGE_BOTTOM,r.marginBottom||0),e.setMargin(o.EDGE_LEFT,r.marginLeft||0),e.setMargin(o.EDGE_RIGHT,r.marginRight||0),e.setBorder(o.EDGE_TOP,r.borderWidth||0),e.setBorder(o.EDGE_BOTTOM,r.borderWidth||0),e.setBorder(o.EDGE_LEFT,r.borderWidth||0),e.setBorder(o.EDGE_RIGHT,r.borderWidth||0),e.setPadding(o.EDGE_TOP,r.paddingTop||0),e.setPadding(o.EDGE_BOTTOM,r.paddingBottom||0),e.setPadding(o.EDGE_LEFT,r.paddingLeft||0),e.setPadding(o.EDGE_RIGHT,r.paddingRight||0),e.setPositionType(K(r.position,{absolute:o.POSITION_TYPE_ABSOLUTE,relative:o.POSITION_TYPE_RELATIVE},o.POSITION_TYPE_RELATIVE)),typeof r.top<"u"&&e.setPosition(o.EDGE_TOP,r.top),typeof r.bottom<"u"&&e.setPosition(o.EDGE_BOTTOM,r.bottom),typeof r.left<"u"&&e.setPosition(o.EDGE_LEFT,r.left),typeof r.right<"u"&&e.setPosition(o.EDGE_RIGHT,r.right),typeof r.height<"u"?e.setHeight(r.height):e.setHeightAuto(),typeof r.width<"u"?e.setWidth(r.width):e.setWidthAuto(),[r,Ge(r)]}function le({left:e,top:t,width:n,height:i},a,o,r){var l,m,p,d;let s;if(o)s=a;else{let g=(m=r==null?void 0:r.xAbsolute)!=null?m:((l=r==null?void 0:r.xRelative)!=null?l:50)*n/100,h=(d=r==null?void 0:r.yAbsolute)!=null?d:((p=r==null?void 0:r.yRelative)!=null?p:50)*i/100,f=e+g,u=t+h;s=pe([1,0,0,1,f,u],pe(a,[1,0,0,1,-f,-u])),a.__parent&&(s=pe(a.__parent,s)),a.splice(0,6,...s)}return`matrix(${s.map(g=>g.toFixed(2)).join(",")})`}function Rt({left:e,top:t,width:n,height:i,isInheritingTransform:a},o){let r="",s=1;return o.transform&&(r=le({left:e,top:t,width:n,height:i},o.transform,a,o.transformOrigin)),o.opacity&&(s=+o.opacity),{matrix:r,opacity:s}}function Xe({id:e,content:t,filter:n,left:i,top:a,width:o,height:r,matrix:s,opacity:l,image:m,clipPathId:p,debug:d,shape:g,decorationShape:h},f){let u="";if(d&&(u=y("rect",{x:i,y:a-r,width:o,height:r,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:s||void 0,"clip-path":p?`url(#${p})`:void 0})),m){let x={href:m,x:i,y:a,width:o,height:r,transform:s||void 0,"clip-path":p?`url(#${p})`:void 0,style:f.filter?`filter:${f.filter}`:void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+y("image",{...x,opacity:l!==1?l:void 0})+(h||"")+(n?"</g>":"")+u,""]}let b={x:i,y:a,width:o,height:r,"font-weight":f.fontWeight,"font-style":f.fontStyle,"font-size":f.fontSize,"font-family":f.fontFamily,"letter-spacing":f.letterSpacing||void 0,transform:s||void 0,"clip-path":p?`url(#${p})`:void 0,style:f.filter?`filter:${f.filter}`:void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+y("text",{...b,fill:f.color,opacity:l!==1?l:void 0},t)+(h||"")+(n?"</g>":"")+u,g?y("text",b,t):""]}function fe({id:e,width:t,height:n},i){if(!i.shadowColor||!i.shadowOffset||typeof i.shadowRadius>"u")return"";let a=i.shadowRadius*i.shadowRadius/4,o=Math.min(i.shadowOffset.width-a,0),r=Math.max(i.shadowOffset.width+a+t,t),s=Math.min(i.shadowOffset.height-a,0),l=Math.max(i.shadowOffset.height+a+n,n);return`<defs><filter id="satori_s-${e}" x="${o/t*100}%" y="${s/n*100}%" width="${(r-o)/t*100}%" height="${(l-s)/n*100}%"><feDropShadow dx="${i.shadowOffset.width}" dy="${i.shadowOffset.height}" stdDeviation="${i.shadowRadius/2}" flood-color="${i.shadowColor}" flood-opacity="1"/></filter></defs>`}function je({width:e,left:t,top:n,ascender:i,clipPathId:a},o){let{textDecorationColor:r,textDecorationStyle:s,textDecorationLine:l,fontSize:m}=o;if(!l||l==="none")return"";let p=Math.max(1,m*.1),d=l==="line-through"?n+i*.5:l==="underline"?n+i*1.1:n,g=s==="dashed"?`${p*1.2} ${p*2}`:s==="dotted"?`0 ${p*2}`:void 0;return y("line",{x1:t,y1:d,x2:t+e,y2:d,stroke:r,"stroke-width":p,"stroke-dasharray":g,"stroke-linecap":s==="dotted"?"round":"square","clip-path":a?`url(#${a})`:void 0})}var Ve=void 0;async function*Je(e,t){var ft;let n=ee(),{parentStyle:i,inheritedStyle:a,parent:o,font:r,id:s,isInheritingTransform:l,debug:m,embedFont:p,graphemeImages:d,canLoadAdditionalAssets:g}=t;i.textTransform==="uppercase"?e=e.toLocaleUpperCase(Ve):i.textTransform==="lowercase"?e=e.toLocaleLowerCase(Ve):i.textTransform==="capitalize"&&(e=ae(e,"word").map(_=>ae(_,"grapheme").map((I,L)=>L===0?I.toLocaleUpperCase(Ve):I).join("")).join(""));let h=K(i.wordBreak,{normal:"word","break-all":"grapheme","break-word":"grapheme","keep-all":"word"},"word"),f=ae(e,h),u=n.Node.create();u.setAlignItems(n.ALIGN_BASELINE),i.textAlign==="left"?u.setJustifyContent(n.JUSTIFY_FLEX_START):i.textAlign==="center"?u.setJustifyContent(n.JUSTIFY_CENTER):i.textAlign==="right"?u.setJustifyContent(n.JUSTIFY_FLEX_END):i.textAlign==="justify"&&u.setJustifyContent(n.JUSTIFY_SPACE_BETWEEN),o.insertChild(u,o.getChildCount());let{textAlign:b,textOverflow:x,whiteSpace:E,lineHeight:F,filter:$,_inheritedBackgroundClipTextPath:N}=i,W=i.fontSize,R=r.getEngine(W,F,i),V=g?f.filter(_=>!R.check(_)):[];yield V,V.length&&(R=r.getEngine(W,F,i));let A=[],v=[],M=[],G=[],z=new Map,k=_=>{let I=0;for(let L of _){if(z.has(L)){I+=z.get(L);continue}let U=R.measure(L,i);z.set(L,U),I+=U}return I},O=0,J=[],c=0;for(let _ of f){let I=!1,L=d&&d[_];E==="pre"?I=_[0]===`
`:E!=="nowrap"&&(L||Re.includes(_[0]))&&(I=!0),I?(E==="nowrap"?c+=k(J)+i.fontSize:(O=Math.max(O,k(J)),L&&(O=Math.max(O,i.fontSize))),J=[]):(!Re.includes(_[0])||!J.length)&&J.push(_===`
`?" ":_)}O=Math.max(O,k(J)+c);let w=o.getMinWidth(),C=o.getMaxWidth(),Z=o.getWidth();isNaN(Z.value)&&(isNaN(w.value)||w.unit===1&&w.value>O)&&(isNaN(C.value)||C.unit===1&&(O=Math.min(O,C.value)),o.setMinWidth(O)),typeof i.flexShrink>"u"&&o.setFlexShrink(1);let ge=E==="pre-wrap"||E==="pre";u.setMeasureFunc(_=>{let I=0,L="",U=0,Y=0,H=0,X=-1,re=0,P=0,ie=0;A=[],M=[0];for(let ne=0;ne<f.length;ne++){let D=f[ne];if(!ge&&Re.includes(D[0]))L||(L=" "),U=k([L]),G[ne]=null;else{let oe=ge&&D===`
`,j=oe?0:d&&d[D]?i.fontSize:k([D]);Y||(L="",U=0);let B=U||",.!?:-@)>]}%#".indexOf(D[0])<0,q=!Y||!!U;if(oe||ne&&B&&Y+U+j>_&&E!=="nowrap"&&E!=="pre")A.push(Y),v.push(ie),I++,re+=P,Y=j,P=j?R.height(D):0,ie=j?R.baseline(D):0,M.push(1),X=-1,oe||(H=Math.max(H,_));else{Y+=U+j;let de=R.height(D);de>P&&(P=de,ie=R.baseline(D)),q&&M[M.length-1]++}L="",U=0,q&&X++,H=Math.max(H,Y),G[ne]={y:re,x:Y-j,width:j,line:I,lineIndex:X}}}return Y&&(I++,A.push(Y),v.push(ie),re+=P),{width:H,height:re}});let[Ft,Pt]=yield,Oe="",we="",te=a._inheritedClipPathId,{left:it,top:ot,width:Ee,height:at}=u.getComputedLayout(),Fe=o.getComputedWidth()-o.getComputedPadding(n.EDGE_LEFT)-o.getComputedPadding(n.EDGE_RIGHT)-o.getComputedBorder(n.EDGE_LEFT)-o.getComputedBorder(n.EDGE_RIGHT),ue=Ft+it,ce=Pt+ot,{matrix:Q,opacity:ve}=Rt({left:it,top:ot,width:Ee,height:at,isInheritingTransform:l},i),ke="";i.textShadowOffset&&(ke=fe({width:Ee,height:at,id:s},{shadowColor:i.textShadowColor,shadowOffset:i.textShadowOffset,shadowRadius:i.textShadowRadius}));let me="",Se="",st="",Pe=-1,lt=x==="ellipsis"?k(["\u2026"]):0,$t=x==="ellipsis"?k([" "]):0,Te={};for(let _=0;_<f.length;_++){if(!G[_])continue;let I=G[_],L=f[_],U=null,Y=d?d[L]:null,H=I.y,X=I.x,re=I.width,P=I.line;if(P===Pe)continue;let ie=!1;if(A.length>1){let B=Ee-A[P];if(b==="right"||b==="end")X+=B;else if(b==="center")X+=B/2;else if(b==="justify"&&P<A.length-1){let q=M[P];X+=(q>1?B/(q-1):0)*I.lineIndex,ie=!0}}if(Te[P]||(Te[P]=[X,ie?Ee:A[P]]),x==="ellipsis"&&A[P]>Fe&&I.x+re+lt+$t>Fe){let B=ae(L,"grapheme"),q="",de=0;for(let ut of B){let ct=I.x+k([q+ut]);if(q&&ct+lt>Fe)break;q+=ut,de=ct}L=q+"\u2026",Pe=P,Te[P][1]=de}let ne=v[P],D=R.baseline(L),oe=R.height(L),j=ne-D;if(Y?H+=0:p?(U=R.getSVG(L,{...i,left:ue+X,top:ce+H+D+j,letterSpacing:i.letterSpacing}),m&&(st+=y("rect",{x:ue+X,y:ce+H+j,width:I.width,height:oe,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:Q||void 0,"clip-path":te?`url(#${te})`:void 0})+y("line",{x1:ue+X,x2:ue+X+I.width,y1:ce+H+j+D,y2:ce+H+j+D,stroke:"#14c000","stroke-width":1,transform:Q||void 0,"clip-path":te?`url(#${te})`:void 0}))):H+=D+j,i.textDecorationLine&&(P!==((ft=G[_+1])==null?void 0:ft.line)||Pe===P)){let B=Te[P];B&&!B[2]&&(me+=je({left:ue+B[0],top:ce+oe*+P,width:B[1],ascender:R.baseline(L),clipPathId:te},i),B[2]=1)}if(U!==null)Se+=U+" ";else{let[B,q]=Xe({content:L,filter:ke,id:s,left:ue+X,top:ce+H,width:re,height:oe,matrix:Q,opacity:ve,image:Y,clipPathId:te,debug:m,shape:!!N,decorationShape:me},i);Oe+=B,we+=q,me=""}}if(Se){let _=i.color!=="transparent"&&ve!==0?y("path",{fill:i.color,d:Se,transform:Q||void 0,opacity:ve!==1?ve:void 0,"clip-path":te?`url(#${te})`:void 0,style:$?`filter:${$}`:void 0}):"";N&&(we=y("path",{d:Se,transform:Q||void 0})),Oe+=(ke?ke+y("g",{filter:`url(#satori_s-${s})`},_+me):_+me)+st}return we&&(i._inheritedBackgroundClipTextPath.value+=we),Oe}var qe=qe||{};qe.parse=function(){var e={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function n(c){var w=new Error(t+": "+c);throw w.source=t,w}function i(){var c=a();return t.length>0&&n("Invalid input not EOF"),c}function a(){return F(o)}function o(){return r("linear-gradient",e.linearGradient,l)||r("repeating-linear-gradient",e.repeatingLinearGradient,l)||r("radial-gradient",e.radialGradient,d)||r("repeating-radial-gradient",e.repeatingRadialGradient,d)}function r(c,w,C){return s(w,function(Z){var ge=C();return ge&&(O(e.comma)||n("Missing comma before color stops")),{type:c,orientation:ge,colorStops:F($)}})}function s(c,w){var C=O(c);if(C){O(e.startCall)||n("Missing (");var Z=w(C);return O(e.endCall)||n("Missing )"),Z}}function l(){return m()||p()}function m(){return k("directional",e.sideOrCorner,1)}function p(){return k("angular",e.angleValue,1)}function d(){var c,w=g(),C;return w&&(c=[],c.push(w),C=t,O(e.comma)&&(w=g(),w?c.push(w):t=C)),c}function g(){var c=h()||f();if(c)c.at=b();else{var w=u();if(w){c=w;var C=b();C&&(c.at=C)}else{var Z=x();Z&&(c={type:"default-radial",at:Z})}}return c}function h(){var c=k("shape",/^(circle)/i,0);return c&&(c.style=z()||u()),c}function f(){var c=k("shape",/^(ellipse)/i,0);return c&&(c.style=M()||u()),c}function u(){return k("extent-keyword",e.extentKeywords,1)}function b(){if(k("position",/^at/,0)){var c=x();return c||n("Missing positioning value"),c}}function x(){var c=E();if(c.x||c.y)return{type:"position",value:c}}function E(){return{x:M(),y:M()}}function F(c){var w=c(),C=[];if(w)for(C.push(w);O(e.comma);)w=c(),w?C.push(w):n("One extra comma");return C}function $(){var c=N();return c||n("Expected color definition"),c.length=M(),c}function N(){return R()||A()||V()||W()}function W(){return k("literal",e.literalColor,0)}function R(){return k("hex",e.hexColor,1)}function V(){return s(e.rgbColor,function(){return{type:"rgb",value:F(v)}})}function A(){return s(e.rgbaColor,function(){return{type:"rgba",value:F(v)}})}function v(){return O(e.number)[1]}function M(){return k("%",e.percentageValue,1)||G()||z()}function G(){return k("position-keyword",e.positionKeywords,1)}function z(){return k("px",e.pixelValue,1)||k("em",e.emValue,1)}function k(c,w,C){var Z=O(w);if(Z)return{type:c,value:Z[C]}}function O(c){var w,C;return C=/^[\n\r\t\s]+/.exec(t),C&&J(C[0].length),w=c.exec(t),w&&J(w[0].length),w}function J(c){t=t.substr(c)}return function(c){return t=c.toString(),i()}}();var Ke=qe;var _t=ht(100),Ze=new Map,ln=["image/png","image/jpeg","image/gif","image/svg+xml"];function fn(e){let t="",n=new Uint8Array(e);for(let i=0;i<n.byteLength;i++)t+=String.fromCharCode(n[i]);return btoa(t)}async function Ie(e){if(!e)throw new Error("Image URL is not provided");if(e.startsWith("data:"))return e;if(!globalThis.fetch)throw new Error("`fetch` is required to be polyfilled to load images.");if(Ze.has(e))return Ze.get(e);let t=_t.get(e);if(t)return t;let n=new Promise((i,a)=>{let o;fetch(e).then(r=>(o=(r.headers.get("content-type")||"").toLowerCase(),r.arrayBuffer())).then(r=>{if(!o)switch([...new Uint8Array(r.slice(0,4))].map(p=>p.toString(16)).join("")){case"89504e47":o="image/png";break;case"47494638":o="image/gif";break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":o="image/jpeg";break}if(!ln.includes(o))throw new Error(`Unsupported image type: ${o||"unknown"}`);let s=`data:${o};base64,${fn(r)}`;_t.set(e,s),i(s)}).catch(a)});return Ze.set(e,n),n}function un(e){return e.type==="literal"?e.value:e.type==="hex"?`#${e.value}`:e.type==="rgb"?`rgb(${e.value.join(",")})`:e.type==="rgba"?`rgba(${e.value.join(",")})`:"transparent"}function cn(e,t){return typeof e=="string"&&e.endsWith("%")?t*parseFloat(e)/100:+e}function Ct(e,{x:t,y:n,defaultX:i,defaultY:a}){return(e?e.split(" ").map(o=>{try{let r=new se(o);return r.type==="length"||r.type==="number"?r.value:r.value+r.unit}catch{return null}}).filter(o=>o!==null):[i,a]).map((o,r)=>cn(o,[t,n][r]))}function It(e,t){let n=[];for(let r of t){let s=un(r);if(!n.length&&(n.push({offset:0,color:s}),typeof r.length>"u"||r.length.value==="0"))continue;let l=typeof r.length>"u"?void 0:r.length.type==="%"?r.length.value/100:r.length.value/e;n.push({offset:l,color:s})}n.length||n.push({offset:0,color:"transparent"});let i=n[n.length-1];i.offset!==1&&(typeof i.offset>"u"?i.offset=1:n.push({offset:1,color:i.color}));let a=0,o=1;for(let r=0;r<n.length;r++)if(typeof n[r].offset>"u"){for(o<r&&(o=r);typeof n[o].offset>"u";)o++;n[r].offset=(n[o].offset-n[a].offset)/(o-a)*(r-a)+n[a].offset}else a=r;return n}async function Qe({id:e,width:t,height:n},{image:i,size:a,position:o,repeat:r}){r=r||"repeat";let s=r==="repeat-x"||r==="repeat",l=r==="repeat-y"||r==="repeat",m=Ct(a,{x:t,y:n,defaultX:t,defaultY:n}),p=Ct(o,{x:t,y:n,defaultX:0,defaultY:0});if(i.startsWith("linear-gradient(")){let d=Ke.parse(i)[0],g,h,f,u;if(d.orientation.type==="directional")[g,h,f,u]={top:[0,1,0,0],bottom:[0,0,0,1],left:[1,0,0,0],right:[0,0,1,0]}[d.orientation.value];else if(d.orientation.type==="angular"){let x=+d.orientation.value/180*Math.PI-Math.PI/2,E=Math.cos(x),F=Math.sin(x);g=0,h=0,f=E,u=F,f<0&&(g-=f,f=0),u<0&&(h-=u,u=0)}let b=It(t,d.colorStops);return[`satori_bi${e}`,`<linearGradient id="satori_bi${e}" x1="${g}" y1="${h}" x2="${f}" y2="${u}">${b.map(x=>`<stop offset="${x.offset*100}%" stop-color="${x.color}"/>`).join("")}</linearGradient>`]}if(i.startsWith("radial-gradient(")){let d=Ke.parse(i)[0],g=d.orientation[0],[h,f]=m,u="circle",b=h/2,x=f/2;if(g.type==="shape"){if(u=g.value,g.at)if(g.at.type==="position")b=g.at.value.x.value,x=g.at.value.y.value;else throw new Error("orientation.at.type not implemented: "+g.at.type)}else throw new Error("orientation.type not implemented: "+g.type);let E=It(t,d.colorStops),F=`satori_radial_${e}`,$=`satori_pattern_${e}`,N={},W=Math.max(Math.abs(h-b),Math.abs(b)),R=Math.max(Math.abs(f-x),Math.abs(x));if(u==="circle")N.r=Math.sqrt(W*W+R*R);else if(u==="ellipse"){let v=R!==0?W/R:1;N.ry=Math.sqrt(W*W+R*R*v*v)/v,N.rx=N.ry*v}let V=y("pattern",{id:$,x:p[0],y:p[1],width:s?h:"100%",height:l?f:"100%",patternUnits:"userSpaceOnUse"},y("radialGradient",{id:F},E.map(v=>y("stop",{offset:v.offset,"stop-color":v.color})).join(""))+y(u,{cx:b,cy:x,width:h,height:f,...N,fill:`url(#${F})`}));return[$,V]}if(i.startsWith("url(")){let d=await Ie(i.slice(4,-1));return[`satori_bi${e}`,y("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:p[0],y:p[1],width:s?m[0]:"100%",height:l?m[1]:"100%"},y("image",{x:0,y:0,width:m[0],height:m[1],href:d}))]}}function Le(e,t,n){return n<e+t&&(n/2<e&&n/2<t?e=t=n/2:n/2<e?e=n-t:n/2<t&&(t=n-e)),[e,t]}function be({left:e,top:t,width:n,height:i},a){let{borderTopLeftRadius:o,borderTopRightRadius:r,borderBottomLeftRadius:s,borderBottomRightRadius:l}=a;return o=Math.min(o||0,n,i),r=Math.min(r||0,n,i),s=Math.min(s||0,n,i),l=Math.min(l||0,n,i),!o&&!r&&!s&&!l?"":([o,r]=Le(o,r,n),[o,s]=Le(o,s,i),[r,l]=Le(r,l,i),[s,l]=Le(s,l,n),`M${e+o},${t} h${n-o-r} a${r},${r} 0 0 1 ${r},${r} v${i-r-l} a${l},${l} 0 0 1 ${-l},${l} h${l+s-n} a${s},${s} 0 0 1 ${-s},${-s} v${s+o-i} a${o},${o} 0 0 1 ${o},${-o}`)}function et({left:e,top:t,width:n,height:i,path:a,id:o},r){return r.overflow!=="hidden"?"":a?y("clipPath",{id:`satori_cp-${o}`,"clip-path":r._inheritedClipPathId?`url(#${r._inheritedClipPathId})`:void 0},y("path",{x:e,y:t,width:n,height:i,d:a})):y("clipPath",{id:`satori_cp-${o}`,"clip-path":r._inheritedClipPathId?`url(#${r._inheritedClipPathId})`:void 0},y("rect",{x:e,y:t,width:n,height:i}))}async function tt({id:e,left:t,top:n,width:i,height:a,isInheritingTransform:o,debug:r},s){if(s.display==="none")return"";let l="rect",m="transparent",p="",d=0,g="",h="",f=[],u=1,b="";s.backgroundColor&&f.push(s.backgroundColor),s.borderWidth&&(d=s.borderWidth,m=s.borderColor,s.borderStyle==="dashed"&&(p=d*2+" "+d)),s.opacity&&(u=+s.opacity),s.transform&&(g=le({left:t,top:n,width:i,height:a},s.transform,o,s.transformOrigin));let x="";if(s.backgroundImage){let A=[];for(let v=0;v<s.backgroundImage.length;v++){let M=s.backgroundImage[v],G=await Qe({id:e+"_"+v,width:i,height:a},M);G&&A.push(G)}for(let v of A)f.push(`url(#${v[0]})`),h+=v[1],v[2]&&(x+=v[2])}let E=be({left:t,top:n,width:i,height:a},s);E&&(l="path");let F=et({left:t,top:n,width:i,height:a,path:E,id:e},s),$=s._inheritedClipPathId,N=fe({width:i,height:a,id:e},s);r&&(b=y("rect",{x:t,y:n,width:i,height:a,fill:"transparent",stroke:"#ff5757","stroke-width":1,"stroke-dasharray":p||void 0,transform:g||void 0,"clip-path":$?`url(#${$})`:void 0})),f.length||f.push("transparent");let{backgroundClip:W,filter:R}=s,V=f.map((A,v)=>{if(A==="transparent"&&!(v===f.length-1&&d))return"";let M=!!d,G=v===f.length-1&&M&&W!=="text",z=W==="text"?`url(#satori_bct-${e})`:$?`url(#${$})`:void 0;return G&&(h+=y("clipPath",{id:`satori_bc-${e}`,"clip-path":z},y(l,{x:t,y:n,width:i,height:a,d:E||void 0})),z=`url(#satori_bc-${e})`),y(l,{x:t,y:n,width:i,height:a,fill:A,stroke:G||M?m:void 0,"stroke-width":G?d*2:M?1:void 0,"stroke-dasharray":p||void 0,d:E||void 0,transform:g||void 0,"clip-path":z,style:R?`filter:${R}`:void 0})}).join("");return W==="text"&&d&&(V=y(l,{x:t,y:n,width:i,height:a,fill:"transparent",stroke:m,"stroke-width":d*2,"stroke-dasharray":p||void 0,d:E||void 0,transform:g||void 0,"clip-path":$?`url(#${$})`:void 0})+V),(h?`<defs>${h}</defs>`:"")+F+(N?`${N}<g filter="url(#satori_s-${e})">`:"")+(u!==1?`<g opacity="${u}">`:"")+(x||V)+(u!==1?"</g>":"")+(N?"</g>":"")+b}function Ae({id:e,left:t,top:n,width:i,height:a,src:o,debug:r,isInheritingTransform:s},l){if(l.display==="none")return"";let m="",p=1,d="",g=l.objectFit==="contain"?"xMidYMid":l.objectFit==="cover"?"xMidYMid slice":"none",h=be({left:t,top:n,width:i,height:a},l),f=l._inheritedClipPathId;h&&(m=y("clipPath",{id:`satori_c-${e}`,"clip-path":f?`url(#${f})`:void 0},y("path",{x:t,y:n,width:i,height:a,d:h}))),l.opacity&&(p=+l.opacity);let u=fe({width:i,height:a,id:e},l);return l.transform&&(d=le({left:t,top:n,width:i,height:a},l.transform,s,l.transformOrigin)),u+(u?`<g filter="url(#satori_s-${e})">`:"")+m+y("image",{x:t,y:n,width:i,height:a,href:o,preserveAspectRatio:g,transform:d||void 0,"clip-path":m?`url(#satori_c-${e})`:f?`url(#${f})`:void 0})+(u?"</g>":"")}async function*ye(e,t){var J;let n=ee(),{id:i,inheritedStyle:a,parent:o,font:r,debug:s,embedFont:l=!0,graphemeImages:m,canLoadAdditionalAssets:p}=t;if(e===null||typeof e>"u")return yield,yield,"";if(!We(e)||typeof e.type=="function"){let c;if(!We(e))c=Je(String(e),t),yield(await c.next()).value;else{if(pt(e.type))throw new Error("Class component is not supported.");c=ye(e.type(e.props),t),yield(await c.next()).value}await c.next();let w=yield;return(await c.next(w)).value}let{type:d,props:g}=e,{style:h,children:f}=g||{},u=n.Node.create();o.insertChild(u,o.getChildCount());let[b,x]=He(u,d,a,h,g),E=b.transform===a.transform;if(E||(b.transform.__parent=a.transform),b.overflow==="hidden"&&(x._inheritedClipPathId=`satori_cp-${i}`),b.backgroundClip==="text"){let c={value:""};x._inheritedBackgroundClipTextPath=c,b._inheritedBackgroundClipTextPath=c}let F=gt(f),$=[],N=0,W=[];for(let c of F){let w=ye(c,{id:i+"-"+N++,parentStyle:b,inheritedStyle:x,isInheritingTransform:!0,parent:u,font:r,embedFont:l,debug:s,graphemeImages:m,canLoadAdditionalAssets:p});p?W.push(...(await w.next()).value||[]):await w.next(),$.push(w)}yield W;for(let c of $)await c.next();let[R,V]=yield,{left:A,top:v,width:M,height:G}=u.getComputedLayout();A+=R,v+=V;let z="",k="",O="";if(d==="img"){let c=await Ie(g.src);k=Ae({id:i,left:A,top:v,width:M,height:G,src:c,isInheritingTransform:E,debug:s},b)}else if(d==="svg"){let c=yt(e);k=Ae({id:i,left:A,top:v,width:M,height:G,src:c,isInheritingTransform:E,debug:s},b)}else{let c=(J=h==null?void 0:h.display)!=null?J:"block";if(d==="div"&&f&&typeof f!="string"&&c!=="flex"&&c!=="none")throw new Error(`Expected <div> to have style={{display: 'flex'}} but received style={{display: '${c}'}}`);k=await tt({id:i,left:A,top:v,width:M,height:G,isInheritingTransform:E,debug:s},b)}for(let c of $)z+=(await c.next([A,v])).value;return b._inheritedBackgroundClipTextPath&&(O+=y("clipPath",{id:`satori_bct-${i}`,"clip-path":b._inheritedClipPathId?`url(#${b._inheritedClipPathId})`:void 0},b._inheritedBackgroundClipTextPath.value)),O+k+z}import dn from"@shuding/opentype.js";function pn(e,t,[n,i],[a,o]){if(n!==a)return n?!a||n===e?-1:a===e?1:e===400&&n===500||e===500&&n===400?-1:e===400&&a===500||e===500&&a===400?1:e<400?n<e&&a<e?a-n:n<e?-1:a<e?1:n-a:e<n&&e<a?n-a:e<n?-1:e<a?1:a-n:1;if(i!==o){if(i===t)return-1;if(o===t)return 1}return-1}var xe=class{constructor(t){this.fonts=new Map;this.addFonts(t)}get({name:t,weight:n,style:i}){if(!this.fonts.has(t))return null;n==="normal"&&(n=400),n==="bold"&&(n=700);let a=[...this.fonts.get(t)],o=a[0];for(let r=1;r<a.length;r++){let[,s,l]=o,[,m,p]=a[r];pn(n,i,[s,l],[m,p])>0&&(o=a[r])}return o[0]}addFonts(t){for(let n of t){let i=n.data,a=dn.parse("buffer"in i?i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength):i,{lowMemory:!0}),o=a.charToGlyphIndex;a.charToGlyphIndex=s=>{let l=o.call(a,s);return l===0&&a._trackBrokenChars&&a._trackBrokenChars.push(s),l},this.defaultFont||(this.defaultFont=a);let r=n.name.toLowerCase();this.fonts.has(r)||this.fonts.set(r,[]),this.fonts.get(r).push([a,n.weight,n.style])}}getEngine(t=16,n=1.2,{fontFamily:i,fontWeight:a=400,fontStyle:o="normal"}){if(!this.fonts.size)throw new Error("No fonts are loaded. At least one font is required to calculate the layout.");i=(Array.isArray(i)?i:[i]).map(f=>f.toLowerCase());let r=i.map(f=>this.get({name:f,weight:a,style:o})).filter(Boolean),s=Array.from(this.fonts.keys());for(let f of s)i.includes(f)||r.push(this.get({name:f,weight:a,style:o}));let l=new Map,m=(f,u=!0)=>{let b=f.charCodeAt(0);if(l.has(b))return l.get(b);let x=r.find((E,F)=>!!E.charToGlyphIndex(f)||u&&F===r.length-1);return x&&l.set(b,x),x},p=(f,u=!1)=>{var x,E;return((u?(E=(x=f.tables)==null?void 0:x.os2)==null?void 0:E.sTypoAscender:0)||f.ascender)/f.unitsPerEm*t},d=(f,u=!1)=>{var x,E;return((u?(E=(x=f.tables)==null?void 0:x.os2)==null?void 0:E.sTypoDescender:0)||f.descender)/f.unitsPerEm*t},g=f=>m(f,!1),h={check:f=>{let u=g(f);return u?(u._trackBrokenChars=[],u.stringToGlyphs(f),u._trackBrokenChars.length?(u._trackBrokenChars=void 0,!1):!0):!1},baseline:(f,u=typeof f>"u"?r[0]:m(f))=>{let b=p(u,!0),x=d(u,!0),E=h.height(f,u),{yMax:F,yMin:$}=u.tables.head,N=b-x,W=(F/(F-$)-1)*N;return E*((1.2/n+1)/2)+W},height:(f,u=typeof f>"u"?r[0]:m(f))=>(p(u)-d(u))*(n/1.2),measure:(f,u)=>this.measure(m,f,u),getSVG:(f,u)=>this.getSVG(m,f,u)};return h}patchFontFallbackResolver(t,n){let i=[];t._trackBrokenChars=i;let a=t.stringToGlyphs;return t.stringToGlyphs=(o,...r)=>{let s=a.call(t,o,...r);for(let l=0;l<s.length;l++)if(s[l].unicode===void 0){let m=i.shift(),p=n(m);p!==t&&(s[l]=p.charToGlyph(m))}return s},()=>{t.stringToGlyphs=a,t._trackBrokenChars=void 0}}measure(t,n,{fontSize:i,letterSpacing:a=0}){let o=t(n),r=this.patchFontFallbackResolver(o,t);try{return o.getAdvanceWidth(n,i,{letterSpacing:a/i})}finally{r()}}getSVG(t,n,{fontSize:i,top:a,left:o,letterSpacing:r=0}){let s=t(n),l=this.patchFontFallbackResolver(s,t);try{return i===0?"":s.getPath(n,o,a,i,{letterSpacing:r/i}).toPathData(1)}finally{l()}}};function nt({width:e,height:t,content:n}){return y("svg",{width:e,height:t,viewBox:`0 0 ${e} ${t}`,xmlns:"http://www.w3.org/2000/svg"},n)}var Lt={emoji:/\p{RI}\p{RI}|\p{Emoji}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?(\u{200D}\p{Emoji}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?)+|\p{EPres}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?|\p{Emoji}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})/u,ja:/\p{scx=Hira}|\p{scx=Kana}|[,;:]/u,ko:/\p{scx=Hangul}/u,zh:/\p{scx=Han}/u,th:/\p{scx=Thai}/u,bn:/\p{scx=Bengali}/u,ar:/\p{scx=Arabic}/u,ta:/\p{scx=Tamil}/u,ml:/\p{scx=Malayalam}/u,he:/\p{scx=Hebrew}/u,te:/\p{scx=Telugu}/u,devanagari:/\p{scx=Devanagari}/u};function At(e){for(let t in Lt)if(Lt[t].test(e))return t;return"unknown"}var rt=new WeakMap;async function Ot(e,t){let n=ee();if(!n)throw new Error("Satori is not initialized.");let i;rt.has(t.fonts)?i=rt.get(t.fonts):rt.set(t.fonts,i=new xe(t.fonts));let a=n.Node.create();a.setWidth(t.width),a.setHeight(t.height),a.setFlexDirection(n.FLEX_DIRECTION_ROW),a.setFlexWrap(n.WRAP_WRAP),a.setAlignContent(n.ALIGN_AUTO),a.setAlignItems(n.ALIGN_FLEX_START),a.setJustifyContent(n.JUSTIFY_FLEX_START),a.setOverflow(n.OVERFLOW_HIDDEN);let o={...t.graphemeImages},r=ye(e,{id:"id",parentStyle:{},inheritedStyle:{fontSize:16,fontWeight:"normal",fontFamily:"serif",fontStyle:"normal",lineHeight:1.2,color:"black",opacity:1,whiteSpace:"normal",_viewportWidth:t.width,_viewportHeight:t.height},parent:a,font:i,embedFont:t.embedFont,debug:t.debug,graphemeImages:o,canLoadAdditionalAssets:!!t.loadAdditionalAsset}),s=(await r.next()).value;if(t.loadAdditionalAsset&&s.length){s=Array.from(new Set(ae(s.join(""),"grapheme")));let m={};s.forEach(g=>{let h=At(g);m[h]=m[h]||[],h==="emoji"?m[h].push(g):m[h][0]=(m[h][0]||"")+g});let p=[],d={};await Promise.all(Object.entries(m).flatMap(([g,h])=>h.map(f=>t.loadAdditionalAsset(g,f).then(u=>{typeof u=="string"?d[f]=u:u&&p.push(u)})))),i.addFonts(p),Object.assign(o,d)}await r.next(),a.calculateLayout(t.width,t.height,n.DIRECTION_LTR);let l=(await r.next([0,0])).value;return a.freeRecursive(),nt({width:t.width,height:t.height,content:l})}export{Ot as default,Mt as init};
var mt={};var $e;$e=mt.default;function Nt(e){$e=e}function ee(){return $e}function Ge(e){let t=typeof e;return!(t==="number"||t==="bigint"||t==="string"||t==="boolean")}function bt(e){return/^class\s/.test(Function.prototype.toString.call(e))}function yt(e){let t=typeof e>"u"?[]:[].concat(e).flat(1/0),n=[];for(let o=0;o<t.length;o++){let a=t[o];typeof a>"u"||typeof a=="boolean"||a===null||(typeof a=="number"&&(a=String(a)),typeof a=="string"&&n.length&&typeof n[n.length-1]=="string"?n[n.length-1]+=a:n.push(a))}return n}function pe(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function K(e,t,n){let o=t[e];return typeof o>"u"?n:o}var ht=void 0,Me,We,Re=[32,160,4961,65792,65793,4153,4241,10].map(e=>String.fromCodePoint(e));function ae(e,t){if(!Me||!We){if(!(typeof Intl<"u"&&"Segmenter"in Intl))throw new Error("Intl.Segmenter does not exist, please use import a polyfill.");Me=new Intl.Segmenter(ht,{granularity:"word"}),We=new Intl.Segmenter(ht,{granularity:"grapheme"})}return t==="word"?[...Me.segment(e)].map(n=>n.segment):[...We.segment(e)].map(n=>n.segment)}function x(e,t,n){let o="";for(let[a,i]of Object.entries(t))typeof i<"u"&&(o+=` ${a}="${i}"`);return n?`<${e}${o}>${n}</${e}>`:`<${e}${o}/>`}function xt(e=20){let t=new Map;function n(a,i){if(t.size>=e){let r=t.keys().next().value;t.delete(r)}t.set(a,i)}function o(a){if(!t.has(a))return;let r=t.get(a);return t.delete(a),t.set(a,r),r}return{set:n,get:o}}var wt={accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",allowReorder:"allowreorder",arabicForm:"arabic-form",attributeName:"attributename",attributeType:"attributetype",autoReverse:"autoreverse",baseFrequency:"basefrequency",baseProfile:"baseprofile",baselineShift:"baseline-shift",calcMode:"calcmode",capHeight:"cap-height",clipPath:"clip-path",clipPathUnits:"clippathunits",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentscripttype",contentStyleType:"contentstyletype",diffuseConstant:"diffuseconstant",dominantBaseline:"dominant-baseline",edgeMode:"edgemode",enableBackground:"enable-background",externalResourcesRequired:"externalresourcesrequired",fillOpacity:"fill-opacity",fillRule:"fill-rule",filterRes:"filterres",filterUnits:"filterunits",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphref",gradientTransform:"gradienttransform",gradientUnits:"gradientunits",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",kernelMatrix:"kernelmatrix",kernelUnitLength:"kernelunitlength",keyPoints:"keypoints",keySplines:"keysplines",keyTimes:"keytimes",lengthAdjust:"lengthadjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingconeangle",markerEnd:"marker-end",markerHeight:"markerheight",markerMid:"marker-mid",markerStart:"marker-start",markerUnits:"markerunits",markerWidth:"markerwidth",maskContentUnits:"maskcontentunits",maskUnits:"maskunits",numOctaves:"numoctaves",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathlength",patternContentUnits:"patterncontentunits",patternTransform:"patterntransform",patternUnits:"patternunits",pointerEvents:"pointer-events",pointsAtX:"pointsatx",pointsAtY:"pointsaty",pointsAtZ:"pointsatz",preserveAlpha:"preservealpha",preserveAspectRatio:"preserveaspectratio",primitiveUnits:"primitiveunits",refX:"refx",refY:"refy",renderingIntent:"rendering-intent",repeatCount:"repeatcount",repeatDur:"repeatdur",requiredExtensions:"requiredextensions",requiredFeatures:"requiredfeatures",shapeRendering:"shape-rendering",specularConstant:"specularconstant",specularExponent:"specularexponent",spreadMethod:"spreadmethod",startOffset:"startoffset",stdDeviation:"stddeviation",stitchTiles:"stitchtiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",suppressContentEditableWarning:"suppresscontenteditablewarning",suppressHydrationWarning:"suppresshydrationwarning",surfaceScale:"surfacescale",systemLanguage:"systemlanguage",tableValues:"tablevalues",targetX:"targetx",targetY:"targety",textAnchor:"text-anchor",textDecoration:"text-decoration",textLength:"textlength",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewbox",viewTarget:"viewtarget",wordSpacing:"word-spacing",writingMode:"writing-mode",xChannelSelector:"xchannelselector",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlLang:"xml:lang",xmlSpace:"xmlspace",xmlnsXlink:"xmlns:xlink",yChannelSelector:"ychannelselector",zoomAndPan:"zoomandpan"},Gt=/[\r\n%#()<>?[\\\]^`{|}"']/g;function Ne(e){if(!e)return"";if(Array.isArray(e))return e.map(Ne).join("");if(typeof e!="object")return String(e);let t=e.type;if(t==="text")throw new Error("<text> nodes are not currently supported, please convert them to <path>");let{children:n,...o}=e.props||{};return`<${t}${Object.entries(o).map(([a,i])=>` ${wt[a]||a}="${i}"`).join("")}>${Ne(n)}</${t}>`}function vt(e){let{viewBox:t,viewbox:n,width:o,height:a,className:i,style:r,children:s,...l}=e.props||{};t||(t=n);let m=t.split(" ").map(g=>parseInt(g,10));return l.xmlns="http://www.w3.org/2000/svg",l.viewBox=t,l.width=m[2],l.height=m[3],`data:image/svg+xml;utf8,${`<svg${Object.entries(l).map(([g,u])=>` ${wt[g]||g}="${u}"`).join("")}>${Ne(s)}</svg>`.replace(Gt,encodeURIComponent)}`}var Et={p:{display:"block",marginTop:"1em",marginBottom:"1em"},div:{display:"block"},blockquote:{display:"block",marginTop:"1em",marginBottom:"1em",marginLeft:40,marginRight:40},center:{display:"block",textAlign:"center"},hr:{display:"block",marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"auto",marginRight:"auto",borderWidth:1,borderStyle:"inset"},h1:{display:"block",fontSize:"2em",marginTop:"0.67em",marginBottom:"0.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h2:{display:"block",fontSize:"1.5em",marginTop:"0.83em",marginBottom:"0.83em",marginLeft:0,marginRight:0,fontWeight:"bold"},h3:{display:"block",fontSize:"1.17em",marginTop:"1em",marginBottom:"1em",marginLeft:0,marginRight:0,fontWeight:"bold"},h4:{display:"block",marginTop:"1.33em",marginBottom:"1.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},h5:{display:"block",fontSize:"0.83em",marginTop:"1.67em",marginBottom:"1.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h6:{display:"block",fontSize:"0.67em",marginTop:"2.33em",marginBottom:"2.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},u:{textDecoration:"underline"},strong:{fontWeight:"bold"},b:{fontWeight:"bold"},i:{fontStyle:"italic"},em:{fontStyle:"italic"},code:{fontFamily:"monospace"},kbd:{fontFamily:"monospace"},pre:{display:"block",fontFamily:"monospace",whiteSpace:"pre",marginTop:"1em",marginBottom:"1em"},mark:{backgroundColor:"yellow",color:"black"},big:{fontSize:"larger"},small:{fontSize:"smaller"},s:{textDecoration:"line-through"}};var Dt=new Set(["color","font","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","textAlign","textTransform","textShadowOffset","textShadowColor","textShadowRadius","textDecorationLine","textDecorationStyle","textDecorationColor","whiteSpace","transform","wordBreak","opacity","filter","_viewportWidth","_viewportHeight","_inheritedClipPathId","_inheritedBackgroundClipTextPath"]);function De(e){let t={};for(let n in e)Dt.has(n)&&(t[n]=e[n]);return t}import{getPropertyName as en,getStylesForProperty as tn}from"css-to-react-native";import{parseElementStyle as nn}from"css-background-parser";var he=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bt=he((e,t)=>{t.exports=["em","ex","ch","rem","vh","vw","vmin","vmax","px","mm","cm","in","pt","pc","mozmm"]}),Ut=he((e,t)=>{t.exports=["deg","grad","rad","turn"]}),zt=he((e,t)=>{t.exports=["dpi","dpcm","dppx"]}),Ht=he((e,t)=>{t.exports=["Hz","kHz"]}),Yt=he((e,t)=>{t.exports=["s","ms"]}),Xt=Bt(),kt=Ut(),St=zt(),Tt=Ht(),Rt=Yt();function Ue(e){if(/\.\D?$/.test(e))throw new Error("The dot should be followed by a number");if(/^[+-]{2}/.test(e))throw new Error("Only one leading +/- is allowed");if(jt(e)>1)throw new Error("Only one dot is allowed");if(/%$/.test(e)){this.type="percentage",this.value=Be(e),this.unit="%";return}var t=Jt(e);if(!t){this.type="number",this.value=Be(e);return}this.type=Kt(t),this.value=Be(e.substr(0,e.length-t.length)),this.unit=t}Ue.prototype.valueOf=function(){return this.value};Ue.prototype.toString=function(){return this.value+(this.unit||"")};function se(e){return new Ue(e)}function jt(e){var t=e.match(/\./g);return t?t.length:0}function Be(e){var t=parseFloat(e);if(isNaN(t))throw new Error("Invalid number: "+e);return t}var Vt=[].concat(kt,Tt,Xt,St,Rt);function Jt(e){var t=e.match(/\D+$/),n=t&&t[0];if(n&&Vt.indexOf(n)===-1)throw new Error("Invalid unit: "+n);return n}var qt=Object.assign(_e(kt,"angle"),_e(Tt,"frequency"),_e(St,"resolution"),_e(Rt,"time"));function _e(e,t){return Object.fromEntries(e.map(n=>[n,t]))}function Kt(e){return qt[e]||"length"}import Zt from"postcss-value-parser";function Qt(e,t){try{let n=new se(e);switch(n.unit){case"px":return{absolute:n.value};case"em":return{absolute:n.value*t};case"rem":return{absolute:n.value*16};case"%":return{relative:n.value};default:return{}}}catch{return{}}}function ze(e,t,n){switch(e){case"top":return{yRelative:0};case"left":return{xRelative:0};case"right":return{xRelative:100};case"bottom":return{yRelative:100};case"center":return{};default:let o=Qt(e,t);return o.absolute?{[n?"xAbsolute":"yAbsolute"]:o.absolute}:o.relative?{[n?"xRelative":"yRelative"]:o.relative}:{}}}function He(e,t){if(typeof e=="number")return{xAbsolute:e};let n;try{n=Zt(e).nodes.filter(o=>o.type==="word").map(o=>o.value)}catch{return{}}return n.length===1?ze(n[0],t,!0):n.length===2?((n[0]==="top"||n[0]==="bottom"||n[1]==="left"||n[1]==="right")&&n.reverse(),{...ze(n[0],t,!0),...ze(n[1],t,!1)}):{}}var rn=new Set(["flex","flexGrow","flexShrink","flexBasis","fontWeight","lineHeight","opacity","scale","scaleX","scaleY"]),on=new Set(["lineHeight"]),_t=[1,0,0,1,0,0];function an(e,t,n,o){return e==="border"&&!n.includes(t.borderColor)?t.borderColor=o:e==="borderColor"?t.borderColor=t.borderTopColor:e==="textDecoration"&&!n.includes(t.textDecorationColor)&&(t.textDecorationColor=o),t}function It(e,t){return typeof t=="number"?rn.has(e)?on.has(e)?t:String(t):t+"px":t}function sn(e,t){return e==="lineHeight"?{lineHeight:It(e,t)}:e==="fontFamily"?{fontFamily:t.split(",").map(n=>n.trim().replace(/(^['"])|(['"]$)/g,"").toLocaleLowerCase())}:null}function ln(e){return e==="transform"?" Only absolute lengths such as `10px` are supported.":""}function Ye(e,t,n,{percentage:o}={percentage:!1}){if(typeof e=="number")return e;try{let a=new se(e);if(a.type==="length")switch(a.unit){case"em":return a.value*t;case"rem":return a.value*16;case"vw":return~~(a.value*n._viewportWidth/100);case"vh":return~~(a.value*n._viewportHeight/100);default:return a.value}else if(a.type==="angle")switch(a.unit){case"deg":return a.value;case"rad":return a.value*180/Math.PI;default:return a.value}else if(a.type==="percentage"&&o)return a.value/100*t}catch{}}function Ie(e,t){let n={};for(let a in e){if(a.startsWith("_")){n[a]=e[a];continue}let i=en(a);try{Object.assign(n,sn(i,e[a])||an(i,tn(i,It(i,e[a]),!0),e[a],e.color||t.color))}catch(r){throw console.error(r),new Error(`Failed to parse CSS \`${i}: ${e[a]}\`.${ln(i)}`)}}if(n.backgroundImage){let{backgrounds:a}=nn(n);n.backgroundImage=a}let o=typeof n.fontSize=="number"?n.fontSize:t.fontSize;if(typeof o=="string")try{let a=new se(o);switch(a.unit){case"em":o=a.value*t.fontSize;break;case"rem":o=a.value*16;break}}catch{o=16}typeof n.fontSize<"u"&&(n.fontSize=o),n.transformOrigin&&(n.transformOrigin=He(n.transformOrigin,o));for(let a in n){let i=n[a];if(a==="lineHeight")typeof i=="string"&&(i=n[a]=Ye(i,o,t,{percentage:!0})/o);else if(typeof i=="string"){let r=Ye(i,o,t);typeof r<"u"&&(n[a]=r),i=n[a]}if(a==="opacity"&&(i=n[a]=i*t.opacity),a==="transform"){let r=[..._t],s=i;for(let l of s){let m=Object.keys(l)[0],g=l[m],u=typeof g=="string"?Ye(g,o,t):g,d=[..._t];switch(m){case"translateX":d[4]=u;break;case"translateY":d[5]=u;break;case"scale":d[0]=u,d[3]=u;break;case"scaleX":d[0]=u;break;case"scaleY":d[3]=u;break;case"rotate":let h=u*Math.PI/180,f=Math.cos(h),c=Math.sin(h);d[0]=f,d[1]=c,d[2]=-c,d[3]=f;break;case"skewX":d[2]=Math.tan(u*Math.PI/180);break;case"skewY":d[1]=Math.tan(u*Math.PI/180);break}r=pe(d,r)}n.transform=r}}return n}function fn(e){let t=new DataView(e),n=4,o=t.byteLength;for(;n<o;){let a=t.getUint16(n,!1);if(a>o)throw new TypeError("Invalid JPEG");let i=t.getUint8(a+1+n);if(i===192||i===193||i===194)return[t.getUint16(a+7+n,!1),t.getUint16(a+5+n,!1)];n+=a+2}throw new TypeError("Invalid JPEG")}function un(e){let t=new Uint8Array(e.slice(6,10));return[t[0]|t[1]<<8,t[2]|t[3]<<8]}function cn(e){let t=new DataView(e);return[t.getUint16(18,!1),t.getUint16(22,!1)]}var Ct=xt(100),Xe=new Map,dn=["image/png","image/jpeg","image/gif","image/svg+xml"];function pn(e){let t="",n=new Uint8Array(e);for(let o=0;o<n.byteLength;o++)t+=String.fromCharCode(n[o]);return btoa(t)}async function Ce(e){if(!e)throw new Error("Image source is not provided.");if(e.startsWith("data:"))return[e];if(!globalThis.fetch)throw new Error("`fetch` is required to be polyfilled to load images.");if(Xe.has(e))return Xe.get(e);let t=Ct.get(e);if(t)return t;let n=new Promise((o,a)=>{fetch(e).then(i=>i.arrayBuffer()).then(i=>{let r,s;switch([...new Uint8Array(i.slice(0,4))].map(u=>u.toString(16)).join("")){case"89504e47":r="image/png",s=cn(i);break;case"47494638":r="image/gif",s=un(i);break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":r="image/jpeg",s=fn(i);break}if(!dn.includes(r))throw new Error(`Unsupported image type: ${r||"unknown"}`);let g=`data:${r};base64,${pn(i)}`;Ct.set(e,[g,...s]),o([g,...s])}).catch(a)});return Xe.set(e,n),n}async function je(e,t,n,o,a){let i=ee(),r={...n,...Ie(Et[t],n),...Ie(o,n)};if(t==="img"){let[s,l,m]=await Ce(a.src);if(l===void 0&&m===void 0){if(a.width===void 0||a.height===void 0)throw new Error("Image size cannot be determined. Please provide the width and height of the image.");l=parseInt(a.width),m=parseInt(a.height)}let g=m/l,u=r.width||a.width,d=r.height||a.height;!u&&!d&&(u=l,d=m),u||(u=d/g),d||(d=u*g),r.width=u,r.height=d,r.__src=s}if(t==="svg"){let l=(a.viewBox||a.viewbox).split(" ").map(d=>parseInt(d,10)),m=l[3]/l[2],{width:g,height:u}=a;typeof g>"u"&&u?typeof u=="string"&&u.endsWith("%")?g=parseInt(u)/m+"%":g=parseInt(u)/m:typeof u>"u"&&g?typeof g=="string"&&g.endsWith("%")?u=parseInt(g)*m+"%":u=parseInt(g)*m:(g||(g=l[2]),u||(u=l[3])),r.width||(r.width=g),r.height||(r.height=u)}return e.setDisplay(K(r.display,{flex:i.DISPLAY_FLEX,none:i.DISPLAY_NONE},i.DISPLAY_FLEX)),e.setAlignContent(K(r.alignContent,{stretch:i.ALIGN_STRETCH,center:i.ALIGN_CENTER,"flex-start":i.ALIGN_FLEX_START,"flex-end":i.ALIGN_FLEX_END,"space-between":i.ALIGN_SPACE_BETWEEN,"space-around":i.ALIGN_SPACE_AROUND,baseline:i.ALIGN_BASELINE,normal:i.ALIGN_AUTO},i.ALIGN_AUTO)),e.setAlignItems(K(r.alignItems,{stretch:i.ALIGN_STRETCH,center:i.ALIGN_CENTER,"flex-start":i.ALIGN_FLEX_START,"flex-end":i.ALIGN_FLEX_END,baseline:i.ALIGN_BASELINE,normal:i.ALIGN_AUTO},i.ALIGN_FLEX_START)),e.setAlignSelf(K(r.alignSelf,{stretch:i.ALIGN_STRETCH,center:i.ALIGN_CENTER,"flex-start":i.ALIGN_FLEX_START,"flex-end":i.ALIGN_FLEX_END,baseline:i.ALIGN_BASELINE,normal:i.ALIGN_AUTO},i.ALIGN_AUTO)),e.setJustifyContent(K(r.justifyContent,{center:i.JUSTIFY_CENTER,"flex-start":i.JUSTIFY_FLEX_START,"flex-end":i.JUSTIFY_FLEX_END,"space-between":i.JUSTIFY_SPACE_BETWEEN,"space-around":i.JUSTIFY_SPACE_AROUND},i.JUSTIFY_FLEX_START)),e.setFlexDirection(K(r.flexDirection,{row:i.FLEX_DIRECTION_ROW,column:i.FLEX_DIRECTION_COLUMN,"row-reverse":i.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":i.FLEX_DIRECTION_COLUMN_REVERSE},i.FLEX_DIRECTION_ROW)),e.setFlexWrap(K(r.flexWrap,{wrap:i.WRAP_WRAP,nowrap:i.WRAP_NO_WRAP,"wrap-reverse":i.WRAP_WRAP_REVERSE},i.WRAP_NO_WRAP)),typeof r.flexBasis<"u"&&e.setFlexBasis(r.flexBasis),e.setFlexGrow(typeof r.flexGrow>"u"?0:r.flexGrow),e.setFlexShrink(typeof r.flexShrink>"u"?0:r.flexShrink),typeof r.maxHeight<"u"&&e.setMaxHeight(r.maxHeight),typeof r.maxWidth<"u"&&e.setMaxWidth(r.maxWidth),typeof r.minHeight<"u"&&e.setMinHeight(r.minHeight),typeof r.minWidth<"u"&&e.setMinWidth(r.minWidth),e.setOverflow(K(r.overflow,{visible:i.OVERFLOW_VISIBLE,hidden:i.OVERFLOW_HIDDEN},i.OVERFLOW_VISIBLE)),e.setMargin(i.EDGE_TOP,r.marginTop||0),e.setMargin(i.EDGE_BOTTOM,r.marginBottom||0),e.setMargin(i.EDGE_LEFT,r.marginLeft||0),e.setMargin(i.EDGE_RIGHT,r.marginRight||0),e.setBorder(i.EDGE_TOP,r.borderWidth||0),e.setBorder(i.EDGE_BOTTOM,r.borderWidth||0),e.setBorder(i.EDGE_LEFT,r.borderWidth||0),e.setBorder(i.EDGE_RIGHT,r.borderWidth||0),e.setPadding(i.EDGE_TOP,r.paddingTop||0),e.setPadding(i.EDGE_BOTTOM,r.paddingBottom||0),e.setPadding(i.EDGE_LEFT,r.paddingLeft||0),e.setPadding(i.EDGE_RIGHT,r.paddingRight||0),e.setPositionType(K(r.position,{absolute:i.POSITION_TYPE_ABSOLUTE,relative:i.POSITION_TYPE_RELATIVE},i.POSITION_TYPE_RELATIVE)),typeof r.top<"u"&&e.setPosition(i.EDGE_TOP,r.top),typeof r.bottom<"u"&&e.setPosition(i.EDGE_BOTTOM,r.bottom),typeof r.left<"u"&&e.setPosition(i.EDGE_LEFT,r.left),typeof r.right<"u"&&e.setPosition(i.EDGE_RIGHT,r.right),typeof r.height<"u"?e.setHeight(r.height):e.setHeightAuto(),typeof r.width<"u"?e.setWidth(r.width):e.setWidthAuto(),[r,De(r)]}function le({left:e,top:t,width:n,height:o},a,i,r){var l,m,g,u;let s;if(i)s=a;else{let d=(m=r==null?void 0:r.xAbsolute)!=null?m:((l=r==null?void 0:r.xRelative)!=null?l:50)*n/100,h=(u=r==null?void 0:r.yAbsolute)!=null?u:((g=r==null?void 0:r.yRelative)!=null?g:50)*o/100,f=e+d,c=t+h;s=pe([1,0,0,1,f,c],pe(a,[1,0,0,1,-f,-c])),a.__parent&&(s=pe(a.__parent,s)),a.splice(0,6,...s)}return`matrix(${s.map(d=>d.toFixed(2)).join(",")})`}function At({left:e,top:t,width:n,height:o,isInheritingTransform:a},i){let r="",s=1;return i.transform&&(r=le({left:e,top:t,width:n,height:o},i.transform,a,i.transformOrigin)),i.opacity&&(s=+i.opacity),{matrix:r,opacity:s}}function Ve({id:e,content:t,filter:n,left:o,top:a,width:i,height:r,matrix:s,opacity:l,image:m,clipPathId:g,debug:u,shape:d,decorationShape:h},f){let c="";if(u&&(c=x("rect",{x:o,y:a-r,width:i,height:r,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:s||void 0,"clip-path":g?`url(#${g})`:void 0})),m){let y={href:m,x:o,y:a,width:i,height:r,transform:s||void 0,"clip-path":g?`url(#${g})`:void 0,style:f.filter?`filter:${f.filter}`:void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+x("image",{...y,opacity:l!==1?l:void 0})+(h||"")+(n?"</g>":"")+c,""]}let b={x:o,y:a,width:i,height:r,"font-weight":f.fontWeight,"font-style":f.fontStyle,"font-size":f.fontSize,"font-family":f.fontFamily,"letter-spacing":f.letterSpacing||void 0,transform:s||void 0,"clip-path":g?`url(#${g})`:void 0,style:f.filter?`filter:${f.filter}`:void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+x("text",{...b,fill:f.color,opacity:l!==1?l:void 0},t)+(h||"")+(n?"</g>":"")+c,d?x("text",b,t):""]}function fe({id:e,width:t,height:n},o){if(!o.shadowColor||!o.shadowOffset||typeof o.shadowRadius>"u")return"";let a=o.shadowRadius*o.shadowRadius/4,i=Math.min(o.shadowOffset.width-a,0),r=Math.max(o.shadowOffset.width+a+t,t),s=Math.min(o.shadowOffset.height-a,0),l=Math.max(o.shadowOffset.height+a+n,n);return`<defs><filter id="satori_s-${e}" x="${i/t*100}%" y="${s/n*100}%" width="${(r-i)/t*100}%" height="${(l-s)/n*100}%"><feDropShadow dx="${o.shadowOffset.width}" dy="${o.shadowOffset.height}" stdDeviation="${o.shadowRadius/2}" flood-color="${o.shadowColor}" flood-opacity="1"/></filter></defs>`}function Je({width:e,left:t,top:n,ascender:o,clipPathId:a},i){let{textDecorationColor:r,textDecorationStyle:s,textDecorationLine:l,fontSize:m}=i;if(!l||l==="none")return"";let g=Math.max(1,m*.1),u=l==="line-through"?n+o*.5:l==="underline"?n+o*1.1:n,d=s==="dashed"?`${g*1.2} ${g*2}`:s==="dotted"?`0 ${g*2}`:void 0;return x("line",{x1:t,y1:u,x2:t+e,y2:u,stroke:r,"stroke-width":g,"stroke-dasharray":d,"stroke-linecap":s==="dotted"?"round":"square","clip-path":a?`url(#${a})`:void 0})}var qe=void 0;async function*Ke(e,t){var dt;let n=ee(),{parentStyle:o,inheritedStyle:a,parent:i,font:r,id:s,isInheritingTransform:l,debug:m,embedFont:g,graphemeImages:u,canLoadAdditionalAssets:d}=t;o.textTransform==="uppercase"?e=e.toLocaleUpperCase(qe):o.textTransform==="lowercase"?e=e.toLocaleLowerCase(qe):o.textTransform==="capitalize"&&(e=ae(e,"word").map(_=>ae(_,"grapheme").map((C,A)=>A===0?C.toLocaleUpperCase(qe):C).join("")).join(""));let h=K(o.wordBreak,{normal:"word","break-all":"grapheme","break-word":"grapheme","keep-all":"word"},"word"),f=ae(e,h),c=n.Node.create();c.setAlignItems(n.ALIGN_BASELINE),o.textAlign==="left"?c.setJustifyContent(n.JUSTIFY_FLEX_START):o.textAlign==="center"?c.setJustifyContent(n.JUSTIFY_CENTER):o.textAlign==="right"?c.setJustifyContent(n.JUSTIFY_FLEX_END):o.textAlign==="justify"&&c.setJustifyContent(n.JUSTIFY_SPACE_BETWEEN),i.insertChild(c,i.getChildCount());let{textAlign:b,textOverflow:y,whiteSpace:v,lineHeight:O,filter:$,_inheritedBackgroundClipTextPath:N}=o,W=o.fontSize,R=r.getEngine(W,O,o),V=d?f.filter(_=>!R.check(_)):[];yield V,V.length&&(R=r.getEngine(W,O,o));let L=[],E=[],M=[],G=[],z=new Map,k=_=>{let C=0;for(let A of _){if(z.has(A)){C+=z.get(A);continue}let U=R.measure(A,o);z.set(A,U),C+=U}return C},P=0,J=[],p=0;for(let _ of f){let C=!1,A=u&&u[_];v==="pre"?C=_[0]===`
`:v!=="nowrap"&&(A||Re.includes(_[0]))&&(C=!0),C?(v==="nowrap"?p+=k(J)+o.fontSize:(P=Math.max(P,k(J)),A&&(P=Math.max(P,o.fontSize))),J=[]):(!Re.includes(_[0])||!J.length)&&J.push(_===`
`?" ":_)}P=Math.max(P,k(J)+p);let w=i.getMinWidth(),I=i.getMaxWidth(),Z=i.getWidth();isNaN(Z.value)&&(isNaN(w.value)||w.unit===1&&w.value>P)&&(isNaN(I.value)||I.unit===1&&(P=Math.min(P,I.value)),i.setMinWidth(P)),typeof o.flexShrink>"u"&&i.setFlexShrink(1);let ge=v==="pre-wrap"||v==="pre";c.setMeasureFunc(_=>{let C=0,A="",U=0,H=0,Y=0,X=-1,re=0,F=0,ie=0;L=[],M=[0];for(let ne=0;ne<f.length;ne++){let D=f[ne];if(!ge&&Re.includes(D[0]))A||(A=" "),U=k([A]),G[ne]=null;else{let oe=ge&&D===`
`,j=oe?0:u&&u[D]?o.fontSize:k([D]);H||(A="",U=0);let B=U||",.!?:-@)>]}%#".indexOf(D[0])<0,q=!H||!!U;if(oe||ne&&B&&H+U+j>_&&v!=="nowrap"&&v!=="pre")L.push(H),E.push(ie),C++,re+=F,H=j,F=j?R.height(D):0,ie=j?R.baseline(D):0,M.push(1),X=-1,oe||(Y=Math.max(Y,_));else{H+=U+j;let de=R.height(D);de>F&&(F=de,ie=R.baseline(D)),q&&M[M.length-1]++}A="",U=0,q&&X++,Y=Math.max(Y,H),G[ne]={y:re,x:H-j,width:j,line:C,lineIndex:X}}}return H&&(C++,L.push(H),E.push(ie),re+=F),{width:Y,height:re}});let[$t,Mt]=yield,Pe="",we="",te=a._inheritedClipPathId,{left:st,top:lt,width:ve,height:ft}=c.getComputedLayout(),Oe=i.getComputedWidth()-i.getComputedPadding(n.EDGE_LEFT)-i.getComputedPadding(n.EDGE_RIGHT)-i.getComputedBorder(n.EDGE_LEFT)-i.getComputedBorder(n.EDGE_RIGHT),ue=$t+st,ce=Mt+lt,{matrix:Q,opacity:Ee}=At({left:st,top:lt,width:ve,height:ft,isInheritingTransform:l},o),ke="";o.textShadowOffset&&(ke=fe({width:ve,height:ft,id:s},{shadowColor:o.textShadowColor,shadowOffset:o.textShadowOffset,shadowRadius:o.textShadowRadius}));let me="",Se="",ut="",Fe=-1,ct=y==="ellipsis"?k(["\u2026"]):0,Wt=y==="ellipsis"?k([" "]):0,Te={};for(let _=0;_<f.length;_++){if(!G[_])continue;let C=G[_],A=f[_],U=null,H=u?u[A]:null,Y=C.y,X=C.x,re=C.width,F=C.line;if(F===Fe)continue;let ie=!1;if(L.length>1){let B=ve-L[F];if(b==="right"||b==="end")X+=B;else if(b==="center")X+=B/2;else if(b==="justify"&&F<L.length-1){let q=M[F];X+=(q>1?B/(q-1):0)*C.lineIndex,ie=!0}}if(Te[F]||(Te[F]=[X,ie?ve:L[F]]),y==="ellipsis"&&L[F]>Oe&&C.x+re+ct+Wt>Oe){let B=ae(A,"grapheme"),q="",de=0;for(let pt of B){let gt=C.x+k([q+pt]);if(q&&gt+ct>Oe)break;q+=pt,de=gt}A=q+"\u2026",Fe=F,Te[F][1]=de}let ne=E[F],D=R.baseline(A),oe=R.height(A),j=ne-D;if(H?Y+=0:g?(U=R.getSVG(A,{...o,left:ue+X,top:ce+Y+D+j,letterSpacing:o.letterSpacing}),m&&(ut+=x("rect",{x:ue+X,y:ce+Y+j,width:C.width,height:oe,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:Q||void 0,"clip-path":te?`url(#${te})`:void 0})+x("line",{x1:ue+X,x2:ue+X+C.width,y1:ce+Y+j+D,y2:ce+Y+j+D,stroke:"#14c000","stroke-width":1,transform:Q||void 0,"clip-path":te?`url(#${te})`:void 0}))):Y+=D+j,o.textDecorationLine&&(F!==((dt=G[_+1])==null?void 0:dt.line)||Fe===F)){let B=Te[F];B&&!B[2]&&(me+=Je({left:ue+B[0],top:ce+oe*+F,width:B[1],ascender:R.baseline(A),clipPathId:te},o),B[2]=1)}if(U!==null)Se+=U+" ";else{let[B,q]=Ve({content:A,filter:ke,id:s,left:ue+X,top:ce+Y,width:re,height:oe,matrix:Q,opacity:Ee,image:H,clipPathId:te,debug:m,shape:!!N,decorationShape:me},o);Pe+=B,we+=q,me=""}}if(Se){let _=o.color!=="transparent"&&Ee!==0?x("path",{fill:o.color,d:Se,transform:Q||void 0,opacity:Ee!==1?Ee:void 0,"clip-path":te?`url(#${te})`:void 0,style:$?`filter:${$}`:void 0}):"";N&&(we=x("path",{d:Se,transform:Q||void 0})),Pe+=(ke?ke+x("g",{filter:`url(#satori_s-${s})`},_+me):_+me)+ut}return we&&(o._inheritedBackgroundClipTextPath.value+=we),Pe}var Ze=Ze||{};Ze.parse=function(){var e={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function n(p){var w=new Error(t+": "+p);throw w.source=t,w}function o(){var p=a();return t.length>0&&n("Invalid input not EOF"),p}function a(){return O(i)}function i(){return r("linear-gradient",e.linearGradient,l)||r("repeating-linear-gradient",e.repeatingLinearGradient,l)||r("radial-gradient",e.radialGradient,u)||r("repeating-radial-gradient",e.repeatingRadialGradient,u)}function r(p,w,I){return s(w,function(Z){var ge=I();return ge&&(P(e.comma)||n("Missing comma before color stops")),{type:p,orientation:ge,colorStops:O($)}})}function s(p,w){var I=P(p);if(I){P(e.startCall)||n("Missing (");var Z=w(I);return P(e.endCall)||n("Missing )"),Z}}function l(){return m()||g()}function m(){return k("directional",e.sideOrCorner,1)}function g(){return k("angular",e.angleValue,1)}function u(){var p,w=d(),I;return w&&(p=[],p.push(w),I=t,P(e.comma)&&(w=d(),w?p.push(w):t=I)),p}function d(){var p=h()||f();if(p)p.at=b();else{var w=c();if(w){p=w;var I=b();I&&(p.at=I)}else{var Z=y();Z&&(p={type:"default-radial",at:Z})}}return p}function h(){var p=k("shape",/^(circle)/i,0);return p&&(p.style=z()||c()),p}function f(){var p=k("shape",/^(ellipse)/i,0);return p&&(p.style=M()||c()),p}function c(){return k("extent-keyword",e.extentKeywords,1)}function b(){if(k("position",/^at/,0)){var p=y();return p||n("Missing positioning value"),p}}function y(){var p=v();if(p.x||p.y)return{type:"position",value:p}}function v(){return{x:M(),y:M()}}function O(p){var w=p(),I=[];if(w)for(I.push(w);P(e.comma);)w=p(),w?I.push(w):n("One extra comma");return I}function $(){var p=N();return p||n("Expected color definition"),p.length=M(),p}function N(){return R()||L()||V()||W()}function W(){return k("literal",e.literalColor,0)}function R(){return k("hex",e.hexColor,1)}function V(){return s(e.rgbColor,function(){return{type:"rgb",value:O(E)}})}function L(){return s(e.rgbaColor,function(){return{type:"rgba",value:O(E)}})}function E(){return P(e.number)[1]}function M(){return k("%",e.percentageValue,1)||G()||z()}function G(){return k("position-keyword",e.positionKeywords,1)}function z(){return k("px",e.pixelValue,1)||k("em",e.emValue,1)}function k(p,w,I){var Z=P(w);if(Z)return{type:p,value:Z[I]}}function P(p){var w,I;return I=/^[\n\r\t\s]+/.exec(t),I&&J(I[0].length),w=p.exec(t),w&&J(w[0].length),w}function J(p){t=t.substr(p)}return function(p){return t=p.toString(),o()}}();var Qe=Ze;function gn(e){return e.type==="literal"?e.value:e.type==="hex"?`#${e.value}`:e.type==="rgb"?`rgb(${e.value.join(",")})`:e.type==="rgba"?`rgba(${e.value.join(",")})`:"transparent"}function mn(e,t){return typeof e=="string"&&e.endsWith("%")?t*parseFloat(e)/100:+e}function et(e,{x:t,y:n,defaultX:o,defaultY:a}){return(e?e.split(" ").map(i=>{try{let r=new se(i);return r.type==="length"||r.type==="number"?r.value:r.value+r.unit}catch{return null}}).filter(i=>i!==null):[o,a]).map((i,r)=>mn(i,[t,n][r]))}function Lt(e,t){let n=[];for(let r of t){let s=gn(r);if(!n.length&&(n.push({offset:0,color:s}),typeof r.length>"u"||r.length.value==="0"))continue;let l=typeof r.length>"u"?void 0:r.length.type==="%"?r.length.value/100:r.length.value/e;n.push({offset:l,color:s})}n.length||n.push({offset:0,color:"transparent"});let o=n[n.length-1];o.offset!==1&&(typeof o.offset>"u"?o.offset=1:n.push({offset:1,color:o.color}));let a=0,i=1;for(let r=0;r<n.length;r++)if(typeof n[r].offset>"u"){for(i<r&&(i=r);typeof n[i].offset>"u";)i++;n[r].offset=(n[i].offset-n[a].offset)/(i-a)*(r-a)+n[a].offset}else a=r;return n}async function tt({id:e,width:t,height:n},{image:o,size:a,position:i,repeat:r}){r=r||"repeat";let s=r==="repeat-x"||r==="repeat",l=r==="repeat-y"||r==="repeat",m=et(a,{x:t,y:n,defaultX:t,defaultY:n}),g=et(i,{x:t,y:n,defaultX:0,defaultY:0});if(o.startsWith("linear-gradient(")){let u=Qe.parse(o)[0],d,h,f,c;if(u.orientation.type==="directional")[d,h,f,c]={top:[0,1,0,0],bottom:[0,0,0,1],left:[1,0,0,0],right:[0,0,1,0]}[u.orientation.value];else if(u.orientation.type==="angular"){let y=+u.orientation.value/180*Math.PI-Math.PI/2,v=Math.cos(y),O=Math.sin(y);d=0,h=0,f=v,c=O,f<0&&(d-=f,f=0),c<0&&(h-=c,c=0)}let b=Lt(t,u.colorStops);return[`satori_bi${e}`,`<linearGradient id="satori_bi${e}" x1="${d}" y1="${h}" x2="${f}" y2="${c}">${b.map(y=>`<stop offset="${y.offset*100}%" stop-color="${y.color}"/>`).join("")}</linearGradient>`]}if(o.startsWith("radial-gradient(")){let u=Qe.parse(o)[0],d=u.orientation[0],[h,f]=m,c="circle",b=h/2,y=f/2;if(d.type==="shape"){if(c=d.value,d.at)if(d.at.type==="position")b=d.at.value.x.value,y=d.at.value.y.value;else throw new Error("orientation.at.type not implemented: "+d.at.type)}else throw new Error("orientation.type not implemented: "+d.type);let v=Lt(t,u.colorStops),O=`satori_radial_${e}`,$=`satori_pattern_${e}`,N={},W=Math.max(Math.abs(h-b),Math.abs(b)),R=Math.max(Math.abs(f-y),Math.abs(y));if(c==="circle")N.r=Math.sqrt(W*W+R*R);else if(c==="ellipse"){let E=R!==0?W/R:1;N.ry=Math.sqrt(W*W+R*R*E*E)/E,N.rx=N.ry*E}let V=x("pattern",{id:$,x:g[0],y:g[1],width:s?h:"100%",height:l?f:"100%",patternUnits:"userSpaceOnUse"},x("radialGradient",{id:O},v.map(E=>x("stop",{offset:E.offset,"stop-color":E.color})).join(""))+x(c,{cx:b,cy:y,width:h,height:f,...N,fill:`url(#${O})`}));return[$,V]}if(o.startsWith("url(")){let u=et(a,{x:t,y:n,defaultX:0,defaultY:0}),[d,h,f]=await Ce(o.slice(4,-1)),c=u[0]||h,b=u[1]||f;return[`satori_bi${e}`,x("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:g[0],y:g[1],width:s?c:"100%",height:l?b:"100%"},x("image",{x:0,y:0,width:c,height:b,href:d}))]}}function Ae(e,t,n){return n<e+t&&(n/2<e&&n/2<t?e=t=n/2:n/2<e?e=n-t:n/2<t&&(t=n-e)),[e,t]}function be({left:e,top:t,width:n,height:o},a){let{borderTopLeftRadius:i,borderTopRightRadius:r,borderBottomLeftRadius:s,borderBottomRightRadius:l}=a;return i=Math.min(i||0,n,o),r=Math.min(r||0,n,o),s=Math.min(s||0,n,o),l=Math.min(l||0,n,o),!i&&!r&&!s&&!l?"":([i,r]=Ae(i,r,n),[i,s]=Ae(i,s,o),[r,l]=Ae(r,l,o),[s,l]=Ae(s,l,n),`M${e+i},${t} h${n-i-r} a${r},${r} 0 0 1 ${r},${r} v${o-r-l} a${l},${l} 0 0 1 ${-l},${l} h${l+s-n} a${s},${s} 0 0 1 ${-s},${-s} v${s+i-o} a${i},${i} 0 0 1 ${i},${-i}`)}function nt({left:e,top:t,width:n,height:o,path:a,id:i},r){return r.overflow!=="hidden"?"":a?x("clipPath",{id:`satori_cp-${i}`,"clip-path":r._inheritedClipPathId?`url(#${r._inheritedClipPathId})`:void 0},x("path",{x:e,y:t,width:n,height:o,d:a})):x("clipPath",{id:`satori_cp-${i}`,"clip-path":r._inheritedClipPathId?`url(#${r._inheritedClipPathId})`:void 0},x("rect",{x:e,y:t,width:n,height:o}))}async function rt({id:e,left:t,top:n,width:o,height:a,isInheritingTransform:i,debug:r},s){if(s.display==="none")return"";let l="rect",m="transparent",g="",u=0,d="",h="",f=[],c=1,b="";s.backgroundColor&&f.push(s.backgroundColor),s.borderWidth&&(u=s.borderWidth,m=s.borderColor,s.borderStyle==="dashed"&&(g=u*2+" "+u)),s.opacity&&(c=+s.opacity),s.transform&&(d=le({left:t,top:n,width:o,height:a},s.transform,i,s.transformOrigin));let y="";if(s.backgroundImage){let L=[];for(let E=0;E<s.backgroundImage.length;E++){let M=s.backgroundImage[E],G=await tt({id:e+"_"+E,width:o,height:a},M);G&&L.push(G)}for(let E of L)f.push(`url(#${E[0]})`),h+=E[1],E[2]&&(y+=E[2])}let v=be({left:t,top:n,width:o,height:a},s);v&&(l="path");let O=nt({left:t,top:n,width:o,height:a,path:v,id:e},s),$=s._inheritedClipPathId,N=fe({width:o,height:a,id:e},s);r&&(b=x("rect",{x:t,y:n,width:o,height:a,fill:"transparent",stroke:"#ff5757","stroke-width":1,"stroke-dasharray":g||void 0,transform:d||void 0,"clip-path":$?`url(#${$})`:void 0})),f.length||f.push("transparent");let{backgroundClip:W,filter:R}=s,V=f.map((L,E)=>{if(L==="transparent"&&!(E===f.length-1&&u))return"";let M=!!u,G=E===f.length-1&&M&&W!=="text",z=W==="text"?`url(#satori_bct-${e})`:$?`url(#${$})`:void 0;return G&&(h+=x("clipPath",{id:`satori_bc-${e}`,"clip-path":z},x(l,{x:t,y:n,width:o,height:a,d:v||void 0})),z=`url(#satori_bc-${e})`),x(l,{x:t,y:n,width:o,height:a,fill:L,stroke:G||M?m:void 0,"stroke-width":G?u*2:M?1:void 0,"stroke-dasharray":g||void 0,d:v||void 0,transform:d||void 0,"clip-path":z,style:R?`filter:${R}`:void 0})}).join("");return W==="text"&&u&&(V=x(l,{x:t,y:n,width:o,height:a,fill:"transparent",stroke:m,"stroke-width":u*2,"stroke-dasharray":g||void 0,d:v||void 0,transform:d||void 0,"clip-path":$?`url(#${$})`:void 0})+V),(h?`<defs>${h}</defs>`:"")+O+(N?`${N}<g filter="url(#satori_s-${e})">`:"")+(c!==1?`<g opacity="${c}">`:"")+(y||V)+(c!==1?"</g>":"")+(N?"</g>":"")+b}function Le({id:e,left:t,top:n,width:o,height:a,src:i,debug:r,isInheritingTransform:s},l){if(l.display==="none")return"";let m="",g=1,u="",d=l.objectFit==="contain"?"xMidYMid":l.objectFit==="cover"?"xMidYMid slice":"none",h=be({left:t,top:n,width:o,height:a},l),f=l._inheritedClipPathId;h&&(m=x("clipPath",{id:`satori_c-${e}`,"clip-path":f?`url(#${f})`:void 0},x("path",{x:t,y:n,width:o,height:a,d:h}))),l.opacity&&(g=+l.opacity);let c=fe({width:o,height:a,id:e},l);return l.transform&&(u=le({left:t,top:n,width:o,height:a},l.transform,s,l.transformOrigin)),c+(c?`<g filter="url(#satori_s-${e})">`:"")+m+x("image",{x:t,y:n,width:o,height:a,href:i,preserveAspectRatio:d,transform:u||void 0,"clip-path":m?`url(#satori_c-${e})`:f?`url(#${f})`:void 0})+(c?"</g>":"")}async function*ye(e,t){var J;let n=ee(),{id:o,inheritedStyle:a,parent:i,font:r,debug:s,embedFont:l=!0,graphemeImages:m,canLoadAdditionalAssets:g}=t;if(e===null||typeof e>"u")return yield,yield,"";if(!Ge(e)||typeof e.type=="function"){let p;if(!Ge(e))p=Ke(String(e),t),yield(await p.next()).value;else{if(bt(e.type))throw new Error("Class component is not supported.");p=ye(e.type(e.props),t),yield(await p.next()).value}await p.next();let w=yield;return(await p.next(w)).value}let{type:u,props:d}=e,{style:h,children:f}=d||{},c=n.Node.create();i.insertChild(c,i.getChildCount());let[b,y]=await je(c,u,a,h,d),v=b.transform===a.transform;if(v||(b.transform.__parent=a.transform),b.overflow==="hidden"&&(y._inheritedClipPathId=`satori_cp-${o}`),b.backgroundClip==="text"){let p={value:""};y._inheritedBackgroundClipTextPath=p,b._inheritedBackgroundClipTextPath=p}let O=yt(f),$=[],N=0,W=[];for(let p of O){let w=ye(p,{id:o+"-"+N++,parentStyle:b,inheritedStyle:y,isInheritingTransform:!0,parent:c,font:r,embedFont:l,debug:s,graphemeImages:m,canLoadAdditionalAssets:g});g?W.push(...(await w.next()).value||[]):await w.next(),$.push(w)}yield W;for(let p of $)await p.next();let[R,V]=yield,{left:L,top:E,width:M,height:G}=c.getComputedLayout();L+=R,E+=V;let z="",k="",P="";if(u==="img"){let p=b.__src;k=Le({id:o,left:L,top:E,width:M,height:G,src:p,isInheritingTransform:v,debug:s},b)}else if(u==="svg"){let p=vt(e);k=Le({id:o,left:L,top:E,width:M,height:G,src:p,isInheritingTransform:v,debug:s},b)}else{let p=(J=h==null?void 0:h.display)!=null?J:"block";if(u==="div"&&f&&typeof f!="string"&&p!=="flex"&&p!=="none")throw new Error(`Expected <div> to have style={{display: 'flex'}} but received style={{display: '${p}'}}`);k=await rt({id:o,left:L,top:E,width:M,height:G,isInheritingTransform:v,debug:s},b)}for(let p of $)z+=(await p.next([L,E])).value;return b._inheritedBackgroundClipTextPath&&(P+=x("clipPath",{id:`satori_bct-${o}`,"clip-path":b._inheritedClipPathId?`url(#${b._inheritedClipPathId})`:void 0},b._inheritedBackgroundClipTextPath.value)),P+k+z}import it from"@shuding/opentype.js";function hn(e,t,[n,o],[a,i]){if(n!==a)return n?!a||n===e?-1:a===e?1:e===400&&n===500||e===500&&n===400?-1:e===400&&a===500||e===500&&a===400?1:e<400?n<e&&a<e?a-n:n<e?-1:a<e?1:n-a:e<n&&e<a?n-a:e<n?-1:e<a?1:a-n:1;if(o!==i){if(o===t)return-1;if(i===t)return 1}return-1}var xe=class{constructor(t){this.fonts=new Map;this.addFonts(t)}get({name:t,weight:n,style:o}){if(!this.fonts.has(t))return null;n==="normal"&&(n=400),n==="bold"&&(n=700);let a=[...this.fonts.get(t)],i=a[0];for(let r=1;r<a.length;r++){let[,s,l]=i,[,m,g]=a[r];hn(n,o,[s,l],[m,g])>0&&(i=a[r])}return i[0]}addFonts(t){for(let n of t){let o=n.data,a=it.parse("buffer"in o?o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength):o,{lowMemory:!0}),i=a.charToGlyphIndex;a.charToGlyphIndex=s=>{let l=i.call(a,s);return l===0&&a._trackBrokenChars&&a._trackBrokenChars.push(s),l},this.defaultFont||(this.defaultFont=a);let r=n.name.toLowerCase();this.fonts.has(r)||this.fonts.set(r,[]),this.fonts.get(r).push([a,n.weight,n.style])}}getEngine(t=16,n=1.2,{fontFamily:o,fontWeight:a=400,fontStyle:i="normal"}){if(!this.fonts.size)throw new Error("No fonts are loaded. At least one font is required to calculate the layout.");o=(Array.isArray(o)?o:[o]).map(f=>f.toLowerCase());let r=o.map(f=>this.get({name:f,weight:a,style:i})).filter(Boolean),s=Array.from(this.fonts.keys());for(let f of s)o.includes(f)||r.push(this.get({name:f,weight:a,style:i}));let l=new Map,m=(f,c=!0)=>{let b=f.charCodeAt(0);if(l.has(b))return l.get(b);let y=r.find((v,O)=>!!v.charToGlyphIndex(f)||c&&O===r.length-1);return y&&l.set(b,y),y},g=(f,c=!1)=>{var y,v;return((c?(v=(y=f.tables)==null?void 0:y.os2)==null?void 0:v.sTypoAscender:0)||f.ascender)/f.unitsPerEm*t},u=(f,c=!1)=>{var y,v;return((c?(v=(y=f.tables)==null?void 0:y.os2)==null?void 0:v.sTypoDescender:0)||f.descender)/f.unitsPerEm*t},d=f=>m(f,!1),h={check:f=>{let c=d(f);return c?(c._trackBrokenChars=[],c.stringToGlyphs(f),c._trackBrokenChars.length?(c._trackBrokenChars=void 0,!1):!0):!1},baseline:(f,c=typeof f>"u"?r[0]:m(f))=>{let b=g(c,!0),y=u(c,!0),v=h.height(f,c),{yMax:O,yMin:$}=c.tables.head,N=b-y,W=(O/(O-$)-1)*N;return v*((1.2/n+1)/2)+W},height:(f,c=typeof f>"u"?r[0]:m(f))=>(g(c)-u(c))*(n/1.2),measure:(f,c)=>this.measure(m,f,c),getSVG:(f,c)=>this.getSVG(m,f,c)};return h}patchFontFallbackResolver(t,n){let o=[];t._trackBrokenChars=o;let a=t.stringToGlyphs;return t.stringToGlyphs=(i,...r)=>{let s=a.call(t,i,...r);for(let l=0;l<s.length;l++)if(s[l].unicode===void 0){let m=o.shift(),g=n(m);if(g!==t){let u=g.charToGlyph(m),d=t.unitsPerEm/g.unitsPerEm,h=new it.Path;h.unitsPerEm=t.unitsPerEm,h.commands=u.path.commands.map(c=>{let b={...c};for(let y in b)typeof b[y]=="number"&&(b[y]*=d);return b});let f=new it.Glyph({...u,advanceWidth:u.advanceWidth*d,xMin:u.xMin*d,xMax:u.xMax*d,yMin:u.yMin*d,yMax:u.yMax*d,path:h});s[l]=f}}return s},()=>{t.stringToGlyphs=a,t._trackBrokenChars=void 0}}measure(t,n,{fontSize:o,letterSpacing:a=0}){let i=t(n),r=this.patchFontFallbackResolver(i,t);try{return i.getAdvanceWidth(n,o,{letterSpacing:a/o})}finally{r()}}getSVG(t,n,{fontSize:o,top:a,left:i,letterSpacing:r=0}){let s=t(n),l=this.patchFontFallbackResolver(s,t);try{return o===0?"":s.getPath(n,i,a,o,{letterSpacing:r/o}).toPathData(1)}finally{l()}}};function ot({width:e,height:t,content:n}){return x("svg",{width:e,height:t,viewBox:`0 0 ${e} ${t}`,xmlns:"http://www.w3.org/2000/svg"},n)}var Pt={emoji:/\p{RI}\p{RI}|\p{Emoji}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?(\u{200D}\p{Emoji}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?)+|\p{EPres}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?|\p{Emoji}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})/u,ja:/\p{scx=Hira}|\p{scx=Kana}|[,;:]/u,ko:/\p{scx=Hangul}/u,zh:/\p{scx=Han}/u,th:/\p{scx=Thai}/u,bn:/\p{scx=Bengali}/u,ar:/\p{scx=Arabic}/u,ta:/\p{scx=Tamil}/u,ml:/\p{scx=Malayalam}/u,he:/\p{scx=Hebrew}/u,te:/\p{scx=Telugu}/u,devanagari:/\p{scx=Devanagari}/u};function Ot(e){for(let t in Pt)if(Pt[t].test(e))return t;return"unknown"}var at=new WeakMap;async function Ft(e,t){let n=ee();if(!n)throw new Error("Satori is not initialized.");let o;at.has(t.fonts)?o=at.get(t.fonts):at.set(t.fonts,o=new xe(t.fonts));let a=n.Node.create();a.setWidth(t.width),a.setHeight(t.height),a.setFlexDirection(n.FLEX_DIRECTION_ROW),a.setFlexWrap(n.WRAP_WRAP),a.setAlignContent(n.ALIGN_AUTO),a.setAlignItems(n.ALIGN_FLEX_START),a.setJustifyContent(n.JUSTIFY_FLEX_START),a.setOverflow(n.OVERFLOW_HIDDEN);let i={...t.graphemeImages},r=ye(e,{id:"id",parentStyle:{},inheritedStyle:{fontSize:16,fontWeight:"normal",fontFamily:"serif",fontStyle:"normal",lineHeight:1.2,color:"black",opacity:1,whiteSpace:"normal",_viewportWidth:t.width,_viewportHeight:t.height},parent:a,font:o,embedFont:t.embedFont,debug:t.debug,graphemeImages:i,canLoadAdditionalAssets:!!t.loadAdditionalAsset}),s=(await r.next()).value;if(t.loadAdditionalAsset&&s.length){s=Array.from(new Set(ae(s.join(""),"grapheme")));let m={};s.forEach(d=>{let h=Ot(d);m[h]=m[h]||[],h==="emoji"?m[h].push(d):m[h][0]=(m[h][0]||"")+d});let g=[],u={};await Promise.all(Object.entries(m).flatMap(([d,h])=>h.map(f=>t.loadAdditionalAsset(d,f).then(c=>{typeof c=="string"?u[f]=c:c&&g.push(c)})))),o.addFonts(g),Object.assign(i,u)}await r.next(),a.calculateLayout(t.width,t.height,n.DIRECTION_LTR);let l=(await r.next([0,0])).value;return a.freeRecursive(),ot({width:t.width,height:t.height,content:l})}export{Ft as default,Nt as init};
//# sourceMappingURL=index.wasm.js.map
{
"name": "satori",
"version": "0.0.32",
"version": "0.0.33",
"description": "Satori converts HTML JSX to SVG string.",

@@ -9,2 +9,3 @@ "module": "./dist/esm/index.js",

"type": "module",
"license": "MPL-2.0",
"files": [

@@ -18,12 +19,2 @@ "dist/**"

},
"scripts": {
"dev": "concurrently \"pnpm dev:default\" \"pnpm dev:wasm\"",
"dev:default": "NODE_ENV=development tsup src/index.ts --watch --ignore-watch playground",
"dev:wasm": "WASM=1 NODE_ENV=development tsup src/index.ts --watch --ignore-watch playground",
"build": "NODE_ENV=production pnpm run test && pnpm run build:default && pnpm run build:wasm",
"build:default": "tsup",
"build:wasm": "WASM=1 tsup",
"test": "NODE_ENV=test vitest run --outputTruncateLength=9999999",
"dev:test": "NODE_ENV=test vitest --update --outputTruncateLength=9999999"
},
"repository": {

@@ -64,5 +55,16 @@ "type": "git",

},
"packageManager": "pnpm@7.11.0",
"engines": {
"node": ">=16"
},
"scripts": {
"dev": "concurrently \"pnpm dev:default\" \"pnpm dev:wasm\"",
"dev:default": "NODE_ENV=development tsup src/index.ts --watch --ignore-watch playground",
"dev:wasm": "WASM=1 NODE_ENV=development tsup src/index.ts --watch --ignore-watch playground",
"build": "NODE_ENV=production pnpm run test && pnpm run build:default && pnpm run build:wasm",
"build:default": "tsup",
"build:wasm": "WASM=1 tsup",
"test": "NODE_ENV=test vitest run --outputTruncateLength=9999999",
"dev:test": "NODE_ENV=test vitest --update --outputTruncateLength=9999999"
}
}
}

@@ -1,10 +0,13 @@

<h1 align="center">
Satori
</h1>
![Satori](.github/card.png)
## API
**Satori**: A library that converts HTML and CSS into SVG.
Satori converts HTML and CSS into SVG.
[Playground →](https://satori-playground.vercel.app)
## Overview
Satori supports the JSX syntax, which makes it very straightforward to use. Here’s an overview of the basic usage:
```jsx
// api.jsx
import satori from 'satori'

@@ -24,8 +27,3 @@

},
...
],
embedFont: true, // Embed the font in SVG as path data. Optional, default: true.
debug: false, // Show the bounding box for debugging. Optional, default: false.
graphemeImages: {}, // Custom grapheme images, see "Emojis". Optional, default: empty.
loadAdditionalAsset, // See "Dynamically Load Emojis and Fonts" below. Optional.
},

@@ -35,3 +33,3 @@ )

Which yields:
Satori will render the element into a 600×400 SVG, and return the SVG string:

@@ -42,4 +40,6 @@ ```js

Text (with font data) will be embedded in the SVG as paths.
Under the hood, it handles layout calculation, font, typography and more, to generate a SVG that matches the exact same HTML and CSS in a browser.
<br/>
## Playground

@@ -49,2 +49,4 @@

<br/>
## Documentation

@@ -87,3 +89,3 @@

You can use `<img>` to embed images but `src`, `width`, and `height` attributes are all required.
You can use `<img>` to embed images. However, `width`, and `height` attributes are recommended to set:

@@ -344,2 +346,34 @@ ```jsx

### Font Embedding
By default, Satori renders the text as `<path>` in SVG, instead of `<text>`. That means it embeds the font path data as inlined information, so succeeding processes (e.g. render the SVG on another platform) don’t need to deal with font files anymore.
You can turn off this behavior by setting `embedFonts` to `false`, and Satori will use `<text>` instead:
```jsx
const svg = await satori(
<div style={{ color: 'black' }}>hello, world</div>,
{
...,
embedFont: false,
},
)
```
### Debug
To draw the bounding box for debugging, you can pass `debug: true` as an option:
```jsx
const svg = await satori(
<div style={{ color: 'black' }}>hello, world</div>,
{
...,
debug: true,
},
)
```
<br/>
## Contribute

@@ -370,2 +404,4 @@

<br/>
## Author

@@ -372,0 +408,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc