@feliperohdee/satori 0.0.16 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @feliperohdee/satori might be problematic. Click here for more details.
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/standalone.cjs +1 -1
- package/dist/standalone.cjs.map +1 -1
- package/dist/standalone.js +1 -1
- package/dist/standalone.js.map +1 -1
- package/package.json +1 -1
package/dist/standalone.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var Yo=Object.defineProperty;var Ut=(e,t)=>()=>(e&&(t=e(e=0)),t);var qo=(e,t)=>{for(var n in t)Yo(e,n,{get:t[n],enumerable:!0})};function Or(e){e=e||{};var t;t||(t=typeof e<"u"?e:{});var n,o;t.ready=new Promise(function(u,l){n=u,o=l});var i=Object.assign({},t),r="";typeof document<"u"&&document.currentScript&&(r=document.currentScript.src),Wr&&(r=Wr),r.indexOf("blob:")!==0?r=r.substr(0,r.replace(/[?#].*/,"").lastIndexOf("/")+1):r="";var a=t.print||console.log.bind(console),c=t.printErr||console.warn.bind(console);Object.assign(t,i),i=null;var s;t.wasmBinary&&(s=t.wasmBinary);var d=t.noExitRuntime||!0;typeof WebAssembly!="object"&&ue("no native wasm support detected");var f,p=!1;function g(u,l,m){m=l+m;for(var h="";!(l>=m);){var y=u[l++];if(!y)break;if(y&128){var w=u[l++]&63;if((y&224)==192)h+=String.fromCharCode((y&31)<<6|w);else{var T=u[l++]&63;y=(y&240)==224?(y&15)<<12|w<<6|T:(y&7)<<18|w<<12|T<<6|u[l++]&63,65536>y?h+=String.fromCharCode(y):(y-=65536,h+=String.fromCharCode(55296|y>>10,56320|y&1023))}}else h+=String.fromCharCode(y)}return h}var b,S,x,_,O,P,M,E,k;function $(){var u=f.buffer;b=u,t.HEAP8=S=new Int8Array(u),t.HEAP16=_=new Int16Array(u),t.HEAP32=P=new Int32Array(u),t.HEAPU8=x=new Uint8Array(u),t.HEAPU16=O=new Uint16Array(u),t.HEAPU32=M=new Uint32Array(u),t.HEAPF32=E=new Float32Array(u),t.HEAPF64=k=new Float64Array(u)}var A,L=[],W=[],j=[];function X(){var u=t.preRun.shift();L.unshift(u)}var he=0,oe=null,ce=null;function ue(u){throw t.onAbort&&t.onAbort(u),u="Aborted("+u+")",c(u),p=!0,u=new WebAssembly.RuntimeError(u+". Build with -sASSERTIONS for more info."),o(u),u}function ke(u){return u.startsWith("data:application/octet-stream;base64,")}var K="";if(!ke(K)){var z=K;K=t.locateFile?t.locateFile(z,r):r+z}function Ie(){var u=K;try{if(u==K&&s)return new Uint8Array(s);if(ke(u))try{var l=Ho(u.slice(37)),m=new Uint8Array(l.length);for(u=0;u<l.length;++u)m[u]=l.charCodeAt(u);var h=m}catch{throw Error("Converting base64 string to bytes failed.")}else h=void 0;var y=h;if(y)return y;throw"both async and sync fetching of the wasm failed"}catch(w){ue(w)}}function De(){return s||typeof fetch!="function"?Promise.resolve().then(function(){return Ie()}):fetch(K,{credentials:"same-origin"}).then(function(u){if(!u.ok)throw"failed to load wasm binary file at '"+K+"'";return u.arrayBuffer()}).catch(function(){return Ie()})}function le(u){for(;0<u.length;)u.shift()(t)}function Se(u){if(u===void 0)return"_unknown";u=u.replace(/[^a-zA-Z0-9_]/g,"$");var l=u.charCodeAt(0);return 48<=l&&57>=l?"_"+u:u}function Ne(u,l){return u=Se(u),function(){return l.apply(this,arguments)}}var B=[{},{value:void 0},{value:null},{value:!0},{value:!1}],ie=[];function Y(u){var l=Error,m=Ne(u,function(h){this.name=u,this.message=h,h=Error(h).stack,h!==void 0&&(this.stack=this.toString()+`
|
|
2
2
|
`+h.replace(/^Error(:[^\n]*)?\n/,""))});return m.prototype=Object.create(l.prototype),m.prototype.constructor=m,m.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},m}var ae=void 0;function F(u){throw new ae(u)}var se=u=>(u||F("Cannot use deleted val. handle = "+u),B[u].value),de=u=>{switch(u){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var l=ie.length?ie.pop():B.length;return B[l]={ga:1,value:u},l}},Ee=void 0,Te=void 0;function te(u){for(var l="";x[u];)l+=Te[x[u++]];return l}var Re=[];function ye(){for(;Re.length;){var u=Re.pop();u.M.$=!1,u.delete()}}var Oe=void 0,we={};function Tt(u,l){for(l===void 0&&F("ptr should not be undefined");u.R;)l=u.ba(l),u=u.R;return l}var nt={};function Bt(u){u=br(u);var l=te(u);return st(u),l}function bt(u,l){var m=nt[u];return m===void 0&&F(l+" has unknown type "+Bt(u)),m}function Rt(){}var kt=!1;function yt(u){--u.count.value,u.count.value===0&&(u.T?u.U.W(u.T):u.P.N.W(u.O))}function rt(u,l,m){return l===m?u:m.R===void 0?null:(u=rt(u,l,m.R),u===null?null:m.na(u))}var Ye={};function Ue(u,l){return l=Tt(u,l),we[l]}var xt=void 0;function We(u){throw new xt(u)}function qe(u,l){return l.P&&l.O||We("makeClassHandle requires ptr and ptrType"),!!l.U!=!!l.T&&We("Both smartPtrType and smartPtr must be specified"),l.count={value:1},Ke(Object.create(u,{M:{value:l}}))}function Ke(u){return typeof FinalizationRegistry>"u"?(Ke=l=>l,u):(kt=new FinalizationRegistry(l=>{yt(l.M)}),Ke=l=>{var m=l.M;return m.T&&kt.register(l,{M:m},l),l},Rt=l=>{kt.unregister(l)},Ke(u))}var St={};function dt(u){for(;u.length;){var l=u.pop();u.pop()(l)}}function Ce(u){return this.fromWireType(P[u>>2])}var je={},Be={};function Je(u,l,m){function h(R){R=m(R),R.length!==u.length&&We("Mismatched type converter count");for(var C=0;C<u.length;++C)G(u[C],R[C])}u.forEach(function(R){Be[R]=l});var y=Array(l.length),w=[],T=0;l.forEach((R,C)=>{nt.hasOwnProperty(R)?y[C]=nt[R]:(w.push(R),je.hasOwnProperty(R)||(je[R]=[]),je[R].push(()=>{y[C]=nt[R],++T,T===w.length&&h(y)}))}),w.length===0&&h(y)}function U(u){switch(u){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+u)}}function G(u,l,m={}){if(!("argPackAdvance"in l))throw new TypeError("registerType registeredInstance requires argPackAdvance");var h=l.name;if(u||F('type "'+h+'" must have a positive integer typeid pointer'),nt.hasOwnProperty(u)){if(m.ua)return;F("Cannot register type '"+h+"' twice")}nt[u]=l,delete Be[u],je.hasOwnProperty(u)&&(l=je[u],delete je[u],l.forEach(y=>y()))}function J(u){F(u.M.P.N.name+" instance already deleted")}function V(){}function fe(u,l,m){if(u[l].S===void 0){var h=u[l];u[l]=function(){return u[l].S.hasOwnProperty(arguments.length)||F("Function '"+m+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+u[l].S+")!"),u[l].S[arguments.length].apply(this,arguments)},u[l].S=[],u[l].S[h.Z]=h}}function ne(u,l){t.hasOwnProperty(u)?(F("Cannot register public name '"+u+"' twice"),fe(t,u,u),t.hasOwnProperty(void 0)&&F("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),t[u].S[void 0]=l):t[u]=l}function pe(u,l,m,h,y,w,T,R){this.name=u,this.constructor=l,this.X=m,this.W=h,this.R=y,this.pa=w,this.ba=T,this.na=R,this.ja=[]}function Z(u,l,m){for(;l!==m;)l.ba||F("Expected null or instance of "+m.name+", got an instance of "+l.name),u=l.ba(u),l=l.R;return u}function Q(u,l){return l===null?(this.ea&&F("null is not a valid "+this.name),0):(l.M||F('Cannot pass "'+Fe(l)+'" as a '+this.name),l.M.O||F("Cannot pass deleted object as a pointer of type "+this.name),Z(l.M.O,l.M.P.N,this.N))}function ze(u,l){if(l===null){if(this.ea&&F("null is not a valid "+this.name),this.da){var m=this.fa();return u!==null&&u.push(this.W,m),m}return 0}if(l.M||F('Cannot pass "'+Fe(l)+'" as a '+this.name),l.M.O||F("Cannot pass deleted object as a pointer of type "+this.name),!this.ca&&l.M.P.ca&&F("Cannot convert argument of type "+(l.M.U?l.M.U.name:l.M.P.name)+" to parameter type "+this.name),m=Z(l.M.O,l.M.P.N,this.N),this.da)switch(l.M.T===void 0&&F("Passing raw pointer to smart pointer is illegal"),this.Ba){case 0:l.M.U===this?m=l.M.T:F("Cannot convert argument of type "+(l.M.U?l.M.U.name:l.M.P.name)+" to parameter type "+this.name);break;case 1:m=l.M.T;break;case 2:if(l.M.U===this)m=l.M.T;else{var h=l.clone();m=this.xa(m,de(function(){h.delete()})),u!==null&&u.push(this.W,m)}break;default:F("Unsupporting sharing policy")}return m}function q(u,l){return l===null?(this.ea&&F("null is not a valid "+this.name),0):(l.M||F('Cannot pass "'+Fe(l)+'" as a '+this.name),l.M.O||F("Cannot pass deleted object as a pointer of type "+this.name),l.M.P.ca&&F("Cannot convert argument of type "+l.M.P.name+" to parameter type "+this.name),Z(l.M.O,l.M.P.N,this.N))}function ve(u,l,m,h){this.name=u,this.N=l,this.ea=m,this.ca=h,this.da=!1,this.W=this.xa=this.fa=this.ka=this.Ba=this.wa=void 0,l.R!==void 0?this.toWireType=ze:(this.toWireType=h?Q:q,this.V=null)}function Ae(u,l){t.hasOwnProperty(u)||We("Replacing nonexistant public symbol"),t[u]=l,t[u].Z=void 0}function Ft(u,l){var m=[];return function(){if(m.length=0,Object.assign(m,arguments),u.includes("j")){var h=t["dynCall_"+u];h=m&&m.length?h.apply(null,[l].concat(m)):h.call(null,l)}else h=A.get(l).apply(null,m);return h}}function be(u,l){u=te(u);var m=u.includes("j")?Ft(u,l):A.get(l);return typeof m!="function"&&F("unknown function pointer with signature "+u+": "+l),m}var wt=void 0;function _e(u,l){function m(w){y[w]||nt[w]||(Be[w]?Be[w].forEach(m):(h.push(w),y[w]=!0))}var h=[],y={};throw l.forEach(m),new wt(u+": "+h.map(Bt).join([", "]))}function at(u,l,m,h,y){var w=l.length;2>w&&F("argTypes array size mismatch! Must at least get return value and 'this' types!");var T=l[1]!==null&&m!==null,R=!1;for(m=1;m<l.length;++m)if(l[m]!==null&&l[m].V===void 0){R=!0;break}var C=l[0].name!=="void",I=w-2,N=Array(I),D=[],ee=[];return function(){if(arguments.length!==I&&F("function "+u+" called with "+arguments.length+" arguments, expected "+I+" args!"),ee.length=0,D.length=T?2:1,D[0]=y,T){var xe=l[1].toWireType(ee,this);D[1]=xe}for(var re=0;re<I;++re)N[re]=l[re+2].toWireType(ee,arguments[re]),D.push(N[re]);if(re=h.apply(null,D),R)dt(ee);else for(var Ge=T?1:2;Ge<l.length;Ge++){var et=Ge===1?xe:N[Ge-2];l[Ge].V!==null&&l[Ge].V(et)}return xe=C?l[0].fromWireType(re):void 0,xe}}function me(u,l){for(var m=[],h=0;h<u;h++)m.push(M[l+4*h>>2]);return m}function ge(u){4<u&&--B[u].ga===0&&(B[u]=void 0,ie.push(u))}function Fe(u){if(u===null)return"null";var l=typeof u;return l==="object"||l==="array"||l==="function"?u.toString():""+u}function $e(u,l){switch(l){case 2:return function(m){return this.fromWireType(E[m>>2])};case 3:return function(m){return this.fromWireType(k[m>>3])};default:throw new TypeError("Unknown float type: "+u)}}function Ze(u,l,m){switch(l){case 0:return m?function(h){return S[h]}:function(h){return x[h]};case 1:return m?function(h){return _[h>>1]}:function(h){return O[h>>1]};case 2:return m?function(h){return P[h>>2]}:function(h){return M[h>>2]};default:throw new TypeError("Unknown integer type: "+u)}}function Qe(u,l){for(var m="",h=0;!(h>=l/2);++h){var y=_[u+2*h>>1];if(y==0)break;m+=String.fromCharCode(y)}return m}function Me(u,l,m){if(m===void 0&&(m=2147483647),2>m)return 0;m-=2;var h=l;m=m<2*u.length?m/2:u.length;for(var y=0;y<m;++y)_[l>>1]=u.charCodeAt(y),l+=2;return _[l>>1]=0,l-h}function Ve(u){return 2*u.length}function $t(u,l){for(var m=0,h="";!(m>=l/4);){var y=P[u+4*m>>2];if(y==0)break;++m,65536<=y?(y-=65536,h+=String.fromCharCode(55296|y>>10,56320|y&1023)):h+=String.fromCharCode(y)}return h}function It(u,l,m){if(m===void 0&&(m=2147483647),4>m)return 0;var h=l;m=h+m-4;for(var y=0;y<u.length;++y){var w=u.charCodeAt(y);if(55296<=w&&57343>=w){var T=u.charCodeAt(++y);w=65536+((w&1023)<<10)|T&1023}if(P[l>>2]=w,l+=4,l+4>m)break}return P[l>>2]=0,l-h}function an(u){for(var l=0,m=0;m<u.length;++m){var h=u.charCodeAt(m);55296<=h&&57343>=h&&++m,l+=4}return l}var sn={};function Gt(u){var l=sn[u];return l===void 0?te(u):l}var un=[];function jo(u){var l=un.length;return un.push(u),l}function zo(u,l){for(var m=Array(u),h=0;h<u;++h)m[h]=bt(M[l+4*h>>2],"parameter "+h);return m}var hr=[],Vo=[null,[],[]];ae=t.BindingError=Y("BindingError"),t.count_emval_handles=function(){for(var u=0,l=5;l<B.length;++l)B[l]!==void 0&&++u;return u},t.get_first_emval=function(){for(var u=5;u<B.length;++u)if(B[u]!==void 0)return B[u];return null},Ee=t.PureVirtualError=Y("PureVirtualError");for(var gr=Array(256),ln=0;256>ln;++ln)gr[ln]=String.fromCharCode(ln);Te=gr,t.getInheritedInstanceCount=function(){return Object.keys(we).length},t.getLiveInheritedInstances=function(){var u=[],l;for(l in we)we.hasOwnProperty(l)&&u.push(we[l]);return u},t.flushPendingDeletes=ye,t.setDelayFunction=function(u){Oe=u,Re.length&&Oe&&Oe(ye)},xt=t.InternalError=Y("InternalError"),V.prototype.isAliasOf=function(u){if(!(this instanceof V&&u instanceof V))return!1;var l=this.M.P.N,m=this.M.O,h=u.M.P.N;for(u=u.M.O;l.R;)m=l.ba(m),l=l.R;for(;h.R;)u=h.ba(u),h=h.R;return l===h&&m===u},V.prototype.clone=function(){if(this.M.O||J(this),this.M.aa)return this.M.count.value+=1,this;var u=Ke,l=Object,m=l.create,h=Object.getPrototypeOf(this),y=this.M;return u=u(m.call(l,h,{M:{value:{count:y.count,$:y.$,aa:y.aa,O:y.O,P:y.P,T:y.T,U:y.U}}})),u.M.count.value+=1,u.M.$=!1,u},V.prototype.delete=function(){this.M.O||J(this),this.M.$&&!this.M.aa&&F("Object already scheduled for deletion"),Rt(this),yt(this.M),this.M.aa||(this.M.T=void 0,this.M.O=void 0)},V.prototype.isDeleted=function(){return!this.M.O},V.prototype.deleteLater=function(){return this.M.O||J(this),this.M.$&&!this.M.aa&&F("Object already scheduled for deletion"),Re.push(this),Re.length===1&&Oe&&Oe(ye),this.M.$=!0,this},ve.prototype.qa=function(u){return this.ka&&(u=this.ka(u)),u},ve.prototype.ha=function(u){this.W&&this.W(u)},ve.prototype.argPackAdvance=8,ve.prototype.readValueFromPointer=Ce,ve.prototype.deleteObject=function(u){u!==null&&u.delete()},ve.prototype.fromWireType=function(u){function l(){return this.da?qe(this.N.X,{P:this.wa,O:m,U:this,T:u}):qe(this.N.X,{P:this,O:u})}var m=this.qa(u);if(!m)return this.ha(u),null;var h=Ue(this.N,m);if(h!==void 0)return h.M.count.value===0?(h.M.O=m,h.M.T=u,h.clone()):(h=h.clone(),this.ha(u),h);if(h=this.N.pa(m),h=Ye[h],!h)return l.call(this);h=this.ca?h.la:h.pointerType;var y=rt(m,this.N,h.N);return y===null?l.call(this):this.da?qe(h.N.X,{P:h,O:y,U:this,T:u}):qe(h.N.X,{P:h,O:y})},wt=t.UnboundTypeError=Y("UnboundTypeError");var Ho=typeof atob=="function"?atob:function(u){var l="",m=0;u=u.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(u.charAt(m++)),y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(u.charAt(m++)),w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(u.charAt(m++)),T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(u.charAt(m++));h=h<<2|y>>4,y=(y&15)<<4|w>>2;var R=(w&3)<<6|T;l+=String.fromCharCode(h),w!==64&&(l+=String.fromCharCode(y)),T!==64&&(l+=String.fromCharCode(R))}while(m<u.length);return l},Xo={l:function(u,l,m,h){ue("Assertion failed: "+(u?g(x,u):"")+", at: "+[l?l?g(x,l):"":"unknown filename",m,h?h?g(x,h):"":"unknown function"])},q:function(u,l,m){u=te(u),l=bt(l,"wrapper"),m=se(m);var h=[].slice,y=l.N,w=y.X,T=y.R.X,R=y.R.constructor;u=Ne(u,function(){y.R.ja.forEach(function(I){if(this[I]===T[I])throw new Ee("Pure virtual function "+I+" must be implemented in JavaScript")}.bind(this)),Object.defineProperty(this,"__parent",{value:w}),this.__construct.apply(this,h.call(arguments))}),w.__construct=function(){this===w&&F("Pass correct 'this' to __construct");var I=R.implement.apply(void 0,[this].concat(h.call(arguments)));Rt(I);var N=I.M;I.notifyOnDestruction(),N.aa=!0,Object.defineProperties(this,{M:{value:N}}),Ke(this),I=N.O,I=Tt(y,I),we.hasOwnProperty(I)?F("Tried to register registered instance: "+I):we[I]=this},w.__destruct=function(){this===w&&F("Pass correct 'this' to __destruct"),Rt(this);var I=this.M.O;I=Tt(y,I),we.hasOwnProperty(I)?delete we[I]:F("Tried to unregister unregistered instance: "+I)},u.prototype=Object.create(w);for(var C in m)u.prototype[C]=m[C];return de(u)},j:function(u){var l=St[u];delete St[u];var m=l.fa,h=l.W,y=l.ia,w=y.map(T=>T.ta).concat(y.map(T=>T.za));Je([u],w,T=>{var R={};return y.forEach((C,I)=>{var N=T[I],D=C.ra,ee=C.sa,xe=T[I+y.length],re=C.ya,Ge=C.Aa;R[C.oa]={read:et=>N.fromWireType(D(ee,et)),write:(et,Dt)=>{var ut=[];re(Ge,et,xe.toWireType(ut,Dt)),dt(ut)}}}),[{name:l.name,fromWireType:function(C){var I={},N;for(N in R)I[N]=R[N].read(C);return h(C),I},toWireType:function(C,I){for(var N in R)if(!(N in I))throw new TypeError('Missing field: "'+N+'"');var D=m();for(N in R)R[N].write(D,I[N]);return C!==null&&C.push(h,D),D},argPackAdvance:8,readValueFromPointer:Ce,V:h}]})},v:function(){},B:function(u,l,m,h,y){var w=U(m);l=te(l),G(u,{name:l,fromWireType:function(T){return!!T},toWireType:function(T,R){return R?h:y},argPackAdvance:8,readValueFromPointer:function(T){if(m===1)var R=S;else if(m===2)R=_;else if(m===4)R=P;else throw new TypeError("Unknown boolean type size: "+l);return this.fromWireType(R[T>>w])},V:null})},f:function(u,l,m,h,y,w,T,R,C,I,N,D,ee){N=te(N),w=be(y,w),R&&(R=be(T,R)),I&&(I=be(C,I)),ee=be(D,ee);var xe=Se(N);ne(xe,function(){_e("Cannot construct "+N+" due to unbound types",[h])}),Je([u,l,m],h?[h]:[],function(re){if(re=re[0],h)var Ge=re.N,et=Ge.X;else et=V.prototype;re=Ne(xe,function(){if(Object.getPrototypeOf(this)!==Dt)throw new ae("Use 'new' to construct "+N);if(ut.Y===void 0)throw new ae(N+" has no accessible constructor");var Sr=ut.Y[arguments.length];if(Sr===void 0)throw new ae("Tried to invoke ctor of "+N+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(ut.Y).toString()+") parameters instead!");return Sr.apply(this,arguments)});var Dt=Object.create(et,{constructor:{value:re}});re.prototype=Dt;var ut=new pe(N,re,Dt,ee,Ge,w,R,I);Ge=new ve(N,ut,!0,!1),et=new ve(N+"*",ut,!1,!1);var xr=new ve(N+" const*",ut,!1,!0);return Ye[u]={pointerType:et,la:xr},Ae(xe,re),[Ge,et,xr]})},d:function(u,l,m,h,y,w,T){var R=me(m,h);l=te(l),w=be(y,w),Je([],[u],function(C){function I(){_e("Cannot call "+N+" due to unbound types",R)}C=C[0];var N=C.name+"."+l;l.startsWith("@@")&&(l=Symbol[l.substring(2)]);var D=C.N.constructor;return D[l]===void 0?(I.Z=m-1,D[l]=I):(fe(D,l,N),D[l].S[m-1]=I),Je([],R,function(ee){return ee=at(N,[ee[0],null].concat(ee.slice(1)),null,w,T),D[l].S===void 0?(ee.Z=m-1,D[l]=ee):D[l].S[m-1]=ee,[]}),[]})},p:function(u,l,m,h,y,w){0<l||ue();var T=me(l,m);y=be(h,y),Je([],[u],function(R){R=R[0];var C="constructor "+R.name;if(R.N.Y===void 0&&(R.N.Y=[]),R.N.Y[l-1]!==void 0)throw new ae("Cannot register multiple constructors with identical number of parameters ("+(l-1)+") for class '"+R.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return R.N.Y[l-1]=()=>{_e("Cannot construct "+R.name+" due to unbound types",T)},Je([],T,function(I){return I.splice(1,0,null),R.N.Y[l-1]=at(C,I,null,y,w),[]}),[]})},a:function(u,l,m,h,y,w,T,R){var C=me(m,h);l=te(l),w=be(y,w),Je([],[u],function(I){function N(){_e("Cannot call "+D+" due to unbound types",C)}I=I[0];var D=I.name+"."+l;l.startsWith("@@")&&(l=Symbol[l.substring(2)]),R&&I.N.ja.push(l);var ee=I.N.X,xe=ee[l];return xe===void 0||xe.S===void 0&&xe.className!==I.name&&xe.Z===m-2?(N.Z=m-2,N.className=I.name,ee[l]=N):(fe(ee,l,D),ee[l].S[m-2]=N),Je([],C,function(re){return re=at(D,re,I,w,T),ee[l].S===void 0?(re.Z=m-2,ee[l]=re):ee[l].S[m-2]=re,[]}),[]})},A:function(u,l){l=te(l),G(u,{name:l,fromWireType:function(m){var h=se(m);return ge(m),h},toWireType:function(m,h){return de(h)},argPackAdvance:8,readValueFromPointer:Ce,V:null})},n:function(u,l,m){m=U(m),l=te(l),G(u,{name:l,fromWireType:function(h){return h},toWireType:function(h,y){return y},argPackAdvance:8,readValueFromPointer:$e(l,m),V:null})},e:function(u,l,m,h,y){l=te(l),y===-1&&(y=4294967295),y=U(m);var w=R=>R;if(h===0){var T=32-8*m;w=R=>R<<T>>>T}m=l.includes("unsigned")?function(R,C){return C>>>0}:function(R,C){return C},G(u,{name:l,fromWireType:w,toWireType:m,argPackAdvance:8,readValueFromPointer:Ze(l,y,h!==0),V:null})},b:function(u,l,m){function h(w){w>>=2;var T=M;return new y(b,T[w+1],T[w])}var y=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][l];m=te(m),G(u,{name:m,fromWireType:h,argPackAdvance:8,readValueFromPointer:h},{ua:!0})},o:function(u,l){l=te(l);var m=l==="std::string";G(u,{name:l,fromWireType:function(h){var y=M[h>>2],w=h+4;if(m)for(var T=w,R=0;R<=y;++R){var C=w+R;if(R==y||x[C]==0){if(T=T?g(x,T,C-T):"",I===void 0)var I=T;else I+="\0",I+=T;T=C+1}}else{for(I=Array(y),R=0;R<y;++R)I[R]=String.fromCharCode(x[w+R]);I=I.join("")}return st(h),I},toWireType:function(h,y){y instanceof ArrayBuffer&&(y=new Uint8Array(y));var w,T=typeof y=="string";if(T||y instanceof Uint8Array||y instanceof Uint8ClampedArray||y instanceof Int8Array||F("Cannot pass non-string to std::string"),m&&T){var R=0;for(w=0;w<y.length;++w){var C=y.charCodeAt(w);127>=C?R++:2047>=C?R+=2:55296<=C&&57343>=C?(R+=4,++w):R+=3}w=R}else w=y.length;if(R=An(4+w+1),C=R+4,M[R>>2]=w,m&&T){if(T=C,C=w+1,w=x,0<C){C=T+C-1;for(var I=0;I<y.length;++I){var N=y.charCodeAt(I);if(55296<=N&&57343>=N){var D=y.charCodeAt(++I);N=65536+((N&1023)<<10)|D&1023}if(127>=N){if(T>=C)break;w[T++]=N}else{if(2047>=N){if(T+1>=C)break;w[T++]=192|N>>6}else{if(65535>=N){if(T+2>=C)break;w[T++]=224|N>>12}else{if(T+3>=C)break;w[T++]=240|N>>18,w[T++]=128|N>>12&63}w[T++]=128|N>>6&63}w[T++]=128|N&63}}w[T]=0}}else if(T)for(T=0;T<w;++T)I=y.charCodeAt(T),255<I&&(st(C),F("String has UTF-16 code units that do not fit in 8 bits")),x[C+T]=I;else for(T=0;T<w;++T)x[C+T]=y[T];return h!==null&&h.push(st,R),R},argPackAdvance:8,readValueFromPointer:Ce,V:function(h){st(h)}})},i:function(u,l,m){if(m=te(m),l===2)var h=Qe,y=Me,w=Ve,T=()=>O,R=1;else l===4&&(h=$t,y=It,w=an,T=()=>M,R=2);G(u,{name:m,fromWireType:function(C){for(var I=M[C>>2],N=T(),D,ee=C+4,xe=0;xe<=I;++xe){var re=C+4+xe*l;(xe==I||N[re>>R]==0)&&(ee=h(ee,re-ee),D===void 0?D=ee:(D+="\0",D+=ee),ee=re+l)}return st(C),D},toWireType:function(C,I){typeof I!="string"&&F("Cannot pass non-string to C++ string type "+m);var N=w(I),D=An(4+N+l);return M[D>>2]=N>>R,y(I,D+4,N+l),C!==null&&C.push(st,D),D},argPackAdvance:8,readValueFromPointer:Ce,V:function(C){st(C)}})},k:function(u,l,m,h,y,w){St[u]={name:te(l),fa:be(m,h),W:be(y,w),ia:[]}},h:function(u,l,m,h,y,w,T,R,C,I){St[u].ia.push({oa:te(l),ta:m,ra:be(h,y),sa:w,za:T,ya:be(R,C),Aa:I})},C:function(u,l){l=te(l),G(u,{va:!0,name:l,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},s:function(u,l,m,h,y){u=un[u],l=se(l),m=Gt(m);var w=[];return M[h>>2]=de(w),u(l,m,w,y)},t:function(u,l,m,h){u=un[u],l=se(l),m=Gt(m),u(l,m,null,h)},g:ge,m:function(u,l){var m=zo(u,l),h=m[0];l=h.name+"_$"+m.slice(1).map(function(T){return T.name}).join("_")+"$";var y=hr[l];if(y!==void 0)return y;var w=Array(u-1);return y=jo((T,R,C,I)=>{for(var N=0,D=0;D<u-1;++D)w[D]=m[D+1].readValueFromPointer(I+N),N+=m[D+1].argPackAdvance;for(T=T[R].apply(T,w),D=0;D<u-1;++D)m[D+1].ma&&m[D+1].ma(w[D]);if(!h.va)return h.toWireType(C,T)}),hr[l]=y},D:function(u){4<u&&(B[u].ga+=1)},r:function(u){var l=se(u);dt(l),ge(u)},c:function(){ue("")},x:function(u,l,m){x.copyWithin(u,l,l+m)},w:function(u){var l=x.length;if(u>>>=0,2147483648<u)return!1;for(var m=1;4>=m;m*=2){var h=l*(1+.2/m);h=Math.min(h,u+100663296);var y=Math;h=Math.max(u,h),y=y.min.call(y,2147483648,h+(65536-h%65536)%65536);e:{try{f.grow(y-b.byteLength+65535>>>16),$();var w=1;break e}catch{}w=void 0}if(w)return!0}return!1},z:function(){return 52},u:function(){return 70},y:function(u,l,m,h){for(var y=0,w=0;w<m;w++){var T=M[l>>2],R=M[l+4>>2];l+=8;for(var C=0;C<R;C++){var I=x[T+C],N=Vo[u];I===0||I===10?((u===1?a:c)(g(N,0)),N.length=0):N.push(I)}y+=R}return M[h>>2]=y,0}};(function(){function u(y){t.asm=y.exports,f=t.asm.E,$(),A=t.asm.J,W.unshift(t.asm.F),he--,t.monitorRunDependencies&&t.monitorRunDependencies(he),he==0&&(oe!==null&&(clearInterval(oe),oe=null),ce&&(y=ce,ce=null,y()))}function l(y){u(y.instance)}function m(y){return De().then(function(w){return w instanceof WebAssembly.Instance?w:WebAssembly.instantiate(w,h)}).then(function(w){return w}).then(y,function(w){c("failed to asynchronously prepare wasm: "+w),ue(w)})}var h={a:Xo};if(he++,t.monitorRunDependencies&&t.monitorRunDependencies(he),t.instantiateWasm)try{return t.instantiateWasm(h,u)}catch(y){c("Module.instantiateWasm callback failed with error: "+y),o(y)}return function(){return s||typeof WebAssembly.instantiateStreaming!="function"||ke(K)||typeof fetch!="function"?m(l):fetch(K,{credentials:"same-origin"}).then(function(y){return WebAssembly.instantiateStreaming(y,h).then(l,function(w){return c("wasm streaming compile failed: "+w),c("falling back to ArrayBuffer instantiation"),m(l)})})}().catch(o),{}})(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.F).apply(null,arguments)};var br=t.___getTypeName=function(){return(br=t.___getTypeName=t.asm.G).apply(null,arguments)};t.__embind_initialize_bindings=function(){return(t.__embind_initialize_bindings=t.asm.H).apply(null,arguments)};var An=t._malloc=function(){return(An=t._malloc=t.asm.I).apply(null,arguments)},st=t._free=function(){return(st=t._free=t.asm.K).apply(null,arguments)};t.dynCall_jiji=function(){return(t.dynCall_jiji=t.asm.L).apply(null,arguments)};var fn;ce=function u(){fn||yr(),fn||(ce=u)};function yr(){function u(){if(!fn&&(fn=!0,t.calledRun=!0,!p)){if(le(W),n(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;){var l=t.postRun.shift();j.unshift(l)}le(j)}}if(!(0<he)){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)X();le(L),0<he||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),u()},1)):u())}}if(t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();return yr(),e.ready}var Wr,Br=Ut(()=>{Wr=""});var ft,Fr,$r,Vt,Bn,ct,Mt,li,mn,Fn,Pt,Lt,$n,Gr,Gn,Dn,tt,Un,fi,Dr,hn=Ut(()=>{ft=function(e){return e[e.Auto=0]="Auto",e[e.FlexStart=1]="FlexStart",e[e.Center=2]="Center",e[e.FlexEnd=3]="FlexEnd",e[e.Stretch=4]="Stretch",e[e.Baseline=5]="Baseline",e[e.SpaceBetween=6]="SpaceBetween",e[e.SpaceAround=7]="SpaceAround",e[e.SpaceEvenly=8]="SpaceEvenly",e}({}),Fr=function(e){return e[e.BorderBox=0]="BorderBox",e[e.ContentBox=1]="ContentBox",e}({}),$r=function(e){return e[e.Width=0]="Width",e[e.Height=1]="Height",e}({}),Vt=function(e){return e[e.Inherit=0]="Inherit",e[e.LTR=1]="LTR",e[e.RTL=2]="RTL",e}({}),Bn=function(e){return e[e.Flex=0]="Flex",e[e.None=1]="None",e[e.Contents=2]="Contents",e}({}),ct=function(e){return e[e.Left=0]="Left",e[e.Top=1]="Top",e[e.Right=2]="Right",e[e.Bottom=3]="Bottom",e[e.Start=4]="Start",e[e.End=5]="End",e[e.Horizontal=6]="Horizontal",e[e.Vertical=7]="Vertical",e[e.All=8]="All",e}({}),Mt=function(e){return e[e.None=0]="None",e[e.StretchFlexBasis=1]="StretchFlexBasis",e[e.AbsolutePositionWithoutInsetsExcludesPadding=2]="AbsolutePositionWithoutInsetsExcludesPadding",e[e.AbsolutePercentAgainstInnerSize=4]="AbsolutePercentAgainstInnerSize",e[e.All=2147483647]="All",e[e.Classic=2147483646]="Classic",e}({}),li=function(e){return e[e.WebFlexBasis=0]="WebFlexBasis",e}({}),mn=function(e){return e[e.Column=0]="Column",e[e.ColumnReverse=1]="ColumnReverse",e[e.Row=2]="Row",e[e.RowReverse=3]="RowReverse",e}({}),Fn=function(e){return e[e.Column=0]="Column",e[e.Row=1]="Row",e[e.All=2]="All",e}({}),Pt=function(e){return e[e.FlexStart=0]="FlexStart",e[e.Center=1]="Center",e[e.FlexEnd=2]="FlexEnd",e[e.SpaceBetween=3]="SpaceBetween",e[e.SpaceAround=4]="SpaceAround",e[e.SpaceEvenly=5]="SpaceEvenly",e}({}),Lt=function(e){return e[e.Error=0]="Error",e[e.Warn=1]="Warn",e[e.Info=2]="Info",e[e.Debug=3]="Debug",e[e.Verbose=4]="Verbose",e[e.Fatal=5]="Fatal",e}({}),$n=function(e){return e[e.Undefined=0]="Undefined",e[e.Exactly=1]="Exactly",e[e.AtMost=2]="AtMost",e}({}),Gr=function(e){return e[e.Default=0]="Default",e[e.Text=1]="Text",e}({}),Gn=function(e){return e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.Scroll=2]="Scroll",e}({}),Dn=function(e){return e[e.Static=0]="Static",e[e.Relative=1]="Relative",e[e.Absolute=2]="Absolute",e}({}),tt=function(e){return e[e.Undefined=0]="Undefined",e[e.Point=1]="Point",e[e.Percent=2]="Percent",e[e.Auto=3]="Auto",e}({}),Un=function(e){return e[e.NoWrap=0]="NoWrap",e[e.Wrap=1]="Wrap",e[e.WrapReverse=2]="WrapReverse",e}({}),fi={ALIGN_AUTO:ft.Auto,ALIGN_FLEX_START:ft.FlexStart,ALIGN_CENTER:ft.Center,ALIGN_FLEX_END:ft.FlexEnd,ALIGN_STRETCH:ft.Stretch,ALIGN_BASELINE:ft.Baseline,ALIGN_SPACE_BETWEEN:ft.SpaceBetween,ALIGN_SPACE_AROUND:ft.SpaceAround,ALIGN_SPACE_EVENLY:ft.SpaceEvenly,BOX_SIZING_BORDER_BOX:Fr.BorderBox,BOX_SIZING_CONTENT_BOX:Fr.ContentBox,DIMENSION_WIDTH:$r.Width,DIMENSION_HEIGHT:$r.Height,DIRECTION_INHERIT:Vt.Inherit,DIRECTION_LTR:Vt.LTR,DIRECTION_RTL:Vt.RTL,DISPLAY_FLEX:Bn.Flex,DISPLAY_NONE:Bn.None,DISPLAY_CONTENTS:Bn.Contents,EDGE_LEFT:ct.Left,EDGE_TOP:ct.Top,EDGE_RIGHT:ct.Right,EDGE_BOTTOM:ct.Bottom,EDGE_START:ct.Start,EDGE_END:ct.End,EDGE_HORIZONTAL:ct.Horizontal,EDGE_VERTICAL:ct.Vertical,EDGE_ALL:ct.All,ERRATA_NONE:Mt.None,ERRATA_STRETCH_FLEX_BASIS:Mt.StretchFlexBasis,ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING:Mt.AbsolutePositionWithoutInsetsExcludesPadding,ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE:Mt.AbsolutePercentAgainstInnerSize,ERRATA_ALL:Mt.All,ERRATA_CLASSIC:Mt.Classic,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:li.WebFlexBasis,FLEX_DIRECTION_COLUMN:mn.Column,FLEX_DIRECTION_COLUMN_REVERSE:mn.ColumnReverse,FLEX_DIRECTION_ROW:mn.Row,FLEX_DIRECTION_ROW_REVERSE:mn.RowReverse,GUTTER_COLUMN:Fn.Column,GUTTER_ROW:Fn.Row,GUTTER_ALL:Fn.All,JUSTIFY_FLEX_START:Pt.FlexStart,JUSTIFY_CENTER:Pt.Center,JUSTIFY_FLEX_END:Pt.FlexEnd,JUSTIFY_SPACE_BETWEEN:Pt.SpaceBetween,JUSTIFY_SPACE_AROUND:Pt.SpaceAround,JUSTIFY_SPACE_EVENLY:Pt.SpaceEvenly,LOG_LEVEL_ERROR:Lt.Error,LOG_LEVEL_WARN:Lt.Warn,LOG_LEVEL_INFO:Lt.Info,LOG_LEVEL_DEBUG:Lt.Debug,LOG_LEVEL_VERBOSE:Lt.Verbose,LOG_LEVEL_FATAL:Lt.Fatal,MEASURE_MODE_UNDEFINED:$n.Undefined,MEASURE_MODE_EXACTLY:$n.Exactly,MEASURE_MODE_AT_MOST:$n.AtMost,NODE_TYPE_DEFAULT:Gr.Default,NODE_TYPE_TEXT:Gr.Text,OVERFLOW_VISIBLE:Gn.Visible,OVERFLOW_HIDDEN:Gn.Hidden,OVERFLOW_SCROLL:Gn.Scroll,POSITION_TYPE_STATIC:Dn.Static,POSITION_TYPE_RELATIVE:Dn.Relative,POSITION_TYPE_ABSOLUTE:Dn.Absolute,UNIT_UNDEFINED:tt.Undefined,UNIT_POINT:tt.Point,UNIT_PERCENT:tt.Percent,UNIT_AUTO:tt.Auto,WRAP_NO_WRAP:Un.NoWrap,WRAP_WRAP:Un.Wrap,WRAP_WRAP_REVERSE:Un.WrapReverse},Dr=fi});function jn(e){function t(i,r,a){let c=i[r];i[r]=function(){for(var s=arguments.length,d=new Array(s),f=0;f<s;f++)d[f]=arguments[f];return a.call(this,c,...d)}}for(let i of["setPosition","setMargin","setFlexBasis","setWidth","setHeight","setMinWidth","setMinHeight","setMaxWidth","setMaxHeight","setPadding","setGap"]){let r={[tt.Point]:e.Node.prototype[i],[tt.Percent]:e.Node.prototype[`${i}Percent`],[tt.Auto]:e.Node.prototype[`${i}Auto`]};t(e.Node.prototype,i,function(a){for(var c=arguments.length,s=new Array(c>1?c-1:0),d=1;d<c;d++)s[d-1]=arguments[d];let f=s.pop(),p,g;if(f==="auto")p=tt.Auto,g=void 0;else if(typeof f=="object")p=f.unit,g=f.valueOf();else if(p=typeof f=="string"&&f.endsWith("%")?tt.Percent:tt.Point,g=parseFloat(f),f!==void 0&&!Number.isNaN(f)&&Number.isNaN(g))throw new Error(`Invalid value ${f} for ${i}`);if(!r[p])throw new Error(`Failed to execute "${i}": Unsupported unit '${f}'`);return g!==void 0?r[p].call(this,...s,g):r[p].call(this,...s)})}function n(i){return e.MeasureCallback.implement({measure:function(){let{width:r,height:a}=i(...arguments);return{width:r??NaN,height:a??NaN}}})}t(e.Node.prototype,"setMeasureFunc",function(i,r){return r?i.call(this,n(r)):this.unsetMeasureFunc()});function o(i){return e.DirtiedCallback.implement({dirtied:i})}return t(e.Node.prototype,"setDirtiedFunc",function(i,r){i.call(this,o(r))}),t(e.Config.prototype,"free",function(){e.Config.destroy(this)}),t(e.Node,"create",(i,r)=>r?e.Node.createWithConfig(r):e.Node.createDefault()),t(e.Node.prototype,"free",function(){e.Node.destroy(this)}),t(e.Node.prototype,"freeRecursive",function(){for(let i=0,r=this.getChildCount();i<r;++i)this.getChild(0).freeRecursive();this.free()}),t(e.Node.prototype,"calculateLayout",function(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NaN,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Vt.LTR;return i.call(this,r,a,c)}),{Config:e.Config,Node:e.Node,...Dr}}var Ur=Ut(()=>{hn();hn()});async function jr(e){return jn(await Or(e))}var zr=Ut(()=>{Br();Ur();hn()});var Vn={};qo(Vn,{getYoga:()=>hi,init:()=>mi});async function pi(e,t){let n;if(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL?n=await fetch(e):n=await e,typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,t)}catch(r){n.headers.get("Content-Type")!=="application/wasm"&&console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r)}let i=await n.arrayBuffer();return await WebAssembly.instantiate(i,t)}let o=await WebAssembly.instantiate("buffer"in n?n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength):n,t);return o instanceof WebAssembly.Instance?{instance:o,module:n}:o}function mi(e){ci({instantiateWasm(t,n){return pi(e,t).then(({instance:o})=>{n(o)}).catch(zn),{}}}).then(Vr).catch(zn)}function hi(){return di}var ci,Vr,zn,di,Hn=Ut(()=>{zr();ci=jr,di=new Promise((e,t)=>{Vr=e,zn=t})});import si from"linebreak";var jt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ko=jt((e,t)=>{t.exports=["em","ex","ch","rem","vh","vw","vmin","vmax","px","mm","cm","in","pt","pc","mozmm"]}),Jo=jt((e,t)=>{t.exports=["deg","grad","rad","turn"]}),Zo=jt((e,t)=>{t.exports=["dpi","dpcm","dppx"]}),Qo=jt((e,t)=>{t.exports=["Hz","kHz"]}),ei=jt((e,t)=>{t.exports=["s","ms"]}),ti=Ko(),wr=Jo(),vr=Zo(),Er=Qo(),Tr=ei();function Pn(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(ni(e)>1)throw new Error("Only one dot is allowed");if(/%$/.test(e)){this.type="percentage",this.value=Mn(e),this.unit="%";return}var t=oi(e);if(!t){this.type="number",this.value=Mn(e);return}this.type=ai(t),this.value=Mn(e.substr(0,e.length-t.length)),this.unit=t}Pn.prototype.valueOf=function(){return this.value};Pn.prototype.toString=function(){return this.value+(this.unit||"")};function He(e){return new Pn(e)}function ni(e){var t=e.match(/\./g);return t?t.length:0}function Mn(e){var t=parseFloat(e);if(isNaN(t))throw new Error("Invalid number: "+e);return t}var ri=[].concat(wr,Er,ti,vr,Tr);function oi(e){var t=e.match(/\D+$/),n=t&&t[0];if(n&&ri.indexOf(n)===-1)throw new Error("Invalid unit: "+n);return n}var ii=Object.assign(cn(wr,"angle"),cn(Er,"frequency"),cn(vr,"resolution"),cn(Tr,"time"));function cn(e,t){return Object.fromEntries(e.map(n=>[n,t]))}function ai(e){return ii[e]||"length"}function Ct(e){let t=typeof e;return!(t==="number"||t==="bigint"||t==="string"||t==="boolean")}function Rr(e){return/^class\s/.test(e.toString())}function Wn(e){return e&&e.$$typeof===Symbol.for("react.forward_ref")}function kr(e){return typeof e=="function"||Wn(e)}function Ir(e){return"dangerouslySetInnerHTML"in e}function _r(e){let t=typeof e>"u"?[]:[].concat(e).flat(1/0),n=[];for(let o=0;o<t.length;o++){let i=t[o];typeof i>"u"||typeof i=="boolean"||i===null||(typeof i=="number"&&(i=String(i)),typeof i=="string"&&n.length&&typeof n[n.length-1]=="string"?n[n.length-1]+=i:n.push(i))}return n}function H(e,t,n,o,i=!1){if(typeof e=="number")return e;try{if(e=e.trim(),/[ /\(,]/.test(e))return;if(e===String(+e))return+e;let r=new He(e);if(r.type==="length")switch(r.unit){case"em":return r.value*t;case"rem":return r.value*16;case"vw":return~~(r.value*o._viewportWidth/100);case"vh":return~~(r.value*o._viewportHeight/100);default:return r.value}else{if(r.type==="angle")return On(e);if(r.type==="percentage"&&i)return r.value/100*n}}catch{}}function On(e){let t=new He(e);switch(t.unit){case"deg":return t.value;case"rad":return t.value*180/Math.PI;case"turn":return t.value*360;case"grad":return .9*t.value}}function zt(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 Le(e,t,n,o){let i=t[e];if(typeof i>"u"){if(o&&typeof e<"u")throw new Error(`Invalid value for CSS property "${o}". Allowed values: ${Object.keys(t).map(r=>`"${r}"`).join(" | ")}. Received: "${e}".`);i=n}return i}var Ln,Nn,Cr=[32,160,4961,65792,65793,4153,4241,10].map(e=>String.fromCodePoint(e)),_t=new Map,ui=500;function Pe(e,t,n){let o=`${t}:${n||""}:${e}`;if(_t.has(o))return _t.get(o);if(!Ln||!Nn){if(!(typeof Intl<"u"&&"Segmenter"in Intl))throw new Error("Intl.Segmenter does not exist, please use import a polyfill.");Ln=new Intl.Segmenter(n,{granularity:"word"}),Nn=new Intl.Segmenter(n,{granularity:"grapheme"})}let i;if(t==="grapheme")i=[...Nn.segment(e)].map(r=>r.segment);else{let r=[...Ln.segment(e)].map(s=>s.segment),a=[],c=0;for(;c<r.length;){let s=r[c];if(s=="\xA0"){let d=c===0?"":a.pop(),f=c===r.length-1?"":r[c+1];a.push(d+"\xA0"+f),c+=2}else a.push(s),c++}i=a}if(_t.size>=ui){let r=_t.keys().next().value;_t.delete(r)}return _t.set(o,i),i}function v(e,t,n){let o="";for(let[i,r]of Object.entries(t))typeof r<"u"&&(o+=` ${i}="${r}"`);return n?`<${e}${o}>${n}</${e}>`:`<${e}${o}/>`}function Ar(e=20){let t=new Map;function n(r){let a=t.get(r);if(a!==void 0)return t.delete(r),t.set(r,a),a}function o(r,a){if(t.has(r))t.delete(r);else if(t.size>=e){let c=t.keys().next().value;t.delete(c)}t.set(r,a)}function i(){t.clear()}return{set:o,get:n,clear:i}}function At(e){return e?e.split(/[, ]/).filter(Boolean).map(Number):null}function dn(e){return typeof e=="string"}function Mr(e){return typeof e=="number"}function Pr(e){return typeof e>"u"}function lt(e,t){if(typeof e=="number")return e;if(e.endsWith("%")){let n=parseFloat(e.slice(0,-1));if(isNaN(n)){console.warn(`Invalid value "${e}"${typeof t=="string"?` for "${t}"`:""}. Expected a percentage value (e.g., "50%").`);return}return`${n}%`}console.warn(`Invalid value "${e}"${typeof t=="string"?` for "${t}"`:""}. Expected a number or a percentage value (e.g., "50%").`)}function pt(e,t){if(typeof e=="number")return e;if(e==="auto")return"auto";if(e.endsWith("%")){let n=parseFloat(e.slice(0,-1));if(isNaN(n)){console.warn(`Invalid value "${e}"${typeof t=="string"?` for "${t}"`:""}. Expected a percentage value (e.g., "50%").`);return}return`${n}%`}console.warn(`Invalid value "${e}"${typeof t=="string"?` for "${t}"`:""}. Expected a number, "auto", or a percentage value (e.g., "50%").`)}function Lr(e,t){if(t==="break-all")return{words:Pe(e,"grapheme"),requiredBreaks:[]};if(t==="keep-all")return{words:Pe(e,"word"),requiredBreaks:[]};let n=new si(e),o=0,i=n.nextBreak(),r=[],a=[!1];for(;i;){let c=e.slice(o,i.position);r.push(c),i.required?a.push(!0):a.push(!1),o=i.position,i=n.nextBreak()}return{words:r,requiredBreaks:a}}var Nr=e=>e.replaceAll(/([A-Z])/g,(t,n)=>`-${n.toLowerCase()}`);function pn(e,t=","){let n=[],o=0,i=0;t=new RegExp(t);for(let r=0;r<e.length;r++)e[r]==="("?i++:e[r]===")"&&i--,i===0&&t.test(e[r])&&(n.push(e.slice(o,r).trim()),o=r+1);return n.push(e.slice(o).trim()),n}function gi(e){return Promise.resolve().then(()=>(Hn(),Vn)).then(t=>t.init(e))}function mt(){return Promise.resolve().then(()=>(Hn(),Vn)).then(e=>e.getYoga())}var bi="image/avif",yi="image/webp",gn="image/apng",bn="image/png",yn="image/jpeg",xn="image/gif",Xn="image/svg+xml";function Yr(e){let t=new DataView(e),n=4,o=t.byteLength;for(;n<o;){let i=t.getUint16(n,!1);if(i>o)throw new TypeError("Invalid JPEG");let r=t.getUint8(i+1+n);if(r===192||r===193||r===194)return[t.getUint16(i+7+n,!1),t.getUint16(i+5+n,!1)];n+=i+2}throw new TypeError("Invalid JPEG")}function qr(e){let t=new Uint8Array(e.slice(6,10));return[t[0]|t[1]<<8,t[2]|t[3]<<8]}function Kr(e){let t=new DataView(e);return[t.getUint16(18,!1),t.getUint16(22,!1)]}var ot=Ar(500),Ht=new Map,xi=[bn,gn,yn,xn,Xn],Si=/<svg[^>]*>/i,wi=/viewBox=['"]([^'"]+)['"]/,vi=/width=['"](\d*\.?\d+)['"]/,Ei=/height=['"](\d*\.?\d+)['"]/;function Ti(e){let t=new Uint8Array(e),n=32768,o="";for(let i=0;i<t.length;i+=n){let r=t.subarray(i,Math.min(i+n,t.length));o+=String.fromCharCode(...r)}return btoa(o)}function Ri(e){let t=atob(e),n=t.length,o=new Uint8Array(n);for(let i=0;i<n;i++)o[i]=t.charCodeAt(i);return o.buffer}function Hr(e,t){let n=t.match(Si);if(!n)throw new Error(`Failed to parse SVG from ${e}`);let o=n[0],i=wi.exec(o),r=vi.exec(o),a=Ei.exec(o),c=i?At(i[1]):null;if(!c&&(!r||!a))throw new Error(`Failed to parse SVG from ${e}: missing "viewBox"`);let s=c?[c[2],c[3]]:[+r[1],+a[1]],d=s[0]/s[1];return r&&a?[+r[1],+a[1]]:r?[+r[1],+r[1]/d]:a?[+a[1]*d,+a[1]]:[s[0],s[1]]}function Xr(e){let t,n=ki(new Uint8Array(e));switch(n){case bn:case gn:t=Kr(e);break;case xn:t=qr(e);break;case yn:t=Yr(e);break}if(!xi.includes(n))throw new Error(`Unsupported image type: ${n||"unknown"}`);return[`data:${n};base64,${Ti(e)}`,t]}async function Nt(e){if(!e)throw new Error("Image source is not provided.");if(typeof e=="object"){let[i,r]=Xr(e);return[i,...r]}if((e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))&&(e=e.slice(1,-1)),typeof window>"u"&&!e.startsWith("http")&&!e.startsWith("data:"))throw new Error(`Image source must be an absolute URL: ${e}`);if(e.startsWith("data:")){let i;try{i=/data:(?<imageType>[a-z/+]+)(;[^;=]+=[^;=]+)*?(;(?<encodingType>[^;,]+))?,(?<dataString>.*)/g.exec(e).groups}catch{return console.warn("Image data URI resolved without size:"+e),[e]}let{imageType:r,encodingType:a,dataString:c}=i;if(r===Xn){let s=a==="base64"?atob(c):decodeURIComponent(c.replace(/ /g,"%20")),d=a==="base64"?e:`data:image/svg+xml;base64,${btoa(s)}`,f=Hr(e,s);return ot.set(e,[d,...f]),[d,...f]}else if(a==="base64"){let s,d=Ri(c);switch(r){case bn:case gn:s=Kr(d);break;case xn:s=qr(d);break;case yn:s=Yr(d);break}return ot.set(e,[e,...s]),[e,...s]}else return console.warn("Image data URI resolved without size:"+e),ot.set(e,[e]),[e]}if(!globalThis.fetch)throw new Error("`fetch` is required to be polyfilled to load images.");if(Ht.has(e))return Ht.get(e);let t=ot.get(e);if(t)return t;let n=e,o=fetch(n).then(i=>{let r=i.headers.get("content-type");return r==="image/svg+xml"||r==="application/svg+xml"?i.text():i.arrayBuffer()}).then(i=>{if(typeof i=="string")try{let c=`data:image/svg+xml;base64,${btoa(i)}`,s=Hr(n,i);return[c,...s]}catch(c){throw new Error(`Failed to parse SVG image: ${c.message}`)}let[r,a]=Xr(i);return[r,...a]}).then(i=>(ot.set(n,i),i)).catch(i=>(console.error(`Can't load image ${n}: `+i.message),ot.set(n,[]),[]));return Ht.set(n,o),o}function ki(e){return[255,216,255].every((t,n)=>e[n]===t)?yn:[137,80,78,71,13,10,26,10].every((t,n)=>e[n]===t)?Ii(e)?gn:bn:[71,73,70,56].every((t,n)=>e[n]===t)?xn:[82,73,70,70,0,0,0,0,87,69,66,80].every((t,n)=>!t||e[n]===t)?yi:[60,63,120,109,108].every((t,n)=>e[n]===t)?Xn:[0,0,0,0,102,116,121,112,97,118,105,102].every((t,n)=>!t||e[n]===t)?bi:null}function Ii(e){let t=new DataView(e.buffer),n,o,i=8,r=!1;for(;!r&&n!=="IEND"&&i<e.length;){o=t.getUint32(i);let a=e.subarray(i+4,i+8);n=String.fromCharCode(...a),r=n==="acTL",i+=12+o}return r}var Yn={accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",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",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",href:"href",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",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",textAnchor:"text-anchor",textDecoration:"text-decoration",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",wordSpacing:"word-spacing",writingMode:"writing-mode",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:"xml:space",xmlnsXlink:"xmlns:xlink"},_i=/[\r\n%#()<>?[\\\]^`{|}"']/g;function qn(e,t){if(!e)return"";if(Array.isArray(e))return e.map(d=>qn(d,t)).join("");if(typeof e!="object")return String(e);let n=e.type;if(n==="text")throw new Error("<text> nodes are not currently supported, please convert them to <path>");let{children:o,style:i,...r}=e.props||{},a=(i==null?void 0:i.color)||t,c=`${Object.entries(r).map(([d,f])=>(typeof f=="string"&&f.toLowerCase()==="currentcolor"&&(f=a),(d==="href"||d==="xlinkHref")&&n==="image"?` ${Yn[d]||d}="${ot.get(f)[0]}"`:` ${Yn[d]||d}="${f}"`)).join("")}`,s=i?` style="${Object.entries(i).map(([d,f])=>`${Nr(d)}:${f}`).join(";")}"`:"";return`<${n}${c}${s}>${qn(o,a)}</${n}>`}async function Jr(e){let t=new Set,n=o=>{if(o&&Ct(o)){if(Array.isArray(o)){o.forEach(i=>n(i));return}else if(typeof o=="object")if(o.type==="image"){let i=o.props.href||o.props.xlinkHref;i&&(t.has(i)||t.add(i))}else o.type==="img"&&(t.has(o.props.src)||t.add(o.props.src));Array.isArray(o.props.children)?o.props.children.map(i=>n(i)):n(o.props.children)}};return n(e),Promise.all(Array.from(t).map(o=>Nt(o)))}async function Zr(e,t){let{viewBox:n,viewbox:o,width:i,height:r,className:a,style:c,children:s,...d}=e.props||{};n||=o,d.xmlns="http://www.w3.org/2000/svg";let f=(c==null?void 0:c.color)||t,p=At(n),g=p?p[3]/p[2]:null;return i=i||g&&r?r/g:null,r=r||g&&i?i*g:null,d.width=i,d.height=r,n&&(d.viewBox=n),`data:image/svg+xml;utf8,${`<svg ${Object.entries(d).map(([b,S])=>(typeof S=="string"&&S.toLowerCase()==="currentcolor"&&(S=f),` ${Yn[b]||b}="${S}"`)).join("")}>${qn(s,f)}</svg>`.replace(_i,encodeURIComponent)}`}var Xe="flex",Qr={p:{display:Xe,marginTop:"1em",marginBottom:"1em"},div:{display:Xe},blockquote:{display:Xe,marginTop:"1em",marginBottom:"1em",marginLeft:40,marginRight:40},center:{display:Xe,textAlign:"center"},hr:{display:Xe,marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"auto",marginRight:"auto",borderWidth:1,borderStyle:"solid"},h1:{display:Xe,fontSize:"2em",marginTop:"0.67em",marginBottom:"0.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h2:{display:Xe,fontSize:"1.5em",marginTop:"0.83em",marginBottom:"0.83em",marginLeft:0,marginRight:0,fontWeight:"bold"},h3:{display:Xe,fontSize:"1.17em",marginTop:"1em",marginBottom:"1em",marginLeft:0,marginRight:0,fontWeight:"bold"},h4:{display:Xe,marginTop:"1.33em",marginBottom:"1.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},h5:{display:Xe,fontSize:"0.83em",marginTop:"1.67em",marginBottom:"1.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h6:{display:Xe,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:Xe,fontFamily:"monospace",whiteSpace:"pre",marginTop:"1em",marginBottom:"1em"},mark:{backgroundColor:"yellow",color:"black"},big:{fontSize:"larger"},small:{fontSize:"smaller"},s:{textDecoration:"line-through"}};var Ci=new Set(["color","font","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","textAlign","textIndent","textTransform","textShadowOffset","textShadowColor","textShadowRadius","WebkitTextStrokeWidth","WebkitTextStrokeColor","textDecorationLine","textDecorationStyle","textDecorationColor","textDecorationSkipInk","whiteSpace","transform","wordBreak","tabSize","opacity","filter","_viewportWidth","_viewportHeight","_inheritedClipPathId","_inheritedMaskId","_inheritedBackgroundClipTextPath","_inheritedBackgroundClipTextHasBackground"]);function Kn(e){let t={};for(let n in e)(Ci.has(n)||n.startsWith("--"))&&(t[n]=e[n]);return t}import{getPropertyName as Ni,getStylesForProperty as ht}from"css-to-react-native";import{parseElementStyle as Wi}from"css-background-parser";import{parse as Oi}from"css-box-shadow";import Bi from"parse-css-color";import Ai from"postcss-value-parser";function Mi(e,t){try{let n=new He(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 Jn(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=Mi(e,t);return o.absolute?{[n?"xAbsolute":"yAbsolute"]:o.absolute}:o.relative?{[n?"xRelative":"yRelative"]:o.relative}:{}}}}function Zn(e,t){if(typeof e=="number")return{xAbsolute:e};let n;try{n=Ai(e).nodes.filter(o=>o.type==="word").map(o=>o.value)}catch{return{}}return n.length===1?Jn(n[0],t,!0):n.length===2?((n[0]==="top"||n[0]==="bottom"||n[1]==="left"||n[1]==="right")&&n.reverse(),{...Jn(n[0],t,!0),...Jn(n[1],t,!1)}):{}}import{getPropertyName as Pi}from"css-to-react-native";function Xt(e,t){let n=Pi(`mask-${t}`);return e[n]||e[`WebkitM${n.substring(1)}`]}function eo(e){let t=e.maskImage||e.WebkitMaskImage,n={position:Xt(e,"position")||"0% 0%",size:Xt(e,"size")||"100% 100%",repeat:Xt(e,"repeat")||"repeat",origin:Xt(e,"origin")||"border-box",clip:Xt(e,"origin")||"border-box"};return pn(t).filter(i=>i&&i!=="none").reverse().map(i=>({image:i,...n}))}import to from"postcss-value-parser";function no(e){let t={},n={};for(let o in e)o.startsWith("--")?t[o]=String(e[o]):n[o]=e[o];return{variables:t,remainingStyle:n}}function ro(e,t){return{...e,...t}}function qt(e,t,n=new Set){if(typeof e!="string"||!e.includes("var("))return e;try{let o=to(e),i=!1;if(o.walk(r=>{if(r.type==="function"&&r.value==="var"){i=!0;let a=Li(r);if(!a)return;let{varName:c,fallback:s}=a;if(n.has(c)){console.warn(`Circular reference detected for CSS variable: ${c}`),s!==void 0?Yt(r,s):Yt(r,"initial");return}let d=t[c];if(d!==void 0){let f=new Set(n);f.add(c);let p=qt(d,t,f);Yt(r,String(p))}else if(s!==void 0){let f=qt(s,t,n);Yt(r,String(f))}else Yt(r,"initial")}}),i)return o.toString()}catch{console.warn(`Failed to parse CSS value for variable resolution: ${e}`)}return e}function Li(e){if(!e.nodes||e.nodes.length===0)return null;let t,n=-1;for(let i=0;i<e.nodes.length;i++){let r=e.nodes[i];if(r.type==="word"&&!t)t=r;else if(r.type==="div"&&r.value===","){n=i;break}}if(!t||t.type!=="word")return null;let o=t.value.trim();if(n!==-1&&n<e.nodes.length-1){let i=e.nodes.slice(n+1),r=to.stringify(i).trim();return{varName:o,fallback:r}}return{varName:o}}function Yt(e,t){e.type="word",e.value=t,delete e.nodes}var Fi=new Set(["flex","flexGrow","flexShrink","flexBasis","fontWeight","lineHeight","opacity","scale","scaleX","scaleY"]),$i=new Set(["lineHeight"]);function Gi(e,t,n,o){return e==="textDecoration"&&!n.includes(t.textDecorationColor)&&(t.textDecorationColor=o),t}function vt(e,t){let n=Number(t);return isNaN(n)?t:Fi.has(e)?$i.has(e)?n:String(t):n+"px"}function Di(e,t,n){if(e==="zIndex")return console.warn("`z-index` is currently not supported."),{[e]:t};if(e==="lineHeight")return{lineHeight:vt(e,t)};if(e==="fontFamily")return{fontFamily:t.split(",").map(o=>o.trim().replace(/(^['"])|(['"]$)/g,"").toLocaleLowerCase())};if(e==="borderRadius"){if(typeof t!="string"||!t.includes("/"))return;let[o,i]=t.split("/"),r=ht(e,o,!0),a=ht(e,i,!0);for(let c in r)a[c]=vt(e,r[c])+" "+vt(e,a[c]);return a}if(/^border(Top|Right|Bottom|Left)?$/.test(e)){let o=ht("border",t,!0);o.borderWidth===1&&!String(t).includes("1px")&&(o.borderWidth=3),o.borderColor==="black"&&!String(t).includes("black")&&(o.borderColor=n);let i={Width:vt(e+"Width",o.borderWidth),Style:Le(o.borderStyle,{solid:"solid",dashed:"dashed"},"solid",e+"Style"),Color:o.borderColor},r={};for(let a of e==="border"?["Top","Right","Bottom","Left"]:[e.slice(6)])for(let c in i)r["border"+a+c]=i[c];return r}if(e==="boxShadow"){if(!t)throw new Error('Invalid `boxShadow` value: "'+t+'".');return{[e]:typeof t=="string"?Oi(t):t}}if(e==="transform"){if(typeof t!="string")throw new Error("Invalid `transform` value.");let o={},i=t.replace(/(-?[\d.]+%)/g,(a,c)=>{let s=~~(Math.random()*1e9);return o[s]=c,s+"px"}),r=ht("transform",i,!0);for(let a of r.transform)for(let c in a)o[a[c]]&&(a[c]=o[a[c]]);return r}if(e==="background")return t=t.toString().trim(),/^(linear-gradient|radial-gradient|url|repeating-linear-gradient|repeating-radial-gradient)\(/.test(t)?ht("backgroundImage",t,!0):ht("background",t,!0);if(e==="textShadow"){t=t.toString().trim();let o={},i=pn(t);for(let r of i){let a=ht("textShadow",r,!0);for(let c in a)o[c]?o[c].push(a[c]):o[c]=[a[c]]}return o}if(e==="WebkitTextStroke"){t=t.toString().trim();let o=t.split(" ");if(o.length!==2)throw new Error("Invalid `WebkitTextStroke` value.");return{WebkitTextStrokeWidth:vt(e,o[0]),WebkitTextStrokeColor:vt(e,o[1])}}if(e==="backdropFilter"||e==="WebkitBackdropFilter")return{backdropFilter:t};if(e==="textDecorationSkipInk"){let o=t.toString().trim().toLowerCase();if(!["auto","none","all"].includes(o))throw new Error("Invalid `textDecorationSkipInk` value.");return{textDecorationSkipInk:o}}}function oo(e){return e==="transform"?" Only absolute lengths such as `10px` are supported.":""}var io=/rgb\((\d+)\s+(\d+)\s+(\d+)\s*\/\s*([\.\d]+)\)/;function so(e){if(typeof e=="string"&&io.test(e.trim()))return e.trim().replace(io,(t,n,o,i,r)=>`rgba(${n}, ${o}, ${i}, ${r})`);if(typeof e=="object"&&e!==null){for(let t in e)e[t]=so(e[t]);return e}return e}function Sn(e,t){let n={},o={};for(let s in t)s.startsWith("--")&&(o[s]=String(t[s]));let i={},r=e;if(e){let{variables:s,remainingStyle:d}=no(e);i=s,r=d}let a=ro(o,i);for(let s in a)n[s]=a[s];if(r){let s=r.color?qt(r.color,a):void 0,d=ji(s,t.color);n.color=d;for(let f in r){if(f.startsWith("_")){n[f]=r[f];continue}if(f==="color")continue;let p=Ni(f),g=qt(r[f],a),b=Vi(g,d);try{let S=Di(p,b,d)||Gi(p,ht(p,vt(p,b),!0),b,d);Object.assign(n,S)}catch(S){throw new Error(S.message+(S.message.includes(b)?`
|
|
3
3
|
`+oo(p):`
|
|
4
|
-
in CSS rule \`${p}: ${b}\`.${oo(p)}`))}}}if(n.backgroundImage){let{backgrounds:s}=Wi(n);n.backgroundImage=s}(n.maskImage||n.WebkitMaskImage)&&(n.maskImage=eo(n));let c=Ui(n.fontSize,t.fontSize);typeof n.fontSize<"u"&&(n.fontSize=c),n.transformOrigin&&(n.transformOrigin=Zn(n.transformOrigin,c));for(let s in n){let d=n[s];if(s==="lineHeight")typeof d=="string"&&d!=="normal"&&(d=n[s]=H(d,c,c,t,!0)/c);else{if(typeof d=="string"){let f=H(d,c,c,t);typeof f<"u"&&(n[s]=f),d=n[s]}if(typeof d=="string"||typeof d=="object"){let f=so(d);f&&(n[s]=f),d=n[s]}}if(s==="opacity"&&typeof d=="number"&&(n.opacity=d*t.opacity),s==="transform"){let f=d;for(let p of f){let g=Object.keys(p)[0],b=p[g],S=typeof b=="string"?H(b,c,c,t)??b:b;p[g]=S}}if(s==="textShadowRadius"){let f=d;n.textShadowRadius=f.map(p=>H(p,c,0,t,!1))}if(s==="textShadowOffset"){let f=d;n.textShadowOffset=f.map(({height:p,width:g})=>({height:H(p,c,0,t,!1),width:H(g,c,0,t,!1)}))}}return n}function Ui(e,t){if(typeof e=="number")return e;try{let n=new He(e);switch(n.unit){case"em":return n.value*t;case"rem":return n.value*16}}catch{return t}}function ao(e){if(e.startsWith("hsl")){let t=Bi(e),[n,o,i]=t.values;return`hsl(${[n,`${o}%`,`${i}%`].concat(t.alpha===1?[]:[t.alpha]).join(",")})`}return e}function ji(e,t){return e&&e.toLowerCase()!=="currentcolor"?ao(e):ao(t)}function zi(e,t){return e.replace(/currentcolor/gi,t)}function Vi(e,t){return dn(e)&&(e=zi(e,t)),e}async function Qn(e,t,n,o,i){let r=await mt(),a=Object.assign({},n,Sn(Qr[t],n),Sn(o,n));if(t==="img"){let[c,s,d]=await Nt(i.src);if(s===void 0&&d===void 0){if(i.width===void 0||i.height===void 0)throw new Error("Image size cannot be determined. Please provide the width and height of the image.");s=parseInt(i.width),d=parseInt(i.height)}let f=d/s,p=(a.borderLeftWidth||0)+(a.borderRightWidth||0)+(a.paddingLeft||0)+(a.paddingRight||0),g=(a.borderTopWidth||0)+(a.borderBottomWidth||0)+(a.paddingTop||0)+(a.paddingBottom||0),b=a.width||i.width,S=a.height||i.height,x=typeof b=="number"&&typeof S=="number";x&&(b-=p,S-=g),b===void 0&&S===void 0?(b="100%",e.setAspectRatio(1/f)):b===void 0?typeof S=="number"?b=S/f:e.setAspectRatio(1/f):S===void 0&&(typeof b=="number"?S=b*f:e.setAspectRatio(1/f)),a.width=x?b+p:b,a.height=x?S+g:S,a.__src=c,a.__naturalWidth=s,a.__naturalHeight=d}if(t==="svg"){let c=i.viewBox||i.viewbox,s=At(c),d=s?s[3]/s[2]:null,{width:f,height:p}=i;typeof f>"u"&&p?d==null?f=0:typeof p=="string"&&p.endsWith("%")?f=parseInt(p)/d+"%":(p=H(p,n.fontSize,1,n),f=p/d):typeof p>"u"&&f?d==null?f=0:typeof f=="string"&&f.endsWith("%")?p=parseInt(f)*d+"%":(f=H(f,n.fontSize,1,n),p=f*d):(typeof f<"u"&&(f=H(f,n.fontSize,1,n)||f),typeof p<"u"&&(p=H(p,n.fontSize,1,n)||p),f||=s==null?void 0:s[2],p||=s==null?void 0:s[3]),!a.width&&f&&(a.width=f),!a.height&&p&&(a.height=p)}return e.setDisplay(Le(a.display,{flex:r.DISPLAY_FLEX,block:r.DISPLAY_FLEX,contents:r.DISPLAY_CONTENTS,none:r.DISPLAY_NONE,"-webkit-box":r.DISPLAY_FLEX},r.DISPLAY_FLEX,"display")),e.setAlignContent(Le(a.alignContent,{stretch:r.ALIGN_STRETCH,center:r.ALIGN_CENTER,"flex-start":r.ALIGN_FLEX_START,"flex-end":r.ALIGN_FLEX_END,"space-between":r.ALIGN_SPACE_BETWEEN,"space-around":r.ALIGN_SPACE_AROUND,baseline:r.ALIGN_BASELINE,normal:r.ALIGN_AUTO},r.ALIGN_AUTO,"alignContent")),e.setAlignItems(Le(a.alignItems,{stretch:r.ALIGN_STRETCH,center:r.ALIGN_CENTER,"flex-start":r.ALIGN_FLEX_START,"flex-end":r.ALIGN_FLEX_END,baseline:r.ALIGN_BASELINE,normal:r.ALIGN_AUTO},r.ALIGN_STRETCH,"alignItems")),e.setAlignSelf(Le(a.alignSelf,{stretch:r.ALIGN_STRETCH,center:r.ALIGN_CENTER,"flex-start":r.ALIGN_FLEX_START,"flex-end":r.ALIGN_FLEX_END,baseline:r.ALIGN_BASELINE,normal:r.ALIGN_AUTO},r.ALIGN_AUTO,"alignSelf")),e.setJustifyContent(Le(a.justifyContent,{center:r.JUSTIFY_CENTER,"flex-start":r.JUSTIFY_FLEX_START,"flex-end":r.JUSTIFY_FLEX_END,"space-between":r.JUSTIFY_SPACE_BETWEEN,"space-around":r.JUSTIFY_SPACE_AROUND},r.JUSTIFY_FLEX_START,"justifyContent")),e.setFlexDirection(Le(a.flexDirection,{row:r.FLEX_DIRECTION_ROW,column:r.FLEX_DIRECTION_COLUMN,"row-reverse":r.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":r.FLEX_DIRECTION_COLUMN_REVERSE},r.FLEX_DIRECTION_ROW,"flexDirection")),e.setFlexWrap(Le(a.flexWrap,{wrap:r.WRAP_WRAP,nowrap:r.WRAP_NO_WRAP,"wrap-reverse":r.WRAP_WRAP_REVERSE},r.WRAP_NO_WRAP,"flexWrap")),typeof a.gap<"u"&&e.setGap(r.GUTTER_ALL,a.gap),typeof a.rowGap<"u"&&e.setGap(r.GUTTER_ROW,a.rowGap),typeof a.columnGap<"u"&&e.setGap(r.GUTTER_COLUMN,a.columnGap),typeof a.flexBasis<"u"&&e.setFlexBasis(pt(a.flexBasis,"flexBasis")),e.setFlexGrow(typeof a.flexGrow>"u"?0:a.flexGrow),e.setFlexShrink(typeof a.flexShrink>"u"?0:a.flexShrink),typeof a.maxHeight<"u"&&e.setMaxHeight(lt(a.maxHeight,"maxHeight")),typeof a.maxWidth<"u"&&e.setMaxWidth(lt(a.maxWidth,"maxWidth")),typeof a.minHeight<"u"&&e.setMinHeight(lt(a.minHeight,"minHeight")),typeof a.minWidth<"u"&&e.setMinWidth(lt(a.minWidth,"minWidth")),e.setOverflow(Le(a.overflow,{visible:r.OVERFLOW_VISIBLE,hidden:r.OVERFLOW_HIDDEN},r.OVERFLOW_VISIBLE,"overflow")),e.setMargin(r.EDGE_TOP,pt(a.marginTop||0)),e.setMargin(r.EDGE_BOTTOM,pt(a.marginBottom||0)),e.setMargin(r.EDGE_LEFT,pt(a.marginLeft||0)),e.setMargin(r.EDGE_RIGHT,pt(a.marginRight||0)),e.setBorder(r.EDGE_TOP,a.borderTopWidth||0),e.setBorder(r.EDGE_BOTTOM,a.borderBottomWidth||0),e.setBorder(r.EDGE_LEFT,a.borderLeftWidth||0),e.setBorder(r.EDGE_RIGHT,a.borderRightWidth||0),e.setPadding(r.EDGE_TOP,a.paddingTop||0),e.setPadding(r.EDGE_BOTTOM,a.paddingBottom||0),e.setPadding(r.EDGE_LEFT,a.paddingLeft||0),e.setPadding(r.EDGE_RIGHT,a.paddingRight||0),e.setBoxSizing(Le(a.boxSizing,{"border-box":r.BOX_SIZING_BORDER_BOX,"content-box":r.BOX_SIZING_CONTENT_BOX},r.BOX_SIZING_BORDER_BOX,"boxSizing")),e.setPositionType(Le(a.position,{absolute:r.POSITION_TYPE_ABSOLUTE,relative:r.POSITION_TYPE_RELATIVE,static:r.POSITION_TYPE_STATIC},r.POSITION_TYPE_RELATIVE,"position")),typeof a.top<"u"&&e.setPosition(r.EDGE_TOP,lt(a.top,"top")),typeof a.bottom<"u"&&e.setPosition(r.EDGE_BOTTOM,lt(a.bottom,"bottom")),typeof a.left<"u"&&e.setPosition(r.EDGE_LEFT,lt(a.left,"left")),typeof a.right<"u"&&e.setPosition(r.EDGE_RIGHT,lt(a.right,"right")),typeof a.height<"u"?e.setHeight(pt(a.height,"height")):e.setHeightAuto(),typeof a.width<"u"?e.setWidth(pt(a.width,"width")):e.setWidthAuto(),[a,Kn(a)]}import lo from"escape-html";var uo=[1,0,0,1,0,0];function Hi(e,t,n){let o=[...uo];for(let i of e){let r=Object.keys(i)[0],a=i[r];if(typeof a=="string")if(r==="translateX")a=parseFloat(a)/100*t,i[r]=a;else if(r==="translateY")a=parseFloat(a)/100*n,i[r]=a;else throw new Error(`Invalid transform: "${r}: ${a}".`);let c=a,s=[...uo];switch(r){case"translateX":s[4]=c;break;case"translateY":s[5]=c;break;case"scale":s[0]=c,s[3]=c;break;case"scaleX":s[0]=c;break;case"scaleY":s[3]=c;break;case"rotate":{let d=c*Math.PI/180,f=Math.cos(d),p=Math.sin(d);s[0]=f,s[1]=p,s[2]=-p,s[3]=f;break}case"skewX":s[2]=Math.tan(c*Math.PI/180);break;case"skewY":s[1]=Math.tan(c*Math.PI/180);break}o=zt(s,o)}e.splice(0,e.length),e.push(...o),e.__resolved=!0}function Kt({left:e,top:t,width:n,height:o},i,r,a){let c;i.__resolved||Hi(i,n,o);let s=i;if(r)c=s;else{let d=(a==null?void 0:a.xAbsolute)??((a==null?void 0:a.xRelative)??50)*n/100,f=(a==null?void 0:a.yAbsolute)??((a==null?void 0:a.yRelative)??50)*o/100,p=e+d,g=t+f;c=zt([1,0,0,1,p,g],zt(s,[1,0,0,1,-p,-g])),s.__parent&&(c=zt(s.__parent,c)),s.splice(0,6,...c)}return`matrix(${c.map(d=>d.toFixed(2)).join(",")})`}function fo({left:e,top:t,width:n,height:o,isInheritingTransform:i},r){let a="",c=1;return r.transform&&(a=Kt({left:e,top:t,width:n,height:o},r.transform,i,r.transformOrigin)),r.opacity!==void 0&&(c=+r.opacity),{matrix:a,opacity:c}}function er({id:e,content:t,filter:n,left:o,top:i,width:r,height:a,matrix:c,opacity:s,image:d,clipPathId:f,debug:p,fauxBoldStrokeWidth:g,shape:b,decorationShape:S},x){let _="";if(p&&(_=v("rect",{x:o,y:i-a,width:r,height:a,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:c||void 0,"clip-path":f?`url(#${f})`:void 0})),d){let E={href:d,x:o,y:i,width:r,height:a,transform:c||void 0,"clip-path":f?`url(#${f})`:void 0,style:x.filter?`filter:${x.filter}`:void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+v("image",{...E,opacity:s!==1?s:void 0})+(S||"")+(n?"</g>":"")+_,""]}let O=!!x.WebkitTextStrokeWidth,P=!O&&g!==void 0,M={x:o,y:i,width:r,height:a,"font-weight":x.fontWeight,"font-style":x.fontStyle,"font-size":x.fontSize,"font-family":x.fontFamily,"letter-spacing":x.letterSpacing||void 0,transform:c||void 0,"clip-path":f?`url(#${f})`:void 0,style:x.filter?`filter:${x.filter}`:void 0,"stroke-width":O?`${x.WebkitTextStrokeWidth}px`:P?`${g}`:void 0,stroke:O?x.WebkitTextStrokeColor:P?x.color:void 0,"stroke-linejoin":O||P?"round":void 0,"paint-order":O||P?"stroke":void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+v("text",{...M,fill:x.color,opacity:s!==1?s:void 0},lo(t))+(S||"")+(n?"</g>":"")+_,b?v("text",M,lo(t)):""]}function Xi(e,t,n){return e.replace(/([MA])([0-9.-]+),([0-9.-]+)/g,function(o,i,r,a){return i+(parseFloat(r)+t)+","+(parseFloat(a)+n)})}var wn=1.1;function co({id:e,width:t,height:n},o,i=!1){if(!o.shadowColor||!o.shadowOffset||typeof o.shadowRadius>"u")return"";let r=o.shadowColor.length,a="",c="",s=0,d=t,f=0,p=n;for(let g=0;g<r;g++){let b=o.shadowRadius[g]*o.shadowRadius[g]/4;if(s=Math.min(o.shadowOffset[g].width-b,s),d=Math.max(o.shadowOffset[g].width+b+t,d),f=Math.min(o.shadowOffset[g].height-b,f),p=Math.max(o.shadowOffset[g].height+b+n,p),i){let S=`satori_s-${e}-result-${g}`;a+=v("feGaussianBlur",{in:"SourceAlpha",stdDeviation:o.shadowRadius[g]/2,result:`${S}-blur`})+v("feOffset",{in:`${S}-blur`,dx:o.shadowOffset[g].width,dy:o.shadowOffset[g].height,result:`${S}-offset`})+v("feFlood",{"flood-color":o.shadowColor[g],"flood-opacity":1,result:`${S}-color`})+v("feComposite",{in:`${S}-color`,in2:`${S}-offset`,operator:"in",result:r>1?S:void 0})}else a+=v("feDropShadow",{dx:o.shadowOffset[g].width,dy:o.shadowOffset[g].height,stdDeviation:o.shadowRadius[g]/2,"flood-color":o.shadowColor[g],"flood-opacity":1,...r>1?{in:"SourceGraphic",result:`satori_s-${e}-result-${g}`}:{}});r>1&&(c=v("feMergeNode",{in:`satori_s-${e}-result-${g}`})+c)}return v("filter",{id:`satori_s-${e}`,x:(s/t*100*wn).toFixed(2)+"%",y:(f/n*100*wn).toFixed(2)+"%",width:((d-s)/t*100*wn).toFixed(2)+"%",height:((p-f)/n*100*wn).toFixed(2)+"%"},a+(c?v("feMerge",{},c):""))}function po({width:e,height:t,shape:n,opacity:o,id:i},r){if(!r.boxShadow)return null;let a="",c="";for(let s=r.boxShadow.length-1;s>=0;s--){let d="",f=r.boxShadow[s];f.spreadRadius&&f.inset&&(f.spreadRadius=-f.spreadRadius);let p=f.blurRadius*f.blurRadius/4+(f.spreadRadius||0),g=Math.min(-p-(f.inset?f.offsetX:0),0),b=Math.max(p+e-(f.inset?f.offsetX:0),e),S=Math.min(-p-(f.inset?f.offsetY:0),0),x=Math.max(p+t-(f.inset?f.offsetY:0),t),_=`satori_s-${i}-${s}`,O=`satori_ms-${i}-${s}`,P=f.spreadRadius?n.replace('stroke-width="0"',`stroke-width="${f.spreadRadius*2}"`):n;d+=v("mask",{id:O,maskUnits:"userSpaceOnUse"},v("rect",{x:0,y:0,width:r._viewportWidth||"100%",height:r._viewportHeight||"100%",fill:f.inset?"#000":"#fff"})+P.replace('fill="#fff"',f.inset?'fill="#fff"':'fill="#000"').replace('stroke="#fff"',""));let M=P.replace(/d="([^"]+)"/,(E,k)=>'d="'+Xi(k,f.offsetX,f.offsetY)+'"').replace(/x="([^"]+)"/,(E,k)=>'x="'+(parseFloat(k)+f.offsetX)+'"').replace(/y="([^"]+)"/,(E,k)=>'y="'+(parseFloat(k)+f.offsetY)+'"');f.spreadRadius&&f.spreadRadius<0&&(d+=v("mask",{id:O+"-neg",maskUnits:"userSpaceOnUse"},M.replace('stroke="#fff"','stroke="#000"').replace(/stroke-width="[^"]+"/,`stroke-width="${-f.spreadRadius*2}"`))),f.spreadRadius&&f.spreadRadius<0&&(M=v("g",{mask:`url(#${O}-neg)`},M)),d+=v("defs",{},v("filter",{id:_,x:`${g/e*100}%`,y:`${S/t*100}%`,width:`${(b-g)/e*100}%`,height:`${(x-S)/t*100}%`},v("feGaussianBlur",{stdDeviation:f.blurRadius/2,result:"b"})+v("feFlood",{"flood-color":f.color,in:"SourceGraphic",result:"f"})+v("feComposite",{in:"f",in2:"b",operator:f.inset?"out":"in"})))+v("g",{mask:`url(#${O})`,filter:`url(#${_})`,opacity:o},M),f.inset?c+=d:a+=d}return[a,c]}function Yi(e,t,n,o,i,r){let a=i/2,c=Math.max(a,i*1.25),s=[];for(let p of n){if(p.y2<r+a||p.y1>o+a)continue;let g=Math.max(e,p.x1-c),b=Math.min(t,p.x2+c);if(g>=b)continue;if(s.length===0){s.push([g,b]);continue}let S=s[s.length-1];g<=S[1]?S[1]=Math.max(S[1],b):s.push([g,b])}if(!s.length)return[[e,t]];let d=[],f=e;for(let[p,g]of s)if(p>f&&d.push([f,p]),f=Math.max(f,g),f>=t)break;return f<t&&d.push([f,t]),d}function tr({width:e,left:t,top:n,ascender:o,clipPathId:i,matrix:r,glyphBoxes:a},c){let{textDecorationColor:s,textDecorationStyle:d,textDecorationLine:f,textDecorationSkipInk:p,fontSize:g,color:b}=c;if(!f||f==="none")return"";let S=Math.max(1,g*.1),x=f==="line-through"?n+o*.7:f==="underline"?n+o*1.1:n,_=d==="dashed"?`${S*1.2} ${S*2}`:d==="dotted"?`0 ${S*2}`:void 0,O=f==="underline"&&(p||"auto")!=="none"&&(a==null?void 0:a.length),P=n+o,M=O?Yi(t,t+e,a,x,S,P):[[t,t+e]],E=d==="double"?M.map(([k,$])=>v("line",{x1:k,y1:x+S+1,x2:$,y2:x+S+1,stroke:s||b,"stroke-width":S,"stroke-dasharray":_,"stroke-linecap":d==="dotted"?"round":"square",transform:r})).join(""):"";return(i?`<g clip-path="url(#${i})">`:"")+M.map(([k,$])=>v("line",{x1:k,y1:x,x2:$,y2:x,stroke:s||b,"stroke-width":S,"stroke-dasharray":_,"stroke-linecap":d==="dotted"?"round":"square",transform:r})).join("")+E+(i?"</g>":"")}function nr(e){return e=e.replace("U+","0x"),String.fromCodePoint(Number(e))}var Et=nr("U+0020"),rr=nr("U+0009"),Wt=nr("U+2026");function mo(e,t,n){let{fontSize:o,letterSpacing:i}=n,r=new Map;function a(d){let f=r.get(d);return f===void 0&&(f=e.measure(d,{fontSize:o,letterSpacing:i}),r.set(d,f)),f}function c(d){let f=0;for(let p of d)t(p)?f+=o:f+=a(p);return f}function s(d){return c(Pe(d,"grapheme"))}return{measureGrapheme:a,measureGraphemeArray:c,measureText:s}}function ho(e,t,n){let{textTransform:o,whiteSpace:i,wordBreak:r}=t;e=qi(e,o,n);let{content:a,shouldCollapseTabsAndSpaces:c,allowSoftWrap:s}=Zi(e,i),{words:d,requiredBreaks:f,allowBreakWord:p}=Ji(a,r),[g,b]=Ki(t,s);return{words:d,requiredBreaks:f,allowSoftWrap:s,allowBreakWord:p,processedContent:a,shouldCollapseTabsAndSpaces:c,lineLimit:g,blockEllipsis:b}}function qi(e,t,n){return t==="uppercase"?e=e.toLocaleUpperCase(n):t==="lowercase"?e=e.toLocaleLowerCase(n):t==="capitalize"&&(e=Pe(e,"word",n).map(o=>Pe(o,"grapheme",n).map((i,r)=>r===0?i.toLocaleUpperCase(n):i).join("")).join("")),e}function Ki(e,t){let{textOverflow:n,lineClamp:o,WebkitLineClamp:i,WebkitBoxOrient:r,overflow:a,display:c}=e;if(c==="block"&&o){let[s,d=Wt]=Qi(o);if(s)return[s,d]}return n==="ellipsis"&&c==="-webkit-box"&&r==="vertical"&&Mr(i)&&i>0?[i,Wt]:n==="ellipsis"&&a==="hidden"&&!t?[1,Wt]:[1/0]}function Ji(e,t){let n=["break-all","break-word"].includes(t),{words:o,requiredBreaks:i}=Lr(e,t);return{words:o,requiredBreaks:i,allowBreakWord:n}}function Zi(e,t){let n=["pre","pre-wrap","pre-line"].includes(t),o=["normal","nowrap","pre-line"].includes(t),i=!["pre","nowrap"].includes(t);return n||(e=e.replace(/\n/g,Et)),o&&(e=e.replace(/([ ]|\t)+/g,Et).replace(/^[ ]|[ ]$/g,"")),{content:e,shouldCollapseTabsAndSpaces:o,allowSoftWrap:i}}function Qi(e){if(typeof e=="number")return[e];let t=/^(\d+)\s*"(.*)"$/,n=/^(\d+)\s*'(.*)'$/,o=t.exec(e),i=n.exec(e);if(o){let r=+o[1],a=o[2];return[r,a]}else if(i){let r=+i[1],a=i[2];return[r,a]}return[]}import bo from"parse-css-color";var ea=new Set([rr]);function ta(e){return ea.has(e)}function or(e){if(e==="transparent")return!0;let t=bo(e);return t?t.alpha===0:!1}function go(e){if(!e)return!1;let t=bo(e);if(!t)return!1;let[n,o,i,r]=t.values;return n===255&&o===255&&i===255&&(r===void 0||r===1)}async function*ir(e,t){let n=await mt(),{parentStyle:o,inheritedStyle:i,parent:r,font:a,id:c,isInheritingTransform:s,debug:d,embedFont:f,graphemeImages:p,locale:g,canLoadAdditionalAssets:b}=t,{textAlign:S,textIndent:x=0,lineHeight:_,textWrap:O,fontSize:P,filter:M,tabSize:E=8,letterSpacing:k,_inheritedBackgroundClipTextPath:$,_inheritedBackgroundClipTextHasBackground:A,flexShrink:L}=o,{words:W,requiredBreaks:j,allowSoftWrap:X,allowBreakWord:he,processedContent:oe,shouldCollapseTabsAndSpaces:ce,lineLimit:ue,blockEllipsis:ke}=ho(e,o,g),K=na(n,S);r.insertChild(K,r.getChildCount()),Pr(L)&&r.setFlexShrink(1);let z=a.getEngine(P,_,o,g),Ie=b?Pe(oe,"grapheme").filter(U=>!ta(U)&&!z.has(U)):[];yield Ie.map(U=>({word:U,locale:g})),Ie.length&&(z=a.getEngine(P,_,o,g));function De(U){return!!(p&&p[U])}let{measureGrapheme:le,measureGraphemeArray:Se,measureText:Ne}=mo(z,De,{fontSize:P,letterSpacing:k}),B=dn(E)?H(E,P,1,o):le(Et)*E,ie=(U,G)=>{if(U.length===0)return{originWidth:0,endingSpacesWidth:0,text:U};let{index:J,tabCount:V}=ra(U),fe=0;if(V>0){let pe=U.slice(0,J),Z=U.slice(J+V),Q=Ne(pe),ze=Q+G;fe=(B===0?Q:(Math.floor(ze/B)+V)*B)+Ne(Z)}else fe=Ne(U);let ne=U.trimEnd()===U?fe:Ne(U.trimEnd());return{originWidth:fe,endingSpacesWidth:fe-ne,text:U}},Y=[],ae=[],F=[],se=[],de=[];function Ee(U){let G=0,J=0,V=-1,fe=0,ne=0,pe=0,Z=0;Y=[],F=[0],se=[],de=[];let Q=0,ze=0;for(;Q<W.length&&G<ue;){let q=W[Q],ve=j[Q],Ae=0,{originWidth:Ft,endingSpacesWidth:be,text:wt}=ie(q,ne);q=wt,Ae=Ft;let _e=be;ve&&pe===0&&(pe=z.height(q));let at=S==="justify",me=Q&&ne+Ae>U+_e&&X;if(he&&Ae>U&&(!ne||me||ve)){let $e=Pe(q,"grapheme");W.splice(Q,1,...$e),ne>0&&(Y.push(ne-ze),ae.push(Z),G++,fe+=pe,ne=0,pe=0,Z=0,F.push(1),V=-1),ze=_e;continue}if(ve||me)ce&&q===Et&&(Ae=0),Y.push(ne-ze),ae.push(Z),G++,fe+=pe,ne=Ae,pe=Ae?Math.round(z.height(q)):0,Z=Ae?Math.round(z.baseline(q)):0,F.push(1),V=-1,ve||(J=Math.max(J,U));else{ne+=Ae;let $e=Math.round(z.height(q));$e>pe&&(pe=$e,Z=Math.round(z.baseline(q))),at&&F[F.length-1]++}at&&V++,J=Math.max(J,ne);let Fe=ne-Ae;if(Ae===0)de.push({y:fe,x:Fe,width:0,line:G,lineIndex:V,isImage:!1});else{let $e=Pe(q,"word");for(let Ze=0;Ze<$e.length;Ze++){let Qe=$e[Ze],Me=0,Ve=!1;De(Qe)?(Me=P,Ve=!0):!f&&Qe.length>1?Me=Ne(Qe):Me=le(Qe),se.push(Qe),de.push({y:fe,x:Fe,width:Me,line:G,lineIndex:V,isImage:Ve}),Fe+=Me}}Q++,ze=_e}return ne&&(G<ue&&(fe+=pe),G++,Y.push(ne),ae.push(Z)),{width:J,height:fe}}let Te={width:0,height:0};K.setMeasureFunc(U=>{let{width:G,height:J}=Ee(U);if(O==="balance"){let fe=G/2,ne=G,pe=G;for(;fe+1<ne;){pe=(fe+ne)/2;let{height:Q}=Ee(pe);Q>J?fe=pe:ne=pe}Ee(ne);let Z=Math.ceil(ne);return Te={width:Z,height:J},{width:Z,height:J}}if(O==="pretty"&&Y[Y.length-1]<G/3){let pe=G*.9,Z=Ee(pe);if(Z.height<=J*1.3)return Te={width:G,height:Z.height},{width:G,height:Z.height}}let V=Math.ceil(G);return Te={width:V,height:J},{width:V,height:J}});let[te,Re]=yield,ye="",Oe="",we=i._inheritedClipPathId,Tt=i._inheritedMaskId,{left:nt,top:Bt,width:bt,height:Rt}=K.getComputedLayout(),kt=typeof x=="string"?H(x,P,bt,o,!0)||0:x,yt=r.getComputedWidth()-r.getComputedPadding(n.EDGE_LEFT)-r.getComputedPadding(n.EDGE_RIGHT)-r.getComputedBorder(n.EDGE_LEFT)-r.getComputedBorder(n.EDGE_RIGHT),rt=te+nt,Ye=Re+Bt,{matrix:Ue,opacity:xt}=fo({left:nt,top:Bt,width:bt,height:Rt,isInheritingTransform:s},o),We="";if(o.textShadowOffset){let{textShadowColor:U,textShadowOffset:G,textShadowRadius:J}=o;We=co({width:Te.width,height:Te.height,id:c},{shadowColor:U,shadowOffset:G,shadowRadius:J},or(o.color)||A&&go(o.color)),We=v("defs",{},We)}let qe="",Ke="",St="",dt=-1,Ce={},je={},Be=null,Je=0;for(let U=0;U<se.length;U++){let G=de[U],J=de[U+1];if(!G)continue;let V=se[U],fe=null,ne=!1,pe=p?p[V]:null,Z=G.y,Q=G.x,ze=G.width,q=G.line,ve=o.textDecorationLine==="underline"&&(o.textDecorationSkipInk||"auto")!=="none";if(q===dt)continue;let Ae=!1;if(q===0&&kt!==0&&(Q+=kt),Y.length>1){let me=bt-Y[q];if(S==="right"||S==="end")Q+=me;else if(S==="center")Q+=me/2;else if(S==="justify"&&q<Y.length-1){let ge=F[q],Fe=ge>1?me/(ge-1):0;Q+=Fe*G.lineIndex,Ae=!0}f&&(Q=Math.round(Q))}let Ft=ae[q],be=z.baseline(V),wt=z.height(V),_e=Ft-be,at=me=>!ve||o.textDecorationLine!=="underline"?void 0:{underlineY:Ye+me+_e+be+be*.1,strokeWidth:Math.max(1,P*.1)};if(Ce[q]||(Ce[q]={left:Q,top:Ye+Z+_e,ascender:be,width:Ae?bt:Y[q]}),ue!==1/0){let Qe=function(Me,Ve){let $t=Pe(Ve,"grapheme",g),It="",an=0;for(let sn of $t){let Gt=Me+Se([It+sn]);if(It&&Gt+ge>yt)break;It+=sn,an=Gt}return{subset:It,resolvedWidth:an}},me=ke,ge=le(ke);ge>yt&&(me=Wt,ge=le(me));let Fe=le(Et),$e=q<Y.length-1;if(q+1===ue&&($e||Y[q]>yt)){if(Q+ze+ge+Fe>yt){let{subset:Me,resolvedWidth:Ve}=Qe(Q,V);V=Me+me,dt=q,Ce[q].width=Math.max(0,Ve-Ce[q].left),ne=!0}else if(J&&J.line!==q)if(S==="center"){let{subset:Me,resolvedWidth:Ve}=Qe(Q,V);V=Me+me,dt=q,Ce[q].width=Math.max(0,Ve-Ce[q].left),ne=!0}else{let Me=se[U+1],{subset:Ve,resolvedWidth:$t}=Qe(ze+Q,Me);V=V+Ve+me,dt=q,Ce[q].width=Math.max(0,$t-Ce[q].left),ne=!0}}}if(pe)Z+=0;else if(f){if(!V.includes(rr)&&!Cr.includes(V)&&se[U+1]&&J&&!J.isImage&&Z===J.y&&!ne){Be===null&&(Je=Q),Be=Be===null?V:Be+V;continue}let me=Be===null?V:Be+V,ge=Be===null?Q:Je,Fe=G.width+Q-ge,$e=at(Z),Ze=z.getSVG(me.replace(/(\t)+/g,""),{fontSize:P,left:rt+ge,top:Ye+Z+be+_e,letterSpacing:k},$e);fe=Ze.path,ve&&Ze.boxes&&Ze.boxes.length&&(je[q]||(je[q]=[])).push(...Ze.boxes),Be=null,d&&(St+=v("rect",{x:rt+ge,y:Ye+Z+_e,width:Fe,height:wt,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:Ue||void 0,"clip-path":we?`url(#${we})`:void 0})+v("line",{x1:rt+Q,x2:rt+Q+G.width,y1:Ye+Z+_e+be,y2:Ye+Z+_e+be,stroke:"#14c000","stroke-width":1,transform:Ue||void 0,"clip-path":we?`url(#${we})`:void 0}))}else if(Z+=be+_e,ve&&!pe){let me=at(Z),ge=z.getSVG(V.replace(/(\t)+/g,""),{fontSize:P,left:rt+Q,top:Ye+Z,letterSpacing:k},me);ge.boxes&&ge.boxes.length&&(je[q]||(je[q]=[])).push(...ge.boxes)}if(fe!==null)Ke+=fe+" ";else{let[me,ge]=er({content:V,filter:We,id:c,left:rt+Q,top:Ye+Z,width:ze,height:wt,matrix:Ue,opacity:xt,image:pe,clipPathId:we,debug:d,fauxBoldStrokeWidth:z.fauxBoldStrokeWidth,shape:!!$},o);ye+=me,Oe+=ge}if(ne)break}if(o.textDecorationLine&&(qe=Object.entries(Ce).map(([U,G])=>{if(!G)return"";let J=je[U]||[];return tr({left:rt+G.left,top:G.top,width:G.width,ascender:G.ascender,clipPathId:we,matrix:Ue,glyphBoxes:J},o)}).join("")),Ke){let U=!!i.WebkitTextStrokeWidth,G=!U&&z.fauxBoldStrokeWidth!==void 0,J=We&&(or(o.color)||A&&go(o.color))?"black":o.color,V=(!or(o.color)||We)&&xt!==0?`<g ${Tt?`mask="url(#${Tt})"`:""} ${we?`clip-path="url(#${we})"`:""}>`+v("path",{d:Ke,fill:J,opacity:xt!==1?xt:void 0,"paint-order":U||G?"stroke":void 0,stroke:U?i.WebkitTextStrokeColor:G?J:void 0,"stroke-linejoin":U||G?"round":void 0,"stroke-width":U?`${i.WebkitTextStrokeWidth}px`:G?`${z.fauxBoldStrokeWidth}`:void 0,style:M?`filter:${M}`:void 0,transform:Ue||void 0})+"</g>":"";$&&(Oe=v("path",{d:Ke,transform:Ue||void 0})),ye+=(We?We+v("g",{filter:`url(#satori_s-${c})`},V+qe):V+qe)+St}else qe&&(ye+=We?v("g",{filter:`url(#satori_s-${c})`},qe):qe);return Oe&&(o._inheritedBackgroundClipTextPath.value+=Oe),ye}function na(e,t){let n=e.Node.create();return n.setAlignItems(e.ALIGN_BASELINE),n.setJustifyContent(Le(t,{left:e.JUSTIFY_FLEX_START,right:e.JUSTIFY_FLEX_END,center:e.JUSTIFY_CENTER,justify:e.JUSTIFY_SPACE_BETWEEN,start:e.JUSTIFY_FLEX_START,end:e.JUSTIFY_FLEX_END},e.JUSTIFY_FLEX_START,"textAlign")),n}function ra(e){let t=/(\t)+/.exec(e);return t?{index:t.index,tabCount:t[0].length}:{index:null,tabCount:0}}import{parseLinearGradient as ia}from"css-gradient-parser";import oa from"parse-css-color";function vn(e,t,n,o,i){let r=[],a=t.at(-1),c=a&&a.offset&&a.offset.unit==="%"&&o?+a.offset.value:100;for(let p of t){let{color:g}=p;if(!r.length&&(r.push({offset:0,color:g}),!p.offset||p.offset.value==="0"))continue;let b=typeof p.offset>"u"?void 0:p.offset.unit==="%"?+p.offset.value/c:Number(H(`${p.offset.value}${p.offset.unit}`,n.fontSize,e,n,!0))/e;r.push({offset:b,color:g})}r.length||r.push({offset:0,color:"transparent"});let s=r[r.length-1];s.offset!==1&&(typeof s.offset>"u"?s.offset=1:o?r[r.length-1]={offset:1,color:s.color}:r.push({offset:1,color:s.color}));let d=0,f=1;for(let p=0;p<r.length;p++)if(typeof r[p].offset>"u"){for(f<p&&(f=p);typeof r[f].offset>"u";)f++;r[p].offset=(r[f].offset-r[d].offset)/(f-d)*(p-d)+r[d].offset}else d=p;return i==="mask"?r.map(p=>{let g=oa(p.color);return g?g.alpha===0?{...p,color:"rgba(0, 0, 0, 1)"}:{...p,color:`rgba(255, 255, 255, ${g.alpha})`}:p}):r}function yo({id:e,width:t,height:n,repeatX:o,repeatY:i},r,a,c,s,d){let f=ia(r),[p,g]=a,b=r.startsWith("repeating"),S,x,_;if(f.orientation.type==="directional")S=sa(f.orientation.value),x=Math.sqrt(Math.pow((S.x2-S.x1)*p,2)+Math.pow((S.y2-S.y1)*g,2));else if(f.orientation.type==="angular"){let{length:k,...$}=ua(On(`${f.orientation.value.value}${f.orientation.value.unit}`)/180*Math.PI,p,g);x=k,S=$}_=b?la(f.stops,x,S,s):S;let O=vn(b?aa(f.stops,x):x,f.stops,s,b,d),P=`satori_bi${e}`,M=`satori_pattern_${e}`,E=v("pattern",{id:M,x:c[0]/t,y:c[1]/n,width:o?p/t:"1",height:i?g/n:"1",patternUnits:"objectBoundingBox"},v("linearGradient",{id:P,..._,spreadMethod:b?"repeat":"pad"},O.map(k=>v("stop",{offset:(k.offset??0)*100+"%","stop-color":k.color})).join(""))+v("rect",{x:0,y:0,width:p,height:g,fill:`url(#${P})`}));return[M,E]}function aa(e,t){let n=e[e.length-1],{offset:o}=n;return o?o.unit==="%"?Number(o.value)/100*t:Number(o.value):t}function sa(e){let t=0,n=0,o=0,i=0;return e.includes("top")?n=1:e.includes("bottom")&&(i=1),e.includes("left")?t=1:e.includes("right")&&(o=1),!t&&!o&&!n&&!i&&(n=1),{x1:t,y1:n,x2:o,y2:i}}function ua(e,t,n){let o=Math.pow(n/t,2);e=(e%(Math.PI*2)+Math.PI*2)%(Math.PI*2);let i,r,a,c,s,d,f,p,g=b=>{if(b===0){i=0,r=n,a=0,c=0,s=n;return}else if(b===Math.PI/2){i=0,r=0,a=t,c=0,s=t;return}if(b>0&&b<Math.PI/2){i=(o*t/2/Math.tan(b)-n/2)/(Math.tan(b)+o/Math.tan(b)),r=Math.tan(b)*i+n,a=Math.abs(t/2-i)+t/2,c=n/2-Math.abs(r-n/2),s=Math.sqrt(Math.pow(a-i,2)+Math.pow(c-r,2)),f=(t/2/Math.tan(b)-n/2)/(Math.tan(b)+1/Math.tan(b)),p=Math.tan(b)*f+n,s=2*Math.sqrt(Math.pow(t/2-f,2)+Math.pow(n/2-p,2));return}else if(b>Math.PI/2&&b<Math.PI){i=(n/2+o*t/2/Math.tan(b))/(Math.tan(b)+o/Math.tan(b)),r=Math.tan(b)*i,a=Math.abs(t/2-i)+t/2,c=n/2+Math.abs(r-n/2),f=(t/2/Math.tan(b)+n/2)/(Math.tan(b)+1/Math.tan(b)),p=Math.tan(b)*f,s=2*Math.sqrt(Math.pow(t/2-f,2)+Math.pow(n/2-p,2));return}else b>=Math.PI&&(g(b-Math.PI),d=i,i=a,a=d,d=r,r=c,c=d)};return g(e),{x1:i/t,y1:r/n,x2:a/t,y2:c/n,length:s}}function la(e,t,n,o){let{x1:i,x2:r,y1:a,y2:c}=n,s=e[0].offset?e[0].offset.unit==="%"?Number(e[0].offset.value)/100:H(`${e[0].offset.value}${e[0].offset.unit}`,o.fontSize,t,o,!0)/t:0,d=e.at(-1).offset?e.at(-1).offset.unit==="%"?Number(e.at(-1).offset.value)/100:H(`${e.at(-1).offset.value}${e.at(-1).offset.unit}`,o.fontSize,t,o,!0)/t:1,f=(r-i)*s+i,p=(c-a)*s+a,g=(r-i)*d+i,b=(c-a)*d+a;return{x1:f,y1:p,x2:g,y2:b}}import{parseRadialGradient as fa}from"css-gradient-parser";function So({id:e,width:t,height:n,repeatX:o,repeatY:i},r,a,c,s,d){var oe;let{shape:f,stops:p,position:g,size:b,repeating:S}=fa(r),[x,_]=a,O=x/2,P=_/2,M=da(g.x,g.y,x,_,s.fontSize,s);O=M.x,P=M.y;let E=ca(t,p,S,s),k=vn(E,p,s,S,d),$=`satori_radial_${e}`,A=`satori_pattern_${e}`,L=`satori_mask_${e}`,W=ma(f,b,s.fontSize,{x:O,y:P},[x,_],s,S),j=pa(f,s.fontSize,p,[x,_],s,S,W),X=v("pattern",{id:A,x:c[0]/t,y:c[1]/n,width:o?x/t:"1",height:i?_/n:"1",patternUnits:"objectBoundingBox"},v("radialGradient",{id:$,...j},k.map(ce=>v("stop",{offset:ce.offset||0,"stop-color":ce.color})).join(""))+v("mask",{id:L},v("rect",{x:0,y:0,width:x,height:_,fill:"#fff"}))+v("rect",{x:0,y:0,width:x,height:_,fill:((oe=k.at(-1))==null?void 0:oe.color)||"transparent"})+v(f,{cx:O,cy:P,width:x,height:_,...W,fill:`url(#${$})`,mask:`url(#${L})`}));return[A,X]}function ca(e,t,n,o){if(!n)return e;let i=t.at(-1);return!i||!i.offset||i.offset.unit==="%"?e:H(`${i.offset.value}${i.offset.unit}`,+o.fontSize,e,o,!0)}function da(e,t,n,o,i,r){let a={x:n/2,y:o/2};return e.type==="keyword"?Object.assign(a,xo(e.value,n,o,"x")):a.x=H(`${e.value.value}${e.value.unit}`,i,n,r,!0)??n/2,t.type==="keyword"?Object.assign(a,xo(t.value,n,o,"y")):a.y=H(`${t.value.value}${t.value.unit}`,i,o,r,!0)??o/2,a}function xo(e,t,n,o){switch(e){case"center":return{[o]:o==="x"?t/2:n/2};case"left":return{x:0};case"top":return{y:0};case"right":return{x:t};case"bottom":return{y:n}}}function pa(e,t,n,[o,i],r,a,c){let{r:s,rx:d,ratio:f=1}=c;if(!a)return{spreadMethod:"pad"};let p=n.at(-1),g=e==="circle"?s*2:d*2;return{spreadMethod:"repeat",cx:"50%",cy:"50%",r:p.offset.unit==="%"?`${Number(p.offset.value)*Math.min(i/o,1)/f}%`:Number(H(`${p.offset.value}${p.offset.unit}`,t,o,r,!0)/g)}}function ma(e,t,n,o,i,r,a){let[c,s]=i,{x:d,y:f}=o,p={},g=0,b=0;if(ha(t)){if(t.some(S=>S.value.value.startsWith("-")))throw new Error("disallow setting negative values to the size of the shape. Check https://w3c.github.io/csswg-drafts/css-images/#valdef-rg-size-length-0");return e==="circle"?Object.assign(p,{r:Number(H(`${t[0].value.value}${t[0].value.unit}`,n,c,r,!0))}):Object.assign(p,{rx:Number(H(`${t[0].value.value}${t[0].value.unit}`,n,c,r,!0)),ry:Number(H(`${t[1].value.value}${t[1].value.unit}`,n,s,r,!0))}),En(p,c,s,d,f,a,e),p}switch(t[0].value){case"farthest-corner":g=Math.max(Math.abs(c-d),Math.abs(d)),b=Math.max(Math.abs(s-f),Math.abs(f));break;case"closest-corner":g=Math.min(Math.abs(c-d),Math.abs(d)),b=Math.min(Math.abs(s-f),Math.abs(f));break;case"farthest-side":return e==="circle"?p.r=Math.max(Math.abs(c-d),Math.abs(d),Math.abs(s-f),Math.abs(f)):(p.rx=Math.max(Math.abs(c-d),Math.abs(d)),p.ry=Math.max(Math.abs(s-f),Math.abs(f))),En(p,c,s,d,f,a,e),p;case"closest-side":return e==="circle"?p.r=Math.min(Math.abs(c-d),Math.abs(d),Math.abs(s-f),Math.abs(f)):(p.rx=Math.min(Math.abs(c-d),Math.abs(d)),p.ry=Math.min(Math.abs(s-f),Math.abs(f))),En(p,c,s,d,f,a,e),p}return e==="circle"?p.r=Math.sqrt(g*g+b*b):Object.assign(p,wo(g,b)),En(p,c,s,d,f,a,e),p}function En(e,t,n,o,i,r,a){if(r)if(a==="ellipse"){let c=Math.max(Math.abs(t-o),Math.abs(o)),s=Math.max(Math.abs(n-i),Math.abs(i)),{rx:d,ry:f}=wo(c,s);e.ratio=Math.max(d/e.rx,f/e.ry),e.ratio>1&&(e.rx*=e.ratio,e.ry*=e.ratio)}else{let c=Math.max(Math.abs(t-o),Math.abs(o)),s=Math.max(Math.abs(n-i),Math.abs(i)),d=Math.sqrt(c*c+s*s);e.ratio=d/e.r,e.ratio>1&&(e.r=d)}}function wo(e,t){let n=t!==0?e/t:1;if(e===0)return{rx:0,ry:0};{let o=Math.sqrt(e*e+t*t*n*n)/n;return{ry:o,rx:o*n}}}function ha(e){return!e.some(t=>t.type==="keyword")}import vo from"parse-css-color";function Ot(e,t){return typeof e=="string"&&e.endsWith("%")?t*parseFloat(e)/100:typeof e=="string"?parseFloat(e)||0:+e}function ga(e,t,n,o,i){if(!o||!i)return[t,n];if(e==="cover"){let r=t/o,a=n/i,c=Math.max(r,a);return[o*c,i*c]}if(e==="contain"){let r=t/o,a=n/i,c=Math.min(r,a);return[o*c,i*c]}if(e==="auto"||e.includes("auto")){let r=e.split(" "),a=r[0]||"auto",c=r[1]||r[0]||"auto",s=o,d=i;if(a==="auto"&&c!=="auto"){let f=Ot(c,n);d=f,s=o/i*f}else if(c==="auto"&&a!=="auto"){let f=Ot(a,t);s=f,d=i/o*f}return[s,d]}return[t,n]}var Jt={bottom:"100%",center:"50%",left:"0%",right:"100%",top:"0%"};function ar(e){if(!e)return{x:"0%",y:"0%"};let t=e.split(" ").filter(Boolean);if(t.length===1){let n=t[0];return n in Jt?n==="top"||n==="bottom"?{x:"50%",y:Jt[n]}:{x:Jt[n],y:"50%"}:{x:n,y:"50%"}}return{x:Jt[t[0]]||t[0],y:Jt[t[1]]||t[1]}}function gt(e,t,n){if(e.endsWith("%")){let o=parseFloat(e)/100;return(t-n)*o}try{let o=new He(e);return o.type==="length"||o.type==="number"?o.value:Ot(o.value+o.unit,t)}catch{return 0}}function Eo(e,{x:t,y:n,defaultX:o,defaultY:i}){let r=e?e.split(" ").map(a=>{try{let c=new He(a);return c.type==="length"||c.type==="number"?c.value:c.value+c.unit}catch{return null}}).filter(a=>a!==null):[o,i];return r.length===0?[Ot(o,t),Ot(i,n)]:(r.length===1&&r.push(i),r.map((a,c)=>Ot(a,[t,n][c])))}async function Zt({id:e,width:t,height:n,left:o,top:i},{image:r,size:a,position:c,repeat:s},d,f){s=s||"repeat",f=f||"background",a=a||"auto",a!=="cover"&&a!=="contain"&&a!=="auto"&&!a.includes(" ")&&(a=`${a} auto`);let p=s==="repeat-x"||s==="repeat",g=s==="repeat-y"||s==="repeat",b=a&&(a==="cover"||a==="contain"||a==="auto"||a.includes("auto")),S=r.startsWith("linear-gradient(")||r.startsWith("repeating-linear-gradient(")||r.startsWith("radial-gradient(")||r.startsWith("repeating-radial-gradient("),x=b&&S?[t,n]:b?[0,0]:Eo(a,{x:t,y:n,defaultX:t,defaultY:n}),_=ar(c);if(r.startsWith("linear-gradient(")||r.startsWith("repeating-linear-gradient(")){let O=[gt(_.x,t,x[0]),gt(_.y,n,x[1])];return yo({id:e,width:t,height:n,repeatX:p,repeatY:g},r,x,O,d,f)}if(r.startsWith("radial-gradient(")||r.startsWith("repeating-radial-gradient(")){let O=[gt(_.x,t,x[0]),gt(_.y,n,x[1])];return So({id:e,width:t,height:n,repeatX:p,repeatY:g},r,x,O,d,f)}if(r.startsWith("url(")){let[O,P,M]=await Nt(r.slice(4,-1)),E,k;if(b){let[W,j]=ga(a,t,n,P,M);E=W,k=j}else{let W=Eo(a,{x:t,y:n,defaultX:0,defaultY:0});E=f==="mask"?P||W[0]:W[0]||P,k=f==="mask"?M||W[1]:W[1]||M}if(b){let W=ar(c),j=gt(W.x,t,E),X=gt(W.y,n,k);return[`satori_bi${e}`,v("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:(p?j:0)+o,y:(g?X:0)+i,width:p?E:"100%",height:g?k:"100%"},v("image",{x:p?0:j,y:g?0:X,width:E,height:k,preserveAspectRatio:"none",href:O}))]}let $=ar(c),A=gt($.x,t,E),L=gt($.y,n,k);return[`satori_bi${e}`,v("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:(p?A:0)+o,y:(g?L:0)+i,width:p?E:"100%",height:g?k:"100%"},v("image",{x:p?0:A,y:g?0:L,width:E,height:k,preserveAspectRatio:"none",href:O}))]}if(vo(r)){let O=vo(r),[P,M,E,k]=O.values,A=`rgba(${P},${M},${E},${k!==void 0?k:1})`;return[`satori_bi${e}`,v("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:o,y:i,width:t,height:n},v("rect",{x:0,y:0,width:t,height:n,fill:A}))]}throw new Error(`Invalid background image: "${r}"`)}function ba([e,t]){return Math.round(e*1e3)===0&&Math.round(t*1e3)===0?0:Math.round(e*t/Math.sqrt(e*e+t*t)*1e3)/1e3}function Tn(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 Rn(e){e[0]=e[1]=Math.min(e[0],e[1])}function kn(e,t,n,o,i){if(typeof e=="string"){let r=e.split(" ").map(c=>c.trim()),a=!r[1]&&!r[0].endsWith("%");return r[1]=r[1]||r[0],[a,[Math.min(H(r[0],o,t,i,!0),t),Math.min(H(r[1],o,n,i,!0),n)]]}return typeof e=="number"?[!0,[Math.min(e,t),Math.min(e,n)]]:[!0,void 0]}var In=e=>e&&e[0]!==0&&e[1]!==0;function To({id:e,borderRadiusPath:t,borderType:n,left:o,top:i,width:r,height:a},c){let s=`satori_brc-${e}`;return[v("clipPath",{id:s},v(n,{x:o,y:i,width:r,height:a,d:t||void 0})),s]}function it({left:e,top:t,width:n,height:o},i,r){let{borderTopLeftRadius:a,borderTopRightRadius:c,borderBottomLeftRadius:s,borderBottomRightRadius:d,fontSize:f}=i,p,g,b,S;if([p,a]=kn(a,n,o,f,i),[g,c]=kn(c,n,o,f,i),[b,s]=kn(s,n,o,f,i),[S,d]=kn(d,n,o,f,i),!r&&!In(a)&&!In(c)&&!In(s)&&!In(d))return"";a||=[0,0],c||=[0,0],s||=[0,0],d||=[0,0],[a[0],c[0]]=Tn(a[0],c[0],n),[s[0],d[0]]=Tn(s[0],d[0],n),[a[1],s[1]]=Tn(a[1],s[1],o),[c[1],d[1]]=Tn(c[1],d[1],o),p&&Rn(a),g&&Rn(c),b&&Rn(s),S&&Rn(d);let x=[];x[0]=[c,c],x[1]=[d,[-d[0],d[1]]],x[2]=[s,[-s[0],-s[1]]],x[3]=[a,[a[0],-a[1]]];let _=`h${n-a[0]-c[0]} a${x[0][0]} 0 0 1 ${x[0][1]}`,O=`v${o-c[1]-d[1]} a${x[1][0]} 0 0 1 ${x[1][1]}`,P=`h${d[0]+s[0]-n} a${x[2][0]} 0 0 1 ${x[2][1]}`,M=`v${s[1]+a[1]-o} a${x[3][0]} 0 0 1 ${x[3][1]}`;if(r){let k=function(he){let oe=ba([a,c,d,s][he]);return he===0?[[e+a[0]-oe,t+a[1]-oe],[e+a[0],t]]:he===1?[[e+n-c[0]+oe,t+c[1]-oe],[e+n,t+c[1]]]:he===2?[[e+n-d[0]+oe,t+o-d[1]+oe],[e+n-d[0],t+o]]:[[e+s[0]-oe,t+o-s[1]+oe],[e,t+o-s[1]]]},E=r.indexOf(!1);if(!r.includes(!0))throw new Error("Invalid `partialSides`.");if(E===-1)E=0;else for(;!r[E];)E=(E+1)%4;let $="",A=k(E),L=`M${A[0]} A${x[(E+3)%4][0]} 0 0 1 ${A[1]}`,W=0;for(;W<4&&r[(E+W)%4];W++)$+=L+" ",L=[_,O,P,M][(E+W)%4];let j=(E+W)%4;$+=L.split(" ")[0];let X=k(j);return $+=` A${x[(j+3)%4][0]} 0 0 1 ${X[0]}`,$}return`M${e+a[0]},${t} ${_} ${O} ${P} ${M}`}function Ro(e,t,n){return n[e+"Width"]===n[t+"Width"]&&n[e+"Style"]===n[t+"Style"]&&n[e+"Color"]===n[t+"Color"]}function ko({id:e,currentClipPathId:t,borderPath:n,borderType:o,left:i,top:r,width:a,height:c},s){if(!(s.borderTopWidth||s.borderRightWidth||s.borderBottomWidth||s.borderLeftWidth))return null;let f=`satori_bc-${e}`;return[v("clipPath",{id:f,"clip-path":t?`url(#${t})`:void 0},v(o,{x:i,y:r,width:a,height:c,d:n||void 0})),f]}function Qt({left:e,top:t,width:n,height:o,props:i,asContentMask:r,maskBorderOnly:a},c){let s=["borderTop","borderRight","borderBottom","borderLeft"];if(!r&&!s.some(b=>c[b+"Width"]))return"";let d="",f=0;for(;f>0&&Ro(s[f],s[(f+3)%4],c);)f=(f+3)%4;let p=[!1,!1,!1,!1],g=[];for(let b=0;b<4;b++){let S=(f+b)%4,x=(f+b+1)%4,_=s[S],O=s[x];if(p[S]=!0,g=[c[_+"Width"],c[_+"Style"],c[_+"Color"],_],!Ro(_,O,c)){let P=(g[0]||0)+(r&&!a&&c[_.replace("border","padding")]||0);P&&(d+=v("path",{width:n,height:o,...i,fill:"none",stroke:r?"#000":g[2],"stroke-width":P*2,"stroke-dasharray":!r&&g[1]==="dashed"?P*2+" "+P:void 0,d:it({left:e,top:t,width:n,height:o},c,p)})),p=[!1,!1,!1,!1]}}if(p.some(Boolean)){let b=(g[0]||0)+(r&&!a&&c[g[3].replace("border","padding")]||0);b&&(d+=v("path",{width:n,height:o,...i,fill:"none",stroke:r?"#000":g[2],"stroke-width":b*2,"stroke-dasharray":!r&&g[1]==="dashed"?b*2+" "+b:void 0,d:it({left:e,top:t,width:n,height:o},c,p)}))}return d}function sr({id:e,left:t,top:n,width:o,height:i,matrix:r,borderOnly:a},c){let s=(c.borderLeftWidth||0)+(a?0:c.paddingLeft||0),d=(c.borderTopWidth||0)+(a?0:c.paddingTop||0),f=(c.borderRightWidth||0)+(a?0:c.paddingRight||0),p=(c.borderBottomWidth||0)+(a?0:c.paddingBottom||0),g={x:t+s,y:n+d,width:o-s-f,height:i-d-p};return v("mask",{id:e},v("rect",{...g,fill:"#fff",transform:c.overflow==="hidden"&&c.transform&&r?r:void 0,mask:c._inheritedMaskId?`url(#${c._inheritedMaskId})`:void 0})+Qt({left:t,top:n,width:o,height:i,props:{transform:r||void 0},asContentMask:!0,maskBorderOnly:a},c))}import{getStylesForProperty as Io}from"css-to-react-native";var en={circle:/circle\((.+)\)/,ellipse:/ellipse\((.+)\)/,path:/path\((.+)\)/,polygon:/polygon\((.+)\)/,inset:/inset\((.+)\)/};function Ao({width:e,height:t},n,o){function i(d){let f=d.match(en.circle);if(!f)return null;let[,p]=f,[g,b=""]=p.split("at").map(_=>_.trim()),{x:S,y:x}=Co(b,e,t);return{type:"circle",r:H(g,o.fontSize,Math.sqrt(Math.pow(e,2)+Math.pow(t,2))/Math.sqrt(2),o,!0),cx:H(S,o.fontSize,e,o,!0),cy:H(x,o.fontSize,t,o,!0)}}function r(d){let f=d.match(en.ellipse);if(!f)return null;let[,p]=f,[g,b=""]=p.split("at").map(P=>P.trim()),[S,x]=g.split(" "),{x:_,y:O}=Co(b,e,t);return{type:"ellipse",rx:H(S||"50%",o.fontSize,e,o,!0),ry:H(x||"50%",o.fontSize,t,o,!0),cx:H(_,o.fontSize,e,o,!0),cy:H(O,o.fontSize,t,o,!0)}}function a(d){let f=d.match(en.path);if(!f)return null;let[p,g]=_o(f[1]);return{type:"path",d:g,"fill-rule":p}}function c(d){let f=d.match(en.polygon);if(!f)return null;let[p,g]=_o(f[1]);return{type:"polygon","fill-rule":p,points:g.split(",").map(b=>b.split(" ").map((S,x)=>H(S,o.fontSize,x===0?e:t,o,!0)).join(" ")).join(",")}}function s(d){let f=d.match(en.inset);if(!f)return null;let[p,g]=(f[1].includes("round")?f[1]:`${f[1].trim()} round 0`).split("round"),b=Io("borderRadius",g,!0),S=Object.values(b).map(E=>String(E)).map((E,k)=>H(E,o.fontSize,k===0||k===2?t:e,o,!0)||0),x=Object.values(Io("margin",p,!0)).map(E=>String(E)).map((E,k)=>H(E,o.fontSize,k===0||k===2?t:e,o,!0)||0),_=x[3],O=x[0],P=e-(x[1]+x[3]),M=t-(x[0]+x[2]);return S.some(E=>E>0)?{type:"path",d:it({left:_,top:O,width:P,height:M},{...n,...b})}:{type:"rect",x:_,y:O,width:P,height:M}}return{parseCircle:i,parseEllipse:r,parsePath:a,parsePolygon:c,parseInset:s}}function _o(e){let[,t="nonzero",n]=e.replace(/('|")/g,"").match(/^(nonzero|evenodd)?,?(.+)/)||[];return[t,n]}function Co(e,t,n){let o=e.split(" "),i={x:o[0]||"50%",y:o[1]||"50%"};return o.forEach(r=>{r==="top"?i.y=0:r==="bottom"?i.y=n:r==="left"?i.x=0:r==="right"?i.x=t:r==="center"&&(i.x=t/2,i.y=n/2)}),i}function _n(e){return`satori_cp-${e}`}function Mo(e){return`url(#${_n(e)})`}function Po(e,t,n){if(t.clipPath==="none")return"";let o=Ao(e,t,n),i=t.clipPath,r={type:""};for(let a of Object.keys(o))if(r=o[a](i),r)break;if(r){let{type:a,...c}=r;return v("clipPath",{id:_n(e.id),"clip-path":e.currentClipPath,transform:`translate(${e.left}, ${e.top})`},v(a,c))}return""}function ur({left:e,top:t,width:n,height:o,path:i,matrix:r,id:a,currentClipPath:c,src:s},d,f){let p="",g=d.clipPath&&d.clipPath!=="none"?Po({left:e,top:t,width:n,height:o,path:i,id:a,matrix:r,currentClipPath:c,src:s},d,f):"";if(d.overflow!=="hidden"&&!s)p="";else{let S=g?`satori_ocp-${a}`:_n(a);p=v("clipPath",{id:S,"clip-path":c},v(i?"path":"rect",{x:e,y:t,width:n,height:o,d:i||void 0,transform:d.overflow==="hidden"&&d.transform&&r?r:void 0}))}let b=sr({id:`satori_om-${a}`,left:e,top:t,width:n,height:o,matrix:r,borderOnly:!s},d);return g+p+b}var ya=e=>`satori_mi-${e}`;async function lr(e,t,n){if(!t.maskImage)return["",""];let{left:o,top:i,width:r,height:a,id:c}=e,s=t.maskImage,d=s.length;if(!d)return["",""];let f=ya(c),p="";for(let g=0;g<d;g++){let b=s[g],[S,x]=await Zt({id:`${f}-${g}`,left:o,top:i,width:r,height:a},b,n,"mask");p+=x+v("rect",{x:o,y:i,width:r,height:a,fill:`url(#${S})`})}return p=v("mask",{id:f},p),[f,p]}function xa(e,t,n){let o=e.toLowerCase().trim().split(/\s+/),i=(s,d)=>({left:"0%",center:"50%",right:"100%",top:"0%",bottom:"100%"})[s]||s,r,a;if(o.length===1){let s=o[0];s==="left"||s==="center"||s==="right"?(r=i(s,"x"),a="50%"):s==="top"||s==="bottom"?(r="50%",a=i(s,"y")):(r=s,a="50%")}else{let s=o[0],d=o[1];s==="top"||s==="bottom"?(a=i(s,"y"),d==="left"||d==="right"||d==="center"?r=i(d,"x"):(r="50%",a=s==="top"||s==="bottom"?i(s,"y"):d)):(r=i(s,"x"),a=i(d,"y"))}let c=(s,d)=>{try{if(s.endsWith("%"))return d*parseFloat(s)/100;let f=new He(s);return f.type==="length"||f.type==="number"?f.value:0}catch{return 0}};return[c(r,t),c(a,n)]}async function tn({id:e,left:t,top:n,width:o,height:i,isInheritingTransform:r,src:a,debug:c},s,d){if(s.display==="none")return"";let f=!!a,p="rect",g="",b="",S=[],x=1,_="";s.backgroundColor&&S.push(s.backgroundColor),s.opacity!==void 0&&(x=+s.opacity),s.transform&&(g=Kt({left:t,top:n,width:o,height:i},s.transform,r,s.transformOrigin));let O="";if(s.backgroundImage){let K=[];for(let z=0;z<s.backgroundImage.length;z++){let Ie=s.backgroundImage[z],De=await Zt({id:e+"_"+z,width:o,height:i,left:t,top:n},Ie,d);De&&K.unshift(De)}for(let z of K)S.push(`url(#${z[0]})`),b+=z[1],z[2]&&(O+=z[2])}let[P,M]=await lr({id:e,left:t,top:n,width:o,height:i},s,d);b+=M;let E=P?`url(#${P})`:s._inheritedMaskId?`url(#${s._inheritedMaskId})`:void 0,k=it({left:t,top:n,width:o,height:i},s);k&&(p="path");let $=s._inheritedClipPathId;c&&(_=v("rect",{x:t,y:n,width:o,height:i,fill:"transparent",stroke:"#ff5757","stroke-width":1,transform:g||void 0,"clip-path":$?`url(#${$})`:void 0}));let{backgroundClip:A,filter:L,mixBlendMode:W}=s,j=[L?`filter:${L}`:void 0,W?`mix-blend-mode:${W}`:void 0].filter(K=>K).join(";")||void 0,X=A==="text"?`url(#satori_bct-${e})`:$?`url(#${$})`:s.clipPath?Mo(e):void 0,he=ur({left:t,top:n,width:o,height:i,path:k,id:e,matrix:g,currentClipPath:X,src:a},s,d),oe=S.map(K=>v(p,{x:t,y:n,width:o,height:i,fill:K,d:k||void 0,transform:g||void 0,"clip-path":s.transform?void 0:X,style:j,mask:s.transform?void 0:E})).join(""),ce=ko({id:e,left:t,top:n,width:o,height:i,currentClipPathId:$,borderPath:k,borderType:p},s),ue;if(f){let K=(s.borderLeftWidth||0)+(s.paddingLeft||0),z=(s.borderTopWidth||0)+(s.paddingTop||0),Ie=(s.borderRightWidth||0)+(s.paddingRight||0),De=(s.borderBottomWidth||0)+(s.paddingBottom||0),le=o-K-Ie,Se=i-z-De,Ne=(s.objectPosition||"center").toString(),[B,ie]=xa(Ne,le,Se),Y=s.__naturalWidth||le,ae=s.__naturalHeight||Se,F,se=le,de=Se,Ee=t+K,Te=n+z;if(s.objectFit==="contain"){let te=le/Y,Re=Se/ae,ye=Math.min(te,Re);se=Y*ye,de=ae*ye,Ee=t+K+B-se*B/le,Te=n+z+ie-de*ie/Se,F="none"}else if(s.objectFit==="cover"){let te=le/Y,Re=Se/ae,ye=Math.max(te,Re);se=Y*ye,de=ae*ye,Ee=t+K+B-se*B/le,Te=n+z+ie-de*ie/Se,F="none"}else if(s.objectFit==="fill")F="none";else if(s.objectFit==="scale-down")if(Y&&ae){let te=le/Y,Re=Se/ae,ye=Math.min(te,Re);if(ye>=1)se=Y,de=ae,F="none",Ee=t+K+B-se*B/le,Te=n+z+ie-de*ie/Se;else{let Oe=ye;se=Y*Oe,de=ae*Oe,Ee=t+K+B-se*B/le,Te=n+z+ie-de*ie/Se,F="none"}}else{let te=le/Y,Re=Se/ae,ye=Math.min(te,Re);se=Y*ye,de=ae*ye,Ee=t+K+B-se*B/le,Te=n+z+ie-de*ie/Se,F="none"}else F="none";s.transform&&(ue=To({id:e,borderRadiusPath:k,borderType:p,left:t,top:n,width:o,height:i},s)),oe+=v("image",{x:Ee,y:Te,width:se,height:de,href:a,preserveAspectRatio:F,transform:g||void 0,style:j,"clip-path":s.transform?ue?`url(#${ue[1]})`:void 0:`url(#satori_cp-${e})`,mask:s.transform?void 0:P?`url(#${P})`:`url(#satori_om-${e})`})}if(ce){b+=ce[0];let K=ce[1];oe+=Qt({left:t,top:n,width:o,height:i,props:{transform:g||void 0,"clip-path":`url(#${K})`}},s)}let ke=po({width:o,height:i,id:e,opacity:x,shape:v(p,{x:t,y:n,width:o,height:i,fill:"#fff",stroke:"#fff","stroke-width":0,d:k||void 0,transform:g||void 0,"clip-path":X,mask:E})},s);return(b?v("defs",{},b):"")+(ke?ke[0]:"")+(ue?ue[0]:"")+he+(x!==1?`<g opacity="${x}">`:"")+(s.transform&&(X||E)?`<g${X?` clip-path="${X}"`:""}${E?` mask="${E}"`:""}>`:"")+(O||oe)+(s.transform&&(X||E)?"</g>":"")+(x!==1?"</g>":"")+(ke?ke[1]:"")+_}var Sa=e=>{let t="",n="SourceGraphic",o=!1,i=e.match(/blur\(([\d.]+)(?:px)?\)/);if(i){o=!0;let d=parseFloat(i[1]),f=Math.ceil(d*3);t+=v("feOffset",{dx:-f,dy:-f,in:"SourceGraphic",result:"satori_bfTL"}),t+=v("feOffset",{dx:f,dy:-f,in:"SourceGraphic",result:"satori_bfTR"}),t+=v("feOffset",{dx:-f,dy:f,in:"SourceGraphic",result:"satori_bfBL"}),t+=v("feOffset",{dx:f,dy:f,in:"SourceGraphic",result:"satori_bfBR"}),t+=v("feMerge",{result:"satori_bfext"},v("feMergeNode",{in:"satori_bfTL"})+v("feMergeNode",{in:"satori_bfTR"})+v("feMergeNode",{in:"satori_bfBL"})+v("feMergeNode",{in:"satori_bfBR"})+v("feMergeNode",{in:"SourceGraphic"})),n="satori_bfext";let p="satori_bfblur";t+=v("feGaussianBlur",{edgeMode:"duplicate",in:n,result:p,stdDeviation:d}),n=p}let r=e.match(/saturate\(([\d.]+)(%?)\)/);if(r){let d=r[2]==="%"?parseFloat(r[1])/100:parseFloat(r[1]),f="satori_bfsat";t+=v("feColorMatrix",{in:n,result:f,type:"saturate",values:d}),n=f}let a=e.match(/brightness\(([\d.]+)\)/);if(a){let d=parseFloat(a[1]),f="satori_bfbri";t+=v("feComponentTransfer",{in:n,result:f},v("feFuncR",{slope:d,type:"linear"})+v("feFuncG",{slope:d,type:"linear"})+v("feFuncB",{slope:d,type:"linear"})),n=f}let c=e.match(/contrast\(([\d.]+)\)/);if(c){let d=parseFloat(c[1]),f=-(.5*d)+.5,p="satori_bfcon";t+=v("feComponentTransfer",{in:n,result:p},v("feFuncR",{intercept:f,slope:d,type:"linear"})+v("feFuncG",{intercept:f,slope:d,type:"linear"})+v("feFuncB",{intercept:f,slope:d,type:"linear"})),n=p}let s=e.match(/grayscale\(([\d.]+)(%?)\)/);if(s){let d=s[2]==="%"?parseFloat(s[1])/100:parseFloat(s[1]),f="satori_bfgray";t+=v("feColorMatrix",{in:n,result:f,type:"saturate",values:1-Math.min(d,1)}),n=f}return o&&(t+=v("feComposite",{in:n,in2:"SourceGraphic",operator:"atop"})),t},Lo=e=>{let{bgGroupId:t,filterValue:n,height:o,id:i,left:r,maskId:a,style:c,top:s,width:d}=e,f=Sa(n);if(!f)return"";let p=`satori_bf-${i}`,g=`satori_bfc-${i}`,b=v("filter",{height:"200%",id:p,width:"200%",x:"-50%",y:"-50%"},f),S=it({height:o,left:r,top:s,width:d},c),x=S?v("path",{d:S}):v("rect",{height:o,width:d,x:r,y:s}),_=v("clipPath",{id:g},x),O=v("defs",{},b+_),P=v("use",{filter:`url(#${p})`,href:`#${t}`}),M={"clip-path":`url(#${g})`};return a&&(M.mask=`url(#${a})`),O+v("g",M,P)};var Wo=String.raw,No=Wo`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Oo=()=>new RegExp(Wo`\p{RI}{2}|(?)${No}(?:\u200D${No})*`,"gu");var wa=new RegExp(Oo(),"u"),fr={emoji:wa,symbol:new RegExp("\\p{Symbol}","u"),math:new RegExp("\\p{Math}","u")},cr={"ja-JP":new RegExp("\\p{scx=Hira}|\\p{scx=Kana}|\\p{scx=Han}|[\\u3000]|[\\uFF00-\\uFFEF]","u"),"ko-KR":new RegExp("\\p{scx=Hangul}","u"),"zh-CN":new RegExp("\\p{scx=Han}","u"),"zh-TW":new RegExp("\\p{scx=Han}","u"),"zh-HK":new RegExp("\\p{scx=Han}","u"),"th-TH":new RegExp("\\p{scx=Thai}","u"),"bn-IN":new RegExp("\\p{scx=Bengali}","u"),"ar-AR":new RegExp("\\p{scx=Arabic}","u"),"ta-IN":new RegExp("\\p{scx=Tamil}","u"),"ml-IN":new RegExp("\\p{scx=Malayalam}","u"),"he-IL":new RegExp("\\p{scx=Hebrew}","u"),"te-IN":new RegExp("\\p{scx=Telugu}","u"),devanagari:new RegExp("\\p{scx=Devanagari}","u"),kannada:new RegExp("\\p{scx=Kannada}","u")},Cn=Object.keys({...cr,...fr});function Bo(e){return Cn.includes(e)}function Fo(e,t){for(let o of Object.keys(fr))if(fr[o].test(e))return[o];let n=Object.keys(cr).filter(o=>cr[o].test(e));if(n.length===0)return["unknown"];if(t){let o=n.findIndex(i=>i===t);o!==-1&&(n.splice(o,1),n.unshift(t))}return n}function $o(e){if(e)return Cn.find(t=>t.toLowerCase().startsWith(e.toLowerCase()))}async function*nn(e,t){var Ne;let n=await mt(),{id:o,inheritedStyle:i,parent:r,font:a,debug:c,locale:s,embedFont:d=!0,graphemeImages:f,canLoadAdditionalAssets:p}=t;if(e===null||typeof e>"u")return yield,yield,"";if(!Ct(e)||kr(e.type)){let B;if(!Ct(e))B=ir(String(e),t),yield(await B.next()).value;else{if(Rr(e.type))throw new Error("Class component is not supported.");let Y;Wn(e.type)?Y=e.type.render:Y=e.type,B=nn(await Y(e.props),t),yield(await B.next()).value}await B.next();let ie=yield;return(await B.next(ie)).value}let{type:g,props:b}=e,S=g;if(b&&Ir(b))throw new Error("dangerouslySetInnerHTML property is not supported. See documentation for more information https://github.com/vercel/satori#jsx.");let{style:x,children:_,lang:O=s}=b||{},P=$o(O),M=n.Node.create();r.insertChild(M,r.getChildCount());let[E,k]=await Qn(M,S,i,x,b),$=E.transform===i.transform;if($||(E.transform.__parent=i.transform),(E.overflow==="hidden"||E.clipPath&&E.clipPath!=="none")&&(k._inheritedClipPathId=`satori_cp-${o}`,k._inheritedMaskId=`satori_om-${o}`),E.maskImage&&(k._inheritedMaskId=`satori_mi-${o}`),E.backdropFilter&&t.onBackdropFilterDetected&&t.onBackdropFilterDetected({filter:E.backdropFilter,inheritedStyle:k,node:M,style:E}),E.backgroundClip==="text"){let B={value:""};k._inheritedBackgroundClipTextPath=B,E._inheritedBackgroundClipTextPath=B,E.backgroundImage&&(k._inheritedBackgroundClipTextHasBackground="true",E._inheritedBackgroundClipTextHasBackground="true")}let A=_r(_),L=[],W={},j=0,X=[];for(let B of A){let ie=j,Y=nn(B,{id:o+"-"+j++,parentStyle:E,inheritedStyle:k,isInheritingTransform:!0,parent:M,font:a,embedFont:d,debug:c,graphemeImages:f,canLoadAdditionalAssets:p,locale:P,onNodeDetected:t.onNodeDetected,onBackdropFilterDetected:ae=>{W[ie]=ae}});p?X.push(...(await Y.next()).value||[]):await Y.next(),L.push(Y)}yield X;for(let B of L)await B.next();let[he,oe]=yield,{left:ce,top:ue,width:ke,height:K}=M.getComputedLayout();ce+=he,ue+=oe;let z="",Ie="",De="",{children:le,...Se}=b;if((Ne=t.onNodeDetected)==null||Ne.call(t,{left:ce,top:ue,width:ke,height:K,type:S,props:Se,key:e.key,textContent:Ct(le)?void 0:le}),S==="img"){let B=E.__src;Ie=await tn({id:o,left:ce,top:ue,width:ke,height:K,src:B,isInheritingTransform:$,debug:c},E,k)}else if(S==="svg"){let B=E.color,ie=await Zr(e,B);Ie=await tn({id:o,left:ce,top:ue,width:ke,height:K,src:ie,isInheritingTransform:$,debug:c},E,k)}else{let B=x==null?void 0:x.display;if(S==="div"&&_&&typeof _!="string"&&B!=="flex"&&B!=="none"&&B!=="contents")throw new Error('Expected <div> to have explicit "display: flex", "display: contents", or "display: none" if it has more than one child node.');Ie=await tn({id:o,left:ce,top:ue,width:ke,height:K,isInheritingTransform:$,debug:c},E,k)}for(let B=0;B<L.length;B++){if(W[B]){let ie=W[B],Y=ie.node.getComputedLayout(),ae=ce+Y.left,F=ue+Y.top,se=Y.width,de=Y.height,Ee=`satori_bfbg-${o}-${B}`,Te=Ie+z;Ie=`<g id="${Ee}">${Te}</g>`,z="";let te=o+"-"+B,Re=ie.style.maskImage?`satori_mi-${te}`:void 0;z+=Lo({bgGroupId:Ee,filterValue:ie.filter,height:de,id:te,left:ae,maskId:Re,style:ie.style,top:F,width:se})}z+=(await L[B].next([ce,ue])).value}return E._inheritedBackgroundClipTextPath&&(De+=v("clipPath",{id:`satori_bct-${o}`,"clip-path":E._inheritedClipPathId?`url(#${E._inheritedClipPathId})`:void 0},E._inheritedBackgroundClipTextPath.value)),De+Ie+z}import rn from"@shuding/opentype.js";var Go="unknown";function va(e){let t=[],n=[0,0],o=[0,0],i=(r,a)=>{let c=r[0];for(let s=1;s<=a;s++){let d=s/a,f=Ea(r,d);t.push({from:c,to:f}),c=f}o=r[r.length-1]};for(let r of e){if(r.type==="M"){n=o=[r.x,r.y];continue}if(r.type==="L"){let a=[r.x,r.y];t.push({from:o,to:a}),o=a;continue}if(r.type==="Q"){i([o,[r.x1,r.y1],[r.x,r.y]],12);continue}if(r.type==="C"){i([o,[r.x1,r.y1],[r.x2,r.y2],[r.x,r.y]],16);continue}r.type==="Z"&&(t.push({from:o,to:n}),o=n)}return t}function Ea(e,t){let n=e;for(;n.length>1;){let o=[];for(let i=0;i<n.length-1;i++)o.push([n[i][0]+(n[i+1][0]-n[i][0])*t,n[i][1]+(n[i+1][1]-n[i][1])*t]);n=o}return n[0]}function Ta(e,t){if(!t)return[];let n=t.strokeWidth,o=t.underlineY-n*.25,i=t.underlineY+n*2.5,r=va(e);if(!r.length)return[];let a=i-o,c=Math.max(12,Math.ceil(a/.25)),s=a/c,d=o+s/2,f=new Set;for(let M=0;M<c;M++){let E=d+s*M,k=[];for(let $ of r){let[A,L]=$.from,[W,j]=$.to;if(L===j)continue;let X=Math.min(L,j),he=Math.max(L,j);if(E<X||E>=he)continue;let oe=(E-L)/(j-L),ce=A+(W-A)*oe;k.push(ce)}if(k.length){k.sort(($,A)=>$-A);for(let $=0;$<k.length-1;$+=2){let A=Math.min(k[$],k[$+1]),L=Math.max(k[$],k[$+1]),W=Math.floor(A),j=Math.ceil(L);for(let X=W;X<j;X++)f.add(X)}}}if(!f.size)return[];let p=Array.from(f.values()).sort((M,E)=>M-E),g=[],b=p[0],S=p[0];for(let M=1;M<p.length;M++){let E=p[M];E>S+1&&(g.push([b,S+1]),b=E),S=E}g.push([b,S+1]);let x=[],_=n*.6,O=g[0][0],P=g[g.length-1][1];for(let[M,E]of g){let k=Math.min(M,O)-_,$=Math.max(E,P)+_;x.push({x1:k,x2:$,y1:o,y2:i})}return x}function Ra(e,t,[n,o],[i,r]){if(n!==i)return n?!i||n===e?-1:i===e?1:e===400&&n===500||e===500&&n===400?-1:e===400&&i===500||e===500&&i===400?1:e<400?n<e&&i<e?i-n:n<e?-1:i<e?1:n-i:e<n&&e<i?n-i:e<n?-1:e<i?1:i-n:1;if(o!==r){if(o===t)return-1;if(r===t)return 1}return-1}var dr=new WeakMap,on=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),typeof n=="string"&&(n=Number.parseInt(n,10));let i=[...this.fonts.get(t)],r=i[0];for(let a=1;a<i.length;a++){let[,c,s]=r,[,d,f]=i[a];Ra(n,o,[c,s],[d,f])>0&&(r=i[a])}return{font:r[0],weight:r[1]}}addFonts(t){for(let n of t){let{name:o,data:i,lang:r}=n;if(r&&!Bo(r))throw new Error(`Invalid value for props \`lang\`: "${r}". The value must be one of the following: ${Cn.join(", ")}.`);let a=r??Go,c;if(dr.has(i))c=dr.get(i);else{c=rn.parse("buffer"in i?i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength):i,{lowMemory:!0});let d=c.charToGlyphIndex;c.charToGlyphIndex=f=>{let p=d.call(c,f);return p===0&&c._trackBrokenChars&&c._trackBrokenChars.push(f),p},dr.set(i,c)}this.defaultFont||(this.defaultFont=c);let s=`${o.toLowerCase()}_${a}`;this.fonts.has(s)||this.fonts.set(s,[]),this.fonts.get(s).push([c,n.weight,n.style])}}getEngine(t=16,n="normal",{fontFamily:o="sans-serif",fontWeight:i=400,fontStyle:r="normal"},a){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(A=>A.toLowerCase());let c=[],s;o.forEach(A=>{let L=this.get({name:A,weight:i,style:r});if(L){c.push(L.font),c.length===1&&(s=L.weight);return}let W=this.get({name:A+"_unknown",weight:i,style:r});if(W){c.push(W.font),c.length===1&&(s=W.weight);return}});let d=Array.from(this.fonts.keys()),f=[],p=[],g=[],b=(A,L)=>{L&&(A.push(L.font),s===void 0&&(s=L.weight))};for(let A of d)if(!o.includes(A))if(a){let L=ka(A);L?L===a?b(f,this.get({name:A,weight:i,style:r})):b(p,this.get({name:A,weight:i,style:r})):b(g,this.get({name:A,weight:i,style:r}))}else b(g,this.get({name:A,weight:i,style:r}));let S=new Map,x=(A,L=!0)=>{let W=[...c,...g,...f,...L?p:[]];if(typeof A>"u")return L?W[W.length-1]:void 0;let j=A.charCodeAt(0);if(S.has(j))return S.get(j);let X=W.find((he,oe)=>!!he.charToGlyphIndex(A)||L&&oe===W.length-1);return X&&S.set(j,X),X},_=(A,L=!1)=>{var j,X;return((L?(X=(j=A.tables)==null?void 0:j.os2)==null?void 0:X.sTypoAscender:0)||A.ascender)/A.unitsPerEm*t},O=(A,L=!1)=>{var j,X;return((L?(X=(j=A.tables)==null?void 0:j.os2)==null?void 0:X.sTypoDescender:0)||A.descender)/A.unitsPerEm*t},P=(A,L=!1)=>{var W,j;if(typeof n=="string"&&n==="normal"){let X=(L?(j=(W=A.tables)==null?void 0:W.os2)==null?void 0:j.sTypoLineGap:0)||0;return _(A,L)-O(A,L)+X/A.unitsPerEm*t}else if(typeof n=="number")return t*n},M=A=>x(A,!1),E,k=i==="bold"?700:i==="normal"?400:Number(i);if(k>=600&&(!s||s<600)){let A=k-(s||400);E=t*.06*(A/300)}return{fauxBoldStrokeWidth:E,has:A=>{if(A===`
|
|
4
|
+
in CSS rule \`${p}: ${b}\`.${oo(p)}`))}}}if(n.backgroundImage){let{backgrounds:s}=Wi(n);n.backgroundImage=s}(n.maskImage||n.WebkitMaskImage)&&(n.maskImage=eo(n));let c=Ui(n.fontSize,t.fontSize);typeof n.fontSize<"u"&&(n.fontSize=c),n.transformOrigin&&(n.transformOrigin=Zn(n.transformOrigin,c));for(let s in n){let d=n[s];if(s==="lineHeight")typeof d=="string"&&d!=="normal"&&(d=n[s]=H(d,c,c,t,!0)/c);else{if(typeof d=="string"){let f=H(d,c,c,t);typeof f<"u"&&(n[s]=f),d=n[s]}if(typeof d=="string"||typeof d=="object"){let f=so(d);f&&(n[s]=f),d=n[s]}}if(s==="opacity"&&typeof d=="number"&&(n.opacity=d*t.opacity),s==="transform"){let f=d;for(let p of f){let g=Object.keys(p)[0],b=p[g],S=typeof b=="string"?H(b,c,c,t)??b:b;p[g]=S}}if(s==="textShadowRadius"){let f=d;n.textShadowRadius=f.map(p=>H(p,c,0,t,!1))}if(s==="textShadowOffset"){let f=d;n.textShadowOffset=f.map(({height:p,width:g})=>({height:H(p,c,0,t,!1),width:H(g,c,0,t,!1)}))}}return n}function Ui(e,t){if(typeof e=="number")return e;try{let n=new He(e);switch(n.unit){case"em":return n.value*t;case"rem":return n.value*16}}catch{return t}}function ao(e){if(e.startsWith("hsl")){let t=Bi(e),[n,o,i]=t.values;return`hsl(${[n,`${o}%`,`${i}%`].concat(t.alpha===1?[]:[t.alpha]).join(",")})`}return e}function ji(e,t){return e&&e.toLowerCase()!=="currentcolor"?ao(e):ao(t)}function zi(e,t){return e.replace(/currentcolor/gi,t)}function Vi(e,t){return dn(e)&&(e=zi(e,t)),e}async function Qn(e,t,n,o,i){let r=await mt(),a=Object.assign({},n,Sn(Qr[t],n),Sn(o,n));if(t==="img"){let[c,s,d]=await Nt(i.src);if(s===void 0&&d===void 0){if(i.width===void 0||i.height===void 0)throw new Error("Image size cannot be determined. Please provide the width and height of the image.");s=parseInt(i.width),d=parseInt(i.height)}let f=d/s,p=(a.borderLeftWidth||0)+(a.borderRightWidth||0)+(a.paddingLeft||0)+(a.paddingRight||0),g=(a.borderTopWidth||0)+(a.borderBottomWidth||0)+(a.paddingTop||0)+(a.paddingBottom||0),b=a.width||i.width,S=a.height||i.height,x=typeof b=="number"&&typeof S=="number";x&&(b-=p,S-=g),b===void 0&&S===void 0?(b="100%",e.setAspectRatio(1/f)):b===void 0?typeof S=="number"?b=S/f:e.setAspectRatio(1/f):S===void 0&&(typeof b=="number"?S=b*f:e.setAspectRatio(1/f)),a.width=x?b+p:b,a.height=x?S+g:S,a.__src=c,a.__naturalWidth=s,a.__naturalHeight=d}if(t==="svg"){let c=i.viewBox||i.viewbox,s=At(c),d=s?s[3]/s[2]:null,{width:f,height:p}=i;typeof f>"u"&&p?d==null?f=0:typeof p=="string"&&p.endsWith("%")?f=parseInt(p)/d+"%":(p=H(p,n.fontSize,1,n),f=p/d):typeof p>"u"&&f?d==null?f=0:typeof f=="string"&&f.endsWith("%")?p=parseInt(f)*d+"%":(f=H(f,n.fontSize,1,n),p=f*d):(typeof f<"u"&&(f=H(f,n.fontSize,1,n)||f),typeof p<"u"&&(p=H(p,n.fontSize,1,n)||p),f||=s==null?void 0:s[2],p||=s==null?void 0:s[3]),!a.width&&f&&(a.width=f),!a.height&&p&&(a.height=p)}return e.setDisplay(Le(a.display,{flex:r.DISPLAY_FLEX,block:r.DISPLAY_FLEX,contents:r.DISPLAY_CONTENTS,none:r.DISPLAY_NONE,"-webkit-box":r.DISPLAY_FLEX},r.DISPLAY_FLEX,"display")),e.setAlignContent(Le(a.alignContent,{stretch:r.ALIGN_STRETCH,center:r.ALIGN_CENTER,"flex-start":r.ALIGN_FLEX_START,"flex-end":r.ALIGN_FLEX_END,"space-between":r.ALIGN_SPACE_BETWEEN,"space-around":r.ALIGN_SPACE_AROUND,baseline:r.ALIGN_BASELINE,normal:r.ALIGN_AUTO},r.ALIGN_AUTO,"alignContent")),e.setAlignItems(Le(a.alignItems,{stretch:r.ALIGN_STRETCH,center:r.ALIGN_CENTER,"flex-start":r.ALIGN_FLEX_START,"flex-end":r.ALIGN_FLEX_END,baseline:r.ALIGN_BASELINE,normal:r.ALIGN_AUTO},r.ALIGN_STRETCH,"alignItems")),e.setAlignSelf(Le(a.alignSelf,{stretch:r.ALIGN_STRETCH,center:r.ALIGN_CENTER,"flex-start":r.ALIGN_FLEX_START,"flex-end":r.ALIGN_FLEX_END,baseline:r.ALIGN_BASELINE,normal:r.ALIGN_AUTO},r.ALIGN_AUTO,"alignSelf")),e.setJustifyContent(Le(a.justifyContent,{center:r.JUSTIFY_CENTER,"flex-start":r.JUSTIFY_FLEX_START,"flex-end":r.JUSTIFY_FLEX_END,"space-between":r.JUSTIFY_SPACE_BETWEEN,"space-around":r.JUSTIFY_SPACE_AROUND},r.JUSTIFY_FLEX_START,"justifyContent")),e.setFlexDirection(Le(a.flexDirection,{row:r.FLEX_DIRECTION_ROW,column:r.FLEX_DIRECTION_COLUMN,"row-reverse":r.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":r.FLEX_DIRECTION_COLUMN_REVERSE},r.FLEX_DIRECTION_ROW,"flexDirection")),e.setFlexWrap(Le(a.flexWrap,{wrap:r.WRAP_WRAP,nowrap:r.WRAP_NO_WRAP,"wrap-reverse":r.WRAP_WRAP_REVERSE},r.WRAP_NO_WRAP,"flexWrap")),typeof a.gap<"u"&&e.setGap(r.GUTTER_ALL,a.gap),typeof a.rowGap<"u"&&e.setGap(r.GUTTER_ROW,a.rowGap),typeof a.columnGap<"u"&&e.setGap(r.GUTTER_COLUMN,a.columnGap),typeof a.flexBasis<"u"&&e.setFlexBasis(pt(a.flexBasis,"flexBasis")),e.setFlexGrow(typeof a.flexGrow>"u"?0:a.flexGrow),e.setFlexShrink(typeof a.flexShrink>"u"?0:a.flexShrink),typeof a.maxHeight<"u"&&e.setMaxHeight(lt(a.maxHeight,"maxHeight")),typeof a.maxWidth<"u"&&e.setMaxWidth(lt(a.maxWidth,"maxWidth")),typeof a.minHeight<"u"&&e.setMinHeight(lt(a.minHeight,"minHeight")),typeof a.minWidth<"u"&&e.setMinWidth(lt(a.minWidth,"minWidth")),e.setOverflow(Le(a.overflow,{visible:r.OVERFLOW_VISIBLE,hidden:r.OVERFLOW_HIDDEN},r.OVERFLOW_VISIBLE,"overflow")),e.setMargin(r.EDGE_TOP,pt(a.marginTop||0)),e.setMargin(r.EDGE_BOTTOM,pt(a.marginBottom||0)),e.setMargin(r.EDGE_LEFT,pt(a.marginLeft||0)),e.setMargin(r.EDGE_RIGHT,pt(a.marginRight||0)),e.setBorder(r.EDGE_TOP,a.borderTopWidth||0),e.setBorder(r.EDGE_BOTTOM,a.borderBottomWidth||0),e.setBorder(r.EDGE_LEFT,a.borderLeftWidth||0),e.setBorder(r.EDGE_RIGHT,a.borderRightWidth||0),e.setPadding(r.EDGE_TOP,a.paddingTop||0),e.setPadding(r.EDGE_BOTTOM,a.paddingBottom||0),e.setPadding(r.EDGE_LEFT,a.paddingLeft||0),e.setPadding(r.EDGE_RIGHT,a.paddingRight||0),e.setBoxSizing(Le(a.boxSizing,{"border-box":r.BOX_SIZING_BORDER_BOX,"content-box":r.BOX_SIZING_CONTENT_BOX},r.BOX_SIZING_BORDER_BOX,"boxSizing")),e.setPositionType(Le(a.position,{absolute:r.POSITION_TYPE_ABSOLUTE,relative:r.POSITION_TYPE_RELATIVE,static:r.POSITION_TYPE_STATIC},r.POSITION_TYPE_RELATIVE,"position")),typeof a.top<"u"&&e.setPosition(r.EDGE_TOP,lt(a.top,"top")),typeof a.bottom<"u"&&e.setPosition(r.EDGE_BOTTOM,lt(a.bottom,"bottom")),typeof a.left<"u"&&e.setPosition(r.EDGE_LEFT,lt(a.left,"left")),typeof a.right<"u"&&e.setPosition(r.EDGE_RIGHT,lt(a.right,"right")),typeof a.height<"u"?e.setHeight(pt(a.height,"height")):e.setHeightAuto(),typeof a.width<"u"?e.setWidth(pt(a.width,"width")):e.setWidthAuto(),[a,Kn(a)]}import lo from"escape-html";var uo=[1,0,0,1,0,0];function Hi(e,t,n){let o=[...uo];for(let i of e){let r=Object.keys(i)[0],a=i[r];if(typeof a=="string")if(r==="translateX")a=parseFloat(a)/100*t,i[r]=a;else if(r==="translateY")a=parseFloat(a)/100*n,i[r]=a;else throw new Error(`Invalid transform: "${r}: ${a}".`);let c=a,s=[...uo];switch(r){case"translateX":s[4]=c;break;case"translateY":s[5]=c;break;case"scale":s[0]=c,s[3]=c;break;case"scaleX":s[0]=c;break;case"scaleY":s[3]=c;break;case"rotate":{let d=c*Math.PI/180,f=Math.cos(d),p=Math.sin(d);s[0]=f,s[1]=p,s[2]=-p,s[3]=f;break}case"skewX":s[2]=Math.tan(c*Math.PI/180);break;case"skewY":s[1]=Math.tan(c*Math.PI/180);break}o=zt(s,o)}e.splice(0,e.length),e.push(...o),e.__resolved=!0}function Kt({left:e,top:t,width:n,height:o},i,r,a){let c;i.__resolved||Hi(i,n,o);let s=i;if(r)c=s;else{let d=(a==null?void 0:a.xAbsolute)??((a==null?void 0:a.xRelative)??50)*n/100,f=(a==null?void 0:a.yAbsolute)??((a==null?void 0:a.yRelative)??50)*o/100,p=e+d,g=t+f;c=zt([1,0,0,1,p,g],zt(s,[1,0,0,1,-p,-g])),s.__parent&&(c=zt(s.__parent,c)),s.splice(0,6,...c)}return`matrix(${c.map(d=>d.toFixed(2)).join(",")})`}function fo({left:e,top:t,width:n,height:o,isInheritingTransform:i},r){let a="",c=1;return r.transform&&(a=Kt({left:e,top:t,width:n,height:o},r.transform,i,r.transformOrigin)),r.opacity!==void 0&&(c=+r.opacity),{matrix:a,opacity:c}}function er({id:e,content:t,filter:n,left:o,top:i,width:r,height:a,matrix:c,opacity:s,image:d,clipPathId:f,debug:p,fauxBoldStrokeWidth:g,shape:b,decorationShape:S},x){let _="";if(p&&(_=v("rect",{x:o,y:i-a,width:r,height:a,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:c||void 0,"clip-path":f?`url(#${f})`:void 0})),d){let E={href:d,x:o,y:i,width:r,height:a,transform:c||void 0,"clip-path":f?`url(#${f})`:void 0,style:x.filter?`filter:${x.filter}`:void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+v("image",{...E,opacity:s!==1?s:void 0})+(S||"")+(n?"</g>":"")+_,""]}let O=!!x.WebkitTextStrokeWidth,P=!O&&g!==void 0,M={x:o,y:i,width:r,height:a,"font-weight":x.fontWeight,"font-style":x.fontStyle,"font-size":x.fontSize,"font-family":x.fontFamily,"letter-spacing":x.letterSpacing||void 0,transform:c||void 0,"clip-path":f?`url(#${f})`:void 0,style:x.filter?`filter:${x.filter}`:void 0,"stroke-width":O?`${x.WebkitTextStrokeWidth}px`:P?`${g}`:void 0,stroke:O?x.WebkitTextStrokeColor:P?x.color:void 0,"stroke-linejoin":O?"round":P?"miter":void 0,"paint-order":O||P?"stroke":void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+v("text",{...M,fill:x.color,opacity:s!==1?s:void 0},lo(t))+(S||"")+(n?"</g>":"")+_,b?v("text",M,lo(t)):""]}function Xi(e,t,n){return e.replace(/([MA])([0-9.-]+),([0-9.-]+)/g,function(o,i,r,a){return i+(parseFloat(r)+t)+","+(parseFloat(a)+n)})}var wn=1.1;function co({id:e,width:t,height:n},o,i=!1){if(!o.shadowColor||!o.shadowOffset||typeof o.shadowRadius>"u")return"";let r=o.shadowColor.length,a="",c="",s=0,d=t,f=0,p=n;for(let g=0;g<r;g++){let b=o.shadowRadius[g]*o.shadowRadius[g]/4;if(s=Math.min(o.shadowOffset[g].width-b,s),d=Math.max(o.shadowOffset[g].width+b+t,d),f=Math.min(o.shadowOffset[g].height-b,f),p=Math.max(o.shadowOffset[g].height+b+n,p),i){let S=`satori_s-${e}-result-${g}`;a+=v("feGaussianBlur",{in:"SourceAlpha",stdDeviation:o.shadowRadius[g]/2,result:`${S}-blur`})+v("feOffset",{in:`${S}-blur`,dx:o.shadowOffset[g].width,dy:o.shadowOffset[g].height,result:`${S}-offset`})+v("feFlood",{"flood-color":o.shadowColor[g],"flood-opacity":1,result:`${S}-color`})+v("feComposite",{in:`${S}-color`,in2:`${S}-offset`,operator:"in",result:r>1?S:void 0})}else a+=v("feDropShadow",{dx:o.shadowOffset[g].width,dy:o.shadowOffset[g].height,stdDeviation:o.shadowRadius[g]/2,"flood-color":o.shadowColor[g],"flood-opacity":1,...r>1?{in:"SourceGraphic",result:`satori_s-${e}-result-${g}`}:{}});r>1&&(c=v("feMergeNode",{in:`satori_s-${e}-result-${g}`})+c)}return v("filter",{id:`satori_s-${e}`,x:(s/t*100*wn).toFixed(2)+"%",y:(f/n*100*wn).toFixed(2)+"%",width:((d-s)/t*100*wn).toFixed(2)+"%",height:((p-f)/n*100*wn).toFixed(2)+"%"},a+(c?v("feMerge",{},c):""))}function po({width:e,height:t,shape:n,opacity:o,id:i},r){if(!r.boxShadow)return null;let a="",c="";for(let s=r.boxShadow.length-1;s>=0;s--){let d="",f=r.boxShadow[s];f.spreadRadius&&f.inset&&(f.spreadRadius=-f.spreadRadius);let p=f.blurRadius*f.blurRadius/4+(f.spreadRadius||0),g=Math.min(-p-(f.inset?f.offsetX:0),0),b=Math.max(p+e-(f.inset?f.offsetX:0),e),S=Math.min(-p-(f.inset?f.offsetY:0),0),x=Math.max(p+t-(f.inset?f.offsetY:0),t),_=`satori_s-${i}-${s}`,O=`satori_ms-${i}-${s}`,P=f.spreadRadius?n.replace('stroke-width="0"',`stroke-width="${f.spreadRadius*2}"`):n;d+=v("mask",{id:O,maskUnits:"userSpaceOnUse"},v("rect",{x:0,y:0,width:r._viewportWidth||"100%",height:r._viewportHeight||"100%",fill:f.inset?"#000":"#fff"})+P.replace('fill="#fff"',f.inset?'fill="#fff"':'fill="#000"').replace('stroke="#fff"',""));let M=P.replace(/d="([^"]+)"/,(E,k)=>'d="'+Xi(k,f.offsetX,f.offsetY)+'"').replace(/x="([^"]+)"/,(E,k)=>'x="'+(parseFloat(k)+f.offsetX)+'"').replace(/y="([^"]+)"/,(E,k)=>'y="'+(parseFloat(k)+f.offsetY)+'"');f.spreadRadius&&f.spreadRadius<0&&(d+=v("mask",{id:O+"-neg",maskUnits:"userSpaceOnUse"},M.replace('stroke="#fff"','stroke="#000"').replace(/stroke-width="[^"]+"/,`stroke-width="${-f.spreadRadius*2}"`))),f.spreadRadius&&f.spreadRadius<0&&(M=v("g",{mask:`url(#${O}-neg)`},M)),d+=v("defs",{},v("filter",{id:_,x:`${g/e*100}%`,y:`${S/t*100}%`,width:`${(b-g)/e*100}%`,height:`${(x-S)/t*100}%`},v("feGaussianBlur",{stdDeviation:f.blurRadius/2,result:"b"})+v("feFlood",{"flood-color":f.color,in:"SourceGraphic",result:"f"})+v("feComposite",{in:"f",in2:"b",operator:f.inset?"out":"in"})))+v("g",{mask:`url(#${O})`,filter:`url(#${_})`,opacity:o},M),f.inset?c+=d:a+=d}return[a,c]}function Yi(e,t,n,o,i,r){let a=i/2,c=Math.max(a,i*1.25),s=[];for(let p of n){if(p.y2<r+a||p.y1>o+a)continue;let g=Math.max(e,p.x1-c),b=Math.min(t,p.x2+c);if(g>=b)continue;if(s.length===0){s.push([g,b]);continue}let S=s[s.length-1];g<=S[1]?S[1]=Math.max(S[1],b):s.push([g,b])}if(!s.length)return[[e,t]];let d=[],f=e;for(let[p,g]of s)if(p>f&&d.push([f,p]),f=Math.max(f,g),f>=t)break;return f<t&&d.push([f,t]),d}function tr({width:e,left:t,top:n,ascender:o,clipPathId:i,matrix:r,glyphBoxes:a},c){let{textDecorationColor:s,textDecorationStyle:d,textDecorationLine:f,textDecorationSkipInk:p,fontSize:g,color:b}=c;if(!f||f==="none")return"";let S=Math.max(1,g*.1),x=f==="line-through"?n+o*.7:f==="underline"?n+o*1.1:n,_=d==="dashed"?`${S*1.2} ${S*2}`:d==="dotted"?`0 ${S*2}`:void 0,O=f==="underline"&&(p||"auto")!=="none"&&(a==null?void 0:a.length),P=n+o,M=O?Yi(t,t+e,a,x,S,P):[[t,t+e]],E=d==="double"?M.map(([k,$])=>v("line",{x1:k,y1:x+S+1,x2:$,y2:x+S+1,stroke:s||b,"stroke-width":S,"stroke-dasharray":_,"stroke-linecap":d==="dotted"?"round":"square",transform:r})).join(""):"";return(i?`<g clip-path="url(#${i})">`:"")+M.map(([k,$])=>v("line",{x1:k,y1:x,x2:$,y2:x,stroke:s||b,"stroke-width":S,"stroke-dasharray":_,"stroke-linecap":d==="dotted"?"round":"square",transform:r})).join("")+E+(i?"</g>":"")}function nr(e){return e=e.replace("U+","0x"),String.fromCodePoint(Number(e))}var Et=nr("U+0020"),rr=nr("U+0009"),Wt=nr("U+2026");function mo(e,t,n){let{fontSize:o,letterSpacing:i}=n,r=new Map;function a(d){let f=r.get(d);return f===void 0&&(f=e.measure(d,{fontSize:o,letterSpacing:i}),r.set(d,f)),f}function c(d){let f=0;for(let p of d)t(p)?f+=o:f+=a(p);return f}function s(d){return c(Pe(d,"grapheme"))}return{measureGrapheme:a,measureGraphemeArray:c,measureText:s}}function ho(e,t,n){let{textTransform:o,whiteSpace:i,wordBreak:r}=t;e=qi(e,o,n);let{content:a,shouldCollapseTabsAndSpaces:c,allowSoftWrap:s}=Zi(e,i),{words:d,requiredBreaks:f,allowBreakWord:p}=Ji(a,r),[g,b]=Ki(t,s);return{words:d,requiredBreaks:f,allowSoftWrap:s,allowBreakWord:p,processedContent:a,shouldCollapseTabsAndSpaces:c,lineLimit:g,blockEllipsis:b}}function qi(e,t,n){return t==="uppercase"?e=e.toLocaleUpperCase(n):t==="lowercase"?e=e.toLocaleLowerCase(n):t==="capitalize"&&(e=Pe(e,"word",n).map(o=>Pe(o,"grapheme",n).map((i,r)=>r===0?i.toLocaleUpperCase(n):i).join("")).join("")),e}function Ki(e,t){let{textOverflow:n,lineClamp:o,WebkitLineClamp:i,WebkitBoxOrient:r,overflow:a,display:c}=e;if(c==="block"&&o){let[s,d=Wt]=Qi(o);if(s)return[s,d]}return n==="ellipsis"&&c==="-webkit-box"&&r==="vertical"&&Mr(i)&&i>0?[i,Wt]:n==="ellipsis"&&a==="hidden"&&!t?[1,Wt]:[1/0]}function Ji(e,t){let n=["break-all","break-word"].includes(t),{words:o,requiredBreaks:i}=Lr(e,t);return{words:o,requiredBreaks:i,allowBreakWord:n}}function Zi(e,t){let n=["pre","pre-wrap","pre-line"].includes(t),o=["normal","nowrap","pre-line"].includes(t),i=!["pre","nowrap"].includes(t);return n||(e=e.replace(/\n/g,Et)),o&&(e=e.replace(/([ ]|\t)+/g,Et).replace(/^[ ]|[ ]$/g,"")),{content:e,shouldCollapseTabsAndSpaces:o,allowSoftWrap:i}}function Qi(e){if(typeof e=="number")return[e];let t=/^(\d+)\s*"(.*)"$/,n=/^(\d+)\s*'(.*)'$/,o=t.exec(e),i=n.exec(e);if(o){let r=+o[1],a=o[2];return[r,a]}else if(i){let r=+i[1],a=i[2];return[r,a]}return[]}import bo from"parse-css-color";var ea=new Set([rr]);function ta(e){return ea.has(e)}function or(e){if(e==="transparent")return!0;let t=bo(e);return t?t.alpha===0:!1}function go(e){if(!e)return!1;let t=bo(e);if(!t)return!1;let[n,o,i,r]=t.values;return n===255&&o===255&&i===255&&(r===void 0||r===1)}async function*ir(e,t){let n=await mt(),{parentStyle:o,inheritedStyle:i,parent:r,font:a,id:c,isInheritingTransform:s,debug:d,embedFont:f,graphemeImages:p,locale:g,canLoadAdditionalAssets:b}=t,{textAlign:S,textIndent:x=0,lineHeight:_,textWrap:O,fontSize:P,filter:M,tabSize:E=8,letterSpacing:k,_inheritedBackgroundClipTextPath:$,_inheritedBackgroundClipTextHasBackground:A,flexShrink:L}=o,{words:W,requiredBreaks:j,allowSoftWrap:X,allowBreakWord:he,processedContent:oe,shouldCollapseTabsAndSpaces:ce,lineLimit:ue,blockEllipsis:ke}=ho(e,o,g),K=na(n,S);r.insertChild(K,r.getChildCount()),Pr(L)&&r.setFlexShrink(1);let z=a.getEngine(P,_,o,g),Ie=b?Pe(oe,"grapheme").filter(U=>!ta(U)&&!z.has(U)):[];yield Ie.map(U=>({word:U,locale:g})),Ie.length&&(z=a.getEngine(P,_,o,g));function De(U){return!!(p&&p[U])}let{measureGrapheme:le,measureGraphemeArray:Se,measureText:Ne}=mo(z,De,{fontSize:P,letterSpacing:k}),B=dn(E)?H(E,P,1,o):le(Et)*E,ie=(U,G)=>{if(U.length===0)return{originWidth:0,endingSpacesWidth:0,text:U};let{index:J,tabCount:V}=ra(U),fe=0;if(V>0){let pe=U.slice(0,J),Z=U.slice(J+V),Q=Ne(pe),ze=Q+G;fe=(B===0?Q:(Math.floor(ze/B)+V)*B)+Ne(Z)}else fe=Ne(U);let ne=U.trimEnd()===U?fe:Ne(U.trimEnd());return{originWidth:fe,endingSpacesWidth:fe-ne,text:U}},Y=[],ae=[],F=[],se=[],de=[];function Ee(U){let G=0,J=0,V=-1,fe=0,ne=0,pe=0,Z=0;Y=[],F=[0],se=[],de=[];let Q=0,ze=0;for(;Q<W.length&&G<ue;){let q=W[Q],ve=j[Q],Ae=0,{originWidth:Ft,endingSpacesWidth:be,text:wt}=ie(q,ne);q=wt,Ae=Ft;let _e=be;ve&&pe===0&&(pe=z.height(q));let at=S==="justify",me=Q&&ne+Ae>U+_e&&X;if(he&&Ae>U&&(!ne||me||ve)){let $e=Pe(q,"grapheme");W.splice(Q,1,...$e),ne>0&&(Y.push(ne-ze),ae.push(Z),G++,fe+=pe,ne=0,pe=0,Z=0,F.push(1),V=-1),ze=_e;continue}if(ve||me)ce&&q===Et&&(Ae=0),Y.push(ne-ze),ae.push(Z),G++,fe+=pe,ne=Ae,pe=Ae?Math.round(z.height(q)):0,Z=Ae?Math.round(z.baseline(q)):0,F.push(1),V=-1,ve||(J=Math.max(J,U));else{ne+=Ae;let $e=Math.round(z.height(q));$e>pe&&(pe=$e,Z=Math.round(z.baseline(q))),at&&F[F.length-1]++}at&&V++,J=Math.max(J,ne);let Fe=ne-Ae;if(Ae===0)de.push({y:fe,x:Fe,width:0,line:G,lineIndex:V,isImage:!1});else{let $e=Pe(q,"word");for(let Ze=0;Ze<$e.length;Ze++){let Qe=$e[Ze],Me=0,Ve=!1;De(Qe)?(Me=P,Ve=!0):!f&&Qe.length>1?Me=Ne(Qe):Me=le(Qe),se.push(Qe),de.push({y:fe,x:Fe,width:Me,line:G,lineIndex:V,isImage:Ve}),Fe+=Me}}Q++,ze=_e}return ne&&(G<ue&&(fe+=pe),G++,Y.push(ne),ae.push(Z)),{width:J,height:fe}}let Te={width:0,height:0};K.setMeasureFunc(U=>{let{width:G,height:J}=Ee(U);if(O==="balance"){let fe=G/2,ne=G,pe=G;for(;fe+1<ne;){pe=(fe+ne)/2;let{height:Q}=Ee(pe);Q>J?fe=pe:ne=pe}Ee(ne);let Z=Math.ceil(ne);return Te={width:Z,height:J},{width:Z,height:J}}if(O==="pretty"&&Y[Y.length-1]<G/3){let pe=G*.9,Z=Ee(pe);if(Z.height<=J*1.3)return Te={width:G,height:Z.height},{width:G,height:Z.height}}let V=Math.ceil(G);return Te={width:V,height:J},{width:V,height:J}});let[te,Re]=yield,ye="",Oe="",we=i._inheritedClipPathId,Tt=i._inheritedMaskId,{left:nt,top:Bt,width:bt,height:Rt}=K.getComputedLayout(),kt=typeof x=="string"?H(x,P,bt,o,!0)||0:x,yt=r.getComputedWidth()-r.getComputedPadding(n.EDGE_LEFT)-r.getComputedPadding(n.EDGE_RIGHT)-r.getComputedBorder(n.EDGE_LEFT)-r.getComputedBorder(n.EDGE_RIGHT),rt=te+nt,Ye=Re+Bt,{matrix:Ue,opacity:xt}=fo({left:nt,top:Bt,width:bt,height:Rt,isInheritingTransform:s},o),We="";if(o.textShadowOffset){let{textShadowColor:U,textShadowOffset:G,textShadowRadius:J}=o;We=co({width:Te.width,height:Te.height,id:c},{shadowColor:U,shadowOffset:G,shadowRadius:J},or(o.color)||A&&go(o.color)),We=v("defs",{},We)}let qe="",Ke="",St="",dt=-1,Ce={},je={},Be=null,Je=0;for(let U=0;U<se.length;U++){let G=de[U],J=de[U+1];if(!G)continue;let V=se[U],fe=null,ne=!1,pe=p?p[V]:null,Z=G.y,Q=G.x,ze=G.width,q=G.line,ve=o.textDecorationLine==="underline"&&(o.textDecorationSkipInk||"auto")!=="none";if(q===dt)continue;let Ae=!1;if(q===0&&kt!==0&&(Q+=kt),Y.length>1){let me=bt-Y[q];if(S==="right"||S==="end")Q+=me;else if(S==="center")Q+=me/2;else if(S==="justify"&&q<Y.length-1){let ge=F[q],Fe=ge>1?me/(ge-1):0;Q+=Fe*G.lineIndex,Ae=!0}f&&(Q=Math.round(Q))}let Ft=ae[q],be=z.baseline(V),wt=z.height(V),_e=Ft-be,at=me=>!ve||o.textDecorationLine!=="underline"?void 0:{underlineY:Ye+me+_e+be+be*.1,strokeWidth:Math.max(1,P*.1)};if(Ce[q]||(Ce[q]={left:Q,top:Ye+Z+_e,ascender:be,width:Ae?bt:Y[q]}),ue!==1/0){let Qe=function(Me,Ve){let $t=Pe(Ve,"grapheme",g),It="",an=0;for(let sn of $t){let Gt=Me+Se([It+sn]);if(It&&Gt+ge>yt)break;It+=sn,an=Gt}return{subset:It,resolvedWidth:an}},me=ke,ge=le(ke);ge>yt&&(me=Wt,ge=le(me));let Fe=le(Et),$e=q<Y.length-1;if(q+1===ue&&($e||Y[q]>yt)){if(Q+ze+ge+Fe>yt){let{subset:Me,resolvedWidth:Ve}=Qe(Q,V);V=Me+me,dt=q,Ce[q].width=Math.max(0,Ve-Ce[q].left),ne=!0}else if(J&&J.line!==q)if(S==="center"){let{subset:Me,resolvedWidth:Ve}=Qe(Q,V);V=Me+me,dt=q,Ce[q].width=Math.max(0,Ve-Ce[q].left),ne=!0}else{let Me=se[U+1],{subset:Ve,resolvedWidth:$t}=Qe(ze+Q,Me);V=V+Ve+me,dt=q,Ce[q].width=Math.max(0,$t-Ce[q].left),ne=!0}}}if(pe)Z+=0;else if(f){if(!V.includes(rr)&&!Cr.includes(V)&&se[U+1]&&J&&!J.isImage&&Z===J.y&&!ne){Be===null&&(Je=Q),Be=Be===null?V:Be+V;continue}let me=Be===null?V:Be+V,ge=Be===null?Q:Je,Fe=G.width+Q-ge,$e=at(Z),Ze=z.getSVG(me.replace(/(\t)+/g,""),{fontSize:P,left:rt+ge,top:Ye+Z+be+_e,letterSpacing:k},$e);fe=Ze.path,ve&&Ze.boxes&&Ze.boxes.length&&(je[q]||(je[q]=[])).push(...Ze.boxes),Be=null,d&&(St+=v("rect",{x:rt+ge,y:Ye+Z+_e,width:Fe,height:wt,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:Ue||void 0,"clip-path":we?`url(#${we})`:void 0})+v("line",{x1:rt+Q,x2:rt+Q+G.width,y1:Ye+Z+_e+be,y2:Ye+Z+_e+be,stroke:"#14c000","stroke-width":1,transform:Ue||void 0,"clip-path":we?`url(#${we})`:void 0}))}else if(Z+=be+_e,ve&&!pe){let me=at(Z),ge=z.getSVG(V.replace(/(\t)+/g,""),{fontSize:P,left:rt+Q,top:Ye+Z,letterSpacing:k},me);ge.boxes&&ge.boxes.length&&(je[q]||(je[q]=[])).push(...ge.boxes)}if(fe!==null)Ke+=fe+" ";else{let[me,ge]=er({content:V,filter:We,id:c,left:rt+Q,top:Ye+Z,width:ze,height:wt,matrix:Ue,opacity:xt,image:pe,clipPathId:we,debug:d,fauxBoldStrokeWidth:z.fauxBoldStrokeWidth,shape:!!$},o);ye+=me,Oe+=ge}if(ne)break}if(o.textDecorationLine&&(qe=Object.entries(Ce).map(([U,G])=>{if(!G)return"";let J=je[U]||[];return tr({left:rt+G.left,top:G.top,width:G.width,ascender:G.ascender,clipPathId:we,matrix:Ue,glyphBoxes:J},o)}).join("")),Ke){let U=!!i.WebkitTextStrokeWidth,G=!U&&z.fauxBoldStrokeWidth!==void 0,J=We&&(or(o.color)||A&&go(o.color))?"black":o.color,V=(!or(o.color)||We||U)&&xt!==0?`<g ${Tt?`mask="url(#${Tt})"`:""} ${we?`clip-path="url(#${we})"`:""}>`+v("path",{d:Ke,fill:J,opacity:xt!==1?xt:void 0,"paint-order":U||G?"stroke":void 0,stroke:U?i.WebkitTextStrokeColor:G?J:void 0,"stroke-linejoin":U?"round":G?"miter":void 0,"stroke-width":U?`${i.WebkitTextStrokeWidth}px`:G?`${z.fauxBoldStrokeWidth}`:void 0,style:M?`filter:${M}`:void 0,transform:Ue||void 0})+"</g>":"";$&&(Oe=v("path",{d:Ke,transform:Ue||void 0})),ye+=(We?We+v("g",{filter:`url(#satori_s-${c})`},V+qe):V+qe)+St}else qe&&(ye+=We?v("g",{filter:`url(#satori_s-${c})`},qe):qe);return Oe&&(o._inheritedBackgroundClipTextPath.value+=Oe),ye}function na(e,t){let n=e.Node.create();return n.setAlignItems(e.ALIGN_BASELINE),n.setJustifyContent(Le(t,{left:e.JUSTIFY_FLEX_START,right:e.JUSTIFY_FLEX_END,center:e.JUSTIFY_CENTER,justify:e.JUSTIFY_SPACE_BETWEEN,start:e.JUSTIFY_FLEX_START,end:e.JUSTIFY_FLEX_END},e.JUSTIFY_FLEX_START,"textAlign")),n}function ra(e){let t=/(\t)+/.exec(e);return t?{index:t.index,tabCount:t[0].length}:{index:null,tabCount:0}}import{parseLinearGradient as ia}from"css-gradient-parser";import oa from"parse-css-color";function vn(e,t,n,o,i){let r=[],a=t.at(-1),c=a&&a.offset&&a.offset.unit==="%"&&o?+a.offset.value:100;for(let p of t){let{color:g}=p;if(!r.length&&(r.push({offset:0,color:g}),!p.offset||p.offset.value==="0"))continue;let b=typeof p.offset>"u"?void 0:p.offset.unit==="%"?+p.offset.value/c:Number(H(`${p.offset.value}${p.offset.unit}`,n.fontSize,e,n,!0))/e;r.push({offset:b,color:g})}r.length||r.push({offset:0,color:"transparent"});let s=r[r.length-1];s.offset!==1&&(typeof s.offset>"u"?s.offset=1:o?r[r.length-1]={offset:1,color:s.color}:r.push({offset:1,color:s.color}));let d=0,f=1;for(let p=0;p<r.length;p++)if(typeof r[p].offset>"u"){for(f<p&&(f=p);typeof r[f].offset>"u";)f++;r[p].offset=(r[f].offset-r[d].offset)/(f-d)*(p-d)+r[d].offset}else d=p;return i==="mask"?r.map(p=>{let g=oa(p.color);return g?g.alpha===0?{...p,color:"rgba(0, 0, 0, 1)"}:{...p,color:`rgba(255, 255, 255, ${g.alpha})`}:p}):r}function yo({id:e,width:t,height:n,repeatX:o,repeatY:i},r,a,c,s,d){let f=ia(r),[p,g]=a,b=r.startsWith("repeating"),S,x,_;if(f.orientation.type==="directional")S=sa(f.orientation.value),x=Math.sqrt(Math.pow((S.x2-S.x1)*p,2)+Math.pow((S.y2-S.y1)*g,2));else if(f.orientation.type==="angular"){let{length:k,...$}=ua(On(`${f.orientation.value.value}${f.orientation.value.unit}`)/180*Math.PI,p,g);x=k,S=$}_=b?la(f.stops,x,S,s):S;let O=vn(b?aa(f.stops,x):x,f.stops,s,b,d),P=`satori_bi${e}`,M=`satori_pattern_${e}`,E=v("pattern",{id:M,x:c[0]/t,y:c[1]/n,width:o?p/t:"1",height:i?g/n:"1",patternUnits:"objectBoundingBox"},v("linearGradient",{id:P,..._,spreadMethod:b?"repeat":"pad"},O.map(k=>v("stop",{offset:(k.offset??0)*100+"%","stop-color":k.color})).join(""))+v("rect",{x:0,y:0,width:p,height:g,fill:`url(#${P})`}));return[M,E]}function aa(e,t){let n=e[e.length-1],{offset:o}=n;return o?o.unit==="%"?Number(o.value)/100*t:Number(o.value):t}function sa(e){let t=0,n=0,o=0,i=0;return e.includes("top")?n=1:e.includes("bottom")&&(i=1),e.includes("left")?t=1:e.includes("right")&&(o=1),!t&&!o&&!n&&!i&&(n=1),{x1:t,y1:n,x2:o,y2:i}}function ua(e,t,n){let o=Math.pow(n/t,2);e=(e%(Math.PI*2)+Math.PI*2)%(Math.PI*2);let i,r,a,c,s,d,f,p,g=b=>{if(b===0){i=0,r=n,a=0,c=0,s=n;return}else if(b===Math.PI/2){i=0,r=0,a=t,c=0,s=t;return}if(b>0&&b<Math.PI/2){i=(o*t/2/Math.tan(b)-n/2)/(Math.tan(b)+o/Math.tan(b)),r=Math.tan(b)*i+n,a=Math.abs(t/2-i)+t/2,c=n/2-Math.abs(r-n/2),s=Math.sqrt(Math.pow(a-i,2)+Math.pow(c-r,2)),f=(t/2/Math.tan(b)-n/2)/(Math.tan(b)+1/Math.tan(b)),p=Math.tan(b)*f+n,s=2*Math.sqrt(Math.pow(t/2-f,2)+Math.pow(n/2-p,2));return}else if(b>Math.PI/2&&b<Math.PI){i=(n/2+o*t/2/Math.tan(b))/(Math.tan(b)+o/Math.tan(b)),r=Math.tan(b)*i,a=Math.abs(t/2-i)+t/2,c=n/2+Math.abs(r-n/2),f=(t/2/Math.tan(b)+n/2)/(Math.tan(b)+1/Math.tan(b)),p=Math.tan(b)*f,s=2*Math.sqrt(Math.pow(t/2-f,2)+Math.pow(n/2-p,2));return}else b>=Math.PI&&(g(b-Math.PI),d=i,i=a,a=d,d=r,r=c,c=d)};return g(e),{x1:i/t,y1:r/n,x2:a/t,y2:c/n,length:s}}function la(e,t,n,o){let{x1:i,x2:r,y1:a,y2:c}=n,s=e[0].offset?e[0].offset.unit==="%"?Number(e[0].offset.value)/100:H(`${e[0].offset.value}${e[0].offset.unit}`,o.fontSize,t,o,!0)/t:0,d=e.at(-1).offset?e.at(-1).offset.unit==="%"?Number(e.at(-1).offset.value)/100:H(`${e.at(-1).offset.value}${e.at(-1).offset.unit}`,o.fontSize,t,o,!0)/t:1,f=(r-i)*s+i,p=(c-a)*s+a,g=(r-i)*d+i,b=(c-a)*d+a;return{x1:f,y1:p,x2:g,y2:b}}import{parseRadialGradient as fa}from"css-gradient-parser";function So({id:e,width:t,height:n,repeatX:o,repeatY:i},r,a,c,s,d){var oe;let{shape:f,stops:p,position:g,size:b,repeating:S}=fa(r),[x,_]=a,O=x/2,P=_/2,M=da(g.x,g.y,x,_,s.fontSize,s);O=M.x,P=M.y;let E=ca(t,p,S,s),k=vn(E,p,s,S,d),$=`satori_radial_${e}`,A=`satori_pattern_${e}`,L=`satori_mask_${e}`,W=ma(f,b,s.fontSize,{x:O,y:P},[x,_],s,S),j=pa(f,s.fontSize,p,[x,_],s,S,W),X=v("pattern",{id:A,x:c[0]/t,y:c[1]/n,width:o?x/t:"1",height:i?_/n:"1",patternUnits:"objectBoundingBox"},v("radialGradient",{id:$,...j},k.map(ce=>v("stop",{offset:ce.offset||0,"stop-color":ce.color})).join(""))+v("mask",{id:L},v("rect",{x:0,y:0,width:x,height:_,fill:"#fff"}))+v("rect",{x:0,y:0,width:x,height:_,fill:((oe=k.at(-1))==null?void 0:oe.color)||"transparent"})+v(f,{cx:O,cy:P,width:x,height:_,...W,fill:`url(#${$})`,mask:`url(#${L})`}));return[A,X]}function ca(e,t,n,o){if(!n)return e;let i=t.at(-1);return!i||!i.offset||i.offset.unit==="%"?e:H(`${i.offset.value}${i.offset.unit}`,+o.fontSize,e,o,!0)}function da(e,t,n,o,i,r){let a={x:n/2,y:o/2};return e.type==="keyword"?Object.assign(a,xo(e.value,n,o,"x")):a.x=H(`${e.value.value}${e.value.unit}`,i,n,r,!0)??n/2,t.type==="keyword"?Object.assign(a,xo(t.value,n,o,"y")):a.y=H(`${t.value.value}${t.value.unit}`,i,o,r,!0)??o/2,a}function xo(e,t,n,o){switch(e){case"center":return{[o]:o==="x"?t/2:n/2};case"left":return{x:0};case"top":return{y:0};case"right":return{x:t};case"bottom":return{y:n}}}function pa(e,t,n,[o,i],r,a,c){let{r:s,rx:d,ratio:f=1}=c;if(!a)return{spreadMethod:"pad"};let p=n.at(-1),g=e==="circle"?s*2:d*2;return{spreadMethod:"repeat",cx:"50%",cy:"50%",r:p.offset.unit==="%"?`${Number(p.offset.value)*Math.min(i/o,1)/f}%`:Number(H(`${p.offset.value}${p.offset.unit}`,t,o,r,!0)/g)}}function ma(e,t,n,o,i,r,a){let[c,s]=i,{x:d,y:f}=o,p={},g=0,b=0;if(ha(t)){if(t.some(S=>S.value.value.startsWith("-")))throw new Error("disallow setting negative values to the size of the shape. Check https://w3c.github.io/csswg-drafts/css-images/#valdef-rg-size-length-0");return e==="circle"?Object.assign(p,{r:Number(H(`${t[0].value.value}${t[0].value.unit}`,n,c,r,!0))}):Object.assign(p,{rx:Number(H(`${t[0].value.value}${t[0].value.unit}`,n,c,r,!0)),ry:Number(H(`${t[1].value.value}${t[1].value.unit}`,n,s,r,!0))}),En(p,c,s,d,f,a,e),p}switch(t[0].value){case"farthest-corner":g=Math.max(Math.abs(c-d),Math.abs(d)),b=Math.max(Math.abs(s-f),Math.abs(f));break;case"closest-corner":g=Math.min(Math.abs(c-d),Math.abs(d)),b=Math.min(Math.abs(s-f),Math.abs(f));break;case"farthest-side":return e==="circle"?p.r=Math.max(Math.abs(c-d),Math.abs(d),Math.abs(s-f),Math.abs(f)):(p.rx=Math.max(Math.abs(c-d),Math.abs(d)),p.ry=Math.max(Math.abs(s-f),Math.abs(f))),En(p,c,s,d,f,a,e),p;case"closest-side":return e==="circle"?p.r=Math.min(Math.abs(c-d),Math.abs(d),Math.abs(s-f),Math.abs(f)):(p.rx=Math.min(Math.abs(c-d),Math.abs(d)),p.ry=Math.min(Math.abs(s-f),Math.abs(f))),En(p,c,s,d,f,a,e),p}return e==="circle"?p.r=Math.sqrt(g*g+b*b):Object.assign(p,wo(g,b)),En(p,c,s,d,f,a,e),p}function En(e,t,n,o,i,r,a){if(r)if(a==="ellipse"){let c=Math.max(Math.abs(t-o),Math.abs(o)),s=Math.max(Math.abs(n-i),Math.abs(i)),{rx:d,ry:f}=wo(c,s);e.ratio=Math.max(d/e.rx,f/e.ry),e.ratio>1&&(e.rx*=e.ratio,e.ry*=e.ratio)}else{let c=Math.max(Math.abs(t-o),Math.abs(o)),s=Math.max(Math.abs(n-i),Math.abs(i)),d=Math.sqrt(c*c+s*s);e.ratio=d/e.r,e.ratio>1&&(e.r=d)}}function wo(e,t){let n=t!==0?e/t:1;if(e===0)return{rx:0,ry:0};{let o=Math.sqrt(e*e+t*t*n*n)/n;return{ry:o,rx:o*n}}}function ha(e){return!e.some(t=>t.type==="keyword")}import vo from"parse-css-color";function Ot(e,t){return typeof e=="string"&&e.endsWith("%")?t*parseFloat(e)/100:typeof e=="string"?parseFloat(e)||0:+e}function ga(e,t,n,o,i){if(!o||!i)return[t,n];if(e==="cover"){let r=t/o,a=n/i,c=Math.max(r,a);return[o*c,i*c]}if(e==="contain"){let r=t/o,a=n/i,c=Math.min(r,a);return[o*c,i*c]}if(e==="auto"||e.includes("auto")){let r=e.split(" "),a=r[0]||"auto",c=r[1]||r[0]||"auto",s=o,d=i;if(a==="auto"&&c!=="auto"){let f=Ot(c,n);d=f,s=o/i*f}else if(c==="auto"&&a!=="auto"){let f=Ot(a,t);s=f,d=i/o*f}return[s,d]}return[t,n]}var Jt={bottom:"100%",center:"50%",left:"0%",right:"100%",top:"0%"};function ar(e){if(!e)return{x:"0%",y:"0%"};let t=e.split(" ").filter(Boolean);if(t.length===1){let n=t[0];return n in Jt?n==="top"||n==="bottom"?{x:"50%",y:Jt[n]}:{x:Jt[n],y:"50%"}:{x:n,y:"50%"}}return{x:Jt[t[0]]||t[0],y:Jt[t[1]]||t[1]}}function gt(e,t,n){if(e.endsWith("%")){let o=parseFloat(e)/100;return(t-n)*o}try{let o=new He(e);return o.type==="length"||o.type==="number"?o.value:Ot(o.value+o.unit,t)}catch{return 0}}function Eo(e,{x:t,y:n,defaultX:o,defaultY:i}){let r=e?e.split(" ").map(a=>{try{let c=new He(a);return c.type==="length"||c.type==="number"?c.value:c.value+c.unit}catch{return null}}).filter(a=>a!==null):[o,i];return r.length===0?[Ot(o,t),Ot(i,n)]:(r.length===1&&r.push(i),r.map((a,c)=>Ot(a,[t,n][c])))}async function Zt({id:e,width:t,height:n,left:o,top:i},{image:r,size:a,position:c,repeat:s},d,f){s=s||"repeat",f=f||"background",a=a||"auto",a!=="cover"&&a!=="contain"&&a!=="auto"&&!a.includes(" ")&&(a=`${a} auto`);let p=s==="repeat-x"||s==="repeat",g=s==="repeat-y"||s==="repeat",b=a&&(a==="cover"||a==="contain"||a==="auto"||a.includes("auto")),S=r.startsWith("linear-gradient(")||r.startsWith("repeating-linear-gradient(")||r.startsWith("radial-gradient(")||r.startsWith("repeating-radial-gradient("),x=b&&S?[t,n]:b?[0,0]:Eo(a,{x:t,y:n,defaultX:t,defaultY:n}),_=ar(c);if(r.startsWith("linear-gradient(")||r.startsWith("repeating-linear-gradient(")){let O=[gt(_.x,t,x[0]),gt(_.y,n,x[1])];return yo({id:e,width:t,height:n,repeatX:p,repeatY:g},r,x,O,d,f)}if(r.startsWith("radial-gradient(")||r.startsWith("repeating-radial-gradient(")){let O=[gt(_.x,t,x[0]),gt(_.y,n,x[1])];return So({id:e,width:t,height:n,repeatX:p,repeatY:g},r,x,O,d,f)}if(r.startsWith("url(")){let[O,P,M]=await Nt(r.slice(4,-1)),E,k;if(b){let[W,j]=ga(a,t,n,P,M);E=W,k=j}else{let W=Eo(a,{x:t,y:n,defaultX:0,defaultY:0});E=f==="mask"?P||W[0]:W[0]||P,k=f==="mask"?M||W[1]:W[1]||M}if(b){let W=ar(c),j=gt(W.x,t,E),X=gt(W.y,n,k);return[`satori_bi${e}`,v("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:(p?j:0)+o,y:(g?X:0)+i,width:p?E:"100%",height:g?k:"100%"},v("image",{x:p?0:j,y:g?0:X,width:E,height:k,preserveAspectRatio:"none",href:O}))]}let $=ar(c),A=gt($.x,t,E),L=gt($.y,n,k);return[`satori_bi${e}`,v("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:(p?A:0)+o,y:(g?L:0)+i,width:p?E:"100%",height:g?k:"100%"},v("image",{x:p?0:A,y:g?0:L,width:E,height:k,preserveAspectRatio:"none",href:O}))]}if(vo(r)){let O=vo(r),[P,M,E,k]=O.values,A=`rgba(${P},${M},${E},${k!==void 0?k:1})`;return[`satori_bi${e}`,v("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:o,y:i,width:t,height:n},v("rect",{x:0,y:0,width:t,height:n,fill:A}))]}throw new Error(`Invalid background image: "${r}"`)}function ba([e,t]){return Math.round(e*1e3)===0&&Math.round(t*1e3)===0?0:Math.round(e*t/Math.sqrt(e*e+t*t)*1e3)/1e3}function Tn(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 Rn(e){e[0]=e[1]=Math.min(e[0],e[1])}function kn(e,t,n,o,i){if(typeof e=="string"){let r=e.split(" ").map(c=>c.trim()),a=!r[1]&&!r[0].endsWith("%");return r[1]=r[1]||r[0],[a,[Math.min(H(r[0],o,t,i,!0),t),Math.min(H(r[1],o,n,i,!0),n)]]}return typeof e=="number"?[!0,[Math.min(e,t),Math.min(e,n)]]:[!0,void 0]}var In=e=>e&&e[0]!==0&&e[1]!==0;function To({id:e,borderRadiusPath:t,borderType:n,left:o,top:i,width:r,height:a},c){let s=`satori_brc-${e}`;return[v("clipPath",{id:s},v(n,{x:o,y:i,width:r,height:a,d:t||void 0})),s]}function it({left:e,top:t,width:n,height:o},i,r){let{borderTopLeftRadius:a,borderTopRightRadius:c,borderBottomLeftRadius:s,borderBottomRightRadius:d,fontSize:f}=i,p,g,b,S;if([p,a]=kn(a,n,o,f,i),[g,c]=kn(c,n,o,f,i),[b,s]=kn(s,n,o,f,i),[S,d]=kn(d,n,o,f,i),!r&&!In(a)&&!In(c)&&!In(s)&&!In(d))return"";a||=[0,0],c||=[0,0],s||=[0,0],d||=[0,0],[a[0],c[0]]=Tn(a[0],c[0],n),[s[0],d[0]]=Tn(s[0],d[0],n),[a[1],s[1]]=Tn(a[1],s[1],o),[c[1],d[1]]=Tn(c[1],d[1],o),p&&Rn(a),g&&Rn(c),b&&Rn(s),S&&Rn(d);let x=[];x[0]=[c,c],x[1]=[d,[-d[0],d[1]]],x[2]=[s,[-s[0],-s[1]]],x[3]=[a,[a[0],-a[1]]];let _=`h${n-a[0]-c[0]} a${x[0][0]} 0 0 1 ${x[0][1]}`,O=`v${o-c[1]-d[1]} a${x[1][0]} 0 0 1 ${x[1][1]}`,P=`h${d[0]+s[0]-n} a${x[2][0]} 0 0 1 ${x[2][1]}`,M=`v${s[1]+a[1]-o} a${x[3][0]} 0 0 1 ${x[3][1]}`;if(r){let k=function(he){let oe=ba([a,c,d,s][he]);return he===0?[[e+a[0]-oe,t+a[1]-oe],[e+a[0],t]]:he===1?[[e+n-c[0]+oe,t+c[1]-oe],[e+n,t+c[1]]]:he===2?[[e+n-d[0]+oe,t+o-d[1]+oe],[e+n-d[0],t+o]]:[[e+s[0]-oe,t+o-s[1]+oe],[e,t+o-s[1]]]},E=r.indexOf(!1);if(!r.includes(!0))throw new Error("Invalid `partialSides`.");if(E===-1)E=0;else for(;!r[E];)E=(E+1)%4;let $="",A=k(E),L=`M${A[0]} A${x[(E+3)%4][0]} 0 0 1 ${A[1]}`,W=0;for(;W<4&&r[(E+W)%4];W++)$+=L+" ",L=[_,O,P,M][(E+W)%4];let j=(E+W)%4;$+=L.split(" ")[0];let X=k(j);return $+=` A${x[(j+3)%4][0]} 0 0 1 ${X[0]}`,$}return`M${e+a[0]},${t} ${_} ${O} ${P} ${M}`}function Ro(e,t,n){return n[e+"Width"]===n[t+"Width"]&&n[e+"Style"]===n[t+"Style"]&&n[e+"Color"]===n[t+"Color"]}function ko({id:e,currentClipPathId:t,borderPath:n,borderType:o,left:i,top:r,width:a,height:c},s){if(!(s.borderTopWidth||s.borderRightWidth||s.borderBottomWidth||s.borderLeftWidth))return null;let f=`satori_bc-${e}`;return[v("clipPath",{id:f,"clip-path":t?`url(#${t})`:void 0},v(o,{x:i,y:r,width:a,height:c,d:n||void 0})),f]}function Qt({left:e,top:t,width:n,height:o,props:i,asContentMask:r,maskBorderOnly:a},c){let s=["borderTop","borderRight","borderBottom","borderLeft"];if(!r&&!s.some(b=>c[b+"Width"]))return"";let d="",f=0;for(;f>0&&Ro(s[f],s[(f+3)%4],c);)f=(f+3)%4;let p=[!1,!1,!1,!1],g=[];for(let b=0;b<4;b++){let S=(f+b)%4,x=(f+b+1)%4,_=s[S],O=s[x];if(p[S]=!0,g=[c[_+"Width"],c[_+"Style"],c[_+"Color"],_],!Ro(_,O,c)){let P=(g[0]||0)+(r&&!a&&c[_.replace("border","padding")]||0);P&&(d+=v("path",{width:n,height:o,...i,fill:"none",stroke:r?"#000":g[2],"stroke-width":P*2,"stroke-dasharray":!r&&g[1]==="dashed"?P*2+" "+P:void 0,d:it({left:e,top:t,width:n,height:o},c,p)})),p=[!1,!1,!1,!1]}}if(p.some(Boolean)){let b=(g[0]||0)+(r&&!a&&c[g[3].replace("border","padding")]||0);b&&(d+=v("path",{width:n,height:o,...i,fill:"none",stroke:r?"#000":g[2],"stroke-width":b*2,"stroke-dasharray":!r&&g[1]==="dashed"?b*2+" "+b:void 0,d:it({left:e,top:t,width:n,height:o},c,p)}))}return d}function sr({id:e,left:t,top:n,width:o,height:i,matrix:r,borderOnly:a},c){let s=(c.borderLeftWidth||0)+(a?0:c.paddingLeft||0),d=(c.borderTopWidth||0)+(a?0:c.paddingTop||0),f=(c.borderRightWidth||0)+(a?0:c.paddingRight||0),p=(c.borderBottomWidth||0)+(a?0:c.paddingBottom||0),g={x:t+s,y:n+d,width:o-s-f,height:i-d-p};return v("mask",{id:e},v("rect",{...g,fill:"#fff",transform:c.overflow==="hidden"&&c.transform&&r?r:void 0,mask:c._inheritedMaskId?`url(#${c._inheritedMaskId})`:void 0})+Qt({left:t,top:n,width:o,height:i,props:{transform:r||void 0},asContentMask:!0,maskBorderOnly:a},c))}import{getStylesForProperty as Io}from"css-to-react-native";var en={circle:/circle\((.+)\)/,ellipse:/ellipse\((.+)\)/,path:/path\((.+)\)/,polygon:/polygon\((.+)\)/,inset:/inset\((.+)\)/};function Ao({width:e,height:t},n,o){function i(d){let f=d.match(en.circle);if(!f)return null;let[,p]=f,[g,b=""]=p.split("at").map(_=>_.trim()),{x:S,y:x}=Co(b,e,t);return{type:"circle",r:H(g,o.fontSize,Math.sqrt(Math.pow(e,2)+Math.pow(t,2))/Math.sqrt(2),o,!0),cx:H(S,o.fontSize,e,o,!0),cy:H(x,o.fontSize,t,o,!0)}}function r(d){let f=d.match(en.ellipse);if(!f)return null;let[,p]=f,[g,b=""]=p.split("at").map(P=>P.trim()),[S,x]=g.split(" "),{x:_,y:O}=Co(b,e,t);return{type:"ellipse",rx:H(S||"50%",o.fontSize,e,o,!0),ry:H(x||"50%",o.fontSize,t,o,!0),cx:H(_,o.fontSize,e,o,!0),cy:H(O,o.fontSize,t,o,!0)}}function a(d){let f=d.match(en.path);if(!f)return null;let[p,g]=_o(f[1]);return{type:"path",d:g,"fill-rule":p}}function c(d){let f=d.match(en.polygon);if(!f)return null;let[p,g]=_o(f[1]);return{type:"polygon","fill-rule":p,points:g.split(",").map(b=>b.split(" ").map((S,x)=>H(S,o.fontSize,x===0?e:t,o,!0)).join(" ")).join(",")}}function s(d){let f=d.match(en.inset);if(!f)return null;let[p,g]=(f[1].includes("round")?f[1]:`${f[1].trim()} round 0`).split("round"),b=Io("borderRadius",g,!0),S=Object.values(b).map(E=>String(E)).map((E,k)=>H(E,o.fontSize,k===0||k===2?t:e,o,!0)||0),x=Object.values(Io("margin",p,!0)).map(E=>String(E)).map((E,k)=>H(E,o.fontSize,k===0||k===2?t:e,o,!0)||0),_=x[3],O=x[0],P=e-(x[1]+x[3]),M=t-(x[0]+x[2]);return S.some(E=>E>0)?{type:"path",d:it({left:_,top:O,width:P,height:M},{...n,...b})}:{type:"rect",x:_,y:O,width:P,height:M}}return{parseCircle:i,parseEllipse:r,parsePath:a,parsePolygon:c,parseInset:s}}function _o(e){let[,t="nonzero",n]=e.replace(/('|")/g,"").match(/^(nonzero|evenodd)?,?(.+)/)||[];return[t,n]}function Co(e,t,n){let o=e.split(" "),i={x:o[0]||"50%",y:o[1]||"50%"};return o.forEach(r=>{r==="top"?i.y=0:r==="bottom"?i.y=n:r==="left"?i.x=0:r==="right"?i.x=t:r==="center"&&(i.x=t/2,i.y=n/2)}),i}function _n(e){return`satori_cp-${e}`}function Mo(e){return`url(#${_n(e)})`}function Po(e,t,n){if(t.clipPath==="none")return"";let o=Ao(e,t,n),i=t.clipPath,r={type:""};for(let a of Object.keys(o))if(r=o[a](i),r)break;if(r){let{type:a,...c}=r;return v("clipPath",{id:_n(e.id),"clip-path":e.currentClipPath,transform:`translate(${e.left}, ${e.top})`},v(a,c))}return""}function ur({left:e,top:t,width:n,height:o,path:i,matrix:r,id:a,currentClipPath:c,src:s},d,f){let p="",g=d.clipPath&&d.clipPath!=="none"?Po({left:e,top:t,width:n,height:o,path:i,id:a,matrix:r,currentClipPath:c,src:s},d,f):"";if(d.overflow!=="hidden"&&!s)p="";else{let S=g?`satori_ocp-${a}`:_n(a);p=v("clipPath",{id:S,"clip-path":c},v(i?"path":"rect",{x:e,y:t,width:n,height:o,d:i||void 0,transform:d.overflow==="hidden"&&d.transform&&r?r:void 0}))}let b=sr({id:`satori_om-${a}`,left:e,top:t,width:n,height:o,matrix:r,borderOnly:!s},d);return g+p+b}var ya=e=>`satori_mi-${e}`;async function lr(e,t,n){if(!t.maskImage)return["",""];let{left:o,top:i,width:r,height:a,id:c}=e,s=t.maskImage,d=s.length;if(!d)return["",""];let f=ya(c),p="";for(let g=0;g<d;g++){let b=s[g],[S,x]=await Zt({id:`${f}-${g}`,left:o,top:i,width:r,height:a},b,n,"mask");p+=x+v("rect",{x:o,y:i,width:r,height:a,fill:`url(#${S})`})}return p=v("mask",{id:f},p),[f,p]}function xa(e,t,n){let o=e.toLowerCase().trim().split(/\s+/),i=(s,d)=>({left:"0%",center:"50%",right:"100%",top:"0%",bottom:"100%"})[s]||s,r,a;if(o.length===1){let s=o[0];s==="left"||s==="center"||s==="right"?(r=i(s,"x"),a="50%"):s==="top"||s==="bottom"?(r="50%",a=i(s,"y")):(r=s,a="50%")}else{let s=o[0],d=o[1];s==="top"||s==="bottom"?(a=i(s,"y"),d==="left"||d==="right"||d==="center"?r=i(d,"x"):(r="50%",a=s==="top"||s==="bottom"?i(s,"y"):d)):(r=i(s,"x"),a=i(d,"y"))}let c=(s,d)=>{try{if(s.endsWith("%"))return d*parseFloat(s)/100;let f=new He(s);return f.type==="length"||f.type==="number"?f.value:0}catch{return 0}};return[c(r,t),c(a,n)]}async function tn({id:e,left:t,top:n,width:o,height:i,isInheritingTransform:r,src:a,debug:c},s,d){if(s.display==="none")return"";let f=!!a,p="rect",g="",b="",S=[],x=1,_="";s.backgroundColor&&S.push(s.backgroundColor),s.opacity!==void 0&&(x=+s.opacity),s.transform&&(g=Kt({left:t,top:n,width:o,height:i},s.transform,r,s.transformOrigin));let O="";if(s.backgroundImage){let K=[];for(let z=0;z<s.backgroundImage.length;z++){let Ie=s.backgroundImage[z],De=await Zt({id:e+"_"+z,width:o,height:i,left:t,top:n},Ie,d);De&&K.unshift(De)}for(let z of K)S.push(`url(#${z[0]})`),b+=z[1],z[2]&&(O+=z[2])}let[P,M]=await lr({id:e,left:t,top:n,width:o,height:i},s,d);b+=M;let E=P?`url(#${P})`:s._inheritedMaskId?`url(#${s._inheritedMaskId})`:void 0,k=it({left:t,top:n,width:o,height:i},s);k&&(p="path");let $=s._inheritedClipPathId;c&&(_=v("rect",{x:t,y:n,width:o,height:i,fill:"transparent",stroke:"#ff5757","stroke-width":1,transform:g||void 0,"clip-path":$?`url(#${$})`:void 0}));let{backgroundClip:A,filter:L,mixBlendMode:W}=s,j=[L?`filter:${L}`:void 0,W?`mix-blend-mode:${W}`:void 0].filter(K=>K).join(";")||void 0,X=A==="text"?`url(#satori_bct-${e})`:$?`url(#${$})`:s.clipPath?Mo(e):void 0,he=ur({left:t,top:n,width:o,height:i,path:k,id:e,matrix:g,currentClipPath:X,src:a},s,d),oe=S.map(K=>v(p,{x:t,y:n,width:o,height:i,fill:K,d:k||void 0,transform:g||void 0,"clip-path":s.transform?void 0:X,style:j,mask:s.transform?void 0:E})).join(""),ce=ko({id:e,left:t,top:n,width:o,height:i,currentClipPathId:$,borderPath:k,borderType:p},s),ue;if(f){let K=(s.borderLeftWidth||0)+(s.paddingLeft||0),z=(s.borderTopWidth||0)+(s.paddingTop||0),Ie=(s.borderRightWidth||0)+(s.paddingRight||0),De=(s.borderBottomWidth||0)+(s.paddingBottom||0),le=o-K-Ie,Se=i-z-De,Ne=(s.objectPosition||"center").toString(),[B,ie]=xa(Ne,le,Se),Y=s.__naturalWidth||le,ae=s.__naturalHeight||Se,F,se=le,de=Se,Ee=t+K,Te=n+z;if(s.objectFit==="contain"){let te=le/Y,Re=Se/ae,ye=Math.min(te,Re);se=Y*ye,de=ae*ye,Ee=t+K+B-se*B/le,Te=n+z+ie-de*ie/Se,F="none"}else if(s.objectFit==="cover"){let te=le/Y,Re=Se/ae,ye=Math.max(te,Re);se=Y*ye,de=ae*ye,Ee=t+K+B-se*B/le,Te=n+z+ie-de*ie/Se,F="none"}else if(s.objectFit==="fill")F="none";else if(s.objectFit==="scale-down")if(Y&&ae){let te=le/Y,Re=Se/ae,ye=Math.min(te,Re);if(ye>=1)se=Y,de=ae,F="none",Ee=t+K+B-se*B/le,Te=n+z+ie-de*ie/Se;else{let Oe=ye;se=Y*Oe,de=ae*Oe,Ee=t+K+B-se*B/le,Te=n+z+ie-de*ie/Se,F="none"}}else{let te=le/Y,Re=Se/ae,ye=Math.min(te,Re);se=Y*ye,de=ae*ye,Ee=t+K+B-se*B/le,Te=n+z+ie-de*ie/Se,F="none"}else F="none";s.transform&&(ue=To({id:e,borderRadiusPath:k,borderType:p,left:t,top:n,width:o,height:i},s)),oe+=v("image",{x:Ee,y:Te,width:se,height:de,href:a,preserveAspectRatio:F,transform:g||void 0,style:j,"clip-path":s.transform?ue?`url(#${ue[1]})`:void 0:`url(#satori_cp-${e})`,mask:s.transform?void 0:P?`url(#${P})`:`url(#satori_om-${e})`})}if(ce){b+=ce[0];let K=ce[1];oe+=Qt({left:t,top:n,width:o,height:i,props:{transform:g||void 0,"clip-path":`url(#${K})`}},s)}let ke=po({width:o,height:i,id:e,opacity:x,shape:v(p,{x:t,y:n,width:o,height:i,fill:"#fff",stroke:"#fff","stroke-width":0,d:k||void 0,transform:g||void 0,"clip-path":X,mask:E})},s);return(b?v("defs",{},b):"")+(ke?ke[0]:"")+(ue?ue[0]:"")+he+(x!==1?`<g opacity="${x}">`:"")+(s.transform&&(X||E)?`<g${X?` clip-path="${X}"`:""}${E?` mask="${E}"`:""}>`:"")+(O||oe)+(s.transform&&(X||E)?"</g>":"")+(x!==1?"</g>":"")+(ke?ke[1]:"")+_}var Sa=e=>{let t="",n="SourceGraphic",o=!1,i=e.match(/blur\(([\d.]+)(?:px)?\)/);if(i){o=!0;let d=parseFloat(i[1]),f=Math.ceil(d*3);t+=v("feOffset",{dx:-f,dy:-f,in:"SourceGraphic",result:"satori_bfTL"}),t+=v("feOffset",{dx:f,dy:-f,in:"SourceGraphic",result:"satori_bfTR"}),t+=v("feOffset",{dx:-f,dy:f,in:"SourceGraphic",result:"satori_bfBL"}),t+=v("feOffset",{dx:f,dy:f,in:"SourceGraphic",result:"satori_bfBR"}),t+=v("feMerge",{result:"satori_bfext"},v("feMergeNode",{in:"satori_bfTL"})+v("feMergeNode",{in:"satori_bfTR"})+v("feMergeNode",{in:"satori_bfBL"})+v("feMergeNode",{in:"satori_bfBR"})+v("feMergeNode",{in:"SourceGraphic"})),n="satori_bfext";let p="satori_bfblur";t+=v("feGaussianBlur",{edgeMode:"duplicate",in:n,result:p,stdDeviation:d}),n=p}let r=e.match(/saturate\(([\d.]+)(%?)\)/);if(r){let d=r[2]==="%"?parseFloat(r[1])/100:parseFloat(r[1]),f="satori_bfsat";t+=v("feColorMatrix",{in:n,result:f,type:"saturate",values:d}),n=f}let a=e.match(/brightness\(([\d.]+)\)/);if(a){let d=parseFloat(a[1]),f="satori_bfbri";t+=v("feComponentTransfer",{in:n,result:f},v("feFuncR",{slope:d,type:"linear"})+v("feFuncG",{slope:d,type:"linear"})+v("feFuncB",{slope:d,type:"linear"})),n=f}let c=e.match(/contrast\(([\d.]+)\)/);if(c){let d=parseFloat(c[1]),f=-(.5*d)+.5,p="satori_bfcon";t+=v("feComponentTransfer",{in:n,result:p},v("feFuncR",{intercept:f,slope:d,type:"linear"})+v("feFuncG",{intercept:f,slope:d,type:"linear"})+v("feFuncB",{intercept:f,slope:d,type:"linear"})),n=p}let s=e.match(/grayscale\(([\d.]+)(%?)\)/);if(s){let d=s[2]==="%"?parseFloat(s[1])/100:parseFloat(s[1]),f="satori_bfgray";t+=v("feColorMatrix",{in:n,result:f,type:"saturate",values:1-Math.min(d,1)}),n=f}return o&&(t+=v("feComposite",{in:n,in2:"SourceGraphic",operator:"atop"})),t},Lo=e=>{let{bgGroupId:t,filterValue:n,height:o,id:i,left:r,maskId:a,style:c,top:s,width:d}=e,f=Sa(n);if(!f)return"";let p=`satori_bf-${i}`,g=`satori_bfc-${i}`,b=v("filter",{height:"200%",id:p,width:"200%",x:"-50%",y:"-50%"},f),S=it({height:o,left:r,top:s,width:d},c),x=S?v("path",{d:S}):v("rect",{height:o,width:d,x:r,y:s}),_=v("clipPath",{id:g},x),O=v("defs",{},b+_),P=v("use",{filter:`url(#${p})`,href:`#${t}`}),M={"clip-path":`url(#${g})`};return a&&(M.mask=`url(#${a})`),O+v("g",M,P)};var Wo=String.raw,No=Wo`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Oo=()=>new RegExp(Wo`\p{RI}{2}|(?)${No}(?:\u200D${No})*`,"gu");var wa=new RegExp(Oo(),"u"),fr={emoji:wa,symbol:new RegExp("\\p{Symbol}","u"),math:new RegExp("\\p{Math}","u")},cr={"ja-JP":new RegExp("\\p{scx=Hira}|\\p{scx=Kana}|\\p{scx=Han}|[\\u3000]|[\\uFF00-\\uFFEF]","u"),"ko-KR":new RegExp("\\p{scx=Hangul}","u"),"zh-CN":new RegExp("\\p{scx=Han}","u"),"zh-TW":new RegExp("\\p{scx=Han}","u"),"zh-HK":new RegExp("\\p{scx=Han}","u"),"th-TH":new RegExp("\\p{scx=Thai}","u"),"bn-IN":new RegExp("\\p{scx=Bengali}","u"),"ar-AR":new RegExp("\\p{scx=Arabic}","u"),"ta-IN":new RegExp("\\p{scx=Tamil}","u"),"ml-IN":new RegExp("\\p{scx=Malayalam}","u"),"he-IL":new RegExp("\\p{scx=Hebrew}","u"),"te-IN":new RegExp("\\p{scx=Telugu}","u"),devanagari:new RegExp("\\p{scx=Devanagari}","u"),kannada:new RegExp("\\p{scx=Kannada}","u")},Cn=Object.keys({...cr,...fr});function Bo(e){return Cn.includes(e)}function Fo(e,t){for(let o of Object.keys(fr))if(fr[o].test(e))return[o];let n=Object.keys(cr).filter(o=>cr[o].test(e));if(n.length===0)return["unknown"];if(t){let o=n.findIndex(i=>i===t);o!==-1&&(n.splice(o,1),n.unshift(t))}return n}function $o(e){if(e)return Cn.find(t=>t.toLowerCase().startsWith(e.toLowerCase()))}async function*nn(e,t){var Ne;let n=await mt(),{id:o,inheritedStyle:i,parent:r,font:a,debug:c,locale:s,embedFont:d=!0,graphemeImages:f,canLoadAdditionalAssets:p}=t;if(e===null||typeof e>"u")return yield,yield,"";if(!Ct(e)||kr(e.type)){let B;if(!Ct(e))B=ir(String(e),t),yield(await B.next()).value;else{if(Rr(e.type))throw new Error("Class component is not supported.");let Y;Wn(e.type)?Y=e.type.render:Y=e.type,B=nn(await Y(e.props),t),yield(await B.next()).value}await B.next();let ie=yield;return(await B.next(ie)).value}let{type:g,props:b}=e,S=g;if(b&&Ir(b))throw new Error("dangerouslySetInnerHTML property is not supported. See documentation for more information https://github.com/vercel/satori#jsx.");let{style:x,children:_,lang:O=s}=b||{},P=$o(O),M=n.Node.create();r.insertChild(M,r.getChildCount());let[E,k]=await Qn(M,S,i,x,b),$=E.transform===i.transform;if($||(E.transform.__parent=i.transform),(E.overflow==="hidden"||E.clipPath&&E.clipPath!=="none")&&(k._inheritedClipPathId=`satori_cp-${o}`,k._inheritedMaskId=`satori_om-${o}`),E.maskImage&&(k._inheritedMaskId=`satori_mi-${o}`),E.backdropFilter&&t.onBackdropFilterDetected&&t.onBackdropFilterDetected({filter:E.backdropFilter,inheritedStyle:k,node:M,style:E}),E.backgroundClip==="text"){let B={value:""};k._inheritedBackgroundClipTextPath=B,E._inheritedBackgroundClipTextPath=B,E.backgroundImage&&(k._inheritedBackgroundClipTextHasBackground="true",E._inheritedBackgroundClipTextHasBackground="true")}let A=_r(_),L=[],W={},j=0,X=[];for(let B of A){let ie=j,Y=nn(B,{id:o+"-"+j++,parentStyle:E,inheritedStyle:k,isInheritingTransform:!0,parent:M,font:a,embedFont:d,debug:c,graphemeImages:f,canLoadAdditionalAssets:p,locale:P,onNodeDetected:t.onNodeDetected,onBackdropFilterDetected:ae=>{W[ie]=ae}});p?X.push(...(await Y.next()).value||[]):await Y.next(),L.push(Y)}yield X;for(let B of L)await B.next();let[he,oe]=yield,{left:ce,top:ue,width:ke,height:K}=M.getComputedLayout();ce+=he,ue+=oe;let z="",Ie="",De="",{children:le,...Se}=b;if((Ne=t.onNodeDetected)==null||Ne.call(t,{left:ce,top:ue,width:ke,height:K,type:S,props:Se,key:e.key,textContent:Ct(le)?void 0:le}),S==="img"){let B=E.__src;Ie=await tn({id:o,left:ce,top:ue,width:ke,height:K,src:B,isInheritingTransform:$,debug:c},E,k)}else if(S==="svg"){let B=E.color,ie=await Zr(e,B);Ie=await tn({id:o,left:ce,top:ue,width:ke,height:K,src:ie,isInheritingTransform:$,debug:c},E,k)}else{let B=x==null?void 0:x.display;if(S==="div"&&_&&typeof _!="string"&&B!=="flex"&&B!=="none"&&B!=="contents")throw new Error('Expected <div> to have explicit "display: flex", "display: contents", or "display: none" if it has more than one child node.');Ie=await tn({id:o,left:ce,top:ue,width:ke,height:K,isInheritingTransform:$,debug:c},E,k)}for(let B=0;B<L.length;B++){if(W[B]){let ie=W[B],Y=ie.node.getComputedLayout(),ae=ce+Y.left,F=ue+Y.top,se=Y.width,de=Y.height,Ee=`satori_bfbg-${o}-${B}`,Te=Ie+z;Ie=`<g id="${Ee}">${Te}</g>`,z="";let te=o+"-"+B,Re=ie.style.maskImage?`satori_mi-${te}`:void 0;z+=Lo({bgGroupId:Ee,filterValue:ie.filter,height:de,id:te,left:ae,maskId:Re,style:ie.style,top:F,width:se})}z+=(await L[B].next([ce,ue])).value}return E._inheritedBackgroundClipTextPath&&(De+=v("clipPath",{id:`satori_bct-${o}`,"clip-path":E._inheritedClipPathId?`url(#${E._inheritedClipPathId})`:void 0},E._inheritedBackgroundClipTextPath.value)),De+Ie+z}import rn from"@shuding/opentype.js";var Go="unknown";function va(e){let t=[],n=[0,0],o=[0,0],i=(r,a)=>{let c=r[0];for(let s=1;s<=a;s++){let d=s/a,f=Ea(r,d);t.push({from:c,to:f}),c=f}o=r[r.length-1]};for(let r of e){if(r.type==="M"){n=o=[r.x,r.y];continue}if(r.type==="L"){let a=[r.x,r.y];t.push({from:o,to:a}),o=a;continue}if(r.type==="Q"){i([o,[r.x1,r.y1],[r.x,r.y]],12);continue}if(r.type==="C"){i([o,[r.x1,r.y1],[r.x2,r.y2],[r.x,r.y]],16);continue}r.type==="Z"&&(t.push({from:o,to:n}),o=n)}return t}function Ea(e,t){let n=e;for(;n.length>1;){let o=[];for(let i=0;i<n.length-1;i++)o.push([n[i][0]+(n[i+1][0]-n[i][0])*t,n[i][1]+(n[i+1][1]-n[i][1])*t]);n=o}return n[0]}function Ta(e,t){if(!t)return[];let n=t.strokeWidth,o=t.underlineY-n*.25,i=t.underlineY+n*2.5,r=va(e);if(!r.length)return[];let a=i-o,c=Math.max(12,Math.ceil(a/.25)),s=a/c,d=o+s/2,f=new Set;for(let M=0;M<c;M++){let E=d+s*M,k=[];for(let $ of r){let[A,L]=$.from,[W,j]=$.to;if(L===j)continue;let X=Math.min(L,j),he=Math.max(L,j);if(E<X||E>=he)continue;let oe=(E-L)/(j-L),ce=A+(W-A)*oe;k.push(ce)}if(k.length){k.sort(($,A)=>$-A);for(let $=0;$<k.length-1;$+=2){let A=Math.min(k[$],k[$+1]),L=Math.max(k[$],k[$+1]),W=Math.floor(A),j=Math.ceil(L);for(let X=W;X<j;X++)f.add(X)}}}if(!f.size)return[];let p=Array.from(f.values()).sort((M,E)=>M-E),g=[],b=p[0],S=p[0];for(let M=1;M<p.length;M++){let E=p[M];E>S+1&&(g.push([b,S+1]),b=E),S=E}g.push([b,S+1]);let x=[],_=n*.6,O=g[0][0],P=g[g.length-1][1];for(let[M,E]of g){let k=Math.min(M,O)-_,$=Math.max(E,P)+_;x.push({x1:k,x2:$,y1:o,y2:i})}return x}function Ra(e,t,[n,o],[i,r]){if(n!==i)return n?!i||n===e?-1:i===e?1:e===400&&n===500||e===500&&n===400?-1:e===400&&i===500||e===500&&i===400?1:e<400?n<e&&i<e?i-n:n<e?-1:i<e?1:n-i:e<n&&e<i?n-i:e<n?-1:e<i?1:i-n:1;if(o!==r){if(o===t)return-1;if(r===t)return 1}return-1}var dr=new WeakMap,on=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),typeof n=="string"&&(n=Number.parseInt(n,10));let i=[...this.fonts.get(t)],r=i[0];for(let a=1;a<i.length;a++){let[,c,s]=r,[,d,f]=i[a];Ra(n,o,[c,s],[d,f])>0&&(r=i[a])}return{font:r[0],weight:r[1]}}addFonts(t){for(let n of t){let{name:o,data:i,lang:r}=n;if(r&&!Bo(r))throw new Error(`Invalid value for props \`lang\`: "${r}". The value must be one of the following: ${Cn.join(", ")}.`);let a=r??Go,c;if(dr.has(i))c=dr.get(i);else{c=rn.parse("buffer"in i?i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength):i,{lowMemory:!0});let d=c.charToGlyphIndex;c.charToGlyphIndex=f=>{let p=d.call(c,f);return p===0&&c._trackBrokenChars&&c._trackBrokenChars.push(f),p},dr.set(i,c)}this.defaultFont||(this.defaultFont=c);let s=`${o.toLowerCase()}_${a}`;this.fonts.has(s)||this.fonts.set(s,[]),this.fonts.get(s).push([c,n.weight,n.style])}}getEngine(t=16,n="normal",{fontFamily:o="sans-serif",fontWeight:i=400,fontStyle:r="normal"},a){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(A=>A.toLowerCase());let c=[],s;o.forEach(A=>{let L=this.get({name:A,weight:i,style:r});if(L){c.push(L.font),c.length===1&&(s=L.weight);return}let W=this.get({name:A+"_unknown",weight:i,style:r});if(W){c.push(W.font),c.length===1&&(s=W.weight);return}});let d=Array.from(this.fonts.keys()),f=[],p=[],g=[],b=(A,L)=>{L&&(A.push(L.font),s===void 0&&(s=L.weight))};for(let A of d)if(!o.includes(A))if(a){let L=ka(A);L?L===a?b(f,this.get({name:A,weight:i,style:r})):b(p,this.get({name:A,weight:i,style:r})):b(g,this.get({name:A,weight:i,style:r}))}else b(g,this.get({name:A,weight:i,style:r}));let S=new Map,x=(A,L=!0)=>{let W=[...c,...g,...f,...L?p:[]];if(typeof A>"u")return L?W[W.length-1]:void 0;let j=A.charCodeAt(0);if(S.has(j))return S.get(j);let X=W.find((he,oe)=>!!he.charToGlyphIndex(A)||L&&oe===W.length-1);return X&&S.set(j,X),X},_=(A,L=!1)=>{var j,X;return((L?(X=(j=A.tables)==null?void 0:j.os2)==null?void 0:X.sTypoAscender:0)||A.ascender)/A.unitsPerEm*t},O=(A,L=!1)=>{var j,X;return((L?(X=(j=A.tables)==null?void 0:j.os2)==null?void 0:X.sTypoDescender:0)||A.descender)/A.unitsPerEm*t},P=(A,L=!1)=>{var W,j;if(typeof n=="string"&&n==="normal"){let X=(L?(j=(W=A.tables)==null?void 0:W.os2)==null?void 0:j.sTypoLineGap:0)||0;return _(A,L)-O(A,L)+X/A.unitsPerEm*t}else if(typeof n=="number")return t*n},M=A=>x(A,!1),E,k=i==="bold"?700:i==="normal"?400:Number(i);if(k>=600&&(!s||s<600)){let A=k-(s||400);E=t*.05*(A/300)}return{fauxBoldStrokeWidth:E,has:A=>{if(A===`
|
|
5
5
|
`)return!0;let L=M(A);return L?(L._trackBrokenChars=[],L.stringToGlyphs(A),L._trackBrokenChars.length?(L._trackBrokenChars=void 0,!1):!0):!1},baseline:(A,L=typeof A>"u"?c[0]:x(A))=>{let W=_(L),j=O(L),X=W-j;return W+(P(L)-X)/2},height:(A,L=typeof A>"u"?c[0]:x(A))=>P(L),measure:(A,L)=>this.measure(x,A,L),getSVG:(A,L,W)=>this.getSVG(x,A,L,W)}}patchFontFallbackResolver(t,n){let o=[];t._trackBrokenChars=o;let i=t.stringToGlyphs;return t.stringToGlyphs=(r,...a)=>{let c=i.call(t,r,...a);for(let s=0;s<c.length;s++)if(c[s].unicode===void 0){let d=o.shift(),f=n(d);if(f!==t){let p=f.charToGlyph(d),g=t.unitsPerEm/f.unitsPerEm,b=new rn.Path;b.unitsPerEm=t.unitsPerEm,b.commands=p.path.commands.map(x=>{let _={...x};for(let O in _)typeof _[O]=="number"&&(_[O]*=g);return _});let S=new rn.Glyph({...p,advanceWidth:p.advanceWidth*g,xMin:p.xMin*g,xMax:p.xMax*g,yMin:p.yMin*g,yMax:p.yMax*g,path:b});c[s]=S}}return c},()=>{t.stringToGlyphs=i,t._trackBrokenChars=void 0}}measure(t,n,{fontSize:o,letterSpacing:i=0}){let r=t(n),a=this.patchFontFallbackResolver(r,t);try{return r.getAdvanceWidth(n,o,{letterSpacing:i/o})}finally{a()}}getSVG(t,n,{fontSize:o,top:i,left:r,letterSpacing:a=0},c){let s=t(n),d=this.patchFontFallbackResolver(s,t);try{if(o===0)return{path:"",boxes:[]};let f=new rn.Path,p=[],g={letterSpacing:a/o},b=new WeakMap;return s.forEachGlyph(n.replace(/\n/g,""),r,i,o,g,function(S,x,_,O){let P;if(!b.has(S))P=S.getPath(x,_,O,g),b.set(S,[x,_,P]);else{let[E,k,$]=b.get(S);P=new rn.Path,P.commands=$.commands.map(A=>{let L={...A};for(let W in L)typeof L[W]=="number"&&((W==="x"||W==="x1"||W==="x2")&&(L[W]+=x-E),(W==="y"||W==="y1"||W==="y2")&&(L[W]+=_-k));return L})}let M=c?Ta(P.commands,c):[];M.length&&p.push(...M),f.extend(P)}),{path:f.toPathData(1),boxes:p}}finally{d()}}};function ka(e){let t=e.split("_"),n=t[t.length-1];return n===Go?void 0:n}function pr({width:e,height:t,content:n}){return v("svg",{width:e,height:t,viewBox:`0 0 ${e} ${t}`,xmlns:"http://www.w3.org/2000/svg"},n)}var mr=new WeakMap;async function Uo(e,t){let n=await mt();if(!n||!n.Node)throw new Error("Satori is not initialized: expect `yoga` to be loaded, got "+n);t.fonts=t.fonts||[];let o;mr.has(t.fonts)?o=mr.get(t.fonts):mr.set(t.fonts,o=new on(t.fonts));let i="width"in t?t.width:void 0,r="height"in t?t.height:void 0,a=Ia(n,t.pointScaleFactor);i&&a.setWidth(i),r&&a.setHeight(r),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 c={...t.graphemeImages},s=new Set;ot.clear(),Ht.clear(),await Jr(e);let d=nn(e,{id:"id",parentStyle:{},inheritedStyle:{fontSize:16,fontWeight:"normal",fontFamily:"serif",fontStyle:"normal",lineHeight:"normal",color:"black",opacity:1,whiteSpace:"normal",_viewportWidth:i,_viewportHeight:r},parent:a,font:o,embedFont:t.embedFont,debug:t.debug,graphemeImages:c,canLoadAdditionalAssets:!!t.loadAdditionalAsset,onNodeDetected:t.onNodeDetected}),f=(await d.next()).value;if(t.loadAdditionalAsset&&f.length){let S=_a(f),x=[],_={};await Promise.all(Object.entries(S).flatMap(([O,P])=>P.map(M=>{let E=`${O}_${M}`;return s.has(E)?null:(s.add(E),t.loadAdditionalAsset(O,M).then(k=>{typeof k=="string"?_[M]=k:k&&(Array.isArray(k)?x.push(...k):x.push(k))}))}))),o.addFonts(x),Object.assign(c,_)}await d.next(),a.calculateLayout(i,r,n.DIRECTION_LTR);let p=(await d.next([0,0])).value,g=a.getComputedWidth(),b=a.getComputedHeight();return a.freeRecursive(),pr({width:g,height:b,content:p})}function Ia(e,t){if(t){let n=e.Config.create();return n.setPointScaleFactor(t),e.Node.createWithConfig(n)}else return e.Node.create()}function _a(e){let t={},n={};for(let{word:o,locale:i}of e){let r=Fo(o,i).join("|");n[r]=n[r]||"",n[r]+=o}return Object.keys(n).forEach(o=>{t[o]=t[o]||[],o==="emoji"?t[o].push(...Do(Pe(n[o],"grapheme"))):(t[o][0]=t[o][0]||"",t[o][0]+=Do(Pe(n[o],"grapheme",o==="unknown"?void 0:o)).join(""))}),t}function Do(e){return Array.from(new Set(e))}export{Uo as default,gi as init};
|
|
6
6
|
//# sourceMappingURL=standalone.js.map
|