modern-text 1.10.0 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const Text = require('./shared/modern-text.BUyl2x8m.cjs');
3
+ const Text = require('./shared/modern-text.CwzFN2LS.cjs');
4
4
  require('modern-idoc');
5
5
  require('modern-path2d');
6
6
  require('modern-font');
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ ${t}`);return e.documentElement}else return r}const yo="px",mo=90,Xr=["mm","cm",
27
27
  xmlns="http://www.w3.org/2000/svg"
28
28
  >
29
29
  ${o}
30
- </svg>`}toSvgUrl(){return`data:image/svg+xml;base64,${btoa(this.toSvgString())}`}toSvg(){return new DOMParser().parseFromString(this.toSvgString(),"image/svg+xml").documentElement}toCanvas(t={}){const{pixelRatio:e=2,...n}=t,{left:i,top:o,width:s,height:a}=this.getBoundingBox(),l=document.createElement("canvas");l.width=s*e,l.height=a*e,l.style.width=`${s}px`,l.style.height=`${a}px`;const c=l.getContext("2d");return c&&(c.scale(e,e),c.translate(-i,-o),this.paths.forEach(u=>{u.drawTo(c,n)})),l}}class ui{constructor(t,e){this.text=t,this.context=e}pixelRatio=window?.devicePixelRatio||1;_setupView=()=>{const t=this.pixelRatio,e=this.context,{left:n,top:i,width:o,height:s}=this.text.boundingBox,a=e.canvas;a.dataset.viewBox=`${n} ${i} ${o} ${s}`,a.dataset.pixelRatio=String(t);const l=o,c=s;a.width=Math.max(1,Math.ceil(l*t)),a.height=Math.max(1,Math.ceil(c*t)),a.style.width=`${l}px`,a.style.height=`${c}px`,e.clearRect(0,0,a.width,a.height),e.scale(t,t),e.translate(-n,-i)};_setupColors=()=>{const{paragraphs:t,computedStyle:e,glyphBox:n}=this.text;this.uploadColor(e,n),t.forEach(i=>{this.uploadColor(i.computedStyle,i.lineBox),i.fragments.forEach(o=>{this.uploadColor(o.computedStyle,o.inlineBox)})})};setup=()=>(this._setupView(),this._setupColors(),this);_parseColor=(t,e)=>{if(typeof t=="string"&&_e(t)){const n=Or(t)[0];if(n)switch(n.type){case"linear-gradient":{let i=0;if(n.orientation)switch(n.orientation.type){case"angular":i=Number(n.orientation.value);break}const{left:o,top:s,width:a,height:l}=e,c=i*Math.PI/180,u=a*Math.sin(c),h=l*Math.cos(c),p=this.context.createLinearGradient(o+a/2-u,s+l/2+h,o+a/2+u,s+l/2-h);return n.colorStops.forEach(g=>{let f=0;if(g.length)switch(g.length.type){case"%":f=Number(g.length.value)/100;break}switch(g.type){case"rgb":p.addColorStop(f,`rgb(${g.value.join(", ")})`);break;case"rgba":p.addColorStop(f,`rgba(${g.value.join(", ")})`);break}}),p}}}return t};_uploadedStyles=["color","backgroundColor","textStrokeColor"];uploadColor=(t,e)=>{this._uploadedStyles.forEach(n=>{t[n]=this._parseColor(t[n],e)})};drawPath=(t,e={})=>{const n=this.context,{fontSize:i=this.text.computedStyle.fontSize,clipRect:o}=e;n.save(),n.beginPath(),o&&(n.rect(o.left,o.top,o.width,o.height),n.clip(),n.beginPath());const s=t.style,a=e.textStrokeColor??s.stroke,l=e.textStrokeWidth?e.textStrokeWidth*i:s.strokeWidth;t.drawTo(n,{...s,fill:e.color??s.fill,stroke:l===void 0||l>0?a:void 0,strokeWidth:l,strokeLinecap:"round",strokeLinejoin:"round",shadowOffsetX:(e.shadowOffsetX??0)*i,shadowOffsetY:(e.shadowOffsetY??0)*i,shadowBlur:(e.shadowBlur??0)*i,shadowColor:e.shadowColor}),n.restore()};drawCharacter=(t,e={})=>{const n=this.context,{computedStyle:i,path:o,glyphBox:s,isVertical:a,content:l,inlineBox:c,baseline:u}=t,h={...i,...e};if(s)this.drawPath(o,h);else{n.save(),n.beginPath();const p=o.style;Dn(n,{...p,fill:h.color??p.fill,stroke:h.textStrokeColor??p.stroke,strokeWidth:h.textStrokeWidth?h.textStrokeWidth*h.fontSize:p.strokeWidth,shadowOffsetX:(h.shadowOffsetX??0)*h.fontSize,shadowOffsetY:(h.shadowOffsetY??0)*h.fontSize,shadowBlur:(h.shadowBlur??0)*h.fontSize,shadowColor:h.shadowColor}),n.font=`${h.fontSize}px ${h.fontFamily}`,a?(n.textBaseline="middle",n.fillText(l,c.left,c.top+c.height/2)):(n.textBaseline="alphabetic",n.fillText(l,c.left,c.top+u)),n.restore()}}}var ut=Uint8Array,At=Uint16Array,Vn=Int32Array,an=new ut([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ln=new ut([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),jn=new ut([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fi=function(r,t){for(var e=new At(31),n=0;n<31;++n)e[n]=t+=1<<r[n-1];for(var i=new Vn(e[30]),n=1;n<30;++n)for(var o=e[n];o<e[n+1];++o)i[o]=o-e[n]<<5|n;return{b:e,r:i}},pi=fi(an,2),di=pi.b,Gn=pi.r;di[28]=258,Gn[258]=28;for(var gi=fi(ln,0),ua=gi.b,yi=gi.r,qn=new At(32768),K=0;K<32768;++K){var ne=(K&43690)>>1|(K&21845)<<1;ne=(ne&52428)>>2|(ne&13107)<<2,ne=(ne&61680)>>4|(ne&3855)<<4,qn[K]=((ne&65280)>>8|(ne&255)<<8)>>1}for(var Wt=(function(r,t,e){for(var n=r.length,i=0,o=new At(t);i<n;++i)r[i]&&++o[r[i]-1];var s=new At(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(e){a=new At(1<<t);var l=15-t;for(i=0;i<n;++i)if(r[i])for(var c=i<<4|r[i],u=t-r[i],h=s[r[i]-1]++<<u,p=h|(1<<u)-1;h<=p;++h)a[qn[h]>>l]=c}else for(a=new At(n),i=0;i<n;++i)r[i]&&(a[i]=qn[s[r[i]-1]++]>>15-r[i]);return a}),re=new ut(288),K=0;K<144;++K)re[K]=8;for(var K=144;K<256;++K)re[K]=9;for(var K=256;K<280;++K)re[K]=7;for(var K=280;K<288;++K)re[K]=8;for(var Be=new ut(32),K=0;K<32;++K)Be[K]=5;var fa=Wt(re,9,0),pa=Wt(re,9,1),da=Wt(Be,5,0),ga=Wt(Be,5,1),Wn=function(r){for(var t=r[0],e=1;e<r.length;++e)r[e]>t&&(t=r[e]);return t},Lt=function(r,t,e){var n=t/8|0;return(r[n]|r[n+1]<<8)>>(t&7)&e},Hn=function(r,t){var e=t/8|0;return(r[e]|r[e+1]<<8|r[e+2]<<16)>>(t&7)},Xn=function(r){return(r+7)/8|0},mi=function(r,t,e){return(e==null||e>r.length)&&(e=r.length),new ut(r.subarray(t,e))},ya=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],$t=function(r,t,e){var n=new Error(t||ya[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,$t),!e)throw n;return n},ma=function(r,t,e,n){var i=r.length,o=0;if(!i||t.f&&!t.l)return e||new ut(0);var s=!e,a=s||t.i!=2,l=t.i;s&&(e=new ut(i*3));var c=function(Pt){var Tt=e.length;if(Pt>Tt){var ht=new ut(Math.max(Tt*2,Pt));ht.set(e),e=ht}},u=t.f||0,h=t.p||0,p=t.b||0,g=t.l,f=t.d,y=t.m,d=t.n,P=i*8;do{if(!g){u=Lt(r,h,1);var M=Lt(r,h+1,3);if(h+=3,M)if(M==1)g=pa,f=ga,y=9,d=5;else if(M==2){var x=Lt(r,h,31)+257,S=Lt(r,h+10,15)+4,b=x+Lt(r,h+5,31)+1;h+=14;for(var D=new ut(b),z=new ut(19),E=0;E<S;++E)z[jn[E]]=Lt(r,h+E*3,7);h+=S*3;for(var F=Wn(z),N=(1<<F)-1,B=Wt(z,F,1),E=0;E<b;){var A=B[Lt(r,h,N)];h+=A&15;var w=A>>4;if(w<16)D[E++]=w;else{var W=0,O=0;for(w==16?(O=3+Lt(r,h,3),h+=2,W=D[E-1]):w==17?(O=3+Lt(r,h,7),h+=3):w==18&&(O=11+Lt(r,h,127),h+=7);O--;)D[E++]=W}}var L=D.subarray(0,x),V=D.subarray(x);y=Wn(L),d=Wn(V),g=Wt(L,y,1),f=Wt(V,d,1)}else $t(1);else{var w=Xn(h)+4,C=r[w-4]|r[w-3]<<8,v=w+C;if(v>i){l&&$t(0);break}a&&c(p+C),e.set(r.subarray(w,v),p),t.b=p+=C,t.p=h=v*8,t.f=u;continue}if(h>P){l&&$t(0);break}}a&&c(p+131072);for(var I=(1<<y)-1,R=(1<<d)-1,T=h;;T=h){var W=g[Hn(r,h)&I],_=W>>4;if(h+=W&15,h>P){l&&$t(0);break}if(W||$t(2),_<256)e[p++]=_;else if(_==256){T=h,g=null;break}else{var U=_-254;if(_>264){var E=_-257,$=an[E];U=Lt(r,h,(1<<$)-1)+di[E],h+=$}var q=f[Hn(r,h)&R],X=q>>4;q||$t(3),h+=q&15;var V=ua[X];if(X>3){var $=ln[X];V+=Hn(r,h)&(1<<$)-1,h+=$}if(h>P){l&&$t(0);break}a&&c(p+131072);var nt=p+U;if(p<V){var Zt=o-V,Dt=Math.min(V,nt);for(Zt+p<0&&$t(3);p<Dt;++p)e[p]=n[Zt+p]}for(;p<nt;++p)e[p]=e[p-V]}}t.l=g,t.p=T,t.b=p,t.f=u,g&&(u=1,t.m=y,t.d=f,t.n=d)}while(!u);return p!=e.length&&s?mi(e,0,p):e.subarray(0,p)},Qt=function(r,t,e){e<<=t&7;var n=t/8|0;r[n]|=e,r[n+1]|=e>>8},De=function(r,t,e){e<<=t&7;var n=t/8|0;r[n]|=e,r[n+1]|=e>>8,r[n+2]|=e>>16},Zn=function(r,t){for(var e=[],n=0;n<r.length;++n)r[n]&&e.push({s:n,f:r[n]});var i=e.length,o=e.slice();if(!i)return{t:bi,l:0};if(i==1){var s=new ut(e[0].s+1);return s[e[0].s]=1,{t:s,l:1}}e.sort(function(v,x){return v.f-x.f}),e.push({s:-1,f:25001});var a=e[0],l=e[1],c=0,u=1,h=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=e[e[c].f<e[h].f?c++:h++],l=e[c!=u&&e[c].f<e[h].f?c++:h++],e[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var p=o[0].s,n=1;n<i;++n)o[n].s>p&&(p=o[n].s);var g=new At(p+1),f=Yn(e[u-1],g,0);if(f>t){var n=0,y=0,d=f-t,P=1<<d;for(o.sort(function(x,S){return g[S.s]-g[x.s]||x.f-S.f});n<i;++n){var M=o[n].s;if(g[M]>t)y+=P-(1<<f-g[M]),g[M]=t;else break}for(y>>=d;y>0;){var w=o[n].s;g[w]<t?y-=1<<t-g[w]++-1:++n}for(;n>=0&&y;--n){var C=o[n].s;g[C]==t&&(--g[C],++y)}f=t}return{t:new ut(g),l:f}},Yn=function(r,t,e){return r.s==-1?Math.max(Yn(r.l,t,e+1),Yn(r.r,t,e+1)):t[r.s]=e},xi=function(r){for(var t=r.length;t&&!r[--t];);for(var e=new At(++t),n=0,i=r[0],o=1,s=function(l){e[n++]=l},a=1;a<=t;++a)if(r[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=r[a]}return{c:e.subarray(0,n),n:t}},Fe=function(r,t){for(var e=0,n=0;n<t.length;++n)e+=r[n]*t[n];return e},vi=function(r,t,e){var n=e.length,i=Xn(t+2);r[i]=n&255,r[i+1]=n>>8,r[i+2]=r[i]^255,r[i+3]=r[i+1]^255;for(var o=0;o<n;++o)r[i+o+4]=e[o];return(i+4+n)*8},wi=function(r,t,e,n,i,o,s,a,l,c,u){Qt(t,u++,e),++i[256];for(var h=Zn(i,15),p=h.t,g=h.l,f=Zn(o,15),y=f.t,d=f.l,P=xi(p),M=P.c,w=P.n,C=xi(y),v=C.c,x=C.n,S=new At(19),b=0;b<M.length;++b)++S[M[b]&31];for(var b=0;b<v.length;++b)++S[v[b]&31];for(var D=Zn(S,7),z=D.t,E=D.l,F=19;F>4&&!z[jn[F-1]];--F);var N=c+5<<3,B=Fe(i,re)+Fe(o,Be)+s,A=Fe(i,p)+Fe(o,y)+s+14+3*F+Fe(S,z)+2*S[16]+3*S[17]+7*S[18];if(l>=0&&N<=B&&N<=A)return vi(t,u,r.subarray(l,l+c));var W,O,L,V;if(Qt(t,u,1+(A<B)),u+=2,A<B){W=Wt(p,g,0),O=p,L=Wt(y,d,0),V=y;var I=Wt(z,E,0);Qt(t,u,w-257),Qt(t,u+5,x-1),Qt(t,u+10,F-4),u+=14;for(var b=0;b<F;++b)Qt(t,u+3*b,z[jn[b]]);u+=3*F;for(var R=[M,v],T=0;T<2;++T)for(var _=R[T],b=0;b<_.length;++b){var U=_[b]&31;Qt(t,u,I[U]),u+=z[U],U>15&&(Qt(t,u,_[b]>>5&127),u+=_[b]>>12)}}else W=fa,O=re,L=da,V=Be;for(var b=0;b<a;++b){var $=n[b];if($>255){var U=$>>18&31;De(t,u,W[U+257]),u+=O[U+257],U>7&&(Qt(t,u,$>>23&31),u+=an[U]);var q=$&31;De(t,u,L[q]),u+=V[q],q>3&&(De(t,u,$>>5&8191),u+=ln[q])}else De(t,u,W[$]),u+=O[$]}return De(t,u,W[256]),u+O[256]},xa=new Vn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bi=new ut(0),va=function(r,t,e,n,i,o){var s=o.z||r.length,a=new ut(n+s+5*(1+Math.ceil(s/7e3))+i),l=a.subarray(n,a.length-i),c=o.l,u=(o.r||0)&7;if(t){u&&(l[0]=o.r>>3);for(var h=xa[t-1],p=h>>13,g=h&8191,f=(1<<e)-1,y=o.p||new At(32768),d=o.h||new At(f+1),P=Math.ceil(e/3),M=2*P,w=function(kt){return(r[kt]^r[kt+1]<<P^r[kt+2]<<M)&f},C=new Vn(25e3),v=new At(288),x=new At(32),S=0,b=0,D=o.i||0,z=0,E=o.w||0,F=0;D+2<s;++D){var N=w(D),B=D&32767,A=d[N];if(y[B]=A,d[N]=B,E<=D){var W=s-D;if((S>7e3||z>24576)&&(W>423||!c)){u=wi(r,l,0,C,v,x,b,z,F,D-F,u),z=S=b=0,F=D;for(var O=0;O<286;++O)v[O]=0;for(var O=0;O<30;++O)x[O]=0}var L=2,V=0,I=g,R=B-A&32767;if(W>2&&N==w(D-R))for(var T=Math.min(p,W)-1,_=Math.min(32767,D),U=Math.min(258,W);R<=_&&--I&&B!=A;){if(r[D+L]==r[D+L-R]){for(var $=0;$<U&&r[D+$]==r[D+$-R];++$);if($>L){if(L=$,V=R,$>T)break;for(var q=Math.min(R,$-2),X=0,O=0;O<q;++O){var nt=D-R+O&32767,Zt=y[nt],Dt=nt-Zt&32767;Dt>X&&(X=Dt,A=nt)}}}B=A,A=y[B],R+=B-A&32767}if(V){C[z++]=268435456|Gn[L]<<18|yi[V];var Pt=Gn[L]&31,Tt=yi[V]&31;b+=an[Pt]+ln[Tt],++v[257+Pt],++x[Tt],E=D+L,++S}else C[z++]=r[D],++v[r[D]]}}for(D=Math.max(D,E);D<s;++D)C[z++]=r[D],++v[r[D]];u=wi(r,l,c,C,v,x,b,z,F,D-F,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=d,o.p=y,o.i=D,o.w=E)}else{for(var D=o.w||0;D<s+c;D+=65535){var ht=D+65535;ht>=s&&(l[u/8|0]=c,ht=s),u=vi(l,u+1,r.subarray(D,ht))}o.i=s}return mi(a,0,n+Xn(u)+i)},Si=function(){var r=1,t=0;return{p:function(e){for(var n=r,i=t,o=e.length|0,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=n+=e[s];n=(n&65535)+15*(n>>16),i=(i&65535)+15*(i>>16)}r=n,t=i},d:function(){return r%=65521,t%=65521,(r&255)<<24|(r&65280)<<8|(t&255)<<8|t>>8}}},wa=function(r,t,e,n,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new ut(o.length+r.length);s.set(o),s.set(r,o.length),r=s,i.w=o.length}return va(r,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+t.mem,e,n,i)},Ci=function(r,t,e){for(;e;++t)r[t]=e,e>>>=8},ba=function(r,t){var e=t.level,n=e==0?0:e<6?1:e==9?3:2;if(r[0]=120,r[1]=n<<6|(t.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,t.dictionary){var i=Si();i.p(t.dictionary),Ci(r,2,i.d())}},Sa=function(r,t){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&$t(6,"invalid zlib data"),(r[1]>>5&1)==1&&$t(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function Ca(r,t){t||(t={});var e=Si();e.p(r);var n=wa(r,t,t.dictionary?6:2,4);return ba(n,t),Ci(n,n.length-4,e.d()),n}function Pa(r,t){return ma(r.subarray(Sa(r),-4),{i:2},t,t)}var Ma=typeof TextDecoder<"u"&&new TextDecoder,_a=0;try{Ma.decode(bi,{stream:!0}),_a=1}catch{}const Ta="modern-font";function Ue(r,t){if(!r)throw new Error(`[${Ta}] ${t}`)}function ka(r){if("buffer"in r){const t=r.buffer;return r.byteOffset>0||r.byteLength<r.buffer.byteLength?t.slice(r.byteOffset,r.byteOffset+r.byteLength):t}else return r}function xe(r){return"buffer"in r?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(r)}function Aa(r){let t="";for(let e=0,n=r.length,i;e<n;e++)i=r.charCodeAt(e),i!==0&&(t+=String.fromCharCode(i));return t}function cn(r){r=Aa(r);const t=[];for(let e=0,n=r.length,i;e<n;e++)i=r.charCodeAt(e),t.push(i>>8),t.push(i&255);return t}function Oa(r){let t="";for(let e=0,n=r.length;e<n;e++)r[e]<127?t+=String.fromCharCode(r[e]):t+=`%${(256+r[e]).toString(16).slice(1)}`;return unescape(t)}function Ia(r){let t="";for(let e=0,n=r.length;e<n;e+=2)t+=String.fromCharCode((r[e]<<8)+r[e+1]);return t}var Ea=Object.defineProperty,ft=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Ea(t,e,i),i};const hn={int8:1,int16:2,int32:4,uint8:1,uint16:2,uint32:4,float32:4,float64:8,fixed:4,longDateTime:8,char:1};function pt(){return function(r,t){Object.defineProperty(r.constructor.prototype,t,{get(){if(typeof t=="string"){if(t.startsWith("read"))return(...e)=>this.read(t.substring(4).toLowerCase(),...e);if(t.startsWith("write"))return(...e)=>this.write(t.substring(5).toLowerCase(),...e)}},configurable:!0,enumerable:!0})}}class lt extends DataView{constructor(t,e,n,i){super(ka(t),e,n),this.littleEndian=i}cursor=0;readColumn(t){if(t.size){const e=Array.from({length:t.size},(n,i)=>this.read(t.type,t.offset+i));switch(t.type){case"char":return e.join("");default:return e}}else return this.read(t.type,t.offset)}writeColumn(t,e){t.size?Array.from({length:t.size},(n,i)=>{this.write(t.type,e[i],t.offset+i)}):this.write(t.type,e,t.offset)}read(t,e=this.cursor,n=this.littleEndian){switch(t){case"char":return this.readChar(e);case"fixed":return this.readFixed(e,n);case"longDateTime":return this.readLongDateTime(e,n)}const i=`get${t.replace(/^\S/,l=>l.toUpperCase())}`,o=this,a=o[i]?.bind(o)?.(e,n);return this.cursor+=hn[t],a}readUint24(t=this.cursor){const[e,n,i]=this.readBytes(t,3);return(e<<16)+(n<<8)+i}readBytes(t,e){e==null&&(e=t,t=this.cursor);const n=[];for(let i=0;i<e;++i)n.push(this.getUint8(t+i));return this.cursor=t+e,n}readString(t,e){const n=this.readBytes(t,e);let i="";for(let o=0,s=n.length;o<s;o++)i+=String.fromCharCode(n[o]);return i}readFixed(t,e){const n=this.readInt32(t,e)/65536;return Math.ceil(n*1e5)/1e5}readLongDateTime(t=this.cursor,e){const n=this.readUint32(t+4,e),i=new Date;return i.setTime(n*1e3+-20775456e5),i}readChar(t){return this.readString(t,1)}write(t,e,n=this.cursor,i=this.littleEndian){switch(t){case"char":return this.writeChar(e,n);case"fixed":return this.writeFixed(e,n);case"longDateTime":return this.writeLongDateTime(e,n)}const o=`set${t.replace(/^\S/,c=>c.toUpperCase())}`,s=this,l=s[o]?.bind(s)?.(n,e,i);return this.cursor+=hn[t.toLowerCase()],l}writeString(t="",e=this.cursor){const n=t.replace(/[^\x00-\xFF]/g,"11").length;this.seek(e);for(let i=0,o=t.length,s;i<o;++i)s=t.charCodeAt(i)||0,s>127?this.writeUint16(s):this.writeUint8(s);return this.cursor+=n,this}writeChar(t,e){return this.writeString(t,e)}writeFixed(t,e){return this.writeInt32(Math.round(t*65536),e),this}writeLongDateTime(t,e=this.cursor){typeof t>"u"?t=-20775456e5:typeof t.getTime=="function"?t=t.getTime():/^\d+$/.test(t)?t=+t:t=Date.parse(t);const i=Math.round((t- -20775456e5)/1e3);return this.writeUint32(0,e),this.writeUint32(i,e+4),this}writeBytes(t,e=this.cursor){let n;if(Array.isArray(t)){n=t.length;for(let i=0;i<n;++i)this.setUint8(e+i,t[i])}else{const i=xe(t);n=i.byteLength;for(let o=0;o<n;++o)this.setUint8(e+o,i.getUint8(o))}return this.cursor=e+n,this}seek(t){return this.cursor=t,this}}ft([pt()],lt.prototype,"readInt8"),ft([pt()],lt.prototype,"readInt16"),ft([pt()],lt.prototype,"readInt32"),ft([pt()],lt.prototype,"readUint8"),ft([pt()],lt.prototype,"readUint16"),ft([pt()],lt.prototype,"readUint32"),ft([pt()],lt.prototype,"readFloat32"),ft([pt()],lt.prototype,"readFloat64"),ft([pt()],lt.prototype,"writeInt8"),ft([pt()],lt.prototype,"writeInt16"),ft([pt()],lt.prototype,"writeInt32"),ft([pt()],lt.prototype,"writeUint8"),ft([pt()],lt.prototype,"writeUint16"),ft([pt()],lt.prototype,"writeUint32"),ft([pt()],lt.prototype,"writeFloat32"),ft([pt()],lt.prototype,"writeFloat64");const Pi=new WeakMap;function m(r){const t=typeof r=="object"?r:{type:r},{size:e=1,type:n}=t;return(i,o)=>{if(typeof o!="string")return;let s=Pi.get(i);s||(s={columns:[],byteLength:0},Pi.set(i,s));const a={...t,name:o,byteLength:e*hn[n],offset:t.offset??s.columns.reduce((l,c)=>l+c.byteLength,0)};s.columns.push(a),s.byteLength=s.columns.reduce((l,c)=>l+hn[c.type]*(c.size??1),0),Object.defineProperty(i.constructor.prototype,o,{get(){return this.view.readColumn(a)},set(l){this.view.writeColumn(a,l)},configurable:!0,enumerable:!0})}}class Bt{view;constructor(t,e,n,i){this.view=new lt(t,e,n,i)}}class Kn extends Bt{get buffer(){return this.view.buffer}toBuffer(){return this.view.buffer.slice(this.view.byteOffset,this.view.byteOffset+this.view.byteLength)}toBlob(){return new Blob([new Uint8Array(this.view.buffer,this.view.byteOffset,this.view.byteLength)],{type:this.mimeType})}toFontFace(t){return new FontFace(t,this.view.buffer)}}var Ba=Object.defineProperty,wt=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Ba(t,e,i),i};const bt=class Ki extends Kn{format="EmbeddedOpenType";mimeType="application/vnd.ms-fontobject";static from(t){const e=t.sfnt,i=e.name.names,o=cn(i.fontFamily||""),s=o.length,a=cn(i.fontStyle||""),l=a.length,c=cn(i.version||""),u=c.length,h=cn(i.fullName||""),p=h.length,g=86+s+4+l+4+u+4+p+2+t.view.byteLength,f=new Ki(new ArrayBuffer(g),0,g,!0);f.EOTSize=f.view.byteLength,f.FontDataSize=t.view.byteLength,f.Version=131073,f.Flags=0,f.Charset=1,f.MagicNumber=20556,f.Padding1=0,f.CheckSumAdjustment=e.head.checkSumAdjustment;const y=e.os2;return y&&(f.FontPANOSE=y.fontPANOSE,f.Italic=y.fsSelection,f.Weight=y.usWeightClass,f.fsType=y.fsType,f.UnicodeRange=y.ulUnicodeRange,f.CodePageRange=y.ulCodePageRange),f.view.writeUint16(s),f.view.writeBytes(o),f.view.writeUint16(0),f.view.writeUint16(l),f.view.writeBytes(a),f.view.writeUint16(0),f.view.writeUint16(u),f.view.writeBytes(c),f.view.writeUint16(0),f.view.writeUint16(p),f.view.writeBytes(h),f.view.writeUint16(0),f.view.writeUint16(0),f.view.writeBytes(t.view),f}};wt([m("uint32")],bt.prototype,"EOTSize"),wt([m("uint32")],bt.prototype,"FontDataSize"),wt([m("uint32")],bt.prototype,"Version"),wt([m("uint32")],bt.prototype,"Flags"),wt([m({type:"uint8",size:10})],bt.prototype,"FontPANOSE"),wt([m("uint8")],bt.prototype,"Charset"),wt([m("uint8")],bt.prototype,"Italic"),wt([m("uint32")],bt.prototype,"Weight"),wt([m("uint16")],bt.prototype,"fsType"),wt([m("uint16")],bt.prototype,"MagicNumber"),wt([m({type:"uint8",size:16})],bt.prototype,"UnicodeRange"),wt([m({type:"uint8",size:8})],bt.prototype,"CodePageRange"),wt([m("uint32")],bt.prototype,"CheckSumAdjustment"),wt([m({type:"uint8",size:16})],bt.prototype,"Reserved"),wt([m("uint16")],bt.prototype,"Padding1");var Da=Object.defineProperty,un=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Da(t,e,i),i};class Le extends Bt{constructor(t,e){super(t,e,16)}}un([m({type:"char",size:4})],Le.prototype,"tag"),un([m("uint32")],Le.prototype,"checkSum"),un([m("uint32")],Le.prototype,"offset"),un([m("uint32")],Le.prototype,"length");const Qn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],Fa=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];class Mi{index;name;isComposite=!1;components=[];pathCommands=[];constructor(t){const e={...t};if(this.index=e.index??0,e.name===".notdef"?e.unicode=void 0:e.name===".null"&&(e.unicode=0),e.unicode===0&&e.name!==".null")throw new Error('The unicode value "0" is reserved for the glyph name ".null" and cannot be used by any other glyph.');this.name=e.name??null,e.unicode&&(this.unicode=e.unicode),e.unicodes?this.unicodes=e.unicodes:e.unicode&&(this.unicodes=[e.unicode])}getPathCommands(t=0,e=0,n=72,i={},o){const s=1/(o?.unitsPerEm??1e3)*n,{xScale:a=s,yScale:l=s}=i,c=this.pathCommands,u=[];for(let h=0,p=c.length;h<p;h+=1){const g=c[h];g.type==="M"?u.push({type:"M",x:t+g.x*a,y:e+-g.y*l}):g.type==="L"?u.push({type:"L",x:t+g.x*a,y:e+-g.y*l}):g.type==="Q"?u.push({type:"Q",x1:t+g.x1*a,y1:e+-g.y1*l,x:t+g.x*a,y:e+-g.y*l}):g.type==="C"?u.push({type:"C",x1:t+g.x1*a,y1:e+-g.y1*l,x2:t+g.x2*a,y2:e+-g.y2*l,x:t+g.x*a,y:e+-g.y*l}):g.type==="Z"&&u.push({type:"Z"})}return u}}class Ua extends Mi{parse(t,e,n){const i=this,{nominalWidthX:o,defaultWidthX:s,gsubrsBias:a,subrsBias:l}=t,c=t.topDict.paintType,u=this.index;let h,p,g,f;const y=[],d=[];let P=0,M=!1,w=!1,C=s,v=0,x=0;function S(B,A){y.push({type:"L",x:B,y:A})}function b(B,A,W,O,L,V){y.push({type:"C",x1:B,y1:A,x2:W,y2:O,x:L,y:V})}function D(B,A){w&&c!==2&&z(),w=!0,y.push({type:"M",x:B,y:A})}function z(){y.push({type:"Z"})}function E(B){y.push(...B)}function F(){d.length%2!==0&&!M&&(C=d.shift()+o),P+=d.length>>1,d.length=0,M=!0}function N(B){let A,W,O,L,V,I,R,T,_,U,$,q,X=0;for(;X<B.length;){let nt=B[X++];switch(nt){case 1:F();break;case 3:F();break;case 4:d.length>1&&!M&&(C=d.shift()+o,M=!0),x+=d.pop(),D(v,x);break;case 5:for(;d.length>0;)v+=d.shift(),x+=d.shift(),S(v,x);break;case 6:for(;d.length>0&&(v+=d.shift(),S(v,x),d.length!==0);)x+=d.shift(),S(v,x);break;case 7:for(;d.length>0&&(x+=d.shift(),S(v,x),d.length!==0);)v+=d.shift(),S(v,x);break;case 8:for(;d.length>0;)h=v+d.shift(),p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),v=g+d.shift(),x=f+d.shift(),b(h,p,g,f,v,x);break;case 10:V=d.pop()+l,I=t.subrs[V],I&&N(I);break;case 11:return;case 12:switch(nt=B[X],X+=1,nt){case 35:h=v+d.shift(),p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),R=g+d.shift(),T=f+d.shift(),_=R+d.shift(),U=T+d.shift(),$=_+d.shift(),q=U+d.shift(),v=$+d.shift(),x=q+d.shift(),d.shift(),b(h,p,g,f,R,T),b(_,U,$,q,v,x);break;case 34:h=v+d.shift(),p=x,g=h+d.shift(),f=p+d.shift(),R=g+d.shift(),T=f,_=R+d.shift(),U=f,$=_+d.shift(),q=x,v=$+d.shift(),b(h,p,g,f,R,T),b(_,U,$,q,v,x);break;case 36:h=v+d.shift(),p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),R=g+d.shift(),T=f,_=R+d.shift(),U=f,$=_+d.shift(),q=U+d.shift(),v=$+d.shift(),b(h,p,g,f,R,T),b(_,U,$,q,v,x);break;case 37:h=v+d.shift(),p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),R=g+d.shift(),T=f+d.shift(),_=R+d.shift(),U=T+d.shift(),$=_+d.shift(),q=U+d.shift(),Math.abs($-v)>Math.abs(q-x)?v=$+d.shift():x=q+d.shift(),b(h,p,g,f,R,T),b(_,U,$,q,v,x);break;default:console.warn(`Glyph ${u}: unknown operator ${1200+nt}`),d.length=0}break;case 14:if(d.length>=4){const Zt=Qn[d.pop()],Dt=Qn[d.pop()],Pt=d.pop(),Tt=d.pop();if(Zt&&Dt){i.isComposite=!0,i.components=[];const ht=t.charset.indexOf(Zt),kt=t.charset.indexOf(Dt);i.components.push({glyphIndex:kt,dx:0,dy:0}),i.components.push({glyphIndex:ht,dx:Tt,dy:Pt}),E(n.get(kt).pathCommands);const Rt=JSON.parse(JSON.stringify(n.get(ht).pathCommands));for(let Vt=0;Vt<Rt.length;Vt+=1){const Ft=Rt[Vt];Ft.type!=="Z"&&(Ft.x+=Tt,Ft.y+=Pt),(Ft.type==="Q"||Ft.type==="C")&&(Ft.x1+=Tt,Ft.y1+=Pt),Ft.type==="C"&&(Ft.x2+=Tt,Ft.y2+=Pt)}E(Rt)}}else d.length>0&&!M&&(C=d.shift()+o,M=!0);w&&c!==2&&(z(),w=!1);break;case 18:F();break;case 19:case 20:F(),X+=P+7>>3;break;case 21:d.length>2&&!M&&(C=d.shift()+o,M=!0),x+=d.pop(),v+=d.pop(),D(v,x);break;case 22:d.length>1&&!M&&(C=d.shift()+o,M=!0),v+=d.pop(),D(v,x);break;case 23:F();break;case 24:for(;d.length>2;)h=v+d.shift(),p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),v=g+d.shift(),x=f+d.shift(),b(h,p,g,f,v,x);v+=d.shift(),x+=d.shift(),S(v,x);break;case 25:for(;d.length>6;)v+=d.shift(),x+=d.shift(),S(v,x);h=v+d.shift(),p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),v=g+d.shift(),x=f+d.shift(),b(h,p,g,f,v,x);break;case 26:for(d.length%2&&(v+=d.shift());d.length>0;)h=v,p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),v=g,x=f+d.shift(),b(h,p,g,f,v,x);break;case 27:for(d.length%2&&(x+=d.shift());d.length>0;)h=v+d.shift(),p=x,g=h+d.shift(),f=p+d.shift(),v=g+d.shift(),x=f,b(h,p,g,f,v,x);break;case 28:A=B[X],W=B[X+1],d.push((A<<24|W<<16)>>16),X+=2;break;case 29:V=d.pop()+a,I=t.gsubrs[V],I&&N(I);break;case 30:for(;d.length>0&&(h=v,p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),v=g+d.shift(),x=f+(d.length===1?d.shift():0),b(h,p,g,f,v,x),d.length!==0);)h=v+d.shift(),p=x,g=h+d.shift(),f=p+d.shift(),x=f+d.shift(),v=g+(d.length===1?d.shift():0),b(h,p,g,f,v,x);break;case 31:for(;d.length>0&&(h=v+d.shift(),p=x,g=h+d.shift(),f=p+d.shift(),x=f+d.shift(),v=g+(d.length===1?d.shift():0),b(h,p,g,f,v,x),d.length!==0);)h=v,p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),v=g+d.shift(),x=f+(d.length===1?d.shift():0),b(h,p,g,f,v,x);break;default:nt<32?console.warn(`Glyph ${u}: unknown operator ${nt}`):nt<247?d.push(nt-139):nt<251?(A=B[X],X+=1,d.push((nt-247)*256+A+108)):nt<255?(A=B[X],X+=1,d.push(-(nt-251)*256-A-108)):(A=B[X],W=B[X+1],O=B[X+2],L=B[X+3],X+=4,d.push((A<<24|W<<16|O<<8|L)/65536))}}}N(e),this.pathCommands=y,M&&(this.advanceWidth=C)}}class _i{constructor(t){this._sfnt=t}_items=[];get(t){const e=this._items[t];let n;if(e)n=e;else{n=this._get(t);const i=this._sfnt.hmtx.metrics[t];i&&(n.advanceWidth=n.advanceWidth||i.advanceWidth,n.leftSideBearing=n.leftSideBearing||i.leftSideBearing);const o=this._sfnt.cmap.glyphIndexToUnicodesMap.get(t);o&&(n.unicode??=o[0],n.unicodes??=o),this._items[t]=n}return n}}class La extends _i{get length(){return this._sfnt.cff.charStringsIndex.offsets.length-1}_get(t){const e=this._sfnt.cff,n=new Ua({index:t});return n.parse(e,e.charStringsIndex.get(t),this),n.name=e.charset[t],n}}var $a=Object.defineProperty,Ti=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&$a(t,e,i),i};class fn extends Bt{_offsets;get offsets(){return this._offsets??=this.readOffsets()}_objects;get objects(){return this._objects??=this.readObjects()}constructor(t,e,n,i){super(t,e,n,i),this._init()}_init(){const t=this.view,e=this.count,n=this.offsetSize;this.objectOffset=(e+1)*n+2,this.endOffset=t.byteOffset+this.objectOffset+this.offsets[e]}readOffsets(){const t=this.view,e=this.count,n=this.offsetSize;t.seek(3);const i=[];for(let o=0,s=e+1;o<s;o++){const a=this.view;let l=0;for(let c=0;c<n;c++)l<<=8,l+=a.readUint8();i.push(l)}return i}readObjects(){const t=[];for(let e=0,n=this.count;e<n;e++)t.push(this.get(e));return t}get(t){const e=this.offsets,n=this.objectOffset,i=n+e[t],s=n+e[t+1]-i;return this._isString?this.view.readString(i,s):this.view.readBytes(i,s)}}Ti([m("uint16")],fn.prototype,"count"),Ti([m("uint8")],fn.prototype,"offsetSize");class pn extends fn{_isString=!1}class ki extends fn{_isString=!0}const Na=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],za=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"],Ra=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],Va=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"];function dn(r,t){return t<=390?Na[t]:r[t-391]}function Q(r,t="number",e){return(n,i)=>{if(typeof i!="string")return;const o={type:t,operator:r,default:e??t==="number"?0:void 0};Object.defineProperty(n.constructor.prototype,i,{get(){return this._getProp(o)},set(s){this._setProp(o,s)},configurable:!0,enumerable:!0})}}class Ai extends Bt{_dict;get dict(){return this._dict??=this._readDict()}_stringIndex;setStringIndex(t){return this._stringIndex=t,this}_readFloatOperand(){const t=this.view;let e="";const n=15,i=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const o=t.readUint8(),s=o>>4,a=o&15;if(s===n||(e+=i[s],a===n))break;e+=i[a]}return Number.parseFloat(e)}_readOperand(t){const e=this.view;let n,i,o,s;if(t===28)return n=e.readUint8(),i=e.readUint8(),n<<8|i;if(t===29)return n=e.readUint8(),i=e.readUint8(),o=e.readUint8(),s=e.readUint8(),n<<24|i<<16|o<<8|s;if(t===30)return this._readFloatOperand();if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return n=e.readUint8(),(t-247)*256+n+108;if(t>=251&&t<=254)return n=e.readUint8(),-(t-251)*256-n-108;throw new Error(`invalid b0 ${t}, at: ${e.cursor}`)}_readDict(){const t=this.view;t.seek(0);let e=[];const n=t.cursor+t.byteLength,i={};for(;t.cursor<n;){let o=t.readUint8();o<=21?(o===12&&(o=1200+t.readUint8()),i[o]=e,e=[]):e.push(this._readOperand(o))}return i}_getProp(t){const e=this.dict[t.operator]??t.default;switch(t.type){case"number":return e[0];case"string":return dn(this._stringIndex?.objects??[],e[0]);case"number[]":return e}return e}_setProp(t,e){}}var ja=Object.defineProperty,Jn=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&ja(t,e,i),i};class gn extends Ai{}Jn([Q(19)],gn.prototype,"subrs"),Jn([Q(20)],gn.prototype,"defaultWidthX"),Jn([Q(21)],gn.prototype,"nominalWidthX");var Ga=Object.defineProperty,it=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Ga(t,e,i),i};class et extends Ai{}it([Q(0,"string")],et.prototype,"version"),it([Q(1,"string")],et.prototype,"notice"),it([Q(1200,"string")],et.prototype,"copyright"),it([Q(2,"string")],et.prototype,"fullName"),it([Q(3,"string")],et.prototype,"familyName"),it([Q(4,"string")],et.prototype,"weight"),it([Q(1201)],et.prototype,"isFixedPitch"),it([Q(1202)],et.prototype,"italicAngle"),it([Q(1203,"number",-100)],et.prototype,"underlinePosition"),it([Q(1204,"number",50)],et.prototype,"underlineThickness"),it([Q(1205)],et.prototype,"paintType"),it([Q(1206,"number",2)],et.prototype,"charstringType"),it([Q(1207,"number[]",[.001,0,0,.001,0,0])],et.prototype,"fontMatrix"),it([Q(13)],et.prototype,"uniqueId"),it([Q(5,"number[]",[0,0,0,0])],et.prototype,"fontBBox"),it([Q(1208)],et.prototype,"strokeWidth"),it([Q(14)],et.prototype,"xuid"),it([Q(15)],et.prototype,"charset"),it([Q(16)],et.prototype,"encoding"),it([Q(17)],et.prototype,"charStrings"),it([Q(18,"number[]",[0,0])],et.prototype,"private");function dt(r,t=r){return e=>{Jt.tableDefinitions.set(r,{tag:r,prop:t,class:e}),Object.defineProperty(Jt.prototype,t,{get(){return this.get(r)},set(n){return this.set(r,n)},configurable:!0,enumerable:!0})}}class Jt{static tableDefinitions=new Map;tables=new Map;tableViews=new Map;get hasGlyf(){return this.tableViews.has("glyf")}get names(){return this.name.names}get unitsPerEm(){return this.head.unitsPerEm}get ascender(){return this.hhea.ascent}get descender(){return this.hhea.descent}get createdTimestamp(){return this.head.created}get modifiedTimestamp(){return this.head.modified}get numGlyphs(){return this.maxp.numGlyphs}get unicodes(){return this.cmap.glyphIndexToUnicodesMap}get glyphs(){return this.hasGlyf?this.glyf.glyphs:this.cff.glyphs}charToGlyphIndex(t){let e=this.cmap.unicodeToGlyphIndexMap.get(t.codePointAt(0));if(e===void 0&&!this.hasGlyf){const{encoding:n,charset:i}=this.cff;e=i.indexOf(n[t.codePointAt(0)])}return e??0}charToGlyph(t){return this.glyphs.get(this.charToGlyphIndex(t))}textToGlyphIndexes(t){const e=[];for(const n of t)e.push(this.charToGlyphIndex(n));return e}textToGlyphs(t){const e=this.glyphs,n=this.textToGlyphIndexes(t),i=n.length,o=Array.from({length:i}),s=e.get(0);for(let a=0;a<i;a+=1)o[a]=e.get(n[a])||s;return o}getPathCommands(t,e,n,i,o){const s=[];return this.forEachGlyph(t,e,n,i,o,(a,l,c,u,h)=>{s.push(...a.getPathCommands(l,c,u,h,this))}),s}getAdvanceWidth(t,e,n){return this.forEachGlyph(t,0,0,e,n,()=>{})}forEachGlyph(t,e=0,n=0,i=72,o={},s){const a=1/this.unitsPerEm*i,l=this.textToGlyphs(t);for(let c=0;c<l.length;c+=1){const u=l[c];s.call(this,u,e,n,i,o),u.advanceWidth&&(e+=u.advanceWidth*a),o.letterSpacing?e+=o.letterSpacing*i:o.tracking&&(e+=o.tracking/1e3*i)}return e}constructor(t){(t instanceof Map?t:new Map(Object.entries(t))).forEach((n,i)=>{this.tableViews.set(i,new DataView(n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)))})}clone(){return new Jt(this.tableViews)}delete(t){const e=Jt.tableDefinitions.get(t);return e?(this.tableViews.delete(t),this.tables.delete(e.prop),this):this}set(t,e){const n=Jt.tableDefinitions.get(t);return n&&this.tables.set(n.prop,e),this.tableViews.set(t,e.view),this}get(t){const e=Jt.tableDefinitions.get(t);if(!e)return;let n=this.tables.get(e.prop);if(!n){const i=e.class;if(i){const o=this.tableViews.get(t);if(!o)return;n=new i(o.buffer,o.byteOffset,o.byteLength).setSFNT(this),this.tables.set(e.prop,n)}}return n}}class gt extends Bt{setSFNT(t){return this._sfnt=t,this}getSFNT(){return this._sfnt}}var qa=Object.defineProperty,Wa=Object.getOwnPropertyDescriptor,$e=(r,t,e,n)=>{for(var i=n>1?void 0:n?Wa(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&qa(t,e,i),i};let ve=class extends gt{_glyphs;get glyphs(){return this._glyphs??=new La(this._sfnt)}get gsubrs(){return this.globalSubrIndex.objects}get gsubrsBias(){return this._calcSubroutineBias(this.globalSubrIndex.objects)}privateDict;subrsIndex;get defaultWidthX(){return this.privateDict?.defaultWidthX??0}get nominalWidthX(){return this.privateDict?.nominalWidthX??0}get subrs(){return this.subrsIndex?.objects??[]}get subrsBias(){return this._calcSubroutineBias(this.subrs)}constructor(r,t,e,n){super(r,t,e,n),this._init()}_init(){const r=this.view,{buffer:t,byteOffset:e}=r,n=e+4;this.nameIndex=new ki(t,n),this.topDictIndex=new pn(t,this.nameIndex.endOffset),this.stringIndex=new ki(t,this.topDictIndex.endOffset),this.globalSubrIndex=new pn(t,this.stringIndex.endOffset),this.topDict=new et(new Uint8Array(this.topDictIndex.objects[0]).buffer).setStringIndex(this.stringIndex);const i=this.topDict.private[0],o=this.topDict.private[1];i&&(this.privateDict=new gn(t,e+o,i).setStringIndex(this.stringIndex),this.privateDict.subrs&&(this.subrsIndex=new pn(t,e+o+this.privateDict.subrs))),this.charStringsIndex=new pn(t,e+this.topDict.charStrings);const s=this.charStringsIndex.offsets.length-1;this.topDict.charset===0?this.charset=za:this.topDict.charset===1?this.charset=Ra:this.topDict.charset===2?this.charset=Va:this.charset=this._readCharset(e+this.topDict.charset,s,this.stringIndex.objects),this.topDict.encoding===0?this.encoding=Qn:this.topDict.encoding===1?this.encoding=Fa:this.encoding=this._readEncoding(e+this.topDict.encoding)}_readCharset(r,t,e){const n=this.view;n.seek(r);let i,o,s;t-=1;const a=[".notdef"],l=n.readUint8();if(l===0)for(i=0;i<t;i+=1)o=n.readUint16(),a.push(dn(e,o));else if(l===1)for(;a.length<=t;)for(o=n.readUint16(),s=n.readUint8(),i=0;i<=s;i+=1)a.push(dn(e,o)),o+=1;else if(l===2)for(;a.length<=t;)for(o=n.readUint16(),s=n.readUint16(),i=0;i<=s;i+=1)a.push(dn(e,o)),o+=1;else throw new Error(`Unknown charset format ${l}`);return a}_readEncoding(r){const t=this.view;t.seek(r);let e,n;const i={},o=t.readUint8();if(o===0){const s=t.readUint8();for(e=0;e<s;e+=1)n=t.readUint8(),i[n]=e}else if(o===1){const s=t.readUint8();for(n=1,e=0;e<s;e+=1){const a=t.readUint8(),l=t.readUint8();for(let c=a;c<=a+l;c+=1)i[c]=n,n+=1}}else console.warn(`unknown encoding format:${o}`);return i}_calcSubroutineBias(r){let t;return r.length<1240?t=107:r.length<33900?t=1131:t=32768,t}};$e([m("uint8")],ve.prototype,"majorVersion",2),$e([m("uint8")],ve.prototype,"minorVersion",2),$e([m("uint8")],ve.prototype,"headerSize",2),$e([m("uint8")],ve.prototype,"offsetSize",2),ve=$e([dt("CFF ","cff")],ve);var Ha=Object.defineProperty,yn=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Ha(t,e,i),i};const Ne=class Qi extends Bt{constructor(t=new ArrayBuffer(262),e){super(t,e,262)}static from(t){const e=new Qi;return e.format=0,e.length=e.view.byteLength,e.language=0,t.forEach((n,i)=>{i<256&&n<256&&e.view.writeUint8(n,6+i)}),e}getUnicodeToGlyphIndexMap(){const t=new Map;return this.glyphIndexArray.forEach((e,n)=>{t.set(n,e)}),t}};yn([m("uint16")],Ne.prototype,"format"),yn([m("uint16")],Ne.prototype,"length"),yn([m("uint16")],Ne.prototype,"language"),yn([m({type:"uint8",size:256})],Ne.prototype,"glyphIndexArray");let Oi=Ne;var Xa=Object.defineProperty,tr=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Xa(t,e,i),i};class mn extends Bt{get subHeaderKeys(){return this.view.seek(6),Array.from({length:256},()=>this.view.readUint16()/8)}get maxSubHeaderKey(){return this.subHeaderKeys.reduce((t,e)=>Math.max(t,e),0)}get subHeaders(){const t=this.maxSubHeaderKey;return this.view.seek(6+256*2),Array.from({length:t},(e,n)=>({firstCode:this.view.readUint16(),entryCount:this.view.readUint16(),idDelta:this.view.readUint16(),idRangeOffset:(this.view.readUint16()-(t-n)*8-2)/2}))}get glyphIndexArray(){const t=this.maxSubHeaderKey,e=6+256*2+t*8;this.view.seek(e);const n=(this.view.byteLength-e)/2;return Array.from({length:n},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(t){const e=new Map,n=this.subHeaderKeys,i=this.maxSubHeaderKey,o=this.subHeaders,s=this.glyphIndexArray,a=n.findIndex(c=>c===i);let l=0;for(let c=0;c<256;c++)if(n[c]===0)c>=a||c<o[0].firstCode||c>=o[0].firstCode+o[0].entryCount||o[0].idRangeOffset+(c-o[0].firstCode)>=s.length?l=0:(l=s[o[0].idRangeOffset+(c-o[0].firstCode)],l!==0&&(l=l+o[0].idDelta)),l!==0&&l<t&&e.set(c,l);else{const u=n[c];for(let h=0,p=o[u].entryCount;h<p;h++)if(o[u].idRangeOffset+h>=s.length?l=0:(l=s[o[u].idRangeOffset+h],l!==0&&(l=l+o[u].idDelta)),l!==0&&l<t){const g=(c<<8|h+o[u].firstCode)%65535;e.set(g,l)}}return e}}tr([m("uint16")],mn.prototype,"format"),tr([m("uint16")],mn.prototype,"length"),tr([m("uint16")],mn.prototype,"language");function Ii(r){return r>32767?r-65536:r<-32767?r+65536:r}function Ei(r,t){let e;const n=[];let i={};return r.forEach((o,s)=>{t&&s>t||((!e||s!==e.unicode+1||o!==e.glyphIndex+1)&&(e?(i.end=e.unicode,n.push(i),i={start:s,startId:o,delta:Ii(o-s)}):(i.start=Number(s),i.startId=o,i.delta=Ii(o-s))),e={unicode:s,glyphIndex:o})}),e&&(i.end=e.unicode,n.push(i)),n}var Za=Object.defineProperty,ue=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Za(t,e,i),i};const ie=class Ji extends Bt{get endCode(){const t=this.segCountX2;return this.view.seek(14),Array.from({length:t/2},()=>this.view.readUint16())}set endCode(t){this.view.seek(14),t.forEach(e=>this.view.writeUint16(e))}get reservedPad(){return this.view.readUint16(14+this.segCountX2)}set reservedPad(t){this.view.writeUint16(t,14+this.segCountX2)}get startCode(){const t=this.segCountX2;return this.view.seek(14+t+2),Array.from({length:t/2},()=>this.view.readUint16())}set startCode(t){this.view.seek(14+this.segCountX2+2),t.forEach(e=>this.view.writeUint16(e))}get idDelta(){const t=this.segCountX2;return this.view.seek(14+t+2+t),Array.from({length:t/2},()=>this.view.readUint16())}set idDelta(t){const e=this.segCountX2;this.view.seek(14+e+2+e),t.forEach(n=>this.view.writeUint16(n))}get idRangeOffsetCursor(){const t=this.segCountX2;return 14+t+2+t*2}get idRangeOffset(){const t=this.segCountX2;return this.view.seek(this.idRangeOffsetCursor),Array.from({length:t/2},()=>this.view.readUint16())}set idRangeOffset(t){this.view.seek(this.idRangeOffsetCursor),t.forEach(e=>this.view.writeUint16(e))}get glyphIndexArrayCursor(){const t=this.segCountX2;return 14+t+2+t*3}get glyphIndexArray(){const t=this.glyphIndexArrayCursor;this.view.seek(t);const e=(this.view.byteLength-t)/2;return Array.from({length:e},()=>this.view.readUint16())}static from(t){const e=Ei(t,65535),n=e.length+1,i=Math.floor(Math.log(n)/Math.LN2),o=2*2**i,s=new Ji(new ArrayBuffer(24+e.length*8));return s.format=4,s.length=s.view.byteLength,s.language=0,s.segCountX2=n*2,s.searchRange=o,s.entrySelector=i,s.rangeShift=2*n-o,s.endCode=[...e.map(a=>a.end),65535],s.reservedPad=0,s.startCode=[...e.map(a=>a.start),65535],s.idDelta=[...e.map(a=>a.delta),1],s.idRangeOffset=Array.from({length:n},()=>0),s}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.segCountX2/2,n=(this.glyphIndexArrayCursor-this.idRangeOffsetCursor)/2,i=this.startCode,o=this.endCode,s=this.idRangeOffset,a=this.idDelta,l=this.glyphIndexArray;for(let c=0;c<e;++c)for(let u=i[c],h=o[c];u<=h;++u)if(s[c]===0)t.set(u,(u+a[c])%65536);else{const p=c+s[c]/2+(u-i[c])-n,g=l[p];g!==0?t.set(u,(g+a[c])%65536):t.set(u,0)}return t.delete(65535),t}};ue([m("uint16")],ie.prototype,"format"),ue([m("uint16")],ie.prototype,"length"),ue([m("uint16")],ie.prototype,"language"),ue([m("uint16")],ie.prototype,"segCountX2"),ue([m("uint16")],ie.prototype,"searchRange"),ue([m("uint16")],ie.prototype,"entrySelector"),ue([m("uint16")],ie.prototype,"rangeShift");let Bi=ie;var Ya=Object.defineProperty,ze=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Ya(t,e,i),i};class we extends Bt{get glyphIndexArray(){return this.view.seek(12),Array.from({length:this.entryCount},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(){const t=this.glyphIndexArray,e=new Map;return t.forEach((n,i)=>{e.set(i,n)}),e}}ze([m("uint16")],we.prototype,"format"),ze([m("uint16")],we.prototype,"length"),ze([m("uint16")],we.prototype,"language"),ze([m("uint16")],we.prototype,"firstCode"),ze([m("uint16")],we.prototype,"entryCount");var Ka=Object.defineProperty,Re=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Ka(t,e,i),i};const be=class ts extends Bt{get groups(){const t=this.nGroups;return this.view.seek(16),Array.from({length:t},()=>({startCharCode:this.view.readUint32(),endCharCode:this.view.readUint32(),startGlyphCode:this.view.readUint32()}))}static from(t){const e=Ei(t),n=new ts(new ArrayBuffer(16+e.length*12));return n.format=12,n.reserved=0,n.length=n.view.byteLength,n.language=0,n.nGroups=e.length,e.forEach(i=>{n.view.writeUint32(i.start),n.view.writeUint32(i.end),n.view.writeUint32(i.startId)}),n}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.groups;for(let n=0,i=e.length;n<i;n++){const o=e[n];let s=o.startGlyphCode,a=o.startCharCode;const l=o.endCharCode;for(;a<=l;)t.set(a++,s++)}return t}};Re([m("uint16")],be.prototype,"format"),Re([m("uint16")],be.prototype,"reserved"),Re([m("uint32")],be.prototype,"length"),Re([m("uint32")],be.prototype,"language"),Re([m("uint32")],be.prototype,"nGroups");let Di=be;var Qa=Object.defineProperty,er=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Qa(t,e,i),i};class xn extends Bt{getVarSelectorRecords(){const t=this.numVarSelectorRecords;return this.view.seek(10),Array.from({length:t},()=>{const e={varSelector:this.view.readUint24(),defaultUVSOffset:this.view.readUint32(),unicodeValueRanges:[],nonDefaultUVSOffset:this.view.readUint32(),uVSMappings:[]};if(e.defaultUVSOffset){this.view.seek(e.defaultUVSOffset);const n=this.view.readUint32();e.unicodeValueRanges=Array.from({length:n},()=>({startUnicodeValue:this.view.readUint24(),additionalCount:this.view.readUint8()}))}if(e.nonDefaultUVSOffset){this.view.seek(e.nonDefaultUVSOffset);const n=this.view.readUint32();e.uVSMappings=Array.from({length:n},()=>({unicodeValue:this.view.readUint24(),glyphID:this.view.readUint16()}))}return e})}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.getVarSelectorRecords();for(let n=0,i=e.length;n<i;n++){const{uVSMappings:o}=e[n];o.forEach(s=>{t.set(s.unicodeValue,s.glyphID)})}return t}}er([m("uint16")],xn.prototype,"format"),er([m("uint32")],xn.prototype,"length"),er([m("uint32")],xn.prototype,"numVarSelectorRecords");var Ja=Object.defineProperty,tl=Object.getOwnPropertyDescriptor,nr=(r,t,e,n)=>{for(var i=n>1?void 0:n?tl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&Ja(t,e,i),i};let Ve=class extends gt{static from(r){const t=Array.from(r.keys()).some(u=>u>65535),e=Bi.from(r),n=Oi.from(r),i=t?Di.from(r):void 0,o=4+(i?32:24),s=o+e.view.byteLength,a=s+n.view.byteLength,l=[{platformID:0,platformSpecificID:3,offset:o},{platformID:1,platformSpecificID:0,offset:s},{platformID:3,platformSpecificID:1,offset:o},i&&{platformID:3,platformSpecificID:10,offset:a}].filter(Boolean),c=new Ve(new ArrayBuffer(4+8*l.length+e.view.byteLength+n.view.byteLength+(i?.view.byteLength??0)));return c.numberSubtables=l.length,c.view.seek(4),l.forEach(u=>{c.view.writeUint16(u.platformID),c.view.writeUint16(u.platformSpecificID),c.view.writeUint32(u.offset)}),c.view.writeBytes(e.view,o),c.view.writeBytes(n.view,s),i&&c.view.writeBytes(i.view,a),c}_unicodeToGlyphIndexMap;get unicodeToGlyphIndexMap(){return this._unicodeToGlyphIndexMap??=this.readunicodeToGlyphIndexMap()}_glyphIndexToUnicodesMap;get glyphIndexToUnicodesMap(){if(!this._glyphIndexToUnicodesMap){const r=new Map,t=this.unicodeToGlyphIndexMap,e=Array.from(t.keys());for(let n=0,i=e.length;n<i;n++){const o=e[n],s=t.get(o);r.has(s)?r.get(s).push(o):r.set(s,[o])}this._glyphIndexToUnicodesMap=r}return this._glyphIndexToUnicodesMap}readSubtables(){const r=this.numberSubtables;return this.view.seek(4),Array.from({length:r},()=>({platformID:this.view.readUint16(),platformSpecificID:this.view.readUint16(),offset:this.view.readUint32()})).map(t=>{this.view.seek(t.offset);const e=this.view.readUint16();let n;switch(e){case 0:n=new Oi(this.view.buffer,t.offset);break;case 2:n=new mn(this.view.buffer,t.offset,this.view.readUint16());break;case 4:n=new Bi(this.view.buffer,t.offset,this.view.readUint16());break;case 6:n=new we(this.view.buffer,t.offset,this.view.readUint16());break;case 12:n=new Di(this.view.buffer,t.offset,this.view.readUint32(t.offset+4));break;case 14:default:n=new xn(this.view.buffer,t.offset,this.view.readUint32());break}return{...t,format:e,view:n}})}readunicodeToGlyphIndexMap(){const r=this.readSubtables(),t=r.find(s=>s.format===0)?.view,e=r.find(s=>s.platformID===3&&s.platformSpecificID===3&&s.format===2)?.view,n=r.find(s=>s.platformID===3&&s.platformSpecificID===1&&s.format===4)?.view,i=r.find(s=>s.platformID===3&&s.platformSpecificID===10&&s.format===12)?.view,o=r.find(s=>s.platformID===0&&s.platformSpecificID===5&&s.format===14)?.view;return new Map([...t?.getUnicodeToGlyphIndexMap()??[],...e?.getUnicodeToGlyphIndexMap(this._sfnt.maxp.numGlyphs)??[],...n?.getUnicodeToGlyphIndexMap()??[],...i?.getUnicodeToGlyphIndexMap()??[],...o?.getUnicodeToGlyphIndexMap()??[]])}};nr([m("uint16")],Ve.prototype,"version",2),nr([m("uint16")],Ve.prototype,"numberSubtables",2),Ve=nr([dt("cmap")],Ve);class el extends Mi{_parseContours(t){const e=[];let n=[];for(let i=0;i<t.length;i+=1){const o=t[i];n.push(o),o.lastPointOfContour&&(e.push(n),n=[])}return Ue(n.length===0,"There are still points left in the current contour."),e}_transformPoints(t,e){const n=[];for(let i=0;i<t.length;i+=1){const o=t[i],s={x:e.xScale*o.x+e.scale10*o.y+e.dx,y:e.scale01*o.x+e.yScale*o.y+e.dy,onCurve:o.onCurve,lastPointOfContour:o.lastPointOfContour};n.push(s)}return n}_parseGlyphCoordinate(t,e,n,i,o){let s;return(e&i)>0?(s=t.view.readUint8(),(e&o)===0&&(s=-s),s=n+s):(e&o)>0?s=n:s=n+t.view.readInt16(),s}parse(t,e,n){t.view.seek(e);const i=this.numberOfContours=t.view.readInt16();if(this.xMin=t.view.readInt16(),this.yMin=t.view.readInt16(),this.xMax=t.view.readInt16(),this.yMax=t.view.readInt16(),i>0){const a=this.endPointIndices=[];for(let y=0;y<i;y++)a.push(t.view.readUint16());const l=this.instructionLength=t.view.readUint16();Ue(l<5e3,`Bad instructionLength:${l}`);const c=this.instructions=[];for(let y=0;y<l;++y)c.push(t.view.readUint8());const u=t.view.byteOffset,h=a[a.length-1]+1;Ue(h<2e4,`Bad numberOfCoordinates:${u}`);const p=[];let g,f=0;for(;f<h;)if(g=t.view.readUint8(),p.push(g),f++,g&8&&f<h){const y=t.view.readUint8();for(let d=0;d<y;d++)p.push(g),f++}if(Ue(p.length===h,`Bad flags length: ${p.length}, numberOfCoordinates: ${h}`),a.length>0){const y=[];let d;if(h>0){for(let w=0;w<h;w+=1)g=p[w],d={},d.onCurve=!!(g&1),d.lastPointOfContour=a.includes(w),y.push(d);let P=0;for(let w=0;w<h;w+=1)g=p[w],d=y[w],d.x=this._parseGlyphCoordinate(t,g,P,2,16),P=d.x;let M=0;for(let w=0;w<h;w+=1)g=p[w],d=y[w],d.y=this._parseGlyphCoordinate(t,g,M,4,32),M=d.y}this.points=y}else this.points=[]}else if(i===0)this.points=[];else{this.isComposite=!0,this.points=[],this.components=[];let a,l=!0;for(;l;){a=t.view.readUint16();const c={glyphIndex:t.view.readUint16(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(a&1)>0?(a&2)>0?(c.dx=t.view.readInt16(),c.dy=t.view.readInt16()):c.matchedPoints=[t.view.readUint16(),t.view.readUint16()]:(a&2)>0?(c.dx=t.view.readInt8(),c.dy=t.view.readInt8()):c.matchedPoints=[t.view.readUint8(),t.view.readUint8()],(a&8)>0?c.xScale=c.yScale=t.view.readInt16()/16384:(a&64)>0?(c.xScale=t.view.readInt16()/16384,c.yScale=t.view.readInt16()/16384):(a&128)>0&&(c.xScale=t.view.readInt16()/16384,c.scale01=t.view.readInt16()/16384,c.scale10=t.view.readInt16()/16384,c.yScale=t.view.readInt16()/16384),this.components.push(c),l=!!(a&32)}if(a&256){this.instructionLength=t.view.readUint16(),this.instructions=[];for(let c=0;c<this.instructionLength;c+=1)this.instructions.push(t.view.readUint8())}}if(this.isComposite)for(let a=0;a<this.components.length;a+=1){const l=this.components[a],c=n.get(l.glyphIndex);if(c.getPathCommands(),c.points){let u;if(l.matchedPoints===void 0)u=this._transformPoints(c.points,l);else{Ue(l.matchedPoints[0]>this.points.length-1||l.matchedPoints[1]>c.points.length-1,`Matched points out of range in ${this.name}`);const h=this.points[l.matchedPoints[0]];let p=c.points[l.matchedPoints[1]];const g={xScale:l.xScale,scale01:l.scale01,scale10:l.scale10,yScale:l.yScale,dx:0,dy:0};p=this._transformPoints([p],g)[0],g.dx=h.x-p.x,g.dy=h.y-p.y,u=this._transformPoints(c.points,g)}this.points=this.points.concat(u)}}const o=[],s=this._parseContours(this.points);for(let a=0,l=s.length;a<l;++a){const c=s[a];let u=c[c.length-1],h=c[0];u.onCurve?o.push({type:"M",x:u.x,y:u.y}):h.onCurve?o.push({type:"M",x:h.x,y:h.y}):o.push({type:"M",x:(u.x+h.x)*.5,y:(u.y+h.y)*.5});for(let p=0,g=c.length;p<g;++p)if(u=h,h=c[(p+1)%g],u.onCurve)o.push({type:"L",x:u.x,y:u.y});else{let f=h;h.onCurve||(f={x:(u.x+h.x)*.5,y:(u.y+h.y)*.5}),o.push({type:"Q",x1:u.x,y1:u.y,x:f.x,y:f.y})}o.push({type:"Z"})}this.pathCommands=o}}class nl extends _i{get length(){return this._sfnt.loca.locations.length}_get(t){const e=this._sfnt.loca.locations,n=e[t],i=new el({index:t});return n!==e[t+1]&&i.parse(this._sfnt.glyf,n,this),i}}var rl=Object.getOwnPropertyDescriptor,il=(r,t,e,n)=>{for(var i=n>1?void 0:n?rl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i};let rr=class extends gt{static from(r){const t=r.reduce((n,i)=>n+i.byteLength,0),e=new rr(new ArrayBuffer(t));return r.forEach(n=>{e.view.writeBytes(n)}),e}_glyphs;get glyphs(){return this._glyphs??=new nl(this._sfnt)}};rr=il([dt("glyf")],rr);var sl=Object.getOwnPropertyDescriptor,ol=(r,t,e,n)=>{for(var i=n>1?void 0:n?sl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i};let Fi=class extends gt{};Fi=ol([dt("GPOS","gpos")],Fi);var al=Object.defineProperty,ll=Object.getOwnPropertyDescriptor,fe=(r,t,e,n)=>{for(var i=n>1?void 0:n?ll(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&al(t,e,i),i};let se=class extends gt{};fe([m("uint16")],se.prototype,"majorVersion",2),fe([m("uint16")],se.prototype,"minorVersion",2),fe([m("uint16")],se.prototype,"scriptListOffset",2),fe([m("uint16")],se.prototype,"featureListOffset",2),fe([m("uint16")],se.prototype,"lookupListOffset",2),fe([m("uint16")],se.prototype,"featureVariationsOffset",2),se=fe([dt("GSUB","gsub")],se);var cl=Object.defineProperty,hl=Object.getOwnPropertyDescriptor,at=(r,t,e,n)=>{for(var i=n>1?void 0:n?hl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&cl(t,e,i),i};let st=class extends gt{constructor(r=new ArrayBuffer(54),t){super(r,t,Math.min(54,r.byteLength-(t??0)))}};at([m("fixed")],st.prototype,"version",2),at([m("fixed")],st.prototype,"fontRevision",2),at([m("uint32")],st.prototype,"checkSumAdjustment",2),at([m("uint32")],st.prototype,"magickNumber",2),at([m("uint16")],st.prototype,"flags",2),at([m("uint16")],st.prototype,"unitsPerEm",2),at([m({type:"longDateTime"})],st.prototype,"created",2),at([m({type:"longDateTime"})],st.prototype,"modified",2),at([m("int16")],st.prototype,"xMin",2),at([m("int16")],st.prototype,"yMin",2),at([m("int16")],st.prototype,"xMax",2),at([m("int16")],st.prototype,"yMax",2),at([m("uint16")],st.prototype,"macStyle",2),at([m("uint16")],st.prototype,"lowestRecPPEM",2),at([m("int16")],st.prototype,"fontDirectionHint",2),at([m("int16")],st.prototype,"indexToLocFormat",2),at([m("int16")],st.prototype,"glyphDataFormat",2),st=at([dt("head")],st);var ul=Object.defineProperty,fl=Object.getOwnPropertyDescriptor,St=(r,t,e,n)=>{for(var i=n>1?void 0:n?fl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&ul(t,e,i),i};let yt=class extends gt{constructor(r=new ArrayBuffer(36),t){super(r,t,Math.min(36,r.byteLength-(t??0)))}};St([m("fixed")],yt.prototype,"version",2),St([m("int16")],yt.prototype,"ascent",2),St([m("int16")],yt.prototype,"descent",2),St([m("int16")],yt.prototype,"lineGap",2),St([m("uint16")],yt.prototype,"advanceWidthMax",2),St([m("int16")],yt.prototype,"minLeftSideBearing",2),St([m("int16")],yt.prototype,"minRightSideBearing",2),St([m("int16")],yt.prototype,"xMaxExtent",2),St([m("int16")],yt.prototype,"caretSlopeRise",2),St([m("int16")],yt.prototype,"caretSlopeRun",2),St([m("int16")],yt.prototype,"caretOffset",2),St([m({type:"int16",size:4})],yt.prototype,"reserved",2),St([m("int16")],yt.prototype,"metricDataFormat",2),St([m("uint16")],yt.prototype,"numOfLongHorMetrics",2),yt=St([dt("hhea")],yt);var pl=Object.getOwnPropertyDescriptor,dl=(r,t,e,n)=>{for(var i=n>1?void 0:n?pl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i};let ir=class extends gt{static from(r){const t=r.length*4,e=new ir(new ArrayBuffer(t));return r.forEach(n=>{e.view.writeUint16(n.advanceWidth),e.view.writeUint16(n.leftSideBearing)}),e}_metrics;get metrics(){return this._metrics??=this.readMetrics()}readMetrics(){const r=this._sfnt.maxp.numGlyphs,t=this._sfnt.hhea.numOfLongHorMetrics;let e=0;const n=this.view;return n.seek(0),Array.from({length:r}).map((i,o)=>(o<t&&(e=n.readUint16()),{advanceWidth:e,leftSideBearing:n.readUint16()}))}};ir=dl([dt("hmtx")],ir);var gl=Object.getOwnPropertyDescriptor,yl=(r,t,e,n)=>{for(var i=n>1?void 0:n?gl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i};let Ui=class extends gt{};Ui=yl([dt("kern","kern")],Ui);var ml=Object.getOwnPropertyDescriptor,xl=(r,t,e,n)=>{for(var i=n>1?void 0:n?ml(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i};let sr=class extends gt{static from(r,t=1){const e=r.length*(t?4:2),n=new sr(new ArrayBuffer(e));return r.forEach(i=>{t?n.view.writeUint32(i):n.view.writeUint16(i/2)}),n}_locations;get locations(){return this._locations??=this.readLocations()}readLocations(){const r=this._sfnt.maxp.numGlyphs,t=this._sfnt.head.indexToLocFormat,e=this.view;return e.seek(0),Array.from({length:r}).map(()=>t?e.readUint32():e.readUint16()*2)}};sr=xl([dt("loca")],sr);var vl=Object.defineProperty,wl=Object.getOwnPropertyDescriptor,mt=(r,t,e,n)=>{for(var i=n>1?void 0:n?wl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&vl(t,e,i),i};let ct=class extends gt{constructor(r=new ArrayBuffer(32),t){super(r,t,Math.min(32,r.byteLength-(t??0)))}};mt([m("fixed")],ct.prototype,"version",2),mt([m("uint16")],ct.prototype,"numGlyphs",2),mt([m("uint16")],ct.prototype,"maxPoints",2),mt([m("uint16")],ct.prototype,"maxContours",2),mt([m("uint16")],ct.prototype,"maxComponentPoints",2),mt([m("uint16")],ct.prototype,"maxComponentContours",2),mt([m("uint16")],ct.prototype,"maxZones",2),mt([m("uint16")],ct.prototype,"maxTwilightPoints",2),mt([m("uint16")],ct.prototype,"maxStorage",2),mt([m("uint16")],ct.prototype,"maxFunctionDefs",2),mt([m("uint16")],ct.prototype,"maxInstructionDefs",2),mt([m("uint16")],ct.prototype,"maxStackElements",2),mt([m("uint16")],ct.prototype,"maxSizeOfInstructions",2),mt([m("uint16")],ct.prototype,"maxComponentElements",2),mt([m("uint16")],ct.prototype,"maxComponentDepth",2),ct=mt([dt("maxp")],ct);var bl=Object.defineProperty,Sl=Object.getOwnPropertyDescriptor,vn=(r,t,e,n)=>{for(var i=n>1?void 0:n?Sl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&bl(t,e,i),i};const Li={0:"copyright",1:"fontFamily",2:"fontSubFamily",3:"uniqueSubFamily",4:"fullName",5:"version",6:"postScriptName",7:"tradeMark",8:"manufacturer",9:"designer",10:"description",11:"urlOfFontVendor",12:"urlOfFontDesigner",13:"licence",14:"urlOfLicence",16:"preferredFamily",17:"preferredSubFamily",18:"compatibleFull",19:"sampleText"},or={Macintosh:1,Microsoft:3},Cl={Default:0},$i={UCS2:1};let je=class extends gt{_names;get names(){return this._names??=this.readNames()}readNames(){const r=this.count;this.view.seek(6);const t=[];for(let a=0;a<r;++a)t.push({platform:this.view.readUint16(),encoding:this.view.readUint16(),language:this.view.readUint16(),nameId:this.view.readUint16(),length:this.view.readUint16(),offset:this.view.readUint16()});const e=this.stringOffset;for(let a=0;a<r;++a){const l=t[a];l.name=this.view.readBytes(e+l.offset,l.length)}let n=or.Macintosh,i=Cl.Default,o=0;t.some(a=>a.platform===or.Microsoft&&a.encoding===$i.UCS2&&a.language===1033)&&(n=or.Microsoft,i=$i.UCS2,o=1033);const s={};for(let a=0;a<r;++a){const l=t[a];l.platform===n&&l.encoding===i&&l.language===o&&Li[l.nameId]&&(s[Li[l.nameId]]=o===0?Oa(l.name):Ia(l.name))}return s}};vn([m("uint16")],je.prototype,"format",2),vn([m("uint16")],je.prototype,"count",2),vn([m("uint16")],je.prototype,"stringOffset",2),je=vn([dt("name")],je);var Pl=Object.defineProperty,Ml=Object.getOwnPropertyDescriptor,G=(r,t,e,n)=>{for(var i=n>1?void 0:n?Ml(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&Pl(t,e,i),i};let j=class extends gt{get fontPANOSE(){return[this.bFamilyType,this.bSerifStyle,this.bWeight,this.bProportion,this.bContrast,this.bStrokeVariation,this.bArmStyle,this.bLetterform,this.bMidline,this.bXHeight]}};G([m("uint16")],j.prototype,"version",2),G([m("int16")],j.prototype,"xAvgCharWidth",2),G([m("uint16")],j.prototype,"usWeightClass",2),G([m("uint16")],j.prototype,"usWidthClass",2),G([m("uint16")],j.prototype,"fsType",2),G([m("uint16")],j.prototype,"ySubscriptXSize",2),G([m("uint16")],j.prototype,"ySubscriptYSize",2),G([m("uint16")],j.prototype,"ySubscriptXOffset",2),G([m("uint16")],j.prototype,"ySubscriptYOffset",2),G([m("uint16")],j.prototype,"ySuperscriptXSize",2),G([m("uint16")],j.prototype,"ySuperscriptYSize",2),G([m("uint16")],j.prototype,"ySuperscriptXOffset",2),G([m("uint16")],j.prototype,"ySuperscriptYOffset",2),G([m("uint16")],j.prototype,"yStrikeoutSize",2),G([m("uint16")],j.prototype,"yStrikeoutPosition",2),G([m("uint16")],j.prototype,"sFamilyClass",2),G([m({type:"uint8"})],j.prototype,"bFamilyType",2),G([m({type:"uint8"})],j.prototype,"bSerifStyle",2),G([m({type:"uint8"})],j.prototype,"bWeight",2),G([m({type:"uint8"})],j.prototype,"bProportion",2),G([m({type:"uint8"})],j.prototype,"bContrast",2),G([m({type:"uint8"})],j.prototype,"bStrokeVariation",2),G([m({type:"uint8"})],j.prototype,"bArmStyle",2),G([m({type:"uint8"})],j.prototype,"bLetterform",2),G([m({type:"uint8"})],j.prototype,"bMidline",2),G([m({type:"uint8"})],j.prototype,"bXHeight",2),G([m({type:"uint8",size:16})],j.prototype,"ulUnicodeRange",2),G([m({type:"char",size:4})],j.prototype,"achVendID",2),G([m("uint16")],j.prototype,"fsSelection",2),G([m("uint16")],j.prototype,"usFirstCharIndex",2),G([m("uint16")],j.prototype,"usLastCharIndex",2),G([m("int16")],j.prototype,"sTypoAscender",2),G([m("int16")],j.prototype,"sTypoDescender",2),G([m("int16")],j.prototype,"sTypoLineGap",2),G([m("uint16")],j.prototype,"usWinAscent",2),G([m("uint16")],j.prototype,"usWinDescent",2),G([m({offset:72,type:"uint8",size:8})],j.prototype,"ulCodePageRange",2),G([m({offset:72,type:"int16"})],j.prototype,"sxHeight",2),G([m("int16")],j.prototype,"sCapHeight",2),G([m("uint16")],j.prototype,"usDefaultChar",2),G([m("uint16")],j.prototype,"usBreakChar",2),G([m("uint16")],j.prototype,"usMaxContext",2),j=G([dt("OS/2","os2")],j);var _l=Object.defineProperty,Tl=Object.getOwnPropertyDescriptor,Ht=(r,t,e,n)=>{for(var i=n>1?void 0:n?Tl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&_l(t,e,i),i};let Nt=class extends gt{constructor(r=new ArrayBuffer(32),t,e){super(r,t,e)}};Ht([m("fixed")],Nt.prototype,"format",2),Ht([m("fixed")],Nt.prototype,"italicAngle",2),Ht([m("int16")],Nt.prototype,"underlinePosition",2),Ht([m("int16")],Nt.prototype,"underlineThickness",2),Ht([m("uint32")],Nt.prototype,"isFixedPitch",2),Ht([m("uint32")],Nt.prototype,"minMemType42",2),Ht([m("uint32")],Nt.prototype,"maxMemType42",2),Ht([m("uint32")],Nt.prototype,"minMemType1",2),Ht([m("uint32")],Nt.prototype,"maxMemType1",2),Nt=Ht([dt("post")],Nt);var kl=Object.defineProperty,Al=Object.getOwnPropertyDescriptor,Ct=(r,t,e,n)=>{for(var i=n>1?void 0:n?Al(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&kl(t,e,i),i};let xt=class extends gt{constructor(r=new ArrayBuffer(36),t){super(r,t,Math.min(36,r.byteLength-(t??0)))}};Ct([m("fixed")],xt.prototype,"version",2),Ct([m("int16")],xt.prototype,"vertTypoAscender",2),Ct([m("int16")],xt.prototype,"vertTypoDescender",2),Ct([m("int16")],xt.prototype,"vertTypoLineGap",2),Ct([m("int16")],xt.prototype,"advanceHeightMax",2),Ct([m("int16")],xt.prototype,"minTopSideBearing",2),Ct([m("int16")],xt.prototype,"minBottomSideBearing",2),Ct([m("int16")],xt.prototype,"yMaxExtent",2),Ct([m("int16")],xt.prototype,"caretSlopeRise",2),Ct([m("int16")],xt.prototype,"caretSlopeRun",2),Ct([m("int16")],xt.prototype,"caretOffset",2),Ct([m({type:"int16",size:4})],xt.prototype,"reserved",2),Ct([m("int16")],xt.prototype,"metricDataFormat",2),Ct([m("int16")],xt.prototype,"numOfLongVerMetrics",2),xt=Ct([dt("vhea")],xt);var Ol=Object.getOwnPropertyDescriptor,Il=(r,t,e,n)=>{for(var i=n>1?void 0:n?Ol(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i};let ar=class extends gt{static from(r){const t=r.length*4,e=new ar(new ArrayBuffer(t));return r.forEach(n=>{e.view.writeUint16(n.advanceHeight),e.view.writeInt16(n.topSideBearing)}),e}_metrics;get metrics(){return this._metrics??=this.readMetrics()}readMetrics(){const r=this._sfnt.maxp.numGlyphs,t=this._sfnt.vhea?.numOfLongVerMetrics??0,e=this.view;e.seek(0);let n=0;return Array.from({length:r}).map((i,o)=>(o<t&&(n=e.readUint16()),{advanceHeight:n,topSideBearing:e.readUint8()}))}};ar=Il([dt("vmtx")],ar);var El=Object.defineProperty,Ge=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&El(t,e,i),i};class Xt extends Kn{format="TrueType";mimeType="font/ttf";_sfnt;get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static signature=new Set([65536,1953658213,1954115633]);static is(t){return typeof t=="number"?this.signature.has(t):this.signature.has(xe(t).getUint32(0))}static checksum(t){const e=xe(t);let n=e.byteLength;for(;n%4;)n++;let i=0;for(let o=0,s=n/4;o<s;o+=4)o*4<n-4&&(i+=e.getUint32(o*4,!1));return i&4294967295}static from(t){const e=h=>h+3&-4,n=t.tableViews.size,i=Array.from(t.tableViews.values()).reduce((h,p)=>h+e(p.byteLength),0),o=new this(new ArrayBuffer(12+n*16+i));o.scalerType=65536,o.numTables=n;const s=Math.log(2);o.searchRange=Math.floor(Math.log(n)/s)*16,o.entrySelector=Math.floor(o.searchRange/s),o.rangeShift=n*16-o.searchRange;let a=12+n*16,l=0;const c=o.getDirectories();t.tableViews.forEach((h,p)=>{const g=c[l++];g.tag=p,g.checkSum=this.checksum(h),g.offset=a,g.length=h.byteLength,o.view.writeBytes(h,a),a+=e(g.length)});const u=o.createSFNT().head;return u.checkSumAdjustment=0,u.checkSumAdjustment=2981146554-this.checksum(o.view),o}getDirectories(){let t=this.view.byteOffset+12;return Array.from({length:this.numTables},()=>{const e=new Le(this.view.buffer,t);return t+=e.view.byteLength,e})}createSFNT(){return new Jt(this.getDirectories().reduce((t,e)=>(t[e.tag]=new DataView(this.view.buffer,this.view.byteOffset+e.offset,e.length),t),{}))}}Ge([m("uint32")],Xt.prototype,"scalerType"),Ge([m("uint16")],Xt.prototype,"numTables"),Ge([m("uint16")],Xt.prototype,"searchRange"),Ge([m("uint16")],Xt.prototype,"entrySelector"),Ge([m("uint16")],Xt.prototype,"rangeShift");class lr extends Xt{format="OpenType";mimeType="font/otf";static signature=new Set([1330926671]);static from(t){return super.from(t)}}var Bl=Object.defineProperty,qe=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Bl(t,e,i),i};class Se extends Bt{constructor(t,e){super(t,e,20)}}qe([m({type:"char",size:4})],Se.prototype,"tag"),qe([m("uint32")],Se.prototype,"offset"),qe([m("uint32")],Se.prototype,"compLength"),qe([m("uint32")],Se.prototype,"origLength"),qe([m("uint32")],Se.prototype,"origChecksum");var Dl=Object.defineProperty,Ot=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Dl(t,e,i),i};const _t=class dr extends Kn{format="WOFF";mimeType="font/woff";get subfontFormat(){return Xt.is(this.flavor)?"TrueType":lr.is(this.flavor)?"OpenType":"Open"}_sfnt;get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static signature=new Set([2001684038]);static is(t){return typeof t=="number"?this.signature.has(t):this.signature.has(xe(t).getUint32(0))}static checkSum(t){const e=xe(t),n=e.byteLength,i=Math.floor(n/4);let o=0,s=0;for(;s<i;)o+=e.getUint32(4*s++,!1);let a=n-i*4;if(a){let l=i*4;for(;a>0;)o+=e.getUint8(l)<<a*8,l++,a--}return o%4294967296}static from(t,e=new ArrayBuffer(0)){const n=h=>h+3&-4,i=[];t.tableViews.forEach((h,p)=>{const g=xe(Ca(new Uint8Array(h.buffer,h.byteOffset,h.byteLength)));i.push({tag:p,view:g.byteLength<h.byteLength?g:h,rawView:h})});const o=i.length,s=i.reduce((h,p)=>h+n(p.view.byteLength),0),a=new dr(new ArrayBuffer(44+20*o+s+e.byteLength));a.signature=2001684038,a.flavor=65536,a.length=a.view.byteLength,a.numTables=o,a.totalSFNTSize=12+16*o+i.reduce((h,p)=>h+n(p.rawView.byteLength),0);let l=44+o*20,c=0;const u=a.getDirectories();return i.forEach(h=>{const p=u[c++];p.tag=h.tag,p.offset=l,p.compLength=h.view.byteLength,p.origChecksum=dr.checkSum(h.rawView),p.origLength=h.rawView.byteLength,a.view.writeBytes(h.view,l),l+=n(p.compLength)}),a.view.writeBytes(e),a}getDirectories(){let t=44;return Array.from({length:this.numTables},()=>{const e=new Se(this.view.buffer,t);return t+=e.view.byteLength,e})}createSFNT(){return new Jt(this.getDirectories().reduce((t,e)=>{const n=e.tag,i=this.view.byteOffset+e.offset,o=e.compLength,s=e.origLength,a=i+o;return t[n]=o>=s?new DataView(this.view.buffer,i,o):new DataView(Pa(new Uint8Array(this.view.buffer.slice(i,a))).buffer),t},{}))}};Ot([m("uint32")],_t.prototype,"signature"),Ot([m("uint32")],_t.prototype,"flavor"),Ot([m("uint32")],_t.prototype,"length"),Ot([m("uint16")],_t.prototype,"numTables"),Ot([m("uint16")],_t.prototype,"reserved"),Ot([m("uint32")],_t.prototype,"totalSFNTSize"),Ot([m("uint16")],_t.prototype,"majorVersion"),Ot([m("uint16")],_t.prototype,"minorVersion"),Ot([m("uint32")],_t.prototype,"metaOffset"),Ot([m("uint32")],_t.prototype,"metaLength"),Ot([m("uint32")],_t.prototype,"metaOrigLength"),Ot([m("uint32")],_t.prototype,"privOffset"),Ot([m("uint32")],_t.prototype,"privLength");let cr=_t;function Fl(r,t=!0){if(Xt.is(r))return new Xt(r);if(lr.is(r))return new lr(r);if(cr.is(r))return new cr(r);if(t)throw new Error("Failed to parseFont")}function Ul(r,t=!0){const e=Fl(r,!1);if(e)return e;if(t)throw new Error("Failed to parseFont")}class hr{static defaultRequestInit={cache:"force-cache"};fallbackFont;loading=new Map;loaded=new Map;familyToUrl=new Map;setFallbackFont(t){this.fallbackFont=t}async loadFallbackFont(t,e={}){this.fallbackFont=await this.load(t,e)}_createRequest(t,e){const n=new AbortController;return{url:t,when:fetch(t,{...hr.defaultRequestInit,...e,signal:n.signal}).then(i=>i.arrayBuffer()),cancel:()=>n.abort()}}injectFontFace(t,e){return document.fonts.check(`14px ${t}`)||document.fonts.add(new FontFace(t,e)),this}injectStyleTag(t,e){const n=CSS.escape(t);if(!document.querySelector(`style[data-family="${n}"]`)){const i=document.createElement("style");i.type="text/css",i.dataset.family=t,i.appendChild(document.createTextNode(`@font-face {
30
+ </svg>`}toSvgUrl(){return`data:image/svg+xml;base64,${btoa(this.toSvgString())}`}toSvg(){return new DOMParser().parseFromString(this.toSvgString(),"image/svg+xml").documentElement}toCanvas(t={}){const{pixelRatio:e=2,...n}=t,{left:i,top:o,width:s,height:a}=this.getBoundingBox(),l=document.createElement("canvas");l.width=s*e,l.height=a*e,l.style.width=`${s}px`,l.style.height=`${a}px`;const c=l.getContext("2d");return c&&(c.scale(e,e),c.translate(-i,-o),this.paths.forEach(u=>{u.drawTo(c,n)})),l}}class ui{constructor(t,e){this.text=t,this.context=e}pixelRatio=window?.devicePixelRatio||1;_setupView=()=>{const t=this.pixelRatio,e=this.context,{left:n,top:i,width:o,height:s}=this.text.boundingBox,a=e.canvas;a.dataset.viewBox=`${n} ${i} ${o} ${s}`,a.dataset.pixelRatio=String(t);const l=o,c=s;a.width=Math.max(1,Math.ceil(l*t)),a.height=Math.max(1,Math.ceil(c*t)),a.style.width=`${l}px`,a.style.height=`${c}px`,e.clearRect(0,0,a.width,a.height),e.scale(t,t),e.translate(-n,-i)};_setupColors=()=>{const{paragraphs:t,computedStyle:e,glyphBox:n}=this.text;this.uploadColor(e,n),t.forEach(i=>{this.uploadColor(i.computedStyle,i.lineBox),i.fragments.forEach(o=>{this.uploadColor(o.computedStyle,o.inlineBox)})})};setup=()=>(this._setupView(),this._setupColors(),this);_parseColor=(t,e)=>{if(typeof t=="string"&&_e(t)){const n=Or(t)[0];if(n)switch(n.type){case"linear-gradient":{let i=0;if(n.orientation)switch(n.orientation.type){case"angular":i=Number(n.orientation.value);break}const{left:o,top:s,width:a,height:l}=e,c=i*Math.PI/180,u=a*Math.sin(c),h=l*Math.cos(c),p=this.context.createLinearGradient(o+a/2-u,s+l/2+h,o+a/2+u,s+l/2-h);return n.colorStops.forEach(g=>{let f=0;if(g.length)switch(g.length.type){case"%":f=Number(g.length.value)/100;break}switch(g.type){case"rgb":p.addColorStop(f,`rgb(${g.value.join(", ")})`);break;case"rgba":p.addColorStop(f,`rgba(${g.value.join(", ")})`);break;case"hex":p.addColorStop(f,`#${g.value}`);break}}),p}}}return t};_uploadedStyles=["color","backgroundColor","textStrokeColor"];uploadColor=(t,e)=>{this._uploadedStyles.forEach(n=>{t[n]=this._parseColor(t[n],e)})};drawPath=(t,e={})=>{const n=this.context,{fontSize:i=this.text.computedStyle.fontSize,clipRect:o}=e;n.save(),n.beginPath(),o&&(n.rect(o.left,o.top,o.width,o.height),n.clip(),n.beginPath());const s=t.style,a=e.textStrokeColor??s.stroke,l=e.textStrokeWidth?e.textStrokeWidth*i:s.strokeWidth;t.drawTo(n,{...s,fill:e.color??s.fill,stroke:l===void 0||l>0?a:void 0,strokeWidth:l,strokeLinecap:"round",strokeLinejoin:"round",shadowOffsetX:(e.shadowOffsetX??0)*i,shadowOffsetY:(e.shadowOffsetY??0)*i,shadowBlur:(e.shadowBlur??0)*i,shadowColor:e.shadowColor}),n.restore()};drawCharacter=(t,e={})=>{const n=this.context,{computedStyle:i,path:o,glyphBox:s,isVertical:a,content:l,inlineBox:c,baseline:u}=t,h={...i,...e};if(s)this.drawPath(o,h);else{n.save(),n.beginPath();const p=o.style;Dn(n,{...p,fill:h.color??p.fill,stroke:h.textStrokeColor??p.stroke,strokeWidth:h.textStrokeWidth?h.textStrokeWidth*h.fontSize:p.strokeWidth,shadowOffsetX:(h.shadowOffsetX??0)*h.fontSize,shadowOffsetY:(h.shadowOffsetY??0)*h.fontSize,shadowBlur:(h.shadowBlur??0)*h.fontSize,shadowColor:h.shadowColor}),n.font=`${h.fontSize}px ${h.fontFamily}`,a?(n.textBaseline="middle",n.fillText(l,c.left,c.top+c.height/2)):(n.textBaseline="alphabetic",n.fillText(l,c.left,c.top+u)),n.restore()}}}var ut=Uint8Array,At=Uint16Array,Vn=Int32Array,an=new ut([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ln=new ut([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),jn=new ut([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fi=function(r,t){for(var e=new At(31),n=0;n<31;++n)e[n]=t+=1<<r[n-1];for(var i=new Vn(e[30]),n=1;n<30;++n)for(var o=e[n];o<e[n+1];++o)i[o]=o-e[n]<<5|n;return{b:e,r:i}},pi=fi(an,2),di=pi.b,Gn=pi.r;di[28]=258,Gn[258]=28;for(var gi=fi(ln,0),ua=gi.b,yi=gi.r,qn=new At(32768),K=0;K<32768;++K){var ne=(K&43690)>>1|(K&21845)<<1;ne=(ne&52428)>>2|(ne&13107)<<2,ne=(ne&61680)>>4|(ne&3855)<<4,qn[K]=((ne&65280)>>8|(ne&255)<<8)>>1}for(var Wt=(function(r,t,e){for(var n=r.length,i=0,o=new At(t);i<n;++i)r[i]&&++o[r[i]-1];var s=new At(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(e){a=new At(1<<t);var l=15-t;for(i=0;i<n;++i)if(r[i])for(var c=i<<4|r[i],u=t-r[i],h=s[r[i]-1]++<<u,p=h|(1<<u)-1;h<=p;++h)a[qn[h]>>l]=c}else for(a=new At(n),i=0;i<n;++i)r[i]&&(a[i]=qn[s[r[i]-1]++]>>15-r[i]);return a}),re=new ut(288),K=0;K<144;++K)re[K]=8;for(var K=144;K<256;++K)re[K]=9;for(var K=256;K<280;++K)re[K]=7;for(var K=280;K<288;++K)re[K]=8;for(var Be=new ut(32),K=0;K<32;++K)Be[K]=5;var fa=Wt(re,9,0),pa=Wt(re,9,1),da=Wt(Be,5,0),ga=Wt(Be,5,1),Wn=function(r){for(var t=r[0],e=1;e<r.length;++e)r[e]>t&&(t=r[e]);return t},Lt=function(r,t,e){var n=t/8|0;return(r[n]|r[n+1]<<8)>>(t&7)&e},Hn=function(r,t){var e=t/8|0;return(r[e]|r[e+1]<<8|r[e+2]<<16)>>(t&7)},Xn=function(r){return(r+7)/8|0},mi=function(r,t,e){return(e==null||e>r.length)&&(e=r.length),new ut(r.subarray(t,e))},ya=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],$t=function(r,t,e){var n=new Error(t||ya[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,$t),!e)throw n;return n},ma=function(r,t,e,n){var i=r.length,o=0;if(!i||t.f&&!t.l)return e||new ut(0);var s=!e,a=s||t.i!=2,l=t.i;s&&(e=new ut(i*3));var c=function(Pt){var Tt=e.length;if(Pt>Tt){var ht=new ut(Math.max(Tt*2,Pt));ht.set(e),e=ht}},u=t.f||0,h=t.p||0,p=t.b||0,g=t.l,f=t.d,y=t.m,d=t.n,P=i*8;do{if(!g){u=Lt(r,h,1);var M=Lt(r,h+1,3);if(h+=3,M)if(M==1)g=pa,f=ga,y=9,d=5;else if(M==2){var x=Lt(r,h,31)+257,S=Lt(r,h+10,15)+4,b=x+Lt(r,h+5,31)+1;h+=14;for(var D=new ut(b),z=new ut(19),E=0;E<S;++E)z[jn[E]]=Lt(r,h+E*3,7);h+=S*3;for(var F=Wn(z),N=(1<<F)-1,B=Wt(z,F,1),E=0;E<b;){var A=B[Lt(r,h,N)];h+=A&15;var w=A>>4;if(w<16)D[E++]=w;else{var W=0,O=0;for(w==16?(O=3+Lt(r,h,3),h+=2,W=D[E-1]):w==17?(O=3+Lt(r,h,7),h+=3):w==18&&(O=11+Lt(r,h,127),h+=7);O--;)D[E++]=W}}var L=D.subarray(0,x),V=D.subarray(x);y=Wn(L),d=Wn(V),g=Wt(L,y,1),f=Wt(V,d,1)}else $t(1);else{var w=Xn(h)+4,C=r[w-4]|r[w-3]<<8,v=w+C;if(v>i){l&&$t(0);break}a&&c(p+C),e.set(r.subarray(w,v),p),t.b=p+=C,t.p=h=v*8,t.f=u;continue}if(h>P){l&&$t(0);break}}a&&c(p+131072);for(var I=(1<<y)-1,R=(1<<d)-1,T=h;;T=h){var W=g[Hn(r,h)&I],_=W>>4;if(h+=W&15,h>P){l&&$t(0);break}if(W||$t(2),_<256)e[p++]=_;else if(_==256){T=h,g=null;break}else{var U=_-254;if(_>264){var E=_-257,$=an[E];U=Lt(r,h,(1<<$)-1)+di[E],h+=$}var q=f[Hn(r,h)&R],X=q>>4;q||$t(3),h+=q&15;var V=ua[X];if(X>3){var $=ln[X];V+=Hn(r,h)&(1<<$)-1,h+=$}if(h>P){l&&$t(0);break}a&&c(p+131072);var nt=p+U;if(p<V){var Zt=o-V,Dt=Math.min(V,nt);for(Zt+p<0&&$t(3);p<Dt;++p)e[p]=n[Zt+p]}for(;p<nt;++p)e[p]=e[p-V]}}t.l=g,t.p=T,t.b=p,t.f=u,g&&(u=1,t.m=y,t.d=f,t.n=d)}while(!u);return p!=e.length&&s?mi(e,0,p):e.subarray(0,p)},Qt=function(r,t,e){e<<=t&7;var n=t/8|0;r[n]|=e,r[n+1]|=e>>8},De=function(r,t,e){e<<=t&7;var n=t/8|0;r[n]|=e,r[n+1]|=e>>8,r[n+2]|=e>>16},Zn=function(r,t){for(var e=[],n=0;n<r.length;++n)r[n]&&e.push({s:n,f:r[n]});var i=e.length,o=e.slice();if(!i)return{t:bi,l:0};if(i==1){var s=new ut(e[0].s+1);return s[e[0].s]=1,{t:s,l:1}}e.sort(function(v,x){return v.f-x.f}),e.push({s:-1,f:25001});var a=e[0],l=e[1],c=0,u=1,h=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=e[e[c].f<e[h].f?c++:h++],l=e[c!=u&&e[c].f<e[h].f?c++:h++],e[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var p=o[0].s,n=1;n<i;++n)o[n].s>p&&(p=o[n].s);var g=new At(p+1),f=Yn(e[u-1],g,0);if(f>t){var n=0,y=0,d=f-t,P=1<<d;for(o.sort(function(x,S){return g[S.s]-g[x.s]||x.f-S.f});n<i;++n){var M=o[n].s;if(g[M]>t)y+=P-(1<<f-g[M]),g[M]=t;else break}for(y>>=d;y>0;){var w=o[n].s;g[w]<t?y-=1<<t-g[w]++-1:++n}for(;n>=0&&y;--n){var C=o[n].s;g[C]==t&&(--g[C],++y)}f=t}return{t:new ut(g),l:f}},Yn=function(r,t,e){return r.s==-1?Math.max(Yn(r.l,t,e+1),Yn(r.r,t,e+1)):t[r.s]=e},xi=function(r){for(var t=r.length;t&&!r[--t];);for(var e=new At(++t),n=0,i=r[0],o=1,s=function(l){e[n++]=l},a=1;a<=t;++a)if(r[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=r[a]}return{c:e.subarray(0,n),n:t}},Fe=function(r,t){for(var e=0,n=0;n<t.length;++n)e+=r[n]*t[n];return e},vi=function(r,t,e){var n=e.length,i=Xn(t+2);r[i]=n&255,r[i+1]=n>>8,r[i+2]=r[i]^255,r[i+3]=r[i+1]^255;for(var o=0;o<n;++o)r[i+o+4]=e[o];return(i+4+n)*8},wi=function(r,t,e,n,i,o,s,a,l,c,u){Qt(t,u++,e),++i[256];for(var h=Zn(i,15),p=h.t,g=h.l,f=Zn(o,15),y=f.t,d=f.l,P=xi(p),M=P.c,w=P.n,C=xi(y),v=C.c,x=C.n,S=new At(19),b=0;b<M.length;++b)++S[M[b]&31];for(var b=0;b<v.length;++b)++S[v[b]&31];for(var D=Zn(S,7),z=D.t,E=D.l,F=19;F>4&&!z[jn[F-1]];--F);var N=c+5<<3,B=Fe(i,re)+Fe(o,Be)+s,A=Fe(i,p)+Fe(o,y)+s+14+3*F+Fe(S,z)+2*S[16]+3*S[17]+7*S[18];if(l>=0&&N<=B&&N<=A)return vi(t,u,r.subarray(l,l+c));var W,O,L,V;if(Qt(t,u,1+(A<B)),u+=2,A<B){W=Wt(p,g,0),O=p,L=Wt(y,d,0),V=y;var I=Wt(z,E,0);Qt(t,u,w-257),Qt(t,u+5,x-1),Qt(t,u+10,F-4),u+=14;for(var b=0;b<F;++b)Qt(t,u+3*b,z[jn[b]]);u+=3*F;for(var R=[M,v],T=0;T<2;++T)for(var _=R[T],b=0;b<_.length;++b){var U=_[b]&31;Qt(t,u,I[U]),u+=z[U],U>15&&(Qt(t,u,_[b]>>5&127),u+=_[b]>>12)}}else W=fa,O=re,L=da,V=Be;for(var b=0;b<a;++b){var $=n[b];if($>255){var U=$>>18&31;De(t,u,W[U+257]),u+=O[U+257],U>7&&(Qt(t,u,$>>23&31),u+=an[U]);var q=$&31;De(t,u,L[q]),u+=V[q],q>3&&(De(t,u,$>>5&8191),u+=ln[q])}else De(t,u,W[$]),u+=O[$]}return De(t,u,W[256]),u+O[256]},xa=new Vn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bi=new ut(0),va=function(r,t,e,n,i,o){var s=o.z||r.length,a=new ut(n+s+5*(1+Math.ceil(s/7e3))+i),l=a.subarray(n,a.length-i),c=o.l,u=(o.r||0)&7;if(t){u&&(l[0]=o.r>>3);for(var h=xa[t-1],p=h>>13,g=h&8191,f=(1<<e)-1,y=o.p||new At(32768),d=o.h||new At(f+1),P=Math.ceil(e/3),M=2*P,w=function(kt){return(r[kt]^r[kt+1]<<P^r[kt+2]<<M)&f},C=new Vn(25e3),v=new At(288),x=new At(32),S=0,b=0,D=o.i||0,z=0,E=o.w||0,F=0;D+2<s;++D){var N=w(D),B=D&32767,A=d[N];if(y[B]=A,d[N]=B,E<=D){var W=s-D;if((S>7e3||z>24576)&&(W>423||!c)){u=wi(r,l,0,C,v,x,b,z,F,D-F,u),z=S=b=0,F=D;for(var O=0;O<286;++O)v[O]=0;for(var O=0;O<30;++O)x[O]=0}var L=2,V=0,I=g,R=B-A&32767;if(W>2&&N==w(D-R))for(var T=Math.min(p,W)-1,_=Math.min(32767,D),U=Math.min(258,W);R<=_&&--I&&B!=A;){if(r[D+L]==r[D+L-R]){for(var $=0;$<U&&r[D+$]==r[D+$-R];++$);if($>L){if(L=$,V=R,$>T)break;for(var q=Math.min(R,$-2),X=0,O=0;O<q;++O){var nt=D-R+O&32767,Zt=y[nt],Dt=nt-Zt&32767;Dt>X&&(X=Dt,A=nt)}}}B=A,A=y[B],R+=B-A&32767}if(V){C[z++]=268435456|Gn[L]<<18|yi[V];var Pt=Gn[L]&31,Tt=yi[V]&31;b+=an[Pt]+ln[Tt],++v[257+Pt],++x[Tt],E=D+L,++S}else C[z++]=r[D],++v[r[D]]}}for(D=Math.max(D,E);D<s;++D)C[z++]=r[D],++v[r[D]];u=wi(r,l,c,C,v,x,b,z,F,D-F,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=d,o.p=y,o.i=D,o.w=E)}else{for(var D=o.w||0;D<s+c;D+=65535){var ht=D+65535;ht>=s&&(l[u/8|0]=c,ht=s),u=vi(l,u+1,r.subarray(D,ht))}o.i=s}return mi(a,0,n+Xn(u)+i)},Si=function(){var r=1,t=0;return{p:function(e){for(var n=r,i=t,o=e.length|0,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=n+=e[s];n=(n&65535)+15*(n>>16),i=(i&65535)+15*(i>>16)}r=n,t=i},d:function(){return r%=65521,t%=65521,(r&255)<<24|(r&65280)<<8|(t&255)<<8|t>>8}}},wa=function(r,t,e,n,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new ut(o.length+r.length);s.set(o),s.set(r,o.length),r=s,i.w=o.length}return va(r,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+t.mem,e,n,i)},Ci=function(r,t,e){for(;e;++t)r[t]=e,e>>>=8},ba=function(r,t){var e=t.level,n=e==0?0:e<6?1:e==9?3:2;if(r[0]=120,r[1]=n<<6|(t.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,t.dictionary){var i=Si();i.p(t.dictionary),Ci(r,2,i.d())}},Sa=function(r,t){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&$t(6,"invalid zlib data"),(r[1]>>5&1)==1&&$t(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function Ca(r,t){t||(t={});var e=Si();e.p(r);var n=wa(r,t,t.dictionary?6:2,4);return ba(n,t),Ci(n,n.length-4,e.d()),n}function Pa(r,t){return ma(r.subarray(Sa(r),-4),{i:2},t,t)}var Ma=typeof TextDecoder<"u"&&new TextDecoder,_a=0;try{Ma.decode(bi,{stream:!0}),_a=1}catch{}const Ta="modern-font";function Ue(r,t){if(!r)throw new Error(`[${Ta}] ${t}`)}function ka(r){if("buffer"in r){const t=r.buffer;return r.byteOffset>0||r.byteLength<r.buffer.byteLength?t.slice(r.byteOffset,r.byteOffset+r.byteLength):t}else return r}function xe(r){return"buffer"in r?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(r)}function Aa(r){let t="";for(let e=0,n=r.length,i;e<n;e++)i=r.charCodeAt(e),i!==0&&(t+=String.fromCharCode(i));return t}function cn(r){r=Aa(r);const t=[];for(let e=0,n=r.length,i;e<n;e++)i=r.charCodeAt(e),t.push(i>>8),t.push(i&255);return t}function Oa(r){let t="";for(let e=0,n=r.length;e<n;e++)r[e]<127?t+=String.fromCharCode(r[e]):t+=`%${(256+r[e]).toString(16).slice(1)}`;return unescape(t)}function Ia(r){let t="";for(let e=0,n=r.length;e<n;e+=2)t+=String.fromCharCode((r[e]<<8)+r[e+1]);return t}var Ea=Object.defineProperty,ft=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Ea(t,e,i),i};const hn={int8:1,int16:2,int32:4,uint8:1,uint16:2,uint32:4,float32:4,float64:8,fixed:4,longDateTime:8,char:1};function pt(){return function(r,t){Object.defineProperty(r.constructor.prototype,t,{get(){if(typeof t=="string"){if(t.startsWith("read"))return(...e)=>this.read(t.substring(4).toLowerCase(),...e);if(t.startsWith("write"))return(...e)=>this.write(t.substring(5).toLowerCase(),...e)}},configurable:!0,enumerable:!0})}}class lt extends DataView{constructor(t,e,n,i){super(ka(t),e,n),this.littleEndian=i}cursor=0;readColumn(t){if(t.size){const e=Array.from({length:t.size},(n,i)=>this.read(t.type,t.offset+i));switch(t.type){case"char":return e.join("");default:return e}}else return this.read(t.type,t.offset)}writeColumn(t,e){t.size?Array.from({length:t.size},(n,i)=>{this.write(t.type,e[i],t.offset+i)}):this.write(t.type,e,t.offset)}read(t,e=this.cursor,n=this.littleEndian){switch(t){case"char":return this.readChar(e);case"fixed":return this.readFixed(e,n);case"longDateTime":return this.readLongDateTime(e,n)}const i=`get${t.replace(/^\S/,l=>l.toUpperCase())}`,o=this,a=o[i]?.bind(o)?.(e,n);return this.cursor+=hn[t],a}readUint24(t=this.cursor){const[e,n,i]=this.readBytes(t,3);return(e<<16)+(n<<8)+i}readBytes(t,e){e==null&&(e=t,t=this.cursor);const n=[];for(let i=0;i<e;++i)n.push(this.getUint8(t+i));return this.cursor=t+e,n}readString(t,e){const n=this.readBytes(t,e);let i="";for(let o=0,s=n.length;o<s;o++)i+=String.fromCharCode(n[o]);return i}readFixed(t,e){const n=this.readInt32(t,e)/65536;return Math.ceil(n*1e5)/1e5}readLongDateTime(t=this.cursor,e){const n=this.readUint32(t+4,e),i=new Date;return i.setTime(n*1e3+-20775456e5),i}readChar(t){return this.readString(t,1)}write(t,e,n=this.cursor,i=this.littleEndian){switch(t){case"char":return this.writeChar(e,n);case"fixed":return this.writeFixed(e,n);case"longDateTime":return this.writeLongDateTime(e,n)}const o=`set${t.replace(/^\S/,c=>c.toUpperCase())}`,s=this,l=s[o]?.bind(s)?.(n,e,i);return this.cursor+=hn[t.toLowerCase()],l}writeString(t="",e=this.cursor){const n=t.replace(/[^\x00-\xFF]/g,"11").length;this.seek(e);for(let i=0,o=t.length,s;i<o;++i)s=t.charCodeAt(i)||0,s>127?this.writeUint16(s):this.writeUint8(s);return this.cursor+=n,this}writeChar(t,e){return this.writeString(t,e)}writeFixed(t,e){return this.writeInt32(Math.round(t*65536),e),this}writeLongDateTime(t,e=this.cursor){typeof t>"u"?t=-20775456e5:typeof t.getTime=="function"?t=t.getTime():/^\d+$/.test(t)?t=+t:t=Date.parse(t);const i=Math.round((t- -20775456e5)/1e3);return this.writeUint32(0,e),this.writeUint32(i,e+4),this}writeBytes(t,e=this.cursor){let n;if(Array.isArray(t)){n=t.length;for(let i=0;i<n;++i)this.setUint8(e+i,t[i])}else{const i=xe(t);n=i.byteLength;for(let o=0;o<n;++o)this.setUint8(e+o,i.getUint8(o))}return this.cursor=e+n,this}seek(t){return this.cursor=t,this}}ft([pt()],lt.prototype,"readInt8"),ft([pt()],lt.prototype,"readInt16"),ft([pt()],lt.prototype,"readInt32"),ft([pt()],lt.prototype,"readUint8"),ft([pt()],lt.prototype,"readUint16"),ft([pt()],lt.prototype,"readUint32"),ft([pt()],lt.prototype,"readFloat32"),ft([pt()],lt.prototype,"readFloat64"),ft([pt()],lt.prototype,"writeInt8"),ft([pt()],lt.prototype,"writeInt16"),ft([pt()],lt.prototype,"writeInt32"),ft([pt()],lt.prototype,"writeUint8"),ft([pt()],lt.prototype,"writeUint16"),ft([pt()],lt.prototype,"writeUint32"),ft([pt()],lt.prototype,"writeFloat32"),ft([pt()],lt.prototype,"writeFloat64");const Pi=new WeakMap;function m(r){const t=typeof r=="object"?r:{type:r},{size:e=1,type:n}=t;return(i,o)=>{if(typeof o!="string")return;let s=Pi.get(i);s||(s={columns:[],byteLength:0},Pi.set(i,s));const a={...t,name:o,byteLength:e*hn[n],offset:t.offset??s.columns.reduce((l,c)=>l+c.byteLength,0)};s.columns.push(a),s.byteLength=s.columns.reduce((l,c)=>l+hn[c.type]*(c.size??1),0),Object.defineProperty(i.constructor.prototype,o,{get(){return this.view.readColumn(a)},set(l){this.view.writeColumn(a,l)},configurable:!0,enumerable:!0})}}class Bt{view;constructor(t,e,n,i){this.view=new lt(t,e,n,i)}}class Kn extends Bt{get buffer(){return this.view.buffer}toBuffer(){return this.view.buffer.slice(this.view.byteOffset,this.view.byteOffset+this.view.byteLength)}toBlob(){return new Blob([new Uint8Array(this.view.buffer,this.view.byteOffset,this.view.byteLength)],{type:this.mimeType})}toFontFace(t){return new FontFace(t,this.view.buffer)}}var Ba=Object.defineProperty,wt=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Ba(t,e,i),i};const bt=class Ki extends Kn{format="EmbeddedOpenType";mimeType="application/vnd.ms-fontobject";static from(t){const e=t.sfnt,i=e.name.names,o=cn(i.fontFamily||""),s=o.length,a=cn(i.fontStyle||""),l=a.length,c=cn(i.version||""),u=c.length,h=cn(i.fullName||""),p=h.length,g=86+s+4+l+4+u+4+p+2+t.view.byteLength,f=new Ki(new ArrayBuffer(g),0,g,!0);f.EOTSize=f.view.byteLength,f.FontDataSize=t.view.byteLength,f.Version=131073,f.Flags=0,f.Charset=1,f.MagicNumber=20556,f.Padding1=0,f.CheckSumAdjustment=e.head.checkSumAdjustment;const y=e.os2;return y&&(f.FontPANOSE=y.fontPANOSE,f.Italic=y.fsSelection,f.Weight=y.usWeightClass,f.fsType=y.fsType,f.UnicodeRange=y.ulUnicodeRange,f.CodePageRange=y.ulCodePageRange),f.view.writeUint16(s),f.view.writeBytes(o),f.view.writeUint16(0),f.view.writeUint16(l),f.view.writeBytes(a),f.view.writeUint16(0),f.view.writeUint16(u),f.view.writeBytes(c),f.view.writeUint16(0),f.view.writeUint16(p),f.view.writeBytes(h),f.view.writeUint16(0),f.view.writeUint16(0),f.view.writeBytes(t.view),f}};wt([m("uint32")],bt.prototype,"EOTSize"),wt([m("uint32")],bt.prototype,"FontDataSize"),wt([m("uint32")],bt.prototype,"Version"),wt([m("uint32")],bt.prototype,"Flags"),wt([m({type:"uint8",size:10})],bt.prototype,"FontPANOSE"),wt([m("uint8")],bt.prototype,"Charset"),wt([m("uint8")],bt.prototype,"Italic"),wt([m("uint32")],bt.prototype,"Weight"),wt([m("uint16")],bt.prototype,"fsType"),wt([m("uint16")],bt.prototype,"MagicNumber"),wt([m({type:"uint8",size:16})],bt.prototype,"UnicodeRange"),wt([m({type:"uint8",size:8})],bt.prototype,"CodePageRange"),wt([m("uint32")],bt.prototype,"CheckSumAdjustment"),wt([m({type:"uint8",size:16})],bt.prototype,"Reserved"),wt([m("uint16")],bt.prototype,"Padding1");var Da=Object.defineProperty,un=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Da(t,e,i),i};class Le extends Bt{constructor(t,e){super(t,e,16)}}un([m({type:"char",size:4})],Le.prototype,"tag"),un([m("uint32")],Le.prototype,"checkSum"),un([m("uint32")],Le.prototype,"offset"),un([m("uint32")],Le.prototype,"length");const Qn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],Fa=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];class Mi{index;name;isComposite=!1;components=[];pathCommands=[];constructor(t){const e={...t};if(this.index=e.index??0,e.name===".notdef"?e.unicode=void 0:e.name===".null"&&(e.unicode=0),e.unicode===0&&e.name!==".null")throw new Error('The unicode value "0" is reserved for the glyph name ".null" and cannot be used by any other glyph.');this.name=e.name??null,e.unicode&&(this.unicode=e.unicode),e.unicodes?this.unicodes=e.unicodes:e.unicode&&(this.unicodes=[e.unicode])}getPathCommands(t=0,e=0,n=72,i={},o){const s=1/(o?.unitsPerEm??1e3)*n,{xScale:a=s,yScale:l=s}=i,c=this.pathCommands,u=[];for(let h=0,p=c.length;h<p;h+=1){const g=c[h];g.type==="M"?u.push({type:"M",x:t+g.x*a,y:e+-g.y*l}):g.type==="L"?u.push({type:"L",x:t+g.x*a,y:e+-g.y*l}):g.type==="Q"?u.push({type:"Q",x1:t+g.x1*a,y1:e+-g.y1*l,x:t+g.x*a,y:e+-g.y*l}):g.type==="C"?u.push({type:"C",x1:t+g.x1*a,y1:e+-g.y1*l,x2:t+g.x2*a,y2:e+-g.y2*l,x:t+g.x*a,y:e+-g.y*l}):g.type==="Z"&&u.push({type:"Z"})}return u}}class Ua extends Mi{parse(t,e,n){const i=this,{nominalWidthX:o,defaultWidthX:s,gsubrsBias:a,subrsBias:l}=t,c=t.topDict.paintType,u=this.index;let h,p,g,f;const y=[],d=[];let P=0,M=!1,w=!1,C=s,v=0,x=0;function S(B,A){y.push({type:"L",x:B,y:A})}function b(B,A,W,O,L,V){y.push({type:"C",x1:B,y1:A,x2:W,y2:O,x:L,y:V})}function D(B,A){w&&c!==2&&z(),w=!0,y.push({type:"M",x:B,y:A})}function z(){y.push({type:"Z"})}function E(B){y.push(...B)}function F(){d.length%2!==0&&!M&&(C=d.shift()+o),P+=d.length>>1,d.length=0,M=!0}function N(B){let A,W,O,L,V,I,R,T,_,U,$,q,X=0;for(;X<B.length;){let nt=B[X++];switch(nt){case 1:F();break;case 3:F();break;case 4:d.length>1&&!M&&(C=d.shift()+o,M=!0),x+=d.pop(),D(v,x);break;case 5:for(;d.length>0;)v+=d.shift(),x+=d.shift(),S(v,x);break;case 6:for(;d.length>0&&(v+=d.shift(),S(v,x),d.length!==0);)x+=d.shift(),S(v,x);break;case 7:for(;d.length>0&&(x+=d.shift(),S(v,x),d.length!==0);)v+=d.shift(),S(v,x);break;case 8:for(;d.length>0;)h=v+d.shift(),p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),v=g+d.shift(),x=f+d.shift(),b(h,p,g,f,v,x);break;case 10:V=d.pop()+l,I=t.subrs[V],I&&N(I);break;case 11:return;case 12:switch(nt=B[X],X+=1,nt){case 35:h=v+d.shift(),p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),R=g+d.shift(),T=f+d.shift(),_=R+d.shift(),U=T+d.shift(),$=_+d.shift(),q=U+d.shift(),v=$+d.shift(),x=q+d.shift(),d.shift(),b(h,p,g,f,R,T),b(_,U,$,q,v,x);break;case 34:h=v+d.shift(),p=x,g=h+d.shift(),f=p+d.shift(),R=g+d.shift(),T=f,_=R+d.shift(),U=f,$=_+d.shift(),q=x,v=$+d.shift(),b(h,p,g,f,R,T),b(_,U,$,q,v,x);break;case 36:h=v+d.shift(),p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),R=g+d.shift(),T=f,_=R+d.shift(),U=f,$=_+d.shift(),q=U+d.shift(),v=$+d.shift(),b(h,p,g,f,R,T),b(_,U,$,q,v,x);break;case 37:h=v+d.shift(),p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),R=g+d.shift(),T=f+d.shift(),_=R+d.shift(),U=T+d.shift(),$=_+d.shift(),q=U+d.shift(),Math.abs($-v)>Math.abs(q-x)?v=$+d.shift():x=q+d.shift(),b(h,p,g,f,R,T),b(_,U,$,q,v,x);break;default:console.warn(`Glyph ${u}: unknown operator ${1200+nt}`),d.length=0}break;case 14:if(d.length>=4){const Zt=Qn[d.pop()],Dt=Qn[d.pop()],Pt=d.pop(),Tt=d.pop();if(Zt&&Dt){i.isComposite=!0,i.components=[];const ht=t.charset.indexOf(Zt),kt=t.charset.indexOf(Dt);i.components.push({glyphIndex:kt,dx:0,dy:0}),i.components.push({glyphIndex:ht,dx:Tt,dy:Pt}),E(n.get(kt).pathCommands);const Rt=JSON.parse(JSON.stringify(n.get(ht).pathCommands));for(let Vt=0;Vt<Rt.length;Vt+=1){const Ft=Rt[Vt];Ft.type!=="Z"&&(Ft.x+=Tt,Ft.y+=Pt),(Ft.type==="Q"||Ft.type==="C")&&(Ft.x1+=Tt,Ft.y1+=Pt),Ft.type==="C"&&(Ft.x2+=Tt,Ft.y2+=Pt)}E(Rt)}}else d.length>0&&!M&&(C=d.shift()+o,M=!0);w&&c!==2&&(z(),w=!1);break;case 18:F();break;case 19:case 20:F(),X+=P+7>>3;break;case 21:d.length>2&&!M&&(C=d.shift()+o,M=!0),x+=d.pop(),v+=d.pop(),D(v,x);break;case 22:d.length>1&&!M&&(C=d.shift()+o,M=!0),v+=d.pop(),D(v,x);break;case 23:F();break;case 24:for(;d.length>2;)h=v+d.shift(),p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),v=g+d.shift(),x=f+d.shift(),b(h,p,g,f,v,x);v+=d.shift(),x+=d.shift(),S(v,x);break;case 25:for(;d.length>6;)v+=d.shift(),x+=d.shift(),S(v,x);h=v+d.shift(),p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),v=g+d.shift(),x=f+d.shift(),b(h,p,g,f,v,x);break;case 26:for(d.length%2&&(v+=d.shift());d.length>0;)h=v,p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),v=g,x=f+d.shift(),b(h,p,g,f,v,x);break;case 27:for(d.length%2&&(x+=d.shift());d.length>0;)h=v+d.shift(),p=x,g=h+d.shift(),f=p+d.shift(),v=g+d.shift(),x=f,b(h,p,g,f,v,x);break;case 28:A=B[X],W=B[X+1],d.push((A<<24|W<<16)>>16),X+=2;break;case 29:V=d.pop()+a,I=t.gsubrs[V],I&&N(I);break;case 30:for(;d.length>0&&(h=v,p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),v=g+d.shift(),x=f+(d.length===1?d.shift():0),b(h,p,g,f,v,x),d.length!==0);)h=v+d.shift(),p=x,g=h+d.shift(),f=p+d.shift(),x=f+d.shift(),v=g+(d.length===1?d.shift():0),b(h,p,g,f,v,x);break;case 31:for(;d.length>0&&(h=v+d.shift(),p=x,g=h+d.shift(),f=p+d.shift(),x=f+d.shift(),v=g+(d.length===1?d.shift():0),b(h,p,g,f,v,x),d.length!==0);)h=v,p=x+d.shift(),g=h+d.shift(),f=p+d.shift(),v=g+d.shift(),x=f+(d.length===1?d.shift():0),b(h,p,g,f,v,x);break;default:nt<32?console.warn(`Glyph ${u}: unknown operator ${nt}`):nt<247?d.push(nt-139):nt<251?(A=B[X],X+=1,d.push((nt-247)*256+A+108)):nt<255?(A=B[X],X+=1,d.push(-(nt-251)*256-A-108)):(A=B[X],W=B[X+1],O=B[X+2],L=B[X+3],X+=4,d.push((A<<24|W<<16|O<<8|L)/65536))}}}N(e),this.pathCommands=y,M&&(this.advanceWidth=C)}}class _i{constructor(t){this._sfnt=t}_items=[];get(t){const e=this._items[t];let n;if(e)n=e;else{n=this._get(t);const i=this._sfnt.hmtx.metrics[t];i&&(n.advanceWidth=n.advanceWidth||i.advanceWidth,n.leftSideBearing=n.leftSideBearing||i.leftSideBearing);const o=this._sfnt.cmap.glyphIndexToUnicodesMap.get(t);o&&(n.unicode??=o[0],n.unicodes??=o),this._items[t]=n}return n}}class La extends _i{get length(){return this._sfnt.cff.charStringsIndex.offsets.length-1}_get(t){const e=this._sfnt.cff,n=new Ua({index:t});return n.parse(e,e.charStringsIndex.get(t),this),n.name=e.charset[t],n}}var $a=Object.defineProperty,Ti=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&$a(t,e,i),i};class fn extends Bt{_offsets;get offsets(){return this._offsets??=this.readOffsets()}_objects;get objects(){return this._objects??=this.readObjects()}constructor(t,e,n,i){super(t,e,n,i),this._init()}_init(){const t=this.view,e=this.count,n=this.offsetSize;this.objectOffset=(e+1)*n+2,this.endOffset=t.byteOffset+this.objectOffset+this.offsets[e]}readOffsets(){const t=this.view,e=this.count,n=this.offsetSize;t.seek(3);const i=[];for(let o=0,s=e+1;o<s;o++){const a=this.view;let l=0;for(let c=0;c<n;c++)l<<=8,l+=a.readUint8();i.push(l)}return i}readObjects(){const t=[];for(let e=0,n=this.count;e<n;e++)t.push(this.get(e));return t}get(t){const e=this.offsets,n=this.objectOffset,i=n+e[t],s=n+e[t+1]-i;return this._isString?this.view.readString(i,s):this.view.readBytes(i,s)}}Ti([m("uint16")],fn.prototype,"count"),Ti([m("uint8")],fn.prototype,"offsetSize");class pn extends fn{_isString=!1}class ki extends fn{_isString=!0}const Na=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],za=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"],Ra=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],Va=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"];function dn(r,t){return t<=390?Na[t]:r[t-391]}function Q(r,t="number",e){return(n,i)=>{if(typeof i!="string")return;const o={type:t,operator:r,default:e??t==="number"?0:void 0};Object.defineProperty(n.constructor.prototype,i,{get(){return this._getProp(o)},set(s){this._setProp(o,s)},configurable:!0,enumerable:!0})}}class Ai extends Bt{_dict;get dict(){return this._dict??=this._readDict()}_stringIndex;setStringIndex(t){return this._stringIndex=t,this}_readFloatOperand(){const t=this.view;let e="";const n=15,i=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const o=t.readUint8(),s=o>>4,a=o&15;if(s===n||(e+=i[s],a===n))break;e+=i[a]}return Number.parseFloat(e)}_readOperand(t){const e=this.view;let n,i,o,s;if(t===28)return n=e.readUint8(),i=e.readUint8(),n<<8|i;if(t===29)return n=e.readUint8(),i=e.readUint8(),o=e.readUint8(),s=e.readUint8(),n<<24|i<<16|o<<8|s;if(t===30)return this._readFloatOperand();if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return n=e.readUint8(),(t-247)*256+n+108;if(t>=251&&t<=254)return n=e.readUint8(),-(t-251)*256-n-108;throw new Error(`invalid b0 ${t}, at: ${e.cursor}`)}_readDict(){const t=this.view;t.seek(0);let e=[];const n=t.cursor+t.byteLength,i={};for(;t.cursor<n;){let o=t.readUint8();o<=21?(o===12&&(o=1200+t.readUint8()),i[o]=e,e=[]):e.push(this._readOperand(o))}return i}_getProp(t){const e=this.dict[t.operator]??t.default;switch(t.type){case"number":return e[0];case"string":return dn(this._stringIndex?.objects??[],e[0]);case"number[]":return e}return e}_setProp(t,e){}}var ja=Object.defineProperty,Jn=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&ja(t,e,i),i};class gn extends Ai{}Jn([Q(19)],gn.prototype,"subrs"),Jn([Q(20)],gn.prototype,"defaultWidthX"),Jn([Q(21)],gn.prototype,"nominalWidthX");var Ga=Object.defineProperty,it=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Ga(t,e,i),i};class et extends Ai{}it([Q(0,"string")],et.prototype,"version"),it([Q(1,"string")],et.prototype,"notice"),it([Q(1200,"string")],et.prototype,"copyright"),it([Q(2,"string")],et.prototype,"fullName"),it([Q(3,"string")],et.prototype,"familyName"),it([Q(4,"string")],et.prototype,"weight"),it([Q(1201)],et.prototype,"isFixedPitch"),it([Q(1202)],et.prototype,"italicAngle"),it([Q(1203,"number",-100)],et.prototype,"underlinePosition"),it([Q(1204,"number",50)],et.prototype,"underlineThickness"),it([Q(1205)],et.prototype,"paintType"),it([Q(1206,"number",2)],et.prototype,"charstringType"),it([Q(1207,"number[]",[.001,0,0,.001,0,0])],et.prototype,"fontMatrix"),it([Q(13)],et.prototype,"uniqueId"),it([Q(5,"number[]",[0,0,0,0])],et.prototype,"fontBBox"),it([Q(1208)],et.prototype,"strokeWidth"),it([Q(14)],et.prototype,"xuid"),it([Q(15)],et.prototype,"charset"),it([Q(16)],et.prototype,"encoding"),it([Q(17)],et.prototype,"charStrings"),it([Q(18,"number[]",[0,0])],et.prototype,"private");function dt(r,t=r){return e=>{Jt.tableDefinitions.set(r,{tag:r,prop:t,class:e}),Object.defineProperty(Jt.prototype,t,{get(){return this.get(r)},set(n){return this.set(r,n)},configurable:!0,enumerable:!0})}}class Jt{static tableDefinitions=new Map;tables=new Map;tableViews=new Map;get hasGlyf(){return this.tableViews.has("glyf")}get names(){return this.name.names}get unitsPerEm(){return this.head.unitsPerEm}get ascender(){return this.hhea.ascent}get descender(){return this.hhea.descent}get createdTimestamp(){return this.head.created}get modifiedTimestamp(){return this.head.modified}get numGlyphs(){return this.maxp.numGlyphs}get unicodes(){return this.cmap.glyphIndexToUnicodesMap}get glyphs(){return this.hasGlyf?this.glyf.glyphs:this.cff.glyphs}charToGlyphIndex(t){let e=this.cmap.unicodeToGlyphIndexMap.get(t.codePointAt(0));if(e===void 0&&!this.hasGlyf){const{encoding:n,charset:i}=this.cff;e=i.indexOf(n[t.codePointAt(0)])}return e??0}charToGlyph(t){return this.glyphs.get(this.charToGlyphIndex(t))}textToGlyphIndexes(t){const e=[];for(const n of t)e.push(this.charToGlyphIndex(n));return e}textToGlyphs(t){const e=this.glyphs,n=this.textToGlyphIndexes(t),i=n.length,o=Array.from({length:i}),s=e.get(0);for(let a=0;a<i;a+=1)o[a]=e.get(n[a])||s;return o}getPathCommands(t,e,n,i,o){const s=[];return this.forEachGlyph(t,e,n,i,o,(a,l,c,u,h)=>{s.push(...a.getPathCommands(l,c,u,h,this))}),s}getAdvanceWidth(t,e,n){return this.forEachGlyph(t,0,0,e,n,()=>{})}forEachGlyph(t,e=0,n=0,i=72,o={},s){const a=1/this.unitsPerEm*i,l=this.textToGlyphs(t);for(let c=0;c<l.length;c+=1){const u=l[c];s.call(this,u,e,n,i,o),u.advanceWidth&&(e+=u.advanceWidth*a),o.letterSpacing?e+=o.letterSpacing*i:o.tracking&&(e+=o.tracking/1e3*i)}return e}constructor(t){(t instanceof Map?t:new Map(Object.entries(t))).forEach((n,i)=>{this.tableViews.set(i,new DataView(n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)))})}clone(){return new Jt(this.tableViews)}delete(t){const e=Jt.tableDefinitions.get(t);return e?(this.tableViews.delete(t),this.tables.delete(e.prop),this):this}set(t,e){const n=Jt.tableDefinitions.get(t);return n&&this.tables.set(n.prop,e),this.tableViews.set(t,e.view),this}get(t){const e=Jt.tableDefinitions.get(t);if(!e)return;let n=this.tables.get(e.prop);if(!n){const i=e.class;if(i){const o=this.tableViews.get(t);if(!o)return;n=new i(o.buffer,o.byteOffset,o.byteLength).setSFNT(this),this.tables.set(e.prop,n)}}return n}}class gt extends Bt{setSFNT(t){return this._sfnt=t,this}getSFNT(){return this._sfnt}}var qa=Object.defineProperty,Wa=Object.getOwnPropertyDescriptor,$e=(r,t,e,n)=>{for(var i=n>1?void 0:n?Wa(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&qa(t,e,i),i};let ve=class extends gt{_glyphs;get glyphs(){return this._glyphs??=new La(this._sfnt)}get gsubrs(){return this.globalSubrIndex.objects}get gsubrsBias(){return this._calcSubroutineBias(this.globalSubrIndex.objects)}privateDict;subrsIndex;get defaultWidthX(){return this.privateDict?.defaultWidthX??0}get nominalWidthX(){return this.privateDict?.nominalWidthX??0}get subrs(){return this.subrsIndex?.objects??[]}get subrsBias(){return this._calcSubroutineBias(this.subrs)}constructor(r,t,e,n){super(r,t,e,n),this._init()}_init(){const r=this.view,{buffer:t,byteOffset:e}=r,n=e+4;this.nameIndex=new ki(t,n),this.topDictIndex=new pn(t,this.nameIndex.endOffset),this.stringIndex=new ki(t,this.topDictIndex.endOffset),this.globalSubrIndex=new pn(t,this.stringIndex.endOffset),this.topDict=new et(new Uint8Array(this.topDictIndex.objects[0]).buffer).setStringIndex(this.stringIndex);const i=this.topDict.private[0],o=this.topDict.private[1];i&&(this.privateDict=new gn(t,e+o,i).setStringIndex(this.stringIndex),this.privateDict.subrs&&(this.subrsIndex=new pn(t,e+o+this.privateDict.subrs))),this.charStringsIndex=new pn(t,e+this.topDict.charStrings);const s=this.charStringsIndex.offsets.length-1;this.topDict.charset===0?this.charset=za:this.topDict.charset===1?this.charset=Ra:this.topDict.charset===2?this.charset=Va:this.charset=this._readCharset(e+this.topDict.charset,s,this.stringIndex.objects),this.topDict.encoding===0?this.encoding=Qn:this.topDict.encoding===1?this.encoding=Fa:this.encoding=this._readEncoding(e+this.topDict.encoding)}_readCharset(r,t,e){const n=this.view;n.seek(r);let i,o,s;t-=1;const a=[".notdef"],l=n.readUint8();if(l===0)for(i=0;i<t;i+=1)o=n.readUint16(),a.push(dn(e,o));else if(l===1)for(;a.length<=t;)for(o=n.readUint16(),s=n.readUint8(),i=0;i<=s;i+=1)a.push(dn(e,o)),o+=1;else if(l===2)for(;a.length<=t;)for(o=n.readUint16(),s=n.readUint16(),i=0;i<=s;i+=1)a.push(dn(e,o)),o+=1;else throw new Error(`Unknown charset format ${l}`);return a}_readEncoding(r){const t=this.view;t.seek(r);let e,n;const i={},o=t.readUint8();if(o===0){const s=t.readUint8();for(e=0;e<s;e+=1)n=t.readUint8(),i[n]=e}else if(o===1){const s=t.readUint8();for(n=1,e=0;e<s;e+=1){const a=t.readUint8(),l=t.readUint8();for(let c=a;c<=a+l;c+=1)i[c]=n,n+=1}}else console.warn(`unknown encoding format:${o}`);return i}_calcSubroutineBias(r){let t;return r.length<1240?t=107:r.length<33900?t=1131:t=32768,t}};$e([m("uint8")],ve.prototype,"majorVersion",2),$e([m("uint8")],ve.prototype,"minorVersion",2),$e([m("uint8")],ve.prototype,"headerSize",2),$e([m("uint8")],ve.prototype,"offsetSize",2),ve=$e([dt("CFF ","cff")],ve);var Ha=Object.defineProperty,yn=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Ha(t,e,i),i};const Ne=class Qi extends Bt{constructor(t=new ArrayBuffer(262),e){super(t,e,262)}static from(t){const e=new Qi;return e.format=0,e.length=e.view.byteLength,e.language=0,t.forEach((n,i)=>{i<256&&n<256&&e.view.writeUint8(n,6+i)}),e}getUnicodeToGlyphIndexMap(){const t=new Map;return this.glyphIndexArray.forEach((e,n)=>{t.set(n,e)}),t}};yn([m("uint16")],Ne.prototype,"format"),yn([m("uint16")],Ne.prototype,"length"),yn([m("uint16")],Ne.prototype,"language"),yn([m({type:"uint8",size:256})],Ne.prototype,"glyphIndexArray");let Oi=Ne;var Xa=Object.defineProperty,tr=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Xa(t,e,i),i};class mn extends Bt{get subHeaderKeys(){return this.view.seek(6),Array.from({length:256},()=>this.view.readUint16()/8)}get maxSubHeaderKey(){return this.subHeaderKeys.reduce((t,e)=>Math.max(t,e),0)}get subHeaders(){const t=this.maxSubHeaderKey;return this.view.seek(6+256*2),Array.from({length:t},(e,n)=>({firstCode:this.view.readUint16(),entryCount:this.view.readUint16(),idDelta:this.view.readUint16(),idRangeOffset:(this.view.readUint16()-(t-n)*8-2)/2}))}get glyphIndexArray(){const t=this.maxSubHeaderKey,e=6+256*2+t*8;this.view.seek(e);const n=(this.view.byteLength-e)/2;return Array.from({length:n},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(t){const e=new Map,n=this.subHeaderKeys,i=this.maxSubHeaderKey,o=this.subHeaders,s=this.glyphIndexArray,a=n.findIndex(c=>c===i);let l=0;for(let c=0;c<256;c++)if(n[c]===0)c>=a||c<o[0].firstCode||c>=o[0].firstCode+o[0].entryCount||o[0].idRangeOffset+(c-o[0].firstCode)>=s.length?l=0:(l=s[o[0].idRangeOffset+(c-o[0].firstCode)],l!==0&&(l=l+o[0].idDelta)),l!==0&&l<t&&e.set(c,l);else{const u=n[c];for(let h=0,p=o[u].entryCount;h<p;h++)if(o[u].idRangeOffset+h>=s.length?l=0:(l=s[o[u].idRangeOffset+h],l!==0&&(l=l+o[u].idDelta)),l!==0&&l<t){const g=(c<<8|h+o[u].firstCode)%65535;e.set(g,l)}}return e}}tr([m("uint16")],mn.prototype,"format"),tr([m("uint16")],mn.prototype,"length"),tr([m("uint16")],mn.prototype,"language");function Ii(r){return r>32767?r-65536:r<-32767?r+65536:r}function Ei(r,t){let e;const n=[];let i={};return r.forEach((o,s)=>{t&&s>t||((!e||s!==e.unicode+1||o!==e.glyphIndex+1)&&(e?(i.end=e.unicode,n.push(i),i={start:s,startId:o,delta:Ii(o-s)}):(i.start=Number(s),i.startId=o,i.delta=Ii(o-s))),e={unicode:s,glyphIndex:o})}),e&&(i.end=e.unicode,n.push(i)),n}var Za=Object.defineProperty,ue=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Za(t,e,i),i};const ie=class Ji extends Bt{get endCode(){const t=this.segCountX2;return this.view.seek(14),Array.from({length:t/2},()=>this.view.readUint16())}set endCode(t){this.view.seek(14),t.forEach(e=>this.view.writeUint16(e))}get reservedPad(){return this.view.readUint16(14+this.segCountX2)}set reservedPad(t){this.view.writeUint16(t,14+this.segCountX2)}get startCode(){const t=this.segCountX2;return this.view.seek(14+t+2),Array.from({length:t/2},()=>this.view.readUint16())}set startCode(t){this.view.seek(14+this.segCountX2+2),t.forEach(e=>this.view.writeUint16(e))}get idDelta(){const t=this.segCountX2;return this.view.seek(14+t+2+t),Array.from({length:t/2},()=>this.view.readUint16())}set idDelta(t){const e=this.segCountX2;this.view.seek(14+e+2+e),t.forEach(n=>this.view.writeUint16(n))}get idRangeOffsetCursor(){const t=this.segCountX2;return 14+t+2+t*2}get idRangeOffset(){const t=this.segCountX2;return this.view.seek(this.idRangeOffsetCursor),Array.from({length:t/2},()=>this.view.readUint16())}set idRangeOffset(t){this.view.seek(this.idRangeOffsetCursor),t.forEach(e=>this.view.writeUint16(e))}get glyphIndexArrayCursor(){const t=this.segCountX2;return 14+t+2+t*3}get glyphIndexArray(){const t=this.glyphIndexArrayCursor;this.view.seek(t);const e=(this.view.byteLength-t)/2;return Array.from({length:e},()=>this.view.readUint16())}static from(t){const e=Ei(t,65535),n=e.length+1,i=Math.floor(Math.log(n)/Math.LN2),o=2*2**i,s=new Ji(new ArrayBuffer(24+e.length*8));return s.format=4,s.length=s.view.byteLength,s.language=0,s.segCountX2=n*2,s.searchRange=o,s.entrySelector=i,s.rangeShift=2*n-o,s.endCode=[...e.map(a=>a.end),65535],s.reservedPad=0,s.startCode=[...e.map(a=>a.start),65535],s.idDelta=[...e.map(a=>a.delta),1],s.idRangeOffset=Array.from({length:n},()=>0),s}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.segCountX2/2,n=(this.glyphIndexArrayCursor-this.idRangeOffsetCursor)/2,i=this.startCode,o=this.endCode,s=this.idRangeOffset,a=this.idDelta,l=this.glyphIndexArray;for(let c=0;c<e;++c)for(let u=i[c],h=o[c];u<=h;++u)if(s[c]===0)t.set(u,(u+a[c])%65536);else{const p=c+s[c]/2+(u-i[c])-n,g=l[p];g!==0?t.set(u,(g+a[c])%65536):t.set(u,0)}return t.delete(65535),t}};ue([m("uint16")],ie.prototype,"format"),ue([m("uint16")],ie.prototype,"length"),ue([m("uint16")],ie.prototype,"language"),ue([m("uint16")],ie.prototype,"segCountX2"),ue([m("uint16")],ie.prototype,"searchRange"),ue([m("uint16")],ie.prototype,"entrySelector"),ue([m("uint16")],ie.prototype,"rangeShift");let Bi=ie;var Ya=Object.defineProperty,ze=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Ya(t,e,i),i};class we extends Bt{get glyphIndexArray(){return this.view.seek(12),Array.from({length:this.entryCount},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(){const t=this.glyphIndexArray,e=new Map;return t.forEach((n,i)=>{e.set(i,n)}),e}}ze([m("uint16")],we.prototype,"format"),ze([m("uint16")],we.prototype,"length"),ze([m("uint16")],we.prototype,"language"),ze([m("uint16")],we.prototype,"firstCode"),ze([m("uint16")],we.prototype,"entryCount");var Ka=Object.defineProperty,Re=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Ka(t,e,i),i};const be=class ts extends Bt{get groups(){const t=this.nGroups;return this.view.seek(16),Array.from({length:t},()=>({startCharCode:this.view.readUint32(),endCharCode:this.view.readUint32(),startGlyphCode:this.view.readUint32()}))}static from(t){const e=Ei(t),n=new ts(new ArrayBuffer(16+e.length*12));return n.format=12,n.reserved=0,n.length=n.view.byteLength,n.language=0,n.nGroups=e.length,e.forEach(i=>{n.view.writeUint32(i.start),n.view.writeUint32(i.end),n.view.writeUint32(i.startId)}),n}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.groups;for(let n=0,i=e.length;n<i;n++){const o=e[n];let s=o.startGlyphCode,a=o.startCharCode;const l=o.endCharCode;for(;a<=l;)t.set(a++,s++)}return t}};Re([m("uint16")],be.prototype,"format"),Re([m("uint16")],be.prototype,"reserved"),Re([m("uint32")],be.prototype,"length"),Re([m("uint32")],be.prototype,"language"),Re([m("uint32")],be.prototype,"nGroups");let Di=be;var Qa=Object.defineProperty,er=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Qa(t,e,i),i};class xn extends Bt{getVarSelectorRecords(){const t=this.numVarSelectorRecords;return this.view.seek(10),Array.from({length:t},()=>{const e={varSelector:this.view.readUint24(),defaultUVSOffset:this.view.readUint32(),unicodeValueRanges:[],nonDefaultUVSOffset:this.view.readUint32(),uVSMappings:[]};if(e.defaultUVSOffset){this.view.seek(e.defaultUVSOffset);const n=this.view.readUint32();e.unicodeValueRanges=Array.from({length:n},()=>({startUnicodeValue:this.view.readUint24(),additionalCount:this.view.readUint8()}))}if(e.nonDefaultUVSOffset){this.view.seek(e.nonDefaultUVSOffset);const n=this.view.readUint32();e.uVSMappings=Array.from({length:n},()=>({unicodeValue:this.view.readUint24(),glyphID:this.view.readUint16()}))}return e})}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.getVarSelectorRecords();for(let n=0,i=e.length;n<i;n++){const{uVSMappings:o}=e[n];o.forEach(s=>{t.set(s.unicodeValue,s.glyphID)})}return t}}er([m("uint16")],xn.prototype,"format"),er([m("uint32")],xn.prototype,"length"),er([m("uint32")],xn.prototype,"numVarSelectorRecords");var Ja=Object.defineProperty,tl=Object.getOwnPropertyDescriptor,nr=(r,t,e,n)=>{for(var i=n>1?void 0:n?tl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&Ja(t,e,i),i};let Ve=class extends gt{static from(r){const t=Array.from(r.keys()).some(u=>u>65535),e=Bi.from(r),n=Oi.from(r),i=t?Di.from(r):void 0,o=4+(i?32:24),s=o+e.view.byteLength,a=s+n.view.byteLength,l=[{platformID:0,platformSpecificID:3,offset:o},{platformID:1,platformSpecificID:0,offset:s},{platformID:3,platformSpecificID:1,offset:o},i&&{platformID:3,platformSpecificID:10,offset:a}].filter(Boolean),c=new Ve(new ArrayBuffer(4+8*l.length+e.view.byteLength+n.view.byteLength+(i?.view.byteLength??0)));return c.numberSubtables=l.length,c.view.seek(4),l.forEach(u=>{c.view.writeUint16(u.platformID),c.view.writeUint16(u.platformSpecificID),c.view.writeUint32(u.offset)}),c.view.writeBytes(e.view,o),c.view.writeBytes(n.view,s),i&&c.view.writeBytes(i.view,a),c}_unicodeToGlyphIndexMap;get unicodeToGlyphIndexMap(){return this._unicodeToGlyphIndexMap??=this.readunicodeToGlyphIndexMap()}_glyphIndexToUnicodesMap;get glyphIndexToUnicodesMap(){if(!this._glyphIndexToUnicodesMap){const r=new Map,t=this.unicodeToGlyphIndexMap,e=Array.from(t.keys());for(let n=0,i=e.length;n<i;n++){const o=e[n],s=t.get(o);r.has(s)?r.get(s).push(o):r.set(s,[o])}this._glyphIndexToUnicodesMap=r}return this._glyphIndexToUnicodesMap}readSubtables(){const r=this.numberSubtables;return this.view.seek(4),Array.from({length:r},()=>({platformID:this.view.readUint16(),platformSpecificID:this.view.readUint16(),offset:this.view.readUint32()})).map(t=>{this.view.seek(t.offset);const e=this.view.readUint16();let n;switch(e){case 0:n=new Oi(this.view.buffer,t.offset);break;case 2:n=new mn(this.view.buffer,t.offset,this.view.readUint16());break;case 4:n=new Bi(this.view.buffer,t.offset,this.view.readUint16());break;case 6:n=new we(this.view.buffer,t.offset,this.view.readUint16());break;case 12:n=new Di(this.view.buffer,t.offset,this.view.readUint32(t.offset+4));break;case 14:default:n=new xn(this.view.buffer,t.offset,this.view.readUint32());break}return{...t,format:e,view:n}})}readunicodeToGlyphIndexMap(){const r=this.readSubtables(),t=r.find(s=>s.format===0)?.view,e=r.find(s=>s.platformID===3&&s.platformSpecificID===3&&s.format===2)?.view,n=r.find(s=>s.platformID===3&&s.platformSpecificID===1&&s.format===4)?.view,i=r.find(s=>s.platformID===3&&s.platformSpecificID===10&&s.format===12)?.view,o=r.find(s=>s.platformID===0&&s.platformSpecificID===5&&s.format===14)?.view;return new Map([...t?.getUnicodeToGlyphIndexMap()??[],...e?.getUnicodeToGlyphIndexMap(this._sfnt.maxp.numGlyphs)??[],...n?.getUnicodeToGlyphIndexMap()??[],...i?.getUnicodeToGlyphIndexMap()??[],...o?.getUnicodeToGlyphIndexMap()??[]])}};nr([m("uint16")],Ve.prototype,"version",2),nr([m("uint16")],Ve.prototype,"numberSubtables",2),Ve=nr([dt("cmap")],Ve);class el extends Mi{_parseContours(t){const e=[];let n=[];for(let i=0;i<t.length;i+=1){const o=t[i];n.push(o),o.lastPointOfContour&&(e.push(n),n=[])}return Ue(n.length===0,"There are still points left in the current contour."),e}_transformPoints(t,e){const n=[];for(let i=0;i<t.length;i+=1){const o=t[i],s={x:e.xScale*o.x+e.scale10*o.y+e.dx,y:e.scale01*o.x+e.yScale*o.y+e.dy,onCurve:o.onCurve,lastPointOfContour:o.lastPointOfContour};n.push(s)}return n}_parseGlyphCoordinate(t,e,n,i,o){let s;return(e&i)>0?(s=t.view.readUint8(),(e&o)===0&&(s=-s),s=n+s):(e&o)>0?s=n:s=n+t.view.readInt16(),s}parse(t,e,n){t.view.seek(e);const i=this.numberOfContours=t.view.readInt16();if(this.xMin=t.view.readInt16(),this.yMin=t.view.readInt16(),this.xMax=t.view.readInt16(),this.yMax=t.view.readInt16(),i>0){const a=this.endPointIndices=[];for(let y=0;y<i;y++)a.push(t.view.readUint16());const l=this.instructionLength=t.view.readUint16();Ue(l<5e3,`Bad instructionLength:${l}`);const c=this.instructions=[];for(let y=0;y<l;++y)c.push(t.view.readUint8());const u=t.view.byteOffset,h=a[a.length-1]+1;Ue(h<2e4,`Bad numberOfCoordinates:${u}`);const p=[];let g,f=0;for(;f<h;)if(g=t.view.readUint8(),p.push(g),f++,g&8&&f<h){const y=t.view.readUint8();for(let d=0;d<y;d++)p.push(g),f++}if(Ue(p.length===h,`Bad flags length: ${p.length}, numberOfCoordinates: ${h}`),a.length>0){const y=[];let d;if(h>0){for(let w=0;w<h;w+=1)g=p[w],d={},d.onCurve=!!(g&1),d.lastPointOfContour=a.includes(w),y.push(d);let P=0;for(let w=0;w<h;w+=1)g=p[w],d=y[w],d.x=this._parseGlyphCoordinate(t,g,P,2,16),P=d.x;let M=0;for(let w=0;w<h;w+=1)g=p[w],d=y[w],d.y=this._parseGlyphCoordinate(t,g,M,4,32),M=d.y}this.points=y}else this.points=[]}else if(i===0)this.points=[];else{this.isComposite=!0,this.points=[],this.components=[];let a,l=!0;for(;l;){a=t.view.readUint16();const c={glyphIndex:t.view.readUint16(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(a&1)>0?(a&2)>0?(c.dx=t.view.readInt16(),c.dy=t.view.readInt16()):c.matchedPoints=[t.view.readUint16(),t.view.readUint16()]:(a&2)>0?(c.dx=t.view.readInt8(),c.dy=t.view.readInt8()):c.matchedPoints=[t.view.readUint8(),t.view.readUint8()],(a&8)>0?c.xScale=c.yScale=t.view.readInt16()/16384:(a&64)>0?(c.xScale=t.view.readInt16()/16384,c.yScale=t.view.readInt16()/16384):(a&128)>0&&(c.xScale=t.view.readInt16()/16384,c.scale01=t.view.readInt16()/16384,c.scale10=t.view.readInt16()/16384,c.yScale=t.view.readInt16()/16384),this.components.push(c),l=!!(a&32)}if(a&256){this.instructionLength=t.view.readUint16(),this.instructions=[];for(let c=0;c<this.instructionLength;c+=1)this.instructions.push(t.view.readUint8())}}if(this.isComposite)for(let a=0;a<this.components.length;a+=1){const l=this.components[a],c=n.get(l.glyphIndex);if(c.getPathCommands(),c.points){let u;if(l.matchedPoints===void 0)u=this._transformPoints(c.points,l);else{Ue(l.matchedPoints[0]>this.points.length-1||l.matchedPoints[1]>c.points.length-1,`Matched points out of range in ${this.name}`);const h=this.points[l.matchedPoints[0]];let p=c.points[l.matchedPoints[1]];const g={xScale:l.xScale,scale01:l.scale01,scale10:l.scale10,yScale:l.yScale,dx:0,dy:0};p=this._transformPoints([p],g)[0],g.dx=h.x-p.x,g.dy=h.y-p.y,u=this._transformPoints(c.points,g)}this.points=this.points.concat(u)}}const o=[],s=this._parseContours(this.points);for(let a=0,l=s.length;a<l;++a){const c=s[a];let u=c[c.length-1],h=c[0];u.onCurve?o.push({type:"M",x:u.x,y:u.y}):h.onCurve?o.push({type:"M",x:h.x,y:h.y}):o.push({type:"M",x:(u.x+h.x)*.5,y:(u.y+h.y)*.5});for(let p=0,g=c.length;p<g;++p)if(u=h,h=c[(p+1)%g],u.onCurve)o.push({type:"L",x:u.x,y:u.y});else{let f=h;h.onCurve||(f={x:(u.x+h.x)*.5,y:(u.y+h.y)*.5}),o.push({type:"Q",x1:u.x,y1:u.y,x:f.x,y:f.y})}o.push({type:"Z"})}this.pathCommands=o}}class nl extends _i{get length(){return this._sfnt.loca.locations.length}_get(t){const e=this._sfnt.loca.locations,n=e[t],i=new el({index:t});return n!==e[t+1]&&i.parse(this._sfnt.glyf,n,this),i}}var rl=Object.getOwnPropertyDescriptor,il=(r,t,e,n)=>{for(var i=n>1?void 0:n?rl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i};let rr=class extends gt{static from(r){const t=r.reduce((n,i)=>n+i.byteLength,0),e=new rr(new ArrayBuffer(t));return r.forEach(n=>{e.view.writeBytes(n)}),e}_glyphs;get glyphs(){return this._glyphs??=new nl(this._sfnt)}};rr=il([dt("glyf")],rr);var sl=Object.getOwnPropertyDescriptor,ol=(r,t,e,n)=>{for(var i=n>1?void 0:n?sl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i};let Fi=class extends gt{};Fi=ol([dt("GPOS","gpos")],Fi);var al=Object.defineProperty,ll=Object.getOwnPropertyDescriptor,fe=(r,t,e,n)=>{for(var i=n>1?void 0:n?ll(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&al(t,e,i),i};let se=class extends gt{};fe([m("uint16")],se.prototype,"majorVersion",2),fe([m("uint16")],se.prototype,"minorVersion",2),fe([m("uint16")],se.prototype,"scriptListOffset",2),fe([m("uint16")],se.prototype,"featureListOffset",2),fe([m("uint16")],se.prototype,"lookupListOffset",2),fe([m("uint16")],se.prototype,"featureVariationsOffset",2),se=fe([dt("GSUB","gsub")],se);var cl=Object.defineProperty,hl=Object.getOwnPropertyDescriptor,at=(r,t,e,n)=>{for(var i=n>1?void 0:n?hl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&cl(t,e,i),i};let st=class extends gt{constructor(r=new ArrayBuffer(54),t){super(r,t,Math.min(54,r.byteLength-(t??0)))}};at([m("fixed")],st.prototype,"version",2),at([m("fixed")],st.prototype,"fontRevision",2),at([m("uint32")],st.prototype,"checkSumAdjustment",2),at([m("uint32")],st.prototype,"magickNumber",2),at([m("uint16")],st.prototype,"flags",2),at([m("uint16")],st.prototype,"unitsPerEm",2),at([m({type:"longDateTime"})],st.prototype,"created",2),at([m({type:"longDateTime"})],st.prototype,"modified",2),at([m("int16")],st.prototype,"xMin",2),at([m("int16")],st.prototype,"yMin",2),at([m("int16")],st.prototype,"xMax",2),at([m("int16")],st.prototype,"yMax",2),at([m("uint16")],st.prototype,"macStyle",2),at([m("uint16")],st.prototype,"lowestRecPPEM",2),at([m("int16")],st.prototype,"fontDirectionHint",2),at([m("int16")],st.prototype,"indexToLocFormat",2),at([m("int16")],st.prototype,"glyphDataFormat",2),st=at([dt("head")],st);var ul=Object.defineProperty,fl=Object.getOwnPropertyDescriptor,St=(r,t,e,n)=>{for(var i=n>1?void 0:n?fl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&ul(t,e,i),i};let yt=class extends gt{constructor(r=new ArrayBuffer(36),t){super(r,t,Math.min(36,r.byteLength-(t??0)))}};St([m("fixed")],yt.prototype,"version",2),St([m("int16")],yt.prototype,"ascent",2),St([m("int16")],yt.prototype,"descent",2),St([m("int16")],yt.prototype,"lineGap",2),St([m("uint16")],yt.prototype,"advanceWidthMax",2),St([m("int16")],yt.prototype,"minLeftSideBearing",2),St([m("int16")],yt.prototype,"minRightSideBearing",2),St([m("int16")],yt.prototype,"xMaxExtent",2),St([m("int16")],yt.prototype,"caretSlopeRise",2),St([m("int16")],yt.prototype,"caretSlopeRun",2),St([m("int16")],yt.prototype,"caretOffset",2),St([m({type:"int16",size:4})],yt.prototype,"reserved",2),St([m("int16")],yt.prototype,"metricDataFormat",2),St([m("uint16")],yt.prototype,"numOfLongHorMetrics",2),yt=St([dt("hhea")],yt);var pl=Object.getOwnPropertyDescriptor,dl=(r,t,e,n)=>{for(var i=n>1?void 0:n?pl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i};let ir=class extends gt{static from(r){const t=r.length*4,e=new ir(new ArrayBuffer(t));return r.forEach(n=>{e.view.writeUint16(n.advanceWidth),e.view.writeUint16(n.leftSideBearing)}),e}_metrics;get metrics(){return this._metrics??=this.readMetrics()}readMetrics(){const r=this._sfnt.maxp.numGlyphs,t=this._sfnt.hhea.numOfLongHorMetrics;let e=0;const n=this.view;return n.seek(0),Array.from({length:r}).map((i,o)=>(o<t&&(e=n.readUint16()),{advanceWidth:e,leftSideBearing:n.readUint16()}))}};ir=dl([dt("hmtx")],ir);var gl=Object.getOwnPropertyDescriptor,yl=(r,t,e,n)=>{for(var i=n>1?void 0:n?gl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i};let Ui=class extends gt{};Ui=yl([dt("kern","kern")],Ui);var ml=Object.getOwnPropertyDescriptor,xl=(r,t,e,n)=>{for(var i=n>1?void 0:n?ml(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i};let sr=class extends gt{static from(r,t=1){const e=r.length*(t?4:2),n=new sr(new ArrayBuffer(e));return r.forEach(i=>{t?n.view.writeUint32(i):n.view.writeUint16(i/2)}),n}_locations;get locations(){return this._locations??=this.readLocations()}readLocations(){const r=this._sfnt.maxp.numGlyphs,t=this._sfnt.head.indexToLocFormat,e=this.view;return e.seek(0),Array.from({length:r}).map(()=>t?e.readUint32():e.readUint16()*2)}};sr=xl([dt("loca")],sr);var vl=Object.defineProperty,wl=Object.getOwnPropertyDescriptor,mt=(r,t,e,n)=>{for(var i=n>1?void 0:n?wl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&vl(t,e,i),i};let ct=class extends gt{constructor(r=new ArrayBuffer(32),t){super(r,t,Math.min(32,r.byteLength-(t??0)))}};mt([m("fixed")],ct.prototype,"version",2),mt([m("uint16")],ct.prototype,"numGlyphs",2),mt([m("uint16")],ct.prototype,"maxPoints",2),mt([m("uint16")],ct.prototype,"maxContours",2),mt([m("uint16")],ct.prototype,"maxComponentPoints",2),mt([m("uint16")],ct.prototype,"maxComponentContours",2),mt([m("uint16")],ct.prototype,"maxZones",2),mt([m("uint16")],ct.prototype,"maxTwilightPoints",2),mt([m("uint16")],ct.prototype,"maxStorage",2),mt([m("uint16")],ct.prototype,"maxFunctionDefs",2),mt([m("uint16")],ct.prototype,"maxInstructionDefs",2),mt([m("uint16")],ct.prototype,"maxStackElements",2),mt([m("uint16")],ct.prototype,"maxSizeOfInstructions",2),mt([m("uint16")],ct.prototype,"maxComponentElements",2),mt([m("uint16")],ct.prototype,"maxComponentDepth",2),ct=mt([dt("maxp")],ct);var bl=Object.defineProperty,Sl=Object.getOwnPropertyDescriptor,vn=(r,t,e,n)=>{for(var i=n>1?void 0:n?Sl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&bl(t,e,i),i};const Li={0:"copyright",1:"fontFamily",2:"fontSubFamily",3:"uniqueSubFamily",4:"fullName",5:"version",6:"postScriptName",7:"tradeMark",8:"manufacturer",9:"designer",10:"description",11:"urlOfFontVendor",12:"urlOfFontDesigner",13:"licence",14:"urlOfLicence",16:"preferredFamily",17:"preferredSubFamily",18:"compatibleFull",19:"sampleText"},or={Macintosh:1,Microsoft:3},Cl={Default:0},$i={UCS2:1};let je=class extends gt{_names;get names(){return this._names??=this.readNames()}readNames(){const r=this.count;this.view.seek(6);const t=[];for(let a=0;a<r;++a)t.push({platform:this.view.readUint16(),encoding:this.view.readUint16(),language:this.view.readUint16(),nameId:this.view.readUint16(),length:this.view.readUint16(),offset:this.view.readUint16()});const e=this.stringOffset;for(let a=0;a<r;++a){const l=t[a];l.name=this.view.readBytes(e+l.offset,l.length)}let n=or.Macintosh,i=Cl.Default,o=0;t.some(a=>a.platform===or.Microsoft&&a.encoding===$i.UCS2&&a.language===1033)&&(n=or.Microsoft,i=$i.UCS2,o=1033);const s={};for(let a=0;a<r;++a){const l=t[a];l.platform===n&&l.encoding===i&&l.language===o&&Li[l.nameId]&&(s[Li[l.nameId]]=o===0?Oa(l.name):Ia(l.name))}return s}};vn([m("uint16")],je.prototype,"format",2),vn([m("uint16")],je.prototype,"count",2),vn([m("uint16")],je.prototype,"stringOffset",2),je=vn([dt("name")],je);var Pl=Object.defineProperty,Ml=Object.getOwnPropertyDescriptor,G=(r,t,e,n)=>{for(var i=n>1?void 0:n?Ml(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&Pl(t,e,i),i};let j=class extends gt{get fontPANOSE(){return[this.bFamilyType,this.bSerifStyle,this.bWeight,this.bProportion,this.bContrast,this.bStrokeVariation,this.bArmStyle,this.bLetterform,this.bMidline,this.bXHeight]}};G([m("uint16")],j.prototype,"version",2),G([m("int16")],j.prototype,"xAvgCharWidth",2),G([m("uint16")],j.prototype,"usWeightClass",2),G([m("uint16")],j.prototype,"usWidthClass",2),G([m("uint16")],j.prototype,"fsType",2),G([m("uint16")],j.prototype,"ySubscriptXSize",2),G([m("uint16")],j.prototype,"ySubscriptYSize",2),G([m("uint16")],j.prototype,"ySubscriptXOffset",2),G([m("uint16")],j.prototype,"ySubscriptYOffset",2),G([m("uint16")],j.prototype,"ySuperscriptXSize",2),G([m("uint16")],j.prototype,"ySuperscriptYSize",2),G([m("uint16")],j.prototype,"ySuperscriptXOffset",2),G([m("uint16")],j.prototype,"ySuperscriptYOffset",2),G([m("uint16")],j.prototype,"yStrikeoutSize",2),G([m("uint16")],j.prototype,"yStrikeoutPosition",2),G([m("uint16")],j.prototype,"sFamilyClass",2),G([m({type:"uint8"})],j.prototype,"bFamilyType",2),G([m({type:"uint8"})],j.prototype,"bSerifStyle",2),G([m({type:"uint8"})],j.prototype,"bWeight",2),G([m({type:"uint8"})],j.prototype,"bProportion",2),G([m({type:"uint8"})],j.prototype,"bContrast",2),G([m({type:"uint8"})],j.prototype,"bStrokeVariation",2),G([m({type:"uint8"})],j.prototype,"bArmStyle",2),G([m({type:"uint8"})],j.prototype,"bLetterform",2),G([m({type:"uint8"})],j.prototype,"bMidline",2),G([m({type:"uint8"})],j.prototype,"bXHeight",2),G([m({type:"uint8",size:16})],j.prototype,"ulUnicodeRange",2),G([m({type:"char",size:4})],j.prototype,"achVendID",2),G([m("uint16")],j.prototype,"fsSelection",2),G([m("uint16")],j.prototype,"usFirstCharIndex",2),G([m("uint16")],j.prototype,"usLastCharIndex",2),G([m("int16")],j.prototype,"sTypoAscender",2),G([m("int16")],j.prototype,"sTypoDescender",2),G([m("int16")],j.prototype,"sTypoLineGap",2),G([m("uint16")],j.prototype,"usWinAscent",2),G([m("uint16")],j.prototype,"usWinDescent",2),G([m({offset:72,type:"uint8",size:8})],j.prototype,"ulCodePageRange",2),G([m({offset:72,type:"int16"})],j.prototype,"sxHeight",2),G([m("int16")],j.prototype,"sCapHeight",2),G([m("uint16")],j.prototype,"usDefaultChar",2),G([m("uint16")],j.prototype,"usBreakChar",2),G([m("uint16")],j.prototype,"usMaxContext",2),j=G([dt("OS/2","os2")],j);var _l=Object.defineProperty,Tl=Object.getOwnPropertyDescriptor,Ht=(r,t,e,n)=>{for(var i=n>1?void 0:n?Tl(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&_l(t,e,i),i};let Nt=class extends gt{constructor(r=new ArrayBuffer(32),t,e){super(r,t,e)}};Ht([m("fixed")],Nt.prototype,"format",2),Ht([m("fixed")],Nt.prototype,"italicAngle",2),Ht([m("int16")],Nt.prototype,"underlinePosition",2),Ht([m("int16")],Nt.prototype,"underlineThickness",2),Ht([m("uint32")],Nt.prototype,"isFixedPitch",2),Ht([m("uint32")],Nt.prototype,"minMemType42",2),Ht([m("uint32")],Nt.prototype,"maxMemType42",2),Ht([m("uint32")],Nt.prototype,"minMemType1",2),Ht([m("uint32")],Nt.prototype,"maxMemType1",2),Nt=Ht([dt("post")],Nt);var kl=Object.defineProperty,Al=Object.getOwnPropertyDescriptor,Ct=(r,t,e,n)=>{for(var i=n>1?void 0:n?Al(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&kl(t,e,i),i};let xt=class extends gt{constructor(r=new ArrayBuffer(36),t){super(r,t,Math.min(36,r.byteLength-(t??0)))}};Ct([m("fixed")],xt.prototype,"version",2),Ct([m("int16")],xt.prototype,"vertTypoAscender",2),Ct([m("int16")],xt.prototype,"vertTypoDescender",2),Ct([m("int16")],xt.prototype,"vertTypoLineGap",2),Ct([m("int16")],xt.prototype,"advanceHeightMax",2),Ct([m("int16")],xt.prototype,"minTopSideBearing",2),Ct([m("int16")],xt.prototype,"minBottomSideBearing",2),Ct([m("int16")],xt.prototype,"yMaxExtent",2),Ct([m("int16")],xt.prototype,"caretSlopeRise",2),Ct([m("int16")],xt.prototype,"caretSlopeRun",2),Ct([m("int16")],xt.prototype,"caretOffset",2),Ct([m({type:"int16",size:4})],xt.prototype,"reserved",2),Ct([m("int16")],xt.prototype,"metricDataFormat",2),Ct([m("int16")],xt.prototype,"numOfLongVerMetrics",2),xt=Ct([dt("vhea")],xt);var Ol=Object.getOwnPropertyDescriptor,Il=(r,t,e,n)=>{for(var i=n>1?void 0:n?Ol(t,e):t,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(i)||i);return i};let ar=class extends gt{static from(r){const t=r.length*4,e=new ar(new ArrayBuffer(t));return r.forEach(n=>{e.view.writeUint16(n.advanceHeight),e.view.writeInt16(n.topSideBearing)}),e}_metrics;get metrics(){return this._metrics??=this.readMetrics()}readMetrics(){const r=this._sfnt.maxp.numGlyphs,t=this._sfnt.vhea?.numOfLongVerMetrics??0,e=this.view;e.seek(0);let n=0;return Array.from({length:r}).map((i,o)=>(o<t&&(n=e.readUint16()),{advanceHeight:n,topSideBearing:e.readUint8()}))}};ar=Il([dt("vmtx")],ar);var El=Object.defineProperty,Ge=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&El(t,e,i),i};class Xt extends Kn{format="TrueType";mimeType="font/ttf";_sfnt;get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static signature=new Set([65536,1953658213,1954115633]);static is(t){return typeof t=="number"?this.signature.has(t):this.signature.has(xe(t).getUint32(0))}static checksum(t){const e=xe(t);let n=e.byteLength;for(;n%4;)n++;let i=0;for(let o=0,s=n/4;o<s;o+=4)o*4<n-4&&(i+=e.getUint32(o*4,!1));return i&4294967295}static from(t){const e=h=>h+3&-4,n=t.tableViews.size,i=Array.from(t.tableViews.values()).reduce((h,p)=>h+e(p.byteLength),0),o=new this(new ArrayBuffer(12+n*16+i));o.scalerType=65536,o.numTables=n;const s=Math.log(2);o.searchRange=Math.floor(Math.log(n)/s)*16,o.entrySelector=Math.floor(o.searchRange/s),o.rangeShift=n*16-o.searchRange;let a=12+n*16,l=0;const c=o.getDirectories();t.tableViews.forEach((h,p)=>{const g=c[l++];g.tag=p,g.checkSum=this.checksum(h),g.offset=a,g.length=h.byteLength,o.view.writeBytes(h,a),a+=e(g.length)});const u=o.createSFNT().head;return u.checkSumAdjustment=0,u.checkSumAdjustment=2981146554-this.checksum(o.view),o}getDirectories(){let t=this.view.byteOffset+12;return Array.from({length:this.numTables},()=>{const e=new Le(this.view.buffer,t);return t+=e.view.byteLength,e})}createSFNT(){return new Jt(this.getDirectories().reduce((t,e)=>(t[e.tag]=new DataView(this.view.buffer,this.view.byteOffset+e.offset,e.length),t),{}))}}Ge([m("uint32")],Xt.prototype,"scalerType"),Ge([m("uint16")],Xt.prototype,"numTables"),Ge([m("uint16")],Xt.prototype,"searchRange"),Ge([m("uint16")],Xt.prototype,"entrySelector"),Ge([m("uint16")],Xt.prototype,"rangeShift");class lr extends Xt{format="OpenType";mimeType="font/otf";static signature=new Set([1330926671]);static from(t){return super.from(t)}}var Bl=Object.defineProperty,qe=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Bl(t,e,i),i};class Se extends Bt{constructor(t,e){super(t,e,20)}}qe([m({type:"char",size:4})],Se.prototype,"tag"),qe([m("uint32")],Se.prototype,"offset"),qe([m("uint32")],Se.prototype,"compLength"),qe([m("uint32")],Se.prototype,"origLength"),qe([m("uint32")],Se.prototype,"origChecksum");var Dl=Object.defineProperty,Ot=(r,t,e,n)=>{for(var i=void 0,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=s(t,e,i)||i);return i&&Dl(t,e,i),i};const _t=class dr extends Kn{format="WOFF";mimeType="font/woff";get subfontFormat(){return Xt.is(this.flavor)?"TrueType":lr.is(this.flavor)?"OpenType":"Open"}_sfnt;get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static signature=new Set([2001684038]);static is(t){return typeof t=="number"?this.signature.has(t):this.signature.has(xe(t).getUint32(0))}static checkSum(t){const e=xe(t),n=e.byteLength,i=Math.floor(n/4);let o=0,s=0;for(;s<i;)o+=e.getUint32(4*s++,!1);let a=n-i*4;if(a){let l=i*4;for(;a>0;)o+=e.getUint8(l)<<a*8,l++,a--}return o%4294967296}static from(t,e=new ArrayBuffer(0)){const n=h=>h+3&-4,i=[];t.tableViews.forEach((h,p)=>{const g=xe(Ca(new Uint8Array(h.buffer,h.byteOffset,h.byteLength)));i.push({tag:p,view:g.byteLength<h.byteLength?g:h,rawView:h})});const o=i.length,s=i.reduce((h,p)=>h+n(p.view.byteLength),0),a=new dr(new ArrayBuffer(44+20*o+s+e.byteLength));a.signature=2001684038,a.flavor=65536,a.length=a.view.byteLength,a.numTables=o,a.totalSFNTSize=12+16*o+i.reduce((h,p)=>h+n(p.rawView.byteLength),0);let l=44+o*20,c=0;const u=a.getDirectories();return i.forEach(h=>{const p=u[c++];p.tag=h.tag,p.offset=l,p.compLength=h.view.byteLength,p.origChecksum=dr.checkSum(h.rawView),p.origLength=h.rawView.byteLength,a.view.writeBytes(h.view,l),l+=n(p.compLength)}),a.view.writeBytes(e),a}getDirectories(){let t=44;return Array.from({length:this.numTables},()=>{const e=new Se(this.view.buffer,t);return t+=e.view.byteLength,e})}createSFNT(){return new Jt(this.getDirectories().reduce((t,e)=>{const n=e.tag,i=this.view.byteOffset+e.offset,o=e.compLength,s=e.origLength,a=i+o;return t[n]=o>=s?new DataView(this.view.buffer,i,o):new DataView(Pa(new Uint8Array(this.view.buffer.slice(i,a))).buffer),t},{}))}};Ot([m("uint32")],_t.prototype,"signature"),Ot([m("uint32")],_t.prototype,"flavor"),Ot([m("uint32")],_t.prototype,"length"),Ot([m("uint16")],_t.prototype,"numTables"),Ot([m("uint16")],_t.prototype,"reserved"),Ot([m("uint32")],_t.prototype,"totalSFNTSize"),Ot([m("uint16")],_t.prototype,"majorVersion"),Ot([m("uint16")],_t.prototype,"minorVersion"),Ot([m("uint32")],_t.prototype,"metaOffset"),Ot([m("uint32")],_t.prototype,"metaLength"),Ot([m("uint32")],_t.prototype,"metaOrigLength"),Ot([m("uint32")],_t.prototype,"privOffset"),Ot([m("uint32")],_t.prototype,"privLength");let cr=_t;function Fl(r,t=!0){if(Xt.is(r))return new Xt(r);if(lr.is(r))return new lr(r);if(cr.is(r))return new cr(r);if(t)throw new Error("Failed to parseFont")}function Ul(r,t=!0){const e=Fl(r,!1);if(e)return e;if(t)throw new Error("Failed to parseFont")}class hr{static defaultRequestInit={cache:"force-cache"};fallbackFont;loading=new Map;loaded=new Map;familyToUrl=new Map;setFallbackFont(t){this.fallbackFont=t}async loadFallbackFont(t,e={}){this.fallbackFont=await this.load(t,e)}_createRequest(t,e){const n=new AbortController;return{url:t,when:fetch(t,{...hr.defaultRequestInit,...e,signal:n.signal}).then(i=>i.arrayBuffer()),cancel:()=>n.abort()}}injectFontFace(t,e){return document.fonts.check(`14px ${t}`)||document.fonts.add(new FontFace(t,e)),this}injectStyleTag(t,e){const n=CSS.escape(t);if(!document.querySelector(`style[data-family="${n}"]`)){const i=document.createElement("style");i.type="text/css",i.dataset.family=t,i.appendChild(document.createTextNode(`@font-face {
31
31
  font-family: "${t}";
32
32
  src: url(${e});
33
33
  }`)),document.head.appendChild(i)}return this}_parseUrls(t){const e=Array.from(new Set([...t.split(","),t]));return Array.from(new Set(e.map(n=>this.familyToUrl.get(n.trim())??this.familyToUrl.get(n)??n)))}get(t){let e;return t&&(e=this._parseUrls(t).reduce((i,o)=>i||this.loaded.get(o),void 0)),e??this.fallbackFont}set(t,e){return this.familyToUrl.set(t,e.src),this.loaded.set(e.src,e),this}delete(t){return this._parseUrls(t).forEach(e=>{this.familyToUrl.delete(e),this.loaded.delete(e)}),this}clear(){return this.familyToUrl.clear(),this.loading.clear(),this.loaded.clear(),this}_parseFamilies(t){return t?(Array.isArray(t)?t:[t]).flatMap(e=>e.split(",").map(n=>n.trim())):[]}async load(t,e={}){const{cancelOther:n,injectFontFace:i=!0,injectStyleTag:o=!0,...s}=e;let a,l;typeof t=="string"?a=t:{src:a,family:l}=t;const c=this._parseFamilies(l);if(this.loaded.has(a))return n&&(this.loading.forEach(g=>g.cancel()),this.loading.clear()),h(this.loaded.get(a));let u=this.loading.get(a);return u||(u=this._createRequest(a,s),this.loading.set(a,u)),n&&this.loading.forEach((g,f)=>{g!==u&&(g.cancel(),this.loading.delete(f))}),u.when.then(g=>{let f;return this.loaded.has(a)?f=h(this.loaded.get(a)):(f=p(g),e.noAdd||this.loaded.set(a,f)),Promise.all(Array.from(f.familySet).map(y=>(this.familyToUrl.set(y,a),typeof document<"u"&&(i&&this.injectFontFace(y,g),o&&this.injectStyleTag(y,a),i||o)?document.fonts.load(`14px ${y}`):Promise.resolve()))).then(()=>f)}).catch(g=>{if(g instanceof DOMException&&g.message==="The user aborted a request.")return p();throw g}).finally(()=>{this.loading.delete(a)});function h(g){return c.forEach(f=>{g.familySet.add(f)}),g}function p(g=new ArrayBuffer(0)){let f;function y(){return f||(f=g.byteLength?Ul(g,!1):void 0),f}function d(){const P=y();if(P instanceof Xt||P instanceof cr)return P.sfnt}return{src:a,family:l,buffer:g,familySet:new Set(c),getFont:y,getSFNT:d}}}async waitUntilLoad(){await Promise.all(Array.from(this.loading.values()).map(t=>t.when))}}const Ll=new hr,$l=new Set(["©","®","÷"]),Nl=new Set(["—","…","“","”","﹏","﹋","﹌","‘","’","˜"]),zl={1:"italic",32:"bold"},Rl={1:"italic",2:"bold"},Ni={100:-.2,200:-.1,300:0,400:0,normal:0,500:.1,600:.2,700:.3,bold:.3,800:.4,900:.5};class zi{constructor(t,e,n){this.content=t,this.index=e,this.parent=n}path=new Mt().setMeta(this);lineBox=new H;inlineBox=new H;glyphBox;advanceWidth=0;advanceHeight=0;underlinePosition=0;underlineThickness=0;strikeoutPosition=0;strikeoutSize=0;ascender=0;descender=0;typoAscender=0;typoDescender=0;typoLineGap=0;winAscent=0;winDescent=0;xHeight=0;capHeight=0;baseline=0;centerDiviation=0;fontStyle;get compatibleGlyphBox(){const t=this.computedStyle.fontSize*.8;return this.glyphBox??(this.isVertical?new H(this.lineBox.left+this.lineBox.width/2-t/2,this.lineBox.top,t,this.lineBox.height):new H(this.lineBox.left,this.lineBox.top+this.lineBox.height/2-t/2,this.lineBox.width,t))}get center(){return this.compatibleGlyphBox.center}get computedFill(){return this.parent.computedFill}get computedOutline(){return this.parent.computedOutline}get computedStyle(){return this.parent.computedStyle}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get fontSize(){return this.computedStyle.fontSize}get fontHeight(){return this.fontSize*this.computedStyle.lineHeight}_getFontSFNT(t){const e=this.computedStyle.fontFamily,n=t??Ll;let o=(e?n.get(e):n.fallbackFont)?.getSFNT();return o?.textToGlyphIndexes(this.content).includes(0)&&(o=n.fallbackFont?.getSFNT()),o}updateGlyph(t=this._getFontSFNT()){if(!t)return this;const{hhea:e,os2:n,post:i,head:o}=t,s=o.unitsPerEm,a=e.ascent,l=e.descent,{content:c,computedStyle:u,isVertical:h}=this,{fontSize:p}=u,g=s/p,f=t.getAdvanceWidth(c,p),y=(a+Math.abs(l))/g,d=a/g;return this.advanceWidth=f,this.advanceHeight=y,this.inlineBox.width=h?y:f,this.inlineBox.height=h?f:y,this.underlinePosition=(a-i.underlinePosition)/g,this.underlineThickness=i.underlineThickness/g,this.strikeoutPosition=(a-n.yStrikeoutPosition)/g,this.strikeoutSize=n.yStrikeoutSize/g,this.ascender=a/g,this.descender=l/g,this.typoAscender=n.sTypoAscender/g,this.typoDescender=n.sTypoDescender/g,this.typoLineGap=n.sTypoLineGap/g,this.winAscent=n.usWinAscent/g,this.winDescent=n.usWinDescent/g,this.xHeight=n.sxHeight/g,this.capHeight=n.sCapHeight/g,this.baseline=d,this.centerDiviation=y/2-d,this.fontStyle=zl[n.fsSelection]??Rl[o.macStyle],this}update(t){const e=this._getFontSFNT(t);if(!e)return this;this.updateGlyph(e);const{isVertical:n,content:i,computedStyle:o,baseline:s,inlineBox:a,ascender:l,descender:c,typoAscender:u,fontStyle:h,advanceWidth:p,advanceHeight:g}=this,{left:f,top:y}=a,d=o.fontStyle==="italic"&&h!=="italic";let P=f,M=y+s,w;const C=new Mt().setMeta(this);if(n&&(P+=(g-p)/2,Math.abs(p-g)>.1&&(M-=(l-u)/(l+Math.abs(c))*g),w=void 0),n&&!$l.has(i)&&(i.codePointAt(0)<=256||Nl.has(i))){C.addCommands(e.getPathCommands(i,P,y+s-(g-p)/2,o.fontSize));const x={y:y-(g-p)/2+g/2,x:P+p/2};d&&this._italic(C,n?{x:x.x,y:y-(g-p)/2+s}:void 0),C.rotate(90,x)}else w!==void 0?(C.addCommands(e.glyphs.get(w).getPathCommands(P,M,o.fontSize)),d&&this._italic(C,n?{x:P+p/2,y:y+u/(l+Math.abs(c))*g}:void 0)):(C.addCommands(e.getPathCommands(i,P,M,o.fontSize)),d&&this._italic(C,n?{x:P+g/2,y:M}:void 0));const v=o.fontWeight??400;return v in Ni&&(v===700||v==="bold")&&h!=="bold"&&C.bold(Ni[v]*o.fontSize*.05),C.style={fill:this.computedFill??o.color,fillRule:"nonzero",stroke:this.computedOutline??(o.textStrokeWidth?o.textStrokeColor:"none"),strokeWidth:o.textStrokeWidth?o.textStrokeWidth*o.fontSize*.03:0},this.path=C,this.glyphBox=this.getGlyphBoundingBox(),this}_italic(t,e){t.skew(-.24,0,e||{y:this.inlineBox.top+this.baseline,x:this.inlineBox.left+this.inlineBox.width/2})}getGlyphMinMax(t,e,n){if(this.path.curves[0]?.curves.length)return this.path.getMinMax(t,e,n)}getGlyphBoundingBox(t){const e=this.getGlyphMinMax(void 0,void 0,t);if(!e)return;const{min:n,max:i}=e;return new H(n.x,n.y,i.x-n.x,i.y-n.y)}}function ur(){const r=new Map;async function t(n){if(!r.has(n)){r.set(n,n);try{r.set(n,await fetch(n).then(i=>i.text()))}catch(i){console.warn(i),r.delete(n)}}}function e(n){return n.startsWith("http://")||n.startsWith("https://")||n.startsWith("blob://")}return{loaded:r,needsLoad:e,load:t}}function fr(r){const t=new Map;function e(n){let i=t.get(n);if(!i){const o=Hr(r.needsLoad(n)?r.loaded.get(n)??n:n),s=Qr(o);i={dom:o,pathSet:s},t.set(n,i)}return i}return{parsed:t,parse:e}}function wn(r,t){return typeof r=="number"?r:r.endsWith("%")?(r=r.substring(0,r.length-1),Math.ceil(Number(r)/100*t.total)):r.endsWith("rem")?(r=r.substring(0,r.length-3),Number(r)*t.fontSize):r.endsWith("em")?(r=r.substring(0,r.length-2),Number(r)*t.fontSize):Number(r)}function bn(r){return J(r)?{}:r}function Ri(r,t){const e=Object.keys(r),n=Object.keys(t);return Array.from(new Set([...e,...n])).every(o=>pe(r[o],t[o]))}function pe(r,t){const e=typeof r;return e===typeof t?e==="object"?Ri(r,t):r===t:!1}function Vl(r){const t=r.startsWith("#")?r.slice(1):r;if(!/^(?:[0-9A-F]{3}|[0-9A-F]{6})$/i.test(t))return null;const n=t.length===3?t.split("").map(a=>a+a).join(""):t,i=Number.parseInt(n.slice(0,2),16),o=Number.parseInt(n.slice(2,4),16),s=Number.parseInt(n.slice(4,6),16);return`rgb(${i}, ${o}, ${s})`}function Sn(r){if(!r)return r;const t={};for(const e in r)r[e]!==""&&r[e]!==void 0&&(t[e]=r[e]);return t}class Vi{constructor(t,e={},n,i){this.content=t,this.style=e,this.index=n,this.parent=i,this.updateComputedStyle().initCharacters()}inlineBox=new H;fill;outline;get computedFill(){return this.fill??this.parent.computedFill}get computedOutline(){return this.outline??this.parent.computedOutline}get computedContent(){const t=this.computedStyle;return t.textTransform==="uppercase"?this.content.toUpperCase():t.textTransform==="lowercase"?this.content.toLowerCase():this.content}updateComputedStyle(){return this.computedStyle={...this.parent.computedStyle,...Sn(this.style)},this}initCharacters(){const t=[];let e=0;for(const n of this.computedContent)t.push(new zi(n,e++,this));return this.characters=t,this}}class ji{constructor(t,e,n){this.style=t,this.index=e,this.parent=n,this.updateComputedStyle()}lineBox=new H;fragments=[];fill;outline;get computedFill(){return this.fill??this.parent.fill}get computedOutline(){return this.outline??this.parent.outline}updateComputedStyle(){return this.computedStyle={...Sn(this.parent.computedStyle),...Sn(this.style)},this}}function jl(r){return r}class We{static notZeroStyles=new Set(["width","height"]);static pxStyles=new Set(["width","height","fontSize","letterSpacing","textStrokeWidth","textIndent","shadowOffsetX","shadowOffsetY","shadowBlur","margin","marginLeft","marginTop","marginRight","marginBottom","padding","paddingLeft","paddingTop","paddingRight","paddingBottom"]);_toDomStyle(t){const e={};for(const n in t){const i=t[n];We.notZeroStyles.has(n)&&i===0||(typeof i=="number"&&We.pxStyles.has(n)?e[n]=`${i}px`:e[n]=i)}return e}createDom(t,e){const n=document.createElement("section"),i={...e},o=e.writingMode.includes("horizontal");switch(e.textAlign){case"start":case"left":i.justifyContent="flex-start";break;case"center":i.justifyContent="center";break;case"end":case"right":i.justifyContent="flex-end";break}switch(e.verticalAlign){case"top":i.alignItems="flex-start";break;case"middle":i.alignItems="center";break;case"bottom":i.alignItems="flex-end";break}const s=!!(i.justifyContent||i.alignItems);Object.assign(n.style,{...this._toDomStyle({...i,boxSizing:i.boxSizing??"border-box",display:i.display??(s?"inline-flex":void 0),width:i.width??"max-content",height:i.height??"max-content"}),whiteSpace:"pre-wrap",wordBreak:"break-all"});const a=document.createElement("ul");return Object.assign(a.style,{verticalAlign:"inherit",listStyleType:"inherit",padding:"0",margin:"0",width:s&&o?"100%":void 0,height:s&&!o?"100%":void 0}),t.forEach(l=>{const c=document.createElement("li");Object.assign(c.style,{verticalAlign:"inherit",...this._toDomStyle(l.style)}),l.fragments.forEach(u=>{const h=document.createElement("span");Object.assign(h.style,{verticalAlign:"inherit",...this._toDomStyle(u.style)}),h.appendChild(document.createTextNode(u.content)),c.appendChild(h)}),a.appendChild(c)}),n.appendChild(a),n}measureDomText(t){const e=document.createRange();e.selectNodeContents(t);const n=t.data??"";let i=0;return Array.from(n).map(o=>{const s=i+=n.substring(i).indexOf(o),a=s+o.length;i+=o.length,e.setStart(t,Math.max(s,0)),e.setEnd(t,a);const l=e.getClientRects?.()??[e.getBoundingClientRect()];let c=l[l.length-1];l.length>1&&c.width<2&&(c=l[l.length-2]);const u=e.toString();if(u!==""&&c&&c.width+c.height!==0)return{content:u,top:c.top,left:c.left,height:c.height,width:c.width}}).filter(Boolean)}measureDom(t){const e=[],n=[],i=[];return t.querySelectorAll("li").forEach((o,s)=>{const a=o.getBoundingClientRect();e.push({paragraphIndex:s,left:a.left,top:a.top,width:a.width,height:a.height}),o.querySelectorAll(":scope > *").forEach((l,c)=>{const u=l.getBoundingClientRect();n.push({paragraphIndex:s,fragmentIndex:c,left:u.left,top:u.top,width:u.width,height:u.height});let h=0;!l.children.length&&l.firstChild instanceof window.Text?this.measureDomText(l.firstChild).forEach(p=>{i.push({...p,newParagraphIndex:-1,paragraphIndex:s,fragmentIndex:c,characterIndex:h++,textWidth:-1,textHeight:-1})}):l.querySelectorAll(":scope > *").forEach(p=>{p.firstChild instanceof window.Text&&this.measureDomText(p.firstChild).forEach(g=>{i.push({...g,newParagraphIndex:-1,paragraphIndex:s,fragmentIndex:c,characterIndex:h++,textWidth:-1,textHeight:-1})})})})}),{paragraphs:e,fragments:n,characters:i}}measureParagraphDom(t,e){const n=e.getBoundingClientRect(),i=this.measureDom(e);i.paragraphs.forEach(a=>{const l=t[a.paragraphIndex];l.lineBox.left=a.left-n.left,l.lineBox.top=a.top-n.top,l.lineBox.width=a.width,l.lineBox.height=a.height}),i.fragments.forEach(a=>{const l=t[a.paragraphIndex].fragments[a.fragmentIndex];l.inlineBox.left=a.left-n.left,l.inlineBox.top=a.top-n.top,l.inlineBox.width=a.width,l.inlineBox.height=a.height});const o=[];let s=0;return i.characters.forEach(a=>{const{paragraphIndex:l,fragmentIndex:c,characterIndex:u}=a;o.push({...a,newParagraphIndex:l,left:a.left-n.left,top:a.top-n.top});const h=t[l].fragments[c].characters[u],{fontHeight:p,isVertical:g}=h,f=o[s];h.inlineBox.left=f.left,h.inlineBox.top=f.top,h.inlineBox.width=f.width,h.inlineBox.height=f.height,g?(h.lineBox.left=f.left+(f.width-p)/2,h.lineBox.top=f.top,h.lineBox.width=p,h.lineBox.height=f.height):(h.lineBox.left=f.left,h.lineBox.top=f.top+(f.height-p)/2,h.lineBox.width=f.width,h.lineBox.height=p),s++}),{paragraphs:t,boundingBox:new H(0,0,n.width,n.height)}}measure(t,e,n){let i;n||(n=this.createDom(t,e),Object.assign(n.style,{position:"fixed",visibility:"hidden"}),document.body.appendChild(n),i=()=>n?.parentNode?.removeChild(n));const o=this.measureParagraphDom(t,n);return i?.(),o}}function Gi(){const r=new ee,t=ur(),e=fr(t);return{name:"background",pathSet:r,load:async n=>{const{backgroundImage:i}=n.computedStyle;i&&t.needsLoad(i)&&await t.load(i)},update:n=>{r.paths.length=0;const{computedStyle:i,lineBox:o,isVertical:s}=n,{backgroundImage:a,backgroundSize:l,backgroundColormap:c}=i;if(J(a))return;const{pathSet:u}=e.parse(a),h=u.getBoundingBox(!0);let p,g,f,y;s?{x:g,y:p,width:y,height:f}=o:{x:p,y:g,width:f,height:y}=o;const d=bn(c??"none"),P=u.paths.map(v=>{const x=v.clone();return x.style.fill&&x.style.fill in d&&(x.style.fill=d[x.style.fill]),x.style.stroke&&x.style.stroke in d&&(x.style.stroke=d[x.style.stroke]),x});let M,w;if(l==="rigid"){M=Math.max(n.fontSize*5/h.width),w=M;const v=new k;v.x=h.width-f/M,v.y=h.height-y/w,P.forEach(x=>{x.applyTransform(S=>{const b=S.x>h.left+h.width/2,D=S.y>h.top+h.height/2;b&&(S.x-=v.x),D&&(S.y-=v.y)})})}else M=f/h.width,w=y/h.height;const C=new vt;C.translate(-h.x,-h.y),C.scale(M,w),s&&(C.translate(-f/2,-y/2),C.rotate(-Math.PI/2),C.translate(y/2,f/2)),C.translate(p,g),P.forEach(v=>{v.applyTransform(x=>{x.applyMatrix3(C)})}),r.paths.push(...P)},renderOrder:-2,render:n=>{const{text:i,context:o}=n,{boundingBox:s,computedStyle:a}=i;J(a.backgroundColor)||(o.fillStyle=a.backgroundColor,o.fillRect(...s.array)),r.paths.forEach(l=>{if(n.drawPath(l),i.debug){const c=new ee([l]).getBoundingBox();c&&o.strokeRect(c.x,c.y,c.width,c.height)}}),i.paragraphs.forEach(l=>{const{lineBox:c,style:u}=l;J(u.backgroundColor)||(o.fillStyle=u.backgroundColor,o.fillRect(...c.array)),l.fragments.forEach(h=>{const{inlineBox:p,style:g}=h;J(g.backgroundColor)||(o.fillStyle=g.backgroundColor,o.fillRect(...p.array))})})}}}function Cn(r){const{highlight:t,highlightImage:e,highlightReferImage:n,highlightColormap:i,highlightLine:o,highlightSize:s,highlightThickness:a}=r;return{image:t?.image??e??"none",referImage:t?.referImage??n??"none",colormap:t?.colormap??i??"none",line:t?.line??o??"none",size:t?.size??s??"cover",thickness:t?.thickness??a??"100%"}}function qi(){const r=new ee,t=[],e=ur(),n=fr(e);return{name:"highlight",pathSet:r,load:async i=>{const o=new Set;i.forEachCharacter(s=>{const{computedStyle:a}=s,{image:l,referImage:c}=Cn(a);l&&e.needsLoad(l)&&o.add(l),c&&e.needsLoad(c)&&o.add(c)}),await Promise.all(Array.from(o).map(s=>e.load(s)))},update:i=>{t.length=0,r.paths.length=0;let o=[],s,a;i.forEachCharacter(l=>{const{computedStyle:c}=l,u=Cn(c),{image:h,colormap:p,line:g,size:f,thickness:y}=u;if(J(h))s?.length&&(s=[],o.push(s));else{const{inlineBox:d,isVertical:P}=l,{fontSize:M}=c;(!a||pe(a.image,h)&&pe(a.colormap,p)&&pe(a.line,g)&&pe(a.size,f)&&pe(a.thickness,y))&&s?.length&&(P?s[0].inlineBox.left===d.left:s[0].inlineBox.top===d.top)&&s[0].fontSize===M?s.push(l):(s=[],s.push(l),o.push(s))}a=u}),o=o.filter(l=>l.length);for(let l=0;l<o.length;l++){const c=o[l],u=c[0],h=H.from(...c.map(I=>I.compatibleGlyphBox));if(!h.height||!h.width)continue;const{computedStyle:p,isVertical:g,inlineBox:f,compatibleGlyphBox:y,strikeoutPosition:d,underlinePosition:P}=u,{fontSize:M}=p,{image:w,referImage:C,colormap:v,line:x,size:S,thickness:b}=Cn(p),D=wn(b,{fontSize:M,total:h.width})/h.width,z=bn(v),{pathSet:E,dom:F}=n.parse(w),N=E.getBoundingBox(!0),B=M/N.width*2,A=new H().copy(h);g&&(A.width=h.height,A.height=h.width,A.left=h.left+h.width);const W=Math.floor(A.width);let O=W;S!=="cover"&&(O=wn(S,{fontSize:M,total:h.width})||W,A.width=O);const L=!J(C)&&J(x);if(L)N.copy(n.parse(C).pathSet.getBoundingBox(!0));else{let I;if(J(x))if(N.width/N.height>4){I="underline";const R=F.getAttribute("viewBox");if(R){const[T,_,U,$]=R.split(" ").map(X=>Number(X)),q=_+$/2;N.y<q&&N.y+N.height>q?I="line-through":N.y+N.height<q?I="overline":I="underline"}}else I="outline";else I=x;switch(I){case"outline":{const R=A.width*.2,T=A.height*.2;g?(A.x-=T/2,A.y-=R/2,A.x-=A.height):(A.x-=R/2,A.y-=T/2),A.width+=R,A.height+=T;break}case"overline":A.height=N.height*B,g?A.x=f.left+f.width:A.y=f.top;break;case"line-through":A.height=N.height*B,g?A.x=f.left+f.width-d+A.height/2:A.y=f.top+d-A.height/2;break;case"underline":A.height=N.height*B,g?A.x=y.left+y.width-P:A.y=f.top+P;break}}const V=new vt;if(V.translate(-N.x,-N.y),V.scale(A.width/N.width,A.height/N.height),g){const I=A.width/2,R=A.height/2;L||V.translate(-I,-R),V.rotate(-Math.PI/2),L||V.translate(R,I)}V.translate(A.x,A.y);for(let I=0;I<Math.ceil(W/O);I++){const R=V.clone();g?R.translate(0,I*A.width):R.translate(I*A.width,0),E.paths.forEach(T=>{const _=T.clone().applyTransform(R);_.style.strokeWidth&&(_.style.strokeWidth*=B*D),_.style.strokeMiterlimit&&(_.style.strokeMiterlimit*=B),_.style.strokeDashoffset&&(_.style.strokeDashoffset*=B),_.style.strokeDasharray&&(_.style.strokeDasharray=_.style.strokeDasharray.map(U=>U*B)),_.style.fill&&_.style.fill in z&&(_.style.fill=z[_.style.fill]),_.style.stroke&&_.style.stroke in z&&(_.style.stroke=z[_.style.stroke]),r.paths.push(_),W!==O&&(g?t[r.paths.length-1]=new H(h.left-h.width*2,h.top,h.width*4,h.height):t[r.paths.length-1]=new H(h.left,h.top-h.height*2,h.width,h.height*4))})}}},renderOrder:-1,getBoundingBox:()=>{const i=[];return r.paths.forEach((o,s)=>{const a=t[s];let l=o.getBoundingBox();if(a){const c=Math.max(l.x,a.x),u=Math.max(l.y,a.y),h=Math.min(l.right,a.right),p=Math.min(l.bottom,a.bottom);l=new H(c,u,h-c,p-u)}i.push(l)}),H.from(...i)},render:i=>{const{text:o,context:s}=i;r.paths.forEach((a,l)=>{if(i.drawPath(a,{clipRect:t[l]}),o.debug){const c=new ee([a]).getBoundingBox();c&&s.strokeRect(c.x,c.y,c.width,c.height)}})}}}function Gl(r,t){return`<svg width="${r*2}" height="${r*2}" xmlns="http://www.w3.org/2000/svg">
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { T as Text } from './shared/modern-text.BD1kUWDw.mjs';
2
- export { C as Canvas2DRenderer, a as Character, F as Fragment, M as Measurer, P as Paragraph, b as backgroundPlugin, f as createSvgLoader, i as createSvgParser, d as definePlugin, q as filterEmpty, g as getHighlightStyle, c as getTransform2D, n as hexToRgb, h as highlightPlugin, k as isEqualObject, m as isEqualValue, l as listStylePlugin, o as outlinePlugin, j as parseColormap, p as parseValueNumber, r as renderPlugin, t as textDecorationPlugin, e as textDefaultStyle } from './shared/modern-text.BD1kUWDw.mjs';
1
+ import { T as Text } from './shared/modern-text.B4chPFti.mjs';
2
+ export { C as Canvas2DRenderer, a as Character, F as Fragment, M as Measurer, P as Paragraph, b as backgroundPlugin, f as createSvgLoader, i as createSvgParser, d as definePlugin, q as filterEmpty, g as getHighlightStyle, c as getTransform2D, n as hexToRgb, h as highlightPlugin, k as isEqualObject, m as isEqualValue, l as listStylePlugin, o as outlinePlugin, j as parseColormap, p as parseValueNumber, r as renderPlugin, t as textDecorationPlugin, e as textDefaultStyle } from './shared/modern-text.B4chPFti.mjs';
3
3
  import 'modern-idoc';
4
4
  import 'modern-path2d';
5
5
  import 'modern-font';
@@ -80,6 +80,9 @@ class Canvas2DRenderer {
80
80
  case "rgba":
81
81
  canvasGradient.addColorStop(offset, `rgba(${colorStop.value.join(", ")})`);
82
82
  break;
83
+ case "hex":
84
+ canvasGradient.addColorStop(offset, `#${colorStop.value}`);
85
+ break;
83
86
  }
84
87
  });
85
88
  return canvasGradient;
@@ -82,6 +82,9 @@ class Canvas2DRenderer {
82
82
  case "rgba":
83
83
  canvasGradient.addColorStop(offset, `rgba(${colorStop.value.join(", ")})`);
84
84
  break;
85
+ case "hex":
86
+ canvasGradient.addColorStop(offset, `#${colorStop.value}`);
87
+ break;
85
88
  }
86
89
  });
87
90
  return canvasGradient;
@@ -2,7 +2,7 @@
2
2
 
3
3
  const diff = require('diff');
4
4
  const modernIdoc = require('modern-idoc');
5
- const Text = require('../shared/modern-text.BUyl2x8m.cjs');
5
+ const Text = require('../shared/modern-text.CwzFN2LS.cjs');
6
6
  require('modern-path2d');
7
7
  require('modern-font');
8
8
 
@@ -1,6 +1,6 @@
1
1
  import { diffChars } from 'diff';
2
2
  import { isCRLF, textContentToString, normalizeCRLF, normalizeTextContent, property } from 'modern-idoc';
3
- import { T as Text } from '../shared/modern-text.BD1kUWDw.mjs';
3
+ import { T as Text } from '../shared/modern-text.B4chPFti.mjs';
4
4
  import 'modern-path2d';
5
5
  import 'modern-font';
6
6
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-text",
3
3
  "type": "module",
4
- "version": "1.10.0",
4
+ "version": "1.10.1",
5
5
  "packageManager": "pnpm@10.18.1",
6
6
  "description": "Measure and render text in a way that describes the DOM.",
7
7
  "author": "wxm",