x_ite 12.1.3 → 12.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/assets/components/AnnotationComponent.js +2 -2
- package/dist/assets/components/AnnotationComponent.min.js +2 -2
- package/dist/assets/components/CADGeometryComponent.js +2 -2
- package/dist/assets/components/CADGeometryComponent.min.js +2 -2
- package/dist/assets/components/CubeMapTexturingComponent.js +2 -2
- package/dist/assets/components/CubeMapTexturingComponent.min.js +2 -2
- package/dist/assets/components/DISComponent.js +2 -2
- package/dist/assets/components/DISComponent.min.js +2 -2
- package/dist/assets/components/EventUtilitiesComponent.js +2 -2
- package/dist/assets/components/EventUtilitiesComponent.min.js +2 -2
- package/dist/assets/components/Geometry2DComponent.js +2 -2
- package/dist/assets/components/Geometry2DComponent.min.js +2 -2
- package/dist/assets/components/GeospatialComponent.js +2 -2
- package/dist/assets/components/GeospatialComponent.min.js +2 -2
- package/dist/assets/components/HAnimComponent.js +144 -80
- package/dist/assets/components/HAnimComponent.min.js +2 -2
- package/dist/assets/components/KeyDeviceSensorComponent.js +2 -2
- package/dist/assets/components/KeyDeviceSensorComponent.min.js +2 -2
- package/dist/assets/components/LayoutComponent.js +2 -2
- package/dist/assets/components/LayoutComponent.min.js +2 -2
- package/dist/assets/components/NURBSComponent.js +2 -2
- package/dist/assets/components/NURBSComponent.min.js +2 -2
- package/dist/assets/components/ParticleSystemsComponent.js +2 -10
- package/dist/assets/components/ParticleSystemsComponent.min.js +2 -2
- package/dist/assets/components/PickingComponent.js +2 -2
- package/dist/assets/components/PickingComponent.min.js +2 -2
- package/dist/assets/components/RigidBodyPhysicsComponent.js +2 -2
- package/dist/assets/components/RigidBodyPhysicsComponent.min.js +2 -2
- package/dist/assets/components/ScriptingComponent.js +5 -3
- package/dist/assets/components/ScriptingComponent.min.js +2 -2
- package/dist/assets/components/TextComponent.js +2 -2
- package/dist/assets/components/TextComponent.min.js +2 -2
- package/dist/assets/components/TextureProjectionComponent.js +6 -5
- package/dist/assets/components/TextureProjectionComponent.min.js +2 -2
- package/dist/assets/components/Texturing3DComponent.js +3571 -3571
- package/dist/assets/components/Texturing3DComponent.min.js +2 -2
- package/dist/assets/components/VolumeRenderingComponent.js +6 -2
- package/dist/assets/components/VolumeRenderingComponent.min.js +2 -2
- package/dist/assets/components/WebXRComponent.js +2 -2
- package/dist/assets/components/WebXRComponent.min.js +2 -2
- package/dist/assets/components/X_ITEComponent.js +6 -6
- package/dist/assets/components/X_ITEComponent.min.js +2 -2
- package/dist/example.html +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.d.ts +52 -8
- package/dist/x_ite.js +50444 -50363
- package/dist/x_ite.min.js +2 -2
- package/dist/x_ite.min.mjs +2 -2
- package/dist/x_ite.mjs +50194 -50113
- package/dist/x_ite.zip +0 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* X_ITE v12.1.
|
|
2
|
-
const e=window[Symbol.for("X_ITE.X3D-12.1.3")];(()=>{var t={254:t=>{t.exports=e.jquery}},n={};function s(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,s),o.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const r=e.Components;var o=s.n(r);const a=e.Fields;var i=s.n(a);const l=e.X3DFieldDefinition;var u=s.n(l);const c=e.FieldDefinitionArray;var p=s.n(c);const h=e.X3DNode;var f=s.n(h);const d=e.X3DUrlObject;var g=s.n(d);const m=e.Namespace;var y=s.n(m);let v=0;const b={BEGIN:++v,FIRST:++v,MIDDLE:++v,END:++v},S=y().add("TextAlignment",b),x=e.X3DConstants;var T=s.n(x);const O=e.URLs;var k=s.n(O),w=s(254);const I=new Map([["SERIF",new Map([["PLAIN",k().getFontsURL("Droid/DroidSerif-Regular.woff2")],["ITALIC",k().getFontsURL("Droid/DroidSerif-Italic.woff2")],["BOLD",k().getFontsURL("Droid/DroidSerif-Bold.woff2")],["BOLDITALIC",k().getFontsURL("Droid/DroidSerif-BoldItalic.woff2")]])],["SANS",new Map([["PLAIN",k().getFontsURL("Ubuntu/Ubuntu-R.woff2")],["ITALIC",k().getFontsURL("Ubuntu/Ubuntu-RI.woff2")],["BOLD",k().getFontsURL("Ubuntu/Ubuntu-B.woff2")],["BOLDITALIC",k().getFontsURL("Ubuntu/Ubuntu-BI.woff2")]])],["TYPEWRITER",new Map([["PLAIN",k().getFontsURL("Ubuntu/UbuntuMono-R.woff2")],["ITALIC",k().getFontsURL("Ubuntu/UbuntuMono-RI.woff2")],["BOLD",k().getFontsURL("Ubuntu/UbuntuMono-B.woff2")],["BOLDITALIC",k().getFontsURL("Ubuntu/UbuntuMono-BI.woff2")]])]]);function U(e){f().call(this,e),g().call(this,e),this.addType(T().X3DFontStyleNode),this.addChildObjects(T().inputOutput,"description",new(i().SFString),T().inputOutput,"url",new(i().MFString),T().inputOutput,"load",new(i().SFBool)(!0),T().inputOutput,"autoRefresh",new(i().SFTime)(0),T().inputOutput,"autoRefreshTimeLimit",new(i().SFTime)(3600)),this.alignments=[]}Object.assign(Object.setPrototypeOf(U.prototype,f().prototype),g().prototype,{initialize(){f().prototype.initialize.call(this),g().prototype.initialize.call(this),this._family.addInterest("set_url__",this),this._style.addInterest("set_url__",this),this._justify.addInterest("set_justify__",this),this.set_justify__(),this.requestImmediateLoad().catch(Function.prototype)},set_justify__(){const e=this._horizontal.getValue()?this._leftToRight.getValue():this._topToBottom.getValue();this.alignments[0]=this._justify.length>0?this.getAlignment(0,e):e?S.BEGIN:S.END;const t=this._horizontal.getValue()?this._topToBottom.getValue():this._leftToRight.getValue();this.alignments[1]=this._justify.length>1?this.getAlignment(1,t):t?S.FIRST:S.END},getAllowEmptyUrl:()=>!0,getFont(){return this.font},getDefaultFont(e,t){const n=I.get(e);return n?.get(t)??n?.get("PLAIN")},getMajorAlignment(){return this.alignments[0]},getMinorAlignment(){return this.alignments[1]},getAlignment(e,t){if(t)switch(this._justify[e]){case"FIRST":return S.FIRST;case"BEGIN":return S.BEGIN;case"MIDDLE":return S.MIDDLE;case"END":return S.END}else switch(this._justify[e]){case"FIRST":case"BEGIN":return S.END;case"MIDDLE":return S.MIDDLE;case"END":return S.BEGIN}return e?S.FIRST:S.BEGIN},async loadData(){await w.sleep(0);const e=this.getBrowser(),t=this.getExecutionContext(),n=this._family.copy(),s=this._style.getValue();n.push("SERIF"),this.font=null;for(const r of n){const n=this.getDefaultFont(r,s);if(n){const t=await e.loadFont(new URL(n),!0);if(t){this.font=t;break}}const o=await e.getFont(t,r,s);if(o){this.font=o;break}const a=new URL(r,t.getBaseURL());if("data:"===a.protocol||a.pathname.match(/\.(?:woff2|woff|otf|ttf)$/i)){t.getSpecificationVersion()>=4.1&&console.warn("Loading a font file via family field is depreciated, please use new FontLibrary node instead.");const n=await e.loadFont(a,this.getCache());if(n){this.font=n;break}}else console.warn(`Couldn't find font family '${r}' with style '${s}'.`)}this.setLoadState(this.font?T().COMPLETE_STATE:T().FAILED_STATE),this.addNodeEvent()},dispose(){g().prototype.dispose.call(this),f().prototype.dispose.call(this)}}),Object.defineProperties(U,f().getStaticProperties("X3DFontStyleNode","Text",1));const R=U,L=y().add("X3DFontStyleNode",R),C=e.PrimitiveQuality;var E=s.n(C);const D=e.TextCompression;var M=s.n(D);const F=e.Box2;var A=s.n(F);const N=e.Box3;var P=s.n(N);const B=e.Vector2;var G=s.n(B);const H=e.Vector3;var _=s.n(H);const V=e.Matrix3;var z=s.n(V);const j=new(A()),q=new(A()),W=new(G()),$=new(G()),X=new(G()),Y=new(G()),Z=new(_()),Q=new(_()),K=new(G()),J=new(G()),ee=new(G()),te=new(G()),ne=new(G()),se=new(G()),re=new(_()),oe=new(A()),ae=new(G()),ie=new(_());function le(e,t){this.browser=e.getBrowser(),this.text=e,this.fontStyle=t,this.glyphs=[],this.minorAlignment=new(G()),this.lineIndices=[],this.translations=[],this.charSpacings=[],this.scales=[],this.bearing=new(G()),this.bbox=new(P())}Object.assign(le.prototype,{getBrowser(){return this.browser},getText(){return this.text},getFontStyle(){return this.fontStyle},getGlyphs(){return this.glyphs},getMinorAlignment(){return this.minorAlignment},getTranslations(){return this.translations},getCharSpacings(){return this.charSpacings},getScales(){return this.scales},getBearing(){return this.bearing},getBBox(){return this.bbox},update(){const e=this.text,t=this.fontStyle,n=e._string.length;if(e._lineBounds.length=n,this.glyphs.length=0,0===n||!t.getFont())return e._origin.setValue(ie),e._textBounds.setValue(ae),void this.bbox.set();if(t._horizontal.getValue())this.resizeArray(this.translations,n),this.lineIndices.length=0,this.charSpacings.length=n,this.scales.length=n,this.horizontal(e,t);else{const s=e._string.reduce((e,t)=>e+t.length,0);this.resizeArray(this.translations,s),this.lineIndices.length=s,this.charSpacings.length=n,this.scales.length=n,this.vertical(e,t)}},resizeArray(e,t){for(let n=e.length;n<t;++n)e.push(new(G()));e.length=t},horizontal(e,t){const n=t.getFont(),s=e._string,r=s.length,o=Math.max(0,e._maxExtent.getValue()),a=t._topToBottom.getValue(),i=t.getScale(),l=t.getContentScale(),u=t._spacing.getValue(),c=this.getBrowser().getBrowserOptions().getTextCompression();j.set();const p=a?r:-1,h=a?1:-1;for(let o=a?0:r-1,f=0;o!==p;o+=h,++f){const r=s[o],a=this.getHorizontalLineExtents(t,r,W,$,f);K.assign($).subtract(W);const p=e.getLength(o)*l,h=K.x*i;let d=0;switch(se.set(h,0==f?$.y-n.descender/n.unitsPerEm*i:u),p&&(c===M().CHAR_SPACING&&a.length>1&&(d=(p-se.x)/(a.length-1)),se.x=p,K.x=p/i),this.charSpacings[f]=d,this.scales[f]=c===M().SCALING?se.x/h:1,e._lineBounds[o]=se,t.getMajorAlignment()){case S.BEGIN:case S.FIRST:this.translations[f].set(0,-f*u);break;case S.MIDDLE:this.translations[f].set(-W.x-K.x/2,-f*u);break;case S.END:this.translations[f].set(-W.x-K.x,-f*u)}this.translations[f].multiply(i),J.assign(W).add(ee.assign(K).divide(2)),j.add(oe.set(K.multiply(i),J.multiply(i).add(this.translations[f])))}if(o){const t=e._lineBounds.reduce((e,t)=>Math.max(e,t.x),0);if(t>o){const n=o*l/t;switch(c){case M().CHAR_SPACING:for(const t of this.charSpacings.keys())e._string[t].length<2||(this.charSpacings[t]-=(e._lineBounds[t].x-e._lineBounds[t].x*n)/(e._string[t].length-1));break;case M().SCALING:for(const e of this.scales.keys())this.scales[e]*=n}for(const e of this.translations.keys())this.translations[e].x*=n;for(const t of e._lineBounds.keys())e._lineBounds[t].x*=n;j.multRight(new(z())(n,0,0,0,1,0,0,0,0))}}switch(j.getExtents(W,$),K.assign($).subtract(W),e._textBounds=K,this.bearing.set(0,-$.y),t.getMinorAlignment()){case S.BEGIN:this.minorAlignment.assign(this.bearing);break;case S.FIRST:this.minorAlignment.set(0);break;case S.MIDDLE:this.minorAlignment.set(0,K.y/2-$.y);break;case S.END:this.minorAlignment.set(0,(r-1)*u*i)}W.add(this.minorAlignment),$.add(this.minorAlignment),e._origin.setValue(re.set(W.x,$.y,0)),this.bbox.setExtents(Z.set(W.x,W.y,0),Q.set($.x,$.y,0))},vertical(e,t){const n=t.getFont(),s=e._string,r=s.length,o=Math.max(0,e._maxExtent.getValue()),a=t._leftToRight.getValue(),i=t._topToBottom.getValue(),l=t.getScale(),u=t.getContentScale(),c=t._spacing.getValue(),p=this.getBrowser().getBrowserOptions().getPrimitiveQuality(),h=this.getBrowser().getBrowserOptions().getTextCompression();j.set();const f=a?r:-1,d=a?1:-1;let g=0;for(let o=a?0:r-1;o!==f;o+=d){const f=this.stringToGlyphs(n,s[o],!0,o),d=g,m=f.length;q.set();const y=i?m:-1,v=i?1:-1;for(let e=i?0:m-1;e!==y;e+=v,++g){const t=f[e];this.getGlyphExtents(n,t,p,W,$),K.assign($).subtract(W);const s=i?e:m-e-1;this.lineIndices[g]=o,this.translations[g].set((c-K.x-W.x)/2,-s),J.assign(W).add(ee.assign(K).divide(2)).add(this.translations[g]),q.add(oe.set(K,J))}q.getExtents(W,$),K.assign($).subtract(W);const b=a?o:r-o-1,x=(c-K.x)/2,T=e.getLength(o)*u;let O=0;se.set(0===o?c-x:c,m?K.y:0).multiply(l);const k=se.y;if(T){switch(h){case M().CHAR_SPACING:f.length>1&&(O=(T-se.y)/(f.length-1));break;case M().SCALING:t.getMajorAlignment()===S.MIDDLE&&($.y+=(T-se.y)/2)}se.y=T,K.y=T/l,W.y=$.y-K.y}switch(this.charSpacings[o]=O,this.scales[o]=h===M().SCALING?se.y/k:1,e._lineBounds[o]=se,t.getMajorAlignment()){case S.BEGIN:case S.FIRST:ne.assign(te.set(b*c,-$.y));break;case S.MIDDLE:ne.assign(te.set(b*c,K.y/2-$.y));break;case S.END:te.set(b*c,K.y/this.scales[o]-$.y),ne.set(b*c,K.y-$.y)}for(let e=d;e<g;++e)this.translations[e].add(te).multiply(l);J.assign(W).add(ee.assign(K).divide(2)),j.add(oe.set(K.multiply(l),J.add(ne).multiply(l)))}if(o){const n=e._lineBounds.reduce((e,t)=>Math.max(e,t.y),0);if(n>o){const s=o*u/n;switch(h){case M().CHAR_SPACING:for(const t of this.charSpacings.keys())e._string[t].length<2||(this.charSpacings[t]-=(e._lineBounds[t].y-e._lineBounds[t].y*s)/(e._string[t].length-1));switch(t.getMajorAlignment()){case S.MIDDLE:for(const t of this.translations.keys()){const n=this.lineIndices[t];this.translations[t].y-=(e._lineBounds[n].y-e._lineBounds[n].y*s)/2}break;case S.END:for(const t of this.translations.keys()){const n=this.lineIndices[t];this.translations[t].y-=e._lineBounds[n].y-e._lineBounds[n].y*s}}break;case M().SCALING:for(const e of this.scales.keys())this.scales[e]*=s}for(const t of e._lineBounds.keys())e._lineBounds[t].y*=s;j.multRight(new(z())(1,0,0,0,s,0,0,0,0))}}switch(j.getExtents(W,$),K.assign($).subtract(W),e._textBounds=K,t.getMajorAlignment()){case S.BEGIN:case S.FIRST:this.bearing.set(-W.x,$.y);break;case S.MIDDLE:this.bearing.set(-W.x,0);break;case S.END:this.bearing.set(-W.x,W.y)}switch(t.getMinorAlignment()){case S.BEGIN:case S.FIRST:this.minorAlignment.set(-W.x,0);break;case S.MIDDLE:this.minorAlignment.set(-W.x-K.x/2,0);break;case S.END:this.minorAlignment.set(-W.x-K.x,0)}W.add(this.minorAlignment),$.add(this.minorAlignment),e._origin.setValue(re.set(W.x,$.y,0)),this.bbox.setExtents(Z.set(W.x,W.y,0),Q.set($.x,$.y,0))},stringToGlyphs(e,t,n,s){const r=this.glyphs[s]??(this.glyphs[s]=[]);r.length=t.length;const o=n?0:t.length-1,a=n?t.length:-1,i=n?1:-1;for(let n=o,s=0;n!==a;n+=i,++s)r[s]=e.charToGlyph(t[n]);return r},getHorizontalLineExtents(e,t,n,s,r){const o=e.getFont(),a=e._horizontal.getValue()?e._leftToRight.getValue():e._topToBottom.getValue(),i=this.stringToGlyphs(o,t,a,r),l=i.length,u=this.getBrowser().getBrowserOptions().getPrimitiveQuality();let c=0,p=0,h=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY;for(let e=0;e<l;++e){const t=i[e],n=i[e+1],s=n?o.getKerningValue(t,n):0;this.getGlyphExtents(o,t,u,X,Y),p+=e<l-1?t.advanceWidth+s:Y.x*o.unitsPerEm,h=Math.min(h,X.y),f=Math.max(f,Y.y)}switch(i.length?(this.getGlyphExtents(o,i[0],u,X,Y),c=X.x):(h=0,f=0),n.set(c,h),s.set(p/o.unitsPerEm,f),e.getMajorAlignment()){case S.BEGIN:case S.FIRST:n.x=0}return i},traverse(e,t){}});const ue=le,ce=y().add("X3DTextGeometry",ue),pe=e.Matrix4;var he=s.n(pe);const fe=e.Bezier;var de=s.n(fe);const ge=e.libtess;var me=s.n(ge);const ye=Symbol();function ve(e,t){ce.call(this,e,t),e.setTransparent(!1)}Object.assign(Object.setPrototypeOf(ve.prototype,ce.prototype),{getMatrix:()=>he().IDENTITY,build:(()=>{const e=new(_()),t=new(_());return function(){const n=this.getFontStyle(),s=n.getFont();if(!s)return;const r=this.getText(),o=this.getGlyphs(),a=this.getMinorAlignment(),i=this.getTranslations(),l=this.getCharSpacings(),u=this.getScales(),c=n.getScale(),p=n._spacing.getValue(),h=r._origin.getValue(),f=c/s.unitsPerEm,d=this.getBrowser().getBrowserOptions().getPrimitiveQuality(),g=r.getTexCoords(),m=r.getNormals(),y=r.getVertices();if(r.getMultiTexCoords().push(g),this.getBBox().getExtents(e,t),r.getMin().assign(e),r.getMax().assign(t),n._horizontal.getValue())for(let e=0,t=o.length;e<t;++e){const t=o[e],n=i[e],r=l[e],v=u[e];let b=0;for(let e=0,o=t.length;e<o;++e){const o=t[e],i=this.getGlyphGeometry(s,o,d),l=a.x+n.x+b*v+e*r,u=a.y+n.y;for(const{x:e,y:t}of i){const n=e*c*v+l,s=t*c+u;g.push((n-h.x)/p,(s-h.y)/p,0,1),m.push(0,0,1),y.push(n,s,0,1)}let S=0;e+1<t.length&&(S=s.getKerningValue(o,t[e+1])),b+=(o.advanceWidth+S)*f}}else{const e=n._leftToRight.getValue(),t=n._topToBottom.getValue(),f=e?0:r._string.length-1,v=e?r._string.length:-1,b=e?1:-1;for(let e=f,n=0;e!==v;e+=b){const r=o[e],f=r.length,v=t?0:f-1,b=t?f:-1,S=t?1:-1,x=l[e],T=u[e];for(let e=v;e!==b;e+=S,++n){const o=i[n],l=this.getGlyphGeometry(s,r[e],d);for(const{x:n,y:s}of l){const r=t?e:f-e-1,i=n*c+a.x+o.x,l=s*c*T+a.y+o.y*T-r*x;g.push((i-h.x)/p,(l-h.y)/p,0,1),m.push(0,0,1),y.push(i,l,0,1)}}}}}})(),getGlyph(e,t,n){const s=e[ye]??=[],r=s[t]??=[];return r[n]??={}},getGlyphExtents(e,t,n,s,r){const o=this.getGlyph(e,n,t.index),a=o.extents;if(a)s.assign(a.min),r.assign(a.max);else{const a=this.getGlyphGeometry(e,t,n);a.length?(s.assign(a[0]).min(...a),r.assign(a[0]).max(...a)):(s.set(0),r.set(0));const i=o.extents={};i.min=s.copy(),i.max=r.copy()}},getGlyphGeometry(e,t,n){const s=this.getGlyph(e,n,t.index);return s.geometry??=this.createGlyphGeometry(t,n)},createGlyphGeometry(e,t){const n=this.getBezierSteps(t),s=e.getPath(0,0,1),r=[];let o=[],a=0,i=0;s.commands.push({type:"Z"});for(const{type:e,x1:t,y1:l,x2:u,y2:c,x:p,y:h}of s.commands){switch(e){case"M":case"Z":o.length>2&&r.push(o),o=[],"M"===e&&o.push(new(_())(p,-h,0));break;case"L":o.push(new(_())(p,-h,0));break;case"Q":de().quadric(a,-i,0,t,-l,0,p,-h,0,n,o);break;case"C":de().cubic(a,-i,0,t,-l,0,u,-c,0,p,-h,0,n,o);break;default:continue}a=p,i=h}return this.triangulatePolygon(r,[])},getBezierSteps(e){switch(e){case E().LOW:return 3;case E().HIGH:return 7;default:return 5}},triangulatePolygon:(()=>{const e=new(me().GluTesselator);return e.gluTessCallback(me().gluEnum.GLU_TESS_VERTEX_DATA,function(e,t){t.push(e)}),e.gluTessCallback(me().gluEnum.GLU_TESS_COMBINE,function(e,t,n){return new(_())(...e)}),e.gluTessProperty(me().gluEnum.GLU_TESS_WINDING_RULE,me().windingRule.GLU_TESS_WINDING_NONZERO),e.gluTessNormal(0,0,1),function(t,n){e.gluTessBeginPolygon(n);for(const n of t){e.gluTessBeginContour();for(const t of n)e.gluTessVertex(t,t);e.gluTessEndContour()}return e.gluTessEndPolygon(),n}})(),displaySimple(e,t){},display(e,t){},transformLine(e){},transformMatrix(e){}});const be=ve,Se=y().add("PolygonText",be);function xe(e){L.call(this,e),this.addType(T().FontStyle),this._size.setUnit("length")}Object.assign(Object.setPrototypeOf(xe.prototype,L.prototype),{getTextGeometry(e){return new Se(e,this)},getScale(){return this._size.getValue()},getContentScale:()=>1}),Object.defineProperties(xe,{...f().getStaticProperties("FontStyle","Text",1,"fontStyle","2.0"),fieldDefinitions:{value:new(p())([new(u())(T().inputOutput,"metadata",new(i().SFNode)),new(u())(T().inputOutput,"language",new(i().SFString)),new(u())(T().inputOutput,"family",new(i().MFString)("SERIF")),new(u())(T().inputOutput,"style",new(i().SFString)("PLAIN")),new(u())(T().inputOutput,"size",new(i().SFFloat)(1)),new(u())(T().inputOutput,"spacing",new(i().SFFloat)(1)),new(u())(T().inputOutput,"horizontal",new(i().SFBool)(!0)),new(u())(T().inputOutput,"leftToRight",new(i().SFBool)(!0)),new(u())(T().inputOutput,"topToBottom",new(i().SFBool)(!0)),new(u())(T().inputOutput,"justify",new(i().MFString)("BEGIN"))]),enumerable:!0}});const Te=xe,Oe=y().add("FontStyle",Te);function ke(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function we(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new ke,this.dtree=new ke}var Ie=new ke,Ue=new ke,Re=new Uint8Array(30),Le=new Uint16Array(30),Ce=new Uint8Array(30),Ee=new Uint16Array(30),De=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Me=new ke,Fe=new Uint8Array(320);function Ae(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]}var Ne=new Uint16Array(16);function Pe(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)Ne[r]=o,o+=e.table[r];for(r=0;r<s;++r)t[n+r]&&(e.trans[Ne[t[n+r]]++]=r)}function Be(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=1&e.tag;return e.tag>>>=1,t}function Ge(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 He(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+(1&o),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 _e(e,t,n){var s,r,o,a,i,l;for(s=Ge(e,5,257),r=Ge(e,5,1),o=Ge(e,4,4),a=0;a<19;++a)Fe[a]=0;for(a=0;a<o;++a){var u=Ge(e,3,0);Fe[De[a]]=u}for(Pe(Me,Fe,0,19),i=0;i<s+r;){var c=He(e,Me);switch(c){case 16:var p=Fe[i-1];for(l=Ge(e,2,3);l;--l)Fe[i++]=p;break;case 17:for(l=Ge(e,3,3);l;--l)Fe[i++]=0;break;case 18:for(l=Ge(e,7,11);l;--l)Fe[i++]=0;break;default:Fe[i++]=c}}Pe(t,Fe,0,s),Pe(n,Fe,s,r)}function Ve(e,t,n){for(;;){var s,r,o,a,i=He(e,t);if(256===i)return 0;if(i<256)e.dest[e.destLen++]=i;else for(s=Ge(e,Re[i-=257],Le[i]),r=He(e,n),a=o=e.destLen-Ge(e,Ce[r],Ee[r]);a<o+s;++a)e.dest[e.destLen++]=e.dest[a]}}function ze(e){for(var t,n;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if((t=256*(t=e.source[e.sourceIndex+1])+e.source[e.sourceIndex])!==(65535&~(256*e.source[e.sourceIndex+3]+e.source[e.sourceIndex+2])))return-3;for(e.sourceIndex+=4,n=t;n;--n)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,0}function je(e,t){var n,s,r=new we(e,t);do{switch(n=Be(r),Ge(r,2,0)){case 0:s=ze(r);break;case 1:s=Ve(r,Ie,Ue);break;case 2:_e(r,r.ltree,r.dtree),s=Ve(r,r.ltree,r.dtree);break;default:s=-3}if(0!==s)throw new Error("Data error")}while(!n);return r.destLen<r.dest.length?"function"==typeof r.dest.slice?r.dest.slice(0,r.destLen):r.dest.subarray(0,r.destLen):r.dest}function qe(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 We(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}!function(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}(Ie,Ue),Ae(Re,Le,4,3),Ae(Ce,Ee,2,1),Re[28]=0,Le[28]=258,We.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},We.prototype.addPoint=function(e,t){"number"==typeof e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},We.prototype.addX=function(e){this.addPoint(e,null)},We.prototype.addY=function(e){this.addPoint(null,e)},We.prototype.addBezier=function(e,t,n,s,r,o,a,i){const l=[e,t],u=[n,s],c=[r,o],p=[a,i];this.addPoint(e,t),this.addPoint(a,i);for(let e=0;e<=1;e++){const t=6*l[e]-12*u[e]+6*c[e],n=-3*l[e]+9*u[e]-9*c[e]+3*p[e],s=3*u[e]-3*l[e];if(0===n){if(0===t)continue;const n=-s/t;0<n&&n<1&&(0===e&&this.addX(qe(l[e],u[e],c[e],p[e],n)),1===e&&this.addY(qe(l[e],u[e],c[e],p[e],n)));continue}const r=Math.pow(t,2)-4*s*n;if(r<0)continue;const o=(-t+Math.sqrt(r))/(2*n);0<o&&o<1&&(0===e&&this.addX(qe(l[e],u[e],c[e],p[e],o)),1===e&&this.addY(qe(l[e],u[e],c[e],p[e],o)));const a=(-t-Math.sqrt(r))/(2*n);0<a&&a<1&&(0===e&&this.addX(qe(l[e],u[e],c[e],p[e],a)),1===e&&this.addY(qe(l[e],u[e],c[e],p[e],a)))}},We.prototype.addQuad=function(e,t,n,s,r,o){const a=e+2/3*(n-e),i=t+2/3*(s-t),l=a+1/3*(r-e),u=i+1/3*(o-t);this.addBezier(e,t,a,i,l,u,r,o)};var $e=We;function Xe(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}var Ye={};function Ze(e,t){const n=Math.floor(e),s=e-n;if(Ye[t]||(Ye[t]={}),void 0!==Ye[t][s]){return n+Ye[t][s]}const r=+(Math.round(s+"e+"+t)+"e-"+t);return Ye[t][s]=r,n+r}function Qe(e){let t=[[]],n=0,s=0;for(let r=0;r<e.length;r+=1){const o=t[t.length-1],a=e[r],i=o[0],l=o[1],u=o[o.length-1],c=e[r+1];o.push(a),"M"===a.type?(n=a.x,s=a.y):"L"!==a.type||c&&"Z"!==c.command?"L"===a.type&&u&&u.x===a.x&&u.y===a.y?o.pop():"Z"===a.type&&(i&&l&&u&&"M"===i.type&&"L"===l.type&&"L"===u.type&&u.x===i.x&&u.y===i.y&&(o.shift(),o[0].type="M"),r+1<e.length&&t.push([])):Math.abs(a.x-n)>1||Math.abs(a.y-s)>1||o.pop()}return e=[].concat.apply([],t)}Xe.prototype.fromSVG=function(e,t={}){"undefined"!=typeof SVGPathElement&&e instanceof SVGPathElement&&(e=e.getAttribute("d")),t=function(e){return Object.assign({},{decimalPlaces:2,optimize:!0,flipY:!0,flipYBase:void 0,scale:1,x:0,y:0},e)}(t),this.commands=[];const n="MmLlQqCcZzHhVv";let s={},r=[""],o=!1;function a(e){if(!this.commands.length)return e;const t=this.commands[this.commands.length-1];for(let n=0;n<e.length;n++)e[n]+=t[1&n?"y":"x"];return e}function i(){if(void 0===s.type)return;const e=s.type.toUpperCase(),n="Z"!==e&&s.type.toUpperCase()!==s.type;let o=r.filter(e=>e.length).map(e=>{let n=parseFloat(e);return(t.decimalPlaces||0===t.decimalPlaces)&&(n=Ze(n,t.decimalPlaces)),n});if(r=[""],!o.length&&"Z"!==e)return;n&&"H"!==e&&"V"!==e&&(o=a.apply(this,[o]));const i=this.commands.length&&this.commands[this.commands.length-1].x||0,l=this.commands.length&&this.commands[this.commands.length-1].y||0;switch(e){case"M":this.moveTo(...o);break;case"L":this.lineTo(...o);break;case"V":for(let e=0;e<o.length;e++){let t=0;n&&(t=this.commands.length&&this.commands[this.commands.length-1].y||0),this.lineTo(i,o[e]+t)}break;case"H":for(let e=0;e<o.length;e++){let t=0;n&&(t=this.commands.length&&this.commands[this.commands.length-1].x||0),this.lineTo(o[e]+t,l)}break;case"C":this.bezierCurveTo(...o);break;case"Q":this.quadraticCurveTo(...o);break;case"Z":(this.commands.length<1||"Z"!==this.commands[this.commands.length-1].type)&&this.close()}if(this.commands.length)for(const e in this.commands[this.commands.length-1])void 0===this.commands[this.commands.length-1][e]&&(this.commands[this.commands.length-1][e]=0)}for(let t=0;t<e.length;t++){const a=e.charAt(t),l=r[r.length-1];if("0123456789".indexOf(a)>-1)r[r.length-1]+=a;else if("-+".indexOf(a)>-1)if(s.type||this.commands.length||(s.type="L"),"-"===a)!s.type||l.indexOf("-")>0?o=!0:l.length?r.push("-"):r[r.length-1]=a;else{if(s.type&&!(l.length>0))continue;o=!0}else if(n.indexOf(a)>-1)s.type?(i.apply(this),s={type:a}):s.type=a;else{if("SsTtAa".indexOf(a)>-1)throw new Error("Unsupported path command: "+a+". Currently supported commands are "+n.split("").join(", ")+".");" ,\t\n\r\f\v".indexOf(a)>-1?r.push(""):"."===a?!s.type||l.indexOf(a)>-1?o=!0:r[r.length-1]+=a:o=!0}if(o)throw new Error("Unexpected character: "+a+" at offset "+t)}i.apply(this),t.optimize&&(this.commands=Qe(this.commands));const l=t.flipY;let u=t.flipYBase;if(!0===l&&void 0===t.flipYBase){const e=this.getBoundingBox();u=e.y1+e.y2}for(const e in this.commands){const n=this.commands[e];for(const s in n)["x","x1","x2"].includes(s)?this.commands[e][s]=t.x+n[s]*t.scale:["y","y1","y2"].includes(s)&&(this.commands[e][s]=t.y+(l?u-n[s]:n[s])*t.scale)}return this},Xe.fromSVG=function(e,t){return(new Xe).fromSVG(e,t)},Xe.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},Xe.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},Xe.prototype.curveTo=Xe.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})},Xe.prototype.quadTo=Xe.prototype.quadraticCurveTo=function(e,t,n,s){this.commands.push({type:"Q",x1:e,y1:t,x:n,y:s})},Xe.prototype.close=Xe.prototype.closePath=function(){this.commands.push({type:"Z"})},Xe.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof $e){const t=e;return this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close()}Array.prototype.push.apply(this.commands,e)},Xe.prototype.getBoundingBox=function(){const e=new $e;let t=0,n=0,s=0,r=0;for(let o=0;o<this.commands.length;o++){const a=this.commands[o];switch(a.type){case"M":e.addPoint(a.x,a.y),t=s=a.x,n=r=a.y;break;case"L":e.addPoint(a.x,a.y),s=a.x,r=a.y;break;case"Q":e.addQuad(s,r,a.x1,a.y1,a.x,a.y),s=a.x,r=a.y;break;case"C":e.addBezier(s,r,a.x1,a.y1,a.x2,a.y2,a.x,a.y),s=a.x,r=a.y;break;case"Z":s=t,r=n;break;default:throw new Error("Unexpected path command "+a.type)}}return e.isEmpty()&&e.addPoint(0,0),e},Xe.prototype.draw=function(e){const t=this._layers;if(t&&t.length){for(let n=0;n<t.length;n++)this.draw.call(t[n],e);return}const n=this._image;if(n)e.drawImage(n.image,n.x,n.y,n.width,n.height);else{e.beginPath();for(let t=0;t<this.commands.length;t+=1){const n=this.commands[t];"M"===n.type?e.moveTo(n.x,n.y):"L"===n.type?e.lineTo(n.x,n.y):"C"===n.type?e.bezierCurveTo(n.x1,n.y1,n.x2,n.y2,n.x,n.y):"Q"===n.type?e.quadraticCurveTo(n.x1,n.y1,n.x,n.y):"Z"===n.type&&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())}},Xe.prototype.toPathData=function(e){function t(t){const n=Ze(t,e.decimalPlaces);return Math.round(t)===n?""+n:n.toFixed(e.decimalPlaces)}function n(){let e="";for(let n=0;n<arguments.length;n+=1){const s=arguments[n];s>=0&&n>0&&(e+=" "),e+=t(s)}return e}e=function(e){return parseInt(e)===e&&(e={decimalPlaces:e,flipY:!1}),Object.assign({},{decimalPlaces:2,optimize:!0,flipY:!0,flipYBase:void 0},e)}(e);let s=this.commands;e.optimize&&(s=JSON.parse(JSON.stringify(this.commands)),s=Qe(s));const r=e.flipY;let o=e.flipYBase;if(!0===r&&void 0===o){const e=new Xe;e.extend(s);const t=e.getBoundingBox();o=t.y1+t.y2}let a="";for(let e=0;e<s.length;e+=1){const t=s[e];"M"===t.type?a+="M"+n(t.x,r?o-t.y:t.y):"L"===t.type?a+="L"+n(t.x,r?o-t.y:t.y):"C"===t.type?a+="C"+n(t.x1,r?o-t.y1:t.y1,t.x2,r?o-t.y2:t.y2,t.x,r?o-t.y:t.y):"Q"===t.type?a+="Q"+n(t.x1,r?o-t.y1:t.y1,t.x,r?o-t.y:t.y):"Z"===t.type&&(a+="Z")}return a},Xe.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+='"',void 0!==this.fill&&"black"!==this.fill&&(null===this.fill?n+=' fill="none"':n+=' fill="'+this.fill+'"'),this.stroke&&(n+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),n+="/>",n},Xe.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));const n=t,s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("d",n),void 0!==this.fill&&"black"!==this.fill&&(null===this.fill?s.setAttribute("fill","none"):s.setAttribute("fill",this.fill)),this.stroke&&(s.setAttribute("stroke",this.stroke),s.setAttribute("stroke-width",this.strokeWidth)),s};var Ke=Xe;function Je(e){throw new Error(e)}function et(e,t){e||Je(t)}var tt={fail:Je,argument:et,assert:et},nt=2147483648,st={},rt={},ot={};function at(e){return function(){return e}}rt.BYTE=function(e){return tt.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]},ot.BYTE=at(1),rt.CHAR=function(e){return[e.charCodeAt(0)]},ot.CHAR=at(1),rt.CHARARRAY=function(e){null==e&&(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."));const t=[];for(let n=0;n<e.length;n+=1)t[n]=e.charCodeAt(n);return t},ot.CHARARRAY=function(e){return void 0===e?0:e.length},rt.USHORT=function(e){return[e>>8&255,255&e]},ot.USHORT=at(2),rt.SHORT=function(e){return e>=32768&&(e=-(65536-e)),[e>>8&255,255&e]},ot.SHORT=at(2),rt.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},ot.UINT24=at(3),rt.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},ot.ULONG=at(4),rt.LONG=function(e){return e>=nt&&(e=-(2*nt-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},ot.LONG=at(4),rt.FLOAT=function(e){if(e>32767.00001525879||e<-32768)throw new Error(`Value ${e} is outside the range of representable values in 16.16 format`);const t=Math.round(65536*e)|0;return rt.ULONG(t)},ot.FLOAT=ot.ULONG,rt.FIXED=rt.ULONG,ot.FIXED=ot.ULONG,rt.FWORD=rt.SHORT,ot.FWORD=ot.SHORT,rt.UFWORD=rt.USHORT,ot.UFWORD=ot.USHORT,rt.F2DOT14=function(e){return rt.USHORT(16384*e)},ot.F2DOT14=ot.USHORT,rt.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},ot.LONGDATETIME=at(8),rt.TAG=function(e){return tt.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},ot.TAG=at(4),rt.Card8=rt.BYTE,ot.Card8=ot.BYTE,rt.Card16=rt.USHORT,ot.Card16=ot.USHORT,rt.OffSize=rt.BYTE,ot.OffSize=ot.BYTE,rt.SID=rt.USHORT,ot.SID=ot.USHORT,rt.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?rt.NUMBER16(e):rt.NUMBER32(e)},ot.NUMBER=function(e){return rt.NUMBER(e).length},rt.NUMBER16=function(e){return[28,e>>8&255,255&e]},ot.NUMBER16=at(3),rt.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},ot.NUMBER32=at(5),rt.REAL=function(e){let t=e.toString();const n=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(n){const s=parseFloat("1e"+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*s)/s).toString()}let s="";for(let e=0,n=t.length;e<n;e+=1){const n=t[e];s+="e"===n?"-"===t[++e]?"c":"b":"."===n?"a":"-"===n?"e":n}s+=1&s.length?"f":"ff";const r=[30];for(let e=0,t=s.length;e<t;e+=2)r.push(parseInt(s.substr(e,2),16));return r},ot.REAL=function(e){return rt.REAL(e).length},rt.NAME=rt.CHARARRAY,ot.NAME=ot.CHARARRAY,rt.STRING=rt.CHARARRAY,ot.STRING=ot.CHARARRAY,st.UTF8=function(e,t,n){const s=[],r=n;for(let n=0;n<r;n++,t+=1)s[n]=e.getUint8(t);return String.fromCharCode.apply(null,s)},st.UTF16=function(e,t,n){const s=[],r=n/2;for(let n=0;n<r;n++,t+=2)s[n]=e.getUint16(t);return String.fromCharCode.apply(null,s)},rt.UTF16=function(e){const t=[];for(let n=0;n<e.length;n+=1){const s=e.charCodeAt(n);t[t.length]=s>>8&255,t[t.length]=255&s}return t},ot.UTF16=function(e){return 2*e.length};var it={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};st.MACSTRING=function(e,t,n,s){const r=it[s];if(void 0===r)return;let o="";for(let s=0;s<n;s++){const n=e.getUint8(t+s);o+=n<=127?String.fromCharCode(n):r[127&n]}return o};var lt,ut="function"==typeof WeakMap&&new WeakMap;function ct(e){return e>=-128&&e<=127}function pt(e,t,n){let s=0;const r=e.length;for(;t<r&&s<64&&0===e[t];)++t,++s;return n.push(128|s-1),t}function ht(e,t,n){let s=0;const r=e.length;let o=t;for(;o<r&&s<64;){const t=e[o];if(!ct(t))break;if(0===t&&o+1<r&&0===e[o+1])break;++o,++s}n.push(s-1);for(let s=t;s<o;++s)n.push(e[s]+256&255);return o}function ft(e,t,n){let s=0;const r=e.length;let o=t;for(;o<r&&s<64;){const t=e[o];if(0===t)break;if(ct(t)&&o+1<r&&ct(e[o+1]))break;++o,++s}n.push(64|s-1);for(let s=t;s<o;++s){const t=e[s];n.push(t+65536>>8&255,t+256&255)}return o}rt.MACSTRING=function(e,t){const n=function(e){if(!lt){lt={};for(let e in it)lt[e]=new String(e)}const t=lt[e];if(void 0===t)return;if(ut){const e=ut.get(t);if(void 0!==e)return e}const n=it[e];if(void 0===n)return;const s={};for(let e=0;e<n.length;e++)s[n.charCodeAt(e)]=e+128;return ut&&ut.set(t,s),s}(t);if(void 0===n)return;const s=[];for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>=128&&(r=n[r],void 0===r))return;s[t]=r}return s},ot.MACSTRING=function(e,t){const n=rt.MACSTRING(e,t);return void 0!==n?n.length:0},rt.VARDELTAS=function(e){let t=0;const n=[];for(;t<e.length;){const s=e[t];t=0===s?pt(e,t,n):s>=-128&&s<=127?ht(e,t,n):ft(e,t,n)}return n},rt.INDEX=function(e){let t=1;const n=[t],s=[];for(let r=0;r<e.length;r+=1){const o=rt.OBJECT(e[r]);Array.prototype.push.apply(s,o),t+=o.length,n.push(t)}if(0===s.length)return[0,0];const r=[],o=1+Math.floor(Math.log(t)/Math.log(2))/8|0,a=[void 0,rt.BYTE,rt.USHORT,rt.UINT24,rt.ULONG][o];for(let e=0;e<n.length;e+=1){const t=a(n[e]);Array.prototype.push.apply(r,t)}return Array.prototype.concat(rt.Card16(e.length),rt.OffSize(o),r,s)},ot.INDEX=function(e){return rt.INDEX(e).length},rt.DICT=function(e){let t=[];const n=Object.keys(e),s=n.length;for(let r=0;r<s;r+=1){const s=parseInt(n[r],0),o=e[s],a=rt.OPERAND(o.value,o.type),i=rt.OPERATOR(s);for(let e=0;e<a.length;e++)t.push(a[e]);for(let e=0;e<i.length;e++)t.push(i[e])}return t},ot.DICT=function(e){return rt.DICT(e).length},rt.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},rt.OPERAND=function(e,t){let n=[];if(Array.isArray(t))for(let s=0;s<t.length;s+=1){tt.argument(e.length===t.length,"Not enough arguments given for type"+t);const r=rt.OPERAND(e[s],t[s]);for(let e=0;e<r.length;e++)n.push(r[e])}else if("SID"===t){const t=rt.NUMBER(e);for(let e=0;e<t.length;e++)n.push(t[e])}else if("offset"===t){const t=rt.NUMBER32(e);for(let e=0;e<t.length;e++)n.push(t[e])}else if("number"===t){const t=rt.NUMBER(e);for(let e=0;e<t.length;e++)n.push(t[e])}else{if("real"!==t)throw new Error("Unknown operand type "+t);{const t=rt.REAL(e);for(let e=0;e<t.length;e++)n.push(t[e])}}return n},rt.OP=rt.BYTE,ot.OP=ot.BYTE;var dt="function"==typeof WeakMap&&new WeakMap;function gt(e,t,n){if(t&&t.length)for(let e=0;e<t.length;e+=1){const n=t[e];this[n.name]=n.value}if(this.tableName=e,this.fields=t,n){const e=Object.keys(n);for(let t=0;t<e.length;t+=1){const s=e[t],r=n[s];void 0!==this[s]&&(this[s]=r)}}}function mt(e,t,n){void 0===n&&(n=t.length);const s=new Array(t.length+1);s[0]={name:e+"Count",type:"USHORT",value:n};for(let n=0;n<t.length;n++)s[n+1]={name:e+n,type:"USHORT",value:t[n]};return s}function yt(e,t,n){const 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 vt(e,t,n){const s=t.length;let r=[];r[0]={name:e+"Count",type:"USHORT",value:s};for(let e=0;e<s;e++)r=r.concat(n(t[e],e));return r}function bt(e){1===e.format?gt.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(mt("glyph",e.glyphs))):2===e.format?gt.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(vt("rangeRecord",e.ranges,function(e,t){return[{name:"startGlyphID"+t,type:"USHORT",value:e.start},{name:"endGlyphID"+t,type:"USHORT",value:e.end},{name:"startCoverageIndex"+t,type:"USHORT",value:e.index}]}))):tt.assert(!1,"Coverage format must be 1 or 2.")}function St(e){gt.call(this,"scriptListTable",vt("scriptRecord",e,function(e,t){const n=e.script;let s=n.defaultLangSys;return tt.assert(!!s,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new gt("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new gt("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:s.reqFeatureIndex}].concat(mt("featureIndex",s.featureIndexes)))}].concat(vt("langSys",n.langSysRecords,function(e,t){const n=e.langSys;return[{name:"langSysTag"+t,type:"TAG",value:e.tag},{name:"langSys"+t,type:"TABLE",value:new gt("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:n.reqFeatureIndex}].concat(mt("featureIndex",n.featureIndexes)))}]})))}]}))}function xt(e){gt.call(this,"featureListTable",vt("featureRecord",e,function(e,t){const n=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new gt("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat(mt("lookupListIndex",n.lookupListIndexes)))}]}))}function Tt(e,t){gt.call(this,"lookupListTable",yt("lookup",e,function(e){let n=t[e.lookupType];return tt.assert(!!n,"Unable to write GSUB lookup type "+e.lookupType+" tables."),new gt("lookupTable",[{name:"lookupType",type:"USHORT",value:e.lookupType},{name:"lookupFlag",type:"USHORT",value:e.lookupFlag}].concat(yt("subtable",e.subtables,n)))}))}function Ot(e){1===e.format?gt.call(this,"classDefTable",[{name:"classFormat",type:"USHORT",value:1},{name:"startGlyphID",type:"USHORT",value:e.startGlyph}].concat(mt("glyph",e.classes))):2===e.format?gt.call(this,"classDefTable",[{name:"classFormat",type:"USHORT",value:2}].concat(vt("rangeRecord",e.ranges,function(e,t){return[{name:"startGlyphID"+t,type:"USHORT",value:e.start},{name:"endGlyphID"+t,type:"USHORT",value:e.end},{name:"class"+t,type:"USHORT",value:e.classId}]}))):tt.assert(!1,"Class format must be 1 or 2.")}rt.CHARSTRING=function(e){if(dt){const t=dt.get(e);if(void 0!==t)return t}let t=[];const n=e.length;for(let s=0;s<n;s+=1){const n=e[s],r=rt[n.type](n.value);for(let e=0;e<r.length;e++)t.push(r[e])}return dt&&dt.set(e,t),t},ot.CHARSTRING=function(e){return rt.CHARSTRING(e).length},rt.OBJECT=function(e){const t=rt[e.type];return tt.argument(void 0!==t,"No encoding function for type "+e.type),t(e.value)},ot.OBJECT=function(e){const t=ot[e.type];return tt.argument(void 0!==t,"No sizeOf function for type "+e.type),t(e.value)},rt.TABLE=function(e){let t=[];const n=(e.fields||[]).length,s=[],r=[];for(let o=0;o<n;o+=1){const n=e.fields[o],a=rt[n.type];tt.argument(void 0!==a,"No encoding function for field type "+n.type+" ("+n.name+")");let i=e[n.name];void 0===i&&(i=n.value);const l=a(i);if("TABLE"===n.type)null!==i.fields&&(r.push(t.length),s.push(l)),t.push(0,0);else for(let e=0;e<l.length;e++)t.push(l[e])}for(let n=0;n<s.length;n+=1){const o=r[n],a=t.length;tt.argument(a<65536,"Table "+e.tableName+" too big."),t[o]=a>>8,t[o+1]=255&a;for(let e=0;e<s[n].length;e++)t.push(s[n][e])}return t},ot.TABLE=function(e){let t=0;const n=(e.fields||[]).length;for(let s=0;s<n;s+=1){const n=e.fields[s],r=ot[n.type];tt.argument(void 0!==r,"No sizeOf function for field type "+n.type+" ("+n.name+")");let o=e[n.name];void 0===o&&(o=n.value),t+=r(o),"TABLE"===n.type&&(t+=2)}return t},rt.RECORD=rt.TABLE,ot.RECORD=ot.TABLE,rt.LITERAL=function(e){return e},ot.LITERAL=function(e){return e.length},gt.prototype.encode=function(){return rt.TABLE(this)},gt.prototype.sizeOf=function(){return ot.TABLE(this)},bt.prototype=Object.create(gt.prototype),bt.prototype.constructor=bt,St.prototype=Object.create(gt.prototype),St.prototype.constructor=St,xt.prototype=Object.create(gt.prototype),xt.prototype.constructor=xt,Tt.prototype=Object.create(gt.prototype),Tt.prototype.constructor=Tt,Ot.prototype=Object.create(gt.prototype),Ot.prototype.constructor=Ot;var kt={Table:gt,Record:gt,Coverage:bt,ClassDef:Ot,ScriptList:St,FeatureList:xt,LookupList:Tt,ushortList:mt,tableList:yt,recordList:vt};function wt(e,t){return e.getUint8(t)}function It(e,t){return e.getUint16(t,!1)}function Ut(e,t){return(e.getUint16(t)<<8)+e.getUint8(t+2)}function Rt(e,t){return e.getUint32(t,!1)}function Lt(e,t){return e.getInt16(t,!1)+e.getUint16(t+2,!1)/65535}var Ct={byte:1,uShort:2,f2dot14:2,short:2,uInt24:3,uLong:4,fixed:4,longDateTime:8,tag:4},Et=32768,Dt=32767,Mt=32768,Ft=4095,At=32768,Nt=16384,Pt=8192,Bt=4095,Gt=128,Ht=127,_t=128,Vt=64,zt=63,jt=15,qt=48;function Wt(e,t){this.data=e,this.offset=t,this.relativeOffset=0}Wt.prototype.parseByte=function(){const e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},Wt.prototype.parseChar=function(){const e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},Wt.prototype.parseCard8=Wt.prototype.parseByte,Wt.prototype.parseUShort=function(){const e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},Wt.prototype.parseCard16=Wt.prototype.parseUShort,Wt.prototype.parseSID=Wt.prototype.parseUShort,Wt.prototype.parseOffset16=Wt.prototype.parseUShort,Wt.prototype.parseShort=function(){const e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},Wt.prototype.parseF2Dot14=function(){const e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},Wt.prototype.parseUInt24=function(){const e=Ut(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=3,e},Wt.prototype.parseULong=function(){const e=Rt(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},Wt.prototype.parseLong=function(){const e=(t=this.data,n=this.offset+this.relativeOffset,t.getInt32(n,!1));var t,n;return this.relativeOffset+=4,e},Wt.prototype.parseOffset32=Wt.prototype.parseULong,Wt.prototype.parseFixed=function(){const e=Lt(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},Wt.prototype.parseString=function(e){const t=this.data,n=this.offset+this.relativeOffset;let s="";this.relativeOffset+=e;for(let r=0;r<e;r++)s+=String.fromCharCode(t.getUint8(n+r));return s},Wt.prototype.parseTag=function(){return this.parseString(4)},Wt.prototype.parseLongDateTime=function(){let e=Rt(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},Wt.prototype.parseVersion=function(e){const t=It(this.data,this.offset+this.relativeOffset),n=It(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,void 0===e&&(e=4096),t+n/e/10},Wt.prototype.skip=function(e,t){void 0===t&&(t=1),this.relativeOffset+=Ct[e]*t},Wt.prototype.parseULongList=function(e){void 0===e&&(e=this.parseULong());const t=new Array(e),n=this.data;let s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint32(s),s+=4;return this.relativeOffset+=4*e,t},Wt.prototype.parseOffset16List=Wt.prototype.parseUShortList=function(e){void 0===e&&(e=this.parseUShort());const t=new Array(e),n=this.data;let s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint16(s),s+=2;return this.relativeOffset+=2*e,t},Wt.prototype.parseShortList=function(e){const t=new Array(e),n=this.data;let s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getInt16(s),s+=2;return this.relativeOffset+=2*e,t},Wt.prototype.parseByteList=function(e){const t=new Array(e),n=this.data;let s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint8(s++);return this.relativeOffset+=e,t},Wt.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());const n=new Array(e);for(let s=0;s<e;s++)n[s]=t.call(this);return n},Wt.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());const n=new Array(e);for(let s=0;s<e;s++)n[s]=t.call(this);return n},Wt.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());const n=new Array(e),s=Object.keys(t);for(let r=0;r<e;r++){const e={};for(let n=0;n<s.length;n++){const r=s[n],o=t[r];e[r]=o.call(this)}n[r]=e}return n},Wt.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());const n=new Array(e),s=Object.keys(t);for(let r=0;r<e;r++){const e={};for(let n=0;n<s.length;n++){const r=s[n],o=t[r];e[r]=o.call(this)}n[r]=e}return n},Wt.prototype.parseTupleRecords=function(e,t){let n=[];for(let s=0;s<e;s++){let e=[];for(let n=0;n<t;n++)e.push(this.parseF2Dot14());n.push(e)}return n},Wt.prototype.parseStruct=function(e){if("function"==typeof e)return e.call(this);{const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const r=t[s],o=e[r];n[r]=o.call(this)}return n}},Wt.prototype.parseValueRecord=function(e){if(void 0===e&&(e=this.parseUShort()),0===e)return;const t={};return 1&e&&(t.xPlacement=this.parseShort()),2&e&&(t.yPlacement=this.parseShort()),4&e&&(t.xAdvance=this.parseShort()),8&e&&(t.yAdvance=this.parseShort()),16&e&&(t.xPlaDevice=void 0,this.parseShort()),32&e&&(t.yPlaDevice=void 0,this.parseShort()),64&e&&(t.xAdvDevice=void 0,this.parseShort()),128&e&&(t.yAdvDevice=void 0,this.parseShort()),t},Wt.prototype.parseValueRecordList=function(){const e=this.parseUShort(),t=this.parseUShort(),n=new Array(t);for(let s=0;s<t;s++)n[s]=this.parseValueRecord(e);return n},Wt.prototype.parsePointer=function(e){const t=this.parseOffset16();if(t>0)return new Wt(this.data,this.offset+t).parseStruct(e)},Wt.prototype.parsePointer32=function(e){const t=this.parseOffset32();if(t>0)return new Wt(this.data,this.offset+t).parseStruct(e)},Wt.prototype.parseListOfLists=function(e){const t=this.parseOffset16List(),n=t.length,s=this.relativeOffset,r=new Array(n);for(let s=0;s<n;s++){const n=t[s];if(0!==n)if(this.relativeOffset=n,e){const t=this.parseOffset16List(),o=new Array(t.length);for(let s=0;s<t.length;s++)this.relativeOffset=n+t[s],o[s]=e.call(this);r[s]=o}else r[s]=this.parseUShortList();else r[s]=void 0}return this.relativeOffset=s,r},Wt.prototype.parseCoverage=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort(),n=this.parseUShort();if(1===t)return{format:1,glyphs:this.parseUShortList(n)};if(2===t){const e=new Array(n);for(let t=0;t<n;t++)e[t]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:e}}throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.")},Wt.prototype.parseClassDef=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()}:2===t?{format:2,ranges:this.parseRecordList({start:Wt.uShort,end:Wt.uShort,classId:Wt.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})},Wt.list=function(e,t){return function(){return this.parseList(e,t)}},Wt.list32=function(e,t){return function(){return this.parseList32(e,t)}},Wt.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},Wt.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},Wt.pointer=function(e){return function(){return this.parsePointer(e)}},Wt.pointer32=function(e){return function(){return this.parsePointer32(e)}},Wt.tag=Wt.prototype.parseTag,Wt.byte=Wt.prototype.parseByte,Wt.uShort=Wt.offset16=Wt.prototype.parseUShort,Wt.uShortList=Wt.prototype.parseUShortList,Wt.uInt24=Wt.prototype.parseUInt24,Wt.uLong=Wt.offset32=Wt.prototype.parseULong,Wt.uLongList=Wt.prototype.parseULongList,Wt.fixed=Wt.prototype.parseFixed,Wt.f2Dot14=Wt.prototype.parseF2Dot14,Wt.struct=Wt.prototype.parseStruct,Wt.coverage=Wt.prototype.parseCoverage,Wt.classDef=Wt.prototype.parseClassDef;var $t={reserved:Wt.uShort,reqFeatureIndex:Wt.uShort,featureIndexes:Wt.uShortList};Wt.prototype.parseScriptList=function(){return this.parsePointer(Wt.recordList({tag:Wt.tag,script:Wt.pointer({defaultLangSys:Wt.pointer($t),langSysRecords:Wt.recordList({tag:Wt.tag,langSys:Wt.pointer($t)})})}))||[]},Wt.prototype.parseFeatureList=function(){return this.parsePointer(Wt.recordList({tag:Wt.tag,feature:Wt.pointer({featureParams:Wt.offset16,lookupListIndexes:Wt.uShortList})}))||[]},Wt.prototype.parseLookupList=function(e){return this.parsePointer(Wt.list(Wt.pointer(function(){const t=this.parseUShort();tt.argument(1<=t&&t<=9,"GPOS/GSUB lookup type "+t+" unknown.");const n=this.parseUShort(),s=16&n;return{lookupType:t,lookupFlag:n,subtables:this.parseList(Wt.pointer(e[t])),markFilteringSet:s?this.parseUShort():void 0}})))||[]},Wt.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){const e=this.parseUShort(),t=this.parseUShort();tt.argument(1===e&&t<1,"GPOS/GSUB feature variations table unknown.");return this.parseRecordList32({conditionSetOffset:Wt.offset32,featureTableSubstitutionOffset:Wt.offset32})})||[]},Wt.prototype.parseVariationStore=function(){const e=this.relativeOffset,t=this.parseUShort(),n={itemVariationStore:this.parseItemVariationStore()};return this.relativeOffset=e+t+2,n},Wt.prototype.parseItemVariationStore=function(){const 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 n=0;n<s;n++){const s=r[n];this.relativeOffset=e+s,t.itemVariationSubtables.push(this.parseItemVariationSubtable())}return t},Wt.prototype.parseVariationRegionList=function(){const e=this.parseUShort(),t=this.parseUShort();return this.parseRecordList(t,{regionAxes:Wt.recordList(e,{startCoord:Wt.f2Dot14,peakCoord:Wt.f2Dot14,endCoord:Wt.f2Dot14})})},Wt.prototype.parseItemVariationSubtable=function(){const e=this.parseUShort(),t=this.parseUShort(),n=this.parseUShortList(),s=n.length;return{regionIndexes:n,deltaSets:e&&s?this.parseDeltaSets(e,t,s):[]}},Wt.prototype.parseDeltaSetIndexMap=function(){const e=this.parseByte(),t=this.parseByte(),n=[];let 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};const r=1+(t&jt),o=1+((t&qt)>>4);for(let e=0;e<s;e++){let e;if(1===o)e=this.parseByte();else if(2===o)e=this.parseUShort();else if(3===o)e=this.parseUInt24();else{if(4!==o)throw new Error(`Invalid entry size of ${o}`);e=this.getULong()}const t=e>>r,s=e&(1<<r)-1;n.push({outerIndex:t,innerIndex:s})}return{format:e,entryFormat:t,map:n}},Wt.prototype.parseDeltaSets=function(e,t,n){const s=Array.from({length:e},()=>[]),r=t&Et,o=t&Dt;if(o>n)throw Error("wordCount must be less than or equal to regionIndexCount");const a=(r?this.parseLong:this.parseShort).bind(this),i=(r?this.parseShort:this.parseChar).bind(this);for(let t=0;t<e;t++)for(let e=0;e<n;e++)e<o?s[t].push(a()):s[t].push(i());return s},Wt.prototype.parseTupleVariationStoreList=function(e,t,n){const s=this.parseUShort(),r=1&this.parseUShort(),o=this.parseOffset32(),a=(r?this.parseULong:this.parseUShort).bind(this),i={};let l,u=a();r||(u*=2);for(let c=0;c<s;c++){l=a(),r||(l*=2);const s=l-u;i[c]=s?this.parseTupleVariationStore(o+u,e,t,n,c):void 0,u=l}return i},Wt.prototype.parseTupleVariationStore=function(e,t,n,s,r){const o=this.relativeOffset;this.relativeOffset=e,"cvar"===n&&(this.relativeOffset+=4);const a=this.parseUShort(),i=!!(a&Mt),l=a&Ft;let u=this.parseOffset16();const c=[];let p=[];for(let e=0;e<l;e++){const e=this.parseTupleVariationHeader(t,n);c.push(e)}this.relativeOffset!==e+u&&(console.warn(`Unexpected offset after parsing tuple variation headers! Expected ${e+u}, actually ${this.relativeOffset}`),this.relativeOffset=e+u),i&&(p=this.parsePackedPointNumbers());let h=this.relativeOffset;for(let e=0;e<l;e++){const t=c[e];t.privatePoints=[],this.relativeOffset=h,"cvar"!==n||t.peakTuple||console.warn("An embedded peak tuple is required in TupleVariationHeaders for the cvar table."),t.flags.privatePointNumbers&&(t.privatePoints=this.parsePackedPointNumbers()),delete t.flags;const o=this.offset,a=this.relativeOffset,i=e=>{let i,l;const u=()=>{let e=0;if("gvar"===n){if(e=t.privatePoints.length||p.length,!e){const t=s.get(r);t.path,e=t.points.length,e+=4}}else"cvar"===n&&(e=s.length);this.offset=o,this.relativeOffset=a,i=this.parsePackedDeltas(e),"gvar"===n&&(l=this.parsePackedDeltas(e))};return{configurable:!0,get:function(){return void 0===i&&u(),"deltasY"===e?l:i},set:function(t){void 0===i&&u(),"deltasY"===e?l=t:i=t}}};Object.defineProperty(t,"deltas",i.call(this,"deltas")),"gvar"===n&&Object.defineProperty(t,"deltasY",i.call(this,"deltasY")),h+=t.variationDataSize,delete t.variationDataSize}this.relativeOffset=o;const f={headers:c};return f.sharedPoints=p,f},Wt.prototype.parseTupleVariationHeader=function(e,t){const n=this.parseUShort(),s=this.parseUShort(),r=!!(s&At),o=!!(s&Nt),a=!!(s&Pt),i=r?void 0:s&Bt,l={variationDataSize:n,peakTuple:r?this.parseTupleRecords(1,e)[0]:void 0,intermediateStartTuple:o?this.parseTupleRecords(1,e)[0]:void 0,intermediateEndTuple:o?this.parseTupleRecords(1,e)[0]:void 0,flags:{embeddedPeakTuple:r,intermediateRegion:o,privatePointNumbers:a}};return"gvar"===t&&(l.sharedTupleRecordsIndex=i),l},Wt.prototype.parsePackedPointNumbers=function(){const e=this.parseByte(),t=[];let n=e;if(e>=128){const t=this.parseByte();n=(e&Ht)<<8|t}let s=0;for(;t.length<n;){const e=this.parseByte(),r=!!(e&Gt);let o=1+(e&Ht);for(let e=0;e<o&&t.length<n;e++){let e;e=r?this.parseUShort():this.parseByte(),s+=e,t.push(s)}}return t},Wt.prototype.parsePackedDeltas=function(e){const t=[];for(;t.length<e;){const n=this.parseByte(),s=!!(n&_t),r=!!(n&Vt),o=1+(n&zt);for(let n=0;n<o&&t.length<e;n++)s?t.push(0):r?t.push(this.parseShort()):t.push(this.parseChar())}return t};var Xt={getByte:wt,getCard8:wt,getUShort:It,getCard16:It,getShort:function(e,t){return e.getInt16(t,!1)},getUInt24:Ut,getULong:Rt,getFixed:Lt,getTag:function(e,t){let n="";for(let s=t;s<t+4;s+=1)n+=String.fromCharCode(e.getInt8(s));return n},getOffset:function(e,t,n){let s=0;for(let r=0;r<n;r+=1)s<<=8,s+=e.getUint8(t+r);return s},getBytes:function(e,t,n){const s=[];for(let r=t;r<n;r+=1)s.push(e.getUint8(r));return s},bytesToString:function(e){let t="";for(let n=0;n<e.length;n+=1)t+=String.fromCharCode(e[n]);return t},Parser:Wt},Yt=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],Zt={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"},Qt={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},Kt={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 Jt(e,t,n){switch(e){case 0:if(65535===t)return"und";if(n)return n[t];break;case 1:return Zt[t];case 3:return Kt[t]}}var en="utf-16",tn={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"},nn={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 sn(e,t,n){switch(e){case 0:return en;case 1:return nn[n]||tn[t];case 3:if(1===t||10===t)return en}}var rn={0:"unicode",1:"macintosh",2:"reserved",3:"windows"};function on(e){return rn[e]}function an(e){const t={};for(let n in e)t[e[n]]=parseInt(n);return t}function ln(e,t,n,s,r,o){return new kt.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 un(e,t){let n=function(e,t){const n=e.length,s=t.length-n+1;e:for(let r=0;r<s;r++)for(;r<s;r++){for(let s=0;s<n;s++)if(t[r+s]!==e[s])continue e;return r}return-1}(e,t);if(n<0){n=t.length;let s=0;const r=e.length;for(;s<r;++s)t.push(e[s])}return n}function cn(e,t,n=[]){if(t<256&&t in Yt){if(n.length&&!n.includes(parseInt(t)))return;t=Yt[t]}for(let n in e)for(let s in e[n])if(s===t||parseInt(s)===t)return e[n][s]}var pn={parse:function(e,t,n){const s={},r=new Xt.Parser(e,t),o=r.parseUShort(),a=r.parseUShort(),i=r.offset+r.parseUShort();for(let t=0;t<a;t++){const t=r.parseUShort(),o=r.parseUShort(),a=r.parseUShort(),l=r.parseUShort(),u=Yt[l]||l,c=r.parseUShort(),p=r.parseUShort(),h=Jt(t,a,n),f=sn(t,o,a),d=on(t);if(void 0!==f&&void 0!==h&&void 0!==d){let t;if(t=f===en?st.UTF16(e,i+p,c):st.MACSTRING(e,i+p,c,f),t){let e=s[d];void 0===e&&(e=s[d]={});let n=e[u];void 0===n&&(n=e[u]={}),n[h]=t}}}return 1===o&&r.parseUShort(),s},make:function(e,t){const n=an(rn),s=an(Zt),r=an(Kt),o=[],a=[];for(let i in e){let l;const u=[],c={},p=an(Yt),h=n[i];for(let t in e[i]){let n=p[t];if(void 0===n&&(n=t),l=parseInt(n),isNaN(l))throw new Error('Name table entry "'+t+'" does not exist, see nameTableNames for complete list.');c[l]=e[i][t],u.push(l)}for(let e=0;e<u.length;e++){l=u[e];const n=c[l];for(let e in n){const i=n[e];if(1===h||0===h){let n=s[e],r=Qt[n];const u=sn(h,r,n);let c=rt.MACSTRING(i,u);if(0===h&&(n=t.indexOf(e),n<0&&(n=t.length,t.push(e)),r=4,c=rt.UTF16(i)),void 0!==c){const e=un(c,a);o.push(ln(h,r,n,l,c.length,e))}}if(3===h){const t=r[e];if(void 0!==t){const e=rt.UTF16(i),n=un(e,a);o.push(ln(3,1,t,l,e.length,n))}}}}}o.sort(function(e,t){return e.platformID-t.platformID||e.encodingID-t.encodingID||e.languageID-t.languageID||e.nameID-t.nameID});const i=new kt.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:o.length},{name:"stringOffset",type:"USHORT",value:6+12*o.length}]);for(let e=0;e<o.length;e++)i.fields.push({name:"record_"+e,type:"RECORD",value:o[e]});return i.fields.push({name:"strings",type:"LITERAL",value:a}),i},getNameByID:cn};function hn(e,t,n){e.segments.push({end:t,start:t,delta:-(t-n),offset:0,glyphIndex:n})}var fn={parse:function(e,t){const n={};n.version=Xt.getUShort(e,t),tt.argument(0===n.version,"cmap table version should be 0."),n.numTables=Xt.getUShort(e,t+2);let s=null,r=-1,o=-1,a=null,i=null;const l=[0,1,2,3,4,6],u=[0,1,10];for(let c=n.numTables-1;c>=0;c-=1)if(a=Xt.getUShort(e,t+4+8*c),i=Xt.getUShort(e,t+4+8*c+2),3===a&&u.includes(i)||0===a&&l.includes(i)||1===a&&0===i){if(o>0)continue;if(o=Xt.getULong(e,t+4+8*c+4),s)break}else if(0===a&&5===i)if(r=Xt.getULong(e,t+4+8*c+4),s=new Xt.Parser(e,t+r),14!==s.parseUShort())r=-1,s=null;else if(o>0)break;if(-1===o)throw new Error("No valid cmap sub-tables found.");const c=new Xt.Parser(e,t+o);if(n.format=c.parseUShort(),0===n.format)!function(e,t,n,s){e.length=t.parseUShort(),e.language=t.parseUShort()-1;const r=t.parseByteList(e.length),o=Object.assign({},r),a=sn(n,s,e.language),i=it[a];for(let e=0;e<i.length;e++)o[i.charCodeAt(e)]=r[128+e];e.glyphIndexMap=o}(n,c,a,i);else if(12===n.format||13===n.format)!function(e,t,n){let s;t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong(),e.groupCount=s=t.parseULong(),e.glyphIndexMap={};for(let r=0;r<s;r+=1){const s=t.parseULong(),r=t.parseULong();let o=t.parseULong();for(let t=s;t<=r;t+=1)e.glyphIndexMap[t]=o,12===n&&o++}}(n,c,n.format);else{if(4!==n.format)throw new Error("Only format 0 (platformId 1, encodingId 0), 4, 12 and 14 cmap tables are supported (found format "+n.format+", platformId "+a+", encodingId "+i+").");!function(e,t,n,s,r){let o;e.length=t.parseUShort(),e.language=t.parseUShort(),e.segCount=o=t.parseUShort()>>1,t.skip("uShort",3),e.glyphIndexMap={};const a=new Xt.Parser(n,s+r+14),i=new Xt.Parser(n,s+r+16+2*o),l=new Xt.Parser(n,s+r+16+4*o),u=new Xt.Parser(n,s+r+16+6*o);let c=s+r+16+8*o;for(let t=0;t<o-1;t+=1){let t;const s=a.parseUShort(),r=i.parseUShort(),o=l.parseShort(),p=u.parseUShort();for(let a=r;a<=s;a+=1)0!==p?(c=u.offset+u.relativeOffset-2,c+=p,c+=2*(a-r),t=Xt.getUShort(n,c),0!==t&&(t=t+o&65535)):t=a+o&65535,e.glyphIndexMap[a]=t}}(n,c,e,t,o)}return s&&function(e,t){const n={};t.skip("uLong");const s=t.parseULong();for(let e=0;e<s;e+=1){const e=t.parseUInt24(),s={varSelector:e},r=t.parseOffset32(),o=t.parseOffset32(),a=t.relativeOffset;r&&(t.relativeOffset=r,s.defaultUVS=t.parseStruct({ranges:function(){return t.parseRecordList32({startUnicodeValue:t.parseUInt24,additionalCount:t.parseByte})}})),o&&(t.relativeOffset=o,s.nonDefaultUVS=t.parseStruct({uvsMappings:function(){const e={},n=t.parseRecordList32({unicodeValue:t.parseUInt24,glyphID:t.parseUShort});for(let t=0;t<n.length;t+=1)e[n[t].unicodeValue]=n[t];return e}})),n[e]=s,t.relativeOffset=a}e.varSelectorList=n}(n,s),n},make:function(e){let t,n=!0;for(t=e.length-1;t>0;t-=1){if(e.get(t).unicode>65535){console.log("Adding CMAP format 12 (needed!)"),n=!1;break}}let s=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:n?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:n?12:20}];n||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});const r=new kt.Table("cmap",s);for(r.segments=[],t=0;t<e.length;t+=1){const n=e.get(t);for(let e=0;e<n.unicodes.length;e+=1)hn(r,n.unicodes[e],t)}r.segments.sort(function(e,t){return e.start-t.start}),function(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}(r);const o=r.segments.length;let a=0,i=[],l=[],u=[],c=[],p=[],h=[];for(t=0;t<o;t+=1){const e=r.segments[t];e.end<=65535&&e.start<=65535?(i.push({name:"end_"+t,type:"USHORT",value:e.end}),l.push({name:"start_"+t,type:"USHORT",value:e.start}),u.push({name:"idDelta_"+t,type:"SHORT",value:e.delta}),c.push({name:"idRangeOffset_"+t,type:"USHORT",value:e.offset}),void 0!==e.glyphId&&p.push({name:"glyph_"+t,type:"USHORT",value:e.glyphId})):a+=1,n||void 0===e.glyphIndex||(h.push({name:"cmap12Start_"+t,type:"ULONG",value:e.start}),h.push({name:"cmap12End_"+t,type:"ULONG",value:e.end}),h.push({name:"cmap12Glyph_"+t,type:"ULONG",value:e.glyphIndex}))}r.segCountX2=2*(o-a),r.searchRange=2*Math.pow(2,Math.floor(Math.log(o-a)/Math.log(2))),r.entrySelector=Math.log(r.searchRange/2)/Math.log(2),r.rangeShift=r.segCountX2-r.searchRange;for(let e=0;e<i.length;e++)r.fields.push(i[e]);r.fields.push({name:"reservedPad",type:"USHORT",value:0});for(let e=0;e<l.length;e++)r.fields.push(l[e]);for(let e=0;e<u.length;e++)r.fields.push(u[e]);for(let e=0;e<c.length;e++)r.fields.push(c[e]);for(let e=0;e<p.length;e++)r.fields.push(p[e]);if(r.cmap4Length=14+2*i.length+2+2*l.length+2*u.length+2*c.length+2*p.length,!n){const e=16+4*h.length;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:e},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:h.length/3});for(let e=0;e<h.length;e++)r.fields.push(h[e])}return r}},dn=[".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"],gn=[".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"],mn=[".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"],yn=[".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"],vn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],bn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],Sn=[".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 xn(e){this.font=e}function Tn(e){this.cmap=e}function On(e,t){this.encoding=e,this.charset=t}function kn(e){switch(e.version){case 1:this.names=Sn.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(let t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<Sn.length?this.names[t]=Sn[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-Sn.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(let t=0;t<e.numberOfGlyphs;t++)this.names[t]=Sn[t+e.glyphNameIndex[t]];break;default:this.names=[]}}function wn(e,t){t.lowMemory?function(e){e._IndexToUnicodeMap={};const t=e.tables.cmap.glyphIndexMap,n=Object.keys(t);for(let s=0;s<n.length;s+=1){const r=n[s];let o=t[r];void 0===e._IndexToUnicodeMap[o]?e._IndexToUnicodeMap[o]={unicodes:[parseInt(r)]}:e._IndexToUnicodeMap[o].unicodes.push(parseInt(r))}}(e):function(e){let t;const n=e.tables.cmap.glyphIndexMap,s=Object.keys(n);for(let r=0;r<s.length;r+=1){const o=s[r],a=n[o];t=e.glyphs.get(a),t.addUnicode(parseInt(o))}for(let n=0;n<e.glyphs.length;n+=1)t=e.glyphs.get(n),e.cffEncoding?t.name=e.cffEncoding.charset[n]:e.glyphNames.names&&(t.name=e.glyphNames.glyphIndexToName(n))}(e)}xn.prototype.charToGlyphIndex=function(e){const t=e.codePointAt(0),n=this.font.glyphs;if(n)for(let e=0;e<n.length;e+=1){const s=n.get(e);for(let n=0;n<s.unicodes.length;n+=1)if(s.unicodes[n]===t)return e}return null},Tn.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0},On.prototype.charToGlyphIndex=function(e){const t=e.codePointAt(0),n=this.encoding[t];return this.charset.indexOf(n)},kn.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},kn.prototype.glyphIndexToName=function(e){return this.names[e]};var In={line:function(e,t,n,s,r){e.beginPath(),e.moveTo(t,n),e.lineTo(s,r),e.stroke()}};function Un(e){var t=(4278190080&e)>>24,n=(16711680&e)>>16,s=(65280&e)>>8,r=255&e;return{b:t=t+256&255,g:n=n+256&255,r:s=s+256&255,a:r=(r+256&255)/255}}function Rn(e,t,n=0,s="hexa"){if(65535==t)return"currentColor";const 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})`);const o=r.colorRecordIndices[n]+t;if(o>r.colorRecords)throw new Error(`Color index out of range (colorRecords.length: ${r.colorRecords.length}, lookupIndex: ${o})`);const a=Un(r.colorRecords[o]);return"bgra"===s?a:Dn(a,s)}function Ln(e){return("0"+parseInt(e).toString(16)).slice(-2)}function Cn(e){return parseInt(`0x${Ln(e.b)}${Ln(e.g)}${Ln(e.r)}${Ln(255*e.a)}`,16)}function En(e,t="hexa"){const n="raw"==t||"cpal"==t,s=Number.isInteger(e);let r=!0;if(s&&n||"currentColor"===e)return e;if("object"==typeof e){if("bgra"==t)return e;if(n)return Cn(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)).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}}if("bgra"==t)return e}else if("undefined"!=typeof document&&/^[a-z]+$/i.test(e)){const t=document.createElement("canvas").getContext("2d");t.fillStyle=e;const n=Dn(t.fillStyle,"hexa");"#000000ff"===n&&"black"!==e.toLowerCase()?r=!1:e=n}else{e=e.trim();const t=/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(t.test(e)){const n=e.match(t).filter(e=>void 0!==e);e={r:Math.round(parseFloat(n[1])/(n[2]?100/255:1)),g:Math.round(parseFloat(n[3])/(n[4]?100/255:1)),b:Math.round(parseFloat(n[5])/(n[6]?100/255:1)),a:n[7]?parseFloat(n[7])/(n[8]?100:1):1}}else{const t=/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(t.test(e)){const n=e.match(t).filter(e=>void 0!==e);e=function(e){let{h:t,s:n,l:s,a:r}=e;t%=360,n/=100,s/=100;const o=(1-Math.abs(2*s-1))*n,a=o*(1-Math.abs(t/60%2-1)),i=s-o/2;let l=0,u=0,c=0;return 0<=t&&t<60?(l=o,u=a,c=0):60<=t&&t<120?(l=a,u=o,c=0):120<=t&&t<180?(l=0,u=o,c=a):180<=t&&t<240?(l=0,u=a,c=o):240<=t&&t<300?(l=a,u=0,c=o):300<=t&&t<=360&&(l=o,u=0,c=a),{r:Math.round(255*(l+i)),g:Math.round(255*(u+i)),b:Math.round(255*(c+i)),a:r}}({h:parseFloat(n[1])*("turn"===n[2]?360:1),s:parseFloat(n[3]),l:parseFloat(n[4]),a:n[5]?parseFloat(n[5])/(n[6]?100:1):1})}else r=!1}}if(!r)throw new Error(`Invalid color format: ${e}`);return Dn(e,t)}function Dn(e,t="hexa"){if("currentColor"===e)return e;if(Number.isInteger(e)){if("raw"==t||"cpal"==t)return e;e=Un(e)}else"object"!=typeof e&&(e=En(e,"bgra"));let n=["hsl","hsla"].includes(t)?function(e){const t=e.r/255,n=e.g/255,s=e.b/255,r=Math.max(t,n,s),o=Math.min(t,n,s);let a,i,l=(r+o)/2;if(r===o)a=i=0;else{const e=r-o;switch(i=l>.5?e/(2-r-o):e/(r+o),r){case t:a=(n-s)/e+(n<s?6:0);break;case n:a=(s-t)/e+2;break;case s:a=(t-n)/e+4}a/=6}return{h:360*a,s:100*i,l:100*l}}(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`#${Ln(e.r)}${Ln(e.g)}${Ln(e.b)}`;case"hexa":case"hex8":case"hex-8":return`#${Ln(e.r)}${Ln(e.g)}${Ln(e.b)}${Ln(255*e.a)}`;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 Cn(e);default:throw new Error("Unknown color format: "+t)}}var Mn={parse:function(e,t){const n=new Wt(e,t),s=n.parseShort();0!==s&&console.warn("Only CPALv0 is currently fully supported.");const r=n.parseShort(),o=n.parseShort(),a=n.parseShort(),i=n.parseOffset32(),l=n.parseUShortList(o);n.relativeOffset=i;const u=n.parseULongList(a);return n.relativeOffset=i,{version:s,numPaletteEntries:r,colorRecords:u,colorRecordIndices:l}},make:function({version:e=0,numPaletteEntries:t=0,colorRecords:n=[],colorRecordIndices:s=[0]}){return tt.argument(0===e,"Only CPALv0 are supported."),tt.argument(n.length,"No colorRecords given."),tt.argument(s.length,"No colorRecordIndices given."),s.length>1&&tt.argument(t,"Can't infer numPaletteEntries on multiple colorRecordIndices"),new kt.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((e,t)=>({name:"colorRecordIndices_"+t,type:"USHORT",value:e})),...n.map((e,t)=>({name:"colorRecords_"+t,type:"ULONG",value:e}))])},getPaletteColor:Rn,parseColor:En,formatColor:Dn};function Fn(e){this.bindConstructorValues(e)}Fn.prototype.bindConstructorValues=function(e){if(this.index=e.index||0,".notdef"===e.name?e.unicode=void 0:".null"===e.name&&(e.unicode=0),0===e.unicode&&".null"!==e.name)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||(void 0!==e.unicode?[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",function(e,t){let n=t||new Ke;return{configurable:!0,get:function(){return"function"==typeof n&&(n=n()),n},set:function(e){n=e}}}(0,e.path))},Fn.prototype.addUnicode=function(e){0===this.unicodes.length&&(this.unicode=e),this.unicodes.push(e)},Fn.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},Fn.prototype.getPath=function(e,t,n,s,r){let o,a;e=void 0!==e?e:0,t=void 0!==t?t:0,n=void 0!==n?n:72;let i=(s=Object.assign({},r&&r.defaultRenderOptions,s)).xScale,l=s.yScale;const u=1/(this.path.unitsPerEm||1e3)*n;let c=this;r&&r.variation&&(c=r.variation.getTransform(this,s.variation),o=c.path.commands),s.hinting&&r&&r.hinting&&(a=c.path&&r.hinting.exec(c,n,s)),a?(o=r.hinting.getCommands(a),e=Math.round(e),t=Math.round(t),i=l=1):(o=c.path.commands,void 0===i&&(i=u),void 0===l&&(l=u));const p=new Ke;if(s.drawSVG){const n=this.getSvgImage(r);if(n){const s=new Ke;return s._image={image:n.image,x:e+n.leftSideBearing*u,y:t-n.baseline*u,width:n.image.width*u,height:n.image.height*u},p._layers=[s],p}}if(s.drawLayers){const o=this.getLayers(r);if(o&&o.length){p._layers=[];for(let a=0;a<o.length;a+=1){const i=o[a];let l=Rn(r,i.paletteIndex,s.usePalette);l="currentColor"===l?s.fill||"black":Dn(l,s.colorFormat||"rgba"),s=Object.assign({},s,{fill:l}),p._layers.push(this.getPath.call(i.glyph,e,t,n,s,r))}return p}}p.fill=s.fill||this.path.fill,p.stroke=this.path.stroke,p.strokeWidth=this.path.strokeWidth*u;for(let n=0;n<o.length;n+=1){const s=o[n];"M"===s.type?p.moveTo(e+s.x*i,t+-s.y*l):"L"===s.type?p.lineTo(e+s.x*i,t+-s.y*l):"Q"===s.type?p.quadraticCurveTo(e+s.x1*i,t+-s.y1*l,e+s.x*i,t+-s.y*l):"C"===s.type?p.curveTo(e+s.x1*i,t+-s.y1*l,e+s.x2*i,t+-s.y2*l,e+s.x*i,t+-s.y*l):"Z"===s.type&&p.stroke&&p.strokeWidth&&p.closePath()}return p},Fn.prototype.getLayers=function(e){if(!e)throw Error("The font object is required to read the colr/cpal tables in order to get the layers.");return e.layers.get(this.index)},Fn.prototype.getSvgImage=function(e){if(!e)throw Error("The font object is required to read the svg table in order to get the image.");return e.svgImages.get(this.index)},Fn.prototype.getContours=function(e=null){if(void 0===this.points&&!e)return[];const t=[];let n=[],s=e||this.points;for(let e=0;e<s.length;e+=1){const r=s[e];n.push(r),r.lastPointOfContour&&(t.push(n),n=[])}return tt.argument(0===n.length,"There are still points left in the current contour."),t},Fn.prototype.getMetrics=function(){const e=this.path.commands,t=[],n=[];for(let s=0;s<e.length;s+=1){const r=e[s];"Z"!==r.type&&(t.push(r.x),n.push(r.y)),"Q"!==r.type&&"C"!==r.type||(t.push(r.x1),n.push(r.y1)),"C"===r.type&&(t.push(r.x2),n.push(r.y2))}const 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},Fn.prototype.draw=function(e,t,n,s,r,o){r=Object.assign({},o.defaultRenderOptions,r);this.getPath(t,n,s,r,o).draw(e)},Fn.prototype.drawPoints=function(e,t,n,s,r,o){if((r=Object.assign({},o&&o.defaultRenderOptions,r)).drawLayers){const r=this.getLayers(o);if(r&&r.length){for(let o=0;o<r.length;o+=1)r[o].glyph.index!==this.index&&this.drawPoints.call(r[o].glyph,e,t,n,s);return}}function a(t,n,s,r){e.beginPath();for(let o=0;o<t.length;o+=1)e.moveTo(n+t[o].x*r,s+t[o].y*r),e.arc(n+t[o].x*r,s+t[o].y*r,2,0,2*Math.PI,!1);e.fill()}t=void 0!==t?t:0,n=void 0!==n?n:0,s=void 0!==s?s:24;const i=1/this.path.unitsPerEm*s,l=[],u=[];let c=this.path.commands;o&&o.variation&&(c=o.variation.getTransform(this,r.variation).path.commands);for(let e=0;e<c.length;e+=1){const t=c[e];void 0!==t.x&&l.push({x:t.x,y:-t.y}),void 0!==t.x1&&u.push({x:t.x1,y:-t.y1}),void 0!==t.x2&&u.push({x:t.x2,y:-t.y2})}e.fillStyle="blue",a(l,t,n,i),e.fillStyle="red",a(u,t,n,i)},Fn.prototype.drawMetrics=function(e,t,n,s){let r;t=void 0!==t?t:0,n=void 0!==n?n:0,s=void 0!==s?s:24,r=1/this.path.unitsPerEm*s,e.lineWidth=1,e.strokeStyle="black",In.line(e,t,-1e4,t,1e4),In.line(e,-1e4,n,1e4,n);const o=this.xMin||0;let a=this.yMin||0;const i=this.xMax||0;let l=this.yMax||0;const u=this.advanceWidth||0;e.strokeStyle="blue",In.line(e,t+o*r,-1e4,t+o*r,1e4),In.line(e,t+i*r,-1e4,t+i*r,1e4),In.line(e,-1e4,n+-a*r,1e4,n+-a*r),In.line(e,-1e4,n+-l*r,1e4,n+-l*r),e.strokeStyle="green",In.line(e,t+u*r,-1e4,t+u*r,1e4)},Fn.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.pathTramsform&&(s=e.pathTramsform(s)),s.toPathData(e)},Fn.prototype.fromSVG=function(e,t={}){return this.path.fromSVG(e,t)},Fn.prototype.toSVG=function(e,t){const n=this.toPathData.apply(this,[e,t]);return this.path.toSVG(e,n)},Fn.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 An=Fn;function Nn(e,t,n){Object.defineProperty(e,t,{get:function(){return void 0===e[n]&&e.path,e[n]},set:function(t){e[n]=t},enumerable:!0,configurable:!0})}function Pn(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(let n=0;n<t.length;n++){const s=t[n];s.path.unitsPerEm=e.unitsPerEm,this.glyphs[n]=s}this.length=t&&t.length||0}"undefined"!=typeof Symbol&&Symbol.iterator&&(Pn.prototype[Symbol.iterator]=function(){let e=-1;return{next:function(){e++;const t=e>=this.length-1;return{value:this.get(e),done:t}}.bind(this)}}),Pn.prototype.get=function(e){if(this.font._push&&void 0===this.glyphs[e]){this.font._push(e),"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]());let t=this.glyphs[e],n=this.font._IndexToUnicodeMap[e];if(n)for(let e=0;e<n.unicodes.length;e++)t.addUnicode(n.unicodes[e]);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"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]());return this.glyphs[e]},Pn.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};var Bn={GlyphSet:Pn,glyphLoader:function(e,t){return new An({index:t,font:e})},ttfGlyphLoader:function(e,t,n,s,r,o){return function(){const a=new An({index:t,font:e});return a.path=function(){n(a,s,r);const t=o(e.glyphs,a);return t.unitsPerEm=e.unitsPerEm,t},Nn(a,"numberOfContours","_numberOfContours"),Nn(a,"xMin","_xMin"),Nn(a,"xMax","_xMax"),Nn(a,"yMin","_yMin"),Nn(a,"yMax","_yMax"),Nn(a,"points","_points"),a}},cffGlyphLoader:function(e,t,n,s,r){return function(){const o=new An({index:t,font:e});return o.path=function(){const t=n(e,o,s,r);return t.unitsPerEm=e.unitsPerEm,t},o}}};function Gn(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(!Gn(e[n],t[n]))return!1;return!0}return!1}function Hn(e){let t;return t=e.length<1240?107:e.length<33900?1131:32768,t}function _n(e,t,n,s){const r=[],o=[],a=s>1?Xt.getULong(e,t):Xt.getCard16(e,t),i=s>1?4:2;let l,u;if(0!==a){const n=Xt.getByte(e,t+i);l=t+(a+1)*n+i;let s=t+i+1;for(let t=0;t<a+1;t+=1)r.push(Xt.getOffset(e,s,n)),s+=n;u=l+r[a]}else u=t+i;for(let a=0;a<r.length-1;a+=1){let i=Xt.getBytes(e,l+r[a],l+r[a+1]);n&&(i=n(i,e,t,s)),o.push(i)}return{objects:o,startOffset:t,endOffset:u}}function Vn(e,t){let n,s,r,o;if(28===t)return n=e.parseByte(),s=e.parseByte(),n<<8|s;if(29===t)return n=e.parseByte(),s=e.parseByte(),r=e.parseByte(),o=e.parseByte(),n<<24|s<<16|r<<8|o;if(30===t)return function(e){let t="";const n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const s=e.parseByte(),r=s>>4,o=15&s;if(15===r)break;if(t+=n[r],15===o)break;t+=n[o]}return parseFloat(t)}(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return n=e.parseByte(),256*(t-247)+n+108;if(t>=251&&t<=254)return n=e.parseByte(),256*-(t-251)-n-108;throw new Error("Invalid b0 "+t)}function zn(e,t,n,s){t=void 0!==t?t:0;const r=new Xt.Parser(e,t),o=[];let a=[];n=void 0!==n?n:e.byteLength;let i=s<2?22:28;for(;r.relativeOffset<n;){let e=r.parseByte();if(e<i){if(12===e&&(e=1200+r.parseByte()),s>1&&23===e){ts(a);continue}o.push([e,a]),a=[]}else a.push(Vn(r,e))}return function(e){const t={};for(let n=0;n<e.length;n+=1){const s=e[n][0],r=e[n][1];let o;if(o=1===r.length?r[0]:r,Object.prototype.hasOwnProperty.call(t,s)&&!isNaN(t[s]))throw new Error("Object "+t+" already has key "+s);t[s]=o}return t}(o)}function jn(e,t){return t=t<=390?dn[t]:e?e[t-391]:void 0}function qn(e,t,n){const s={};let r;for(let o=0;o<t.length;o+=1){const a=t[o];if(Array.isArray(a.type)){const t=[];t.length=a.type.length;for(let s=0;s<a.type.length;s++)r=void 0!==e[a.op]?e[a.op][s]:void 0,void 0===r&&(r=void 0!==a.value&&void 0!==a.value[s]?a.value[s]:null),"SID"===a.type[s]&&(r=jn(n,r)),t[s]=r;s[a.name]=t}else r=e[a.op],void 0===r&&(r=void 0!==a.value?a.value:null),"SID"===a.type&&(r=jn(n,r)),s[a.name]=r}return s}var Wn=[{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"}],$n=[{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"}],Xn=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}],Yn=[{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"}],Zn=[{name:"private",op:18,type:["number","offset"],value:[0,0]}];function Qn(e,t,n,s){return qn(zn(e,t,e.byteLength,s),s>1?$n:Wn,n)}function Kn(e,t,n,s,r){return qn(zn(e,t,n,r),r>1?Yn:Xn,s)}function Jn(e,t,n){return qn(zn(e,t,void 0,n),Zn)}function es(e,t,n,s,r){const o=[];for(let a=0;a<n.length;a+=1){const i=Qn(new DataView(new Uint8Array(n[a]).buffer),0,s,r);i._subrs=[],i._subrsBias=0,i._defaultWidthX=0,i._nominalWidthX=0;const l=r<2?i.private[0]:0,u=r<2?i.private[1]:0;if(0!==l&&0!==u){const n=Kn(e,u+t,l,s,r);if(i._defaultWidthX=n.defaultWidthX,i._nominalWidthX=n.nominalWidthX,0!==n.subrs){const s=_n(e,u+n.subrs+t,void 0,r);i._subrs=s.objects,i._subrsBias=Hn(i._subrs)}i._privateDict=n}o.push(i)}return o}function ts(e){let t=e.pop();for(;e.length>t;)e.pop()}function ns(e,t){const n=e.tables.cff&&e.tables.cff.topDict&&e.tables.cff.topDict.paintType||0;return 2===n&&(t.fill=null,t.stroke="black",t.strokeWidth=e.tables.cff.topDict.strokeWidth||0),n}function ss(e,t,n,s,r){let o,a,i,l;const u=new Ke,c=[];let p,h,f,d,g,m=0,y=!1,v=!1,b=0,S=0,x=0,T=[];const O=e.tables.cff2||e.tables.cff;if(f=O.topDict._defaultWidthX,d=O.topDict._nominalWidthX,r=r||e.variation&&e.variation.get(),t.getBlendPath||(t.getBlendPath=function(r){return ss(e,t,n,s,r)}),e.isCIDFont||s>1){const e=O.topDict._fdSelect?O.topDict._fdSelect[t.index]:0,n=O.topDict._fdArray[e];p=n._subrs,h=n._subrsBias,s>1?(T=O.topDict._vstore.itemVariationStore,x=n._privateDict.vsindex):(f=n._defaultWidthX,d=n._nominalWidthX)}else p=O.topDict._subrs,h=O.topDict._subrsBias;const k=ns(e,u);let w=f;function I(e,t){v&&2!==k&&u.closePath(),u.moveTo(e,t),v=!0}function U(){let e;e=!!(1&c.length),e&&!y&&(w=c.shift()+d),m+=c.length>>1,c.length=0,y=!0}return function n(f){let O,R,L,C,E,D,M,F,A,N,P,B,G=0;for(;G<f.length;){let W=f[G];switch(G+=1,W){case 1:case 3:case 18:case 23:U();break;case 4:c.length>1&&!y&&(w=c.shift()+d,y=!0),S+=c.pop(),I(b,S);break;case 5:for(;c.length>0;)b+=c.shift(),S+=c.shift(),u.lineTo(b,S);break;case 6:for(;c.length>0&&(b+=c.shift(),u.lineTo(b,S),0!==c.length);)S+=c.shift(),u.lineTo(b,S);break;case 7:for(;c.length>0&&(S+=c.shift(),u.lineTo(b,S),0!==c.length);)b+=c.shift(),u.lineTo(b,S);break;case 8:for(;c.length>0;)o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l+c.shift(),u.curveTo(o,a,i,l,b,S);break;case 10:E=c.pop()+h,D=p[E],D&&n(D);break;case 11:if(s>1){console.error("CFF CharString operator return (11) is not supported in CFF2");break}return;case 12:switch(W=f[G],G+=1,W){case 35:o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),M=i+c.shift(),F=l+c.shift(),A=M+c.shift(),N=F+c.shift(),P=A+c.shift(),B=N+c.shift(),b=P+c.shift(),S=B+c.shift(),c.shift(),u.curveTo(o,a,i,l,M,F),u.curveTo(A,N,P,B,b,S);break;case 34:o=b+c.shift(),a=S,i=o+c.shift(),l=a+c.shift(),M=i+c.shift(),F=l,A=M+c.shift(),N=l,P=A+c.shift(),B=S,b=P+c.shift(),u.curveTo(o,a,i,l,M,F),u.curveTo(A,N,P,B,b,S);break;case 36:o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),M=i+c.shift(),F=l,A=M+c.shift(),N=l,P=A+c.shift(),B=N+c.shift(),b=P+c.shift(),u.curveTo(o,a,i,l,M,F),u.curveTo(A,N,P,B,b,S);break;case 37:o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),M=i+c.shift(),F=l+c.shift(),A=M+c.shift(),N=F+c.shift(),P=A+c.shift(),B=N+c.shift(),Math.abs(P-b)>Math.abs(B-S)?b=P+c.shift():S=B+c.shift(),u.curveTo(o,a,i,l,M,F),u.curveTo(A,N,P,B,b,S);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+W),c.length=0}break;case 14:if(s>1){console.error("CFF CharString operator endchar (14) is not supported in CFF2");break}if(c.length>=4){const n=vn[c.pop()],s=vn[c.pop()],r=c.pop(),o=c.pop();if(n&&s){t.isComposite=!0,t.components=[];const a=e.cffEncoding.charset.indexOf(n),i=e.cffEncoding.charset.indexOf(s);t.components.push({glyphIndex:i,dx:0,dy:0}),t.components.push({glyphIndex:a,dx:o,dy:r}),u.extend(e.glyphs.get(i).path);const l=e.glyphs.get(a),c=JSON.parse(JSON.stringify(l.path.commands));for(let e=0;e<c.length;e+=1){const t=c[e];"Z"!==t.type&&(t.x+=o,t.y+=r),"Q"!==t.type&&"C"!==t.type||(t.x1+=o,t.y1+=r),"C"===t.type&&(t.x2+=o,t.y2+=r)}u.extend(c)}}else c.length>0&&!y&&(w=c.shift()+d,y=!0);v&&2!==k&&(u.closePath(),v=!1);break;case 15:if(s<2){console.error("CFF2 CharString operator vsindex (15) is not supported in CFF");break}x=c.pop();break;case 16:if(s<2){console.error("CFF2 CharString operator blend (16) is not supported in CFF");break}g||(g=e.variation&&r&&e.variation.process.getBlendVector(T,x,r));var H=c.pop(),_=g?g.length:T.itemVariationSubtables[x].regionIndexes.length,V=H*_,z=c.length-V,j=z-H;if(g)for(let e=0;e<H;e++){var q=c[j+e];for(let e=0;e<_;e++)q+=g[e]*c[z++];c[j+e]=q}for(;V--;)c.pop();break;case 19:case 20:U(),G+=m+7>>3;break;case 21:c.length>2&&!y&&(w=c.shift()+d,y=!0),S+=c.pop(),b+=c.pop(),I(b,S);break;case 22:c.length>1&&!y&&(w=c.shift()+d,y=!0),b+=c.pop(),I(b,S);break;case 24:for(;c.length>2;)o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l+c.shift(),u.curveTo(o,a,i,l,b,S);b+=c.shift(),S+=c.shift(),u.lineTo(b,S);break;case 25:for(;c.length>6;)b+=c.shift(),S+=c.shift(),u.lineTo(b,S);o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l+c.shift(),u.curveTo(o,a,i,l,b,S);break;case 26:for(1&c.length&&(b+=c.shift());c.length>0;)o=b,a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i,S=l+c.shift(),u.curveTo(o,a,i,l,b,S);break;case 27:for(1&c.length&&(S+=c.shift());c.length>0;)o=b+c.shift(),a=S,i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l,u.curveTo(o,a,i,l,b,S);break;case 28:O=f[G],R=f[G+1],c.push((O<<24|R<<16)>>16),G+=2;break;case 29:E=c.pop()+e.gsubrsBias,D=e.gsubrs[E],D&&n(D);break;case 30:for(;c.length>0&&(o=b,a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l+(1===c.length?c.shift():0),u.curveTo(o,a,i,l,b,S),0!==c.length);)o=b+c.shift(),a=S,i=o+c.shift(),l=a+c.shift(),S=l+c.shift(),b=i+(1===c.length?c.shift():0),u.curveTo(o,a,i,l,b,S);break;case 31:for(;c.length>0&&(o=b+c.shift(),a=S,i=o+c.shift(),l=a+c.shift(),S=l+c.shift(),b=i+(1===c.length?c.shift():0),u.curveTo(o,a,i,l,b,S),0!==c.length);)o=b,a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l+(1===c.length?c.shift():0),u.curveTo(o,a,i,l,b,S);break;default:W<32?console.log("Glyph "+t.index+": unknown operator "+W):W<247?c.push(W-139):W<251?(O=f[G],G+=1,c.push(256*(W-247)+O+108)):W<255?(O=f[G],G+=1,c.push(256*-(W-251)-O-108)):(O=f[G],R=f[G+1],L=f[G+2],C=f[G+3],G+=4,c.push((O<<24|R<<16|L<<8|C)/65536))}}}(n),e.variation&&r&&(u.commands=u.commands.map(e=>{const t=Object.keys(e);for(let n=0;n<t.length;n++){const s=t[n];"type"!==s&&(e[s]=Math.round(e[s]))}return e})),y&&(t.advanceWidth=w),u}function rs(e,t,n,s,r){const o=[];let a;const i=new Xt.Parser(e,t),l=i.parseCard8();if(0===l)for(let e=0;e<n;e++){if(a=i.parseCard8(),a>=s)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+s+")");o.push(a)}else{if(!(3===l||r>1&&4===l))throw new Error("CFF Table CID Font FDSelect table has unsupported format "+l);{const e=4===l?i.parseULong():i.parseCard16();let t,u=4===l?i.parseULong():i.parseCard16();if(0!==u)throw new Error(`CFF Table CID Font FDSelect format ${l} range has bad initial GID ${u}`);for(let c=0;c<e;c++){if(a=4===l?i.parseUShort():i.parseCard8(),t=4===l?i.parseULong():i.parseCard16(),a>=s)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+s+")");if(t>n)throw new Error(`CFF Table CID Font FDSelect format ${r} range has bad GID ${t}`);for(;u<t;u++)o.push(a);u=t}if(t!==n)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final (Sentinal) GID "+t)}}return o}function os(e,t){let n,s=dn.indexOf(e);return s>=0&&(n=s),s=t.indexOf(e),s>=0?n=s+dn.length:(n=dn.length+t.length,t.push(e)),n}function as(e,t,n){const s={};for(let r=0;r<e.length;r+=1){const o=e[r];let a=t[o.name];void 0===a||Gn(a,o.value)||("SID"===o.type&&(a=os(a,n)),s[o.op]={name:o.name,type:o.type,value:a})}return s}function is(e,t,n){const s=new kt.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return s.dict=as(n>1?$n:Wn,e,t),s}function ls(e){const t=new kt.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}function us(e,t){const n=[],s=e.path;t<2&&n.push({name:"width",type:"NUMBER",value:e.advanceWidth});let r=0,o=0;for(let e=0;e<s.commands.length;e+=1){let t,a,i=s.commands[e];if("Q"===i.type){const e=1/3,t=2/3;i={type:"C",x:i.x,y:i.y,x1:Math.round(e*r+t*i.x1),y1:Math.round(e*o+t*i.y1),x2:Math.round(e*i.x+t*i.x1),y2:Math.round(e*i.y+t*i.y1)}}if("M"===i.type)t=Math.round(i.x-r),a=Math.round(i.y-o),n.push({name:"dx",type:"NUMBER",value:t}),n.push({name:"dy",type:"NUMBER",value:a}),n.push({name:"rmoveto",type:"OP",value:21}),r=Math.round(i.x),o=Math.round(i.y);else if("L"===i.type)t=Math.round(i.x-r),a=Math.round(i.y-o),n.push({name:"dx",type:"NUMBER",value:t}),n.push({name:"dy",type:"NUMBER",value:a}),n.push({name:"rlineto",type:"OP",value:5}),r=Math.round(i.x),o=Math.round(i.y);else if("C"===i.type){const e=Math.round(i.x1-r),s=Math.round(i.y1-o),l=Math.round(i.x2-i.x1),u=Math.round(i.y2-i.y1);t=Math.round(i.x-i.x2),a=Math.round(i.y-i.y2),n.push({name:"dx1",type:"NUMBER",value:e}),n.push({name:"dy1",type:"NUMBER",value:s}),n.push({name:"dx2",type:"NUMBER",value:l}),n.push({name:"dy2",type:"NUMBER",value:u}),n.push({name:"dx",type:"NUMBER",value:t}),n.push({name:"dy",type:"NUMBER",value:a}),n.push({name:"rrcurveto",type:"OP",value:8}),r=Math.round(i.x),o=Math.round(i.y)}}return t<2&&n.push({name:"endchar",type:"OP",value:14}),n}var cs={parse:function(e,t,n,s){let r;const o=function(e,t){const n={};if(n.formatMajor=Xt.getCard8(e,t),n.formatMinor=Xt.getCard8(e,t+1),n.formatMajor>2)throw new Error(`Unsupported CFF table version ${n.formatMajor}.${n.formatMinor}`);return n.size=Xt.getCard8(e,t+2),n.formatMajor<2?(n.offsetSize=Xt.getCard8(e,t+3),n.startOffset=t,n.endOffset=t+4):(n.topDictLength=Xt.getCard16(e,t+3),n.endOffset=t+8),n}(e,t);r=2===o.formatMajor?n.tables.cff2={}:n.tables.cff={};const a=o.formatMajor>1?null:_n(e,o.endOffset,Xt.bytesToString),i=o.formatMajor>1?null:_n(e,a.endOffset),l=o.formatMajor>1?null:_n(e,i.endOffset,Xt.bytesToString),u=_n(e,o.formatMajor>1?t+o.size+o.topDictLength:l.endOffset,void 0,o.formatMajor);let c,p;if(n.gsubrs=u.objects,n.gsubrsBias=Hn(n.gsubrs),o.formatMajor>1){const n=t+o.size,s=Xt.getBytes(e,n,n+o.topDictLength);c=es(e,0,[s],void 0,o.formatMajor)[0]}else{const n=es(e,t,i.objects,l.objects,o.formatMajor);if(1!==n.length)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+n.length);c=n[0]}if(r.topDict=c,c._privateDict&&(n.defaultWidthX=c._privateDict.defaultWidthX,n.nominalWidthX=c._privateDict.nominalWidthX),o.formatMajor<2&&void 0!==c.ros[0]&&void 0!==c.ros[1]&&(n.isCIDFont=!0),o.formatMajor>1){let s=c.fdArray,r=c.fdSelect;if(!s)throw new Error("This is a CFF2 font, but FDArray information is missing");const a=_n(e,t+s,null,o.formatMajor),i=function(e,t,n){const s=[];for(let r=0;r<n.length;r++){const o=Jn(new DataView(new Uint8Array(n[r]).buffer),0,2),a=o.private[0],i=o.private[1];if(0!==a&&0!==i){const n=Kn(e,i+t,a,[],2);if(n.subrs){const s=_n(e,i+n.subrs+t,void 0,2);o._subrs=s.objects,o._subrsBias=Hn(o._subrs)}o._privateDict=n}s.push(o)}return s}(e,t,a.objects);c._fdArray=i,r&&(c._fdSelect=rs(e,t+r,n.numGlyphs,i.length,o.formatMajor))}else if(n.isCIDFont){let s=c.fdArray,r=c.fdSelect;if(0===s||0===r)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");s+=t;const a=_n(e,s),i=es(e,t,a.objects,l.objects,o.formatMajor);c._fdArray=i,r+=t,c._fdSelect=rs(e,r,n.numGlyphs,i.length,o.formatMajor)}if(o.formatMajor<2){const s=t+c.private[1],r=Kn(e,s,c.private[0],l.objects,o.formatMajor);if(n.defaultWidthX=r.defaultWidthX,n.nominalWidthX=r.nominalWidthX,0!==r.subrs){const t=s+r.subrs,o=_n(e,t);n.subrs=o.objects,n.subrsBias=Hn(n.subrs)}else n.subrs=[],n.subrsBias=0}if(s.lowMemory?(p=function(e,t,n){const s=[],r=n>1?Xt.getULong(e,t):Xt.getCard16(e,t),o=n>1?4:2;let a,i;if(0!==r){const n=Xt.getByte(e,t+o);a=t+(r+1)*n+o;let l=t+o+1;for(let t=0;t<r+1;t+=1)s.push(Xt.getOffset(e,l,n)),l+=n;i=a+s[r]}else i=t+o;return{offsets:s,startOffset:t,endOffset:i}}(e,t+c.charStrings,o.formatMajor),n.nGlyphs=p.offsets.length-(o.formatMajor>1?1:0)):(p=_n(e,t+c.charStrings,null,o.formatMajor),n.nGlyphs=p.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 s=[],r=[];s=0===c.charset?gn:1===c.charset?mn:2===c.charset?yn:function(e,t,n,s,r){let o,a;const i=new Xt.Parser(e,t);n-=1;const l=[".notdef"],u=i.parseCard8();if(0===u)for(let e=0;e<n;e+=1)o=i.parseSID(),r?l.push(o):l.push(jn(s,o)||o);else if(1===u)for(;l.length<=n;){o=i.parseSID(),a=i.parseCard8();for(let e=0;e<=a;e+=1)r?l.push("cid"+("00000"+o).slice(-5)):l.push(jn(s,o)||o),o+=1}else{if(2!==u)throw new Error("Unknown charset format "+u);for(;l.length<=n;){o=i.parseSID(),a=i.parseCard16();for(let e=0;e<=a;e+=1)r?l.push("cid"+("00000"+o).slice(-5)):l.push(jn(s,o)||o),o+=1}}return l}(e,t+c.charset,n.nGlyphs,l.objects,n.isCIDFont),r=0===c.encoding?vn:1===c.encoding?bn:function(e,t){let n;const s={},r=new Xt.Parser(e,t),o=r.parseCard8();if(0===o){const e=r.parseCard8();for(let t=0;t<e;t+=1)n=r.parseCard8(),s[n]=t}else{if(1!==o)throw new Error("Unknown encoding format "+o);{const e=r.parseCard8();n=1;for(let t=0;t<e;t+=1){const e=r.parseCard8(),t=r.parseCard8();for(let r=e;r<=e+t;r+=1)s[r]=n,n+=1}}}return s}(e,t+c.encoding),n.cffEncoding=new On(r,s),n.encoding=n.encoding||n.cffEncoding}if(n.glyphs=new Bn.GlyphSet(n),s.lowMemory)n._push=function(s){const r=function(e,t,n,s,r,o){const a=o>1?Xt.getULong(n,s):Xt.getCard16(n,s),i=o>1?4:2;let l=0;0!==a&&(l=s+(a+1)*Xt.getByte(n,s+i)+i);let u=Xt.getBytes(n,l+t[e],l+t[e+1]);return r&&(u=r(u)),u}(s,p.offsets,e,t+c.charStrings,void 0,o.formatMajor);n.glyphs.push(s,Bn.cffGlyphLoader(n,s,ss,r,o.formatMajor))};else for(let e=0;e<n.nGlyphs;e+=1){const t=p.objects[e];n.glyphs.push(e,Bn.cffGlyphLoader(n,e,ss,t,o.formatMajor))}if(c.vstore){const n=new Xt.Parser(e,t+c.vstore);c._vstore=n.parseVariationStore()}},make:function(e,t){const n=new kt.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"}]),s=1/t.unitsPerEm,r={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[s,0,0,s,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},o=t&&t.topDict||{};o.paintType&&(r.paintType=o.paintType,r.strokeWidth=o.strokeWidth||0);const a=[];let i;for(let t=1;t<e.length;t+=1)i=e.get(t),a.push(i.name);const l=[];n.header=new kt.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}]),n.nameIndex=function(e){const t=new kt.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}([t.postScriptName]);let u=is(r,l);n.topDictIndex=ls(u),n.globalSubrIndex=new kt.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}]),n.charsets=function(e,t){const n=new kt.Record("Charsets",[{name:"format",type:"Card8",value:0}]);for(let s=0;s<e.length;s+=1){const r=os(e[s],t);n.fields.push({name:"glyph_"+s,type:"SID",value:r})}return n}(a,l),n.charStringsIndex=function(e,t){const n=new kt.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]);for(let s=0;s<e.length;s+=1){const r=e.get(s),o=us(r,t);n.charStrings.push({name:r.name,type:"CHARSTRING",value:o})}return n}(e,1),n.privateDict=function(e,t,n){const s=new kt.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return s.dict=as(n>1?Yn:Xn,e,t),s}({},l),n.stringIndex=function(e){const t=new kt.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}(l);const c=n.header.sizeOf()+n.nameIndex.sizeOf()+n.topDictIndex.sizeOf()+n.stringIndex.sizeOf()+n.globalSubrIndex.sizeOf();return r.charset=c,r.encoding=0,r.charStrings=r.charset+n.charsets.sizeOf(),r.private[1]=r.charStrings+n.charStringsIndex.sizeOf(),u=is(r,l),n.topDictIndex=ls(u),n}};var ps={parse:function(e,t){const n={},s=new Xt.Parser(e,t);return n.version=s.parseVersion(),n.fontRevision=Math.round(1e3*s.parseFixed())/1e3,n.checkSumAdjustment=s.parseULong(),n.magicNumber=s.parseULong(),tt.argument(1594834165===n.magicNumber,"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},make:function(e){const t=Math.round((new Date).getTime()/1e3)+2082844800;let n=t,s=e.macStyle||0;return e.createdTimestamp&&(n=e.createdTimestamp+2082844800),new kt.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 hs={parse:function(e,t){const n={},s=new Xt.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},make:function(e){return new kt.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 fs={parse:function(e,t,n,s,r,o,a){a.lowMemory?function(e,t,n,s,r){let o,a;e._hmtxTableData={};const i=new Xt.Parser(t,n);for(let t=0;t<r;t+=1)t<s&&(o=i.parseUShort(),a=i.parseShort()),e._hmtxTableData[t]={advanceWidth:o,leftSideBearing:a}}(e,t,n,s,r):function(e,t,n,s,r){let o,a;const i=new Xt.Parser(e,t);for(let e=0;e<s;e+=1){e<n&&(o=i.parseUShort(),a=i.parseShort());const t=r.get(e);t.advanceWidth=o,t.leftSideBearing=a}}(t,n,s,r,o)},make:function(e){const t=new kt.Table("hmtx",[]);for(let n=0;n<e.length;n+=1){const 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 ds={make:function(e){const t=new kt.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]);let n="";const s=12+4*e.length;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},parse:function(e,t){const n=new Xt.Parser(e,t),s=n.parseULong();tt.argument(1===s,"Unsupported ltag table version."),n.skip("uLong",1);const r=n.parseULong(),o=[];for(let s=0;s<r;s++){let s="";const r=t+n.parseUShort(),a=n.parseUShort();for(let t=r;t<r+a;++t)s+=String.fromCharCode(e.getInt8(t));o.push(s)}return o}};var gs={parse:function(e,t){const n={},s=new Xt.Parser(e,t);return n.version=s.parseVersion(),n.numGlyphs=s.parseUShort(),1===n.version&&(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},make:function(e){return new kt.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])}},ms=[{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}];var ys={parse:function(e,t){const n={},s=new Xt.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 e=0;e<10;e++)n.panose[e]=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},make:function(e){return new kt.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)},unicodeRanges:ms,getUnicodeRange:function(e){for(let t=0;t<ms.length;t+=1){const n=ms[t];if(e>=n.begin&&e<n.end)return t}return-1}};var vs={parse:function(e,t){const n={},s=new Xt.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=Sn.slice();break;case 2:n.numberOfGlyphs=s.parseUShort(),n.glyphNameIndex=new Array(n.numberOfGlyphs);for(let e=0;e<n.numberOfGlyphs;e++)n.glyphNameIndex[e]=s.parseUShort();n.names=[];for(let e=0;e<n.numberOfGlyphs;e++)if(n.glyphNameIndex[e]>=Sn.length){const e=s.parseChar();n.names.push(s.parseString(e))}break;case 2.5:n.numberOfGlyphs=s.parseUShort(),n.offset=new Array(n.numberOfGlyphs);for(let e=0;e<n.numberOfGlyphs;e++)n.offset[e]=s.parseChar()}return n},make:function(e){const{italicAngle:t=Math.round(65536*(e.italicAngle||0)),underlinePosition:n=0,underlineThickness:s=0,isFixedPitch:r=0,minMemType42:o=0,maxMemType42:a=0,minMemType1:i=0,maxMemType1:l=0}=e.tables.post||{};return new kt.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:a},{name:"minMemType1",type:"ULONG",value:i},{name:"maxMemType1",type:"ULONG",value:l}])}},bs=new Array(9);bs[1]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(Wt.coverage),deltaGlyphId:this.parseShort()}:2===t?{substFormat:2,coverage:this.parsePointer(Wt.coverage),substitute:this.parseOffset16List()}:void tt.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")},bs[2]=function(){const e=this.parseUShort();return tt.argument(1===e,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(Wt.coverage),sequences:this.parseListOfLists()}},bs[3]=function(){const e=this.parseUShort();return tt.argument(1===e,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(Wt.coverage),alternateSets:this.parseListOfLists()}},bs[4]=function(){const e=this.parseUShort();return tt.argument(1===e,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(Wt.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var Ss={sequenceIndex:Wt.uShort,lookupListIndex:Wt.uShort};bs[5]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{substFormat:t,coverage:this.parsePointer(Wt.coverage),ruleSets:this.parseListOfLists(function(){const e=this.parseUShort(),t=this.parseUShort();return{input:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,Ss)}})};if(2===t)return{substFormat:t,coverage:this.parsePointer(Wt.coverage),classDef:this.parsePointer(Wt.classDef),classSets:this.parseListOfLists(function(){const e=this.parseUShort(),t=this.parseUShort();return{classes:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,Ss)}})};if(3===t){const e=this.parseUShort(),n=this.parseUShort();return{substFormat:t,coverages:this.parseList(e,Wt.pointer(Wt.coverage)),lookupRecords:this.parseRecordList(n,Ss)}}tt.assert(!1,"0x"+e.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},bs[6]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(Wt.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Ss)}})}:2===t?{substFormat:2,coverage:this.parsePointer(Wt.coverage),backtrackClassDef:this.parsePointer(Wt.classDef),inputClassDef:this.parsePointer(Wt.classDef),lookaheadClassDef:this.parsePointer(Wt.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Ss)}})}:3===t?{substFormat:3,backtrackCoverage:this.parseList(Wt.pointer(Wt.coverage)),inputCoverage:this.parseList(Wt.pointer(Wt.coverage)),lookaheadCoverage:this.parseList(Wt.pointer(Wt.coverage)),lookupRecords:this.parseRecordList(Ss)}:void tt.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},bs[7]=function(){const e=this.parseUShort();tt.argument(1===e,"GSUB Extension Substitution subtable identifier-format must be 1");const t=this.parseUShort(),n=new Wt(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:bs[t].call(n)}},bs[8]=function(){const e=this.parseUShort();return tt.argument(1===e,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(Wt.coverage),backtrackCoverage:this.parseList(Wt.pointer(Wt.coverage)),lookaheadCoverage:this.parseList(Wt.pointer(Wt.coverage)),substitutes:this.parseUShortList()}};var xs=new Array(9);xs[1]=function(e){return 1===e.substFormat?new kt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new kt.Coverage(e.coverage)},{name:"deltaGlyphID",type:"SHORT",value:e.deltaGlyphId}]):2===e.substFormat?new kt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new kt.Coverage(e.coverage)}].concat(kt.ushortList("substitute",e.substitute))):void tt.fail("Lookup type 1 substFormat must be 1 or 2.")},xs[2]=function(e){return tt.assert(1===e.substFormat,"Lookup type 2 substFormat must be 1."),new kt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new kt.Coverage(e.coverage)}].concat(kt.tableList("seqSet",e.sequences,function(e){return new kt.Table("sequenceSetTable",kt.ushortList("sequence",e))})))},xs[3]=function(e){return tt.assert(1===e.substFormat,"Lookup type 3 substFormat must be 1."),new kt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new kt.Coverage(e.coverage)}].concat(kt.tableList("altSet",e.alternateSets,function(e){return new kt.Table("alternateSetTable",kt.ushortList("alternate",e))})))},xs[4]=function(e){return tt.assert(1===e.substFormat,"Lookup type 4 substFormat must be 1."),new kt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new kt.Coverage(e.coverage)}].concat(kt.tableList("ligSet",e.ligatureSets,function(e){return new kt.Table("ligatureSetTable",kt.tableList("ligature",e,function(e){return new kt.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:e.ligGlyph}].concat(kt.ushortList("component",e.components,e.components.length+1)))}))})))},xs[5]=function(e){if(1===e.substFormat)return new kt.Table("contextualSubstitutionTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new kt.Coverage(e.coverage)}].concat(kt.tableList("sequenceRuleSet",e.ruleSets,function(e){return e?new kt.Table("sequenceRuleSetTable",kt.tableList("sequenceRule",e,function(e){let t=kt.ushortList("seqLookup",[],e.lookupRecords.length).concat(kt.ushortList("inputSequence",e.input,e.input.length+1));[t[0],t[1]]=[t[1],t[0]];for(let n=0;n<e.lookupRecords.length;n++){const s=e.lookupRecords[n];t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:s.lookupListIndex})}return new kt.Table("sequenceRuleTable",t)})):new kt.Table("NULL",null)})));if(2===e.substFormat)return new kt.Table("contextualSubstitutionTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new kt.Coverage(e.coverage)},{name:"classDef",type:"TABLE",value:new kt.ClassDef(e.classDef)}].concat(kt.tableList("classSeqRuleSet",e.classSets,function(e){return e?new kt.Table("classSeqRuleSetTable",kt.tableList("classSeqRule",e,function(e){let t=kt.ushortList("classes",e.classes,e.classes.length+1).concat(kt.ushortList("seqLookupCount",[],e.lookupRecords.length));for(let n=0;n<e.lookupRecords.length;n++){const s=e.lookupRecords[n];t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:s.lookupListIndex})}return new kt.Table("classSeqRuleTable",t)})):new kt.Table("NULL",null)})));if(3===e.substFormat){let t=[{name:"substFormat",type:"USHORT",value:e.substFormat}];t.push({name:"inputGlyphCount",type:"USHORT",value:e.coverages.length}),t.push({name:"substitutionCount",type:"USHORT",value:e.lookupRecords.length});for(let n=0;n<e.coverages.length;n++){const s=e.coverages[n];t.push({name:"inputCoverage"+n,type:"TABLE",value:new kt.Coverage(s)})}for(let n=0;n<e.lookupRecords.length;n++){const s=e.lookupRecords[n];t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:s.lookupListIndex})}return new kt.Table("contextualSubstitutionTable",t)}tt.assert(!1,"lookup type 5 format must be 1, 2 or 3.")},xs[6]=function(e){if(1===e.substFormat){let t=new kt.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new kt.Coverage(e.coverage)}].concat(kt.tableList("chainRuleSet",e.chainRuleSets,function(e){return new kt.Table("chainRuleSetTable",kt.tableList("chainRule",e,function(e){let t=kt.ushortList("backtrackGlyph",e.backtrack,e.backtrack.length).concat(kt.ushortList("inputGlyph",e.input,e.input.length+1)).concat(kt.ushortList("lookaheadGlyph",e.lookahead,e.lookahead.length)).concat(kt.ushortList("substitution",[],e.lookupRecords.length));for(let n=0;n<e.lookupRecords.length;n++){const s=e.lookupRecords[n];t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:s.lookupListIndex})}return new kt.Table("chainRuleTable",t)}))})));return t}if(2===e.substFormat)tt.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(3===e.substFormat){let t=[{name:"substFormat",type:"USHORT",value:e.substFormat}];t.push({name:"backtrackGlyphCount",type:"USHORT",value:e.backtrackCoverage.length});for(let n=0;n<e.backtrackCoverage.length;n++){const s=e.backtrackCoverage[n];t.push({name:"backtrackCoverage"+n,type:"TABLE",value:new kt.Coverage(s)})}t.push({name:"inputGlyphCount",type:"USHORT",value:e.inputCoverage.length});for(let n=0;n<e.inputCoverage.length;n++){const s=e.inputCoverage[n];t.push({name:"inputCoverage"+n,type:"TABLE",value:new kt.Coverage(s)})}t.push({name:"lookaheadGlyphCount",type:"USHORT",value:e.lookaheadCoverage.length});for(let n=0;n<e.lookaheadCoverage.length;n++){const s=e.lookaheadCoverage[n];t.push({name:"lookaheadCoverage"+n,type:"TABLE",value:new kt.Coverage(s)})}t.push({name:"substitutionCount",type:"USHORT",value:e.lookupRecords.length});for(let n=0;n<e.lookupRecords.length;n++){const s=e.lookupRecords[n];t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:s.lookupListIndex})}return new kt.Table("chainContextTable",t)}tt.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};var Ts={parse:function(e,t){const n=new Wt(e,t=t||0),s=n.parseVersion(1);return tt.argument(1===s||1.1===s,"Unsupported GSUB table version."),1===s?{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(bs)}:{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(bs),variations:n.parseFeatureVariationsList()}},make:function(e){return new kt.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new kt.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new kt.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new kt.LookupList(e.lookups,xs)}])}};var Os={parse:function(e,t){const n=new Xt.Parser(e,t),s=n.parseULong();tt.argument(1===s,"Unsupported META table version."),n.parseULong(),n.parseULong();const r=n.parseULong(),o={};for(let s=0;s<r;s++){const s=n.parseTag(),r=n.parseULong(),a=n.parseULong();if("appl"===s||"bild"===s)continue;const i=st.UTF8(e,t+r,a);o[s]=i}return o},make:function(e){const t=Object.keys(e).length;let n="";const s=16+12*t,r=new kt.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 t in e){const o=n.length;n+=e[t],r.fields.push({name:"tag "+t,type:"TAG",value:t}),r.fields.push({name:"offset "+t,type:"ULONG",value:s+o}),r.fields.push({name:"length "+t,type:"ULONG",value:e[t].length})}return r.fields.push({name:"stringPool",type:"CHARARRAY",value:n}),r}};var ks={parse:function(e,t){const n=new Wt(e,t),s=n.parseUShort();0!==s&&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.");const r=n.parseUShort(),o=n.parseOffset32(),a=n.parseOffset32(),i=n.parseUShort();n.relativeOffset=o;const l=n.parseRecordList(r,{glyphID:Wt.uShort,firstLayerIndex:Wt.uShort,numLayers:Wt.uShort});return n.relativeOffset=a,{version:s,baseGlyphRecords:l,layerRecords:n.parseRecordList(i,{glyphID:Wt.uShort,paletteIndex:Wt.uShort})}},make:function({version:e=0,baseGlyphRecords:t=[],layerRecords:n=[]}){tt.argument(0===e,"Only COLRv0 supported.");const s=14+6*t.length;return new kt.Table("COLR",[{name:"version",type:"USHORT",value:e},{name:"numBaseGlyphRecords",type:"USHORT",value:t.length},{name:"baseGlyphRecordsOffset",type:"ULONG",value:14},{name:"layerRecordsOffset",type:"ULONG",value:s},{name:"numLayerRecords",type:"USHORT",value:n.length},...t.map((e,t)=>[{name:"glyphID_"+t,type:"USHORT",value:e.glyphID},{name:"firstLayerIndex_"+t,type:"USHORT",value:e.firstLayerIndex},{name:"numLayers_"+t,type:"USHORT",value:e.numLayers}]).flat(),...n.map((e,t)=>[{name:"LayerGlyphID_"+t,type:"USHORT",value:e.glyphID},{name:"paletteIndex_"+t,type:"USHORT",value:e.paletteIndex}]).flat()])}};function ws(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 Is(e,t,n){const s={},r=new Xt.Parser(e,t);s.tag=r.parseTag(),s.minValue=r.parseFixed(),s.defaultValue=r.parseFixed(),s.maxValue=r.parseFixed(),r.skip("uShort",1);const o=r.parseUShort();return s.axisNameID=o,s.name=cn(n,o),s}function Us(e,t,n,s={}){const r=[{name:"nameID_"+e,type:"USHORT",value:t.subfamilyNameID},{name:"flags_"+e,type:"USHORT",value:0}];for(let s=0;s<n.length;++s){const o=n[s].tag;r.push({name:"axis_"+e+" "+o,type:"FIXED",value:t.coordinates[o]<<16})}return s&&s.postScriptNameID&&r.push({name:"postScriptNameID_",type:"USHORT",value:void 0!==t.postScriptNameID?t.postScriptNameID:65535}),r}function Rs(e,t,n,s,r){const o={},a=new Xt.Parser(e,t),i=a.parseUShort();o.subfamilyNameID=i,o.name=cn(s,i,[2,17]),a.skip("uShort",1),o.coordinates={};for(let e=0;e<n.length;++e)o.coordinates[n[e].tag]=a.parseFixed();if(a.relativeOffset===r)return o.postScriptNameID=void 0,o.postScriptName=void 0,o;const l=a.parseUShort();return o.postScriptNameID=65535==l?void 0:l,o.postScriptName=void 0!==o.postScriptNameID?cn(s,l,[6]):"",o}var Ls={make:function(e,t){const n=new kt.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+4*e.axes.length}]);n.offsetToData=n.sizeOf();for(let t=0;t<e.axes.length;t++)n.fields=n.fields.concat(ws(t,e.axes[t]));const s={};for(let t=0;t<e.instances.length;t++)if(void 0!==e.instances[t].postScriptNameID){n.instanceSize+=2,s.postScriptNameID=!0;break}for(let t=0;t<e.instances.length;t++)n.fields=n.fields.concat(Us(t,e.instances[t],e.axes,s));return n},parse:function(e,t,n){const s=new Xt.Parser(e,t),r=s.parseULong();tt.argument(65536===r,"Unsupported fvar table version.");const o=s.parseOffset16();s.skip("uShort",1);const a=s.parseUShort(),i=s.parseUShort(),l=s.parseUShort(),u=s.parseUShort(),c=[];for(let s=0;s<a;s++)c.push(Is(e,t+o+s*i,n));const p=[],h=t+o+a*i;for(let t=0;t<l;t++)p.push(Rs(e,h+t*u,c,n,u));return{axes:c,instances:p}}},Cs={tag:Wt.tag,nameID:Wt.uShort,ordering:Wt.uShort},Es=new Array(5);function Ds(){const e=this.parseUShort(),t=Es[e],n={format:e};return void 0===t?(console.warn(`Unknown axis value table format ${e}`),n):Object.assign(n,this.parseStruct(t.bind(this)))}Es[1]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),value:this.parseFixed()}},Es[2]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),nominalValue:this.parseFixed(),rangeMinValue:this.parseFixed(),rangeMaxValue:this.parseFixed()}},Es[3]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),value:this.parseFixed(),linkedValue:this.parseFixed()}},Es[4]=function(){const e=this.parseUShort();return{flags:this.parseUShort(),valueNameID:this.parseUShort(),axisValues:this.parseList(e,function(){return{axisIndex:this.parseUShort(),value:this.parseFixed()}})}};var Ms=new Array(5);function Fs(e,t){return new kt.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 As(e,t){const n=t.format,s=Ms[n];tt.argument(void 0!==s,`Unknown axis value table format ${n}`);const r=s(e,t);return new kt.Table("axisValueTable_"+e,r)}Ms[1]=function(e,t){return[{name:`format${e}`,type:"USHORT",value:1},{name:`axisIndex${e}`,type:"USHORT",value:t.axisIndex},{name:`flags${e}`,type:"USHORT",value:t.flags},{name:`valueNameID${e}`,type:"USHORT",value:t.valueNameID},{name:`value${e}`,type:"FLOAT",value:t.value}]},Ms[2]=function(e,t){return[{name:`format${e}`,type:"USHORT",value:2},{name:`axisIndex${e}`,type:"USHORT",value:t.axisIndex},{name:`flags${e}`,type:"USHORT",value:t.flags},{name:`valueNameID${e}`,type:"USHORT",value:t.valueNameID},{name:`nominalValue${e}`,type:"FLOAT",value:t.nominalValue},{name:`rangeMinValue${e}`,type:"FLOAT",value:t.rangeMinValue},{name:`rangeMaxValue${e}`,type:"FLOAT",value:t.rangeMaxValue}]},Ms[3]=function(e,t){return[{name:`format${e}`,type:"USHORT",value:3},{name:`axisIndex${e}`,type:"USHORT",value:t.axisIndex},{name:`flags${e}`,type:"USHORT",value:t.flags},{name:`valueNameID${e}`,type:"USHORT",value:t.valueNameID},{name:`value${e}`,type:"FLOAT",value:t.value},{name:`linkedValue${e}`,type:"FLOAT",value:t.linkedValue}]},Ms[4]=function(e,t){let n=[{name:`format${e}`,type:"USHORT",value:4},{name:`axisCount${e}`,type:"USHORT",value:t.axisValues.length},{name:`flags${e}`,type:"USHORT",value:t.flags},{name:`valueNameID${e}`,type:"USHORT",value:t.valueNameID}];for(let s=0;s<t.axisValues.length;s++)n=n.concat([{name:`format${e}axisIndex${s}`,type:"USHORT",value:t.axisValues[s].axisIndex},{name:`format${e}value${s}`,type:"FLOAT",value:t.axisValues[s].value}]);return n};var Ns={make:function(e){const t=new kt.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 n=0;n<e.axes.length;n++){const s=Fs(n,e.axes[n]);t.offsetToAxisValueOffsets+=s.sizeOf(),t.fields=t.fields.concat(s.fields)}const n=[];let s=[],r=2*e.values.length;for(let t=0;t<e.values.length;t++){const o=As(t,e.values[t]);n.push({name:"offset_"+t,type:"USHORT",value:r}),r+=o.sizeOf(),s=s.concat(o.fields)}return t.fields=t.fields.concat(n),t.fields=t.fields.concat(s),t},parse:function(e,t,n){t||(t=0);const s=new Xt.Parser(e,t),r=s.parseUShort(),o=s.parseUShort();1!==r&&console.warn(`Unsupported STAT table version ${r}.${o}`);const a=[r,o],i=s.parseUShort(),l=s.parseUShort(),u=s.parseOffset32(),c=s.parseUShort(),p=s.parseOffset32(),h=r>1||o>0?s.parseUShort():void 0;void 0!==n&&tt.argument(l>=n.axes.length,"STAT axis count must be greater than or equal to fvar axis count"),c>0&&tt.argument(l>=0,"STAT axis count must be greater than 0 if STAT axis value count is greater than 0");const f=[];for(let e=0;e<l;e++)s.offset=t+u,s.relativeOffset=e*i,f.push(s.parseStruct(Cs));s.offset=t,s.relativeOffset=p;const d=s.parseUShortList(c),g=[];for(let e=0;e<c;e++)s.offset=t+p,s.relativeOffset=d[e],g.push(Ds.apply(s));return{version:a,axes:f,values:g,elidedFallbackNameID:h}}};function Ps(e,t){return new kt.Record("axisValueMap_"+e,[{name:"fromCoordinate_"+e,type:"F2DOT14",value:t.fromCoordinate},{name:"toCoordinate_"+e,type:"F2DOT14",value:t.toCoordinate}])}function Bs(e,t){const n=new kt.Record("segmentMap_"+e,[{name:"positionMapCount_"+e,type:"USHORT",value:t.axisValueMaps.length}]);let s=[];for(let n=0;n<t.axisValueMaps.length;n++){const r=Ps(`${e}_${n}`,t.axisValueMaps[n]);s=s.concat(r.fields)}return n.fields=n.fields.concat(s),n}var Gs={make:function(e,t){tt.argument(e.axisSegmentMaps.length===t.axes.length,"avar axis count must correspond to fvar axis count");const n=new kt.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 t=0;t<e.axisSegmentMaps.length;t++){const s=Bs(t,e.axisSegmentMaps[t]);n.fields=n.fields.concat(s.fields)}return n},parse:function(e,t,n){t||(t=0);const s=new Wt(e,t),r=s.parseUShort(),o=s.parseUShort();1!==r&&console.warn(`Unsupported avar table version ${r}.${o}`),s.skip("uShort",1);const a=s.parseUShort();tt.argument(a===n.axes.length,"avar axis count must correspond to fvar axis count");const i=[];for(let e=0;e<a;e++){const e=[],t=s.parseUShort();for(let n=0;n<t;n++){const t=s.parseF2Dot14(),n=s.parseF2Dot14();e.push({fromCoordinate:t,toCoordinate:n})}i.push({axisValueMaps:e})}return{version:[r,o],axisSegmentMaps:i}}};var Hs={make:function(){console.warn("Writing of cvar tables is not yet supported.")},parse:function(e,t,n,s){const r=new Xt.Parser(e,t),o=r.parseTupleVariationStore(r.relativeOffset,n.axes.length,"cvar",s),a=r.parseUShort(),i=r.parseUShort();return 1!==a&&console.warn(`Unsupported cvar table version ${a}.${i}`),{version:[a,i],...o}}};var _s={make:function(){console.warn("Writing of gvar tables is not yet supported.")},parse:function(e,t,n,s){const r=new Xt.Parser(e,t),o=r.parseUShort(),a=r.parseUShort();1!==o&&console.warn(`Unsupported gvar table version ${o}.${a}`);const i=r.parseUShort();i!==n.axes.length&&console.warn(`axisCount ${i} in gvar table does not match the number of axes ${n.axes.length} in the fvar table!`);const l=r.parseUShort();return{version:[o,a],sharedTuples:r.parsePointer32(function(){return this.parseTupleRecords(l,i)}),glyphVariations:r.parseTupleVariationStoreList(i,"gvar",s)}}};var Vs={parse:function(e,t){const n={},s=new Xt.Parser(e,t);n.version=s.parseUShort(),tt.argument(n.version<=1,"Unsupported gasp table version."),n.numRanges=s.parseUShort(),n.gaspRanges=[];for(let e=0;e<n.numRanges;e++)n.gaspRanges[e]={rangeMaxPPEM:s.parseUShort(),rangeGaspBehavior:s.parseUShort()};return n},make:function(e){const t=new kt.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 zs={make:function(e){const t=Array.from(e.keys()).sort(),n=[],s=[],r=new Map;let o=0,a={endGlyphID:null};for(let i=0,l=t.length;i<l;i++){const l=t[i],u=e.get(l);let c=r.get(u);void 0===c&&(c=o,s.push(u),r.set(u,c),o+=u.byteLength),l-1===a.endGlyphID&&c===a.svgDocOffset?a.endGlyphID=l:(a={startGlyphID:l,endGlyphID:l,svgDocOffset:c,svgDocLength:u.byteLength},n.push(a))}const i=n.length,l=s.length,u=2+12*i,c=new Array(4+4*i+l);let p=0;c[p++]={name:"version",type:"USHORT",value:0},c[p++]={name:"svgDocumentListOffset",type:"ULONG",value:10},c[p++]={name:"reserved",type:"ULONG",value:0},c[p++]={name:"numEntries",type:"USHORT",value:i};for(let e=0;e<i;e++){const t="documentRecord_"+e,{startGlyphID:s,endGlyphID:r,svgDocOffset:o,svgDocLength:a}=n[e];c[p++]={name:t+"_startGlyphID",type:"USHORT",value:s},c[p++]={name:t+"_endGlyphID",type:"USHORT",value:r},c[p++]={name:t+"_svgDocOffset",type:"ULONG",value:u+o},c[p++]={name:t+"_svgDocLength",type:"ULONG",value:a}}for(let e=0;e<l;e++)c[p++]={name:"svgDoc_"+e,type:"LITERAL",value:s[e]};return new kt.Table("SVG ",c)},parse:function(e,t){const n=new Map,s=e.buffer,r=new Wt(e,t);if(0!==r.parseUShort())return n;r.relativeOffset=r.parseOffset32();const o=e.byteOffset+t+r.relativeOffset,a=r.parseUShort(),i=new Map;for(let e=0;e<a;e++){const e=r.parseUShort(),t=r.parseUShort(),a=o+r.parseOffset32(),l=r.parseULong();let u=i.get(a);void 0===u&&(u=new Uint8Array(s,a,l),i.set(a,u));for(let s=e;s<=t;s++)n.set(s,u)}return n}};function js(e){return Math.log(e)/Math.log(2)|0}function qs(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 Ws(e,t,n,s){return new kt.Record("Table Record",[{name:"tag",type:"TAG",value:void 0!==e?e:""},{name:"checkSum",type:"ULONG",value:void 0!==t?t:0},{name:"offset",type:"ULONG",value:void 0!==n?n:0},{name:"length",type:"ULONG",value:void 0!==s?s:0}])}function $s(e){const t=new kt.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;const n=Math.pow(2,js(t.numTables));t.searchRange=16*n,t.entrySelector=js(n),t.rangeShift=16*t.numTables-t.searchRange;const s=[],r=[];let o=t.sizeOf()+Ws().sizeOf()*t.numTables;for(;o%4!=0;)o+=1,r.push({name:"padding",type:"BYTE",value:0});for(let t=0;t<e.length;t+=1){const n=e[t];tt.argument(4===n.tableName.length,"Table name"+n.tableName+" is invalid.");const a=n.sizeOf(),i=Ws(n.tableName,qs(n.encode()),o,a);for(s.push({name:i.tag+" Table Record",type:"RECORD",value:i}),r.push({name:n.tableName+" table",type:"RECORD",value:n}),o+=a,tt.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(e,t){return e.value.tag>t.value.tag?1:-1}),t.fields=t.fields.concat(s),t.fields=t.fields.concat(r),t}function Xs(e,t,n){for(let n=0;n<t.length;n+=1){const s=e.charToGlyphIndex(t[n]);if(s>0){return e.glyphs.get(s).getMetrics()}}return n}function Ys(e){let t=0;for(let n=0;n<e.length;n+=1)t+=e[n];return t/e.length}var Zs={make:$s,fontToTable:function(e){const t=[],n=[],s=[],r=[],o=[],a=[],i=[];let l,u=0,c=0,p=0,h=0,f=0;for(let d=0;d<e.glyphs.length;d+=1){const g=e.glyphs.get(d),m=0|g.unicode;if(isNaN(g.advanceWidth))throw new Error("Glyph "+g.name+" ("+d+"): advanceWidth is not a number.");(l>m||void 0===l)&&m>0&&(l=m),u<m&&(u=m);const y=ys.getUnicodeRange(m);if(y<32)c|=1<<y;else if(y<64)p|=1<<y-32;else if(y<96)h|=1<<y-64;else{if(!(y<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");f|=1<<y-96}if(".notdef"===g.name)continue;const v=g.getMetrics();t.push(v.xMin),n.push(v.yMin),s.push(v.xMax),r.push(v.yMax),a.push(v.leftSideBearing),i.push(v.rightSideBearing),o.push(g.advanceWidth)}const d={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:Ys(o),minLeftSideBearing:Math.min.apply(null,a),maxLeftSideBearing:Math.max.apply(null,a),minRightSideBearing:Math.min.apply(null,i)};d.ascender=e.ascender,d.descender=e.descender;let g=0;e.weightClass>=600&&(g|=e.macStyleValues.BOLD),e.italicAngle<0&&(g|=e.macStyleValues.ITALIC);const m=ps.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:d.xMin,yMin:d.yMin,xMax:d.xMax,yMax:d.yMax,lowestRecPPEM:3,macStyle:g,createdTimestamp:e.createdTimestamp}),y=hs.make({ascender:d.ascender,descender:d.descender,advanceWidthMax:d.advanceWidthMax,minLeftSideBearing:d.minLeftSideBearing,minRightSideBearing:d.minRightSideBearing,xMaxExtent:d.maxLeftSideBearing+(d.xMax-d.xMin),numberOfHMetrics:e.glyphs.length}),v=gs.make(e.glyphs.length),b=ys.make(Object.assign({xAvgCharWidth:Math.round(d.advanceWidthAvg),usFirstCharIndex:l,usLastCharIndex:u,ulUnicodeRange1:c,ulUnicodeRange2:p,ulUnicodeRange3:h,ulUnicodeRange4:f,sTypoAscender:d.ascender,sTypoDescender:d.descender,sTypoLineGap:0,usWinAscent:d.yMax,usWinDescent:Math.abs(d.yMin),ulCodePageRange1:1,sxHeight:Xs(e,"xyvw",{yMax:Math.round(d.ascender/2)}).yMax,sCapHeight:Xs(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",d).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0},e.tables.os2)),S=fs.make(e.glyphs),x=fn.make(e.glyphs),T=e.getEnglishName("fontFamily"),O=e.getEnglishName("fontSubfamily"),k=T+" "+O;let w=e.getEnglishName("postScriptName");w||(w=T.replace(/\s/g,"")+"-"+O);const I={};for(let t in e.names)I[t]=e.names[t];I.unicode=I.unicode||{},I.macintosh=I.macintosh||{},I.windows=I.windows||{};const U=e.names.unicode||{},R=e.names.macintosh||{},L=e.names.windows||{};for(const t in I){if(I[t]=I[t]||{},!I[t].uniqueID){const n=e.getEnglishName("manufacturer")||"";I[t].uniqueID={en:`${n}: ${k}`}}I[t].postScriptName||(I[t].postScriptName={en:w})}I.unicode.preferredFamily||(I.unicode.preferredFamily=U.fontFamily||R.fontFamily||L.fontFamily),I.macintosh.preferredFamily||(I.macintosh.preferredFamily=R.fontFamily||U.fontFamily||L.fontFamily),I.windows.preferredFamily||(I.windows.preferredFamily=L.fontFamily||U.fontFamily||R.fontFamily),I.unicode.preferredSubfamily||(I.unicode.preferredSubfamily=U.fontSubfamily||R.fontSubfamily||L.fontSubfamily),I.macintosh.preferredSubfamily||(I.macintosh.preferredSubfamily=R.fontSubfamily||U.fontSubfamily||L.fontSubfamily),I.windows.preferredSubfamily||(I.windows.preferredSubfamily=L.fontSubfamily||U.fontSubfamily||R.fontSubfamily);const C=[],E=pn.make(I,C),D=C.length>0?ds.make(C):void 0,M=vs.make(e),F=cs.make(e.glyphs,{version:e.getEnglishName("version"),fullName:k,familyName:T,weightName:O,postScriptName:w,unitsPerEm:e.unitsPerEm,fontBBox:[0,d.yMin,d.ascender,d.advanceWidthMax],topDict:e.tables.cff&&e.tables.cff.topDict||{}}),A=e.metas&&Object.keys(e.metas).length>0?Os.make(e.metas):void 0,N=[m,y,v,b,E,x,M,F,S];D&&N.push(D);const P={gsub:Ts,cpal:Mn,colr:ks,stat:Ns,avar:Gs,cvar:Hs,fvar:Ls,gvar:_s,gasp:Vs,svg:zs},B={avar:[e.tables.fvar],fvar:[e.names]};for(let t in P){const n=e.tables[t];if(n){const s=P[t].make.call(e,n,...B[t]||[]);s&&N.push(s)}}A&&N.push(A);const G=$s(N),H=qs(G.encode()),_=G.fields;let V=!1;for(let e=0;e<_.length;e+=1)if("head table"===_[e].name){_[e].value.checkSumAdjustment=2981146554-H,V=!0;break}if(!V)throw new Error("Could not find head table with checkSum to adjust.");return G},computeCheckSum:qs};function Qs(e,t){let n=0,s=e.length-1;for(;n<=s;){const 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 Ks(e,t){let n=0,s=e.length-1;for(;n<=s;){const r=n+s>>>1,o=e[r];if(o===t)return r;o<t?n=r+1:s=r-1}return-n-1}function Js(e,t){let n,s=0,r=e.length-1;for(;s<=r;){const o=s+r>>>1;n=e[o];const a=n.start;if(a===t)return n;a<t?s=o+1:r=o-1}if(s>0)return n=e[s-1],t>n.end?0:n}function er(e,t){this.font=e,this.tableName=t}er.prototype={searchTag:Qs,binSearch:Ks,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(e){return e.tag}):[]},getDefaultScriptName:function(){let e=this.getTable();if(!e)return;let t=!1;for(let n=0;n<e.scripts.length;n++){const s=e.scripts[n].tag;if("DFLT"===s)return s;"latn"===s&&(t=!0)}return t?"latn":void 0},getScriptTable:function(e,t){const n=this.getTable(t);if(n){e=e||"DFLT";const s=n.scripts,r=Qs(n.scripts,e);if(r>=0)return s[r].script;if(t){const t={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return s.splice(-1-r,0,t),t.script}}},getLangSysTable:function(e,t,n){const s=this.getScriptTable(e,n);if(s){if(!t||"dflt"===t||"DFLT"===t)return s.defaultLangSys;const e=Qs(s.langSysRecords,t);if(e>=0)return s.langSysRecords[e].langSys;if(n){const n={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return s.langSysRecords.splice(-1-e,0,n),n.langSys}}},getFeatureTable:function(e,t,n,s){const r=this.getLangSysTable(e,t,s);if(r){let e;const t=r.featureIndexes,o=this.font.tables[this.tableName].features;for(let s=0;s<t.length;s++)if(e=o[t[s]],e.tag===n)return e.feature;if(s){const s=o.length;return tt.assert(0===s||n>=o[s-1].tag,"Features must be added in alphabetical order."),e={tag:n,feature:{params:0,lookupListIndexes:[]}},o.push(e),t.push(s),e.feature}}},getLookupTables:function(e,t,n,s,r){const o=this.getFeatureTable(e,t,n,r),a=[];if(o){let e;const t=o.lookupListIndexes,n=this.font.tables[this.tableName].lookups;for(let r=0;r<t.length;r++)e=n[t[r]],e.lookupType===s&&a.push(e);if(0===a.length&&r){e={lookupType:s,lookupFlag:0,subtables:[],markFilteringSet:void 0};const r=n.length;return n.push(e),t.push(r),[e]}}return a},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:{const n=Js(e.ranges,t);return n?n.classId:0}}},getCoverageIndex:function(e,t){switch(e.format){case 1:{const n=Ks(e.glyphs,t);return n>=0?n:-1}case 2:{const n=Js(e.ranges,t);return n?n.index+t-n.start:-1}}},expandCoverage:function(e){if(1===e.format)return e.glyphs;{const t=[],n=e.ranges;for(let e=0;e<n.length;e++){const s=n[e],r=s.start,o=s.end;for(let e=r;e<=o;e++)t.push(e)}return t}}};var tr=er;function nr(e){tr.call(this,e,"gpos")}nr.prototype=tr.prototype,nr.prototype.init=function(){const e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},nr.prototype.getKerningValue=function(e,t,n){for(let s=0;s<e.length;s++){const r=e[s].subtables;for(let e=0;e<r.length;e++){const s=r[e],o=this.getCoverageIndex(s.coverage,t);if(!(o<0))switch(s.posFormat){case 1:{let e=s.pairSets[o];for(let t=0;t<e.length;t++){let s=e[t];if(s.secondGlyph===n)return s.value1&&s.value1.xAdvance||0}break}case 2:{const e=this.getGlyphClass(s.classDef1,t),r=this.getGlyphClass(s.classDef2,n),o=s.classRecords[e][r];return o.value1&&o.value1.xAdvance||0}}}}return 0},nr.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,"kern",2)};var sr=nr;function rr(e,t){const 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 or(e){return 31===e[0]&&139===e[1]&&8===e[2]}function ar(e){return{x:e.x,y:e.y,onCurve:e.onCurve,lastPointOfContour:e.lastPointOfContour}}function ir(e){return{glyphIndex:e.glyphIndex,xScale:e.xScale,scale01:e.scale01,scale10:e.scale10,yScale:e.yScale,dx:e.dx,dy:e.dy}}function lr(e){tr.call(this,e,"gsub")}function ur(e,t,n){const s=e.subtables;for(let e=0;e<s.length;e++){const n=s[e];if(n.substFormat===t)return n}if(n)return s.push(n),n}lr.prototype=tr.prototype,lr.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},lr.prototype.getSingle=function(e,t,n){const s=[],r=this.getLookupTables(t,n,e,1);for(let e=0;e<r.length;e++){const t=r[e].subtables;for(let e=0;e<t.length;e++){const n=t[e],r=this.expandCoverage(n.coverage);let o;if(1===n.substFormat){const e=n.deltaGlyphId;for(o=0;o<r.length;o++){const t=r[o];s.push({sub:t,by:t+e})}}else{const e=n.substitute;for(o=0;o<r.length;o++)s.push({sub:r[o],by:e[o]})}}}return s},lr.prototype.getMultiple=function(e,t,n){const s=[],r=this.getLookupTables(t,n,e,2);for(let e=0;e<r.length;e++){const t=r[e].subtables;for(let e=0;e<t.length;e++){const n=t[e],r=this.expandCoverage(n.coverage);let o;for(o=0;o<r.length;o++){const e=r[o],t=n.sequences[o];s.push({sub:e,by:t})}}}return s},lr.prototype.getAlternates=function(e,t,n){const s=[],r=this.getLookupTables(t,n,e,3);for(let e=0;e<r.length;e++){const t=r[e].subtables;for(let e=0;e<t.length;e++){const n=t[e],r=this.expandCoverage(n.coverage),o=n.alternateSets;for(let e=0;e<r.length;e++)s.push({sub:r[e],by:o[e]})}}return s},lr.prototype.getLigatures=function(e,t,n){const s=[],r=this.getLookupTables(t,n,e,4);for(let e=0;e<r.length;e++){const t=r[e].subtables;for(let e=0;e<t.length;e++){const n=t[e],r=this.expandCoverage(n.coverage),o=n.ligatureSets;for(let e=0;e<r.length;e++){const t=r[e],n=o[e];for(let e=0;e<n.length;e++){const r=n[e];s.push({sub:[t].concat(r.components),by:r.ligGlyph})}}}}return s},lr.prototype.addSingle=function(e,t,n,s){const r=ur(this.getLookupTables(n,s,e,1,!0)[0],2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});tt.assert(1===r.coverage.format,"Single: unable to modify coverage table format "+r.coverage.format);const o=t.sub;let a=this.binSearch(r.coverage.glyphs,o);a<0&&(a=-1-a,r.coverage.glyphs.splice(a,0,o),r.substitute.splice(a,0,0)),r.substitute[a]=t.by},lr.prototype.addMultiple=function(e,t,n,s){tt.assert(t.by instanceof Array&&t.by.length>1,'Multiple: "by" must be an array of two or more ids');const r=ur(this.getLookupTables(n,s,e,2,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});tt.assert(1===r.coverage.format,"Multiple: unable to modify coverage table format "+r.coverage.format);const o=t.sub;let a=this.binSearch(r.coverage.glyphs,o);a<0&&(a=-1-a,r.coverage.glyphs.splice(a,0,o),r.sequences.splice(a,0,0)),r.sequences[a]=t.by},lr.prototype.addAlternate=function(e,t,n,s){const r=ur(this.getLookupTables(n,s,e,3,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});tt.assert(1===r.coverage.format,"Alternate: unable to modify coverage table format "+r.coverage.format);const o=t.sub;let a=this.binSearch(r.coverage.glyphs,o);a<0&&(a=-1-a,r.coverage.glyphs.splice(a,0,o),r.alternateSets.splice(a,0,0)),r.alternateSets[a]=t.by},lr.prototype.addLigature=function(e,t,n,s){const r=this.getLookupTables(n,s,e,4,!0)[0];let o=r.subtables[0];o||(o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},r.subtables[0]=o),tt.assert(1===o.coverage.format,"Ligature: unable to modify coverage table format "+o.coverage.format);const a=t.sub[0],i=t.sub.slice(1),l={ligGlyph:t.by,components:i};let u=this.binSearch(o.coverage.glyphs,a);if(u>=0){const e=o.ligatureSets[u];for(let t=0;t<e.length;t++)if(rr(e[t].components,i))return;e.push(l)}else u=-1-u,o.coverage.glyphs.splice(u,0,a),o.ligatureSets.splice(u,0,[l])},lr.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)}},lr.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"number"==typeof t.by?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 cr=lr,pr=class{constructor(e){this.defaultValue=255,this.font=e}cpal(){return!(!this.font.tables||!this.font.tables.cpal)&&this.font.tables.cpal}getAll(e){const t=[],n=this.cpal();if(!n)return t;for(let s=0;s<n.colorRecordIndices.length;s++){const r=n.colorRecordIndices[s],o=[];for(let t=r;t<r+n.numPaletteEntries;t++)o.push(Dn(n.colorRecords[t],e||"hexa"));t.push(o)}return t}toCPALcolor(e){return Array.isArray(e)?e.map(e=>En(e,"raw")):En(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;const t=this.cpal(),n=t.numPaletteEntries+e,s=this.getAll().map(e=>this.fillPalette(e,[],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 Rn(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`);const o=this.cpal(),a=o.numPaletteEntries;Array.isArray(t)||(t=[t]),t.length+e>a&&(this.extend(t.length+e-a),s=this.getAll("raw"),r=s[n]);for(let n=0;n<t.length;n++)r[n+e]=this.toCPALcolor(t[n]);o.colorRecords=s.flat(),this.updateIndices()}add(e){if(this.ensureCPAL(e))return;const t=this.cpal(),n=t.numPaletteEntries;e&&e.length?((e=this.toCPALcolor(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){const t=this.getAll("raw");delete t[e];const 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");const 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 t=0;t<s.length;t++){const n=s[t].filter((t,n)=>n!==e);r.push(n)}const o=this.font.tables.colr;if(o){const n=o.layerRecords;for(let r=0;r<n.length;r++){const o=n[r].paletteIndex;if(o>e){const e=1;n[r].paletteIndex-=e}else if(o===e){let o=0;for(let n=0;n<s.length;n++)if(t>e&&t<=e+s[n].length){o++;break}n[r].paletteIndex=t-o}}this.font.tables.colr={...o,layerRecords:n}}const a=r.flat();for(let e=0;e<s.length;e++)n.colorRecordIndices[e]-=e;n.numPaletteEntries=Math.max(0,n.numPaletteEntries-1),n.colorRecords=this.toCPALcolor(a)}ensureCPAL(e){return!this.cpal()&&(e=e&&e.length?this.toCPALcolor(e):[this.defaultValue],this.font.tables.cpal={version:0,numPaletteEntries:e.length,colorRecords:e,colorRecordIndices:[0]},!0)}updateIndices(){const 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)}},hr=class{constructor(e){this.font=e}ensureCOLR(){return this.font.tables.colr||(this.font.tables.colr={version:0,baseGlyphRecords:[],layerRecords:[]}),this.font}get(e){const t=this.font,n=[],s=t.tables.colr,r=t.tables.cpal;if(!s||!r)return n;const o=function(e,t,n){let s=0,r=e.length-1,o=null;for(;s<=r;){const a=Math.floor((s+r)/2),i=e[a],l=i[t];if(l<n)s=a+1;else{if(!(l>n)){o=i;break}r=a-1}}return o}(s.baseGlyphRecords,"glyphID",e);if(!o)return n;const a=o.firstLayerIndex,i=o.numLayers;for(let e=0;e<i;e++){const r=s.layerRecords[a+e];n.push({glyph:t.glyphs.get(r.glyphID),paletteIndex:r.paletteIndex})}return n}add(e,t,n){const s=this.get(e);t=Array.isArray(t)?t:[t],void 0===n||n===1/0||n>s.length?n=s.length:n<0&&(n=s.length+1+n%(s.length+1))>=s.length+1&&(n-=s.length+1);const r=[];for(let e=0;e<n;e++){const t=Number.isInteger(s[e].glyph)?s[e].glyph:s[e].glyph.index;r.push({glyphID:t,paletteIndex:s[e].paletteIndex})}for(const e of t){const t=Number.isInteger(e.glyph)?e.glyph:e.glyph.index;r.push({glyphID:t,paletteIndex:e.paletteIndex})}for(let e=n;e<s.length;e++){const t=Number.isInteger(s[e].glyph)?s[e].glyph:s[e].glyph.index;r.push({glyphID:t,paletteIndex:s[e].paletteIndex})}this.updateColrTable(e,r)}setPaletteIndex(e,t,n){let s=this.get(e);s[t]?(s=s.map((e,s)=>({glyphID:e.glyph.index,paletteIndex:s===t?n:e.paletteIndex})),this.updateColrTable(e,s)):console.error("Invalid layer index")}remove(e,t,n=t){let s=this.get(e);s=s.map(e=>({glyphID:e.glyph.index,paletteIndex:e.paletteIndex})),s.splice(t,n-t+1),this.updateColrTable(e,s)}updateColrTable(e,t){this.ensureCOLR();const n=this.font.tables.colr;let s=function(e,t,n){let s=0,r=e.length-1;for(;s<=r;){const o=Math.floor((s+r)/2),a=e[o];if(a[t]<n)s=o+1;else{if(!(a[t]>n))return o;r=o-1}}return-1}(n.baseGlyphRecords,"glyphID",e);if(-1===s){const t={glyphID:e,firstLayerIndex:n.layerRecords.length,numLayers:0};s=function(e,t,n){let s=0,r=e.length;const o=(e,n)=>e[t]-n[t];for(;s<r;){const t=s+r>>>1;o(e[t],n)<0?s=t+1:r=t}return e.splice(s,0,n),s}(n.baseGlyphRecords,"glyphID",t)}const r=n.baseGlyphRecords[s],o=r.numLayers,a=t.length,i=a-o;if(i>0){const e=t.slice(o).map(e=>({glyphID:e.glyphID,paletteIndex:e.paletteIndex}));n.layerRecords.splice(r.firstLayerIndex+o,0,...e)}else i<0&&n.layerRecords.splice(r.firstLayerIndex+a,-i);for(let e=0;e<Math.min(o,a);e++)n.layerRecords[r.firstLayerIndex+e]={glyphID:t[e].glyphID,paletteIndex:t[e].paletteIndex};if(r.numLayers=a,0!==i)for(let e=0;e<n.baseGlyphRecords.length;e++){const t=n.baseGlyphRecords[e];e===s||t.firstLayerIndex<r.firstLayerIndex||(n.baseGlyphRecords[e].firstLayerIndex+=i)}}},fr=class{constructor(e){this.font=e,this.cache=new WeakMap}get(e){const t=this.getOrCreateSvgImageCacheEntry(e);return t&&t.image}getAsync(e){const t=this.getOrCreateSvgImageCacheEntry(e);return t&&t.promise}getOrCreateSvgImageCacheEntry(e){const t=this.font.tables.svg;if(void 0===t)return;const n=t.get(e);if(void 0===n)return;let s=this.cache.get(n);void 0===s&&(s=function(e){return{template:dr(e).then(gr),images:new Map}}(n),this.cache.set(n,s));let r=s.images.get(e);return void 0===r&&(r=function(e,t,n){return{promise:t.then(t=>{let s;"string"==typeof t?s=t:(t[4]=n,s=t.join(""));const r=function(e,t){const n=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement,s=n.viewBox.baseVal,r=n.width.baseVal,o=n.height.baseVal;let a=1,i=1;s.width>0&&s.height>0&&(1===r.unitType?(a=r.valueInSpecifiedUnits/s.width,i=1===o.unitType?o.valueInSpecifiedUnits/s.height:a):1===o.unitType?(i=o.valueInSpecifiedUnits/s.height,a=i):t&&(a=t/s.width,i=t/s.height));const l=document.createElement("div");l.style.position="fixed",l.style.visibility="hidden",l.appendChild(n),document.body.appendChild(l);const u=n.getBBox();document.body.removeChild(l);const c=(u.x-s.x)*a,p=(s.y-u.y)*i,h=u.width*a,f=u.height*i;n.setAttribute("viewBox",[u.x,u.y,u.width,u.height].join(" ")),1!==a&&n.setAttribute("width",h);1!==i&&n.setAttribute("height",f);const d=new Image(h,f);return d.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n.outerHTML),{leftSideBearing:c,baseline:p,image:d}}(s,e.unitsPerEm);return r.image.decode().then(()=>r)}),image:void 0}}(this.font,s.template,e),r.promise.then(t=>{if(r.image=t,"function"==typeof this.font.onGlyphUpdated)try{this.font.onGlyphUpdated(e)}catch(t){console.error("font.onGlyphUpdated",e,t)}}),s.images.set(e,r)),r}};var dr="function"==typeof DecompressionStream?function(e){if(or(e))return new Response(new Response(e).body.pipeThrough(new DecompressionStream("gzip"))).text();try{return Promise.resolve((new TextDecoder).decode(e))}catch(e){return Promise.reject(e)}}:function(e){try{return Promise.resolve((new TextDecoder).decode(or(e)?function(e){const t=new DataView(e.buffer,e.byteOffset,e.byteLength);let n=10;const s=e.byteLength-8,r=t.getInt8(3);if(4&r&&(n+=2+t.getUint16(n,!0)),8&r)for(;n<s&&0!==e[n++];);if(16&r)for(;n<s&&0!==e[n++];);if(2&r&&(n+=2),n>=s)throw new Error("Can't find compressed blocks");const o=t.getUint32(t.byteLength-4,!0);return je(e.subarray(n,s),new Uint8Array(o))}(e):e))}catch(e){return Promise.reject(e)}};function gr(e){const t=e.indexOf("<svg"),n=e.indexOf(">",t+4)+1;if(/ id=['"]glyph\d+['"]/.test(e.substring(t,n)))return e;const s=e.lastIndexOf("</svg>");return[e.substring(0,n),"<defs>",e.substring(n,s),'</defs><use href="#glyph',"",'"/>',e.substring(s)]}function mr(e,t,n,s,r){let o;return(t&s)>0?(o=e.parseByte(),0===(t&r)&&(o=-o),o=n+o):o=(t&r)>0?n:n+e.parseShort(),o}function yr(e,t,n){const s=new Xt.Parser(t,n);let r,o;if(e._numberOfContours=s.parseShort(),e._xMin=s.parseShort(),e._yMin=s.parseShort(),e._xMax=s.parseShort(),e._yMax=s.parseShort(),e._numberOfContours>0){const t=e.endPointIndices=[];for(let n=0;n<e._numberOfContours;n+=1)t.push(s.parseUShort());e.instructionLength=s.parseUShort(),e.instructions=[];for(let t=0;t<e.instructionLength;t+=1)e.instructions.push(s.parseByte());const n=t[t.length-1]+1;r=[];for(let e=0;e<n;e+=1)if(o=s.parseByte(),r.push(o),(8&o)>0){const t=s.parseByte();for(let n=0;n<t;n+=1)r.push(o),e+=1}if(tt.argument(r.length===n,"Bad flags."),t.length>0){const a=[];let i;if(n>0){for(let e=0;e<n;e+=1)o=r[e],i={},i.onCurve=!!(1&o),i.lastPointOfContour=t.indexOf(e)>=0,a.push(i);let e=0;for(let t=0;t<n;t+=1)o=r[t],i=a[t],i.x=mr(s,o,e,2,16),e=i.x;let l=0;for(let e=0;e<n;e+=1)o=r[e],i=a[e],i.y=mr(s,o,l,4,32),l=i.y}e.points=a}else e.points=[]}else if(0===e.numberOfContours)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];let t=!0;for(;t;){r=s.parseUShort();const n={glyphIndex:s.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(1&r)>0?(2&r)>0?(n.dx=s.parseShort(),n.dy=s.parseShort()):n.matchedPoints=[s.parseUShort(),s.parseUShort()]:(2&r)>0?(n.dx=s.parseChar(),n.dy=s.parseChar()):n.matchedPoints=[s.parseByte(),s.parseByte()],(8&r)>0?n.xScale=n.yScale=s.parseF2Dot14():(64&r)>0?(n.xScale=s.parseF2Dot14(),n.yScale=s.parseF2Dot14()):(128&r)>0&&(n.xScale=s.parseF2Dot14(),n.scale01=s.parseF2Dot14(),n.scale10=s.parseF2Dot14(),n.yScale=s.parseF2Dot14()),e.components.push(n),t=!!(32&r)}if(256&r){e.instructionLength=s.parseUShort(),e.instructions=[];for(let t=0;t<e.instructionLength;t+=1)e.instructions.push(s.parseByte())}}}function vr(e,t){const n=[];for(let s=0;s<e.length;s+=1){const 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 br(e){const t=new Ke;if(!e)return t;const n=function(e){const t=[];let n=[];for(let s=0;s<e.length;s+=1){const r=e[s];n.push(r),r.lastPointOfContour&&(t.push(n),n=[])}return tt.argument(0===n.length,"There are still points left in the current contour."),t}(e);for(let e=0;e<n.length;++e){const s=n[e];let r=s[s.length-1],o=s[0];if(r.onCurve)t.moveTo(r.x,r.y);else if(o.onCurve)t.moveTo(o.x,o.y);else{const e={x:.5*(r.x+o.x),y:.5*(r.y+o.y)};t.moveTo(e.x,e.y)}for(let e=0;e<s.length;++e)if(r=o,o=s[(e+1)%s.length],r.onCurve)t.lineTo(r.x,r.y);else{let e=o;o.onCurve||(e={x:.5*(r.x+o.x),y:.5*(r.y+o.y)}),t.quadraticCurveTo(r.x,r.y,e.x,e.y)}t.closePath()}return t}function Sr(e,t){if(t.isComposite)for(let n=0;n<t.components.length;n+=1){const s=t.components[n],r=e.get(s.glyphIndex);if(r.getPath(),r.points){let e;if(void 0===s.matchedPoints)e=vr(r.points,s);else{if(s.matchedPoints[0]>t.points.length-1||s.matchedPoints[1]>r.points.length-1)throw Error("Matched points out of range in "+t.name);const n=t.points[s.matchedPoints[0]];let o=r.points[s.matchedPoints[1]];const a={xScale:s.xScale,scale01:s.scale01,scale10:s.scale10,yScale:s.yScale,dx:0,dy:0};o=vr([o],a)[0],a.dx=n.x-o.x,a.dy=n.y-o.y,e=vr(r.points,a)}t.points=t.points.concat(e)}}return br(t.points)}var xr,Tr,Or,kr,wr={getPath:br,parse:function(e,t,n,s,r){return r.lowMemory?function(e,t,n,s){const r=new Bn.GlyphSet(s);return s._push=function(o){const a=n[o];a!==n[o+1]?r.push(o,Bn.ttfGlyphLoader(s,o,yr,e,t+a,Sr)):r.push(o,Bn.glyphLoader(s,o))},r}(e,t,n,s):function(e,t,n,s){const r=new Bn.GlyphSet(s);for(let o=0;o<n.length-1;o+=1){const a=n[o];a!==n[o+1]?r.push(o,Bn.ttfGlyphLoader(s,o,yr,e,t+a,Sr)):r.push(o,Bn.glyphLoader(s,o))}return r}(e,t,n,s)}},Ir=class{constructor(e){this.font=e}normalizeCoordTags(e){for(const t in e)if(t.length<4){const n=t.padEnd(4," ");void 0===e[n]&&(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++){const s=this.fvar().axes[n];let r=e[s.tag];void 0===r&&(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 e=0;e<this.avar().axisSegmentMaps.length;e++){let n=this.avar().axisSegmentMaps[e];for(let s=0;s<n.axisValueMaps.length;s++){let r=n.axisValueMaps[s];if(s>=1&&t[e]<r.fromCoordinate){let o=n.axisValueMaps[s-1];t[e]=((t[e]-o.fromCoordinate)*(r.toCoordinate-o.toCoordinate)+Number.EPSILON)/(r.fromCoordinate-o.fromCoordinate+Number.EPSILON)+o.toCoordinate;break}}}return t}interpolatePoints(e,t,n){if(0===e.length)return;let s=0;for(;s<e.length;){let r=s,o=s,a=e[o];for(;!a.lastPointOfContour;)a=e[++o];for(;s<=o&&!n[s];)s++;if(s>o)continue;let i=s,l=s;for(s++;s<=o;)n[s]&&(this.deltaInterpolate(l+1,s-1,l,s,t,e),l=s),s++;l===i?this.deltaShift(r,o,l,t,e):(this.deltaInterpolate(l+1,o,l,i,t,e),i>0&&this.deltaInterpolate(r,i-1,l,i,t,e)),s=o+1}}deltaInterpolate(e,t,n,s,r,o){if(e>t)return;let a=["x","y"];for(let l=0;l<a.length;l++){let u=a[l];if(r[n][u]>r[s][u]){var i=n;n=s,s=i}let c=r[n][u],p=r[s][u],h=o[n][u],f=o[s][u];if(c!==p||h===f){let n=c===p?0:(f-h)/(p-c);for(let s=e;s<=t;s++){let e=r[s][u];e<=c?e+=h-c:e>=p?e+=f-p:e=h+(e-c)*n,o[s][u]=e}}}}deltaShift(e,t,n,s,r){let o=r[n].x-s[n].x,a=r[n].y-s[n].y;if(0!==o||0!==a)for(let s=e;s<=t;s++)s!==n&&(r[s].x+=o,r[s].y+=a)}transformComponents(e,t,n,s,r,o){let a=0;for(let i=0;i<e.components.length;i++){const l=e.components[i],u=this.font.glyphs.get(l.glyphIndex),c=ir(l),p=s.indexOf(i);p>-1&&(c.dx+=Math.round(r.deltas[p]*o),c.dy+=Math.round(r.deltasY[p]*o));const h=vr(this.getTransform(u,n).points,c);t.splice(a,h.length,...h),a+=u.points.length}}applyTupleVariationStore(e,t,n,s="gvar",r={}){n||(n=this.font.variation.get());const o=this.getNormalizedCoords(n),{headers:a,sharedPoints:i}=e,l=this.fvar().axes.length;let u;"gvar"===s?u=t.map(ar):"cvar"===s&&(u=[...t]);for(let e=0;e<a.length;e++){const c=a[e];let p=1;for(let e=0;e<l;e++){let t=[0];switch(s){case"gvar":t=c.peakTuple?c.peakTuple:this.gvar().sharedTuples[c.sharedTupleRecordsIndex];break;case"cvar":t=c.peakTuple}if(0!==t[e]){if(0===o[e]){p=0;break}if(c.intermediateStartTuple){if(o[e]<c.intermediateStartTuple[e]||o[e]>c.intermediateEndTuple[e]){p=0;break}p=o[e]<t[e]?p*(o[e]-c.intermediateStartTuple[e]+Number.EPSILON)/(t[e]-c.intermediateStartTuple[e]+Number.EPSILON):p*(c.intermediateEndTuple[e]-o[e]+Number.EPSILON)/(c.intermediateEndTuple[e]-t[e]+Number.EPSILON)}else{if(o[e]<Math.min(0,t[e])||o[e]>Math.max(0,t[e])){p=0;break}p=(p*o[e]+Number.EPSILON)/(t[e]+Number.EPSILON)}}}if(0===p)continue;const h=c.privatePoints.length?c.privatePoints:i;if("gvar"===s&&r.glyph&&r.glyph.isComposite)this.transformComponents(r.glyph,u,n,h,c,p);else if(0===h.length)for(let e=0;e<u.length;e++){const t=u[e];"gvar"===s?u[e]={x:Math.round(t.x+c.deltas[e]*p),y:Math.round(t.y+c.deltasY[e]*p),onCurve:t.onCurve,lastPointOfContour:t.lastPointOfContour}:"cvar"===s&&(u[e]=Math.round(t+c.deltas[e]*p))}else{let e;"gvar"===s?e=u.map(ar):"cvar"===s&&(e=u);const n=Array(t.length).fill(!1);for(let r=0;r<h.length;r++){let o=h[r];if(o<t.length){let t=e[o];"gvar"===s?(n[o]=!0,t.x+=c.deltas[r]*p,t.y+=c.deltasY[r]*p):"cvar"===s&&(u[o]=Math.round(t+c.deltas[r]*p))}}if("gvar"===s){this.interpolatePoints(e,u,n);for(let n=0;n<t.length;n++){let t=e[n].x-u[n].x,s=e[n].y-u[n].y;u[n].x=Math.round(u[n].x+t),u[n].y=Math.round(u[n].y+s)}}}}return u}getTransform(e,t){Number.isInteger(e)&&(e=this.font.glyphs.get(e));const n=e.getBlendPath,s=!(!e.points||!e.points.length);let r=e;if(n||s)if(t||(t=this.font.variation.get()),s){const n=this.gvar()&&this.gvar().glyphVariations[e.index];if(n){const s=e.points;let o=this.applyTupleVariationStore(n,s,t,"gvar",{glyph:e});r=new An(Object.assign({},e,{points:o,path:br(o)}))}}else if(n){const n=e.getBlendPath(t);r=new An(Object.assign({},e,{path:n}))}return this.font.tables.hvar&&(e._advanceWidth=void 0!==e._advanceWidth?e._advanceWidth:e.advanceWidth,e.advanceWidth=r.advanceWidth=Math.round(e._advanceWidth+this.getVariableAdjustment(r.index,"hvar","advanceWidth",t)),e._leftSideBearing=void 0!==e._leftSideBearing?e._leftSideBearing:e.leftSideBearing,e.leftSideBearing=r.leftSideBearing=Math.round(e._leftSideBearing+this.getVariableAdjustment(r.index,"hvar","lsb",t))),r}getCvarTransform(e){const t=this.font.tables.cvt,n=this.cvar();return t&&t.length&&n&&n.headers.length?this.applyTupleVariationStore(n,t,e,"cvar"):t}getVariableAdjustment(e,t,n,s){let r,o;s=s||this.font.variation.get();const a=this.font.tables[t];if(!a)throw Error(`trying to get variation adjustment from non-existent table "${a}"`);if(!a.itemVariationStore)throw Error(`trying to get variation adjustment from table "${a}" which does not have an itemVariationStore`);const i=a[n]&&a[n].map.length;if(i){let t=e;t>=i&&(t=i-1),({outerIndex:r,innerIndex:o}=a[n].map[t])}else r=0,o=e;return this.getDelta(a.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],a=this.getBlendVector(e,t,s),i=0;for(let e=0;e<r.regionIndexes.length;e++)i+=o[e]*a[e];return i}getBlendVector(e,t,n){n||(n=this.font.variation.get());let s=e.itemVariationSubtables[t];const r=this.getNormalizedCoords(n);let o=[];for(let t=0;t<s.regionIndexes.length;t++){let n=1,a=s.regionIndexes[t],i=e.variationRegions[a].regionAxes;for(let e=0;e<i.length;e++){let t,s=i[e];t=s.startCoord>s.peakCoord||s.peakCoord>s.endCoord||s.startCoord<0&&s.endCoord>0&&0!==s.peakCoord||0===s.peakCoord?1:r[e]<s.startCoord||r[e]>s.endCoord?0:r[e]===s.peakCoord?1:r[e]<s.peakCoord?(r[e]-s.startCoord+Number.EPSILON)/(s.peakCoord-s.startCoord+Number.EPSILON):(s.endCoord-r[e]+Number.EPSILON)/(s.endCoord-s.peakCoord+Number.EPSILON),n*=t}o[t]=n}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}},Ur=class{constructor(e){this.font=e,this.process=new Ir(this.font),this.activateDefaultVariation(),this.getTransform=this.process.getTransform.bind(this.process)}activateDefaultVariation(){const 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(){const e=this.getDefaultCoordinates();let t=this.getInstanceIndex(e);return t<0&&(t=this.fvar().instances.findIndex(e=>e.name&&"Regular"===e.name.en)),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)){const 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}};function Rr(e){this.font=e,this.getCommands=function(e){return wr.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Lr(e){return e}function Cr(e){return Math.sign(e)*Math.round(Math.abs(e))}function Er(e){return Math.sign(e)*Math.round(Math.abs(2*e))/2}function Dr(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function Mr(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function Fr(e){return Math.sign(e)*Math.floor(Math.abs(e))}var Ar=function(e){const t=this.srPeriod;let n=this.srPhase;let s=1;return e<0&&(e=-e,s=-1),e+=this.srThreshold-n,e=Math.trunc(e/t)*t,(e+=n)<0?n*s:e*s},Nr={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,a,i,l,u,c;if(!s||s===this)return r=e.xo-t.xo,o=e.xo-n.xo,l=t.x-t.xo,u=n.x-n.xo,a=Math.abs(r),i=Math.abs(o),c=a+i,0===c?void(e.x=e.xo+(l+u)/2):void(e.x=e.xo+(l*i+u*a)/c);r=s.distance(e,t,!0,!0),o=s.distance(e,n,!0,!0),l=s.distance(t,t,!1,!0),u=s.distance(n,n,!1,!0),a=Math.abs(r),i=Math.abs(o),c=a+i,0!==c?Nr.setRelative(e,e,(l*i+u*a)/c,s,!0):Nr.setRelative(e,e,(l+u)/2,s,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,n,s,r){if(!s||s===this)return void(e.x=(r?t.xo:t.x)+n);const o=r?t.xo:t.x,a=r?t.yo:t.y,i=o+n*s.x,l=a+n*s.y;e.x=i+(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}},Pr={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,a,i,l,u,c;if(!s||s===this)return r=e.yo-t.yo,o=e.yo-n.yo,l=t.y-t.yo,u=n.y-n.yo,a=Math.abs(r),i=Math.abs(o),c=a+i,0===c?void(e.y=e.yo+(l+u)/2):void(e.y=e.yo+(l*i+u*a)/c);r=s.distance(e,t,!0,!0),o=s.distance(e,n,!0,!0),l=s.distance(t,t,!1,!0),u=s.distance(n,n,!1,!0),a=Math.abs(r),i=Math.abs(o),c=a+i,0!==c?Pr.setRelative(e,e,(l*i+u*a)/c,s,!0):Pr.setRelative(e,e,(l+u)/2,s,!0)},normalSlope:0,setRelative:function(e,t,n,s,r){if(!s||s===this)return void(e.y=(r?t.yo:t.y)+n);const o=r?t.xo:t.x,a=r?t.yo:t.y,i=o+n*s.x,l=a+n*s.y;e.y=l+s.normalSlope*(e.x-i)},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};function Br(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}function Gr(e,t){const n=Math.sqrt(e*e+t*t);return t/=n,1===(e/=n)&&0===t?Nr:0===e&&1===t?Pr:new Br(e,t)}function Hr(e,t,n,s){this.x=this.xo=Math.round(64*e)/64,this.y=this.yo=Math.round(64*t)/64,this.lastPointOfContour=n,this.onCurve=s,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Object.freeze(Nr),Object.freeze(Pr),Br.prototype.distance=function(e,t,n,s){return this.x*Nr.distance(e,t,n,s)+this.y*Pr.distance(e,t,n,s)},Br.prototype.interpolate=function(e,t,n,s){let r,o,a,i,l,u,c;a=s.distance(e,t,!0,!0),i=s.distance(e,n,!0,!0),r=s.distance(t,t,!1,!0),o=s.distance(n,n,!1,!0),l=Math.abs(a),u=Math.abs(i),c=l+u,0!==c?this.setRelative(e,e,(r*u+o*l)/c,s,!0):this.setRelative(e,e,(r+o)/2,s,!0)},Br.prototype.setRelative=function(e,t,n,s,r){s=s||this;const o=r?t.xo:t.x,a=r?t.yo:t.y,i=o+n*s.x,l=a+n*s.y,u=s.normalSlope,c=this.slope,p=e.x,h=e.y;e.x=(c*p-u*i+l-h)/(c-u),e.y=c*(e.x-p)+h},Br.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0},Hr.prototype.nextTouched=function(e){let t=this.nextPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},Hr.prototype.prevTouched=function(e){let t=this.prevPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var _r=Object.freeze(new Hr(0,0)),Vr={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function zr(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=Nr,this.round=Cr}}function jr(e){const t=e.tZone=new Array(e.gZone.length);for(let e=0;e<t.length;e++)t[e]=new Hr(0,0)}function qr(e,t){const n=e.prog;let s,r=e.ip,o=1;do{if(s=n[++r],88===s)o++;else if(89===s)o--;else if(64===s)r+=n[r+1]+1;else if(65===s)r+=2*n[r+1]+1;else if(s>=176&&s<=183)r+=s-176+1;else if(s>=184&&s<=191)r+=2*(s-184+1);else if(t&&1===o&&27===s)break}while(o>0);e.ip=r}function Wr(e,t){t.fv=t.pv=t.dpv=e}function $r(e,t){t.pv=t.dpv=e}function Xr(e,t){t.fv=e}function Yr(e,t){const n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],a=t.z1[r];let i,l;e?(i=o.y-a.y,l=a.x-o.x):(i=a.x-o.x,l=a.y-o.y),t.pv=t.dpv=Gr(i,l)}function Zr(e,t){const n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],a=t.z1[r];let i,l;e?(i=o.y-a.y,l=a.x-o.x):(i=a.x-o.x,l=a.y-o.y),t.fv=Gr(i,l)}function Qr(e){e.stack.pop()}function Kr(e,t){const n=t.stack.pop(),s=t.z0[n],r=t.fv,o=t.pv;let a=o.distance(s,_r);e&&(a=t.round(a)),r.setRelative(s,_r,a,o),r.touch(s),t.rp0=t.rp1=n}function Jr(e,t){const n=t.z2,s=n.length-2;let r,o,a;for(let t=0;t<s;t++)r=n[t],e.touched(r)||(o=r.prevTouched(e),o!==r&&(a=r.nextTouched(e),o===a&&e.setRelative(r,r,e.distance(o,o,!1,!0),e,!0),e.interpolate(r,o,a,e)))}function eo(e,t){const n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,a=t.pv;let i=t.loop;const l=t.z2;for(;i--;){const e=l[n.pop()],t=a.distance(r,r,!1,!0);o.setRelative(e,e,t,a),o.touch(e)}t.loop=1}function to(e,t){const n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,a=t.pv,i=n.pop(),l=t.z2[t.contours[i]];let u=l;const c=a.distance(r,r,!1,!0);do{u!==r&&o.setRelative(u,u,c,a),u=u.nextPointOnContour}while(u!==l)}function no(e,t){const n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,a=t.pv;let i,l;switch(n.pop()){case 0:i=t.tZone;break;case 1:i=t.gZone;break;default:throw new Error("Invalid zone")}const u=a.distance(r,r,!1,!0),c=i.length-2;for(let e=0;e<c;e++)l=i[e],o.setRelative(l,l,u,a)}function so(e,t){const n=t.stack,s=n.pop()/64,r=n.pop(),o=t.z1[r],a=t.z0[t.rp0],i=t.fv,l=t.pv;i.setRelative(o,a,s,l),i.touch(o),t.rp1=t.rp0,t.rp2=r,e&&(t.rp0=r)}function ro(e,t){const n=t.stack,s=n.pop(),r=n.pop(),o=t.z0[r],a=t.fv,i=t.pv;let l=t.cvt[s];let u=i.distance(o,_r);e&&(Math.abs(u-l)<t.cvCutIn&&(u=l),u=t.round(u)),a.setRelative(o,_r,u,i),0===t.zp0&&(o.xo=o.x,o.yo=o.y),a.touch(o),t.rp0=t.rp1=r}function oo(e,t){const n=t.stack,s=n.pop(),r=t.z2[s];n.push(64*t.dpv.distance(r,_r,e,!1))}function ao(e,t){const n=t.stack,s=n.pop(),r=n.pop(),o=t.z1[s],a=t.z0[r],i=t.dpv.distance(a,o,e,e);t.stack.push(Math.round(64*i))}function io(e,t){const n=t.stack,s=n.pop(),r=t.fv,o=t.pv,a=t.ppem,i=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;for(let e=0;e<s;e++){const e=n.pop(),t=n.pop();if(i+((240&t)>>4)!==a)continue;let s=(15&t)-8;s>=0&&s++;const c=u[e];r.setRelative(c,c,s*l,o)}}function lo(e,t){const n=t.stack,s=n.pop();n.push(64*t.round(s/64))}function uo(e,t){const n=t.stack,s=n.pop(),r=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;for(let e=0;e<s;e++){const e=n.pop(),s=n.pop();if(o+((240&s)>>4)!==r)continue;let i=(15&s)-8;i>=0&&i++;const l=i*a;0,t.cvt[e]+=l}}function co(e,t){const n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],a=t.z1[r];let i,l;e?(i=o.y-a.y,l=a.x-o.x):(i=a.x-o.x,l=a.y-o.y),t.dpv=Gr(i,l)}function po(e,t){const n=t.stack,s=t.prog;let r=t.ip;for(let t=0;t<e;t++)n.push(s[++r]);t.ip=r}function ho(e,t){let n=t.ip;const s=t.prog,r=t.stack;for(let t=0;t<e;t++){let e=s[++n]<<8|s[++n];32768&e&&(e=-(1+(65535^e))),r.push(e)}t.ip=n}function fo(e,t,n,s,r,o){const a=o.stack,i=e&&a.pop(),l=a.pop(),u=o.rp0,c=o.z0[u],p=o.z1[l],h=o.minDis,f=o.fv,d=o.dpv;let g,m,y,v;m=g=d.distance(p,c,!0,!0),y=m>=0?1:-1,m=Math.abs(m),e&&(v=o.cvt[i],s&&Math.abs(m-v)<o.cvCutIn&&(m=v)),n&&m<h&&(m=h),s&&(m=o.round(m)),f.setRelative(p,c,y*m,d),f.touch(p),o.rp1=o.rp0,o.rp2=l,t&&(o.rp0=l)}Rr.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(this._errorState>2)return;const n=this.font;let s=this._prepState;if(!s||s.ppem!==t){let e=this._fpgmState;if(!e){zr.prototype=Vr,e=this._fpgmState=new zr("fpgm",n.tables.fpgm),e.funcs=[],e.font=n;try{Tr(e)}catch(e){return console.log("Hinting error in FPGM:"+e),void(this._errorState=3)}}zr.prototype=e,s=this._prepState=new zr("prep",n.tables.prep),s.ppem=t;const r=n.variation&&n.variation.process.getCvarTransform()||n.tables.cvt;if(r){const e=s.cvt=new Array(r.length),o=t/n.unitsPerEm;for(let t=0;t<r.length;t++)e[t]=r[t]*o}else s.cvt=[];0;try{Tr(s)}catch(e){this._errorState<2&&console.log("Hinting error in PREP:"+e),this._errorState=2}}if(!(this._errorState>1))try{return Or(e,s)}catch(e){return this._errorState<1&&(console.log("Hinting error:"+e),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}},Or=function(e,t){const n=t.ppem/t.font.unitsPerEm,s=n;let r,o,a,i=e.components;if(zr.prototype=t,i){const l=t.font;o=[],r=[];for(let e=0;e<i.length;e++){const t=i[e],u=l.glyphs.get(t.glyphIndex);a=new zr("glyf",u.instructions),kr(u,a,n,s);const c=Math.round(t.dx*n),p=Math.round(t.dy*s),h=a.gZone,f=a.contours;for(let e=0;e<h.length;e++){const t=h[e];t.xTouched=t.yTouched=!1,t.xo=t.x=t.x+c,t.yo=t.y=t.y+p}const d=o.length;o.push.apply(o,h);for(let e=0;e<f.length;e++)r.push(f[e]+d)}e.instructions&&!a.inhibitGridFit&&(a=new zr("glyf",e.instructions),a.gZone=a.z0=a.z1=a.z2=o,a.contours=r,o.push(new Hr(0,0),new Hr(Math.round(e.advanceWidth*n),0)),Tr(a),o.length-=2)}else a=new zr("glyf",e.instructions),kr(e,a,n,s),o=a.gZone;return o},kr=function(e,t,n,s){const r=e.points||[],o=r.length,a=t.gZone=t.z0=t.z1=t.z2=[],i=t.contours=[];let l,u,c;for(let e=0;e<o;e++)l=r[e],a[e]=new Hr(l.x*n,l.y*s,l.lastPointOfContour,l.onCurve);for(let e=0;e<o;e++)l=a[e],u||(u=l,i.push(e)),l.lastPointOfContour?(l.nextPointOnContour=u,u.prevPointOnContour=l,u=void 0):(c=a[e+1],l.nextPointOnContour=c,c.prevPointOnContour=l);t.inhibitGridFit||(a.push(new Hr(0,0),new Hr(Math.round(e.advanceWidth*n),0)),Tr(t),a.length-=2)},Tr=function(e){let t=e.prog;if(!t)return;const n=t.length;let s;for(e.ip=0;e.ip<n;e.ip++){if(s=xr[t[e.ip]],!s)throw new Error("unknown instruction: 0x"+Number(t[e.ip]).toString(16));s(e)}},xr=[Wr.bind(void 0,Pr),Wr.bind(void 0,Nr),$r.bind(void 0,Pr),$r.bind(void 0,Nr),Xr.bind(void 0,Pr),Xr.bind(void 0,Nr),Yr.bind(void 0,0),Yr.bind(void 0,1),Zr.bind(void 0,0),Zr.bind(void 0,1),function(e){const t=e.stack,n=t.pop(),s=t.pop();e.pv=e.dpv=Gr(s,n)},function(e){const t=e.stack,n=t.pop(),s=t.pop();e.fv=Gr(s,n)},function(e){const t=e.stack,n=e.pv;t.push(16384*n.x),t.push(16384*n.y)},function(e){const t=e.stack,n=e.fv;t.push(16384*n.x),t.push(16384*n.y)},function(e){e.fv=e.pv},function(e){const t=e.stack,n=t.pop(),s=t.pop(),r=t.pop(),o=t.pop(),a=t.pop(),i=e.z0,l=e.z1,u=i[n],c=i[s],p=l[r],h=l[o],f=e.z2[a],d=u.x,g=u.y,m=c.x,y=c.y,v=p.x,b=p.y,S=h.x,x=h.y,T=(d-m)*(b-x)-(g-y)*(v-S),O=d*y-g*m,k=v*x-b*S;f.x=(O*(v-S)-k*(d-m))/T,f.y=(O*(b-x)-k*(g-y))/T},function(e){e.rp0=e.stack.pop()},function(e){e.rp1=e.stack.pop()},function(e){e.rp2=e.stack.pop()},function(e){const t=e.stack.pop();switch(e.zp0=t,t){case 0:e.tZone||jr(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){const t=e.stack.pop();switch(e.zp1=t,t){case 0:e.tZone||jr(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){const t=e.stack.pop();switch(e.zp2=t,t){case 0:e.tZone||jr(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){const t=e.stack.pop();switch(e.zp0=e.zp1=e.zp2=t,t){case 0:e.tZone||jr(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(e){e.loop=e.stack.pop()},function(e){e.round=Cr},function(e){e.round=Dr},function(e){const t=e.stack.pop();e.minDis=t/64},function(e){qr(e,!1)},function(e){const t=e.stack.pop();e.ip+=t-1},function(e){const t=e.stack.pop();e.cvCutIn=t/64},void 0,void 0,function(e){const t=e.stack;t.push(t[t.length-1])},Qr,function(e){e.stack.length=0},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(n),t.push(s)},function(e){const t=e.stack;t.push(t.length)},function(e){const t=e.stack,n=t.pop();t.push(t[t.length-n])},function(e){const t=e.stack,n=t.pop();t.push(t.splice(t.length-n,1)[0])},void 0,void 0,void 0,function(e){const t=e.stack,n=t.pop(),s=t.pop(),r=e.ip,o=e.prog;e.prog=e.funcs[n];for(let t=0;t<s;t++)Tr(e);e.ip=r,e.prog=o},function(e){const t=e.stack.pop(),n=e.ip,s=e.prog;e.prog=e.funcs[t],Tr(e),e.ip=n,e.prog=s},function(e){if("fpgm"!==e.env)throw new Error("FDEF not allowed here");const t=e.stack,n=e.prog;let s=e.ip;const r=t.pop(),o=s;for(0;45!==n[++s];);e.ip=s,e.funcs[r]=n.slice(o+1,s)},void 0,Kr.bind(void 0,0),Kr.bind(void 0,1),Jr.bind(void 0,Pr),Jr.bind(void 0,Nr),eo.bind(void 0,0),eo.bind(void 0,1),to.bind(void 0,0),to.bind(void 0,1),no.bind(void 0,0),no.bind(void 0,1),function(e){const t=e.stack;let n=e.loop;const s=e.fv,r=t.pop()/64,o=e.z2;for(;n--;){const e=o[t.pop()];0,s.setRelative(e,e,r),s.touch(e)}e.loop=1},function(e){const t=e.stack,n=e.rp1,s=e.rp2;let r=e.loop;const o=e.z0[n],a=e.z1[s],i=e.fv,l=e.dpv,u=e.z2;for(;r--;){const e=u[t.pop()];0,i.interpolate(e,o,a,l),i.touch(e)}e.loop=1},so.bind(void 0,0),so.bind(void 0,1),function(e){const t=e.stack,n=e.rp0,s=e.z0[n];let r=e.loop;const o=e.fv,a=e.pv,i=e.z1;for(;r--;){const e=i[t.pop()];0,o.setRelative(e,s,0,a),o.touch(e)}e.loop=1},function(e){e.round=Er},ro.bind(void 0,0),ro.bind(void 0,1),function(e){const t=e.prog;let n=e.ip;const s=e.stack,r=t[++n];for(let e=0;e<r;e++)s.push(t[++n]);e.ip=n},function(e){let t=e.ip;const n=e.prog,s=e.stack,r=n[++t];for(let e=0;e<r;e++){let e=n[++t]<<8|n[++t];32768&e&&(e=-(1+(65535^e))),s.push(e)}e.ip=t},function(e){const t=e.stack;let n=e.store;n||(n=e.store=[]);const s=t.pop();n[t.pop()]=s},function(e){const t=e.stack,n=e.store,s=t.pop(),r=n&&n[s]||0;t.push(r)},function(e){const t=e.stack,n=t.pop(),s=t.pop();e.cvt[s]=n/64},function(e){const t=e.stack,n=t.pop();t.push(64*e.cvt[n])},oo.bind(void 0,0),oo.bind(void 0,1),void 0,ao.bind(void 0,0),ao.bind(void 0,1),function(e){e.stack.push(e.ppem)},void 0,function(e){e.autoFlip=!0},void 0,void 0,function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s<n?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s<=n?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s>n?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s>=n?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(n===s?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(n!==s?1:0)},function(e){const t=e.stack,n=t.pop();t.push(1&Math.trunc(n)?1:0)},function(e){const t=e.stack,n=t.pop();t.push(1&Math.trunc(n)?0:1)},function(e){e.stack.pop()||qr(e,!0)},function(e){0},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(n&&s?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(n||s?1:0)},function(e){const t=e.stack,n=t.pop();t.push(n?0:1)},io.bind(void 0,1),function(e){const t=e.stack.pop();e.deltaBase=t},function(e){const t=e.stack.pop();e.deltaShift=Math.pow(.5,t)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s+n)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s-n)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(64*s/n)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s*n/64)},function(e){const t=e.stack,n=t.pop();t.push(Math.abs(n))},function(e){const t=e.stack;let n=t.pop();t.push(-n)},function(e){const t=e.stack,n=t.pop();t.push(64*Math.floor(n/64))},function(e){const t=e.stack,n=t.pop();t.push(64*Math.ceil(n/64))},lo.bind(void 0,0),lo.bind(void 0,1),lo.bind(void 0,2),lo.bind(void 0,3),void 0,void 0,void 0,void 0,function(e){const t=e.stack,n=t.pop(),s=t.pop();e.cvt[s]=n*e.ppem/e.font.unitsPerEm},io.bind(void 0,2),io.bind(void 0,3),uo.bind(void 0,1),uo.bind(void 0,2),uo.bind(void 0,3),function(e){let t,n=e.stack.pop();switch(e.round=Ar,192&n){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,48&n){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")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*t},function(e){let t,n=e.stack.pop();switch(e.round=Ar,192&n){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,48&n){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")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*t},void 0,void 0,function(e){e.round=Lr},void 0,function(e){e.round=Mr},function(e){e.round=Fr},Qr,Qr,void 0,void 0,void 0,void 0,void 0,function(e){e.stack.pop()},co.bind(void 0,0),co.bind(void 0,1),function(e){const t=e.stack,n=t.pop();let s=0;1&n&&(s=35),32&n&&(s|=4096),t.push(s)},void 0,function(e){const t=e.stack,n=t.pop(),s=t.pop(),r=t.pop();t.push(s),t.push(n),t.push(r)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(Math.max(s,n))},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(Math.min(s,n))},function(e){e.stack.pop()},function(e){const t=e.stack.pop();let n=e.stack.pop();switch(t){case 1:return void(e.inhibitGridFit=!!n);case 2:return void(e.ignoreCvt=!!n);default:throw new Error("invalid INSTCTRL[] selector")}},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,po.bind(void 0,1),po.bind(void 0,2),po.bind(void 0,3),po.bind(void 0,4),po.bind(void 0,5),po.bind(void 0,6),po.bind(void 0,7),po.bind(void 0,8),ho.bind(void 0,1),ho.bind(void 0,2),ho.bind(void 0,3),ho.bind(void 0,4),ho.bind(void 0,5),ho.bind(void 0,6),ho.bind(void 0,7),ho.bind(void 0,8),fo.bind(void 0,0,0,0,0,0),fo.bind(void 0,0,0,0,0,1),fo.bind(void 0,0,0,0,0,2),fo.bind(void 0,0,0,0,0,3),fo.bind(void 0,0,0,0,1,0),fo.bind(void 0,0,0,0,1,1),fo.bind(void 0,0,0,0,1,2),fo.bind(void 0,0,0,0,1,3),fo.bind(void 0,0,0,1,0,0),fo.bind(void 0,0,0,1,0,1),fo.bind(void 0,0,0,1,0,2),fo.bind(void 0,0,0,1,0,3),fo.bind(void 0,0,0,1,1,0),fo.bind(void 0,0,0,1,1,1),fo.bind(void 0,0,0,1,1,2),fo.bind(void 0,0,0,1,1,3),fo.bind(void 0,0,1,0,0,0),fo.bind(void 0,0,1,0,0,1),fo.bind(void 0,0,1,0,0,2),fo.bind(void 0,0,1,0,0,3),fo.bind(void 0,0,1,0,1,0),fo.bind(void 0,0,1,0,1,1),fo.bind(void 0,0,1,0,1,2),fo.bind(void 0,0,1,0,1,3),fo.bind(void 0,0,1,1,0,0),fo.bind(void 0,0,1,1,0,1),fo.bind(void 0,0,1,1,0,2),fo.bind(void 0,0,1,1,0,3),fo.bind(void 0,0,1,1,1,0),fo.bind(void 0,0,1,1,1,1),fo.bind(void 0,0,1,1,1,2),fo.bind(void 0,0,1,1,1,3),fo.bind(void 0,1,0,0,0,0),fo.bind(void 0,1,0,0,0,1),fo.bind(void 0,1,0,0,0,2),fo.bind(void 0,1,0,0,0,3),fo.bind(void 0,1,0,0,1,0),fo.bind(void 0,1,0,0,1,1),fo.bind(void 0,1,0,0,1,2),fo.bind(void 0,1,0,0,1,3),fo.bind(void 0,1,0,1,0,0),fo.bind(void 0,1,0,1,0,1),fo.bind(void 0,1,0,1,0,2),fo.bind(void 0,1,0,1,0,3),fo.bind(void 0,1,0,1,1,0),fo.bind(void 0,1,0,1,1,1),fo.bind(void 0,1,0,1,1,2),fo.bind(void 0,1,0,1,1,3),fo.bind(void 0,1,1,0,0,0),fo.bind(void 0,1,1,0,0,1),fo.bind(void 0,1,1,0,0,2),fo.bind(void 0,1,1,0,0,3),fo.bind(void 0,1,1,0,1,0),fo.bind(void 0,1,1,0,1,1),fo.bind(void 0,1,1,0,1,2),fo.bind(void 0,1,1,0,1,3),fo.bind(void 0,1,1,1,0,0),fo.bind(void 0,1,1,1,0,1),fo.bind(void 0,1,1,1,0,2),fo.bind(void 0,1,1,1,0,3),fo.bind(void 0,1,1,1,1,0),fo.bind(void 0,1,1,1,1,1),fo.bind(void 0,1,1,1,1,2),fo.bind(void 0,1,1,1,1,3)];var go=Rr;function mo(e){this.char=e,this.state={},this.activeState=null}function yo(e,t,n){this.contextName=n,this.startIndex=e,this.endOffset=t}function vo(e,t,n){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=t,this.checkEnd=n}function bo(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 So(e){this.eventId=e,this.subscribers=[]}function xo(e){const t=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];for(let e=0;e<t.length;e++){const n=t[e];Object.defineProperty(this.events,n,{value:new So(n)})}if(e)for(let n=0;n<t.length;n++){const s=t[n],r=e[s];"function"==typeof r&&this.events[s].subscribe(r)}const n=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];for(let e=0;e<n.length;e++){const t=n[e];this.events[t].subscribe(this.updateContextsRanges)}}function To(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],xo.call(this,e)}mo.prototype.setState=function(e,t){return this.state[e]=t,this.activeState={key:e,value:this.state[e]},this.activeState},mo.prototype.getState=function(e){return this.state[e]||null},To.prototype.inboundIndex=function(e){return e>=0&&e<this.tokens.length},To.prototype.composeRUD=function(e){const t=e.map(e=>this[e[0]].apply(this,e.slice(1).concat(true))),n=e=>"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"FAIL");if(t.every(n))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:t.filter(n)};this.dispatch("composeRUD",[t.filter(e=>!n(e))])},To.prototype.replaceRange=function(e,t,n,s){t=null!==t?t:this.tokens.length;const r=n.every(e=>e instanceof mo);if(!isNaN(e)&&this.inboundIndex(e)&&r){const r=this.tokens.splice.apply(this.tokens,[e,t].concat(n));return s||this.dispatch("replaceToken",[e,t,n]),[r,n]}return{FAIL:"replaceRange: invalid tokens or startIndex."}},To.prototype.replaceToken=function(e,t,n){if(!isNaN(e)&&this.inboundIndex(e)&&t instanceof mo){const s=this.tokens.splice(e,1,t);return n||this.dispatch("replaceToken",[e,t]),[s[0],t]}return{FAIL:"replaceToken: invalid token or index."}},To.prototype.removeRange=function(e,t,n){t=isNaN(t)?this.tokens.length:t;const s=this.tokens.splice(e,t);return n||this.dispatch("removeRange",[s,e,t]),s},To.prototype.removeToken=function(e,t){if(!isNaN(e)&&this.inboundIndex(e)){const n=this.tokens.splice(e,1);return t||this.dispatch("removeToken",[n,e]),n}return{FAIL:"removeToken: invalid token index."}},To.prototype.insertToken=function(e,t,n){return e.every(e=>e instanceof mo)?(this.tokens.splice.apply(this.tokens,[t,0].concat(e)),n||this.dispatch("insertToken",[e,t]),e):{FAIL:"insertToken: invalid token(s)."}},To.prototype.registerModifier=function(e,t,n){this.events.newToken.subscribe(function(s,r){const o=[s,r],a=[s,r];if(null===t||!0===t.apply(this,o)){let t=n.apply(this,a);s.setState(e,t)}}),this.registeredModifiers.push(e)},So.prototype.subscribe=function(e){return"function"==typeof e?this.subscribers.push(e)-1:{FAIL:`invalid '${this.eventId}' event handler`}},So.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)},bo.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)},bo.prototype.get=function(e){switch(!0){case 0===e: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}},To.prototype.rangeToText=function(e){if(e instanceof yo)return this.getRangeTokens(e).map(e=>e.char).join("")},To.prototype.getText=function(){return this.tokens.map(e=>e.char).join("")},To.prototype.getContext=function(e){let t=this.registeredContexts[e];return t||null},To.prototype.on=function(e,t){const n=this.events[e];return n?n.subscribe(t):null},To.prototype.dispatch=function(e,t){const n=this.events[e];if(n instanceof So)for(let e=0;e<n.subscribers.length;e++){n.subscribers[e].apply(this,t||[])}},To.prototype.registerContextChecker=function(e,t,n){if(this.getContext(e))return{FAIL:`context name '${e}' is already registered.`};if("function"!=typeof t)return{FAIL:"missing context start check."};if("function"!=typeof n)return{FAIL:"missing context end check."};const s=new vo(e,t,n);return this.registeredContexts[e]=s,this.contextCheckers.push(s),s},To.prototype.getRangeTokens=function(e){const t=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,t))},To.prototype.getContextRanges=function(e){const t=this.getContext(e);return t?t.ranges:{FAIL:`context checker '${e}' is not registered.`}},To.prototype.resetContextsRanges=function(){const e=this.registeredContexts;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){e[t].ranges=[]}},To.prototype.updateContextsRanges=function(){this.resetContextsRanges();const e=this.tokens.map(e=>e.char);for(let t=0;t<e.length;t++){const n=new bo(e,t);this.runContextCheck(n)}this.dispatch("updateContextsRanges",[this.registeredContexts])},To.prototype.setEndOffset=function(e,t){let n=new yo(this.getContext(t).openRange.startIndex,e,t);const s=this.getContext(t).ranges;return n.rangeId=`${t}.${s.length}`,s.push(n),this.getContext(t).openRange=null,n},To.prototype.runContextCheck=function(e){const t=e.index;for(let n=0;n<this.contextCheckers.length;n++){const s=this.contextCheckers[n];let r=s.contextName,o=this.getContext(r).openRange;if(!o&&s.checkStart(e)&&(o=new yo(t,null,r),this.getContext(r).openRange=o,this.dispatch("contextStart",[r,t])),o&&s.checkEnd(e)){const e=t-o.startIndex+1,n=this.setEndOffset(e,r);this.dispatch("contextEnd",[r,n])}}},To.prototype.tokenize=function(e){this.tokens=[],this.resetContextsRanges();let t=Array.from(e);this.dispatch("start");for(let e=0;e<t.length;e++){const n=t[e],s=new bo(t,e);this.dispatch("next",[s]),this.runContextCheck(s);let r=new mo(n);this.tokens.push(r),this.dispatch("newToken",[r,s])}return this.dispatch("end",[this.tokens]),this.tokens};var Oo=To;function ko(e){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e)}function wo(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 Io(e){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e)}function Uo(e){return/[\u0E00-\u0E7F]/.test(e)}function Ro(e){return/[A-z]/.test(e)}function Lo(e){this.font=e,this.features={}}function Co(e){this.id=e.id,this.tag=e.tag,this.substitution=e.substitution}function Eo(e,t){if(!e)return-1;switch(t.format){case 1:return t.glyphs.indexOf(e);case 2:{let n=t.ranges;for(let t=0;t<n.length;t++){const s=n[t];if(e>=s.start&&e<=s.end){let t=e-s.start;return s.index+t}}break}default:return-1}return-1}function Do(e,t){return-1===Eo(e,t.coverage)?null:e+t.deltaGlyphId}function Mo(e,t){let n=Eo(e,t.coverage);return-1===n?null:t.substitute[n]}function Fo(e,t){let n=[];for(let s=0;s<e.length;s++){const r=e[s];let o=t.current;o=Array.isArray(o)?o[0]:o;const a=Eo(o,r);-1!==a&&n.push(a)}return n.length!==e.length?-1:n}function Ao(e,t){const n=t.inputCoverage.length+t.lookaheadCoverage.length+t.backtrackCoverage.length;if(e.context.length<n)return[];let s=Fo(t.inputCoverage,e);if(-1===s)return[];const r=t.inputCoverage.length-1;if(e.lookahead.length<t.lookaheadCoverage.length)return[];let o=e.lookahead.slice(r);for(;o.length&&Io(o[0].char);)o.shift();const a=new bo(o,0);let i=Fo(t.lookaheadCoverage,a),l=[].concat(e.backtrack);for(l.reverse();l.length&&Io(l[0].char);)l.shift();if(l.length<t.backtrackCoverage.length)return[];const u=new bo(l,0);let c=Fo(t.backtrackCoverage,u);let p=[];if(s.length===t.inputCoverage.length&&i.length===t.lookaheadCoverage.length&&c.length===t.backtrackCoverage.length)for(let n=0;n<t.lookupRecords.length;n++){const r=t.lookupRecords[n].lookupListIndex,o=this.getLookupByIndex(r);for(let t=0;t<o.subtables.length;t++){let n,r=o.subtables[t],a=this.getSubstitutionType(o,r);if("71"===a?(a=this.getSubstitutionType(r,r.extension),n=this.getLookupMethod(r,r.extension),r=r.extension):n=this.getLookupMethod(o,r),"12"!==a)throw new Error(`Substitution type ${a} is not supported in chaining substitution`);for(let t=0;t<s.length;t++){const s=n(e.get(t));s&&p.push(s)}}}return p}function No(e,t){let n,s=Eo(e.current,t.coverage);if(-1===s)return null;let r=t.ligatureSets[s];for(let t=0;t<r.length;t++){n=r[t];for(let t=0;t<n.components.length;t++){if(e.lookahead[t]!==n.components[t])break;if(t===n.components.length-1)return n}}return null}function Po(e,t){let n=e.current;if(-1===Eo(n,t.coverage))return null;for(const s of t.ruleSets)for(const t of s){let s=!0;for(let n=0;n<t.input.length;n++)if(e.lookahead[n]!==t.input[n]){s=!1;break}if(s){let e=[];e.push(n);for(let n=0;n<t.input.length;n++)e.push(t.input[n]);const s=(e,t)=>{const{lookupListIndex:n,sequenceIndex:s}=t,{subtables:r}=this.getLookupByIndex(n);for(const t of r){-1!==Eo(e[s],t.coverage)&&(e[s]=t.deltaGlyphId)}};for(let n=0;n<t.lookupRecords.length;n++){s(e,t.lookupRecords[n])}return e}}return null}function Bo(e,t){let n=[];for(let s=0;s<t.coverages.length;s++){const r=t.lookupRecords[s],o=t.coverages[s];let a=e.context[e.index+r.sequenceIndex];if(-1===Eo(a,o))return null;let i=this.font.tables.gsub.lookups[r.lookupListIndex];for(let e=0;e<i.subtables.length;e++){let t=i.subtables[e],s=Eo(a,t.coverage);if(-1===s)return null;switch(i.lookupType){case 1:{let e=t.substitute[s];n.push(e);break}case 2:{let e=t.sequences[s];n.push(e);break}}}}return n}function Go(e,t){let n=Eo(e,t.coverage);return-1===n?null:t.sequences[n]}Lo.prototype.getDefaultScriptFeaturesIndexes=function(){const e=this.font.tables.gsub.scripts;for(let t=0;t<e.length;t++){const n=e[t];if("DFLT"===n.tag)return n.script.defaultLangSys.featureIndexes}return[]},Lo.prototype.getScriptFeaturesIndexes=function(e){if(!this.font.tables.gsub)return[];if(!e)return this.getDefaultScriptFeaturesIndexes();const t=this.font.tables.gsub.scripts;for(let n=0;n<t.length;n++){const s=t[n];if(s.tag===e&&s.script.defaultLangSys)return s.script.defaultLangSys.featureIndexes;{let t=s.langSysRecords;if(t)for(let n=0;n<t.length;n++){const s=t[n];if(s.tag===e){return s.langSys.featureIndexes}}}}return this.getDefaultScriptFeaturesIndexes()},Lo.prototype.mapTagsToFeatures=function(e,t){let n={};for(let t=0;t<e.length;t++){const s=e[t].tag,r=e[t].feature;n[s]=r}this.features[t].tags=n},Lo.prototype.getScriptFeatures=function(e){let t=this.features[e];if(Object.prototype.hasOwnProperty.call(this.features,e))return t;const n=this.getScriptFeaturesIndexes(e);if(!n)return null;const s=this.font.tables.gsub;return t=n.map(e=>s.features[e]),this.features[e]=t,this.mapTagsToFeatures(t,e),t},Lo.prototype.getSubstitutionType=function(e,t){return e.lookupType.toString()+t.substFormat.toString()},Lo.prototype.getLookupMethod=function(e,t){let n=this.getSubstitutionType(e,t);switch(n){case"11":return e=>Do.apply(this,[e,t]);case"12":return e=>Mo.apply(this,[e,t]);case"63":return e=>Ao.apply(this,[e,t]);case"41":return e=>No.apply(this,[e,t]);case"21":return e=>Go.apply(this,[e,t]);case"51":return e=>Po.apply(this,[e,t]);case"53":return e=>Bo.apply(this,[e,t]);default:throw new Error(`substitutionType : ${n} lookupType: ${e.lookupType} - substFormat: ${t.substFormat} is not yet supported`)}},Lo.prototype.lookupFeature=function(e){let t=e.contextParams,n=t.index;const 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}'.`);const r=this.getFeatureLookups(s),o=[].concat(t.context);for(let s=0;s<r.length;s++){const a=r[s],i=this.getLookupSubtables(a);for(let s=0;s<i.length;s++){let r,l,u=i[s],c=this.getSubstitutionType(a,u);switch("71"===c?(c=this.getSubstitutionType(u,u.extension),r=this.getLookupMethod(u,u.extension),u=u.extension):r=this.getLookupMethod(a,u),c){case"11":l=r(t.current),l&&o.splice(n,1,new Co({id:11,tag:e.tag,substitution:l}));break;case"12":l=r(t.current),l&&o.splice(n,1,new Co({id:12,tag:e.tag,substitution:l}));break;case"63":l=r(t),Array.isArray(l)&&l.length&&o.splice(n,1,new Co({id:63,tag:e.tag,substitution:l}));break;case"41":l=r(t),l&&o.splice(n,1,new Co({id:41,tag:e.tag,substitution:l}));break;case"21":l=r(t.current),l&&o.splice(n,1,new Co({id:21,tag:e.tag,substitution:l}));break;case"51":case"53":l=r(t),Array.isArray(l)&&l.length&&o.splice(n,1,new Co({id:parseInt(c),tag:e.tag,substitution:l}))}t=new bo(o,n),Array.isArray(l)&&!l.length||(l=null)}}return o.length?o:null},Lo.prototype.supports=function(e){if(!e.script)return!1;this.getScriptFeatures(e.script);const t=Object.prototype.hasOwnProperty.call(this.features,e.script);if(!e.tag)return t;const n=this.features[e.script].some(t=>t.tag===e.tag);return t&&n},Lo.prototype.getLookupSubtables=function(e){return e.subtables||null},Lo.prototype.getLookupByIndex=function(e){return this.font.tables.gsub.lookups[e]||null},Lo.prototype.getFeatureLookups=function(e){return e.lookupListIndexes.map(this.getLookupByIndex.bind(this))},Lo.prototype.getFeature=function(e){if(!this.font)return{FAIL:"No font was found"};Object.prototype.hasOwnProperty.call(this.features,e.script)||this.getScriptFeatures(e.script);const t=this.features[e.script];return t?t.tags[e.tag]?this.features[e.script].tags[e.tag]:null:{FAIL:`No feature for script ${e.script}`}};var Ho=Lo;var _o={startCheck:function(e){const t=e.current,n=e.get(-1);return null===n&&ko(t)||!ko(n)&&ko(t)},endCheck:function(e){const t=e.get(1);return null===t||!ko(t)}};var Vo={startCheck:function(e){const t=e.current,n=e.get(-1);return(ko(t)||Io(t))&&!ko(n)},endCheck:function(e){const t=e.get(1);switch(!0){case null===t:return!0;case!ko(t)&&!Io(t):{const n=/\s/.test(t);if(!n)return!0;if(n){let t=!1;if(t=e.lookahead.some(e=>ko(e)||Io(e)),!t)return!0}break}default:return!1}}};function zo(e,t,n){for(let s=0;s<e.substitution.length;s++){const r=e.substitution[s],o=t[n+s];Array.isArray(r)?r.length?o.setState(e.tag,r[0]):o.setState("deleted",!0):o.setState(e.tag,r)}}var jo={11:function(e,t,n){t[n].setState(e.tag,e.substitution)},12:function(e,t,n){t[n].setState(e.tag,e.substitution)},63:zo,41:function(e,t,n){let s=t[n];s.setState(e.tag,e.substitution.ligGlyph);const r=e.substitution.components.length;for(let e=0;e<r;e++)s=t[n+e+1],s.setState("deleted",!0)},51:zo,53:zo};var qo=function(e,t,n){e instanceof Co&&jo[e.id]&&jo[e.id](e,t,n)};function Wo(e){let t=[].concat(e.backtrack);for(let e=t.length-1;e>=0;e--){const n=t[e],s=wo(n),r=Io(n);if(!s&&!r)return!0;if(s)return!1}return!1}function $o(e){if(wo(e.current))return!1;for(let t=0;t<e.lookahead.length;t++){if(!Io(e.lookahead[t]))return!0}return!1}var Xo=function(e){const t="arab",n=this.featuresTags[t],s=this.tokenizer.getRangeTokens(e);if(1===s.length)return;let r=new bo(s.map(e=>e.getState("glyphIndex")),0);const o=new bo(s.map(e=>e.char),0);for(let e=0;e<s.length;e++){if(Io(s[e].char))continue;r.setCurrentIndex(e),o.setCurrentIndex(e);let a,i=0;switch(Wo(o)&&(i|=1),$o(o)&&(i|=2),i){case 1:a="fina";break;case 2:a="init";break;case 3:a="medi"}if(-1===n.indexOf(a))continue;let l=this.query.lookupFeature({tag:a,script:t,contextParams:r});if(l instanceof Error)console.info(l.message);else for(let e=0;e<l.length;e++){const t=l[e];t instanceof Co&&(qo(t,s,e),r.context[e]=t.substitution)}}};function Yo(e,t){return new bo(e.map(e=>e.activeState.value),t||0)}var Zo=function(e){let t=this.tokenizer.getRangeTokens(e),n=Yo(t);for(let e=0;e<n.context.length;e++){n.setCurrentIndex(e);let s=this.query.lookupFeature({tag:"rlig",script:"arab",contextParams:n});if(s.length){for(let n=0;n<s.length;n++){const r=s[n];qo(r,t,e)}n=Yo(t)}}};var Qo={startCheck:function(e){return 0===e.index&&e.context.length>1},endCheck:function(e){return e.index===e.context.length-1}};function Ko(e,t){return new bo(e.map(e=>e.activeState.value),t||0)}var Jo=function(e){const t="delf",n="ccmp";let s=this.tokenizer.getRangeTokens(e),r=Ko(s);for(let e=0;e<r.context.length;e++){if(!this.query.getFeature({tag:n,script:t,contextParams:r}))continue;r.setCurrentIndex(e);let o=this.query.lookupFeature({tag:n,script:t,contextParams:r});if(o.length){for(let t=0;t<o.length;t++){const n=o[t];qo(n,s,e)}r=Ko(s)}}};var ea={startCheck:function(e){const t=e.current,n=e.get(-1);return null===n&&Ro(t)||!Ro(n)&&Ro(t)},endCheck:function(e){const t=e.get(1);return null===t||!Ro(t)}};function ta(e,t){return new bo(e.map(e=>e.activeState.value),t||0)}var na=function(e){let t=this.tokenizer.getRangeTokens(e),n=ta(t);for(let e=0;e<n.context.length;e++){n.setCurrentIndex(e);let s=this.query.lookupFeature({tag:"liga",script:"latn",contextParams:n});if(s.length){for(let n=0;n<s.length;n++){const r=s[n];qo(r,t,e)}n=ta(t)}}};var sa={startCheck:function(e){const t=e.current,n=e.get(-1);return null===n&&Uo(t)||!Uo(n)&&Uo(t)},endCheck:function(e){const t=e.get(1);return null===t||!Uo(t)}};function ra(e,t){return new bo(e.map(e=>e.activeState.value),t||0)}var oa=function(e){let t=this.tokenizer.getRangeTokens(e),n=ra(t,0);for(let e=0;e<n.context.length;e++){n.setCurrentIndex(e);let s=this.query.lookupFeature({tag:"ccmp",script:"thai",contextParams:n});if(s.length){for(let n=0;n<s.length;n++){const r=s[n];qo(r,t,e)}n=ra(t,e)}}};function aa(e,t){return new bo(e.map(e=>e.activeState.value),t||0)}var ia=function(e){let t=this.tokenizer.getRangeTokens(e),n=aa(t,0);for(let e=0;e<n.context.length;e++){n.setCurrentIndex(e);let s=this.query.lookupFeature({tag:"liga",script:"thai",contextParams:n});if(s.length){for(let n=0;n<s.length;n++){const r=s[n];qo(r,t,e)}n=aa(t,e)}}};function la(e,t){return new bo(e.map(e=>e.activeState.value),t||0)}var ua=function(e){let t=this.tokenizer.getRangeTokens(e),n=la(t,0);for(let e=0;e<n.context.length;e++){n.setCurrentIndex(e);let s=this.query.lookupFeature({tag:"rlig",script:"thai",contextParams:n});if(s.length){for(let n=0;n<s.length;n++){const r=s[n];qo(r,t,e)}n=la(t,e)}}};function ca(e){if(null===e)return!1;const t=e.codePointAt(0);return t>=6155&&t<=6157||t>=65024&&t<=65039||t>=917760&&t<=917999}var pa={startCheck:function(e){const t=e.current,n=e.get(1);return null===n&&ca(t)||ca(n)},endCheck:function(e){const t=e.get(1);return null===t||!ca(t)}};var ha=function(e){const t=this.query.font,n=this.tokenizer.getRangeTokens(e);if(n[1].setState("deleted",!0),t.tables.cmap&&t.tables.cmap.varSelectorList){const e=n[0].char.codePointAt(0),s=n[1].char.codePointAt(0),r=t.tables.cmap.varSelectorList[s];if(void 0!==r&&r.nonDefaultUVS){const s=r.nonDefaultUVS.uvsMappings;if(s[e]){const r=s[e].glyphID;void 0!==t.glyphs.glyphs[r]&&n[0].setState("glyphIndex",r)}}}};function fa(e){this.baseDir=e||"ltr",this.tokenizer=new Oo,this.featuresTags={}}function da(e){const t=this.contextChecks[`${e}Check`];return this.tokenizer.registerContextChecker(e,t.startCheck,t.endCheck)}function ga(){return da.call(this,"ccmpReplacement"),da.call(this,"latinWord"),da.call(this,"arabicWord"),da.call(this,"arabicSentence"),da.call(this,"thaiWord"),da.call(this,"unicodeVariationSequence"),this.tokenizer.tokenize(this.text)}function ma(){const e=this.tokenizer.getContextRanges("arabicSentence");for(let t=0;t<e.length;t++){const n=e[t];let s=this.tokenizer.getRangeTokens(n);this.tokenizer.replaceRange(n.startIndex,n.endOffset,s.reverse())}}function ya(){if(-1===this.tokenizer.registeredModifiers.indexOf("glyphIndex"))throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function va(){if(!Object.prototype.hasOwnProperty.call(this.featuresTags,"arab"))return;ya.call(this);const e=this.tokenizer.getContextRanges("arabicWord");for(let t=0;t<e.length;t++){const n=e[t];Xo.call(this,n)}}function ba(){ya.call(this);const e=this.tokenizer.getContextRanges("ccmpReplacement");for(let t=0;t<e.length;t++){const n=e[t];Jo.call(this,n)}}function Sa(){if(!this.hasFeatureEnabled("arab","rlig"))return;ya.call(this);const e=this.tokenizer.getContextRanges("arabicWord");for(let t=0;t<e.length;t++){const n=e[t];Zo.call(this,n)}}function xa(){if(!this.hasFeatureEnabled("latn","liga"))return;ya.call(this);const e=this.tokenizer.getContextRanges("latinWord");for(let t=0;t<e.length;t++){const n=e[t];na.call(this,n)}}function Ta(){const e=this.tokenizer.getContextRanges("unicodeVariationSequence");for(let t=0;t<e.length;t++){const n=e[t];ha.call(this,n)}}function Oa(){ya.call(this);const e=this.tokenizer.getContextRanges("thaiWord");for(let t=0;t<e.length;t++){const n=e[t];this.hasFeatureEnabled("thai","liga")&&ia.call(this,n),this.hasFeatureEnabled("thai","rlig")&&ua.call(this,n),this.hasFeatureEnabled("thai","ccmp")&&oa.call(this,n)}}fa.prototype.setText=function(e){this.text=e},fa.prototype.contextChecks={ccmpReplacementCheck:Qo,latinWordCheck:ea,arabicWordCheck:_o,arabicSentenceCheck:Vo,thaiWordCheck:sa,unicodeVariationSequenceCheck:pa},fa.prototype.registerFeatures=function(e,t){const n=t.filter(t=>this.query.supports({script:e,tag:t}));Object.prototype.hasOwnProperty.call(this.featuresTags,e)?this.featuresTags[e]=this.featuresTags[e].concat(n):this.featuresTags[e]=n},fa.prototype.applyFeatures=function(e,t){if(!e)throw new Error("No valid font was provided to apply features");this.query||(this.query=new Ho(e));for(let e=0;e<t.length;e++){const n=t[e];this.query.supports({script:n.script})&&this.registerFeatures(n.script,n.tags)}},fa.prototype.registerModifier=function(e,t,n){this.tokenizer.registerModifier(e,t,n)},fa.prototype.checkContextReady=function(e){return!!this.tokenizer.getContext(e)},fa.prototype.applyFeaturesToContexts=function(){this.checkContextReady("ccmpReplacement")&&ba.call(this),this.checkContextReady("arabicWord")&&(va.call(this),Sa.call(this)),this.checkContextReady("latinWord")&&xa.call(this),this.checkContextReady("arabicSentence")&&ma.call(this),this.checkContextReady("thaiWord")&&Oa.call(this),this.checkContextReady("unicodeVariationSequence")&&Ta.call(this)},fa.prototype.hasFeatureEnabled=function(e,t){return-1!==(this.featuresTags[e]||[]).indexOf(t)},fa.prototype.processText=function(e){this.text&&this.text===e||(this.setText(e),ga.call(this),this.applyFeaturesToContexts())},fa.prototype.getBidiText=function(e){return this.processText(e),this.tokenizer.getText()},fa.prototype.getTextGlyphs=function(e){this.processText(e);let t=[];for(let e=0;e<this.tokenizer.tokens.length;e++){const n=this.tokenizer.tokens[e];if(n.state.deleted)continue;const s=n.activeState.value;t.push(Array.isArray(s)?s[0]:s)}return t};var ka=fa;function wa(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 Ia(e){if((e=e||{}).tables=e.tables||{},!e.empty){if(!e.familyName)throw"When creating a new Font object, familyName is required.";if(!e.styleName)throw"When creating a new Font object, styleName is required.";if(!e.unitsPerEm)throw"When creating a new Font object, unitsPerEm is required.";if(!e.ascender)throw"When creating a new Font object, ascender is required.";if(e.descender>0)throw"When creating a new Font object, negative descender value is required.";this.names={},this.names.unicode=wa(e),this.names.macintosh=wa(e),this.names.windows=wa(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),0==t&&(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 Bn.GlyphSet(this,e.glyphs||[]),this.encoding=new xn(this),this.position=new sr(this),this.substitution=new cr(this),this.tables=this.tables||{},this.tables=new Proxy(this.tables,{set:(e,t,n)=>(e[t]=n,e.fvar&&(e.gvar||e.cff2)&&!this.variation&&(this.variation=new Ur(this)),!0)}),this.palettes=new pr(this),this.layers=new hr(this),this.svgImages=new fr(this),this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new go(this):null}})}Ia.prototype.hasChar=function(e){return this.encoding.charToGlyphIndex(e)>0},Ia.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},Ia.prototype.charToGlyph=function(e){const t=this.charToGlyphIndex(e);let n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},Ia.prototype.updateFeatures=function(e){return this.defaultRenderOptions.features.map(t=>"latn"===t.script?{script:"latn",tags:t.tags.filter(t=>e[t])}:t)},Ia.prototype.stringToGlyphIndexes=function(e,t){const n=new ka;n.registerModifier("glyphIndex",null,e=>this.charToGlyphIndex(e.char));let s=t?this.updateFeatures(t.features):this.defaultRenderOptions.features;return n.applyFeatures(this,s),n.getTextGlyphs(e)},Ia.prototype.stringToGlyphs=function(e,t){const n=this.stringToGlyphIndexes(e,t);let s=n.length;const r=new Array(s),o=this.glyphs.get(0);for(let e=0;e<s;e+=1)r[e]=this.glyphs.get(n[e])||o;return r},Ia.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},Ia.prototype.nameToGlyph=function(e){const t=this.nameToGlyphIndex(e);let n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},Ia.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},Ia.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;const n=this.position.defaultKerningTables;return n?this.position.getKerningValue(n,e,t):this.kerningPairs[e+","+t]||0},Ia.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},Ia.prototype.forEachGlyph=function(e,t,n,s,r,o){t=void 0!==t?t:0,n=void 0!==n?n:0,s=void 0!==s?s:72,r=Object.assign({},this.defaultRenderOptions,r);const a=1/this.unitsPerEm*s,i=this.stringToGlyphs(e,r);let l;if(r.kerning){const e=r.script||this.position.getDefaultScriptName();l=this.position.getKerningTables(e,r.language)}for(let e=0;e<i.length;e+=1){const u=i[e];if(o.call(this,u,t,n,s,r),u.advanceWidth&&(t+=u.advanceWidth*a),r.kerning&&e<i.length-1){t+=(l?this.position.getKerningValue(l,u.index,i[e+1].index):this.getKerningValue(u,i[e+1]))*a}r.letterSpacing?t+=r.letterSpacing*s:r.tracking&&(t+=r.tracking/1e3*s)}return t},Ia.prototype.getPath=function(e,t,n,s,r){r=Object.assign({},this.defaultRenderOptions,r);const o=new Ke;if(o._layers=[],ns(this,o),o.stroke){const e=1/(o.unitsPerEm||1e3)*s;o.strokeWidth*=e}return this.forEachGlyph(e,t,n,s,r,(e,t,n,s)=>{const a=e.getPath(t,n,s,r,this);if(r.drawSVG||r.drawLayers){const e=a._layers;if(e&&e.length){for(let t=0;t<e.length;t++){const n=e[t];o._layers.push(n)}return}}o.extend(a)}),o},Ia.prototype.getPaths=function(e,t,n,s,r){r=Object.assign({},this.defaultRenderOptions,r);const o=[];return this.forEachGlyph(e,t,n,s,r,function(e,t,n,s){const a=e.getPath(t,n,s,r,this);o.push(a)}),o},Ia.prototype.getAdvanceWidth=function(e,t,n){return n=Object.assign({},this.defaultRenderOptions,n),this.forEachGlyph(e,0,0,t,n,function(){})},Ia.prototype.draw=function(e,t,n,s,r,o){this.getPath(t,n,s,r,o).draw(e)},Ia.prototype.drawPoints=function(e,t,n,s,r,o){o=Object.assign({},this.defaultRenderOptions,o),this.forEachGlyph(t,n,s,r,o,function(t,n,s,r){t.drawPoints(e,n,s,r,o,this)})},Ia.prototype.drawMetrics=function(e,t,n,s,r,o){o=Object.assign({},this.defaultRenderOptions,o),this.forEachGlyph(t,n,s,r,o,function(t,n,s,r){t.drawMetrics(e,n,s,r)})},Ia.prototype.getEnglishName=function(e){const t=(this.names.unicode||this.names.macintosh||this.names.windows)[e];if(t)return t.en},Ia.prototype.validate=function(){const e=[],t=this;function n(t,n){t||(console.warn(`[opentype.js] ${n}`),e.push(n))}function s(e){const s=t.getEnglishName(e);n(s&&s.trim().length>0,"No English "+e+" specified.")}if(s("fontFamily"),s("weightName"),s("manufacturer"),s("copyright"),s("version"),n(this.unitsPerEm>0,"No unitsPerEm specified."),this.tables.colr){const e=this.tables.colr.baseGlyphRecords;let t=-1;for(let s=0;s<e.length;s++){const r=e[s].glyphID;if(n(t<e[s].glyphID,`baseGlyphs must be sorted by GlyphID in ascending order, but glyphID ${r} comes after ${t}`),t>e[s].glyphID)break;t=r}}return e},Ia.prototype.toTables=function(){return Zs.fontToTable(this)},Ia.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},Ia.prototype.toArrayBuffer=function(){const e=this.toTables().encode(),t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let t=0;t<e.length;t++)n[t]=e[t];return t},Ia.prototype.download=function(){console.error("DEPRECATED: platform-specific actions are to be implemented on user-side")},Ia.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},Ia.prototype.macStyleValues={BOLD:1,ITALIC:2,UNDERLINE:4,OUTLINED:8,SHADOW:16,CONDENSED:32,EXTENDED:64},Ia.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},Ia.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var Ua=Ia;var Ra={make:function(){console.warn("Writing of hvar tables is not yet supported.")},parse:function(e,t){const n=new Xt.Parser(e,t),s=n.parseUShort(),r=n.parseUShort();return 1!==s&&console.warn(`Unsupported hvar table version ${s}.${r}`),{version:[s,r],itemVariationStore:n.parsePointer32(function(){return this.parseItemVariationStore()}),advanceWidth:n.parsePointer32(function(){return this.parseDeltaSetIndexMap()}),lsb:n.parsePointer32(function(){return this.parseDeltaSetIndexMap()}),rsb:n.parsePointer32(function(){return this.parseDeltaSetIndexMap()})}}},La=function(){return{coverage:this.parsePointer(Wt.coverage),attachPoints:this.parseList(Wt.pointer(Wt.uShortList))}},Ca=function(){var e=this.parseUShort();return tt.argument(1===e||2===e||3===e,"Unsupported CaretValue table version."),1===e?{coordinate:this.parseShort()}:2===e?{pointindex:this.parseShort()}:3===e?{coordinate:this.parseShort()}:void 0},Ea=function(){return this.parseList(Wt.pointer(Ca))},Da=function(){return{coverage:this.parsePointer(Wt.coverage),ligGlyphs:this.parseList(Wt.pointer(Ea))}},Ma=function(){return this.parseUShort(),this.parseList(Wt.pointer(Wt.coverage))};var Fa={parse:function(e,t){const n=new Wt(e,t=t||0),s=n.parseVersion(1);tt.argument(1===s||1.2===s||1.3===s,"Unsupported GDEF table version.");var r={version:s,classDef:n.parsePointer(Wt.classDef),attachList:n.parsePointer(La),ligCaretList:n.parsePointer(Da),markAttachClassDef:n.parsePointer(Wt.classDef)};return s>=1.2&&(r.markGlyphSets=n.parsePointer(Ma)),r}},Aa=new Array(10);Aa[1]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{posFormat:1,coverage:this.parsePointer(Wt.coverage),value:this.parseValueRecord()}:2===t?{posFormat:2,coverage:this.parsePointer(Wt.coverage),values:this.parseValueRecordList()}:void tt.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},Aa[2]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();tt.assert(1===t||2===t,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");const n=this.parsePointer(Wt.coverage),s=this.parseUShort(),r=this.parseUShort();if(1===t)return{posFormat:t,coverage:n,valueFormat1:s,valueFormat2:r,pairSets:this.parseList(Wt.pointer(Wt.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(s),value2:this.parseValueRecord(r)}})))};if(2===t){const e=this.parsePointer(Wt.classDef),o=this.parsePointer(Wt.classDef),a=this.parseUShort(),i=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:s,valueFormat2:r,classDef1:e,classDef2:o,class1Count:a,class2Count:i,classRecords:this.parseList(a,Wt.list(i,function(){return{value1:this.parseValueRecord(s),value2:this.parseValueRecord(r)}}))}}},Aa[3]=function(){return{error:"GPOS Lookup 3 not supported"}},Aa[4]=function(){return{error:"GPOS Lookup 4 not supported"}},Aa[5]=function(){return{error:"GPOS Lookup 5 not supported"}},Aa[6]=function(){return{error:"GPOS Lookup 6 not supported"}},Aa[7]=function(){return{error:"GPOS Lookup 7 not supported"}},Aa[8]=function(){return{error:"GPOS Lookup 8 not supported"}},Aa[9]=function(){return{error:"GPOS Lookup 9 not supported"}};var Na=new Array(10);var Pa={parse:function(e,t){const n=new Wt(e,t=t||0),s=n.parseVersion(1);return tt.argument(1===s||1.1===s,"Unsupported GPOS table version "+s),1===s?{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(Aa)}:{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(Aa),variations:n.parseFeatureVariationsList()}},make:function(e){return new kt.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new kt.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new kt.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new kt.LookupList(e.lookups,Na)}])}};var Ba={parse:function(e,t){const n=new Xt.Parser(e,t),s=n.parseUShort();if(0===s)return function(e){const t={};e.skip("uShort");const n=e.parseUShort();tt.argument(0===n,"Unsupported kern sub-table version."),e.skip("uShort",2);const s=e.parseUShort();e.skip("uShort",3);for(let n=0;n<s;n+=1){const n=e.parseUShort(),s=e.parseUShort(),r=e.parseShort();t[n+","+s]=r}return t}(n);if(1===s)return function(e){const t={};e.skip("uShort"),e.parseULong()>1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");const n=255&e.parseUShort();if(e.skip("uShort"),0===n){const n=e.parseUShort();e.skip("uShort",3);for(let s=0;s<n;s+=1){const n=e.parseUShort(),s=e.parseUShort(),r=e.parseShort();t[n+","+s]=r}}return t}(n);throw new Error("Unsupported kern table version ("+s+").")}};var Ga={parse:function(e,t,n,s){const r=new Xt.Parser(e,t),o=s?r.parseUShort:r.parseULong,a=[];for(let e=0;e<n+1;e+=1){let e=o.call(r);s&&(e*=2),a.push(e)}return a}};function Ha(e,t){const n=[];let s=12;for(let r=0;r<t;r+=1){const t=Xt.getTag(e,s),r=Xt.getULong(e,s+4),o=Xt.getULong(e,s+8),a=Xt.getULong(e,s+12);n.push({tag:t,checksum:r,offset:o,length:a,compression:!1}),s+=16}return n}function _a(e,t){if("WOFF"===t.compression){const n=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),s=new Uint8Array(t.length);if(je(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}}return{data:e,offset:t.offset}}function Va(e,t={}){let n,s;const r=new Ua({empty:!0});e.constructor!==ArrayBuffer&&(e=new Uint8Array(e).buffer);const o=new DataView(e,0);let a,i=[];const l=Xt.getTag(o,0);if(l===String.fromCharCode(0,1,0,0)||"true"===l||"typ1"===l)r.outlinesFormat="truetype",a=Xt.getUShort(o,4),i=Ha(o,a);else if("OTTO"===l)r.outlinesFormat="cff",a=Xt.getUShort(o,4),i=Ha(o,a);else{if("wOFF"!==l){if("wOF2"===l){throw new Error("WOFF2 require an external decompressor library, see examples at: https://github.com/opentypejs/opentype.js/issues/183#issuecomment-1147228025")}throw new Error("Unsupported OpenType signature "+l)}{const e=Xt.getTag(o,4);if(e===String.fromCharCode(0,1,0,0))r.outlinesFormat="truetype";else{if("OTTO"!==e)throw new Error("Unsupported OpenType flavor "+l);r.outlinesFormat="cff"}a=Xt.getUShort(o,12),i=function(e,t){const n=[];let s=44;for(let r=0;r<t;r+=1){const t=Xt.getTag(e,s),r=Xt.getULong(e,s+4),o=Xt.getULong(e,s+8),a=Xt.getULong(e,s+12);let i;i=o<a&&"WOFF",n.push({tag:t,offset:r,compression:i,compressedLength:o,length:a}),s+=20}return n}(o,a)}}let u,c,p,h,f,d,g,m,y,v,b,S,x,T,O,k,w,I;for(let e=0;e<a;e+=1){const t=i[e];let a;switch(t.tag){case"avar":g=t;break;case"cmap":a=_a(o,t),r.tables.cmap=fn.parse(a.data,a.offset),r.encoding=new Tn(r.tables.cmap);break;case"cvt ":a=_a(o,t),I=new Xt.Parser(a.data,a.offset),r.tables.cvt=I.parseShortList(t.length/2);break;case"fvar":p=t;break;case"STAT":h=t;break;case"gvar":f=t;break;case"cvar":d=t;break;case"fpgm":a=_a(o,t),I=new Xt.Parser(a.data,a.offset),r.tables.fpgm=I.parseByteList(t.length);break;case"head":a=_a(o,t),r.tables.head=ps.parse(a.data,a.offset),r.unitsPerEm=r.tables.head.unitsPerEm,n=r.tables.head.indexToLocFormat;break;case"hhea":a=_a(o,t),r.tables.hhea=hs.parse(a.data,a.offset),r.ascender=r.tables.hhea.ascender,r.descender=r.tables.hhea.descender,r.numberOfHMetrics=r.tables.hhea.numberOfHMetrics;break;case"HVAR":x=t;break;case"hmtx":S=t;break;case"ltag":a=_a(o,t),s=ds.parse(a.data,a.offset);break;case"COLR":a=_a(o,t),r.tables.colr=ks.parse(a.data,a.offset);break;case"CPAL":a=_a(o,t),r.tables.cpal=Mn.parse(a.data,a.offset);break;case"maxp":a=_a(o,t),r.tables.maxp=gs.parse(a.data,a.offset),r.numGlyphs=r.tables.maxp.numGlyphs;break;case"name":k=t;break;case"OS/2":a=_a(o,t),r.tables.os2=ys.parse(a.data,a.offset);break;case"post":a=_a(o,t),r.tables.post=vs.parse(a.data,a.offset),r.glyphNames=new kn(r.tables.post);break;case"prep":a=_a(o,t),I=new Xt.Parser(a.data,a.offset),r.tables.prep=I.parseByteList(t.length);break;case"glyf":m=t;break;case"loca":O=t;break;case"CFF ":u=t;break;case"CFF2":c=t;break;case"kern":T=t;break;case"GDEF":y=t;break;case"GPOS":v=t;break;case"GSUB":b=t;break;case"meta":w=t;break;case"gasp":try{a=_a(o,t),r.tables.gasp=Vs.parse(a.data,a.offset)}catch(e){console.warn("Failed to parse gasp table, skipping."),console.warn(e)}break;case"SVG ":a=_a(o,t),r.tables.svg=zs.parse(a.data,a.offset)}}const U=_a(o,k);if(r.tables.name=pn.parse(U.data,U.offset,s),r.names=r.tables.name,m&&O){const e=0===n,s=_a(o,O),a=Ga.parse(s.data,s.offset,r.numGlyphs,e),i=_a(o,m);r.glyphs=wr.parse(i.data,i.offset,a,r,t)}else if(u){const e=_a(o,u);cs.parse(e.data,e.offset,r,t)}else{if(!c)throw new Error("Font doesn't contain TrueType, CFF or CFF2 outlines.");{const e=_a(o,c);cs.parse(e.data,e.offset,r,t)}}const R=_a(o,S);if(fs.parse(r,R.data,R.offset,r.numberOfHMetrics,r.numGlyphs,r.glyphs,t),wn(r,t),T){const e=_a(o,T);r.kerningPairs=Ba.parse(e.data,e.offset)}else r.kerningPairs={};if(y){const e=_a(o,y);r.tables.gdef=Fa.parse(e.data,e.offset)}if(v){const e=_a(o,v);r.tables.gpos=Pa.parse(e.data,e.offset),r.position.init()}if(b){const e=_a(o,b);r.tables.gsub=Ts.parse(e.data,e.offset)}if(p){const e=_a(o,p);r.tables.fvar=Ls.parse(e.data,e.offset,r.names)}if(h){const e=_a(o,h);r.tables.stat=Ns.parse(e.data,e.offset,r.tables.fvar)}if(f){p||console.warn("This font provides a gvar table, but no fvar table, which is required for variable fonts."),m||console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");const e=_a(o,f);r.tables.gvar=_s.parse(e.data,e.offset,r.tables.fvar,r.glyphs)}if(d){p||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."),m||console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");const e=_a(o,d);r.tables.cvar=Hs.parse(e.data,e.offset,r.tables.fvar,r.tables.cvt||[])}if(g){p||console.warn("This font provides an avar table, but no fvar table, which is required for variable fonts.");const e=_a(o,g);r.tables.avar=Gs.parse(e.data,e.offset,r.tables.fvar)}if(x){p||console.warn("This font provides an HVAR table, but no fvar table, which is required for variable fonts."),S||console.warn("This font provides an HVAR table, but no hmtx table to vary.");const e=_a(o,x);r.tables.hvar=Ra.parse(e.data,e.offset,r.tables.fvar)}if(w){const e=_a(o,w);r.tables.meta=Os.parse(e.data,e.offset),r.metas=r.tables.meta}return r.palettes=new pr(r),r}const za=e.DEVELOPMENT;var ja=s.n(za);const qa=Symbol(),Wa=Symbol(),$a=Symbol(),Xa=Symbol(),Ya=Symbol(),Za=Symbol();function Qa(){this[$a]=new Set,this[Wa]=new Map,this[Xa]=new WeakMap,this[Ya]=new WeakMap}Object.assign(Qa.prototype,{getDefaultFontStyle(){return this[qa]??=(()=>{const e=new Oe(this.getPrivateScene());return e.setup(),e})()},loadFont(e,t=!0){let n=t?this[Wa].get(e.href):null;return n||(n=new Promise(async(s,r)=>{try{const n=await fetch(e,{cache:t?"default":"reload"});if(!n.ok)throw new Error(n.statusText||n.status);const r=await n.arrayBuffer(),o=Va(await this.decompressFont(r));ja()&&"data:"!==e.protocol&&console.info(`Done loading font '${decodeURI(e)}'.`),s(o)}catch(t){"data:"!==e.protocol&&console.warn(`Error loading font '${decodeURI(e)}':`,t),s(null)}finally{this[$a].delete(n)}}),this[$a].add(n),e.search||this[Wa].set(e.href,n)),n},registerFont(e,t){const n=this[Xa].getOrInsertComputed(e,()=>new Map),s=new Map(Object.values(t.names).flatMap(e=>Object.values(e.fontFamily??{}).map(t=>[t,e])));for(const[e,r]of s){const s=n.getOrInsertComputed(e.toUpperCase(),()=>new Map);for(const n of new Set(Object.values(r.fontSubfamily??{})))this.getBrowserOption("Debug")&&console.info(`Registering font family ${e} - ${n}.`),s.set(n.toUpperCase().replaceAll(" ",""),t)}},registerFontLibrary(e,t,n){this[Ya].getOrInsertComputed(e,()=>new Map).set(t.toUpperCase(),n)},async getFont(e,t,n){try{for(t=t.toUpperCase(),n=n.toUpperCase().replaceAll(" ","");;){const s=this[Ya].get(e),r=this[Xa].get(e),o=s?.get(t)??r?.get(t)?.get(n);if(o)return o;await Promise.any(this[$a])}}catch{return null}},async decompressFont(e){if(this.isWoff2(e)){const t=await this.getWoff2Decoder();return await t(e)}return e},isWoff2(e){if(e.byteLength<4)return!1;return 2001684018===new DataView(e).getUint32(0,!1)},async getWoff2Decoder(){return this[Za]??=await this.loadWoff2Decoder()},async loadWoff2Decoder(){const e=k().getLibraryURL("woff2_decoder.js"),t=await fetch(e);if(!t.ok)throw new Error(t.statusText||t.status);const n=await t.text();return new Function(n)()}});const Ka=Qa,Ja=y().add("X3DTextContext",Ka),ei=e.X3DGeometryNode;var ti=s.n(ei);const ni=e.X3DCast;var si=s.n(ni);function ri(e){ti().call(this,e),this.addType(T().Text),this._length.setUnit("length"),this._maxExtent.setUnit("length"),this._origin.setUnit("length"),this._textBounds.setUnit("length"),this._lineBounds.setUnit("length")}Object.assign(Object.setPrototypeOf(ri.prototype,ti().prototype),{initialize(){ti().prototype.initialize.call(this),this._fontStyle.addInterest("set_fontStyle__",this),this.set_fontStyle__()},getMatrix(){return this.textGeometry.getMatrix()},getLength(e){return e<this._length.length?Math.max(0,this._length[e]):0},set_live__(){const e=this.getBrowser(),t=this.isLive()&&e.getBrowserOption("AlwaysUpdateGeometries");this.getLive().getValue()||t?(e.getBrowserOptions()._PrimitiveQuality.addInterest("requestRebuild",this),e.getBrowserOptions()._TextCompression.addInterest("requestRebuild",this),this.requestRebuild()):(e.getBrowserOptions()._PrimitiveQuality.removeInterest("requestRebuild",this),e.getBrowserOptions()._TextCompression.removeInterest("requestRebuild",this))},set_fontStyle__(){this.fontStyleNode?.removeInterest("requestRebuild",this),this.fontStyleNode=si()(T().X3DFontStyleNode,this._fontStyle)??this.getBrowser().getDefaultFontStyle(),this.fontStyleNode.addInterest("requestRebuild",this),this.textGeometry=this.fontStyleNode.getTextGeometry(this)},build(){this.textGeometry.update(),this.textGeometry.build(),this.setSolid(this._solid.getValue())},traverse(e,t){this.textGeometry.traverse(e,t),ti().prototype.traverse.call(this,e,t)},displaySimple(e,t,n){this.textGeometry.displaySimple(e,t,n),ti().prototype.displaySimple.call(this,e,t,n)},display(e,t){this.textGeometry.display(e,t),ti().prototype.display.call(this,e,t),t.textureNode=null},transformLine(e){return this.textGeometry.transformLine(e)},transformMatrix(e){return this.textGeometry.transformMatrix(e)}}),Object.defineProperties(ri,{...f().getStaticProperties("Text","Text",1,"geometry","2.0"),fieldDefinitions:{value:new(p())([new(u())(T().inputOutput,"metadata",new(i().SFNode)),new(u())(T().inputOutput,"string",new(i().MFString)),new(u())(T().inputOutput,"length",new(i().MFFloat)),new(u())(T().inputOutput,"maxExtent",new(i().SFFloat)),new(u())(T().initializeOnly,"solid",new(i().SFBool)),new(u())(T().outputOnly,"origin",new(i().SFVec3f)),new(u())(T().outputOnly,"textBounds",new(i().SFVec2f)),new(u())(T().outputOnly,"lineBounds",new(i().MFVec2f)),new(u())(T().inputOutput,"fontStyle",new(i().SFNode))]),enumerable:!0}});const oi=ri,ai=y().add("Text",oi);o().add({name:"Text",concreteNodes:[Oe,ai],abstractNodes:[L],browserContext:Ja});y().add("TextComponent",undefined)})();
|
|
1
|
+
/* X_ITE v12.1.5 */
|
|
2
|
+
const e=window[Symbol.for("X_ITE.X3D-12.1.5")];(()=>{var t={254:t=>{t.exports=e.jquery}},n={};function s(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,s),o.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const r=e.Components;var o=s.n(r);const a=e.Fields;var i=s.n(a);const l=e.X3DFieldDefinition;var u=s.n(l);const c=e.FieldDefinitionArray;var p=s.n(c);const h=e.X3DNode;var f=s.n(h);const d=e.X3DUrlObject;var g=s.n(d);const m=e.Namespace;var y=s.n(m);let v=0;const b={BEGIN:++v,FIRST:++v,MIDDLE:++v,END:++v},S=y().add("TextAlignment",b),x=e.X3DConstants;var T=s.n(x);const O=e.URLs;var k=s.n(O),w=s(254);const I=new Map([["SERIF",new Map([["PLAIN",k().getFontsURL("Droid/DroidSerif-Regular.woff2")],["ITALIC",k().getFontsURL("Droid/DroidSerif-Italic.woff2")],["BOLD",k().getFontsURL("Droid/DroidSerif-Bold.woff2")],["BOLDITALIC",k().getFontsURL("Droid/DroidSerif-BoldItalic.woff2")]])],["SANS",new Map([["PLAIN",k().getFontsURL("Ubuntu/Ubuntu-R.woff2")],["ITALIC",k().getFontsURL("Ubuntu/Ubuntu-RI.woff2")],["BOLD",k().getFontsURL("Ubuntu/Ubuntu-B.woff2")],["BOLDITALIC",k().getFontsURL("Ubuntu/Ubuntu-BI.woff2")]])],["TYPEWRITER",new Map([["PLAIN",k().getFontsURL("Ubuntu/UbuntuMono-R.woff2")],["ITALIC",k().getFontsURL("Ubuntu/UbuntuMono-RI.woff2")],["BOLD",k().getFontsURL("Ubuntu/UbuntuMono-B.woff2")],["BOLDITALIC",k().getFontsURL("Ubuntu/UbuntuMono-BI.woff2")]])]]);function U(e){f().call(this,e),g().call(this,e),this.addType(T().X3DFontStyleNode),this.addChildObjects(T().inputOutput,"description",new(i().SFString),T().inputOutput,"url",new(i().MFString),T().inputOutput,"load",new(i().SFBool)(!0),T().inputOutput,"autoRefresh",new(i().SFTime)(0),T().inputOutput,"autoRefreshTimeLimit",new(i().SFTime)(3600)),this.alignments=[]}Object.assign(Object.setPrototypeOf(U.prototype,f().prototype),g().prototype,{initialize(){f().prototype.initialize.call(this),g().prototype.initialize.call(this),this._family.addInterest("set_url__",this),this._style.addInterest("set_url__",this),this._justify.addInterest("set_justify__",this),this.set_justify__(),this.requestImmediateLoad().catch(Function.prototype)},set_justify__(){const e=this._horizontal.getValue()?this._leftToRight.getValue():this._topToBottom.getValue();this.alignments[0]=this._justify.length>0?this.getAlignment(0,e):e?S.BEGIN:S.END;const t=this._horizontal.getValue()?this._topToBottom.getValue():this._leftToRight.getValue();this.alignments[1]=this._justify.length>1?this.getAlignment(1,t):t?S.FIRST:S.END},getAllowEmptyUrl:()=>!0,getFont(){return this.font},getDefaultFont(e,t){const n=I.get(e);return n?.get(t)??n?.get("PLAIN")},getMajorAlignment(){return this.alignments[0]},getMinorAlignment(){return this.alignments[1]},getAlignment(e,t){if(t)switch(this._justify[e]){case"FIRST":return S.FIRST;case"BEGIN":return S.BEGIN;case"MIDDLE":return S.MIDDLE;case"END":return S.END}else switch(this._justify[e]){case"FIRST":case"BEGIN":return S.END;case"MIDDLE":return S.MIDDLE;case"END":return S.BEGIN}return e?S.FIRST:S.BEGIN},async loadData(){await w.sleep(0);const e=this.getBrowser(),t=this.getExecutionContext(),n=this._family.copy(),s=this._style.getValue();n.push("SERIF"),this.font=null;for(const r of n){const n=this.getDefaultFont(r,s);if(n){const t=await e.loadFont(new URL(n),!0);if(t){this.font=t;break}}const o=await e.getFont(t,r,s);if(o){this.font=o;break}const a=new URL(r,t.getBaseURL());if("data:"===a.protocol||a.pathname.match(/\.(?:woff2|woff|otf|ttf)$/i)){t.getSpecificationVersion()>=4.1&&console.warn("Loading a font file via family field is depreciated, please use new FontLibrary node instead.");const n=await e.loadFont(a,this.getCache());if(n){this.font=n;break}}else console.warn(`Couldn't find font family '${r}' with style '${s}'.`)}this.setLoadState(this.font?T().COMPLETE_STATE:T().FAILED_STATE),this.addNodeEvent()},dispose(){g().prototype.dispose.call(this),f().prototype.dispose.call(this)}}),Object.defineProperties(U,f().getStaticProperties("X3DFontStyleNode","Text",1));const R=U,L=y().add("X3DFontStyleNode",R),C=e.PrimitiveQuality;var E=s.n(C);const D=e.TextCompression;var M=s.n(D);const F=e.Box2;var A=s.n(F);const N=e.Box3;var P=s.n(N);const B=e.Vector2;var G=s.n(B);const H=e.Vector3;var _=s.n(H);const V=e.Matrix3;var z=s.n(V);const j=new(A()),q=new(A()),W=new(G()),$=new(G()),X=new(G()),Y=new(G()),Z=new(_()),Q=new(_()),K=new(G()),J=new(G()),ee=new(G()),te=new(G()),ne=new(G()),se=new(G()),re=new(_()),oe=new(A()),ae=new(G()),ie=new(_());function le(e,t){this.browser=e.getBrowser(),this.text=e,this.fontStyle=t,this.glyphs=[],this.minorAlignment=new(G()),this.lineIndices=[],this.translations=[],this.charSpacings=[],this.scales=[],this.bearing=new(G()),this.bbox=new(P())}Object.assign(le.prototype,{getBrowser(){return this.browser},getText(){return this.text},getFontStyle(){return this.fontStyle},getGlyphs(){return this.glyphs},getMinorAlignment(){return this.minorAlignment},getTranslations(){return this.translations},getCharSpacings(){return this.charSpacings},getScales(){return this.scales},getBearing(){return this.bearing},getBBox(){return this.bbox},update(){const e=this.text,t=this.fontStyle,n=e._string.length;if(e._lineBounds.length=n,this.glyphs.length=0,0===n||!t.getFont())return e._origin.setValue(ie),e._textBounds.setValue(ae),void this.bbox.set();if(t._horizontal.getValue())this.resizeArray(this.translations,n),this.lineIndices.length=0,this.charSpacings.length=n,this.scales.length=n,this.horizontal(e,t);else{const s=e._string.reduce((e,t)=>e+t.length,0);this.resizeArray(this.translations,s),this.lineIndices.length=s,this.charSpacings.length=n,this.scales.length=n,this.vertical(e,t)}},resizeArray(e,t){for(let n=e.length;n<t;++n)e.push(new(G()));e.length=t},horizontal(e,t){const n=t.getFont(),s=e._string,r=s.length,o=Math.max(0,e._maxExtent.getValue()),a=t._topToBottom.getValue(),i=t.getScale(),l=t.getContentScale(),u=t._spacing.getValue(),c=this.getBrowser().getBrowserOptions().getTextCompression();j.set();const p=a?r:-1,h=a?1:-1;for(let o=a?0:r-1,f=0;o!==p;o+=h,++f){const r=s[o],a=this.getHorizontalLineExtents(t,r,W,$,f);K.assign($).subtract(W);const p=e.getLength(o)*l,h=K.x*i;let d=0;switch(se.set(h,0==f?$.y-n.descender/n.unitsPerEm*i:u),p&&(c===M().CHAR_SPACING&&a.length>1&&(d=(p-se.x)/(a.length-1)),se.x=p,K.x=p/i),this.charSpacings[f]=d,this.scales[f]=c===M().SCALING?se.x/h:1,e._lineBounds[o]=se,t.getMajorAlignment()){case S.BEGIN:case S.FIRST:this.translations[f].set(0,-f*u);break;case S.MIDDLE:this.translations[f].set(-W.x-K.x/2,-f*u);break;case S.END:this.translations[f].set(-W.x-K.x,-f*u)}this.translations[f].multiply(i),J.assign(W).add(ee.assign(K).divide(2)),j.add(oe.set(K.multiply(i),J.multiply(i).add(this.translations[f])))}if(o){const t=e._lineBounds.reduce((e,t)=>Math.max(e,t.x),0);if(t>o){const n=o*l/t;switch(c){case M().CHAR_SPACING:for(const t of this.charSpacings.keys())e._string[t].length<2||(this.charSpacings[t]-=(e._lineBounds[t].x-e._lineBounds[t].x*n)/(e._string[t].length-1));break;case M().SCALING:for(const e of this.scales.keys())this.scales[e]*=n}for(const e of this.translations.keys())this.translations[e].x*=n;for(const t of e._lineBounds.keys())e._lineBounds[t].x*=n;j.multRight(new(z())(n,0,0,0,1,0,0,0,0))}}switch(j.getExtents(W,$),K.assign($).subtract(W),e._textBounds=K,this.bearing.set(0,-$.y),t.getMinorAlignment()){case S.BEGIN:this.minorAlignment.assign(this.bearing);break;case S.FIRST:this.minorAlignment.set(0);break;case S.MIDDLE:this.minorAlignment.set(0,K.y/2-$.y);break;case S.END:this.minorAlignment.set(0,(r-1)*u*i)}W.add(this.minorAlignment),$.add(this.minorAlignment),e._origin.setValue(re.set(W.x,$.y,0)),this.bbox.setExtents(Z.set(W.x,W.y,0),Q.set($.x,$.y,0))},vertical(e,t){const n=t.getFont(),s=e._string,r=s.length,o=Math.max(0,e._maxExtent.getValue()),a=t._leftToRight.getValue(),i=t._topToBottom.getValue(),l=t.getScale(),u=t.getContentScale(),c=t._spacing.getValue(),p=this.getBrowser().getBrowserOptions().getPrimitiveQuality(),h=this.getBrowser().getBrowserOptions().getTextCompression();j.set();const f=a?r:-1,d=a?1:-1;let g=0;for(let o=a?0:r-1;o!==f;o+=d){const f=this.stringToGlyphs(n,s[o],!0,o),d=g,m=f.length;q.set();const y=i?m:-1,v=i?1:-1;for(let e=i?0:m-1;e!==y;e+=v,++g){const t=f[e];this.getGlyphExtents(n,t,p,W,$),K.assign($).subtract(W);const s=i?e:m-e-1;this.lineIndices[g]=o,this.translations[g].set((c-K.x-W.x)/2,-s),J.assign(W).add(ee.assign(K).divide(2)).add(this.translations[g]),q.add(oe.set(K,J))}q.getExtents(W,$),K.assign($).subtract(W);const b=a?o:r-o-1,x=(c-K.x)/2,T=e.getLength(o)*u;let O=0;se.set(0===o?c-x:c,m?K.y:0).multiply(l);const k=se.y;if(T){switch(h){case M().CHAR_SPACING:f.length>1&&(O=(T-se.y)/(f.length-1));break;case M().SCALING:t.getMajorAlignment()===S.MIDDLE&&($.y+=(T-se.y)/2)}se.y=T,K.y=T/l,W.y=$.y-K.y}switch(this.charSpacings[o]=O,this.scales[o]=h===M().SCALING?se.y/k:1,e._lineBounds[o]=se,t.getMajorAlignment()){case S.BEGIN:case S.FIRST:ne.assign(te.set(b*c,-$.y));break;case S.MIDDLE:ne.assign(te.set(b*c,K.y/2-$.y));break;case S.END:te.set(b*c,K.y/this.scales[o]-$.y),ne.set(b*c,K.y-$.y)}for(let e=d;e<g;++e)this.translations[e].add(te).multiply(l);J.assign(W).add(ee.assign(K).divide(2)),j.add(oe.set(K.multiply(l),J.add(ne).multiply(l)))}if(o){const n=e._lineBounds.reduce((e,t)=>Math.max(e,t.y),0);if(n>o){const s=o*u/n;switch(h){case M().CHAR_SPACING:for(const t of this.charSpacings.keys())e._string[t].length<2||(this.charSpacings[t]-=(e._lineBounds[t].y-e._lineBounds[t].y*s)/(e._string[t].length-1));switch(t.getMajorAlignment()){case S.MIDDLE:for(const t of this.translations.keys()){const n=this.lineIndices[t];this.translations[t].y-=(e._lineBounds[n].y-e._lineBounds[n].y*s)/2}break;case S.END:for(const t of this.translations.keys()){const n=this.lineIndices[t];this.translations[t].y-=e._lineBounds[n].y-e._lineBounds[n].y*s}}break;case M().SCALING:for(const e of this.scales.keys())this.scales[e]*=s}for(const t of e._lineBounds.keys())e._lineBounds[t].y*=s;j.multRight(new(z())(1,0,0,0,s,0,0,0,0))}}switch(j.getExtents(W,$),K.assign($).subtract(W),e._textBounds=K,t.getMajorAlignment()){case S.BEGIN:case S.FIRST:this.bearing.set(-W.x,$.y);break;case S.MIDDLE:this.bearing.set(-W.x,0);break;case S.END:this.bearing.set(-W.x,W.y)}switch(t.getMinorAlignment()){case S.BEGIN:case S.FIRST:this.minorAlignment.set(-W.x,0);break;case S.MIDDLE:this.minorAlignment.set(-W.x-K.x/2,0);break;case S.END:this.minorAlignment.set(-W.x-K.x,0)}W.add(this.minorAlignment),$.add(this.minorAlignment),e._origin.setValue(re.set(W.x,$.y,0)),this.bbox.setExtents(Z.set(W.x,W.y,0),Q.set($.x,$.y,0))},stringToGlyphs(e,t,n,s){const r=this.glyphs[s]??(this.glyphs[s]=[]);r.length=t.length;const o=n?0:t.length-1,a=n?t.length:-1,i=n?1:-1;for(let n=o,s=0;n!==a;n+=i,++s)r[s]=e.charToGlyph(t[n]);return r},getHorizontalLineExtents(e,t,n,s,r){const o=e.getFont(),a=e._horizontal.getValue()?e._leftToRight.getValue():e._topToBottom.getValue(),i=this.stringToGlyphs(o,t,a,r),l=i.length,u=this.getBrowser().getBrowserOptions().getPrimitiveQuality();let c=0,p=0,h=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY;for(let e=0;e<l;++e){const t=i[e],n=i[e+1],s=n?o.getKerningValue(t,n):0;this.getGlyphExtents(o,t,u,X,Y),p+=e<l-1?t.advanceWidth+s:Y.x*o.unitsPerEm,h=Math.min(h,X.y),f=Math.max(f,Y.y)}switch(i.length?(this.getGlyphExtents(o,i[0],u,X,Y),c=X.x):(h=0,f=0),n.set(c,h),s.set(p/o.unitsPerEm,f),e.getMajorAlignment()){case S.BEGIN:case S.FIRST:n.x=0}return i},traverse(e,t){}});const ue=le,ce=y().add("X3DTextGeometry",ue),pe=e.Matrix4;var he=s.n(pe);const fe=e.Bezier;var de=s.n(fe);const ge=e.libtess;var me=s.n(ge);const ye=Symbol();function ve(e,t){ce.call(this,e,t),e.setTransparent(!1)}Object.assign(Object.setPrototypeOf(ve.prototype,ce.prototype),{getMatrix:()=>he().IDENTITY,build:(()=>{const e=new(_()),t=new(_());return function(){const n=this.getFontStyle(),s=n.getFont();if(!s)return;const r=this.getText(),o=this.getGlyphs(),a=this.getMinorAlignment(),i=this.getTranslations(),l=this.getCharSpacings(),u=this.getScales(),c=n.getScale(),p=n._spacing.getValue(),h=r._origin.getValue(),f=c/s.unitsPerEm,d=this.getBrowser().getBrowserOptions().getPrimitiveQuality(),g=r.getTexCoords(),m=r.getNormals(),y=r.getVertices();if(r.getMultiTexCoords().push(g),this.getBBox().getExtents(e,t),r.getMin().assign(e),r.getMax().assign(t),n._horizontal.getValue())for(let e=0,t=o.length;e<t;++e){const t=o[e],n=i[e],r=l[e],v=u[e];let b=0;for(let e=0,o=t.length;e<o;++e){const o=t[e],i=this.getGlyphGeometry(s,o,d),l=a.x+n.x+b*v+e*r,u=a.y+n.y;for(const{x:e,y:t}of i){const n=e*c*v+l,s=t*c+u;g.push((n-h.x)/p,(s-h.y)/p,0,1),m.push(0,0,1),y.push(n,s,0,1)}let S=0;e+1<t.length&&(S=s.getKerningValue(o,t[e+1])),b+=(o.advanceWidth+S)*f}}else{const e=n._leftToRight.getValue(),t=n._topToBottom.getValue(),f=e?0:r._string.length-1,v=e?r._string.length:-1,b=e?1:-1;for(let e=f,n=0;e!==v;e+=b){const r=o[e],f=r.length,v=t?0:f-1,b=t?f:-1,S=t?1:-1,x=l[e],T=u[e];for(let e=v;e!==b;e+=S,++n){const o=i[n],l=this.getGlyphGeometry(s,r[e],d);for(const{x:n,y:s}of l){const r=t?e:f-e-1,i=n*c+a.x+o.x,l=s*c*T+a.y+o.y*T-r*x;g.push((i-h.x)/p,(l-h.y)/p,0,1),m.push(0,0,1),y.push(i,l,0,1)}}}}}})(),getGlyph(e,t,n){const s=e[ye]??=[],r=s[t]??=[];return r[n]??={}},getGlyphExtents(e,t,n,s,r){const o=this.getGlyph(e,n,t.index),a=o.extents;if(a)s.assign(a.min),r.assign(a.max);else{const a=this.getGlyphGeometry(e,t,n);a.length?(s.assign(a[0]).min(...a),r.assign(a[0]).max(...a)):(s.set(0),r.set(0));const i=o.extents={};i.min=s.copy(),i.max=r.copy()}},getGlyphGeometry(e,t,n){const s=this.getGlyph(e,n,t.index);return s.geometry??=this.createGlyphGeometry(t,n)},createGlyphGeometry(e,t){const n=this.getBezierSteps(t),s=e.getPath(0,0,1),r=[];let o=[],a=0,i=0;s.commands.push({type:"Z"});for(const{type:e,x1:t,y1:l,x2:u,y2:c,x:p,y:h}of s.commands){switch(e){case"M":case"Z":o.length>2&&r.push(o),o=[],"M"===e&&o.push(new(_())(p,-h,0));break;case"L":o.push(new(_())(p,-h,0));break;case"Q":de().quadric(a,-i,0,t,-l,0,p,-h,0,n,o);break;case"C":de().cubic(a,-i,0,t,-l,0,u,-c,0,p,-h,0,n,o);break;default:continue}a=p,i=h}return this.triangulatePolygon(r,[])},getBezierSteps(e){switch(e){case E().LOW:return 3;case E().HIGH:return 7;default:return 5}},triangulatePolygon:(()=>{const e=new(me().GluTesselator);return e.gluTessCallback(me().gluEnum.GLU_TESS_VERTEX_DATA,function(e,t){t.push(e)}),e.gluTessCallback(me().gluEnum.GLU_TESS_COMBINE,function(e,t,n){return new(_())(...e)}),e.gluTessProperty(me().gluEnum.GLU_TESS_WINDING_RULE,me().windingRule.GLU_TESS_WINDING_NONZERO),e.gluTessNormal(0,0,1),function(t,n){e.gluTessBeginPolygon(n);for(const n of t){e.gluTessBeginContour();for(const t of n)e.gluTessVertex(t,t);e.gluTessEndContour()}return e.gluTessEndPolygon(),n}})(),displaySimple(e,t){},display(e,t){},transformLine(e){},transformMatrix(e){}});const be=ve,Se=y().add("PolygonText",be);function xe(e){L.call(this,e),this.addType(T().FontStyle),this._size.setUnit("length")}Object.assign(Object.setPrototypeOf(xe.prototype,L.prototype),{getTextGeometry(e){return new Se(e,this)},getScale(){return this._size.getValue()},getContentScale:()=>1}),Object.defineProperties(xe,{...f().getStaticProperties("FontStyle","Text",1,"fontStyle","2.0"),fieldDefinitions:{value:new(p())([new(u())(T().inputOutput,"metadata",new(i().SFNode)),new(u())(T().inputOutput,"language",new(i().SFString)),new(u())(T().inputOutput,"family",new(i().MFString)("SERIF")),new(u())(T().inputOutput,"style",new(i().SFString)("PLAIN")),new(u())(T().inputOutput,"size",new(i().SFFloat)(1)),new(u())(T().inputOutput,"spacing",new(i().SFFloat)(1)),new(u())(T().inputOutput,"horizontal",new(i().SFBool)(!0)),new(u())(T().inputOutput,"leftToRight",new(i().SFBool)(!0)),new(u())(T().inputOutput,"topToBottom",new(i().SFBool)(!0)),new(u())(T().inputOutput,"justify",new(i().MFString)("BEGIN"))]),enumerable:!0}});const Te=xe,Oe=y().add("FontStyle",Te);function ke(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function we(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new ke,this.dtree=new ke}var Ie=new ke,Ue=new ke,Re=new Uint8Array(30),Le=new Uint16Array(30),Ce=new Uint8Array(30),Ee=new Uint16Array(30),De=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Me=new ke,Fe=new Uint8Array(320);function Ae(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]}var Ne=new Uint16Array(16);function Pe(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)Ne[r]=o,o+=e.table[r];for(r=0;r<s;++r)t[n+r]&&(e.trans[Ne[t[n+r]]++]=r)}function Be(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=1&e.tag;return e.tag>>>=1,t}function Ge(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 He(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+(1&o),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 _e(e,t,n){var s,r,o,a,i,l;for(s=Ge(e,5,257),r=Ge(e,5,1),o=Ge(e,4,4),a=0;a<19;++a)Fe[a]=0;for(a=0;a<o;++a){var u=Ge(e,3,0);Fe[De[a]]=u}for(Pe(Me,Fe,0,19),i=0;i<s+r;){var c=He(e,Me);switch(c){case 16:var p=Fe[i-1];for(l=Ge(e,2,3);l;--l)Fe[i++]=p;break;case 17:for(l=Ge(e,3,3);l;--l)Fe[i++]=0;break;case 18:for(l=Ge(e,7,11);l;--l)Fe[i++]=0;break;default:Fe[i++]=c}}Pe(t,Fe,0,s),Pe(n,Fe,s,r)}function Ve(e,t,n){for(;;){var s,r,o,a,i=He(e,t);if(256===i)return 0;if(i<256)e.dest[e.destLen++]=i;else for(s=Ge(e,Re[i-=257],Le[i]),r=He(e,n),a=o=e.destLen-Ge(e,Ce[r],Ee[r]);a<o+s;++a)e.dest[e.destLen++]=e.dest[a]}}function ze(e){for(var t,n;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if((t=256*(t=e.source[e.sourceIndex+1])+e.source[e.sourceIndex])!==(65535&~(256*e.source[e.sourceIndex+3]+e.source[e.sourceIndex+2])))return-3;for(e.sourceIndex+=4,n=t;n;--n)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,0}function je(e,t){var n,s,r=new we(e,t);do{switch(n=Be(r),Ge(r,2,0)){case 0:s=ze(r);break;case 1:s=Ve(r,Ie,Ue);break;case 2:_e(r,r.ltree,r.dtree),s=Ve(r,r.ltree,r.dtree);break;default:s=-3}if(0!==s)throw new Error("Data error")}while(!n);return r.destLen<r.dest.length?"function"==typeof r.dest.slice?r.dest.slice(0,r.destLen):r.dest.subarray(0,r.destLen):r.dest}function qe(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 We(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}!function(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}(Ie,Ue),Ae(Re,Le,4,3),Ae(Ce,Ee,2,1),Re[28]=0,Le[28]=258,We.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},We.prototype.addPoint=function(e,t){"number"==typeof e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},We.prototype.addX=function(e){this.addPoint(e,null)},We.prototype.addY=function(e){this.addPoint(null,e)},We.prototype.addBezier=function(e,t,n,s,r,o,a,i){const l=[e,t],u=[n,s],c=[r,o],p=[a,i];this.addPoint(e,t),this.addPoint(a,i);for(let e=0;e<=1;e++){const t=6*l[e]-12*u[e]+6*c[e],n=-3*l[e]+9*u[e]-9*c[e]+3*p[e],s=3*u[e]-3*l[e];if(0===n){if(0===t)continue;const n=-s/t;0<n&&n<1&&(0===e&&this.addX(qe(l[e],u[e],c[e],p[e],n)),1===e&&this.addY(qe(l[e],u[e],c[e],p[e],n)));continue}const r=Math.pow(t,2)-4*s*n;if(r<0)continue;const o=(-t+Math.sqrt(r))/(2*n);0<o&&o<1&&(0===e&&this.addX(qe(l[e],u[e],c[e],p[e],o)),1===e&&this.addY(qe(l[e],u[e],c[e],p[e],o)));const a=(-t-Math.sqrt(r))/(2*n);0<a&&a<1&&(0===e&&this.addX(qe(l[e],u[e],c[e],p[e],a)),1===e&&this.addY(qe(l[e],u[e],c[e],p[e],a)))}},We.prototype.addQuad=function(e,t,n,s,r,o){const a=e+2/3*(n-e),i=t+2/3*(s-t),l=a+1/3*(r-e),u=i+1/3*(o-t);this.addBezier(e,t,a,i,l,u,r,o)};var $e=We;function Xe(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}var Ye={};function Ze(e,t){const n=Math.floor(e),s=e-n;if(Ye[t]||(Ye[t]={}),void 0!==Ye[t][s]){return n+Ye[t][s]}const r=+(Math.round(s+"e+"+t)+"e-"+t);return Ye[t][s]=r,n+r}function Qe(e){let t=[[]],n=0,s=0;for(let r=0;r<e.length;r+=1){const o=t[t.length-1],a=e[r],i=o[0],l=o[1],u=o[o.length-1],c=e[r+1];o.push(a),"M"===a.type?(n=a.x,s=a.y):"L"!==a.type||c&&"Z"!==c.command?"L"===a.type&&u&&u.x===a.x&&u.y===a.y?o.pop():"Z"===a.type&&(i&&l&&u&&"M"===i.type&&"L"===l.type&&"L"===u.type&&u.x===i.x&&u.y===i.y&&(o.shift(),o[0].type="M"),r+1<e.length&&t.push([])):Math.abs(a.x-n)>1||Math.abs(a.y-s)>1||o.pop()}return e=[].concat.apply([],t)}Xe.prototype.fromSVG=function(e,t={}){"undefined"!=typeof SVGPathElement&&e instanceof SVGPathElement&&(e=e.getAttribute("d")),t=function(e){return Object.assign({},{decimalPlaces:2,optimize:!0,flipY:!0,flipYBase:void 0,scale:1,x:0,y:0},e)}(t),this.commands=[];const n="MmLlQqCcZzHhVv";let s={},r=[""],o=!1;function a(e){if(!this.commands.length)return e;const t=this.commands[this.commands.length-1];for(let n=0;n<e.length;n++)e[n]+=t[1&n?"y":"x"];return e}function i(){if(void 0===s.type)return;const e=s.type.toUpperCase(),n="Z"!==e&&s.type.toUpperCase()!==s.type;let o=r.filter(e=>e.length).map(e=>{let n=parseFloat(e);return(t.decimalPlaces||0===t.decimalPlaces)&&(n=Ze(n,t.decimalPlaces)),n});if(r=[""],!o.length&&"Z"!==e)return;n&&"H"!==e&&"V"!==e&&(o=a.apply(this,[o]));const i=this.commands.length&&this.commands[this.commands.length-1].x||0,l=this.commands.length&&this.commands[this.commands.length-1].y||0;switch(e){case"M":this.moveTo(...o);break;case"L":this.lineTo(...o);break;case"V":for(let e=0;e<o.length;e++){let t=0;n&&(t=this.commands.length&&this.commands[this.commands.length-1].y||0),this.lineTo(i,o[e]+t)}break;case"H":for(let e=0;e<o.length;e++){let t=0;n&&(t=this.commands.length&&this.commands[this.commands.length-1].x||0),this.lineTo(o[e]+t,l)}break;case"C":this.bezierCurveTo(...o);break;case"Q":this.quadraticCurveTo(...o);break;case"Z":(this.commands.length<1||"Z"!==this.commands[this.commands.length-1].type)&&this.close()}if(this.commands.length)for(const e in this.commands[this.commands.length-1])void 0===this.commands[this.commands.length-1][e]&&(this.commands[this.commands.length-1][e]=0)}for(let t=0;t<e.length;t++){const a=e.charAt(t),l=r[r.length-1];if("0123456789".indexOf(a)>-1)r[r.length-1]+=a;else if("-+".indexOf(a)>-1)if(s.type||this.commands.length||(s.type="L"),"-"===a)!s.type||l.indexOf("-")>0?o=!0:l.length?r.push("-"):r[r.length-1]=a;else{if(s.type&&!(l.length>0))continue;o=!0}else if(n.indexOf(a)>-1)s.type?(i.apply(this),s={type:a}):s.type=a;else{if("SsTtAa".indexOf(a)>-1)throw new Error("Unsupported path command: "+a+". Currently supported commands are "+n.split("").join(", ")+".");" ,\t\n\r\f\v".indexOf(a)>-1?r.push(""):"."===a?!s.type||l.indexOf(a)>-1?o=!0:r[r.length-1]+=a:o=!0}if(o)throw new Error("Unexpected character: "+a+" at offset "+t)}i.apply(this),t.optimize&&(this.commands=Qe(this.commands));const l=t.flipY;let u=t.flipYBase;if(!0===l&&void 0===t.flipYBase){const e=this.getBoundingBox();u=e.y1+e.y2}for(const e in this.commands){const n=this.commands[e];for(const s in n)["x","x1","x2"].includes(s)?this.commands[e][s]=t.x+n[s]*t.scale:["y","y1","y2"].includes(s)&&(this.commands[e][s]=t.y+(l?u-n[s]:n[s])*t.scale)}return this},Xe.fromSVG=function(e,t){return(new Xe).fromSVG(e,t)},Xe.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},Xe.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},Xe.prototype.curveTo=Xe.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})},Xe.prototype.quadTo=Xe.prototype.quadraticCurveTo=function(e,t,n,s){this.commands.push({type:"Q",x1:e,y1:t,x:n,y:s})},Xe.prototype.close=Xe.prototype.closePath=function(){this.commands.push({type:"Z"})},Xe.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof $e){const t=e;return this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close()}Array.prototype.push.apply(this.commands,e)},Xe.prototype.getBoundingBox=function(){const e=new $e;let t=0,n=0,s=0,r=0;for(let o=0;o<this.commands.length;o++){const a=this.commands[o];switch(a.type){case"M":e.addPoint(a.x,a.y),t=s=a.x,n=r=a.y;break;case"L":e.addPoint(a.x,a.y),s=a.x,r=a.y;break;case"Q":e.addQuad(s,r,a.x1,a.y1,a.x,a.y),s=a.x,r=a.y;break;case"C":e.addBezier(s,r,a.x1,a.y1,a.x2,a.y2,a.x,a.y),s=a.x,r=a.y;break;case"Z":s=t,r=n;break;default:throw new Error("Unexpected path command "+a.type)}}return e.isEmpty()&&e.addPoint(0,0),e},Xe.prototype.draw=function(e){const t=this._layers;if(t&&t.length){for(let n=0;n<t.length;n++)this.draw.call(t[n],e);return}const n=this._image;if(n)e.drawImage(n.image,n.x,n.y,n.width,n.height);else{e.beginPath();for(let t=0;t<this.commands.length;t+=1){const n=this.commands[t];"M"===n.type?e.moveTo(n.x,n.y):"L"===n.type?e.lineTo(n.x,n.y):"C"===n.type?e.bezierCurveTo(n.x1,n.y1,n.x2,n.y2,n.x,n.y):"Q"===n.type?e.quadraticCurveTo(n.x1,n.y1,n.x,n.y):"Z"===n.type&&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())}},Xe.prototype.toPathData=function(e){function t(t){const n=Ze(t,e.decimalPlaces);return Math.round(t)===n?""+n:n.toFixed(e.decimalPlaces)}function n(){let e="";for(let n=0;n<arguments.length;n+=1){const s=arguments[n];s>=0&&n>0&&(e+=" "),e+=t(s)}return e}e=function(e){return parseInt(e)===e&&(e={decimalPlaces:e,flipY:!1}),Object.assign({},{decimalPlaces:2,optimize:!0,flipY:!0,flipYBase:void 0},e)}(e);let s=this.commands;e.optimize&&(s=JSON.parse(JSON.stringify(this.commands)),s=Qe(s));const r=e.flipY;let o=e.flipYBase;if(!0===r&&void 0===o){const e=new Xe;e.extend(s);const t=e.getBoundingBox();o=t.y1+t.y2}let a="";for(let e=0;e<s.length;e+=1){const t=s[e];"M"===t.type?a+="M"+n(t.x,r?o-t.y:t.y):"L"===t.type?a+="L"+n(t.x,r?o-t.y:t.y):"C"===t.type?a+="C"+n(t.x1,r?o-t.y1:t.y1,t.x2,r?o-t.y2:t.y2,t.x,r?o-t.y:t.y):"Q"===t.type?a+="Q"+n(t.x1,r?o-t.y1:t.y1,t.x,r?o-t.y:t.y):"Z"===t.type&&(a+="Z")}return a},Xe.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+='"',void 0!==this.fill&&"black"!==this.fill&&(null===this.fill?n+=' fill="none"':n+=' fill="'+this.fill+'"'),this.stroke&&(n+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),n+="/>",n},Xe.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));const n=t,s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("d",n),void 0!==this.fill&&"black"!==this.fill&&(null===this.fill?s.setAttribute("fill","none"):s.setAttribute("fill",this.fill)),this.stroke&&(s.setAttribute("stroke",this.stroke),s.setAttribute("stroke-width",this.strokeWidth)),s};var Ke=Xe;function Je(e){throw new Error(e)}function et(e,t){e||Je(t)}var tt={fail:Je,argument:et,assert:et},nt=2147483648,st={},rt={},ot={};function at(e){return function(){return e}}rt.BYTE=function(e){return tt.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]},ot.BYTE=at(1),rt.CHAR=function(e){return[e.charCodeAt(0)]},ot.CHAR=at(1),rt.CHARARRAY=function(e){null==e&&(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."));const t=[];for(let n=0;n<e.length;n+=1)t[n]=e.charCodeAt(n);return t},ot.CHARARRAY=function(e){return void 0===e?0:e.length},rt.USHORT=function(e){return[e>>8&255,255&e]},ot.USHORT=at(2),rt.SHORT=function(e){return e>=32768&&(e=-(65536-e)),[e>>8&255,255&e]},ot.SHORT=at(2),rt.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},ot.UINT24=at(3),rt.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},ot.ULONG=at(4),rt.LONG=function(e){return e>=nt&&(e=-(2*nt-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},ot.LONG=at(4),rt.FLOAT=function(e){if(e>32767.00001525879||e<-32768)throw new Error(`Value ${e} is outside the range of representable values in 16.16 format`);const t=Math.round(65536*e)|0;return rt.ULONG(t)},ot.FLOAT=ot.ULONG,rt.FIXED=rt.ULONG,ot.FIXED=ot.ULONG,rt.FWORD=rt.SHORT,ot.FWORD=ot.SHORT,rt.UFWORD=rt.USHORT,ot.UFWORD=ot.USHORT,rt.F2DOT14=function(e){return rt.USHORT(16384*e)},ot.F2DOT14=ot.USHORT,rt.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},ot.LONGDATETIME=at(8),rt.TAG=function(e){return tt.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},ot.TAG=at(4),rt.Card8=rt.BYTE,ot.Card8=ot.BYTE,rt.Card16=rt.USHORT,ot.Card16=ot.USHORT,rt.OffSize=rt.BYTE,ot.OffSize=ot.BYTE,rt.SID=rt.USHORT,ot.SID=ot.USHORT,rt.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?rt.NUMBER16(e):rt.NUMBER32(e)},ot.NUMBER=function(e){return rt.NUMBER(e).length},rt.NUMBER16=function(e){return[28,e>>8&255,255&e]},ot.NUMBER16=at(3),rt.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},ot.NUMBER32=at(5),rt.REAL=function(e){let t=e.toString();const n=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(n){const s=parseFloat("1e"+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*s)/s).toString()}let s="";for(let e=0,n=t.length;e<n;e+=1){const n=t[e];s+="e"===n?"-"===t[++e]?"c":"b":"."===n?"a":"-"===n?"e":n}s+=1&s.length?"f":"ff";const r=[30];for(let e=0,t=s.length;e<t;e+=2)r.push(parseInt(s.substr(e,2),16));return r},ot.REAL=function(e){return rt.REAL(e).length},rt.NAME=rt.CHARARRAY,ot.NAME=ot.CHARARRAY,rt.STRING=rt.CHARARRAY,ot.STRING=ot.CHARARRAY,st.UTF8=function(e,t,n){const s=[],r=n;for(let n=0;n<r;n++,t+=1)s[n]=e.getUint8(t);return String.fromCharCode.apply(null,s)},st.UTF16=function(e,t,n){const s=[],r=n/2;for(let n=0;n<r;n++,t+=2)s[n]=e.getUint16(t);return String.fromCharCode.apply(null,s)},rt.UTF16=function(e){const t=[];for(let n=0;n<e.length;n+=1){const s=e.charCodeAt(n);t[t.length]=s>>8&255,t[t.length]=255&s}return t},ot.UTF16=function(e){return 2*e.length};var it={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};st.MACSTRING=function(e,t,n,s){const r=it[s];if(void 0===r)return;let o="";for(let s=0;s<n;s++){const n=e.getUint8(t+s);o+=n<=127?String.fromCharCode(n):r[127&n]}return o};var lt,ut="function"==typeof WeakMap&&new WeakMap;function ct(e){return e>=-128&&e<=127}function pt(e,t,n){let s=0;const r=e.length;for(;t<r&&s<64&&0===e[t];)++t,++s;return n.push(128|s-1),t}function ht(e,t,n){let s=0;const r=e.length;let o=t;for(;o<r&&s<64;){const t=e[o];if(!ct(t))break;if(0===t&&o+1<r&&0===e[o+1])break;++o,++s}n.push(s-1);for(let s=t;s<o;++s)n.push(e[s]+256&255);return o}function ft(e,t,n){let s=0;const r=e.length;let o=t;for(;o<r&&s<64;){const t=e[o];if(0===t)break;if(ct(t)&&o+1<r&&ct(e[o+1]))break;++o,++s}n.push(64|s-1);for(let s=t;s<o;++s){const t=e[s];n.push(t+65536>>8&255,t+256&255)}return o}rt.MACSTRING=function(e,t){const n=function(e){if(!lt){lt={};for(let e in it)lt[e]=new String(e)}const t=lt[e];if(void 0===t)return;if(ut){const e=ut.get(t);if(void 0!==e)return e}const n=it[e];if(void 0===n)return;const s={};for(let e=0;e<n.length;e++)s[n.charCodeAt(e)]=e+128;return ut&&ut.set(t,s),s}(t);if(void 0===n)return;const s=[];for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>=128&&(r=n[r],void 0===r))return;s[t]=r}return s},ot.MACSTRING=function(e,t){const n=rt.MACSTRING(e,t);return void 0!==n?n.length:0},rt.VARDELTAS=function(e){let t=0;const n=[];for(;t<e.length;){const s=e[t];t=0===s?pt(e,t,n):s>=-128&&s<=127?ht(e,t,n):ft(e,t,n)}return n},rt.INDEX=function(e){let t=1;const n=[t],s=[];for(let r=0;r<e.length;r+=1){const o=rt.OBJECT(e[r]);Array.prototype.push.apply(s,o),t+=o.length,n.push(t)}if(0===s.length)return[0,0];const r=[],o=1+Math.floor(Math.log(t)/Math.log(2))/8|0,a=[void 0,rt.BYTE,rt.USHORT,rt.UINT24,rt.ULONG][o];for(let e=0;e<n.length;e+=1){const t=a(n[e]);Array.prototype.push.apply(r,t)}return Array.prototype.concat(rt.Card16(e.length),rt.OffSize(o),r,s)},ot.INDEX=function(e){return rt.INDEX(e).length},rt.DICT=function(e){let t=[];const n=Object.keys(e),s=n.length;for(let r=0;r<s;r+=1){const s=parseInt(n[r],0),o=e[s],a=rt.OPERAND(o.value,o.type),i=rt.OPERATOR(s);for(let e=0;e<a.length;e++)t.push(a[e]);for(let e=0;e<i.length;e++)t.push(i[e])}return t},ot.DICT=function(e){return rt.DICT(e).length},rt.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},rt.OPERAND=function(e,t){let n=[];if(Array.isArray(t))for(let s=0;s<t.length;s+=1){tt.argument(e.length===t.length,"Not enough arguments given for type"+t);const r=rt.OPERAND(e[s],t[s]);for(let e=0;e<r.length;e++)n.push(r[e])}else if("SID"===t){const t=rt.NUMBER(e);for(let e=0;e<t.length;e++)n.push(t[e])}else if("offset"===t){const t=rt.NUMBER32(e);for(let e=0;e<t.length;e++)n.push(t[e])}else if("number"===t){const t=rt.NUMBER(e);for(let e=0;e<t.length;e++)n.push(t[e])}else{if("real"!==t)throw new Error("Unknown operand type "+t);{const t=rt.REAL(e);for(let e=0;e<t.length;e++)n.push(t[e])}}return n},rt.OP=rt.BYTE,ot.OP=ot.BYTE;var dt="function"==typeof WeakMap&&new WeakMap;function gt(e,t,n){if(t&&t.length)for(let e=0;e<t.length;e+=1){const n=t[e];this[n.name]=n.value}if(this.tableName=e,this.fields=t,n){const e=Object.keys(n);for(let t=0;t<e.length;t+=1){const s=e[t],r=n[s];void 0!==this[s]&&(this[s]=r)}}}function mt(e,t,n){void 0===n&&(n=t.length);const s=new Array(t.length+1);s[0]={name:e+"Count",type:"USHORT",value:n};for(let n=0;n<t.length;n++)s[n+1]={name:e+n,type:"USHORT",value:t[n]};return s}function yt(e,t,n){const 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 vt(e,t,n){const s=t.length;let r=[];r[0]={name:e+"Count",type:"USHORT",value:s};for(let e=0;e<s;e++)r=r.concat(n(t[e],e));return r}function bt(e){1===e.format?gt.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(mt("glyph",e.glyphs))):2===e.format?gt.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(vt("rangeRecord",e.ranges,function(e,t){return[{name:"startGlyphID"+t,type:"USHORT",value:e.start},{name:"endGlyphID"+t,type:"USHORT",value:e.end},{name:"startCoverageIndex"+t,type:"USHORT",value:e.index}]}))):tt.assert(!1,"Coverage format must be 1 or 2.")}function St(e){gt.call(this,"scriptListTable",vt("scriptRecord",e,function(e,t){const n=e.script;let s=n.defaultLangSys;return tt.assert(!!s,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new gt("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new gt("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:s.reqFeatureIndex}].concat(mt("featureIndex",s.featureIndexes)))}].concat(vt("langSys",n.langSysRecords,function(e,t){const n=e.langSys;return[{name:"langSysTag"+t,type:"TAG",value:e.tag},{name:"langSys"+t,type:"TABLE",value:new gt("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:n.reqFeatureIndex}].concat(mt("featureIndex",n.featureIndexes)))}]})))}]}))}function xt(e){gt.call(this,"featureListTable",vt("featureRecord",e,function(e,t){const n=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new gt("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat(mt("lookupListIndex",n.lookupListIndexes)))}]}))}function Tt(e,t){gt.call(this,"lookupListTable",yt("lookup",e,function(e){let n=t[e.lookupType];return tt.assert(!!n,"Unable to write GSUB lookup type "+e.lookupType+" tables."),new gt("lookupTable",[{name:"lookupType",type:"USHORT",value:e.lookupType},{name:"lookupFlag",type:"USHORT",value:e.lookupFlag}].concat(yt("subtable",e.subtables,n)))}))}function Ot(e){1===e.format?gt.call(this,"classDefTable",[{name:"classFormat",type:"USHORT",value:1},{name:"startGlyphID",type:"USHORT",value:e.startGlyph}].concat(mt("glyph",e.classes))):2===e.format?gt.call(this,"classDefTable",[{name:"classFormat",type:"USHORT",value:2}].concat(vt("rangeRecord",e.ranges,function(e,t){return[{name:"startGlyphID"+t,type:"USHORT",value:e.start},{name:"endGlyphID"+t,type:"USHORT",value:e.end},{name:"class"+t,type:"USHORT",value:e.classId}]}))):tt.assert(!1,"Class format must be 1 or 2.")}rt.CHARSTRING=function(e){if(dt){const t=dt.get(e);if(void 0!==t)return t}let t=[];const n=e.length;for(let s=0;s<n;s+=1){const n=e[s],r=rt[n.type](n.value);for(let e=0;e<r.length;e++)t.push(r[e])}return dt&&dt.set(e,t),t},ot.CHARSTRING=function(e){return rt.CHARSTRING(e).length},rt.OBJECT=function(e){const t=rt[e.type];return tt.argument(void 0!==t,"No encoding function for type "+e.type),t(e.value)},ot.OBJECT=function(e){const t=ot[e.type];return tt.argument(void 0!==t,"No sizeOf function for type "+e.type),t(e.value)},rt.TABLE=function(e){let t=[];const n=(e.fields||[]).length,s=[],r=[];for(let o=0;o<n;o+=1){const n=e.fields[o],a=rt[n.type];tt.argument(void 0!==a,"No encoding function for field type "+n.type+" ("+n.name+")");let i=e[n.name];void 0===i&&(i=n.value);const l=a(i);if("TABLE"===n.type)null!==i.fields&&(r.push(t.length),s.push(l)),t.push(0,0);else for(let e=0;e<l.length;e++)t.push(l[e])}for(let n=0;n<s.length;n+=1){const o=r[n],a=t.length;tt.argument(a<65536,"Table "+e.tableName+" too big."),t[o]=a>>8,t[o+1]=255&a;for(let e=0;e<s[n].length;e++)t.push(s[n][e])}return t},ot.TABLE=function(e){let t=0;const n=(e.fields||[]).length;for(let s=0;s<n;s+=1){const n=e.fields[s],r=ot[n.type];tt.argument(void 0!==r,"No sizeOf function for field type "+n.type+" ("+n.name+")");let o=e[n.name];void 0===o&&(o=n.value),t+=r(o),"TABLE"===n.type&&(t+=2)}return t},rt.RECORD=rt.TABLE,ot.RECORD=ot.TABLE,rt.LITERAL=function(e){return e},ot.LITERAL=function(e){return e.length},gt.prototype.encode=function(){return rt.TABLE(this)},gt.prototype.sizeOf=function(){return ot.TABLE(this)},bt.prototype=Object.create(gt.prototype),bt.prototype.constructor=bt,St.prototype=Object.create(gt.prototype),St.prototype.constructor=St,xt.prototype=Object.create(gt.prototype),xt.prototype.constructor=xt,Tt.prototype=Object.create(gt.prototype),Tt.prototype.constructor=Tt,Ot.prototype=Object.create(gt.prototype),Ot.prototype.constructor=Ot;var kt={Table:gt,Record:gt,Coverage:bt,ClassDef:Ot,ScriptList:St,FeatureList:xt,LookupList:Tt,ushortList:mt,tableList:yt,recordList:vt};function wt(e,t){return e.getUint8(t)}function It(e,t){return e.getUint16(t,!1)}function Ut(e,t){return(e.getUint16(t)<<8)+e.getUint8(t+2)}function Rt(e,t){return e.getUint32(t,!1)}function Lt(e,t){return e.getInt16(t,!1)+e.getUint16(t+2,!1)/65535}var Ct={byte:1,uShort:2,f2dot14:2,short:2,uInt24:3,uLong:4,fixed:4,longDateTime:8,tag:4},Et=32768,Dt=32767,Mt=32768,Ft=4095,At=32768,Nt=16384,Pt=8192,Bt=4095,Gt=128,Ht=127,_t=128,Vt=64,zt=63,jt=15,qt=48;function Wt(e,t){this.data=e,this.offset=t,this.relativeOffset=0}Wt.prototype.parseByte=function(){const e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},Wt.prototype.parseChar=function(){const e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},Wt.prototype.parseCard8=Wt.prototype.parseByte,Wt.prototype.parseUShort=function(){const e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},Wt.prototype.parseCard16=Wt.prototype.parseUShort,Wt.prototype.parseSID=Wt.prototype.parseUShort,Wt.prototype.parseOffset16=Wt.prototype.parseUShort,Wt.prototype.parseShort=function(){const e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},Wt.prototype.parseF2Dot14=function(){const e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},Wt.prototype.parseUInt24=function(){const e=Ut(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=3,e},Wt.prototype.parseULong=function(){const e=Rt(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},Wt.prototype.parseLong=function(){const e=(t=this.data,n=this.offset+this.relativeOffset,t.getInt32(n,!1));var t,n;return this.relativeOffset+=4,e},Wt.prototype.parseOffset32=Wt.prototype.parseULong,Wt.prototype.parseFixed=function(){const e=Lt(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},Wt.prototype.parseString=function(e){const t=this.data,n=this.offset+this.relativeOffset;let s="";this.relativeOffset+=e;for(let r=0;r<e;r++)s+=String.fromCharCode(t.getUint8(n+r));return s},Wt.prototype.parseTag=function(){return this.parseString(4)},Wt.prototype.parseLongDateTime=function(){let e=Rt(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},Wt.prototype.parseVersion=function(e){const t=It(this.data,this.offset+this.relativeOffset),n=It(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,void 0===e&&(e=4096),t+n/e/10},Wt.prototype.skip=function(e,t){void 0===t&&(t=1),this.relativeOffset+=Ct[e]*t},Wt.prototype.parseULongList=function(e){void 0===e&&(e=this.parseULong());const t=new Array(e),n=this.data;let s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint32(s),s+=4;return this.relativeOffset+=4*e,t},Wt.prototype.parseOffset16List=Wt.prototype.parseUShortList=function(e){void 0===e&&(e=this.parseUShort());const t=new Array(e),n=this.data;let s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint16(s),s+=2;return this.relativeOffset+=2*e,t},Wt.prototype.parseShortList=function(e){const t=new Array(e),n=this.data;let s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getInt16(s),s+=2;return this.relativeOffset+=2*e,t},Wt.prototype.parseByteList=function(e){const t=new Array(e),n=this.data;let s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint8(s++);return this.relativeOffset+=e,t},Wt.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());const n=new Array(e);for(let s=0;s<e;s++)n[s]=t.call(this);return n},Wt.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());const n=new Array(e);for(let s=0;s<e;s++)n[s]=t.call(this);return n},Wt.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());const n=new Array(e),s=Object.keys(t);for(let r=0;r<e;r++){const e={};for(let n=0;n<s.length;n++){const r=s[n],o=t[r];e[r]=o.call(this)}n[r]=e}return n},Wt.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());const n=new Array(e),s=Object.keys(t);for(let r=0;r<e;r++){const e={};for(let n=0;n<s.length;n++){const r=s[n],o=t[r];e[r]=o.call(this)}n[r]=e}return n},Wt.prototype.parseTupleRecords=function(e,t){let n=[];for(let s=0;s<e;s++){let e=[];for(let n=0;n<t;n++)e.push(this.parseF2Dot14());n.push(e)}return n},Wt.prototype.parseStruct=function(e){if("function"==typeof e)return e.call(this);{const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const r=t[s],o=e[r];n[r]=o.call(this)}return n}},Wt.prototype.parseValueRecord=function(e){if(void 0===e&&(e=this.parseUShort()),0===e)return;const t={};return 1&e&&(t.xPlacement=this.parseShort()),2&e&&(t.yPlacement=this.parseShort()),4&e&&(t.xAdvance=this.parseShort()),8&e&&(t.yAdvance=this.parseShort()),16&e&&(t.xPlaDevice=void 0,this.parseShort()),32&e&&(t.yPlaDevice=void 0,this.parseShort()),64&e&&(t.xAdvDevice=void 0,this.parseShort()),128&e&&(t.yAdvDevice=void 0,this.parseShort()),t},Wt.prototype.parseValueRecordList=function(){const e=this.parseUShort(),t=this.parseUShort(),n=new Array(t);for(let s=0;s<t;s++)n[s]=this.parseValueRecord(e);return n},Wt.prototype.parsePointer=function(e){const t=this.parseOffset16();if(t>0)return new Wt(this.data,this.offset+t).parseStruct(e)},Wt.prototype.parsePointer32=function(e){const t=this.parseOffset32();if(t>0)return new Wt(this.data,this.offset+t).parseStruct(e)},Wt.prototype.parseListOfLists=function(e){const t=this.parseOffset16List(),n=t.length,s=this.relativeOffset,r=new Array(n);for(let s=0;s<n;s++){const n=t[s];if(0!==n)if(this.relativeOffset=n,e){const t=this.parseOffset16List(),o=new Array(t.length);for(let s=0;s<t.length;s++)this.relativeOffset=n+t[s],o[s]=e.call(this);r[s]=o}else r[s]=this.parseUShortList();else r[s]=void 0}return this.relativeOffset=s,r},Wt.prototype.parseCoverage=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort(),n=this.parseUShort();if(1===t)return{format:1,glyphs:this.parseUShortList(n)};if(2===t){const e=new Array(n);for(let t=0;t<n;t++)e[t]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:e}}throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.")},Wt.prototype.parseClassDef=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()}:2===t?{format:2,ranges:this.parseRecordList({start:Wt.uShort,end:Wt.uShort,classId:Wt.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})},Wt.list=function(e,t){return function(){return this.parseList(e,t)}},Wt.list32=function(e,t){return function(){return this.parseList32(e,t)}},Wt.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},Wt.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},Wt.pointer=function(e){return function(){return this.parsePointer(e)}},Wt.pointer32=function(e){return function(){return this.parsePointer32(e)}},Wt.tag=Wt.prototype.parseTag,Wt.byte=Wt.prototype.parseByte,Wt.uShort=Wt.offset16=Wt.prototype.parseUShort,Wt.uShortList=Wt.prototype.parseUShortList,Wt.uInt24=Wt.prototype.parseUInt24,Wt.uLong=Wt.offset32=Wt.prototype.parseULong,Wt.uLongList=Wt.prototype.parseULongList,Wt.fixed=Wt.prototype.parseFixed,Wt.f2Dot14=Wt.prototype.parseF2Dot14,Wt.struct=Wt.prototype.parseStruct,Wt.coverage=Wt.prototype.parseCoverage,Wt.classDef=Wt.prototype.parseClassDef;var $t={reserved:Wt.uShort,reqFeatureIndex:Wt.uShort,featureIndexes:Wt.uShortList};Wt.prototype.parseScriptList=function(){return this.parsePointer(Wt.recordList({tag:Wt.tag,script:Wt.pointer({defaultLangSys:Wt.pointer($t),langSysRecords:Wt.recordList({tag:Wt.tag,langSys:Wt.pointer($t)})})}))||[]},Wt.prototype.parseFeatureList=function(){return this.parsePointer(Wt.recordList({tag:Wt.tag,feature:Wt.pointer({featureParams:Wt.offset16,lookupListIndexes:Wt.uShortList})}))||[]},Wt.prototype.parseLookupList=function(e){return this.parsePointer(Wt.list(Wt.pointer(function(){const t=this.parseUShort();tt.argument(1<=t&&t<=9,"GPOS/GSUB lookup type "+t+" unknown.");const n=this.parseUShort(),s=16&n;return{lookupType:t,lookupFlag:n,subtables:this.parseList(Wt.pointer(e[t])),markFilteringSet:s?this.parseUShort():void 0}})))||[]},Wt.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){const e=this.parseUShort(),t=this.parseUShort();tt.argument(1===e&&t<1,"GPOS/GSUB feature variations table unknown.");return this.parseRecordList32({conditionSetOffset:Wt.offset32,featureTableSubstitutionOffset:Wt.offset32})})||[]},Wt.prototype.parseVariationStore=function(){const e=this.relativeOffset,t=this.parseUShort(),n={itemVariationStore:this.parseItemVariationStore()};return this.relativeOffset=e+t+2,n},Wt.prototype.parseItemVariationStore=function(){const 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 n=0;n<s;n++){const s=r[n];this.relativeOffset=e+s,t.itemVariationSubtables.push(this.parseItemVariationSubtable())}return t},Wt.prototype.parseVariationRegionList=function(){const e=this.parseUShort(),t=this.parseUShort();return this.parseRecordList(t,{regionAxes:Wt.recordList(e,{startCoord:Wt.f2Dot14,peakCoord:Wt.f2Dot14,endCoord:Wt.f2Dot14})})},Wt.prototype.parseItemVariationSubtable=function(){const e=this.parseUShort(),t=this.parseUShort(),n=this.parseUShortList(),s=n.length;return{regionIndexes:n,deltaSets:e&&s?this.parseDeltaSets(e,t,s):[]}},Wt.prototype.parseDeltaSetIndexMap=function(){const e=this.parseByte(),t=this.parseByte(),n=[];let 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};const r=1+(t&jt),o=1+((t&qt)>>4);for(let e=0;e<s;e++){let e;if(1===o)e=this.parseByte();else if(2===o)e=this.parseUShort();else if(3===o)e=this.parseUInt24();else{if(4!==o)throw new Error(`Invalid entry size of ${o}`);e=this.getULong()}const t=e>>r,s=e&(1<<r)-1;n.push({outerIndex:t,innerIndex:s})}return{format:e,entryFormat:t,map:n}},Wt.prototype.parseDeltaSets=function(e,t,n){const s=Array.from({length:e},()=>[]),r=t&Et,o=t&Dt;if(o>n)throw Error("wordCount must be less than or equal to regionIndexCount");const a=(r?this.parseLong:this.parseShort).bind(this),i=(r?this.parseShort:this.parseChar).bind(this);for(let t=0;t<e;t++)for(let e=0;e<n;e++)e<o?s[t].push(a()):s[t].push(i());return s},Wt.prototype.parseTupleVariationStoreList=function(e,t,n){const s=this.parseUShort(),r=1&this.parseUShort(),o=this.parseOffset32(),a=(r?this.parseULong:this.parseUShort).bind(this),i={};let l,u=a();r||(u*=2);for(let c=0;c<s;c++){l=a(),r||(l*=2);const s=l-u;i[c]=s?this.parseTupleVariationStore(o+u,e,t,n,c):void 0,u=l}return i},Wt.prototype.parseTupleVariationStore=function(e,t,n,s,r){const o=this.relativeOffset;this.relativeOffset=e,"cvar"===n&&(this.relativeOffset+=4);const a=this.parseUShort(),i=!!(a&Mt),l=a&Ft;let u=this.parseOffset16();const c=[];let p=[];for(let e=0;e<l;e++){const e=this.parseTupleVariationHeader(t,n);c.push(e)}this.relativeOffset!==e+u&&(console.warn(`Unexpected offset after parsing tuple variation headers! Expected ${e+u}, actually ${this.relativeOffset}`),this.relativeOffset=e+u),i&&(p=this.parsePackedPointNumbers());let h=this.relativeOffset;for(let e=0;e<l;e++){const t=c[e];t.privatePoints=[],this.relativeOffset=h,"cvar"!==n||t.peakTuple||console.warn("An embedded peak tuple is required in TupleVariationHeaders for the cvar table."),t.flags.privatePointNumbers&&(t.privatePoints=this.parsePackedPointNumbers()),delete t.flags;const o=this.offset,a=this.relativeOffset,i=e=>{let i,l;const u=()=>{let e=0;if("gvar"===n){if(e=t.privatePoints.length||p.length,!e){const t=s.get(r);t.path,e=t.points.length,e+=4}}else"cvar"===n&&(e=s.length);this.offset=o,this.relativeOffset=a,i=this.parsePackedDeltas(e),"gvar"===n&&(l=this.parsePackedDeltas(e))};return{configurable:!0,get:function(){return void 0===i&&u(),"deltasY"===e?l:i},set:function(t){void 0===i&&u(),"deltasY"===e?l=t:i=t}}};Object.defineProperty(t,"deltas",i.call(this,"deltas")),"gvar"===n&&Object.defineProperty(t,"deltasY",i.call(this,"deltasY")),h+=t.variationDataSize,delete t.variationDataSize}this.relativeOffset=o;const f={headers:c};return f.sharedPoints=p,f},Wt.prototype.parseTupleVariationHeader=function(e,t){const n=this.parseUShort(),s=this.parseUShort(),r=!!(s&At),o=!!(s&Nt),a=!!(s&Pt),i=r?void 0:s&Bt,l={variationDataSize:n,peakTuple:r?this.parseTupleRecords(1,e)[0]:void 0,intermediateStartTuple:o?this.parseTupleRecords(1,e)[0]:void 0,intermediateEndTuple:o?this.parseTupleRecords(1,e)[0]:void 0,flags:{embeddedPeakTuple:r,intermediateRegion:o,privatePointNumbers:a}};return"gvar"===t&&(l.sharedTupleRecordsIndex=i),l},Wt.prototype.parsePackedPointNumbers=function(){const e=this.parseByte(),t=[];let n=e;if(e>=128){const t=this.parseByte();n=(e&Ht)<<8|t}let s=0;for(;t.length<n;){const e=this.parseByte(),r=!!(e&Gt);let o=1+(e&Ht);for(let e=0;e<o&&t.length<n;e++){let e;e=r?this.parseUShort():this.parseByte(),s+=e,t.push(s)}}return t},Wt.prototype.parsePackedDeltas=function(e){const t=[];for(;t.length<e;){const n=this.parseByte(),s=!!(n&_t),r=!!(n&Vt),o=1+(n&zt);for(let n=0;n<o&&t.length<e;n++)s?t.push(0):r?t.push(this.parseShort()):t.push(this.parseChar())}return t};var Xt={getByte:wt,getCard8:wt,getUShort:It,getCard16:It,getShort:function(e,t){return e.getInt16(t,!1)},getUInt24:Ut,getULong:Rt,getFixed:Lt,getTag:function(e,t){let n="";for(let s=t;s<t+4;s+=1)n+=String.fromCharCode(e.getInt8(s));return n},getOffset:function(e,t,n){let s=0;for(let r=0;r<n;r+=1)s<<=8,s+=e.getUint8(t+r);return s},getBytes:function(e,t,n){const s=[];for(let r=t;r<n;r+=1)s.push(e.getUint8(r));return s},bytesToString:function(e){let t="";for(let n=0;n<e.length;n+=1)t+=String.fromCharCode(e[n]);return t},Parser:Wt},Yt=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],Zt={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"},Qt={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},Kt={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 Jt(e,t,n){switch(e){case 0:if(65535===t)return"und";if(n)return n[t];break;case 1:return Zt[t];case 3:return Kt[t]}}var en="utf-16",tn={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"},nn={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 sn(e,t,n){switch(e){case 0:return en;case 1:return nn[n]||tn[t];case 3:if(1===t||10===t)return en}}var rn={0:"unicode",1:"macintosh",2:"reserved",3:"windows"};function on(e){return rn[e]}function an(e){const t={};for(let n in e)t[e[n]]=parseInt(n);return t}function ln(e,t,n,s,r,o){return new kt.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 un(e,t){let n=function(e,t){const n=e.length,s=t.length-n+1;e:for(let r=0;r<s;r++)for(;r<s;r++){for(let s=0;s<n;s++)if(t[r+s]!==e[s])continue e;return r}return-1}(e,t);if(n<0){n=t.length;let s=0;const r=e.length;for(;s<r;++s)t.push(e[s])}return n}function cn(e,t,n=[]){if(t<256&&t in Yt){if(n.length&&!n.includes(parseInt(t)))return;t=Yt[t]}for(let n in e)for(let s in e[n])if(s===t||parseInt(s)===t)return e[n][s]}var pn={parse:function(e,t,n){const s={},r=new Xt.Parser(e,t),o=r.parseUShort(),a=r.parseUShort(),i=r.offset+r.parseUShort();for(let t=0;t<a;t++){const t=r.parseUShort(),o=r.parseUShort(),a=r.parseUShort(),l=r.parseUShort(),u=Yt[l]||l,c=r.parseUShort(),p=r.parseUShort(),h=Jt(t,a,n),f=sn(t,o,a),d=on(t);if(void 0!==f&&void 0!==h&&void 0!==d){let t;if(t=f===en?st.UTF16(e,i+p,c):st.MACSTRING(e,i+p,c,f),t){let e=s[d];void 0===e&&(e=s[d]={});let n=e[u];void 0===n&&(n=e[u]={}),n[h]=t}}}return 1===o&&r.parseUShort(),s},make:function(e,t){const n=an(rn),s=an(Zt),r=an(Kt),o=[],a=[];for(let i in e){let l;const u=[],c={},p=an(Yt),h=n[i];for(let t in e[i]){let n=p[t];if(void 0===n&&(n=t),l=parseInt(n),isNaN(l))throw new Error('Name table entry "'+t+'" does not exist, see nameTableNames for complete list.');c[l]=e[i][t],u.push(l)}for(let e=0;e<u.length;e++){l=u[e];const n=c[l];for(let e in n){const i=n[e];if(1===h||0===h){let n=s[e],r=Qt[n];const u=sn(h,r,n);let c=rt.MACSTRING(i,u);if(0===h&&(n=t.indexOf(e),n<0&&(n=t.length,t.push(e)),r=4,c=rt.UTF16(i)),void 0!==c){const e=un(c,a);o.push(ln(h,r,n,l,c.length,e))}}if(3===h){const t=r[e];if(void 0!==t){const e=rt.UTF16(i),n=un(e,a);o.push(ln(3,1,t,l,e.length,n))}}}}}o.sort(function(e,t){return e.platformID-t.platformID||e.encodingID-t.encodingID||e.languageID-t.languageID||e.nameID-t.nameID});const i=new kt.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:o.length},{name:"stringOffset",type:"USHORT",value:6+12*o.length}]);for(let e=0;e<o.length;e++)i.fields.push({name:"record_"+e,type:"RECORD",value:o[e]});return i.fields.push({name:"strings",type:"LITERAL",value:a}),i},getNameByID:cn};function hn(e,t,n){e.segments.push({end:t,start:t,delta:-(t-n),offset:0,glyphIndex:n})}var fn={parse:function(e,t){const n={};n.version=Xt.getUShort(e,t),tt.argument(0===n.version,"cmap table version should be 0."),n.numTables=Xt.getUShort(e,t+2);let s=null,r=-1,o=-1,a=null,i=null;const l=[0,1,2,3,4,6],u=[0,1,10];for(let c=n.numTables-1;c>=0;c-=1)if(a=Xt.getUShort(e,t+4+8*c),i=Xt.getUShort(e,t+4+8*c+2),3===a&&u.includes(i)||0===a&&l.includes(i)||1===a&&0===i){if(o>0)continue;if(o=Xt.getULong(e,t+4+8*c+4),s)break}else if(0===a&&5===i)if(r=Xt.getULong(e,t+4+8*c+4),s=new Xt.Parser(e,t+r),14!==s.parseUShort())r=-1,s=null;else if(o>0)break;if(-1===o)throw new Error("No valid cmap sub-tables found.");const c=new Xt.Parser(e,t+o);if(n.format=c.parseUShort(),0===n.format)!function(e,t,n,s){e.length=t.parseUShort(),e.language=t.parseUShort()-1;const r=t.parseByteList(e.length),o=Object.assign({},r),a=sn(n,s,e.language),i=it[a];for(let e=0;e<i.length;e++)o[i.charCodeAt(e)]=r[128+e];e.glyphIndexMap=o}(n,c,a,i);else if(12===n.format||13===n.format)!function(e,t,n){let s;t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong(),e.groupCount=s=t.parseULong(),e.glyphIndexMap={};for(let r=0;r<s;r+=1){const s=t.parseULong(),r=t.parseULong();let o=t.parseULong();for(let t=s;t<=r;t+=1)e.glyphIndexMap[t]=o,12===n&&o++}}(n,c,n.format);else{if(4!==n.format)throw new Error("Only format 0 (platformId 1, encodingId 0), 4, 12 and 14 cmap tables are supported (found format "+n.format+", platformId "+a+", encodingId "+i+").");!function(e,t,n,s,r){let o;e.length=t.parseUShort(),e.language=t.parseUShort(),e.segCount=o=t.parseUShort()>>1,t.skip("uShort",3),e.glyphIndexMap={};const a=new Xt.Parser(n,s+r+14),i=new Xt.Parser(n,s+r+16+2*o),l=new Xt.Parser(n,s+r+16+4*o),u=new Xt.Parser(n,s+r+16+6*o);let c=s+r+16+8*o;for(let t=0;t<o-1;t+=1){let t;const s=a.parseUShort(),r=i.parseUShort(),o=l.parseShort(),p=u.parseUShort();for(let a=r;a<=s;a+=1)0!==p?(c=u.offset+u.relativeOffset-2,c+=p,c+=2*(a-r),t=Xt.getUShort(n,c),0!==t&&(t=t+o&65535)):t=a+o&65535,e.glyphIndexMap[a]=t}}(n,c,e,t,o)}return s&&function(e,t){const n={};t.skip("uLong");const s=t.parseULong();for(let e=0;e<s;e+=1){const e=t.parseUInt24(),s={varSelector:e},r=t.parseOffset32(),o=t.parseOffset32(),a=t.relativeOffset;r&&(t.relativeOffset=r,s.defaultUVS=t.parseStruct({ranges:function(){return t.parseRecordList32({startUnicodeValue:t.parseUInt24,additionalCount:t.parseByte})}})),o&&(t.relativeOffset=o,s.nonDefaultUVS=t.parseStruct({uvsMappings:function(){const e={},n=t.parseRecordList32({unicodeValue:t.parseUInt24,glyphID:t.parseUShort});for(let t=0;t<n.length;t+=1)e[n[t].unicodeValue]=n[t];return e}})),n[e]=s,t.relativeOffset=a}e.varSelectorList=n}(n,s),n},make:function(e){let t,n=!0;for(t=e.length-1;t>0;t-=1){if(e.get(t).unicode>65535){console.log("Adding CMAP format 12 (needed!)"),n=!1;break}}let s=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:n?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:n?12:20}];n||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});const r=new kt.Table("cmap",s);for(r.segments=[],t=0;t<e.length;t+=1){const n=e.get(t);for(let e=0;e<n.unicodes.length;e+=1)hn(r,n.unicodes[e],t)}r.segments.sort(function(e,t){return e.start-t.start}),function(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}(r);const o=r.segments.length;let a=0,i=[],l=[],u=[],c=[],p=[],h=[];for(t=0;t<o;t+=1){const e=r.segments[t];e.end<=65535&&e.start<=65535?(i.push({name:"end_"+t,type:"USHORT",value:e.end}),l.push({name:"start_"+t,type:"USHORT",value:e.start}),u.push({name:"idDelta_"+t,type:"SHORT",value:e.delta}),c.push({name:"idRangeOffset_"+t,type:"USHORT",value:e.offset}),void 0!==e.glyphId&&p.push({name:"glyph_"+t,type:"USHORT",value:e.glyphId})):a+=1,n||void 0===e.glyphIndex||(h.push({name:"cmap12Start_"+t,type:"ULONG",value:e.start}),h.push({name:"cmap12End_"+t,type:"ULONG",value:e.end}),h.push({name:"cmap12Glyph_"+t,type:"ULONG",value:e.glyphIndex}))}r.segCountX2=2*(o-a),r.searchRange=2*Math.pow(2,Math.floor(Math.log(o-a)/Math.log(2))),r.entrySelector=Math.log(r.searchRange/2)/Math.log(2),r.rangeShift=r.segCountX2-r.searchRange;for(let e=0;e<i.length;e++)r.fields.push(i[e]);r.fields.push({name:"reservedPad",type:"USHORT",value:0});for(let e=0;e<l.length;e++)r.fields.push(l[e]);for(let e=0;e<u.length;e++)r.fields.push(u[e]);for(let e=0;e<c.length;e++)r.fields.push(c[e]);for(let e=0;e<p.length;e++)r.fields.push(p[e]);if(r.cmap4Length=14+2*i.length+2+2*l.length+2*u.length+2*c.length+2*p.length,!n){const e=16+4*h.length;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:e},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:h.length/3});for(let e=0;e<h.length;e++)r.fields.push(h[e])}return r}},dn=[".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"],gn=[".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"],mn=[".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"],yn=[".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"],vn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],bn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],Sn=[".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 xn(e){this.font=e}function Tn(e){this.cmap=e}function On(e,t){this.encoding=e,this.charset=t}function kn(e){switch(e.version){case 1:this.names=Sn.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(let t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<Sn.length?this.names[t]=Sn[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-Sn.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(let t=0;t<e.numberOfGlyphs;t++)this.names[t]=Sn[t+e.glyphNameIndex[t]];break;default:this.names=[]}}function wn(e,t){t.lowMemory?function(e){e._IndexToUnicodeMap={};const t=e.tables.cmap.glyphIndexMap,n=Object.keys(t);for(let s=0;s<n.length;s+=1){const r=n[s];let o=t[r];void 0===e._IndexToUnicodeMap[o]?e._IndexToUnicodeMap[o]={unicodes:[parseInt(r)]}:e._IndexToUnicodeMap[o].unicodes.push(parseInt(r))}}(e):function(e){let t;const n=e.tables.cmap.glyphIndexMap,s=Object.keys(n);for(let r=0;r<s.length;r+=1){const o=s[r],a=n[o];t=e.glyphs.get(a),t.addUnicode(parseInt(o))}for(let n=0;n<e.glyphs.length;n+=1)t=e.glyphs.get(n),e.cffEncoding?t.name=e.cffEncoding.charset[n]:e.glyphNames.names&&(t.name=e.glyphNames.glyphIndexToName(n))}(e)}xn.prototype.charToGlyphIndex=function(e){const t=e.codePointAt(0),n=this.font.glyphs;if(n)for(let e=0;e<n.length;e+=1){const s=n.get(e);for(let n=0;n<s.unicodes.length;n+=1)if(s.unicodes[n]===t)return e}return null},Tn.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0},On.prototype.charToGlyphIndex=function(e){const t=e.codePointAt(0),n=this.encoding[t];return this.charset.indexOf(n)},kn.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},kn.prototype.glyphIndexToName=function(e){return this.names[e]};var In={line:function(e,t,n,s,r){e.beginPath(),e.moveTo(t,n),e.lineTo(s,r),e.stroke()}};function Un(e){var t=(4278190080&e)>>24,n=(16711680&e)>>16,s=(65280&e)>>8,r=255&e;return{b:t=t+256&255,g:n=n+256&255,r:s=s+256&255,a:r=(r+256&255)/255}}function Rn(e,t,n=0,s="hexa"){if(65535==t)return"currentColor";const 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})`);const o=r.colorRecordIndices[n]+t;if(o>r.colorRecords)throw new Error(`Color index out of range (colorRecords.length: ${r.colorRecords.length}, lookupIndex: ${o})`);const a=Un(r.colorRecords[o]);return"bgra"===s?a:Dn(a,s)}function Ln(e){return("0"+parseInt(e).toString(16)).slice(-2)}function Cn(e){return parseInt(`0x${Ln(e.b)}${Ln(e.g)}${Ln(e.r)}${Ln(255*e.a)}`,16)}function En(e,t="hexa"){const n="raw"==t||"cpal"==t,s=Number.isInteger(e);let r=!0;if(s&&n||"currentColor"===e)return e;if("object"==typeof e){if("bgra"==t)return e;if(n)return Cn(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)).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}}if("bgra"==t)return e}else if("undefined"!=typeof document&&/^[a-z]+$/i.test(e)){const t=document.createElement("canvas").getContext("2d");t.fillStyle=e;const n=Dn(t.fillStyle,"hexa");"#000000ff"===n&&"black"!==e.toLowerCase()?r=!1:e=n}else{e=e.trim();const t=/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(t.test(e)){const n=e.match(t).filter(e=>void 0!==e);e={r:Math.round(parseFloat(n[1])/(n[2]?100/255:1)),g:Math.round(parseFloat(n[3])/(n[4]?100/255:1)),b:Math.round(parseFloat(n[5])/(n[6]?100/255:1)),a:n[7]?parseFloat(n[7])/(n[8]?100:1):1}}else{const t=/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(t.test(e)){const n=e.match(t).filter(e=>void 0!==e);e=function(e){let{h:t,s:n,l:s,a:r}=e;t%=360,n/=100,s/=100;const o=(1-Math.abs(2*s-1))*n,a=o*(1-Math.abs(t/60%2-1)),i=s-o/2;let l=0,u=0,c=0;return 0<=t&&t<60?(l=o,u=a,c=0):60<=t&&t<120?(l=a,u=o,c=0):120<=t&&t<180?(l=0,u=o,c=a):180<=t&&t<240?(l=0,u=a,c=o):240<=t&&t<300?(l=a,u=0,c=o):300<=t&&t<=360&&(l=o,u=0,c=a),{r:Math.round(255*(l+i)),g:Math.round(255*(u+i)),b:Math.round(255*(c+i)),a:r}}({h:parseFloat(n[1])*("turn"===n[2]?360:1),s:parseFloat(n[3]),l:parseFloat(n[4]),a:n[5]?parseFloat(n[5])/(n[6]?100:1):1})}else r=!1}}if(!r)throw new Error(`Invalid color format: ${e}`);return Dn(e,t)}function Dn(e,t="hexa"){if("currentColor"===e)return e;if(Number.isInteger(e)){if("raw"==t||"cpal"==t)return e;e=Un(e)}else"object"!=typeof e&&(e=En(e,"bgra"));let n=["hsl","hsla"].includes(t)?function(e){const t=e.r/255,n=e.g/255,s=e.b/255,r=Math.max(t,n,s),o=Math.min(t,n,s);let a,i,l=(r+o)/2;if(r===o)a=i=0;else{const e=r-o;switch(i=l>.5?e/(2-r-o):e/(r+o),r){case t:a=(n-s)/e+(n<s?6:0);break;case n:a=(s-t)/e+2;break;case s:a=(t-n)/e+4}a/=6}return{h:360*a,s:100*i,l:100*l}}(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`#${Ln(e.r)}${Ln(e.g)}${Ln(e.b)}`;case"hexa":case"hex8":case"hex-8":return`#${Ln(e.r)}${Ln(e.g)}${Ln(e.b)}${Ln(255*e.a)}`;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 Cn(e);default:throw new Error("Unknown color format: "+t)}}var Mn={parse:function(e,t){const n=new Wt(e,t),s=n.parseShort();0!==s&&console.warn("Only CPALv0 is currently fully supported.");const r=n.parseShort(),o=n.parseShort(),a=n.parseShort(),i=n.parseOffset32(),l=n.parseUShortList(o);n.relativeOffset=i;const u=n.parseULongList(a);return n.relativeOffset=i,{version:s,numPaletteEntries:r,colorRecords:u,colorRecordIndices:l}},make:function({version:e=0,numPaletteEntries:t=0,colorRecords:n=[],colorRecordIndices:s=[0]}){return tt.argument(0===e,"Only CPALv0 are supported."),tt.argument(n.length,"No colorRecords given."),tt.argument(s.length,"No colorRecordIndices given."),s.length>1&&tt.argument(t,"Can't infer numPaletteEntries on multiple colorRecordIndices"),new kt.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((e,t)=>({name:"colorRecordIndices_"+t,type:"USHORT",value:e})),...n.map((e,t)=>({name:"colorRecords_"+t,type:"ULONG",value:e}))])},getPaletteColor:Rn,parseColor:En,formatColor:Dn};function Fn(e){this.bindConstructorValues(e)}Fn.prototype.bindConstructorValues=function(e){if(this.index=e.index||0,".notdef"===e.name?e.unicode=void 0:".null"===e.name&&(e.unicode=0),0===e.unicode&&".null"!==e.name)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||(void 0!==e.unicode?[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",function(e,t){let n=t||new Ke;return{configurable:!0,get:function(){return"function"==typeof n&&(n=n()),n},set:function(e){n=e}}}(0,e.path))},Fn.prototype.addUnicode=function(e){0===this.unicodes.length&&(this.unicode=e),this.unicodes.push(e)},Fn.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},Fn.prototype.getPath=function(e,t,n,s,r){let o,a;e=void 0!==e?e:0,t=void 0!==t?t:0,n=void 0!==n?n:72;let i=(s=Object.assign({},r&&r.defaultRenderOptions,s)).xScale,l=s.yScale;const u=1/(this.path.unitsPerEm||1e3)*n;let c=this;r&&r.variation&&(c=r.variation.getTransform(this,s.variation),o=c.path.commands),s.hinting&&r&&r.hinting&&(a=c.path&&r.hinting.exec(c,n,s)),a?(o=r.hinting.getCommands(a),e=Math.round(e),t=Math.round(t),i=l=1):(o=c.path.commands,void 0===i&&(i=u),void 0===l&&(l=u));const p=new Ke;if(s.drawSVG){const n=this.getSvgImage(r);if(n){const s=new Ke;return s._image={image:n.image,x:e+n.leftSideBearing*u,y:t-n.baseline*u,width:n.image.width*u,height:n.image.height*u},p._layers=[s],p}}if(s.drawLayers){const o=this.getLayers(r);if(o&&o.length){p._layers=[];for(let a=0;a<o.length;a+=1){const i=o[a];let l=Rn(r,i.paletteIndex,s.usePalette);l="currentColor"===l?s.fill||"black":Dn(l,s.colorFormat||"rgba"),s=Object.assign({},s,{fill:l}),p._layers.push(this.getPath.call(i.glyph,e,t,n,s,r))}return p}}p.fill=s.fill||this.path.fill,p.stroke=this.path.stroke,p.strokeWidth=this.path.strokeWidth*u;for(let n=0;n<o.length;n+=1){const s=o[n];"M"===s.type?p.moveTo(e+s.x*i,t+-s.y*l):"L"===s.type?p.lineTo(e+s.x*i,t+-s.y*l):"Q"===s.type?p.quadraticCurveTo(e+s.x1*i,t+-s.y1*l,e+s.x*i,t+-s.y*l):"C"===s.type?p.curveTo(e+s.x1*i,t+-s.y1*l,e+s.x2*i,t+-s.y2*l,e+s.x*i,t+-s.y*l):"Z"===s.type&&p.stroke&&p.strokeWidth&&p.closePath()}return p},Fn.prototype.getLayers=function(e){if(!e)throw Error("The font object is required to read the colr/cpal tables in order to get the layers.");return e.layers.get(this.index)},Fn.prototype.getSvgImage=function(e){if(!e)throw Error("The font object is required to read the svg table in order to get the image.");return e.svgImages.get(this.index)},Fn.prototype.getContours=function(e=null){if(void 0===this.points&&!e)return[];const t=[];let n=[],s=e||this.points;for(let e=0;e<s.length;e+=1){const r=s[e];n.push(r),r.lastPointOfContour&&(t.push(n),n=[])}return tt.argument(0===n.length,"There are still points left in the current contour."),t},Fn.prototype.getMetrics=function(){const e=this.path.commands,t=[],n=[];for(let s=0;s<e.length;s+=1){const r=e[s];"Z"!==r.type&&(t.push(r.x),n.push(r.y)),"Q"!==r.type&&"C"!==r.type||(t.push(r.x1),n.push(r.y1)),"C"===r.type&&(t.push(r.x2),n.push(r.y2))}const 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},Fn.prototype.draw=function(e,t,n,s,r,o){r=Object.assign({},o.defaultRenderOptions,r);this.getPath(t,n,s,r,o).draw(e)},Fn.prototype.drawPoints=function(e,t,n,s,r,o){if((r=Object.assign({},o&&o.defaultRenderOptions,r)).drawLayers){const r=this.getLayers(o);if(r&&r.length){for(let o=0;o<r.length;o+=1)r[o].glyph.index!==this.index&&this.drawPoints.call(r[o].glyph,e,t,n,s);return}}function a(t,n,s,r){e.beginPath();for(let o=0;o<t.length;o+=1)e.moveTo(n+t[o].x*r,s+t[o].y*r),e.arc(n+t[o].x*r,s+t[o].y*r,2,0,2*Math.PI,!1);e.fill()}t=void 0!==t?t:0,n=void 0!==n?n:0,s=void 0!==s?s:24;const i=1/this.path.unitsPerEm*s,l=[],u=[];let c=this.path.commands;o&&o.variation&&(c=o.variation.getTransform(this,r.variation).path.commands);for(let e=0;e<c.length;e+=1){const t=c[e];void 0!==t.x&&l.push({x:t.x,y:-t.y}),void 0!==t.x1&&u.push({x:t.x1,y:-t.y1}),void 0!==t.x2&&u.push({x:t.x2,y:-t.y2})}e.fillStyle="blue",a(l,t,n,i),e.fillStyle="red",a(u,t,n,i)},Fn.prototype.drawMetrics=function(e,t,n,s){let r;t=void 0!==t?t:0,n=void 0!==n?n:0,s=void 0!==s?s:24,r=1/this.path.unitsPerEm*s,e.lineWidth=1,e.strokeStyle="black",In.line(e,t,-1e4,t,1e4),In.line(e,-1e4,n,1e4,n);const o=this.xMin||0;let a=this.yMin||0;const i=this.xMax||0;let l=this.yMax||0;const u=this.advanceWidth||0;e.strokeStyle="blue",In.line(e,t+o*r,-1e4,t+o*r,1e4),In.line(e,t+i*r,-1e4,t+i*r,1e4),In.line(e,-1e4,n+-a*r,1e4,n+-a*r),In.line(e,-1e4,n+-l*r,1e4,n+-l*r),e.strokeStyle="green",In.line(e,t+u*r,-1e4,t+u*r,1e4)},Fn.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.pathTramsform&&(s=e.pathTramsform(s)),s.toPathData(e)},Fn.prototype.fromSVG=function(e,t={}){return this.path.fromSVG(e,t)},Fn.prototype.toSVG=function(e,t){const n=this.toPathData.apply(this,[e,t]);return this.path.toSVG(e,n)},Fn.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 An=Fn;function Nn(e,t,n){Object.defineProperty(e,t,{get:function(){return void 0===e[n]&&e.path,e[n]},set:function(t){e[n]=t},enumerable:!0,configurable:!0})}function Pn(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(let n=0;n<t.length;n++){const s=t[n];s.path.unitsPerEm=e.unitsPerEm,this.glyphs[n]=s}this.length=t&&t.length||0}"undefined"!=typeof Symbol&&Symbol.iterator&&(Pn.prototype[Symbol.iterator]=function(){let e=-1;return{next:function(){e++;const t=e>=this.length-1;return{value:this.get(e),done:t}}.bind(this)}}),Pn.prototype.get=function(e){if(this.font._push&&void 0===this.glyphs[e]){this.font._push(e),"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]());let t=this.glyphs[e],n=this.font._IndexToUnicodeMap[e];if(n)for(let e=0;e<n.unicodes.length;e++)t.addUnicode(n.unicodes[e]);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"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]());return this.glyphs[e]},Pn.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};var Bn={GlyphSet:Pn,glyphLoader:function(e,t){return new An({index:t,font:e})},ttfGlyphLoader:function(e,t,n,s,r,o){return function(){const a=new An({index:t,font:e});return a.path=function(){n(a,s,r);const t=o(e.glyphs,a);return t.unitsPerEm=e.unitsPerEm,t},Nn(a,"numberOfContours","_numberOfContours"),Nn(a,"xMin","_xMin"),Nn(a,"xMax","_xMax"),Nn(a,"yMin","_yMin"),Nn(a,"yMax","_yMax"),Nn(a,"points","_points"),a}},cffGlyphLoader:function(e,t,n,s,r){return function(){const o=new An({index:t,font:e});return o.path=function(){const t=n(e,o,s,r);return t.unitsPerEm=e.unitsPerEm,t},o}}};function Gn(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(!Gn(e[n],t[n]))return!1;return!0}return!1}function Hn(e){let t;return t=e.length<1240?107:e.length<33900?1131:32768,t}function _n(e,t,n,s){const r=[],o=[],a=s>1?Xt.getULong(e,t):Xt.getCard16(e,t),i=s>1?4:2;let l,u;if(0!==a){const n=Xt.getByte(e,t+i);l=t+(a+1)*n+i;let s=t+i+1;for(let t=0;t<a+1;t+=1)r.push(Xt.getOffset(e,s,n)),s+=n;u=l+r[a]}else u=t+i;for(let a=0;a<r.length-1;a+=1){let i=Xt.getBytes(e,l+r[a],l+r[a+1]);n&&(i=n(i,e,t,s)),o.push(i)}return{objects:o,startOffset:t,endOffset:u}}function Vn(e,t){let n,s,r,o;if(28===t)return n=e.parseByte(),s=e.parseByte(),n<<8|s;if(29===t)return n=e.parseByte(),s=e.parseByte(),r=e.parseByte(),o=e.parseByte(),n<<24|s<<16|r<<8|o;if(30===t)return function(e){let t="";const n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const s=e.parseByte(),r=s>>4,o=15&s;if(15===r)break;if(t+=n[r],15===o)break;t+=n[o]}return parseFloat(t)}(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return n=e.parseByte(),256*(t-247)+n+108;if(t>=251&&t<=254)return n=e.parseByte(),256*-(t-251)-n-108;throw new Error("Invalid b0 "+t)}function zn(e,t,n,s){t=void 0!==t?t:0;const r=new Xt.Parser(e,t),o=[];let a=[];n=void 0!==n?n:e.byteLength;let i=s<2?22:28;for(;r.relativeOffset<n;){let e=r.parseByte();if(e<i){if(12===e&&(e=1200+r.parseByte()),s>1&&23===e){ts(a);continue}o.push([e,a]),a=[]}else a.push(Vn(r,e))}return function(e){const t={};for(let n=0;n<e.length;n+=1){const s=e[n][0],r=e[n][1];let o;if(o=1===r.length?r[0]:r,Object.prototype.hasOwnProperty.call(t,s)&&!isNaN(t[s]))throw new Error("Object "+t+" already has key "+s);t[s]=o}return t}(o)}function jn(e,t){return t=t<=390?dn[t]:e?e[t-391]:void 0}function qn(e,t,n){const s={};let r;for(let o=0;o<t.length;o+=1){const a=t[o];if(Array.isArray(a.type)){const t=[];t.length=a.type.length;for(let s=0;s<a.type.length;s++)r=void 0!==e[a.op]?e[a.op][s]:void 0,void 0===r&&(r=void 0!==a.value&&void 0!==a.value[s]?a.value[s]:null),"SID"===a.type[s]&&(r=jn(n,r)),t[s]=r;s[a.name]=t}else r=e[a.op],void 0===r&&(r=void 0!==a.value?a.value:null),"SID"===a.type&&(r=jn(n,r)),s[a.name]=r}return s}var Wn=[{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"}],$n=[{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"}],Xn=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}],Yn=[{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"}],Zn=[{name:"private",op:18,type:["number","offset"],value:[0,0]}];function Qn(e,t,n,s){return qn(zn(e,t,e.byteLength,s),s>1?$n:Wn,n)}function Kn(e,t,n,s,r){return qn(zn(e,t,n,r),r>1?Yn:Xn,s)}function Jn(e,t,n){return qn(zn(e,t,void 0,n),Zn)}function es(e,t,n,s,r){const o=[];for(let a=0;a<n.length;a+=1){const i=Qn(new DataView(new Uint8Array(n[a]).buffer),0,s,r);i._subrs=[],i._subrsBias=0,i._defaultWidthX=0,i._nominalWidthX=0;const l=r<2?i.private[0]:0,u=r<2?i.private[1]:0;if(0!==l&&0!==u){const n=Kn(e,u+t,l,s,r);if(i._defaultWidthX=n.defaultWidthX,i._nominalWidthX=n.nominalWidthX,0!==n.subrs){const s=_n(e,u+n.subrs+t,void 0,r);i._subrs=s.objects,i._subrsBias=Hn(i._subrs)}i._privateDict=n}o.push(i)}return o}function ts(e){let t=e.pop();for(;e.length>t;)e.pop()}function ns(e,t){const n=e.tables.cff&&e.tables.cff.topDict&&e.tables.cff.topDict.paintType||0;return 2===n&&(t.fill=null,t.stroke="black",t.strokeWidth=e.tables.cff.topDict.strokeWidth||0),n}function ss(e,t,n,s,r){let o,a,i,l;const u=new Ke,c=[];let p,h,f,d,g,m=0,y=!1,v=!1,b=0,S=0,x=0,T=[];const O=e.tables.cff2||e.tables.cff;if(f=O.topDict._defaultWidthX,d=O.topDict._nominalWidthX,r=r||e.variation&&e.variation.get(),t.getBlendPath||(t.getBlendPath=function(r){return ss(e,t,n,s,r)}),e.isCIDFont||s>1){const e=O.topDict._fdSelect?O.topDict._fdSelect[t.index]:0,n=O.topDict._fdArray[e];p=n._subrs,h=n._subrsBias,s>1?(T=O.topDict._vstore.itemVariationStore,x=n._privateDict.vsindex):(f=n._defaultWidthX,d=n._nominalWidthX)}else p=O.topDict._subrs,h=O.topDict._subrsBias;const k=ns(e,u);let w=f;function I(e,t){v&&2!==k&&u.closePath(),u.moveTo(e,t),v=!0}function U(){let e;e=!!(1&c.length),e&&!y&&(w=c.shift()+d),m+=c.length>>1,c.length=0,y=!0}return function n(f){let O,R,L,C,E,D,M,F,A,N,P,B,G=0;for(;G<f.length;){let W=f[G];switch(G+=1,W){case 1:case 3:case 18:case 23:U();break;case 4:c.length>1&&!y&&(w=c.shift()+d,y=!0),S+=c.pop(),I(b,S);break;case 5:for(;c.length>0;)b+=c.shift(),S+=c.shift(),u.lineTo(b,S);break;case 6:for(;c.length>0&&(b+=c.shift(),u.lineTo(b,S),0!==c.length);)S+=c.shift(),u.lineTo(b,S);break;case 7:for(;c.length>0&&(S+=c.shift(),u.lineTo(b,S),0!==c.length);)b+=c.shift(),u.lineTo(b,S);break;case 8:for(;c.length>0;)o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l+c.shift(),u.curveTo(o,a,i,l,b,S);break;case 10:E=c.pop()+h,D=p[E],D&&n(D);break;case 11:if(s>1){console.error("CFF CharString operator return (11) is not supported in CFF2");break}return;case 12:switch(W=f[G],G+=1,W){case 35:o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),M=i+c.shift(),F=l+c.shift(),A=M+c.shift(),N=F+c.shift(),P=A+c.shift(),B=N+c.shift(),b=P+c.shift(),S=B+c.shift(),c.shift(),u.curveTo(o,a,i,l,M,F),u.curveTo(A,N,P,B,b,S);break;case 34:o=b+c.shift(),a=S,i=o+c.shift(),l=a+c.shift(),M=i+c.shift(),F=l,A=M+c.shift(),N=l,P=A+c.shift(),B=S,b=P+c.shift(),u.curveTo(o,a,i,l,M,F),u.curveTo(A,N,P,B,b,S);break;case 36:o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),M=i+c.shift(),F=l,A=M+c.shift(),N=l,P=A+c.shift(),B=N+c.shift(),b=P+c.shift(),u.curveTo(o,a,i,l,M,F),u.curveTo(A,N,P,B,b,S);break;case 37:o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),M=i+c.shift(),F=l+c.shift(),A=M+c.shift(),N=F+c.shift(),P=A+c.shift(),B=N+c.shift(),Math.abs(P-b)>Math.abs(B-S)?b=P+c.shift():S=B+c.shift(),u.curveTo(o,a,i,l,M,F),u.curveTo(A,N,P,B,b,S);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+W),c.length=0}break;case 14:if(s>1){console.error("CFF CharString operator endchar (14) is not supported in CFF2");break}if(c.length>=4){const n=vn[c.pop()],s=vn[c.pop()],r=c.pop(),o=c.pop();if(n&&s){t.isComposite=!0,t.components=[];const a=e.cffEncoding.charset.indexOf(n),i=e.cffEncoding.charset.indexOf(s);t.components.push({glyphIndex:i,dx:0,dy:0}),t.components.push({glyphIndex:a,dx:o,dy:r}),u.extend(e.glyphs.get(i).path);const l=e.glyphs.get(a),c=JSON.parse(JSON.stringify(l.path.commands));for(let e=0;e<c.length;e+=1){const t=c[e];"Z"!==t.type&&(t.x+=o,t.y+=r),"Q"!==t.type&&"C"!==t.type||(t.x1+=o,t.y1+=r),"C"===t.type&&(t.x2+=o,t.y2+=r)}u.extend(c)}}else c.length>0&&!y&&(w=c.shift()+d,y=!0);v&&2!==k&&(u.closePath(),v=!1);break;case 15:if(s<2){console.error("CFF2 CharString operator vsindex (15) is not supported in CFF");break}x=c.pop();break;case 16:if(s<2){console.error("CFF2 CharString operator blend (16) is not supported in CFF");break}g||(g=e.variation&&r&&e.variation.process.getBlendVector(T,x,r));var H=c.pop(),_=g?g.length:T.itemVariationSubtables[x].regionIndexes.length,V=H*_,z=c.length-V,j=z-H;if(g)for(let e=0;e<H;e++){var q=c[j+e];for(let e=0;e<_;e++)q+=g[e]*c[z++];c[j+e]=q}for(;V--;)c.pop();break;case 19:case 20:U(),G+=m+7>>3;break;case 21:c.length>2&&!y&&(w=c.shift()+d,y=!0),S+=c.pop(),b+=c.pop(),I(b,S);break;case 22:c.length>1&&!y&&(w=c.shift()+d,y=!0),b+=c.pop(),I(b,S);break;case 24:for(;c.length>2;)o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l+c.shift(),u.curveTo(o,a,i,l,b,S);b+=c.shift(),S+=c.shift(),u.lineTo(b,S);break;case 25:for(;c.length>6;)b+=c.shift(),S+=c.shift(),u.lineTo(b,S);o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l+c.shift(),u.curveTo(o,a,i,l,b,S);break;case 26:for(1&c.length&&(b+=c.shift());c.length>0;)o=b,a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i,S=l+c.shift(),u.curveTo(o,a,i,l,b,S);break;case 27:for(1&c.length&&(S+=c.shift());c.length>0;)o=b+c.shift(),a=S,i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l,u.curveTo(o,a,i,l,b,S);break;case 28:O=f[G],R=f[G+1],c.push((O<<24|R<<16)>>16),G+=2;break;case 29:E=c.pop()+e.gsubrsBias,D=e.gsubrs[E],D&&n(D);break;case 30:for(;c.length>0&&(o=b,a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l+(1===c.length?c.shift():0),u.curveTo(o,a,i,l,b,S),0!==c.length);)o=b+c.shift(),a=S,i=o+c.shift(),l=a+c.shift(),S=l+c.shift(),b=i+(1===c.length?c.shift():0),u.curveTo(o,a,i,l,b,S);break;case 31:for(;c.length>0&&(o=b+c.shift(),a=S,i=o+c.shift(),l=a+c.shift(),S=l+c.shift(),b=i+(1===c.length?c.shift():0),u.curveTo(o,a,i,l,b,S),0!==c.length);)o=b,a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l+(1===c.length?c.shift():0),u.curveTo(o,a,i,l,b,S);break;default:W<32?console.log("Glyph "+t.index+": unknown operator "+W):W<247?c.push(W-139):W<251?(O=f[G],G+=1,c.push(256*(W-247)+O+108)):W<255?(O=f[G],G+=1,c.push(256*-(W-251)-O-108)):(O=f[G],R=f[G+1],L=f[G+2],C=f[G+3],G+=4,c.push((O<<24|R<<16|L<<8|C)/65536))}}}(n),e.variation&&r&&(u.commands=u.commands.map(e=>{const t=Object.keys(e);for(let n=0;n<t.length;n++){const s=t[n];"type"!==s&&(e[s]=Math.round(e[s]))}return e})),y&&(t.advanceWidth=w),u}function rs(e,t,n,s,r){const o=[];let a;const i=new Xt.Parser(e,t),l=i.parseCard8();if(0===l)for(let e=0;e<n;e++){if(a=i.parseCard8(),a>=s)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+s+")");o.push(a)}else{if(!(3===l||r>1&&4===l))throw new Error("CFF Table CID Font FDSelect table has unsupported format "+l);{const e=4===l?i.parseULong():i.parseCard16();let t,u=4===l?i.parseULong():i.parseCard16();if(0!==u)throw new Error(`CFF Table CID Font FDSelect format ${l} range has bad initial GID ${u}`);for(let c=0;c<e;c++){if(a=4===l?i.parseUShort():i.parseCard8(),t=4===l?i.parseULong():i.parseCard16(),a>=s)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+s+")");if(t>n)throw new Error(`CFF Table CID Font FDSelect format ${r} range has bad GID ${t}`);for(;u<t;u++)o.push(a);u=t}if(t!==n)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final (Sentinal) GID "+t)}}return o}function os(e,t){let n,s=dn.indexOf(e);return s>=0&&(n=s),s=t.indexOf(e),s>=0?n=s+dn.length:(n=dn.length+t.length,t.push(e)),n}function as(e,t,n){const s={};for(let r=0;r<e.length;r+=1){const o=e[r];let a=t[o.name];void 0===a||Gn(a,o.value)||("SID"===o.type&&(a=os(a,n)),s[o.op]={name:o.name,type:o.type,value:a})}return s}function is(e,t,n){const s=new kt.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return s.dict=as(n>1?$n:Wn,e,t),s}function ls(e){const t=new kt.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}function us(e,t){const n=[],s=e.path;t<2&&n.push({name:"width",type:"NUMBER",value:e.advanceWidth});let r=0,o=0;for(let e=0;e<s.commands.length;e+=1){let t,a,i=s.commands[e];if("Q"===i.type){const e=1/3,t=2/3;i={type:"C",x:i.x,y:i.y,x1:Math.round(e*r+t*i.x1),y1:Math.round(e*o+t*i.y1),x2:Math.round(e*i.x+t*i.x1),y2:Math.round(e*i.y+t*i.y1)}}if("M"===i.type)t=Math.round(i.x-r),a=Math.round(i.y-o),n.push({name:"dx",type:"NUMBER",value:t}),n.push({name:"dy",type:"NUMBER",value:a}),n.push({name:"rmoveto",type:"OP",value:21}),r=Math.round(i.x),o=Math.round(i.y);else if("L"===i.type)t=Math.round(i.x-r),a=Math.round(i.y-o),n.push({name:"dx",type:"NUMBER",value:t}),n.push({name:"dy",type:"NUMBER",value:a}),n.push({name:"rlineto",type:"OP",value:5}),r=Math.round(i.x),o=Math.round(i.y);else if("C"===i.type){const e=Math.round(i.x1-r),s=Math.round(i.y1-o),l=Math.round(i.x2-i.x1),u=Math.round(i.y2-i.y1);t=Math.round(i.x-i.x2),a=Math.round(i.y-i.y2),n.push({name:"dx1",type:"NUMBER",value:e}),n.push({name:"dy1",type:"NUMBER",value:s}),n.push({name:"dx2",type:"NUMBER",value:l}),n.push({name:"dy2",type:"NUMBER",value:u}),n.push({name:"dx",type:"NUMBER",value:t}),n.push({name:"dy",type:"NUMBER",value:a}),n.push({name:"rrcurveto",type:"OP",value:8}),r=Math.round(i.x),o=Math.round(i.y)}}return t<2&&n.push({name:"endchar",type:"OP",value:14}),n}var cs={parse:function(e,t,n,s){let r;const o=function(e,t){const n={};if(n.formatMajor=Xt.getCard8(e,t),n.formatMinor=Xt.getCard8(e,t+1),n.formatMajor>2)throw new Error(`Unsupported CFF table version ${n.formatMajor}.${n.formatMinor}`);return n.size=Xt.getCard8(e,t+2),n.formatMajor<2?(n.offsetSize=Xt.getCard8(e,t+3),n.startOffset=t,n.endOffset=t+4):(n.topDictLength=Xt.getCard16(e,t+3),n.endOffset=t+8),n}(e,t);r=2===o.formatMajor?n.tables.cff2={}:n.tables.cff={};const a=o.formatMajor>1?null:_n(e,o.endOffset,Xt.bytesToString),i=o.formatMajor>1?null:_n(e,a.endOffset),l=o.formatMajor>1?null:_n(e,i.endOffset,Xt.bytesToString),u=_n(e,o.formatMajor>1?t+o.size+o.topDictLength:l.endOffset,void 0,o.formatMajor);let c,p;if(n.gsubrs=u.objects,n.gsubrsBias=Hn(n.gsubrs),o.formatMajor>1){const n=t+o.size,s=Xt.getBytes(e,n,n+o.topDictLength);c=es(e,0,[s],void 0,o.formatMajor)[0]}else{const n=es(e,t,i.objects,l.objects,o.formatMajor);if(1!==n.length)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+n.length);c=n[0]}if(r.topDict=c,c._privateDict&&(n.defaultWidthX=c._privateDict.defaultWidthX,n.nominalWidthX=c._privateDict.nominalWidthX),o.formatMajor<2&&void 0!==c.ros[0]&&void 0!==c.ros[1]&&(n.isCIDFont=!0),o.formatMajor>1){let s=c.fdArray,r=c.fdSelect;if(!s)throw new Error("This is a CFF2 font, but FDArray information is missing");const a=_n(e,t+s,null,o.formatMajor),i=function(e,t,n){const s=[];for(let r=0;r<n.length;r++){const o=Jn(new DataView(new Uint8Array(n[r]).buffer),0,2),a=o.private[0],i=o.private[1];if(0!==a&&0!==i){const n=Kn(e,i+t,a,[],2);if(n.subrs){const s=_n(e,i+n.subrs+t,void 0,2);o._subrs=s.objects,o._subrsBias=Hn(o._subrs)}o._privateDict=n}s.push(o)}return s}(e,t,a.objects);c._fdArray=i,r&&(c._fdSelect=rs(e,t+r,n.numGlyphs,i.length,o.formatMajor))}else if(n.isCIDFont){let s=c.fdArray,r=c.fdSelect;if(0===s||0===r)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");s+=t;const a=_n(e,s),i=es(e,t,a.objects,l.objects,o.formatMajor);c._fdArray=i,r+=t,c._fdSelect=rs(e,r,n.numGlyphs,i.length,o.formatMajor)}if(o.formatMajor<2){const s=t+c.private[1],r=Kn(e,s,c.private[0],l.objects,o.formatMajor);if(n.defaultWidthX=r.defaultWidthX,n.nominalWidthX=r.nominalWidthX,0!==r.subrs){const t=s+r.subrs,o=_n(e,t);n.subrs=o.objects,n.subrsBias=Hn(n.subrs)}else n.subrs=[],n.subrsBias=0}if(s.lowMemory?(p=function(e,t,n){const s=[],r=n>1?Xt.getULong(e,t):Xt.getCard16(e,t),o=n>1?4:2;let a,i;if(0!==r){const n=Xt.getByte(e,t+o);a=t+(r+1)*n+o;let l=t+o+1;for(let t=0;t<r+1;t+=1)s.push(Xt.getOffset(e,l,n)),l+=n;i=a+s[r]}else i=t+o;return{offsets:s,startOffset:t,endOffset:i}}(e,t+c.charStrings,o.formatMajor),n.nGlyphs=p.offsets.length-(o.formatMajor>1?1:0)):(p=_n(e,t+c.charStrings,null,o.formatMajor),n.nGlyphs=p.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 s=[],r=[];s=0===c.charset?gn:1===c.charset?mn:2===c.charset?yn:function(e,t,n,s,r){let o,a;const i=new Xt.Parser(e,t);n-=1;const l=[".notdef"],u=i.parseCard8();if(0===u)for(let e=0;e<n;e+=1)o=i.parseSID(),r?l.push(o):l.push(jn(s,o)||o);else if(1===u)for(;l.length<=n;){o=i.parseSID(),a=i.parseCard8();for(let e=0;e<=a;e+=1)r?l.push("cid"+("00000"+o).slice(-5)):l.push(jn(s,o)||o),o+=1}else{if(2!==u)throw new Error("Unknown charset format "+u);for(;l.length<=n;){o=i.parseSID(),a=i.parseCard16();for(let e=0;e<=a;e+=1)r?l.push("cid"+("00000"+o).slice(-5)):l.push(jn(s,o)||o),o+=1}}return l}(e,t+c.charset,n.nGlyphs,l.objects,n.isCIDFont),r=0===c.encoding?vn:1===c.encoding?bn:function(e,t){let n;const s={},r=new Xt.Parser(e,t),o=r.parseCard8();if(0===o){const e=r.parseCard8();for(let t=0;t<e;t+=1)n=r.parseCard8(),s[n]=t}else{if(1!==o)throw new Error("Unknown encoding format "+o);{const e=r.parseCard8();n=1;for(let t=0;t<e;t+=1){const e=r.parseCard8(),t=r.parseCard8();for(let r=e;r<=e+t;r+=1)s[r]=n,n+=1}}}return s}(e,t+c.encoding),n.cffEncoding=new On(r,s),n.encoding=n.encoding||n.cffEncoding}if(n.glyphs=new Bn.GlyphSet(n),s.lowMemory)n._push=function(s){const r=function(e,t,n,s,r,o){const a=o>1?Xt.getULong(n,s):Xt.getCard16(n,s),i=o>1?4:2;let l=0;0!==a&&(l=s+(a+1)*Xt.getByte(n,s+i)+i);let u=Xt.getBytes(n,l+t[e],l+t[e+1]);return r&&(u=r(u)),u}(s,p.offsets,e,t+c.charStrings,void 0,o.formatMajor);n.glyphs.push(s,Bn.cffGlyphLoader(n,s,ss,r,o.formatMajor))};else for(let e=0;e<n.nGlyphs;e+=1){const t=p.objects[e];n.glyphs.push(e,Bn.cffGlyphLoader(n,e,ss,t,o.formatMajor))}if(c.vstore){const n=new Xt.Parser(e,t+c.vstore);c._vstore=n.parseVariationStore()}},make:function(e,t){const n=new kt.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"}]),s=1/t.unitsPerEm,r={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[s,0,0,s,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},o=t&&t.topDict||{};o.paintType&&(r.paintType=o.paintType,r.strokeWidth=o.strokeWidth||0);const a=[];let i;for(let t=1;t<e.length;t+=1)i=e.get(t),a.push(i.name);const l=[];n.header=new kt.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}]),n.nameIndex=function(e){const t=new kt.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}([t.postScriptName]);let u=is(r,l);n.topDictIndex=ls(u),n.globalSubrIndex=new kt.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}]),n.charsets=function(e,t){const n=new kt.Record("Charsets",[{name:"format",type:"Card8",value:0}]);for(let s=0;s<e.length;s+=1){const r=os(e[s],t);n.fields.push({name:"glyph_"+s,type:"SID",value:r})}return n}(a,l),n.charStringsIndex=function(e,t){const n=new kt.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]);for(let s=0;s<e.length;s+=1){const r=e.get(s),o=us(r,t);n.charStrings.push({name:r.name,type:"CHARSTRING",value:o})}return n}(e,1),n.privateDict=function(e,t,n){const s=new kt.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return s.dict=as(n>1?Yn:Xn,e,t),s}({},l),n.stringIndex=function(e){const t=new kt.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}(l);const c=n.header.sizeOf()+n.nameIndex.sizeOf()+n.topDictIndex.sizeOf()+n.stringIndex.sizeOf()+n.globalSubrIndex.sizeOf();return r.charset=c,r.encoding=0,r.charStrings=r.charset+n.charsets.sizeOf(),r.private[1]=r.charStrings+n.charStringsIndex.sizeOf(),u=is(r,l),n.topDictIndex=ls(u),n}};var ps={parse:function(e,t){const n={},s=new Xt.Parser(e,t);return n.version=s.parseVersion(),n.fontRevision=Math.round(1e3*s.parseFixed())/1e3,n.checkSumAdjustment=s.parseULong(),n.magicNumber=s.parseULong(),tt.argument(1594834165===n.magicNumber,"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},make:function(e){const t=Math.round((new Date).getTime()/1e3)+2082844800;let n=t,s=e.macStyle||0;return e.createdTimestamp&&(n=e.createdTimestamp+2082844800),new kt.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 hs={parse:function(e,t){const n={},s=new Xt.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},make:function(e){return new kt.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 fs={parse:function(e,t,n,s,r,o,a){a.lowMemory?function(e,t,n,s,r){let o,a;e._hmtxTableData={};const i=new Xt.Parser(t,n);for(let t=0;t<r;t+=1)t<s&&(o=i.parseUShort(),a=i.parseShort()),e._hmtxTableData[t]={advanceWidth:o,leftSideBearing:a}}(e,t,n,s,r):function(e,t,n,s,r){let o,a;const i=new Xt.Parser(e,t);for(let e=0;e<s;e+=1){e<n&&(o=i.parseUShort(),a=i.parseShort());const t=r.get(e);t.advanceWidth=o,t.leftSideBearing=a}}(t,n,s,r,o)},make:function(e){const t=new kt.Table("hmtx",[]);for(let n=0;n<e.length;n+=1){const 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 ds={make:function(e){const t=new kt.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]);let n="";const s=12+4*e.length;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},parse:function(e,t){const n=new Xt.Parser(e,t),s=n.parseULong();tt.argument(1===s,"Unsupported ltag table version."),n.skip("uLong",1);const r=n.parseULong(),o=[];for(let s=0;s<r;s++){let s="";const r=t+n.parseUShort(),a=n.parseUShort();for(let t=r;t<r+a;++t)s+=String.fromCharCode(e.getInt8(t));o.push(s)}return o}};var gs={parse:function(e,t){const n={},s=new Xt.Parser(e,t);return n.version=s.parseVersion(),n.numGlyphs=s.parseUShort(),1===n.version&&(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},make:function(e){return new kt.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])}},ms=[{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}];var ys={parse:function(e,t){const n={},s=new Xt.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 e=0;e<10;e++)n.panose[e]=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},make:function(e){return new kt.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)},unicodeRanges:ms,getUnicodeRange:function(e){for(let t=0;t<ms.length;t+=1){const n=ms[t];if(e>=n.begin&&e<n.end)return t}return-1}};var vs={parse:function(e,t){const n={},s=new Xt.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=Sn.slice();break;case 2:n.numberOfGlyphs=s.parseUShort(),n.glyphNameIndex=new Array(n.numberOfGlyphs);for(let e=0;e<n.numberOfGlyphs;e++)n.glyphNameIndex[e]=s.parseUShort();n.names=[];for(let e=0;e<n.numberOfGlyphs;e++)if(n.glyphNameIndex[e]>=Sn.length){const e=s.parseChar();n.names.push(s.parseString(e))}break;case 2.5:n.numberOfGlyphs=s.parseUShort(),n.offset=new Array(n.numberOfGlyphs);for(let e=0;e<n.numberOfGlyphs;e++)n.offset[e]=s.parseChar()}return n},make:function(e){const{italicAngle:t=Math.round(65536*(e.italicAngle||0)),underlinePosition:n=0,underlineThickness:s=0,isFixedPitch:r=0,minMemType42:o=0,maxMemType42:a=0,minMemType1:i=0,maxMemType1:l=0}=e.tables.post||{};return new kt.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:a},{name:"minMemType1",type:"ULONG",value:i},{name:"maxMemType1",type:"ULONG",value:l}])}},bs=new Array(9);bs[1]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(Wt.coverage),deltaGlyphId:this.parseShort()}:2===t?{substFormat:2,coverage:this.parsePointer(Wt.coverage),substitute:this.parseOffset16List()}:void tt.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")},bs[2]=function(){const e=this.parseUShort();return tt.argument(1===e,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(Wt.coverage),sequences:this.parseListOfLists()}},bs[3]=function(){const e=this.parseUShort();return tt.argument(1===e,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(Wt.coverage),alternateSets:this.parseListOfLists()}},bs[4]=function(){const e=this.parseUShort();return tt.argument(1===e,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(Wt.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var Ss={sequenceIndex:Wt.uShort,lookupListIndex:Wt.uShort};bs[5]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{substFormat:t,coverage:this.parsePointer(Wt.coverage),ruleSets:this.parseListOfLists(function(){const e=this.parseUShort(),t=this.parseUShort();return{input:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,Ss)}})};if(2===t)return{substFormat:t,coverage:this.parsePointer(Wt.coverage),classDef:this.parsePointer(Wt.classDef),classSets:this.parseListOfLists(function(){const e=this.parseUShort(),t=this.parseUShort();return{classes:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,Ss)}})};if(3===t){const e=this.parseUShort(),n=this.parseUShort();return{substFormat:t,coverages:this.parseList(e,Wt.pointer(Wt.coverage)),lookupRecords:this.parseRecordList(n,Ss)}}tt.assert(!1,"0x"+e.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},bs[6]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(Wt.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Ss)}})}:2===t?{substFormat:2,coverage:this.parsePointer(Wt.coverage),backtrackClassDef:this.parsePointer(Wt.classDef),inputClassDef:this.parsePointer(Wt.classDef),lookaheadClassDef:this.parsePointer(Wt.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Ss)}})}:3===t?{substFormat:3,backtrackCoverage:this.parseList(Wt.pointer(Wt.coverage)),inputCoverage:this.parseList(Wt.pointer(Wt.coverage)),lookaheadCoverage:this.parseList(Wt.pointer(Wt.coverage)),lookupRecords:this.parseRecordList(Ss)}:void tt.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},bs[7]=function(){const e=this.parseUShort();tt.argument(1===e,"GSUB Extension Substitution subtable identifier-format must be 1");const t=this.parseUShort(),n=new Wt(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:bs[t].call(n)}},bs[8]=function(){const e=this.parseUShort();return tt.argument(1===e,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(Wt.coverage),backtrackCoverage:this.parseList(Wt.pointer(Wt.coverage)),lookaheadCoverage:this.parseList(Wt.pointer(Wt.coverage)),substitutes:this.parseUShortList()}};var xs=new Array(9);xs[1]=function(e){return 1===e.substFormat?new kt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new kt.Coverage(e.coverage)},{name:"deltaGlyphID",type:"SHORT",value:e.deltaGlyphId}]):2===e.substFormat?new kt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new kt.Coverage(e.coverage)}].concat(kt.ushortList("substitute",e.substitute))):void tt.fail("Lookup type 1 substFormat must be 1 or 2.")},xs[2]=function(e){return tt.assert(1===e.substFormat,"Lookup type 2 substFormat must be 1."),new kt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new kt.Coverage(e.coverage)}].concat(kt.tableList("seqSet",e.sequences,function(e){return new kt.Table("sequenceSetTable",kt.ushortList("sequence",e))})))},xs[3]=function(e){return tt.assert(1===e.substFormat,"Lookup type 3 substFormat must be 1."),new kt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new kt.Coverage(e.coverage)}].concat(kt.tableList("altSet",e.alternateSets,function(e){return new kt.Table("alternateSetTable",kt.ushortList("alternate",e))})))},xs[4]=function(e){return tt.assert(1===e.substFormat,"Lookup type 4 substFormat must be 1."),new kt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new kt.Coverage(e.coverage)}].concat(kt.tableList("ligSet",e.ligatureSets,function(e){return new kt.Table("ligatureSetTable",kt.tableList("ligature",e,function(e){return new kt.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:e.ligGlyph}].concat(kt.ushortList("component",e.components,e.components.length+1)))}))})))},xs[5]=function(e){if(1===e.substFormat)return new kt.Table("contextualSubstitutionTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new kt.Coverage(e.coverage)}].concat(kt.tableList("sequenceRuleSet",e.ruleSets,function(e){return e?new kt.Table("sequenceRuleSetTable",kt.tableList("sequenceRule",e,function(e){let t=kt.ushortList("seqLookup",[],e.lookupRecords.length).concat(kt.ushortList("inputSequence",e.input,e.input.length+1));[t[0],t[1]]=[t[1],t[0]];for(let n=0;n<e.lookupRecords.length;n++){const s=e.lookupRecords[n];t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:s.lookupListIndex})}return new kt.Table("sequenceRuleTable",t)})):new kt.Table("NULL",null)})));if(2===e.substFormat)return new kt.Table("contextualSubstitutionTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new kt.Coverage(e.coverage)},{name:"classDef",type:"TABLE",value:new kt.ClassDef(e.classDef)}].concat(kt.tableList("classSeqRuleSet",e.classSets,function(e){return e?new kt.Table("classSeqRuleSetTable",kt.tableList("classSeqRule",e,function(e){let t=kt.ushortList("classes",e.classes,e.classes.length+1).concat(kt.ushortList("seqLookupCount",[],e.lookupRecords.length));for(let n=0;n<e.lookupRecords.length;n++){const s=e.lookupRecords[n];t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:s.lookupListIndex})}return new kt.Table("classSeqRuleTable",t)})):new kt.Table("NULL",null)})));if(3===e.substFormat){let t=[{name:"substFormat",type:"USHORT",value:e.substFormat}];t.push({name:"inputGlyphCount",type:"USHORT",value:e.coverages.length}),t.push({name:"substitutionCount",type:"USHORT",value:e.lookupRecords.length});for(let n=0;n<e.coverages.length;n++){const s=e.coverages[n];t.push({name:"inputCoverage"+n,type:"TABLE",value:new kt.Coverage(s)})}for(let n=0;n<e.lookupRecords.length;n++){const s=e.lookupRecords[n];t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:s.lookupListIndex})}return new kt.Table("contextualSubstitutionTable",t)}tt.assert(!1,"lookup type 5 format must be 1, 2 or 3.")},xs[6]=function(e){if(1===e.substFormat){let t=new kt.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new kt.Coverage(e.coverage)}].concat(kt.tableList("chainRuleSet",e.chainRuleSets,function(e){return new kt.Table("chainRuleSetTable",kt.tableList("chainRule",e,function(e){let t=kt.ushortList("backtrackGlyph",e.backtrack,e.backtrack.length).concat(kt.ushortList("inputGlyph",e.input,e.input.length+1)).concat(kt.ushortList("lookaheadGlyph",e.lookahead,e.lookahead.length)).concat(kt.ushortList("substitution",[],e.lookupRecords.length));for(let n=0;n<e.lookupRecords.length;n++){const s=e.lookupRecords[n];t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:s.lookupListIndex})}return new kt.Table("chainRuleTable",t)}))})));return t}if(2===e.substFormat)tt.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(3===e.substFormat){let t=[{name:"substFormat",type:"USHORT",value:e.substFormat}];t.push({name:"backtrackGlyphCount",type:"USHORT",value:e.backtrackCoverage.length});for(let n=0;n<e.backtrackCoverage.length;n++){const s=e.backtrackCoverage[n];t.push({name:"backtrackCoverage"+n,type:"TABLE",value:new kt.Coverage(s)})}t.push({name:"inputGlyphCount",type:"USHORT",value:e.inputCoverage.length});for(let n=0;n<e.inputCoverage.length;n++){const s=e.inputCoverage[n];t.push({name:"inputCoverage"+n,type:"TABLE",value:new kt.Coverage(s)})}t.push({name:"lookaheadGlyphCount",type:"USHORT",value:e.lookaheadCoverage.length});for(let n=0;n<e.lookaheadCoverage.length;n++){const s=e.lookaheadCoverage[n];t.push({name:"lookaheadCoverage"+n,type:"TABLE",value:new kt.Coverage(s)})}t.push({name:"substitutionCount",type:"USHORT",value:e.lookupRecords.length});for(let n=0;n<e.lookupRecords.length;n++){const s=e.lookupRecords[n];t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:s.lookupListIndex})}return new kt.Table("chainContextTable",t)}tt.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};var Ts={parse:function(e,t){const n=new Wt(e,t=t||0),s=n.parseVersion(1);return tt.argument(1===s||1.1===s,"Unsupported GSUB table version."),1===s?{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(bs)}:{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(bs),variations:n.parseFeatureVariationsList()}},make:function(e){return new kt.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new kt.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new kt.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new kt.LookupList(e.lookups,xs)}])}};var Os={parse:function(e,t){const n=new Xt.Parser(e,t),s=n.parseULong();tt.argument(1===s,"Unsupported META table version."),n.parseULong(),n.parseULong();const r=n.parseULong(),o={};for(let s=0;s<r;s++){const s=n.parseTag(),r=n.parseULong(),a=n.parseULong();if("appl"===s||"bild"===s)continue;const i=st.UTF8(e,t+r,a);o[s]=i}return o},make:function(e){const t=Object.keys(e).length;let n="";const s=16+12*t,r=new kt.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 t in e){const o=n.length;n+=e[t],r.fields.push({name:"tag "+t,type:"TAG",value:t}),r.fields.push({name:"offset "+t,type:"ULONG",value:s+o}),r.fields.push({name:"length "+t,type:"ULONG",value:e[t].length})}return r.fields.push({name:"stringPool",type:"CHARARRAY",value:n}),r}};var ks={parse:function(e,t){const n=new Wt(e,t),s=n.parseUShort();0!==s&&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.");const r=n.parseUShort(),o=n.parseOffset32(),a=n.parseOffset32(),i=n.parseUShort();n.relativeOffset=o;const l=n.parseRecordList(r,{glyphID:Wt.uShort,firstLayerIndex:Wt.uShort,numLayers:Wt.uShort});return n.relativeOffset=a,{version:s,baseGlyphRecords:l,layerRecords:n.parseRecordList(i,{glyphID:Wt.uShort,paletteIndex:Wt.uShort})}},make:function({version:e=0,baseGlyphRecords:t=[],layerRecords:n=[]}){tt.argument(0===e,"Only COLRv0 supported.");const s=14+6*t.length;return new kt.Table("COLR",[{name:"version",type:"USHORT",value:e},{name:"numBaseGlyphRecords",type:"USHORT",value:t.length},{name:"baseGlyphRecordsOffset",type:"ULONG",value:14},{name:"layerRecordsOffset",type:"ULONG",value:s},{name:"numLayerRecords",type:"USHORT",value:n.length},...t.map((e,t)=>[{name:"glyphID_"+t,type:"USHORT",value:e.glyphID},{name:"firstLayerIndex_"+t,type:"USHORT",value:e.firstLayerIndex},{name:"numLayers_"+t,type:"USHORT",value:e.numLayers}]).flat(),...n.map((e,t)=>[{name:"LayerGlyphID_"+t,type:"USHORT",value:e.glyphID},{name:"paletteIndex_"+t,type:"USHORT",value:e.paletteIndex}]).flat()])}};function ws(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 Is(e,t,n){const s={},r=new Xt.Parser(e,t);s.tag=r.parseTag(),s.minValue=r.parseFixed(),s.defaultValue=r.parseFixed(),s.maxValue=r.parseFixed(),r.skip("uShort",1);const o=r.parseUShort();return s.axisNameID=o,s.name=cn(n,o),s}function Us(e,t,n,s={}){const r=[{name:"nameID_"+e,type:"USHORT",value:t.subfamilyNameID},{name:"flags_"+e,type:"USHORT",value:0}];for(let s=0;s<n.length;++s){const o=n[s].tag;r.push({name:"axis_"+e+" "+o,type:"FIXED",value:t.coordinates[o]<<16})}return s&&s.postScriptNameID&&r.push({name:"postScriptNameID_",type:"USHORT",value:void 0!==t.postScriptNameID?t.postScriptNameID:65535}),r}function Rs(e,t,n,s,r){const o={},a=new Xt.Parser(e,t),i=a.parseUShort();o.subfamilyNameID=i,o.name=cn(s,i,[2,17]),a.skip("uShort",1),o.coordinates={};for(let e=0;e<n.length;++e)o.coordinates[n[e].tag]=a.parseFixed();if(a.relativeOffset===r)return o.postScriptNameID=void 0,o.postScriptName=void 0,o;const l=a.parseUShort();return o.postScriptNameID=65535==l?void 0:l,o.postScriptName=void 0!==o.postScriptNameID?cn(s,l,[6]):"",o}var Ls={make:function(e,t){const n=new kt.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+4*e.axes.length}]);n.offsetToData=n.sizeOf();for(let t=0;t<e.axes.length;t++)n.fields=n.fields.concat(ws(t,e.axes[t]));const s={};for(let t=0;t<e.instances.length;t++)if(void 0!==e.instances[t].postScriptNameID){n.instanceSize+=2,s.postScriptNameID=!0;break}for(let t=0;t<e.instances.length;t++)n.fields=n.fields.concat(Us(t,e.instances[t],e.axes,s));return n},parse:function(e,t,n){const s=new Xt.Parser(e,t),r=s.parseULong();tt.argument(65536===r,"Unsupported fvar table version.");const o=s.parseOffset16();s.skip("uShort",1);const a=s.parseUShort(),i=s.parseUShort(),l=s.parseUShort(),u=s.parseUShort(),c=[];for(let s=0;s<a;s++)c.push(Is(e,t+o+s*i,n));const p=[],h=t+o+a*i;for(let t=0;t<l;t++)p.push(Rs(e,h+t*u,c,n,u));return{axes:c,instances:p}}},Cs={tag:Wt.tag,nameID:Wt.uShort,ordering:Wt.uShort},Es=new Array(5);function Ds(){const e=this.parseUShort(),t=Es[e],n={format:e};return void 0===t?(console.warn(`Unknown axis value table format ${e}`),n):Object.assign(n,this.parseStruct(t.bind(this)))}Es[1]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),value:this.parseFixed()}},Es[2]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),nominalValue:this.parseFixed(),rangeMinValue:this.parseFixed(),rangeMaxValue:this.parseFixed()}},Es[3]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),value:this.parseFixed(),linkedValue:this.parseFixed()}},Es[4]=function(){const e=this.parseUShort();return{flags:this.parseUShort(),valueNameID:this.parseUShort(),axisValues:this.parseList(e,function(){return{axisIndex:this.parseUShort(),value:this.parseFixed()}})}};var Ms=new Array(5);function Fs(e,t){return new kt.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 As(e,t){const n=t.format,s=Ms[n];tt.argument(void 0!==s,`Unknown axis value table format ${n}`);const r=s(e,t);return new kt.Table("axisValueTable_"+e,r)}Ms[1]=function(e,t){return[{name:`format${e}`,type:"USHORT",value:1},{name:`axisIndex${e}`,type:"USHORT",value:t.axisIndex},{name:`flags${e}`,type:"USHORT",value:t.flags},{name:`valueNameID${e}`,type:"USHORT",value:t.valueNameID},{name:`value${e}`,type:"FLOAT",value:t.value}]},Ms[2]=function(e,t){return[{name:`format${e}`,type:"USHORT",value:2},{name:`axisIndex${e}`,type:"USHORT",value:t.axisIndex},{name:`flags${e}`,type:"USHORT",value:t.flags},{name:`valueNameID${e}`,type:"USHORT",value:t.valueNameID},{name:`nominalValue${e}`,type:"FLOAT",value:t.nominalValue},{name:`rangeMinValue${e}`,type:"FLOAT",value:t.rangeMinValue},{name:`rangeMaxValue${e}`,type:"FLOAT",value:t.rangeMaxValue}]},Ms[3]=function(e,t){return[{name:`format${e}`,type:"USHORT",value:3},{name:`axisIndex${e}`,type:"USHORT",value:t.axisIndex},{name:`flags${e}`,type:"USHORT",value:t.flags},{name:`valueNameID${e}`,type:"USHORT",value:t.valueNameID},{name:`value${e}`,type:"FLOAT",value:t.value},{name:`linkedValue${e}`,type:"FLOAT",value:t.linkedValue}]},Ms[4]=function(e,t){let n=[{name:`format${e}`,type:"USHORT",value:4},{name:`axisCount${e}`,type:"USHORT",value:t.axisValues.length},{name:`flags${e}`,type:"USHORT",value:t.flags},{name:`valueNameID${e}`,type:"USHORT",value:t.valueNameID}];for(let s=0;s<t.axisValues.length;s++)n=n.concat([{name:`format${e}axisIndex${s}`,type:"USHORT",value:t.axisValues[s].axisIndex},{name:`format${e}value${s}`,type:"FLOAT",value:t.axisValues[s].value}]);return n};var Ns={make:function(e){const t=new kt.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 n=0;n<e.axes.length;n++){const s=Fs(n,e.axes[n]);t.offsetToAxisValueOffsets+=s.sizeOf(),t.fields=t.fields.concat(s.fields)}const n=[];let s=[],r=2*e.values.length;for(let t=0;t<e.values.length;t++){const o=As(t,e.values[t]);n.push({name:"offset_"+t,type:"USHORT",value:r}),r+=o.sizeOf(),s=s.concat(o.fields)}return t.fields=t.fields.concat(n),t.fields=t.fields.concat(s),t},parse:function(e,t,n){t||(t=0);const s=new Xt.Parser(e,t),r=s.parseUShort(),o=s.parseUShort();1!==r&&console.warn(`Unsupported STAT table version ${r}.${o}`);const a=[r,o],i=s.parseUShort(),l=s.parseUShort(),u=s.parseOffset32(),c=s.parseUShort(),p=s.parseOffset32(),h=r>1||o>0?s.parseUShort():void 0;void 0!==n&&tt.argument(l>=n.axes.length,"STAT axis count must be greater than or equal to fvar axis count"),c>0&&tt.argument(l>=0,"STAT axis count must be greater than 0 if STAT axis value count is greater than 0");const f=[];for(let e=0;e<l;e++)s.offset=t+u,s.relativeOffset=e*i,f.push(s.parseStruct(Cs));s.offset=t,s.relativeOffset=p;const d=s.parseUShortList(c),g=[];for(let e=0;e<c;e++)s.offset=t+p,s.relativeOffset=d[e],g.push(Ds.apply(s));return{version:a,axes:f,values:g,elidedFallbackNameID:h}}};function Ps(e,t){return new kt.Record("axisValueMap_"+e,[{name:"fromCoordinate_"+e,type:"F2DOT14",value:t.fromCoordinate},{name:"toCoordinate_"+e,type:"F2DOT14",value:t.toCoordinate}])}function Bs(e,t){const n=new kt.Record("segmentMap_"+e,[{name:"positionMapCount_"+e,type:"USHORT",value:t.axisValueMaps.length}]);let s=[];for(let n=0;n<t.axisValueMaps.length;n++){const r=Ps(`${e}_${n}`,t.axisValueMaps[n]);s=s.concat(r.fields)}return n.fields=n.fields.concat(s),n}var Gs={make:function(e,t){tt.argument(e.axisSegmentMaps.length===t.axes.length,"avar axis count must correspond to fvar axis count");const n=new kt.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 t=0;t<e.axisSegmentMaps.length;t++){const s=Bs(t,e.axisSegmentMaps[t]);n.fields=n.fields.concat(s.fields)}return n},parse:function(e,t,n){t||(t=0);const s=new Wt(e,t),r=s.parseUShort(),o=s.parseUShort();1!==r&&console.warn(`Unsupported avar table version ${r}.${o}`),s.skip("uShort",1);const a=s.parseUShort();tt.argument(a===n.axes.length,"avar axis count must correspond to fvar axis count");const i=[];for(let e=0;e<a;e++){const e=[],t=s.parseUShort();for(let n=0;n<t;n++){const t=s.parseF2Dot14(),n=s.parseF2Dot14();e.push({fromCoordinate:t,toCoordinate:n})}i.push({axisValueMaps:e})}return{version:[r,o],axisSegmentMaps:i}}};var Hs={make:function(){console.warn("Writing of cvar tables is not yet supported.")},parse:function(e,t,n,s){const r=new Xt.Parser(e,t),o=r.parseTupleVariationStore(r.relativeOffset,n.axes.length,"cvar",s),a=r.parseUShort(),i=r.parseUShort();return 1!==a&&console.warn(`Unsupported cvar table version ${a}.${i}`),{version:[a,i],...o}}};var _s={make:function(){console.warn("Writing of gvar tables is not yet supported.")},parse:function(e,t,n,s){const r=new Xt.Parser(e,t),o=r.parseUShort(),a=r.parseUShort();1!==o&&console.warn(`Unsupported gvar table version ${o}.${a}`);const i=r.parseUShort();i!==n.axes.length&&console.warn(`axisCount ${i} in gvar table does not match the number of axes ${n.axes.length} in the fvar table!`);const l=r.parseUShort();return{version:[o,a],sharedTuples:r.parsePointer32(function(){return this.parseTupleRecords(l,i)}),glyphVariations:r.parseTupleVariationStoreList(i,"gvar",s)}}};var Vs={parse:function(e,t){const n={},s=new Xt.Parser(e,t);n.version=s.parseUShort(),tt.argument(n.version<=1,"Unsupported gasp table version."),n.numRanges=s.parseUShort(),n.gaspRanges=[];for(let e=0;e<n.numRanges;e++)n.gaspRanges[e]={rangeMaxPPEM:s.parseUShort(),rangeGaspBehavior:s.parseUShort()};return n},make:function(e){const t=new kt.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 zs={make:function(e){const t=Array.from(e.keys()).sort(),n=[],s=[],r=new Map;let o=0,a={endGlyphID:null};for(let i=0,l=t.length;i<l;i++){const l=t[i],u=e.get(l);let c=r.get(u);void 0===c&&(c=o,s.push(u),r.set(u,c),o+=u.byteLength),l-1===a.endGlyphID&&c===a.svgDocOffset?a.endGlyphID=l:(a={startGlyphID:l,endGlyphID:l,svgDocOffset:c,svgDocLength:u.byteLength},n.push(a))}const i=n.length,l=s.length,u=2+12*i,c=new Array(4+4*i+l);let p=0;c[p++]={name:"version",type:"USHORT",value:0},c[p++]={name:"svgDocumentListOffset",type:"ULONG",value:10},c[p++]={name:"reserved",type:"ULONG",value:0},c[p++]={name:"numEntries",type:"USHORT",value:i};for(let e=0;e<i;e++){const t="documentRecord_"+e,{startGlyphID:s,endGlyphID:r,svgDocOffset:o,svgDocLength:a}=n[e];c[p++]={name:t+"_startGlyphID",type:"USHORT",value:s},c[p++]={name:t+"_endGlyphID",type:"USHORT",value:r},c[p++]={name:t+"_svgDocOffset",type:"ULONG",value:u+o},c[p++]={name:t+"_svgDocLength",type:"ULONG",value:a}}for(let e=0;e<l;e++)c[p++]={name:"svgDoc_"+e,type:"LITERAL",value:s[e]};return new kt.Table("SVG ",c)},parse:function(e,t){const n=new Map,s=e.buffer,r=new Wt(e,t);if(0!==r.parseUShort())return n;r.relativeOffset=r.parseOffset32();const o=e.byteOffset+t+r.relativeOffset,a=r.parseUShort(),i=new Map;for(let e=0;e<a;e++){const e=r.parseUShort(),t=r.parseUShort(),a=o+r.parseOffset32(),l=r.parseULong();let u=i.get(a);void 0===u&&(u=new Uint8Array(s,a,l),i.set(a,u));for(let s=e;s<=t;s++)n.set(s,u)}return n}};function js(e){return Math.log(e)/Math.log(2)|0}function qs(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 Ws(e,t,n,s){return new kt.Record("Table Record",[{name:"tag",type:"TAG",value:void 0!==e?e:""},{name:"checkSum",type:"ULONG",value:void 0!==t?t:0},{name:"offset",type:"ULONG",value:void 0!==n?n:0},{name:"length",type:"ULONG",value:void 0!==s?s:0}])}function $s(e){const t=new kt.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;const n=Math.pow(2,js(t.numTables));t.searchRange=16*n,t.entrySelector=js(n),t.rangeShift=16*t.numTables-t.searchRange;const s=[],r=[];let o=t.sizeOf()+Ws().sizeOf()*t.numTables;for(;o%4!=0;)o+=1,r.push({name:"padding",type:"BYTE",value:0});for(let t=0;t<e.length;t+=1){const n=e[t];tt.argument(4===n.tableName.length,"Table name"+n.tableName+" is invalid.");const a=n.sizeOf(),i=Ws(n.tableName,qs(n.encode()),o,a);for(s.push({name:i.tag+" Table Record",type:"RECORD",value:i}),r.push({name:n.tableName+" table",type:"RECORD",value:n}),o+=a,tt.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(e,t){return e.value.tag>t.value.tag?1:-1}),t.fields=t.fields.concat(s),t.fields=t.fields.concat(r),t}function Xs(e,t,n){for(let n=0;n<t.length;n+=1){const s=e.charToGlyphIndex(t[n]);if(s>0){return e.glyphs.get(s).getMetrics()}}return n}function Ys(e){let t=0;for(let n=0;n<e.length;n+=1)t+=e[n];return t/e.length}var Zs={make:$s,fontToTable:function(e){const t=[],n=[],s=[],r=[],o=[],a=[],i=[];let l,u=0,c=0,p=0,h=0,f=0;for(let d=0;d<e.glyphs.length;d+=1){const g=e.glyphs.get(d),m=0|g.unicode;if(isNaN(g.advanceWidth))throw new Error("Glyph "+g.name+" ("+d+"): advanceWidth is not a number.");(l>m||void 0===l)&&m>0&&(l=m),u<m&&(u=m);const y=ys.getUnicodeRange(m);if(y<32)c|=1<<y;else if(y<64)p|=1<<y-32;else if(y<96)h|=1<<y-64;else{if(!(y<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");f|=1<<y-96}if(".notdef"===g.name)continue;const v=g.getMetrics();t.push(v.xMin),n.push(v.yMin),s.push(v.xMax),r.push(v.yMax),a.push(v.leftSideBearing),i.push(v.rightSideBearing),o.push(g.advanceWidth)}const d={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:Ys(o),minLeftSideBearing:Math.min.apply(null,a),maxLeftSideBearing:Math.max.apply(null,a),minRightSideBearing:Math.min.apply(null,i)};d.ascender=e.ascender,d.descender=e.descender;let g=0;e.weightClass>=600&&(g|=e.macStyleValues.BOLD),e.italicAngle<0&&(g|=e.macStyleValues.ITALIC);const m=ps.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:d.xMin,yMin:d.yMin,xMax:d.xMax,yMax:d.yMax,lowestRecPPEM:3,macStyle:g,createdTimestamp:e.createdTimestamp}),y=hs.make({ascender:d.ascender,descender:d.descender,advanceWidthMax:d.advanceWidthMax,minLeftSideBearing:d.minLeftSideBearing,minRightSideBearing:d.minRightSideBearing,xMaxExtent:d.maxLeftSideBearing+(d.xMax-d.xMin),numberOfHMetrics:e.glyphs.length}),v=gs.make(e.glyphs.length),b=ys.make(Object.assign({xAvgCharWidth:Math.round(d.advanceWidthAvg),usFirstCharIndex:l,usLastCharIndex:u,ulUnicodeRange1:c,ulUnicodeRange2:p,ulUnicodeRange3:h,ulUnicodeRange4:f,sTypoAscender:d.ascender,sTypoDescender:d.descender,sTypoLineGap:0,usWinAscent:d.yMax,usWinDescent:Math.abs(d.yMin),ulCodePageRange1:1,sxHeight:Xs(e,"xyvw",{yMax:Math.round(d.ascender/2)}).yMax,sCapHeight:Xs(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",d).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0},e.tables.os2)),S=fs.make(e.glyphs),x=fn.make(e.glyphs),T=e.getEnglishName("fontFamily"),O=e.getEnglishName("fontSubfamily"),k=T+" "+O;let w=e.getEnglishName("postScriptName");w||(w=T.replace(/\s/g,"")+"-"+O);const I={};for(let t in e.names)I[t]=e.names[t];I.unicode=I.unicode||{},I.macintosh=I.macintosh||{},I.windows=I.windows||{};const U=e.names.unicode||{},R=e.names.macintosh||{},L=e.names.windows||{};for(const t in I){if(I[t]=I[t]||{},!I[t].uniqueID){const n=e.getEnglishName("manufacturer")||"";I[t].uniqueID={en:`${n}: ${k}`}}I[t].postScriptName||(I[t].postScriptName={en:w})}I.unicode.preferredFamily||(I.unicode.preferredFamily=U.fontFamily||R.fontFamily||L.fontFamily),I.macintosh.preferredFamily||(I.macintosh.preferredFamily=R.fontFamily||U.fontFamily||L.fontFamily),I.windows.preferredFamily||(I.windows.preferredFamily=L.fontFamily||U.fontFamily||R.fontFamily),I.unicode.preferredSubfamily||(I.unicode.preferredSubfamily=U.fontSubfamily||R.fontSubfamily||L.fontSubfamily),I.macintosh.preferredSubfamily||(I.macintosh.preferredSubfamily=R.fontSubfamily||U.fontSubfamily||L.fontSubfamily),I.windows.preferredSubfamily||(I.windows.preferredSubfamily=L.fontSubfamily||U.fontSubfamily||R.fontSubfamily);const C=[],E=pn.make(I,C),D=C.length>0?ds.make(C):void 0,M=vs.make(e),F=cs.make(e.glyphs,{version:e.getEnglishName("version"),fullName:k,familyName:T,weightName:O,postScriptName:w,unitsPerEm:e.unitsPerEm,fontBBox:[0,d.yMin,d.ascender,d.advanceWidthMax],topDict:e.tables.cff&&e.tables.cff.topDict||{}}),A=e.metas&&Object.keys(e.metas).length>0?Os.make(e.metas):void 0,N=[m,y,v,b,E,x,M,F,S];D&&N.push(D);const P={gsub:Ts,cpal:Mn,colr:ks,stat:Ns,avar:Gs,cvar:Hs,fvar:Ls,gvar:_s,gasp:Vs,svg:zs},B={avar:[e.tables.fvar],fvar:[e.names]};for(let t in P){const n=e.tables[t];if(n){const s=P[t].make.call(e,n,...B[t]||[]);s&&N.push(s)}}A&&N.push(A);const G=$s(N),H=qs(G.encode()),_=G.fields;let V=!1;for(let e=0;e<_.length;e+=1)if("head table"===_[e].name){_[e].value.checkSumAdjustment=2981146554-H,V=!0;break}if(!V)throw new Error("Could not find head table with checkSum to adjust.");return G},computeCheckSum:qs};function Qs(e,t){let n=0,s=e.length-1;for(;n<=s;){const 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 Ks(e,t){let n=0,s=e.length-1;for(;n<=s;){const r=n+s>>>1,o=e[r];if(o===t)return r;o<t?n=r+1:s=r-1}return-n-1}function Js(e,t){let n,s=0,r=e.length-1;for(;s<=r;){const o=s+r>>>1;n=e[o];const a=n.start;if(a===t)return n;a<t?s=o+1:r=o-1}if(s>0)return n=e[s-1],t>n.end?0:n}function er(e,t){this.font=e,this.tableName=t}er.prototype={searchTag:Qs,binSearch:Ks,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(e){return e.tag}):[]},getDefaultScriptName:function(){let e=this.getTable();if(!e)return;let t=!1;for(let n=0;n<e.scripts.length;n++){const s=e.scripts[n].tag;if("DFLT"===s)return s;"latn"===s&&(t=!0)}return t?"latn":void 0},getScriptTable:function(e,t){const n=this.getTable(t);if(n){e=e||"DFLT";const s=n.scripts,r=Qs(n.scripts,e);if(r>=0)return s[r].script;if(t){const t={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return s.splice(-1-r,0,t),t.script}}},getLangSysTable:function(e,t,n){const s=this.getScriptTable(e,n);if(s){if(!t||"dflt"===t||"DFLT"===t)return s.defaultLangSys;const e=Qs(s.langSysRecords,t);if(e>=0)return s.langSysRecords[e].langSys;if(n){const n={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return s.langSysRecords.splice(-1-e,0,n),n.langSys}}},getFeatureTable:function(e,t,n,s){const r=this.getLangSysTable(e,t,s);if(r){let e;const t=r.featureIndexes,o=this.font.tables[this.tableName].features;for(let s=0;s<t.length;s++)if(e=o[t[s]],e.tag===n)return e.feature;if(s){const s=o.length;return tt.assert(0===s||n>=o[s-1].tag,"Features must be added in alphabetical order."),e={tag:n,feature:{params:0,lookupListIndexes:[]}},o.push(e),t.push(s),e.feature}}},getLookupTables:function(e,t,n,s,r){const o=this.getFeatureTable(e,t,n,r),a=[];if(o){let e;const t=o.lookupListIndexes,n=this.font.tables[this.tableName].lookups;for(let r=0;r<t.length;r++)e=n[t[r]],e.lookupType===s&&a.push(e);if(0===a.length&&r){e={lookupType:s,lookupFlag:0,subtables:[],markFilteringSet:void 0};const r=n.length;return n.push(e),t.push(r),[e]}}return a},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:{const n=Js(e.ranges,t);return n?n.classId:0}}},getCoverageIndex:function(e,t){switch(e.format){case 1:{const n=Ks(e.glyphs,t);return n>=0?n:-1}case 2:{const n=Js(e.ranges,t);return n?n.index+t-n.start:-1}}},expandCoverage:function(e){if(1===e.format)return e.glyphs;{const t=[],n=e.ranges;for(let e=0;e<n.length;e++){const s=n[e],r=s.start,o=s.end;for(let e=r;e<=o;e++)t.push(e)}return t}}};var tr=er;function nr(e){tr.call(this,e,"gpos")}nr.prototype=tr.prototype,nr.prototype.init=function(){const e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},nr.prototype.getKerningValue=function(e,t,n){for(let s=0;s<e.length;s++){const r=e[s].subtables;for(let e=0;e<r.length;e++){const s=r[e],o=this.getCoverageIndex(s.coverage,t);if(!(o<0))switch(s.posFormat){case 1:{let e=s.pairSets[o];for(let t=0;t<e.length;t++){let s=e[t];if(s.secondGlyph===n)return s.value1&&s.value1.xAdvance||0}break}case 2:{const e=this.getGlyphClass(s.classDef1,t),r=this.getGlyphClass(s.classDef2,n),o=s.classRecords[e][r];return o.value1&&o.value1.xAdvance||0}}}}return 0},nr.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,"kern",2)};var sr=nr;function rr(e,t){const 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 or(e){return 31===e[0]&&139===e[1]&&8===e[2]}function ar(e){return{x:e.x,y:e.y,onCurve:e.onCurve,lastPointOfContour:e.lastPointOfContour}}function ir(e){return{glyphIndex:e.glyphIndex,xScale:e.xScale,scale01:e.scale01,scale10:e.scale10,yScale:e.yScale,dx:e.dx,dy:e.dy}}function lr(e){tr.call(this,e,"gsub")}function ur(e,t,n){const s=e.subtables;for(let e=0;e<s.length;e++){const n=s[e];if(n.substFormat===t)return n}if(n)return s.push(n),n}lr.prototype=tr.prototype,lr.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},lr.prototype.getSingle=function(e,t,n){const s=[],r=this.getLookupTables(t,n,e,1);for(let e=0;e<r.length;e++){const t=r[e].subtables;for(let e=0;e<t.length;e++){const n=t[e],r=this.expandCoverage(n.coverage);let o;if(1===n.substFormat){const e=n.deltaGlyphId;for(o=0;o<r.length;o++){const t=r[o];s.push({sub:t,by:t+e})}}else{const e=n.substitute;for(o=0;o<r.length;o++)s.push({sub:r[o],by:e[o]})}}}return s},lr.prototype.getMultiple=function(e,t,n){const s=[],r=this.getLookupTables(t,n,e,2);for(let e=0;e<r.length;e++){const t=r[e].subtables;for(let e=0;e<t.length;e++){const n=t[e],r=this.expandCoverage(n.coverage);let o;for(o=0;o<r.length;o++){const e=r[o],t=n.sequences[o];s.push({sub:e,by:t})}}}return s},lr.prototype.getAlternates=function(e,t,n){const s=[],r=this.getLookupTables(t,n,e,3);for(let e=0;e<r.length;e++){const t=r[e].subtables;for(let e=0;e<t.length;e++){const n=t[e],r=this.expandCoverage(n.coverage),o=n.alternateSets;for(let e=0;e<r.length;e++)s.push({sub:r[e],by:o[e]})}}return s},lr.prototype.getLigatures=function(e,t,n){const s=[],r=this.getLookupTables(t,n,e,4);for(let e=0;e<r.length;e++){const t=r[e].subtables;for(let e=0;e<t.length;e++){const n=t[e],r=this.expandCoverage(n.coverage),o=n.ligatureSets;for(let e=0;e<r.length;e++){const t=r[e],n=o[e];for(let e=0;e<n.length;e++){const r=n[e];s.push({sub:[t].concat(r.components),by:r.ligGlyph})}}}}return s},lr.prototype.addSingle=function(e,t,n,s){const r=ur(this.getLookupTables(n,s,e,1,!0)[0],2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});tt.assert(1===r.coverage.format,"Single: unable to modify coverage table format "+r.coverage.format);const o=t.sub;let a=this.binSearch(r.coverage.glyphs,o);a<0&&(a=-1-a,r.coverage.glyphs.splice(a,0,o),r.substitute.splice(a,0,0)),r.substitute[a]=t.by},lr.prototype.addMultiple=function(e,t,n,s){tt.assert(t.by instanceof Array&&t.by.length>1,'Multiple: "by" must be an array of two or more ids');const r=ur(this.getLookupTables(n,s,e,2,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});tt.assert(1===r.coverage.format,"Multiple: unable to modify coverage table format "+r.coverage.format);const o=t.sub;let a=this.binSearch(r.coverage.glyphs,o);a<0&&(a=-1-a,r.coverage.glyphs.splice(a,0,o),r.sequences.splice(a,0,0)),r.sequences[a]=t.by},lr.prototype.addAlternate=function(e,t,n,s){const r=ur(this.getLookupTables(n,s,e,3,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});tt.assert(1===r.coverage.format,"Alternate: unable to modify coverage table format "+r.coverage.format);const o=t.sub;let a=this.binSearch(r.coverage.glyphs,o);a<0&&(a=-1-a,r.coverage.glyphs.splice(a,0,o),r.alternateSets.splice(a,0,0)),r.alternateSets[a]=t.by},lr.prototype.addLigature=function(e,t,n,s){const r=this.getLookupTables(n,s,e,4,!0)[0];let o=r.subtables[0];o||(o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},r.subtables[0]=o),tt.assert(1===o.coverage.format,"Ligature: unable to modify coverage table format "+o.coverage.format);const a=t.sub[0],i=t.sub.slice(1),l={ligGlyph:t.by,components:i};let u=this.binSearch(o.coverage.glyphs,a);if(u>=0){const e=o.ligatureSets[u];for(let t=0;t<e.length;t++)if(rr(e[t].components,i))return;e.push(l)}else u=-1-u,o.coverage.glyphs.splice(u,0,a),o.ligatureSets.splice(u,0,[l])},lr.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)}},lr.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"number"==typeof t.by?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 cr=lr,pr=class{constructor(e){this.defaultValue=255,this.font=e}cpal(){return!(!this.font.tables||!this.font.tables.cpal)&&this.font.tables.cpal}getAll(e){const t=[],n=this.cpal();if(!n)return t;for(let s=0;s<n.colorRecordIndices.length;s++){const r=n.colorRecordIndices[s],o=[];for(let t=r;t<r+n.numPaletteEntries;t++)o.push(Dn(n.colorRecords[t],e||"hexa"));t.push(o)}return t}toCPALcolor(e){return Array.isArray(e)?e.map(e=>En(e,"raw")):En(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;const t=this.cpal(),n=t.numPaletteEntries+e,s=this.getAll().map(e=>this.fillPalette(e,[],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 Rn(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`);const o=this.cpal(),a=o.numPaletteEntries;Array.isArray(t)||(t=[t]),t.length+e>a&&(this.extend(t.length+e-a),s=this.getAll("raw"),r=s[n]);for(let n=0;n<t.length;n++)r[n+e]=this.toCPALcolor(t[n]);o.colorRecords=s.flat(),this.updateIndices()}add(e){if(this.ensureCPAL(e))return;const t=this.cpal(),n=t.numPaletteEntries;e&&e.length?((e=this.toCPALcolor(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){const t=this.getAll("raw");delete t[e];const 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");const 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 t=0;t<s.length;t++){const n=s[t].filter((t,n)=>n!==e);r.push(n)}const o=this.font.tables.colr;if(o){const n=o.layerRecords;for(let r=0;r<n.length;r++){const o=n[r].paletteIndex;if(o>e){const e=1;n[r].paletteIndex-=e}else if(o===e){let o=0;for(let n=0;n<s.length;n++)if(t>e&&t<=e+s[n].length){o++;break}n[r].paletteIndex=t-o}}this.font.tables.colr={...o,layerRecords:n}}const a=r.flat();for(let e=0;e<s.length;e++)n.colorRecordIndices[e]-=e;n.numPaletteEntries=Math.max(0,n.numPaletteEntries-1),n.colorRecords=this.toCPALcolor(a)}ensureCPAL(e){return!this.cpal()&&(e=e&&e.length?this.toCPALcolor(e):[this.defaultValue],this.font.tables.cpal={version:0,numPaletteEntries:e.length,colorRecords:e,colorRecordIndices:[0]},!0)}updateIndices(){const 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)}},hr=class{constructor(e){this.font=e}ensureCOLR(){return this.font.tables.colr||(this.font.tables.colr={version:0,baseGlyphRecords:[],layerRecords:[]}),this.font}get(e){const t=this.font,n=[],s=t.tables.colr,r=t.tables.cpal;if(!s||!r)return n;const o=function(e,t,n){let s=0,r=e.length-1,o=null;for(;s<=r;){const a=Math.floor((s+r)/2),i=e[a],l=i[t];if(l<n)s=a+1;else{if(!(l>n)){o=i;break}r=a-1}}return o}(s.baseGlyphRecords,"glyphID",e);if(!o)return n;const a=o.firstLayerIndex,i=o.numLayers;for(let e=0;e<i;e++){const r=s.layerRecords[a+e];n.push({glyph:t.glyphs.get(r.glyphID),paletteIndex:r.paletteIndex})}return n}add(e,t,n){const s=this.get(e);t=Array.isArray(t)?t:[t],void 0===n||n===1/0||n>s.length?n=s.length:n<0&&(n=s.length+1+n%(s.length+1))>=s.length+1&&(n-=s.length+1);const r=[];for(let e=0;e<n;e++){const t=Number.isInteger(s[e].glyph)?s[e].glyph:s[e].glyph.index;r.push({glyphID:t,paletteIndex:s[e].paletteIndex})}for(const e of t){const t=Number.isInteger(e.glyph)?e.glyph:e.glyph.index;r.push({glyphID:t,paletteIndex:e.paletteIndex})}for(let e=n;e<s.length;e++){const t=Number.isInteger(s[e].glyph)?s[e].glyph:s[e].glyph.index;r.push({glyphID:t,paletteIndex:s[e].paletteIndex})}this.updateColrTable(e,r)}setPaletteIndex(e,t,n){let s=this.get(e);s[t]?(s=s.map((e,s)=>({glyphID:e.glyph.index,paletteIndex:s===t?n:e.paletteIndex})),this.updateColrTable(e,s)):console.error("Invalid layer index")}remove(e,t,n=t){let s=this.get(e);s=s.map(e=>({glyphID:e.glyph.index,paletteIndex:e.paletteIndex})),s.splice(t,n-t+1),this.updateColrTable(e,s)}updateColrTable(e,t){this.ensureCOLR();const n=this.font.tables.colr;let s=function(e,t,n){let s=0,r=e.length-1;for(;s<=r;){const o=Math.floor((s+r)/2),a=e[o];if(a[t]<n)s=o+1;else{if(!(a[t]>n))return o;r=o-1}}return-1}(n.baseGlyphRecords,"glyphID",e);if(-1===s){const t={glyphID:e,firstLayerIndex:n.layerRecords.length,numLayers:0};s=function(e,t,n){let s=0,r=e.length;const o=(e,n)=>e[t]-n[t];for(;s<r;){const t=s+r>>>1;o(e[t],n)<0?s=t+1:r=t}return e.splice(s,0,n),s}(n.baseGlyphRecords,"glyphID",t)}const r=n.baseGlyphRecords[s],o=r.numLayers,a=t.length,i=a-o;if(i>0){const e=t.slice(o).map(e=>({glyphID:e.glyphID,paletteIndex:e.paletteIndex}));n.layerRecords.splice(r.firstLayerIndex+o,0,...e)}else i<0&&n.layerRecords.splice(r.firstLayerIndex+a,-i);for(let e=0;e<Math.min(o,a);e++)n.layerRecords[r.firstLayerIndex+e]={glyphID:t[e].glyphID,paletteIndex:t[e].paletteIndex};if(r.numLayers=a,0!==i)for(let e=0;e<n.baseGlyphRecords.length;e++){const t=n.baseGlyphRecords[e];e===s||t.firstLayerIndex<r.firstLayerIndex||(n.baseGlyphRecords[e].firstLayerIndex+=i)}}},fr=class{constructor(e){this.font=e,this.cache=new WeakMap}get(e){const t=this.getOrCreateSvgImageCacheEntry(e);return t&&t.image}getAsync(e){const t=this.getOrCreateSvgImageCacheEntry(e);return t&&t.promise}getOrCreateSvgImageCacheEntry(e){const t=this.font.tables.svg;if(void 0===t)return;const n=t.get(e);if(void 0===n)return;let s=this.cache.get(n);void 0===s&&(s=function(e){return{template:dr(e).then(gr),images:new Map}}(n),this.cache.set(n,s));let r=s.images.get(e);return void 0===r&&(r=function(e,t,n){return{promise:t.then(t=>{let s;"string"==typeof t?s=t:(t[4]=n,s=t.join(""));const r=function(e,t){const n=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement,s=n.viewBox.baseVal,r=n.width.baseVal,o=n.height.baseVal;let a=1,i=1;s.width>0&&s.height>0&&(1===r.unitType?(a=r.valueInSpecifiedUnits/s.width,i=1===o.unitType?o.valueInSpecifiedUnits/s.height:a):1===o.unitType?(i=o.valueInSpecifiedUnits/s.height,a=i):t&&(a=t/s.width,i=t/s.height));const l=document.createElement("div");l.style.position="fixed",l.style.visibility="hidden",l.appendChild(n),document.body.appendChild(l);const u=n.getBBox();document.body.removeChild(l);const c=(u.x-s.x)*a,p=(s.y-u.y)*i,h=u.width*a,f=u.height*i;n.setAttribute("viewBox",[u.x,u.y,u.width,u.height].join(" ")),1!==a&&n.setAttribute("width",h);1!==i&&n.setAttribute("height",f);const d=new Image(h,f);return d.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n.outerHTML),{leftSideBearing:c,baseline:p,image:d}}(s,e.unitsPerEm);return r.image.decode().then(()=>r)}),image:void 0}}(this.font,s.template,e),r.promise.then(t=>{if(r.image=t,"function"==typeof this.font.onGlyphUpdated)try{this.font.onGlyphUpdated(e)}catch(t){console.error("font.onGlyphUpdated",e,t)}}),s.images.set(e,r)),r}};var dr="function"==typeof DecompressionStream?function(e){if(or(e))return new Response(new Response(e).body.pipeThrough(new DecompressionStream("gzip"))).text();try{return Promise.resolve((new TextDecoder).decode(e))}catch(e){return Promise.reject(e)}}:function(e){try{return Promise.resolve((new TextDecoder).decode(or(e)?function(e){const t=new DataView(e.buffer,e.byteOffset,e.byteLength);let n=10;const s=e.byteLength-8,r=t.getInt8(3);if(4&r&&(n+=2+t.getUint16(n,!0)),8&r)for(;n<s&&0!==e[n++];);if(16&r)for(;n<s&&0!==e[n++];);if(2&r&&(n+=2),n>=s)throw new Error("Can't find compressed blocks");const o=t.getUint32(t.byteLength-4,!0);return je(e.subarray(n,s),new Uint8Array(o))}(e):e))}catch(e){return Promise.reject(e)}};function gr(e){const t=e.indexOf("<svg"),n=e.indexOf(">",t+4)+1;if(/ id=['"]glyph\d+['"]/.test(e.substring(t,n)))return e;const s=e.lastIndexOf("</svg>");return[e.substring(0,n),"<defs>",e.substring(n,s),'</defs><use href="#glyph',"",'"/>',e.substring(s)]}function mr(e,t,n,s,r){let o;return(t&s)>0?(o=e.parseByte(),0===(t&r)&&(o=-o),o=n+o):o=(t&r)>0?n:n+e.parseShort(),o}function yr(e,t,n){const s=new Xt.Parser(t,n);let r,o;if(e._numberOfContours=s.parseShort(),e._xMin=s.parseShort(),e._yMin=s.parseShort(),e._xMax=s.parseShort(),e._yMax=s.parseShort(),e._numberOfContours>0){const t=e.endPointIndices=[];for(let n=0;n<e._numberOfContours;n+=1)t.push(s.parseUShort());e.instructionLength=s.parseUShort(),e.instructions=[];for(let t=0;t<e.instructionLength;t+=1)e.instructions.push(s.parseByte());const n=t[t.length-1]+1;r=[];for(let e=0;e<n;e+=1)if(o=s.parseByte(),r.push(o),(8&o)>0){const t=s.parseByte();for(let n=0;n<t;n+=1)r.push(o),e+=1}if(tt.argument(r.length===n,"Bad flags."),t.length>0){const a=[];let i;if(n>0){for(let e=0;e<n;e+=1)o=r[e],i={},i.onCurve=!!(1&o),i.lastPointOfContour=t.indexOf(e)>=0,a.push(i);let e=0;for(let t=0;t<n;t+=1)o=r[t],i=a[t],i.x=mr(s,o,e,2,16),e=i.x;let l=0;for(let e=0;e<n;e+=1)o=r[e],i=a[e],i.y=mr(s,o,l,4,32),l=i.y}e.points=a}else e.points=[]}else if(0===e.numberOfContours)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];let t=!0;for(;t;){r=s.parseUShort();const n={glyphIndex:s.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(1&r)>0?(2&r)>0?(n.dx=s.parseShort(),n.dy=s.parseShort()):n.matchedPoints=[s.parseUShort(),s.parseUShort()]:(2&r)>0?(n.dx=s.parseChar(),n.dy=s.parseChar()):n.matchedPoints=[s.parseByte(),s.parseByte()],(8&r)>0?n.xScale=n.yScale=s.parseF2Dot14():(64&r)>0?(n.xScale=s.parseF2Dot14(),n.yScale=s.parseF2Dot14()):(128&r)>0&&(n.xScale=s.parseF2Dot14(),n.scale01=s.parseF2Dot14(),n.scale10=s.parseF2Dot14(),n.yScale=s.parseF2Dot14()),e.components.push(n),t=!!(32&r)}if(256&r){e.instructionLength=s.parseUShort(),e.instructions=[];for(let t=0;t<e.instructionLength;t+=1)e.instructions.push(s.parseByte())}}}function vr(e,t){const n=[];for(let s=0;s<e.length;s+=1){const 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 br(e){const t=new Ke;if(!e)return t;const n=function(e){const t=[];let n=[];for(let s=0;s<e.length;s+=1){const r=e[s];n.push(r),r.lastPointOfContour&&(t.push(n),n=[])}return tt.argument(0===n.length,"There are still points left in the current contour."),t}(e);for(let e=0;e<n.length;++e){const s=n[e];let r=s[s.length-1],o=s[0];if(r.onCurve)t.moveTo(r.x,r.y);else if(o.onCurve)t.moveTo(o.x,o.y);else{const e={x:.5*(r.x+o.x),y:.5*(r.y+o.y)};t.moveTo(e.x,e.y)}for(let e=0;e<s.length;++e)if(r=o,o=s[(e+1)%s.length],r.onCurve)t.lineTo(r.x,r.y);else{let e=o;o.onCurve||(e={x:.5*(r.x+o.x),y:.5*(r.y+o.y)}),t.quadraticCurveTo(r.x,r.y,e.x,e.y)}t.closePath()}return t}function Sr(e,t){if(t.isComposite)for(let n=0;n<t.components.length;n+=1){const s=t.components[n],r=e.get(s.glyphIndex);if(r.getPath(),r.points){let e;if(void 0===s.matchedPoints)e=vr(r.points,s);else{if(s.matchedPoints[0]>t.points.length-1||s.matchedPoints[1]>r.points.length-1)throw Error("Matched points out of range in "+t.name);const n=t.points[s.matchedPoints[0]];let o=r.points[s.matchedPoints[1]];const a={xScale:s.xScale,scale01:s.scale01,scale10:s.scale10,yScale:s.yScale,dx:0,dy:0};o=vr([o],a)[0],a.dx=n.x-o.x,a.dy=n.y-o.y,e=vr(r.points,a)}t.points=t.points.concat(e)}}return br(t.points)}var xr,Tr,Or,kr,wr={getPath:br,parse:function(e,t,n,s,r){return r.lowMemory?function(e,t,n,s){const r=new Bn.GlyphSet(s);return s._push=function(o){const a=n[o];a!==n[o+1]?r.push(o,Bn.ttfGlyphLoader(s,o,yr,e,t+a,Sr)):r.push(o,Bn.glyphLoader(s,o))},r}(e,t,n,s):function(e,t,n,s){const r=new Bn.GlyphSet(s);for(let o=0;o<n.length-1;o+=1){const a=n[o];a!==n[o+1]?r.push(o,Bn.ttfGlyphLoader(s,o,yr,e,t+a,Sr)):r.push(o,Bn.glyphLoader(s,o))}return r}(e,t,n,s)}},Ir=class{constructor(e){this.font=e}normalizeCoordTags(e){for(const t in e)if(t.length<4){const n=t.padEnd(4," ");void 0===e[n]&&(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++){const s=this.fvar().axes[n];let r=e[s.tag];void 0===r&&(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 e=0;e<this.avar().axisSegmentMaps.length;e++){let n=this.avar().axisSegmentMaps[e];for(let s=0;s<n.axisValueMaps.length;s++){let r=n.axisValueMaps[s];if(s>=1&&t[e]<r.fromCoordinate){let o=n.axisValueMaps[s-1];t[e]=((t[e]-o.fromCoordinate)*(r.toCoordinate-o.toCoordinate)+Number.EPSILON)/(r.fromCoordinate-o.fromCoordinate+Number.EPSILON)+o.toCoordinate;break}}}return t}interpolatePoints(e,t,n){if(0===e.length)return;let s=0;for(;s<e.length;){let r=s,o=s,a=e[o];for(;!a.lastPointOfContour;)a=e[++o];for(;s<=o&&!n[s];)s++;if(s>o)continue;let i=s,l=s;for(s++;s<=o;)n[s]&&(this.deltaInterpolate(l+1,s-1,l,s,t,e),l=s),s++;l===i?this.deltaShift(r,o,l,t,e):(this.deltaInterpolate(l+1,o,l,i,t,e),i>0&&this.deltaInterpolate(r,i-1,l,i,t,e)),s=o+1}}deltaInterpolate(e,t,n,s,r,o){if(e>t)return;let a=["x","y"];for(let l=0;l<a.length;l++){let u=a[l];if(r[n][u]>r[s][u]){var i=n;n=s,s=i}let c=r[n][u],p=r[s][u],h=o[n][u],f=o[s][u];if(c!==p||h===f){let n=c===p?0:(f-h)/(p-c);for(let s=e;s<=t;s++){let e=r[s][u];e<=c?e+=h-c:e>=p?e+=f-p:e=h+(e-c)*n,o[s][u]=e}}}}deltaShift(e,t,n,s,r){let o=r[n].x-s[n].x,a=r[n].y-s[n].y;if(0!==o||0!==a)for(let s=e;s<=t;s++)s!==n&&(r[s].x+=o,r[s].y+=a)}transformComponents(e,t,n,s,r,o){let a=0;for(let i=0;i<e.components.length;i++){const l=e.components[i],u=this.font.glyphs.get(l.glyphIndex),c=ir(l),p=s.indexOf(i);p>-1&&(c.dx+=Math.round(r.deltas[p]*o),c.dy+=Math.round(r.deltasY[p]*o));const h=vr(this.getTransform(u,n).points,c);t.splice(a,h.length,...h),a+=u.points.length}}applyTupleVariationStore(e,t,n,s="gvar",r={}){n||(n=this.font.variation.get());const o=this.getNormalizedCoords(n),{headers:a,sharedPoints:i}=e,l=this.fvar().axes.length;let u;"gvar"===s?u=t.map(ar):"cvar"===s&&(u=[...t]);for(let e=0;e<a.length;e++){const c=a[e];let p=1;for(let e=0;e<l;e++){let t=[0];switch(s){case"gvar":t=c.peakTuple?c.peakTuple:this.gvar().sharedTuples[c.sharedTupleRecordsIndex];break;case"cvar":t=c.peakTuple}if(0!==t[e]){if(0===o[e]){p=0;break}if(c.intermediateStartTuple){if(o[e]<c.intermediateStartTuple[e]||o[e]>c.intermediateEndTuple[e]){p=0;break}p=o[e]<t[e]?p*(o[e]-c.intermediateStartTuple[e]+Number.EPSILON)/(t[e]-c.intermediateStartTuple[e]+Number.EPSILON):p*(c.intermediateEndTuple[e]-o[e]+Number.EPSILON)/(c.intermediateEndTuple[e]-t[e]+Number.EPSILON)}else{if(o[e]<Math.min(0,t[e])||o[e]>Math.max(0,t[e])){p=0;break}p=(p*o[e]+Number.EPSILON)/(t[e]+Number.EPSILON)}}}if(0===p)continue;const h=c.privatePoints.length?c.privatePoints:i;if("gvar"===s&&r.glyph&&r.glyph.isComposite)this.transformComponents(r.glyph,u,n,h,c,p);else if(0===h.length)for(let e=0;e<u.length;e++){const t=u[e];"gvar"===s?u[e]={x:Math.round(t.x+c.deltas[e]*p),y:Math.round(t.y+c.deltasY[e]*p),onCurve:t.onCurve,lastPointOfContour:t.lastPointOfContour}:"cvar"===s&&(u[e]=Math.round(t+c.deltas[e]*p))}else{let e;"gvar"===s?e=u.map(ar):"cvar"===s&&(e=u);const n=Array(t.length).fill(!1);for(let r=0;r<h.length;r++){let o=h[r];if(o<t.length){let t=e[o];"gvar"===s?(n[o]=!0,t.x+=c.deltas[r]*p,t.y+=c.deltasY[r]*p):"cvar"===s&&(u[o]=Math.round(t+c.deltas[r]*p))}}if("gvar"===s){this.interpolatePoints(e,u,n);for(let n=0;n<t.length;n++){let t=e[n].x-u[n].x,s=e[n].y-u[n].y;u[n].x=Math.round(u[n].x+t),u[n].y=Math.round(u[n].y+s)}}}}return u}getTransform(e,t){Number.isInteger(e)&&(e=this.font.glyphs.get(e));const n=e.getBlendPath,s=!(!e.points||!e.points.length);let r=e;if(n||s)if(t||(t=this.font.variation.get()),s){const n=this.gvar()&&this.gvar().glyphVariations[e.index];if(n){const s=e.points;let o=this.applyTupleVariationStore(n,s,t,"gvar",{glyph:e});r=new An(Object.assign({},e,{points:o,path:br(o)}))}}else if(n){const n=e.getBlendPath(t);r=new An(Object.assign({},e,{path:n}))}return this.font.tables.hvar&&(e._advanceWidth=void 0!==e._advanceWidth?e._advanceWidth:e.advanceWidth,e.advanceWidth=r.advanceWidth=Math.round(e._advanceWidth+this.getVariableAdjustment(r.index,"hvar","advanceWidth",t)),e._leftSideBearing=void 0!==e._leftSideBearing?e._leftSideBearing:e.leftSideBearing,e.leftSideBearing=r.leftSideBearing=Math.round(e._leftSideBearing+this.getVariableAdjustment(r.index,"hvar","lsb",t))),r}getCvarTransform(e){const t=this.font.tables.cvt,n=this.cvar();return t&&t.length&&n&&n.headers.length?this.applyTupleVariationStore(n,t,e,"cvar"):t}getVariableAdjustment(e,t,n,s){let r,o;s=s||this.font.variation.get();const a=this.font.tables[t];if(!a)throw Error(`trying to get variation adjustment from non-existent table "${a}"`);if(!a.itemVariationStore)throw Error(`trying to get variation adjustment from table "${a}" which does not have an itemVariationStore`);const i=a[n]&&a[n].map.length;if(i){let t=e;t>=i&&(t=i-1),({outerIndex:r,innerIndex:o}=a[n].map[t])}else r=0,o=e;return this.getDelta(a.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],a=this.getBlendVector(e,t,s),i=0;for(let e=0;e<r.regionIndexes.length;e++)i+=o[e]*a[e];return i}getBlendVector(e,t,n){n||(n=this.font.variation.get());let s=e.itemVariationSubtables[t];const r=this.getNormalizedCoords(n);let o=[];for(let t=0;t<s.regionIndexes.length;t++){let n=1,a=s.regionIndexes[t],i=e.variationRegions[a].regionAxes;for(let e=0;e<i.length;e++){let t,s=i[e];t=s.startCoord>s.peakCoord||s.peakCoord>s.endCoord||s.startCoord<0&&s.endCoord>0&&0!==s.peakCoord||0===s.peakCoord?1:r[e]<s.startCoord||r[e]>s.endCoord?0:r[e]===s.peakCoord?1:r[e]<s.peakCoord?(r[e]-s.startCoord+Number.EPSILON)/(s.peakCoord-s.startCoord+Number.EPSILON):(s.endCoord-r[e]+Number.EPSILON)/(s.endCoord-s.peakCoord+Number.EPSILON),n*=t}o[t]=n}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}},Ur=class{constructor(e){this.font=e,this.process=new Ir(this.font),this.activateDefaultVariation(),this.getTransform=this.process.getTransform.bind(this.process)}activateDefaultVariation(){const 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(){const e=this.getDefaultCoordinates();let t=this.getInstanceIndex(e);return t<0&&(t=this.fvar().instances.findIndex(e=>e.name&&"Regular"===e.name.en)),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)){const 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}};function Rr(e){this.font=e,this.getCommands=function(e){return wr.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Lr(e){return e}function Cr(e){return Math.sign(e)*Math.round(Math.abs(e))}function Er(e){return Math.sign(e)*Math.round(Math.abs(2*e))/2}function Dr(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function Mr(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function Fr(e){return Math.sign(e)*Math.floor(Math.abs(e))}var Ar=function(e){const t=this.srPeriod;let n=this.srPhase;let s=1;return e<0&&(e=-e,s=-1),e+=this.srThreshold-n,e=Math.trunc(e/t)*t,(e+=n)<0?n*s:e*s},Nr={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,a,i,l,u,c;if(!s||s===this)return r=e.xo-t.xo,o=e.xo-n.xo,l=t.x-t.xo,u=n.x-n.xo,a=Math.abs(r),i=Math.abs(o),c=a+i,0===c?void(e.x=e.xo+(l+u)/2):void(e.x=e.xo+(l*i+u*a)/c);r=s.distance(e,t,!0,!0),o=s.distance(e,n,!0,!0),l=s.distance(t,t,!1,!0),u=s.distance(n,n,!1,!0),a=Math.abs(r),i=Math.abs(o),c=a+i,0!==c?Nr.setRelative(e,e,(l*i+u*a)/c,s,!0):Nr.setRelative(e,e,(l+u)/2,s,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,n,s,r){if(!s||s===this)return void(e.x=(r?t.xo:t.x)+n);const o=r?t.xo:t.x,a=r?t.yo:t.y,i=o+n*s.x,l=a+n*s.y;e.x=i+(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}},Pr={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,a,i,l,u,c;if(!s||s===this)return r=e.yo-t.yo,o=e.yo-n.yo,l=t.y-t.yo,u=n.y-n.yo,a=Math.abs(r),i=Math.abs(o),c=a+i,0===c?void(e.y=e.yo+(l+u)/2):void(e.y=e.yo+(l*i+u*a)/c);r=s.distance(e,t,!0,!0),o=s.distance(e,n,!0,!0),l=s.distance(t,t,!1,!0),u=s.distance(n,n,!1,!0),a=Math.abs(r),i=Math.abs(o),c=a+i,0!==c?Pr.setRelative(e,e,(l*i+u*a)/c,s,!0):Pr.setRelative(e,e,(l+u)/2,s,!0)},normalSlope:0,setRelative:function(e,t,n,s,r){if(!s||s===this)return void(e.y=(r?t.yo:t.y)+n);const o=r?t.xo:t.x,a=r?t.yo:t.y,i=o+n*s.x,l=a+n*s.y;e.y=l+s.normalSlope*(e.x-i)},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};function Br(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}function Gr(e,t){const n=Math.sqrt(e*e+t*t);return t/=n,1===(e/=n)&&0===t?Nr:0===e&&1===t?Pr:new Br(e,t)}function Hr(e,t,n,s){this.x=this.xo=Math.round(64*e)/64,this.y=this.yo=Math.round(64*t)/64,this.lastPointOfContour=n,this.onCurve=s,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Object.freeze(Nr),Object.freeze(Pr),Br.prototype.distance=function(e,t,n,s){return this.x*Nr.distance(e,t,n,s)+this.y*Pr.distance(e,t,n,s)},Br.prototype.interpolate=function(e,t,n,s){let r,o,a,i,l,u,c;a=s.distance(e,t,!0,!0),i=s.distance(e,n,!0,!0),r=s.distance(t,t,!1,!0),o=s.distance(n,n,!1,!0),l=Math.abs(a),u=Math.abs(i),c=l+u,0!==c?this.setRelative(e,e,(r*u+o*l)/c,s,!0):this.setRelative(e,e,(r+o)/2,s,!0)},Br.prototype.setRelative=function(e,t,n,s,r){s=s||this;const o=r?t.xo:t.x,a=r?t.yo:t.y,i=o+n*s.x,l=a+n*s.y,u=s.normalSlope,c=this.slope,p=e.x,h=e.y;e.x=(c*p-u*i+l-h)/(c-u),e.y=c*(e.x-p)+h},Br.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0},Hr.prototype.nextTouched=function(e){let t=this.nextPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},Hr.prototype.prevTouched=function(e){let t=this.prevPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var _r=Object.freeze(new Hr(0,0)),Vr={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function zr(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=Nr,this.round=Cr}}function jr(e){const t=e.tZone=new Array(e.gZone.length);for(let e=0;e<t.length;e++)t[e]=new Hr(0,0)}function qr(e,t){const n=e.prog;let s,r=e.ip,o=1;do{if(s=n[++r],88===s)o++;else if(89===s)o--;else if(64===s)r+=n[r+1]+1;else if(65===s)r+=2*n[r+1]+1;else if(s>=176&&s<=183)r+=s-176+1;else if(s>=184&&s<=191)r+=2*(s-184+1);else if(t&&1===o&&27===s)break}while(o>0);e.ip=r}function Wr(e,t){t.fv=t.pv=t.dpv=e}function $r(e,t){t.pv=t.dpv=e}function Xr(e,t){t.fv=e}function Yr(e,t){const n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],a=t.z1[r];let i,l;e?(i=o.y-a.y,l=a.x-o.x):(i=a.x-o.x,l=a.y-o.y),t.pv=t.dpv=Gr(i,l)}function Zr(e,t){const n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],a=t.z1[r];let i,l;e?(i=o.y-a.y,l=a.x-o.x):(i=a.x-o.x,l=a.y-o.y),t.fv=Gr(i,l)}function Qr(e){e.stack.pop()}function Kr(e,t){const n=t.stack.pop(),s=t.z0[n],r=t.fv,o=t.pv;let a=o.distance(s,_r);e&&(a=t.round(a)),r.setRelative(s,_r,a,o),r.touch(s),t.rp0=t.rp1=n}function Jr(e,t){const n=t.z2,s=n.length-2;let r,o,a;for(let t=0;t<s;t++)r=n[t],e.touched(r)||(o=r.prevTouched(e),o!==r&&(a=r.nextTouched(e),o===a&&e.setRelative(r,r,e.distance(o,o,!1,!0),e,!0),e.interpolate(r,o,a,e)))}function eo(e,t){const n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,a=t.pv;let i=t.loop;const l=t.z2;for(;i--;){const e=l[n.pop()],t=a.distance(r,r,!1,!0);o.setRelative(e,e,t,a),o.touch(e)}t.loop=1}function to(e,t){const n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,a=t.pv,i=n.pop(),l=t.z2[t.contours[i]];let u=l;const c=a.distance(r,r,!1,!0);do{u!==r&&o.setRelative(u,u,c,a),u=u.nextPointOnContour}while(u!==l)}function no(e,t){const n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,a=t.pv;let i,l;switch(n.pop()){case 0:i=t.tZone;break;case 1:i=t.gZone;break;default:throw new Error("Invalid zone")}const u=a.distance(r,r,!1,!0),c=i.length-2;for(let e=0;e<c;e++)l=i[e],o.setRelative(l,l,u,a)}function so(e,t){const n=t.stack,s=n.pop()/64,r=n.pop(),o=t.z1[r],a=t.z0[t.rp0],i=t.fv,l=t.pv;i.setRelative(o,a,s,l),i.touch(o),t.rp1=t.rp0,t.rp2=r,e&&(t.rp0=r)}function ro(e,t){const n=t.stack,s=n.pop(),r=n.pop(),o=t.z0[r],a=t.fv,i=t.pv;let l=t.cvt[s];let u=i.distance(o,_r);e&&(Math.abs(u-l)<t.cvCutIn&&(u=l),u=t.round(u)),a.setRelative(o,_r,u,i),0===t.zp0&&(o.xo=o.x,o.yo=o.y),a.touch(o),t.rp0=t.rp1=r}function oo(e,t){const n=t.stack,s=n.pop(),r=t.z2[s];n.push(64*t.dpv.distance(r,_r,e,!1))}function ao(e,t){const n=t.stack,s=n.pop(),r=n.pop(),o=t.z1[s],a=t.z0[r],i=t.dpv.distance(a,o,e,e);t.stack.push(Math.round(64*i))}function io(e,t){const n=t.stack,s=n.pop(),r=t.fv,o=t.pv,a=t.ppem,i=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;for(let e=0;e<s;e++){const e=n.pop(),t=n.pop();if(i+((240&t)>>4)!==a)continue;let s=(15&t)-8;s>=0&&s++;const c=u[e];r.setRelative(c,c,s*l,o)}}function lo(e,t){const n=t.stack,s=n.pop();n.push(64*t.round(s/64))}function uo(e,t){const n=t.stack,s=n.pop(),r=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;for(let e=0;e<s;e++){const e=n.pop(),s=n.pop();if(o+((240&s)>>4)!==r)continue;let i=(15&s)-8;i>=0&&i++;const l=i*a;0,t.cvt[e]+=l}}function co(e,t){const n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],a=t.z1[r];let i,l;e?(i=o.y-a.y,l=a.x-o.x):(i=a.x-o.x,l=a.y-o.y),t.dpv=Gr(i,l)}function po(e,t){const n=t.stack,s=t.prog;let r=t.ip;for(let t=0;t<e;t++)n.push(s[++r]);t.ip=r}function ho(e,t){let n=t.ip;const s=t.prog,r=t.stack;for(let t=0;t<e;t++){let e=s[++n]<<8|s[++n];32768&e&&(e=-(1+(65535^e))),r.push(e)}t.ip=n}function fo(e,t,n,s,r,o){const a=o.stack,i=e&&a.pop(),l=a.pop(),u=o.rp0,c=o.z0[u],p=o.z1[l],h=o.minDis,f=o.fv,d=o.dpv;let g,m,y,v;m=g=d.distance(p,c,!0,!0),y=m>=0?1:-1,m=Math.abs(m),e&&(v=o.cvt[i],s&&Math.abs(m-v)<o.cvCutIn&&(m=v)),n&&m<h&&(m=h),s&&(m=o.round(m)),f.setRelative(p,c,y*m,d),f.touch(p),o.rp1=o.rp0,o.rp2=l,t&&(o.rp0=l)}Rr.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(this._errorState>2)return;const n=this.font;let s=this._prepState;if(!s||s.ppem!==t){let e=this._fpgmState;if(!e){zr.prototype=Vr,e=this._fpgmState=new zr("fpgm",n.tables.fpgm),e.funcs=[],e.font=n;try{Tr(e)}catch(e){return console.log("Hinting error in FPGM:"+e),void(this._errorState=3)}}zr.prototype=e,s=this._prepState=new zr("prep",n.tables.prep),s.ppem=t;const r=n.variation&&n.variation.process.getCvarTransform()||n.tables.cvt;if(r){const e=s.cvt=new Array(r.length),o=t/n.unitsPerEm;for(let t=0;t<r.length;t++)e[t]=r[t]*o}else s.cvt=[];0;try{Tr(s)}catch(e){this._errorState<2&&console.log("Hinting error in PREP:"+e),this._errorState=2}}if(!(this._errorState>1))try{return Or(e,s)}catch(e){return this._errorState<1&&(console.log("Hinting error:"+e),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}},Or=function(e,t){const n=t.ppem/t.font.unitsPerEm,s=n;let r,o,a,i=e.components;if(zr.prototype=t,i){const l=t.font;o=[],r=[];for(let e=0;e<i.length;e++){const t=i[e],u=l.glyphs.get(t.glyphIndex);a=new zr("glyf",u.instructions),kr(u,a,n,s);const c=Math.round(t.dx*n),p=Math.round(t.dy*s),h=a.gZone,f=a.contours;for(let e=0;e<h.length;e++){const t=h[e];t.xTouched=t.yTouched=!1,t.xo=t.x=t.x+c,t.yo=t.y=t.y+p}const d=o.length;o.push.apply(o,h);for(let e=0;e<f.length;e++)r.push(f[e]+d)}e.instructions&&!a.inhibitGridFit&&(a=new zr("glyf",e.instructions),a.gZone=a.z0=a.z1=a.z2=o,a.contours=r,o.push(new Hr(0,0),new Hr(Math.round(e.advanceWidth*n),0)),Tr(a),o.length-=2)}else a=new zr("glyf",e.instructions),kr(e,a,n,s),o=a.gZone;return o},kr=function(e,t,n,s){const r=e.points||[],o=r.length,a=t.gZone=t.z0=t.z1=t.z2=[],i=t.contours=[];let l,u,c;for(let e=0;e<o;e++)l=r[e],a[e]=new Hr(l.x*n,l.y*s,l.lastPointOfContour,l.onCurve);for(let e=0;e<o;e++)l=a[e],u||(u=l,i.push(e)),l.lastPointOfContour?(l.nextPointOnContour=u,u.prevPointOnContour=l,u=void 0):(c=a[e+1],l.nextPointOnContour=c,c.prevPointOnContour=l);t.inhibitGridFit||(a.push(new Hr(0,0),new Hr(Math.round(e.advanceWidth*n),0)),Tr(t),a.length-=2)},Tr=function(e){let t=e.prog;if(!t)return;const n=t.length;let s;for(e.ip=0;e.ip<n;e.ip++){if(s=xr[t[e.ip]],!s)throw new Error("unknown instruction: 0x"+Number(t[e.ip]).toString(16));s(e)}},xr=[Wr.bind(void 0,Pr),Wr.bind(void 0,Nr),$r.bind(void 0,Pr),$r.bind(void 0,Nr),Xr.bind(void 0,Pr),Xr.bind(void 0,Nr),Yr.bind(void 0,0),Yr.bind(void 0,1),Zr.bind(void 0,0),Zr.bind(void 0,1),function(e){const t=e.stack,n=t.pop(),s=t.pop();e.pv=e.dpv=Gr(s,n)},function(e){const t=e.stack,n=t.pop(),s=t.pop();e.fv=Gr(s,n)},function(e){const t=e.stack,n=e.pv;t.push(16384*n.x),t.push(16384*n.y)},function(e){const t=e.stack,n=e.fv;t.push(16384*n.x),t.push(16384*n.y)},function(e){e.fv=e.pv},function(e){const t=e.stack,n=t.pop(),s=t.pop(),r=t.pop(),o=t.pop(),a=t.pop(),i=e.z0,l=e.z1,u=i[n],c=i[s],p=l[r],h=l[o],f=e.z2[a],d=u.x,g=u.y,m=c.x,y=c.y,v=p.x,b=p.y,S=h.x,x=h.y,T=(d-m)*(b-x)-(g-y)*(v-S),O=d*y-g*m,k=v*x-b*S;f.x=(O*(v-S)-k*(d-m))/T,f.y=(O*(b-x)-k*(g-y))/T},function(e){e.rp0=e.stack.pop()},function(e){e.rp1=e.stack.pop()},function(e){e.rp2=e.stack.pop()},function(e){const t=e.stack.pop();switch(e.zp0=t,t){case 0:e.tZone||jr(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){const t=e.stack.pop();switch(e.zp1=t,t){case 0:e.tZone||jr(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){const t=e.stack.pop();switch(e.zp2=t,t){case 0:e.tZone||jr(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){const t=e.stack.pop();switch(e.zp0=e.zp1=e.zp2=t,t){case 0:e.tZone||jr(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(e){e.loop=e.stack.pop()},function(e){e.round=Cr},function(e){e.round=Dr},function(e){const t=e.stack.pop();e.minDis=t/64},function(e){qr(e,!1)},function(e){const t=e.stack.pop();e.ip+=t-1},function(e){const t=e.stack.pop();e.cvCutIn=t/64},void 0,void 0,function(e){const t=e.stack;t.push(t[t.length-1])},Qr,function(e){e.stack.length=0},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(n),t.push(s)},function(e){const t=e.stack;t.push(t.length)},function(e){const t=e.stack,n=t.pop();t.push(t[t.length-n])},function(e){const t=e.stack,n=t.pop();t.push(t.splice(t.length-n,1)[0])},void 0,void 0,void 0,function(e){const t=e.stack,n=t.pop(),s=t.pop(),r=e.ip,o=e.prog;e.prog=e.funcs[n];for(let t=0;t<s;t++)Tr(e);e.ip=r,e.prog=o},function(e){const t=e.stack.pop(),n=e.ip,s=e.prog;e.prog=e.funcs[t],Tr(e),e.ip=n,e.prog=s},function(e){if("fpgm"!==e.env)throw new Error("FDEF not allowed here");const t=e.stack,n=e.prog;let s=e.ip;const r=t.pop(),o=s;for(0;45!==n[++s];);e.ip=s,e.funcs[r]=n.slice(o+1,s)},void 0,Kr.bind(void 0,0),Kr.bind(void 0,1),Jr.bind(void 0,Pr),Jr.bind(void 0,Nr),eo.bind(void 0,0),eo.bind(void 0,1),to.bind(void 0,0),to.bind(void 0,1),no.bind(void 0,0),no.bind(void 0,1),function(e){const t=e.stack;let n=e.loop;const s=e.fv,r=t.pop()/64,o=e.z2;for(;n--;){const e=o[t.pop()];0,s.setRelative(e,e,r),s.touch(e)}e.loop=1},function(e){const t=e.stack,n=e.rp1,s=e.rp2;let r=e.loop;const o=e.z0[n],a=e.z1[s],i=e.fv,l=e.dpv,u=e.z2;for(;r--;){const e=u[t.pop()];0,i.interpolate(e,o,a,l),i.touch(e)}e.loop=1},so.bind(void 0,0),so.bind(void 0,1),function(e){const t=e.stack,n=e.rp0,s=e.z0[n];let r=e.loop;const o=e.fv,a=e.pv,i=e.z1;for(;r--;){const e=i[t.pop()];0,o.setRelative(e,s,0,a),o.touch(e)}e.loop=1},function(e){e.round=Er},ro.bind(void 0,0),ro.bind(void 0,1),function(e){const t=e.prog;let n=e.ip;const s=e.stack,r=t[++n];for(let e=0;e<r;e++)s.push(t[++n]);e.ip=n},function(e){let t=e.ip;const n=e.prog,s=e.stack,r=n[++t];for(let e=0;e<r;e++){let e=n[++t]<<8|n[++t];32768&e&&(e=-(1+(65535^e))),s.push(e)}e.ip=t},function(e){const t=e.stack;let n=e.store;n||(n=e.store=[]);const s=t.pop();n[t.pop()]=s},function(e){const t=e.stack,n=e.store,s=t.pop(),r=n&&n[s]||0;t.push(r)},function(e){const t=e.stack,n=t.pop(),s=t.pop();e.cvt[s]=n/64},function(e){const t=e.stack,n=t.pop();t.push(64*e.cvt[n])},oo.bind(void 0,0),oo.bind(void 0,1),void 0,ao.bind(void 0,0),ao.bind(void 0,1),function(e){e.stack.push(e.ppem)},void 0,function(e){e.autoFlip=!0},void 0,void 0,function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s<n?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s<=n?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s>n?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s>=n?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(n===s?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(n!==s?1:0)},function(e){const t=e.stack,n=t.pop();t.push(1&Math.trunc(n)?1:0)},function(e){const t=e.stack,n=t.pop();t.push(1&Math.trunc(n)?0:1)},function(e){e.stack.pop()||qr(e,!0)},function(e){0},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(n&&s?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(n||s?1:0)},function(e){const t=e.stack,n=t.pop();t.push(n?0:1)},io.bind(void 0,1),function(e){const t=e.stack.pop();e.deltaBase=t},function(e){const t=e.stack.pop();e.deltaShift=Math.pow(.5,t)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s+n)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s-n)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(64*s/n)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s*n/64)},function(e){const t=e.stack,n=t.pop();t.push(Math.abs(n))},function(e){const t=e.stack;let n=t.pop();t.push(-n)},function(e){const t=e.stack,n=t.pop();t.push(64*Math.floor(n/64))},function(e){const t=e.stack,n=t.pop();t.push(64*Math.ceil(n/64))},lo.bind(void 0,0),lo.bind(void 0,1),lo.bind(void 0,2),lo.bind(void 0,3),void 0,void 0,void 0,void 0,function(e){const t=e.stack,n=t.pop(),s=t.pop();e.cvt[s]=n*e.ppem/e.font.unitsPerEm},io.bind(void 0,2),io.bind(void 0,3),uo.bind(void 0,1),uo.bind(void 0,2),uo.bind(void 0,3),function(e){let t,n=e.stack.pop();switch(e.round=Ar,192&n){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,48&n){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")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*t},function(e){let t,n=e.stack.pop();switch(e.round=Ar,192&n){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,48&n){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")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*t},void 0,void 0,function(e){e.round=Lr},void 0,function(e){e.round=Mr},function(e){e.round=Fr},Qr,Qr,void 0,void 0,void 0,void 0,void 0,function(e){e.stack.pop()},co.bind(void 0,0),co.bind(void 0,1),function(e){const t=e.stack,n=t.pop();let s=0;1&n&&(s=35),32&n&&(s|=4096),t.push(s)},void 0,function(e){const t=e.stack,n=t.pop(),s=t.pop(),r=t.pop();t.push(s),t.push(n),t.push(r)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(Math.max(s,n))},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(Math.min(s,n))},function(e){e.stack.pop()},function(e){const t=e.stack.pop();let n=e.stack.pop();switch(t){case 1:return void(e.inhibitGridFit=!!n);case 2:return void(e.ignoreCvt=!!n);default:throw new Error("invalid INSTCTRL[] selector")}},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,po.bind(void 0,1),po.bind(void 0,2),po.bind(void 0,3),po.bind(void 0,4),po.bind(void 0,5),po.bind(void 0,6),po.bind(void 0,7),po.bind(void 0,8),ho.bind(void 0,1),ho.bind(void 0,2),ho.bind(void 0,3),ho.bind(void 0,4),ho.bind(void 0,5),ho.bind(void 0,6),ho.bind(void 0,7),ho.bind(void 0,8),fo.bind(void 0,0,0,0,0,0),fo.bind(void 0,0,0,0,0,1),fo.bind(void 0,0,0,0,0,2),fo.bind(void 0,0,0,0,0,3),fo.bind(void 0,0,0,0,1,0),fo.bind(void 0,0,0,0,1,1),fo.bind(void 0,0,0,0,1,2),fo.bind(void 0,0,0,0,1,3),fo.bind(void 0,0,0,1,0,0),fo.bind(void 0,0,0,1,0,1),fo.bind(void 0,0,0,1,0,2),fo.bind(void 0,0,0,1,0,3),fo.bind(void 0,0,0,1,1,0),fo.bind(void 0,0,0,1,1,1),fo.bind(void 0,0,0,1,1,2),fo.bind(void 0,0,0,1,1,3),fo.bind(void 0,0,1,0,0,0),fo.bind(void 0,0,1,0,0,1),fo.bind(void 0,0,1,0,0,2),fo.bind(void 0,0,1,0,0,3),fo.bind(void 0,0,1,0,1,0),fo.bind(void 0,0,1,0,1,1),fo.bind(void 0,0,1,0,1,2),fo.bind(void 0,0,1,0,1,3),fo.bind(void 0,0,1,1,0,0),fo.bind(void 0,0,1,1,0,1),fo.bind(void 0,0,1,1,0,2),fo.bind(void 0,0,1,1,0,3),fo.bind(void 0,0,1,1,1,0),fo.bind(void 0,0,1,1,1,1),fo.bind(void 0,0,1,1,1,2),fo.bind(void 0,0,1,1,1,3),fo.bind(void 0,1,0,0,0,0),fo.bind(void 0,1,0,0,0,1),fo.bind(void 0,1,0,0,0,2),fo.bind(void 0,1,0,0,0,3),fo.bind(void 0,1,0,0,1,0),fo.bind(void 0,1,0,0,1,1),fo.bind(void 0,1,0,0,1,2),fo.bind(void 0,1,0,0,1,3),fo.bind(void 0,1,0,1,0,0),fo.bind(void 0,1,0,1,0,1),fo.bind(void 0,1,0,1,0,2),fo.bind(void 0,1,0,1,0,3),fo.bind(void 0,1,0,1,1,0),fo.bind(void 0,1,0,1,1,1),fo.bind(void 0,1,0,1,1,2),fo.bind(void 0,1,0,1,1,3),fo.bind(void 0,1,1,0,0,0),fo.bind(void 0,1,1,0,0,1),fo.bind(void 0,1,1,0,0,2),fo.bind(void 0,1,1,0,0,3),fo.bind(void 0,1,1,0,1,0),fo.bind(void 0,1,1,0,1,1),fo.bind(void 0,1,1,0,1,2),fo.bind(void 0,1,1,0,1,3),fo.bind(void 0,1,1,1,0,0),fo.bind(void 0,1,1,1,0,1),fo.bind(void 0,1,1,1,0,2),fo.bind(void 0,1,1,1,0,3),fo.bind(void 0,1,1,1,1,0),fo.bind(void 0,1,1,1,1,1),fo.bind(void 0,1,1,1,1,2),fo.bind(void 0,1,1,1,1,3)];var go=Rr;function mo(e){this.char=e,this.state={},this.activeState=null}function yo(e,t,n){this.contextName=n,this.startIndex=e,this.endOffset=t}function vo(e,t,n){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=t,this.checkEnd=n}function bo(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 So(e){this.eventId=e,this.subscribers=[]}function xo(e){const t=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];for(let e=0;e<t.length;e++){const n=t[e];Object.defineProperty(this.events,n,{value:new So(n)})}if(e)for(let n=0;n<t.length;n++){const s=t[n],r=e[s];"function"==typeof r&&this.events[s].subscribe(r)}const n=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];for(let e=0;e<n.length;e++){const t=n[e];this.events[t].subscribe(this.updateContextsRanges)}}function To(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],xo.call(this,e)}mo.prototype.setState=function(e,t){return this.state[e]=t,this.activeState={key:e,value:this.state[e]},this.activeState},mo.prototype.getState=function(e){return this.state[e]||null},To.prototype.inboundIndex=function(e){return e>=0&&e<this.tokens.length},To.prototype.composeRUD=function(e){const t=e.map(e=>this[e[0]].apply(this,e.slice(1).concat(true))),n=e=>"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"FAIL");if(t.every(n))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:t.filter(n)};this.dispatch("composeRUD",[t.filter(e=>!n(e))])},To.prototype.replaceRange=function(e,t,n,s){t=null!==t?t:this.tokens.length;const r=n.every(e=>e instanceof mo);if(!isNaN(e)&&this.inboundIndex(e)&&r){const r=this.tokens.splice.apply(this.tokens,[e,t].concat(n));return s||this.dispatch("replaceToken",[e,t,n]),[r,n]}return{FAIL:"replaceRange: invalid tokens or startIndex."}},To.prototype.replaceToken=function(e,t,n){if(!isNaN(e)&&this.inboundIndex(e)&&t instanceof mo){const s=this.tokens.splice(e,1,t);return n||this.dispatch("replaceToken",[e,t]),[s[0],t]}return{FAIL:"replaceToken: invalid token or index."}},To.prototype.removeRange=function(e,t,n){t=isNaN(t)?this.tokens.length:t;const s=this.tokens.splice(e,t);return n||this.dispatch("removeRange",[s,e,t]),s},To.prototype.removeToken=function(e,t){if(!isNaN(e)&&this.inboundIndex(e)){const n=this.tokens.splice(e,1);return t||this.dispatch("removeToken",[n,e]),n}return{FAIL:"removeToken: invalid token index."}},To.prototype.insertToken=function(e,t,n){return e.every(e=>e instanceof mo)?(this.tokens.splice.apply(this.tokens,[t,0].concat(e)),n||this.dispatch("insertToken",[e,t]),e):{FAIL:"insertToken: invalid token(s)."}},To.prototype.registerModifier=function(e,t,n){this.events.newToken.subscribe(function(s,r){const o=[s,r],a=[s,r];if(null===t||!0===t.apply(this,o)){let t=n.apply(this,a);s.setState(e,t)}}),this.registeredModifiers.push(e)},So.prototype.subscribe=function(e){return"function"==typeof e?this.subscribers.push(e)-1:{FAIL:`invalid '${this.eventId}' event handler`}},So.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)},bo.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)},bo.prototype.get=function(e){switch(!0){case 0===e: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}},To.prototype.rangeToText=function(e){if(e instanceof yo)return this.getRangeTokens(e).map(e=>e.char).join("")},To.prototype.getText=function(){return this.tokens.map(e=>e.char).join("")},To.prototype.getContext=function(e){let t=this.registeredContexts[e];return t||null},To.prototype.on=function(e,t){const n=this.events[e];return n?n.subscribe(t):null},To.prototype.dispatch=function(e,t){const n=this.events[e];if(n instanceof So)for(let e=0;e<n.subscribers.length;e++){n.subscribers[e].apply(this,t||[])}},To.prototype.registerContextChecker=function(e,t,n){if(this.getContext(e))return{FAIL:`context name '${e}' is already registered.`};if("function"!=typeof t)return{FAIL:"missing context start check."};if("function"!=typeof n)return{FAIL:"missing context end check."};const s=new vo(e,t,n);return this.registeredContexts[e]=s,this.contextCheckers.push(s),s},To.prototype.getRangeTokens=function(e){const t=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,t))},To.prototype.getContextRanges=function(e){const t=this.getContext(e);return t?t.ranges:{FAIL:`context checker '${e}' is not registered.`}},To.prototype.resetContextsRanges=function(){const e=this.registeredContexts;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){e[t].ranges=[]}},To.prototype.updateContextsRanges=function(){this.resetContextsRanges();const e=this.tokens.map(e=>e.char);for(let t=0;t<e.length;t++){const n=new bo(e,t);this.runContextCheck(n)}this.dispatch("updateContextsRanges",[this.registeredContexts])},To.prototype.setEndOffset=function(e,t){let n=new yo(this.getContext(t).openRange.startIndex,e,t);const s=this.getContext(t).ranges;return n.rangeId=`${t}.${s.length}`,s.push(n),this.getContext(t).openRange=null,n},To.prototype.runContextCheck=function(e){const t=e.index;for(let n=0;n<this.contextCheckers.length;n++){const s=this.contextCheckers[n];let r=s.contextName,o=this.getContext(r).openRange;if(!o&&s.checkStart(e)&&(o=new yo(t,null,r),this.getContext(r).openRange=o,this.dispatch("contextStart",[r,t])),o&&s.checkEnd(e)){const e=t-o.startIndex+1,n=this.setEndOffset(e,r);this.dispatch("contextEnd",[r,n])}}},To.prototype.tokenize=function(e){this.tokens=[],this.resetContextsRanges();let t=Array.from(e);this.dispatch("start");for(let e=0;e<t.length;e++){const n=t[e],s=new bo(t,e);this.dispatch("next",[s]),this.runContextCheck(s);let r=new mo(n);this.tokens.push(r),this.dispatch("newToken",[r,s])}return this.dispatch("end",[this.tokens]),this.tokens};var Oo=To;function ko(e){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e)}function wo(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 Io(e){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e)}function Uo(e){return/[\u0E00-\u0E7F]/.test(e)}function Ro(e){return/[A-z]/.test(e)}function Lo(e){this.font=e,this.features={}}function Co(e){this.id=e.id,this.tag=e.tag,this.substitution=e.substitution}function Eo(e,t){if(!e)return-1;switch(t.format){case 1:return t.glyphs.indexOf(e);case 2:{let n=t.ranges;for(let t=0;t<n.length;t++){const s=n[t];if(e>=s.start&&e<=s.end){let t=e-s.start;return s.index+t}}break}default:return-1}return-1}function Do(e,t){return-1===Eo(e,t.coverage)?null:e+t.deltaGlyphId}function Mo(e,t){let n=Eo(e,t.coverage);return-1===n?null:t.substitute[n]}function Fo(e,t){let n=[];for(let s=0;s<e.length;s++){const r=e[s];let o=t.current;o=Array.isArray(o)?o[0]:o;const a=Eo(o,r);-1!==a&&n.push(a)}return n.length!==e.length?-1:n}function Ao(e,t){const n=t.inputCoverage.length+t.lookaheadCoverage.length+t.backtrackCoverage.length;if(e.context.length<n)return[];let s=Fo(t.inputCoverage,e);if(-1===s)return[];const r=t.inputCoverage.length-1;if(e.lookahead.length<t.lookaheadCoverage.length)return[];let o=e.lookahead.slice(r);for(;o.length&&Io(o[0].char);)o.shift();const a=new bo(o,0);let i=Fo(t.lookaheadCoverage,a),l=[].concat(e.backtrack);for(l.reverse();l.length&&Io(l[0].char);)l.shift();if(l.length<t.backtrackCoverage.length)return[];const u=new bo(l,0);let c=Fo(t.backtrackCoverage,u);let p=[];if(s.length===t.inputCoverage.length&&i.length===t.lookaheadCoverage.length&&c.length===t.backtrackCoverage.length)for(let n=0;n<t.lookupRecords.length;n++){const r=t.lookupRecords[n].lookupListIndex,o=this.getLookupByIndex(r);for(let t=0;t<o.subtables.length;t++){let n,r=o.subtables[t],a=this.getSubstitutionType(o,r);if("71"===a?(a=this.getSubstitutionType(r,r.extension),n=this.getLookupMethod(r,r.extension),r=r.extension):n=this.getLookupMethod(o,r),"12"!==a)throw new Error(`Substitution type ${a} is not supported in chaining substitution`);for(let t=0;t<s.length;t++){const s=n(e.get(t));s&&p.push(s)}}}return p}function No(e,t){let n,s=Eo(e.current,t.coverage);if(-1===s)return null;let r=t.ligatureSets[s];for(let t=0;t<r.length;t++){n=r[t];for(let t=0;t<n.components.length;t++){if(e.lookahead[t]!==n.components[t])break;if(t===n.components.length-1)return n}}return null}function Po(e,t){let n=e.current;if(-1===Eo(n,t.coverage))return null;for(const s of t.ruleSets)for(const t of s){let s=!0;for(let n=0;n<t.input.length;n++)if(e.lookahead[n]!==t.input[n]){s=!1;break}if(s){let e=[];e.push(n);for(let n=0;n<t.input.length;n++)e.push(t.input[n]);const s=(e,t)=>{const{lookupListIndex:n,sequenceIndex:s}=t,{subtables:r}=this.getLookupByIndex(n);for(const t of r){-1!==Eo(e[s],t.coverage)&&(e[s]=t.deltaGlyphId)}};for(let n=0;n<t.lookupRecords.length;n++){s(e,t.lookupRecords[n])}return e}}return null}function Bo(e,t){let n=[];for(let s=0;s<t.coverages.length;s++){const r=t.lookupRecords[s],o=t.coverages[s];let a=e.context[e.index+r.sequenceIndex];if(-1===Eo(a,o))return null;let i=this.font.tables.gsub.lookups[r.lookupListIndex];for(let e=0;e<i.subtables.length;e++){let t=i.subtables[e],s=Eo(a,t.coverage);if(-1===s)return null;switch(i.lookupType){case 1:{let e=t.substitute[s];n.push(e);break}case 2:{let e=t.sequences[s];n.push(e);break}}}}return n}function Go(e,t){let n=Eo(e,t.coverage);return-1===n?null:t.sequences[n]}Lo.prototype.getDefaultScriptFeaturesIndexes=function(){const e=this.font.tables.gsub.scripts;for(let t=0;t<e.length;t++){const n=e[t];if("DFLT"===n.tag)return n.script.defaultLangSys.featureIndexes}return[]},Lo.prototype.getScriptFeaturesIndexes=function(e){if(!this.font.tables.gsub)return[];if(!e)return this.getDefaultScriptFeaturesIndexes();const t=this.font.tables.gsub.scripts;for(let n=0;n<t.length;n++){const s=t[n];if(s.tag===e&&s.script.defaultLangSys)return s.script.defaultLangSys.featureIndexes;{let t=s.langSysRecords;if(t)for(let n=0;n<t.length;n++){const s=t[n];if(s.tag===e){return s.langSys.featureIndexes}}}}return this.getDefaultScriptFeaturesIndexes()},Lo.prototype.mapTagsToFeatures=function(e,t){let n={};for(let t=0;t<e.length;t++){const s=e[t].tag,r=e[t].feature;n[s]=r}this.features[t].tags=n},Lo.prototype.getScriptFeatures=function(e){let t=this.features[e];if(Object.prototype.hasOwnProperty.call(this.features,e))return t;const n=this.getScriptFeaturesIndexes(e);if(!n)return null;const s=this.font.tables.gsub;return t=n.map(e=>s.features[e]),this.features[e]=t,this.mapTagsToFeatures(t,e),t},Lo.prototype.getSubstitutionType=function(e,t){return e.lookupType.toString()+t.substFormat.toString()},Lo.prototype.getLookupMethod=function(e,t){let n=this.getSubstitutionType(e,t);switch(n){case"11":return e=>Do.apply(this,[e,t]);case"12":return e=>Mo.apply(this,[e,t]);case"63":return e=>Ao.apply(this,[e,t]);case"41":return e=>No.apply(this,[e,t]);case"21":return e=>Go.apply(this,[e,t]);case"51":return e=>Po.apply(this,[e,t]);case"53":return e=>Bo.apply(this,[e,t]);default:throw new Error(`substitutionType : ${n} lookupType: ${e.lookupType} - substFormat: ${t.substFormat} is not yet supported`)}},Lo.prototype.lookupFeature=function(e){let t=e.contextParams,n=t.index;const 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}'.`);const r=this.getFeatureLookups(s),o=[].concat(t.context);for(let s=0;s<r.length;s++){const a=r[s],i=this.getLookupSubtables(a);for(let s=0;s<i.length;s++){let r,l,u=i[s],c=this.getSubstitutionType(a,u);switch("71"===c?(c=this.getSubstitutionType(u,u.extension),r=this.getLookupMethod(u,u.extension),u=u.extension):r=this.getLookupMethod(a,u),c){case"11":l=r(t.current),l&&o.splice(n,1,new Co({id:11,tag:e.tag,substitution:l}));break;case"12":l=r(t.current),l&&o.splice(n,1,new Co({id:12,tag:e.tag,substitution:l}));break;case"63":l=r(t),Array.isArray(l)&&l.length&&o.splice(n,1,new Co({id:63,tag:e.tag,substitution:l}));break;case"41":l=r(t),l&&o.splice(n,1,new Co({id:41,tag:e.tag,substitution:l}));break;case"21":l=r(t.current),l&&o.splice(n,1,new Co({id:21,tag:e.tag,substitution:l}));break;case"51":case"53":l=r(t),Array.isArray(l)&&l.length&&o.splice(n,1,new Co({id:parseInt(c),tag:e.tag,substitution:l}))}t=new bo(o,n),Array.isArray(l)&&!l.length||(l=null)}}return o.length?o:null},Lo.prototype.supports=function(e){if(!e.script)return!1;this.getScriptFeatures(e.script);const t=Object.prototype.hasOwnProperty.call(this.features,e.script);if(!e.tag)return t;const n=this.features[e.script].some(t=>t.tag===e.tag);return t&&n},Lo.prototype.getLookupSubtables=function(e){return e.subtables||null},Lo.prototype.getLookupByIndex=function(e){return this.font.tables.gsub.lookups[e]||null},Lo.prototype.getFeatureLookups=function(e){return e.lookupListIndexes.map(this.getLookupByIndex.bind(this))},Lo.prototype.getFeature=function(e){if(!this.font)return{FAIL:"No font was found"};Object.prototype.hasOwnProperty.call(this.features,e.script)||this.getScriptFeatures(e.script);const t=this.features[e.script];return t?t.tags[e.tag]?this.features[e.script].tags[e.tag]:null:{FAIL:`No feature for script ${e.script}`}};var Ho=Lo;var _o={startCheck:function(e){const t=e.current,n=e.get(-1);return null===n&&ko(t)||!ko(n)&&ko(t)},endCheck:function(e){const t=e.get(1);return null===t||!ko(t)}};var Vo={startCheck:function(e){const t=e.current,n=e.get(-1);return(ko(t)||Io(t))&&!ko(n)},endCheck:function(e){const t=e.get(1);switch(!0){case null===t:return!0;case!ko(t)&&!Io(t):{const n=/\s/.test(t);if(!n)return!0;if(n){let t=!1;if(t=e.lookahead.some(e=>ko(e)||Io(e)),!t)return!0}break}default:return!1}}};function zo(e,t,n){for(let s=0;s<e.substitution.length;s++){const r=e.substitution[s],o=t[n+s];Array.isArray(r)?r.length?o.setState(e.tag,r[0]):o.setState("deleted",!0):o.setState(e.tag,r)}}var jo={11:function(e,t,n){t[n].setState(e.tag,e.substitution)},12:function(e,t,n){t[n].setState(e.tag,e.substitution)},63:zo,41:function(e,t,n){let s=t[n];s.setState(e.tag,e.substitution.ligGlyph);const r=e.substitution.components.length;for(let e=0;e<r;e++)s=t[n+e+1],s.setState("deleted",!0)},51:zo,53:zo};var qo=function(e,t,n){e instanceof Co&&jo[e.id]&&jo[e.id](e,t,n)};function Wo(e){let t=[].concat(e.backtrack);for(let e=t.length-1;e>=0;e--){const n=t[e],s=wo(n),r=Io(n);if(!s&&!r)return!0;if(s)return!1}return!1}function $o(e){if(wo(e.current))return!1;for(let t=0;t<e.lookahead.length;t++){if(!Io(e.lookahead[t]))return!0}return!1}var Xo=function(e){const t="arab",n=this.featuresTags[t],s=this.tokenizer.getRangeTokens(e);if(1===s.length)return;let r=new bo(s.map(e=>e.getState("glyphIndex")),0);const o=new bo(s.map(e=>e.char),0);for(let e=0;e<s.length;e++){if(Io(s[e].char))continue;r.setCurrentIndex(e),o.setCurrentIndex(e);let a,i=0;switch(Wo(o)&&(i|=1),$o(o)&&(i|=2),i){case 1:a="fina";break;case 2:a="init";break;case 3:a="medi"}if(-1===n.indexOf(a))continue;let l=this.query.lookupFeature({tag:a,script:t,contextParams:r});if(l instanceof Error)console.info(l.message);else for(let e=0;e<l.length;e++){const t=l[e];t instanceof Co&&(qo(t,s,e),r.context[e]=t.substitution)}}};function Yo(e,t){return new bo(e.map(e=>e.activeState.value),t||0)}var Zo=function(e){let t=this.tokenizer.getRangeTokens(e),n=Yo(t);for(let e=0;e<n.context.length;e++){n.setCurrentIndex(e);let s=this.query.lookupFeature({tag:"rlig",script:"arab",contextParams:n});if(s.length){for(let n=0;n<s.length;n++){const r=s[n];qo(r,t,e)}n=Yo(t)}}};var Qo={startCheck:function(e){return 0===e.index&&e.context.length>1},endCheck:function(e){return e.index===e.context.length-1}};function Ko(e,t){return new bo(e.map(e=>e.activeState.value),t||0)}var Jo=function(e){const t="delf",n="ccmp";let s=this.tokenizer.getRangeTokens(e),r=Ko(s);for(let e=0;e<r.context.length;e++){if(!this.query.getFeature({tag:n,script:t,contextParams:r}))continue;r.setCurrentIndex(e);let o=this.query.lookupFeature({tag:n,script:t,contextParams:r});if(o.length){for(let t=0;t<o.length;t++){const n=o[t];qo(n,s,e)}r=Ko(s)}}};var ea={startCheck:function(e){const t=e.current,n=e.get(-1);return null===n&&Ro(t)||!Ro(n)&&Ro(t)},endCheck:function(e){const t=e.get(1);return null===t||!Ro(t)}};function ta(e,t){return new bo(e.map(e=>e.activeState.value),t||0)}var na=function(e){let t=this.tokenizer.getRangeTokens(e),n=ta(t);for(let e=0;e<n.context.length;e++){n.setCurrentIndex(e);let s=this.query.lookupFeature({tag:"liga",script:"latn",contextParams:n});if(s.length){for(let n=0;n<s.length;n++){const r=s[n];qo(r,t,e)}n=ta(t)}}};var sa={startCheck:function(e){const t=e.current,n=e.get(-1);return null===n&&Uo(t)||!Uo(n)&&Uo(t)},endCheck:function(e){const t=e.get(1);return null===t||!Uo(t)}};function ra(e,t){return new bo(e.map(e=>e.activeState.value),t||0)}var oa=function(e){let t=this.tokenizer.getRangeTokens(e),n=ra(t,0);for(let e=0;e<n.context.length;e++){n.setCurrentIndex(e);let s=this.query.lookupFeature({tag:"ccmp",script:"thai",contextParams:n});if(s.length){for(let n=0;n<s.length;n++){const r=s[n];qo(r,t,e)}n=ra(t,e)}}};function aa(e,t){return new bo(e.map(e=>e.activeState.value),t||0)}var ia=function(e){let t=this.tokenizer.getRangeTokens(e),n=aa(t,0);for(let e=0;e<n.context.length;e++){n.setCurrentIndex(e);let s=this.query.lookupFeature({tag:"liga",script:"thai",contextParams:n});if(s.length){for(let n=0;n<s.length;n++){const r=s[n];qo(r,t,e)}n=aa(t,e)}}};function la(e,t){return new bo(e.map(e=>e.activeState.value),t||0)}var ua=function(e){let t=this.tokenizer.getRangeTokens(e),n=la(t,0);for(let e=0;e<n.context.length;e++){n.setCurrentIndex(e);let s=this.query.lookupFeature({tag:"rlig",script:"thai",contextParams:n});if(s.length){for(let n=0;n<s.length;n++){const r=s[n];qo(r,t,e)}n=la(t,e)}}};function ca(e){if(null===e)return!1;const t=e.codePointAt(0);return t>=6155&&t<=6157||t>=65024&&t<=65039||t>=917760&&t<=917999}var pa={startCheck:function(e){const t=e.current,n=e.get(1);return null===n&&ca(t)||ca(n)},endCheck:function(e){const t=e.get(1);return null===t||!ca(t)}};var ha=function(e){const t=this.query.font,n=this.tokenizer.getRangeTokens(e);if(n[1].setState("deleted",!0),t.tables.cmap&&t.tables.cmap.varSelectorList){const e=n[0].char.codePointAt(0),s=n[1].char.codePointAt(0),r=t.tables.cmap.varSelectorList[s];if(void 0!==r&&r.nonDefaultUVS){const s=r.nonDefaultUVS.uvsMappings;if(s[e]){const r=s[e].glyphID;void 0!==t.glyphs.glyphs[r]&&n[0].setState("glyphIndex",r)}}}};function fa(e){this.baseDir=e||"ltr",this.tokenizer=new Oo,this.featuresTags={}}function da(e){const t=this.contextChecks[`${e}Check`];return this.tokenizer.registerContextChecker(e,t.startCheck,t.endCheck)}function ga(){return da.call(this,"ccmpReplacement"),da.call(this,"latinWord"),da.call(this,"arabicWord"),da.call(this,"arabicSentence"),da.call(this,"thaiWord"),da.call(this,"unicodeVariationSequence"),this.tokenizer.tokenize(this.text)}function ma(){const e=this.tokenizer.getContextRanges("arabicSentence");for(let t=0;t<e.length;t++){const n=e[t];let s=this.tokenizer.getRangeTokens(n);this.tokenizer.replaceRange(n.startIndex,n.endOffset,s.reverse())}}function ya(){if(-1===this.tokenizer.registeredModifiers.indexOf("glyphIndex"))throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function va(){if(!Object.prototype.hasOwnProperty.call(this.featuresTags,"arab"))return;ya.call(this);const e=this.tokenizer.getContextRanges("arabicWord");for(let t=0;t<e.length;t++){const n=e[t];Xo.call(this,n)}}function ba(){ya.call(this);const e=this.tokenizer.getContextRanges("ccmpReplacement");for(let t=0;t<e.length;t++){const n=e[t];Jo.call(this,n)}}function Sa(){if(!this.hasFeatureEnabled("arab","rlig"))return;ya.call(this);const e=this.tokenizer.getContextRanges("arabicWord");for(let t=0;t<e.length;t++){const n=e[t];Zo.call(this,n)}}function xa(){if(!this.hasFeatureEnabled("latn","liga"))return;ya.call(this);const e=this.tokenizer.getContextRanges("latinWord");for(let t=0;t<e.length;t++){const n=e[t];na.call(this,n)}}function Ta(){const e=this.tokenizer.getContextRanges("unicodeVariationSequence");for(let t=0;t<e.length;t++){const n=e[t];ha.call(this,n)}}function Oa(){ya.call(this);const e=this.tokenizer.getContextRanges("thaiWord");for(let t=0;t<e.length;t++){const n=e[t];this.hasFeatureEnabled("thai","liga")&&ia.call(this,n),this.hasFeatureEnabled("thai","rlig")&&ua.call(this,n),this.hasFeatureEnabled("thai","ccmp")&&oa.call(this,n)}}fa.prototype.setText=function(e){this.text=e},fa.prototype.contextChecks={ccmpReplacementCheck:Qo,latinWordCheck:ea,arabicWordCheck:_o,arabicSentenceCheck:Vo,thaiWordCheck:sa,unicodeVariationSequenceCheck:pa},fa.prototype.registerFeatures=function(e,t){const n=t.filter(t=>this.query.supports({script:e,tag:t}));Object.prototype.hasOwnProperty.call(this.featuresTags,e)?this.featuresTags[e]=this.featuresTags[e].concat(n):this.featuresTags[e]=n},fa.prototype.applyFeatures=function(e,t){if(!e)throw new Error("No valid font was provided to apply features");this.query||(this.query=new Ho(e));for(let e=0;e<t.length;e++){const n=t[e];this.query.supports({script:n.script})&&this.registerFeatures(n.script,n.tags)}},fa.prototype.registerModifier=function(e,t,n){this.tokenizer.registerModifier(e,t,n)},fa.prototype.checkContextReady=function(e){return!!this.tokenizer.getContext(e)},fa.prototype.applyFeaturesToContexts=function(){this.checkContextReady("ccmpReplacement")&&ba.call(this),this.checkContextReady("arabicWord")&&(va.call(this),Sa.call(this)),this.checkContextReady("latinWord")&&xa.call(this),this.checkContextReady("arabicSentence")&&ma.call(this),this.checkContextReady("thaiWord")&&Oa.call(this),this.checkContextReady("unicodeVariationSequence")&&Ta.call(this)},fa.prototype.hasFeatureEnabled=function(e,t){return-1!==(this.featuresTags[e]||[]).indexOf(t)},fa.prototype.processText=function(e){this.text&&this.text===e||(this.setText(e),ga.call(this),this.applyFeaturesToContexts())},fa.prototype.getBidiText=function(e){return this.processText(e),this.tokenizer.getText()},fa.prototype.getTextGlyphs=function(e){this.processText(e);let t=[];for(let e=0;e<this.tokenizer.tokens.length;e++){const n=this.tokenizer.tokens[e];if(n.state.deleted)continue;const s=n.activeState.value;t.push(Array.isArray(s)?s[0]:s)}return t};var ka=fa;function wa(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 Ia(e){if((e=e||{}).tables=e.tables||{},!e.empty){if(!e.familyName)throw"When creating a new Font object, familyName is required.";if(!e.styleName)throw"When creating a new Font object, styleName is required.";if(!e.unitsPerEm)throw"When creating a new Font object, unitsPerEm is required.";if(!e.ascender)throw"When creating a new Font object, ascender is required.";if(e.descender>0)throw"When creating a new Font object, negative descender value is required.";this.names={},this.names.unicode=wa(e),this.names.macintosh=wa(e),this.names.windows=wa(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),0==t&&(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 Bn.GlyphSet(this,e.glyphs||[]),this.encoding=new xn(this),this.position=new sr(this),this.substitution=new cr(this),this.tables=this.tables||{},this.tables=new Proxy(this.tables,{set:(e,t,n)=>(e[t]=n,e.fvar&&(e.gvar||e.cff2)&&!this.variation&&(this.variation=new Ur(this)),!0)}),this.palettes=new pr(this),this.layers=new hr(this),this.svgImages=new fr(this),this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new go(this):null}})}Ia.prototype.hasChar=function(e){return this.encoding.charToGlyphIndex(e)>0},Ia.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},Ia.prototype.charToGlyph=function(e){const t=this.charToGlyphIndex(e);let n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},Ia.prototype.updateFeatures=function(e){return this.defaultRenderOptions.features.map(t=>"latn"===t.script?{script:"latn",tags:t.tags.filter(t=>e[t])}:t)},Ia.prototype.stringToGlyphIndexes=function(e,t){const n=new ka;n.registerModifier("glyphIndex",null,e=>this.charToGlyphIndex(e.char));let s=t?this.updateFeatures(t.features):this.defaultRenderOptions.features;return n.applyFeatures(this,s),n.getTextGlyphs(e)},Ia.prototype.stringToGlyphs=function(e,t){const n=this.stringToGlyphIndexes(e,t);let s=n.length;const r=new Array(s),o=this.glyphs.get(0);for(let e=0;e<s;e+=1)r[e]=this.glyphs.get(n[e])||o;return r},Ia.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},Ia.prototype.nameToGlyph=function(e){const t=this.nameToGlyphIndex(e);let n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},Ia.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},Ia.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;const n=this.position.defaultKerningTables;return n?this.position.getKerningValue(n,e,t):this.kerningPairs[e+","+t]||0},Ia.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},Ia.prototype.forEachGlyph=function(e,t,n,s,r,o){t=void 0!==t?t:0,n=void 0!==n?n:0,s=void 0!==s?s:72,r=Object.assign({},this.defaultRenderOptions,r);const a=1/this.unitsPerEm*s,i=this.stringToGlyphs(e,r);let l;if(r.kerning){const e=r.script||this.position.getDefaultScriptName();l=this.position.getKerningTables(e,r.language)}for(let e=0;e<i.length;e+=1){const u=i[e];if(o.call(this,u,t,n,s,r),u.advanceWidth&&(t+=u.advanceWidth*a),r.kerning&&e<i.length-1){t+=(l?this.position.getKerningValue(l,u.index,i[e+1].index):this.getKerningValue(u,i[e+1]))*a}r.letterSpacing?t+=r.letterSpacing*s:r.tracking&&(t+=r.tracking/1e3*s)}return t},Ia.prototype.getPath=function(e,t,n,s,r){r=Object.assign({},this.defaultRenderOptions,r);const o=new Ke;if(o._layers=[],ns(this,o),o.stroke){const e=1/(o.unitsPerEm||1e3)*s;o.strokeWidth*=e}return this.forEachGlyph(e,t,n,s,r,(e,t,n,s)=>{const a=e.getPath(t,n,s,r,this);if(r.drawSVG||r.drawLayers){const e=a._layers;if(e&&e.length){for(let t=0;t<e.length;t++){const n=e[t];o._layers.push(n)}return}}o.extend(a)}),o},Ia.prototype.getPaths=function(e,t,n,s,r){r=Object.assign({},this.defaultRenderOptions,r);const o=[];return this.forEachGlyph(e,t,n,s,r,function(e,t,n,s){const a=e.getPath(t,n,s,r,this);o.push(a)}),o},Ia.prototype.getAdvanceWidth=function(e,t,n){return n=Object.assign({},this.defaultRenderOptions,n),this.forEachGlyph(e,0,0,t,n,function(){})},Ia.prototype.draw=function(e,t,n,s,r,o){this.getPath(t,n,s,r,o).draw(e)},Ia.prototype.drawPoints=function(e,t,n,s,r,o){o=Object.assign({},this.defaultRenderOptions,o),this.forEachGlyph(t,n,s,r,o,function(t,n,s,r){t.drawPoints(e,n,s,r,o,this)})},Ia.prototype.drawMetrics=function(e,t,n,s,r,o){o=Object.assign({},this.defaultRenderOptions,o),this.forEachGlyph(t,n,s,r,o,function(t,n,s,r){t.drawMetrics(e,n,s,r)})},Ia.prototype.getEnglishName=function(e){const t=(this.names.unicode||this.names.macintosh||this.names.windows)[e];if(t)return t.en},Ia.prototype.validate=function(){const e=[],t=this;function n(t,n){t||(console.warn(`[opentype.js] ${n}`),e.push(n))}function s(e){const s=t.getEnglishName(e);n(s&&s.trim().length>0,"No English "+e+" specified.")}if(s("fontFamily"),s("weightName"),s("manufacturer"),s("copyright"),s("version"),n(this.unitsPerEm>0,"No unitsPerEm specified."),this.tables.colr){const e=this.tables.colr.baseGlyphRecords;let t=-1;for(let s=0;s<e.length;s++){const r=e[s].glyphID;if(n(t<e[s].glyphID,`baseGlyphs must be sorted by GlyphID in ascending order, but glyphID ${r} comes after ${t}`),t>e[s].glyphID)break;t=r}}return e},Ia.prototype.toTables=function(){return Zs.fontToTable(this)},Ia.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},Ia.prototype.toArrayBuffer=function(){const e=this.toTables().encode(),t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let t=0;t<e.length;t++)n[t]=e[t];return t},Ia.prototype.download=function(){console.error("DEPRECATED: platform-specific actions are to be implemented on user-side")},Ia.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},Ia.prototype.macStyleValues={BOLD:1,ITALIC:2,UNDERLINE:4,OUTLINED:8,SHADOW:16,CONDENSED:32,EXTENDED:64},Ia.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},Ia.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var Ua=Ia;var Ra={make:function(){console.warn("Writing of hvar tables is not yet supported.")},parse:function(e,t){const n=new Xt.Parser(e,t),s=n.parseUShort(),r=n.parseUShort();return 1!==s&&console.warn(`Unsupported hvar table version ${s}.${r}`),{version:[s,r],itemVariationStore:n.parsePointer32(function(){return this.parseItemVariationStore()}),advanceWidth:n.parsePointer32(function(){return this.parseDeltaSetIndexMap()}),lsb:n.parsePointer32(function(){return this.parseDeltaSetIndexMap()}),rsb:n.parsePointer32(function(){return this.parseDeltaSetIndexMap()})}}},La=function(){return{coverage:this.parsePointer(Wt.coverage),attachPoints:this.parseList(Wt.pointer(Wt.uShortList))}},Ca=function(){var e=this.parseUShort();return tt.argument(1===e||2===e||3===e,"Unsupported CaretValue table version."),1===e?{coordinate:this.parseShort()}:2===e?{pointindex:this.parseShort()}:3===e?{coordinate:this.parseShort()}:void 0},Ea=function(){return this.parseList(Wt.pointer(Ca))},Da=function(){return{coverage:this.parsePointer(Wt.coverage),ligGlyphs:this.parseList(Wt.pointer(Ea))}},Ma=function(){return this.parseUShort(),this.parseList(Wt.pointer(Wt.coverage))};var Fa={parse:function(e,t){const n=new Wt(e,t=t||0),s=n.parseVersion(1);tt.argument(1===s||1.2===s||1.3===s,"Unsupported GDEF table version.");var r={version:s,classDef:n.parsePointer(Wt.classDef),attachList:n.parsePointer(La),ligCaretList:n.parsePointer(Da),markAttachClassDef:n.parsePointer(Wt.classDef)};return s>=1.2&&(r.markGlyphSets=n.parsePointer(Ma)),r}},Aa=new Array(10);Aa[1]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{posFormat:1,coverage:this.parsePointer(Wt.coverage),value:this.parseValueRecord()}:2===t?{posFormat:2,coverage:this.parsePointer(Wt.coverage),values:this.parseValueRecordList()}:void tt.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},Aa[2]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();tt.assert(1===t||2===t,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");const n=this.parsePointer(Wt.coverage),s=this.parseUShort(),r=this.parseUShort();if(1===t)return{posFormat:t,coverage:n,valueFormat1:s,valueFormat2:r,pairSets:this.parseList(Wt.pointer(Wt.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(s),value2:this.parseValueRecord(r)}})))};if(2===t){const e=this.parsePointer(Wt.classDef),o=this.parsePointer(Wt.classDef),a=this.parseUShort(),i=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:s,valueFormat2:r,classDef1:e,classDef2:o,class1Count:a,class2Count:i,classRecords:this.parseList(a,Wt.list(i,function(){return{value1:this.parseValueRecord(s),value2:this.parseValueRecord(r)}}))}}},Aa[3]=function(){return{error:"GPOS Lookup 3 not supported"}},Aa[4]=function(){return{error:"GPOS Lookup 4 not supported"}},Aa[5]=function(){return{error:"GPOS Lookup 5 not supported"}},Aa[6]=function(){return{error:"GPOS Lookup 6 not supported"}},Aa[7]=function(){return{error:"GPOS Lookup 7 not supported"}},Aa[8]=function(){return{error:"GPOS Lookup 8 not supported"}},Aa[9]=function(){return{error:"GPOS Lookup 9 not supported"}};var Na=new Array(10);var Pa={parse:function(e,t){const n=new Wt(e,t=t||0),s=n.parseVersion(1);return tt.argument(1===s||1.1===s,"Unsupported GPOS table version "+s),1===s?{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(Aa)}:{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(Aa),variations:n.parseFeatureVariationsList()}},make:function(e){return new kt.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new kt.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new kt.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new kt.LookupList(e.lookups,Na)}])}};var Ba={parse:function(e,t){const n=new Xt.Parser(e,t),s=n.parseUShort();if(0===s)return function(e){const t={};e.skip("uShort");const n=e.parseUShort();tt.argument(0===n,"Unsupported kern sub-table version."),e.skip("uShort",2);const s=e.parseUShort();e.skip("uShort",3);for(let n=0;n<s;n+=1){const n=e.parseUShort(),s=e.parseUShort(),r=e.parseShort();t[n+","+s]=r}return t}(n);if(1===s)return function(e){const t={};e.skip("uShort"),e.parseULong()>1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");const n=255&e.parseUShort();if(e.skip("uShort"),0===n){const n=e.parseUShort();e.skip("uShort",3);for(let s=0;s<n;s+=1){const n=e.parseUShort(),s=e.parseUShort(),r=e.parseShort();t[n+","+s]=r}}return t}(n);throw new Error("Unsupported kern table version ("+s+").")}};var Ga={parse:function(e,t,n,s){const r=new Xt.Parser(e,t),o=s?r.parseUShort:r.parseULong,a=[];for(let e=0;e<n+1;e+=1){let e=o.call(r);s&&(e*=2),a.push(e)}return a}};function Ha(e,t){const n=[];let s=12;for(let r=0;r<t;r+=1){const t=Xt.getTag(e,s),r=Xt.getULong(e,s+4),o=Xt.getULong(e,s+8),a=Xt.getULong(e,s+12);n.push({tag:t,checksum:r,offset:o,length:a,compression:!1}),s+=16}return n}function _a(e,t){if("WOFF"===t.compression){const n=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),s=new Uint8Array(t.length);if(je(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}}return{data:e,offset:t.offset}}function Va(e,t={}){let n,s;const r=new Ua({empty:!0});e.constructor!==ArrayBuffer&&(e=new Uint8Array(e).buffer);const o=new DataView(e,0);let a,i=[];const l=Xt.getTag(o,0);if(l===String.fromCharCode(0,1,0,0)||"true"===l||"typ1"===l)r.outlinesFormat="truetype",a=Xt.getUShort(o,4),i=Ha(o,a);else if("OTTO"===l)r.outlinesFormat="cff",a=Xt.getUShort(o,4),i=Ha(o,a);else{if("wOFF"!==l){if("wOF2"===l){throw new Error("WOFF2 require an external decompressor library, see examples at: https://github.com/opentypejs/opentype.js/issues/183#issuecomment-1147228025")}throw new Error("Unsupported OpenType signature "+l)}{const e=Xt.getTag(o,4);if(e===String.fromCharCode(0,1,0,0))r.outlinesFormat="truetype";else{if("OTTO"!==e)throw new Error("Unsupported OpenType flavor "+l);r.outlinesFormat="cff"}a=Xt.getUShort(o,12),i=function(e,t){const n=[];let s=44;for(let r=0;r<t;r+=1){const t=Xt.getTag(e,s),r=Xt.getULong(e,s+4),o=Xt.getULong(e,s+8),a=Xt.getULong(e,s+12);let i;i=o<a&&"WOFF",n.push({tag:t,offset:r,compression:i,compressedLength:o,length:a}),s+=20}return n}(o,a)}}let u,c,p,h,f,d,g,m,y,v,b,S,x,T,O,k,w,I;for(let e=0;e<a;e+=1){const t=i[e];let a;switch(t.tag){case"avar":g=t;break;case"cmap":a=_a(o,t),r.tables.cmap=fn.parse(a.data,a.offset),r.encoding=new Tn(r.tables.cmap);break;case"cvt ":a=_a(o,t),I=new Xt.Parser(a.data,a.offset),r.tables.cvt=I.parseShortList(t.length/2);break;case"fvar":p=t;break;case"STAT":h=t;break;case"gvar":f=t;break;case"cvar":d=t;break;case"fpgm":a=_a(o,t),I=new Xt.Parser(a.data,a.offset),r.tables.fpgm=I.parseByteList(t.length);break;case"head":a=_a(o,t),r.tables.head=ps.parse(a.data,a.offset),r.unitsPerEm=r.tables.head.unitsPerEm,n=r.tables.head.indexToLocFormat;break;case"hhea":a=_a(o,t),r.tables.hhea=hs.parse(a.data,a.offset),r.ascender=r.tables.hhea.ascender,r.descender=r.tables.hhea.descender,r.numberOfHMetrics=r.tables.hhea.numberOfHMetrics;break;case"HVAR":x=t;break;case"hmtx":S=t;break;case"ltag":a=_a(o,t),s=ds.parse(a.data,a.offset);break;case"COLR":a=_a(o,t),r.tables.colr=ks.parse(a.data,a.offset);break;case"CPAL":a=_a(o,t),r.tables.cpal=Mn.parse(a.data,a.offset);break;case"maxp":a=_a(o,t),r.tables.maxp=gs.parse(a.data,a.offset),r.numGlyphs=r.tables.maxp.numGlyphs;break;case"name":k=t;break;case"OS/2":a=_a(o,t),r.tables.os2=ys.parse(a.data,a.offset);break;case"post":a=_a(o,t),r.tables.post=vs.parse(a.data,a.offset),r.glyphNames=new kn(r.tables.post);break;case"prep":a=_a(o,t),I=new Xt.Parser(a.data,a.offset),r.tables.prep=I.parseByteList(t.length);break;case"glyf":m=t;break;case"loca":O=t;break;case"CFF ":u=t;break;case"CFF2":c=t;break;case"kern":T=t;break;case"GDEF":y=t;break;case"GPOS":v=t;break;case"GSUB":b=t;break;case"meta":w=t;break;case"gasp":try{a=_a(o,t),r.tables.gasp=Vs.parse(a.data,a.offset)}catch(e){console.warn("Failed to parse gasp table, skipping."),console.warn(e)}break;case"SVG ":a=_a(o,t),r.tables.svg=zs.parse(a.data,a.offset)}}const U=_a(o,k);if(r.tables.name=pn.parse(U.data,U.offset,s),r.names=r.tables.name,m&&O){const e=0===n,s=_a(o,O),a=Ga.parse(s.data,s.offset,r.numGlyphs,e),i=_a(o,m);r.glyphs=wr.parse(i.data,i.offset,a,r,t)}else if(u){const e=_a(o,u);cs.parse(e.data,e.offset,r,t)}else{if(!c)throw new Error("Font doesn't contain TrueType, CFF or CFF2 outlines.");{const e=_a(o,c);cs.parse(e.data,e.offset,r,t)}}const R=_a(o,S);if(fs.parse(r,R.data,R.offset,r.numberOfHMetrics,r.numGlyphs,r.glyphs,t),wn(r,t),T){const e=_a(o,T);r.kerningPairs=Ba.parse(e.data,e.offset)}else r.kerningPairs={};if(y){const e=_a(o,y);r.tables.gdef=Fa.parse(e.data,e.offset)}if(v){const e=_a(o,v);r.tables.gpos=Pa.parse(e.data,e.offset),r.position.init()}if(b){const e=_a(o,b);r.tables.gsub=Ts.parse(e.data,e.offset)}if(p){const e=_a(o,p);r.tables.fvar=Ls.parse(e.data,e.offset,r.names)}if(h){const e=_a(o,h);r.tables.stat=Ns.parse(e.data,e.offset,r.tables.fvar)}if(f){p||console.warn("This font provides a gvar table, but no fvar table, which is required for variable fonts."),m||console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");const e=_a(o,f);r.tables.gvar=_s.parse(e.data,e.offset,r.tables.fvar,r.glyphs)}if(d){p||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."),m||console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");const e=_a(o,d);r.tables.cvar=Hs.parse(e.data,e.offset,r.tables.fvar,r.tables.cvt||[])}if(g){p||console.warn("This font provides an avar table, but no fvar table, which is required for variable fonts.");const e=_a(o,g);r.tables.avar=Gs.parse(e.data,e.offset,r.tables.fvar)}if(x){p||console.warn("This font provides an HVAR table, but no fvar table, which is required for variable fonts."),S||console.warn("This font provides an HVAR table, but no hmtx table to vary.");const e=_a(o,x);r.tables.hvar=Ra.parse(e.data,e.offset,r.tables.fvar)}if(w){const e=_a(o,w);r.tables.meta=Os.parse(e.data,e.offset),r.metas=r.tables.meta}return r.palettes=new pr(r),r}const za=e.DEVELOPMENT;var ja=s.n(za);const qa=Symbol(),Wa=Symbol(),$a=Symbol(),Xa=Symbol(),Ya=Symbol(),Za=Symbol();function Qa(){this[$a]=new Set,this[Wa]=new Map,this[Xa]=new WeakMap,this[Ya]=new WeakMap}Object.assign(Qa.prototype,{getDefaultFontStyle(){return this[qa]??=(()=>{const e=new Oe(this.getPrivateScene());return e.setup(),e})()},loadFont(e,t=!0){let n=t?this[Wa].get(e.href):null;return n||(n=new Promise(async(s,r)=>{try{const n=await fetch(e,{cache:t?"default":"reload"});if(!n.ok)throw new Error(n.statusText||n.status);const r=await n.arrayBuffer(),o=Va(await this.decompressFont(r));ja()&&"data:"!==e.protocol&&console.info(`Done loading font '${decodeURI(e)}'.`),s(o)}catch(t){"data:"!==e.protocol&&console.warn(`Error loading font '${decodeURI(e)}':`,t),s(null)}finally{this[$a].delete(n)}}),this[$a].add(n),e.search||this[Wa].set(e.href,n)),n},registerFont(e,t){const n=this[Xa].getOrInsertComputed(e,()=>new Map),s=new Map(Object.values(t.names).flatMap(e=>Object.values(e.fontFamily??{}).map(t=>[t,e])));for(const[e,r]of s){const s=n.getOrInsertComputed(e.toUpperCase(),()=>new Map);for(const n of new Set(Object.values(r.fontSubfamily??{})))this.getBrowserOption("Debug")&&console.info(`Registering font family ${e} - ${n}.`),s.set(n.toUpperCase().replaceAll(" ",""),t)}},registerFontLibrary(e,t,n){this[Ya].getOrInsertComputed(e,()=>new Map).set(t.toUpperCase(),n)},async getFont(e,t,n){try{for(t=t.toUpperCase(),n=n.toUpperCase().replaceAll(" ","");;){const s=this[Ya].get(e),r=this[Xa].get(e),o=s?.get(t)??r?.get(t)?.get(n);if(o)return o;await Promise.any(this[$a])}}catch{return null}},async decompressFont(e){if(this.isWoff2(e)){const t=await this.getWoff2Decoder();return await t(e)}return e},isWoff2(e){if(e.byteLength<4)return!1;return 2001684018===new DataView(e).getUint32(0,!1)},async getWoff2Decoder(){return this[Za]??=await this.loadWoff2Decoder()},async loadWoff2Decoder(){const e=k().getLibraryURL("woff2_decoder.js"),t=await fetch(e);if(!t.ok)throw new Error(t.statusText||t.status);const n=await t.text();return new Function(n)()}});const Ka=Qa,Ja=y().add("X3DTextContext",Ka),ei=e.X3DGeometryNode;var ti=s.n(ei);const ni=e.X3DCast;var si=s.n(ni);function ri(e){ti().call(this,e),this.addType(T().Text),this._length.setUnit("length"),this._maxExtent.setUnit("length"),this._origin.setUnit("length"),this._textBounds.setUnit("length"),this._lineBounds.setUnit("length")}Object.assign(Object.setPrototypeOf(ri.prototype,ti().prototype),{initialize(){ti().prototype.initialize.call(this),this._fontStyle.addInterest("set_fontStyle__",this),this.set_fontStyle__()},getMatrix(){return this.textGeometry.getMatrix()},getLength(e){return e<this._length.length?Math.max(0,this._length[e]):0},set_live__(){const e=this.getBrowser(),t=this.isLive()&&e.getBrowserOption("AlwaysUpdateGeometries");this.getLive().getValue()||t?(e.getBrowserOptions()._PrimitiveQuality.addInterest("requestRebuild",this),e.getBrowserOptions()._TextCompression.addInterest("requestRebuild",this),this.requestRebuild()):(e.getBrowserOptions()._PrimitiveQuality.removeInterest("requestRebuild",this),e.getBrowserOptions()._TextCompression.removeInterest("requestRebuild",this))},set_fontStyle__(){this.fontStyleNode?.removeInterest("requestRebuild",this),this.fontStyleNode=si()(T().X3DFontStyleNode,this._fontStyle)??this.getBrowser().getDefaultFontStyle(),this.fontStyleNode.addInterest("requestRebuild",this),this.textGeometry=this.fontStyleNode.getTextGeometry(this)},build(){this.textGeometry.update(),this.textGeometry.build(),this.setSolid(this._solid.getValue())},traverse(e,t){this.textGeometry.traverse(e,t),ti().prototype.traverse.call(this,e,t)},displaySimple(e,t,n){this.textGeometry.displaySimple(e,t,n),ti().prototype.displaySimple.call(this,e,t,n)},display(e,t){this.textGeometry.display(e,t),ti().prototype.display.call(this,e,t),t.textureNode=null},transformLine(e){return this.textGeometry.transformLine(e)},transformMatrix(e){return this.textGeometry.transformMatrix(e)}}),Object.defineProperties(ri,{...f().getStaticProperties("Text","Text",1,"geometry","2.0"),fieldDefinitions:{value:new(p())([new(u())(T().inputOutput,"metadata",new(i().SFNode)),new(u())(T().inputOutput,"string",new(i().MFString)),new(u())(T().inputOutput,"length",new(i().MFFloat)),new(u())(T().inputOutput,"maxExtent",new(i().SFFloat)),new(u())(T().initializeOnly,"solid",new(i().SFBool)),new(u())(T().outputOnly,"origin",new(i().SFVec3f)),new(u())(T().outputOnly,"textBounds",new(i().SFVec2f)),new(u())(T().outputOnly,"lineBounds",new(i().MFVec2f)),new(u())(T().inputOutput,"fontStyle",new(i().SFNode))]),enumerable:!0}});const oi=ri,ai=y().add("Text",oi);o().add({name:"Text",concreteNodes:[Oe,ai],abstractNodes:[L],browserContext:Ja});y().add("TextComponent",undefined)})();
|