@xterm/addon-ligatures 0.11.0-beta.251 → 0.11.0-beta.253

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.
@@ -14,6 +14,7 @@
14
14
  * Copyright (c) Microsoft Corporation. All rights reserved.
15
15
  * Licensed under the MIT License. See License.txt in the project root for license information.
16
16
  *--------------------------------------------------------------------------------------------*/
17
- var Po=Object.create;var _n=Object.defineProperty;var Go=Object.getOwnPropertyDescriptor;var No=Object.getOwnPropertyNames;var Ho=Object.getPrototypeOf,_o=Object.prototype.hasOwnProperty;var tt=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(f,p)=>(typeof require<"u"?require:f)[p]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var Ur=(s,f)=>()=>(f||s((f={exports:{}}).exports,f),f.exports);var zo=(s,f,p,h)=>{if(f&&typeof f=="object"||typeof f=="function")for(let v of No(f))!_o.call(s,v)&&v!==p&&_n(s,v,{get:()=>f[v],enumerable:!(h=Go(f,v))||h.enumerable});return s};var Wo=(s,f,p)=>(p=s!=null?Po(Ho(s)):{},zo(f||!s||!s.__esModule?_n(p,"default",{value:s,enumerable:!0}):p,s));var Wn=Ur((Or,zn)=>{(function(s,f){typeof Or=="object"&&typeof zn<"u"?f(Or):typeof define=="function"&&define.amd?define(["exports"],f):f(s.opentype=s.opentype||{})})(Or,(function(s){"use strict";var f=0,p=-3;function h(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function v(e,r){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=r,this.destLen=0,this.ltree=new h,this.dtree=new h}var x=new h,S=new h,L=new Uint8Array(30),k=new Uint16Array(30),D=new Uint8Array(30),V=new Uint16Array(30),N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),W=new h,X=new Uint8Array(320);function ve(e,r,t,n){var a,i;for(a=0;a<t;++a)e[a]=0;for(a=0;a<30-t;++a)e[a+t]=a/t|0;for(i=n,a=0;a<30;++a)r[a]=i,i+=1<<e[a]}function Ae(e,r){var t;for(t=0;t<7;++t)e.table[t]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,t=0;t<24;++t)e.trans[t]=256+t;for(t=0;t<144;++t)e.trans[24+t]=t;for(t=0;t<8;++t)e.trans[168+t]=280+t;for(t=0;t<112;++t)e.trans[176+t]=144+t;for(t=0;t<5;++t)r.table[t]=0;for(r.table[5]=32,t=0;t<32;++t)r.trans[t]=t}var xt=new Uint16Array(16);function Dr(e,r,t,n){var a,i;for(a=0;a<16;++a)e.table[a]=0;for(a=0;a<n;++a)e.table[r[t+a]]++;for(e.table[0]=0,i=0,a=0;a<16;++a)xt[a]=i,i+=e.table[a];for(a=0;a<n;++a)r[t+a]&&(e.trans[xt[r[t+a]]++]=a)}function oa(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var r=e.tag&1;return e.tag>>>=1,r}function Se(e,r,t){if(!r)return t;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=e.tag&65535>>>16-r;return e.tag>>>=r,e.bitcount-=r,n+t}function Ar(e,r){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var t=0,n=0,a=0,i=e.tag;do n=2*n+(i&1),i>>>=1,++a,t+=r.table[a],n-=r.table[a];while(n>=0);return e.tag=i,e.bitcount-=a,r.trans[t+n]}function ua(e,r,t){var n,a,i,o,l,u;for(n=Se(e,5,257),a=Se(e,5,1),i=Se(e,4,4),o=0;o<19;++o)X[o]=0;for(o=0;o<i;++o){var c=Se(e,3,0);X[N[o]]=c}for(Dr(W,X,0,19),l=0;l<n+a;){var d=Ar(e,W);switch(d){case 16:var y=X[l-1];for(u=Se(e,2,3);u;--u)X[l++]=y;break;case 17:for(u=Se(e,3,3);u;--u)X[l++]=0;break;case 18:for(u=Se(e,7,11);u;--u)X[l++]=0;break;default:X[l++]=d;break}}Dr(r,X,0,n),Dr(t,X,n,a)}function St(e,r,t){for(;;){var n=Ar(e,r);if(n===256)return f;if(n<256)e.dest[e.destLen++]=n;else{var a,i,o,l;for(n-=257,a=Se(e,L[n],k[n]),i=Ar(e,t),o=e.destLen-Se(e,D[i],V[i]),l=o;l<o+a;++l)e.dest[e.destLen++]=e.dest[l]}}}function la(e){for(var r,t,n;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if(r=e.source[e.sourceIndex+1],r=256*r+e.source[e.sourceIndex],t=e.source[e.sourceIndex+3],t=256*t+e.source[e.sourceIndex+2],r!==(~t&65535))return p;for(e.sourceIndex+=4,n=r;n;--n)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,f}function fa(e,r){var t=new v(e,r),n,a,i;do{switch(n=oa(t),a=Se(t,2,0),a){case 0:i=la(t);break;case 1:i=St(t,x,S);break;case 2:ua(t,t.ltree,t.dtree),i=St(t,t.ltree,t.dtree);break;default:i=p}if(i!==f)throw new Error("Data error")}while(!n);return t.destLen<t.dest.length?typeof t.dest.slice=="function"?t.dest.slice(0,t.destLen):t.dest.subarray(0,t.destLen):t.dest}Ae(x,S),ve(L,k,4,3),ve(D,V,2,1),L[28]=0,k[28]=258;var pa=fa;function We(e,r,t,n,a){return Math.pow(1-a,3)*e+3*Math.pow(1-a,2)*a*r+3*(1-a)*Math.pow(a,2)*t+Math.pow(a,3)*n}function ke(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}ke.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},ke.prototype.addPoint=function(e,r){typeof e=="number"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof r=="number"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=r,this.y2=r),r<this.y1&&(this.y1=r),r>this.y2&&(this.y2=r))},ke.prototype.addX=function(e){this.addPoint(e,null)},ke.prototype.addY=function(e){this.addPoint(null,e)},ke.prototype.addBezier=function(e,r,t,n,a,i,o,l){var u=this,c=[e,r],d=[t,n],y=[a,i],g=[o,l];this.addPoint(e,r),this.addPoint(o,l);for(var m=0;m<=1;m++){var T=6*c[m]-12*d[m]+6*y[m],O=-3*c[m]+9*d[m]-9*y[m]+3*g[m],F=3*d[m]-3*c[m];if(O===0){if(T===0)continue;var U=-F/T;0<U&&U<1&&(m===0&&u.addX(We(c[m],d[m],y[m],g[m],U)),m===1&&u.addY(We(c[m],d[m],y[m],g[m],U)));continue}var P=Math.pow(T,2)-4*F*O;if(!(P<0)){var I=(-T+Math.sqrt(P))/(2*O);0<I&&I<1&&(m===0&&u.addX(We(c[m],d[m],y[m],g[m],I)),m===1&&u.addY(We(c[m],d[m],y[m],g[m],I)));var H=(-T-Math.sqrt(P))/(2*O);0<H&&H<1&&(m===0&&u.addX(We(c[m],d[m],y[m],g[m],H)),m===1&&u.addY(We(c[m],d[m],y[m],g[m],H)))}}},ke.prototype.addQuad=function(e,r,t,n,a,i){var o=e+.6666666666666666*(t-e),l=r+2/3*(n-r),u=o+1/3*(a-e),c=l+1/3*(i-r);this.addBezier(e,r,o,l,u,c,a,i)};function Z(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}Z.prototype.moveTo=function(e,r){this.commands.push({type:"M",x:e,y:r})},Z.prototype.lineTo=function(e,r){this.commands.push({type:"L",x:e,y:r})},Z.prototype.curveTo=Z.prototype.bezierCurveTo=function(e,r,t,n,a,i){this.commands.push({type:"C",x1:e,y1:r,x2:t,y2:n,x:a,y:i})},Z.prototype.quadTo=Z.prototype.quadraticCurveTo=function(e,r,t,n){this.commands.push({type:"Q",x1:e,y1:r,x:t,y:n})},Z.prototype.close=Z.prototype.closePath=function(){this.commands.push({type:"Z"})},Z.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof ke){var r=e;this.moveTo(r.x1,r.y1),this.lineTo(r.x2,r.y1),this.lineTo(r.x2,r.y2),this.lineTo(r.x1,r.y2),this.close();return}Array.prototype.push.apply(this.commands,e)},Z.prototype.getBoundingBox=function(){for(var e=this,r=new ke,t=0,n=0,a=0,i=0,o=0;o<this.commands.length;o++){var l=e.commands[o];switch(l.type){case"M":r.addPoint(l.x,l.y),t=a=l.x,n=i=l.y;break;case"L":r.addPoint(l.x,l.y),a=l.x,i=l.y;break;case"Q":r.addQuad(a,i,l.x1,l.y1,l.x,l.y),a=l.x,i=l.y;break;case"C":r.addBezier(a,i,l.x1,l.y1,l.x2,l.y2,l.x,l.y),a=l.x,i=l.y;break;case"Z":a=t,i=n;break;default:throw new Error("Unexpected path command "+l.type)}}return r.isEmpty()&&r.addPoint(0,0),r},Z.prototype.draw=function(e){var r=this;e.beginPath();for(var t=0;t<this.commands.length;t+=1){var n=r.commands[t];n.type==="M"?e.moveTo(n.x,n.y):n.type==="L"?e.lineTo(n.x,n.y):n.type==="C"?e.bezierCurveTo(n.x1,n.y1,n.x2,n.y2,n.x,n.y):n.type==="Q"?e.quadraticCurveTo(n.x1,n.y1,n.x,n.y):n.type==="Z"&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},Z.prototype.toPathData=function(e){var r=this;e=e!==void 0?e:2;function t(l){return Math.round(l)===l?""+Math.round(l):l.toFixed(e)}function n(){for(var l=arguments,u="",c=0;c<arguments.length;c+=1){var d=l[c];d>=0&&c>0&&(u+=" "),u+=t(d)}return u}for(var a="",i=0;i<this.commands.length;i+=1){var o=r.commands[i];o.type==="M"?a+="M"+n(o.x,o.y):o.type==="L"?a+="L"+n(o.x,o.y):o.type==="C"?a+="C"+n(o.x1,o.y1,o.x2,o.y2,o.x,o.y):o.type==="Q"?a+="Q"+n(o.x1,o.y1,o.x,o.y):o.type==="Z"&&(a+="Z")}return a},Z.prototype.toSVG=function(e){var r='<path d="';return r+=this.toPathData(e),r+='"',this.fill&&this.fill!=="black"&&(this.fill===null?r+=' fill="none"':r+=' fill="'+this.fill+'"'),this.stroke&&(r+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),r+="/>",r},Z.prototype.toDOMElement=function(e){var r=this.toPathData(e),t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",r),t};function Tt(e){throw new Error(e)}function kt(e,r){e||Tt(r)}var G={fail:Tt,argument:kt,assert:kt},Ft=32768,Lt=2147483648,Ve={},E={},M={};function ge(e){return function(){return e}}E.BYTE=function(e){return G.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]},M.BYTE=ge(1),E.CHAR=function(e){return[e.charCodeAt(0)]},M.CHAR=ge(1),E.CHARARRAY=function(e){for(var r=[],t=0;t<e.length;t+=1)r[t]=e.charCodeAt(t);return r},M.CHARARRAY=function(e){return e.length},E.USHORT=function(e){return[e>>8&255,e&255]},M.USHORT=ge(2),E.SHORT=function(e){return e>=Ft&&(e=-(2*Ft-e)),[e>>8&255,e&255]},M.SHORT=ge(2),E.UINT24=function(e){return[e>>16&255,e>>8&255,e&255]},M.UINT24=ge(3),E.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]},M.ULONG=ge(4),E.LONG=function(e){return e>=Lt&&(e=-(2*Lt-e)),[e>>24&255,e>>16&255,e>>8&255,e&255]},M.LONG=ge(4),E.FIXED=E.ULONG,M.FIXED=M.ULONG,E.FWORD=E.SHORT,M.FWORD=M.SHORT,E.UFWORD=E.USHORT,M.UFWORD=M.USHORT,E.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,e&255]},M.LONGDATETIME=ge(8),E.TAG=function(e){return G.argument(e.length===4,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},M.TAG=ge(4),E.Card8=E.BYTE,M.Card8=M.BYTE,E.Card16=E.USHORT,M.Card16=M.USHORT,E.OffSize=E.BYTE,M.OffSize=M.BYTE,E.SID=E.USHORT,M.SID=M.USHORT,E.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?(e=e-108,[(e>>8)+247,e&255]):e>=-1131&&e<=-108?(e=-e-108,[(e>>8)+251,e&255]):e>=-32768&&e<=32767?E.NUMBER16(e):E.NUMBER32(e)},M.NUMBER=function(e){return E.NUMBER(e).length},E.NUMBER16=function(e){return[28,e>>8&255,e&255]},M.NUMBER16=ge(3),E.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,e&255]},M.NUMBER32=ge(5),E.REAL=function(e){var r=e.toString(),t=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(r);if(t){var n=parseFloat("1e"+((t[2]?+t[2]:0)+t[1].length));r=(Math.round(e*n)/n).toString()}for(var a="",i=0,o=r.length;i<o;i+=1){var l=r[i];l==="e"?a+=r[++i]==="-"?"c":"b":l==="."?a+="a":l==="-"?a+="e":a+=l}a+=a.length&1?"f":"ff";for(var u=[30],c=0,d=a.length;c<d;c+=2)u.push(parseInt(a.substr(c,2),16));return u},M.REAL=function(e){return E.REAL(e).length},E.NAME=E.CHARARRAY,M.NAME=M.CHARARRAY,E.STRING=E.CHARARRAY,M.STRING=M.CHARARRAY,Ve.UTF8=function(e,r,t){for(var n=[],a=t,i=0;i<a;i++,r+=1)n[i]=e.getUint8(r);return String.fromCharCode.apply(null,n)},Ve.UTF16=function(e,r,t){for(var n=[],a=t/2,i=0;i<a;i++,r+=2)n[i]=e.getUint16(r);return String.fromCharCode.apply(null,n)},E.UTF16=function(e){for(var r=[],t=0;t<e.length;t+=1){var n=e.charCodeAt(t);r[r.length]=n>>8&255,r[r.length]=n&255}return r},M.UTF16=function(e){return e.length*2};var Mr={"x-mac-croatian":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\u0160\u2122\xB4\xA8\u2260\u017D\xD8\u221E\xB1\u2264\u2265\u2206\xB5\u2202\u2211\u220F\u0161\u222B\xAA\xBA\u03A9\u017E\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u0106\xAB\u010C\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u0110\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\uF8FF\xA9\u2044\u20AC\u2039\u203A\xC6\xBB\u2013\xB7\u201A\u201E\u2030\xC2\u0107\xC1\u010D\xC8\xCD\xCE\xCF\xCC\xD3\xD4\u0111\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u03C0\xCB\u02DA\xB8\xCA\xE6\u02C7","x-mac-cyrillic":"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u2020\xB0\u0490\xA3\xA7\u2022\xB6\u0406\xAE\xA9\u2122\u0402\u0452\u2260\u0403\u0453\u221E\xB1\u2264\u2265\u0456\xB5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040A\u045A\u0458\u0405\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\u040B\u045B\u040C\u045C\u0455\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u201E\u040E\u045E\u040F\u045F\u2116\u0401\u0451\u044F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E","x-mac-gaelic":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u1E02\xB1\u2264\u2265\u1E03\u010A\u010B\u1E0A\u1E0B\u1E1E\u1E1F\u0120\u0121\u1E40\xE6\xF8\u1E41\u1E56\u1E57\u027C\u0192\u017F\u1E60\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\u1E61\u1E9B\xFF\u0178\u1E6A\u20AC\u2039\u203A\u0176\u0177\u1E6B\xB7\u1EF2\u1EF3\u204A\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\u2663\xD2\xDA\xDB\xD9\u0131\xDD\xFD\u0174\u0175\u1E84\u1E85\u1E80\u1E81\u1E82\u1E83","x-mac-greek":"\xC4\xB9\xB2\xC9\xB3\xD6\xDC\u0385\xE0\xE2\xE4\u0384\xA8\xE7\xE9\xE8\xEA\xEB\xA3\u2122\xEE\xEF\u2022\xBD\u2030\xF4\xF6\xA6\u20AC\xF9\xFB\xFC\u2020\u0393\u0394\u0398\u039B\u039E\u03A0\xDF\xAE\xA9\u03A3\u03AA\xA7\u2260\xB0\xB7\u0391\xB1\u2264\u2265\xA5\u0392\u0395\u0396\u0397\u0399\u039A\u039C\u03A6\u03AB\u03A8\u03A9\u03AC\u039D\xAC\u039F\u03A1\u2248\u03A4\xAB\xBB\u2026\xA0\u03A5\u03A7\u0386\u0388\u0153\u2013\u2015\u201C\u201D\u2018\u2019\xF7\u0389\u038A\u038C\u038E\u03AD\u03AE\u03AF\u03CC\u038F\u03CD\u03B1\u03B2\u03C8\u03B4\u03B5\u03C6\u03B3\u03B7\u03B9\u03BE\u03BA\u03BB\u03BC\u03BD\u03BF\u03C0\u03CE\u03C1\u03C3\u03C4\u03B8\u03C9\u03C2\u03C7\u03C5\u03B6\u03CA\u03CB\u0390\u03B0\xAD","x-mac-icelandic":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\xDD\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\xD0\xF0\xDE\xFE\xFD\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7","x-mac-inuit":"\u1403\u1404\u1405\u1406\u140A\u140B\u1431\u1432\u1433\u1434\u1438\u1439\u1449\u144E\u144F\u1450\u1451\u1455\u1456\u1466\u146D\u146E\u146F\u1470\u1472\u1473\u1483\u148B\u148C\u148D\u148E\u1490\u1491\xB0\u14A1\u14A5\u14A6\u2022\xB6\u14A7\xAE\xA9\u2122\u14A8\u14AA\u14AB\u14BB\u14C2\u14C3\u14C4\u14C5\u14C7\u14C8\u14D0\u14EF\u14F0\u14F1\u14F2\u14F4\u14F5\u1505\u14D5\u14D6\u14D7\u14D8\u14DA\u14DB\u14EA\u1528\u1529\u152A\u152B\u152D\u2026\xA0\u152E\u153E\u1555\u1556\u1557\u2013\u2014\u201C\u201D\u2018\u2019\u1558\u1559\u155A\u155D\u1546\u1547\u1548\u1549\u154B\u154C\u1550\u157F\u1580\u1581\u1582\u1583\u1584\u1585\u158F\u1590\u1591\u1592\u1593\u1594\u1595\u1671\u1672\u1673\u1674\u1675\u1676\u1596\u15A0\u15A1\u15A2\u15A3\u15A4\u15A5\u15A6\u157C\u0141\u0142","x-mac-ce":"\xC4\u0100\u0101\xC9\u0104\xD6\xDC\xE1\u0105\u010C\xE4\u010D\u0106\u0107\xE9\u0179\u017A\u010E\xED\u010F\u0112\u0113\u0116\xF3\u0117\xF4\xF6\xF5\xFA\u011A\u011B\xFC\u2020\xB0\u0118\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\u0119\xA8\u2260\u0123\u012E\u012F\u012A\u2264\u2265\u012B\u0136\u2202\u2211\u0142\u013B\u013C\u013D\u013E\u0139\u013A\u0145\u0146\u0143\xAC\u221A\u0144\u0147\u2206\xAB\xBB\u2026\xA0\u0148\u0150\xD5\u0151\u014C\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\u014D\u0154\u0155\u0158\u2039\u203A\u0159\u0156\u0157\u0160\u201A\u201E\u0161\u015A\u015B\xC1\u0164\u0165\xCD\u017D\u017E\u016A\xD3\xD4\u016B\u016E\xDA\u016F\u0170\u0171\u0172\u0173\xDD\xFD\u0137\u017B\u0141\u017C\u0122\u02C7",macintosh:"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\u2039\u203A\uFB01\uFB02\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7","x-mac-romanian":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\u0102\u0218\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\u0103\u0219\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\u2039\u203A\u021A\u021B\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7","x-mac-turkish":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u011E\u011F\u0130\u0131\u015E\u015F\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\uF8A0\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"};Ve.MACSTRING=function(e,r,t,n){var a=Mr[n];if(a!==void 0){for(var i="",o=0;o<t;o++){var l=e.getUint8(r+o);l<=127?i+=String.fromCharCode(l):i+=a[l&127]}return i}};var fr=typeof WeakMap=="function"&&new WeakMap,pr,ha=function(e){if(!pr){pr={};for(var r in Mr)pr[r]=new String(r)}var t=pr[e];if(t!==void 0){if(fr){var n=fr.get(t);if(n!==void 0)return n}var a=Mr[e];if(a!==void 0){for(var i={},o=0;o<a.length;o++)i[a.charCodeAt(o)]=o+128;return fr&&fr.set(t,i),i}}};E.MACSTRING=function(e,r){var t=ha(r);if(t!==void 0){for(var n=[],a=0;a<e.length;a++){var i=e.charCodeAt(a);if(i>=128&&(i=t[i],i===void 0))return;n[a]=i}return n}},M.MACSTRING=function(e,r){var t=E.MACSTRING(e,r);return t!==void 0?t.length:0};function Br(e){return e>=-128&&e<=127}function ca(e,r,t){for(var n=0,a=e.length;r<a&&n<64&&e[r]===0;)++r,++n;return t.push(128|n-1),r}function va(e,r,t){for(var n=0,a=e.length,i=r;i<a&&n<64;){var o=e[i];if(!Br(o)||o===0&&i+1<a&&e[i+1]===0)break;++i,++n}t.push(n-1);for(var l=r;l<i;++l)t.push(e[l]+256&255);return i}function da(e,r,t){for(var n=0,a=e.length,i=r;i<a&&n<64;){var o=e[i];if(o===0||Br(o)&&i+1<a&&Br(e[i+1]))break;++i,++n}t.push(64|n-1);for(var l=r;l<i;++l){var u=e[l];t.push(u+65536>>8&255,u+256&255)}return i}E.VARDELTAS=function(e){for(var r=0,t=[];r<e.length;){var n=e[r];n===0?r=ca(e,r,t):n>=-128&&n<=127?r=va(e,r,t):r=da(e,r,t)}return t},E.INDEX=function(e){for(var r=1,t=[r],n=[],a=0;a<e.length;a+=1){var i=E.OBJECT(e[a]);Array.prototype.push.apply(n,i),r+=i.length,t.push(r)}if(n.length===0)return[0,0];for(var o=[],l=1+Math.floor(Math.log(r)/Math.log(2))/8|0,u=[void 0,E.BYTE,E.USHORT,E.UINT24,E.ULONG][l],c=0;c<t.length;c+=1){var d=u(t[c]);Array.prototype.push.apply(o,d)}return Array.prototype.concat(E.Card16(e.length),E.OffSize(l),o,n)},M.INDEX=function(e){return E.INDEX(e).length},E.DICT=function(e){for(var r=[],t=Object.keys(e),n=t.length,a=0;a<n;a+=1){var i=parseInt(t[a],0),o=e[i];r=r.concat(E.OPERAND(o.value,o.type)),r=r.concat(E.OPERATOR(i))}return r},M.DICT=function(e){return E.DICT(e).length},E.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},E.OPERAND=function(e,r){var t=[];if(Array.isArray(r))for(var n=0;n<r.length;n+=1)G.argument(e.length===r.length,"Not enough arguments given for type"+r),t=t.concat(E.OPERAND(e[n],r[n]));else if(r==="SID")t=t.concat(E.NUMBER(e));else if(r==="offset")t=t.concat(E.NUMBER32(e));else if(r==="number")t=t.concat(E.NUMBER(e));else if(r==="real")t=t.concat(E.REAL(e));else throw new Error("Unknown operand type "+r);return t},E.OP=E.BYTE,M.OP=M.BYTE;var hr=typeof WeakMap=="function"&&new WeakMap;E.CHARSTRING=function(e){if(hr){var r=hr.get(e);if(r!==void 0)return r}for(var t=[],n=e.length,a=0;a<n;a+=1){var i=e[a];t=t.concat(E[i.type](i.value))}return hr&&hr.set(e,t),t},M.CHARSTRING=function(e){return E.CHARSTRING(e).length},E.OBJECT=function(e){var r=E[e.type];return G.argument(r!==void 0,"No encoding function for type "+e.type),r(e.value)},M.OBJECT=function(e){var r=M[e.type];return G.argument(r!==void 0,"No sizeOf function for type "+e.type),r(e.value)},E.TABLE=function(e){for(var r=[],t=e.fields.length,n=[],a=[],i=0;i<t;i+=1){var o=e.fields[i],l=E[o.type];G.argument(l!==void 0,"No encoding function for field type "+o.type+" ("+o.name+")");var u=e[o.name];u===void 0&&(u=o.value);var c=l(u);o.type==="TABLE"?(a.push(r.length),r=r.concat([0,0]),n.push(c)):r=r.concat(c)}for(var d=0;d<n.length;d+=1){var y=a[d],g=r.length;G.argument(g<65536,"Table "+e.tableName+" too big."),r[y]=g>>8,r[y+1]=g&255,r=r.concat(n[d])}return r},M.TABLE=function(e){for(var r=0,t=e.fields.length,n=0;n<t;n+=1){var a=e.fields[n],i=M[a.type];G.argument(i!==void 0,"No sizeOf function for field type "+a.type+" ("+a.name+")");var o=e[a.name];o===void 0&&(o=a.value),r+=i(o),a.type==="TABLE"&&(r+=2)}return r},E.RECORD=E.TABLE,M.RECORD=M.TABLE,E.LITERAL=function(e){return e},M.LITERAL=function(e){return e.length};function ee(e,r,t){for(var n=this,a=0;a<r.length;a+=1){var i=r[a];n[i.name]=i.value}if(this.tableName=e,this.fields=r,t)for(var o=Object.keys(t),l=0;l<o.length;l+=1){var u=o[l],c=t[u];n[u]!==void 0&&(n[u]=c)}}ee.prototype.encode=function(){return E.TABLE(this)},ee.prototype.sizeOf=function(){return M.TABLE(this)};function je(e,r,t){t===void 0&&(t=r.length);var n=new Array(r.length+1);n[0]={name:e+"Count",type:"USHORT",value:t};for(var a=0;a<r.length;a++)n[a+1]={name:e+a,type:"USHORT",value:r[a]};return n}function Pr(e,r,t){var n=r.length,a=new Array(n+1);a[0]={name:e+"Count",type:"USHORT",value:n};for(var i=0;i<n;i++)a[i+1]={name:e+i,type:"TABLE",value:t(r[i],i)};return a}function cr(e,r,t){var n=r.length,a=[];a[0]={name:e+"Count",type:"USHORT",value:n};for(var i=0;i<n;i++)a=a.concat(t(r[i],i));return a}function vr(e){e.format===1?ee.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(je("glyph",e.glyphs))):G.assert(!1,"Can't create coverage table format 2 yet.")}vr.prototype=Object.create(ee.prototype),vr.prototype.constructor=vr;function dr(e){ee.call(this,"scriptListTable",cr("scriptRecord",e,function(r,t){var n=r.script,a=n.defaultLangSys;return G.assert(!!a,"Unable to write GSUB: script "+r.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:r.tag},{name:"script"+t,type:"TABLE",value:new ee("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new ee("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:a.reqFeatureIndex}].concat(je("featureIndex",a.featureIndexes)))}].concat(cr("langSys",n.langSysRecords,function(i,o){var l=i.langSys;return[{name:"langSysTag"+o,type:"TAG",value:i.tag},{name:"langSys"+o,type:"TABLE",value:new ee("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:l.reqFeatureIndex}].concat(je("featureIndex",l.featureIndexes)))}]})))}]}))}dr.prototype=Object.create(ee.prototype),dr.prototype.constructor=dr;function gr(e){ee.call(this,"featureListTable",cr("featureRecord",e,function(r,t){var n=r.feature;return[{name:"featureTag"+t,type:"TAG",value:r.tag},{name:"feature"+t,type:"TABLE",value:new ee("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat(je("lookupListIndex",n.lookupListIndexes)))}]}))}gr.prototype=Object.create(ee.prototype),gr.prototype.constructor=gr;function mr(e,r){ee.call(this,"lookupListTable",Pr("lookup",e,function(t){var n=r[t.lookupType];return G.assert(!!n,"Unable to write GSUB lookup type "+t.lookupType+" tables."),new ee("lookupTable",[{name:"lookupType",type:"USHORT",value:t.lookupType},{name:"lookupFlag",type:"USHORT",value:t.lookupFlag}].concat(Pr("subtable",t.subtables,n)))}))}mr.prototype=Object.create(ee.prototype),mr.prototype.constructor=mr;var A={Table:ee,Record:ee,Coverage:vr,ScriptList:dr,FeatureList:gr,LookupList:mr,ushortList:je,tableList:Pr,recordList:cr};function Et(e,r){return e.getUint8(r)}function yr(e,r){return e.getUint16(r,!1)}function ga(e,r){return e.getInt16(r,!1)}function Gr(e,r){return e.getUint32(r,!1)}function Ut(e,r){var t=e.getInt16(r,!1),n=e.getUint16(r+2,!1);return t+n/65535}function ma(e,r){for(var t="",n=r;n<r+4;n+=1)t+=String.fromCharCode(e.getInt8(n));return t}function ya(e,r,t){for(var n=0,a=0;a<t;a+=1)n<<=8,n+=e.getUint8(r+a);return n}function ba(e,r,t){for(var n=[],a=r;a<t;a+=1)n.push(e.getUint8(a));return n}function xa(e){for(var r="",t=0;t<e.length;t+=1)r+=String.fromCharCode(e[t]);return r}var Sa={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function b(e,r){this.data=e,this.offset=r,this.relativeOffset=0}b.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},b.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},b.prototype.parseCard8=b.prototype.parseByte,b.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},b.prototype.parseCard16=b.prototype.parseUShort,b.prototype.parseSID=b.prototype.parseUShort,b.prototype.parseOffset16=b.prototype.parseUShort,b.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},b.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},b.prototype.parseULong=function(){var e=Gr(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},b.prototype.parseOffset32=b.prototype.parseULong,b.prototype.parseFixed=function(){var e=Ut(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},b.prototype.parseString=function(e){var r=this.data,t=this.offset+this.relativeOffset,n="";this.relativeOffset+=e;for(var a=0;a<e;a++)n+=String.fromCharCode(r.getUint8(t+a));return n},b.prototype.parseTag=function(){return this.parseString(4)},b.prototype.parseLongDateTime=function(){var e=Gr(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},b.prototype.parseVersion=function(e){var r=yr(this.data,this.offset+this.relativeOffset),t=yr(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,e===void 0&&(e=4096),r+t/e/10},b.prototype.skip=function(e,r){r===void 0&&(r=1),this.relativeOffset+=Sa[e]*r},b.prototype.parseULongList=function(e){e===void 0&&(e=this.parseULong());for(var r=new Array(e),t=this.data,n=this.offset+this.relativeOffset,a=0;a<e;a++)r[a]=t.getUint32(n),n+=4;return this.relativeOffset+=e*4,r},b.prototype.parseOffset16List=b.prototype.parseUShortList=function(e){e===void 0&&(e=this.parseUShort());for(var r=new Array(e),t=this.data,n=this.offset+this.relativeOffset,a=0;a<e;a++)r[a]=t.getUint16(n),n+=2;return this.relativeOffset+=e*2,r},b.prototype.parseShortList=function(e){for(var r=new Array(e),t=this.data,n=this.offset+this.relativeOffset,a=0;a<e;a++)r[a]=t.getInt16(n),n+=2;return this.relativeOffset+=e*2,r},b.prototype.parseByteList=function(e){for(var r=new Array(e),t=this.data,n=this.offset+this.relativeOffset,a=0;a<e;a++)r[a]=t.getUint8(n++);return this.relativeOffset+=e,r},b.prototype.parseList=function(e,r){var t=this;r||(r=e,e=this.parseUShort());for(var n=new Array(e),a=0;a<e;a++)n[a]=r.call(t);return n},b.prototype.parseList32=function(e,r){var t=this;r||(r=e,e=this.parseULong());for(var n=new Array(e),a=0;a<e;a++)n[a]=r.call(t);return n},b.prototype.parseRecordList=function(e,r){var t=this;r||(r=e,e=this.parseUShort());for(var n=new Array(e),a=Object.keys(r),i=0;i<e;i++){for(var o={},l=0;l<a.length;l++){var u=a[l],c=r[u];o[u]=c.call(t)}n[i]=o}return n},b.prototype.parseRecordList32=function(e,r){var t=this;r||(r=e,e=this.parseULong());for(var n=new Array(e),a=Object.keys(r),i=0;i<e;i++){for(var o={},l=0;l<a.length;l++){var u=a[l],c=r[u];o[u]=c.call(t)}n[i]=o}return n},b.prototype.parseStruct=function(e){var r=this;if(typeof e=="function")return e.call(this);for(var t=Object.keys(e),n={},a=0;a<t.length;a++){var i=t[a],o=e[i];n[i]=o.call(r)}return n},b.prototype.parseValueRecord=function(e){if(e===void 0&&(e=this.parseUShort()),e!==0){var r={};return e&1&&(r.xPlacement=this.parseShort()),e&2&&(r.yPlacement=this.parseShort()),e&4&&(r.xAdvance=this.parseShort()),e&8&&(r.yAdvance=this.parseShort()),e&16&&(r.xPlaDevice=void 0,this.parseShort()),e&32&&(r.yPlaDevice=void 0,this.parseShort()),e&64&&(r.xAdvDevice=void 0,this.parseShort()),e&128&&(r.yAdvDevice=void 0,this.parseShort()),r}},b.prototype.parseValueRecordList=function(){for(var e=this,r=this.parseUShort(),t=this.parseUShort(),n=new Array(t),a=0;a<t;a++)n[a]=e.parseValueRecord(r);return n},b.prototype.parsePointer=function(e){var r=this.parseOffset16();if(r>0)return new b(this.data,this.offset+r).parseStruct(e)},b.prototype.parsePointer32=function(e){var r=this.parseOffset32();if(r>0)return new b(this.data,this.offset+r).parseStruct(e)},b.prototype.parseListOfLists=function(e){for(var r=this,t=this.parseOffset16List(),n=t.length,a=this.relativeOffset,i=new Array(n),o=0;o<n;o++){var l=t[o];if(l===0){i[o]=void 0;continue}if(r.relativeOffset=l,e){for(var u=r.parseOffset16List(),c=new Array(u.length),d=0;d<u.length;d++)r.relativeOffset=l+u[d],c[d]=e.call(r);i[o]=c}else i[o]=r.parseUShortList()}return this.relativeOffset=a,i},b.prototype.parseCoverage=function(){var e=this,r=this.offset+this.relativeOffset,t=this.parseUShort(),n=this.parseUShort();if(t===1)return{format:1,glyphs:this.parseUShortList(n)};if(t===2){for(var a=new Array(n),i=0;i<n;i++)a[i]={start:e.parseUShort(),end:e.parseUShort(),index:e.parseUShort()};return{format:2,ranges:a}}throw new Error("0x"+r.toString(16)+": Coverage format must be 1 or 2.")},b.prototype.parseClassDef=function(){var e=this.offset+this.relativeOffset,r=this.parseUShort();if(r===1)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(r===2)return{format:2,ranges:this.parseRecordList({start:b.uShort,end:b.uShort,classId:b.uShort})};throw new Error("0x"+e.toString(16)+": ClassDef format must be 1 or 2.")},b.list=function(e,r){return function(){return this.parseList(e,r)}},b.list32=function(e,r){return function(){return this.parseList32(e,r)}},b.recordList=function(e,r){return function(){return this.parseRecordList(e,r)}},b.recordList32=function(e,r){return function(){return this.parseRecordList32(e,r)}},b.pointer=function(e){return function(){return this.parsePointer(e)}},b.pointer32=function(e){return function(){return this.parsePointer32(e)}},b.tag=b.prototype.parseTag,b.byte=b.prototype.parseByte,b.uShort=b.offset16=b.prototype.parseUShort,b.uShortList=b.prototype.parseUShortList,b.uLong=b.offset32=b.prototype.parseULong,b.uLongList=b.prototype.parseULongList,b.struct=b.prototype.parseStruct,b.coverage=b.prototype.parseCoverage,b.classDef=b.prototype.parseClassDef;var Ot={reserved:b.uShort,reqFeatureIndex:b.uShort,featureIndexes:b.uShortList};b.prototype.parseScriptList=function(){return this.parsePointer(b.recordList({tag:b.tag,script:b.pointer({defaultLangSys:b.pointer(Ot),langSysRecords:b.recordList({tag:b.tag,langSys:b.pointer(Ot)})})}))||[]},b.prototype.parseFeatureList=function(){return this.parsePointer(b.recordList({tag:b.tag,feature:b.pointer({featureParams:b.offset16,lookupListIndexes:b.uShortList})}))||[]},b.prototype.parseLookupList=function(e){return this.parsePointer(b.list(b.pointer(function(){var r=this.parseUShort();G.argument(1<=r&&r<=9,"GPOS/GSUB lookup type "+r+" unknown.");var t=this.parseUShort(),n=t&16;return{lookupType:r,lookupFlag:t,subtables:this.parseList(b.pointer(e[r])),markFilteringSet:n?this.parseUShort():void 0}})))||[]},b.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var e=this.parseUShort(),r=this.parseUShort();G.argument(e===1&&r<1,"GPOS/GSUB feature variations table unknown.");var t=this.parseRecordList32({conditionSetOffset:b.offset32,featureTableSubstitutionOffset:b.offset32});return t})||[]};var w={getByte:Et,getCard8:Et,getUShort:yr,getCard16:yr,getShort:ga,getULong:Gr,getFixed:Ut,getTag:ma,getOffset:ya,getBytes:ba,bytesToString:xa,Parser:b};function Ta(e,r){r.parseUShort(),e.length=r.parseULong(),e.language=r.parseULong();var t;e.groupCount=t=r.parseULong(),e.glyphIndexMap={};for(var n=0;n<t;n+=1)for(var a=r.parseULong(),i=r.parseULong(),o=r.parseULong(),l=a;l<=i;l+=1)e.glyphIndexMap[l]=o,o++}function ka(e,r,t,n,a){e.length=r.parseUShort(),e.language=r.parseUShort();var i;e.segCount=i=r.parseUShort()>>1,r.skip("uShort",3),e.glyphIndexMap={};for(var o=new w.Parser(t,n+a+14),l=new w.Parser(t,n+a+16+i*2),u=new w.Parser(t,n+a+16+i*4),c=new w.Parser(t,n+a+16+i*6),d=n+a+16+i*8,y=0;y<i-1;y+=1)for(var g=void 0,m=o.parseUShort(),T=l.parseUShort(),O=u.parseShort(),F=c.parseUShort(),U=T;U<=m;U+=1)F!==0?(d=c.offset+c.relativeOffset-2,d+=F,d+=(U-T)*2,g=w.getUShort(t,d),g!==0&&(g=g+O&65535)):g=U+O&65535,e.glyphIndexMap[U]=g}function Fa(e,r){var t={};t.version=w.getUShort(e,r),G.argument(t.version===0,"cmap table version should be 0."),t.numTables=w.getUShort(e,r+2);for(var n=-1,a=t.numTables-1;a>=0;a-=1){var i=w.getUShort(e,r+4+a*8),o=w.getUShort(e,r+4+a*8+2);if(i===3&&(o===0||o===1||o===10)){n=w.getULong(e,r+4+a*8+4);break}}if(n===-1)throw new Error("No valid cmap sub-tables found.");var l=new w.Parser(e,r+n);if(t.format=l.parseUShort(),t.format===12)Ta(t,l);else if(t.format===4)ka(t,l,e,r,n);else throw new Error("Only format 4 and 12 cmap tables are supported (found format "+t.format+").");return t}function La(e,r,t){e.segments.push({end:r,start:r,delta:-(r-t),offset:0,glyphIndex:t})}function Ea(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}function Ua(e){var r=!0,t;for(t=e.length-1;t>0;t-=1){var n=e.get(t);if(n.unicode>65535){console.log("Adding CMAP format 12 (needed!)"),r=!1;break}}var a=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:r?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:r?12:20}];r||(a=a.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),a=a.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var i=new A.Table("cmap",a);for(i.segments=[],t=0;t<e.length;t+=1){for(var o=e.get(t),l=0;l<o.unicodes.length;l+=1)La(i,o.unicodes[l],t);i.segments=i.segments.sort(function(P,I){return P.start-I.start})}Ea(i);var u=i.segments.length,c=0,d=[],y=[],g=[],m=[],T=[],O=[];for(t=0;t<u;t+=1){var F=i.segments[t];F.end<=65535&&F.start<=65535?(d=d.concat({name:"end_"+t,type:"USHORT",value:F.end}),y=y.concat({name:"start_"+t,type:"USHORT",value:F.start}),g=g.concat({name:"idDelta_"+t,type:"SHORT",value:F.delta}),m=m.concat({name:"idRangeOffset_"+t,type:"USHORT",value:F.offset}),F.glyphId!==void 0&&(T=T.concat({name:"glyph_"+t,type:"USHORT",value:F.glyphId}))):c+=1,!r&&F.glyphIndex!==void 0&&(O=O.concat({name:"cmap12Start_"+t,type:"ULONG",value:F.start}),O=O.concat({name:"cmap12End_"+t,type:"ULONG",value:F.end}),O=O.concat({name:"cmap12Glyph_"+t,type:"ULONG",value:F.glyphIndex}))}if(i.segCountX2=(u-c)*2,i.searchRange=Math.pow(2,Math.floor(Math.log(u-c)/Math.log(2)))*2,i.entrySelector=Math.log(i.searchRange/2)/Math.log(2),i.rangeShift=i.segCountX2-i.searchRange,i.fields=i.fields.concat(d),i.fields.push({name:"reservedPad",type:"USHORT",value:0}),i.fields=i.fields.concat(y),i.fields=i.fields.concat(g),i.fields=i.fields.concat(m),i.fields=i.fields.concat(T),i.cmap4Length=14+d.length*2+2+y.length*2+g.length*2+m.length*2+T.length*2,!r){var U=16+O.length*4;i.cmap12Offset=20+i.cmap4Length,i.fields=i.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:U},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:O.length/3}]),i.fields=i.fields.concat(O)}return i}var It={parse:Fa,make:Ua},br=[".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"],Oa=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],Ia=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],Me=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","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","grave","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","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function Ct(e){this.font=e}Ct.prototype.charToGlyphIndex=function(e){var r=e.charCodeAt(0),t=this.font.glyphs;if(t){for(var n=0;n<t.length;n+=1)for(var a=t.get(n),i=0;i<a.unicodes.length;i+=1)if(a.unicodes[i]===r)return n}return null};function wt(e){this.cmap=e}wt.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.charCodeAt(0)]||0};function xr(e,r){this.encoding=e,this.charset=r}xr.prototype.charToGlyphIndex=function(e){var r=e.charCodeAt(0),t=this.encoding[r];return this.charset.indexOf(t)};function Nr(e){var r=this;switch(e.version){case 1:this.names=Me.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(var t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<Me.length?r.names[t]=Me[e.glyphNameIndex[t]]:r.names[t]=e.names[e.glyphNameIndex[t]-Me.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(var n=0;n<e.numberOfGlyphs;n++)r.names[n]=Me[n+e.glyphNameIndex[n]];break;case 3:this.names=[];break;default:this.names=[];break}}Nr.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},Nr.prototype.glyphIndexToName=function(e){return this.names[e]};function Ca(e){for(var r,t=e.tables.cmap.glyphIndexMap,n=Object.keys(t),a=0;a<n.length;a+=1){var i=n[a],o=t[i];r=e.glyphs.get(o),r.addUnicode(parseInt(i))}for(var l=0;l<e.glyphs.length;l+=1)r=e.glyphs.get(l),e.cffEncoding?e.isCIDFont?r.name="gid"+l:r.name=e.cffEncoding.charset[l]:e.glyphNames.names&&(r.name=e.glyphNames.glyphIndexToName(l))}function wa(e,r,t,n,a){e.beginPath(),e.moveTo(r,t),e.lineTo(n,a),e.stroke()}var Be={line:wa};function Rt(e,r,t,n,a){var i;return(r&n)>0?(i=e.parseByte(),(r&a)===0&&(i=-i),i=t+i):(r&a)>0?i=t:i=t+e.parseShort(),i}function Ra(e,r,t){var n=new w.Parser(r,t);e.numberOfContours=n.parseShort(),e._xMin=n.parseShort(),e._yMin=n.parseShort(),e._xMax=n.parseShort(),e._yMax=n.parseShort();var a,i;if(e.numberOfContours>0){for(var o=e.endPointIndices=[],l=0;l<e.numberOfContours;l+=1)o.push(n.parseUShort());e.instructionLength=n.parseUShort(),e.instructions=[];for(var u=0;u<e.instructionLength;u+=1)e.instructions.push(n.parseByte());var c=o[o.length-1]+1;a=[];for(var d=0;d<c;d+=1)if(i=n.parseByte(),a.push(i),(i&8)>0)for(var y=n.parseByte(),g=0;g<y;g+=1)a.push(i),d+=1;if(G.argument(a.length===c,"Bad flags."),o.length>0){var m=[],T;if(c>0){for(var O=0;O<c;O+=1)i=a[O],T={},T.onCurve=!!(i&1),T.lastPointOfContour=o.indexOf(O)>=0,m.push(T);for(var F=0,U=0;U<c;U+=1)i=a[U],T=m[U],T.x=Rt(n,i,F,2,16),F=T.x;for(var P=0,I=0;I<c;I+=1)i=a[I],T=m[I],T.y=Rt(n,i,P,4,32),P=T.y}e.points=m}else e.points=[]}else if(e.numberOfContours===0)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];for(var H=!0;H;){a=n.parseUShort();var R={glyphIndex:n.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(a&1)>0?(a&2)>0?(R.dx=n.parseShort(),R.dy=n.parseShort()):R.matchedPoints=[n.parseUShort(),n.parseUShort()]:(a&2)>0?(R.dx=n.parseChar(),R.dy=n.parseChar()):R.matchedPoints=[n.parseByte(),n.parseByte()],(a&8)>0?R.xScale=R.yScale=n.parseF2Dot14():(a&64)>0?(R.xScale=n.parseF2Dot14(),R.yScale=n.parseF2Dot14()):(a&128)>0&&(R.xScale=n.parseF2Dot14(),R.scale01=n.parseF2Dot14(),R.scale10=n.parseF2Dot14(),R.yScale=n.parseF2Dot14()),e.components.push(R),H=!!(a&32)}if(a&256){e.instructionLength=n.parseUShort(),e.instructions=[];for(var B=0;B<e.instructionLength;B+=1)e.instructions.push(n.parseByte())}}}function Hr(e,r){for(var t=[],n=0;n<e.length;n+=1){var a=e[n],i={x:r.xScale*a.x+r.scale01*a.y+r.dx,y:r.scale10*a.x+r.yScale*a.y+r.dy,onCurve:a.onCurve,lastPointOfContour:a.lastPointOfContour};t.push(i)}return t}function Da(e){for(var r=[],t=[],n=0;n<e.length;n+=1){var a=e[n];t.push(a),a.lastPointOfContour&&(r.push(t),t=[])}return G.argument(t.length===0,"There are still points left in the current contour."),r}function Dt(e){var r=new Z;if(!e)return r;for(var t=Da(e),n=0;n<t.length;++n){var a=t[n],i=null,o=a[a.length-1],l=a[0];if(o.onCurve)r.moveTo(o.x,o.y);else if(l.onCurve)r.moveTo(l.x,l.y);else{var u={x:(o.x+l.x)*.5,y:(o.y+l.y)*.5};r.moveTo(u.x,u.y)}for(var c=0;c<a.length;++c)if(i=o,o=l,l=a[(c+1)%a.length],o.onCurve)r.lineTo(o.x,o.y);else{var d=i,y=l;i.onCurve||(d={x:(o.x+i.x)*.5,y:(o.y+i.y)*.5},r.lineTo(d.x,d.y)),l.onCurve||(y={x:(o.x+l.x)*.5,y:(o.y+l.y)*.5}),r.lineTo(d.x,d.y),r.quadraticCurveTo(o.x,o.y,y.x,y.y)}r.closePath()}return r}function Aa(e,r){if(r.isComposite)for(var t=0;t<r.components.length;t+=1){var n=r.components[t],a=e.get(n.glyphIndex);if(a.getPath(),a.points){var i=void 0;if(n.matchedPoints===void 0)i=Hr(a.points,n);else{if(n.matchedPoints[0]>r.points.length-1||n.matchedPoints[1]>a.points.length-1)throw Error("Matched points out of range in "+r.name);var o=r.points[n.matchedPoints[0]],l=a.points[n.matchedPoints[1]],u={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};l=Hr([l],u)[0],u.dx=o.x-l.x,u.dy=o.y-l.y,i=Hr(a.points,u)}r.points=r.points.concat(i)}}return Dt(r.points)}function Ma(e,r,t,n){for(var a=new qe.GlyphSet(n),i=0;i<t.length-1;i+=1){var o=t[i],l=t[i+1];o!==l?a.push(i,qe.ttfGlyphLoader(n,i,Ra,e,r+o,Aa)):a.push(i,qe.glyphLoader(n,i))}return a}var At={getPath:Dt,parse:Ma};function Ba(e,r){var t=r||new Z;return{configurable:!0,get:function(){return typeof t=="function"&&(t=t()),t},set:function(n){t=n}}}function fe(e){this.bindConstructorValues(e)}fe.prototype.bindConstructorValues=function(e){this.index=e.index||0,this.name=e.name||null,this.unicode=e.unicode||void 0,this.unicodes=e.unicodes||e.unicode!==void 0?[e.unicode]:[],e.xMin&&(this.xMin=e.xMin),e.yMin&&(this.yMin=e.yMin),e.xMax&&(this.xMax=e.xMax),e.yMax&&(this.yMax=e.yMax),e.advanceWidth&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",Ba(this,e.path))},fe.prototype.addUnicode=function(e){this.unicodes.length===0&&(this.unicode=e),this.unicodes.push(e)},fe.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},fe.prototype.getPath=function(e,r,t,n,a){e=e!==void 0?e:0,r=r!==void 0?r:0,t=t!==void 0?t:72;var i,o;n||(n={});var l=n.xScale,u=n.yScale;if(n.hinting&&a&&a.hinting&&(o=this.path&&a.hinting.exec(this,t)),o)i=At.getPath(o).commands,e=Math.round(e),r=Math.round(r),l=u=1;else{i=this.path.commands;var c=1/this.path.unitsPerEm*t;l===void 0&&(l=c),u===void 0&&(u=c)}for(var d=new Z,y=0;y<i.length;y+=1){var g=i[y];g.type==="M"?d.moveTo(e+g.x*l,r+-g.y*u):g.type==="L"?d.lineTo(e+g.x*l,r+-g.y*u):g.type==="Q"?d.quadraticCurveTo(e+g.x1*l,r+-g.y1*u,e+g.x*l,r+-g.y*u):g.type==="C"?d.curveTo(e+g.x1*l,r+-g.y1*u,e+g.x2*l,r+-g.y2*u,e+g.x*l,r+-g.y*u):g.type==="Z"&&d.closePath()}return d},fe.prototype.getContours=function(){var e=this;if(this.points===void 0)return[];for(var r=[],t=[],n=0;n<this.points.length;n+=1){var a=e.points[n];t.push(a),a.lastPointOfContour&&(r.push(t),t=[])}return G.argument(t.length===0,"There are still points left in the current contour."),r},fe.prototype.getMetrics=function(){for(var e=this.path.commands,r=[],t=[],n=0;n<e.length;n+=1){var a=e[n];a.type!=="Z"&&(r.push(a.x),t.push(a.y)),(a.type==="Q"||a.type==="C")&&(r.push(a.x1),t.push(a.y1)),a.type==="C"&&(r.push(a.x2),t.push(a.y2))}var i={xMin:Math.min.apply(null,r),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,r),yMax:Math.max.apply(null,t),leftSideBearing:this.leftSideBearing};return isFinite(i.xMin)||(i.xMin=0),isFinite(i.xMax)||(i.xMax=this.advanceWidth),isFinite(i.yMin)||(i.yMin=0),isFinite(i.yMax)||(i.yMax=0),i.rightSideBearing=this.advanceWidth-i.leftSideBearing-(i.xMax-i.xMin),i},fe.prototype.draw=function(e,r,t,n,a){this.getPath(r,t,n,a).draw(e)},fe.prototype.drawPoints=function(e,r,t,n){function a(y,g,m,T){var O=Math.PI*2;e.beginPath();for(var F=0;F<y.length;F+=1)e.moveTo(g+y[F].x*T,m+y[F].y*T),e.arc(g+y[F].x*T,m+y[F].y*T,2,0,O,!1);e.closePath(),e.fill()}r=r!==void 0?r:0,t=t!==void 0?t:0,n=n!==void 0?n:24;for(var i=1/this.path.unitsPerEm*n,o=[],l=[],u=this.path,c=0;c<u.commands.length;c+=1){var d=u.commands[c];d.x!==void 0&&o.push({x:d.x,y:-d.y}),d.x1!==void 0&&l.push({x:d.x1,y:-d.y1}),d.x2!==void 0&&l.push({x:d.x2,y:-d.y2})}e.fillStyle="blue",a(o,r,t,i),e.fillStyle="red",a(l,r,t,i)},fe.prototype.drawMetrics=function(e,r,t,n){var a;r=r!==void 0?r:0,t=t!==void 0?t:0,n=n!==void 0?n:24,a=1/this.path.unitsPerEm*n,e.lineWidth=1,e.strokeStyle="black",Be.line(e,r,-1e4,r,1e4),Be.line(e,-1e4,t,1e4,t);var i=this.xMin||0,o=this.yMin||0,l=this.xMax||0,u=this.yMax||0,c=this.advanceWidth||0;e.strokeStyle="blue",Be.line(e,r+i*a,-1e4,r+i*a,1e4),Be.line(e,r+l*a,-1e4,r+l*a,1e4),Be.line(e,-1e4,t+-o*a,1e4,t+-o*a),Be.line(e,-1e4,t+-u*a,1e4,t+-u*a),e.strokeStyle="green",Be.line(e,r+c*a,-1e4,r+c*a,1e4)};function Sr(e,r,t){Object.defineProperty(e,r,{get:function(){return e.path,e[t]},set:function(n){e[t]=n},enumerable:!0,configurable:!0})}function _r(e,r){var t=this;if(this.font=e,this.glyphs={},Array.isArray(r))for(var n=0;n<r.length;n++)t.glyphs[n]=r[n];this.length=r&&r.length||0}_r.prototype.get=function(e){return typeof this.glyphs[e]=="function"&&(this.glyphs[e]=this.glyphs[e]()),this.glyphs[e]},_r.prototype.push=function(e,r){this.glyphs[e]=r,this.length++};function Pa(e,r){return new fe({index:r,font:e})}function Ga(e,r,t,n,a,i){return function(){var o=new fe({index:r,font:e});return o.path=function(){t(o,n,a);var l=i(e.glyphs,o);return l.unitsPerEm=e.unitsPerEm,l},Sr(o,"xMin","_xMin"),Sr(o,"xMax","_xMax"),Sr(o,"yMin","_yMin"),Sr(o,"yMax","_yMax"),o}}function Na(e,r,t,n){return function(){var a=new fe({index:r,font:e});return a.path=function(){var i=t(e,a,n);return i.unitsPerEm=e.unitsPerEm,i},a}}var qe={GlyphSet:_r,glyphLoader:Pa,ttfGlyphLoader:Ga,cffGlyphLoader:Na};function Mt(e,r){if(e===r)return!0;if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return!1;for(var t=0;t<e.length;t+=1)if(!Mt(e[t],r[t]))return!1;return!0}else return!1}function zr(e){var r;return e.length<1240?r=107:e.length<33900?r=1131:r=32768,r}function Oe(e,r,t){var n=[],a=[],i=w.getCard16(e,r),o,l;if(i!==0){var u=w.getByte(e,r+2);o=r+(i+1)*u+2;for(var c=r+3,d=0;d<i+1;d+=1)n.push(w.getOffset(e,c,u)),c+=u;l=o+n[i]}else l=r+2;for(var y=0;y<n.length-1;y+=1){var g=w.getBytes(e,o+n[y],o+n[y+1]);t&&(g=t(g)),a.push(g)}return{objects:a,startOffset:r,endOffset:l}}function Ha(e){for(var r="",t=15,n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var a=e.parseByte(),i=a>>4,o=a&15;if(i===t||(r+=n[i],o===t))break;r+=n[o]}return parseFloat(r)}function _a(e,r){var t,n,a,i;if(r===28)return t=e.parseByte(),n=e.parseByte(),t<<8|n;if(r===29)return t=e.parseByte(),n=e.parseByte(),a=e.parseByte(),i=e.parseByte(),t<<24|n<<16|a<<8|i;if(r===30)return Ha(e);if(r>=32&&r<=246)return r-139;if(r>=247&&r<=250)return t=e.parseByte(),(r-247)*256+t+108;if(r>=251&&r<=254)return t=e.parseByte(),-(r-251)*256-t-108;throw new Error("Invalid b0 "+r)}function za(e){for(var r={},t=0;t<e.length;t+=1){var n=e[t][0],a=e[t][1],i=void 0;if(a.length===1?i=a[0]:i=a,r.hasOwnProperty(n)&&!isNaN(r[n]))throw new Error("Object "+r+" already has key "+n);r[n]=i}return r}function Bt(e,r,t){r=r!==void 0?r:0;var n=new w.Parser(e,r),a=[],i=[];for(t=t!==void 0?t:e.length;n.relativeOffset<t;){var o=n.parseByte();o<=21?(o===12&&(o=1200+n.parseByte()),a.push([o,i]),i=[]):i.push(_a(n,o))}return za(a)}function $e(e,r){return r<=390?r=br[r]:r=e[r-391],r}function Pt(e,r,t){for(var n={},a,i=0;i<r.length;i+=1){var o=r[i];if(Array.isArray(o.type)){var l=[];l.length=o.type.length;for(var u=0;u<o.type.length;u++)a=e[o.op]!==void 0?e[o.op][u]:void 0,a===void 0&&(a=o.value!==void 0&&o.value[u]!==void 0?o.value[u]:null),o.type[u]==="SID"&&(a=$e(t,a)),l[u]=a;n[o.name]=l}else a=e[o.op],a===void 0&&(a=o.value!==void 0?o.value:null),o.type==="SID"&&(a=$e(t,a)),n[o.name]=a}return n}function Wa(e,r){var t={};return t.formatMajor=w.getCard8(e,r),t.formatMinor=w.getCard8(e,r+1),t.size=w.getCard8(e,r+2),t.offsetSize=w.getCard8(e,r+3),t.startOffset=r,t.endOffset=r+4,t}var Gt=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],Nt=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];function Va(e,r){var t=Bt(e,0,e.byteLength);return Pt(t,Gt,r)}function Ht(e,r,t,n){var a=Bt(e,r,t);return Pt(a,Nt,n)}function _t(e,r,t,n){for(var a=[],i=0;i<t.length;i+=1){var o=new DataView(new Uint8Array(t[i]).buffer),l=Va(o,n);l._subrs=[],l._subrsBias=0;var u=l.private[0],c=l.private[1];if(u!==0&&c!==0){var d=Ht(e,c+r,u,n);if(l._defaultWidthX=d.defaultWidthX,l._nominalWidthX=d.nominalWidthX,d.subrs!==0){var y=c+d.subrs,g=Oe(e,y+r);l._subrs=g.objects,l._subrsBias=zr(l._subrs)}l._privateDict=d}a.push(l)}return a}function qa(e,r,t,n){var a,i,o=new w.Parser(e,r);t-=1;var l=[".notdef"],u=o.parseCard8();if(u===0)for(var c=0;c<t;c+=1)a=o.parseSID(),l.push($e(n,a));else if(u===1)for(;l.length<=t;){a=o.parseSID(),i=o.parseCard8();for(var d=0;d<=i;d+=1)l.push($e(n,a)),a+=1}else if(u===2)for(;l.length<=t;){a=o.parseSID(),i=o.parseCard16();for(var y=0;y<=i;y+=1)l.push($e(n,a)),a+=1}else throw new Error("Unknown charset format "+u);return l}function Xa(e,r,t){var n,a={},i=new w.Parser(e,r),o=i.parseCard8();if(o===0)for(var l=i.parseCard8(),u=0;u<l;u+=1)n=i.parseCard8(),a[n]=u;else if(o===1){var c=i.parseCard8();n=1;for(var d=0;d<c;d+=1)for(var y=i.parseCard8(),g=i.parseCard8(),m=y;m<=y+g;m+=1)a[m]=n,n+=1}else throw new Error("Unknown encoding format "+o);return new xr(a,t)}function Ya(e,r,t){var n,a,i,o,l=new Z,u=[],c=0,d=!1,y=!1,g=0,m=0,T,O,F,U;if(e.isCIDFont){var P=e.tables.cff.topDict._fdSelect[r.index],I=e.tables.cff.topDict._fdArray[P];T=I._subrs,O=I._subrsBias,F=I._defaultWidthX,U=I._nominalWidthX}else T=e.tables.cff.topDict._subrs,O=e.tables.cff.topDict._subrsBias,F=e.tables.cff.topDict._defaultWidthX,U=e.tables.cff.topDict._nominalWidthX;var H=F;function R(q,K){y&&l.closePath(),l.moveTo(q,K),y=!0}function B(){var q;q=u.length%2!==0,q&&!d&&(H=u.shift()+U),c+=u.length>>1,u.length=0,d=!0}function ue(q){for(var K,se,le,pe,de,J,j,re,te,ne,oe,he,Y=0;Y<q.length;){var ae=q[Y];switch(Y+=1,ae){case 1:B();break;case 3:B();break;case 4:u.length>1&&!d&&(H=u.shift()+U,d=!0),m+=u.pop(),R(g,m);break;case 5:for(;u.length>0;)g+=u.shift(),m+=u.shift(),l.lineTo(g,m);break;case 6:for(;u.length>0&&(g+=u.shift(),l.lineTo(g,m),u.length!==0);)m+=u.shift(),l.lineTo(g,m);break;case 7:for(;u.length>0&&(m+=u.shift(),l.lineTo(g,m),u.length!==0);)g+=u.shift(),l.lineTo(g,m);break;case 8:for(;u.length>0;)n=g+u.shift(),a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),g=i+u.shift(),m=o+u.shift(),l.curveTo(n,a,i,o,g,m);break;case 10:de=u.pop()+O,J=T[de],J&&ue(J);break;case 11:return;case 12:switch(ae=q[Y],Y+=1,ae){case 35:n=g+u.shift(),a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),j=i+u.shift(),re=o+u.shift(),te=j+u.shift(),ne=re+u.shift(),oe=te+u.shift(),he=ne+u.shift(),g=oe+u.shift(),m=he+u.shift(),u.shift(),l.curveTo(n,a,i,o,j,re),l.curveTo(te,ne,oe,he,g,m);break;case 34:n=g+u.shift(),a=m,i=n+u.shift(),o=a+u.shift(),j=i+u.shift(),re=o,te=j+u.shift(),ne=o,oe=te+u.shift(),he=m,g=oe+u.shift(),l.curveTo(n,a,i,o,j,re),l.curveTo(te,ne,oe,he,g,m);break;case 36:n=g+u.shift(),a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),j=i+u.shift(),re=o,te=j+u.shift(),ne=o,oe=te+u.shift(),he=ne+u.shift(),g=oe+u.shift(),l.curveTo(n,a,i,o,j,re),l.curveTo(te,ne,oe,he,g,m);break;case 37:n=g+u.shift(),a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),j=i+u.shift(),re=o+u.shift(),te=j+u.shift(),ne=re+u.shift(),oe=te+u.shift(),he=ne+u.shift(),Math.abs(oe-g)>Math.abs(he-m)?g=oe+u.shift():m=he+u.shift(),l.curveTo(n,a,i,o,j,re),l.curveTo(te,ne,oe,he,g,m);break;default:console.log("Glyph "+r.index+": unknown operator 1200"+ae),u.length=0}break;case 14:u.length>0&&!d&&(H=u.shift()+U,d=!0),y&&(l.closePath(),y=!1);break;case 18:B();break;case 19:case 20:B(),Y+=c+7>>3;break;case 21:u.length>2&&!d&&(H=u.shift()+U,d=!0),m+=u.pop(),g+=u.pop(),R(g,m);break;case 22:u.length>1&&!d&&(H=u.shift()+U,d=!0),g+=u.pop(),R(g,m);break;case 23:B();break;case 24:for(;u.length>2;)n=g+u.shift(),a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),g=i+u.shift(),m=o+u.shift(),l.curveTo(n,a,i,o,g,m);g+=u.shift(),m+=u.shift(),l.lineTo(g,m);break;case 25:for(;u.length>6;)g+=u.shift(),m+=u.shift(),l.lineTo(g,m);n=g+u.shift(),a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),g=i+u.shift(),m=o+u.shift(),l.curveTo(n,a,i,o,g,m);break;case 26:for(u.length%2&&(g+=u.shift());u.length>0;)n=g,a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),g=i,m=o+u.shift(),l.curveTo(n,a,i,o,g,m);break;case 27:for(u.length%2&&(m+=u.shift());u.length>0;)n=g+u.shift(),a=m,i=n+u.shift(),o=a+u.shift(),g=i+u.shift(),m=o,l.curveTo(n,a,i,o,g,m);break;case 28:K=q[Y],se=q[Y+1],u.push((K<<24|se<<16)>>16),Y+=2;break;case 29:de=u.pop()+e.gsubrsBias,J=e.gsubrs[de],J&&ue(J);break;case 30:for(;u.length>0&&(n=g,a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),g=i+u.shift(),m=o+(u.length===1?u.shift():0),l.curveTo(n,a,i,o,g,m),u.length!==0);)n=g+u.shift(),a=m,i=n+u.shift(),o=a+u.shift(),m=o+u.shift(),g=i+(u.length===1?u.shift():0),l.curveTo(n,a,i,o,g,m);break;case 31:for(;u.length>0&&(n=g+u.shift(),a=m,i=n+u.shift(),o=a+u.shift(),m=o+u.shift(),g=i+(u.length===1?u.shift():0),l.curveTo(n,a,i,o,g,m),u.length!==0);)n=g,a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),g=i+u.shift(),m=o+(u.length===1?u.shift():0),l.curveTo(n,a,i,o,g,m);break;default:ae<32?console.log("Glyph "+r.index+": unknown operator "+ae):ae<247?u.push(ae-139):ae<251?(K=q[Y],Y+=1,u.push((ae-247)*256+K+108)):ae<255?(K=q[Y],Y+=1,u.push(-(ae-251)*256-K-108)):(K=q[Y],se=q[Y+1],le=q[Y+2],pe=q[Y+3],Y+=4,u.push((K<<24|se<<16|le<<8|pe)/65536))}}}return ue(t),r.advanceWidth=H,l}function Za(e,r,t,n){var a=[],i,o=new w.Parser(e,r),l=o.parseCard8();if(l===0)for(var u=0;u<t;u++){if(i=o.parseCard8(),i>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+i+" (FD count "+n+")");a.push(i)}else if(l===3){var c=o.parseCard16(),d=o.parseCard16();if(d!==0)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+d);for(var y,g=0;g<c;g++){if(i=o.parseCard8(),y=o.parseCard16(),i>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+i+" (FD count "+n+")");if(y>t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+y);for(;d<y;d++)a.push(i);d=y}if(y!==t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+y)}else throw new Error("CFF Table CID Font FDSelect table has unsupported format "+l);return a}function Qa(e,r,t){t.tables.cff={};var n=Wa(e,r),a=Oe(e,n.endOffset,w.bytesToString),i=Oe(e,a.endOffset),o=Oe(e,i.endOffset,w.bytesToString),l=Oe(e,o.endOffset);t.gsubrs=l.objects,t.gsubrsBias=zr(t.gsubrs);var u=_t(e,r,i.objects,o.objects);if(u.length!==1)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+u.length);var c=u[0];if(t.tables.cff.topDict=c,c._privateDict&&(t.defaultWidthX=c._privateDict.defaultWidthX,t.nominalWidthX=c._privateDict.nominalWidthX),c.ros[0]!==void 0&&c.ros[1]!==void 0&&(t.isCIDFont=!0),t.isCIDFont){var d=c.fdArray,y=c.fdSelect;if(d===0||y===0)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");d+=r;var g=Oe(e,d),m=_t(e,r,g.objects,o.objects);c._fdArray=m,y+=r,c._fdSelect=Za(e,y,t.numGlyphs,m.length)}var T=r+c.private[1],O=Ht(e,T,c.private[0],o.objects);if(t.defaultWidthX=O.defaultWidthX,t.nominalWidthX=O.nominalWidthX,O.subrs!==0){var F=T+O.subrs,U=Oe(e,F);t.subrs=U.objects,t.subrsBias=zr(t.subrs)}else t.subrs=[],t.subrsBias=0;var P=Oe(e,r+c.charStrings);t.nGlyphs=P.objects.length;var I=qa(e,r+c.charset,t.nGlyphs,o.objects);c.encoding===0?t.cffEncoding=new xr(Oa,I):c.encoding===1?t.cffEncoding=new xr(Ia,I):t.cffEncoding=Xa(e,r+c.encoding,I),t.encoding=t.encoding||t.cffEncoding,t.glyphs=new qe.GlyphSet(t);for(var H=0;H<t.nGlyphs;H+=1){var R=P.objects[H];t.glyphs.push(H,qe.cffGlyphLoader(t,H,Ya,R))}}function zt(e,r){var t,n=br.indexOf(e);return n>=0&&(t=n),n=r.indexOf(e),n>=0?t=n+br.length:(t=br.length+r.length,r.push(e)),t}function Ja(){return new A.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function Ka(e){var r=new A.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);r.names=[];for(var t=0;t<e.length;t+=1)r.names.push({name:"name_"+t,type:"NAME",value:e[t]});return r}function Wt(e,r,t){for(var n={},a=0;a<e.length;a+=1){var i=e[a],o=r[i.name];o!==void 0&&!Mt(o,i.value)&&(i.type==="SID"&&(o=zt(o,t)),n[i.op]={name:i.name,type:i.type,value:o})}return n}function Vt(e,r){var t=new A.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=Wt(Gt,e,r),t}function qt(e){var r=new A.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return r.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],r}function ja(e){var r=new A.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);r.strings=[];for(var t=0;t<e.length;t+=1)r.strings.push({name:"string_"+t,type:"STRING",value:e[t]});return r}function $a(){return new A.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function ei(e,r){for(var t=new A.Record("Charsets",[{name:"format",type:"Card8",value:0}]),n=0;n<e.length;n+=1){var a=e[n],i=zt(a,r);t.fields.push({name:"glyph_"+n,type:"SID",value:i})}return t}function ri(e){var r=[],t=e.path;r.push({name:"width",type:"NUMBER",value:e.advanceWidth});for(var n=0,a=0,i=0;i<t.commands.length;i+=1){var o=void 0,l=void 0,u=t.commands[i];if(u.type==="Q"){var c=.3333333333333333,d=2/3;u={type:"C",x:u.x,y:u.y,x1:c*n+d*u.x1,y1:c*a+d*u.y1,x2:c*u.x+d*u.x1,y2:c*u.y+d*u.y1}}if(u.type==="M")o=Math.round(u.x-n),l=Math.round(u.y-a),r.push({name:"dx",type:"NUMBER",value:o}),r.push({name:"dy",type:"NUMBER",value:l}),r.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(u.x),a=Math.round(u.y);else if(u.type==="L")o=Math.round(u.x-n),l=Math.round(u.y-a),r.push({name:"dx",type:"NUMBER",value:o}),r.push({name:"dy",type:"NUMBER",value:l}),r.push({name:"rlineto",type:"OP",value:5}),n=Math.round(u.x),a=Math.round(u.y);else if(u.type==="C"){var y=Math.round(u.x1-n),g=Math.round(u.y1-a),m=Math.round(u.x2-u.x1),T=Math.round(u.y2-u.y1);o=Math.round(u.x-u.x2),l=Math.round(u.y-u.y2),r.push({name:"dx1",type:"NUMBER",value:y}),r.push({name:"dy1",type:"NUMBER",value:g}),r.push({name:"dx2",type:"NUMBER",value:m}),r.push({name:"dy2",type:"NUMBER",value:T}),r.push({name:"dx",type:"NUMBER",value:o}),r.push({name:"dy",type:"NUMBER",value:l}),r.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(u.x),a=Math.round(u.y)}}return r.push({name:"endchar",type:"OP",value:14}),r}function ti(e){for(var r=new A.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),t=0;t<e.length;t+=1){var n=e.get(t),a=ri(n);r.charStrings.push({name:n.name,type:"CHARSTRING",value:a})}return r}function ni(e,r){var t=new A.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=Wt(Nt,e,r),t}function ai(e,r){for(var t=new A.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),n=1/r.unitsPerEm,a={version:r.version,fullName:r.fullName,familyName:r.familyName,weight:r.weightName,fontBBox:r.fontBBox||[0,0,0,0],fontMatrix:[n,0,0,n,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},i={},o=[],l,u=1;u<e.length;u+=1)l=e.get(u),o.push(l.name);var c=[];t.header=Ja(),t.nameIndex=Ka([r.postScriptName]);var d=Vt(a,c);t.topDictIndex=qt(d),t.globalSubrIndex=$a(),t.charsets=ei(o,c),t.charStringsIndex=ti(e),t.privateDict=ni(i,c),t.stringIndex=ja(c);var y=t.header.sizeOf()+t.nameIndex.sizeOf()+t.topDictIndex.sizeOf()+t.stringIndex.sizeOf()+t.globalSubrIndex.sizeOf();return a.charset=y,a.encoding=0,a.charStrings=a.charset+t.charsets.sizeOf(),a.private[1]=a.charStrings+t.charStringsIndex.sizeOf(),d=Vt(a,c),t.topDictIndex=qt(d),t}var Xt={parse:Qa,make:ai};function ii(e,r){var t={},n=new w.Parser(e,r);return t.version=n.parseVersion(),t.fontRevision=Math.round(n.parseFixed()*1e3)/1e3,t.checkSumAdjustment=n.parseULong(),t.magicNumber=n.parseULong(),G.argument(t.magicNumber===1594834165,"Font header has wrong magic number."),t.flags=n.parseUShort(),t.unitsPerEm=n.parseUShort(),t.created=n.parseLongDateTime(),t.modified=n.parseLongDateTime(),t.xMin=n.parseShort(),t.yMin=n.parseShort(),t.xMax=n.parseShort(),t.yMax=n.parseShort(),t.macStyle=n.parseUShort(),t.lowestRecPPEM=n.parseUShort(),t.fontDirectionHint=n.parseShort(),t.indexToLocFormat=n.parseShort(),t.glyphDataFormat=n.parseShort(),t}function si(e){var r=Math.round(new Date().getTime()/1e3)+2082844800,t=r;return e.createdTimestamp&&(t=e.createdTimestamp+2082844800),new A.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:t},{name:"modified",type:"LONGDATETIME",value:r},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],e)}var Yt={parse:ii,make:si};function oi(e,r){var t={},n=new w.Parser(e,r);return t.version=n.parseVersion(),t.ascender=n.parseShort(),t.descender=n.parseShort(),t.lineGap=n.parseShort(),t.advanceWidthMax=n.parseUShort(),t.minLeftSideBearing=n.parseShort(),t.minRightSideBearing=n.parseShort(),t.xMaxExtent=n.parseShort(),t.caretSlopeRise=n.parseShort(),t.caretSlopeRun=n.parseShort(),t.caretOffset=n.parseShort(),n.relativeOffset+=8,t.metricDataFormat=n.parseShort(),t.numberOfHMetrics=n.parseUShort(),t}function ui(e){return new A.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],e)}var Zt={parse:oi,make:ui};function li(e,r,t,n,a){for(var i,o,l=new w.Parser(e,r),u=0;u<n;u+=1){u<t&&(i=l.parseUShort(),o=l.parseShort());var c=a.get(u);c.advanceWidth=i,c.leftSideBearing=o}}function fi(e){for(var r=new A.Table("hmtx",[]),t=0;t<e.length;t+=1){var n=e.get(t),a=n.advanceWidth||0,i=n.leftSideBearing||0;r.fields.push({name:"advanceWidth_"+t,type:"USHORT",value:a}),r.fields.push({name:"leftSideBearing_"+t,type:"SHORT",value:i})}return r}var Qt={parse:li,make:fi};function pi(e){for(var r=new A.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]),t="",n=12+e.length*4,a=0;a<e.length;++a){var i=t.indexOf(e[a]);i<0&&(i=t.length,t+=e[a]),r.fields.push({name:"offset "+a,type:"USHORT",value:n+i}),r.fields.push({name:"length "+a,type:"USHORT",value:e[a].length})}return r.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),r}function hi(e,r){var t=new w.Parser(e,r),n=t.parseULong();G.argument(n===1,"Unsupported ltag table version."),t.skip("uLong",1);for(var a=t.parseULong(),i=[],o=0;o<a;o++){for(var l="",u=r+t.parseUShort(),c=t.parseUShort(),d=u;d<u+c;++d)l+=String.fromCharCode(e.getInt8(d));i.push(l)}return i}var Jt={make:pi,parse:hi};function ci(e,r){var t={},n=new w.Parser(e,r);return t.version=n.parseVersion(),t.numGlyphs=n.parseUShort(),t.version===1&&(t.maxPoints=n.parseUShort(),t.maxContours=n.parseUShort(),t.maxCompositePoints=n.parseUShort(),t.maxCompositeContours=n.parseUShort(),t.maxZones=n.parseUShort(),t.maxTwilightPoints=n.parseUShort(),t.maxStorage=n.parseUShort(),t.maxFunctionDefs=n.parseUShort(),t.maxInstructionDefs=n.parseUShort(),t.maxStackElements=n.parseUShort(),t.maxSizeOfInstructions=n.parseUShort(),t.maxComponentElements=n.parseUShort(),t.maxComponentDepth=n.parseUShort()),t}function vi(e){return new A.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])}var Kt={parse:ci,make:vi},jt=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],$t={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},di={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},en={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"};function gi(e,r,t){switch(e){case 0:if(r===65535)return"und";if(t)return t[r];break;case 1:return $t[r];case 3:return en[r]}}var Wr="utf-16",mi={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},yi={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"};function rn(e,r,t){switch(e){case 0:return Wr;case 1:return yi[t]||mi[r];case 3:if(r===1||r===10)return Wr;break}}function bi(e,r,t){for(var n={},a=new w.Parser(e,r),i=a.parseUShort(),o=a.parseUShort(),l=a.offset+a.parseUShort(),u=0;u<o;u++){var c=a.parseUShort(),d=a.parseUShort(),y=a.parseUShort(),g=a.parseUShort(),m=jt[g]||g,T=a.parseUShort(),O=a.parseUShort(),F=gi(c,y,t),U=rn(c,d,y);if(U!==void 0&&F!==void 0){var P=void 0;if(U===Wr?P=Ve.UTF16(e,l+O,T):P=Ve.MACSTRING(e,l+O,T,U),P){var I=n[m];I===void 0&&(I=n[m]={}),I[F]=P}}}var H=0;return i===1&&(H=a.parseUShort()),n}function Vr(e){var r={};for(var t in e)r[e[t]]=parseInt(t);return r}function tn(e,r,t,n,a,i){return new A.Record("NameRecord",[{name:"platformID",type:"USHORT",value:e},{name:"encodingID",type:"USHORT",value:r},{name:"languageID",type:"USHORT",value:t},{name:"nameID",type:"USHORT",value:n},{name:"length",type:"USHORT",value:a},{name:"offset",type:"USHORT",value:i}])}function xi(e,r){var t=e.length,n=r.length-t+1;e:for(var a=0;a<n;a++)for(;a<n;a++){for(var i=0;i<t;i++)if(r[a+i]!==e[i])continue e;return a}return-1}function nn(e,r){var t=xi(e,r);if(t<0){t=r.length;for(var n=0,a=e.length;n<a;++n)r.push(e[n])}return t}function Si(e,r){var t,n=[],a={},i=Vr(jt);for(var o in e){var l=i[o];if(l===void 0&&(l=o),t=parseInt(l),isNaN(t))throw new Error('Name table entry "'+o+'" does not exist, see nameTableNames for complete list.');a[t]=e[o],n.push(t)}for(var u=Vr($t),c=Vr(en),d=[],y=[],g=0;g<n.length;g++){t=n[g];var m=a[t];for(var T in m){var O=m[T],F=1,U=u[T],P=di[U],I=rn(F,P,U),H=E.MACSTRING(O,I);H===void 0&&(F=0,U=r.indexOf(T),U<0&&(U=r.length,r.push(T)),P=4,H=E.UTF16(O));var R=nn(H,y);d.push(tn(F,P,U,t,H.length,R));var B=c[T];if(B!==void 0){var ue=E.UTF16(O),q=nn(ue,y);d.push(tn(3,1,B,t,ue.length,q))}}}d.sort(function(le,pe){return le.platformID-pe.platformID||le.encodingID-pe.encodingID||le.languageID-pe.languageID||le.nameID-pe.nameID});for(var K=new A.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:d.length},{name:"stringOffset",type:"USHORT",value:6+d.length*12}]),se=0;se<d.length;se++)K.fields.push({name:"record_"+se,type:"RECORD",value:d[se]});return K.fields.push({name:"strings",type:"LITERAL",value:y}),K}var an={parse:bi,make:Si},qr=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];function Ti(e){for(var r=0;r<qr.length;r+=1){var t=qr[r];if(e>=t.begin&&e<t.end)return r}return-1}function ki(e,r){var t={},n=new w.Parser(e,r);t.version=n.parseUShort(),t.xAvgCharWidth=n.parseShort(),t.usWeightClass=n.parseUShort(),t.usWidthClass=n.parseUShort(),t.fsType=n.parseUShort(),t.ySubscriptXSize=n.parseShort(),t.ySubscriptYSize=n.parseShort(),t.ySubscriptXOffset=n.parseShort(),t.ySubscriptYOffset=n.parseShort(),t.ySuperscriptXSize=n.parseShort(),t.ySuperscriptYSize=n.parseShort(),t.ySuperscriptXOffset=n.parseShort(),t.ySuperscriptYOffset=n.parseShort(),t.yStrikeoutSize=n.parseShort(),t.yStrikeoutPosition=n.parseShort(),t.sFamilyClass=n.parseShort(),t.panose=[];for(var a=0;a<10;a++)t.panose[a]=n.parseByte();return t.ulUnicodeRange1=n.parseULong(),t.ulUnicodeRange2=n.parseULong(),t.ulUnicodeRange3=n.parseULong(),t.ulUnicodeRange4=n.parseULong(),t.achVendID=String.fromCharCode(n.parseByte(),n.parseByte(),n.parseByte(),n.parseByte()),t.fsSelection=n.parseUShort(),t.usFirstCharIndex=n.parseUShort(),t.usLastCharIndex=n.parseUShort(),t.sTypoAscender=n.parseShort(),t.sTypoDescender=n.parseShort(),t.sTypoLineGap=n.parseShort(),t.usWinAscent=n.parseUShort(),t.usWinDescent=n.parseUShort(),t.version>=1&&(t.ulCodePageRange1=n.parseULong(),t.ulCodePageRange2=n.parseULong()),t.version>=2&&(t.sxHeight=n.parseShort(),t.sCapHeight=n.parseShort(),t.usDefaultChar=n.parseUShort(),t.usBreakChar=n.parseUShort(),t.usMaxContent=n.parseUShort()),t}function Fi(e){return new A.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)}var Xr={parse:ki,make:Fi,unicodeRanges:qr,getUnicodeRange:Ti};function Li(e,r){var t={},n=new w.Parser(e,r);switch(t.version=n.parseVersion(),t.italicAngle=n.parseFixed(),t.underlinePosition=n.parseShort(),t.underlineThickness=n.parseShort(),t.isFixedPitch=n.parseULong(),t.minMemType42=n.parseULong(),t.maxMemType42=n.parseULong(),t.minMemType1=n.parseULong(),t.maxMemType1=n.parseULong(),t.version){case 1:t.names=Me.slice();break;case 2:t.numberOfGlyphs=n.parseUShort(),t.glyphNameIndex=new Array(t.numberOfGlyphs);for(var a=0;a<t.numberOfGlyphs;a++)t.glyphNameIndex[a]=n.parseUShort();t.names=[];for(var i=0;i<t.numberOfGlyphs;i++)if(t.glyphNameIndex[i]>=Me.length){var o=n.parseChar();t.names.push(n.parseString(o))}break;case 2.5:t.numberOfGlyphs=n.parseUShort(),t.offset=new Array(t.numberOfGlyphs);for(var l=0;l<t.numberOfGlyphs;l++)t.offset[l]=n.parseChar();break}return t}function Ei(){return new A.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}var sn={parse:Li,make:Ei},me=new Array(9);me[1]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(b.coverage),deltaGlyphId:this.parseUShort()};if(t===2)return{substFormat:2,coverage:this.parsePointer(b.coverage),substitute:this.parseOffset16List()};G.assert(!1,"0x"+r.toString(16)+": lookup type 1 format must be 1 or 2.")},me[2]=function(){var r=this.parseUShort();return G.argument(r===1,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:r,coverage:this.parsePointer(b.coverage),sequences:this.parseListOfLists()}},me[3]=function(){var r=this.parseUShort();return G.argument(r===1,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:r,coverage:this.parsePointer(b.coverage),alternateSets:this.parseListOfLists()}},me[4]=function(){var r=this.parseUShort();return G.argument(r===1,"GSUB ligature table identifier-format must be 1"),{substFormat:r,coverage:this.parsePointer(b.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var Xe={sequenceIndex:b.uShort,lookupListIndex:b.uShort};me[5]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:t,coverage:this.parsePointer(b.coverage),ruleSets:this.parseListOfLists(function(){var i=this.parseUShort(),o=this.parseUShort();return{input:this.parseUShortList(i-1),lookupRecords:this.parseRecordList(o,Xe)}})};if(t===2)return{substFormat:t,coverage:this.parsePointer(b.coverage),classDef:this.parsePointer(b.classDef),classSets:this.parseListOfLists(function(){var i=this.parseUShort(),o=this.parseUShort();return{classes:this.parseUShortList(i-1),lookupRecords:this.parseRecordList(o,Xe)}})};if(t===3){var n=this.parseUShort(),a=this.parseUShort();return{substFormat:t,coverages:this.parseList(n,b.pointer(b.coverage)),lookupRecords:this.parseRecordList(a,Xe)}}G.assert(!1,"0x"+r.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},me[6]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(b.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Xe)}})};if(t===2)return{substFormat:2,coverage:this.parsePointer(b.coverage),backtrackClassDef:this.parsePointer(b.classDef),inputClassDef:this.parsePointer(b.classDef),lookaheadClassDef:this.parsePointer(b.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Xe)}})};if(t===3)return{substFormat:3,backtrackCoverage:this.parseList(b.pointer(b.coverage)),inputCoverage:this.parseList(b.pointer(b.coverage)),lookaheadCoverage:this.parseList(b.pointer(b.coverage)),lookupRecords:this.parseRecordList(Xe)};G.assert(!1,"0x"+r.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},me[7]=function(){var r=this.parseUShort();G.argument(r===1,"GSUB Extension Substitution subtable identifier-format must be 1");var t=this.parseUShort(),n=new b(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:me[t].call(n)}},me[8]=function(){var r=this.parseUShort();return G.argument(r===1,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:r,coverage:this.parsePointer(b.coverage),backtrackCoverage:this.parseList(b.pointer(b.coverage)),lookaheadCoverage:this.parseList(b.pointer(b.coverage)),substitutes:this.parseUShortList()}};function Ui(e,r){r=r||0;var t=new b(e,r),n=t.parseVersion(1);return G.argument(n===1||n===1.1,"Unsupported GSUB table version."),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(me)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(me),variations:t.parseFeatureVariationsList()}}var Tr=new Array(9);Tr[1]=function(r){return r.substFormat===1?new A.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new A.Coverage(r.coverage)},{name:"deltaGlyphID",type:"USHORT",value:r.deltaGlyphId}]):new A.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new A.Coverage(r.coverage)}].concat(A.ushortList("substitute",r.substitute)))},Tr[3]=function(r){return G.assert(r.substFormat===1,"Lookup type 3 substFormat must be 1."),new A.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new A.Coverage(r.coverage)}].concat(A.tableList("altSet",r.alternateSets,function(t){return new A.Table("alternateSetTable",A.ushortList("alternate",t))})))},Tr[4]=function(r){return G.assert(r.substFormat===1,"Lookup type 4 substFormat must be 1."),new A.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new A.Coverage(r.coverage)}].concat(A.tableList("ligSet",r.ligatureSets,function(t){return new A.Table("ligatureSetTable",A.tableList("ligature",t,function(n){return new A.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:n.ligGlyph}].concat(A.ushortList("component",n.components,n.components.length+1)))}))})))};function Oi(e){return new A.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new A.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new A.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new A.LookupList(e.lookups,Tr)}])}var on={parse:Ui,make:Oi};function Ii(e,r){var t=new w.Parser(e,r),n=t.parseULong();G.argument(n===1,"Unsupported META table version."),t.parseULong(),t.parseULong();for(var a=t.parseULong(),i={},o=0;o<a;o++){var l=t.parseTag(),u=t.parseULong(),c=t.parseULong(),d=Ve.UTF8(e,r+u,c);i[l]=d}return i}function Ci(e){var r=Object.keys(e).length,t="",n=16+r*12,a=new A.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:n},{name:"numTags",type:"ULONG",value:r}]);for(var i in e){var o=t.length;t+=e[i],a.fields.push({name:"tag "+i,type:"TAG",value:i}),a.fields.push({name:"offset "+i,type:"ULONG",value:n+o}),a.fields.push({name:"length "+i,type:"ULONG",value:e[i].length})}return a.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),a}var un={parse:Ii,make:Ci};function ln(e){return Math.log(e)/Math.log(2)|0}function Yr(e){for(;e.length%4!==0;)e.push(0);for(var r=0,t=0;t<e.length;t+=4)r+=(e[t]<<24)+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];return r%=Math.pow(2,32),r}function fn(e,r,t,n){return new A.Record("Table Record",[{name:"tag",type:"TAG",value:e!==void 0?e:""},{name:"checkSum",type:"ULONG",value:r!==void 0?r:0},{name:"offset",type:"ULONG",value:t!==void 0?t:0},{name:"length",type:"ULONG",value:n!==void 0?n:0}])}function pn(e){var r=new A.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);r.tables=e,r.numTables=e.length;var t=Math.pow(2,ln(r.numTables));r.searchRange=16*t,r.entrySelector=ln(t),r.rangeShift=r.numTables*16-r.searchRange;for(var n=[],a=[],i=r.sizeOf()+fn().sizeOf()*r.numTables;i%4!==0;)i+=1,a.push({name:"padding",type:"BYTE",value:0});for(var o=0;o<e.length;o+=1){var l=e[o];G.argument(l.tableName.length===4,"Table name"+l.tableName+" is invalid.");var u=l.sizeOf(),c=fn(l.tableName,Yr(l.encode()),i,u);for(n.push({name:c.tag+" Table Record",type:"RECORD",value:c}),a.push({name:l.tableName+" table",type:"RECORD",value:l}),i+=u,G.argument(!isNaN(i),"Something went wrong calculating the offset.");i%4!==0;)i+=1,a.push({name:"padding",type:"BYTE",value:0})}return n.sort(function(d,y){return d.value.tag>y.value.tag?1:-1}),r.fields=r.fields.concat(n),r.fields=r.fields.concat(a),r}function hn(e,r,t){for(var n=0;n<r.length;n+=1){var a=e.charToGlyphIndex(r[n]);if(a>0){var i=e.glyphs.get(a);return i.getMetrics()}}return t}function wi(e){for(var r=0,t=0;t<e.length;t+=1)r+=e[t];return r/e.length}function Ri(e){for(var r=[],t=[],n=[],a=[],i=[],o=[],l=[],u,c=0,d=0,y=0,g=0,m=0,T=0;T<e.glyphs.length;T+=1){var O=e.glyphs.get(T),F=O.unicode|0;if(isNaN(O.advanceWidth))throw new Error("Glyph "+O.name+" ("+T+"): advanceWidth is not a number.");(u>F||u===void 0)&&F>0&&(u=F),c<F&&(c=F);var U=Xr.getUnicodeRange(F);if(U<32)d|=1<<U;else if(U<64)y|=1<<U-32;else if(U<96)g|=1<<U-64;else if(U<123)m|=1<<U-96;else throw new Error("Unicode ranges bits > 123 are reserved for internal usage");if(O.name!==".notdef"){var P=O.getMetrics();r.push(P.xMin),t.push(P.yMin),n.push(P.xMax),a.push(P.yMax),o.push(P.leftSideBearing),l.push(P.rightSideBearing),i.push(O.advanceWidth)}}var I={xMin:Math.min.apply(null,r),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,n),yMax:Math.max.apply(null,a),advanceWidthMax:Math.max.apply(null,i),advanceWidthAvg:wi(i),minLeftSideBearing:Math.min.apply(null,o),maxLeftSideBearing:Math.max.apply(null,o),minRightSideBearing:Math.min.apply(null,l)};I.ascender=e.ascender,I.descender=e.descender;var H=Yt.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:I.xMin,yMin:I.yMin,xMax:I.xMax,yMax:I.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp}),R=Zt.make({ascender:I.ascender,descender:I.descender,advanceWidthMax:I.advanceWidthMax,minLeftSideBearing:I.minLeftSideBearing,minRightSideBearing:I.minRightSideBearing,xMaxExtent:I.maxLeftSideBearing+(I.xMax-I.xMin),numberOfHMetrics:e.glyphs.length}),B=Kt.make(e.glyphs.length),ue=Xr.make({xAvgCharWidth:Math.round(I.advanceWidthAvg),usWeightClass:e.tables.os2.usWeightClass,usWidthClass:e.tables.os2.usWidthClass,usFirstCharIndex:u,usLastCharIndex:c,ulUnicodeRange1:d,ulUnicodeRange2:y,ulUnicodeRange3:g,ulUnicodeRange4:m,fsSelection:e.tables.os2.fsSelection,sTypoAscender:I.ascender,sTypoDescender:I.descender,sTypoLineGap:0,usWinAscent:I.yMax,usWinDescent:Math.abs(I.yMin),ulCodePageRange1:1,sxHeight:hn(e,"xyvw",{yMax:Math.round(I.ascender/2)}).yMax,sCapHeight:hn(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",I).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0}),q=Qt.make(e.glyphs),K=It.make(e.glyphs),se=e.getEnglishName("fontFamily"),le=e.getEnglishName("fontSubfamily"),pe=se+" "+le,de=e.getEnglishName("postScriptName");de||(de=se.replace(/\s/g,"")+"-"+le);var J={};for(var j in e.names)J[j]=e.names[j];J.uniqueID||(J.uniqueID={en:e.getEnglishName("manufacturer")+":"+pe}),J.postScriptName||(J.postScriptName={en:de}),J.preferredFamily||(J.preferredFamily=e.names.fontFamily),J.preferredSubfamily||(J.preferredSubfamily=e.names.fontSubfamily);var re=[],te=an.make(J,re),ne=re.length>0?Jt.make(re):void 0,oe=sn.make(),he=Xt.make(e.glyphs,{version:e.getEnglishName("version"),fullName:pe,familyName:se,weightName:le,postScriptName:de,unitsPerEm:e.unitsPerEm,fontBBox:[0,I.yMin,I.ascender,I.advanceWidthMax]}),Y=e.metas&&Object.keys(e.metas).length>0?un.make(e.metas):void 0,ae=[H,R,B,ue,te,K,oe,he,q];ne&&ae.push(ne),e.tables.gsub&&ae.push(on.make(e.tables.gsub)),Y&&ae.push(Y);for(var et=pn(ae),Mo=et.encode(),Bo=Yr(Mo),rt=et.fields,Hn=!1,Er=0;Er<rt.length;Er+=1)if(rt[Er].name==="head table"){rt[Er].value.checkSumAdjustment=2981146554-Bo,Hn=!0;break}if(!Hn)throw new Error("Could not find head table with checkSum to adjust.");return et}var Di={make:pn,fontToTable:Ri,computeCheckSum:Yr};function Zr(e,r){for(var t=0,n=e.length-1;t<=n;){var a=t+n>>>1,i=e[a].tag;if(i===r)return a;i<r?t=a+1:n=a-1}return-t-1}function cn(e,r){for(var t=0,n=e.length-1;t<=n;){var a=t+n>>>1,i=e[a];if(i===r)return a;i<r?t=a+1:n=a-1}return-t-1}function vn(e,r){for(var t,n=0,a=e.length-1;n<=a;){var i=n+a>>>1;t=e[i];var o=t.start;if(o===r)return t;o<r?n=i+1:a=i-1}if(n>0)return t=e[n-1],r>t.end?0:t}function er(e,r){this.font=e,this.tableName=r}er.prototype={searchTag:Zr,binSearch:cn,getTable:function(e){var r=this.font.tables[this.tableName];return!r&&e&&(r=this.font.tables[this.tableName]=this.createDefaultTable()),r},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(r){return r.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var r=!1,t=0;t<e.scripts.length;t++){var n=e.scripts[t].tag;if(n==="DFLT")return n;n==="latn"&&(r=!0)}if(r)return"latn"}},getScriptTable:function(e,r){var t=this.getTable(r);if(t){e=e||"DFLT";var n=t.scripts,a=Zr(t.scripts,e);if(a>=0)return n[a].script;if(r){var i={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return n.splice(-1-a,0,i),i.script}}},getLangSysTable:function(e,r,t){var n=this.getScriptTable(e,t);if(n){if(!r||r==="dflt"||r==="DFLT")return n.defaultLangSys;var a=Zr(n.langSysRecords,r);if(a>=0)return n.langSysRecords[a].langSys;if(t){var i={tag:r,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return n.langSysRecords.splice(-1-a,0,i),i.langSys}}},getFeatureTable:function(e,r,t,n){var a=this.getLangSysTable(e,r,n);if(a){for(var i,o=a.featureIndexes,l=this.font.tables[this.tableName].features,u=0;u<o.length;u++)if(i=l[o[u]],i.tag===t)return i.feature;if(n){var c=l.length;return G.assert(c===0||t>=l[c-1].tag,"Features must be added in alphabetical order."),i={tag:t,feature:{params:0,lookupListIndexes:[]}},l.push(i),o.push(c),i.feature}}},getLookupTables:function(e,r,t,n,a){var i=this.getFeatureTable(e,r,t,a),o=[];if(i){for(var l,u=i.lookupListIndexes,c=this.font.tables[this.tableName].lookups,d=0;d<u.length;d++)l=c[u[d]],l.lookupType===n&&o.push(l);if(o.length===0&&a){l={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0};var y=c.length;return c.push(l),u.push(y),[l]}}return o},getGlyphClass:function(e,r){switch(e.format){case 1:return e.startGlyph<=r&&r<e.startGlyph+e.classes.length?e.classes[r-e.startGlyph]:0;case 2:var t=vn(e.ranges,r);return t?t.classId:0}},getCoverageIndex:function(e,r){switch(e.format){case 1:var t=cn(e.glyphs,r);return t>=0?t:-1;case 2:var n=vn(e.ranges,r);return n?n.index+r-n.start:-1}},expandCoverage:function(e){if(e.format===1)return e.glyphs;for(var r=[],t=e.ranges,n=0;n<t.length;n++)for(var a=t[n],i=a.start,o=a.end,l=i;l<=o;l++)r.push(l);return r}};function kr(e){er.call(this,e,"gpos")}kr.prototype=er.prototype,kr.prototype.getKerningValue=function(e,r,t){for(var n=this,a=0;a<e.length;a++)for(var i=e[a].subtables,o=0;o<i.length;o++){var l=i[o],u=n.getCoverageIndex(l.coverage,r);if(!(u<0))switch(l.posFormat){case 1:for(var c=l.pairSets[u],d=0;d<c.length;d++){var y=c[d];if(y.secondGlyph===t)return y.value1&&y.value1.xAdvance||0}break;case 2:var g=n.getGlyphClass(l.classDef1,r),m=n.getGlyphClass(l.classDef2,t),T=l.classRecords[g][m];return T.value1&&T.value1.xAdvance||0}}return 0},kr.prototype.getKerningTables=function(e,r){if(this.font.tables.gpos)return this.getLookupTables(e,r,"kern",2)};function ye(e){er.call(this,e,"gsub")}function Ai(e,r){var t=e.length;if(t!==r.length)return!1;for(var n=0;n<t;n++)if(e[n]!==r[n])return!1;return!0}function dn(e,r,t){for(var n=e.subtables,a=0;a<n.length;a++){var i=n[a];if(i.substFormat===r)return i}if(t)return n.push(t),t}ye.prototype=er.prototype,ye.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},ye.prototype.getSingle=function(e,r,t){for(var n=this,a=[],i=this.getLookupTables(r,t,e,1),o=0;o<i.length;o++)for(var l=i[o].subtables,u=0;u<l.length;u++){var c=l[u],d=n.expandCoverage(c.coverage),y=void 0;if(c.substFormat===1){var g=c.deltaGlyphId;for(y=0;y<d.length;y++){var m=d[y];a.push({sub:m,by:m+g})}}else{var T=c.substitute;for(y=0;y<d.length;y++)a.push({sub:d[y],by:T[y]})}}return a},ye.prototype.getAlternates=function(e,r,t){for(var n=this,a=[],i=this.getLookupTables(r,t,e,3),o=0;o<i.length;o++)for(var l=i[o].subtables,u=0;u<l.length;u++)for(var c=l[u],d=n.expandCoverage(c.coverage),y=c.alternateSets,g=0;g<d.length;g++)a.push({sub:d[g],by:y[g]});return a},ye.prototype.getLigatures=function(e,r,t){for(var n=this,a=[],i=this.getLookupTables(r,t,e,4),o=0;o<i.length;o++)for(var l=i[o].subtables,u=0;u<l.length;u++)for(var c=l[u],d=n.expandCoverage(c.coverage),y=c.ligatureSets,g=0;g<d.length;g++)for(var m=d[g],T=y[g],O=0;O<T.length;O++){var F=T[O];a.push({sub:[m].concat(F.components),by:F.ligGlyph})}return a},ye.prototype.addSingle=function(e,r,t,n){var a=this.getLookupTables(t,n,e,1,!0)[0],i=dn(a,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});G.assert(i.coverage.format===1,"Ligature: unable to modify coverage table format "+i.coverage.format);var o=r.sub,l=this.binSearch(i.coverage.glyphs,o);l<0&&(l=-1-l,i.coverage.glyphs.splice(l,0,o),i.substitute.splice(l,0,0)),i.substitute[l]=r.by},ye.prototype.addAlternate=function(e,r,t,n){var a=this.getLookupTables(t,n,e,3,!0)[0],i=dn(a,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});G.assert(i.coverage.format===1,"Ligature: unable to modify coverage table format "+i.coverage.format);var o=r.sub,l=this.binSearch(i.coverage.glyphs,o);l<0&&(l=-1-l,i.coverage.glyphs.splice(l,0,o),i.alternateSets.splice(l,0,0)),i.alternateSets[l]=r.by},ye.prototype.addLigature=function(e,r,t,n){var a=this.getLookupTables(t,n,e,4,!0)[0],i=a.subtables[0];i||(i={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},a.subtables[0]=i),G.assert(i.coverage.format===1,"Ligature: unable to modify coverage table format "+i.coverage.format);var o=r.sub[0],l=r.sub.slice(1),u={ligGlyph:r.by,components:l},c=this.binSearch(i.coverage.glyphs,o);if(c>=0){for(var d=i.ligatureSets[c],y=0;y<d.length;y++)if(Ai(d[y].components,l))return;d.push(u)}else c=-1-c,i.coverage.glyphs.splice(c,0,o),i.ligatureSets.splice(c,0,[u])},ye.prototype.getFeature=function(e,r,t){if(/ss\d\d/.test(e))return this.getSingle(e,r,t);switch(e){case"aalt":case"salt":return this.getSingle(e,r,t).concat(this.getAlternates(e,r,t));case"dlig":case"liga":case"rlig":return this.getLigatures(e,r,t)}},ye.prototype.add=function(e,r,t,n){if(/ss\d\d/.test(e))return this.addSingle(e,r,t,n);switch(e){case"aalt":case"salt":return typeof r.by=="number"?this.addSingle(e,r,t,n):this.addAlternate(e,r,t,n);case"dlig":case"liga":case"rlig":return this.addLigature(e,r,t,n)}};function Mi(){return typeof window<"u"}function gn(e){for(var r=new ArrayBuffer(e.length),t=new Uint8Array(r),n=0;n<e.length;++n)t[n]=e[n];return r}function Bi(e){for(var r=new Buffer(e.byteLength),t=new Uint8Array(e),n=0;n<r.length;++n)r[n]=t[n];return r}function Ye(e,r){if(!e)throw r}var mn,Pe,yn,Qr;function bn(e){this.font=e,this._fpgmState=this._prepState=void 0,this._errorState=0}function Pi(e){return e}function xn(e){return Math.sign(e)*Math.round(Math.abs(e))}function Gi(e){return Math.sign(e)*Math.round(Math.abs(e*2))/2}function Ni(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function Hi(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function _i(e){return Math.sign(e)*Math.floor(Math.abs(e))}var Sn=function(e){var r=this.srPeriod,t=this.srPhase,n=this.srThreshold,a=1;return e<0&&(e=-e,a=-1),e+=n-t,e=Math.trunc(e/r)*r,e+=t,e<0?t*a:e*a},Te={x:1,y:0,axis:"x",distance:function(e,r,t,n){return(t?e.xo:e.x)-(n?r.xo:r.x)},interpolate:function(e,r,t,n){var a,i,o,l,u,c,d;if(!n||n===this){if(a=e.xo-r.xo,i=e.xo-t.xo,u=r.x-r.xo,c=t.x-t.xo,o=Math.abs(a),l=Math.abs(i),d=o+l,d===0){e.x=e.xo+(u+c)/2;return}e.x=e.xo+(u*l+c*o)/d;return}if(a=n.distance(e,r,!0,!0),i=n.distance(e,t,!0,!0),u=n.distance(r,r,!1,!0),c=n.distance(t,t,!1,!0),o=Math.abs(a),l=Math.abs(i),d=o+l,d===0){Te.setRelative(e,e,(u+c)/2,n,!0);return}Te.setRelative(e,e,(u*l+c*o)/d,n,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,r,t,n,a){if(!n||n===this){e.x=(a?r.xo:r.x)+t;return}var i=a?r.xo:r.x,o=a?r.yo:r.y,l=i+t*n.x,u=o+t*n.y;e.x=l+(e.y-u)/n.normalSlope},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},Fe={x:0,y:1,axis:"y",distance:function(e,r,t,n){return(t?e.yo:e.y)-(n?r.yo:r.y)},interpolate:function(e,r,t,n){var a,i,o,l,u,c,d;if(!n||n===this){if(a=e.yo-r.yo,i=e.yo-t.yo,u=r.y-r.yo,c=t.y-t.yo,o=Math.abs(a),l=Math.abs(i),d=o+l,d===0){e.y=e.yo+(u+c)/2;return}e.y=e.yo+(u*l+c*o)/d;return}if(a=n.distance(e,r,!0,!0),i=n.distance(e,t,!0,!0),u=n.distance(r,r,!1,!0),c=n.distance(t,t,!1,!0),o=Math.abs(a),l=Math.abs(i),d=o+l,d===0){Fe.setRelative(e,e,(u+c)/2,n,!0);return}Fe.setRelative(e,e,(u*l+c*o)/d,n,!0)},normalSlope:0,setRelative:function(e,r,t,n,a){if(!n||n===this){e.y=(a?r.yo:r.y)+t;return}var i=a?r.xo:r.x,o=a?r.yo:r.y,l=i+t*n.x,u=o+t*n.y;e.y=u+n.normalSlope*(e.x-l)},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};Object.freeze(Te),Object.freeze(Fe);function rr(e,r){this.x=e,this.y=r,this.axis=void 0,this.slope=r/e,this.normalSlope=-e/r,Object.freeze(this)}rr.prototype.distance=function(e,r,t,n){return this.x*Te.distance(e,r,t,n)+this.y*Fe.distance(e,r,t,n)},rr.prototype.interpolate=function(e,r,t,n){var a,i,o,l,u,c,d;if(o=n.distance(e,r,!0,!0),l=n.distance(e,t,!0,!0),a=n.distance(r,r,!1,!0),i=n.distance(t,t,!1,!0),u=Math.abs(o),c=Math.abs(l),d=u+c,d===0){this.setRelative(e,e,(a+i)/2,n,!0);return}this.setRelative(e,e,(a*c+i*u)/d,n,!0)},rr.prototype.setRelative=function(e,r,t,n,a){n=n||this;var i=a?r.xo:r.x,o=a?r.yo:r.y,l=i+t*n.x,u=o+t*n.y,c=n.normalSlope,d=this.slope,y=e.x,g=e.y;e.x=(d*y-c*l+u-g)/(d-c),e.y=d*(e.x-y)+g},rr.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0};function tr(e,r){var t=Math.sqrt(e*e+r*r);return e/=t,r/=t,e===1&&r===0?Te:e===0&&r===1?Fe:new rr(e,r)}function Le(e,r,t,n){this.x=this.xo=Math.round(e*64)/64,this.y=this.yo=Math.round(r*64)/64,this.lastPointOfContour=t,this.onCurve=n,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Le.prototype.nextTouched=function(e){for(var r=this.nextPointOnContour;!e.touched(r)&&r!==this;)r=r.nextPointOnContour;return r},Le.prototype.prevTouched=function(e){for(var r=this.prevPointOnContour;!e.touched(r)&&r!==this;)r=r.prevPointOnContour;return r};var nr=Object.freeze(new Le(0,0)),zi={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function Ie(e,r){switch(this.env=e,this.stack=[],this.prog=r,e){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=Te,this.round=xn}}bn.prototype.exec=function(e,r){if(typeof r!="number")throw new Error("Point size is not a number!");if(!(this._errorState>2)){var t=this.font,n=this._prepState;if(!n||n.ppem!==r){var a=this._fpgmState;if(!a){Ie.prototype=zi,a=this._fpgmState=new Ie("fpgm",t.tables.fpgm),a.funcs=[],a.font=t,s.DEBUG&&(console.log("---EXEC FPGM---"),a.step=-1);try{Pe(a)}catch(c){console.log("Hinting error in FPGM:"+c),this._errorState=3;return}}Ie.prototype=a,n=this._prepState=new Ie("prep",t.tables.prep),n.ppem=r;var i=t.tables.cvt;if(i)for(var o=n.cvt=new Array(i.length),l=r/t.unitsPerEm,u=0;u<i.length;u++)o[u]=i[u]*l;else n.cvt=[];s.DEBUG&&(console.log("---EXEC PREP---"),n.step=-1);try{Pe(n)}catch(c){this._errorState<2&&console.log("Hinting error in PREP:"+c),this._errorState=2}}if(!(this._errorState>1))try{return yn(e,n)}catch(c){this._errorState<1&&(console.log("Hinting error:"+c),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}}},yn=function(e,r){var t=r.ppem/r.font.unitsPerEm,n=t,a=e.components,i,o,l;if(Ie.prototype=r,!a)l=new Ie("glyf",e.instructions),s.DEBUG&&(console.log("---EXEC GLYPH---"),l.step=-1),Qr(e,l,t,n),o=l.gZone;else{var u=r.font;o=[],i=[];for(var c=0;c<a.length;c++){var d=a[c],y=u.glyphs.get(d.glyphIndex);l=new Ie("glyf",y.instructions),s.DEBUG&&(console.log("---EXEC COMP "+c+"---"),l.step=-1),Qr(y,l,t,n);for(var g=Math.round(d.dx*t),m=Math.round(d.dy*n),T=l.gZone,O=l.contours,F=0;F<T.length;F++){var U=T[F];U.xTouched=U.yTouched=!1,U.xo=U.x=U.x+g,U.yo=U.y=U.y+m}var P=o.length;o.push.apply(o,T);for(var I=0;I<O.length;I++)i.push(O[I]+P)}e.instructions&&!l.inhibitGridFit&&(l=new Ie("glyf",e.instructions),l.gZone=l.z0=l.z1=l.z2=o,l.contours=i,o.push(new Le(0,0),new Le(Math.round(e.advanceWidth*t),0)),s.DEBUG&&(console.log("---EXEC COMPOSITE---"),l.step=-1),Pe(l),o.length-=2)}return o},Qr=function(e,r,t,n){for(var a=e.points||[],i=a.length,o=r.gZone=r.z0=r.z1=r.z2=[],l=r.contours=[],u,c=0;c<i;c++)u=a[c],o[c]=new Le(u.x*t,u.y*n,u.lastPointOfContour,u.onCurve);for(var d,y,g=0;g<i;g++)u=o[g],d||(d=u,l.push(g)),u.lastPointOfContour?(u.nextPointOnContour=d,d.prevPointOnContour=u,d=void 0):(y=o[g+1],u.nextPointOnContour=y,y.prevPointOnContour=u);if(!r.inhibitGridFit){if(s.DEBUG){console.log("PROCESSING GLYPH",r.stack);for(var m=0;m<i;m++)console.log(m,o[m].x,o[m].y)}if(o.push(new Le(0,0),new Le(Math.round(e.advanceWidth*t),0)),Pe(r),o.length-=2,s.DEBUG){console.log("FINISHED GLYPH",r.stack);for(var T=0;T<i;T++)console.log(T,o[T].x,o[T].y)}}},Pe=function(e){var r=e.prog;if(r){var t=r.length,n;for(e.ip=0;e.ip<t;e.ip++){if(s.DEBUG&&e.step++,n=mn[r[e.ip]],!n)throw new Error("unknown instruction: 0x"+Number(r[e.ip]).toString(16));n(e)}}};function Fr(e){for(var r=e.tZone=new Array(e.gZone.length),t=0;t<r.length;t++)r[t]=new Le(0,0)}function Tn(e,r){var t=e.prog,n=e.ip,a=1,i;do if(i=t[++n],i===88)a++;else if(i===89)a--;else if(i===64)n+=t[n+1]+1;else if(i===65)n+=2*t[n+1]+1;else if(i>=176&&i<=183)n+=i-176+1;else if(i>=184&&i<=191)n+=(i-184+1)*2;else if(r&&a===1&&i===27)break;while(a>0);e.ip=n}function kn(e,r){s.DEBUG&&console.log(r.step,"SVTCA["+e.axis+"]"),r.fv=r.pv=r.dpv=e}function Fn(e,r){s.DEBUG&&console.log(r.step,"SPVTCA["+e.axis+"]"),r.pv=r.dpv=e}function Ln(e,r){s.DEBUG&&console.log(r.step,"SFVTCA["+e.axis+"]"),r.fv=e}function En(e,r){var t=r.stack,n=t.pop(),a=t.pop(),i=r.z2[n],o=r.z1[a];s.DEBUG&&console.log("SPVTL["+e+"]",n,a);var l,u;e?(l=i.y-o.y,u=o.x-i.x):(l=o.x-i.x,u=o.y-i.y),r.pv=r.dpv=tr(l,u)}function Un(e,r){var t=r.stack,n=t.pop(),a=t.pop(),i=r.z2[n],o=r.z1[a];s.DEBUG&&console.log("SFVTL["+e+"]",n,a);var l,u;e?(l=i.y-o.y,u=o.x-i.x):(l=o.x-i.x,u=o.y-i.y),r.fv=tr(l,u)}function Wi(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"SPVFS[]",t,n),e.pv=e.dpv=tr(n,t)}function Vi(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"SPVFS[]",t,n),e.fv=tr(n,t)}function qi(e){var r=e.stack,t=e.pv;s.DEBUG&&console.log(e.step,"GPV[]"),r.push(t.x*16384),r.push(t.y*16384)}function Xi(e){var r=e.stack,t=e.fv;s.DEBUG&&console.log(e.step,"GFV[]"),r.push(t.x*16384),r.push(t.y*16384)}function Yi(e){e.fv=e.pv,s.DEBUG&&console.log(e.step,"SFVTPV[]")}function Zi(e){var r=e.stack,t=r.pop(),n=r.pop(),a=r.pop(),i=r.pop(),o=r.pop(),l=e.z0,u=e.z1,c=l[t],d=l[n],y=u[a],g=u[i],m=e.z2[o];s.DEBUG&&console.log("ISECT[], ",t,n,a,i,o);var T=c.x,O=c.y,F=d.x,U=d.y,P=y.x,I=y.y,H=g.x,R=g.y,B=(T-F)*(I-R)-(O-U)*(P-H),ue=T*U-O*F,q=P*R-I*H;m.x=(ue*(P-H)-q*(T-F))/B,m.y=(ue*(I-R)-q*(O-U))/B}function Qi(e){e.rp0=e.stack.pop(),s.DEBUG&&console.log(e.step,"SRP0[]",e.rp0)}function Ji(e){e.rp1=e.stack.pop(),s.DEBUG&&console.log(e.step,"SRP1[]",e.rp1)}function Ki(e){e.rp2=e.stack.pop(),s.DEBUG&&console.log(e.step,"SRP2[]",e.rp2)}function ji(e){var r=e.stack.pop();switch(s.DEBUG&&console.log(e.step,"SZP0[]",r),e.zp0=r,r){case 0:e.tZone||Fr(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function $i(e){var r=e.stack.pop();switch(s.DEBUG&&console.log(e.step,"SZP1[]",r),e.zp1=r,r){case 0:e.tZone||Fr(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function es(e){var r=e.stack.pop();switch(s.DEBUG&&console.log(e.step,"SZP2[]",r),e.zp2=r,r){case 0:e.tZone||Fr(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function rs(e){var r=e.stack.pop();switch(s.DEBUG&&console.log(e.step,"SZPS[]",r),e.zp0=e.zp1=e.zp2=r,r){case 0:e.tZone||Fr(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function ts(e){e.loop=e.stack.pop(),s.DEBUG&&console.log(e.step,"SLOOP[]",e.loop)}function ns(e){s.DEBUG&&console.log(e.step,"RTG[]"),e.round=xn}function as(e){s.DEBUG&&console.log(e.step,"RTHG[]"),e.round=Ni}function is(e){var r=e.stack.pop();s.DEBUG&&console.log(e.step,"SMD[]",r),e.minDis=r/64}function ss(e){s.DEBUG&&console.log(e.step,"ELSE[]"),Tn(e,!1)}function os(e){var r=e.stack.pop();s.DEBUG&&console.log(e.step,"JMPR[]",r),e.ip+=r-1}function us(e){var r=e.stack.pop();s.DEBUG&&console.log(e.step,"SCVTCI[]",r),e.cvCutIn=r/64}function ls(e){var r=e.stack;s.DEBUG&&console.log(e.step,"DUP[]"),r.push(r[r.length-1])}function Jr(e){s.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function fs(e){s.DEBUG&&console.log(e.step,"CLEAR[]"),e.stack.length=0}function ps(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"SWAP[]"),r.push(t),r.push(n)}function hs(e){var r=e.stack;s.DEBUG&&console.log(e.step,"DEPTH[]"),r.push(r.length)}function cs(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"LOOPCALL[]",t,n);var a=e.ip,i=e.prog;e.prog=e.funcs[t];for(var o=0;o<n;o++)Pe(e),s.DEBUG&&console.log(++e.step,o+1<n?"next loopcall":"done loopcall",o);e.ip=a,e.prog=i}function vs(e){var r=e.stack.pop();s.DEBUG&&console.log(e.step,"CALL[]",r);var t=e.ip,n=e.prog;e.prog=e.funcs[r],Pe(e),e.ip=t,e.prog=n,s.DEBUG&&console.log(++e.step,"returning from",r)}function ds(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"CINDEX[]",t),r.push(r[r.length-t])}function gs(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"MINDEX[]",t),r.push(r.splice(r.length-t,1)[0])}function ms(e){if(e.env!=="fpgm")throw new Error("FDEF not allowed here");var r=e.stack,t=e.prog,n=e.ip,a=r.pop(),i=n;for(s.DEBUG&&console.log(e.step,"FDEF[]",a);t[++n]!==45;);e.ip=n,e.funcs[a]=t.slice(i+1,n)}function On(e,r){var t=r.stack.pop(),n=r.z0[t],a=r.fv,i=r.pv;s.DEBUG&&console.log(r.step,"MDAP["+e+"]",t);var o=i.distance(n,nr);e&&(o=r.round(o)),a.setRelative(n,nr,o,i),a.touch(n),r.rp0=r.rp1=t}function In(e,r){var t=r.z2,n=t.length-2,a,i,o;s.DEBUG&&console.log(r.step,"IUP["+e.axis+"]");for(var l=0;l<n;l++)a=t[l],!e.touched(a)&&(i=a.prevTouched(e),i!==a&&(o=a.nextTouched(e),i===o&&e.setRelative(a,a,e.distance(i,i,!1,!0),e,!0),e.interpolate(a,i,o,e)))}function Cn(e,r){for(var t=r.stack,n=e?r.rp1:r.rp2,a=(e?r.z0:r.z1)[n],i=r.fv,o=r.pv,l=r.loop,u=r.z2;l--;){var c=t.pop(),d=u[c],y=o.distance(a,a,!1,!0);i.setRelative(d,d,y,o),i.touch(d),s.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-l)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",c)}r.loop=1}function wn(e,r){var t=r.stack,n=e?r.rp1:r.rp2,a=(e?r.z0:r.z1)[n],i=r.fv,o=r.pv,l=t.pop(),u=r.z2[r.contours[l]],c=u;s.DEBUG&&console.log(r.step,"SHC["+e+"]",l);var d=o.distance(a,a,!1,!0);do c!==a&&i.setRelative(c,c,d,o),c=c.nextPointOnContour;while(c!==u)}function Rn(e,r){var t=r.stack,n=e?r.rp1:r.rp2,a=(e?r.z0:r.z1)[n],i=r.fv,o=r.pv,l=t.pop();s.DEBUG&&console.log(r.step,"SHZ["+e+"]",l);var u;switch(l){case 0:u=r.tZone;break;case 1:u=r.gZone;break;default:throw new Error("Invalid zone")}for(var c,d=o.distance(a,a,!1,!0),y=u.length-2,g=0;g<y;g++)c=u[g],i.setRelative(c,c,d,o)}function ys(e){for(var r=e.stack,t=e.loop,n=e.fv,a=r.pop()/64,i=e.z2;t--;){var o=r.pop(),l=i[o];s.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-t)+": ":"")+"SHPIX[]",o,a),n.setRelative(l,l,a),n.touch(l)}e.loop=1}function bs(e){for(var r=e.stack,t=e.rp1,n=e.rp2,a=e.loop,i=e.z0[t],o=e.z1[n],l=e.fv,u=e.dpv,c=e.z2;a--;){var d=r.pop(),y=c[d];s.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-a)+": ":"")+"IP[]",d,t,"<->",n),l.interpolate(y,i,o,u),l.touch(y)}e.loop=1}function Dn(e,r){var t=r.stack,n=t.pop()/64,a=t.pop(),i=r.z1[a],o=r.z0[r.rp0],l=r.fv,u=r.pv;l.setRelative(i,o,n,u),l.touch(i),s.DEBUG&&console.log(r.step,"MSIRP["+e+"]",n,a),r.rp1=r.rp0,r.rp2=a,e&&(r.rp0=a)}function xs(e){for(var r=e.stack,t=e.rp0,n=e.z0[t],a=e.loop,i=e.fv,o=e.pv,l=e.z1;a--;){var u=r.pop(),c=l[u];s.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-a)+": ":"")+"ALIGNRP[]",u),i.setRelative(c,n,0,o),i.touch(c)}e.loop=1}function Ss(e){s.DEBUG&&console.log(e.step,"RTDG[]"),e.round=Gi}function An(e,r){var t=r.stack,n=t.pop(),a=t.pop(),i=r.z0[a],o=r.fv,l=r.pv,u=r.cvt[n];s.DEBUG&&console.log(r.step,"MIAP["+e+"]",n,"(",u,")",a);var c=l.distance(i,nr);e&&(Math.abs(c-u)<r.cvCutIn&&(c=u),c=r.round(c)),o.setRelative(i,nr,c,l),r.zp0===0&&(i.xo=i.x,i.yo=i.y),o.touch(i),r.rp0=r.rp1=a}function Ts(e){var r=e.prog,t=e.ip,n=e.stack,a=r[++t];s.DEBUG&&console.log(e.step,"NPUSHB[]",a);for(var i=0;i<a;i++)n.push(r[++t]);e.ip=t}function ks(e){var r=e.ip,t=e.prog,n=e.stack,a=t[++r];s.DEBUG&&console.log(e.step,"NPUSHW[]",a);for(var i=0;i<a;i++){var o=t[++r]<<8|t[++r];o&32768&&(o=-((o^65535)+1)),n.push(o)}e.ip=r}function Fs(e){var r=e.stack,t=e.store;t||(t=e.store=[]);var n=r.pop(),a=r.pop();s.DEBUG&&console.log(e.step,"WS",n,a),t[a]=n}function Ls(e){var r=e.stack,t=e.store,n=r.pop();s.DEBUG&&console.log(e.step,"RS",n);var a=t&&t[n]||0;r.push(a)}function Es(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"WCVTP",t,n),e.cvt[n]=t/64}function Us(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"RCVT",t),r.push(e.cvt[t]*64)}function Mn(e,r){var t=r.stack,n=t.pop(),a=r.z2[n];s.DEBUG&&console.log(r.step,"GC["+e+"]",n),t.push(r.dpv.distance(a,nr,e,!1)*64)}function Bn(e,r){var t=r.stack,n=t.pop(),a=t.pop(),i=r.z1[n],o=r.z0[a],l=r.dpv.distance(o,i,e,e);s.DEBUG&&console.log(r.step,"MD["+e+"]",n,a,"->",l),r.stack.push(Math.round(l*64))}function Os(e){s.DEBUG&&console.log(e.step,"MPPEM[]"),e.stack.push(e.ppem)}function Is(e){s.DEBUG&&console.log(e.step,"FLIPON[]"),e.autoFlip=!0}function Cs(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"LT[]",t,n),r.push(n<t?1:0)}function ws(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"LTEQ[]",t,n),r.push(n<=t?1:0)}function Rs(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"GT[]",t,n),r.push(n>t?1:0)}function Ds(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"GTEQ[]",t,n),r.push(n>=t?1:0)}function As(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"EQ[]",t,n),r.push(t===n?1:0)}function Ms(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"NEQ[]",t,n),r.push(t!==n?1:0)}function Bs(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"ODD[]",t),r.push(Math.trunc(t)%2?1:0)}function Ps(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"EVEN[]",t),r.push(Math.trunc(t)%2?0:1)}function Gs(e){var r=e.stack.pop(),t;s.DEBUG&&console.log(e.step,"IF[]",r),r||(Tn(e,!0),s.DEBUG&&console.log(e.step,t===27?"ELSE[]":"EIF[]"))}function Ns(e){s.DEBUG&&console.log(e.step,"EIF[]")}function Hs(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"AND[]",t,n),r.push(t&&n?1:0)}function _s(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"OR[]",t,n),r.push(t||n?1:0)}function zs(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"NOT[]",t),r.push(t?0:1)}function Kr(e,r){var t=r.stack,n=t.pop(),a=r.fv,i=r.pv,o=r.ppem,l=r.deltaBase+(e-1)*16,u=r.deltaShift,c=r.z0;s.DEBUG&&console.log(r.step,"DELTAP["+e+"]",n,t);for(var d=0;d<n;d++){var y=t.pop(),g=t.pop(),m=l+((g&240)>>4);if(m===o){var T=(g&15)-8;T>=0&&T++,s.DEBUG&&console.log(r.step,"DELTAPFIX",y,"by",T*u);var O=c[y];a.setRelative(O,O,T*u,i)}}}function Ws(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"SDB[]",t),e.deltaBase=t}function Vs(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"SDS[]",t),e.deltaShift=Math.pow(.5,t)}function qs(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"ADD[]",t,n),r.push(n+t)}function Xs(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"SUB[]",t,n),r.push(n-t)}function Ys(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"DIV[]",t,n),r.push(n*64/t)}function Zs(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"MUL[]",t,n),r.push(n*t/64)}function Qs(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"ABS[]",t),r.push(Math.abs(t))}function Js(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"NEG[]",t),r.push(-t)}function Ks(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"FLOOR[]",t),r.push(Math.floor(t/64)*64)}function js(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"CEILING[]",t),r.push(Math.ceil(t/64)*64)}function Lr(e,r){var t=r.stack,n=t.pop();s.DEBUG&&console.log(r.step,"ROUND[]"),t.push(r.round(n/64)*64)}function $s(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"WCVTF[]",t,n),e.cvt[n]=t*e.ppem/e.font.unitsPerEm}function jr(e,r){var t=r.stack,n=t.pop(),a=r.ppem,i=r.deltaBase+(e-1)*16,o=r.deltaShift;s.DEBUG&&console.log(r.step,"DELTAC["+e+"]",n,t);for(var l=0;l<n;l++){var u=t.pop(),c=t.pop(),d=i+((c&240)>>4);if(d===a){var y=(c&15)-8;y>=0&&y++;var g=y*o;s.DEBUG&&console.log(r.step,"DELTACFIX",u,"by",g),r.cvt[u]+=g}}}function eo(e){var r=e.stack.pop();s.DEBUG&&console.log(e.step,"SROUND[]",r),e.round=Sn;var t;switch(r&192){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=t,r&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}r&=15,r===0?e.srThreshold=0:e.srThreshold=(r/8-.5)*t}function ro(e){var r=e.stack.pop();s.DEBUG&&console.log(e.step,"S45ROUND[]",r),e.round=Sn;var t;switch(r&192){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=t,r&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}r&=15,r===0?e.srThreshold=0:e.srThreshold=(r/8-.5)*t}function to(e){s.DEBUG&&console.log(e.step,"ROFF[]"),e.round=Pi}function no(e){s.DEBUG&&console.log(e.step,"RUTG[]"),e.round=Hi}function ao(e){s.DEBUG&&console.log(e.step,"RDTG[]"),e.round=_i}function io(e){var r=e.stack.pop();s.DEBUG&&console.log(e.step,"SCANCTRL[]",r)}function Pn(e,r){var t=r.stack,n=t.pop(),a=t.pop(),i=r.z2[n],o=r.z1[a];s.DEBUG&&console.log(r.step,"SDPVTL["+e+"]",n,a);var l,u;e?(l=i.y-o.y,u=o.x-i.x):(l=o.x-i.x,u=o.y-i.y),r.dpv=tr(l,u)}function so(e){var r=e.stack,t=r.pop(),n=0;s.DEBUG&&console.log(e.step,"GETINFO[]",t),t&1&&(n=35),t&32&&(n|=4096),r.push(n)}function oo(e){var r=e.stack,t=r.pop(),n=r.pop(),a=r.pop();s.DEBUG&&console.log(e.step,"ROLL[]"),r.push(n),r.push(t),r.push(a)}function uo(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"MAX[]",t,n),r.push(Math.max(n,t))}function lo(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"MIN[]",t,n),r.push(Math.min(n,t))}function fo(e){var r=e.stack.pop();s.DEBUG&&console.log(e.step,"SCANTYPE[]",r)}function po(e){var r=e.stack.pop(),t=e.stack.pop();switch(s.DEBUG&&console.log(e.step,"INSTCTRL[]",r,t),r){case 1:e.inhibitGridFit=!!t;return;case 2:e.ignoreCvt=!!t;return;default:throw new Error("invalid INSTCTRL[] selector")}}function Ce(e,r){var t=r.stack,n=r.prog,a=r.ip;s.DEBUG&&console.log(r.step,"PUSHB["+e+"]");for(var i=0;i<e;i++)t.push(n[++a]);r.ip=a}function we(e,r){var t=r.ip,n=r.prog,a=r.stack;s.DEBUG&&console.log(r.ip,"PUSHW["+e+"]");for(var i=0;i<e;i++){var o=n[++t]<<8|n[++t];o&32768&&(o=-((o^65535)+1)),a.push(o)}r.ip=t}function C(e,r,t,n,a,i){var o=i.stack,l=e&&o.pop(),u=o.pop(),c=i.rp0,d=i.z0[c],y=i.z1[u],g=i.minDis,m=i.fv,T=i.dpv,O,F,U,P;F=O=T.distance(y,d,!0,!0),U=F>=0?1:-1,F=Math.abs(F),e&&(P=i.cvt[l],n&&Math.abs(F-P)<i.cvCutIn&&(F=P)),t&&F<g&&(F=g),n&&(F=i.round(F)),m.setRelative(y,d,U*F,T),m.touch(y),s.DEBUG&&console.log(i.step,(e?"MIRP[":"MDRP[")+(r?"M":"m")+(t?">":"_")+(n?"R":"_")+(a===0?"Gr":a===1?"Bl":a===2?"Wh":"")+"]",e?l+"("+i.cvt[l]+","+P+")":"",u,"(d =",O,"->",U*F,")"),i.rp1=i.rp0,i.rp2=u,r&&(i.rp0=u)}mn=[kn.bind(void 0,Fe),kn.bind(void 0,Te),Fn.bind(void 0,Fe),Fn.bind(void 0,Te),Ln.bind(void 0,Fe),Ln.bind(void 0,Te),En.bind(void 0,0),En.bind(void 0,1),Un.bind(void 0,0),Un.bind(void 0,1),Wi,Vi,qi,Xi,Yi,Zi,Qi,Ji,Ki,ji,$i,es,rs,ts,ns,as,is,ss,os,us,void 0,void 0,ls,Jr,fs,ps,hs,ds,gs,void 0,void 0,void 0,cs,vs,ms,void 0,On.bind(void 0,0),On.bind(void 0,1),In.bind(void 0,Fe),In.bind(void 0,Te),Cn.bind(void 0,0),Cn.bind(void 0,1),wn.bind(void 0,0),wn.bind(void 0,1),Rn.bind(void 0,0),Rn.bind(void 0,1),ys,bs,Dn.bind(void 0,0),Dn.bind(void 0,1),xs,Ss,An.bind(void 0,0),An.bind(void 0,1),Ts,ks,Fs,Ls,Es,Us,Mn.bind(void 0,0),Mn.bind(void 0,1),void 0,Bn.bind(void 0,0),Bn.bind(void 0,1),Os,void 0,Is,void 0,void 0,Cs,ws,Rs,Ds,As,Ms,Bs,Ps,Gs,Ns,Hs,_s,zs,Kr.bind(void 0,1),Ws,Vs,qs,Xs,Ys,Zs,Qs,Js,Ks,js,Lr.bind(void 0,0),Lr.bind(void 0,1),Lr.bind(void 0,2),Lr.bind(void 0,3),void 0,void 0,void 0,void 0,$s,Kr.bind(void 0,2),Kr.bind(void 0,3),jr.bind(void 0,1),jr.bind(void 0,2),jr.bind(void 0,3),eo,ro,void 0,void 0,to,void 0,no,ao,Jr,Jr,void 0,void 0,void 0,void 0,void 0,io,Pn.bind(void 0,0),Pn.bind(void 0,1),so,void 0,oo,uo,lo,fo,po,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Ce.bind(void 0,1),Ce.bind(void 0,2),Ce.bind(void 0,3),Ce.bind(void 0,4),Ce.bind(void 0,5),Ce.bind(void 0,6),Ce.bind(void 0,7),Ce.bind(void 0,8),we.bind(void 0,1),we.bind(void 0,2),we.bind(void 0,3),we.bind(void 0,4),we.bind(void 0,5),we.bind(void 0,6),we.bind(void 0,7),we.bind(void 0,8),C.bind(void 0,0,0,0,0,0),C.bind(void 0,0,0,0,0,1),C.bind(void 0,0,0,0,0,2),C.bind(void 0,0,0,0,0,3),C.bind(void 0,0,0,0,1,0),C.bind(void 0,0,0,0,1,1),C.bind(void 0,0,0,0,1,2),C.bind(void 0,0,0,0,1,3),C.bind(void 0,0,0,1,0,0),C.bind(void 0,0,0,1,0,1),C.bind(void 0,0,0,1,0,2),C.bind(void 0,0,0,1,0,3),C.bind(void 0,0,0,1,1,0),C.bind(void 0,0,0,1,1,1),C.bind(void 0,0,0,1,1,2),C.bind(void 0,0,0,1,1,3),C.bind(void 0,0,1,0,0,0),C.bind(void 0,0,1,0,0,1),C.bind(void 0,0,1,0,0,2),C.bind(void 0,0,1,0,0,3),C.bind(void 0,0,1,0,1,0),C.bind(void 0,0,1,0,1,1),C.bind(void 0,0,1,0,1,2),C.bind(void 0,0,1,0,1,3),C.bind(void 0,0,1,1,0,0),C.bind(void 0,0,1,1,0,1),C.bind(void 0,0,1,1,0,2),C.bind(void 0,0,1,1,0,3),C.bind(void 0,0,1,1,1,0),C.bind(void 0,0,1,1,1,1),C.bind(void 0,0,1,1,1,2),C.bind(void 0,0,1,1,1,3),C.bind(void 0,1,0,0,0,0),C.bind(void 0,1,0,0,0,1),C.bind(void 0,1,0,0,0,2),C.bind(void 0,1,0,0,0,3),C.bind(void 0,1,0,0,1,0),C.bind(void 0,1,0,0,1,1),C.bind(void 0,1,0,0,1,2),C.bind(void 0,1,0,0,1,3),C.bind(void 0,1,0,1,0,0),C.bind(void 0,1,0,1,0,1),C.bind(void 0,1,0,1,0,2),C.bind(void 0,1,0,1,0,3),C.bind(void 0,1,0,1,1,0),C.bind(void 0,1,0,1,1,1),C.bind(void 0,1,0,1,1,2),C.bind(void 0,1,0,1,1,3),C.bind(void 0,1,1,0,0,0),C.bind(void 0,1,1,0,0,1),C.bind(void 0,1,1,0,0,2),C.bind(void 0,1,1,0,0,3),C.bind(void 0,1,1,0,1,0),C.bind(void 0,1,1,0,1,1),C.bind(void 0,1,1,0,1,2),C.bind(void 0,1,1,0,1,3),C.bind(void 0,1,1,1,0,0),C.bind(void 0,1,1,1,0,1),C.bind(void 0,1,1,1,0,2),C.bind(void 0,1,1,1,0,3),C.bind(void 0,1,1,1,1,0),C.bind(void 0,1,1,1,1,1),C.bind(void 0,1,1,1,1,2),C.bind(void 0,1,1,1,1,3)];function z(e){e=e||{},e.empty||(Ye(e.familyName,"When creating a new Font object, familyName is required."),Ye(e.styleName,"When creating a new Font object, styleName is required."),Ye(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Ye(e.ascender,"When creating a new Font object, ascender is required."),Ye(e.descender,"When creating a new Font object, descender is required."),Ye(e.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||e.familyName+e.styleName},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables={os2:{usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new qe.GlyphSet(this,e.glyphs||[]),this.encoding=new Ct(this),this.position=new kr(this),this.substitution=new ye(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){if(this._hinting)return this._hinting;if(this.outlinesFormat==="truetype")return this._hinting=new bn(this)}})}z.prototype.hasChar=function(e){return this.encoding.charToGlyphIndex(e)!==null},z.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},z.prototype.charToGlyph=function(e){var r=this.charToGlyphIndex(e),t=this.glyphs.get(r);return t||(t=this.glyphs.get(0)),t},z.prototype.stringToGlyphs=function(e,r){var t=this;r=r||this.defaultRenderOptions;for(var n=[],a=0;a<e.length;a+=1){var i=e[a];n.push(t.charToGlyphIndex(i))}var o=n.length;if(r.features){var l=r.script||this.substitution.getDefaultScriptName(),u=[];r.features.liga&&(u=u.concat(this.substitution.getFeature("liga",l,r.language))),r.features.rlig&&(u=u.concat(this.substitution.getFeature("rlig",l,r.language)));for(var c=0;c<o;c+=1)for(var d=0;d<u.length;d++){for(var y=u[d],g=y.sub,m=g.length,T=0;T<m&&g[T]===n[c+T];)T++;T===m&&(n.splice(c,m,y.by),o=o-m+1)}}for(var O=new Array(o),F=this.glyphs.get(0),U=0;U<o;U+=1)O[U]=t.glyphs.get(n[U])||F;return O},z.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},z.prototype.nameToGlyph=function(e){var r=this.nameToGlyphIndex(e),t=this.glyphs.get(r);return t||(t=this.glyphs.get(0)),t},z.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},z.prototype.getKerningValue=function(e,r){return e=e.index||e,r=r.index||r,this.kerningPairs[e+","+r]||0},z.prototype.defaultRenderOptions={kerning:!0,features:{liga:!0,rlig:!0}},z.prototype.forEachGlyph=function(e,r,t,n,a,i){var o=this;r=r!==void 0?r:0,t=t!==void 0?t:0,n=n!==void 0?n:72,a=a||this.defaultRenderOptions;var l=1/this.unitsPerEm*n,u=this.stringToGlyphs(e,a),c;if(a.kerning){var d=a.script||this.position.getDefaultScriptName();c=this.position.getKerningTables(d,a.language)}for(var y=0;y<u.length;y+=1){var g=u[y];if(i.call(o,g,r,t,n,a),g.advanceWidth&&(r+=g.advanceWidth*l),a.kerning&&y<u.length-1){var m=c?o.position.getKerningValue(c,g.index,u[y+1].index):o.getKerningValue(g,u[y+1]);r+=m*l}a.letterSpacing?r+=a.letterSpacing*n:a.tracking&&(r+=a.tracking/1e3*n)}return r},z.prototype.getPath=function(e,r,t,n,a){var i=new Z;return this.forEachGlyph(e,r,t,n,a,function(o,l,u,c){var d=o.getPath(l,u,c,a,this);i.extend(d)}),i},z.prototype.getPaths=function(e,r,t,n,a){var i=[];return this.forEachGlyph(e,r,t,n,a,function(o,l,u,c){var d=o.getPath(l,u,c,a,this);i.push(d)}),i},z.prototype.getAdvanceWidth=function(e,r,t){return this.forEachGlyph(e,0,0,r,t,function(){})},z.prototype.draw=function(e,r,t,n,a,i){this.getPath(r,t,n,a,i).draw(e)},z.prototype.drawPoints=function(e,r,t,n,a,i){this.forEachGlyph(r,t,n,a,i,function(o,l,u,c){o.drawPoints(e,l,u,c)})},z.prototype.drawMetrics=function(e,r,t,n,a,i){this.forEachGlyph(r,t,n,a,i,function(o,l,u,c){o.drawMetrics(e,l,u,c)})},z.prototype.getEnglishName=function(e){var r=this.names[e];if(r)return r.en},z.prototype.validate=function(){var e=[],r=this;function t(a,i){a||e.push(i)}function n(a){var i=r.getEnglishName(a);t(i&&i.trim().length>0,"No English "+a+" specified.")}n("fontFamily"),n("weightName"),n("manufacturer"),n("copyright"),n("version"),t(this.unitsPerEm>0,"No unitsPerEm specified.")},z.prototype.toTables=function(){return Di.fontToTable(this)},z.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},z.prototype.toArrayBuffer=function(){for(var e=this.toTables(),r=e.encode(),t=new ArrayBuffer(r.length),n=new Uint8Array(t),a=0;a<r.length;a++)n[a]=r[a];return t},z.prototype.download=function(e){var r=this.getEnglishName("fontFamily"),t=this.getEnglishName("fontSubfamily");e=e||r.replace(/\s/g,"")+"-"+t+".otf";var n=this.toArrayBuffer();if(Mi())window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem,window.requestFileSystem(window.TEMPORARY,n.byteLength,function(o){o.root.getFile(e,{create:!0},function(l){l.createWriter(function(u){var c=new DataView(n),d=new Blob([c],{type:"font/opentype"});u.write(d),u.addEventListener("writeend",function(){location.href=l.toURL()},!1)})})},function(o){throw new Error(o.name+": "+o.message)});else{var a=tt("fs"),i=Bi(n);a.writeFileSync(e,i)}},z.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},z.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},z.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};function Gn(e,r){var t=JSON.stringify(e),n=256;for(var a in r){var i=parseInt(a);if(!(!i||i<256)){if(JSON.stringify(r[a])===t)return i;n<=i&&(n=i+1)}}return r[n]=e,n}function ho(e,r,t){var n=Gn(r.name,t);return[{name:"tag_"+e,type:"TAG",value:r.tag},{name:"minValue_"+e,type:"FIXED",value:r.minValue<<16},{name:"defaultValue_"+e,type:"FIXED",value:r.defaultValue<<16},{name:"maxValue_"+e,type:"FIXED",value:r.maxValue<<16},{name:"flags_"+e,type:"USHORT",value:0},{name:"nameID_"+e,type:"USHORT",value:n}]}function co(e,r,t){var n={},a=new w.Parser(e,r);return n.tag=a.parseTag(),n.minValue=a.parseFixed(),n.defaultValue=a.parseFixed(),n.maxValue=a.parseFixed(),a.skip("uShort",1),n.name=t[a.parseUShort()]||{},n}function vo(e,r,t,n){for(var a=Gn(r.name,n),i=[{name:"nameID_"+e,type:"USHORT",value:a},{name:"flags_"+e,type:"USHORT",value:0}],o=0;o<t.length;++o){var l=t[o].tag;i.push({name:"axis_"+e+" "+l,type:"FIXED",value:r.coordinates[l]<<16})}return i}function go(e,r,t,n){var a={},i=new w.Parser(e,r);a.name=n[i.parseUShort()]||{},i.skip("uShort",1),a.coordinates={};for(var o=0;o<t.length;++o)a.coordinates[t[o].tag]=i.parseFixed();return a}function mo(e,r){var t=new A.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:e.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:e.instances.length},{name:"instanceSize",type:"USHORT",value:4+e.axes.length*4}]);t.offsetToData=t.sizeOf();for(var n=0;n<e.axes.length;n++)t.fields=t.fields.concat(ho(n,e.axes[n],r));for(var a=0;a<e.instances.length;a++)t.fields=t.fields.concat(vo(a,e.instances[a],e.axes,r));return t}function yo(e,r,t){var n=new w.Parser(e,r),a=n.parseULong();G.argument(a===65536,"Unsupported fvar table version.");var i=n.parseOffset16();n.skip("uShort",1);for(var o=n.parseUShort(),l=n.parseUShort(),u=n.parseUShort(),c=n.parseUShort(),d=[],y=0;y<o;y++)d.push(co(e,r+i+y*l,t));for(var g=[],m=r+i+o*l,T=0;T<u;T++)g.push(go(e,m+T*c,d,t));return{axes:d,instances:g}}var bo={make:mo,parse:yo},be=new Array(10);be[1]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{posFormat:1,coverage:this.parsePointer(b.coverage),value:this.parseValueRecord()};if(t===2)return{posFormat:2,coverage:this.parsePointer(b.coverage),values:this.parseValueRecordList()};G.assert(!1,"0x"+r.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},be[2]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort(),n=this.parsePointer(b.coverage),a=this.parseUShort(),i=this.parseUShort();if(t===1)return{posFormat:t,coverage:n,valueFormat1:a,valueFormat2:i,pairSets:this.parseList(b.pointer(b.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(a),value2:this.parseValueRecord(i)}})))};if(t===2){var o=this.parsePointer(b.classDef),l=this.parsePointer(b.classDef),u=this.parseUShort(),c=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:a,valueFormat2:i,classDef1:o,classDef2:l,class1Count:u,class2Count:c,classRecords:this.parseList(u,b.list(c,function(){return{value1:this.parseValueRecord(a),value2:this.parseValueRecord(i)}}))}}G.assert(!1,"0x"+r.toString(16)+": GPOS lookup type 2 format must be 1 or 2.")},be[3]=function(){return{error:"GPOS Lookup 3 not supported"}},be[4]=function(){return{error:"GPOS Lookup 4 not supported"}},be[5]=function(){return{error:"GPOS Lookup 5 not supported"}},be[6]=function(){return{error:"GPOS Lookup 6 not supported"}},be[7]=function(){return{error:"GPOS Lookup 7 not supported"}},be[8]=function(){return{error:"GPOS Lookup 8 not supported"}},be[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function xo(e,r){r=r||0;var t=new b(e,r),n=t.parseVersion(1);return G.argument(n===1||n===1.1,"Unsupported GPOS table version "+n),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(be)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(be),variations:t.parseFeatureVariationsList()}}var So=new Array(10);function To(e){return new A.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new A.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new A.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new A.LookupList(e.lookups,So)}])}var ko={parse:xo,make:To};function Fo(e){var r={};e.skip("uShort");var t=e.parseUShort();G.argument(t===0,"Unsupported kern sub-table version."),e.skip("uShort",2);var n=e.parseUShort();e.skip("uShort",3);for(var a=0;a<n;a+=1){var i=e.parseUShort(),o=e.parseUShort(),l=e.parseShort();r[i+","+o]=l}return r}function Lo(e){var r={};e.skip("uShort");var t=e.parseULong();t>1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");var n=e.parseUShort(),a=n&255;if(e.skip("uShort"),a===0){var i=e.parseUShort();e.skip("uShort",3);for(var o=0;o<i;o+=1){var l=e.parseUShort(),u=e.parseUShort(),c=e.parseShort();r[l+","+u]=c}}return r}function Eo(e,r){var t=new w.Parser(e,r),n=t.parseUShort();if(n===0)return Fo(t);if(n===1)return Lo(t);throw new Error("Unsupported kern table version ("+n+").")}var Uo={parse:Eo};function Oo(e,r,t,n){for(var a=new w.Parser(e,r),i=n?a.parseUShort:a.parseULong,o=[],l=0;l<t+1;l+=1){var u=i.call(a);n&&(u*=2),o.push(u)}return o}var Io={parse:Oo};function Co(e,r){var t=tt("fs");t.readFile(e,function(n,a){if(n)return r(n.message);r(null,gn(a))})}function wo(e,r){var t=new XMLHttpRequest;t.open("get",e,!0),t.responseType="arraybuffer",t.onload=function(){return t.response?r(null,t.response):r("Font could not be loaded: "+t.statusText)},t.onerror=function(){r("Font could not be loaded")},t.send()}function Nn(e,r){for(var t=[],n=12,a=0;a<r;a+=1){var i=w.getTag(e,n),o=w.getULong(e,n+4),l=w.getULong(e,n+8),u=w.getULong(e,n+12);t.push({tag:i,checksum:o,offset:l,length:u,compression:!1}),n+=16}return t}function Ro(e,r){for(var t=[],n=44,a=0;a<r;a+=1){var i=w.getTag(e,n),o=w.getULong(e,n+4),l=w.getULong(e,n+8),u=w.getULong(e,n+12),c=void 0;l<u?c="WOFF":c=!1,t.push({tag:i,offset:o,compression:c,compressedLength:l,length:u}),n+=20}return t}function Q(e,r){if(r.compression==="WOFF"){var t=new Uint8Array(e.buffer,r.offset+2,r.compressedLength-2),n=new Uint8Array(r.length);if(pa(t,n),n.byteLength!==r.length)throw new Error("Decompression error: "+r.tag+" decompressed length doesn't match recorded length");var a=new DataView(n.buffer,0);return{data:a,offset:0}}else return{data:e,offset:r.offset}}function $r(e){var r,t,n=new z({empty:!0}),a=new DataView(e,0),i,o=[],l=w.getTag(a,0);if(l==="\0\0\0"||l==="true"||l==="typ1")n.outlinesFormat="truetype",i=w.getUShort(a,4),o=Nn(a,i);else if(l==="OTTO")n.outlinesFormat="cff",i=w.getUShort(a,4),o=Nn(a,i);else if(l==="wOFF"){var u=w.getTag(a,4);if(u==="\0\0\0")n.outlinesFormat="truetype";else if(u==="OTTO")n.outlinesFormat="cff";else throw new Error("Unsupported OpenType flavor "+l);i=w.getUShort(a,12),o=Ro(a,i)}else throw new Error("Unsupported OpenType signature "+l);for(var c,d,y,g,m,T,O,F,U,P,I,H=0;H<i;H+=1){var R=o[H],B=void 0;switch(R.tag){case"cmap":B=Q(a,R),n.tables.cmap=It.parse(B.data,B.offset),n.encoding=new wt(n.tables.cmap);break;case"cvt ":B=Q(a,R),I=new w.Parser(B.data,B.offset),n.tables.cvt=I.parseShortList(R.length/2);break;case"fvar":d=R;break;case"fpgm":B=Q(a,R),I=new w.Parser(B.data,B.offset),n.tables.fpgm=I.parseByteList(R.length);break;case"head":B=Q(a,R),n.tables.head=Yt.parse(B.data,B.offset),n.unitsPerEm=n.tables.head.unitsPerEm,r=n.tables.head.indexToLocFormat;break;case"hhea":B=Q(a,R),n.tables.hhea=Zt.parse(B.data,B.offset),n.ascender=n.tables.hhea.ascender,n.descender=n.tables.hhea.descender,n.numberOfHMetrics=n.tables.hhea.numberOfHMetrics;break;case"hmtx":T=R;break;case"ltag":B=Q(a,R),t=Jt.parse(B.data,B.offset);break;case"maxp":B=Q(a,R),n.tables.maxp=Kt.parse(B.data,B.offset),n.numGlyphs=n.tables.maxp.numGlyphs;break;case"name":U=R;break;case"OS/2":B=Q(a,R),n.tables.os2=Xr.parse(B.data,B.offset);break;case"post":B=Q(a,R),n.tables.post=sn.parse(B.data,B.offset),n.glyphNames=new Nr(n.tables.post);break;case"prep":B=Q(a,R),I=new w.Parser(B.data,B.offset),n.tables.prep=I.parseByteList(R.length);break;case"glyf":y=R;break;case"loca":F=R;break;case"CFF ":c=R;break;case"kern":O=R;break;case"GPOS":g=R;break;case"GSUB":m=R;break;case"meta":P=R;break}}var ue=Q(a,U);if(n.tables.name=an.parse(ue.data,ue.offset,t),n.names=n.tables.name,y&&F){var q=r===0,K=Q(a,F),se=Io.parse(K.data,K.offset,n.numGlyphs,q),le=Q(a,y);n.glyphs=At.parse(le.data,le.offset,se,n)}else if(c){var pe=Q(a,c);Xt.parse(pe.data,pe.offset,n)}else throw new Error("Font doesn't contain TrueType or CFF outlines.");var de=Q(a,T);if(Qt.parse(de.data,de.offset,n.numberOfHMetrics,n.numGlyphs,n.glyphs),Ca(n),O){var J=Q(a,O);n.kerningPairs=Uo.parse(J.data,J.offset)}else n.kerningPairs={};if(g){var j=Q(a,g);n.tables.gpos=ko.parse(j.data,j.offset)}if(m){var re=Q(a,m);n.tables.gsub=on.parse(re.data,re.offset)}if(d){var te=Q(a,d);n.tables.fvar=bo.parse(te.data,te.offset,n.names)}if(P){var ne=Q(a,P);n.tables.meta=un.parse(ne.data,ne.offset),n.metas=n.tables.meta}return n}function Do(e,r){var t=typeof window>"u",n=t?Co:wo;n(e,function(a,i){if(a)return r(a);var o;try{o=$r(i)}catch(l){return r(l,null)}return r(null,o)})}function Ao(e){var r=tt("fs"),t=r.readFileSync(e);return $r(gn(t))}s.Font=z,s.Glyph=fe,s.Path=Z,s.BoundingBox=ke,s._parse=w,s.parse=$r,s.load=Do,s.loadSync=Ao,Object.defineProperty(s,"__esModule",{value:!0})}))});var Zn=Ur((Au,Yn)=>{"use strict";Yn.exports=function(s){s.prototype[Symbol.iterator]=function*(){for(let f=this.head;f;f=f.next)yield f.value}}});var Jn=Ur((Mu,Qn)=>{"use strict";Qn.exports=_;_.Node=He;_.create=_;function _(s){var f=this;if(f instanceof _||(f=new _),f.tail=null,f.head=null,f.length=0,s&&typeof s.forEach=="function")s.forEach(function(v){f.push(v)});else if(arguments.length>0)for(var p=0,h=arguments.length;p<h;p++)f.push(arguments[p]);return f}_.prototype.removeNode=function(s){if(s.list!==this)throw new Error("removing node which does not belong to this list");var f=s.next,p=s.prev;return f&&(f.prev=p),p&&(p.next=f),s===this.head&&(this.head=f),s===this.tail&&(this.tail=p),s.list.length--,s.next=null,s.prev=null,s.list=null,f};_.prototype.unshiftNode=function(s){if(s!==this.head){s.list&&s.list.removeNode(s);var f=this.head;s.list=this,s.next=f,f&&(f.prev=s),this.head=s,this.tail||(this.tail=s),this.length++}};_.prototype.pushNode=function(s){if(s!==this.tail){s.list&&s.list.removeNode(s);var f=this.tail;s.list=this,s.prev=f,f&&(f.next=s),this.tail=s,this.head||(this.head=s),this.length++}};_.prototype.push=function(){for(var s=0,f=arguments.length;s<f;s++)Jo(this,arguments[s]);return this.length};_.prototype.unshift=function(){for(var s=0,f=arguments.length;s<f;s++)Ko(this,arguments[s]);return this.length};_.prototype.pop=function(){if(this.tail){var s=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,s}};_.prototype.shift=function(){if(this.head){var s=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,s}};_.prototype.forEach=function(s,f){f=f||this;for(var p=this.head,h=0;p!==null;h++)s.call(f,p.value,h,this),p=p.next};_.prototype.forEachReverse=function(s,f){f=f||this;for(var p=this.tail,h=this.length-1;p!==null;h--)s.call(f,p.value,h,this),p=p.prev};_.prototype.get=function(s){for(var f=0,p=this.head;p!==null&&f<s;f++)p=p.next;if(f===s&&p!==null)return p.value};_.prototype.getReverse=function(s){for(var f=0,p=this.tail;p!==null&&f<s;f++)p=p.prev;if(f===s&&p!==null)return p.value};_.prototype.map=function(s,f){f=f||this;for(var p=new _,h=this.head;h!==null;)p.push(s.call(f,h.value,this)),h=h.next;return p};_.prototype.mapReverse=function(s,f){f=f||this;for(var p=new _,h=this.tail;h!==null;)p.push(s.call(f,h.value,this)),h=h.prev;return p};_.prototype.reduce=function(s,f){var p,h=this.head;if(arguments.length>1)p=f;else if(this.head)h=this.head.next,p=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var v=0;h!==null;v++)p=s(p,h.value,v),h=h.next;return p};_.prototype.reduceReverse=function(s,f){var p,h=this.tail;if(arguments.length>1)p=f;else if(this.tail)h=this.tail.prev,p=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var v=this.length-1;h!==null;v--)p=s(p,h.value,v),h=h.prev;return p};_.prototype.toArray=function(){for(var s=new Array(this.length),f=0,p=this.head;p!==null;f++)s[f]=p.value,p=p.next;return s};_.prototype.toArrayReverse=function(){for(var s=new Array(this.length),f=0,p=this.tail;p!==null;f++)s[f]=p.value,p=p.prev;return s};_.prototype.slice=function(s,f){f=f||this.length,f<0&&(f+=this.length),s=s||0,s<0&&(s+=this.length);var p=new _;if(f<s||f<0)return p;s<0&&(s=0),f>this.length&&(f=this.length);for(var h=0,v=this.head;v!==null&&h<s;h++)v=v.next;for(;v!==null&&h<f;h++,v=v.next)p.push(v.value);return p};_.prototype.sliceReverse=function(s,f){f=f||this.length,f<0&&(f+=this.length),s=s||0,s<0&&(s+=this.length);var p=new _;if(f<s||f<0)return p;s<0&&(s=0),f>this.length&&(f=this.length);for(var h=this.length,v=this.tail;v!==null&&h>f;h--)v=v.prev;for(;v!==null&&h>s;h--,v=v.prev)p.push(v.value);return p};_.prototype.splice=function(s,f,...p){s>this.length&&(s=this.length-1),s<0&&(s=this.length+s);for(var h=0,v=this.head;v!==null&&h<s;h++)v=v.next;for(var x=[],h=0;v&&h<f;h++)x.push(v.value),v=this.removeNode(v);v===null&&(v=this.tail),v!==this.head&&v!==this.tail&&(v=v.prev);for(var h=0;h<p.length;h++)v=Qo(this,v,p[h]);return x};_.prototype.reverse=function(){for(var s=this.head,f=this.tail,p=s;p!==null;p=p.prev){var h=p.prev;p.prev=p.next,p.next=h}return this.head=f,this.tail=s,this};function Qo(s,f,p){var h=f===s.head?new He(p,null,f,s):new He(p,f,f.next,s);return h.next===null&&(s.tail=h),h.prev===null&&(s.head=h),s.length++,h}function Jo(s,f){s.tail=new He(f,s.tail,null,s),s.head||(s.head=s.tail),s.length++}function Ko(s,f){s.head=new He(f,null,s.head,s),s.tail||(s.tail=s.head),s.length++}function He(s,f,p,h){if(!(this instanceof He))return new He(s,f,p,h);this.list=h,this.value=s,f?(f.next=this,this.prev=f):this.prev=null,p?(p.prev=this,this.next=p):this.next=null}try{Zn()(_)}catch{}});var ra=Ur((Bu,ea)=>{"use strict";var jo=Jn(),_e=Symbol("max"),Ue=Symbol("length"),Je=Symbol("lengthCalculator"),ur=Symbol("allowStale"),ze=Symbol("maxAge"),Ee=Symbol("dispose"),Kn=Symbol("noDisposeOnSet"),$=Symbol("lruList"),xe=Symbol("cache"),$n=Symbol("updateAgeOnGet"),ht=()=>1,vt=class{constructor(f){if(typeof f=="number"&&(f={max:f}),f||(f={}),f.max&&(typeof f.max!="number"||f.max<0))throw new TypeError("max must be a non-negative number");let p=this[_e]=f.max||1/0,h=f.length||ht;if(this[Je]=typeof h!="function"?ht:h,this[ur]=f.stale||!1,f.maxAge&&typeof f.maxAge!="number")throw new TypeError("maxAge must be a number");this[ze]=f.maxAge||0,this[Ee]=f.dispose,this[Kn]=f.noDisposeOnSet||!1,this[$n]=f.updateAgeOnGet||!1,this.reset()}set max(f){if(typeof f!="number"||f<0)throw new TypeError("max must be a non-negative number");this[_e]=f||1/0,or(this)}get max(){return this[_e]}set allowStale(f){this[ur]=!!f}get allowStale(){return this[ur]}set maxAge(f){if(typeof f!="number")throw new TypeError("maxAge must be a non-negative number");this[ze]=f,or(this)}get maxAge(){return this[ze]}set lengthCalculator(f){typeof f!="function"&&(f=ht),f!==this[Je]&&(this[Je]=f,this[Ue]=0,this[$].forEach(p=>{p.length=this[Je](p.value,p.key),this[Ue]+=p.length})),or(this)}get lengthCalculator(){return this[Je]}get length(){return this[Ue]}get itemCount(){return this[$].length}rforEach(f,p){p=p||this;for(let h=this[$].tail;h!==null;){let v=h.prev;jn(this,f,h,p),h=v}}forEach(f,p){p=p||this;for(let h=this[$].head;h!==null;){let v=h.next;jn(this,f,h,p),h=v}}keys(){return this[$].toArray().map(f=>f.key)}values(){return this[$].toArray().map(f=>f.value)}reset(){this[Ee]&&this[$]&&this[$].length&&this[$].forEach(f=>this[Ee](f.key,f.value)),this[xe]=new Map,this[$]=new jo,this[Ue]=0}dump(){return this[$].map(f=>Rr(this,f)?!1:{k:f.key,v:f.value,e:f.now+(f.maxAge||0)}).toArray().filter(f=>f)}dumpLru(){return this[$]}set(f,p,h){if(h=h||this[ze],h&&typeof h!="number")throw new TypeError("maxAge must be a number");let v=h?Date.now():0,x=this[Je](p,f);if(this[xe].has(f)){if(x>this[_e])return Ke(this,this[xe].get(f)),!1;let k=this[xe].get(f).value;return this[Ee]&&(this[Kn]||this[Ee](f,k.value)),k.now=v,k.maxAge=h,k.value=p,this[Ue]+=x-k.length,k.length=x,this.get(f),or(this),!0}let S=new dt(f,p,x,v,h);return S.length>this[_e]?(this[Ee]&&this[Ee](f,p),!1):(this[Ue]+=S.length,this[$].unshift(S),this[xe].set(f,this[$].head),or(this),!0)}has(f){if(!this[xe].has(f))return!1;let p=this[xe].get(f).value;return!Rr(this,p)}get(f){return ct(this,f,!0)}peek(f){return ct(this,f,!1)}pop(){let f=this[$].tail;return f?(Ke(this,f),f.value):null}del(f){Ke(this,this[xe].get(f))}load(f){this.reset();let p=Date.now();for(let h=f.length-1;h>=0;h--){let v=f[h],x=v.e||0;if(x===0)this.set(v.k,v.v);else{let S=x-p;S>0&&this.set(v.k,v.v,S)}}}prune(){this[xe].forEach((f,p)=>ct(this,p,!1))}},ct=(s,f,p)=>{let h=s[xe].get(f);if(h){let v=h.value;if(Rr(s,v)){if(Ke(s,h),!s[ur])return}else p&&(s[$n]&&(h.value.now=Date.now()),s[$].unshiftNode(h));return v.value}},Rr=(s,f)=>{if(!f||!f.maxAge&&!s[ze])return!1;let p=Date.now()-f.now;return f.maxAge?p>f.maxAge:s[ze]&&p>s[ze]},or=s=>{if(s[Ue]>s[_e])for(let f=s[$].tail;s[Ue]>s[_e]&&f!==null;){let p=f.prev;Ke(s,f),f=p}},Ke=(s,f)=>{if(f){let p=f.value;s[Ee]&&s[Ee](p.key,p.value),s[Ue]-=p.length,s[xe].delete(p.key),s[$].removeNode(f)}},dt=class{constructor(f,p,h,v,x){this.key=f,this.value=p,this.length=h,this.now=v,this.maxAge=x||0}},jn=(s,f,p,h)=>{let v=p.value;Rr(s,v)&&(Ke(s,p),s[ur]||(v=void 0)),v&&f.call(h,v.value,v.key,s)};ea.exports=vt});var ta=Wo(Wn());function ar(s){let f={individual:{},range:[]},p=new WeakMap;for(let h of s)at(f,h,p);return f}function at(s,f,p){for(let[h,v]of Object.entries(f.individual))if(s.individual[h])Ze(s.individual[h],v,p);else{let x=!1;for(let[S,{range:L,entry:k}]of s.range.entries()){let D=nt(Number(h),L);if(D.both!==null){x=!0,s.individual[h]=v,Ze(s.individual[h],ie(k),p),s.range.splice(S,1);for(let V of D.second)Array.isArray(V)?s.range.push({range:V,entry:ie(k)}):s.individual[V]=ie(k)}}x||(s.individual[h]=v)}for(let{range:h,entry:v}of f.range){let x=[h];for(let S=0;S<s.range.length;S++){let{range:L,entry:k}=s.range[S];for(let[D,V]of x.entries())if(Array.isArray(V)){let N=Vo(V,L);if(N.both===null)continue;s.range.splice(S,1),S--;let W=ie(k);Array.isArray(N.both)?s.range.push({range:N.both,entry:W}):s.individual[N.both]=W,Ze(W,ie(v),p);for(let X of N.second)Array.isArray(X)?s.range.push({range:X,entry:ie(k)}):s.individual[X]=ie(k);x=N.first}else{let N=nt(V,L);if(N.both===null)continue;s.individual[V]=ie(v),Ze(s.individual[V],ie(k),p),s.range.splice(S,1),S--;for(let W of N.second)Array.isArray(W)?s.range.push({range:W,entry:ie(k)}):s.individual[W]=ie(k);x.splice(D,1,...N.first);break}}for(let S of Object.keys(s.individual))for(let[L,k]of x.entries())if(Array.isArray(k)){let D=nt(Number(S),k);if(D.both===null)continue;Ze(s.individual[S],ie(v),p),x.splice(L,1,...D.second);break}else if(Number(S)===k){Ze(s.individual[S],ie(v),p);break}for(let S of x)Array.isArray(S)?s.range.push({range:S,entry:ie(v)}):s.individual[S]=ie(v)}}function Ze(s,f,p){let h=p.get(s);h?.has(f)||(h||(h=new Set,p.set(s,h)),h.add(f),f.lookup&&(!s.lookup||s.lookup.index>f.lookup.index||s.lookup.index===f.lookup.index&&s.lookup.subIndex>f.lookup.subIndex)&&(s.lookup=f.lookup),f.forward&&(s.forward?at(s.forward,f.forward,p):s.forward=f.forward),f.reverse&&(s.reverse?at(s.reverse,f.reverse,p):s.reverse=f.reverse))}function Vo(s,f){let p={first:[],second:[],both:null};if(s[0]<f[1]&&f[0]<s[1]){let h=Math.max(s[0],f[0]),v=Math.min(s[1],f[1]);p.both=Ge(h,v)}if(s[0]<f[0]){let h=s[0],v=Math.min(f[0],s[1]);p.first.push(Ge(h,v))}else if(f[0]<s[0]){let h=f[0],v=Math.min(f[1],s[0]);p.second.push(Ge(h,v))}if(s[1]>f[1]){let h=Math.max(s[0],f[1]),v=s[1];p.first.push(Ge(h,v))}else if(f[1]>s[1]){let h=Math.max(s[1],f[0]),v=f[1];p.second.push(Ge(h,v))}return p}function nt(s,f){if(s<f[0]||s>f[1])return{first:[s],second:[f],both:null};let p={first:[],second:[],both:s};return f[0]<s&&p.second.push(Ge(f[0],s)),f[1]>s&&p.second.push(Ge(s+1,f[1])),p}function Ge(s,f){return f-s===1?s:[s,f]}function ie(s,f=new Map){if(f.has(s))return f.get(s);let p={};return f.set(s,p),s.forward&&(p.forward=Vn(s.forward,f)),s.reverse&&(p.reverse=Vn(s.reverse,f)),s.lookup&&(p.lookup={contextRange:s.lookup.contextRange.slice(),index:s.lookup.index,length:s.lookup.length,subIndex:s.lookup.subIndex,substitutions:s.lookup.substitutions.slice()}),p}function Vn(s,f=new Map){let p={};for(let[h,v]of Object.entries(s.individual))p[h]=ie(v,f);return{individual:p,range:s.range.map(({range:h,entry:v})=>({range:h.slice(),entry:ie(v,f)}))}}function ir(s,f,p,h){let v=f[h],x=s[v];if(!x)return;let S=x.lookup;if(x.reverse){let k=qo(x.reverse,f,p);(!S&&k||k&&S&&(S.index>k.index||S.index===k.index&&S.subIndex>k.subIndex))&&(S=k)}if(++h>=f.length||!x.forward)return S;let L=ir(x.forward,f,p,h);return(!S&&L||L&&S&&(S.index>L.index||S.index===L.index&&S.subIndex>L.subIndex))&&(S=L),S}function qo(s,f,p){let h=s[f[--p]],v=h&&h.lookup;for(;h&&((!v&&h.lookup||h.lookup&&v&&v.index>h.lookup.index)&&(v=h.lookup),!(--p<0||!h.reverse));)h=h.reverse[f[p]];return v}function Ir(s,f,p){let h=!1;for(let v=0;v<s.length;v++){let x=s[v];if(h){if(p<=x[0])return s[v-1][1]=p,s;if(p<=x[1])return s[v-1][1]=Math.max(p,x[1]),s.splice(v,1),h=!1,s;s.splice(v,1),v--}else{if(p<=x[0])return s.splice(v,0,[f,p]),s;if(p<=x[1])return x[0]=Math.min(f,x[0]),s;if(f<x[1])x[0]=Math.min(f,x[0]),h=!0;else continue}}return h?s[s.length-1][1]=p:s.push([f,p]),s}function it(s,f){switch(s.format){case 1:let p=s.glyphs.indexOf(f);return p!==-1?p:null;case 2:let h=s.ranges.find(v=>v.start<=f&&v.end>=f);return h?h.index:null}}function ce(s){switch(s.format){case 1:return s.glyphs.map((p,h)=>({glyphId:p,index:h}));case 2:let f=[];for(let[p,h]of s.ranges.entries())h.end===h.start?f.push({glyphId:h.start,index:p}):f.push({glyphId:[h.start,h.end+1],index:p});return f}}function qn(s,f){let p=f[0],h=Cr(s,p),v=f[0]+1,x=new Map;for(;v<f[1];)Cr(s,v)!==h&&(v-p<=1?x.set(p,h):x.set([p,v],h)),v++;return v-p<=1?x.set(p,h):x.set([p,v],h),x}function Cr(s,f){let p=it(s.coverage,f);if(p===null)return null;switch(s.substFormat){case 1:return(f+s.deltaGlyphId)%2**16;case 2:return s.substitute[p]??null}}function Qe(s,f,p,h,v){let x=[];for(let S of p){S.entry.forward={individual:{},range:[]};for(let L of s)x.push(...Ne(S.entry.forward,h,v,f,L).map(({entry:k,substitution:D})=>({entry:k,substitutions:[...S.substitutions,D]})))}return x}function Re(s,f){let p=[],h=new Set;for(let v of f){if(h.has(v.entry))continue;h.add(v.entry),v.entry.forward??={individual:{},range:[]};let x={};for(let S of s)Array.isArray(S)?v.entry.forward.range.push({entry:x,range:S}):v.entry.forward.individual[S]=x;p.push({entry:x,substitutions:v.substitutions})}return p}function De(s,f){let p=[],h=new Set;for(let v of f){if(h.has(v.entry))continue;h.add(v.entry),v.entry.reverse??={individual:{},range:[]};let x={};for(let S of s)Array.isArray(S)?v.entry.reverse.range.push({entry:x,range:S}):v.entry.reverse.individual[S]=x;p.push({entry:x,substitutions:v.substitutions})}return p}function Ne(s,f,p,h,v){let x=[];if(!Array.isArray(v))s.individual[v]={},x.push({entry:s.individual[v],substitution:Yo(f,p,h,v)});else{let S=Xo(f,p,h,v);for(let[L,k]of S){let D={};Array.isArray(L)?s.range.push({range:L,entry:D}):s.individual[L]={},x.push({entry:D,substitution:k})}}return x}function Xo(s,f,p,h){for(let v of s.filter(x=>x.sequenceIndex===p))for(let x of f[v.lookupListIndex].subtables){let S=qn(x,h);if(!Array.from(S.values()).every(L=>L!==null))return S}return new Map([[h,null]])}function Yo(s,f,p,h){for(let v of s.filter(x=>x.sequenceIndex===p))for(let x of f[v.lookupListIndex].subtables){let S=Cr(x,h);if(S!==null)return S}return null}function st(s,f,p){let h={individual:{},range:[]},v=ce(s.coverage);for(let{glyphId:x,index:S}of v){let L=s.chainRuleSets[S];if(L)for(let[k,D]of L.entries()){let V=Ne(h,D.lookupRecords,f,0,x).map(({entry:N,substitution:W})=>({entry:N,substitutions:[W]}));for(let[N,W]of D.input.entries())V=Qe([W],N+1,V,D.lookupRecords,f);for(let N of D.lookahead)V=Re([N],V);for(let N of D.backtrack)V=De([N],V);for(let{entry:N,substitutions:W}of V)N.lookup={substitutions:W,length:D.input.length+1,index:p,subIndex:k,contextRange:[-1*D.backtrack.length,1+D.input.length+D.lookahead.length]}}}return h}function ut(s,f){switch(s.format){case 2:return Array.isArray(f)?Zo(s,f):new Map([[f,ot(s,f)]]);default:return new Map([[f,null]])}}function Zo(s,f){let p=f[0],h=ot(s,p),v=f[0]+1,x=new Map;for(;v<f[1];)ot(s,v)!==h&&(v-p<=1?x.set(p,h):x.set([p,v],h)),v++;return v-p<=1?x.set(p,h):x.set([p,v],h),x}function ot(s,f){for(let p of s.ranges)if(p.start<=f&&p.end>=f)return p.classId;return null}function wr(s,f){switch(s.format){case 2:let p=[];for(let h of s.ranges)h.classId===f&&(h.end===h.start?p.push(h.start):p.push([h.start,h.end+1]));return p;default:return[]}}function lt(s,f,p){let h=[],v=ce(s.coverage);for(let{glyphId:x}of v){let S=ut(s.inputClassDef,x);for(let[L,k]of S.entries()){if(k===null)continue;let D=s.chainClassSet[k];if(D)for(let[V,N]of D.entries()){let W={individual:{},range:[]},X=Ne(W,N.lookupRecords,f,0,L).map(({entry:ve,substitution:Ae})=>({entry:ve,substitutions:[Ae]}));for(let[ve,Ae]of N.input.entries())X=Qe(wr(s.inputClassDef,Ae),ve+1,X,N.lookupRecords,f);for(let ve of N.lookahead)X=Re(wr(s.lookaheadClassDef,ve),X);for(let ve of N.backtrack)X=De(wr(s.backtrackClassDef,ve),X);for(let{entry:ve,substitutions:Ae}of X)ve.lookup={substitutions:Ae,index:p,subIndex:V,length:N.input.length+1,contextRange:[-1*N.backtrack.length,1+N.input.length+N.lookahead.length]};h.push(W)}}}return ar(h)}function ft(s,f,p){let h={individual:{},range:[]},v=ce(s.inputCoverage[0]);for(let{glyphId:x}of v){let S=Ne(h,s.lookupRecords,f,0,x).map(({entry:L,substitution:k})=>({entry:L,substitutions:[k]}));for(let[L,k]of s.inputCoverage.slice(1).entries())S=Qe(ce(k).map(D=>D.glyphId),L+1,S,s.lookupRecords,f);for(let L of s.lookaheadCoverage)S=Re(ce(L).map(k=>k.glyphId),S);for(let L of s.backtrackCoverage)S=De(ce(L).map(k=>k.glyphId),S);for(let{entry:L,substitutions:k}of S)L.lookup={substitutions:k,index:p,subIndex:0,length:s.inputCoverage.length,contextRange:[-1*s.backtrackCoverage.length,s.inputCoverage.length+s.lookaheadCoverage.length]}}return h}function pt(s,f){let p={individual:{},range:[]},h=ce(s.coverage);for(let{glyphId:v,index:x}of h){let S={};Array.isArray(v)?p.range.push({entry:S,range:v}):p.individual[v]=S;let L=[{entry:S,substitutions:[s.substitutes[x]]}];for(let k of s.lookaheadCoverage)L=Re(ce(k).map(D=>D.glyphId),L);for(let k of s.backtrackCoverage)L=De(ce(k).map(D=>D.glyphId),L);for(let{entry:k,substitutions:D}of L)k.lookup={substitutions:D,index:f,subIndex:0,length:1,contextRange:[-1*s.backtrackCoverage.length,1+s.lookaheadCoverage.length]}}return p}function sr(s,f=new Map){let p={};for(let[h,v]of Object.entries(s.individual))p[h]=Xn(v,f);for(let{range:h,entry:v}of s.range){let x=Xn(v,f);for(let S=h[0];S<h[1];S++)p[S]=x}return p}function Xn(s,f){if(f.has(s))return f.get(s);let p={};return f.set(s,p),s.forward&&(p.forward=sr(s.forward,f)),s.reverse&&(p.reverse=sr(s.reverse,f)),s.lookup&&(p.lookup=s.lookup),p}var $o=ra(),gt=class{constructor(f,p){this._lookupTrees=[];this._glyphLookups={};this._font=f,p.cacheSize>0&&(this._cache=new $o({max:p.cacheSize,length:((L,k)=>k.length)}));let v=(this._font.tables.gsub&&this._font.tables.gsub.features.filter(L=>L.tag==="calt")||[]).reduce((L,k)=>[...L,...k.feature.lookupListIndexes],[]),x=this._font.tables.gsub&&this._font.tables.gsub.lookups||[],S=x.filter((L,k)=>v.some(D=>D===k));for(let[L,k]of S.entries()){let D=[];switch(k.lookupType){case 6:for(let[N,W]of k.subtables.entries())switch(W.substFormat){case 1:D.push(st(W,x,N));break;case 2:D.push(lt(W,x,N));break;case 3:D.push(ft(W,x,N));break}break;case 8:for(let[N,W]of k.subtables.entries())D.push(pt(W,N));break}let V=sr(ar(D));this._lookupTrees.push({tree:V,processForward:k.lookupType!==8});for(let N of Object.keys(V))this._glyphLookups[N]||(this._glyphLookups[N]=[]),this._glyphLookups[N].push(L)}}findLigatures(f){let p=this._cache&&this._cache.get(f);if(p&&!Array.isArray(p))return p;let h=[];for(let S of f)h.push(this._font.charToGlyphIndex(S));if(this._lookupTrees.length===0)return{inputGlyphs:h,outputGlyphs:h,contextRanges:[]};let v=this._findInternal(h.slice()),x={inputGlyphs:h,outputGlyphs:v.sequence,contextRanges:v.ranges};return this._cache&&this._cache.set(f,x),x}findLigatureRanges(f){if(this._lookupTrees.length===0)return[];let p=this._cache&&this._cache.get(f);if(p)return Array.isArray(p)?p:p.contextRanges;let h=[];for(let x of f)h.push(this._font.charToGlyphIndex(x));let v=this._findInternal(h);return this._cache&&this._cache.set(f,v.ranges),v.ranges}_findInternal(f){let p=[],h=this._getNextLookup(f,0);for(;h.index!==null;){let v=this._lookupTrees[h.index];if(v.processForward){let x=h.last;for(let S=h.first;S<x;S++){let L=ir(v.tree,f,S,S);if(L){for(let k=0;k<L.substitutions.length;k++){let D=L.substitutions[k];D!==null&&(f[S+k]=D)}Ir(p,L.contextRange[0]+S,L.contextRange[1]+S),S+L.length>=x&&(x=S+L.length+1),S+=L.length-1}}}else for(let x=h.last-1;x>=h.first;x--){let S=ir(v.tree,f,x,x);if(S){for(let L=0;L<S.substitutions.length;L++){let k=S.substitutions[L];k!==null&&(f[x+L]=k)}Ir(p,S.contextRange[0]+x,S.contextRange[1]+x),x-=S.length-1}}h=this._getNextLookup(f,h.index+1)}return{sequence:f,ranges:p}}_getNextLookup(f,p){let h={index:null,first:1/0,last:-1};for(let v=0;v<f.length;v++){let x=this._glyphLookups[f[v]];if(x)for(let S=0;S<x.length;S++){let L=x[S];if(L>=p){(h.index===null||L<=h.index)&&(h.index=L,h.first>v&&(h.first=v),h.last=v+1);break}}}return h}};function na(s,f){let p=ta.parse(s);return new gt(p,{cacheSize:0,...f})}function yt(s){if(typeof s!="string")throw new Error("Font family must be a string");let f={input:s,offset:0},p=[],h="";for(;f.offset<f.input.length;){let v=f.input[f.offset++];switch(v){case"'":case'"':h+=eu(f,v);break;case",":p.push(h),h="";break;default:/\s/.test(v)||(f.offset--,h+=ru(f),p.push(h),h="")}}return p}function eu(s,f){let p="",h=!1;for(;s.offset<s.input.length;){let v=s.input[s.offset++];if(h)/[\dA-Fa-f]/.test(v)?(s.offset--,p+=aa(s)):v!==`
18
- `&&(p+=v),h=!1;else switch(v){case f:return p;case"\\":h=!0;break;default:p+=v}}throw new Error("Unterminated string")}function ru(s){let f="",p=!1;for(;s.offset<s.input.length;){let h=s.input[s.offset++];if(p)/[\dA-Fa-f]/.test(h)?(s.offset--,f+=aa(s)):f+=h,p=!1;else switch(h){case"\\":p=!0;break;case",":return f;default:/\s/.test(h)?f.endsWith(" ")||(f+=" "):f+=h}}return f}function aa(s){let f="";for(;s.offset<s.input.length;){let p=s.input[s.offset++];if(/\s/.test(p))return mt(f);if(f.length>=6||!/[\dA-Fa-f]/.test(p))return s.offset--,mt(f);f+=p}return mt(f)}function mt(s){return String.fromCodePoint(parseInt(s,16))}var lr;async function bt(s,f){if(!lr){if(typeof navigator<"u"&&"fonts"in navigator){try{let v=await navigator.permissions.request?.({name:"local-fonts"});if(v&&v.state!=="granted")throw new Error("Permission to access local fonts not granted.")}catch(v){if(v instanceof Error&&v.name!=="TypeError")throw v}let h={};try{let v=await navigator.fonts.query();for(let x of v)h.hasOwnProperty(x.family)||(h[x.family]=[]),h[x.family].push(x);lr=Promise.resolve(h)}catch(v){v instanceof Error&&console.error(v.name,v.message)}}else if(typeof window<"u"&&"queryLocalFonts"in window){let h={};try{let v=await window.queryLocalFonts();for(let x of v)h.hasOwnProperty(x.family)||(h[x.family]=[]),h[x.family].push(x);lr=Promise.resolve(h)}catch(v){v instanceof Error&&console.error(v.name,v.message)}}lr??=Promise.resolve({})}let p=await lr;for(let h of yt(s)){if(tu.includes(h))return;if(p.hasOwnProperty(h)&&p[h].length>0){let v=p[h][0];if("blob"in v){let S=await(await v.blob()).arrayBuffer();return na(S,{cacheSize:f})}return}}}var tu=["serif","sans-serif","cursive","fantasy","monospace","system-ui","emoji","math","fangsong"];var nu=1e5;function ia(s,f=[]){let p,h,v=0,x;return s.registerCharacterJoiner(S=>{let L=s.options.fontFamily;if(L&&(v===0||p!==L)){h=void 0,v=1,p=L;let k=p;bt(k,nu).then(D=>{k===s.options.fontFamily&&(v=2,h=D,D&&s.refresh(0,s.rows-1))}).catch(D=>{k===s.options.fontFamily&&(v=3,s.options.logLevel==="debug"&&console.debug(x,new Error("Failure while loading font")),h=void 0,x=D)})}return h&&v===2?h.findLigatureRanges(S).map(k=>[k[0],k[1]]):au(S,f)})}function au(s,f){let p=[];for(let h=0;h<s.length;h++)for(let v=0;v<f.length;v++)if(s.startsWith(f[v],h)){p.push([h,h+f[v].length]),h+=f[v].length-1;break}return p}var sa=class{constructor(f){this._fallbackLigatures=(f?.fallbackLigatures??["<--","<---","<<-","<-","->","->>","-->","--->","<==","<===","<<=","<=","=>","=>>","==>","===>",">=",">>=","<->","<-->","<--->","<---->","<=>","<==>","<===>","<====>","::",":::","<~~","</","</>","/>","~~>","==","!=","/=","~=","<>","===","!==","!===","<:",":=","*=","*+","<*","<*>","*>","<|","<|>","|>","+*","=*","=:",":>","/*","*/","+++","<!--","<!---"]).sort((p,h)=>h.length-p.length),this._fontFeatureSettings=f?.fontFeatureSettings}activate(f){if(!f.element)throw new Error("Cannot activate LigaturesAddon before open is called");this._terminal=f,this._characterJoinerId=ia(f,this._fallbackLigatures),f.element.style.fontFeatureSettings=this._fontFeatureSettings??'"calt" on'}dispose(){this._characterJoinerId!==void 0&&(this._terminal?.deregisterCharacterJoiner(this._characterJoinerId),this._characterJoinerId=void 0),this._terminal?.element&&(this._terminal.element.style.fontFeatureSettings="")}};export{sa as LigaturesAddon};
17
+ var Bp=Object.create;var ir=Object.defineProperty;var _p=Object.getOwnPropertyDescriptor;var Gp=Object.getOwnPropertyNames;var Hp=Object.getPrototypeOf,Vp=Object.prototype.hasOwnProperty;var ki=g=>{throw TypeError(g)};var zp=(g,f,p)=>f in g?ir(g,f,{enumerable:!0,configurable:!0,writable:!0,value:p}):g[f]=p;var jp=(g,f)=>()=>(f||g((f={exports:{}}).exports,f),f.exports);var Wp=(g,f,p,h)=>{if(f&&typeof f=="object"||typeof f=="function")for(let y of Gp(f))!Vp.call(g,y)&&y!==p&&ir(g,y,{get:()=>f[y],enumerable:!(h=_p(f,y))||h.enumerable});return g};var qp=(g,f,p)=>(p=g!=null?Bp(Hp(g)):{},Wp(f||!g||!g.__esModule?ir(p,"default",{value:g,enumerable:!0}):p,g));var ye=(g,f,p)=>zp(g,typeof f!="symbol"?f+"":f,p),ar=(g,f,p)=>f.has(g)||ki("Cannot "+p);var b=(g,f,p)=>(ar(g,f,"read from private field"),p?p.call(g):f.get(g)),K=(g,f,p)=>f.has(g)?ki("Cannot add the same private member more than once"):f instanceof WeakSet?f.add(g):f.set(g,p),V=(g,f,p,h)=>(ar(g,f,"write to private field"),h?h.call(g,p):f.set(g,p),p),R=(g,f,p)=>(ar(g,f,"access private method"),p);var vs=(g,f,p,h)=>({set _(y){V(g,f,y,p)},get _(){return b(g,f,h)}});var Oi=jp((Ci,xs)=>{var Ti=(()=>{var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,y=(e,t)=>{for(var n in t)g(e,n,{get:t[n],enumerable:!0})},k=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of p(t))!h.call(e,r)&&r!==n&&g(e,r,{get:()=>t[r],enumerable:!(s=f(t,r))||s.enumerable});return e},T=e=>k(g({},"__esModule",{value:!0}),e),O={};y(O,{BoundingBox:()=>ws,Font:()=>yi,Glyph:()=>fn,Path:()=>Wt,_parse:()=>F,load:()=>Mp,loadSync:()=>Pp,parse:()=>Up});var w=0,E=-3;function j(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function H(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new j,this.dtree=new j}var Q=new j,X=new j,fe=new Uint8Array(30),J=new Uint16Array(30),Se=new Uint8Array(30),$=new Uint16Array(30),ee=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ne=new j,se=new Uint8Array(320);function pe(e,t,n,s){var r,o;for(r=0;r<n;++r)e[r]=0;for(r=0;r<30-n;++r)e[r+n]=r/n|0;for(o=s,r=0;r<30;++r)t[r]=o,o+=1<<e[r]}function Vt(e,t){var n;for(n=0;n<7;++n)e.table[n]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,n=0;n<24;++n)e.trans[n]=256+n;for(n=0;n<144;++n)e.trans[24+n]=n;for(n=0;n<8;++n)e.trans[168+n]=280+n;for(n=0;n<112;++n)e.trans[176+n]=144+n;for(n=0;n<5;++n)t.table[n]=0;for(t.table[5]=32,n=0;n<32;++n)t.trans[n]=n}var St=new Uint16Array(16);function It(e,t,n,s){var r,o;for(r=0;r<16;++r)e.table[r]=0;for(r=0;r<s;++r)e.table[t[n+r]]++;for(e.table[0]=0,o=0,r=0;r<16;++r)St[r]=o,o+=e.table[r];for(r=0;r<s;++r)t[n+r]&&(e.trans[St[t[n+r]]++]=r)}function wt(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=e.tag&1;return e.tag>>>=1,t}function Be(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var s=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,s+n}function zt(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=0,s=0,r=0,o=e.tag;do s=2*s+(o&1),o>>>=1,++r,n+=t.table[r],s-=t.table[r];while(s>=0);return e.tag=o,e.bitcount-=r,t.trans[n+s]}function Wi(e,t,n){var s,r,o,i,a,l;for(s=Be(e,5,257),r=Be(e,5,1),o=Be(e,4,4),i=0;i<19;++i)se[i]=0;for(i=0;i<o;++i){var c=Be(e,3,0);se[ee[i]]=c}for(It(ne,se,0,19),a=0;a<s+r;){var u=zt(e,ne);switch(u){case 16:var m=se[a-1];for(l=Be(e,2,3);l;--l)se[a++]=m;break;case 17:for(l=Be(e,3,3);l;--l)se[a++]=0;break;case 18:for(l=Be(e,7,11);l;--l)se[a++]=0;break;default:se[a++]=u;break}}It(t,se,0,s),It(n,se,s,r)}function wr(e,t,n){for(;;){var s=zt(e,t);if(s===256)return w;if(s<256)e.dest[e.destLen++]=s;else{var r,o,i,a;for(s-=257,r=Be(e,fe[s],J[s]),o=zt(e,n),i=e.destLen-Be(e,Se[o],$[o]),a=i;a<i+r;++a)e.dest[e.destLen++]=e.dest[a]}}}function qi(e){for(var t,n,s;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if(t=e.source[e.sourceIndex+1],t=256*t+e.source[e.sourceIndex],n=e.source[e.sourceIndex+3],n=256*n+e.source[e.sourceIndex+2],t!==(~n&65535))return E;for(e.sourceIndex+=4,s=t;s;--s)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,w}function Er(e,t){var n=new H(e,t),s,r,o;do{switch(s=wt(n),r=Be(n,2,0),r){case 0:o=qi(n);break;case 1:o=wr(n,Q,X);break;case 2:Wi(n,n.ltree,n.dtree),o=wr(n,n.ltree,n.dtree);break;default:o=E}if(o!==w)throw new Error("Data error")}while(!s);return n.destLen<n.dest.length?typeof n.dest.slice=="function"?n.dest.slice(0,n.destLen):n.dest.subarray(0,n.destLen):n.dest}Vt(Q,X),pe(fe,J,4,3),pe(Se,$,2,1),fe[28]=0,J[28]=258;function on(e,t,n,s,r){return Math.pow(1-r,3)*e+3*Math.pow(1-r,2)*r*t+3*(1-r)*Math.pow(r,2)*n+Math.pow(r,3)*s}function jt(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}jt.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},jt.prototype.addPoint=function(e,t){typeof e=="number"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof t=="number"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},jt.prototype.addX=function(e){this.addPoint(e,null)},jt.prototype.addY=function(e){this.addPoint(null,e)},jt.prototype.addBezier=function(e,t,n,s,r,o,i,a){let l=[e,t],c=[n,s],u=[r,o],m=[i,a];this.addPoint(e,t),this.addPoint(i,a);for(let d=0;d<=1;d++){let x=6*l[d]-12*c[d]+6*u[d],v=-3*l[d]+9*c[d]-9*u[d]+3*m[d],S=3*c[d]-3*l[d];if(v===0){if(x===0)continue;let z=-S/x;0<z&&z<1&&(d===0&&this.addX(on(l[d],c[d],u[d],m[d],z)),d===1&&this.addY(on(l[d],c[d],u[d],m[d],z)));continue}let I=Math.pow(x,2)-4*S*v;if(I<0)continue;let _=(-x+Math.sqrt(I))/(2*v);0<_&&_<1&&(d===0&&this.addX(on(l[d],c[d],u[d],m[d],_)),d===1&&this.addY(on(l[d],c[d],u[d],m[d],_)));let P=(-x-Math.sqrt(I))/(2*v);0<P&&P<1&&(d===0&&this.addX(on(l[d],c[d],u[d],m[d],P)),d===1&&this.addY(on(l[d],c[d],u[d],m[d],P)))}},jt.prototype.addQuad=function(e,t,n,s,r,o){let i=e+.6666666666666666*(n-e),a=t+2/3*(s-t),l=i+1/3*(r-e),c=a+1/3*(o-t);this.addBezier(e,t,i,a,l,c,r,o)};var ws=jt;function ve(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}var In={};function Lr(e,t){let n=Math.floor(e),s=e-n;if(In[t]||(In[t]={}),In[t][s]!==void 0){let o=In[t][s];return n+o}let r=+(Math.round(s+"e+"+t)+"e-"+t);return In[t][s]=r,n+r}function Ar(e){let t=[[]],n=0,s=0;for(let r=0;r<e.length;r+=1){let o=t[t.length-1],i=e[r],a=o[0],l=o[1],c=o[o.length-1],u=e[r+1];o.push(i),i.type==="M"?(n=i.x,s=i.y):i.type==="L"&&(!u||u.type==="Z")?Math.abs(i.x-n)>1||Math.abs(i.y-s)>1||o.pop():i.type==="L"&&c&&c.x===i.x&&c.y===i.y?o.pop():i.type==="Z"&&(a&&l&&c&&a.type==="M"&&l.type==="L"&&c.type==="L"&&c.x===a.x&&c.y===a.y&&(o.shift(),o[0].type="M"),r+1<e.length&&t.push([]))}return e=[].concat.apply([],t),e}function $i(e){return Object.assign({},{decimalPlaces:2,optimize:!0,flipY:!0,flipYBase:void 0,scale:1,x:0,y:0},e)}function Xi(e){return parseInt(e)===e&&(e={decimalPlaces:e,flipY:!1}),Object.assign({},{decimalPlaces:2,optimize:!0,flipY:!0,flipYBase:void 0},e)}ve.prototype.fromSVG=function(e,t={}){typeof SVGPathElement<"u"&&e instanceof SVGPathElement&&(e=e.getAttribute("d")),t=$i(t),this.commands=[];let n="0123456789",s="MmLlQqCcZzHhVv",r="SsTtAa",o="-+",i={},a=[""],l=!1;function c(v){return v.filter(S=>S.length).map(S=>{let I=parseFloat(S);return(t.decimalPlaces||t.decimalPlaces===0)&&(I=Lr(I,t.decimalPlaces)),I})}function u(v){if(!this.commands.length)return v;let S=this.commands[this.commands.length-1];for(let I=0;I<v.length;I++)v[I]+=S[I&1?"y":"x"];return v}function m(){if(i.type===void 0)return;let v=i.type.toUpperCase(),S=v!=="Z"&&i.type.toUpperCase()!==i.type,I=c(a);if(a=[""],!I.length&&v!=="Z")return;S&&v!=="H"&&v!=="V"&&(I=u.apply(this,[I]));let _=this.commands.length&&this.commands[this.commands.length-1].x||0,P=this.commands.length&&this.commands[this.commands.length-1].y||0;switch(v){case"M":this.moveTo(...I);break;case"L":this.lineTo(...I);break;case"V":for(let z=0;z<I.length;z++){let Y=0;S&&(Y=this.commands.length&&this.commands[this.commands.length-1].y||0),this.lineTo(_,I[z]+Y)}break;case"H":for(let z=0;z<I.length;z++){let Y=0;S&&(Y=this.commands.length&&this.commands[this.commands.length-1].x||0),this.lineTo(I[z]+Y,P)}break;case"C":this.bezierCurveTo(...I);break;case"Q":this.quadraticCurveTo(...I);break;case"Z":(this.commands.length<1||this.commands[this.commands.length-1].type!=="Z")&&this.close();break}if(this.commands.length)for(let z in this.commands[this.commands.length-1])this.commands[this.commands.length-1][z]===void 0&&(this.commands[this.commands.length-1][z]=0)}for(let v=0;v<e.length;v++){let S=e.charAt(v),I=a[a.length-1];if(n.indexOf(S)>-1)a[a.length-1]+=S;else if(o.indexOf(S)>-1)if(!i.type&&!this.commands.length&&(i.type="L"),S==="-")!i.type||I.indexOf("-")>0?l=!0:I.length?a.push("-"):a[a.length-1]=S;else if(!i.type||I.length>0)l=!0;else continue;else if(s.indexOf(S)>-1)i.type?(m.apply(this),i={type:S}):i.type=S;else{if(r.indexOf(S)>-1)throw new Error("Unsupported path command: "+S+". Currently supported commands are "+s.split("").join(", ")+".");` ,
18
+ \r\f\v`.indexOf(S)>-1?a.push(""):S==="."?!i.type||I.indexOf(S)>-1?l=!0:a[a.length-1]+=S:l=!0}if(l)throw new Error("Unexpected character: "+S+" at offset "+v)}m.apply(this),t.optimize&&(this.commands=Ar(this.commands));let d=t.flipY,x=t.flipYBase;if(d===!0&&t.flipYBase===void 0){let v=this.getBoundingBox();x=v.y1+v.y2}for(let v in this.commands){let S=this.commands[v];for(let I in S)["x","x1","x2"].includes(I)?this.commands[v][I]=t.x+S[I]*t.scale:["y","y1","y2"].includes(I)&&(this.commands[v][I]=t.y+(d?x-S[I]:S[I])*t.scale)}return this},ve.fromSVG=function(e,t){return new ve().fromSVG(e,t)},ve.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},ve.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},ve.prototype.curveTo=ve.prototype.bezierCurveTo=function(e,t,n,s,r,o){this.commands.push({type:"C",x1:e,y1:t,x2:n,y2:s,x:r,y:o})},ve.prototype.quadTo=ve.prototype.quadraticCurveTo=function(e,t,n,s){this.commands.push({type:"Q",x1:e,y1:t,x:n,y:s})},ve.prototype.close=ve.prototype.closePath=function(){this.commands.push({type:"Z"})},ve.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof ws){let t=e;this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),this.close();return}Array.prototype.push.apply(this.commands,e)},ve.prototype.getBoundingBox=function(){let e=new ws,t=0,n=0,s=0,r=0;for(let o=0;o<this.commands.length;o++){let i=this.commands[o];switch(i.type){case"M":e.addPoint(i.x,i.y),t=s=i.x,n=r=i.y;break;case"L":e.addPoint(i.x,i.y),s=i.x,r=i.y;break;case"Q":e.addQuad(s,r,i.x1,i.y1,i.x,i.y),s=i.x,r=i.y;break;case"C":e.addBezier(s,r,i.x1,i.y1,i.x2,i.y2,i.x,i.y),s=i.x,r=i.y;break;case"Z":s=t,r=n;break;default:throw new Error("Unexpected path command "+i.type)}}return e.isEmpty()&&e.addPoint(0,0),e},ve.prototype.draw=function(e){let t=this._layers;if(t&&t.length){for(let s=0;s<t.length;s++)this.draw.call(t[s],e);return}let n=this._image;if(n){e.drawImage(n.image,n.x,n.y,n.width,n.height);return}e.beginPath();for(let s=0;s<this.commands.length;s+=1){let r=this.commands[s];r.type==="M"?e.moveTo(r.x,r.y):r.type==="L"?e.lineTo(r.x,r.y):r.type==="C"?e.bezierCurveTo(r.x1,r.y1,r.x2,r.y2,r.x,r.y):r.type==="Q"?e.quadraticCurveTo(r.x1,r.y1,r.x,r.y):r.type==="Z"&&this.stroke&&this.strokeWidth&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},ve.prototype.toPathData=function(e){e=Xi(e);function t(a){let l=Lr(a,e.decimalPlaces);return Math.round(a)===l?""+l:l.toFixed(e.decimalPlaces)}function n(){let a="";for(let l=0;l<arguments.length;l+=1){let c=arguments[l];c>=0&&l>0&&(a+=" "),a+=t(c)}return a}let s=this.commands;e.optimize&&(s=JSON.parse(JSON.stringify(this.commands)),s=Ar(s));let r=e.flipY,o=e.flipYBase;if(r===!0&&o===void 0){let a=new ve;a.extend(s);let l=a.getBoundingBox();o=l.y1+l.y2}let i="";for(let a=0;a<s.length;a+=1){let l=s[a];l.type==="M"?i+="M"+n(l.x,r?o-l.y:l.y):l.type==="L"?i+="L"+n(l.x,r?o-l.y:l.y):l.type==="C"?i+="C"+n(l.x1,r?o-l.y1:l.y1,l.x2,r?o-l.y2:l.y2,l.x,r?o-l.y:l.y):l.type==="Q"?i+="Q"+n(l.x1,r?o-l.y1:l.y1,l.x,r?o-l.y:l.y):l.type==="Z"&&(i+="Z")}return i},ve.prototype.toSVG=function(e,t){this._layers&&this._layers.length&&console.warn("toSVG() does not support colr font layers yet"),this._image&&console.warn("toSVG() does not support SVG glyphs yet"),t||(t=this.toPathData(e));let n='<path d="';return n+=t,n+='"',this.fill!==void 0&&this.fill!=="black"&&(this.fill===null?n+=' fill="none"':n+=' fill="'+this.fill+'"'),this.stroke&&(n+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),n+="/>",n},ve.prototype.toDOMElement=function(e,t){this._layers&&this._layers.length&&console.warn("toDOMElement() does not support colr font layers yet"),t||(t=this.toPathData(e));let n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",t),this.fill!==void 0&&this.fill!=="black"&&(this.fill===null?n.setAttribute("fill","none"):n.setAttribute("fill",this.fill)),this.stroke&&(n.setAttribute("stroke",this.stroke),n.setAttribute("stroke-width",this.strokeWidth)),n};var Wt=ve;function Rr(e){throw new Error(e)}function Dr(e,t){e||Rr(t)}var B={fail:Rr,argument:Dr,assert:Dr},Fr=32768,Ur=2147483648,Yi=-32768,Zi=32767+1/65536,an={},D={},W={};function tt(e){return function(){return e}}D.BYTE=function(e){return B.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]},W.BYTE=tt(1),D.CHAR=function(e){return[e.charCodeAt(0)]},W.CHAR=tt(1),D.CHARARRAY=function(e){(e===null||typeof e>"u")&&(e="",console.warn("CHARARRAY with undefined or null value encountered and treated as an empty string. This is probably caused by a missing glyph name."));let t=[];for(let n=0;n<e.length;n+=1)t[n]=e.charCodeAt(n);return t},W.CHARARRAY=function(e){return typeof e>"u"?0:e.length},D.USHORT=function(e){return[e>>8&255,e&255]},W.USHORT=tt(2),D.SHORT=function(e){return e>=Fr&&(e=-(2*Fr-e)),[e>>8&255,e&255]},W.SHORT=tt(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,e&255]},W.UINT24=tt(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]},W.ULONG=tt(4),D.LONG=function(e){return e>=Ur&&(e=-(2*Ur-e)),[e>>24&255,e>>16&255,e>>8&255,e&255]},W.LONG=tt(4),D.FLOAT=function(e){if(e>Zi||e<Yi)throw new Error(`Value ${e} is outside the range of representable values in 16.16 format`);let t=Math.round(e*65536)<<0;return D.ULONG(t)},W.FLOAT=W.ULONG,D.FIXED=D.ULONG,W.FIXED=W.ULONG,D.FWORD=D.SHORT,W.FWORD=W.SHORT,D.UFWORD=D.USHORT,W.UFWORD=W.USHORT,D.F2DOT14=function(e){return D.USHORT(e*16384)},W.F2DOT14=W.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,e&255]},W.LONGDATETIME=tt(8),D.TAG=function(e){return B.argument(e.length===4,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},W.TAG=tt(4),D.Card8=D.BYTE,W.Card8=W.BYTE,D.Card16=D.USHORT,W.Card16=W.USHORT,D.OffSize=D.BYTE,W.OffSize=W.BYTE,D.SID=D.USHORT,W.SID=W.USHORT,D.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?(e=e-108,[(e>>8)+247,e&255]):e>=-1131&&e<=-108?(e=-e-108,[(e>>8)+251,e&255]):e>=-32768&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},W.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,e&255]},W.NUMBER16=tt(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,e&255]},W.NUMBER32=tt(5),D.REAL=function(e){let t=e.toString(),n=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(n){let o=parseFloat("1e"+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*o)/o).toString()}let s="";for(let o=0,i=t.length;o<i;o+=1){let a=t[o];a==="e"?s+=t[++o]==="-"?"c":"b":a==="."?s+="a":a==="-"?s+="e":s+=a}s+=s.length&1?"f":"ff";let r=[30];for(let o=0,i=s.length;o<i;o+=2)r.push(parseInt(s.substr(o,2),16));return r},W.REAL=function(e){return D.REAL(e).length},D.NAME=D.CHARARRAY,W.NAME=W.CHARARRAY,D.STRING=D.CHARARRAY,W.STRING=W.CHARARRAY,an.UTF8=function(e,t,n){let s=[],r=n;for(let o=0;o<r;o++,t+=1)s[o]=e.getUint8(t);return String.fromCharCode.apply(null,s)},an.UTF16=function(e,t,n){let s=[],r=n/2;for(let o=0;o<r;o++,t+=2)s[o]=e.getUint16(t);return String.fromCharCode.apply(null,s)},D.UTF16=function(e){let t=[];for(let n=0;n<e.length;n+=1){let s=e.charCodeAt(n);t[t.length]=s>>8&255,t[t.length]=s&255}return t},W.UTF16=function(e){return e.length*2};var jn={"x-mac-croatian":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\u0160\u2122\xB4\xA8\u2260\u017D\xD8\u221E\xB1\u2264\u2265\u2206\xB5\u2202\u2211\u220F\u0161\u222B\xAA\xBA\u03A9\u017E\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u0106\xAB\u010C\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u0110\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\uF8FF\xA9\u2044\u20AC\u2039\u203A\xC6\xBB\u2013\xB7\u201A\u201E\u2030\xC2\u0107\xC1\u010D\xC8\xCD\xCE\xCF\xCC\xD3\xD4\u0111\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u03C0\xCB\u02DA\xB8\xCA\xE6\u02C7","x-mac-cyrillic":"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u2020\xB0\u0490\xA3\xA7\u2022\xB6\u0406\xAE\xA9\u2122\u0402\u0452\u2260\u0403\u0453\u221E\xB1\u2264\u2265\u0456\xB5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040A\u045A\u0458\u0405\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\u040B\u045B\u040C\u045C\u0455\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u201E\u040E\u045E\u040F\u045F\u2116\u0401\u0451\u044F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E","x-mac-gaelic":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u1E02\xB1\u2264\u2265\u1E03\u010A\u010B\u1E0A\u1E0B\u1E1E\u1E1F\u0120\u0121\u1E40\xE6\xF8\u1E41\u1E56\u1E57\u027C\u0192\u017F\u1E60\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\u1E61\u1E9B\xFF\u0178\u1E6A\u20AC\u2039\u203A\u0176\u0177\u1E6B\xB7\u1EF2\u1EF3\u204A\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\u2663\xD2\xDA\xDB\xD9\u0131\xDD\xFD\u0174\u0175\u1E84\u1E85\u1E80\u1E81\u1E82\u1E83","x-mac-greek":"\xC4\xB9\xB2\xC9\xB3\xD6\xDC\u0385\xE0\xE2\xE4\u0384\xA8\xE7\xE9\xE8\xEA\xEB\xA3\u2122\xEE\xEF\u2022\xBD\u2030\xF4\xF6\xA6\u20AC\xF9\xFB\xFC\u2020\u0393\u0394\u0398\u039B\u039E\u03A0\xDF\xAE\xA9\u03A3\u03AA\xA7\u2260\xB0\xB7\u0391\xB1\u2264\u2265\xA5\u0392\u0395\u0396\u0397\u0399\u039A\u039C\u03A6\u03AB\u03A8\u03A9\u03AC\u039D\xAC\u039F\u03A1\u2248\u03A4\xAB\xBB\u2026\xA0\u03A5\u03A7\u0386\u0388\u0153\u2013\u2015\u201C\u201D\u2018\u2019\xF7\u0389\u038A\u038C\u038E\u03AD\u03AE\u03AF\u03CC\u038F\u03CD\u03B1\u03B2\u03C8\u03B4\u03B5\u03C6\u03B3\u03B7\u03B9\u03BE\u03BA\u03BB\u03BC\u03BD\u03BF\u03C0\u03CE\u03C1\u03C3\u03C4\u03B8\u03C9\u03C2\u03C7\u03C5\u03B6\u03CA\u03CB\u0390\u03B0\xAD","x-mac-icelandic":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\xDD\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\xD0\xF0\xDE\xFE\xFD\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7","x-mac-inuit":"\u1403\u1404\u1405\u1406\u140A\u140B\u1431\u1432\u1433\u1434\u1438\u1439\u1449\u144E\u144F\u1450\u1451\u1455\u1456\u1466\u146D\u146E\u146F\u1470\u1472\u1473\u1483\u148B\u148C\u148D\u148E\u1490\u1491\xB0\u14A1\u14A5\u14A6\u2022\xB6\u14A7\xAE\xA9\u2122\u14A8\u14AA\u14AB\u14BB\u14C2\u14C3\u14C4\u14C5\u14C7\u14C8\u14D0\u14EF\u14F0\u14F1\u14F2\u14F4\u14F5\u1505\u14D5\u14D6\u14D7\u14D8\u14DA\u14DB\u14EA\u1528\u1529\u152A\u152B\u152D\u2026\xA0\u152E\u153E\u1555\u1556\u1557\u2013\u2014\u201C\u201D\u2018\u2019\u1558\u1559\u155A\u155D\u1546\u1547\u1548\u1549\u154B\u154C\u1550\u157F\u1580\u1581\u1582\u1583\u1584\u1585\u158F\u1590\u1591\u1592\u1593\u1594\u1595\u1671\u1672\u1673\u1674\u1675\u1676\u1596\u15A0\u15A1\u15A2\u15A3\u15A4\u15A5\u15A6\u157C\u0141\u0142","x-mac-ce":"\xC4\u0100\u0101\xC9\u0104\xD6\xDC\xE1\u0105\u010C\xE4\u010D\u0106\u0107\xE9\u0179\u017A\u010E\xED\u010F\u0112\u0113\u0116\xF3\u0117\xF4\xF6\xF5\xFA\u011A\u011B\xFC\u2020\xB0\u0118\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\u0119\xA8\u2260\u0123\u012E\u012F\u012A\u2264\u2265\u012B\u0136\u2202\u2211\u0142\u013B\u013C\u013D\u013E\u0139\u013A\u0145\u0146\u0143\xAC\u221A\u0144\u0147\u2206\xAB\xBB\u2026\xA0\u0148\u0150\xD5\u0151\u014C\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\u014D\u0154\u0155\u0158\u2039\u203A\u0159\u0156\u0157\u0160\u201A\u201E\u0161\u015A\u015B\xC1\u0164\u0165\xCD\u017D\u017E\u016A\xD3\xD4\u016B\u016E\xDA\u016F\u0170\u0171\u0172\u0173\xDD\xFD\u0137\u017B\u0141\u017C\u0122\u02C7",macintosh:"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\u2039\u203A\uFB01\uFB02\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7","x-mac-romanian":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\u0102\u0218\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\u0103\u0219\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\u2039\u203A\u021A\u021B\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7","x-mac-turkish":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u011E\u011F\u0130\u0131\u015E\u015F\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\uF8A0\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"};an.MACSTRING=function(e,t,n,s){let r=jn[s];if(r===void 0)return;let o="";for(let i=0;i<n;i++){let a=e.getUint8(t+i);a<=127?o+=String.fromCharCode(a):o+=r[a&127]}return o};var Wn=typeof WeakMap=="function"&&new WeakMap,qn,Ki=function(e){if(!qn){qn={};for(let r in jn)qn[r]=new String(r)}let t=qn[e];if(t===void 0)return;if(Wn){let r=Wn.get(t);if(r!==void 0)return r}let n=jn[e];if(n===void 0)return;let s={};for(let r=0;r<n.length;r++)s[n.charCodeAt(r)]=r+128;return Wn&&Wn.set(t,s),s};D.MACSTRING=function(e,t){let n=Ki(t);if(n===void 0)return;let s=[];for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o>=128&&(o=n[o],o===void 0))return;s[r]=o}return s},W.MACSTRING=function(e,t){let n=D.MACSTRING(e,t);return n!==void 0?n.length:0};function Es(e){return e>=-128&&e<=127}function Qi(e,t,n){let s=0,r=e.length;for(;t<r&&s<64&&e[t]===0;)++t,++s;return n.push(128|s-1),t}function Ji(e,t,n){let s=0,r=e.length,o=t;for(;o<r&&s<64;){let i=e[o];if(!Es(i)||i===0&&o+1<r&&e[o+1]===0)break;++o,++s}n.push(s-1);for(let i=t;i<o;++i)n.push(e[i]+256&255);return o}function ea(e,t,n){let s=0,r=e.length,o=t;for(;o<r&&s<64;){let i=e[o];if(i===0||Es(i)&&o+1<r&&Es(e[o+1]))break;++o,++s}n.push(64|s-1);for(let i=t;i<o;++i){let a=e[i];n.push(a+65536>>8&255,a+256&255)}return o}D.VARDELTAS=function(e){let t=0,n=[];for(;t<e.length;){let s=e[t];s===0?t=Qi(e,t,n):s>=-128&&s<=127?t=Ji(e,t,n):t=ea(e,t,n)}return n},D.INDEX=function(e){let t=1,n=[t],s=[];for(let a=0;a<e.length;a+=1){let l=D.OBJECT(e[a]);Array.prototype.push.apply(s,l),t+=l.length,n.push(t)}if(s.length===0)return[0,0];let r=[],o=1+Math.floor(Math.log(t)/Math.log(2))/8|0,i=[void 0,D.BYTE,D.USHORT,D.UINT24,D.ULONG][o];for(let a=0;a<n.length;a+=1){let l=i(n[a]);Array.prototype.push.apply(r,l)}return Array.prototype.concat(D.Card16(e.length),D.OffSize(o),r,s)},W.INDEX=function(e){return D.INDEX(e).length},D.DICT=function(e){let t=[],n=Object.keys(e),s=n.length;for(let r=0;r<s;r+=1){let o=parseInt(n[r],0),i=e[o],a=D.OPERAND(i.value,i.type),l=D.OPERATOR(o);for(let c=0;c<a.length;c++)t.push(a[c]);for(let c=0;c<l.length;c++)t.push(l[c])}return t},W.DICT=function(e){return D.DICT(e).length},D.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},D.OPERAND=function(e,t){let n=[];if(Array.isArray(t))for(let s=0;s<t.length;s+=1){B.argument(e.length===t.length,"Not enough arguments given for type"+t);let r=D.OPERAND(e[s],t[s]);for(let o=0;o<r.length;o++)n.push(r[o])}else if(t==="SID"){let s=D.NUMBER(e);for(let r=0;r<s.length;r++)n.push(s[r])}else if(t==="offset"){let s=D.NUMBER32(e);for(let r=0;r<s.length;r++)n.push(s[r])}else if(t==="number"){let s=D.NUMBER(e);for(let r=0;r<s.length;r++)n.push(s[r])}else if(t==="real"){let s=D.REAL(e);for(let r=0;r<s.length;r++)n.push(s[r])}else throw new Error("Unknown operand type "+t);return n},D.OP=D.BYTE,W.OP=W.BYTE;var $n=typeof WeakMap=="function"&&new WeakMap;D.CHARSTRING=function(e){if($n){let s=$n.get(e);if(s!==void 0)return s}let t=[],n=e.length;for(let s=0;s<n;s+=1){let r=e[s],o=D[r.type](r.value);for(let i=0;i<o.length;i++)t.push(o[i])}return $n&&$n.set(e,t),t},W.CHARSTRING=function(e){return D.CHARSTRING(e).length},D.OBJECT=function(e){let t=D[e.type];return B.argument(t!==void 0,"No encoding function for type "+e.type),t(e.value)},W.OBJECT=function(e){let t=W[e.type];return B.argument(t!==void 0,"No sizeOf function for type "+e.type),t(e.value)},D.TABLE=function(e){let t=[],n=(e.fields||[]).length,s=[],r=[];for(let o=0;o<n;o+=1){let i=e.fields[o],a=D[i.type];B.argument(a!==void 0,"No encoding function for field type "+i.type+" ("+i.name+")");let l=e[i.name];l===void 0&&(l=i.value);let c=a(l);if(i.type==="TABLE")l.fields!==null&&(r.push(t.length),s.push(c)),t.push(0,0);else for(let u=0;u<c.length;u++)t.push(c[u])}for(let o=0;o<s.length;o+=1){let i=r[o],a=t.length;B.argument(a<65536,"Table "+e.tableName+" too big."),t[i]=a>>8,t[i+1]=a&255;for(let l=0;l<s[o].length;l++)t.push(s[o][l])}return t},W.TABLE=function(e){let t=0,n=(e.fields||[]).length;for(let s=0;s<n;s+=1){let r=e.fields[s],o=W[r.type];B.argument(o!==void 0,"No sizeOf function for field type "+r.type+" ("+r.name+")");let i=e[r.name];i===void 0&&(i=r.value),t+=o(i),r.type==="TABLE"&&(t+=2)}return t},D.RECORD=D.TABLE,W.RECORD=W.TABLE,D.LITERAL=function(e){return e},W.LITERAL=function(e){return e.length};function de(e,t,n){if(t&&t.length)for(let s=0;s<t.length;s+=1){let r=t[s];this[r.name]=r.value}if(this.tableName=e,this.fields=t,n){let s=Object.keys(n);for(let r=0;r<s.length;r+=1){let o=s[r],i=n[o];this[o]!==void 0&&(this[o]=i)}}}de.prototype.encode=function(){return D.TABLE(this)},de.prototype.sizeOf=function(){return W.TABLE(this)};function ln(e,t,n){n===void 0&&(n=t.length);let s=new Array(t.length+1);s[0]={name:e+"Count",type:"USHORT",value:n};for(let r=0;r<t.length;r++)s[r+1]={name:e+r,type:"USHORT",value:t[r]};return s}function Ls(e,t,n){let s=t.length,r=new Array(s+1);r[0]={name:e+"Count",type:"USHORT",value:s};for(let o=0;o<s;o++)r[o+1]={name:e+o,type:"TABLE",value:n(t[o],o)};return r}function un(e,t,n){let s=t.length,r=[];r[0]={name:e+"Count",type:"USHORT",value:s};for(let o=0;o<s;o++)r=r.concat(n(t[o],o));return r}function Xn(e){e.format===1?de.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(ln("glyph",e.glyphs))):e.format===2?de.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(un("rangeRecord",e.ranges,function(t,n){return[{name:"startGlyphID"+n,type:"USHORT",value:t.start},{name:"endGlyphID"+n,type:"USHORT",value:t.end},{name:"startCoverageIndex"+n,type:"USHORT",value:t.index}]}))):B.assert(!1,"Coverage format must be 1 or 2.")}Xn.prototype=Object.create(de.prototype),Xn.prototype.constructor=Xn;function Yn(e){de.call(this,"scriptListTable",un("scriptRecord",e,function(t,n){let s=t.script,r=s.defaultLangSys;return B.assert(!!r,"Unable to write GSUB: script "+t.tag+" has no default language system."),[{name:"scriptTag"+n,type:"TAG",value:t.tag},{name:"script"+n,type:"TABLE",value:new de("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new de("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:r.reqFeatureIndex}].concat(ln("featureIndex",r.featureIndexes)))}].concat(un("langSys",s.langSysRecords,function(o,i){let a=o.langSys;return[{name:"langSysTag"+i,type:"TAG",value:o.tag},{name:"langSys"+i,type:"TABLE",value:new de("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:a.reqFeatureIndex}].concat(ln("featureIndex",a.featureIndexes)))}]})))}]}))}Yn.prototype=Object.create(de.prototype),Yn.prototype.constructor=Yn;function Zn(e){de.call(this,"featureListTable",un("featureRecord",e,function(t,n){let s=t.feature;return[{name:"featureTag"+n,type:"TAG",value:t.tag},{name:"feature"+n,type:"TABLE",value:new de("featureTable",[{name:"featureParams",type:"USHORT",value:s.featureParams}].concat(ln("lookupListIndex",s.lookupListIndexes)))}]}))}Zn.prototype=Object.create(de.prototype),Zn.prototype.constructor=Zn;function Kn(e,t){de.call(this,"lookupListTable",Ls("lookup",e,function(n){let s=t[n.lookupType];return B.assert(!!s,"Unable to write GSUB lookup type "+n.lookupType+" tables."),new de("lookupTable",[{name:"lookupType",type:"USHORT",value:n.lookupType},{name:"lookupFlag",type:"USHORT",value:n.lookupFlag}].concat(Ls("subtable",n.subtables,s)))}))}Kn.prototype=Object.create(de.prototype),Kn.prototype.constructor=Kn;function Qn(e){e.format===1?de.call(this,"classDefTable",[{name:"classFormat",type:"USHORT",value:1},{name:"startGlyphID",type:"USHORT",value:e.startGlyph}].concat(ln("glyph",e.classes))):e.format===2?de.call(this,"classDefTable",[{name:"classFormat",type:"USHORT",value:2}].concat(un("rangeRecord",e.ranges,function(t,n){return[{name:"startGlyphID"+n,type:"USHORT",value:t.start},{name:"endGlyphID"+n,type:"USHORT",value:t.end},{name:"class"+n,type:"USHORT",value:t.classId}]}))):B.assert(!1,"Class format must be 1 or 2.")}Qn.prototype=Object.create(de.prototype),Qn.prototype.constructor=Qn;var A={Table:de,Record:de,Coverage:Xn,ClassDef:Qn,ScriptList:Yn,FeatureList:Zn,LookupList:Kn,ushortList:ln,tableList:Ls,recordList:un};function Mr(e,t){return e.getUint8(t)}function Jn(e,t){return e.getUint16(t,!1)}function ta(e,t){return e.getInt16(t,!1)}function Pr(e,t){return(e.getUint16(t)<<8)+e.getUint8(t+2)}function As(e,t){return e.getUint32(t,!1)}function na(e,t){return e.getInt32(t,!1)}function Nr(e,t){let n=e.getInt16(t,!1),s=e.getUint16(t+2,!1);return n+s/65535}function sa(e,t){let n="";for(let s=t;s<t+4;s+=1)n+=String.fromCharCode(e.getInt8(s));return n}function ra(e,t,n){let s=0;for(let r=0;r<n;r+=1)s<<=8,s+=e.getUint8(t+r);return s}function oa(e,t,n){let s=[];for(let r=t;r<n;r+=1)s.push(e.getUint8(r));return s}function ia(e){let t="";for(let n=0;n<e.length;n+=1)t+=String.fromCharCode(e[n]);return t}var aa={byte:1,uShort:2,f2dot14:2,short:2,uInt24:3,uLong:4,fixed:4,longDateTime:8,tag:4},Ie={LONG_WORDS:32768,WORD_DELTA_COUNT_MASK:32767,SHARED_POINT_NUMBERS:32768,COUNT_MASK:4095,EMBEDDED_PEAK_TUPLE:32768,INTERMEDIATE_REGION:16384,PRIVATE_POINT_NUMBERS:8192,TUPLE_INDEX_MASK:4095,POINTS_ARE_WORDS:128,POINT_RUN_COUNT_MASK:127,DELTAS_ARE_ZERO:128,DELTAS_ARE_WORDS:64,DELTA_RUN_COUNT_MASK:63,INNER_INDEX_BIT_COUNT_MASK:15,MAP_ENTRY_SIZE_MASK:48};function C(e,t){this.data=e,this.offset=t,this.relativeOffset=0}C.prototype.parseByte=function(){let e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},C.prototype.parseChar=function(){let e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},C.prototype.parseCard8=C.prototype.parseByte,C.prototype.parseUShort=function(){let e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},C.prototype.parseCard16=C.prototype.parseUShort,C.prototype.parseSID=C.prototype.parseUShort,C.prototype.parseOffset16=C.prototype.parseUShort,C.prototype.parseShort=function(){let e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},C.prototype.parseF2Dot14=function(){let e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},C.prototype.parseUInt24=function(){let e=Pr(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=3,e},C.prototype.parseULong=function(){let e=As(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},C.prototype.parseLong=function(){let e=na(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},C.prototype.parseOffset32=C.prototype.parseULong,C.prototype.parseFixed=function(){let e=Nr(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},C.prototype.parseString=function(e){let t=this.data,n=this.offset+this.relativeOffset,s="";this.relativeOffset+=e;for(let r=0;r<e;r++)s+=String.fromCharCode(t.getUint8(n+r));return s},C.prototype.parseTag=function(){return this.parseString(4)},C.prototype.parseLongDateTime=function(){let e=As(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},C.prototype.parseVersion=function(e){let t=Jn(this.data,this.offset+this.relativeOffset),n=Jn(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,e===void 0&&(e=4096),t+n/e/10},C.prototype.skip=function(e,t){t===void 0&&(t=1),this.relativeOffset+=aa[e]*t},C.prototype.parseULongList=function(e){e===void 0&&(e=this.parseULong());let t=new Array(e),n=this.data,s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint32(s),s+=4;return this.relativeOffset+=e*4,t},C.prototype.parseOffset16List=C.prototype.parseUShortList=function(e){e===void 0&&(e=this.parseUShort());let t=new Array(e),n=this.data,s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint16(s),s+=2;return this.relativeOffset+=e*2,t},C.prototype.parseShortList=function(e){let t=new Array(e),n=this.data,s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getInt16(s),s+=2;return this.relativeOffset+=e*2,t},C.prototype.parseByteList=function(e){let t=new Array(e),n=this.data,s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint8(s++);return this.relativeOffset+=e,t},C.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());let n=new Array(e);for(let s=0;s<e;s++)n[s]=t.call(this);return n},C.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());let n=new Array(e);for(let s=0;s<e;s++)n[s]=t.call(this);return n},C.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());let n=new Array(e),s=Object.keys(t);for(let r=0;r<e;r++){let o={};for(let i=0;i<s.length;i++){let a=s[i],l=t[a];o[a]=l.call(this)}n[r]=o}return n},C.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());let n=new Array(e),s=Object.keys(t);for(let r=0;r<e;r++){let o={};for(let i=0;i<s.length;i++){let a=s[i],l=t[a];o[a]=l.call(this)}n[r]=o}return n},C.prototype.parseTupleRecords=function(e,t){let n=[];for(let s=0;s<e;s++){let r=[];for(let o=0;o<t;o++)r.push(this.parseF2Dot14());n.push(r)}return n},C.prototype.parseStruct=function(e){if(typeof e=="function")return e.call(this);{let t=Object.keys(e),n={};for(let s=0;s<t.length;s++){let r=t[s],o=e[r];n[r]=o.call(this)}return n}},C.prototype.parseValueRecord=function(e){if(e===void 0&&(e=this.parseUShort()),e===0)return;let t={};return e&1&&(t.xPlacement=this.parseShort()),e&2&&(t.yPlacement=this.parseShort()),e&4&&(t.xAdvance=this.parseShort()),e&8&&(t.yAdvance=this.parseShort()),e&16&&(t.xPlaDevice=void 0,this.parseShort()),e&32&&(t.yPlaDevice=void 0,this.parseShort()),e&64&&(t.xAdvDevice=void 0,this.parseShort()),e&128&&(t.yAdvDevice=void 0,this.parseShort()),t},C.prototype.parseValueRecordList=function(){let e=this.parseUShort(),t=this.parseUShort(),n=new Array(t);for(let s=0;s<t;s++)n[s]=this.parseValueRecord(e);return n},C.prototype.parsePointer=function(e){let t=this.parseOffset16();if(t>0)return new C(this.data,this.offset+t).parseStruct(e)},C.prototype.parsePointer32=function(e){let t=this.parseOffset32();if(t>0)return new C(this.data,this.offset+t).parseStruct(e)},C.prototype.parseListOfLists=function(e){let t=this.parseOffset16List(),n=t.length,s=this.relativeOffset,r=new Array(n);for(let o=0;o<n;o++){let i=t[o];if(i===0){r[o]=void 0;continue}if(this.relativeOffset=i,e){let a=this.parseOffset16List(),l=new Array(a.length);for(let c=0;c<a.length;c++)this.relativeOffset=i+a[c],l[c]=e.call(this);r[o]=l}else r[o]=this.parseUShortList()}return this.relativeOffset=s,r},C.prototype.parseCoverage=function(){let e=this.offset+this.relativeOffset,t=this.parseUShort(),n=this.parseUShort();if(t===1)return{format:1,glyphs:this.parseUShortList(n)};if(t===2){let s=new Array(n);for(let r=0;r<n;r++)s[r]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:s}}throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.")},C.prototype.parseClassDef=function(){let e=this.offset+this.relativeOffset,t=this.parseUShort();return t===1?{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()}:t===2?{format:2,ranges:this.parseRecordList({start:C.uShort,end:C.uShort,classId:C.uShort})}:(console.warn(`0x${e.toString(16)}: This font file uses an invalid ClassDef format of ${t}. It might be corrupted and should be reacquired if it doesn't display as intended.`),{format:t})},C.list=function(e,t){return function(){return this.parseList(e,t)}},C.list32=function(e,t){return function(){return this.parseList32(e,t)}},C.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},C.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},C.pointer=function(e){return function(){return this.parsePointer(e)}},C.pointer32=function(e){return function(){return this.parsePointer32(e)}},C.tag=C.prototype.parseTag,C.byte=C.prototype.parseByte,C.uShort=C.offset16=C.prototype.parseUShort,C.uShortList=C.prototype.parseUShortList,C.uInt24=C.prototype.parseUInt24,C.uLong=C.offset32=C.prototype.parseULong,C.uLongList=C.prototype.parseULongList,C.fixed=C.prototype.parseFixed,C.f2Dot14=C.prototype.parseF2Dot14,C.struct=C.prototype.parseStruct,C.coverage=C.prototype.parseCoverage,C.classDef=C.prototype.parseClassDef;var Br={reserved:C.uShort,reqFeatureIndex:C.uShort,featureIndexes:C.uShortList};C.prototype.parseScriptList=function(){return this.parsePointer(C.recordList({tag:C.tag,script:C.pointer({defaultLangSys:C.pointer(Br),langSysRecords:C.recordList({tag:C.tag,langSys:C.pointer(Br)})})}))||[]},C.prototype.parseFeatureList=function(){return this.parsePointer(C.recordList({tag:C.tag,feature:C.pointer({featureParams:C.offset16,lookupListIndexes:C.uShortList})}))||[]},C.prototype.parseLookupList=function(e){return this.parsePointer(C.list(C.pointer(function(){let t=this.parseUShort();B.argument(1<=t&&t<=9,"GPOS/GSUB lookup type "+t+" unknown.");let n=this.parseUShort(),s=n&16;return{lookupType:t,lookupFlag:n,subtables:this.parseList(C.pointer(e[t])),markFilteringSet:s?this.parseUShort():void 0}})))||[]},C.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){let e=this.parseUShort(),t=this.parseUShort();return B.argument(e===1&&t<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:C.offset32,featureTableSubstitutionOffset:C.offset32})})||[]},C.prototype.parseVariationStore=function(){let e=this.relativeOffset,t=this.parseUShort(),n={itemVariationStore:this.parseItemVariationStore()};return this.relativeOffset=e+t+2,n},C.prototype.parseItemVariationStore=function(){let e=this.relativeOffset,t={format:this.parseUShort(),variationRegions:[],itemVariationSubtables:[]},n=this.parseOffset32(),s=this.parseUShort(),r=this.parseULongList(s);this.relativeOffset=e+n,t.variationRegions=this.parseVariationRegionList();for(let o=0;o<s;o++){let i=r[o];this.relativeOffset=e+i,t.itemVariationSubtables.push(this.parseItemVariationSubtable())}return t},C.prototype.parseVariationRegionList=function(){let e=this.parseUShort(),t=this.parseUShort();return this.parseRecordList(t,{regionAxes:C.recordList(e,{startCoord:C.f2Dot14,peakCoord:C.f2Dot14,endCoord:C.f2Dot14})})},C.prototype.parseItemVariationSubtable=function(){let e=this.parseUShort(),t=this.parseUShort(),n=this.parseUShortList(),s=n.length;return{regionIndexes:n,deltaSets:e&&s?this.parseDeltaSets(e,t,s):[]}},C.prototype.parseDeltaSetIndexMap=function(){let e=this.parseByte(),t=this.parseByte(),n=[],s=0;switch(e){case 0:s=this.parseUShort();break;case 1:s=this.parseULong();break;default:console.error(`unsupported DeltaSetIndexMap format ${e}`)}if(!s)return{format:e,entryFormat:t};let r=(t&Ie.INNER_INDEX_BIT_COUNT_MASK)+1,o=((t&Ie.MAP_ENTRY_SIZE_MASK)>>4)+1;for(let i=0;i<s;i++){let a;if(o===1)a=this.parseByte();else if(o===2)a=this.parseUShort();else if(o===3)a=this.parseUInt24();else if(o===4)a=this.parseULong();else throw new Error(`Invalid entry size of ${o}`);let l=a>>r,c=a&(1<<r)-1;n.push({outerIndex:l,innerIndex:c})}return{format:e,entryFormat:t,map:n}},C.prototype.parseDeltaSets=function(e,t,n){let s=Array.from({length:e},()=>[]),r=t&Ie.LONG_WORDS,o=t&Ie.WORD_DELTA_COUNT_MASK;if(o>n)throw Error("wordCount must be less than or equal to regionIndexCount");let i=(r?this.parseLong:this.parseShort).bind(this),a=(r?this.parseShort:this.parseChar).bind(this);for(let l=0;l<e;l++)for(let c=0;c<n;c++)c<o?s[l].push(i()):s[l].push(a());return s},C.prototype.parseTupleVariationStoreList=function(e,t,n){let s=this.parseUShort(),o=this.parseUShort()&1,i=this.parseOffset32(),a=(o?this.parseULong:this.parseUShort).bind(this),l={},c=a();o||(c*=2);let u;for(let m=0;m<s;m++){u=a(),o||(u*=2);let d=u-c;l[m]=d?this.parseTupleVariationStore(i+c,e,t,n,m):void 0,c=u}return l},C.prototype.parseTupleVariationStore=function(e,t,n,s,r){let o=this.relativeOffset;this.relativeOffset=e,n==="cvar"&&(this.relativeOffset+=4);let i=this.parseUShort(),a=!!(i&Ie.SHARED_POINT_NUMBERS),l=i&Ie.COUNT_MASK,c=this.parseOffset16(),u=[],m=[];for(let v=0;v<l;v++){let S=this.parseTupleVariationHeader(t,n);u.push(S)}this.relativeOffset!==e+c&&(console.warn(`Unexpected offset after parsing tuple variation headers! Expected ${e+c}, actually ${this.relativeOffset}`),this.relativeOffset=e+c),a&&(m=this.parsePackedPointNumbers());let d=this.relativeOffset;for(let v=0;v<l;v++){let S=u[v];S.privatePoints=[],this.relativeOffset=d,n==="cvar"&&!S.peakTuple&&console.warn("An embedded peak tuple is required in TupleVariationHeaders for the cvar table."),S.flags.privatePointNumbers&&(S.privatePoints=this.parsePackedPointNumbers()),delete S.flags;let I=this.offset,_=this.relativeOffset,P=z=>{let Y,re,ie=()=>{let ae=0;if(n==="gvar"){if(ae=S.privatePoints.length||m.length,!ae){let me=s.get(r);me.path,ae=me.points.length,ae+=4}}else n==="cvar"&&(ae=s.length);this.offset=I,this.relativeOffset=_,Y=this.parsePackedDeltas(ae),n==="gvar"&&(re=this.parsePackedDeltas(ae))};return{configurable:!0,get:function(){return Y===void 0&&ie(),z==="deltasY"?re:Y},set:function(ae){Y===void 0&&ie(),z==="deltasY"?re=ae:Y=ae}}};Object.defineProperty(S,"deltas",P.call(this,"deltas")),n==="gvar"&&Object.defineProperty(S,"deltasY",P.call(this,"deltasY")),d+=S.variationDataSize,delete S.variationDataSize}this.relativeOffset=o;let x={headers:u};return x.sharedPoints=m,x},C.prototype.parseTupleVariationHeader=function(e,t){let n=this.parseUShort(),s=this.parseUShort(),r=!!(s&Ie.EMBEDDED_PEAK_TUPLE),o=!!(s&Ie.INTERMEDIATE_REGION),i=!!(s&Ie.PRIVATE_POINT_NUMBERS),a=r?void 0:s&Ie.TUPLE_INDEX_MASK,l=r?this.parseTupleRecords(1,e)[0]:void 0,c=o?this.parseTupleRecords(1,e)[0]:void 0,u=o?this.parseTupleRecords(1,e)[0]:void 0,m={variationDataSize:n,peakTuple:l,intermediateStartTuple:c,intermediateEndTuple:u,flags:{embeddedPeakTuple:r,intermediateRegion:o,privatePointNumbers:i}};return t==="gvar"&&(m.sharedTupleRecordsIndex=a),m},C.prototype.parsePackedPointNumbers=function(){let e=this.parseByte(),t=[],n=e;if(e>=128){let r=this.parseByte();n=(e&Ie.POINT_RUN_COUNT_MASK)<<8|r}let s=0;for(;t.length<n;){let r=this.parseByte(),o=!!(r&Ie.POINTS_ARE_WORDS),i=(r&Ie.POINT_RUN_COUNT_MASK)+1;for(let a=0;a<i&&t.length<n;a++){let l;o?l=this.parseUShort():l=this.parseByte(),s=s+l,t.push(s)}}return t},C.prototype.parsePackedDeltas=function(e){let t=[];for(;t.length<e;){let n=this.parseByte(),s=!!(n&Ie.DELTAS_ARE_ZERO),r=!!(n&Ie.DELTAS_ARE_WORDS),o=(n&Ie.DELTA_RUN_COUNT_MASK)+1;for(let i=0;i<o&&t.length<e;i++)s?t.push(0):r?t.push(this.parseShort()):t.push(this.parseChar())}return t};var F={getByte:Mr,getCard8:Mr,getUShort:Jn,getCard16:Jn,getShort:ta,getUInt24:Pr,getULong:As,getFixed:Nr,getTag:sa,getOffset:ra,getBytes:oa,bytesToString:ia,Parser:C},es=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],_r={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},la={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},Gr={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"};function ua(e,t,n){switch(e){case 0:if(t===65535)return"und";if(n)return n[t];break;case 1:return _r[t];case 3:return Gr[t]}}var Rs="utf-16",ca={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},fa={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"};function Ds(e,t,n){switch(e){case 0:return Rs;case 1:return fa[n]||ca[t];case 3:if(t===1||t===10)return Rs;break}}var Hr={0:"unicode",1:"macintosh",2:"reserved",3:"windows"};function pa(e){return Hr[e]}function ha(e,t,n){let s={},r=new F.Parser(e,t),o=r.parseUShort(),i=r.parseUShort(),a=r.offset+r.parseUShort();for(let l=0;l<i;l++){let c=r.parseUShort(),u=r.parseUShort(),m=r.parseUShort(),d=r.parseUShort(),x=es[d]||d,v=r.parseUShort(),S=r.parseUShort(),I=ua(c,m,n),_=Ds(c,u,m),P=pa(c);if(_!==void 0&&I!==void 0&&P!==void 0){let z;if(_===Rs?z=an.UTF16(e,a+S,v):z=an.MACSTRING(e,a+S,v,_),z){let Y=s[P];Y===void 0&&(Y=s[P]={});let re=Y[x];re===void 0&&(re=Y[x]={}),re[I]=z}}}return o===1&&r.parseUShort(),s}function ts(e){let t={};for(let n in e)t[e[n]]=parseInt(n);return t}function Vr(e,t,n,s,r,o){return new A.Record("NameRecord",[{name:"platformID",type:"USHORT",value:e},{name:"encodingID",type:"USHORT",value:t},{name:"languageID",type:"USHORT",value:n},{name:"nameID",type:"USHORT",value:s},{name:"length",type:"USHORT",value:r},{name:"offset",type:"USHORT",value:o}])}function da(e,t){let n=e.length,s=t.length-n+1;e:for(let r=0;r<s;r++)for(;r<s;r++){for(let o=0;o<n;o++)if(t[r+o]!==e[o])continue e;return r}return-1}function zr(e,t){let n=da(e,t);if(n<0){n=t.length;let s=0,r=e.length;for(;s<r;++s)t.push(e[s])}return n}function ga(e,t){let n=ts(Hr),s=ts(_r),r=ts(Gr),o=[],i=[];for(let l in e){let c,u=[],m={},d=ts(es),x=n[l];for(let v in e[l]){let S=d[v];if(S===void 0&&(S=v),c=parseInt(S),isNaN(c))throw new Error('Name table entry "'+v+'" does not exist, see nameTableNames for complete list.');m[c]=e[l][v],u.push(c)}for(let v=0;v<u.length;v++){c=u[v];let S=m[c];for(let I in S){let _=S[I];if(x===1||x===0){let P=s[I],z=la[P],Y=Ds(x,z,P),re=D.MACSTRING(_,Y);if(x===0&&(P=t.indexOf(I),P<0&&(P=t.length,t.push(I)),z=4,re=D.UTF16(_)),re!==void 0){let ie=zr(re,i);o.push(Vr(x,z,P,c,re.length,ie))}}if(x===3){let P=r[I];if(P!==void 0){let z=D.UTF16(_),Y=zr(z,i);o.push(Vr(3,1,P,c,z.length,Y))}}}}}o.sort(function(l,c){return l.platformID-c.platformID||l.encodingID-c.encodingID||l.languageID-c.languageID||l.nameID-c.nameID});let a=new A.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:o.length},{name:"stringOffset",type:"USHORT",value:6+o.length*12}]);for(let l=0;l<o.length;l++)a.fields.push({name:"record_"+l,type:"RECORD",value:o[l]});return a.fields.push({name:"strings",type:"LITERAL",value:i}),a}function ns(e,t,n=[]){if(t<256&&t in es){if(n.length&&!n.includes(parseInt(t)))return;t=es[t]}for(let s in e)for(let r in e[s])if(r===t||parseInt(r)===t)return e[s][r]}var jr={parse:ha,make:ga,getNameByID:ns};function ma(e,t,n,s){e.length=t.parseUShort(),e.language=t.parseUShort()-1;let r=t.parseByteList(e.length),o=Object.assign({},r),i=Ds(n,s,e.language),a=jn[i];for(let l=0;l<a.length;l++)o[a.charCodeAt(l)]=r[128+l];e.glyphIndexMap=o}function ya(e,t,n){t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong();let s;e.groupCount=s=t.parseULong(),e.glyphIndexMap={};for(let r=0;r<s;r+=1){let o=t.parseULong(),i=t.parseULong(),a=t.parseULong();for(let l=o;l<=i;l+=1)e.glyphIndexMap[l]=a,n===12&&a++}}function ba(e,t,n,s,r){e.length=t.parseUShort(),e.language=t.parseUShort();let o;e.segCount=o=t.parseUShort()>>1,t.skip("uShort",3),e.glyphIndexMap={};let i=new F.Parser(n,s+r+14),a=new F.Parser(n,s+r+16+o*2),l=new F.Parser(n,s+r+16+o*4),c=new F.Parser(n,s+r+16+o*6),u=s+r+16+o*8;for(let m=0;m<o-1;m+=1){let d,x=i.parseUShort(),v=a.parseUShort(),S=l.parseShort(),I=c.parseUShort();for(let _=v;_<=x;_+=1)I!==0?(u=c.offset+c.relativeOffset-2,u+=I,u+=(_-v)*2,d=F.getUShort(n,u),d!==0&&(d=d+S&65535)):d=_+S&65535,e.glyphIndexMap[_]=d}}function va(e,t){let n={};t.skip("uLong");let s=t.parseULong();for(let r=0;r<s;r+=1){let o=t.parseUInt24(),i={varSelector:o},a=t.parseOffset32(),l=t.parseOffset32(),c=t.relativeOffset;a&&(t.relativeOffset=a,i.defaultUVS=t.parseStruct({ranges:function(){return t.parseRecordList32({startUnicodeValue:t.parseUInt24,additionalCount:t.parseByte})}})),l&&(t.relativeOffset=l,i.nonDefaultUVS=t.parseStruct({uvsMappings:function(){let u={},m=t.parseRecordList32({unicodeValue:t.parseUInt24,glyphID:t.parseUShort});for(let d=0;d<m.length;d+=1)u[m[d].unicodeValue]=m[d];return u}})),n[o]=i,t.relativeOffset=c}e.varSelectorList=n}function xa(e,t){let n={};n.version=F.getUShort(e,t),B.argument(n.version===0,"cmap table version should be 0."),n.numTables=F.getUShort(e,t+2);let s=null,r=-1,o=-1,i=null,a=null,l=[0,1,2,3,4,6],c=[0,1,10];for(let m=n.numTables-1;m>=0;m-=1)if(i=F.getUShort(e,t+4+m*8),a=F.getUShort(e,t+4+m*8+2),i===3&&c.includes(a)||i===0&&l.includes(a)||i===1&&a===0){if(o>0)continue;if(o=F.getULong(e,t+4+m*8+4),s)break}else if(i===0&&a===5){if(r=F.getULong(e,t+4+m*8+4),s=new F.Parser(e,t+r),s.parseUShort()!==14)r=-1,s=null;else if(o>0)break}if(o===-1)throw new Error("No valid cmap sub-tables found.");let u=new F.Parser(e,t+o);if(n.format=u.parseUShort(),n.format===0)ma(n,u,i,a);else if(n.format===12||n.format===13)ya(n,u,n.format);else if(n.format===4)ba(n,u,e,t,o);else throw new Error("Only format 0 (platformId 1, encodingId 0), 4, 12 and 14 cmap tables are supported (found format "+n.format+", platformId "+i+", encodingId "+a+").");return s&&va(n,s),n}function Sa(e,t,n){e.segments.push({end:t,start:t,delta:-(t-n),offset:0,glyphIndex:n})}function ka(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}function Ta(e){if(e.length===0)return e;let t=[e[0]];for(let n=1;n<e.length;n++){let s=t[t.length-1],r=e[n];s.end+1===r.start&&s.delta===r.delta&&r.end!==65535?s.end=r.end:t.push(r)}return t}function Ca(e){let t=!0,n;for(n=e.length-1;n>0;n-=1)if(e.get(n).unicode>65535){t=!1;break}let s=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:t?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:t?12:20}];t||s.push({name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}),s.push({name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0});let r=new A.Table("cmap",s);for(r.segments=[],n=0;n<e.length;n+=1){let x=e.get(n);for(let v=0;v<x.unicodes.length;v+=1)Sa(r,x.unicodes[v],n)}r.segments.sort(function(x,v){return x.start-v.start}),r.segments=Ta(r.segments),ka(r);let o=r.segments.length,i=0,a=[],l=[],c=[],u=[],m=[],d=[];for(n=0;n<o;n+=1){let x=r.segments[n];x.end<=65535&&x.start<=65535?(a.push({name:"end_"+n,type:"USHORT",value:x.end}),l.push({name:"start_"+n,type:"USHORT",value:x.start}),c.push({name:"idDelta_"+n,type:"SHORT",value:x.delta}),u.push({name:"idRangeOffset_"+n,type:"USHORT",value:x.offset}),x.glyphId!==void 0&&m.push({name:"glyph_"+n,type:"USHORT",value:x.glyphId})):i+=1,!t&&x.glyphIndex!==void 0&&(d.push({name:"cmap12Start_"+n,type:"ULONG",value:x.start}),d.push({name:"cmap12End_"+n,type:"ULONG",value:x.end}),d.push({name:"cmap12Glyph_"+n,type:"ULONG",value:x.glyphIndex}))}r.segCountX2=(o-i)*2,r.searchRange=Math.pow(2,Math.floor(Math.log(o-i)/Math.log(2)))*2,r.entrySelector=Math.log(r.searchRange/2)/Math.log(2),r.rangeShift=r.segCountX2-r.searchRange;for(let x=0;x<a.length;x++)r.fields.push(a[x]);r.fields.push({name:"reservedPad",type:"USHORT",value:0});for(let x=0;x<l.length;x++)r.fields.push(l[x]);for(let x=0;x<c.length;x++)r.fields.push(c[x]);for(let x=0;x<u.length;x++)r.fields.push(u[x]);for(let x=0;x<m.length;x++)r.fields.push(m[x]);if(r.cmap4Length=14+a.length*2+2+l.length*2+c.length*2+u.length*2+m.length*2,!t){let x=16+d.length*4;r.cmap12Offset=20+r.cmap4Length,r.fields.push({name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:x},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:d.length/3});for(let v=0;v<d.length;v++)r.fields.push(d[v])}return r}var Wr={parse:xa,make:Ca},ss=[".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"],Oa=[".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"],Ia=[".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"],wa=[".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"],Fs=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],Ea=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],qt=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","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","grave","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","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function qr(e){this.font=e}qr.prototype.charToGlyphIndex=function(e){let t=e.codePointAt(0),n=this.font.glyphs;if(n)for(let s=0;s<n.length;s+=1){let r=n.get(s);for(let o=0;o<r.unicodes.length;o+=1)if(r.unicodes[o]===t)return s}return null};function $r(e){this.cmap=e}$r.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0};function Xr(e,t){this.encoding=e,this.charset=t}Xr.prototype.charToGlyphIndex=function(e){let t=e.codePointAt(0),n=this.encoding[t];return this.charset.indexOf(n)};function Us(e){switch(e.version){case 1:this.names=qt.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(let t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<qt.length?this.names[t]=qt[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-qt.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(let t=0;t<e.numberOfGlyphs;t++)this.names[t]=qt[t+e.glyphNameIndex[t]];break;case 3:this.names=[];break;default:this.names=[];break}}Us.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},Us.prototype.glyphIndexToName=function(e){return this.names[e]};function La(e){let t,n=e.tables.cmap.glyphIndexMap,s=Object.keys(n);for(let r=0;r<s.length;r+=1){let o=s[r],i=n[o];t=e.glyphs.get(i),t.addUnicode(parseInt(o))}for(let r=0;r<e.glyphs.length;r+=1)t=e.glyphs.get(r),e.cffEncoding?t.name=e.cffEncoding.charset[r]:e.glyphNames.names&&(t.name=e.glyphNames.glyphIndexToName(r))}function Aa(e){e._IndexToUnicodeMap={};let t=e.tables.cmap.glyphIndexMap,n=Object.keys(t);for(let s=0;s<n.length;s+=1){let r=n[s],o=t[r];e._IndexToUnicodeMap[o]===void 0?e._IndexToUnicodeMap[o]={unicodes:[parseInt(r)]}:e._IndexToUnicodeMap[o].unicodes.push(parseInt(r))}}function Ra(e,t){t.lowMemory?Aa(e):La(e)}function Da(e,t,n,s,r){e.beginPath(),e.moveTo(t,n),e.lineTo(s,r),e.stroke()}var $t={line:Da};function Fa(e,t){let n=new C(e,t),s=n.parseShort();s!==0&&console.warn("Only CPALv0 is currently fully supported.");let r=n.parseShort(),o=n.parseShort(),i=n.parseShort(),a=n.parseOffset32(),l=n.parseUShortList(o);n.relativeOffset=a;let c=n.parseULongList(i);return n.relativeOffset=a,{version:s,numPaletteEntries:r,colorRecords:c,colorRecordIndices:l}}function Ua({version:e=0,numPaletteEntries:t=0,colorRecords:n=[],colorRecordIndices:s=[0]}){return B.argument(e===0,"Only CPALv0 are supported."),B.argument(n.length,"No colorRecords given."),B.argument(s.length,"No colorRecordIndices given."),s.length>1&&B.argument(t,"Can't infer numPaletteEntries on multiple colorRecordIndices"),new A.Table("CPAL",[{name:"version",type:"USHORT",value:e},{name:"numPaletteEntries",type:"USHORT",value:t||n.length},{name:"numPalettes",type:"USHORT",value:s.length},{name:"numColorRecords",type:"USHORT",value:n.length},{name:"colorRecordsArrayOffset",type:"ULONG",value:12+2*s.length},...s.map((r,o)=>({name:"colorRecordIndices_"+o,type:"USHORT",value:r})),...n.map((r,o)=>({name:"colorRecords_"+o,type:"ULONG",value:r}))])}function Yr(e){var t=(e&4278190080)>>24,n=(e&16711680)>>16,s=(e&65280)>>8,r=e&255;return t=t+256&255,n=n+256&255,s=s+256&255,r=(r+256&255)/255,{b:t,g:n,r:s,a:r}}function Ms(e,t,n=0,s="hexa"){if(t==65535)return"currentColor";let r=e&&e.tables&&e.tables.cpal;if(!r)return"currentColor";if(n>r.colorRecordIndices.length-1)throw new Error(`Palette index out of range (colorRecordIndices.length: ${r.colorRecordIndices.length}, index: ${t})`);if(t>r.numPaletteEntries)throw new Error(`Color index out of range (numPaletteEntries: ${r.numPaletteEntries}, index: ${t})`);let o=r.colorRecordIndices[n]+t;if(o>r.colorRecords)throw new Error(`Color index out of range (colorRecords.length: ${r.colorRecords.length}, lookupIndex: ${o})`);let i=Yr(r.colorRecords[o]);return s==="bgra"?i:cn(i,s)}function nt(e){return("0"+parseInt(e).toString(16)).slice(-2)}function Ma(e){let t=e.r/255,n=e.g/255,s=e.b/255,r=Math.max(t,n,s),o=Math.min(t,n,s),i,a,l=(r+o)/2;if(r===o)i=a=0;else{let c=r-o;switch(a=l>.5?c/(2-r-o):c/(r+o),r){case t:i=(n-s)/c+(n<s?6:0);break;case n:i=(s-t)/c+2;break;case s:i=(t-n)/c+4;break}i/=6}return{h:i*360,s:a*100,l:l*100}}function Pa(e){let{h:t,s:n,l:s,a:r}=e;t=t%360,n/=100,s/=100;let o=(1-Math.abs(2*s-1))*n,i=o*(1-Math.abs(t/60%2-1)),a=s-o/2,l=0,c=0,u=0;return 0<=t&&t<60?(l=o,c=i,u=0):60<=t&&t<120?(l=i,c=o,u=0):120<=t&&t<180?(l=0,c=o,u=i):180<=t&&t<240?(l=0,c=i,u=o):240<=t&&t<300?(l=i,c=0,u=o):300<=t&&t<=360&&(l=o,c=0,u=i),{r:Math.round((l+a)*255),g:Math.round((c+a)*255),b:Math.round((u+a)*255),a:r}}function Zr(e){return parseInt(`0x${nt(e.b)}${nt(e.g)}${nt(e.r)}${nt(e.a*255)}`,16)}function rs(e,t="hexa"){let n=t=="raw"||t=="cpal",s=Number.isInteger(e),r=!0;if(s&&n||e==="currentColor")return e;if(typeof e=="object"){if(t=="bgra")return e;if(n)return Zr(e)}else if(!s&&/^#([a-f0-9]{3}|[a-f0-9]{4}|[a-f0-9]{6}|[a-f0-9]{8})$/i.test(e.trim())){switch(e=e.trim().substring(1),e.length){case 3:e={r:parseInt(e[0].repeat(2),16),g:parseInt(e[1].repeat(2),16),b:parseInt(e[2].repeat(2),16),a:1};break;case 4:e={r:parseInt(e[0].repeat(2),16),g:parseInt(e[1].repeat(2),16),b:parseInt(e[2].repeat(2),16),a:parseInt(e[3].repeat(2),16)/255};break;case 6:e={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16),a:1};break;case 8:e={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16),a:parseInt(e[6]+e[7],16)/255};break}if(t=="bgra")return e}else if(typeof document<"u"&&/^[a-z]+$/i.test(e)){let o=document.createElement("canvas").getContext("2d");o.fillStyle=e;let i=cn(o.fillStyle,"hexa");i==="#000000ff"&&e.toLowerCase()!=="black"?r=!1:e=i}else{e=e.trim();let o=/rgba?\(\s*(?:(\d*\.\d+)(%?)|(\d+)(%?))\s*(?:,|\s*)\s*(?:(\d*\.\d+)(%?)|(\d+)(%?))\s*(?:,|\s*)\s*(?:(\d*\.\d+)(%?)|(\d+)(%?))\s*(?:(?:,|\s|\/)\s*(?:(0*(?:\.\d+)?()|0*1(?:\.0+)?())|(?:\.\d+)|(\d+)(%)|(\d*\.\d+)(%)))?\s*\)/;if(o.test(e)){let i=e.match(o).filter(a=>typeof a<"u");e={r:Math.round(parseFloat(i[1])/(i[2]?.39215686274509803:1)),g:Math.round(parseFloat(i[3])/(i[4]?.39215686274509803:1)),b:Math.round(parseFloat(i[5])/(i[6]?.39215686274509803:1)),a:i[7]?parseFloat(i[7])/(i[8]?100:1):1}}else{let i=/hsla?\(\s*(?:(\d*\.\d+|\d+)(deg|turn|))\s*(?:,|\s*)\s*(?:(\d*\.\d+)%?|(\d+)%?)\s*(?:,|\s*)\s*(?:(\d*\.\d+)%?|(\d+)%?)\s*(?:(?:,|\s|\/)\s*(?:(0*(?:\.\d+)?()|0*1(?:\.0+)?())|(?:\.\d+)|(\d+)(%)|(\d*\.\d+)(%)))?\s*\)/;if(i.test(e)){let a=e.match(i).filter(l=>typeof l<"u");e=Pa({h:parseFloat(a[1])*(a[2]==="turn"?360:1),s:parseFloat(a[3]),l:parseFloat(a[4]),a:a[5]?parseFloat(a[5])/(a[6]?100:1):1})}else r=!1}}if(!r)throw new Error(`Invalid color format: ${e}`);return cn(e,t)}function cn(e,t="hexa"){if(e==="currentColor")return e;if(Number.isInteger(e)){if(t=="raw"||t=="cpal")return e;e=Yr(e)}else typeof e!="object"&&(e=rs(e,"bgra"));let n=["hsl","hsla"].includes(t)?Ma(e):null;switch(t){case"rgba":return`rgba(${e.r}, ${e.g}, ${e.b}, ${parseFloat(e.a.toFixed(3))})`;case"rgb":return`rgb(${e.r}, ${e.g}, ${e.b})`;case"hex":case"hex6":case"hex-6":return`#${nt(e.r)}${nt(e.g)}${nt(e.b)}`;case"hexa":case"hex8":case"hex-8":return`#${nt(e.r)}${nt(e.g)}${nt(e.b)}${nt(e.a*255)}`;case"hsl":return`hsl(${n.h.toFixed(2)}, ${n.s.toFixed(2)}%, ${n.l.toFixed(2)}%)`;case"hsla":return`hsla(${n.h.toFixed(2)}, ${n.s.toFixed(2)}%, ${n.l.toFixed(2)}%, ${parseFloat(e.a.toFixed(3))})`;case"bgra":return e;case"raw":case"cpal":return Zr(e);default:throw new Error("Unknown color format: "+t)}}var Kr={parse:Fa,make:Ua,getPaletteColor:Ms,parseColor:rs,formatColor:cn};function Na(e,t){let n=t||new Wt;return{configurable:!0,get:function(){return typeof n=="function"&&(n=n()),n},set:function(s){n=s}}}function we(e){this.bindConstructorValues(e)}we.prototype.bindConstructorValues=function(e){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,this.unicode=e.unicode,this.unicodes=e.unicodes||(e.unicode!==void 0?[e.unicode]:[]),"xMin"in e&&(this.xMin=e.xMin),"yMin"in e&&(this.yMin=e.yMin),"xMax"in e&&(this.xMax=e.xMax),"yMax"in e&&(this.yMax=e.yMax),"advanceWidth"in e&&(this.advanceWidth=e.advanceWidth),"leftSideBearing"in e&&(this.leftSideBearing=e.leftSideBearing),"points"in e&&(this.points=e.points),Object.defineProperty(this,"path",Na(this,e.path))},we.prototype.addUnicode=function(e){this.unicodes.length===0&&(this.unicode=e),this.unicodes.push(e)},we.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},we.prototype.getPath=function(e,t,n,s,r){e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:72,s=Object.assign({},r&&r.defaultRenderOptions,s);let o,i,a=s.xScale,l=s.yScale,c=1/(this.path.unitsPerEm||1e3)*n,u=this;r&&r.variation&&(u=r.variation.getTransform(this,s.variation),o=u.path.commands),s.hinting&&r&&r.hinting&&(i=u.path&&r.hinting.exec(u,n,s)),i?(o=r.hinting.getCommands(i),e=Math.round(e),t=Math.round(t),a=l=1):(o=u.path.commands,a===void 0&&(a=c),l===void 0&&(l=c));let m=new Wt;if(s.drawSVG){let d=this.getSvgImage(r);if(d){let x=new Wt;return x._image={image:d.image,x:e+d.leftSideBearing*c,y:t-d.baseline*c,width:d.image.width*c,height:d.image.height*c},m._layers=[x],m}}if(s.drawLayers){let d=this.getLayers(r);if(d&&d.length){m._layers=[];for(let x=0;x<d.length;x+=1){let v=d[x],S=Ms(r,v.paletteIndex,s.usePalette);S==="currentColor"?S=s.fill||"black":S=cn(S,s.colorFormat||"rgba"),s=Object.assign({},s,{fill:S}),m._layers.push(this.getPath.call(v.glyph,e,t,n,s,r))}return m}}m.fill=s.fill||this.path.fill,m.stroke=this.path.stroke,m.strokeWidth=this.path.strokeWidth*c;for(let d=0;d<o.length;d+=1){let x=o[d];x.type==="M"?m.moveTo(e+x.x*a,t+-x.y*l):x.type==="L"?m.lineTo(e+x.x*a,t+-x.y*l):x.type==="Q"?m.quadraticCurveTo(e+x.x1*a,t+-x.y1*l,e+x.x*a,t+-x.y*l):x.type==="C"?m.curveTo(e+x.x1*a,t+-x.y1*l,e+x.x2*a,t+-x.y2*l,e+x.x*a,t+-x.y*l):x.type==="Z"&&m.stroke&&m.strokeWidth&&m.closePath()}return m},we.prototype.getLayers=function(e){if(!e)throw new Error("The font object is required to read the colr/cpal tables in order to get the layers.");return e.layers.get(this.index)},we.prototype.getSvgImage=function(e){if(!e)throw new Error("The font object is required to read the svg table in order to get the image.");return e.svgImages.get(this.index)},we.prototype.getContours=function(e=null){if(this.points===void 0&&!e)return[];let t=[],n=[],s=e||this.points;for(let r=0;r<s.length;r+=1){let o=s[r];n.push(o),o.lastPointOfContour&&(t.push(n),n=[])}return B.argument(n.length===0,"There are still points left in the current contour."),t},we.prototype.getMetrics=function(){let e=this.path.commands,t=[],n=[];for(let r=0;r<e.length;r+=1){let o=e[r];o.type!=="Z"&&(t.push(o.x),n.push(o.y)),(o.type==="Q"||o.type==="C")&&(t.push(o.x1),n.push(o.y1)),o.type==="C"&&(t.push(o.x2),n.push(o.y2))}let s={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,n),leftSideBearing:this.leftSideBearing};return isFinite(s.xMin)||(s.xMin=0),isFinite(s.xMax)||(s.xMax=this.advanceWidth),isFinite(s.yMin)||(s.yMin=0),isFinite(s.yMax)||(s.yMax=0),s.rightSideBearing=this.advanceWidth-s.leftSideBearing-(s.xMax-s.xMin),s},we.prototype.draw=function(e,t,n,s,r,o){r=Object.assign({},o&&o.defaultRenderOptions,r),this.getPath(t,n,s,r,o).draw(e)},we.prototype.drawPoints=function(e,t,n,s,r,o){if(r=Object.assign({},o&&o.defaultRenderOptions,r),r.drawLayers){let d=this.getLayers(o);if(d&&d.length){for(let x=0;x<d.length;x+=1)d[x].glyph.index!==this.index&&this.drawPoints.call(d[x].glyph,e,t,n,s);return}}function i(d,x,v,S){e.beginPath();for(let I=0;I<d.length;I+=1)e.moveTo(x+d[I].x*S,v+d[I].y*S),e.arc(x+d[I].x*S,v+d[I].y*S,2,0,Math.PI*2,!1);e.fill()}t=t!==void 0?t:0,n=n!==void 0?n:0,s=s!==void 0?s:24;let a=1/this.path.unitsPerEm*s,l=[],c=[],m=this.path.commands;o&&o.variation&&(m=o.variation.getTransform(this,r.variation).path.commands);for(let d=0;d<m.length;d+=1){let x=m[d];x.x!==void 0&&l.push({x:x.x,y:-x.y}),x.x1!==void 0&&c.push({x:x.x1,y:-x.y1}),x.x2!==void 0&&c.push({x:x.x2,y:-x.y2})}e.fillStyle="blue",i(l,t,n,a),e.fillStyle="red",i(c,t,n,a)},we.prototype.drawMetrics=function(e,t,n,s){let r;t=t!==void 0?t:0,n=n!==void 0?n:0,s=s!==void 0?s:24,r=1/this.path.unitsPerEm*s,e.lineWidth=1,e.strokeStyle="black",$t.line(e,t,-1e4,t,1e4),$t.line(e,-1e4,n,1e4,n);let o=this.xMin||0,i=this.yMin||0,a=this.xMax||0,l=this.yMax||0,c=this.advanceWidth||0;e.strokeStyle="blue",$t.line(e,t+o*r,-1e4,t+o*r,1e4),$t.line(e,t+a*r,-1e4,t+a*r,1e4),$t.line(e,-1e4,n+-i*r,1e4,n+-i*r),$t.line(e,-1e4,n+-l*r,1e4,n+-l*r),e.strokeStyle="green",$t.line(e,t+c*r,-1e4,t+c*r,1e4)},we.prototype.toPathData=function(e,t){e=Object.assign({},{variation:t&&t.defaultRenderOptions.variation},e);let n=this;t&&t.variation&&(n=t.variation.getTransform(this,e.variation));let s=n.points&&e.pointsTransform?e.pointsTransform(n.points):n.path;return e.pathTransform&&(s=e.pathTransform(s)),s.toPathData(e)},we.prototype.fromSVG=function(e,t={}){return this.path.fromSVG(e,t)},we.prototype.toSVG=function(e,t){let n=this.toPathData.apply(this,[e,t]);return this.path.toSVG(e,n)},we.prototype.toDOMElement=function(e,t){e=Object.assign({},{variation:t&&t.defaultRenderOptions.variation},e);let n=this.path;return t&&t.variation&&(n=t.variation.getTransform(this,e.variation).path),n.toDOMElement(e)};var fn=we;function pn(e,t,n){Object.defineProperty(e,t,{get:function(){return typeof e[n]>"u"&&e.path,e[n]},set:function(s){e[n]=s},enumerable:!0,configurable:!0})}function os(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(let n=0;n<t.length;n++){let s=t[n];s.path.unitsPerEm=e.unitsPerEm,this.glyphs[n]=s}this.length=t&&t.length||0}typeof Symbol<"u"&&Symbol.iterator&&(os.prototype[Symbol.iterator]=function(){let e=-1;return{next:function(){e++;let t=e>=this.length-1;return{value:this.get(e),done:t}}.bind(this)}}),os.prototype.get=function(e){if(this.font._push&&this.glyphs[e]===void 0){this.font._push(e),typeof this.glyphs[e]=="function"&&(this.glyphs[e]=this.glyphs[e]());let t=this.glyphs[e],n=this.font._IndexToUnicodeMap[e];if(n)for(let s=0;s<n.unicodes.length;s++)t.addUnicode(n.unicodes[s]);this.font.cffEncoding?t.name=this.font.cffEncoding.charset[e]:this.font.glyphNames.names&&(t.name=this.font.glyphNames.glyphIndexToName(e)),this.glyphs[e].advanceWidth=this.font._hmtxTableData[e].advanceWidth,this.glyphs[e].leftSideBearing=this.font._hmtxTableData[e].leftSideBearing}else typeof this.glyphs[e]=="function"&&(this.glyphs[e]=this.glyphs[e]());return this.glyphs[e]},os.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};function Ba(e,t){return new fn({index:t,font:e})}function _a(e,t,n,s,r,o){return function(){let i=new fn({index:t,font:e});return i.path=function(){n(i,s,r);let a=o(e.glyphs,i);return a.unitsPerEm=e.unitsPerEm,a},pn(i,"numberOfContours","_numberOfContours"),pn(i,"xMin","_xMin"),pn(i,"xMax","_xMax"),pn(i,"yMin","_yMin"),pn(i,"yMax","_yMax"),pn(i,"points","_points"),i}}function Ga(e,t,n,s,r){return function(){let o=new fn({index:t,font:e});return o.path=function(){let i=n(e,o,s,r);return i.unitsPerEm=e.unitsPerEm,i},o}}var mt={GlyphSet:os,glyphLoader:Ba,ttfGlyphLoader:_a,cffGlyphLoader:Ga};function Qr(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!Qr(e[n],t[n]))return!1;return!0}else return!1}var Jr=10;function is(e){let t;return e.length<1240?t=107:e.length<33900?t=1131:t=32768,t}function yt(e,t,n,s){let r=[],o=[],i=s>1?F.getULong(e,t):F.getCard16(e,t),a=s>1?4:2,l,c;if(i!==0){let u=F.getByte(e,t+a);l=t+(i+1)*u+a;let m=t+a+1;for(let d=0;d<i+1;d+=1)r.push(F.getOffset(e,m,u)),m+=u;c=l+r[i]}else c=t+a;for(let u=0;u<r.length-1;u+=1){let m=F.getBytes(e,l+r[u],l+r[u+1]);n&&(m=n(m,e,t,s)),o.push(m)}return{objects:o,startOffset:t,endOffset:c}}function Ha(e,t,n){let s=[],r=n>1?F.getULong(e,t):F.getCard16(e,t),o=n>1?4:2,i,a;if(r!==0){let l=F.getByte(e,t+o);i=t+(r+1)*l+o;let c=t+o+1;for(let u=0;u<r+1;u+=1)s.push(F.getOffset(e,c,l)),c+=l;a=i+s[r]}else a=t+o;return{offsets:s,startOffset:t,endOffset:a}}function Va(e,t,n,s,r,o){let i=o>1?F.getULong(n,s):F.getCard16(n,s),a=o>1?4:2,l=0;if(i!==0){let u=F.getByte(n,s+a);l=s+(i+1)*u+a}let c=F.getBytes(n,l+t[e],l+t[e+1]);return r&&(c=r(c)),c}function za(e){let t="",s=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){let r=e.parseByte(),o=r>>4,i=r&15;if(o===15||(t+=s[o],i===15))break;t+=s[i]}return parseFloat(t)}function ja(e,t){let n,s,r,o;if(t===28)return n=e.parseByte(),s=e.parseByte(),n<<8|s;if(t===29)return n=e.parseByte(),s=e.parseByte(),r=e.parseByte(),o=e.parseByte(),n<<24|s<<16|r<<8|o;if(t===30)return za(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return n=e.parseByte(),(t-247)*256+n+108;if(t>=251&&t<=254)return n=e.parseByte(),-(t-251)*256-n-108;throw new Error("Invalid b0 "+t)}function Wa(e){let t={};for(let n=0;n<e.length;n+=1){let s=e[n][0],r=e[n][1],o;if(r.length===1?o=r[0]:o=r,Object.prototype.hasOwnProperty.call(t,s)&&!isNaN(t[s]))throw new Error("Object "+t+" already has key "+s);t[s]=o}return t}function Ps(e,t,n,s){t=t!==void 0?t:0;let r=new F.Parser(e,t),o=[],i=[];n=n!==void 0?n:e.byteLength;let a=s<2?22:28;for(;r.relativeOffset<n;){let l=r.parseByte();if(l<a){if(l===12&&(l=1200+r.parseByte()),s>1&&l===23){Ja(i);continue}o.push([l,i]),i=[]}else i.push(ja(r,l,s))}return Wa(o)}function wn(e,t){return t<=390?t=ss[t]:e?t=e[t-391]:t=void 0,t}function Ns(e,t,n){let s={},r;for(let o=0;o<t.length;o+=1){let i=t[o];if(Array.isArray(i.type)){let a=[];a.length=i.type.length;for(let l=0;l<i.type.length;l++)r=e[i.op]!==void 0?e[i.op][l]:void 0,r===void 0&&(r=i.value!==void 0&&i.value[l]!==void 0?i.value[l]:null),i.type[l]==="SID"&&(r=wn(n,r)),a[l]=r;s[i.name]=a}else r=e[i.op],r===void 0&&(r=i.value!==void 0?i.value:null),i.type==="SID"&&(r=wn(n,r)),s[i.name]=r}return s}function qa(e,t){let n={};if(n.formatMajor=F.getCard8(e,t),n.formatMinor=F.getCard8(e,t+1),n.formatMajor>2)throw new Error(`Unsupported CFF table version ${n.formatMajor}.${n.formatMinor}`);return n.size=F.getCard8(e,t+2),n.formatMajor<2?(n.offsetSize=F.getCard8(e,t+3),n.startOffset=t,n.endOffset=t+4):(n.topDictLength=F.getCard16(e,t+3),n.endOffset=t+8),n}var eo=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],to=[{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"charStrings",op:17,type:"offset"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"vstore",op:24,type:"offset"}],no=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}],so=[{name:"blueValues",op:6,type:"delta"},{name:"otherBlues",op:7,type:"delta"},{name:"familyBlues",op:7,type:"delta"},{name:"familyBlues",op:8,type:"delta"},{name:"familyOtherBlues",op:9,type:"delta"},{name:"blueScale",op:1209,type:"number",value:.039625},{name:"blueShift",op:1210,type:"number",value:7},{name:"blueFuzz",op:1211,type:"number",value:1},{name:"stdHW",op:10,type:"number"},{name:"stdVW",op:11,type:"number"},{name:"stemSnapH",op:1212,type:"number"},{name:"stemSnapV",op:1213,type:"number"},{name:"languageGroup",op:1217,type:"number",value:0},{name:"expansionFactor",op:1218,type:"number",value:.06},{name:"vsindex",op:22,type:"number",value:0},{name:"subrs",op:19,type:"offset"}],$a=[{name:"private",op:18,type:["number","offset"],value:[0,0]}];function Xa(e,t,n,s){let r=Ps(e,t,e.byteLength,s);return Ns(r,s>1?to:eo,n)}function Bs(e,t,n,s,r){let o=Ps(e,t,n,r);return Ns(o,r>1?so:no,s)}function Ya(e,t,n){let s=Ps(e,t,void 0,n);return Ns(s,$a)}function Za(e,t,n){let s=[];for(let r=0;r<n.length;r++){let o=new DataView(new Uint8Array(n[r]).buffer),i=Ya(o,0,2),a=i.private[0],l=i.private[1];if(a!==0&&l!==0){let c=Bs(e,l+t,a,[],2);if(c.subrs){let u=l+c.subrs,m=yt(e,u+t,void 0,2);i._subrs=m.objects,i._subrsBias=is(i._subrs)}i._privateDict=c}s.push(i)}return s}function _s(e,t,n,s,r){let o=[];for(let i=0;i<n.length;i+=1){let a=new DataView(new Uint8Array(n[i]).buffer),l=Xa(a,0,s,r);l._subrs=[],l._subrsBias=0,l._defaultWidthX=0,l._nominalWidthX=0;let c=r<2?l.private[0]:0,u=r<2?l.private[1]:0;if(c!==0&&u!==0){let m=Bs(e,u+t,c,s,r);if(l._defaultWidthX=m.defaultWidthX,l._nominalWidthX=m.nominalWidthX,m.subrs!==0){let d=u+m.subrs,x=yt(e,d+t,void 0,r);l._subrs=x.objects,l._subrsBias=is(l._subrs)}l._privateDict=m}o.push(l)}return o}function Ka(e,t,n,s,r){let o,i,a=new F.Parser(e,t);n-=1;let l=[".notdef"],c=a.parseCard8();if(c===0)for(let u=0;u<n;u+=1)o=a.parseSID(),r?l.push(o):l.push(wn(s,o)||o);else if(c===1)for(;l.length<=n;){o=a.parseSID(),i=a.parseCard8();for(let u=0;u<=i;u+=1)r?l.push("cid"+("00000"+o).slice(-5)):l.push(wn(s,o)||o),o+=1}else if(c===2)for(;l.length<=n;){o=a.parseSID(),i=a.parseCard16();for(let u=0;u<=i;u+=1)r?l.push("cid"+("00000"+o).slice(-5)):l.push(wn(s,o)||o),o+=1}else throw new Error("Unknown charset format "+c);return l}function Qa(e,t){let n,s={},r=new F.Parser(e,t),o=r.parseCard8();if(o===0){let i=r.parseCard8();for(let a=0;a<i;a+=1)n=r.parseCard8(),s[n]=a}else if(o===1){let i=r.parseCard8();n=1;for(let a=0;a<i;a+=1){let l=r.parseCard8(),c=r.parseCard8();for(let u=l;u<=l+c;u+=1)s[u]=n,n+=1}}else throw new Error("Unknown encoding format "+o);return s}function Ja(e){let t=e.pop();for(;e.length>t;)e.pop()}function ro(e,t){let n=e.tables.cff&&e.tables.cff.topDict&&e.tables.cff.topDict.paintType||0;return n===2&&(t.fill=null,t.stroke="black",t.strokeWidth=e.tables.cff.topDict.strokeWidth||0),n}function Gs(e,t,n,s,r){let o,i,a,l,c=new Wt,u=[],m=0,d=!1,x=!1,v=0,S=0,I,_,P,z,Y=0,re=[],ie,ae=0,me=e.tables.cff2||e.tables.cff;if(P=me.topDict._defaultWidthX,z=me.topDict._nominalWidthX,r=r||e.variation&&e.variation.get(),t.getBlendPath||(t.getBlendPath=function(U){return Gs(e,t,n,s,U)}),e.isCIDFont||s>1){let U=me.topDict._fdSelect?me.topDict._fdSelect[t.index]:0,M=me.topDict._fdArray[U];I=M._subrs,_=M._subrsBias,s>1?(re=me.topDict._vstore.itemVariationStore,Y=M._privateDict.vsindex):(P=M._defaultWidthX,z=M._nominalWidthX)}else I=me.topDict._subrs,_=me.topDict._subrsBias;let ot=ro(e,c),Z=P;function Ve(U,M){x&&ot!==2&&c.closePath(),c.moveTo(U,M),x=!0}function De(){let U;U=(u.length&1)!==0,U&&!d&&(Z=u.shift()+z),m+=u.length>>1,u.length=0,d=!0}function G(U){let M,Ee,Mt,ms,Kt,it,Fe,Ke,Le,ze,Ue,Me,ge=0;for(;ge<U.length;){let Je=U[ge];switch(ge+=1,Je){case 1:De();break;case 3:De();break;case 4:u.length>1&&!d&&(Z=u.shift()+z,d=!0),S+=u.pop(),Ve(v,S);break;case 5:for(;u.length>0;)v+=u.shift(),S+=u.shift(),c.lineTo(v,S);break;case 6:for(;u.length>0&&(v+=u.shift(),c.lineTo(v,S),u.length!==0);)S+=u.shift(),c.lineTo(v,S);break;case 7:for(;u.length>0&&(S+=u.shift(),c.lineTo(v,S),u.length!==0);)v+=u.shift(),c.lineTo(v,S);break;case 8:for(;u.length>0;)o=v+u.shift(),i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),v=a+u.shift(),S=l+u.shift(),c.curveTo(o,i,a,l,v,S);break;case 10:if(Kt=u.pop()+_,it=I[Kt],it){if(ae>=Jr){console.warn("CFF charstring subroutine call depth exceeded, skipping callsubr");break}ae++,G(it),ae--}break;case 11:if(s>1){console.error("CFF CharString operator return (11) is not supported in CFF2");break}return;case 12:switch(Je=U[ge],ge+=1,Je){case 35:o=v+u.shift(),i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),Fe=a+u.shift(),Ke=l+u.shift(),Le=Fe+u.shift(),ze=Ke+u.shift(),Ue=Le+u.shift(),Me=ze+u.shift(),v=Ue+u.shift(),S=Me+u.shift(),u.shift(),c.curveTo(o,i,a,l,Fe,Ke),c.curveTo(Le,ze,Ue,Me,v,S);break;case 34:o=v+u.shift(),i=S,a=o+u.shift(),l=i+u.shift(),Fe=a+u.shift(),Ke=l,Le=Fe+u.shift(),ze=l,Ue=Le+u.shift(),Me=S,v=Ue+u.shift(),c.curveTo(o,i,a,l,Fe,Ke),c.curveTo(Le,ze,Ue,Me,v,S);break;case 36:o=v+u.shift(),i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),Fe=a+u.shift(),Ke=l,Le=Fe+u.shift(),ze=l,Ue=Le+u.shift(),Me=ze+u.shift(),v=Ue+u.shift(),c.curveTo(o,i,a,l,Fe,Ke),c.curveTo(Le,ze,Ue,Me,v,S);break;case 37:o=v+u.shift(),i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),Fe=a+u.shift(),Ke=l+u.shift(),Le=Fe+u.shift(),ze=Ke+u.shift(),Ue=Le+u.shift(),Me=ze+u.shift(),Math.abs(Ue-v)>Math.abs(Me-S)?v=Ue+u.shift():S=Me+u.shift(),c.curveTo(o,i,a,l,Fe,Ke),c.curveTo(Le,ze,Ue,Me,v,S);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+Je),u.length=0}break;case 14:if(s>1){console.error("CFF CharString operator endchar (14) is not supported in CFF2");break}if(u.length>=4){let Qt=Fs[u.pop()],mn=Fs[u.pop()],ys=u.pop(),bs=u.pop();if(Qt&&mn){t.isComposite=!0,t.components=[];let xi=e.cffEncoding.charset.indexOf(Qt),Si=e.cffEncoding.charset.indexOf(mn);t.components.push({glyphIndex:Si,dx:0,dy:0}),t.components.push({glyphIndex:xi,dx:bs,dy:ys}),c.extend(e.glyphs.get(Si).path);let Np=e.glyphs.get(xi),rr=JSON.parse(JSON.stringify(Np.path.commands));for(let or=0;or<rr.length;or+=1){let vt=rr[or];vt.type!=="Z"&&(vt.x+=bs,vt.y+=ys),(vt.type==="Q"||vt.type==="C")&&(vt.x1+=bs,vt.y1+=ys),vt.type==="C"&&(vt.x2+=bs,vt.y2+=ys)}c.extend(rr)}}else u.length>0&&!d&&(Z=u.shift()+z,d=!0);x&&ot!==2&&(c.closePath(),x=!1);break;case 15:if(s<2){console.error("CFF2 CharString operator vsindex (15) is not supported in CFF");break}Y=u.pop();break;case 16:if(s<2){console.error("CFF2 CharString operator blend (16) is not supported in CFF");break}ie||(ie=e.variation&&r&&e.variation.process.getBlendVector(re,Y,r));var le=u.pop(),_e=ie?ie.length:re.itemVariationSubtables[Y].regionIndexes.length,Qe=le*_e,at=u.length-Qe,Ct=at-le;if(ie)for(let Qt=0;Qt<le;Qt++){var vi=u[Ct+Qt];for(let mn=0;mn<_e;mn++)vi+=ie[mn]*u[at++];u[Ct+Qt]=vi}for(;Qe--;)u.pop();break;case 18:De();break;case 19:case 20:De(),ge+=m+7>>3;break;case 21:u.length>2&&!d&&(Z=u.shift()+z,d=!0),S+=u.pop(),v+=u.pop(),Ve(v,S);break;case 22:u.length>1&&!d&&(Z=u.shift()+z,d=!0),v+=u.pop(),Ve(v,S);break;case 23:De();break;case 24:for(;u.length>2;)o=v+u.shift(),i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),v=a+u.shift(),S=l+u.shift(),c.curveTo(o,i,a,l,v,S);v+=u.shift(),S+=u.shift(),c.lineTo(v,S);break;case 25:for(;u.length>6;)v+=u.shift(),S+=u.shift(),c.lineTo(v,S);o=v+u.shift(),i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),v=a+u.shift(),S=l+u.shift(),c.curveTo(o,i,a,l,v,S);break;case 26:for(u.length&1&&(v+=u.shift());u.length>0;)o=v,i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),v=a,S=l+u.shift(),c.curveTo(o,i,a,l,v,S);break;case 27:for(u.length&1&&(S+=u.shift());u.length>0;)o=v+u.shift(),i=S,a=o+u.shift(),l=i+u.shift(),v=a+u.shift(),S=l,c.curveTo(o,i,a,l,v,S);break;case 28:M=U[ge],Ee=U[ge+1],u.push((M<<24|Ee<<16)>>16),ge+=2;break;case 29:if(Kt=u.pop()+e.gsubrsBias,it=e.gsubrs[Kt],it){if(ae>=Jr){console.warn("CFF charstring subroutine call depth exceeded, skipping callgsubr");break}ae++,G(it),ae--}break;case 30:for(;u.length>0&&(o=v,i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),v=a+u.shift(),S=l+(u.length===1?u.shift():0),c.curveTo(o,i,a,l,v,S),u.length!==0);)o=v+u.shift(),i=S,a=o+u.shift(),l=i+u.shift(),S=l+u.shift(),v=a+(u.length===1?u.shift():0),c.curveTo(o,i,a,l,v,S);break;case 31:for(;u.length>0&&(o=v+u.shift(),i=S,a=o+u.shift(),l=i+u.shift(),S=l+u.shift(),v=a+(u.length===1?u.shift():0),c.curveTo(o,i,a,l,v,S),u.length!==0);)o=v,i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),v=a+u.shift(),S=l+(u.length===1?u.shift():0),c.curveTo(o,i,a,l,v,S);break;default:Je<32?console.log("Glyph "+t.index+": unknown operator "+Je):Je<247?u.push(Je-139):Je<251?(M=U[ge],ge+=1,u.push((Je-247)*256+M+108)):Je<255?(M=U[ge],ge+=1,u.push(-(Je-251)*256-M-108)):(M=U[ge],Ee=U[ge+1],Mt=U[ge+2],ms=U[ge+3],ge+=4,u.push((M<<24|Ee<<16|Mt<<8|ms)/65536))}}}return G(n),e.variation&&r&&(c.commands=c.commands.map(U=>{let M=Object.keys(U);for(let Ee=0;Ee<M.length;Ee++){let Mt=M[Ee];Mt!=="type"&&(U[Mt]=Math.round(U[Mt]))}return U})),d&&(t.advanceWidth=Z),c}function oo(e,t,n,s,r){let o=[],i,a=new F.Parser(e,t),l=a.parseCard8();if(l===0)for(let c=0;c<n;c++){if(i=a.parseCard8(),i>=s)throw new Error("CFF table CID Font FDSelect has bad FD index value "+i+" (FD count "+s+")");o.push(i)}else if(l===3||r>1&&l===4){let c=l===4?a.parseULong():a.parseCard16(),u=l===4?a.parseULong():a.parseCard16();if(u!==0)throw new Error(`CFF Table CID Font FDSelect format ${l} range has bad initial GID ${u}`);let m;for(let d=0;d<c;d++){if(i=l===4?a.parseUShort():a.parseCard8(),m=l===4?a.parseULong():a.parseCard16(),i>=s)throw new Error("CFF table CID Font FDSelect has bad FD index value "+i+" (FD count "+s+")");if(m>n)throw new Error(`CFF Table CID Font FDSelect format ${r} range has bad GID ${m}`);for(;u<m;u++)o.push(i);u=m}if(m!==n)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final (Sentinal) GID "+m)}else throw new Error("CFF Table CID Font FDSelect table has unsupported format "+l);return o}function el(e,t,n,s){let r,o=qa(e,t);o.formatMajor===2?r=n.tables.cff2={}:r=n.tables.cff={};let i=o.formatMajor>1?null:yt(e,o.endOffset,F.bytesToString),a=o.formatMajor>1?null:yt(e,i.endOffset),l=o.formatMajor>1?null:yt(e,a.endOffset,F.bytesToString),c=yt(e,o.formatMajor>1?t+o.size+o.topDictLength:l.endOffset,void 0,o.formatMajor);n.gsubrs=c.objects,n.gsubrsBias=is(n.gsubrs);let u;if(o.formatMajor>1){let d=t+o.size,x=F.getBytes(e,d,d+o.topDictLength);u=_s(e,0,[x],void 0,o.formatMajor)[0]}else{let d=_s(e,t,a.objects,l.objects,o.formatMajor);if(d.length!==1)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+d.length);u=d[0]}if(r.topDict=u,u._privateDict&&(n.defaultWidthX=u._privateDict.defaultWidthX,n.nominalWidthX=u._privateDict.nominalWidthX),o.formatMajor<2&&u.ros[0]!==void 0&&u.ros[1]!==void 0&&(n.isCIDFont=!0),o.formatMajor>1){let d=u.fdArray,x=u.fdSelect;if(!d)throw new Error("This is a CFF2 font, but FDArray information is missing");let v=yt(e,t+d,null,o.formatMajor),S=Za(e,t,v.objects);u._fdArray=S,x&&(u._fdSelect=oo(e,t+x,n.numGlyphs,S.length,o.formatMajor))}else if(n.isCIDFont){let d=u.fdArray,x=u.fdSelect;if(d===0||x===0)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");d+=t;let v=yt(e,d),S=_s(e,t,v.objects,l.objects,o.formatMajor);u._fdArray=S,x+=t,u._fdSelect=oo(e,x,n.numGlyphs,S.length,o.formatMajor)}if(o.formatMajor<2){let d=t+u.private[1],x=Bs(e,d,u.private[0],l.objects,o.formatMajor);if(n.defaultWidthX=x.defaultWidthX,n.nominalWidthX=x.nominalWidthX,x.subrs!==0){let v=d+x.subrs,S=yt(e,v);n.subrs=S.objects,n.subrsBias=is(n.subrs)}else n.subrs=[],n.subrsBias=0}let m;if(s.lowMemory?(m=Ha(e,t+u.charStrings,o.formatMajor),n.nGlyphs=m.offsets.length-(o.formatMajor>1?1:0)):(m=yt(e,t+u.charStrings,null,o.formatMajor),n.nGlyphs=m.objects.length),o.formatMajor>1&&n.tables.maxp&&n.nGlyphs!==n.tables.maxp.numGlyphs&&console.error(`Glyph count in the CFF2 table (${n.nGlyphs}) must correspond to the glyph count in the maxp table (${n.tables.maxp.numGlyphs})`),o.formatMajor<2){let d=[],x=[];u.charset===0?d=Oa:u.charset===1?d=Ia:u.charset===2?d=wa:d=Ka(e,t+u.charset,n.nGlyphs,l.objects,n.isCIDFont),u.encoding===0?x=Fs:u.encoding===1?x=Ea:x=Qa(e,t+u.encoding),n.cffEncoding=new Xr(x,d),n.encoding=n.encoding||n.cffEncoding}if(n.glyphs=new mt.GlyphSet(n),s.lowMemory)n._push=function(d){let x=Va(d,m.offsets,e,t+u.charStrings,void 0,o.formatMajor);n.glyphs.push(d,mt.cffGlyphLoader(n,d,Gs,x,o.formatMajor))};else for(let d=0;d<n.nGlyphs;d+=1){let x=m.objects[d];n.glyphs.push(d,mt.cffGlyphLoader(n,d,Gs,x,o.formatMajor))}if(u.vstore){let d=new F.Parser(e,t+u.vstore);u._vstore=d.parseVariationStore()}}function io(e,t){let n,s=ss.indexOf(e);return s>=0&&(n=s),s=t.indexOf(e),s>=0?n=s+ss.length:(n=ss.length+t.length,t.push(e)),n}function tl(){return new A.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function nl(e){let t=new A.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);t.names=[];for(let n=0;n<e.length;n+=1)t.names.push({name:"name_"+n,type:"NAME",value:e[n]});return t}function ao(e,t,n){let s={};for(let r=0;r<e.length;r+=1){let o=e[r],i=t[o.name];i!==void 0&&!Qr(i,o.value)&&(o.type==="SID"&&(i=io(i,n)),s[o.op]={name:o.name,type:o.type,value:i})}return s}function lo(e,t,n){let s=new A.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return s.dict=ao(n>1?to:eo,e,t),s}function uo(e){let t=new A.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}function sl(e){let t=new A.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);t.strings=[];for(let n=0;n<e.length;n+=1)t.strings.push({name:"string_"+n,type:"STRING",value:e[n]});return t}function rl(){return new A.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function ol(e,t){let n=new A.Record("Charsets",[{name:"format",type:"Card8",value:0}]);for(let s=0;s<e.length;s+=1){let r=e[s],o=io(r,t);n.fields.push({name:"glyph_"+s,type:"SID",value:o})}return n}function il(e,t){let n=[],s=e.path;t<2&&n.push({name:"width",type:"NUMBER",value:e.advanceWidth});let r=0,o=0;for(let i=0;i<s.commands.length;i+=1){let a,l,c=s.commands[i];if(c.type==="Q"){let u=.3333333333333333,m=2/3;c={type:"C",x:c.x,y:c.y,x1:Math.round(u*r+m*c.x1),y1:Math.round(u*o+m*c.y1),x2:Math.round(u*c.x+m*c.x1),y2:Math.round(u*c.y+m*c.y1)}}if(c.type==="M")a=Math.round(c.x-r),l=Math.round(c.y-o),n.push({name:"dx",type:"NUMBER",value:a}),n.push({name:"dy",type:"NUMBER",value:l}),n.push({name:"rmoveto",type:"OP",value:21}),r=Math.round(c.x),o=Math.round(c.y);else if(c.type==="L")a=Math.round(c.x-r),l=Math.round(c.y-o),n.push({name:"dx",type:"NUMBER",value:a}),n.push({name:"dy",type:"NUMBER",value:l}),n.push({name:"rlineto",type:"OP",value:5}),r=Math.round(c.x),o=Math.round(c.y);else if(c.type==="C"){let u=Math.round(c.x1-r),m=Math.round(c.y1-o),d=Math.round(c.x2-c.x1),x=Math.round(c.y2-c.y1);a=Math.round(c.x-c.x2),l=Math.round(c.y-c.y2),n.push({name:"dx1",type:"NUMBER",value:u}),n.push({name:"dy1",type:"NUMBER",value:m}),n.push({name:"dx2",type:"NUMBER",value:d}),n.push({name:"dy2",type:"NUMBER",value:x}),n.push({name:"dx",type:"NUMBER",value:a}),n.push({name:"dy",type:"NUMBER",value:l}),n.push({name:"rrcurveto",type:"OP",value:8}),r=Math.round(c.x),o=Math.round(c.y)}}return t<2&&n.push({name:"endchar",type:"OP",value:14}),n}function al(e,t){let n=new A.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]);for(let s=0;s<e.length;s+=1){let r=e.get(s),o=il(r,t);n.charStrings.push({name:r.name,type:"CHARSTRING",value:o})}return n}function ll(e,t,n){let s=new A.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return s.dict=ao(n>1?so:no,e,t),s}function ul(e,t){let s=new A.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),r=1/t.unitsPerEm,o={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[r,0,0,r,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},i=t&&t.topDict||{};i.paintType&&(o.paintType=i.paintType,o.strokeWidth=i.strokeWidth||0);let a={},l=[],c;for(let x=1;x<e.length;x+=1)c=e.get(x),l.push(c.name);let u=[];s.header=tl(),s.nameIndex=nl([t.postScriptName]);let m=lo(o,u);s.topDictIndex=uo(m),s.globalSubrIndex=rl(),s.charsets=ol(l,u),s.charStringsIndex=al(e,1),s.privateDict=ll(a,u),s.stringIndex=sl(u);let d=s.header.sizeOf()+s.nameIndex.sizeOf()+s.topDictIndex.sizeOf()+s.stringIndex.sizeOf()+s.globalSubrIndex.sizeOf();return o.charset=d,o.encoding=0,o.charStrings=o.charset+s.charsets.sizeOf(),o.private[1]=o.charStrings+s.charStringsIndex.sizeOf(),m=lo(o,u),s.topDictIndex=uo(m),s}var Hs={parse:el,make:ul};function cl(e,t){let n={},s=new F.Parser(e,t);return n.version=s.parseVersion(),n.fontRevision=Math.round(s.parseFixed()*1e3)/1e3,n.checkSumAdjustment=s.parseULong(),n.magicNumber=s.parseULong(),B.argument(n.magicNumber===1594834165,"Font header has wrong magic number."),n.flags=s.parseUShort(),n.unitsPerEm=s.parseUShort(),n.created=s.parseLongDateTime(),n.modified=s.parseLongDateTime(),n.xMin=s.parseShort(),n.yMin=s.parseShort(),n.xMax=s.parseShort(),n.yMax=s.parseShort(),n.macStyle=s.parseUShort(),n.lowestRecPPEM=s.parseUShort(),n.fontDirectionHint=s.parseShort(),n.indexToLocFormat=s.parseShort(),n.glyphDataFormat=s.parseShort(),n}function fl(e){let t=Math.round(new Date().getTime()/1e3)+2082844800,n=t,s=e.macStyle||0;return e.createdTimestamp&&(n=e.createdTimestamp+2082844800),new A.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:n},{name:"modified",type:"LONGDATETIME",value:t},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:s},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],e)}var co={parse:cl,make:fl};function pl(e,t){let n={},s=new F.Parser(e,t);return n.version=s.parseVersion(),n.ascender=s.parseShort(),n.descender=s.parseShort(),n.lineGap=s.parseShort(),n.advanceWidthMax=s.parseUShort(),n.minLeftSideBearing=s.parseShort(),n.minRightSideBearing=s.parseShort(),n.xMaxExtent=s.parseShort(),n.caretSlopeRise=s.parseShort(),n.caretSlopeRun=s.parseShort(),n.caretOffset=s.parseShort(),s.relativeOffset+=8,n.metricDataFormat=s.parseShort(),n.numberOfHMetrics=s.parseUShort(),n}function hl(e){return new A.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],e)}var fo={parse:pl,make:hl};function dl(e,t,n,s,r){let o,i,a=new F.Parser(e,t);for(let l=0;l<s;l+=1){l<n&&(o=a.parseUShort(),i=a.parseShort());let c=r.get(l);c.advanceWidth=o,c.leftSideBearing=i}}function gl(e,t,n,s,r){e._hmtxTableData={};let o,i,a=new F.Parser(t,n);for(let l=0;l<r;l+=1)l<s&&(o=a.parseUShort(),i=a.parseShort()),e._hmtxTableData[l]={advanceWidth:o,leftSideBearing:i}}function ml(e,t,n,s,r,o,i){i.lowMemory?gl(e,t,n,s,r):dl(t,n,s,r,o)}function yl(e){let t=new A.Table("hmtx",[]);for(let n=0;n<e.length;n+=1){let s=e.get(n),r=s.advanceWidth||0,o=s.leftSideBearing||0;t.fields.push({name:"advanceWidth_"+n,type:"USHORT",value:r}),t.fields.push({name:"leftSideBearing_"+n,type:"SHORT",value:o})}return t}var po={parse:ml,make:yl};function bl(e){let t=new A.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]),n="",s=12+e.length*4;for(let r=0;r<e.length;++r){let o=n.indexOf(e[r]);o<0&&(o=n.length,n+=e[r]),t.fields.push({name:"offset "+r,type:"USHORT",value:s+o}),t.fields.push({name:"length "+r,type:"USHORT",value:e[r].length})}return t.fields.push({name:"stringPool",type:"CHARARRAY",value:n}),t}function vl(e,t){let n=new F.Parser(e,t),s=n.parseULong();B.argument(s===1,"Unsupported ltag table version."),n.skip("uLong",1);let r=n.parseULong(),o=[];for(let i=0;i<r;i++){let a="",l=t+n.parseUShort(),c=n.parseUShort();for(let u=l;u<l+c;++u)a+=String.fromCharCode(e.getInt8(u));o.push(a)}return o}var ho={make:bl,parse:vl};function xl(e,t){let n={},s=new F.Parser(e,t);return n.version=s.parseVersion(),n.numGlyphs=s.parseUShort(),n.version===1&&(n.maxPoints=s.parseUShort(),n.maxContours=s.parseUShort(),n.maxCompositePoints=s.parseUShort(),n.maxCompositeContours=s.parseUShort(),n.maxZones=s.parseUShort(),n.maxTwilightPoints=s.parseUShort(),n.maxStorage=s.parseUShort(),n.maxFunctionDefs=s.parseUShort(),n.maxInstructionDefs=s.parseUShort(),n.maxStackElements=s.parseUShort(),n.maxSizeOfInstructions=s.parseUShort(),n.maxComponentElements=s.parseUShort(),n.maxComponentDepth=s.parseUShort()),n}function Sl(e){return new A.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])}var go={parse:xl,make:Sl},Vs=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];function kl(e){for(let t=0;t<Vs.length;t+=1){let n=Vs[t];if(e>=n.begin&&e<n.end)return t}return-1}function Tl(e,t){let n={},s=new F.Parser(e,t);n.version=s.parseUShort(),n.xAvgCharWidth=s.parseShort(),n.usWeightClass=s.parseUShort(),n.usWidthClass=s.parseUShort(),n.fsType=s.parseUShort(),n.ySubscriptXSize=s.parseShort(),n.ySubscriptYSize=s.parseShort(),n.ySubscriptXOffset=s.parseShort(),n.ySubscriptYOffset=s.parseShort(),n.ySuperscriptXSize=s.parseShort(),n.ySuperscriptYSize=s.parseShort(),n.ySuperscriptXOffset=s.parseShort(),n.ySuperscriptYOffset=s.parseShort(),n.yStrikeoutSize=s.parseShort(),n.yStrikeoutPosition=s.parseShort(),n.sFamilyClass=s.parseShort(),n.panose=[];for(let r=0;r<10;r++)n.panose[r]=s.parseByte();return n.ulUnicodeRange1=s.parseULong(),n.ulUnicodeRange2=s.parseULong(),n.ulUnicodeRange3=s.parseULong(),n.ulUnicodeRange4=s.parseULong(),n.achVendID=String.fromCharCode(s.parseByte(),s.parseByte(),s.parseByte(),s.parseByte()),n.fsSelection=s.parseUShort(),n.usFirstCharIndex=s.parseUShort(),n.usLastCharIndex=s.parseUShort(),n.sTypoAscender=s.parseShort(),n.sTypoDescender=s.parseShort(),n.sTypoLineGap=s.parseShort(),n.usWinAscent=s.parseUShort(),n.usWinDescent=s.parseUShort(),n.version>=1&&(n.ulCodePageRange1=s.parseULong(),n.ulCodePageRange2=s.parseULong()),n.version>=2&&(n.sxHeight=s.parseShort(),n.sCapHeight=s.parseShort(),n.usDefaultChar=s.parseUShort(),n.usBreakChar=s.parseUShort(),n.usMaxContent=s.parseUShort()),n}function Cl(e){return new A.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)}var zs={parse:Tl,make:Cl,unicodeRanges:Vs,getUnicodeRange:kl};function Ol(e,t){let n={},s=new F.Parser(e,t);switch(n.version=s.parseVersion(),n.italicAngle=s.parseFixed(),n.underlinePosition=s.parseShort(),n.underlineThickness=s.parseShort(),n.isFixedPitch=s.parseULong(),n.minMemType42=s.parseULong(),n.maxMemType42=s.parseULong(),n.minMemType1=s.parseULong(),n.maxMemType1=s.parseULong(),n.version){case 1:n.names=qt.slice();break;case 2:n.numberOfGlyphs=s.parseUShort(),n.glyphNameIndex=new Array(n.numberOfGlyphs);for(let r=0;r<n.numberOfGlyphs;r++)n.glyphNameIndex[r]=s.parseUShort();n.names=[];for(let r=0;r<n.numberOfGlyphs;r++)if(n.glyphNameIndex[r]>=qt.length){let o=s.parseChar();n.names.push(s.parseString(o))}break;case 2.5:n.numberOfGlyphs=s.parseUShort(),n.offset=new Array(n.numberOfGlyphs);for(let r=0;r<n.numberOfGlyphs;r++)n.offset[r]=s.parseChar();break}return n}function Il(e){let{italicAngle:t=Math.round((e.italicAngle||0)*65536),underlinePosition:n=0,underlineThickness:s=0,isFixedPitch:r=0,minMemType42:o=0,maxMemType42:i=0,minMemType1:a=0,maxMemType1:l=0}=e.tables.post||{};return new A.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:t},{name:"underlinePosition",type:"FWORD",value:n},{name:"underlineThickness",type:"FWORD",value:s},{name:"isFixedPitch",type:"ULONG",value:r},{name:"minMemType42",type:"ULONG",value:o},{name:"maxMemType42",type:"ULONG",value:i},{name:"minMemType1",type:"ULONG",value:a},{name:"maxMemType1",type:"ULONG",value:l}])}var mo={parse:Ol,make:Il},st=new Array(9);st[1]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();if(n===1)return{substFormat:1,coverage:this.parsePointer(C.coverage),deltaGlyphId:this.parseShort()};if(n===2)return{substFormat:2,coverage:this.parsePointer(C.coverage),substitute:this.parseOffset16List()};B.assert(!1,"0x"+t.toString(16)+": lookup type 1 format must be 1 or 2.")},st[2]=function(){let t=this.parseUShort();return B.argument(t===1,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(C.coverage),sequences:this.parseListOfLists()}},st[3]=function(){let t=this.parseUShort();return B.argument(t===1,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(C.coverage),alternateSets:this.parseListOfLists()}},st[4]=function(){let t=this.parseUShort();return B.argument(t===1,"GSUB ligature table identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(C.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var hn={sequenceIndex:C.uShort,lookupListIndex:C.uShort};st[5]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();if(n===1)return{substFormat:n,coverage:this.parsePointer(C.coverage),ruleSets:this.parseListOfLists(function(){let s=this.parseUShort(),r=this.parseUShort();return{input:this.parseUShortList(s-1),lookupRecords:this.parseRecordList(r,hn)}})};if(n===2)return{substFormat:n,coverage:this.parsePointer(C.coverage),classDef:this.parsePointer(C.classDef),classSets:this.parseListOfLists(function(){let s=this.parseUShort(),r=this.parseUShort();return{classes:this.parseUShortList(s-1),lookupRecords:this.parseRecordList(r,hn)}})};if(n===3){let s=this.parseUShort(),r=this.parseUShort();return{substFormat:n,coverages:this.parseList(s,C.pointer(C.coverage)),lookupRecords:this.parseRecordList(r,hn)}}B.assert(!1,"0x"+t.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},st[6]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();if(n===1)return{substFormat:1,coverage:this.parsePointer(C.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(hn)}})};if(n===2)return{substFormat:2,coverage:this.parsePointer(C.coverage),backtrackClassDef:this.parsePointer(C.classDef),inputClassDef:this.parsePointer(C.classDef),lookaheadClassDef:this.parsePointer(C.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(hn)}})};if(n===3)return{substFormat:3,backtrackCoverage:this.parseList(C.pointer(C.coverage)),inputCoverage:this.parseList(C.pointer(C.coverage)),lookaheadCoverage:this.parseList(C.pointer(C.coverage)),lookupRecords:this.parseRecordList(hn)};B.assert(!1,"0x"+t.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},st[7]=function(){let t=this.parseUShort();B.argument(t===1,"GSUB Extension Substitution subtable identifier-format must be 1");let n=this.parseUShort(),s=new C(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:n,extension:st[n].call(s)}},st[8]=function(){let t=this.parseUShort();return B.argument(t===1,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(C.coverage),backtrackCoverage:this.parseList(C.pointer(C.coverage)),lookaheadCoverage:this.parseList(C.pointer(C.coverage)),substitutes:this.parseUShortList()}};function wl(e,t){t=t||0;let n=new C(e,t),s=n.parseVersion(1);return B.argument(s===1||s===1.1,"Unsupported GSUB table version."),s===1?{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(st)}:{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(st),variations:n.parseFeatureVariationsList()}}var Xt=new Array(9);Xt[1]=function(t){if(t.substFormat===1)return new A.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new A.Coverage(t.coverage)},{name:"deltaGlyphID",type:"SHORT",value:t.deltaGlyphId}]);if(t.substFormat===2)return new A.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new A.Coverage(t.coverage)}].concat(A.ushortList("substitute",t.substitute)));B.fail("Lookup type 1 substFormat must be 1 or 2.")},Xt[2]=function(t){return B.assert(t.substFormat===1,"Lookup type 2 substFormat must be 1."),new A.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new A.Coverage(t.coverage)}].concat(A.tableList("seqSet",t.sequences,function(n){return new A.Table("sequenceSetTable",A.ushortList("sequence",n))})))},Xt[3]=function(t){return B.assert(t.substFormat===1,"Lookup type 3 substFormat must be 1."),new A.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new A.Coverage(t.coverage)}].concat(A.tableList("altSet",t.alternateSets,function(n){return new A.Table("alternateSetTable",A.ushortList("alternate",n))})))},Xt[4]=function(t){return B.assert(t.substFormat===1,"Lookup type 4 substFormat must be 1."),new A.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new A.Coverage(t.coverage)}].concat(A.tableList("ligSet",t.ligatureSets,function(n){return new A.Table("ligatureSetTable",A.tableList("ligature",n,function(s){return new A.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:s.ligGlyph}].concat(A.ushortList("component",s.components,s.components.length+1)))}))})))},Xt[5]=function(t){if(t.substFormat===1)return new A.Table("contextualSubstitutionTable",[{name:"substFormat",type:"USHORT",value:t.substFormat},{name:"coverage",type:"TABLE",value:new A.Coverage(t.coverage)}].concat(A.tableList("sequenceRuleSet",t.ruleSets,function(n){return n?new A.Table("sequenceRuleSetTable",A.tableList("sequenceRule",n,function(s){let r=A.ushortList("seqLookup",[],s.lookupRecords.length).concat(A.ushortList("inputSequence",s.input,s.input.length+1));[r[0],r[1]]=[r[1],r[0]];for(let o=0;o<s.lookupRecords.length;o++){let i=s.lookupRecords[o];r=r.concat({name:"sequenceIndex"+o,type:"USHORT",value:i.sequenceIndex}).concat({name:"lookupListIndex"+o,type:"USHORT",value:i.lookupListIndex})}return new A.Table("sequenceRuleTable",r)})):new A.Table("NULL",null)})));if(t.substFormat===2)return new A.Table("contextualSubstitutionTable",[{name:"substFormat",type:"USHORT",value:t.substFormat},{name:"coverage",type:"TABLE",value:new A.Coverage(t.coverage)},{name:"classDef",type:"TABLE",value:new A.ClassDef(t.classDef)}].concat(A.tableList("classSeqRuleSet",t.classSets,function(n){return n?new A.Table("classSeqRuleSetTable",A.tableList("classSeqRule",n,function(s){let r=A.ushortList("classes",s.classes,s.classes.length+1).concat(A.ushortList("seqLookupCount",[],s.lookupRecords.length));for(let o=0;o<s.lookupRecords.length;o++){let i=s.lookupRecords[o];r=r.concat({name:"sequenceIndex"+o,type:"USHORT",value:i.sequenceIndex}).concat({name:"lookupListIndex"+o,type:"USHORT",value:i.lookupListIndex})}return new A.Table("classSeqRuleTable",r)})):new A.Table("NULL",null)})));if(t.substFormat===3){let n=[{name:"substFormat",type:"USHORT",value:t.substFormat}];n.push({name:"inputGlyphCount",type:"USHORT",value:t.coverages.length}),n.push({name:"substitutionCount",type:"USHORT",value:t.lookupRecords.length});for(let r=0;r<t.coverages.length;r++){let o=t.coverages[r];n.push({name:"inputCoverage"+r,type:"TABLE",value:new A.Coverage(o)})}for(let r=0;r<t.lookupRecords.length;r++){let o=t.lookupRecords[r];n=n.concat({name:"sequenceIndex"+r,type:"USHORT",value:o.sequenceIndex}).concat({name:"lookupListIndex"+r,type:"USHORT",value:o.lookupListIndex})}return new A.Table("contextualSubstitutionTable",n)}B.assert(!1,"lookup type 5 format must be 1, 2 or 3.")},Xt[6]=function(t){if(t.substFormat===1)return new A.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:t.substFormat},{name:"coverage",type:"TABLE",value:new A.Coverage(t.coverage)}].concat(A.tableList("chainRuleSet",t.chainRuleSets,function(s){return new A.Table("chainRuleSetTable",A.tableList("chainRule",s,function(r){let o=A.ushortList("backtrackGlyph",r.backtrack,r.backtrack.length).concat(A.ushortList("inputGlyph",r.input,r.input.length+1)).concat(A.ushortList("lookaheadGlyph",r.lookahead,r.lookahead.length)).concat(A.ushortList("substitution",[],r.lookupRecords.length));for(let i=0;i<r.lookupRecords.length;i++){let a=r.lookupRecords[i];o=o.concat({name:"sequenceIndex"+i,type:"USHORT",value:a.sequenceIndex}).concat({name:"lookupListIndex"+i,type:"USHORT",value:a.lookupListIndex})}return new A.Table("chainRuleTable",o)}))})));if(t.substFormat===2)B.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(t.substFormat===3){let n=[{name:"substFormat",type:"USHORT",value:t.substFormat}];n.push({name:"backtrackGlyphCount",type:"USHORT",value:t.backtrackCoverage.length});for(let r=0;r<t.backtrackCoverage.length;r++){let o=t.backtrackCoverage[r];n.push({name:"backtrackCoverage"+r,type:"TABLE",value:new A.Coverage(o)})}n.push({name:"inputGlyphCount",type:"USHORT",value:t.inputCoverage.length});for(let r=0;r<t.inputCoverage.length;r++){let o=t.inputCoverage[r];n.push({name:"inputCoverage"+r,type:"TABLE",value:new A.Coverage(o)})}n.push({name:"lookaheadGlyphCount",type:"USHORT",value:t.lookaheadCoverage.length});for(let r=0;r<t.lookaheadCoverage.length;r++){let o=t.lookaheadCoverage[r];n.push({name:"lookaheadCoverage"+r,type:"TABLE",value:new A.Coverage(o)})}n.push({name:"substitutionCount",type:"USHORT",value:t.lookupRecords.length});for(let r=0;r<t.lookupRecords.length;r++){let o=t.lookupRecords[r];n=n.concat({name:"sequenceIndex"+r,type:"USHORT",value:o.sequenceIndex}).concat({name:"lookupListIndex"+r,type:"USHORT",value:o.lookupListIndex})}return new A.Table("chainContextTable",n)}B.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};function El(e){return new A.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new A.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new A.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new A.LookupList(e.lookups,Xt)}])}var yo={parse:wl,make:El};function Ll(e,t){let n=new F.Parser(e,t),s=n.parseULong();B.argument(s===1,"Unsupported META table version."),n.parseULong(),n.parseULong();let r=n.parseULong(),o={};for(let i=0;i<r;i++){let a=n.parseTag(),l=n.parseULong(),c=n.parseULong();if(a==="appl"||a==="bild")continue;let u=an.UTF8(e,t+l,c);o[a]=u}return o}function Al(e){let t=Object.keys(e).length,n="",s=16+t*12,r=new A.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:s},{name:"numTags",type:"ULONG",value:t}]);for(let o in e){let i=n.length;n+=e[o],r.fields.push({name:"tag "+o,type:"TAG",value:o}),r.fields.push({name:"offset "+o,type:"ULONG",value:s+i}),r.fields.push({name:"length "+o,type:"ULONG",value:e[o].length})}return r.fields.push({name:"stringPool",type:"CHARARRAY",value:n}),r}var bo={parse:Ll,make:Al};function Rl(e,t){let n=new C(e,t),s=n.parseUShort();s!==0&&console.warn("Only COLRv0 is currently fully supported. A subset of color glyphs might be available in this font if provided in the v0 format.");let r=n.parseUShort(),o=n.parseOffset32(),i=n.parseOffset32(),a=n.parseUShort();n.relativeOffset=o;let l=n.parseRecordList(r,{glyphID:C.uShort,firstLayerIndex:C.uShort,numLayers:C.uShort});n.relativeOffset=i;let c=n.parseRecordList(a,{glyphID:C.uShort,paletteIndex:C.uShort});return{version:s,baseGlyphRecords:l,layerRecords:c}}function Dl({version:e=0,baseGlyphRecords:t=[],layerRecords:n=[]}){B.argument(e===0,"Only COLRv0 supported.");let s=14,r=s+t.length*6;return new A.Table("COLR",[{name:"version",type:"USHORT",value:e},{name:"numBaseGlyphRecords",type:"USHORT",value:t.length},{name:"baseGlyphRecordsOffset",type:"ULONG",value:s},{name:"layerRecordsOffset",type:"ULONG",value:r},{name:"numLayerRecords",type:"USHORT",value:n.length},...t.map((o,i)=>[{name:"glyphID_"+i,type:"USHORT",value:o.glyphID},{name:"firstLayerIndex_"+i,type:"USHORT",value:o.firstLayerIndex},{name:"numLayers_"+i,type:"USHORT",value:o.numLayers}]).flat(),...n.map((o,i)=>[{name:"LayerGlyphID_"+i,type:"USHORT",value:o.glyphID},{name:"paletteIndex_"+i,type:"USHORT",value:o.paletteIndex}]).flat()])}var vo={parse:Rl,make:Dl};function Fl(e,t){return[{name:"tag_"+e,type:"TAG",value:t.tag},{name:"minValue_"+e,type:"FIXED",value:t.minValue<<16},{name:"defaultValue_"+e,type:"FIXED",value:t.defaultValue<<16},{name:"maxValue_"+e,type:"FIXED",value:t.maxValue<<16},{name:"flags_"+e,type:"USHORT",value:0},{name:"nameID_"+e,type:"USHORT",value:t.axisNameID}]}function Ul(e,t,n){let s={},r=new F.Parser(e,t);s.tag=r.parseTag(),s.minValue=r.parseFixed(),s.defaultValue=r.parseFixed(),s.maxValue=r.parseFixed(),r.skip("uShort",1);let o=r.parseUShort();return s.axisNameID=o,s.name=ns(n,o),s}function Ml(e,t,n,s={}){let r=[{name:"nameID_"+e,type:"USHORT",value:t.subfamilyNameID},{name:"flags_"+e,type:"USHORT",value:0}];for(let o=0;o<n.length;++o){let i=n[o].tag;r.push({name:"axis_"+e+" "+i,type:"FIXED",value:t.coordinates[i]<<16})}return s&&s.postScriptNameID&&r.push({name:"postScriptNameID_",type:"USHORT",value:t.postScriptNameID!==void 0?t.postScriptNameID:65535}),r}function Pl(e,t,n,s,r){let o={},i=new F.Parser(e,t),a=i.parseUShort();o.subfamilyNameID=a,o.name=ns(s,a,[2,17]),i.skip("uShort",1),o.coordinates={};for(let c=0;c<n.length;++c)o.coordinates[n[c].tag]=i.parseFixed();if(i.relativeOffset===r)return o.postScriptNameID=void 0,o.postScriptName=void 0,o;let l=i.parseUShort();return o.postScriptNameID=l==65535?void 0:l,o.postScriptName=o.postScriptNameID!==void 0?ns(s,l,[6]):"",o}function Nl(e,t){let n=new A.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:e.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:e.instances.length},{name:"instanceSize",type:"USHORT",value:4+e.axes.length*4}]);n.offsetToData=n.sizeOf();for(let r=0;r<e.axes.length;r++)n.fields=n.fields.concat(Fl(r,e.axes[r],t));let s={};for(let r=0;r<e.instances.length;r++)if(e.instances[r].postScriptNameID!==void 0){n.instanceSize+=2,s.postScriptNameID=!0;break}for(let r=0;r<e.instances.length;r++)n.fields=n.fields.concat(Ml(r,e.instances[r],e.axes,s));return n}function Bl(e,t,n){let s=new F.Parser(e,t),r=s.parseULong();B.argument(r===65536,"Unsupported fvar table version.");let o=s.parseOffset16();s.skip("uShort",1);let i=s.parseUShort(),a=s.parseUShort(),l=s.parseUShort(),c=s.parseUShort(),u=[];for(let x=0;x<i;x++)u.push(Ul(e,t+o+x*a,n));let m=[],d=t+o+i*a;for(let x=0;x<l;x++)m.push(Pl(e,d+x*c,u,n,c));return{axes:u,instances:m}}var xo={make:Nl,parse:Bl},_l={tag:C.tag,nameID:C.uShort,ordering:C.uShort},En=new Array(5);En[1]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),value:this.parseFixed()}},En[2]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),nominalValue:this.parseFixed(),rangeMinValue:this.parseFixed(),rangeMaxValue:this.parseFixed()}},En[3]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),value:this.parseFixed(),linkedValue:this.parseFixed()}},En[4]=function(){let t=this.parseUShort();return{flags:this.parseUShort(),valueNameID:this.parseUShort(),axisValues:this.parseList(t,function(){return{axisIndex:this.parseUShort(),value:this.parseFixed()}})}};function Gl(){let e=this.parseUShort(),t=En[e],n={format:e};return t===void 0?(console.warn(`Unknown axis value table format ${e}`),n):Object.assign(n,this.parseStruct(t.bind(this)))}function Hl(e,t,n){t||(t=0);let s=new F.Parser(e,t),r=s.parseUShort(),o=s.parseUShort();r!==1&&console.warn(`Unsupported STAT table version ${r}.${o}`);let i=[r,o],a=s.parseUShort(),l=s.parseUShort(),c=s.parseOffset32(),u=s.parseUShort(),m=s.parseOffset32(),d=r>1||o>0?s.parseUShort():void 0;n!==void 0&&B.argument(l>=n.axes.length,"STAT axis count must be greater than or equal to fvar axis count"),u>0&&B.argument(l>=0,"STAT axis count must be greater than 0 if STAT axis value count is greater than 0");let x=[];for(let I=0;I<l;I++)s.offset=t+c,s.relativeOffset=I*a,x.push(s.parseStruct(_l));s.offset=t,s.relativeOffset=m;let v=s.parseUShortList(u),S=[];for(let I=0;I<u;I++)s.offset=t+m,s.relativeOffset=v[I],S.push(Gl.apply(s));return{version:i,axes:x,values:S,elidedFallbackNameID:d}}var Ln=new Array(5);Ln[1]=function(t,n){return[{name:`format${t}`,type:"USHORT",value:1},{name:`axisIndex${t}`,type:"USHORT",value:n.axisIndex},{name:`flags${t}`,type:"USHORT",value:n.flags},{name:`valueNameID${t}`,type:"USHORT",value:n.valueNameID},{name:`value${t}`,type:"FLOAT",value:n.value}]},Ln[2]=function(t,n){return[{name:`format${t}`,type:"USHORT",value:2},{name:`axisIndex${t}`,type:"USHORT",value:n.axisIndex},{name:`flags${t}`,type:"USHORT",value:n.flags},{name:`valueNameID${t}`,type:"USHORT",value:n.valueNameID},{name:`nominalValue${t}`,type:"FLOAT",value:n.nominalValue},{name:`rangeMinValue${t}`,type:"FLOAT",value:n.rangeMinValue},{name:`rangeMaxValue${t}`,type:"FLOAT",value:n.rangeMaxValue}]},Ln[3]=function(t,n){return[{name:`format${t}`,type:"USHORT",value:3},{name:`axisIndex${t}`,type:"USHORT",value:n.axisIndex},{name:`flags${t}`,type:"USHORT",value:n.flags},{name:`valueNameID${t}`,type:"USHORT",value:n.valueNameID},{name:`value${t}`,type:"FLOAT",value:n.value},{name:`linkedValue${t}`,type:"FLOAT",value:n.linkedValue}]},Ln[4]=function(t,n){let s=[{name:`format${t}`,type:"USHORT",value:4},{name:`axisCount${t}`,type:"USHORT",value:n.axisValues.length},{name:`flags${t}`,type:"USHORT",value:n.flags},{name:`valueNameID${t}`,type:"USHORT",value:n.valueNameID}];for(let r=0;r<n.axisValues.length;r++)s=s.concat([{name:`format${t}axisIndex${r}`,type:"USHORT",value:n.axisValues[r].axisIndex},{name:`format${t}value${r}`,type:"FLOAT",value:n.axisValues[r].value}]);return s};function Vl(e,t){return new A.Record("axisRecord_"+e,[{name:"axisTag_"+e,type:"TAG",value:t.tag},{name:"axisNameID_"+e,type:"USHORT",value:t.nameID},{name:"axisOrdering_"+e,type:"USHORT",value:t.ordering}])}function zl(e,t){let n=t.format,s=Ln[n];B.argument(s!==void 0,`Unknown axis value table format ${n}`);let r=s(e,t);return new A.Table("axisValueTable_"+e,r)}function jl(e){let t=new A.Table("STAT",[{name:"majorVersion",type:"USHORT",value:1},{name:"minorVersion",type:"USHORT",value:2},{name:"designAxisSize",type:"USHORT",value:8},{name:"designAxisCount",type:"USHORT",value:e.axes.length},{name:"designAxesOffset",type:"ULONG",value:0},{name:"axisValueCount",type:"USHORT",value:e.values.length},{name:"offsetToAxisValueOffsets",type:"ULONG",value:0},{name:"elidedFallbackNameID",type:"USHORT",value:e.elidedFallbackNameID}]);t.designAxesOffset=t.offsetToAxisValueOffsets=t.sizeOf();for(let o=0;o<e.axes.length;o++){let i=Vl(o,e.axes[o]);t.offsetToAxisValueOffsets+=i.sizeOf(),t.fields=t.fields.concat(i.fields)}let n=[],s=[],r=e.values.length*2;for(let o=0;o<e.values.length;o++){let i=zl(o,e.values[o]);n.push({name:"offset_"+o,type:"USHORT",value:r}),r+=i.sizeOf(),s=s.concat(i.fields)}return t.fields=t.fields.concat(n),t.fields=t.fields.concat(s),t}var So={make:jl,parse:Hl};function Wl(e,t){return new A.Record("axisValueMap_"+e,[{name:"fromCoordinate_"+e,type:"F2DOT14",value:t.fromCoordinate},{name:"toCoordinate_"+e,type:"F2DOT14",value:t.toCoordinate}])}function ql(e,t){let n=new A.Record("segmentMap_"+e,[{name:"positionMapCount_"+e,type:"USHORT",value:t.axisValueMaps.length}]),s=[];for(let r=0;r<t.axisValueMaps.length;r++){let o=Wl(`${e}_${r}`,t.axisValueMaps[r]);s=s.concat(o.fields)}return n.fields=n.fields.concat(s),n}function $l(e,t){B.argument(e.axisSegmentMaps.length===t.axes.length,"avar axis count must correspond to fvar axis count");let n=new A.Table("avar",[{name:"majorVersion",type:"USHORT",value:1},{name:"minorVersion",type:"USHORT",value:0},{name:"reserved",type:"USHORT",value:0},{name:"axisCount",type:"USHORT",value:e.axisSegmentMaps.length}]);for(let s=0;s<e.axisSegmentMaps.length;s++){let r=ql(s,e.axisSegmentMaps[s]);n.fields=n.fields.concat(r.fields)}return n}function Xl(e,t,n){t||(t=0);let s=new C(e,t),r=s.parseUShort(),o=s.parseUShort();r!==1&&console.warn(`Unsupported avar table version ${r}.${o}`),s.skip("uShort",1);let i=s.parseUShort();B.argument(i===n.axes.length,"avar axis count must correspond to fvar axis count");let a=[];for(let l=0;l<i;l++){let c=[],u=s.parseUShort();for(let m=0;m<u;m++){let d=s.parseF2Dot14(),x=s.parseF2Dot14();c.push({fromCoordinate:d,toCoordinate:x})}a.push({axisValueMaps:c})}return{version:[r,o],axisSegmentMaps:a}}var ko={make:$l,parse:Xl};function Yl(e,t,n,s){let r=new F.Parser(e,t),o=r.parseTupleVariationStore(r.relativeOffset,n.axes.length,"cvar",s),i=r.parseUShort(),a=r.parseUShort();return i!==1&&console.warn(`Unsupported cvar table version ${i}.${a}`),{version:[i,a],...o}}function Zl(){console.warn("Writing of cvar tables is not yet supported.")}var To={make:Zl,parse:Yl};function Kl(e,t,n,s){let r=new F.Parser(e,t),o=r.parseUShort(),i=r.parseUShort();o!==1&&console.warn(`Unsupported gvar table version ${o}.${i}`);let a=r.parseUShort();a!==n.axes.length&&console.warn(`axisCount ${a} in gvar table does not match the number of axes ${n.axes.length} in the fvar table!`);let l=r.parseUShort(),c=r.parsePointer32(function(){return this.parseTupleRecords(l,a)}),u=r.parseTupleVariationStoreList(a,"gvar",s);return{version:[o,i],sharedTuples:c,glyphVariations:u}}function Ql(){console.warn("Writing of gvar tables is not yet supported.")}var Co={make:Ql,parse:Kl};function Jl(e,t){let n={},s=new F.Parser(e,t);n.version=s.parseUShort(),B.argument(n.version<=1,"Unsupported gasp table version."),n.numRanges=s.parseUShort(),n.gaspRanges=[];for(let r=0;r<n.numRanges;r++)n.gaspRanges[r]={rangeMaxPPEM:s.parseUShort(),rangeGaspBehavior:s.parseUShort()};return n}function eu(e){let t=new A.Table("gasp",[{name:"version",type:"USHORT",value:1},{name:"numRanges",type:"USHORT",value:e.numRanges}]);for(let n in e.gaspRanges)t.fields.push({name:"rangeMaxPPEM",type:"USHORT",value:e.gaspRanges[n].rangeMaxPPEM}),t.fields.push({name:"rangeGaspBehavior",type:"USHORT",value:e.gaspRanges[n].rangeGaspBehavior});return t}var Oo={parse:Jl,make:eu};function tu(e,t){let n=new Map,s=e.buffer,r=new C(e,t);if(r.parseUShort()!==0)return n;r.relativeOffset=r.parseOffset32();let i=e.byteOffset+t+r.relativeOffset,a=r.parseUShort(),l=new Map;for(let c=0;c<a;c++){let u=r.parseUShort(),m=r.parseUShort(),d=i+r.parseOffset32(),x=r.parseULong(),v=l.get(d);v===void 0&&(v=new Uint8Array(s,d,x),l.set(d,v));for(let S=u;S<=m;S++)n.set(S,v)}return n}function nu(e){let t=Array.from(e.keys()).sort(),n=[],s=[],r=new Map,o=0,i={endGlyphID:null};for(let d=0,x=t.length;d<x;d++){let v=t[d],S=e.get(v),I=r.get(S);I===void 0&&(I=o,s.push(S),r.set(S,I),o+=S.byteLength),v-1===i.endGlyphID&&I===i.svgDocOffset?i.endGlyphID=v:(i={startGlyphID:v,endGlyphID:v,svgDocOffset:I,svgDocLength:S.byteLength},n.push(i))}let a=n.length,l=s.length,c=2+a*12,u=new Array(4+a*4+l),m=0;u[m++]={name:"version",type:"USHORT",value:0},u[m++]={name:"svgDocumentListOffset",type:"ULONG",value:10},u[m++]={name:"reserved",type:"ULONG",value:0},u[m++]={name:"numEntries",type:"USHORT",value:a};for(let d=0;d<a;d++){let x="documentRecord_"+d,{startGlyphID:v,endGlyphID:S,svgDocOffset:I,svgDocLength:_}=n[d];u[m++]={name:x+"_startGlyphID",type:"USHORT",value:v},u[m++]={name:x+"_endGlyphID",type:"USHORT",value:S},u[m++]={name:x+"_svgDocOffset",type:"ULONG",value:c+I},u[m++]={name:x+"_svgDocLength",type:"ULONG",value:_}}for(let d=0;d<l;d++)u[m++]={name:"svgDoc_"+d,type:"LITERAL",value:s[d]};return new A.Table("SVG ",u)}var Io={make:nu,parse:tu};function wo(e){return Math.log(e)/Math.log(2)|0}function js(e){for(;e.length%4!==0;)e.push(0);let t=0;for(let n=0;n<e.length;n+=4)t+=(e[n]<<24)+(e[n+1]<<16)+(e[n+2]<<8)+e[n+3];return t%=Math.pow(2,32),t}function Eo(e,t,n,s){return new A.Record("Table Record",[{name:"tag",type:"TAG",value:e!==void 0?e:""},{name:"checkSum",type:"ULONG",value:t!==void 0?t:0},{name:"offset",type:"ULONG",value:n!==void 0?n:0},{name:"length",type:"ULONG",value:s!==void 0?s:0}])}function Lo(e){let t=new A.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);t.tables=e,t.numTables=e.length;let n=Math.pow(2,wo(t.numTables));t.searchRange=16*n,t.entrySelector=wo(n),t.rangeShift=t.numTables*16-t.searchRange;let s=[],r=[],o=t.sizeOf()+Eo().sizeOf()*t.numTables;for(;o%4!==0;)o+=1,r.push({name:"padding",type:"BYTE",value:0});for(let i=0;i<e.length;i+=1){let a=e[i];B.argument(a.tableName.length===4,"Table name"+a.tableName+" is invalid.");let l=a.sizeOf(),c=Eo(a.tableName,js(a.encode()),o,l);for(s.push({name:c.tag+" Table Record",type:"RECORD",value:c}),r.push({name:a.tableName+" table",type:"RECORD",value:a}),o+=l,B.argument(!isNaN(o),"Something went wrong calculating the offset.");o%4!==0;)o+=1,r.push({name:"padding",type:"BYTE",value:0})}return s.sort(function(i,a){return i.value.tag>a.value.tag?1:-1}),t.fields=t.fields.concat(s),t.fields=t.fields.concat(r),t}function Ao(e,t,n){for(let s=0;s<t.length;s+=1){let r=e.charToGlyphIndex(t[s]);if(r>0)return e.glyphs.get(r).getMetrics()}return n}function su(e){let t=0;for(let n=0;n<e.length;n+=1)t+=e[n];return t/e.length}function ru(e){let t=[],n=[],s=[],r=[],o=[],i=[],a=[],l,c=0,u=0,m=0,d=0,x=0;for(let le=0;le<e.glyphs.length;le+=1){let _e=e.glyphs.get(le),Qe=_e.unicode|0;if(isNaN(_e.advanceWidth))throw new Error("Glyph "+_e.name+" ("+le+"): advanceWidth is not a number.");(l>Qe||l===void 0)&&Qe>0&&(l=Qe),c<Qe&&(c=Qe);let at=zs.getUnicodeRange(Qe);if(at<32)u|=1<<at;else if(at<64)m|=1<<at-32;else if(at<96)d|=1<<at-64;else if(at<123)x|=1<<at-96;else throw new Error("Unicode ranges bits > 123 are reserved for internal usage");if(_e.name===".notdef")continue;let Ct=_e.getMetrics();t.push(Ct.xMin),n.push(Ct.yMin),s.push(Ct.xMax),r.push(Ct.yMax),i.push(Ct.leftSideBearing),a.push(Ct.rightSideBearing),o.push(_e.advanceWidth)}let v={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,s),yMax:Math.max.apply(null,r),advanceWidthMax:Math.max.apply(null,o),advanceWidthAvg:su(o),minLeftSideBearing:Math.min.apply(null,i),maxLeftSideBearing:Math.max.apply(null,i),minRightSideBearing:Math.min.apply(null,a)};v.ascender=e.ascender,v.descender=e.descender;let S=0;e.weightClass>=600&&(S|=e.macStyleValues.BOLD),e.italicAngle<0&&(S|=e.macStyleValues.ITALIC);let I=co.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:v.xMin,yMin:v.yMin,xMax:v.xMax,yMax:v.yMax,lowestRecPPEM:3,macStyle:S,createdTimestamp:e.createdTimestamp}),_=fo.make({ascender:v.ascender,descender:v.descender,advanceWidthMax:v.advanceWidthMax,minLeftSideBearing:v.minLeftSideBearing,minRightSideBearing:v.minRightSideBearing,xMaxExtent:v.maxLeftSideBearing+(v.xMax-v.xMin),numberOfHMetrics:e.glyphs.length}),P=go.make(e.glyphs.length),z=zs.make(Object.assign({xAvgCharWidth:Math.round(v.advanceWidthAvg),usFirstCharIndex:l,usLastCharIndex:c,ulUnicodeRange1:u,ulUnicodeRange2:m,ulUnicodeRange3:d,ulUnicodeRange4:x,sTypoAscender:v.ascender,sTypoDescender:v.descender,sTypoLineGap:0,usWinAscent:v.yMax,usWinDescent:Math.abs(v.yMin),ulCodePageRange1:1,sxHeight:Ao(e,"xyvw",{yMax:Math.round(v.ascender/2)}).yMax,sCapHeight:Ao(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",v).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0},e.tables.os2)),Y=po.make(e.glyphs),re=Wr.make(e.glyphs),ie=e.getEnglishName("fontFamily"),ae=e.getEnglishName("fontSubfamily"),me=ie+" "+ae,ot=e.getEnglishName("postScriptName");ot||(ot=ie.replace(/\s/g,"")+"-"+ae);let Z={};for(let le in e.names)Z[le]=e.names[le];Z.unicode=Z.unicode||{},Z.macintosh=Z.macintosh||{},Z.windows=Z.windows||{};let Ve=e.names.unicode||{},De=e.names.macintosh||{},G=e.names.windows||{};for(let le in Z){if(Z[le]=Z[le]||{},!Z[le].uniqueID){let _e=e.getEnglishName("manufacturer")||"";Z[le].uniqueID={en:`${_e}: ${me}`}}Z[le].postScriptName||(Z[le].postScriptName={en:ot})}Z.unicode.preferredFamily||(Z.unicode.preferredFamily=Ve.fontFamily||De.fontFamily||G.fontFamily),Z.macintosh.preferredFamily||(Z.macintosh.preferredFamily=De.fontFamily||Ve.fontFamily||G.fontFamily),Z.windows.preferredFamily||(Z.windows.preferredFamily=G.fontFamily||Ve.fontFamily||De.fontFamily),Z.unicode.preferredSubfamily||(Z.unicode.preferredSubfamily=Ve.fontSubfamily||De.fontSubfamily||G.fontSubfamily),Z.macintosh.preferredSubfamily||(Z.macintosh.preferredSubfamily=De.fontSubfamily||Ve.fontSubfamily||G.fontSubfamily),Z.windows.preferredSubfamily||(Z.windows.preferredSubfamily=G.fontSubfamily||Ve.fontSubfamily||De.fontSubfamily);let U=[],M=jr.make(Z,U),Ee=U.length>0?ho.make(U):void 0,Mt=mo.make(e),ms=Hs.make(e.glyphs,{version:e.getEnglishName("version"),fullName:me,familyName:ie,weightName:ae,postScriptName:ot,unitsPerEm:e.unitsPerEm,fontBBox:[0,v.yMin,v.ascender,v.advanceWidthMax],topDict:e.tables.cff&&e.tables.cff.topDict||{}}),Kt=e.metas&&Object.keys(e.metas).length>0?bo.make(e.metas):void 0,it=[I,_,P,z,M,re,Mt,ms,Y];Ee&&it.push(Ee);let Fe={gsub:yo,cpal:Kr,colr:vo,stat:So,avar:ko,cvar:To,fvar:xo,gvar:Co,gasp:Oo,svg:Io},Ke={avar:[e.tables.fvar],fvar:[e.names]};for(let le in Fe){let _e=e.tables[le];if(_e){let Qe=Fe[le].make.call(e,_e,...Ke[le]||[]);Qe&&it.push(Qe)}}Kt&&it.push(Kt);let Le=Lo(it),ze=Le.encode(),Ue=js(ze),Me=Le.fields,ge=!1;for(let le=0;le<Me.length;le+=1)if(Me[le].name==="head table"){Me[le].value.checkSumAdjustment=2981146554-Ue,ge=!0;break}if(!ge)throw new Error("Could not find head table with checkSum to adjust.");return Le}var ou={make:Lo,fontToTable:ru,computeCheckSum:js};function Ws(e,t){let n=0,s=e.length-1;for(;n<=s;){let r=n+s>>>1,o=e[r].tag;if(o===t)return r;o<t?n=r+1:s=r-1}return-n-1}function Ro(e,t){let n=0,s=e.length-1;for(;n<=s;){let r=n+s>>>1,o=e[r];if(o===t)return r;o<t?n=r+1:s=r-1}return-n-1}function Do(e,t){let n,s=0,r=e.length-1;for(;s<=r;){let o=s+r>>>1;n=e[o];let i=n.start;if(i===t)return n;i<t?s=o+1:r=o-1}if(s>0)return n=e[s-1],t>n.end?0:n}function Fo(e,t){this.font=e,this.tableName=t}Fo.prototype={searchTag:Ws,binSearch:Ro,getTable:function(e){let t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){let e=this.getTable();return e?e.scripts.map(function(t){return t.tag}):[]},getDefaultScriptName:function(){let e=this.getTable();if(!e)return;let t=!1;for(let n=0;n<e.scripts.length;n++){let s=e.scripts[n].tag;if(s==="DFLT")return s;s==="latn"&&(t=!0)}if(t)return"latn"},getScriptTable:function(e,t){let n=this.getTable(t);if(n){e=e||"DFLT";let s=n.scripts,r=Ws(n.scripts,e);if(r>=0)return s[r].script;if(t){let o={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return s.splice(-1-r,0,o),o.script}}},getLangSysTable:function(e,t,n){let s=this.getScriptTable(e,n);if(s){if(!t||t==="dflt"||t==="DFLT")return s.defaultLangSys;let r=Ws(s.langSysRecords,t);if(r>=0)return s.langSysRecords[r].langSys;if(n){let o={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return s.langSysRecords.splice(-1-r,0,o),o.langSys}}},getFeatureTable:function(e,t,n,s){let r=this.getLangSysTable(e,t,s);if(r){let o,i=r.featureIndexes,a=this.font.tables[this.tableName].features;for(let l=0;l<i.length;l++)if(o=a[i[l]],o.tag===n)return o.feature;if(s){let l=a.length;return B.assert(l===0||n>=a[l-1].tag,"Features must be added in alphabetical order."),o={tag:n,feature:{params:0,lookupListIndexes:[]}},a.push(o),i.push(l),o.feature}}},getLookupTables:function(e,t,n,s,r){let o=this.getFeatureTable(e,t,n,r),i=[];if(o){let a,l=o.lookupListIndexes,c=this.font.tables[this.tableName].lookups;for(let u=0;u<l.length;u++)a=c[l[u]],a.lookupType===s&&i.push(a);if(i.length===0&&r){a={lookupType:s,lookupFlag:0,subtables:[],markFilteringSet:void 0};let u=c.length;return c.push(a),l.push(u),[a]}}return i},getGlyphClass:function(e,t){switch(e.format){case 1:return e.startGlyph<=t&&t<e.startGlyph+e.classes.length?e.classes[t-e.startGlyph]:0;case 2:{let n=Do(e.ranges,t);return n?n.classId:0}}},getCoverageIndex:function(e,t){switch(e.format){case 1:{let n=Ro(e.glyphs,t);return n>=0?n:-1}case 2:{let n=Do(e.ranges,t);return n?n.index+t-n.start:-1}}},expandCoverage:function(e){if(e.format===1)return e.glyphs;{let t=[],n=e.ranges;for(let s=0;s<n.length;s++){let r=n[s],o=r.start,i=r.end;for(let a=o;a<=i;a++)t.push(a)}return t}}};var as=Fo;function An(e){as.call(this,e,"gpos")}An.prototype=as.prototype,An.prototype.init=function(){let e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},An.prototype.getKerningValue=function(e,t,n){for(let s=0;s<e.length;s++){let r=e[s].subtables;for(let o=0;o<r.length;o++){let i=r[o],a=this.getCoverageIndex(i.coverage,t);if(!(a<0))switch(i.posFormat){case 1:{let l=i.pairSets[a];for(let c=0;c<l.length;c++){let u=l[c];if(u.secondGlyph===n)return u.value1&&u.value1.xAdvance||0}break}case 2:{let l=this.getGlyphClass(i.classDef1,t),c=this.getGlyphClass(i.classDef2,n),u=i.classRecords[l][c];return u.value1&&u.value1.xAdvance||0}}}}return 0},An.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,"kern",2)};var iu=An;function au(e,t){let n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}function lu(e,t,n){let s=0,r=e.length-1,o=null;for(;s<=r;){let i=Math.floor((s+r)/2),a=e[i],l=a[t];if(l<n)s=i+1;else if(l>n)r=i-1;else{o=a;break}}return o}function uu(e,t,n){let s=0,r=e.length-1;for(;s<=r;){let o=Math.floor((s+r)/2),i=e[o];if(i[t]<n)s=o+1;else if(i[t]>n)r=o-1;else return o}return-1}function cu(e,t,n){let s=0,r=e.length,o=(i,a)=>i[t]-a[t];for(;s<r;){let i=s+r>>>1;o(e[i],n)<0?s=i+1:r=i}return e.splice(s,0,n),s}function Uo(e){return e[0]===31&&e[1]===139&&e[2]===8}function fu(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=10,s=e.byteLength-8,r=t.getInt8(3);if(r&4&&(n+=2+t.getUint16(n,!0)),r&8)for(;n<s&&e[n++]!==0;);if(r&16)for(;n<s&&e[n++]!==0;);if(r&2&&(n+=2),n>=s)throw new Error("Can't find compressed blocks");let o=t.getUint32(t.byteLength-4,!0);return Er(e.subarray(n,s),new Uint8Array(o))}function Mo(e){return{x:e.x,y:e.y,onCurve:e.onCurve,lastPointOfContour:e.lastPointOfContour}}function pu(e){return{glyphIndex:e.glyphIndex,xScale:e.xScale,scale01:e.scale01,scale10:e.scale10,yScale:e.yScale,dx:e.dx,dy:e.dy}}function Ge(e){as.call(this,e,"gsub")}function qs(e,t,n){let s=e.subtables;for(let r=0;r<s.length;r++){let o=s[r];if(o.substFormat===t)return o}if(n)return s.push(n),n}Ge.prototype=as.prototype,Ge.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},Ge.prototype.getSingle=function(e,t,n){let s=[],r=this.getLookupTables(t,n,e,1);for(let o=0;o<r.length;o++){let i=r[o].subtables;for(let a=0;a<i.length;a++){let l=i[a],c=this.expandCoverage(l.coverage),u;if(l.substFormat===1){let m=l.deltaGlyphId;for(u=0;u<c.length;u++){let d=c[u];s.push({sub:d,by:d+m})}}else{let m=l.substitute;for(u=0;u<c.length;u++)s.push({sub:c[u],by:m[u]})}}}return s},Ge.prototype.getMultiple=function(e,t,n){let s=[],r=this.getLookupTables(t,n,e,2);for(let o=0;o<r.length;o++){let i=r[o].subtables;for(let a=0;a<i.length;a++){let l=i[a],c=this.expandCoverage(l.coverage),u;for(u=0;u<c.length;u++){let m=c[u],d=l.sequences[u];s.push({sub:m,by:d})}}}return s},Ge.prototype.getAlternates=function(e,t,n){let s=[],r=this.getLookupTables(t,n,e,3);for(let o=0;o<r.length;o++){let i=r[o].subtables;for(let a=0;a<i.length;a++){let l=i[a],c=this.expandCoverage(l.coverage),u=l.alternateSets;for(let m=0;m<c.length;m++)s.push({sub:c[m],by:u[m]})}}return s},Ge.prototype.getLigatures=function(e,t,n){let s=[],r=this.getLookupTables(t,n,e,4);for(let o=0;o<r.length;o++){let i=r[o].subtables;for(let a=0;a<i.length;a++){let l=i[a],c=this.expandCoverage(l.coverage),u=l.ligatureSets;for(let m=0;m<c.length;m++){let d=c[m],x=u[m];for(let v=0;v<x.length;v++){let S=x[v];s.push({sub:[d].concat(S.components),by:S.ligGlyph})}}}}return s},Ge.prototype.addSingle=function(e,t,n,s){let r=this.getLookupTables(n,s,e,1,!0)[0],o=qs(r,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});B.assert(o.coverage.format===1,"Single: unable to modify coverage table format "+o.coverage.format);let i=t.sub,a=this.binSearch(o.coverage.glyphs,i);a<0&&(a=-1-a,o.coverage.glyphs.splice(a,0,i),o.substitute.splice(a,0,0)),o.substitute[a]=t.by},Ge.prototype.addMultiple=function(e,t,n,s){B.assert(t.by instanceof Array&&t.by.length>1,'Multiple: "by" must be an array of two or more ids');let r=this.getLookupTables(n,s,e,2,!0)[0],o=qs(r,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});B.assert(o.coverage.format===1,"Multiple: unable to modify coverage table format "+o.coverage.format);let i=t.sub,a=this.binSearch(o.coverage.glyphs,i);a<0&&(a=-1-a,o.coverage.glyphs.splice(a,0,i),o.sequences.splice(a,0,0)),o.sequences[a]=t.by},Ge.prototype.addAlternate=function(e,t,n,s){let r=this.getLookupTables(n,s,e,3,!0)[0],o=qs(r,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});B.assert(o.coverage.format===1,"Alternate: unable to modify coverage table format "+o.coverage.format);let i=t.sub,a=this.binSearch(o.coverage.glyphs,i);a<0&&(a=-1-a,o.coverage.glyphs.splice(a,0,i),o.alternateSets.splice(a,0,0)),o.alternateSets[a]=t.by},Ge.prototype.addLigature=function(e,t,n,s){let r=this.getLookupTables(n,s,e,4,!0)[0],o=r.subtables[0];o||(o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},r.subtables[0]=o),B.assert(o.coverage.format===1,"Ligature: unable to modify coverage table format "+o.coverage.format);let i=t.sub[0],a=t.sub.slice(1),l={ligGlyph:t.by,components:a},c=this.binSearch(o.coverage.glyphs,i);if(c>=0){let u=o.ligatureSets[c];for(let m=0;m<u.length;m++)if(au(u[m].components,a))return;u.push(l)}else c=-1-c,o.coverage.glyphs.splice(c,0,i),o.ligatureSets.splice(c,0,[l])},Ge.prototype.getFeature=function(e,t,n){if(/ss\d\d/.test(e))return this.getSingle(e,t,n);switch(e){case"aalt":case"salt":return this.getSingle(e,t,n).concat(this.getAlternates(e,t,n));case"dlig":case"liga":case"rlig":return this.getLigatures(e,t,n);case"ccmp":return this.getMultiple(e,t,n).concat(this.getLigatures(e,t,n));case"stch":return this.getMultiple(e,t,n)}},Ge.prototype.add=function(e,t,n,s){if(/ss\d\d/.test(e))return this.addSingle(e,t,n,s);switch(e){case"aalt":case"salt":return typeof t.by=="number"?this.addSingle(e,t,n,s):this.addAlternate(e,t,n,s);case"dlig":case"liga":case"rlig":return this.addLigature(e,t,n,s);case"ccmp":return t.by instanceof Array?this.addMultiple(e,t,n,s):this.addLigature(e,t,n,s)}};var hu=Ge,Po=class{constructor(e){this.defaultValue=255,this.font=e}cpal(){return this.font.tables&&this.font.tables.cpal?this.font.tables.cpal:!1}getAll(e){let t=[],n=this.cpal();if(!n)return t;for(let s=0;s<n.colorRecordIndices.length;s++){let r=n.colorRecordIndices[s],o=[];for(let i=r;i<r+n.numPaletteEntries;i++)o.push(cn(n.colorRecords[i],e||"hexa"));t.push(o)}return t}toCPALcolor(e){return Array.isArray(e)?e.map(t=>rs(t,"raw")):rs(e,"raw")}fillPalette(e,t=[],n=this.cpal().numPaletteEntries){return e=Number.isInteger(e)?this.get(e,"raw"):e,Object.assign(Array(n).fill(this.defaultValue),this.toCPALcolor(e).concat(this.toCPALcolor(t)))}extend(e){if(this.ensureCPAL(Array(e).fill(this.defaultValue)))return;let t=this.cpal(),n=t.numPaletteEntries+e,s=this.getAll().map(r=>this.fillPalette(r,[],n));t.numPaletteEntries=n,t.colorRecords=this.toCPALcolor(s.flat()),this.updateIndices()}get(e,t="hexa"){return this.getAll(t)[e]||null}getColor(e,t=0,n="hexa"){return Ms(this.font,e,t,n)}setColor(e,t,n=0){e=parseInt(e),n=parseInt(n);let s=this.getAll("raw"),r=s[n];if(!r)throw Error(`paletteIndex ${n} out of range`);let o=this.cpal(),i=o.numPaletteEntries;Array.isArray(t)||(t=[t]),t.length+e>i&&(this.extend(t.length+e-i),s=this.getAll("raw"),r=s[n]);for(let a=0;a<t.length;a++)r[a+e]=this.toCPALcolor(t[a]);o.colorRecords=s.flat(),this.updateIndices()}add(e){if(this.ensureCPAL(e))return;let t=this.cpal(),n=t.numPaletteEntries;e&&e.length?(e=this.toCPALcolor(e),e.length>n?this.extend(e.length-n):e.length<n&&(e=this.fillPalette(e)),t.colorRecordIndices.push(t.colorRecords.length),t.colorRecords.push(...e)):(t.colorRecordIndices.push(t.colorRecords.length),t.colorRecords.push(...Array(n).fill(this.defaultValue)))}delete(e){let t=this.getAll("raw");delete t[e];let n=this.cpal();n.colorRecordIndices.pop(),n.colorRecords=t.flat()}deleteColor(e,t){if(e===t)throw Error("replacementIndex cannot be the same as colorIndex");let n=this.cpal(),s=this.getAll("raw"),r=[];if(t>n.numPaletteEntries-1)throw Error(`Replacement index out of range: numPaletteEntries after deletion: ${n.numPaletteEntries-1}, replacementIndex: ${t})`);for(let a=0;a<s.length;a++){let c=s[a].filter((u,m)=>m!==e);r.push(c)}let o=this.font.tables.colr;if(o){let a=o.layerRecords;for(let l=0;l<a.length;l++){let c=a[l].paletteIndex;if(c>e)a[l].paletteIndex-=1;else if(c===e){let u=0;for(let m=0;m<s.length;m++)if(t>e&&t<=e+s[m].length){u++;break}a[l].paletteIndex=t-u}}this.font.tables.colr={...o,layerRecords:a}}let i=r.flat();for(let a=0;a<s.length;a++)n.colorRecordIndices[a]-=a;n.numPaletteEntries=Math.max(0,n.numPaletteEntries-1),n.colorRecords=this.toCPALcolor(i)}ensureCPAL(e){return this.cpal()?!1:(!e||!e.length?e=[this.defaultValue]:e=this.toCPALcolor(e),this.font.tables.cpal={version:0,numPaletteEntries:e.length,colorRecords:e,colorRecordIndices:[0]},!0)}updateIndices(){let e=this.cpal(),t=Math.ceil(e.colorRecords.length/e.numPaletteEntries);e.colorRecordIndices=[];for(let n=0;n<t;n++)e.colorRecordIndices.push(n*e.numPaletteEntries)}},du=class{constructor(e){this.font=e}ensureCOLR(){return this.font.tables.colr||(this.font.tables.colr={version:0,baseGlyphRecords:[],layerRecords:[]}),this.font}get(e){let t=this.font,n=[],s=t.tables.colr,r=t.tables.cpal;if(!s||!r)return n;let o=lu(s.baseGlyphRecords,"glyphID",e);if(!o)return n;let i=o.firstLayerIndex,a=o.numLayers;for(let l=0;l<a;l++){let c=s.layerRecords[i+l];n.push({glyph:t.glyphs.get(c.glyphID),paletteIndex:c.paletteIndex})}return n}add(e,t,n){let s=this.get(e);t=Array.isArray(t)?t:[t],n===void 0||n===1/0||n>s.length?n=s.length:n<0&&(n=s.length+1+n%(s.length+1),n>=s.length+1&&(n-=s.length+1));let r=[];for(let o=0;o<n;o++){let i=Number.isInteger(s[o].glyph)?s[o].glyph:s[o].glyph.index;r.push({glyphID:i,paletteIndex:s[o].paletteIndex})}for(let o of t){let i=Number.isInteger(o.glyph)?o.glyph:o.glyph.index;r.push({glyphID:i,paletteIndex:o.paletteIndex})}for(let o=n;o<s.length;o++){let i=Number.isInteger(s[o].glyph)?s[o].glyph:s[o].glyph.index;r.push({glyphID:i,paletteIndex:s[o].paletteIndex})}this.updateColrTable(e,r)}setPaletteIndex(e,t,n){let s=this.get(e);s[t]?(s=s.map((r,o)=>({glyphID:r.glyph.index,paletteIndex:o===t?n:r.paletteIndex})),this.updateColrTable(e,s)):console.error("Invalid layer index")}remove(e,t,n=t){let s=this.get(e);s=s.map(r=>({glyphID:r.glyph.index,paletteIndex:r.paletteIndex})),s.splice(t,n-t+1),this.updateColrTable(e,s)}updateColrTable(e,t){this.ensureCOLR();let s=this.font.tables.colr,r=uu(s.baseGlyphRecords,"glyphID",e);if(r===-1){let u={glyphID:e,firstLayerIndex:s.layerRecords.length,numLayers:0};r=cu(s.baseGlyphRecords,"glyphID",u)}let i=s.baseGlyphRecords[r],a=i.numLayers,l=t.length,c=l-a;if(c>0){let u=t.slice(a).map(m=>({glyphID:m.glyphID,paletteIndex:m.paletteIndex}));s.layerRecords.splice(i.firstLayerIndex+a,0,...u)}else c<0&&s.layerRecords.splice(i.firstLayerIndex+l,-c);for(let u=0;u<Math.min(a,l);u++)s.layerRecords[i.firstLayerIndex+u]={glyphID:t[u].glyphID,paletteIndex:t[u].paletteIndex};if(i.numLayers=l,c!==0)for(let u=0;u<s.baseGlyphRecords.length;u++){let m=s.baseGlyphRecords[u];u===r||m.firstLayerIndex<i.firstLayerIndex||(s.baseGlyphRecords[u].firstLayerIndex+=c)}}},gu=class{constructor(e){this.font=e,this.cache=new WeakMap}get(e){let t=this.getOrCreateSvgImageCacheEntry(e);return t&&t.image}getAsync(e){let t=this.getOrCreateSvgImageCacheEntry(e);return t&&t.promise}getOrCreateSvgImageCacheEntry(e){let t=this.font.tables.svg;if(t===void 0)return;let n=t.get(e);if(n===void 0)return;let s=this.cache.get(n);s===void 0&&(s=mu(n),this.cache.set(n,s));let r=s.images.get(e);return r===void 0&&(r=yu(this.font,s.template,e),r.promise.then(o=>{if(r.image=o,typeof this.font.onGlyphUpdated=="function")try{this.font.onGlyphUpdated(e)}catch(i){console.error("font.onGlyphUpdated",e,i)}}),s.images.set(e,r)),r}};function mu(e){return{template:bu(e).then(Su),images:new Map}}function yu(e,t,n){return{promise:t.then(s=>{let r;typeof s=="string"?r=s:(s[4]=n,r=s.join(""));let o=ku(r,e.unitsPerEm);return o.image.decode().then(()=>o)}),image:void 0}}var bu=typeof DecompressionStream=="function"?xu:vu;function vu(e){try{return Promise.resolve(new TextDecoder().decode(Uo(e)?fu(e):e))}catch(t){return Promise.reject(t)}}function xu(e){if(Uo(e))return new Response(new Response(e).body.pipeThrough(new DecompressionStream("gzip"))).text();try{return Promise.resolve(new TextDecoder().decode(e))}catch(t){return Promise.reject(t)}}function Su(e){let t=e.indexOf("<svg"),n=e.indexOf(">",t+4)+1;if(/ id=['"]glyph\d+['"]/.test(e.substring(t,n)))return e;let s=e.lastIndexOf("</svg>");return[e.substring(0,n),"<defs>",e.substring(n,s),'</defs><use href="#glyph',"",'"/>',e.substring(s)]}function ku(e,t){let s=new DOMParser().parseFromString(e,"image/svg+xml").documentElement,r=s.viewBox.baseVal,o=s.width.baseVal,i=s.height.baseVal,a=1,l=1;r.width>0&&r.height>0&&(o.unitType===1?(a=o.valueInSpecifiedUnits/r.width,l=i.unitType===1?i.valueInSpecifiedUnits/r.height:a):i.unitType===1?(l=i.valueInSpecifiedUnits/r.height,a=l):t&&(a=t/r.width,l=t/r.height));let c=document.createElement("div");c.style.position="fixed",c.style.visibility="hidden",c.appendChild(s),document.body.appendChild(c);let u=s.getBBox();document.body.removeChild(c);let m=(u.x-r.x)*a,d=(r.y-u.y)*l,x=u.width*a,v=u.height*l;s.setAttribute("viewBox",[u.x,u.y,u.width,u.height].join(" ")),a!==1&&s.setAttribute("width",x),l!==1&&s.setAttribute("height",v);let S=new Image(x,v);return S.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(s.outerHTML),{leftSideBearing:m,baseline:d,image:S}}var $s=new WeakMap;function No(e,t,n,s,r){let o;return(t&s)>0?(o=e.parseByte(),(t&r)===0&&(o=-o),o=n+o):(t&r)>0?o=n:o=n+e.parseShort(),o}function Bo(e,t,n){let s=new F.Parser(t,n);e._numberOfContours=s.parseShort(),e._xMin=s.parseShort(),e._yMin=s.parseShort(),e._xMax=s.parseShort(),e._yMax=s.parseShort();let r,o;if(e._numberOfContours>0){let i=e.endPointIndices=[];for(let l=0;l<e._numberOfContours;l+=1)i.push(s.parseUShort());e.instructionLength=s.parseUShort(),e.instructions=[];for(let l=0;l<e.instructionLength;l+=1)e.instructions.push(s.parseByte());let a=i[i.length-1]+1;r=[];for(let l=0;l<a;l+=1)if(o=s.parseByte(),r.push(o),(o&8)>0){let c=s.parseByte();for(let u=0;u<c;u+=1)r.push(o),l+=1}if(B.argument(r.length===a,"Bad flags."),i.length>0){let l=[],c;if(a>0){for(let d=0;d<a;d+=1)o=r[d],c={},c.onCurve=!!(o&1),c.lastPointOfContour=i.indexOf(d)>=0,l.push(c);let u=0;for(let d=0;d<a;d+=1)o=r[d],c=l[d],c.x=No(s,o,u,2,16),u=c.x;let m=0;for(let d=0;d<a;d+=1)o=r[d],c=l[d],c.y=No(s,o,m,4,32),m=c.y}e.points=l}else e.points=[]}else if(e._numberOfContours===0)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];let i=!0;for(;i;){r=s.parseUShort();let a={glyphIndex:s.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(r&1)>0?(r&2)>0?(a.dx=s.parseShort(),a.dy=s.parseShort()):a.matchedPoints=[s.parseUShort(),s.parseUShort()]:(r&2)>0?(a.dx=s.parseChar(),a.dy=s.parseChar()):a.matchedPoints=[s.parseByte(),s.parseByte()],(r&8)>0?a.xScale=a.yScale=s.parseF2Dot14():(r&64)>0?(a.xScale=s.parseF2Dot14(),a.yScale=s.parseF2Dot14()):(r&128)>0&&(a.xScale=s.parseF2Dot14(),a.scale01=s.parseF2Dot14(),a.scale10=s.parseF2Dot14(),a.yScale=s.parseF2Dot14()),e.components.push(a),i=!!(r&32)}if(r&256){e.instructionLength=s.parseUShort(),e.instructions=[];for(let a=0;a<e.instructionLength;a+=1)e.instructions.push(s.parseByte())}}}function ls(e,t){let n=[];for(let s=0;s<e.length;s+=1){let r=e[s],o={x:t.xScale*r.x+t.scale10*r.y+t.dx,y:t.scale01*r.x+t.yScale*r.y+t.dy,onCurve:r.onCurve,lastPointOfContour:r.lastPointOfContour};n.push(o)}return n}function Tu(e){let t=[],n=[];for(let s=0;s<e.length;s+=1){let r=e[s];n.push(r),r.lastPointOfContour&&(t.push(n),n=[])}return B.argument(n.length===0,"There are still points left in the current contour."),t}function Xs(e){let t=new Wt;if(!e)return t;let n=Tu(e);for(let s=0;s<n.length;++s){let r=n[s],o=r[r.length-1],i=r[0];if(o.onCurve)t.moveTo(o.x,o.y);else if(i.onCurve)t.moveTo(i.x,i.y);else{let a={x:(o.x+i.x)*.5,y:(o.y+i.y)*.5};t.moveTo(a.x,a.y)}for(let a=0;a<r.length;++a)if(o=i,i=r[(a+1)%r.length],o.onCurve)t.lineTo(o.x,o.y);else{let l=i;i.onCurve||(l={x:(o.x+i.x)*.5,y:(o.y+i.y)*.5}),t.quadraticCurveTo(o.x,o.y,l.x,l.y)}t.closePath()}return t}function _o(e,t){if(t.isComposite){$s.has(e)||$s.set(e,new Set);let n=$s.get(e);n.add(t.index);try{for(let s=0;s<t.components.length;s+=1){let r=t.components[s];if(n.has(r.glyphIndex))continue;let o=e.get(r.glyphIndex);if(o.getPath(),o.points){let i;if(r.matchedPoints===void 0)i=ls(o.points,r);else{if(r.matchedPoints[0]>t.points.length-1||r.matchedPoints[1]>o.points.length-1)throw Error("Matched points out of range in "+t.name);let a=t.points[r.matchedPoints[0]],l=o.points[r.matchedPoints[1]],c={xScale:r.xScale,scale01:r.scale01,scale10:r.scale10,yScale:r.yScale,dx:0,dy:0};l=ls([l],c)[0],c.dx=a.x-l.x,c.dy=a.y-l.y,i=ls(o.points,c)}t.points=t.points.concat(i)}}}finally{n.delete(t.index)}}return Xs(t.points)}function Cu(e,t,n,s){let r=new mt.GlyphSet(s);for(let o=0;o<n.length-1;o+=1){let i=n[o],a=n[o+1];i!==a?r.push(o,mt.ttfGlyphLoader(s,o,Bo,e,t+i,_o)):r.push(o,mt.glyphLoader(s,o))}return r}function Ou(e,t,n,s){let r=new mt.GlyphSet(s);return s._push=function(o){let i=n[o],a=n[o+1];i!==a?r.push(o,mt.ttfGlyphLoader(s,o,Bo,e,t+i,_o)):r.push(o,mt.glyphLoader(s,o))},r}function Iu(e,t,n,s,r){return r.lowMemory?Ou(e,t,n,s):Cu(e,t,n,s)}var Go={getPath:Xs,parse:Iu},wu=class{constructor(e){this.font=e}normalizeCoordTags(e){for(let t in e)if(t.length<4){let n=t.padEnd(4," ");e[n]===void 0&&(e[n]=e[t]),delete e[t]}}getNormalizedCoords(e){e||(e=this.font.variation.get());let t=[];this.normalizeCoordTags(e);for(let n=0;n<this.fvar().axes.length;n++){let s=this.fvar().axes[n],r=e[s.tag];r===void 0&&(r=s.defaultValue),r<s.defaultValue?t.push((r-s.defaultValue+Number.EPSILON)/(s.defaultValue-s.minValue+Number.EPSILON)):t.push((r-s.defaultValue+Number.EPSILON)/(s.maxValue-s.defaultValue+Number.EPSILON))}if(this.avar())for(let n=0;n<this.avar().axisSegmentMaps.length;n++){let s=this.avar().axisSegmentMaps[n];for(let r=0;r<s.axisValueMaps.length;r++){let o=s.axisValueMaps[r];if(r>=1&&t[n]<o.fromCoordinate){let i=s.axisValueMaps[r-1];t[n]=((t[n]-i.fromCoordinate)*(o.toCoordinate-i.toCoordinate)+Number.EPSILON)/(o.fromCoordinate-i.fromCoordinate+Number.EPSILON)+i.toCoordinate;break}}}return t}interpolatePoints(e,t,n){if(e.length===0)return;let s=0;for(;s<e.length;){let r=s,o=s,i=e[o];for(;!i.lastPointOfContour;)i=e[++o];for(;s<=o&&!n[s];)s++;if(s>o)continue;let a=s,l=s;for(s++;s<=o;)n[s]&&(this.deltaInterpolate(l+1,s-1,l,s,t,e),l=s),s++;l===a?this.deltaShift(r,o,l,t,e):(this.deltaInterpolate(l+1,o,l,a,t,e),a>0&&this.deltaInterpolate(r,a-1,l,a,t,e)),s=o+1}}deltaInterpolate(e,t,n,s,r,o){if(e>t)return;let i=["x","y"];for(let l=0;l<i.length;l++){let c=i[l];if(r[n][c]>r[s][c]){var a=n;n=s,s=a}let u=r[n][c],m=r[s][c],d=o[n][c],x=o[s][c];if(u!==m||d===x){let v=u===m?0:(x-d)/(m-u);for(let S=e;S<=t;S++){let I=r[S][c];I<=u?I+=d-u:I>=m?I+=x-m:I=d+(I-u)*v,o[S][c]=I}}}}deltaShift(e,t,n,s,r){let o=r[n].x-s[n].x,i=r[n].y-s[n].y;if(!(o===0&&i===0))for(let a=e;a<=t;a++)a!==n&&(r[a].x+=o,r[a].y+=i)}transformComponents(e,t,n,s,r,o){let i=0;for(let a=0;a<e.components.length;a++){let l=e.components[a],c=this.font.glyphs.get(l.glyphIndex),u=pu(l),m=s.indexOf(a);m>-1&&(u.dx+=Math.round(r.deltas[m]*o),u.dy+=Math.round(r.deltasY[m]*o));let d=ls(this.getTransform(c,n).points,u);t.splice(i,d.length,...d),i+=c.points.length}}applyTupleVariationStore(e,t,n,s="gvar",r={}){n||(n=this.font.variation.get());let o=this.getNormalizedCoords(n),{headers:i,sharedPoints:a}=e,l=this.fvar().axes.length,c;s==="gvar"?c=t.map(Mo):s==="cvar"&&(c=[...t]);for(let u=0;u<i.length;u++){let m=i[u],d=1;for(let v=0;v<l;v++){let S=[0];switch(s){case"gvar":S=m.peakTuple?m.peakTuple:this.gvar().sharedTuples[m.sharedTupleRecordsIndex];break;case"cvar":S=m.peakTuple;break}if(S[v]!==0){if(o[v]===0){d=0;break}if(m.intermediateStartTuple)if(o[v]<m.intermediateStartTuple[v]||o[v]>m.intermediateEndTuple[v]){d=0;break}else o[v]<S[v]?d=d*(o[v]-m.intermediateStartTuple[v]+Number.EPSILON)/(S[v]-m.intermediateStartTuple[v]+Number.EPSILON):d=d*(m.intermediateEndTuple[v]-o[v]+Number.EPSILON)/(m.intermediateEndTuple[v]-S[v]+Number.EPSILON);else{if(o[v]<Math.min(0,S[v])||o[v]>Math.max(0,S[v])){d=0;break}d=(d*o[v]+Number.EPSILON)/(S[v]+Number.EPSILON)}}}if(d===0)continue;let x=m.privatePoints.length?m.privatePoints:a;if(s==="gvar"&&r.glyph&&r.glyph.isComposite)this.transformComponents(r.glyph,c,n,x,m,d);else if(x.length===0)for(let v=0;v<c.length;v++){let S=c[v];s==="gvar"?c[v]={x:Math.round(S.x+m.deltas[v]*d),y:Math.round(S.y+m.deltasY[v]*d),onCurve:S.onCurve,lastPointOfContour:S.lastPointOfContour}:s==="cvar"&&(c[v]=Math.round(S+m.deltas[v]*d))}else{let v;s==="gvar"?v=c.map(Mo):s==="cvar"&&(v=c);let S=Array(t.length).fill(!1);for(let I=0;I<x.length;I++){let _=x[I];if(_<t.length){let P=v[_];s==="gvar"?(S[_]=!0,P.x+=m.deltas[I]*d,P.y+=m.deltasY[I]*d):s==="cvar"&&(c[_]=Math.round(P+m.deltas[I]*d))}}if(s==="gvar"){this.interpolatePoints(v,c,S);for(let I=0;I<t.length;I++){let _=v[I].x-c[I].x,P=v[I].y-c[I].y;c[I].x=Math.round(c[I].x+_),c[I].y=Math.round(c[I].y+P)}}}}return c}getTransform(e,t){Number.isInteger(e)&&(e=this.font.glyphs.get(e));let n=e.getBlendPath,s=!!(e.points&&e.points.length),r=e;if(n||s){if(t||(t=this.font.variation.get()),s){let o=this.gvar()&&this.gvar().glyphVariations[e.index];if(o){let i=e.points,a=this.applyTupleVariationStore(o,i,t,"gvar",{glyph:e});r=new fn(Object.assign({},e,{points:a,path:Xs(a)}))}}else if(n){let o=e.getBlendPath(t);r=new fn(Object.assign({},e,{path:o}))}}return this.font.tables.hvar&&(e._advanceWidth=typeof e._advanceWidth<"u"?e._advanceWidth:e.advanceWidth,e.advanceWidth=r.advanceWidth=Math.round(e._advanceWidth+this.getVariableAdjustment(r.index,"hvar","advanceWidth",t)),e._leftSideBearing=typeof e._leftSideBearing<"u"?e._leftSideBearing:e.leftSideBearing,e.leftSideBearing=r.leftSideBearing=Math.round(e._leftSideBearing+this.getVariableAdjustment(r.index,"hvar","lsb",t))),r}getCvarTransform(e){let t=this.font.tables.cvt,n=this.cvar();return!t||!t.length||!n||!n.headers.length?t:this.applyTupleVariationStore(n,t,e,"cvar")}getVariableAdjustment(e,t,n,s){s=s||this.font.variation.get();let r,o,i=this.font.tables[t];if(!i)throw Error(`trying to get variation adjustment from non-existent table "${i}"`);if(!i.itemVariationStore)throw Error(`trying to get variation adjustment from table "${i}" which does not have an itemVariationStore`);let a=i[n]&&i[n].map.length;if(a){let l=e;l>=a&&(l=a-1),{outerIndex:r,innerIndex:o}=i[n].map[l]}else r=0,o=e;return this.getDelta(i.itemVariationStore,r,o,s)}getDelta(e,t,n,s){if(t>=e.itemVariationSubtables.length)return 0;let r=e.itemVariationSubtables[t];if(n>=r.deltaSets.length)return 0;let o=r.deltaSets[n],i=this.getBlendVector(e,t,s),a=0;for(let l=0;l<r.regionIndexes.length;l++)a+=o[l]*i[l];return a}getBlendVector(e,t,n){n||(n=this.font.variation.get());let s=e.itemVariationSubtables[t],r=this.getNormalizedCoords(n),o=[];for(let i=0;i<s.regionIndexes.length;i++){let a=1,l=s.regionIndexes[i],c=e.variationRegions[l].regionAxes;for(let u=0;u<c.length;u++){let m=c[u],d;m.startCoord>m.peakCoord||m.peakCoord>m.endCoord||m.startCoord<0&&m.endCoord>0&&m.peakCoord!==0||m.peakCoord===0?d=1:r[u]<m.startCoord||r[u]>m.endCoord?d=0:r[u]===m.peakCoord?d=1:r[u]<m.peakCoord?d=(r[u]-m.startCoord+Number.EPSILON)/(m.peakCoord-m.startCoord+Number.EPSILON):d=(m.endCoord-r[u]+Number.EPSILON)/(m.endCoord-m.peakCoord+Number.EPSILON),a*=d}o[i]=a}return o}avar(){return this.font.tables.avar}cvar(){return this.font.tables.cvar}fvar(){return this.font.tables.fvar}gvar(){return this.font.tables.gvar}hvar(){return this.font.tables.hvar}},Eu=class{constructor(e){this.font=e,this.process=new wu(this.font),this.activateDefaultVariation(),this.getTransform=this.process.getTransform.bind(this.process)}activateDefaultVariation(){let e=this.getDefaultInstanceIndex();e>-1?this.set(e):this.set(this.getDefaultCoordinates())}getDefaultCoordinates(){return this.fvar().axes.reduce((e,t)=>(e[t.tag]=t.defaultValue,e),{})}getDefaultInstanceIndex(){let e=this.getDefaultCoordinates(),t=this.getInstanceIndex(e);return t<0&&(t=this.fvar().instances.findIndex(n=>n.name&&n.name.en==="Regular")),t}getInstanceIndex(e){return this.fvar().instances.findIndex(t=>Object.keys(e).every(n=>t.coordinates[n]===e[n]))}getInstance(e){return this.fvar().instances&&this.fvar().instances[e]}set(e){let t;if(Number.isInteger(e)){let n=this.getInstance(e);if(!n)throw Error(`Invalid instance index ${e}`);t={...n.coordinates}}else t=e,this.process.normalizeCoordTags(t);t=Object.assign({},this.font.defaultRenderOptions.variation,t),this.font.defaultRenderOptions=Object.assign({},this.font.defaultRenderOptions,{variation:t})}get(){return Object.assign({},this.font.defaultRenderOptions.variation)}avar(){return this.font.tables.avar}cvar(){return this.font.tables.cvar}fvar(){return this.font.tables.fvar}gvar(){return this.font.tables.gvar}hvar(){return this.font.tables.hvar}},Ho=1e6,us=64,cs=1e4,Vo,Yt,zo,Ys;function jo(e){this.font=e,this.getCommands=function(t){return Go.getPath(t).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Lu(e){return e}function Wo(e){return Math.sign(e)*Math.round(Math.abs(e))}function Au(e){return Math.sign(e)*Math.round(Math.abs(e*2))/2}function Ru(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function Du(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function Fu(e){return Math.sign(e)*Math.floor(Math.abs(e))}var qo=function(e){let t=this.srPeriod,n=this.srPhase,s=this.srThreshold,r=1;return e<0&&(e=-e,r=-1),e+=s-n,e=Math.trunc(e/t)*t,e+=n,e<0?n*r:e*r},bt={x:1,y:0,axis:"x",distance:function(e,t,n,s){return(n?e.xo:e.x)-(s?t.xo:t.x)},interpolate:function(e,t,n,s){let r,o,i,a,l,c,u;if(!s||s===this){if(r=e.xo-t.xo,o=e.xo-n.xo,l=t.x-t.xo,c=n.x-n.xo,i=Math.abs(r),a=Math.abs(o),u=i+a,u===0){e.x=e.xo+(l+c)/2;return}e.x=e.xo+(l*a+c*i)/u;return}if(r=s.distance(e,t,!0,!0),o=s.distance(e,n,!0,!0),l=s.distance(t,t,!1,!0),c=s.distance(n,n,!1,!0),i=Math.abs(r),a=Math.abs(o),u=i+a,u===0){bt.setRelative(e,e,(l+c)/2,s,!0);return}bt.setRelative(e,e,(l*a+c*i)/u,s,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,n,s,r){if(!s||s===this){e.x=(r?t.xo:t.x)+n;return}let o=r?t.xo:t.x,i=r?t.yo:t.y,a=o+n*s.x,l=i+n*s.y;e.x=a+(e.y-l)/s.normalSlope},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},kt={x:0,y:1,axis:"y",distance:function(e,t,n,s){return(n?e.yo:e.y)-(s?t.yo:t.y)},interpolate:function(e,t,n,s){let r,o,i,a,l,c,u;if(!s||s===this){if(r=e.yo-t.yo,o=e.yo-n.yo,l=t.y-t.yo,c=n.y-n.yo,i=Math.abs(r),a=Math.abs(o),u=i+a,u===0){e.y=e.yo+(l+c)/2;return}e.y=e.yo+(l*a+c*i)/u;return}if(r=s.distance(e,t,!0,!0),o=s.distance(e,n,!0,!0),l=s.distance(t,t,!1,!0),c=s.distance(n,n,!1,!0),i=Math.abs(r),a=Math.abs(o),u=i+a,u===0){kt.setRelative(e,e,(l+c)/2,s,!0);return}kt.setRelative(e,e,(l*a+c*i)/u,s,!0)},normalSlope:0,setRelative:function(e,t,n,s,r){if(!s||s===this){e.y=(r?t.yo:t.y)+n;return}let o=r?t.xo:t.x,i=r?t.yo:t.y,a=o+n*s.x,l=i+n*s.y;e.y=l+s.normalSlope*(e.x-a)},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};Object.freeze(bt),Object.freeze(kt);function Rn(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}Rn.prototype.distance=function(e,t,n,s){return this.x*bt.distance(e,t,n,s)+this.y*kt.distance(e,t,n,s)},Rn.prototype.interpolate=function(e,t,n,s){let r,o,i,a,l,c,u;if(i=s.distance(e,t,!0,!0),a=s.distance(e,n,!0,!0),r=s.distance(t,t,!1,!0),o=s.distance(n,n,!1,!0),l=Math.abs(i),c=Math.abs(a),u=l+c,u===0){this.setRelative(e,e,(r+o)/2,s,!0);return}this.setRelative(e,e,(r*c+o*l)/u,s,!0)},Rn.prototype.setRelative=function(e,t,n,s,r){s=s||this;let o=r?t.xo:t.x,i=r?t.yo:t.y,a=o+n*s.x,l=i+n*s.y,c=s.normalSlope,u=this.slope,m=e.x,d=e.y;e.x=(u*m-c*a+l-d)/(u-c),e.y=u*(e.x-m)+d},Rn.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0};function Dn(e,t){let n=Math.sqrt(e*e+t*t);return e/=n,t/=n,e===1&&t===0?bt:e===0&&t===1?kt:new Rn(e,t)}function Tt(e,t,n,s){this.x=this.xo=Math.round(e*64)/64,this.y=this.yo=Math.round(t*64)/64,this.lastPointOfContour=n,this.onCurve=s,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Tt.prototype.nextTouched=function(e){let t=this.nextPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},Tt.prototype.prevTouched=function(e){let t=this.prevPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var Fn=Object.freeze(new Tt(0,0)),Uu={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function Et(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=bt,this.round=Wo}}jo.prototype.exec=function(e,t){if(typeof t!="number")throw new Error("Point size is not a number!");if(this._errorState>2)return;let n=this.font,s=this._prepState;if(!s||s.ppem!==t){let r=this._fpgmState;if(!r){Et.prototype=Uu,r=this._fpgmState=new Et("fpgm",n.tables.fpgm),r.funcs=[],r.font=n,r.instructionCount=0,r.callDepth=0;try{Yt(r)}catch(i){console.log("Hinting error in FPGM:"+i),this._errorState=3;return}}Et.prototype=r,s=this._prepState=new Et("prep",n.tables.prep),s.ppem=t,s.instructionCount=0,s.callDepth=0;let o=n.variation&&n.variation.process.getCvarTransform()||n.tables.cvt;if(o){let i=s.cvt=new Array(o.length),a=t/n.unitsPerEm;for(let l=0;l<o.length;l++)i[l]=o[l]*a}else s.cvt=[];try{Yt(s)}catch(i){this._errorState<2&&console.log("Hinting error in PREP:"+i),this._errorState=2}}if(!(this._errorState>1))try{return zo(e,s)}catch(r){this._errorState<1&&(console.log("Hinting error:"+r),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}},zo=function(e,t){let n=t.ppem/t.font.unitsPerEm,s=n,r=e.components,o,i,a;if(Et.prototype=t,!r)a=new Et("glyf",e.instructions),a.instructionCount=0,a.callDepth=0,Ys(e,a,n,s),i=a.gZone;else{let l=t.font;i=[],o=[];for(let c=0;c<r.length;c++){let u=r[c],m=l.glyphs.get(u.glyphIndex);a=new Et("glyf",m.instructions),a.instructionCount=0,a.callDepth=0,Ys(m,a,n,s);let d=Math.round(u.dx*n),x=Math.round(u.dy*s),v=a.gZone,S=a.contours;for(let _=0;_<v.length;_++){let P=v[_];P.xTouched=P.yTouched=!1,P.xo=P.x=P.x+d,P.yo=P.y=P.y+x}let I=i.length;i.push.apply(i,v);for(let _=0;_<S.length;_++)o.push(S[_]+I)}e.instructions&&!a.inhibitGridFit&&(a=new Et("glyf",e.instructions),a.gZone=a.z0=a.z1=a.z2=i,a.contours=o,i.push(new Tt(0,0),new Tt(Math.round(e.advanceWidth*n),0)),Yt(a),i.length-=2)}return i},Ys=function(e,t,n,s){let r=e.points||[],o=r.length,i=t.gZone=t.z0=t.z1=t.z2=[],a=t.contours=[],l;for(let m=0;m<o;m++)l=r[m],i[m]=new Tt(l.x*n,l.y*s,l.lastPointOfContour,l.onCurve);let c,u;for(let m=0;m<o;m++)l=i[m],c||(c=l,a.push(m)),l.lastPointOfContour?(l.nextPointOnContour=c,c.prevPointOnContour=l,c=void 0):(u=i[m+1],l.nextPointOnContour=u,u.prevPointOnContour=l);t.inhibitGridFit||(i.push(new Tt(0,0),new Tt(Math.round(e.advanceWidth*n),0)),Yt(t),i.length-=2)},Yt=function(e){let t=e.prog;if(!t)return;let n=t.length,s;for(e.ip=0;e.ip<n;e.ip++){if(++e.instructionCount>Ho)throw new Error("Hinting instructions exceeded maximum of "+Ho);if(s=Vo[t[e.ip]],!s)throw new Error("unknown instruction: 0x"+Number(t[e.ip]).toString(16));s(e)}};function fs(e){let t=e.tZone=new Array(e.gZone.length);for(let n=0;n<t.length;n++)t[n]=new Tt(0,0)}function $o(e,t){let n=e.prog,s=e.ip,r=1,o;do if(o=n[++s],o===88)r++;else if(o===89)r--;else if(o===64)s+=n[s+1]+1;else if(o===65)s+=2*n[s+1]+1;else if(o>=176&&o<=183)s+=o-176+1;else if(o>=184&&o<=191)s+=(o-184+1)*2;else if(t&&r===1&&o===27)break;while(r>0);e.ip=s}function Xo(e,t){t.fv=t.pv=t.dpv=e}function Yo(e,t){t.pv=t.dpv=e}function Zo(e,t){t.fv=e}function Ko(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],i=t.z1[r],a,l;e?(a=o.y-i.y,l=i.x-o.x):(a=i.x-o.x,l=i.y-o.y),t.pv=t.dpv=Dn(a,l)}function Qo(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],i=t.z1[r],a,l;e?(a=o.y-i.y,l=i.x-o.x):(a=i.x-o.x,l=i.y-o.y),t.fv=Dn(a,l)}function Mu(e){let t=e.stack,n=t.pop(),s=t.pop();e.pv=e.dpv=Dn(s,n)}function Pu(e){let t=e.stack,n=t.pop(),s=t.pop();e.fv=Dn(s,n)}function Nu(e){let t=e.stack,n=e.pv;t.push(n.x*16384),t.push(n.y*16384)}function Bu(e){let t=e.stack,n=e.fv;t.push(n.x*16384),t.push(n.y*16384)}function _u(e){e.fv=e.pv}function Gu(e){let t=e.stack,n=t.pop(),s=t.pop(),r=t.pop(),o=t.pop(),i=t.pop(),a=e.z0,l=e.z1,c=a[n],u=a[s],m=l[r],d=l[o],x=e.z2[i],v=c.x,S=c.y,I=u.x,_=u.y,P=m.x,z=m.y,Y=d.x,re=d.y,ie=(v-I)*(z-re)-(S-_)*(P-Y),ae=v*_-S*I,me=P*re-z*Y;x.x=(ae*(P-Y)-me*(v-I))/ie,x.y=(ae*(z-re)-me*(S-_))/ie}function Hu(e){e.rp0=e.stack.pop()}function Vu(e){e.rp1=e.stack.pop()}function zu(e){e.rp2=e.stack.pop()}function ju(e){let t=e.stack.pop();switch(e.zp0=t,t){case 0:e.tZone||fs(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function Wu(e){let t=e.stack.pop();switch(e.zp1=t,t){case 0:e.tZone||fs(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function qu(e){let t=e.stack.pop();switch(e.zp2=t,t){case 0:e.tZone||fs(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function $u(e){let t=e.stack.pop();switch(e.zp0=e.zp1=e.zp2=t,t){case 0:e.tZone||fs(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function Xu(e){e.loop=e.stack.pop(),e.loop>cs&&(e.loop=cs)}function Yu(e){e.round=Wo}function Zu(e){e.round=Ru}function Ku(e){let t=e.stack.pop();e.minDis=t/64}function Qu(e){$o(e,!1)}function Ju(e){let t=e.stack.pop();e.ip+=t-1}function ec(e){let t=e.stack.pop();e.cvCutIn=t/64}function tc(e){let t=e.stack;t.push(t[t.length-1])}function Zs(e){e.stack.pop()}function nc(e){e.stack.length=0}function sc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n),t.push(s)}function rc(e){let t=e.stack;t.push(t.length)}function oc(e){let t=e.stack,n=t.pop(),s=t.pop();if(s>cs&&(s=cs),++e.callDepth>us)throw new Error("Hinting call depth exceeded maximum of "+us);let r=e.ip,o=e.prog;e.prog=e.funcs[n];for(let i=0;i<s;i++)Yt(e);e.ip=r,e.prog=o,e.callDepth--}function ic(e){let t=e.stack.pop();if(++e.callDepth>us)throw new Error("Hinting call depth exceeded maximum of "+us);let n=e.ip,s=e.prog;e.prog=e.funcs[t],Yt(e),e.ip=n,e.prog=s,e.callDepth--}function ac(e){let t=e.stack,n=t.pop();t.push(t[t.length-n])}function lc(e){let t=e.stack,n=t.pop();t.push(t.splice(t.length-n,1)[0])}function uc(e){if(e.env!=="fpgm")throw new Error("FDEF not allowed here");let t=e.stack,n=e.prog,s=e.ip,r=t.pop(),o=s;for(;n[++s]!==45;);e.ip=s,e.funcs[r]=n.slice(o+1,s)}function Jo(e,t){let n=t.stack.pop(),s=t.z0[n],r=t.fv,o=t.pv,i=o.distance(s,Fn);e&&(i=t.round(i)),r.setRelative(s,Fn,i,o),r.touch(s),t.rp0=t.rp1=n}function ei(e,t){let n=t.z2,s=n.length-2,r,o,i;for(let a=0;a<s;a++)r=n[a],!e.touched(r)&&(o=r.prevTouched(e),o!==r&&(i=r.nextTouched(e),o===i&&e.setRelative(r,r,e.distance(o,o,!1,!0),e,!0),e.interpolate(r,o,i,e)))}function ti(e,t){let n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,i=t.pv,a=t.loop,l=t.z2;for(;a--;){let c=n.pop(),u=l[c],m=i.distance(r,r,!1,!0);o.setRelative(u,u,m,i),o.touch(u)}t.loop=1}function ni(e,t){let n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,i=t.pv,a=n.pop(),l=t.z2[t.contours[a]],c=l,u=i.distance(r,r,!1,!0);do c!==r&&o.setRelative(c,c,u,i),c=c.nextPointOnContour;while(c!==l)}function si(e,t){let n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,i=t.pv,a=n.pop(),l;switch(a){case 0:l=t.tZone;break;case 1:l=t.gZone;break;default:throw new Error("Invalid zone")}let c,u=i.distance(r,r,!1,!0),m=l.length-2;for(let d=0;d<m;d++)c=l[d],o.setRelative(c,c,u,i)}function cc(e){let t=e.stack,n=e.loop,s=e.fv,r=t.pop()/64,o=e.z2;for(;n--;){let i=t.pop(),a=o[i];s.setRelative(a,a,r),s.touch(a)}e.loop=1}function fc(e){let t=e.stack,n=e.rp1,s=e.rp2,r=e.loop,o=e.z0[n],i=e.z1[s],a=e.fv,l=e.dpv,c=e.z2;for(;r--;){let u=t.pop(),m=c[u];a.interpolate(m,o,i,l),a.touch(m)}e.loop=1}function ri(e,t){let n=t.stack,s=n.pop()/64,r=n.pop(),o=t.z1[r],i=t.z0[t.rp0],a=t.fv,l=t.pv;a.setRelative(o,i,s,l),a.touch(o),t.rp1=t.rp0,t.rp2=r,e&&(t.rp0=r)}function pc(e){let t=e.stack,n=e.rp0,s=e.z0[n],r=e.loop,o=e.fv,i=e.pv,a=e.z1;for(;r--;){let l=t.pop(),c=a[l];o.setRelative(c,s,0,i),o.touch(c)}e.loop=1}function hc(e){e.round=Au}function oi(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z0[r],i=t.fv,a=t.pv,l=t.cvt[s],c=a.distance(o,Fn);e&&(Math.abs(c-l)<t.cvCutIn&&(c=l),c=t.round(c)),i.setRelative(o,Fn,c,a),t.zp0===0&&(o.xo=o.x,o.yo=o.y),i.touch(o),t.rp0=t.rp1=r}function dc(e){let t=e.prog,n=e.ip,s=e.stack,r=t[++n];for(let o=0;o<r;o++)s.push(t[++n]);e.ip=n}function gc(e){let t=e.ip,n=e.prog,s=e.stack,r=n[++t];for(let o=0;o<r;o++){let i=n[++t]<<8|n[++t];i&32768&&(i=-((i^65535)+1)),s.push(i)}e.ip=t}function mc(e){let t=e.stack,n=e.store;n||(n=e.store=[]);let s=t.pop(),r=t.pop();n[r]=s}function yc(e){let t=e.stack,n=e.store,s=t.pop(),r=n&&n[s]||0;t.push(r)}function bc(e){let t=e.stack,n=t.pop(),s=t.pop();e.cvt[s]=n/64}function vc(e){let t=e.stack,n=t.pop();t.push(e.cvt[n]*64)}function ii(e,t){let n=t.stack,s=n.pop(),r=t.z2[s];n.push(t.dpv.distance(r,Fn,e,!1)*64)}function ai(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z1[s],i=t.z0[r],a=t.dpv.distance(i,o,e,e);t.stack.push(Math.round(a*64))}function xc(e){e.stack.push(e.ppem)}function Sc(e){e.autoFlip=!0}function kc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s<n?1:0)}function Tc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s<=n?1:0)}function Cc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s>n?1:0)}function Oc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s>=n?1:0)}function Ic(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n===s?1:0)}function wc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n!==s?1:0)}function Ec(e){let t=e.stack,n=t.pop();t.push(Math.trunc(n)&1?1:0)}function Lc(e){let t=e.stack,n=t.pop();t.push(Math.trunc(n)&1?0:1)}function Ac(e){let t=e.stack.pop(),n;t||$o(e,!0)}function Rc(e){}function Dc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n&&s?1:0)}function Fc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n||s?1:0)}function Uc(e){let t=e.stack,n=t.pop();t.push(n?0:1)}function Ks(e,t){let n=t.stack,s=n.pop(),r=t.fv,o=t.pv,i=t.ppem,a=t.deltaBase+(e-1)*16,l=t.deltaShift,c=t.z0;for(let u=0;u<s;u++){let m=n.pop(),d=n.pop();if(a+((d&240)>>4)!==i)continue;let v=(d&15)-8;v>=0&&v++;let S=c[m];r.setRelative(S,S,v*l,o)}}function Mc(e){let n=e.stack.pop();e.deltaBase=n}function Pc(e){let n=e.stack.pop();e.deltaShift=Math.pow(.5,n)}function Nc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s+n)}function Bc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s-n)}function _c(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s*64/n)}function Gc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s*n/64)}function Hc(e){let t=e.stack,n=t.pop();t.push(Math.abs(n))}function Vc(e){let t=e.stack,n=t.pop();t.push(-n)}function zc(e){let t=e.stack,n=t.pop();t.push(Math.floor(n/64)*64)}function jc(e){let t=e.stack,n=t.pop();t.push(Math.ceil(n/64)*64)}function ps(e,t){let n=t.stack,s=n.pop();n.push(t.round(s/64)*64)}function Wc(e){let t=e.stack,n=t.pop(),s=t.pop();e.cvt[s]=n*e.ppem/e.font.unitsPerEm}function Qs(e,t){let n=t.stack,s=n.pop(),r=t.ppem,o=t.deltaBase+(e-1)*16,i=t.deltaShift;for(let a=0;a<s;a++){let l=n.pop(),c=n.pop();if(o+((c&240)>>4)!==r)continue;let m=(c&15)-8;m>=0&&m++;let d=m*i;t.cvt[l]+=d}}function qc(e){let t=e.stack.pop();e.round=qo;let n;switch(t&192){case 0:n=.5;break;case 64:n=1;break;case 128:n=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=n,t&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw new Error("invalid SROUND value")}t&=15,t===0?e.srThreshold=0:e.srThreshold=(t/8-.5)*n}function $c(e){let t=e.stack.pop();e.round=qo;let n;switch(t&192){case 0:n=Math.sqrt(2)/2;break;case 64:n=Math.sqrt(2);break;case 128:n=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=n,t&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw new Error("invalid S45ROUND value")}t&=15,t===0?e.srThreshold=0:e.srThreshold=(t/8-.5)*n}function Xc(e){e.round=Lu}function Yc(e){e.round=Du}function Zc(e){e.round=Fu}function Kc(e){let t=e.stack.pop()}function li(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],i=t.z1[r],a,l;e?(a=o.y-i.y,l=i.x-o.x):(a=i.x-o.x,l=i.y-o.y),t.dpv=Dn(a,l)}function Qc(e){let t=e.stack,n=t.pop(),s=0;n&1&&(s=35),n&32&&(s|=4096),t.push(s)}function Jc(e){let t=e.stack,n=t.pop(),s=t.pop(),r=t.pop();t.push(s),t.push(n),t.push(r)}function ef(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(Math.max(s,n))}function tf(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(Math.min(s,n))}function nf(e){let t=e.stack.pop()}function sf(e){let t=e.stack.pop(),n=e.stack.pop();switch(t){case 1:e.inhibitGridFit=!!n;return;case 2:e.ignoreCvt=!!n;return;default:throw new Error("invalid INSTCTRL[] selector")}}function Lt(e,t){let n=t.stack,s=t.prog,r=t.ip;for(let o=0;o<e;o++)n.push(s[++r]);t.ip=r}function At(e,t){let n=t.ip,s=t.prog,r=t.stack;for(let o=0;o<e;o++){let i=s[++n]<<8|s[++n];i&32768&&(i=-((i^65535)+1)),r.push(i)}t.ip=n}function N(e,t,n,s,r,o){let i=o.stack,a=e&&i.pop(),l=i.pop(),c=o.rp0,u=o.z0[c],m=o.z1[l],d=o.minDis,x=o.fv,v=o.dpv,S,I,_,P;I=S=v.distance(m,u,!0,!0),_=I>=0?1:-1,I=Math.abs(I),e&&(P=o.cvt[a],s&&Math.abs(I-P)<o.cvCutIn&&(I=P)),n&&I<d&&(I=d),s&&(I=o.round(I)),x.setRelative(m,u,_*I,v),x.touch(m),o.rp1=o.rp0,o.rp2=l,t&&(o.rp0=l)}Vo=[Xo.bind(void 0,kt),Xo.bind(void 0,bt),Yo.bind(void 0,kt),Yo.bind(void 0,bt),Zo.bind(void 0,kt),Zo.bind(void 0,bt),Ko.bind(void 0,0),Ko.bind(void 0,1),Qo.bind(void 0,0),Qo.bind(void 0,1),Mu,Pu,Nu,Bu,_u,Gu,Hu,Vu,zu,ju,Wu,qu,$u,Xu,Yu,Zu,Ku,Qu,Ju,ec,void 0,void 0,tc,Zs,nc,sc,rc,ac,lc,void 0,void 0,void 0,oc,ic,uc,void 0,Jo.bind(void 0,0),Jo.bind(void 0,1),ei.bind(void 0,kt),ei.bind(void 0,bt),ti.bind(void 0,0),ti.bind(void 0,1),ni.bind(void 0,0),ni.bind(void 0,1),si.bind(void 0,0),si.bind(void 0,1),cc,fc,ri.bind(void 0,0),ri.bind(void 0,1),pc,hc,oi.bind(void 0,0),oi.bind(void 0,1),dc,gc,mc,yc,bc,vc,ii.bind(void 0,0),ii.bind(void 0,1),void 0,ai.bind(void 0,0),ai.bind(void 0,1),xc,void 0,Sc,void 0,void 0,kc,Tc,Cc,Oc,Ic,wc,Ec,Lc,Ac,Rc,Dc,Fc,Uc,Ks.bind(void 0,1),Mc,Pc,Nc,Bc,_c,Gc,Hc,Vc,zc,jc,ps.bind(void 0,0),ps.bind(void 0,1),ps.bind(void 0,2),ps.bind(void 0,3),void 0,void 0,void 0,void 0,Wc,Ks.bind(void 0,2),Ks.bind(void 0,3),Qs.bind(void 0,1),Qs.bind(void 0,2),Qs.bind(void 0,3),qc,$c,void 0,void 0,Xc,void 0,Yc,Zc,Zs,Zs,void 0,void 0,void 0,void 0,void 0,Kc,li.bind(void 0,0),li.bind(void 0,1),Qc,void 0,Jc,ef,tf,nf,sf,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Lt.bind(void 0,1),Lt.bind(void 0,2),Lt.bind(void 0,3),Lt.bind(void 0,4),Lt.bind(void 0,5),Lt.bind(void 0,6),Lt.bind(void 0,7),Lt.bind(void 0,8),At.bind(void 0,1),At.bind(void 0,2),At.bind(void 0,3),At.bind(void 0,4),At.bind(void 0,5),At.bind(void 0,6),At.bind(void 0,7),At.bind(void 0,8),N.bind(void 0,0,0,0,0,0),N.bind(void 0,0,0,0,0,1),N.bind(void 0,0,0,0,0,2),N.bind(void 0,0,0,0,0,3),N.bind(void 0,0,0,0,1,0),N.bind(void 0,0,0,0,1,1),N.bind(void 0,0,0,0,1,2),N.bind(void 0,0,0,0,1,3),N.bind(void 0,0,0,1,0,0),N.bind(void 0,0,0,1,0,1),N.bind(void 0,0,0,1,0,2),N.bind(void 0,0,0,1,0,3),N.bind(void 0,0,0,1,1,0),N.bind(void 0,0,0,1,1,1),N.bind(void 0,0,0,1,1,2),N.bind(void 0,0,0,1,1,3),N.bind(void 0,0,1,0,0,0),N.bind(void 0,0,1,0,0,1),N.bind(void 0,0,1,0,0,2),N.bind(void 0,0,1,0,0,3),N.bind(void 0,0,1,0,1,0),N.bind(void 0,0,1,0,1,1),N.bind(void 0,0,1,0,1,2),N.bind(void 0,0,1,0,1,3),N.bind(void 0,0,1,1,0,0),N.bind(void 0,0,1,1,0,1),N.bind(void 0,0,1,1,0,2),N.bind(void 0,0,1,1,0,3),N.bind(void 0,0,1,1,1,0),N.bind(void 0,0,1,1,1,1),N.bind(void 0,0,1,1,1,2),N.bind(void 0,0,1,1,1,3),N.bind(void 0,1,0,0,0,0),N.bind(void 0,1,0,0,0,1),N.bind(void 0,1,0,0,0,2),N.bind(void 0,1,0,0,0,3),N.bind(void 0,1,0,0,1,0),N.bind(void 0,1,0,0,1,1),N.bind(void 0,1,0,0,1,2),N.bind(void 0,1,0,0,1,3),N.bind(void 0,1,0,1,0,0),N.bind(void 0,1,0,1,0,1),N.bind(void 0,1,0,1,0,2),N.bind(void 0,1,0,1,0,3),N.bind(void 0,1,0,1,1,0),N.bind(void 0,1,0,1,1,1),N.bind(void 0,1,0,1,1,2),N.bind(void 0,1,0,1,1,3),N.bind(void 0,1,1,0,0,0),N.bind(void 0,1,1,0,0,1),N.bind(void 0,1,1,0,0,2),N.bind(void 0,1,1,0,0,3),N.bind(void 0,1,1,0,1,0),N.bind(void 0,1,1,0,1,1),N.bind(void 0,1,1,0,1,2),N.bind(void 0,1,1,0,1,3),N.bind(void 0,1,1,1,0,0),N.bind(void 0,1,1,1,0,1),N.bind(void 0,1,1,1,0,2),N.bind(void 0,1,1,1,0,3),N.bind(void 0,1,1,1,1,0),N.bind(void 0,1,1,1,1,1),N.bind(void 0,1,1,1,1,2),N.bind(void 0,1,1,1,1,3)];var rf=jo;function dn(e){this.char=e,this.state={},this.activeState=null}function Js(e,t,n){this.contextName=n,this.startIndex=e,this.endOffset=t}function of(e,t,n){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=t,this.checkEnd=n}function Re(e,t){this.context=e,this.index=t,this.length=e.length,this.current=e[t],this.backtrack=e.slice(0,t),this.lookahead=e.slice(t+1)}function hs(e){this.eventId=e,this.subscribers=[]}function af(e){let t=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];for(let s=0;s<t.length;s++){let r=t[s];Object.defineProperty(this.events,r,{value:new hs(r)})}if(e)for(let s=0;s<t.length;s++){let r=t[s],o=e[r];typeof o=="function"&&this.events[r].subscribe(o)}let n=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];for(let s=0;s<n.length;s++){let r=n[s];this.events[r].subscribe(this.updateContextsRanges)}}function he(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],af.call(this,e)}dn.prototype.setState=function(e,t){return this.state[e]=t,this.activeState={key:e,value:this.state[e]},this.activeState},dn.prototype.getState=function(e){return this.state[e]||null},he.prototype.inboundIndex=function(e){return e>=0&&e<this.tokens.length},he.prototype.composeRUD=function(e){let n=e.map(r=>this[r[0]].apply(this,r.slice(1).concat(!0))),s=r=>typeof r=="object"&&Object.prototype.hasOwnProperty.call(r,"FAIL");if(n.every(s))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:n.filter(s)};this.dispatch("composeRUD",[n.filter(r=>!s(r))])},he.prototype.replaceRange=function(e,t,n,s){t=t!==null?t:this.tokens.length;let r=n.every(o=>o instanceof dn);if(!isNaN(e)&&this.inboundIndex(e)&&r){let o=this.tokens.splice.apply(this.tokens,[e,t].concat(n));return s||this.dispatch("replaceToken",[e,t,n]),[o,n]}else return{FAIL:"replaceRange: invalid tokens or startIndex."}},he.prototype.replaceToken=function(e,t,n){if(!isNaN(e)&&this.inboundIndex(e)&&t instanceof dn){let s=this.tokens.splice(e,1,t);return n||this.dispatch("replaceToken",[e,t]),[s[0],t]}else return{FAIL:"replaceToken: invalid token or index."}},he.prototype.removeRange=function(e,t,n){t=isNaN(t)?this.tokens.length:t;let s=this.tokens.splice(e,t);return n||this.dispatch("removeRange",[s,e,t]),s},he.prototype.removeToken=function(e,t){if(!isNaN(e)&&this.inboundIndex(e)){let n=this.tokens.splice(e,1);return t||this.dispatch("removeToken",[n,e]),n}else return{FAIL:"removeToken: invalid token index."}},he.prototype.insertToken=function(e,t,n){return e.every(r=>r instanceof dn)?(this.tokens.splice.apply(this.tokens,[t,0].concat(e)),n||this.dispatch("insertToken",[e,t]),e):{FAIL:"insertToken: invalid token(s)."}},he.prototype.registerModifier=function(e,t,n){this.events.newToken.subscribe(function(s,r){let o=[s,r],i=t===null||t.apply(this,o)===!0,a=[s,r];if(i){let l=n.apply(this,a);s.setState(e,l)}}),this.registeredModifiers.push(e)},hs.prototype.subscribe=function(e){return typeof e=="function"?this.subscribers.push(e)-1:{FAIL:`invalid '${this.eventId}' event handler`}},hs.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)},Re.prototype.setCurrentIndex=function(e){this.index=e,this.current=this.context[e],this.backtrack=this.context.slice(0,e),this.lookahead=this.context.slice(e+1)},Re.prototype.get=function(e){switch(!0){case e===0:return this.current;case(e<0&&Math.abs(e)<=this.backtrack.length):return this.backtrack.slice(e)[0];case(e>0&&e<=this.lookahead.length):return this.lookahead[e-1];default:return null}},he.prototype.rangeToText=function(e){if(e instanceof Js)return this.getRangeTokens(e).map(t=>t.char).join("")},he.prototype.getText=function(){return this.tokens.map(e=>e.char).join("")},he.prototype.getContext=function(e){let t=this.registeredContexts[e];return t||null},he.prototype.on=function(e,t){let n=this.events[e];return n?n.subscribe(t):null},he.prototype.dispatch=function(e,t){let n=this.events[e];if(n instanceof hs)for(let s=0;s<n.subscribers.length;s++)n.subscribers[s].apply(this,t||[])},he.prototype.registerContextChecker=function(e,t,n){if(this.getContext(e))return{FAIL:`context name '${e}' is already registered.`};if(typeof t!="function")return{FAIL:"missing context start check."};if(typeof n!="function")return{FAIL:"missing context end check."};let s=new of(e,t,n);return this.registeredContexts[e]=s,this.contextCheckers.push(s),s},he.prototype.getRangeTokens=function(e){let t=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,t))},he.prototype.getContextRanges=function(e){let t=this.getContext(e);return t?t.ranges:{FAIL:`context checker '${e}' is not registered.`}},he.prototype.resetContextsRanges=function(){let e=this.registeredContexts;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];n.ranges=[]}},he.prototype.updateContextsRanges=function(){this.resetContextsRanges();let e=this.tokens.map(t=>t.char);for(let t=0;t<e.length;t++){let n=new Re(e,t);this.runContextCheck(n)}this.dispatch("updateContextsRanges",[this.registeredContexts])},he.prototype.setEndOffset=function(e,t){let n=this.getContext(t).openRange.startIndex,s=new Js(n,e,t),r=this.getContext(t).ranges;return s.rangeId=`${t}.${r.length}`,r.push(s),this.getContext(t).openRange=null,s},he.prototype.runContextCheck=function(e){let t=e.index;for(let n=0;n<this.contextCheckers.length;n++){let s=this.contextCheckers[n],r=s.contextName,o=this.getContext(r).openRange;if(!o&&s.checkStart(e)&&(o=new Js(t,null,r),this.getContext(r).openRange=o,this.dispatch("contextStart",[r,t])),o&&s.checkEnd(e)){let i=t-o.startIndex+1,a=this.setEndOffset(i,r);this.dispatch("contextEnd",[r,a])}}},he.prototype.tokenize=function(e){this.tokens=[],this.resetContextsRanges();let t=Array.from(e);this.dispatch("start");for(let n=0;n<t.length;n++){let s=t[n],r=new Re(t,n);this.dispatch("next",[r]),this.runContextCheck(r);let o=new dn(s);this.tokens.push(o),this.dispatch("newToken",[o,r])}return this.dispatch("end",[this.tokens]),this.tokens};var lf=he;function Rt(e){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e)}function ui(e){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(e)}function Dt(e){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e)}function ds(e){return/[\u0E00-\u0E7F]/.test(e)}function gs(e){return/[A-z]/.test(e)}function uf(e){return/\s/.test(e)}function He(e){this.font=e,this.features={}}function Ft(e){this.id=e.id,this.tag=e.tag,this.substitution=e.substitution}function Ut(e,t){if(!e)return-1;switch(t.format){case 1:return t.glyphs.indexOf(e);case 2:{let n=t.ranges;for(let s=0;s<n.length;s++){let r=n[s];if(e>=r.start&&e<=r.end){let o=e-r.start;return r.index+o}}break}default:return-1}return-1}function cf(e,t){return Ut(e,t.coverage)===-1?null:e+t.deltaGlyphId}function ff(e,t){let n=Ut(e,t.coverage);return n===-1?null:t.substitute[n]}function er(e,t){let n=[];for(let s=0;s<e.length;s++){let r=e[s],o=t.current;o=Array.isArray(o)?o[0]:o;let i=Ut(o,r);i!==-1&&n.push(i)}return n.length!==e.length?-1:n}function pf(e,t){let n=t.inputCoverage.length+t.lookaheadCoverage.length+t.backtrackCoverage.length;if(e.context.length<n)return[];let s=er(t.inputCoverage,e);if(s===-1)return[];let r=t.inputCoverage.length-1;if(e.lookahead.length<t.lookaheadCoverage.length)return[];let o=e.lookahead.slice(r);for(;o.length&&Dt(o[0].char);)o.shift();let i=new Re(o,0),a=er(t.lookaheadCoverage,i),l=[].concat(e.backtrack);for(l.reverse();l.length&&Dt(l[0].char);)l.shift();if(l.length<t.backtrackCoverage.length)return[];let c=new Re(l,0),u=er(t.backtrackCoverage,c),m=s.length===t.inputCoverage.length&&a.length===t.lookaheadCoverage.length&&u.length===t.backtrackCoverage.length,d=[];if(m)for(let x=0;x<t.lookupRecords.length;x++){let v=t.lookupRecords[x],S=v.lookupListIndex,I=this.getLookupByIndex(S);for(let _=0;_<I.subtables.length;_++){let P=I.subtables[_],z,Y=this.getSubstitutionType(I,P);if(Y==="71"?(Y=this.getSubstitutionType(P,P.extension),z=this.getLookupMethod(P,P.extension),P=P.extension):z=this.getLookupMethod(I,P),Y==="12"){let re=e.get(v.sequenceIndex),ie=z(re);ie&&d.push(ie)}else if(Y==="21"){let re=e.get(v.sequenceIndex),ie=z(re);ie&&d.push(ie)}else throw new Error(`Substitution type ${Y} is not supported in chaining substitution`)}}return d}function hf(e,t){let n=e.current,s=Ut(n,t.coverage);if(s===-1)return null;let r,o=t.ligatureSets[s];for(let i=0;i<o.length;i++){r=o[i];for(let a=0;a<r.components.length;a++){let l=e.lookahead[a],c=r.components[a];if(l!==c)break;if(a===r.components.length-1)return r}}return null}function df(e,t){let n=e.current;if(Ut(n,t.coverage)===-1)return null;for(let r of t.ruleSets)for(let o of r){let i=!0;for(let a=0;a<o.input.length;a++)if(e.lookahead[a]!==o.input[a]){i=!1;break}if(i){let a=[];a.push(n);for(let c=0;c<o.input.length;c++)a.push(o.input[c]);let l=(c,u)=>{let{lookupListIndex:m,sequenceIndex:d}=u,{subtables:x}=this.getLookupByIndex(m);for(let v of x)Ut(c[d],v.coverage)!==-1&&(c[d]=v.deltaGlyphId)};for(let c=0;c<o.lookupRecords.length;c++){let u=o.lookupRecords[c];l(a,u)}return a}}return null}function gf(e,t){if(e.context.length<t.coverages.length)return[];for(let s=0;s<t.coverages.length;s++){let r=e.get(s);if(r=Array.isArray(r)?r[0]:r,Ut(r,t.coverages[s])===-1)return[]}let n=[];for(let s=0;s<t.lookupRecords.length;s++){let r=t.lookupRecords[s],o=r.lookupListIndex,i=this.getLookupByIndex(o);for(let a=0;a<i.subtables.length;a++){let l=i.subtables[a],c,u=this.getSubstitutionType(i,l);if(u==="71"?(u=this.getSubstitutionType(l,l.extension),c=this.getLookupMethod(l,l.extension),l=l.extension):c=this.getLookupMethod(i,l),u==="12"){let m=e.get(r.sequenceIndex),d=c(m);d&&n.push(d)}else if(u==="21"){let m=e.get(r.sequenceIndex),d=c(m);d&&n.push(d)}}}return n}function mf(e,t){let n=Ut(e,t.coverage);return n===-1?null:t.sequences[n]}He.prototype.getDefaultScriptFeaturesIndexes=function(){let e=this.font.tables.gsub.scripts;for(let t=0;t<e.length;t++){let n=e[t];if(n.tag==="DFLT")return n.script.defaultLangSys.featureIndexes}return[]},He.prototype.getScriptFeaturesIndexes=function(e){if(!this.font.tables.gsub)return[];if(!e)return this.getDefaultScriptFeaturesIndexes();let n=this.font.tables.gsub.scripts;for(let s=0;s<n.length;s++){let r=n[s];if(r.tag===e&&r.script.defaultLangSys)return r.script.defaultLangSys.featureIndexes;{let o=r.langSysRecords;if(o)for(let i=0;i<o.length;i++){let a=o[i];if(a.tag===e)return a.langSys.featureIndexes}}}return this.getDefaultScriptFeaturesIndexes()},He.prototype.mapTagsToFeatures=function(e,t){let n={};for(let s=0;s<e.length;s++){let r=e[s].tag,o=e[s].feature;n[r]=o}this.features[t].tags=n},He.prototype.getScriptFeatures=function(e){let t=this.features[e];if(Object.prototype.hasOwnProperty.call(this.features,e))return t;let n=this.getScriptFeaturesIndexes(e);if(!n)return null;let s=this.font.tables.gsub;return t=n.map(r=>s.features[r]),this.features[e]=t,this.mapTagsToFeatures(t,e),t},He.prototype.getSubstitutionType=function(e,t){let n=e.lookupType.toString(),s=t.substFormat.toString();return n+s},He.prototype.getLookupMethod=function(e,t){let n=this.getSubstitutionType(e,t);switch(n){case"11":return s=>cf.apply(this,[s,t]);case"12":return s=>ff.apply(this,[s,t]);case"63":return s=>pf.apply(this,[s,t]);case"41":return s=>hf.apply(this,[s,t]);case"21":return s=>mf.apply(this,[s,t]);case"51":return s=>df.apply(this,[s,t]);case"53":return s=>gf.apply(this,[s,t]);default:throw new Error(`substitutionType : ${n} lookupType: ${e.lookupType} - substFormat: ${t.substFormat} is not yet supported`)}},He.prototype.lookupFeature=function(e){let t=e.contextParams,n=t.index,s=this.getFeature({tag:e.tag,script:e.script});if(!s)return new Error(`font '${(this.font.names.unicode||this.font.names.windows||this.font.names.macintosh).fullName.en}' doesn't support feature '${e.tag}' for script '${e.script}'.`);let r=this.getFeatureLookups(s),o=[].concat(t.context);for(let i=0;i<r.length;i++){let a=r[i],l=this.getLookupSubtables(a);for(let c=0;c<l.length;c++){let u=l[c],m=this.getSubstitutionType(a,u),d;m==="71"?(m=this.getSubstitutionType(u,u.extension),d=this.getLookupMethod(u,u.extension),u=u.extension):d=this.getLookupMethod(a,u);let x;switch(m){case"11":x=d(t.current),x&&o.splice(n,1,new Ft({id:11,tag:e.tag,substitution:x}));break;case"12":x=d(t.current),x&&o.splice(n,1,new Ft({id:12,tag:e.tag,substitution:x}));break;case"63":x=d(t),Array.isArray(x)&&x.length&&o.splice(n,1,new Ft({id:63,tag:e.tag,substitution:x}));break;case"41":x=d(t),x&&o.splice(n,1,new Ft({id:41,tag:e.tag,substitution:x}));break;case"21":x=d(t.current),x&&o.splice(n,1,new Ft({id:21,tag:e.tag,substitution:x}));break;case"51":case"53":x=d(t),Array.isArray(x)&&x.length&&o.splice(n,1,new Ft({id:parseInt(m),tag:e.tag,substitution:x}));break}t=new Re(o,n),!(Array.isArray(x)&&!x.length)&&(x=null)}}return o.length?o:null},He.prototype.supports=function(e){if(!e.script)return!1;this.getScriptFeatures(e.script);let t=Object.prototype.hasOwnProperty.call(this.features,e.script);if(!e.tag)return t;let n=this.features[e.script].some(s=>s.tag===e.tag);return t&&n},He.prototype.getLookupSubtables=function(e){return e.subtables||null},He.prototype.getLookupByIndex=function(e){return this.font.tables.gsub.lookups[e]||null},He.prototype.getFeatureLookups=function(e){return e.lookupListIndexes.map(this.getLookupByIndex.bind(this))},He.prototype.getFeature=function(t){if(!this.font)return{FAIL:"No font was found"};Object.prototype.hasOwnProperty.call(this.features,t.script)||this.getScriptFeatures(t.script);let n=this.features[t.script];return n?n.tags[t.tag]?this.features[t.script].tags[t.tag]:null:{FAIL:`No feature for script ${t.script}`}};var yf=He;function bf(e){let t=e.current,n=e.get(-1);return n===null&&Rt(t)||!Rt(n)&&Rt(t)}function vf(e){let t=e.get(1);return t===null||!Rt(t)}var xf={startCheck:bf,endCheck:vf};function Sf(e){let t=e.current,n=e.get(-1);return(Rt(t)||Dt(t))&&!Rt(n)}function kf(e){let t=e.get(1);switch(!0){case t===null:return!0;case(!Rt(t)&&!Dt(t)):{let n=uf(t);if(!n)return!0;if(n){let s=!1;if(s=e.lookahead.some(r=>Rt(r)||Dt(r)),!s)return!0}break}default:return!1}}var Tf={startCheck:Sf,endCheck:kf};function Cf(e,t,n){t[n].setState(e.tag,e.substitution)}function Of(e,t,n){t[n].setState(e.tag,e.substitution)}function tr(e,t,n){for(let s=0;s<e.substitution.length;s++){let r=e.substitution[s],o=t[n+s];if(Array.isArray(r)){r.length?o.setState(e.tag,r[0]):o.setState("deleted",!0);continue}o.setState(e.tag,r)}}function If(e,t,n){let s=t[n];s.setState(e.tag,e.substitution.ligGlyph);let r=e.substitution.components.length;for(let o=0;o<r;o++)s=t[n+o+1],s.setState("deleted",!0)}var ci={11:Cf,12:Of,63:tr,41:If,51:tr,53:tr};function wf(e,t,n){e instanceof Ft&&ci[e.id]&&ci[e.id](e,t,n)}var Zt=wf;function Ef(e){let t=[].concat(e.backtrack);for(let n=t.length-1;n>=0;n--){let s=t[n],r=ui(s),o=Dt(s);if(!r&&!o)return!0;if(r)return!1}return!1}function Lf(e){if(ui(e.current))return!1;for(let t=0;t<e.lookahead.length;t++){let n=e.lookahead[t];if(!Dt(n))return!0}return!1}function Af(e){let t="arab",n=this.featuresTags[t],s=this.tokenizer.getRangeTokens(e);if(s.length===1)return;let r=new Re(s.map(i=>i.getState("glyphIndex")),0),o=new Re(s.map(i=>i.char),0);for(let i=0;i<s.length;i++){let a=s[i];if(Dt(a.char))continue;r.setCurrentIndex(i),o.setCurrentIndex(i);let l=0;Ef(o)&&(l|=1),Lf(o)&&(l|=2);let c;switch(l){case 1:c="fina";break;case 2:c="init";break;case 3:c="medi";break}if(n.indexOf(c)===-1)continue;let u=this.query.lookupFeature({tag:c,script:t,contextParams:r});if(u instanceof Error){console.info(u.message);continue}for(let m=0;m<u.length;m++){let d=u[m];d instanceof Ft&&(Zt(d,s,m),r.context[m]=d.substitution)}}}var Rf=Af;function fi(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function Df(e){let t="arab",n=this.tokenizer.getRangeTokens(e),s=fi(n);for(let r=0;r<s.context.length;r++){s.setCurrentIndex(r);let o=this.query.lookupFeature({tag:"rlig",script:t,contextParams:s});if(o.length){for(let i=0;i<o.length;i++){let a=o[i];Zt(a,n,r)}s=fi(n)}}}var Ff=Df;function Uf(e){return e.index===0&&e.context.length>1}function Mf(e){return e.index===e.context.length-1}var Pf={startCheck:Uf,endCheck:Mf};function pi(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function Nf(e){let t="delf",n="ccmp",s=this.tokenizer.getRangeTokens(e),r=pi(s);for(let o=0;o<r.context.length;o++){if(!this.query.getFeature({tag:n,script:t,contextParams:r}))continue;r.setCurrentIndex(o);let i=this.query.lookupFeature({tag:n,script:t,contextParams:r});if(i.length){for(let a=0;a<i.length;a++){let l=i[a];Zt(l,s,o)}r=pi(s)}}}var Bf=Nf;function _f(e){let t=e.current,n=e.get(-1);return n===null&&gs(t)||!gs(n)&&gs(t)}function Gf(e){let t=e.get(1);return t===null||!gs(t)}var Hf={startCheck:_f,endCheck:Gf};function hi(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function Vf(e){let t="latn",n=this.tokenizer.getRangeTokens(e),s=hi(n);for(let r=0;r<s.context.length;r++){s.setCurrentIndex(r);let o=this.query.lookupFeature({tag:"liga",script:t,contextParams:s});if(o.length){for(let i=0;i<o.length;i++){let a=o[i];Zt(a,n,r)}s=hi(n)}}}var zf=Vf;function jf(e){let t=e.current,n=e.get(-1);return n===null&&ds(t)||!ds(n)&&ds(t)}function Wf(e){let t=e.get(1);return t===null||!ds(t)}var qf={startCheck:jf,endCheck:Wf};function di(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function $f(e){let t="thai",n=this.tokenizer.getRangeTokens(e),s=di(n,0);for(let r=0;r<s.context.length;r++){s.setCurrentIndex(r);let o=this.query.lookupFeature({tag:"ccmp",script:t,contextParams:s});if(o.length){for(let i=0;i<o.length;i++){let a=o[i];Zt(a,n,r)}s=di(n,r)}}}var Xf=$f;function gi(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function Yf(e){let t="thai",n=this.tokenizer.getRangeTokens(e),s=gi(n,0);for(let r=0;r<s.context.length;r++){s.setCurrentIndex(r);let o=this.query.lookupFeature({tag:"liga",script:t,contextParams:s});if(o.length){for(let i=0;i<o.length;i++){let a=o[i];Zt(a,n,r)}s=gi(n,r)}}}var Zf=Yf;function mi(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function Kf(e){let t="thai",n=this.tokenizer.getRangeTokens(e),s=mi(n,0);for(let r=0;r<s.context.length;r++){s.setCurrentIndex(r);let o=this.query.lookupFeature({tag:"rlig",script:t,contextParams:s});if(o.length){for(let i=0;i<o.length;i++){let a=o[i];Zt(a,n,r)}s=mi(n,r)}}}var Qf=Kf;function nr(e){if(e===null)return!1;let t=e.codePointAt(0);return t>=6155&&t<=6157||t>=65024&&t<=65039||t>=917760&&t<=917999}function Jf(e){let t=e.current,n=e.get(1);return n===null&&nr(t)||nr(n)}function ep(e){let t=e.get(1);return t===null||!nr(t)}var tp={startCheck:Jf,endCheck:ep};function np(e){let t=this.query.font,n=this.tokenizer.getRangeTokens(e);if(n[1].setState("deleted",!0),t.tables.cmap&&t.tables.cmap.varSelectorList){let s=n[0].char.codePointAt(0),r=n[1].char.codePointAt(0),o=t.tables.cmap.varSelectorList[r];if(o!==void 0&&o.nonDefaultUVS){let i=o.nonDefaultUVS.uvsMappings;if(i[s]){let a=i[s].glyphID;t.glyphs.glyphs[a]!==void 0&&n[0].setState("glyphIndex",a)}}}}var sp=np;function Ze(e){this.baseDir=e||"ltr",this.tokenizer=new lf,this.featuresTags={}}Ze.prototype.setText=function(e){this.text=e},Ze.prototype.contextChecks={ccmpReplacementCheck:Pf,latinWordCheck:Hf,arabicWordCheck:xf,arabicSentenceCheck:Tf,thaiWordCheck:qf,unicodeVariationSequenceCheck:tp};function gn(e){let t=this.contextChecks[`${e}Check`];return this.tokenizer.registerContextChecker(e,t.startCheck,t.endCheck)}function rp(){return gn.call(this,"ccmpReplacement"),gn.call(this,"latinWord"),gn.call(this,"arabicWord"),gn.call(this,"arabicSentence"),gn.call(this,"thaiWord"),gn.call(this,"unicodeVariationSequence"),this.tokenizer.tokenize(this.text)}function op(){let e=this.tokenizer.getContextRanges("arabicSentence");for(let t=0;t<e.length;t++){let n=e[t],s=this.tokenizer.getRangeTokens(n);this.tokenizer.replaceRange(n.startIndex,n.endOffset,s.reverse())}}Ze.prototype.registerFeatures=function(e,t){let n=t.filter(s=>this.query.supports({script:e,tag:s}));Object.prototype.hasOwnProperty.call(this.featuresTags,e)?this.featuresTags[e]=this.featuresTags[e].concat(n):this.featuresTags[e]=n},Ze.prototype.applyFeatures=function(e,t){if(!e)throw new Error("No valid font was provided to apply features");this.query||(this.query=new yf(e));for(let n=0;n<t.length;n++){let s=t[n];this.query.supports({script:s.script})&&this.registerFeatures(s.script,s.tags)}},Ze.prototype.registerModifier=function(e,t,n){this.tokenizer.registerModifier(e,t,n)};function Un(){if(this.tokenizer.registeredModifiers.indexOf("glyphIndex")===-1)throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function ip(){if(!Object.prototype.hasOwnProperty.call(this.featuresTags,"arab"))return;Un.call(this);let t=this.tokenizer.getContextRanges("arabicWord");for(let n=0;n<t.length;n++){let s=t[n];Rf.call(this,s)}}function ap(){Un.call(this);let e=this.tokenizer.getContextRanges("ccmpReplacement");for(let t=0;t<e.length;t++){let n=e[t];Bf.call(this,n)}}function lp(){if(!this.hasFeatureEnabled("arab","rlig"))return;Un.call(this);let e=this.tokenizer.getContextRanges("arabicWord");for(let t=0;t<e.length;t++){let n=e[t];Ff.call(this,n)}}function up(){if(!this.hasFeatureEnabled("latn","liga"))return;Un.call(this);let e=this.tokenizer.getContextRanges("latinWord");for(let t=0;t<e.length;t++){let n=e[t];zf.call(this,n)}}function cp(){let e=this.tokenizer.getContextRanges("unicodeVariationSequence");for(let t=0;t<e.length;t++){let n=e[t];sp.call(this,n)}}function fp(){Un.call(this);let e=this.tokenizer.getContextRanges("thaiWord");for(let t=0;t<e.length;t++){let n=e[t];this.hasFeatureEnabled("thai","liga")&&Zf.call(this,n),this.hasFeatureEnabled("thai","rlig")&&Qf.call(this,n),this.hasFeatureEnabled("thai","ccmp")&&Xf.call(this,n)}}Ze.prototype.checkContextReady=function(e){return!!this.tokenizer.getContext(e)},Ze.prototype.applyFeaturesToContexts=function(){this.checkContextReady("ccmpReplacement")&&ap.call(this),this.checkContextReady("arabicWord")&&(ip.call(this),lp.call(this)),this.checkContextReady("latinWord")&&up.call(this),this.checkContextReady("arabicSentence")&&op.call(this),this.checkContextReady("thaiWord")&&fp.call(this),this.checkContextReady("unicodeVariationSequence")&&cp.call(this)},Ze.prototype.hasFeatureEnabled=function(e,t){return(this.featuresTags[e]||[]).indexOf(t)!==-1},Ze.prototype.processText=function(e){(!this.text||this.text!==e)&&(this.setText(e),rp.call(this),this.applyFeaturesToContexts())},Ze.prototype.getBidiText=function(e){return this.processText(e),this.tokenizer.getText()},Ze.prototype.getTextGlyphs=function(e){this.processText(e);let t=[];for(let n=0;n<this.tokenizer.tokens.length;n++){let s=this.tokenizer.tokens[n];if(s.state.deleted)continue;let r=s.activeState.value;t.push(Array.isArray(r)?r[0]:r)}return t};var pp=Ze;function sr(e){return{fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||(e.familyName+e.styleName).replace(/\s/g,"")},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}}}function oe(e){if(e=e||{},e.tables=e.tables||{},!e.empty){if(!e.familyName)throw new Error("When creating a new Font object, familyName is required.");if(!e.styleName)throw new Error("When creating a new Font object, styleName is required.");if(!e.unitsPerEm)throw new Error("When creating a new Font object, unitsPerEm is required.");if(!e.ascender)throw new Error("When creating a new Font object, ascender is required.");if(e.descender>0)throw new Error("When creating a new Font object, negative descender value is required.");this.names={},this.names.unicode=sr(e),this.names.macintosh=sr(e),this.names.windows=sr(e),this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.italicAngle=e.italicAngle||0,this.weightClass=e.weightClass||0;let t=0;e.fsSelection?t=e.fsSelection:(this.italicAngle<0?t|=this.fsSelectionValues.ITALIC:this.italicAngle>0&&(t|=this.fsSelectionValues.OBLIQUE),this.weightClass>=600&&(t|=this.fsSelectionValues.BOLD),t===0&&(t=this.fsSelectionValues.REGULAR)),(!e.panose||!Array.isArray(e.panose))&&(e.panose=[0,0,0,0,0,0,0,0,0]),this.tables=Object.assign(e.tables,{os2:Object.assign({usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,bFamilyType:e.panose[0]||0,bSerifStyle:e.panose[1]||0,bWeight:e.panose[2]||0,bProportion:e.panose[3]||0,bContrast:e.panose[4]||0,bStrokeVariation:e.panose[5]||0,bArmStyle:e.panose[6]||0,bLetterform:e.panose[7]||0,bMidline:e.panose[8]||0,bXHeight:e.panose[9]||0,fsSelection:t},e.tables.os2)})}this.supported=!0,this.glyphs=new mt.GlyphSet(this,e.glyphs||[]),this.encoding=new qr(this),this.position=new iu(this),this.substitution=new hu(this),this.tables=this.tables||{},this.tables=new Proxy(this.tables,{set:(t,n,s)=>(t[n]=s,t.fvar&&(t.gvar||t.cff2)&&!this.variation&&(this.variation=new Eu(this)),!0)}),this.palettes=new Po(this),this.layers=new du(this),this.svgImages=new gu(this),this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:this.outlinesFormat==="truetype"?this._hinting=new rf(this):null}})}oe.prototype.hasChar=function(e){return this.encoding.charToGlyphIndex(e)>0},oe.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},oe.prototype.charToGlyph=function(e){let t=this.charToGlyphIndex(e),n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},oe.prototype.updateFeatures=function(e){return this.defaultRenderOptions.features.map(t=>t.script==="latn"?{script:"latn",tags:t.tags.filter(n=>e[n])}:t)},oe.prototype.stringToGlyphIndexes=function(e,t){let n=new pp,s=o=>this.charToGlyphIndex(o.char);n.registerModifier("glyphIndex",null,s);let r=t?this.updateFeatures(t.features):this.defaultRenderOptions.features;return n.applyFeatures(this,r),n.getTextGlyphs(e)},oe.prototype.stringToGlyphs=function(e,t){let n=this.stringToGlyphIndexes(e,t),s=n.length,r=new Array(s),o=this.glyphs.get(0);for(let i=0;i<s;i+=1)r[i]=this.glyphs.get(n[i])||o;return r},oe.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},oe.prototype.nameToGlyph=function(e){let t=this.nameToGlyphIndex(e),n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},oe.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},oe.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;let n=this.position.defaultKerningTables;return n?this.position.getKerningValue(n,e,t):this.kerningPairs[e+","+t]||0},oe.prototype.defaultRenderOptions={kerning:!0,features:[{script:"arab",tags:["init","medi","fina","rlig"]},{script:"latn",tags:["liga","rlig"]},{script:"thai",tags:["liga","rlig","ccmp"]}],hinting:!1,usePalette:0,drawLayers:!0,drawSVG:!0},oe.prototype.forEachGlyph=function(e,t,n,s,r,o){t=t!==void 0?t:0,n=n!==void 0?n:0,s=s!==void 0?s:72,r=Object.assign({},this.defaultRenderOptions,r);let i=1/this.unitsPerEm*s,a=this.stringToGlyphs(e,r),l;if(r.kerning){let c=r.script||this.position.getDefaultScriptName();l=this.position.getKerningTables(c,r.language)}for(let c=0;c<a.length;c+=1){let u=a[c];if(o.call(this,u,t,n,s,r),u.advanceWidth&&(t+=u.advanceWidth*i),r.kerning&&c<a.length-1){let m=l?this.position.getKerningValue(l,u.index,a[c+1].index):this.getKerningValue(u,a[c+1]);t+=m*i}r.letterSpacing?t+=r.letterSpacing*s:r.tracking&&(t+=r.tracking/1e3*s)}return t},oe.prototype.getPath=function(e,t,n,s,r){r=Object.assign({},this.defaultRenderOptions,r);let o=new Wt;if(o._layers=[],ro(this,o,s),o.stroke){let i=1/(o.unitsPerEm||1e3)*s;o.strokeWidth*=i}return this.forEachGlyph(e,t,n,s,r,(i,a,l,c)=>{let u=i.getPath(a,l,c,r,this);if(r.drawSVG||r.drawLayers){let m=u._layers;if(m&&m.length){for(let d=0;d<m.length;d++){let x=m[d];o._layers.push(x)}return}}o.extend(u)}),o},oe.prototype.getPaths=function(e,t,n,s,r){r=Object.assign({},this.defaultRenderOptions,r);let o=[];return this.forEachGlyph(e,t,n,s,r,function(i,a,l,c){let u=i.getPath(a,l,c,r,this);o.push(u)}),o},oe.prototype.getAdvanceWidth=function(e,t,n){return n=Object.assign({},this.defaultRenderOptions,n),this.forEachGlyph(e,0,0,t,n,function(){})},oe.prototype.draw=function(e,t,n,s,r,o){this.getPath(t,n,s,r,o).draw(e)},oe.prototype.drawPoints=function(e,t,n,s,r,o){o=Object.assign({},this.defaultRenderOptions,o),this.forEachGlyph(t,n,s,r,o,function(i,a,l,c){i.drawPoints(e,a,l,c,o,this)})},oe.prototype.drawMetrics=function(e,t,n,s,r,o){o=Object.assign({},this.defaultRenderOptions,o),this.forEachGlyph(t,n,s,r,o,function(i,a,l,c){i.drawMetrics(e,a,l,c)})},oe.prototype.getEnglishName=function(e){let t=(this.names.unicode||this.names.macintosh||this.names.windows)[e];if(t)return t.en},oe.prototype.validate=function(){let e=[],t=this;function n(r,o){r||(console.warn(`[opentype.js] ${o}`),e.push(o))}function s(r){let o=t.getEnglishName(r);n(o&&o.trim().length>0,"No English "+r+" specified.")}if(s("fontFamily"),s("weightName"),s("manufacturer"),s("copyright"),s("version"),n(this.unitsPerEm>0,"No unitsPerEm specified."),this.tables.colr){let r=this.tables.colr.baseGlyphRecords,o=-1;for(let i=0;i<r.length;i++){let a=r[i].glyphID;if(n(o<r[i].glyphID,`baseGlyphs must be sorted by GlyphID in ascending order, but glyphID ${a} comes after ${o}`),o>r[i].glyphID)break;o=a}}return e},oe.prototype.toTables=function(){return ou.fontToTable(this)},oe.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},oe.prototype.toArrayBuffer=function(){let t=this.toTables().encode(),n=new ArrayBuffer(t.length),s=new Uint8Array(n);for(let r=0;r<t.length;r++)s[r]=t[r];return n},oe.prototype.download=function(){console.error("DEPRECATED: platform-specific actions are to be implemented on user-side")},oe.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},oe.prototype.macStyleValues={BOLD:1,ITALIC:2,UNDERLINE:4,OUTLINED:8,SHADOW:16,CONDENSED:32,EXTENDED:64},oe.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},oe.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var yi=oe;function hp(e,t){let n=new F.Parser(e,t),s=n.parseUShort(),r=n.parseUShort();s!==1&&console.warn(`Unsupported hvar table version ${s}.${r}`);let o=[s,r],i=n.parsePointer32(function(){return this.parseItemVariationStore()}),a=n.parsePointer32(function(){return this.parseDeltaSetIndexMap()}),l=n.parsePointer32(function(){return this.parseDeltaSetIndexMap()}),c=n.parsePointer32(function(){return this.parseDeltaSetIndexMap()});return{version:o,itemVariationStore:i,advanceWidth:a,lsb:l,rsb:c}}function dp(){console.warn("Writing of hvar tables is not yet supported.")}var gp={make:dp,parse:hp},mp=function(){return{coverage:this.parsePointer(C.coverage),attachPoints:this.parseList(C.pointer(C.uShortList))}},yp=function(){var e=this.parseUShort();if(B.argument(e===1||e===2||e===3,"Unsupported CaretValue table version."),e===1)return{coordinate:this.parseShort()};if(e===2)return{pointindex:this.parseShort()};if(e===3)return{coordinate:this.parseShort()}},bp=function(){return this.parseList(C.pointer(yp))},vp=function(){return{coverage:this.parsePointer(C.coverage),ligGlyphs:this.parseList(C.pointer(bp))}},xp=function(){return this.parseUShort(),this.parseList(C.pointer(C.coverage))};function Sp(e,t){t=t||0;let n=new C(e,t),s=n.parseVersion(1);B.argument(s===1||s===1.2||s===1.3,"Unsupported GDEF table version.");var r={version:s,classDef:n.parsePointer(C.classDef),attachList:n.parsePointer(mp),ligCaretList:n.parsePointer(vp),markAttachClassDef:n.parsePointer(C.classDef)};return s>=1.2&&(r.markGlyphSets=n.parsePointer(xp)),r}var kp={parse:Sp},rt=new Array(10);rt[1]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();if(n===1)return{posFormat:1,coverage:this.parsePointer(C.coverage),value:this.parseValueRecord()};if(n===2)return{posFormat:2,coverage:this.parsePointer(C.coverage),values:this.parseValueRecordList()};B.assert(!1,"0x"+t.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},rt[2]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();B.assert(n===1||n===2,"0x"+t.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");let s=this.parsePointer(C.coverage),r=this.parseUShort(),o=this.parseUShort();if(n===1)return{posFormat:n,coverage:s,valueFormat1:r,valueFormat2:o,pairSets:this.parseList(C.pointer(C.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(r),value2:this.parseValueRecord(o)}})))};if(n===2){let i=this.parsePointer(C.classDef),a=this.parsePointer(C.classDef),l=this.parseUShort(),c=this.parseUShort();return{posFormat:n,coverage:s,valueFormat1:r,valueFormat2:o,classDef1:i,classDef2:a,class1Count:l,class2Count:c,classRecords:this.parseList(l,C.list(c,function(){return{value1:this.parseValueRecord(r),value2:this.parseValueRecord(o)}}))}}},rt[3]=function(){return{error:"GPOS Lookup 3 not supported"}},rt[4]=function(){return{error:"GPOS Lookup 4 not supported"}},rt[5]=function(){return{error:"GPOS Lookup 5 not supported"}},rt[6]=function(){return{error:"GPOS Lookup 6 not supported"}},rt[7]=function(){return{error:"GPOS Lookup 7 not supported"}},rt[8]=function(){return{error:"GPOS Lookup 8 not supported"}},rt[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function Tp(e,t){t=t||0;let n=new C(e,t),s=n.parseVersion(1);return B.argument(s===1||s===1.1,"Unsupported GPOS table version "+s),s===1?{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(rt)}:{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(rt),variations:n.parseFeatureVariationsList()}}var Cp=new Array(10);function Op(e){return new A.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new A.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new A.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new A.LookupList(e.lookups,Cp)}])}var Ip={parse:Tp,make:Op};function wp(e){let t={};e.skip("uShort");let n=e.parseUShort();B.argument(n===0,"Unsupported kern sub-table version."),e.skip("uShort",2);let s=e.parseUShort();e.skip("uShort",3);for(let r=0;r<s;r+=1){let o=e.parseUShort(),i=e.parseUShort(),a=e.parseShort();t[o+","+i]=a}return t}function Ep(e){let t={};e.skip("uShort"),e.parseULong()>1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");let r=e.parseUShort()&255;if(e.skip("uShort"),r===0){let o=e.parseUShort();e.skip("uShort",3);for(let i=0;i<o;i+=1){let a=e.parseUShort(),l=e.parseUShort(),c=e.parseShort();t[a+","+l]=c}}return t}function Lp(e,t){let n=new F.Parser(e,t),s=n.parseUShort();if(s===0)return wp(n);if(s===1)return Ep(n);throw new Error("Unsupported kern table version ("+s+").")}var Ap={parse:Lp};function Rp(e,t,n,s){let r=new F.Parser(e,t),o=s?r.parseUShort:r.parseULong,i=[];for(let a=0;a<n+1;a+=1){let l=o.call(r);s&&(l*=2),i.push(l)}return i}var Dp={parse:Rp};function bi(e,t){let n=[],s=12;for(let r=0;r<t;r+=1){let o=F.getTag(e,s),i=F.getULong(e,s+4),a=F.getULong(e,s+8),l=F.getULong(e,s+12);n.push({tag:o,checksum:i,offset:a,length:l,compression:!1}),s+=16}return n}function Fp(e,t){let n=[],s=44;for(let r=0;r<t;r+=1){let o=F.getTag(e,s),i=F.getULong(e,s+4),a=F.getULong(e,s+8),l=F.getULong(e,s+12),c;a<l?c="WOFF":c=!1,n.push({tag:o,offset:i,compression:c,compressedLength:a,length:l}),s+=20}return n}function te(e,t){if(t.compression==="WOFF"){let n=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),s=new Uint8Array(t.length);if(Er(n,s),s.byteLength!==t.length)throw new Error("Decompression error: "+t.tag+" decompressed length doesn't match recorded length");return{data:new DataView(s.buffer,0),offset:0}}else return{data:e,offset:t.offset}}function Up(e,t={}){let n,s,r=new yi({empty:!0});e.constructor!==ArrayBuffer&&(e=new Uint8Array(e).buffer);let o=new DataView(e,0),i,a=[],l=F.getTag(o,0);if(l==="\0\0\0"||l==="true"||l==="typ1")r.outlinesFormat="truetype",i=F.getUShort(o,4),a=bi(o,i);else if(l==="OTTO")r.outlinesFormat="cff",i=F.getUShort(o,4),a=bi(o,i);else if(l==="wOFF"){let G=F.getTag(o,4);if(G==="\0\0\0")r.outlinesFormat="truetype";else if(G==="OTTO")r.outlinesFormat="cff";else throw new Error("Unsupported OpenType flavor "+l);i=F.getUShort(o,12),a=Fp(o,i)}else if(l==="wOF2"){let G="https://github.com/opentypejs/opentype.js/issues/183#issuecomment-1147228025";throw new Error("WOFF2 require an external decompressor library, see examples at: "+G)}else throw new Error("Unsupported OpenType signature "+l);let c,u,m,d,x,v,S,I,_,P,z,Y,re,ie,ae,me,ot,Z;for(let G=0;G<i;G+=1){let U=a[G],M;switch(U.tag){case"avar":S=U;break;case"cmap":M=te(o,U),r.tables.cmap=Wr.parse(M.data,M.offset),r.encoding=new $r(r.tables.cmap);break;case"cvt ":M=te(o,U),Z=new F.Parser(M.data,M.offset),r.tables.cvt=Z.parseShortList(U.length/2);break;case"fvar":m=U;break;case"STAT":d=U;break;case"gvar":x=U;break;case"cvar":v=U;break;case"fpgm":M=te(o,U),Z=new F.Parser(M.data,M.offset),r.tables.fpgm=Z.parseByteList(U.length);break;case"head":M=te(o,U),r.tables.head=co.parse(M.data,M.offset),r.unitsPerEm=r.tables.head.unitsPerEm,n=r.tables.head.indexToLocFormat;break;case"hhea":M=te(o,U),r.tables.hhea=fo.parse(M.data,M.offset),r.ascender=r.tables.hhea.ascender,r.descender=r.tables.hhea.descender,r.numberOfHMetrics=r.tables.hhea.numberOfHMetrics;break;case"HVAR":re=U;break;case"hmtx":Y=U;break;case"ltag":M=te(o,U),s=ho.parse(M.data,M.offset);break;case"COLR":M=te(o,U),r.tables.colr=vo.parse(M.data,M.offset);break;case"CPAL":M=te(o,U),r.tables.cpal=Kr.parse(M.data,M.offset);break;case"maxp":M=te(o,U),r.tables.maxp=go.parse(M.data,M.offset),r.numGlyphs=r.tables.maxp.numGlyphs;break;case"name":me=U;break;case"OS/2":M=te(o,U),r.tables.os2=zs.parse(M.data,M.offset);break;case"post":M=te(o,U),r.tables.post=mo.parse(M.data,M.offset),r.glyphNames=new Us(r.tables.post);break;case"prep":M=te(o,U),Z=new F.Parser(M.data,M.offset),r.tables.prep=Z.parseByteList(U.length);break;case"glyf":I=U;break;case"loca":ae=U;break;case"CFF ":c=U;break;case"CFF2":u=U;break;case"kern":ie=U;break;case"GDEF":_=U;break;case"GPOS":P=U;break;case"GSUB":z=U;break;case"meta":ot=U;break;case"gasp":try{M=te(o,U),r.tables.gasp=Oo.parse(M.data,M.offset)}catch(Ee){console.warn("Failed to parse gasp table, skipping."),console.warn(Ee)}break;case"SVG ":M=te(o,U),r.tables.svg=Io.parse(M.data,M.offset);break;default:break}}let Ve=te(o,me);if(r.tables.name=jr.parse(Ve.data,Ve.offset,s),r.names=r.tables.name,I&&ae){let G=n===0,U=te(o,ae),M=Dp.parse(U.data,U.offset,r.numGlyphs,G),Ee=te(o,I);r.glyphs=Go.parse(Ee.data,Ee.offset,M,r,t)}else if(c){let G=te(o,c);Hs.parse(G.data,G.offset,r,t)}else if(u){let G=te(o,u);Hs.parse(G.data,G.offset,r,t)}else throw new Error("Font doesn't contain TrueType, CFF or CFF2 outlines.");let De=te(o,Y);if(po.parse(r,De.data,De.offset,r.numberOfHMetrics,r.numGlyphs,r.glyphs,t),Ra(r,t),ie){let G=te(o,ie);r.kerningPairs=Ap.parse(G.data,G.offset)}else r.kerningPairs={};if(_){let G=te(o,_);r.tables.gdef=kp.parse(G.data,G.offset)}if(P){let G=te(o,P);r.tables.gpos=Ip.parse(G.data,G.offset),r.position.init()}if(z){let G=te(o,z);r.tables.gsub=yo.parse(G.data,G.offset)}if(m){let G=te(o,m);r.tables.fvar=xo.parse(G.data,G.offset,r.names)}if(d){let G=te(o,d);r.tables.stat=So.parse(G.data,G.offset,r.tables.fvar)}if(x){m||console.warn("This font provides a gvar table, but no fvar table, which is required for variable fonts."),I||console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");let G=te(o,x);r.tables.gvar=Co.parse(G.data,G.offset,r.tables.fvar,r.glyphs)}if(v){m||console.warn("This font provides a cvar table, but no fvar table, which is required for variable fonts."),r.tables.cvt||console.warn("This font provides a cvar table, but no cvt table which could be made variable."),I||console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");let G=te(o,v);r.tables.cvar=To.parse(G.data,G.offset,r.tables.fvar,r.tables.cvt||[])}if(S){m||console.warn("This font provides an avar table, but no fvar table, which is required for variable fonts.");let G=te(o,S);r.tables.avar=ko.parse(G.data,G.offset,r.tables.fvar)}if(re){m||console.warn("This font provides an HVAR table, but no fvar table, which is required for variable fonts."),Y||console.warn("This font provides an HVAR table, but no hmtx table to vary.");let G=te(o,re);r.tables.hvar=gp.parse(G.data,G.offset,r.tables.fvar)}if(ot){let G=te(o,ot);r.tables.meta=bo.parse(G.data,G.offset),r.metas=r.tables.meta}return r.palettes=new Po(r),r}function Mp(){console.error("DEPRECATED! migrate to: opentype.parse(buffer, opt) See: https://github.com/opentypejs/opentype.js/issues/675")}function Pp(){console.error('DEPRECATED! migrate to: opentype.parse(require("fs").readFileSync(url), opt)')}return T(O)})();(function(g,f){typeof define=="function"&&define.amd?define(f):typeof xs=="object"&&xs.exports?xs.exports=f():g.opentype=f()})(typeof self<"u"?self:Ci,()=>({...Ti,default:Ti}))});var Gi=qp(Oi());import{tracingChannel as $p,channel as Xp}from"node:diagnostics_channel";var Ce=Xp("lru-cache:metrics"),Mn=$p("lru-cache"),Yp=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,lr=()=>Ce.hasSubscribers||Mn.hasSubscribers,Li=new Set,Ii=typeof process=="object"&&process?process:{},Zp=(g,f,p,h)=>{typeof Ii.emitWarning=="function"?Ii.emitWarning(g,f,p,h):console.error(`[${p}] ${f}: ${g}`)},Kp=g=>!Li.has(g),Pt=g=>!!g&&g===Math.floor(g)&&g>0&&isFinite(g),Ai=g=>Pt(g)?g<=Math.pow(2,8)?Uint8Array:g<=Math.pow(2,16)?Uint16Array:g<=Math.pow(2,32)?Uint32Array:g<=Number.MAX_SAFE_INTEGER?Ss:null:null,Ss=class extends Array{constructor(g){super(g),this.fill(0)}},xt,bn,Qp=(xt=class{constructor(f,p){ye(this,"heap");ye(this,"length");if(!b(xt,bn))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new p(f),this.length=0}static create(f){let p=Ai(f);if(!p)return[];V(xt,bn,!0);let h=new xt(f,p);return V(xt,bn,!1),h}push(f){this.heap[this.length++]=f}pop(){return this.heap[--this.length]}},bn=new WeakMap,K(xt,bn,!1),xt),wi,Ei,et,je,lt,Jt,ut,vn,xn,ct,xe,ft,be,ce,q,Pe,We,Ae,ke,pt,Te,ht,dt,qe,$e,gt,Sn,Ne,en,L,ur,tn,Ot,Bn,Xe,Di,nn,kn,_n,Nt,Bt,cr,yn,ks,Fi,Ui,Ts,ue,fr,Mi,Pi,Pn,pr,Nn,_t,hr,Tn,Ri=(Tn=class{constructor(f){K(this,L);K(this,et);K(this,je);K(this,lt);K(this,Jt);K(this,ut);K(this,vn);K(this,xn);K(this,ct);ye(this,"ttl");ye(this,"ttlResolution");ye(this,"ttlAutopurge");ye(this,"updateAgeOnGet");ye(this,"updateAgeOnHas");ye(this,"allowStale");ye(this,"noDisposeOnSet");ye(this,"noUpdateTTL");ye(this,"maxEntrySize");ye(this,"sizeCalculation");ye(this,"noDeleteOnFetchRejection");ye(this,"noDeleteOnStaleGet");ye(this,"allowStaleOnFetchAbort");ye(this,"allowStaleOnFetchRejection");ye(this,"ignoreFetchAbort");ye(this,"backgroundFetchSize");K(this,xe);K(this,ft);K(this,be);K(this,ce);K(this,q);K(this,Pe);K(this,We);K(this,Ae);K(this,ke);K(this,pt);K(this,Te);K(this,ht);K(this,dt);K(this,qe);K(this,$e);K(this,gt);K(this,Sn);K(this,Ne);K(this,en);K(this,tn,()=>{});K(this,Ot,()=>{});K(this,Bn,()=>{});K(this,Xe,()=>!1);K(this,nn,f=>{});K(this,kn,(f,p,h)=>{});K(this,_n,(f,p,h,y)=>{if(h||y)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});ye(this,wi,"LRUCache");let{max:p=0,ttl:h,ttlResolution:y=1,ttlAutopurge:k,updateAgeOnGet:T,updateAgeOnHas:O,allowStale:w,dispose:E,onInsert:j,disposeAfter:H,noDisposeOnSet:Q,noUpdateTTL:X,maxSize:fe=0,maxEntrySize:J=0,sizeCalculation:Se,fetchMethod:$,memoMethod:ee,noDeleteOnFetchRejection:ne,noDeleteOnStaleGet:se,allowStaleOnFetchRejection:pe,allowStaleOnFetchAbort:Vt,ignoreFetchAbort:St,backgroundFetchSize:It=1,perf:wt}=f;if(this.backgroundFetchSize=It,wt!==void 0&&typeof wt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(V(this,ct,wt??Yp),p!==0&&!Pt(p))throw new TypeError("max option must be a nonnegative integer");let Be=p?Ai(p):Array;if(!Be)throw new Error("invalid max value: "+p);if(V(this,et,p),V(this,je,fe),this.maxEntrySize=J||b(this,je),this.sizeCalculation=Se,this.sizeCalculation){if(!b(this,je)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(ee!==void 0&&typeof ee!="function")throw new TypeError("memoMethod must be a function if defined");if(V(this,xn,ee),$!==void 0&&typeof $!="function")throw new TypeError("fetchMethod must be a function if specified");if(V(this,vn,$),V(this,Sn,!!$),V(this,be,new Map),V(this,ce,Array.from({length:p}).fill(void 0)),V(this,q,Array.from({length:p}).fill(void 0)),V(this,Pe,new Be(p)),V(this,We,new Be(p)),V(this,Ae,0),V(this,ke,0),V(this,pt,Qp.create(p)),V(this,xe,0),V(this,ft,0),typeof E=="function"&&V(this,lt,E),typeof j=="function"&&V(this,Jt,j),typeof H=="function"?(V(this,ut,H),V(this,Te,[])):(V(this,ut,void 0),V(this,Te,void 0)),V(this,gt,!!b(this,lt)),V(this,en,!!b(this,Jt)),V(this,Ne,!!b(this,ut)),this.noDisposeOnSet=!!Q,this.noUpdateTTL=!!X,this.noDeleteOnFetchRejection=!!ne,this.allowStaleOnFetchRejection=!!pe,this.allowStaleOnFetchAbort=!!Vt,this.ignoreFetchAbort=!!St,this.maxEntrySize!==0){if(b(this,je)!==0&&!Pt(b(this,je)))throw new TypeError("maxSize must be a positive integer if specified");if(!Pt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");R(this,L,Di).call(this)}if(this.allowStale=!!w,this.noDeleteOnStaleGet=!!se,this.updateAgeOnGet=!!T,this.updateAgeOnHas=!!O,this.ttlResolution=Pt(y)||y===0?y:1,this.ttlAutopurge=!!k,this.ttl=h||0,this.ttl){if(!Pt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");R(this,L,ur).call(this)}if(b(this,et)===0&&this.ttl===0&&b(this,je)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!b(this,et)&&!b(this,je)){let zt="LRU_CACHE_UNBOUNDED";Kp(zt)&&(Li.add(zt),Zp("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",zt,Tn))}}get perf(){return b(this,ct)}static unsafeExposeInternals(f){return{starts:b(f,dt),ttls:b(f,qe),autopurgeTimers:b(f,$e),sizes:b(f,ht),keyMap:b(f,be),keyList:b(f,ce),valList:b(f,q),next:b(f,Pe),prev:b(f,We),get head(){return b(f,Ae)},get tail(){return b(f,ke)},free:b(f,pt),isBackgroundFetch:p=>{var h;return R(h=f,L,ue).call(h,p)},backgroundFetch:(p,h,y,k)=>{var T;return R(T=f,L,Ts).call(T,p,h,y,k)},moveToTail:p=>{var h;return R(h=f,L,Nn).call(h,p)},indexes:p=>{var h;return R(h=f,L,Nt).call(h,p)},rindexes:p=>{var h;return R(h=f,L,Bt).call(h,p)},isStale:p=>{var h;return b(h=f,Xe).call(h,p)}}}get max(){return b(this,et)}get maxSize(){return b(this,je)}get calculatedSize(){return b(this,ft)}get size(){return b(this,xe)}get fetchMethod(){return b(this,vn)}get memoMethod(){return b(this,xn)}get dispose(){return b(this,lt)}get onInsert(){return b(this,Jt)}get disposeAfter(){return b(this,ut)}getRemainingTTL(f){return b(this,be).has(f)?1/0:0}*entries(){for(let f of R(this,L,Nt).call(this))b(this,q)[f]!==void 0&&b(this,ce)[f]!==void 0&&!R(this,L,ue).call(this,b(this,q)[f])&&(yield[b(this,ce)[f],b(this,q)[f]])}*rentries(){for(let f of R(this,L,Bt).call(this))b(this,q)[f]!==void 0&&b(this,ce)[f]!==void 0&&!R(this,L,ue).call(this,b(this,q)[f])&&(yield[b(this,ce)[f],b(this,q)[f]])}*keys(){for(let f of R(this,L,Nt).call(this)){let p=b(this,ce)[f];p!==void 0&&!R(this,L,ue).call(this,b(this,q)[f])&&(yield p)}}*rkeys(){for(let f of R(this,L,Bt).call(this)){let p=b(this,ce)[f];p!==void 0&&!R(this,L,ue).call(this,b(this,q)[f])&&(yield p)}}*values(){for(let f of R(this,L,Nt).call(this))b(this,q)[f]!==void 0&&!R(this,L,ue).call(this,b(this,q)[f])&&(yield b(this,q)[f])}*rvalues(){for(let f of R(this,L,Bt).call(this))b(this,q)[f]!==void 0&&!R(this,L,ue).call(this,b(this,q)[f])&&(yield b(this,q)[f])}[(Ei=Symbol.iterator,wi=Symbol.toStringTag,Ei)](){return this.entries()}find(f,p={}){for(let h of R(this,L,Nt).call(this)){let y=b(this,q)[h],k=R(this,L,ue).call(this,y)?y.__staleWhileFetching:y;if(k!==void 0&&f(k,b(this,ce)[h],this))return R(this,L,Pn).call(this,b(this,ce)[h],p)}}forEach(f,p=this){for(let h of R(this,L,Nt).call(this)){let y=b(this,q)[h],k=R(this,L,ue).call(this,y)?y.__staleWhileFetching:y;k!==void 0&&f.call(p,k,b(this,ce)[h],this)}}rforEach(f,p=this){for(let h of R(this,L,Bt).call(this)){let y=b(this,q)[h],k=R(this,L,ue).call(this,y)?y.__staleWhileFetching:y;k!==void 0&&f.call(p,k,b(this,ce)[h],this)}}purgeStale(){let f=!1;for(let p of R(this,L,Bt).call(this,{allowStale:!0}))b(this,Xe).call(this,p)&&(R(this,L,_t).call(this,b(this,ce)[p],"expire"),f=!0);return f}info(f){let p=b(this,be).get(f);if(p===void 0)return;let h=b(this,q)[p],y=R(this,L,ue).call(this,h)?h.__staleWhileFetching:h;if(y===void 0)return;let k={value:y};if(b(this,qe)&&b(this,dt)){let T=b(this,qe)[p],O=b(this,dt)[p];if(T&&O){let w=T-(b(this,ct).now()-O);k.ttl=w,k.start=Date.now()}}return b(this,ht)&&(k.size=b(this,ht)[p]),k}dump(){let f=[];for(let p of R(this,L,Nt).call(this,{allowStale:!0})){let h=b(this,ce)[p],y=b(this,q)[p],k=R(this,L,ue).call(this,y)?y.__staleWhileFetching:y;if(k===void 0||h===void 0)continue;let T={value:k};if(b(this,qe)&&b(this,dt)){T.ttl=b(this,qe)[p];let O=b(this,ct).now()-b(this,dt)[p];T.start=Math.floor(Date.now()-O)}b(this,ht)&&(T.size=b(this,ht)[p]),f.unshift([h,T])}return f}load(f){this.clear();for(let[p,h]of f){if(h.start){let y=Date.now()-h.start;h.start=b(this,ct).now()-y}R(this,L,yn).call(this,p,h.value,h)}}set(f,p,h={}){let{status:y=Ce.hasSubscribers?{}:void 0}=h;h.status=y,y&&(y.op="set",y.key=f,p!==void 0&&(y.value=p),y.cache=this);let k=R(this,L,yn).call(this,f,p,h);return y&&Ce.hasSubscribers&&Ce.publish(y),k}pop(){var f;try{for(;b(this,xe);){let p=b(this,q)[b(this,Ae)];if(R(this,L,ks).call(this,!0),R(this,L,ue).call(this,p)){if(p.__staleWhileFetching)return p.__staleWhileFetching}else if(p!==void 0)return p}}finally{if(b(this,Ne)&&b(this,Te)){let p=b(this,Te),h;for(;h=p?.shift();)(f=b(this,ut))==null||f.call(this,...h)}}}has(f,p={}){let{status:h=Ce.hasSubscribers?{}:void 0}=p;p.status=h,h&&(h.op="has",h.key=f,h.cache=this);let y=R(this,L,Fi).call(this,f,p);return Ce.hasSubscribers&&Ce.publish(h),y}peek(f,p={}){let{status:h=lr()?{}:void 0}=p;h&&(h.op="peek",h.key=f,h.cache=this),p.status=h;let y=R(this,L,Ui).call(this,f,p);return Ce.hasSubscribers&&Ce.publish(h),y}fetch(f,p={}){let h=Mn.hasSubscribers,{status:y=lr()?{}:void 0}=p;p.status=y,y&&p.context&&(y.context=p.context);let k=R(this,L,fr).call(this,f,p);return y&&h&&(y.trace=!0,Mn.tracePromise(()=>k,y).catch(()=>{})),k}forceFetch(f,p={}){let h=Mn.hasSubscribers,{status:y=lr()?{}:void 0}=p;p.status=y,y&&p.context&&(y.context=p.context);let k=R(this,L,Mi).call(this,f,p);return y&&h&&(y.trace=!0,Mn.tracePromise(()=>k,y).catch(()=>{})),k}memo(f,p={}){let{status:h=Ce.hasSubscribers?{}:void 0}=p;p.status=h,h&&(h.op="memo",h.key=f,p.context&&(h.context=p.context),h.cache=this);let y=R(this,L,Pi).call(this,f,p);return h&&(h.value=y),Ce.hasSubscribers&&Ce.publish(h),y}get(f,p={}){let{status:h=Ce.hasSubscribers?{}:void 0}=p;p.status=h,h&&(h.op="get",h.key=f,h.cache=this);let y=R(this,L,Pn).call(this,f,p);return h&&(y!==void 0&&(h.value=y),Ce.hasSubscribers&&Ce.publish(h)),y}delete(f){return R(this,L,_t).call(this,f,"delete")}clear(){return R(this,L,hr).call(this,"delete")}},et=new WeakMap,je=new WeakMap,lt=new WeakMap,Jt=new WeakMap,ut=new WeakMap,vn=new WeakMap,xn=new WeakMap,ct=new WeakMap,xe=new WeakMap,ft=new WeakMap,be=new WeakMap,ce=new WeakMap,q=new WeakMap,Pe=new WeakMap,We=new WeakMap,Ae=new WeakMap,ke=new WeakMap,pt=new WeakMap,Te=new WeakMap,ht=new WeakMap,dt=new WeakMap,qe=new WeakMap,$e=new WeakMap,gt=new WeakMap,Sn=new WeakMap,Ne=new WeakMap,en=new WeakMap,L=new WeakSet,ur=function(){let f=new Ss(b(this,et)),p=new Ss(b(this,et));V(this,qe,f),V(this,dt,p);let h=this.ttlAutopurge?Array.from({length:b(this,et)}):void 0;V(this,$e,h),V(this,Bn,(O,w,E=b(this,ct).now())=>{p[O]=w!==0?E:0,f[O]=w,y(O,w)}),V(this,tn,O=>{p[O]=f[O]!==0?b(this,ct).now():0,y(O,f[O])});let y=this.ttlAutopurge?(O,w)=>{if(h?.[O]&&(clearTimeout(h[O]),h[O]=void 0),w&&w!==0&&h){let E=setTimeout(()=>{b(this,Xe).call(this,O)&&R(this,L,_t).call(this,b(this,ce)[O],"expire")},w+1);E.unref&&E.unref(),h[O]=E}}:()=>{};V(this,Ot,(O,w)=>{if(f[w]){let E=f[w],j=p[w];if(!E||!j)return;O.ttl=E,O.start=j,O.now=k||T();let H=O.now-j;O.remainingTTL=E-H}});let k=0,T=()=>{let O=b(this,ct).now();if(this.ttlResolution>0){k=O;let w=setTimeout(()=>k=0,this.ttlResolution);w.unref&&w.unref()}return O};this.getRemainingTTL=O=>{let w=b(this,be).get(O);if(w===void 0)return 0;let E=f[w],j=p[w];if(!E||!j)return 1/0;let H=(k||T())-j;return E-H},V(this,Xe,O=>{let w=p[O],E=f[O];return!!E&&!!w&&(k||T())-w>E})},tn=new WeakMap,Ot=new WeakMap,Bn=new WeakMap,Xe=new WeakMap,Di=function(){let f=new Ss(b(this,et));V(this,ft,0),V(this,ht,f),V(this,nn,p=>{V(this,ft,b(this,ft)-f[p]),f[p]=0}),V(this,_n,(p,h,y,k)=>{if(!Pt(y)){if(R(this,L,ue).call(this,h))return this.backgroundFetchSize;if(k){if(typeof k!="function")throw new TypeError("sizeCalculation must be a function");if(y=k(h,p),!Pt(y))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return y}),V(this,kn,(p,h,y)=>{if(f[p]=h,b(this,je)){let k=b(this,je)-f[p];for(;b(this,ft)>k;)R(this,L,ks).call(this,!0)}V(this,ft,b(this,ft)+f[p]),y&&(y.entrySize=h,y.totalCalculatedSize=b(this,ft))})},nn=new WeakMap,kn=new WeakMap,_n=new WeakMap,Nt=function*({allowStale:f=this.allowStale}={}){if(b(this,xe))for(let p=b(this,ke);R(this,L,cr).call(this,p)&&((f||!b(this,Xe).call(this,p))&&(yield p),p!==b(this,Ae));)p=b(this,We)[p]},Bt=function*({allowStale:f=this.allowStale}={}){if(b(this,xe))for(let p=b(this,Ae);R(this,L,cr).call(this,p)&&((f||!b(this,Xe).call(this,p))&&(yield p),p!==b(this,ke));)p=b(this,Pe)[p]},cr=function(f){return f!==void 0&&b(this,be).get(b(this,ce)[f])===f},yn=function(f,p,h,y){var fe,J,Se,$;let{ttl:k=this.ttl,start:T,noDisposeOnSet:O=this.noDisposeOnSet,sizeCalculation:w=this.sizeCalculation,status:E}=h,j=R(this,L,ue).call(this,p);if(p===void 0)return E&&(E.set="deleted"),this.delete(f),this;let{noUpdateTTL:H=this.noUpdateTTL}=h;E&&!j&&(E.value=p);let Q=b(this,_n).call(this,f,p,h.size||0,w,E);if(this.maxEntrySize&&Q>this.maxEntrySize)return R(this,L,_t).call(this,f,"set"),E&&(E.set="miss",E.maxEntrySizeExceeded=!0),this;let X=b(this,xe)===0?void 0:b(this,be).get(f);if(X===void 0)X=b(this,xe)===0?b(this,ke):b(this,pt).length!==0?b(this,pt).pop():b(this,xe)===b(this,et)?R(this,L,ks).call(this,!1):b(this,xe),b(this,ce)[X]=f,b(this,q)[X]=p,b(this,be).set(f,X),b(this,Pe)[b(this,ke)]=X,b(this,We)[X]=b(this,ke),V(this,ke,X),vs(this,xe)._++,b(this,kn).call(this,X,Q,E),E&&(E.set="add"),H=!1,b(this,en)&&!j&&((fe=b(this,Jt))==null||fe.call(this,p,f,"add"));else{R(this,L,Nn).call(this,X);let ee=b(this,q)[X];if(p!==ee){if(!O)if(R(this,L,ue).call(this,ee)){ee!==y&&ee.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:ne}=ee;ne!==void 0&&ne!==p&&(b(this,gt)&&((J=b(this,lt))==null||J.call(this,ne,f,"set")),b(this,Ne)&&b(this,Te)?.push([ne,f,"set"]))}else b(this,gt)&&((Se=b(this,lt))==null||Se.call(this,ee,f,"set")),b(this,Ne)&&b(this,Te)?.push([ee,f,"set"]);if(b(this,nn).call(this,X),b(this,kn).call(this,X,Q,E),b(this,q)[X]=p,!j){let ne=ee&&R(this,L,ue).call(this,ee)?ee.__staleWhileFetching:ee,se=ne===void 0?"add":p!==ne?"replace":"update";E&&(E.set=se,ne!==void 0&&(E.oldValue=ne)),b(this,en)&&this.onInsert?.(p,f,se)}}else j||(E&&(E.set="update"),b(this,en)&&this.onInsert?.(p,f,"update"))}if(k!==0&&!b(this,qe)&&R(this,L,ur).call(this),b(this,qe)&&(H||b(this,Bn).call(this,X,k,T),E&&b(this,Ot).call(this,E,X)),!O&&b(this,Ne)&&b(this,Te)){let ee=b(this,Te),ne;for(;ne=ee?.shift();)($=b(this,ut))==null||$.call(this,...ne)}return this},ks=function(f){var O;let p=b(this,Ae),h=b(this,ce)[p],y=b(this,q)[p],k=R(this,L,ue).call(this,y);k&&y.__abortController.abort(new Error("evicted"));let T=k?y.__staleWhileFetching:y;return(b(this,gt)||b(this,Ne))&&T!==void 0&&(b(this,gt)&&((O=b(this,lt))==null||O.call(this,T,h,"evict")),b(this,Ne)&&b(this,Te)?.push([T,h,"evict"])),b(this,nn).call(this,p),b(this,$e)?.[p]&&(clearTimeout(b(this,$e)[p]),b(this,$e)[p]=void 0),f&&(b(this,ce)[p]=void 0,b(this,q)[p]=void 0,b(this,pt).push(p)),b(this,xe)===1?(V(this,Ae,V(this,ke,0)),b(this,pt).length=0):V(this,Ae,b(this,Pe)[p]),b(this,be).delete(h),vs(this,xe)._--,p},Fi=function(f,p={}){let{updateAgeOnHas:h=this.updateAgeOnHas,status:y}=p,k=b(this,be).get(f);if(k!==void 0){let T=b(this,q)[k];if(R(this,L,ue).call(this,T)&&T.__staleWhileFetching===void 0)return!1;if(b(this,Xe).call(this,k))y&&(y.has="stale",b(this,Ot).call(this,y,k));else return h&&b(this,tn).call(this,k),y&&(y.has="hit",b(this,Ot).call(this,y,k)),!0}else y&&(y.has="miss");return!1},Ui=function(f,p){let{status:h,allowStale:y=this.allowStale}=p,k=b(this,be).get(f);if(k===void 0||!y&&b(this,Xe).call(this,k)){h&&(h.peek=k===void 0?"miss":"stale");return}let T=b(this,q)[k],O=R(this,L,ue).call(this,T)?T.__staleWhileFetching:T;return h&&(O!==void 0?(h.peek="hit",h.value=O):h.peek="miss"),O},Ts=function(f,p,h,y){let k=p===void 0?void 0:b(this,q)[p];if(R(this,L,ue).call(this,k))return k;let T=new AbortController,{signal:O}=h;O?.addEventListener("abort",()=>T.abort(O.reason),{signal:T.signal});let w={signal:T.signal,options:h,context:y},E=(J,Se=!1)=>{let{aborted:$}=T.signal,ee=h.ignoreFetchAbort&&J!==void 0,ne=h.ignoreFetchAbort||!!(h.allowStaleOnFetchAbort&&J!==void 0);if(h.status&&($&&!Se?(h.status.fetchAborted=!0,h.status.fetchError=T.signal.reason,ee&&(h.status.fetchAbortIgnored=!0)):h.status.fetchResolved=!0),$&&!ee&&!Se)return H(T.signal.reason,ne);let se=X,pe=b(this,q)[p];return(pe===X||pe===void 0&&ee&&Se)&&(J===void 0?se.__staleWhileFetching!==void 0?b(this,q)[p]=se.__staleWhileFetching:R(this,L,_t).call(this,f,"fetch"):(h.status&&(h.status.fetchUpdated=!0),R(this,L,yn).call(this,f,J,w.options,se))),J},j=J=>(h.status&&(h.status.fetchRejected=!0,h.status.fetchError=J),H(J,!1)),H=(J,Se)=>{let{aborted:$}=T.signal,ee=$&&h.allowStaleOnFetchAbort,ne=ee||h.allowStaleOnFetchRejection,se=ne||h.noDeleteOnFetchRejection,pe=X;if(b(this,q)[p]===X&&(!se||!Se&&pe.__staleWhileFetching===void 0?R(this,L,_t).call(this,f,"fetch"):ee||(b(this,q)[p]=pe.__staleWhileFetching)),ne)return h.status&&pe.__staleWhileFetching!==void 0&&(h.status.returnedStale=!0),pe.__staleWhileFetching;if(pe.__returned===pe)throw J},Q=(J,Se)=>{var ee;let $=(ee=b(this,vn))==null?void 0:ee.call(this,f,k,w);T.signal.addEventListener("abort",()=>{(!h.ignoreFetchAbort||h.allowStaleOnFetchAbort)&&(J(void 0),h.allowStaleOnFetchAbort&&(J=ne=>E(ne,!0)))}),$&&$ instanceof Promise?$.then(ne=>J(ne===void 0?void 0:ne),Se):$!==void 0&&J($)};h.status&&(h.status.fetchDispatched=!0);let X=new Promise(Q).then(E,j),fe=Object.assign(X,{__abortController:T,__staleWhileFetching:k,__returned:void 0});return p===void 0?(R(this,L,yn).call(this,f,fe,{...w.options,status:void 0}),p=b(this,be).get(f)):b(this,q)[p]=fe,fe},ue=function(f){if(!b(this,Sn))return!1;let p=f;return!!p&&p instanceof Promise&&p.hasOwnProperty("__staleWhileFetching")&&p.__abortController instanceof AbortController},fr=async function(f,p={}){let{allowStale:h=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:k=this.noDeleteOnStaleGet,ttl:T=this.ttl,noDisposeOnSet:O=this.noDisposeOnSet,size:w=0,sizeCalculation:E=this.sizeCalculation,noUpdateTTL:j=this.noUpdateTTL,noDeleteOnFetchRejection:H=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Q=this.allowStaleOnFetchRejection,ignoreFetchAbort:X=this.ignoreFetchAbort,allowStaleOnFetchAbort:fe=this.allowStaleOnFetchAbort,context:J,forceRefresh:Se=!1,status:$,signal:ee}=p;if($&&($.op="fetch",$.key=f,Se&&($.forceRefresh=!0),$.cache=this),!b(this,Sn))return $&&($.fetch="get"),R(this,L,Pn).call(this,f,{allowStale:h,updateAgeOnGet:y,noDeleteOnStaleGet:k,status:$});let ne={allowStale:h,updateAgeOnGet:y,noDeleteOnStaleGet:k,ttl:T,noDisposeOnSet:O,size:w,sizeCalculation:E,noUpdateTTL:j,noDeleteOnFetchRejection:H,allowStaleOnFetchRejection:Q,allowStaleOnFetchAbort:fe,ignoreFetchAbort:X,status:$,signal:ee},se=b(this,be).get(f);if(se===void 0){$&&($.fetch="miss");let pe=R(this,L,Ts).call(this,f,se,ne,J);return pe.__returned=pe}else{let pe=b(this,q)[se];if(R(this,L,ue).call(this,pe)){let wt=h&&pe.__staleWhileFetching!==void 0;return $&&($.fetch="inflight",wt&&($.returnedStale=!0)),wt?pe.__staleWhileFetching:pe.__returned=pe}let Vt=b(this,Xe).call(this,se);if(!Se&&!Vt)return $&&($.fetch="hit"),R(this,L,Nn).call(this,se),y&&b(this,tn).call(this,se),$&&b(this,Ot).call(this,$,se),pe;let St=R(this,L,Ts).call(this,f,se,ne,J),It=St.__staleWhileFetching!==void 0&&h;return $&&($.fetch=Vt?"stale":"refresh",It&&Vt&&($.returnedStale=!0)),It?St.__staleWhileFetching:St.__returned=St}},Mi=async function(f,p={}){let h=await R(this,L,fr).call(this,f,p);if(h===void 0)throw new Error("fetch() returned undefined");return h},Pi=function(f,p={}){let h=b(this,xn);if(!h)throw new Error("no memoMethod provided to constructor");let{context:y,status:k,forceRefresh:T,...O}=p;k&&T&&(k.forceRefresh=!0);let w=R(this,L,Pn).call(this,f,O),E=T||w===void 0;if(k&&(k.memo=E?"miss":"hit",E||(k.value=w)),!E)return w;let j=h(f,w,{options:O,context:y});return k&&(k.value=j),R(this,L,yn).call(this,f,j,O),j},Pn=function(f,p={}){let{allowStale:h=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:k=this.noDeleteOnStaleGet,status:T}=p,O=b(this,be).get(f);if(O===void 0){T&&(T.get="miss");return}let w=b(this,q)[O],E=R(this,L,ue).call(this,w);return T&&b(this,Ot).call(this,T,O),b(this,Xe).call(this,O)?E?(T&&(T.get="stale-fetching"),h&&w.__staleWhileFetching!==void 0?(T&&(T.returnedStale=!0),w.__staleWhileFetching):void 0):(k||R(this,L,_t).call(this,f,"expire"),T&&(T.get="stale"),h?(T&&(T.returnedStale=!0),w):void 0):(T&&(T.get=E?"fetching":"hit"),R(this,L,Nn).call(this,O),y&&b(this,tn).call(this,O),E?w.__staleWhileFetching:w)},pr=function(f,p){b(this,We)[p]=f,b(this,Pe)[f]=p},Nn=function(f){f!==b(this,ke)&&(f===b(this,Ae)?V(this,Ae,b(this,Pe)[f]):R(this,L,pr).call(this,b(this,We)[f],b(this,Pe)[f]),R(this,L,pr).call(this,b(this,ke),f),V(this,ke,f))},_t=function(f,p){var y,k;Ce.hasSubscribers&&Ce.publish({op:"delete",delete:p,key:f,cache:this});let h=!1;if(b(this,xe)!==0){let T=b(this,be).get(f);if(T!==void 0)if(b(this,$e)?.[T]&&(clearTimeout(b(this,$e)?.[T]),b(this,$e)[T]=void 0),h=!0,b(this,xe)===1)R(this,L,hr).call(this,p);else{b(this,nn).call(this,T);let O=b(this,q)[T];if(R(this,L,ue).call(this,O)?O.__abortController.abort(new Error("deleted")):(b(this,gt)||b(this,Ne))&&(b(this,gt)&&((y=b(this,lt))==null||y.call(this,O,f,p)),b(this,Ne)&&b(this,Te)?.push([O,f,p])),b(this,be).delete(f),b(this,ce)[T]=void 0,b(this,q)[T]=void 0,T===b(this,ke))V(this,ke,b(this,We)[T]);else if(T===b(this,Ae))V(this,Ae,b(this,Pe)[T]);else{let w=b(this,We)[T];b(this,Pe)[w]=b(this,Pe)[T];let E=b(this,Pe)[T];b(this,We)[E]=b(this,We)[T]}vs(this,xe)._--,b(this,pt).push(T)}}if(b(this,Ne)&&b(this,Te)?.length){let T=b(this,Te),O;for(;O=T?.shift();)(k=b(this,ut))==null||k.call(this,...O)}return h},hr=function(f){var p,h;for(let y of R(this,L,Bt).call(this,{allowStale:!0})){let k=b(this,q)[y];if(R(this,L,ue).call(this,k))k.__abortController.abort(new Error("deleted"));else{let T=b(this,ce)[y];b(this,gt)&&((p=b(this,lt))==null||p.call(this,k,T,f)),b(this,Ne)&&b(this,Te)?.push([k,T,f])}}if(b(this,be).clear(),b(this,q).fill(void 0),b(this,ce).fill(void 0),b(this,qe)&&b(this,dt)){b(this,qe).fill(0),b(this,dt).fill(0);for(let y of b(this,$e)??[])y!==void 0&&clearTimeout(y);b(this,$e)?.fill(void 0)}if(b(this,ht)&&b(this,ht).fill(0),V(this,Ae,0),V(this,ke,0),b(this,pt).length=0,V(this,ft,0),V(this,xe,0),b(this,Ne)&&b(this,Te)){let y=b(this,Te),k;for(;k=y?.shift();)(h=b(this,ut))==null||h.call(this,...k)}},Tn);function Gn(g){let f={individual:{},range:[]},p=new WeakMap;for(let h of g)gr(f,h,p);return f}function gr(g,f,p){for(let[h,y]of Object.entries(f.individual))if(g.individual[h])Cn(g.individual[h],y,p);else{let k=!1;for(let[T,{range:O,entry:w}]of g.range.entries()){let E=dr(Number(h),O);if(E.both!==null){k=!0,g.individual[h]=y,Cn(g.individual[h],Oe(w),p),g.range.splice(T,1);for(let j of E.second)Array.isArray(j)?g.range.push({range:j,entry:Oe(w)}):g.individual[j]=Oe(w)}}k||(g.individual[h]=y)}for(let{range:h,entry:y}of f.range){let k=[h];for(let T=0;T<g.range.length;T++){let{range:O,entry:w}=g.range[T];for(let[E,j]of k.entries())if(Array.isArray(j)){let H=Jp(j,O);if(H.both===null)continue;g.range.splice(T,1),T--;let Q=Oe(w);Array.isArray(H.both)?g.range.push({range:H.both,entry:Q}):g.individual[H.both]=Q,Cn(Q,Oe(y),p);for(let X of H.second)Array.isArray(X)?g.range.push({range:X,entry:Oe(w)}):g.individual[X]=Oe(w);k=H.first}else{let H=dr(j,O);if(H.both===null)continue;g.individual[j]=Oe(y),Cn(g.individual[j],Oe(w),p),g.range.splice(T,1),T--;for(let Q of H.second)Array.isArray(Q)?g.range.push({range:Q,entry:Oe(w)}):g.individual[Q]=Oe(w);k.splice(E,1,...H.first);break}}for(let T of Object.keys(g.individual))for(let[O,w]of k.entries())if(Array.isArray(w)){let E=dr(Number(T),w);if(E.both===null)continue;Cn(g.individual[T],Oe(y),p),k.splice(O,1,...E.second);break}else if(Number(T)===w){Cn(g.individual[T],Oe(y),p);break}for(let T of k)Array.isArray(T)?g.range.push({range:T,entry:Oe(y)}):g.individual[T]=Oe(y)}}function Cn(g,f,p){let h=p.get(g);h?.has(f)||(h||(h=new Set,p.set(g,h)),h.add(f),f.lookup&&(!g.lookup||g.lookup.index>f.lookup.index||g.lookup.index===f.lookup.index&&g.lookup.subIndex>f.lookup.subIndex)&&(g.lookup=f.lookup),f.forward&&(g.forward?gr(g.forward,f.forward,p):g.forward=f.forward),f.reverse&&(g.reverse?gr(g.reverse,f.reverse,p):g.reverse=f.reverse))}function Jp(g,f){let p={first:[],second:[],both:null};if(g[0]<f[1]&&f[0]<g[1]){let h=Math.max(g[0],f[0]),y=Math.min(g[1],f[1]);p.both=sn(h,y)}if(g[0]<f[0]){let h=g[0],y=Math.min(f[0],g[1]);p.first.push(sn(h,y))}else if(f[0]<g[0]){let h=f[0],y=Math.min(f[1],g[0]);p.second.push(sn(h,y))}if(g[1]>f[1]){let h=Math.max(g[0],f[1]),y=g[1];p.first.push(sn(h,y))}else if(f[1]>g[1]){let h=Math.max(g[1],f[0]),y=f[1];p.second.push(sn(h,y))}return p}function dr(g,f){if(g<f[0]||g>f[1])return{first:[g],second:[f],both:null};let p={first:[],second:[],both:g};return f[0]<g&&p.second.push(sn(f[0],g)),f[1]>g&&p.second.push(sn(g+1,f[1])),p}function sn(g,f){return f-g===1?g:[g,f]}function Oe(g,f=new Map){if(f.has(g))return f.get(g);let p={};return f.set(g,p),g.forward&&(p.forward=Ni(g.forward,f)),g.reverse&&(p.reverse=Ni(g.reverse,f)),g.lookup&&(p.lookup={contextRange:g.lookup.contextRange.slice(),index:g.lookup.index,length:g.lookup.length,subIndex:g.lookup.subIndex,substitutions:g.lookup.substitutions.slice()}),p}function Ni(g,f=new Map){let p={};for(let[h,y]of Object.entries(g.individual))p[h]=Oe(y,f);return{individual:p,range:g.range.map(({range:h,entry:y})=>({range:h.slice(),entry:Oe(y,f)}))}}function Hn(g,f,p,h){let y=f[h],k=g[y];if(!k)return;let T=k.lookup;if(k.reverse){let w=eh(k.reverse,f,p);(!T&&w||w&&T&&(T.index>w.index||T.index===w.index&&T.subIndex>w.subIndex))&&(T=w)}if(++h>=f.length||!k.forward)return T;let O=Hn(k.forward,f,p,h);return(!T&&O||O&&T&&(T.index>O.index||T.index===O.index&&T.subIndex>O.subIndex))&&(T=O),T}function eh(g,f,p){let h=g[f[--p]],y=h&&h.lookup;for(;h&&((!y&&h.lookup||h.lookup&&y&&y.index>h.lookup.index)&&(y=h.lookup),!(--p<0||!h.reverse));)h=h.reverse[f[p]];return y}function Cs(g,f,p){let h=!1;for(let y=0;y<g.length;y++){let k=g[y];if(h){if(p<=k[0])return g[y-1][1]=p,g;if(p<=k[1])return g[y-1][1]=Math.max(p,k[1]),g.splice(y,1),g;g.splice(y,1),y--}else{if(p<=k[0])return g.splice(y,0,[f,p]),g;if(p<=k[1])return k[0]=Math.min(f,k[0]),g;if(f<k[1])k[0]=Math.min(f,k[0]),h=!0;else continue}}return h?g[g.length-1][1]=p:g.push([f,p]),g}function mr(g,f){switch(g.format){case 1:let p=g.glyphs.indexOf(f);return p!==-1?p:null;case 2:let h=g.ranges.find(y=>y.start<=f&&y.end>=f);return h?h.index:null}}function Ye(g){switch(g.format){case 1:return g.glyphs.map((p,h)=>({glyphId:p,index:h}));case 2:let f=[];for(let[p,h]of g.ranges.entries())h.end===h.start?f.push({glyphId:h.start,index:p}):f.push({glyphId:[h.start,h.end+1],index:p});return f}}function Bi(g,f){let p=f[0],h=Os(g,p),y=f[0]+1,k=new Map;for(;y<f[1];)Os(g,y)!==h&&(y-p<=1?k.set(p,h):k.set([p,y],h)),y++;return y-p<=1?k.set(p,h):k.set([p,y],h),k}function Os(g,f){let p=mr(g.coverage,f);if(p===null)return null;switch(g.substFormat){case 1:return(f+g.deltaGlyphId)%2**16;case 2:return g.substitute[p]??null}}function On(g,f,p,h,y){let k=[];for(let T of p){T.entry.forward={individual:{},range:[]};for(let O of g)k.push(...rn(T.entry.forward,h,y,f,O).map(({entry:w,substitution:E})=>({entry:w,substitutions:[...T.substitutions,E]})))}return k}function Gt(g,f){let p=[],h=new Set;for(let y of f){if(h.has(y.entry))continue;h.add(y.entry),y.entry.forward??={individual:{},range:[]};let k={};for(let T of g)Array.isArray(T)?y.entry.forward.range.push({entry:k,range:T}):y.entry.forward.individual[T]=k;p.push({entry:k,substitutions:y.substitutions})}return p}function Ht(g,f){let p=[],h=new Set;for(let y of f){if(h.has(y.entry))continue;h.add(y.entry),y.entry.reverse??={individual:{},range:[]};let k={};for(let T of g)Array.isArray(T)?y.entry.reverse.range.push({entry:k,range:T}):y.entry.reverse.individual[T]=k;p.push({entry:k,substitutions:y.substitutions})}return p}function rn(g,f,p,h,y){let k=[];if(!Array.isArray(y))g.individual[y]={},k.push({entry:g.individual[y],substitution:nh(f,p,h,y)});else{let T=th(f,p,h,y);for(let[O,w]of T){let E={};Array.isArray(O)?g.range.push({range:O,entry:E}):g.individual[O]={},k.push({entry:E,substitution:w})}}return k}function th(g,f,p,h){for(let y of g.filter(k=>k.sequenceIndex===p))for(let k of f[y.lookupListIndex].subtables){let T=Bi(k,h);if(!Array.from(T.values()).every(O=>O!==null))return T}return new Map([[h,null]])}function nh(g,f,p,h){for(let y of g.filter(k=>k.sequenceIndex===p))for(let k of f[y.lookupListIndex].subtables){let T=Os(k,h);if(T!==null)return T}return null}function yr(g,f,p){let h={individual:{},range:[]},y=Ye(g.coverage);for(let{glyphId:k,index:T}of y){let O=g.chainRuleSets[T];if(O)for(let[w,E]of O.entries()){let j=rn(h,E.lookupRecords,f,0,k).map(({entry:H,substitution:Q})=>({entry:H,substitutions:[Q]}));for(let[H,Q]of E.input.entries())j=On([Q],H+1,j,E.lookupRecords,f);for(let H of E.lookahead)j=Gt([H],j);for(let H of E.backtrack)j=Ht([H],j);for(let{entry:H,substitutions:Q}of j)H.lookup={substitutions:Q,length:E.input.length+1,index:p,subIndex:w,contextRange:[-1*E.backtrack.length,1+E.input.length+E.lookahead.length]}}}return h}function vr(g,f){return g.format===2?Array.isArray(f)?sh(g,f):new Map([[f,br(g,f)]]):new Map([[f,null]])}function sh(g,f){let p=f[0],h=br(g,p),y=f[0]+1,k=new Map;for(;y<f[1];)br(g,y)!==h&&(y-p<=1?k.set(p,h):k.set([p,y],h)),y++;return y-p<=1?k.set(p,h):k.set([p,y],h),k}function br(g,f){for(let p of g.ranges)if(p.start<=f&&p.end>=f)return p.classId;return null}function Is(g,f){switch(g.format){case 2:let p=[];for(let h of g.ranges)h.classId===f&&(h.end===h.start?p.push(h.start):p.push([h.start,h.end+1]));return p;default:return[]}}function xr(g,f,p){let h=[],y=Ye(g.coverage);for(let{glyphId:k}of y){let T=vr(g.inputClassDef,k);for(let[O,w]of T.entries()){if(w===null)continue;let E=g.chainClassSet[w];if(E)for(let[j,H]of E.entries()){let Q={individual:{},range:[]},X=rn(Q,H.lookupRecords,f,0,O).map(({entry:fe,substitution:J})=>({entry:fe,substitutions:[J]}));for(let[fe,J]of H.input.entries())X=On(Is(g.inputClassDef,J),fe+1,X,H.lookupRecords,f);for(let fe of H.lookahead)X=Gt(Is(g.lookaheadClassDef,fe),X);for(let fe of H.backtrack)X=Ht(Is(g.backtrackClassDef,fe),X);for(let{entry:fe,substitutions:J}of X)fe.lookup={substitutions:J,index:p,subIndex:j,length:H.input.length+1,contextRange:[-1*H.backtrack.length,1+H.input.length+H.lookahead.length]};h.push(Q)}}}return Gn(h)}function Sr(g,f,p){let h={individual:{},range:[]},y=Ye(g.inputCoverage[0]);for(let{glyphId:k}of y){let T=rn(h,g.lookupRecords,f,0,k).map(({entry:O,substitution:w})=>({entry:O,substitutions:[w]}));for(let[O,w]of g.inputCoverage.slice(1).entries())T=On(Ye(w).map(E=>E.glyphId),O+1,T,g.lookupRecords,f);for(let O of g.lookaheadCoverage)T=Gt(Ye(O).map(w=>w.glyphId),T);for(let O of g.backtrackCoverage)T=Ht(Ye(O).map(w=>w.glyphId),T);for(let{entry:O,substitutions:w}of T)O.lookup={substitutions:w,index:p,subIndex:0,length:g.inputCoverage.length,contextRange:[-1*g.backtrackCoverage.length,g.inputCoverage.length+g.lookaheadCoverage.length]}}return h}function kr(g,f){let p={individual:{},range:[]},h=Ye(g.coverage);for(let{glyphId:y,index:k}of h){let T={};Array.isArray(y)?p.range.push({entry:T,range:y}):p.individual[y]=T;let O=[{entry:T,substitutions:[g.substitutes[k]]}];for(let w of g.lookaheadCoverage)O=Gt(Ye(w).map(E=>E.glyphId),O);for(let w of g.backtrackCoverage)O=Ht(Ye(w).map(E=>E.glyphId),O);for(let{entry:w,substitutions:E}of O)w.lookup={substitutions:E,index:f,subIndex:0,length:1,contextRange:[-1*g.backtrackCoverage.length,1+g.lookaheadCoverage.length]}}return p}function Vn(g,f=new Map){let p={};for(let[h,y]of Object.entries(g.individual))p[h]=_i(y,f);for(let{range:h,entry:y}of g.range){let k=_i(y,f);for(let T=h[0];T<h[1];T++)p[T]=k}return p}function _i(g,f){if(f.has(g))return f.get(g);let p={};return f.set(g,p),g.forward&&(p.forward=Vn(g.forward,f)),g.reverse&&(p.reverse=Vn(g.reverse,f)),g.lookup&&(p.lookup=g.lookup),p}var Tr=class{constructor(f,p){this._lookupTrees=[];this._glyphLookups={};this._font=f,p.cacheSize>0&&(this._cache=new Ri({maxSize:p.cacheSize,sizeCalculation:((O,w)=>w.length)}));let y=(this._font.tables.gsub&&this._font.tables.gsub.features.filter(O=>O.tag==="calt")||[]).reduce((O,w)=>[...O,...w.feature.lookupListIndexes],[]),k=this._font.tables.gsub&&this._font.tables.gsub.lookups||[],T=k.filter((O,w)=>y.some(E=>E===w));for(let[O,w]of T.entries()){let E=[];switch(w.lookupType){case 6:for(let[H,Q]of w.subtables.entries())switch(Q.substFormat){case 1:E.push(yr(Q,k,H));break;case 2:E.push(xr(Q,k,H));break;case 3:E.push(Sr(Q,k,H));break}break;case 8:for(let[H,Q]of w.subtables.entries())E.push(kr(Q,H));break}let j=Vn(Gn(E));this._lookupTrees.push({tree:j,processForward:w.lookupType!==8});for(let H of Object.keys(j))this._glyphLookups[H]||(this._glyphLookups[H]=[]),this._glyphLookups[H].push(O)}}findLigatures(f){let p=this._cache&&this._cache.get(f);if(p&&!Array.isArray(p))return p;let h=[];for(let T of f)h.push(this._font.charToGlyphIndex(T));if(this._lookupTrees.length===0)return{inputGlyphs:h,outputGlyphs:h,contextRanges:[]};let y=this._findInternal(h.slice()),k={inputGlyphs:h,outputGlyphs:y.sequence,contextRanges:y.ranges};return this._cache&&this._cache.set(f,k),k}findLigatureRanges(f){if(this._lookupTrees.length===0)return[];let p=this._cache&&this._cache.get(f);if(p)return Array.isArray(p)?p:p.contextRanges;let h=[];for(let k of f)h.push(this._font.charToGlyphIndex(k));let y=this._findInternal(h);return this._cache&&this._cache.set(f,y.ranges),y.ranges}_findInternal(f){let p=[],h=this._getNextLookup(f,0);for(;h.index!==null;){let y=this._lookupTrees[h.index];if(y.processForward){let k=h.last;for(let T=h.first;T<k;T++){let O=Hn(y.tree,f,T,T);if(O){for(let w=0;w<O.substitutions.length;w++){let E=O.substitutions[w];E!==null&&(f[T+w]=E)}Cs(p,O.contextRange[0]+T,O.contextRange[1]+T),T+O.length>=k&&(k=T+O.length+1),T+=O.length-1}}}else for(let k=h.last-1;k>=h.first;k--){let T=Hn(y.tree,f,k,k);if(T){for(let O=0;O<T.substitutions.length;O++){let w=T.substitutions[O];w!==null&&(f[k+O]=w)}Cs(p,T.contextRange[0]+k,T.contextRange[1]+k),k-=T.length-1}}h=this._getNextLookup(f,h.index+1)}return{sequence:f,ranges:p}}_getNextLookup(f,p){let h={index:null,first:1/0,last:-1};for(let y=0;y<f.length;y++){let k=this._glyphLookups[f[y]];if(k)for(let T=0;T<k.length;T++){let O=k[T];if(O>=p){(h.index===null||O<=h.index)&&(h.index=O,h.first>y&&(h.first=y),h.last=y+1);break}}}return h}};function Hi(g,f){let p=Gi.parse(g);return new Tr(p,{cacheSize:0,...f})}function Or(g){if(typeof g!="string")throw new Error("Font family must be a string");let f={input:g,offset:0},p=[],h="";for(;f.offset<f.input.length;){let y=f.input[f.offset++];switch(y){case"'":case'"':h+=rh(f,y);break;case",":p.push(h),h="";break;default:/\s/.test(y)||(f.offset--,h+=oh(f),p.push(h),h="")}}return p}function rh(g,f){let p="",h=!1;for(;g.offset<g.input.length;){let y=g.input[g.offset++];if(h)/[\dA-Fa-f]/.test(y)?(g.offset--,p+=Vi(g)):y!==`
19
+ `&&(p+=y),h=!1;else switch(y){case f:return p;case"\\":h=!0;break;default:p+=y}}throw new Error("Unterminated string")}function oh(g){let f="",p=!1;for(;g.offset<g.input.length;){let h=g.input[g.offset++];if(p)/[\dA-Fa-f]/.test(h)?(g.offset--,f+=Vi(g)):f+=h,p=!1;else switch(h){case"\\":p=!0;break;case",":return f;default:/\s/.test(h)?f.endsWith(" ")||(f+=" "):f+=h}}return f}function Vi(g){let f="";for(;g.offset<g.input.length;){let p=g.input[g.offset++];if(/\s/.test(p))return Cr(f);if(f.length>=6||!/[\dA-Fa-f]/.test(p))return g.offset--,Cr(f);f+=p}return Cr(f)}function Cr(g){return String.fromCodePoint(parseInt(g,16))}var zn;async function Ir(g,f){if(!zn){if(typeof navigator<"u"&&"fonts"in navigator){try{let y=await navigator.permissions.request?.({name:"local-fonts"});if(y&&y.state!=="granted")throw new Error("Permission to access local fonts not granted.")}catch(y){if(y instanceof Error&&y.name!=="TypeError")throw y}let h={};try{let y=await navigator.fonts.query();for(let k of y)h.hasOwnProperty(k.family)||(h[k.family]=[]),h[k.family].push(k);zn=Promise.resolve(h)}catch(y){y instanceof Error&&console.error(y.name,y.message)}}else if(typeof window<"u"&&"queryLocalFonts"in window){let h={};try{let y=await window.queryLocalFonts();for(let k of y)h.hasOwnProperty(k.family)||(h[k.family]=[]),h[k.family].push(k);zn=Promise.resolve(h)}catch(y){y instanceof Error&&console.error(y.name,y.message)}}zn??=Promise.resolve({})}let p=await zn;for(let h of Or(g)){if(ih.includes(h))return;if(p.hasOwnProperty(h)&&p[h].length>0){let y=p[h][0];if("blob"in y){let T=await(await y.blob()).arrayBuffer();return Hi(T,{cacheSize:f})}return}}}var ih=["serif","sans-serif","cursive","fantasy","monospace","system-ui","emoji","math","fangsong"];var ah=1e5;function zi(g,f=[]){let p,h,y=0,k;return g.registerCharacterJoiner(T=>{let O=g.options.fontFamily;if(O&&(y===0||p!==O)){h=void 0,y=1,p=O;let w=p;Ir(w,ah).then(E=>{w===g.options.fontFamily&&(y=2,h=E,E&&g.refresh(0,g.rows-1))}).catch(E=>{w===g.options.fontFamily&&(y=3,g.options.logLevel==="debug"&&console.debug(k,new Error("Failure while loading font")),h=void 0,k=E)})}return h&&y===2?h.findLigatureRanges(T).map(w=>[w[0],w[1]]):lh(T,f)})}function lh(g,f){let p=[];for(let h=0;h<g.length;h++)for(let y=0;y<f.length;y++)if(g.startsWith(f[y],h)){p.push([h,h+f[y].length]),h+=f[y].length-1;break}return p}var ji=class{constructor(f){this._fallbackLigatures=(f?.fallbackLigatures??["<--","<---","<<-","<-","->","->>","-->","--->","<==","<===","<<=","<=","=>","=>>","==>","===>",">=",">>=","<->","<-->","<--->","<---->","<=>","<==>","<===>","<====>","::",":::","<~~","</","</>","/>","~~>","==","!=","/=","~=","<>","===","!==","!===","<:",":=","*=","*+","<*","<*>","*>","<|","<|>","|>","+*","=*","=:",":>","/*","*/","+++","<!--","<!---"]).sort((p,h)=>h.length-p.length),this._fontFeatureSettings=f?.fontFeatureSettings}activate(f){if(!f.element)throw new Error("Cannot activate LigaturesAddon before open is called");this._terminal=f,this._characterJoinerId=zi(f,this._fallbackLigatures),f.element.style.fontFeatureSettings=this._fontFeatureSettings??'"calt" on'}dispose(){this._characterJoinerId!==void 0&&(this._terminal?.deregisterCharacterJoiner(this._characterJoinerId),this._characterJoinerId=void 0),this._terminal?.element&&(this._terminal.element.style.fontFeatureSettings="")}};export{ji as LigaturesAddon};
19
20
  //# sourceMappingURL=addon-ligatures.mjs.map