@xterm/addon-ligatures 0.11.0-beta.23 → 0.11.0-beta.230
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/LICENSE +25 -1
- package/lib/addon-ligatures.js +3 -0
- package/lib/addon-ligatures.js.map +1 -0
- package/lib/addon-ligatures.mjs +2 -2
- package/lib/addon-ligatures.mjs.map +4 -4
- package/package.json +13 -11
- package/src/LigaturesAddon.ts +2 -2
- package/src/font.ts +12 -10
- package/src/fontLigatures/flatten.ts +40 -0
- package/src/fontLigatures/index.ts +262 -0
- package/src/fontLigatures/merge.ts +393 -0
- package/src/fontLigatures/mergeRange.ts +66 -0
- package/src/fontLigatures/processors/6-1.ts +82 -0
- package/src/fontLigatures/processors/6-2.ts +96 -0
- package/src/fontLigatures/processors/6-3.ts +73 -0
- package/src/fontLigatures/processors/8-1.ts +69 -0
- package/src/fontLigatures/processors/classDef.ts +84 -0
- package/src/fontLigatures/processors/coverage.ts +43 -0
- package/src/fontLigatures/processors/helper.ts +183 -0
- package/src/fontLigatures/processors/substitution.ts +59 -0
- package/src/fontLigatures/tables.ts +112 -0
- package/src/fontLigatures/types.ts +86 -0
- package/src/fontLigatures/walk.ts +67 -0
- package/src/index.ts +2 -2
package/LICENSE
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
|
+
Copyright (c) 2019, The xterm.js authors (https://github.com/xtermjs/xterm.js)
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
The code that analyzes font ligatures is forked from https://github.com/princjef/font-ligatures with this license:
|
|
24
|
+
|
|
1
25
|
MIT License
|
|
2
26
|
|
|
3
|
-
Copyright (c) 2018
|
|
27
|
+
Copyright (c) 2018 Jeffrey Principe
|
|
4
28
|
|
|
5
29
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
30
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see addon-ligatures.js.LICENSE.txt */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.LigaturesAddon=t():e.LigaturesAddon=t()}(globalThis,()=>(()=>{var e={55(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const n={individual:{},range:[]},r=(0,o.listGlyphsByIndex)(e.coverage);for(const{glyphId:i,index:a}of r){const r={};Array.isArray(i)?n.range.push({entry:r,range:i}):n.individual[i]=r;let l=[{entry:r,substitutions:[e.substitutes[a]]}];for(const t of e.lookaheadCoverage)l=(0,s.processLookaheadPosition)((0,o.listGlyphsByIndex)(t).map(e=>e.glyphId),l);for(const t of e.backtrackCoverage)l=(0,s.processBacktrackPosition)((0,o.listGlyphsByIndex)(t).map(e=>e.glyphId),l);for(const{entry:n,substitutions:o}of l)n.lookup={substitutions:o,index:t,subIndex:0,length:1,contextRange:[-1*e.backtrackCoverage.length,1+e.lookaheadCoverage.length]}}return n};const o=n(871),s=n(393)},76(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeSubstitutionGlyphs=function(e,t){const n=t[0],o=r(e,n);let s=t[0]+1;const i=new Map;for(;s<t[1];)r(e,s)!==o&&(s-n<=1?i.set(n,o):i.set([n,s],o)),s++;return s-n<=1?i.set(n,o):i.set([n,s],o),i},t.getIndividualSubstitutionGlyph=r;const s=o(n(871));function r(e,t){var n;const o=(0,s.default)(e.coverage,t);if(null===o)return null;switch(e.substFormat){case 1:return(t+e.deltaGlyphId)%65536;case 2:return null!==(n=e.substitute[o])&&void 0!==n?n:null}}},241(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.enableLigatures=function(e,t=[]){let n,o,r,i=0;return e.registerCharacterJoiner(a=>{const l=e.options.fontFamily;if(l&&(0===i||n!==l)){o=void 0,i=1,n=l;const t=n;(0,s.default)(t,1e5).then(n=>{t===e.options.fontFamily&&(i=2,o=n,n&&e.refresh(0,e.rows-1))}).catch(n=>{t===e.options.fontFamily&&(i=3,"debug"===e.options.logLevel&&console.debug(r,new Error("Failure while loading font")),o=void 0,r=n)})}return o&&2===i?o.findLigatureRanges(a).map(e=>[e[0],e[1]]):function(e,t){const n=[];for(let o=0;o<e.length;o++)for(let s=0;s<t.length;s++)if(e.startsWith(t[s],o)){n.push([o,o+t[s].length]),o+=t[s].length-1;break}return n}(a,t)})};const s=o(n(416))},259(e){"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},313(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){let o=!1;for(let s=0;s<e.length;s++){const r=e[s];if(o){if(n<=r[0])return e[s-1][1]=n,e;if(n<=r[1])return e[s-1][1]=Math.max(n,r[1]),e.splice(s,1),o=!1,e;e.splice(s,1),s--}else{if(n<=r[0])return e.splice(s,0,[t,n]),e;if(n<=r[1])return r[0]=Math.min(t,r[0]),e;if(!(t<r[1]))continue;r[0]=Math.min(t,r[0]),o=!0}}return o?e[e.length-1][1]=n:e.push([t,n]),e}},383(e){"use strict";e.exports=require("fs")},393(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processInputPosition=function(e,t,n,o,r){const i=[];for(const a of n){a.entry.forward={individual:{},range:[]};for(const n of e)i.push(...s(a.entry.forward,o,r,t,n).map(({entry:e,substitution:t})=>({entry:e,substitutions:[...a.substitutions,t]})))}return i},t.processLookaheadPosition=function(e,t){var n,o;const s=[],r=new Set;for(const i of t){if(r.has(i.entry))continue;r.add(i.entry),null!==(n=(o=i.entry).forward)&&void 0!==n||(o.forward={individual:{},range:[]});const t={};for(const n of e)Array.isArray(n)?i.entry.forward.range.push({entry:t,range:n}):i.entry.forward.individual[n]=t;s.push({entry:t,substitutions:i.substitutions})}return s},t.processBacktrackPosition=function(e,t){var n,o;const s=[],r=new Set;for(const i of t){if(r.has(i.entry))continue;r.add(i.entry),null!==(n=(o=i.entry).reverse)&&void 0!==n||(o.reverse={individual:{},range:[]});const t={};for(const n of e)Array.isArray(n)?i.entry.reverse.range.push({entry:t,range:n}):i.entry.reverse.individual[n]=t;s.push({entry:t,substitutions:i.substitutions})}return s},t.getInputTree=s;const o=n(76);function s(e,t,n,s,i){const a=[];if(Array.isArray(i)){const r=function(e,t,n,s){for(const r of e.filter(e=>e.sequenceIndex===n))for(const e of t[r.lookupListIndex].subtables){const t=(0,o.getRangeSubstitutionGlyphs)(e,s);if(!Array.from(t.values()).every(e=>null!==e))return t}return new Map([[s,null]])}(t,n,s,i);for(const[t,n]of r){const o={};Array.isArray(t)?e.range.push({range:t,entry:o}):e.individual[t]={},a.push({entry:o,substitution:n})}}else e.individual[i]={},a.push({entry:e.individual[i],substitution:r(t,n,s,i)});return a}function r(e,t,n,s){for(const r of e.filter(e=>e.sequenceIndex===n))for(const e of t[r.lookupListIndex].subtables){const t=(0,o.getIndividualSubstitutionGlyph)(e,s);if(null!==t)return t}return null}},407(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){const r={individual:{},range:[]},i=(0,o.listGlyphsByIndex)(e.inputCoverage[0]);for(const{glyphId:a}of i){let i=(0,s.getInputTree)(r,e.lookupRecords,t,0,a).map(({entry:e,substitution:t})=>({entry:e,substitutions:[t]}));for(const[n,r]of e.inputCoverage.slice(1).entries())i=(0,s.processInputPosition)((0,o.listGlyphsByIndex)(r).map(e=>e.glyphId),n+1,i,e.lookupRecords,t);for(const t of e.lookaheadCoverage)i=(0,s.processLookaheadPosition)((0,o.listGlyphsByIndex)(t).map(e=>e.glyphId),i);for(const t of e.backtrackCoverage)i=(0,s.processBacktrackPosition)((0,o.listGlyphsByIndex)(t).map(e=>e.glyphId),i);for(const{entry:t,substitutions:o}of i)t.lookup={substitutions:o,index:n,subIndex:0,length:e.inputCoverage.length,contextRange:[-1*e.backtrackCoverage.length,e.inputCoverage.length+e.lookaheadCoverage.length]}}return r};const o=n(871),s=n(393)},416(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=async function(e,t){var n,o;if(!i){if("undefined"!=typeof navigator&&"fonts"in navigator){try{const e=await(null===(o=(n=navigator.permissions).request)||void 0===o?void 0:o.call(n,{name:"local-fonts"}));if(e&&"granted"!==e.state)throw new Error("Permission to access local fonts not granted.")}catch(e){if(e instanceof Error&&"TypeError"!==e.name)throw e}const e={};try{const t=await navigator.fonts.query();for(const n of t)e.hasOwnProperty(n.family)||(e[n.family]=[]),e[n.family].push(n);i=Promise.resolve(e)}catch(e){e instanceof Error&&console.error(e.name,e.message)}}else if("undefined"!=typeof window&&"queryLocalFonts"in window){const e={};try{const t=await window.queryLocalFonts();for(const n of t)e.hasOwnProperty(n.family)||(e[n.family]=[]),e[n.family].push(n);i=Promise.resolve(e)}catch(e){e instanceof Error&&console.error(e.name,e.message)}}null!=i||(i=Promise.resolve({}))}const l=await i;for(const n of(0,r.default)(e)){if(a.includes(n))return;if(l.hasOwnProperty(n)&&l[n].length>0){const e=l[n][0];if("blob"in e){const n=await e.blob(),o=await n.arrayBuffer();return(0,s.loadBuffer)(o,{cacheSize:t})}return}}};const s=n(431),r=o(n(838));let i;const a=["serif","sans-serif","cursive","fantasy","monospace","system-ui","emoji","math","fangsong"]},431(e,t,n){"use strict";var o,s=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,s)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(o=function(e){return o=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},o(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=o(e),i=0;i<n.length;i++)"default"!==n[i]&&s(t,e,n[i]);return r(t,e),t}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.loadBuffer=function(e,t){const n=l.parse(e);return new v(n,Object.assign({cacheSize:0},t))};const l=i(n(675)),u=n(749),c=a(n(975)),p=a(n(566)),h=a(n(313)),f=a(n(929)),d=a(n(792)),g=a(n(407)),y=a(n(55)),m=a(n(485));class v{_font;_lookupTrees=[];_glyphLookups={};_cache;constructor(e,t){this._font=e,t.cacheSize>0&&(this._cache=new u({max:t.cacheSize,length:(e,t)=>t.length}));const n=(this._font.tables.gsub&&this._font.tables.gsub.features.filter(e=>"calt"===e.tag)||[]).reduce((e,t)=>[...e,...t.feature.lookupListIndexes],[]),o=this._font.tables.gsub&&this._font.tables.gsub.lookups||[],s=o.filter((e,t)=>n.some(e=>e===t));for(const[e,t]of s.entries()){const n=[];switch(t.lookupType){case 6:for(const[e,s]of t.subtables.entries())switch(s.substFormat){case 1:n.push((0,f.default)(s,o,e));break;case 2:n.push((0,d.default)(s,o,e));break;case 3:n.push((0,g.default)(s,o,e))}break;case 8:for(const[e,o]of t.subtables.entries())n.push((0,y.default)(o,e))}const s=(0,m.default)((0,c.default)(n));this._lookupTrees.push({tree:s,processForward:8!==t.lookupType});for(const t of Object.keys(s))this._glyphLookups[t]||(this._glyphLookups[t]=[]),this._glyphLookups[t].push(e)}}findLigatures(e){const t=this._cache&&this._cache.get(e);if(t&&!Array.isArray(t))return t;const n=[];for(const t of e)n.push(this._font.charToGlyphIndex(t));if(0===this._lookupTrees.length)return{inputGlyphs:n,outputGlyphs:n,contextRanges:[]};const o=this._findInternal(n.slice()),s={inputGlyphs:n,outputGlyphs:o.sequence,contextRanges:o.ranges};return this._cache&&this._cache.set(e,s),s}findLigatureRanges(e){if(0===this._lookupTrees.length)return[];const t=this._cache&&this._cache.get(e);if(t)return Array.isArray(t)?t:t.contextRanges;const n=[];for(const t of e)n.push(this._font.charToGlyphIndex(t));const o=this._findInternal(n);return this._cache&&this._cache.set(e,o.ranges),o.ranges}_findInternal(e){const t=[];let n=this._getNextLookup(e,0);for(;null!==n.index;){const o=this._lookupTrees[n.index];if(o.processForward){let s=n.last;for(let r=n.first;r<s;r++){const n=(0,p.default)(o.tree,e,r,r);if(n){for(let t=0;t<n.substitutions.length;t++){const o=n.substitutions[t];null!==o&&(e[r+t]=o)}(0,h.default)(t,n.contextRange[0]+r,n.contextRange[1]+r),r+n.length>=s&&(s=r+n.length+1),r+=n.length-1}}}else for(let s=n.last-1;s>=n.first;s--){const n=(0,p.default)(o.tree,e,s,s);if(n){for(let t=0;t<n.substitutions.length;t++){const o=n.substitutions[t];null!==o&&(e[s+t]=o)}(0,h.default)(t,n.contextRange[0]+s,n.contextRange[1]+s),s-=n.length-1}}n=this._getNextLookup(e,n.index+1)}return{sequence:e,ranges:t}}_getNextLookup(e,t){const n={index:null,first:1/0,last:-1};for(let o=0;o<e.length;o++){const s=this._glyphLookups[e[o]];if(s)for(let e=0;e<s.length;e++){const r=s[e];if(r>=t){(null===n.index||r<=n.index)&&(n.index=r,n.first>o&&(n.first=o),n.last=o+1);break}}}return n}}},485(e,t){"use strict";function n(e,t=new Map){const n={};for(const[s,r]of Object.entries(e.individual))n[s]=o(r,t);for(const{range:s,entry:r}of e.range){const e=o(r,t);for(let t=s[0];t<s[1];t++)n[t]=e}return n}function o(e,t){if(t.has(e))return t.get(e);const o={};return t.set(e,o),e.forward&&(o.forward=n(e.forward,t)),e.reverse&&(o.reverse=n(e.reverse,t)),e.lookup&&(o.lookup=e.lookup),o}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},566(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n,o,s){const r=t[n[s]];if(!r)return;let i=r.lookup;if(r.reverse){const e=function(e,t,n){let o=e[t[--n]],s=o&&o.lookup;for(;o&&((!s&&o.lookup||o.lookup&&s&&s.index>o.lookup.index)&&(s=o.lookup),!(--n<0)&&o.reverse);)o=o.reverse[t[n]];return s}(r.reverse,n,o);(!i&&e||e&&i&&(i.index>e.index||i.index===e.index&&i.subIndex>e.subIndex))&&(i=e)}if(++s>=n.length||!r.forward)return i;const a=e(r.forward,n,o,s);return(!i&&a||a&&i&&(i.index>a.index||i.index===a.index&&i.subIndex>a.subIndex))&&(i=a),i}},675(e,t,n){"use strict";n.r(t),n.d(t,{BoundingBox:()=>a,Font:()=>Rn,Glyph:()=>le,Path:()=>u,_parse:()=>z,load:()=>Hn,loadSync:()=>zn,parse:()=>_n});var o=n(694),s=n.n(o);function r(e,t,n,o,s){return Math.pow(1-s,3)*e+3*Math.pow(1-s,2)*s*t+3*(1-s)*Math.pow(s,2)*n+Math.pow(s,3)*o}function i(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}i.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},i.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))},i.prototype.addX=function(e){this.addPoint(e,null)},i.prototype.addY=function(e){this.addPoint(null,e)},i.prototype.addBezier=function(e,t,n,o,s,i,a,l){const u=[e,t],c=[n,o],p=[s,i],h=[a,l];this.addPoint(e,t),this.addPoint(a,l);for(let e=0;e<=1;e++){const t=6*u[e]-12*c[e]+6*p[e],n=-3*u[e]+9*c[e]-9*p[e]+3*h[e],o=3*c[e]-3*u[e];if(0===n){if(0===t)continue;const n=-o/t;0<n&&n<1&&(0===e&&this.addX(r(u[e],c[e],p[e],h[e],n)),1===e&&this.addY(r(u[e],c[e],p[e],h[e],n)));continue}const s=Math.pow(t,2)-4*o*n;if(s<0)continue;const i=(-t+Math.sqrt(s))/(2*n);0<i&&i<1&&(0===e&&this.addX(r(u[e],c[e],p[e],h[e],i)),1===e&&this.addY(r(u[e],c[e],p[e],h[e],i)));const a=(-t-Math.sqrt(s))/(2*n);0<a&&a<1&&(0===e&&this.addX(r(u[e],c[e],p[e],h[e],a)),1===e&&this.addY(r(u[e],c[e],p[e],h[e],a)))}},i.prototype.addQuad=function(e,t,n,o,s,r){const i=e+2/3*(n-e),a=t+2/3*(o-t),l=i+1/3*(s-e),u=a+1/3*(r-t);this.addBezier(e,t,i,a,l,u,s,r)};const a=i;function l(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}l.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},l.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},l.prototype.curveTo=l.prototype.bezierCurveTo=function(e,t,n,o,s,r){this.commands.push({type:"C",x1:e,y1:t,x2:n,y2:o,x:s,y:r})},l.prototype.quadTo=l.prototype.quadraticCurveTo=function(e,t,n,o){this.commands.push({type:"Q",x1:e,y1:t,x:n,y:o})},l.prototype.close=l.prototype.closePath=function(){this.commands.push({type:"Z"})},l.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof a){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)},l.prototype.getBoundingBox=function(){const e=new a;let t=0,n=0,o=0,s=0;for(let r=0;r<this.commands.length;r++){const i=this.commands[r];switch(i.type){case"M":e.addPoint(i.x,i.y),t=o=i.x,n=s=i.y;break;case"L":e.addPoint(i.x,i.y),o=i.x,s=i.y;break;case"Q":e.addQuad(o,s,i.x1,i.y1,i.x,i.y),o=i.x,s=i.y;break;case"C":e.addBezier(o,s,i.x1,i.y1,i.x2,i.y2,i.x,i.y),o=i.x,s=i.y;break;case"Z":o=t,s=n;break;default:throw new Error("Unexpected path command "+i.type)}}return e.isEmpty()&&e.addPoint(0,0),e},l.prototype.draw=function(e){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&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},l.prototype.toPathData=function(e){function t(t){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function n(){let e="";for(let n=0;n<arguments.length;n+=1){const o=arguments[n];o>=0&&n>0&&(e+=" "),e+=t(o)}return e}e=void 0!==e?e:2;let o="";for(let e=0;e<this.commands.length;e+=1){const t=this.commands[e];"M"===t.type?o+="M"+n(t.x,t.y):"L"===t.type?o+="L"+n(t.x,t.y):"C"===t.type?o+="C"+n(t.x1,t.y1,t.x2,t.y2,t.x,t.y):"Q"===t.type?o+="Q"+n(t.x1,t.y1,t.x,t.y):"Z"===t.type&&(o+="Z")}return o},l.prototype.toSVG=function(e){let t='<path d="';return t+=this.toPathData(e),t+='"',this.fill&&"black"!==this.fill&&(null===this.fill?t+=' fill="none"':t+=' fill="'+this.fill+'"'),this.stroke&&(t+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),t+="/>",t},l.prototype.toDOMElement=function(e){const t=this.toPathData(e),n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",t),n};const u=l;function c(e){throw new Error(e)}function p(e,t){e||c(t)}const h={fail:c,argument:p,assert:p},f=2147483648,d={},g={},y={};function m(e){return function(){return e}}g.BYTE=function(e){return h.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]},y.BYTE=m(1),g.CHAR=function(e){return[e.charCodeAt(0)]},y.CHAR=m(1),g.CHARARRAY=function(e){const t=[];for(let n=0;n<e.length;n+=1)t[n]=e.charCodeAt(n);return t},y.CHARARRAY=function(e){return e.length},g.USHORT=function(e){return[e>>8&255,255&e]},y.USHORT=m(2),g.SHORT=function(e){return e>=32768&&(e=-(65536-e)),[e>>8&255,255&e]},y.SHORT=m(2),g.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},y.UINT24=m(3),g.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},y.ULONG=m(4),g.LONG=function(e){return e>=f&&(e=-(2*f-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},y.LONG=m(4),g.FIXED=g.ULONG,y.FIXED=y.ULONG,g.FWORD=g.SHORT,y.FWORD=y.SHORT,g.UFWORD=g.USHORT,y.UFWORD=y.USHORT,g.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},y.LONGDATETIME=m(8),g.TAG=function(e){return h.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},y.TAG=m(4),g.Card8=g.BYTE,y.Card8=y.BYTE,g.Card16=g.USHORT,y.Card16=y.USHORT,g.OffSize=g.BYTE,y.OffSize=y.BYTE,g.SID=g.USHORT,y.SID=y.USHORT,g.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?g.NUMBER16(e):g.NUMBER32(e)},y.NUMBER=function(e){return g.NUMBER(e).length},g.NUMBER16=function(e){return[28,e>>8&255,255&e]},y.NUMBER16=m(3),g.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},y.NUMBER32=m(5),g.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 o=parseFloat("1e"+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*o)/o).toString()}let o="";for(let e=0,n=t.length;e<n;e+=1){const n=t[e];o+="e"===n?"-"===t[++e]?"c":"b":"."===n?"a":"-"===n?"e":n}o+=1&o.length?"f":"ff";const s=[30];for(let e=0,t=o.length;e<t;e+=2)s.push(parseInt(o.substr(e,2),16));return s},y.REAL=function(e){return g.REAL(e).length},g.NAME=g.CHARARRAY,y.NAME=y.CHARARRAY,g.STRING=g.CHARARRAY,y.STRING=y.CHARARRAY,d.UTF8=function(e,t,n){const o=[],s=n;for(let n=0;n<s;n++,t+=1)o[n]=e.getUint8(t);return String.fromCharCode.apply(null,o)},d.UTF16=function(e,t,n){const o=[],s=n/2;for(let n=0;n<s;n++,t+=2)o[n]=e.getUint16(t);return String.fromCharCode.apply(null,o)},g.UTF16=function(e){const t=[];for(let n=0;n<e.length;n+=1){const o=e.charCodeAt(n);t[t.length]=o>>8&255,t[t.length]=255&o}return t},y.UTF16=function(e){return 2*e.length};const v={"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":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};d.MACSTRING=function(e,t,n,o){const s=v[o];if(void 0===s)return;let r="";for(let o=0;o<n;o++){const n=e.getUint8(t+o);r+=n<=127?String.fromCharCode(n):s[127&n]}return r};const b="function"==typeof WeakMap&&new WeakMap;let x;function S(e){return e>=-128&&e<=127}function U(e,t,n){let o=0;const s=e.length;for(;t<s&&o<64&&0===e[t];)++t,++o;return n.push(128|o-1),t}function T(e,t,n){let o=0;const s=e.length;let r=t;for(;r<s&&o<64;){const t=e[r];if(!S(t))break;if(0===t&&r+1<s&&0===e[r+1])break;++r,++o}n.push(o-1);for(let o=t;o<r;++o)n.push(e[o]+256&255);return r}function O(e,t,n){let o=0;const s=e.length;let r=t;for(;r<s&&o<64;){const t=e[r];if(0===t)break;if(S(t)&&r+1<s&&S(e[r+1]))break;++r,++o}n.push(64|o-1);for(let o=t;o<r;++o){const t=e[o];n.push(t+65536>>8&255,t+256&255)}return r}g.MACSTRING=function(e,t){const n=function(e){if(!x){x={};for(let e in v)x[e]=new String(e)}const t=x[e];if(void 0===t)return;if(b){const e=b.get(t);if(void 0!==e)return e}const n=v[e];if(void 0===n)return;const o={};for(let e=0;e<n.length;e++)o[n.charCodeAt(e)]=e+128;return b&&b.set(t,o),o}(t);if(void 0===n)return;const o=[];for(let t=0;t<e.length;t++){let s=e.charCodeAt(t);if(s>=128&&(s=n[s],void 0===s))return;o[t]=s}return o},y.MACSTRING=function(e,t){const n=g.MACSTRING(e,t);return void 0!==n?n.length:0},g.VARDELTAS=function(e){let t=0;const n=[];for(;t<e.length;){const o=e[t];t=0===o?U(e,t,n):o>=-128&&o<=127?T(e,t,n):O(e,t,n)}return n},g.INDEX=function(e){let t=1;const n=[t],o=[];for(let s=0;s<e.length;s+=1){const r=g.OBJECT(e[s]);Array.prototype.push.apply(o,r),t+=r.length,n.push(t)}if(0===o.length)return[0,0];const s=[],r=1+Math.floor(Math.log(t)/Math.log(2))/8|0,i=[void 0,g.BYTE,g.USHORT,g.UINT24,g.ULONG][r];for(let e=0;e<n.length;e+=1){const t=i(n[e]);Array.prototype.push.apply(s,t)}return Array.prototype.concat(g.Card16(e.length),g.OffSize(r),s,o)},y.INDEX=function(e){return g.INDEX(e).length},g.DICT=function(e){let t=[];const n=Object.keys(e),o=n.length;for(let s=0;s<o;s+=1){const o=parseInt(n[s],0),r=e[o];t=t.concat(g.OPERAND(r.value,r.type)),t=t.concat(g.OPERATOR(o))}return t},y.DICT=function(e){return g.DICT(e).length},g.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},g.OPERAND=function(e,t){let n=[];if(Array.isArray(t))for(let o=0;o<t.length;o+=1)h.argument(e.length===t.length,"Not enough arguments given for type"+t),n=n.concat(g.OPERAND(e[o],t[o]));else if("SID"===t)n=n.concat(g.NUMBER(e));else if("offset"===t)n=n.concat(g.NUMBER32(e));else if("number"===t)n=n.concat(g.NUMBER(e));else{if("real"!==t)throw new Error("Unknown operand type "+t);n=n.concat(g.REAL(e))}return n},g.OP=g.BYTE,y.OP=y.BYTE;const k="function"==typeof WeakMap&&new WeakMap;function w(e,t,n){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 o=e[t],s=n[o];void 0!==this[o]&&(this[o]=s)}}}function E(e,t,n){void 0===n&&(n=t.length);const o=new Array(t.length+1);o[0]={name:e+"Count",type:"USHORT",value:n};for(let n=0;n<t.length;n++)o[n+1]={name:e+n,type:"USHORT",value:t[n]};return o}function R(e,t,n){const o=t.length,s=new Array(o+1);s[0]={name:e+"Count",type:"USHORT",value:o};for(let r=0;r<o;r++)s[r+1]={name:e+r,type:"TABLE",value:n(t[r],r)};return s}function L(e,t,n){const o=t.length;let s=[];s[0]={name:e+"Count",type:"USHORT",value:o};for(let e=0;e<o;e++)s=s.concat(n(t[e],e));return s}function D(e){1===e.format?w.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(E("glyph",e.glyphs))):h.assert(!1,"Can't create coverage table format 2 yet.")}function C(e){w.call(this,"scriptListTable",L("scriptRecord",e,function(e,t){const n=e.script;let o=n.defaultLangSys;return h.assert(!!o,"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 w("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new w("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:o.reqFeatureIndex}].concat(E("featureIndex",o.featureIndexes)))}].concat(L("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 w("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:n.reqFeatureIndex}].concat(E("featureIndex",n.featureIndexes)))}]})))}]}))}function I(e){w.call(this,"featureListTable",L("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 w("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat(E("lookupListIndex",n.lookupListIndexes)))}]}))}function M(e,t){w.call(this,"lookupListTable",R("lookup",e,function(e){let n=t[e.lookupType];return h.assert(!!n,"Unable to write GSUB lookup type "+e.lookupType+" tables."),new w("lookupTable",[{name:"lookupType",type:"USHORT",value:e.lookupType},{name:"lookupFlag",type:"USHORT",value:e.lookupFlag}].concat(R("subtable",e.subtables,n)))}))}g.CHARSTRING=function(e){if(k){const t=k.get(e);if(void 0!==t)return t}let t=[];const n=e.length;for(let o=0;o<n;o+=1){const n=e[o];t=t.concat(g[n.type](n.value))}return k&&k.set(e,t),t},y.CHARSTRING=function(e){return g.CHARSTRING(e).length},g.OBJECT=function(e){const t=g[e.type];return h.argument(void 0!==t,"No encoding function for type "+e.type),t(e.value)},y.OBJECT=function(e){const t=y[e.type];return h.argument(void 0!==t,"No sizeOf function for type "+e.type),t(e.value)},g.TABLE=function(e){let t=[];const n=e.fields.length,o=[],s=[];for(let r=0;r<n;r+=1){const n=e.fields[r],i=g[n.type];h.argument(void 0!==i,"No encoding function for field type "+n.type+" ("+n.name+")");let a=e[n.name];void 0===a&&(a=n.value);const l=i(a);"TABLE"===n.type?(s.push(t.length),t=t.concat([0,0]),o.push(l)):t=t.concat(l)}for(let n=0;n<o.length;n+=1){const r=s[n],i=t.length;h.argument(i<65536,"Table "+e.tableName+" too big."),t[r]=i>>8,t[r+1]=255&i,t=t.concat(o[n])}return t},y.TABLE=function(e){let t=0;const n=e.fields.length;for(let o=0;o<n;o+=1){const n=e.fields[o],s=y[n.type];h.argument(void 0!==s,"No sizeOf function for field type "+n.type+" ("+n.name+")");let r=e[n.name];void 0===r&&(r=n.value),t+=s(r),"TABLE"===n.type&&(t+=2)}return t},g.RECORD=g.TABLE,y.RECORD=y.TABLE,g.LITERAL=function(e){return e},y.LITERAL=function(e){return e.length},w.prototype.encode=function(){return g.TABLE(this)},w.prototype.sizeOf=function(){return y.TABLE(this)},D.prototype=Object.create(w.prototype),D.prototype.constructor=D,C.prototype=Object.create(w.prototype),C.prototype.constructor=C,I.prototype=Object.create(w.prototype),I.prototype.constructor=I,M.prototype=Object.create(w.prototype),M.prototype.constructor=M;const G={Table:w,Record:w,Coverage:D,ScriptList:C,FeatureList:I,LookupList:M,ushortList:E,tableList:R,recordList:L};function A(e,t){return e.getUint8(t)}function P(e,t){return e.getUint16(t,!1)}function B(e,t){return e.getUint32(t,!1)}function N(e,t){return e.getInt16(t,!1)+e.getUint16(t+2,!1)/65535}const F={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function _(e,t){this.data=e,this.offset=t,this.relativeOffset=0}_.prototype.parseByte=function(){const e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},_.prototype.parseChar=function(){const e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},_.prototype.parseCard8=_.prototype.parseByte,_.prototype.parseUShort=function(){const e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},_.prototype.parseCard16=_.prototype.parseUShort,_.prototype.parseSID=_.prototype.parseUShort,_.prototype.parseOffset16=_.prototype.parseUShort,_.prototype.parseShort=function(){const e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},_.prototype.parseF2Dot14=function(){const e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},_.prototype.parseULong=function(){const e=B(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},_.prototype.parseOffset32=_.prototype.parseULong,_.prototype.parseFixed=function(){const e=N(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},_.prototype.parseString=function(e){const t=this.data,n=this.offset+this.relativeOffset;let o="";this.relativeOffset+=e;for(let s=0;s<e;s++)o+=String.fromCharCode(t.getUint8(n+s));return o},_.prototype.parseTag=function(){return this.parseString(4)},_.prototype.parseLongDateTime=function(){let e=B(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},_.prototype.parseVersion=function(e){const t=P(this.data,this.offset+this.relativeOffset),n=P(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,void 0===e&&(e=4096),t+n/e/10},_.prototype.skip=function(e,t){void 0===t&&(t=1),this.relativeOffset+=F[e]*t},_.prototype.parseULongList=function(e){void 0===e&&(e=this.parseULong());const t=new Array(e),n=this.data;let o=this.offset+this.relativeOffset;for(let s=0;s<e;s++)t[s]=n.getUint32(o),o+=4;return this.relativeOffset+=4*e,t},_.prototype.parseOffset16List=_.prototype.parseUShortList=function(e){void 0===e&&(e=this.parseUShort());const t=new Array(e),n=this.data;let o=this.offset+this.relativeOffset;for(let s=0;s<e;s++)t[s]=n.getUint16(o),o+=2;return this.relativeOffset+=2*e,t},_.prototype.parseShortList=function(e){const t=new Array(e),n=this.data;let o=this.offset+this.relativeOffset;for(let s=0;s<e;s++)t[s]=n.getInt16(o),o+=2;return this.relativeOffset+=2*e,t},_.prototype.parseByteList=function(e){const t=new Array(e),n=this.data;let o=this.offset+this.relativeOffset;for(let s=0;s<e;s++)t[s]=n.getUint8(o++);return this.relativeOffset+=e,t},_.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());const n=new Array(e);for(let o=0;o<e;o++)n[o]=t.call(this);return n},_.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());const n=new Array(e);for(let o=0;o<e;o++)n[o]=t.call(this);return n},_.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());const n=new Array(e),o=Object.keys(t);for(let s=0;s<e;s++){const e={};for(let n=0;n<o.length;n++){const s=o[n],r=t[s];e[s]=r.call(this)}n[s]=e}return n},_.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());const n=new Array(e),o=Object.keys(t);for(let s=0;s<e;s++){const e={};for(let n=0;n<o.length;n++){const s=o[n],r=t[s];e[s]=r.call(this)}n[s]=e}return n},_.prototype.parseStruct=function(e){if("function"==typeof e)return e.call(this);{const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const s=t[o],r=e[s];n[s]=r.call(this)}return n}},_.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},_.prototype.parseValueRecordList=function(){const e=this.parseUShort(),t=this.parseUShort(),n=new Array(t);for(let o=0;o<t;o++)n[o]=this.parseValueRecord(e);return n},_.prototype.parsePointer=function(e){const t=this.parseOffset16();if(t>0)return new _(this.data,this.offset+t).parseStruct(e)},_.prototype.parsePointer32=function(e){const t=this.parseOffset32();if(t>0)return new _(this.data,this.offset+t).parseStruct(e)},_.prototype.parseListOfLists=function(e){const t=this.parseOffset16List(),n=t.length,o=this.relativeOffset,s=new Array(n);for(let o=0;o<n;o++){const n=t[o];if(0!==n)if(this.relativeOffset=n,e){const t=this.parseOffset16List(),r=new Array(t.length);for(let o=0;o<t.length;o++)this.relativeOffset=n+t[o],r[o]=e.call(this);s[o]=r}else s[o]=this.parseUShortList();else s[o]=void 0}return this.relativeOffset=o,s},_.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.")},_.prototype.parseClassDef=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(2===t)return{format:2,ranges:this.parseRecordList({start:_.uShort,end:_.uShort,classId:_.uShort})};throw new Error("0x"+e.toString(16)+": ClassDef format must be 1 or 2.")},_.list=function(e,t){return function(){return this.parseList(e,t)}},_.list32=function(e,t){return function(){return this.parseList32(e,t)}},_.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},_.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},_.pointer=function(e){return function(){return this.parsePointer(e)}},_.pointer32=function(e){return function(){return this.parsePointer32(e)}},_.tag=_.prototype.parseTag,_.byte=_.prototype.parseByte,_.uShort=_.offset16=_.prototype.parseUShort,_.uShortList=_.prototype.parseUShortList,_.uLong=_.offset32=_.prototype.parseULong,_.uLongList=_.prototype.parseULongList,_.struct=_.prototype.parseStruct,_.coverage=_.prototype.parseCoverage,_.classDef=_.prototype.parseClassDef;const H={reserved:_.uShort,reqFeatureIndex:_.uShort,featureIndexes:_.uShortList};_.prototype.parseScriptList=function(){return this.parsePointer(_.recordList({tag:_.tag,script:_.pointer({defaultLangSys:_.pointer(H),langSysRecords:_.recordList({tag:_.tag,langSys:_.pointer(H)})})}))||[]},_.prototype.parseFeatureList=function(){return this.parsePointer(_.recordList({tag:_.tag,feature:_.pointer({featureParams:_.offset16,lookupListIndexes:_.uShortList})}))||[]},_.prototype.parseLookupList=function(e){return this.parsePointer(_.list(_.pointer(function(){const t=this.parseUShort();h.argument(1<=t&&t<=9,"GPOS/GSUB lookup type "+t+" unknown.");const n=this.parseUShort(),o=16&n;return{lookupType:t,lookupFlag:n,subtables:this.parseList(_.pointer(e[t])),markFilteringSet:o?this.parseUShort():void 0}})))||[]},_.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){const e=this.parseUShort(),t=this.parseUShort();return h.argument(1===e&&t<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:_.offset32,featureTableSubstitutionOffset:_.offset32})})||[]};const z={getByte:A,getCard8:A,getUShort:P,getCard16:P,getShort:function(e,t){return e.getInt16(t,!1)},getULong:B,getFixed:N,getTag:function(e,t){let n="";for(let o=t;o<t+4;o+=1)n+=String.fromCharCode(e.getInt8(o));return n},getOffset:function(e,t,n){let o=0;for(let s=0;s<n;s+=1)o<<=8,o+=e.getUint8(t+s);return o},getBytes:function(e,t,n){const o=[];for(let s=t;s<n;s+=1)o.push(e.getUint8(s));return o},bytesToString:function(e){let t="";for(let n=0;n<e.length;n+=1)t+=String.fromCharCode(e[n]);return t},Parser:_};function W(e,t,n){e.segments.push({end:t,start:t,delta:-(t-n),offset:0,glyphIndex:n})}const q=function(e,t){const n={};n.version=z.getUShort(e,t),h.argument(0===n.version,"cmap table version should be 0."),n.numTables=z.getUShort(e,t+2);let o=-1;for(let s=n.numTables-1;s>=0;s-=1){const n=z.getUShort(e,t+4+8*s),r=z.getUShort(e,t+4+8*s+2);if(3===n&&(0===r||1===r||10===r)){o=z.getULong(e,t+4+8*s+4);break}}if(-1===o)throw new Error("No valid cmap sub-tables found.");const s=new z.Parser(e,t+o);if(n.format=s.parseUShort(),12===n.format)!function(e,t){let n;t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong(),e.groupCount=n=t.parseULong(),e.glyphIndexMap={};for(let o=0;o<n;o+=1){const n=t.parseULong(),o=t.parseULong();let s=t.parseULong();for(let t=n;t<=o;t+=1)e.glyphIndexMap[t]=s,s++}}(n,s);else{if(4!==n.format)throw new Error("Only format 4 and 12 cmap tables are supported (found format "+n.format+").");!function(e,t,n,o,s){let r;e.length=t.parseUShort(),e.language=t.parseUShort(),e.segCount=r=t.parseUShort()>>1,t.skip("uShort",3),e.glyphIndexMap={};const i=new z.Parser(n,o+s+14),a=new z.Parser(n,o+s+16+2*r),l=new z.Parser(n,o+s+16+4*r),u=new z.Parser(n,o+s+16+6*r);let c=o+s+16+8*r;for(let t=0;t<r-1;t+=1){let t;const o=i.parseUShort(),s=a.parseUShort(),r=l.parseShort(),p=u.parseUShort();for(let i=s;i<=o;i+=1)0!==p?(c=u.offset+u.relativeOffset-2,c+=p,c+=2*(i-s),t=z.getUShort(n,c),0!==t&&(t=t+r&65535)):t=i+r&65535,e.glyphIndexMap[i]=t}}(n,s,e,t,o)}return n},j=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 o=[{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||(o=o.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),o=o.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);const s=new G.Table("cmap",o);for(s.segments=[],t=0;t<e.length;t+=1){const n=e.get(t);for(let e=0;e<n.unicodes.length;e+=1)W(s,n.unicodes[e],t);s.segments=s.segments.sort(function(e,t){return e.start-t.start})}!function(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}(s);const r=s.segments.length;let i=0,a=[],l=[],u=[],c=[],p=[],h=[];for(t=0;t<r;t+=1){const e=s.segments[t];e.end<=65535&&e.start<=65535?(a=a.concat({name:"end_"+t,type:"USHORT",value:e.end}),l=l.concat({name:"start_"+t,type:"USHORT",value:e.start}),u=u.concat({name:"idDelta_"+t,type:"SHORT",value:e.delta}),c=c.concat({name:"idRangeOffset_"+t,type:"USHORT",value:e.offset}),void 0!==e.glyphId&&(p=p.concat({name:"glyph_"+t,type:"USHORT",value:e.glyphId}))):i+=1,n||void 0===e.glyphIndex||(h=h.concat({name:"cmap12Start_"+t,type:"ULONG",value:e.start}),h=h.concat({name:"cmap12End_"+t,type:"ULONG",value:e.end}),h=h.concat({name:"cmap12Glyph_"+t,type:"ULONG",value:e.glyphIndex}))}if(s.segCountX2=2*(r-i),s.searchRange=2*Math.pow(2,Math.floor(Math.log(r-i)/Math.log(2))),s.entrySelector=Math.log(s.searchRange/2)/Math.log(2),s.rangeShift=s.segCountX2-s.searchRange,s.fields=s.fields.concat(a),s.fields.push({name:"reservedPad",type:"USHORT",value:0}),s.fields=s.fields.concat(l),s.fields=s.fields.concat(u),s.fields=s.fields.concat(c),s.fields=s.fields.concat(p),s.cmap4Length=14+2*a.length+2+2*l.length+2*u.length+2*c.length+2*p.length,!n){const e=16+4*h.length;s.cmap12Offset=20+s.cmap4Length,s.fields=s.fields.concat([{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}]),s.fields=s.fields.concat(h)}return s},X=[".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"],V=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],Y=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],Z=[".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 Q(e){this.font=e}function J(e){this.cmap=e}function K(e,t){this.encoding=e,this.charset=t}function $(e){switch(e.version){case 1:this.names=Z.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(let t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<Z.length?this.names[t]=Z[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-Z.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(let t=0;t<e.numberOfGlyphs;t++)this.names[t]=Z[t+e.glyphNameIndex[t]];break;default:this.names=[]}}Q.prototype.charToGlyphIndex=function(e){const t=e.charCodeAt(0),n=this.font.glyphs;if(n)for(let e=0;e<n.length;e+=1){const o=n.get(e);for(let n=0;n<o.unicodes.length;n+=1)if(o.unicodes[n]===t)return e}return null},J.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.charCodeAt(0)]||0},K.prototype.charToGlyphIndex=function(e){const t=e.charCodeAt(0),n=this.encoding[t];return this.charset.indexOf(n)},$.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},$.prototype.glyphIndexToName=function(e){return this.names[e]};const ee=function(e,t,n,o,s){e.beginPath(),e.moveTo(t,n),e.lineTo(o,s),e.stroke()};function te(e,t,n,o,s){let r;return(t&o)>0?(r=e.parseByte(),0===(t&s)&&(r=-r),r=n+r):r=(t&s)>0?n:n+e.parseShort(),r}function ne(e,t,n){const o=new z.Parser(t,n);let s,r;if(e.numberOfContours=o.parseShort(),e._xMin=o.parseShort(),e._yMin=o.parseShort(),e._xMax=o.parseShort(),e._yMax=o.parseShort(),e.numberOfContours>0){const t=e.endPointIndices=[];for(let n=0;n<e.numberOfContours;n+=1)t.push(o.parseUShort());e.instructionLength=o.parseUShort(),e.instructions=[];for(let t=0;t<e.instructionLength;t+=1)e.instructions.push(o.parseByte());const n=t[t.length-1]+1;s=[];for(let e=0;e<n;e+=1)if(r=o.parseByte(),s.push(r),(8&r)>0){const t=o.parseByte();for(let n=0;n<t;n+=1)s.push(r),e+=1}if(h.argument(s.length===n,"Bad flags."),t.length>0){const i=[];let a;if(n>0){for(let e=0;e<n;e+=1)r=s[e],a={},a.onCurve=!!(1&r),a.lastPointOfContour=t.indexOf(e)>=0,i.push(a);let e=0;for(let t=0;t<n;t+=1)r=s[t],a=i[t],a.x=te(o,r,e,2,16),e=a.x;let l=0;for(let e=0;e<n;e+=1)r=s[e],a=i[e],a.y=te(o,r,l,4,32),l=a.y}e.points=i}else e.points=[]}else if(0===e.numberOfContours)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];let t=!0;for(;t;){s=o.parseUShort();const n={glyphIndex:o.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(1&s)>0?(2&s)>0?(n.dx=o.parseShort(),n.dy=o.parseShort()):n.matchedPoints=[o.parseUShort(),o.parseUShort()]:(2&s)>0?(n.dx=o.parseChar(),n.dy=o.parseChar()):n.matchedPoints=[o.parseByte(),o.parseByte()],(8&s)>0?n.xScale=n.yScale=o.parseF2Dot14():(64&s)>0?(n.xScale=o.parseF2Dot14(),n.yScale=o.parseF2Dot14()):(128&s)>0&&(n.xScale=o.parseF2Dot14(),n.scale01=o.parseF2Dot14(),n.scale10=o.parseF2Dot14(),n.yScale=o.parseF2Dot14()),e.components.push(n),t=!!(32&s)}if(256&s){e.instructionLength=o.parseUShort(),e.instructions=[];for(let t=0;t<e.instructionLength;t+=1)e.instructions.push(o.parseByte())}}}function oe(e,t){const n=[];for(let o=0;o<e.length;o+=1){const s=e[o],r={x:t.xScale*s.x+t.scale01*s.y+t.dx,y:t.scale10*s.x+t.yScale*s.y+t.dy,onCurve:s.onCurve,lastPointOfContour:s.lastPointOfContour};n.push(r)}return n}function se(e){const t=new u;if(!e)return t;const n=function(e){const t=[];let n=[];for(let o=0;o<e.length;o+=1){const s=e[o];n.push(s),s.lastPointOfContour&&(t.push(n),n=[])}return h.argument(0===n.length,"There are still points left in the current contour."),t}(e);for(let e=0;e<n.length;++e){const o=n[e];let s=null,r=o[o.length-1],i=o[0];if(r.onCurve)t.moveTo(r.x,r.y);else if(i.onCurve)t.moveTo(i.x,i.y);else{const e={x:.5*(r.x+i.x),y:.5*(r.y+i.y)};t.moveTo(e.x,e.y)}for(let e=0;e<o.length;++e)if(s=r,r=i,i=o[(e+1)%o.length],r.onCurve)t.lineTo(r.x,r.y);else{let e=s,n=i;s.onCurve||(e={x:.5*(r.x+s.x),y:.5*(r.y+s.y)},t.lineTo(e.x,e.y)),i.onCurve||(n={x:.5*(r.x+i.x),y:.5*(r.y+i.y)}),t.lineTo(e.x,e.y),t.quadraticCurveTo(r.x,r.y,n.x,n.y)}t.closePath()}return t}function re(e,t){if(t.isComposite)for(let n=0;n<t.components.length;n+=1){const o=t.components[n],s=e.get(o.glyphIndex);if(s.getPath(),s.points){let e;if(void 0===o.matchedPoints)e=oe(s.points,o);else{if(o.matchedPoints[0]>t.points.length-1||o.matchedPoints[1]>s.points.length-1)throw Error("Matched points out of range in "+t.name);const n=t.points[o.matchedPoints[0]];let r=s.points[o.matchedPoints[1]];const i={xScale:o.xScale,scale01:o.scale01,scale10:o.scale10,yScale:o.yScale,dx:0,dy:0};r=oe([r],i)[0],i.dx=n.x-r.x,i.dy=n.y-r.y,e=oe(s.points,i)}t.points=t.points.concat(e)}}return se(t.points)}const ie={getPath:se,parse:function(e,t,n,o){const s=new pe.GlyphSet(o);for(let r=0;r<n.length-1;r+=1){const i=n[r];i!==n[r+1]?s.push(r,pe.ttfGlyphLoader(o,r,ne,e,t+i,re)):s.push(r,pe.glyphLoader(o,r))}return s}};function ae(e){this.bindConstructorValues(e)}ae.prototype.bindConstructorValues=function(e){this.index=e.index||0,this.name=e.name||null,this.unicode=e.unicode||void 0,this.unicodes=e.unicodes||void 0!==e.unicode?[e.unicode]:[],e.xMin&&(this.xMin=e.xMin),e.yMin&&(this.yMin=e.yMin),e.xMax&&(this.xMax=e.xMax),e.yMax&&(this.yMax=e.yMax),e.advanceWidth&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",function(e,t){let n=t||new u;return{configurable:!0,get:function(){return"function"==typeof n&&(n=n()),n},set:function(e){n=e}}}(0,e.path))},ae.prototype.addUnicode=function(e){0===this.unicodes.length&&(this.unicode=e),this.unicodes.push(e)},ae.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},ae.prototype.getPath=function(e,t,n,o,s){let r,i;e=void 0!==e?e:0,t=void 0!==t?t:0,n=void 0!==n?n:72,o||(o={});let a=o.xScale,l=o.yScale;if(o.hinting&&s&&s.hinting&&(i=this.path&&s.hinting.exec(this,n)),i)r=ie.getPath(i).commands,e=Math.round(e),t=Math.round(t),a=l=1;else{r=this.path.commands;const e=1/this.path.unitsPerEm*n;void 0===a&&(a=e),void 0===l&&(l=e)}const c=new u;for(let n=0;n<r.length;n+=1){const o=r[n];"M"===o.type?c.moveTo(e+o.x*a,t+-o.y*l):"L"===o.type?c.lineTo(e+o.x*a,t+-o.y*l):"Q"===o.type?c.quadraticCurveTo(e+o.x1*a,t+-o.y1*l,e+o.x*a,t+-o.y*l):"C"===o.type?c.curveTo(e+o.x1*a,t+-o.y1*l,e+o.x2*a,t+-o.y2*l,e+o.x*a,t+-o.y*l):"Z"===o.type&&c.closePath()}return c},ae.prototype.getContours=function(){if(void 0===this.points)return[];const e=[];let t=[];for(let n=0;n<this.points.length;n+=1){const o=this.points[n];t.push(o),o.lastPointOfContour&&(e.push(t),t=[])}return h.argument(0===t.length,"There are still points left in the current contour."),e},ae.prototype.getMetrics=function(){const e=this.path.commands,t=[],n=[];for(let o=0;o<e.length;o+=1){const s=e[o];"Z"!==s.type&&(t.push(s.x),n.push(s.y)),"Q"!==s.type&&"C"!==s.type||(t.push(s.x1),n.push(s.y1)),"C"===s.type&&(t.push(s.x2),n.push(s.y2))}const o={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(o.xMin)||(o.xMin=0),isFinite(o.xMax)||(o.xMax=this.advanceWidth),isFinite(o.yMin)||(o.yMin=0),isFinite(o.yMax)||(o.yMax=0),o.rightSideBearing=this.advanceWidth-o.leftSideBearing-(o.xMax-o.xMin),o},ae.prototype.draw=function(e,t,n,o,s){this.getPath(t,n,o,s).draw(e)},ae.prototype.drawPoints=function(e,t,n,o){function s(t,n,o,s){const r=2*Math.PI;e.beginPath();for(let i=0;i<t.length;i+=1)e.moveTo(n+t[i].x*s,o+t[i].y*s),e.arc(n+t[i].x*s,o+t[i].y*s,2,0,r,!1);e.closePath(),e.fill()}t=void 0!==t?t:0,n=void 0!==n?n:0,o=void 0!==o?o:24;const r=1/this.path.unitsPerEm*o,i=[],a=[],l=this.path;for(let e=0;e<l.commands.length;e+=1){const t=l.commands[e];void 0!==t.x&&i.push({x:t.x,y:-t.y}),void 0!==t.x1&&a.push({x:t.x1,y:-t.y1}),void 0!==t.x2&&a.push({x:t.x2,y:-t.y2})}e.fillStyle="blue",s(i,t,n,r),e.fillStyle="red",s(a,t,n,r)},ae.prototype.drawMetrics=function(e,t,n,o){let s;t=void 0!==t?t:0,n=void 0!==n?n:0,o=void 0!==o?o:24,s=1/this.path.unitsPerEm*o,e.lineWidth=1,e.strokeStyle="black",ee(e,t,-1e4,t,1e4),ee(e,-1e4,n,1e4,n);const r=this.xMin||0;let i=this.yMin||0;const a=this.xMax||0;let l=this.yMax||0;const u=this.advanceWidth||0;e.strokeStyle="blue",ee(e,t+r*s,-1e4,t+r*s,1e4),ee(e,t+a*s,-1e4,t+a*s,1e4),ee(e,-1e4,n+-i*s,1e4,n+-i*s),ee(e,-1e4,n+-l*s,1e4,n+-l*s),e.strokeStyle="green",ee(e,t+u*s,-1e4,t+u*s,1e4)};const le=ae;function ue(e,t,n){Object.defineProperty(e,t,{get:function(){return e.path,e[n]},set:function(t){e[n]=t},enumerable:!0,configurable:!0})}function ce(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(let e=0;e<t.length;e++)this.glyphs[e]=t[e];this.length=t&&t.length||0}ce.prototype.get=function(e){return"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]()),this.glyphs[e]},ce.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};const pe={GlyphSet:ce,glyphLoader:function(e,t){return new le({index:t,font:e})},ttfGlyphLoader:function(e,t,n,o,s,r){return function(){const i=new le({index:t,font:e});return i.path=function(){n(i,o,s);const t=r(e.glyphs,i);return t.unitsPerEm=e.unitsPerEm,t},ue(i,"xMin","_xMin"),ue(i,"xMax","_xMax"),ue(i,"yMin","_yMin"),ue(i,"yMax","_yMax"),i}},cffGlyphLoader:function(e,t,n,o){return function(){const s=new le({index:t,font:e});return s.path=function(){const t=n(e,s,o);return t.unitsPerEm=e.unitsPerEm,t},s}}};function he(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(!he(e[n],t[n]))return!1;return!0}return!1}function fe(e){let t;return t=e.length<1240?107:e.length<33900?1131:32768,t}function de(e,t,n){const o=[],s=[],r=z.getCard16(e,t);let i,a;if(0!==r){const n=z.getByte(e,t+2);i=t+(r+1)*n+2;let s=t+3;for(let t=0;t<r+1;t+=1)o.push(z.getOffset(e,s,n)),s+=n;a=i+o[r]}else a=t+2;for(let t=0;t<o.length-1;t+=1){let r=z.getBytes(e,i+o[t],i+o[t+1]);n&&(r=n(r)),s.push(r)}return{objects:s,startOffset:t,endOffset:a}}function ge(e,t){let n,o,s,r;if(28===t)return n=e.parseByte(),o=e.parseByte(),n<<8|o;if(29===t)return n=e.parseByte(),o=e.parseByte(),s=e.parseByte(),r=e.parseByte(),n<<24|o<<16|s<<8|r;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 o=e.parseByte(),s=o>>4,r=15&o;if(15===s)break;if(t+=n[s],15===r)break;t+=n[r]}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 ye(e,t,n){t=void 0!==t?t:0;const o=new z.Parser(e,t),s=[];let r=[];for(n=void 0!==n?n:e.length;o.relativeOffset<n;){let e=o.parseByte();e<=21?(12===e&&(e=1200+o.parseByte()),s.push([e,r]),r=[]):r.push(ge(o,e))}return function(e){const t={};for(let n=0;n<e.length;n+=1){const o=e[n][0],s=e[n][1];let r;if(r=1===s.length?s[0]:s,t.hasOwnProperty(o)&&!isNaN(t[o]))throw new Error("Object "+t+" already has key "+o);t[o]=r}return t}(s)}function me(e,t){return t<=390?X[t]:e[t-391]}function ve(e,t,n){const o={};let s;for(let r=0;r<t.length;r+=1){const i=t[r];if(Array.isArray(i.type)){const t=[];t.length=i.type.length;for(let o=0;o<i.type.length;o++)s=void 0!==e[i.op]?e[i.op][o]:void 0,void 0===s&&(s=void 0!==i.value&&void 0!==i.value[o]?i.value[o]:null),"SID"===i.type[o]&&(s=me(n,s)),t[o]=s;o[i.name]=t}else s=e[i.op],void 0===s&&(s=void 0!==i.value?i.value:null),"SID"===i.type&&(s=me(n,s)),o[i.name]=s}return o}const be=[{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"}],xe=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];function Se(e,t){return ve(ye(e,0,e.byteLength),be,t)}function Ue(e,t,n,o){return ve(ye(e,t,n),xe,o)}function Te(e,t,n,o){const s=[];for(let r=0;r<n.length;r+=1){const i=Se(new DataView(new Uint8Array(n[r]).buffer),o);i._subrs=[],i._subrsBias=0;const a=i.private[0],l=i.private[1];if(0!==a&&0!==l){const n=Ue(e,l+t,a,o);if(i._defaultWidthX=n.defaultWidthX,i._nominalWidthX=n.nominalWidthX,0!==n.subrs){const o=de(e,l+n.subrs+t);i._subrs=o.objects,i._subrsBias=fe(i._subrs)}i._privateDict=n}s.push(i)}return s}function Oe(e,t,n){let o,s,r,i;const a=new u,l=[];let c,p,h,f,d=0,g=!1,y=!1,m=0,v=0;if(e.isCIDFont){const n=e.tables.cff.topDict._fdSelect[t.index],o=e.tables.cff.topDict._fdArray[n];c=o._subrs,p=o._subrsBias,h=o._defaultWidthX,f=o._nominalWidthX}else c=e.tables.cff.topDict._subrs,p=e.tables.cff.topDict._subrsBias,h=e.tables.cff.topDict._defaultWidthX,f=e.tables.cff.topDict._nominalWidthX;let b=h;function x(e,t){y&&a.closePath(),a.moveTo(e,t),y=!0}function S(){let e;e=l.length%2!=0,e&&!g&&(b=l.shift()+f),d+=l.length>>1,l.length=0,g=!0}return function n(u){let h,U,T,O,k,w,E,R,L,D,C,I,M=0;for(;M<u.length;){let G=u[M];switch(M+=1,G){case 1:case 3:case 18:case 23:S();break;case 4:l.length>1&&!g&&(b=l.shift()+f,g=!0),v+=l.pop(),x(m,v);break;case 5:for(;l.length>0;)m+=l.shift(),v+=l.shift(),a.lineTo(m,v);break;case 6:for(;l.length>0&&(m+=l.shift(),a.lineTo(m,v),0!==l.length);)v+=l.shift(),a.lineTo(m,v);break;case 7:for(;l.length>0&&(v+=l.shift(),a.lineTo(m,v),0!==l.length);)m+=l.shift(),a.lineTo(m,v);break;case 8:for(;l.length>0;)o=m+l.shift(),s=v+l.shift(),r=o+l.shift(),i=s+l.shift(),m=r+l.shift(),v=i+l.shift(),a.curveTo(o,s,r,i,m,v);break;case 10:k=l.pop()+p,w=c[k],w&&n(w);break;case 11:return;case 12:switch(G=u[M],M+=1,G){case 35:o=m+l.shift(),s=v+l.shift(),r=o+l.shift(),i=s+l.shift(),E=r+l.shift(),R=i+l.shift(),L=E+l.shift(),D=R+l.shift(),C=L+l.shift(),I=D+l.shift(),m=C+l.shift(),v=I+l.shift(),l.shift(),a.curveTo(o,s,r,i,E,R),a.curveTo(L,D,C,I,m,v);break;case 34:o=m+l.shift(),s=v,r=o+l.shift(),i=s+l.shift(),E=r+l.shift(),R=i,L=E+l.shift(),D=i,C=L+l.shift(),I=v,m=C+l.shift(),a.curveTo(o,s,r,i,E,R),a.curveTo(L,D,C,I,m,v);break;case 36:o=m+l.shift(),s=v+l.shift(),r=o+l.shift(),i=s+l.shift(),E=r+l.shift(),R=i,L=E+l.shift(),D=i,C=L+l.shift(),I=D+l.shift(),m=C+l.shift(),a.curveTo(o,s,r,i,E,R),a.curveTo(L,D,C,I,m,v);break;case 37:o=m+l.shift(),s=v+l.shift(),r=o+l.shift(),i=s+l.shift(),E=r+l.shift(),R=i+l.shift(),L=E+l.shift(),D=R+l.shift(),C=L+l.shift(),I=D+l.shift(),Math.abs(C-m)>Math.abs(I-v)?m=C+l.shift():v=I+l.shift(),a.curveTo(o,s,r,i,E,R),a.curveTo(L,D,C,I,m,v);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+G),l.length=0}break;case 14:l.length>0&&!g&&(b=l.shift()+f,g=!0),y&&(a.closePath(),y=!1);break;case 19:case 20:S(),M+=d+7>>3;break;case 21:l.length>2&&!g&&(b=l.shift()+f,g=!0),v+=l.pop(),m+=l.pop(),x(m,v);break;case 22:l.length>1&&!g&&(b=l.shift()+f,g=!0),m+=l.pop(),x(m,v);break;case 24:for(;l.length>2;)o=m+l.shift(),s=v+l.shift(),r=o+l.shift(),i=s+l.shift(),m=r+l.shift(),v=i+l.shift(),a.curveTo(o,s,r,i,m,v);m+=l.shift(),v+=l.shift(),a.lineTo(m,v);break;case 25:for(;l.length>6;)m+=l.shift(),v+=l.shift(),a.lineTo(m,v);o=m+l.shift(),s=v+l.shift(),r=o+l.shift(),i=s+l.shift(),m=r+l.shift(),v=i+l.shift(),a.curveTo(o,s,r,i,m,v);break;case 26:for(l.length%2&&(m+=l.shift());l.length>0;)o=m,s=v+l.shift(),r=o+l.shift(),i=s+l.shift(),m=r,v=i+l.shift(),a.curveTo(o,s,r,i,m,v);break;case 27:for(l.length%2&&(v+=l.shift());l.length>0;)o=m+l.shift(),s=v,r=o+l.shift(),i=s+l.shift(),m=r+l.shift(),v=i,a.curveTo(o,s,r,i,m,v);break;case 28:h=u[M],U=u[M+1],l.push((h<<24|U<<16)>>16),M+=2;break;case 29:k=l.pop()+e.gsubrsBias,w=e.gsubrs[k],w&&n(w);break;case 30:for(;l.length>0&&(o=m,s=v+l.shift(),r=o+l.shift(),i=s+l.shift(),m=r+l.shift(),v=i+(1===l.length?l.shift():0),a.curveTo(o,s,r,i,m,v),0!==l.length);)o=m+l.shift(),s=v,r=o+l.shift(),i=s+l.shift(),v=i+l.shift(),m=r+(1===l.length?l.shift():0),a.curveTo(o,s,r,i,m,v);break;case 31:for(;l.length>0&&(o=m+l.shift(),s=v,r=o+l.shift(),i=s+l.shift(),v=i+l.shift(),m=r+(1===l.length?l.shift():0),a.curveTo(o,s,r,i,m,v),0!==l.length);)o=m,s=v+l.shift(),r=o+l.shift(),i=s+l.shift(),m=r+l.shift(),v=i+(1===l.length?l.shift():0),a.curveTo(o,s,r,i,m,v);break;default:G<32?console.log("Glyph "+t.index+": unknown operator "+G):G<247?l.push(G-139):G<251?(h=u[M],M+=1,l.push(256*(G-247)+h+108)):G<255?(h=u[M],M+=1,l.push(256*-(G-251)-h-108)):(h=u[M],U=u[M+1],T=u[M+2],O=u[M+3],M+=4,l.push((h<<24|U<<16|T<<8|O)/65536))}}}(n),t.advanceWidth=b,a}function ke(e,t){let n,o=X.indexOf(e);return o>=0&&(n=o),o=t.indexOf(e),o>=0?n=o+X.length:(n=X.length+t.length,t.push(e)),n}function we(e,t,n){const o={};for(let s=0;s<e.length;s+=1){const r=e[s];let i=t[r.name];void 0===i||he(i,r.value)||("SID"===r.type&&(i=ke(i,n)),o[r.op]={name:r.name,type:r.type,value:i})}return o}function Ee(e,t){const n=new G.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return n.dict=we(be,e,t),n}function Re(e){const t=new G.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}function Le(e){const t=[],n=e.path;t.push({name:"width",type:"NUMBER",value:e.advanceWidth});let o=0,s=0;for(let e=0;e<n.commands.length;e+=1){let r,i,a=n.commands[e];if("Q"===a.type){const e=1/3,t=2/3;a={type:"C",x:a.x,y:a.y,x1:e*o+t*a.x1,y1:e*s+t*a.y1,x2:e*a.x+t*a.x1,y2:e*a.y+t*a.y1}}if("M"===a.type)r=Math.round(a.x-o),i=Math.round(a.y-s),t.push({name:"dx",type:"NUMBER",value:r}),t.push({name:"dy",type:"NUMBER",value:i}),t.push({name:"rmoveto",type:"OP",value:21}),o=Math.round(a.x),s=Math.round(a.y);else if("L"===a.type)r=Math.round(a.x-o),i=Math.round(a.y-s),t.push({name:"dx",type:"NUMBER",value:r}),t.push({name:"dy",type:"NUMBER",value:i}),t.push({name:"rlineto",type:"OP",value:5}),o=Math.round(a.x),s=Math.round(a.y);else if("C"===a.type){const e=Math.round(a.x1-o),n=Math.round(a.y1-s),l=Math.round(a.x2-a.x1),u=Math.round(a.y2-a.y1);r=Math.round(a.x-a.x2),i=Math.round(a.y-a.y2),t.push({name:"dx1",type:"NUMBER",value:e}),t.push({name:"dy1",type:"NUMBER",value:n}),t.push({name:"dx2",type:"NUMBER",value:l}),t.push({name:"dy2",type:"NUMBER",value:u}),t.push({name:"dx",type:"NUMBER",value:r}),t.push({name:"dy",type:"NUMBER",value:i}),t.push({name:"rrcurveto",type:"OP",value:8}),o=Math.round(a.x),s=Math.round(a.y)}}return t.push({name:"endchar",type:"OP",value:14}),t}const De=function(e,t,n){n.tables.cff={};const o=function(e,t){const n={};return n.formatMajor=z.getCard8(e,t),n.formatMinor=z.getCard8(e,t+1),n.size=z.getCard8(e,t+2),n.offsetSize=z.getCard8(e,t+3),n.startOffset=t,n.endOffset=t+4,n}(e,t),s=de(e,o.endOffset,z.bytesToString),r=de(e,s.endOffset),i=de(e,r.endOffset,z.bytesToString),a=de(e,i.endOffset);n.gsubrs=a.objects,n.gsubrsBias=fe(n.gsubrs);const l=Te(e,t,r.objects,i.objects);if(1!==l.length)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+l.length);const u=l[0];if(n.tables.cff.topDict=u,u._privateDict&&(n.defaultWidthX=u._privateDict.defaultWidthX,n.nominalWidthX=u._privateDict.nominalWidthX),void 0!==u.ros[0]&&void 0!==u.ros[1]&&(n.isCIDFont=!0),n.isCIDFont){let o=u.fdArray,s=u.fdSelect;if(0===o||0===s)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");o+=t;const r=Te(e,t,de(e,o).objects,i.objects);u._fdArray=r,s+=t,u._fdSelect=function(e,t,n,o){const s=[];let r;const i=new z.Parser(e,t),a=i.parseCard8();if(0===a)for(let e=0;e<n;e++){if(r=i.parseCard8(),r>=o)throw new Error("CFF table CID Font FDSelect has bad FD index value "+r+" (FD count "+o+")");s.push(r)}else{if(3!==a)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+a);{const e=i.parseCard16();let t,a=i.parseCard16();if(0!==a)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+a);for(let l=0;l<e;l++){if(r=i.parseCard8(),t=i.parseCard16(),r>=o)throw new Error("CFF table CID Font FDSelect has bad FD index value "+r+" (FD count "+o+")");if(t>n)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+t);for(;a<t;a++)s.push(r);a=t}if(t!==n)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+t)}}return s}(e,s,n.numGlyphs,r.length)}const c=t+u.private[1],p=Ue(e,c,u.private[0],i.objects);if(n.defaultWidthX=p.defaultWidthX,n.nominalWidthX=p.nominalWidthX,0!==p.subrs){const t=de(e,c+p.subrs);n.subrs=t.objects,n.subrsBias=fe(n.subrs)}else n.subrs=[],n.subrsBias=0;const h=de(e,t+u.charStrings);n.nGlyphs=h.objects.length;const f=function(e,t,n,o){let s,r;const i=new z.Parser(e,t);n-=1;const a=[".notdef"],l=i.parseCard8();if(0===l)for(let e=0;e<n;e+=1)s=i.parseSID(),a.push(me(o,s));else if(1===l)for(;a.length<=n;){s=i.parseSID(),r=i.parseCard8();for(let e=0;e<=r;e+=1)a.push(me(o,s)),s+=1}else{if(2!==l)throw new Error("Unknown charset format "+l);for(;a.length<=n;){s=i.parseSID(),r=i.parseCard16();for(let e=0;e<=r;e+=1)a.push(me(o,s)),s+=1}}return a}(e,t+u.charset,n.nGlyphs,i.objects);0===u.encoding?n.cffEncoding=new K(V,f):1===u.encoding?n.cffEncoding=new K(Y,f):n.cffEncoding=function(e,t,n){let o;const s={},r=new z.Parser(e,t),i=r.parseCard8();if(0===i){const e=r.parseCard8();for(let t=0;t<e;t+=1)o=r.parseCard8(),s[o]=t}else{if(1!==i)throw new Error("Unknown encoding format "+i);{const e=r.parseCard8();o=1;for(let t=0;t<e;t+=1){const e=r.parseCard8(),t=r.parseCard8();for(let n=e;n<=e+t;n+=1)s[n]=o,o+=1}}}return new K(s,n)}(e,t+u.encoding,f),n.encoding=n.encoding||n.cffEncoding,n.glyphs=new pe.GlyphSet(n);for(let e=0;e<n.nGlyphs;e+=1){const t=h.objects[e];n.glyphs.push(e,pe.cffGlyphLoader(n,e,Oe,t))}},Ce=function(e,t){const n=new G.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"}]),o=1/t.unitsPerEm,s={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[o,0,0,o,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},r=[];let i;for(let t=1;t<e.length;t+=1)i=e.get(t),r.push(i.name);const a=[];n.header=new G.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 G.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 l=Ee(s,a);n.topDictIndex=Re(l),n.globalSubrIndex=new G.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}]),n.charsets=function(e,t){const n=new G.Record("Charsets",[{name:"format",type:"Card8",value:0}]);for(let o=0;o<e.length;o+=1){const s=ke(e[o],t);n.fields.push({name:"glyph_"+o,type:"SID",value:s})}return n}(r,a),n.charStringsIndex=function(e){const t=new G.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]);for(let n=0;n<e.length;n+=1){const o=e.get(n),s=Le(o);t.charStrings.push({name:o.name,type:"CHARSTRING",value:s})}return t}(e),n.privateDict=function(e,t){const n=new G.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return n.dict=we(xe,{},t),n}(0,a),n.stringIndex=function(e){const t=new G.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}(a);const u=n.header.sizeOf()+n.nameIndex.sizeOf()+n.topDictIndex.sizeOf()+n.stringIndex.sizeOf()+n.globalSubrIndex.sizeOf();return s.charset=u,s.encoding=0,s.charStrings=s.charset+n.charsets.sizeOf(),s.private[1]=s.charStrings+n.charStringsIndex.sizeOf(),l=Ee(s,a),n.topDictIndex=Re(l),n},Ie=function(e,t){const n={},o=new z.Parser(e,t);return n.version=o.parseVersion(),n.fontRevision=Math.round(1e3*o.parseFixed())/1e3,n.checkSumAdjustment=o.parseULong(),n.magicNumber=o.parseULong(),h.argument(1594834165===n.magicNumber,"Font header has wrong magic number."),n.flags=o.parseUShort(),n.unitsPerEm=o.parseUShort(),n.created=o.parseLongDateTime(),n.modified=o.parseLongDateTime(),n.xMin=o.parseShort(),n.yMin=o.parseShort(),n.xMax=o.parseShort(),n.yMax=o.parseShort(),n.macStyle=o.parseUShort(),n.lowestRecPPEM=o.parseUShort(),n.fontDirectionHint=o.parseShort(),n.indexToLocFormat=o.parseShort(),n.glyphDataFormat=o.parseShort(),n},Me=function(e){const t=Math.round((new Date).getTime()/1e3)+2082844800;let n=t;return e.createdTimestamp&&(n=e.createdTimestamp+2082844800),new G.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:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],e)},Ge=function(e,t){const n={},o=new z.Parser(e,t);return n.version=o.parseVersion(),n.ascender=o.parseShort(),n.descender=o.parseShort(),n.lineGap=o.parseShort(),n.advanceWidthMax=o.parseUShort(),n.minLeftSideBearing=o.parseShort(),n.minRightSideBearing=o.parseShort(),n.xMaxExtent=o.parseShort(),n.caretSlopeRise=o.parseShort(),n.caretSlopeRun=o.parseShort(),n.caretOffset=o.parseShort(),o.relativeOffset+=8,n.metricDataFormat=o.parseShort(),n.numberOfHMetrics=o.parseUShort(),n},Ae=function(e){return new G.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)},Pe=function(e,t,n,o,s){let r,i;const a=new z.Parser(e,t);for(let e=0;e<o;e+=1){e<n&&(r=a.parseUShort(),i=a.parseShort());const t=s.get(e);t.advanceWidth=r,t.leftSideBearing=i}},Be=function(e){const t=new G.Table("hmtx",[]);for(let n=0;n<e.length;n+=1){const o=e.get(n),s=o.advanceWidth||0,r=o.leftSideBearing||0;t.fields.push({name:"advanceWidth_"+n,type:"USHORT",value:s}),t.fields.push({name:"leftSideBearing_"+n,type:"SHORT",value:r})}return t},Ne=function(e){const t=new G.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]);let n="";const o=12+4*e.length;for(let s=0;s<e.length;++s){let r=n.indexOf(e[s]);r<0&&(r=n.length,n+=e[s]),t.fields.push({name:"offset "+s,type:"USHORT",value:o+r}),t.fields.push({name:"length "+s,type:"USHORT",value:e[s].length})}return t.fields.push({name:"stringPool",type:"CHARARRAY",value:n}),t},Fe=function(e,t){const n=new z.Parser(e,t),o=n.parseULong();h.argument(1===o,"Unsupported ltag table version."),n.skip("uLong",1);const s=n.parseULong(),r=[];for(let o=0;o<s;o++){let o="";const s=t+n.parseUShort(),i=n.parseUShort();for(let t=s;t<s+i;++t)o+=String.fromCharCode(e.getInt8(t));r.push(o)}return r},_e=function(e,t){const n={},o=new z.Parser(e,t);return n.version=o.parseVersion(),n.numGlyphs=o.parseUShort(),1===n.version&&(n.maxPoints=o.parseUShort(),n.maxContours=o.parseUShort(),n.maxCompositePoints=o.parseUShort(),n.maxCompositeContours=o.parseUShort(),n.maxZones=o.parseUShort(),n.maxTwilightPoints=o.parseUShort(),n.maxStorage=o.parseUShort(),n.maxFunctionDefs=o.parseUShort(),n.maxInstructionDefs=o.parseUShort(),n.maxStackElements=o.parseUShort(),n.maxSizeOfInstructions=o.parseUShort(),n.maxComponentElements=o.parseUShort(),n.maxComponentDepth=o.parseUShort()),n},He=function(e){return new G.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])},ze=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],We={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"},qe={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},je={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 Xe(e,t,n){switch(e){case 0:if(65535===t)return"und";if(n)return n[t];break;case 1:return We[t];case 3:return je[t]}}const Ve="utf-16",Ye={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"},Ze={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 Qe(e,t,n){switch(e){case 0:return Ve;case 1:return Ze[n]||Ye[t];case 3:if(1===t||10===t)return Ve}}function Je(e){const t={};for(let n in e)t[e[n]]=parseInt(n);return t}function Ke(e,t,n,o,s,r){return new G.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:o},{name:"length",type:"USHORT",value:s},{name:"offset",type:"USHORT",value:r}])}function $e(e,t){let n=function(e,t){const n=e.length,o=t.length-n+1;e:for(let s=0;s<o;s++)for(;s<o;s++){for(let o=0;o<n;o++)if(t[s+o]!==e[o])continue e;return s}return-1}(e,t);if(n<0){n=t.length;let o=0;const s=e.length;for(;o<s;++o)t.push(e[o])}return n}const et=function(e,t,n){const o={},s=new z.Parser(e,t),r=s.parseUShort(),i=s.parseUShort(),a=s.offset+s.parseUShort();for(let t=0;t<i;t++){const t=s.parseUShort(),r=s.parseUShort(),i=s.parseUShort(),l=s.parseUShort(),u=ze[l]||l,c=s.parseUShort(),p=s.parseUShort(),h=Xe(t,i,n),f=Qe(t,r,i);if(void 0!==f&&void 0!==h){let t;if(t=f===Ve?d.UTF16(e,a+p,c):d.MACSTRING(e,a+p,c,f),t){let e=o[u];void 0===e&&(e=o[u]={}),e[h]=t}}}let l=0;return 1===r&&s.parseUShort(),o},tt=function(e,t){let n;const o=[],s={},r=Je(ze);for(let t in e){let i=r[t];if(void 0===i&&(i=t),n=parseInt(i),isNaN(n))throw new Error('Name table entry "'+t+'" does not exist, see nameTableNames for complete list.');s[n]=e[t],o.push(n)}const i=Je(We),a=Je(je),l=[],u=[];for(let e=0;e<o.length;e++){n=o[e];const r=s[n];for(let e in r){const o=r[e];let s=1,c=i[e],p=qe[c];const h=Qe(s,p,c);let f=g.MACSTRING(o,h);void 0===f&&(s=0,c=t.indexOf(e),c<0&&(c=t.length,t.push(e)),p=4,f=g.UTF16(o));const d=$e(f,u);l.push(Ke(s,p,c,n,f.length,d));const y=a[e];if(void 0!==y){const e=g.UTF16(o),t=$e(e,u);l.push(Ke(3,1,y,n,e.length,t))}}}l.sort(function(e,t){return e.platformID-t.platformID||e.encodingID-t.encodingID||e.languageID-t.languageID||e.nameID-t.nameID});const c=new G.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:l.length},{name:"stringOffset",type:"USHORT",value:6+12*l.length}]);for(let e=0;e<l.length;e++)c.fields.push({name:"record_"+e,type:"RECORD",value:l[e]});return c.fields.push({name:"strings",type:"LITERAL",value:u}),c},nt=[{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}],ot=function(e,t){const n={},o=new z.Parser(e,t);n.version=o.parseUShort(),n.xAvgCharWidth=o.parseShort(),n.usWeightClass=o.parseUShort(),n.usWidthClass=o.parseUShort(),n.fsType=o.parseUShort(),n.ySubscriptXSize=o.parseShort(),n.ySubscriptYSize=o.parseShort(),n.ySubscriptXOffset=o.parseShort(),n.ySubscriptYOffset=o.parseShort(),n.ySuperscriptXSize=o.parseShort(),n.ySuperscriptYSize=o.parseShort(),n.ySuperscriptXOffset=o.parseShort(),n.ySuperscriptYOffset=o.parseShort(),n.yStrikeoutSize=o.parseShort(),n.yStrikeoutPosition=o.parseShort(),n.sFamilyClass=o.parseShort(),n.panose=[];for(let e=0;e<10;e++)n.panose[e]=o.parseByte();return n.ulUnicodeRange1=o.parseULong(),n.ulUnicodeRange2=o.parseULong(),n.ulUnicodeRange3=o.parseULong(),n.ulUnicodeRange4=o.parseULong(),n.achVendID=String.fromCharCode(o.parseByte(),o.parseByte(),o.parseByte(),o.parseByte()),n.fsSelection=o.parseUShort(),n.usFirstCharIndex=o.parseUShort(),n.usLastCharIndex=o.parseUShort(),n.sTypoAscender=o.parseShort(),n.sTypoDescender=o.parseShort(),n.sTypoLineGap=o.parseShort(),n.usWinAscent=o.parseUShort(),n.usWinDescent=o.parseUShort(),n.version>=1&&(n.ulCodePageRange1=o.parseULong(),n.ulCodePageRange2=o.parseULong()),n.version>=2&&(n.sxHeight=o.parseShort(),n.sCapHeight=o.parseShort(),n.usDefaultChar=o.parseUShort(),n.usBreakChar=o.parseUShort(),n.usMaxContent=o.parseUShort()),n},st=function(e){return new G.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)},rt=function(e){for(let t=0;t<nt.length;t+=1){const n=nt[t];if(e>=n.begin&&e<n.end)return t}return-1},it=function(e,t){const n={},o=new z.Parser(e,t);switch(n.version=o.parseVersion(),n.italicAngle=o.parseFixed(),n.underlinePosition=o.parseShort(),n.underlineThickness=o.parseShort(),n.isFixedPitch=o.parseULong(),n.minMemType42=o.parseULong(),n.maxMemType42=o.parseULong(),n.minMemType1=o.parseULong(),n.maxMemType1=o.parseULong(),n.version){case 1:n.names=Z.slice();break;case 2:n.numberOfGlyphs=o.parseUShort(),n.glyphNameIndex=new Array(n.numberOfGlyphs);for(let e=0;e<n.numberOfGlyphs;e++)n.glyphNameIndex[e]=o.parseUShort();n.names=[];for(let e=0;e<n.numberOfGlyphs;e++)if(n.glyphNameIndex[e]>=Z.length){const e=o.parseChar();n.names.push(o.parseString(e))}break;case 2.5:n.numberOfGlyphs=o.parseUShort(),n.offset=new Array(n.numberOfGlyphs);for(let e=0;e<n.numberOfGlyphs;e++)n.offset[e]=o.parseChar()}return n},at=function(){return new G.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])},lt=new Array(9);lt[1]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(_.coverage),deltaGlyphId:this.parseUShort()}:2===t?{substFormat:2,coverage:this.parsePointer(_.coverage),substitute:this.parseOffset16List()}:void h.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")},lt[2]=function(){const e=this.parseUShort();return h.argument(1===e,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(_.coverage),sequences:this.parseListOfLists()}},lt[3]=function(){const e=this.parseUShort();return h.argument(1===e,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(_.coverage),alternateSets:this.parseListOfLists()}},lt[4]=function(){const e=this.parseUShort();return h.argument(1===e,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(_.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};const ut={sequenceIndex:_.uShort,lookupListIndex:_.uShort};lt[5]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{substFormat:t,coverage:this.parsePointer(_.coverage),ruleSets:this.parseListOfLists(function(){const e=this.parseUShort(),t=this.parseUShort();return{input:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,ut)}})};if(2===t)return{substFormat:t,coverage:this.parsePointer(_.coverage),classDef:this.parsePointer(_.classDef),classSets:this.parseListOfLists(function(){const e=this.parseUShort(),t=this.parseUShort();return{classes:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,ut)}})};if(3===t){const e=this.parseUShort(),n=this.parseUShort();return{substFormat:t,coverages:this.parseList(e,_.pointer(_.coverage)),lookupRecords:this.parseRecordList(n,ut)}}h.assert(!1,"0x"+e.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},lt[6]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(_.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(ut)}})}:2===t?{substFormat:2,coverage:this.parsePointer(_.coverage),backtrackClassDef:this.parsePointer(_.classDef),inputClassDef:this.parsePointer(_.classDef),lookaheadClassDef:this.parsePointer(_.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(ut)}})}:3===t?{substFormat:3,backtrackCoverage:this.parseList(_.pointer(_.coverage)),inputCoverage:this.parseList(_.pointer(_.coverage)),lookaheadCoverage:this.parseList(_.pointer(_.coverage)),lookupRecords:this.parseRecordList(ut)}:void h.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},lt[7]=function(){const e=this.parseUShort();h.argument(1===e,"GSUB Extension Substitution subtable identifier-format must be 1");const t=this.parseUShort(),n=new _(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:lt[t].call(n)}},lt[8]=function(){const e=this.parseUShort();return h.argument(1===e,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(_.coverage),backtrackCoverage:this.parseList(_.pointer(_.coverage)),lookaheadCoverage:this.parseList(_.pointer(_.coverage)),substitutes:this.parseUShortList()}};const ct=new Array(9);ct[1]=function(e){return 1===e.substFormat?new G.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new G.Coverage(e.coverage)},{name:"deltaGlyphID",type:"USHORT",value:e.deltaGlyphId}]):new G.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new G.Coverage(e.coverage)}].concat(G.ushortList("substitute",e.substitute)))},ct[3]=function(e){return h.assert(1===e.substFormat,"Lookup type 3 substFormat must be 1."),new G.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new G.Coverage(e.coverage)}].concat(G.tableList("altSet",e.alternateSets,function(e){return new G.Table("alternateSetTable",G.ushortList("alternate",e))})))},ct[4]=function(e){return h.assert(1===e.substFormat,"Lookup type 4 substFormat must be 1."),new G.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new G.Coverage(e.coverage)}].concat(G.tableList("ligSet",e.ligatureSets,function(e){return new G.Table("ligatureSetTable",G.tableList("ligature",e,function(e){return new G.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:e.ligGlyph}].concat(G.ushortList("component",e.components,e.components.length+1)))}))})))};const pt=function(e,t){const n=new _(e,t=t||0),o=n.parseVersion(1);return h.argument(1===o||1.1===o,"Unsupported GSUB table version."),1===o?{version:o,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(lt)}:{version:o,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(lt),variations:n.parseFeatureVariationsList()}},ht=function(e){return new G.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new G.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new G.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new G.LookupList(e.lookups,ct)}])},ft=function(e,t){const n=new z.Parser(e,t),o=n.parseULong();h.argument(1===o,"Unsupported META table version."),n.parseULong(),n.parseULong();const s=n.parseULong(),r={};for(let o=0;o<s;o++){const o=n.parseTag(),s=n.parseULong(),i=n.parseULong(),a=d.UTF8(e,t+s,i);r[o]=a}return r},dt=function(e){const t=Object.keys(e).length;let n="";const o=16+12*t,s=new G.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:o},{name:"numTags",type:"ULONG",value:t}]);for(let t in e){const r=n.length;n+=e[t],s.fields.push({name:"tag "+t,type:"TAG",value:t}),s.fields.push({name:"offset "+t,type:"ULONG",value:o+r}),s.fields.push({name:"length "+t,type:"ULONG",value:e[t].length})}return s.fields.push({name:"stringPool",type:"CHARARRAY",value:n}),s};function gt(e){return Math.log(e)/Math.log(2)|0}function yt(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 mt(e,t,n,o){return new G.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!==o?o:0}])}function vt(e){const t=new G.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,gt(t.numTables));t.searchRange=16*n,t.entrySelector=gt(n),t.rangeShift=16*t.numTables-t.searchRange;const o=[],s=[];let r=t.sizeOf()+mt().sizeOf()*t.numTables;for(;r%4!=0;)r+=1,s.push({name:"padding",type:"BYTE",value:0});for(let t=0;t<e.length;t+=1){const n=e[t];h.argument(4===n.tableName.length,"Table name"+n.tableName+" is invalid.");const i=n.sizeOf(),a=mt(n.tableName,yt(n.encode()),r,i);for(o.push({name:a.tag+" Table Record",type:"RECORD",value:a}),s.push({name:n.tableName+" table",type:"RECORD",value:n}),r+=i,h.argument(!isNaN(r),"Something went wrong calculating the offset.");r%4!=0;)r+=1,s.push({name:"padding",type:"BYTE",value:0})}return o.sort(function(e,t){return e.value.tag>t.value.tag?1:-1}),t.fields=t.fields.concat(o),t.fields=t.fields.concat(s),t}function bt(e,t,n){for(let n=0;n<t.length;n+=1){const o=e.charToGlyphIndex(t[n]);if(o>0)return e.glyphs.get(o).getMetrics()}return n}function xt(e){let t=0;for(let n=0;n<e.length;n+=1)t+=e[n];return t/e.length}const St=function(e){const t=[],n=[],o=[],s=[],r=[],i=[],a=[];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),y=0|g.unicode;if(isNaN(g.advanceWidth))throw new Error("Glyph "+g.name+" ("+d+"): advanceWidth is not a number.");(l>y||void 0===l)&&y>0&&(l=y),u<y&&(u=y);const m=rt(y);if(m<32)c|=1<<m;else if(m<64)p|=1<<m-32;else if(m<96)h|=1<<m-64;else{if(!(m<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");f|=1<<m-96}if(".notdef"===g.name)continue;const v=g.getMetrics();t.push(v.xMin),n.push(v.yMin),o.push(v.xMax),s.push(v.yMax),i.push(v.leftSideBearing),a.push(v.rightSideBearing),r.push(g.advanceWidth)}const d={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,o),yMax:Math.max.apply(null,s),advanceWidthMax:Math.max.apply(null,r),advanceWidthAvg:xt(r),minLeftSideBearing:Math.min.apply(null,i),maxLeftSideBearing:Math.max.apply(null,i),minRightSideBearing:Math.min.apply(null,a)};d.ascender=e.ascender,d.descender=e.descender;const g=Me({flags:3,unitsPerEm:e.unitsPerEm,xMin:d.xMin,yMin:d.yMin,xMax:d.xMax,yMax:d.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp}),y=Ae({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}),m=He(e.glyphs.length),v=st({xAvgCharWidth:Math.round(d.advanceWidthAvg),usWeightClass:e.tables.os2.usWeightClass,usWidthClass:e.tables.os2.usWidthClass,usFirstCharIndex:l,usLastCharIndex:u,ulUnicodeRange1:c,ulUnicodeRange2:p,ulUnicodeRange3:h,ulUnicodeRange4:f,fsSelection:e.tables.os2.fsSelection,sTypoAscender:d.ascender,sTypoDescender:d.descender,sTypoLineGap:0,usWinAscent:d.yMax,usWinDescent:Math.abs(d.yMin),ulCodePageRange1:1,sxHeight:bt(e,"xyvw",{yMax:Math.round(d.ascender/2)}).yMax,sCapHeight:bt(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",d).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0}),b=Be(e.glyphs),x=j(e.glyphs),S=e.getEnglishName("fontFamily"),U=e.getEnglishName("fontSubfamily"),T=S+" "+U;let O=e.getEnglishName("postScriptName");O||(O=S.replace(/\s/g,"")+"-"+U);const k={};for(let t in e.names)k[t]=e.names[t];k.uniqueID||(k.uniqueID={en:e.getEnglishName("manufacturer")+":"+T}),k.postScriptName||(k.postScriptName={en:O}),k.preferredFamily||(k.preferredFamily=e.names.fontFamily),k.preferredSubfamily||(k.preferredSubfamily=e.names.fontSubfamily);const w=[],E=tt(k,w),R=w.length>0?Ne(w):void 0,L=at(),D=Ce(e.glyphs,{version:e.getEnglishName("version"),fullName:T,familyName:S,weightName:U,postScriptName:O,unitsPerEm:e.unitsPerEm,fontBBox:[0,d.yMin,d.ascender,d.advanceWidthMax]}),C=e.metas&&Object.keys(e.metas).length>0?dt(e.metas):void 0,I=[g,y,m,v,E,x,L,D,b];R&&I.push(R),e.tables.gsub&&I.push(ht(e.tables.gsub)),C&&I.push(C);const M=vt(I),G=yt(M.encode()),A=M.fields;let P=!1;for(let e=0;e<A.length;e+=1)if("head table"===A[e].name){A[e].value.checkSumAdjustment=2981146554-G,P=!0;break}if(!P)throw new Error("Could not find head table with checkSum to adjust.");return M};function Ut(e,t){let n=0,o=e.length-1;for(;n<=o;){const s=n+o>>>1,r=e[s].tag;if(r===t)return s;r<t?n=s+1:o=s-1}return-n-1}function Tt(e,t){let n=0,o=e.length-1;for(;n<=o;){const s=n+o>>>1,r=e[s];if(r===t)return s;r<t?n=s+1:o=s-1}return-n-1}function Ot(e,t){let n,o=0,s=e.length-1;for(;o<=s;){const r=o+s>>>1;n=e[r];const i=n.start;if(i===t)return n;i<t?o=r+1:s=r-1}if(o>0)return n=e[o-1],t>n.end?0:n}function kt(e,t){this.font=e,this.tableName=t}kt.prototype={searchTag:Ut,binSearch:Tt,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 o=e.scripts[n].tag;if("DFLT"===o)return o;"latn"===o&&(t=!0)}return t?"latn":void 0},getScriptTable:function(e,t){const n=this.getTable(t);if(n){e=e||"DFLT";const o=n.scripts,s=Ut(n.scripts,e);if(s>=0)return o[s].script;if(t){const t={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return o.splice(-1-s,0,t),t.script}}},getLangSysTable:function(e,t,n){const o=this.getScriptTable(e,n);if(o){if(!t||"dflt"===t||"DFLT"===t)return o.defaultLangSys;const e=Ut(o.langSysRecords,t);if(e>=0)return o.langSysRecords[e].langSys;if(n){const n={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return o.langSysRecords.splice(-1-e,0,n),n.langSys}}},getFeatureTable:function(e,t,n,o){const s=this.getLangSysTable(e,t,o);if(s){let e;const t=s.featureIndexes,r=this.font.tables[this.tableName].features;for(let o=0;o<t.length;o++)if(e=r[t[o]],e.tag===n)return e.feature;if(o){const o=r.length;return h.assert(0===o||n>=r[o-1].tag,"Features must be added in alphabetical order."),e={tag:n,feature:{params:0,lookupListIndexes:[]}},r.push(e),t.push(o),e.feature}}},getLookupTables:function(e,t,n,o,s){const r=this.getFeatureTable(e,t,n,s),i=[];if(r){let e;const t=r.lookupListIndexes,n=this.font.tables[this.tableName].lookups;for(let s=0;s<t.length;s++)e=n[t[s]],e.lookupType===o&&i.push(e);if(0===i.length&&s){e={lookupType:o,lookupFlag:0,subtables:[],markFilteringSet:void 0};const s=n.length;return n.push(e),t.push(s),[e]}}return i},getGlyphClass:function(e,t){switch(e.format){case 1:return e.startGlyph<=t&&t<e.startGlyph+e.classes.length?e.classes[t-e.startGlyph]:0;case 2:const n=Ot(e.ranges,t);return n?n.classId:0}},getCoverageIndex:function(e,t){switch(e.format){case 1:const n=Tt(e.glyphs,t);return n>=0?n:-1;case 2:const o=Ot(e.ranges,t);return o?o.index+t-o.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 o=n[e],s=o.start,r=o.end;for(let e=s;e<=r;e++)t.push(e)}return t}}};const wt=kt;function Et(e){wt.call(this,e,"gpos")}Et.prototype=wt.prototype,Et.prototype.getKerningValue=function(e,t,n){for(let o=0;o<e.length;o++){const s=e[o].subtables;for(let e=0;e<s.length;e++){const o=s[e],r=this.getCoverageIndex(o.coverage,t);if(!(r<0))switch(o.posFormat){case 1:let e=o.pairSets[r];for(let t=0;t<e.length;t++){let o=e[t];if(o.secondGlyph===n)return o.value1&&o.value1.xAdvance||0}break;case 2:const s=this.getGlyphClass(o.classDef1,t),i=this.getGlyphClass(o.classDef2,n),a=o.classRecords[s][i];return a.value1&&a.value1.xAdvance||0}}}return 0},Et.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,"kern",2)};const Rt=Et;function Lt(e){wt.call(this,e,"gsub")}function Dt(e,t){const n=e.length;if(n!==t.length)return!1;for(let o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}function Ct(e,t,n){const o=e.subtables;for(let e=0;e<o.length;e++){const n=o[e];if(n.substFormat===t)return n}if(n)return o.push(n),n}Lt.prototype=wt.prototype,Lt.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},Lt.prototype.getSingle=function(e,t,n){const o=[],s=this.getLookupTables(t,n,e,1);for(let e=0;e<s.length;e++){const t=s[e].subtables;for(let e=0;e<t.length;e++){const n=t[e],s=this.expandCoverage(n.coverage);let r;if(1===n.substFormat){const e=n.deltaGlyphId;for(r=0;r<s.length;r++){const t=s[r];o.push({sub:t,by:t+e})}}else{const e=n.substitute;for(r=0;r<s.length;r++)o.push({sub:s[r],by:e[r]})}}}return o},Lt.prototype.getAlternates=function(e,t,n){const o=[],s=this.getLookupTables(t,n,e,3);for(let e=0;e<s.length;e++){const t=s[e].subtables;for(let e=0;e<t.length;e++){const n=t[e],s=this.expandCoverage(n.coverage),r=n.alternateSets;for(let e=0;e<s.length;e++)o.push({sub:s[e],by:r[e]})}}return o},Lt.prototype.getLigatures=function(e,t,n){const o=[],s=this.getLookupTables(t,n,e,4);for(let e=0;e<s.length;e++){const t=s[e].subtables;for(let e=0;e<t.length;e++){const n=t[e],s=this.expandCoverage(n.coverage),r=n.ligatureSets;for(let e=0;e<s.length;e++){const t=s[e],n=r[e];for(let e=0;e<n.length;e++){const s=n[e];o.push({sub:[t].concat(s.components),by:s.ligGlyph})}}}}return o},Lt.prototype.addSingle=function(e,t,n,o){const s=Ct(this.getLookupTables(n,o,e,1,!0)[0],2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});h.assert(1===s.coverage.format,"Ligature: unable to modify coverage table format "+s.coverage.format);const r=t.sub;let i=this.binSearch(s.coverage.glyphs,r);i<0&&(i=-1-i,s.coverage.glyphs.splice(i,0,r),s.substitute.splice(i,0,0)),s.substitute[i]=t.by},Lt.prototype.addAlternate=function(e,t,n,o){const s=Ct(this.getLookupTables(n,o,e,3,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});h.assert(1===s.coverage.format,"Ligature: unable to modify coverage table format "+s.coverage.format);const r=t.sub;let i=this.binSearch(s.coverage.glyphs,r);i<0&&(i=-1-i,s.coverage.glyphs.splice(i,0,r),s.alternateSets.splice(i,0,0)),s.alternateSets[i]=t.by},Lt.prototype.addLigature=function(e,t,n,o){const s=this.getLookupTables(n,o,e,4,!0)[0];let r=s.subtables[0];r||(r={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},s.subtables[0]=r),h.assert(1===r.coverage.format,"Ligature: unable to modify coverage table format "+r.coverage.format);const i=t.sub[0],a=t.sub.slice(1),l={ligGlyph:t.by,components:a};let u=this.binSearch(r.coverage.glyphs,i);if(u>=0){const e=r.ligatureSets[u];for(let t=0;t<e.length;t++)if(Dt(e[t].components,a))return;e.push(l)}else u=-1-u,r.coverage.glyphs.splice(u,0,i),r.ligatureSets.splice(u,0,[l])},Lt.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)}},Lt.prototype.add=function(e,t,n,o){if(/ss\d\d/.test(e))return this.addSingle(e,t,n,o);switch(e){case"aalt":case"salt":return"number"==typeof t.by?this.addSingle(e,t,n,o):this.addAlternate(e,t,n,o);case"dlig":case"liga":case"rlig":return this.addLigature(e,t,n,o)}};const It=Lt;function Mt(e){const t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let t=0;t<e.length;++t)n[t]=e[t];return t}function Gt(e,t){if(!e)throw t}let At,Pt,Bt,Nt;function Ft(e){this.font=e,this._fpgmState=this._prepState=void 0,this._errorState=0}function _t(e){return e}function Ht(e){return Math.sign(e)*Math.round(Math.abs(e))}function zt(e){return Math.sign(e)*Math.round(Math.abs(2*e))/2}function Wt(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function qt(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function jt(e){return Math.sign(e)*Math.floor(Math.abs(e))}const Xt=function(e){const t=this.srPeriod;let n=this.srPhase,o=1;return e<0&&(e=-e,o=-1),e+=this.srThreshold-n,e=Math.trunc(e/t)*t,(e+=n)<0?n*o:e*o},Vt={x:1,y:0,axis:"x",distance:function(e,t,n,o){return(n?e.xo:e.x)-(o?t.xo:t.x)},interpolate:function(e,t,n,o){let s,r,i,a,l,u,c;if(!o||o===this)return s=e.xo-t.xo,r=e.xo-n.xo,l=t.x-t.xo,u=n.x-n.xo,i=Math.abs(s),a=Math.abs(r),c=i+a,0===c?void(e.x=e.xo+(l+u)/2):void(e.x=e.xo+(l*a+u*i)/c);s=o.distance(e,t,!0,!0),r=o.distance(e,n,!0,!0),l=o.distance(t,t,!1,!0),u=o.distance(n,n,!1,!0),i=Math.abs(s),a=Math.abs(r),c=i+a,0!==c?Vt.setRelative(e,e,(l*a+u*i)/c,o,!0):Vt.setRelative(e,e,(l+u)/2,o,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,n,o,s){if(!o||o===this)return void(e.x=(s?t.xo:t.x)+n);const r=s?t.xo:t.x,i=s?t.yo:t.y,a=r+n*o.x,l=i+n*o.y;e.x=a+(e.y-l)/o.normalSlope},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},Yt={x:0,y:1,axis:"y",distance:function(e,t,n,o){return(n?e.yo:e.y)-(o?t.yo:t.y)},interpolate:function(e,t,n,o){let s,r,i,a,l,u,c;if(!o||o===this)return s=e.yo-t.yo,r=e.yo-n.yo,l=t.y-t.yo,u=n.y-n.yo,i=Math.abs(s),a=Math.abs(r),c=i+a,0===c?void(e.y=e.yo+(l+u)/2):void(e.y=e.yo+(l*a+u*i)/c);s=o.distance(e,t,!0,!0),r=o.distance(e,n,!0,!0),l=o.distance(t,t,!1,!0),u=o.distance(n,n,!1,!0),i=Math.abs(s),a=Math.abs(r),c=i+a,0!==c?Yt.setRelative(e,e,(l*a+u*i)/c,o,!0):Yt.setRelative(e,e,(l+u)/2,o,!0)},normalSlope:0,setRelative:function(e,t,n,o,s){if(!o||o===this)return void(e.y=(s?t.yo:t.y)+n);const r=s?t.xo:t.x,i=s?t.yo:t.y,a=r+n*o.x,l=i+n*o.y;e.y=l+o.normalSlope*(e.x-a)},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};function Zt(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}function Qt(e,t){const n=Math.sqrt(e*e+t*t);return t/=n,1===(e/=n)&&0===t?Vt:0===e&&1===t?Yt:new Zt(e,t)}function Jt(e,t,n,o){this.x=this.xo=Math.round(64*e)/64,this.y=this.yo=Math.round(64*t)/64,this.lastPointOfContour=n,this.onCurve=o,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Object.freeze(Vt),Object.freeze(Yt),Zt.prototype.distance=function(e,t,n,o){return this.x*Vt.distance(e,t,n,o)+this.y*Yt.distance(e,t,n,o)},Zt.prototype.interpolate=function(e,t,n,o){let s,r,i,a,l,u,c;i=o.distance(e,t,!0,!0),a=o.distance(e,n,!0,!0),s=o.distance(t,t,!1,!0),r=o.distance(n,n,!1,!0),l=Math.abs(i),u=Math.abs(a),c=l+u,0!==c?this.setRelative(e,e,(s*u+r*l)/c,o,!0):this.setRelative(e,e,(s+r)/2,o,!0)},Zt.prototype.setRelative=function(e,t,n,o,s){o=o||this;const r=s?t.xo:t.x,i=s?t.yo:t.y,a=r+n*o.x,l=i+n*o.y,u=o.normalSlope,c=this.slope,p=e.x,h=e.y;e.x=(c*p-u*a+l-h)/(c-u),e.y=c*(e.x-p)+h},Zt.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0},Jt.prototype.nextTouched=function(e){let t=this.nextPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},Jt.prototype.prevTouched=function(e){let t=this.prevPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};const Kt=Object.freeze(new Jt(0,0)),$t={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function en(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=Vt,this.round=Ht}}function tn(e){const t=e.tZone=new Array(e.gZone.length);for(let e=0;e<t.length;e++)t[e]=new Jt(0,0)}function nn(e,t){const n=e.prog;let o,s=e.ip,r=1;do{if(o=n[++s],88===o)r++;else if(89===o)r--;else if(64===o)s+=n[s+1]+1;else if(65===o)s+=2*n[s+1]+1;else if(o>=176&&o<=183)s+=o-176+1;else if(o>=184&&o<=191)s+=2*(o-184+1);else if(t&&1===r&&27===o)break}while(r>0);e.ip=s}function on(e,t){exports.DEBUG&&console.log(t.step,"SVTCA["+e.axis+"]"),t.fv=t.pv=t.dpv=e}function sn(e,t){exports.DEBUG&&console.log(t.step,"SPVTCA["+e.axis+"]"),t.pv=t.dpv=e}function rn(e,t){exports.DEBUG&&console.log(t.step,"SFVTCA["+e.axis+"]"),t.fv=e}function an(e,t){const n=t.stack,o=n.pop(),s=n.pop(),r=t.z2[o],i=t.z1[s];let a,l;exports.DEBUG&&console.log("SPVTL["+e+"]",o,s),e?(a=r.y-i.y,l=i.x-r.x):(a=i.x-r.x,l=i.y-r.y),t.pv=t.dpv=Qt(a,l)}function ln(e,t){const n=t.stack,o=n.pop(),s=n.pop(),r=t.z2[o],i=t.z1[s];let a,l;exports.DEBUG&&console.log("SFVTL["+e+"]",o,s),e?(a=r.y-i.y,l=i.x-r.x):(a=i.x-r.x,l=i.y-r.y),t.fv=Qt(a,l)}function un(e){exports.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function cn(e,t){const n=t.stack.pop(),o=t.z0[n],s=t.fv,r=t.pv;exports.DEBUG&&console.log(t.step,"MDAP["+e+"]",n);let i=r.distance(o,Kt);e&&(i=t.round(i)),s.setRelative(o,Kt,i,r),s.touch(o),t.rp0=t.rp1=n}function pn(e,t){const n=t.z2,o=n.length-2;let s,r,i;exports.DEBUG&&console.log(t.step,"IUP["+e.axis+"]");for(let t=0;t<o;t++)s=n[t],e.touched(s)||(r=s.prevTouched(e),r!==s&&(i=s.nextTouched(e),r===i&&e.setRelative(s,s,e.distance(r,r,!1,!0),e,!0),e.interpolate(s,r,i,e)))}function hn(e,t){const n=t.stack,o=e?t.rp1:t.rp2,s=(e?t.z0:t.z1)[o],r=t.fv,i=t.pv;let a=t.loop;const l=t.z2;for(;a--;){const o=n.pop(),u=l[o],c=i.distance(s,s,!1,!0);r.setRelative(u,u,c,i),r.touch(u),exports.DEBUG&&console.log(t.step,(t.loop>1?"loop "+(t.loop-a)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",o)}t.loop=1}function fn(e,t){const n=t.stack,o=e?t.rp1:t.rp2,s=(e?t.z0:t.z1)[o],r=t.fv,i=t.pv,a=n.pop(),l=t.z2[t.contours[a]];let u=l;exports.DEBUG&&console.log(t.step,"SHC["+e+"]",a);const c=i.distance(s,s,!1,!0);do{u!==s&&r.setRelative(u,u,c,i),u=u.nextPointOnContour}while(u!==l)}function dn(e,t){const n=t.stack,o=e?t.rp1:t.rp2,s=(e?t.z0:t.z1)[o],r=t.fv,i=t.pv,a=n.pop();let l,u;switch(exports.DEBUG&&console.log(t.step,"SHZ["+e+"]",a),a){case 0:l=t.tZone;break;case 1:l=t.gZone;break;default:throw new Error("Invalid zone")}const c=i.distance(s,s,!1,!0),p=l.length-2;for(let e=0;e<p;e++)u=l[e],r.setRelative(u,u,c,i)}function gn(e,t){const n=t.stack,o=n.pop()/64,s=n.pop(),r=t.z1[s],i=t.z0[t.rp0],a=t.fv,l=t.pv;a.setRelative(r,i,o,l),a.touch(r),exports.DEBUG&&console.log(t.step,"MSIRP["+e+"]",o,s),t.rp1=t.rp0,t.rp2=s,e&&(t.rp0=s)}function yn(e,t){const n=t.stack,o=n.pop(),s=n.pop(),r=t.z0[s],i=t.fv,a=t.pv;let l=t.cvt[o];exports.DEBUG&&console.log(t.step,"MIAP["+e+"]",o,"(",l,")",s);let u=a.distance(r,Kt);e&&(Math.abs(u-l)<t.cvCutIn&&(u=l),u=t.round(u)),i.setRelative(r,Kt,u,a),0===t.zp0&&(r.xo=r.x,r.yo=r.y),i.touch(r),t.rp0=t.rp1=s}function mn(e,t){const n=t.stack,o=n.pop(),s=t.z2[o];exports.DEBUG&&console.log(t.step,"GC["+e+"]",o),n.push(64*t.dpv.distance(s,Kt,e,!1))}function vn(e,t){const n=t.stack,o=n.pop(),s=n.pop(),r=t.z1[o],i=t.z0[s],a=t.dpv.distance(i,r,e,e);exports.DEBUG&&console.log(t.step,"MD["+e+"]",o,s,"->",a),t.stack.push(Math.round(64*a))}function bn(e,t){const n=t.stack,o=n.pop(),s=t.fv,r=t.pv,i=t.ppem,a=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;exports.DEBUG&&console.log(t.step,"DELTAP["+e+"]",o,n);for(let e=0;e<o;e++){const e=n.pop(),o=n.pop();if(a+((240&o)>>4)!==i)continue;let c=(15&o)-8;c>=0&&c++,exports.DEBUG&&console.log(t.step,"DELTAPFIX",e,"by",c*l);const p=u[e];s.setRelative(p,p,c*l,r)}}function xn(e,t){const n=t.stack,o=n.pop();exports.DEBUG&&console.log(t.step,"ROUND[]"),n.push(64*t.round(o/64))}function Sn(e,t){const n=t.stack,o=n.pop(),s=t.ppem,r=t.deltaBase+16*(e-1),i=t.deltaShift;exports.DEBUG&&console.log(t.step,"DELTAC["+e+"]",o,n);for(let e=0;e<o;e++){const e=n.pop(),o=n.pop();if(r+((240&o)>>4)!==s)continue;let a=(15&o)-8;a>=0&&a++;const l=a*i;exports.DEBUG&&console.log(t.step,"DELTACFIX",e,"by",l),t.cvt[e]+=l}}function Un(e,t){const n=t.stack,o=n.pop(),s=n.pop(),r=t.z2[o],i=t.z1[s];let a,l;exports.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,s),e?(a=r.y-i.y,l=i.x-r.x):(a=i.x-r.x,l=i.y-r.y),t.dpv=Qt(a,l)}function Tn(e,t){const n=t.stack,o=t.prog;let s=t.ip;exports.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(let t=0;t<e;t++)n.push(o[++s]);t.ip=s}function On(e,t){let n=t.ip;const o=t.prog,s=t.stack;exports.DEBUG&&console.log(t.ip,"PUSHW["+e+"]");for(let t=0;t<e;t++){let e=o[++n]<<8|o[++n];32768&e&&(e=-(1+(65535^e))),s.push(e)}t.ip=n}function kn(e,t,n,o,s,r){const i=r.stack,a=e&&i.pop(),l=i.pop(),u=r.rp0,c=r.z0[u],p=r.z1[l],h=r.minDis,f=r.fv,d=r.dpv;let g,y,m,v;y=g=d.distance(p,c,!0,!0),m=y>=0?1:-1,y=Math.abs(y),e&&(v=r.cvt[a],o&&Math.abs(y-v)<r.cvCutIn&&(y=v)),n&&y<h&&(y=h),o&&(y=r.round(y)),f.setRelative(p,c,m*y,d),f.touch(p),exports.DEBUG&&console.log(r.step,(e?"MIRP[":"MDRP[")+(t?"M":"m")+(n?">":"_")+(o?"R":"_")+(0===s?"Gr":1===s?"Bl":2===s?"Wh":"")+"]",e?a+"("+r.cvt[a]+","+v+")":"",l,"(d =",g,"->",m*y,")"),r.rp1=r.rp0,r.rp2=l,t&&(r.rp0=l)}Ft.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 o=this._prepState;if(!o||o.ppem!==t){let e=this._fpgmState;if(!e){en.prototype=$t,e=this._fpgmState=new en("fpgm",n.tables.fpgm),e.funcs=[],e.font=n,exports.DEBUG&&(console.log("---EXEC FPGM---"),e.step=-1);try{Pt(e)}catch(e){return console.log("Hinting error in FPGM:"+e),void(this._errorState=3)}}en.prototype=e,o=this._prepState=new en("prep",n.tables.prep),o.ppem=t;const s=n.tables.cvt;if(s){const e=o.cvt=new Array(s.length),r=t/n.unitsPerEm;for(let t=0;t<s.length;t++)e[t]=s[t]*r}else o.cvt=[];exports.DEBUG&&(console.log("---EXEC PREP---"),o.step=-1);try{Pt(o)}catch(e){this._errorState<2&&console.log("Hinting error in PREP:"+e),this._errorState=2}}if(!(this._errorState>1))try{return Bt(e,o)}catch(e){return this._errorState<1&&(console.log("Hinting error:"+e),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}},Bt=function(e,t){const n=t.ppem/t.font.unitsPerEm,o=n;let s,r,i,a=e.components;if(en.prototype=t,a){const l=t.font;r=[],s=[];for(let e=0;e<a.length;e++){const t=a[e],u=l.glyphs.get(t.glyphIndex);i=new en("glyf",u.instructions),exports.DEBUG&&(console.log("---EXEC COMP "+e+"---"),i.step=-1),Nt(u,i,n,o);const c=Math.round(t.dx*n),p=Math.round(t.dy*o),h=i.gZone,f=i.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=r.length;r.push.apply(r,h);for(let e=0;e<f.length;e++)s.push(f[e]+d)}e.instructions&&!i.inhibitGridFit&&(i=new en("glyf",e.instructions),i.gZone=i.z0=i.z1=i.z2=r,i.contours=s,r.push(new Jt(0,0),new Jt(Math.round(e.advanceWidth*n),0)),exports.DEBUG&&(console.log("---EXEC COMPOSITE---"),i.step=-1),Pt(i),r.length-=2)}else i=new en("glyf",e.instructions),exports.DEBUG&&(console.log("---EXEC GLYPH---"),i.step=-1),Nt(e,i,n,o),r=i.gZone;return r},Nt=function(e,t,n,o){const s=e.points||[],r=s.length,i=t.gZone=t.z0=t.z1=t.z2=[],a=t.contours=[];let l,u,c;for(let e=0;e<r;e++)l=s[e],i[e]=new Jt(l.x*n,l.y*o,l.lastPointOfContour,l.onCurve);for(let e=0;e<r;e++)l=i[e],u||(u=l,a.push(e)),l.lastPointOfContour?(l.nextPointOnContour=u,u.prevPointOnContour=l,u=void 0):(c=i[e+1],l.nextPointOnContour=c,c.prevPointOnContour=l);if(!t.inhibitGridFit){if(exports.DEBUG){console.log("PROCESSING GLYPH",t.stack);for(let e=0;e<r;e++)console.log(e,i[e].x,i[e].y)}if(i.push(new Jt(0,0),new Jt(Math.round(e.advanceWidth*n),0)),Pt(t),i.length-=2,exports.DEBUG){console.log("FINISHED GLYPH",t.stack);for(let e=0;e<r;e++)console.log(e,i[e].x,i[e].y)}}},Pt=function(e){let t=e.prog;if(!t)return;const n=t.length;let o;for(e.ip=0;e.ip<n;e.ip++){if(exports.DEBUG&&e.step++,o=At[t[e.ip]],!o)throw new Error("unknown instruction: 0x"+Number(t[e.ip]).toString(16));o(e)}},At=[on.bind(void 0,Yt),on.bind(void 0,Vt),sn.bind(void 0,Yt),sn.bind(void 0,Vt),rn.bind(void 0,Yt),rn.bind(void 0,Vt),an.bind(void 0,0),an.bind(void 0,1),ln.bind(void 0,0),ln.bind(void 0,1),function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"SPVFS[]",n,o),e.pv=e.dpv=Qt(o,n)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"SPVFS[]",n,o),e.fv=Qt(o,n)},function(e){const t=e.stack,n=e.pv;exports.DEBUG&&console.log(e.step,"GPV[]"),t.push(16384*n.x),t.push(16384*n.y)},function(e){const t=e.stack,n=e.fv;exports.DEBUG&&console.log(e.step,"GFV[]"),t.push(16384*n.x),t.push(16384*n.y)},function(e){e.fv=e.pv,exports.DEBUG&&console.log(e.step,"SFVTPV[]")},function(e){const t=e.stack,n=t.pop(),o=t.pop(),s=t.pop(),r=t.pop(),i=t.pop(),a=e.z0,l=e.z1,u=a[n],c=a[o],p=l[s],h=l[r],f=e.z2[i];exports.DEBUG&&console.log("ISECT[], ",n,o,s,r,i);const d=u.x,g=u.y,y=c.x,m=c.y,v=p.x,b=p.y,x=h.x,S=h.y,U=(d-y)*(b-S)-(g-m)*(v-x),T=d*m-g*y,O=v*S-b*x;f.x=(T*(v-x)-O*(d-y))/U,f.y=(T*(b-S)-O*(g-m))/U},function(e){e.rp0=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP0[]",e.rp0)},function(e){e.rp1=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP1[]",e.rp1)},function(e){e.rp2=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP2[]",e.rp2)},function(e){const t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZP0[]",t),e.zp0=t,t){case 0:e.tZone||tn(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(exports.DEBUG&&console.log(e.step,"SZP1[]",t),e.zp1=t,t){case 0:e.tZone||tn(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(exports.DEBUG&&console.log(e.step,"SZP2[]",t),e.zp2=t,t){case 0:e.tZone||tn(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(exports.DEBUG&&console.log(e.step,"SZPS[]",t),e.zp0=e.zp1=e.zp2=t,t){case 0:e.tZone||tn(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(),exports.DEBUG&&console.log(e.step,"SLOOP[]",e.loop)},function(e){exports.DEBUG&&console.log(e.step,"RTG[]"),e.round=Ht},function(e){exports.DEBUG&&console.log(e.step,"RTHG[]"),e.round=Wt},function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SMD[]",t),e.minDis=t/64},function(e){exports.DEBUG&&console.log(e.step,"ELSE[]"),nn(e,!1)},function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"JMPR[]",t),e.ip+=t-1},function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCVTCI[]",t),e.cvCutIn=t/64},void 0,void 0,function(e){const t=e.stack;exports.DEBUG&&console.log(e.step,"DUP[]"),t.push(t[t.length-1])},un,function(e){exports.DEBUG&&console.log(e.step,"CLEAR[]"),e.stack.length=0},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"SWAP[]"),t.push(n),t.push(o)},function(e){const t=e.stack;exports.DEBUG&&console.log(e.step,"DEPTH[]"),t.push(t.length)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"CINDEX[]",n),t.push(t[t.length-n])},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"MINDEX[]",n),t.push(t.splice(t.length-n,1)[0])},void 0,void 0,void 0,function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"LOOPCALL[]",n,o);const s=e.ip,r=e.prog;e.prog=e.funcs[n];for(let t=0;t<o;t++)Pt(e),exports.DEBUG&&console.log(++e.step,t+1<o?"next loopcall":"done loopcall",t);e.ip=s,e.prog=r},function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"CALL[]",t);const n=e.ip,o=e.prog;e.prog=e.funcs[t],Pt(e),e.ip=n,e.prog=o,exports.DEBUG&&console.log(++e.step,"returning from",t)},function(e){if("fpgm"!==e.env)throw new Error("FDEF not allowed here");const t=e.stack,n=e.prog;let o=e.ip;const s=t.pop(),r=o;for(exports.DEBUG&&console.log(e.step,"FDEF[]",s);45!==n[++o];);e.ip=o,e.funcs[s]=n.slice(r+1,o)},void 0,cn.bind(void 0,0),cn.bind(void 0,1),pn.bind(void 0,Yt),pn.bind(void 0,Vt),hn.bind(void 0,0),hn.bind(void 0,1),fn.bind(void 0,0),fn.bind(void 0,1),dn.bind(void 0,0),dn.bind(void 0,1),function(e){const t=e.stack;let n=e.loop;const o=e.fv,s=t.pop()/64,r=e.z2;for(;n--;){const i=t.pop(),a=r[i];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-n)+": ":"")+"SHPIX[]",i,s),o.setRelative(a,a,s),o.touch(a)}e.loop=1},function(e){const t=e.stack,n=e.rp1,o=e.rp2;let s=e.loop;const r=e.z0[n],i=e.z1[o],a=e.fv,l=e.dpv,u=e.z2;for(;s--;){const c=t.pop(),p=u[c];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-s)+": ":"")+"IP[]",c,n,"<->",o),a.interpolate(p,r,i,l),a.touch(p)}e.loop=1},gn.bind(void 0,0),gn.bind(void 0,1),function(e){const t=e.stack,n=e.rp0,o=e.z0[n];let s=e.loop;const r=e.fv,i=e.pv,a=e.z1;for(;s--;){const n=t.pop(),l=a[n];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-s)+": ":"")+"ALIGNRP[]",n),r.setRelative(l,o,0,i),r.touch(l)}e.loop=1},function(e){exports.DEBUG&&console.log(e.step,"RTDG[]"),e.round=zt},yn.bind(void 0,0),yn.bind(void 0,1),function(e){const t=e.prog;let n=e.ip;const o=e.stack,s=t[++n];exports.DEBUG&&console.log(e.step,"NPUSHB[]",s);for(let e=0;e<s;e++)o.push(t[++n]);e.ip=n},function(e){let t=e.ip;const n=e.prog,o=e.stack,s=n[++t];exports.DEBUG&&console.log(e.step,"NPUSHW[]",s);for(let e=0;e<s;e++){let e=n[++t]<<8|n[++t];32768&e&&(e=-(1+(65535^e))),o.push(e)}e.ip=t},function(e){const t=e.stack;let n=e.store;n||(n=e.store=[]);const o=t.pop(),s=t.pop();exports.DEBUG&&console.log(e.step,"WS",o,s),n[s]=o},function(e){const t=e.stack,n=e.store,o=t.pop();exports.DEBUG&&console.log(e.step,"RS",o);const s=n&&n[o]||0;t.push(s)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"WCVTP",n,o),e.cvt[o]=n/64},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"RCVT",n),t.push(64*e.cvt[n])},mn.bind(void 0,0),mn.bind(void 0,1),void 0,vn.bind(void 0,0),vn.bind(void 0,1),function(e){exports.DEBUG&&console.log(e.step,"MPPEM[]"),e.stack.push(e.ppem)},void 0,function(e){exports.DEBUG&&console.log(e.step,"FLIPON[]"),e.autoFlip=!0},void 0,void 0,function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"LT[]",n,o),t.push(o<n?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"LTEQ[]",n,o),t.push(o<=n?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"GT[]",n,o),t.push(o>n?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"GTEQ[]",n,o),t.push(o>=n?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"EQ[]",n,o),t.push(n===o?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"NEQ[]",n,o),t.push(n!==o?1:0)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"ODD[]",n),t.push(Math.trunc(n)%2?1:0)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"EVEN[]",n),t.push(Math.trunc(n)%2?0:1)},function(e){let t=e.stack.pop();exports.DEBUG&&console.log(e.step,"IF[]",t),t||(nn(e,!0),exports.DEBUG&&console.log(e.step,"EIF[]"))},function(e){exports.DEBUG&&console.log(e.step,"EIF[]")},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"AND[]",n,o),t.push(n&&o?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"OR[]",n,o),t.push(n||o?1:0)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"NOT[]",n),t.push(n?0:1)},bn.bind(void 0,1),function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SDB[]",t),e.deltaBase=t},function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SDS[]",t),e.deltaShift=Math.pow(.5,t)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"ADD[]",n,o),t.push(o+n)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"SUB[]",n,o),t.push(o-n)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"DIV[]",n,o),t.push(64*o/n)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"MUL[]",n,o),t.push(o*n/64)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"ABS[]",n),t.push(Math.abs(n))},function(e){const t=e.stack;let n=t.pop();exports.DEBUG&&console.log(e.step,"NEG[]",n),t.push(-n)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"FLOOR[]",n),t.push(64*Math.floor(n/64))},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"CEILING[]",n),t.push(64*Math.ceil(n/64))},xn.bind(void 0,0),xn.bind(void 0,1),xn.bind(void 0,2),xn.bind(void 0,3),void 0,void 0,void 0,void 0,function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"WCVTF[]",n,o),e.cvt[o]=n*e.ppem/e.font.unitsPerEm},bn.bind(void 0,2),bn.bind(void 0,3),Sn.bind(void 0,1),Sn.bind(void 0,2),Sn.bind(void 0,3),function(e){let t,n=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SROUND[]",n),e.round=Xt,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(exports.DEBUG&&console.log(e.step,"S45ROUND[]",n),e.round=Xt,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){exports.DEBUG&&console.log(e.step,"ROFF[]"),e.round=_t},void 0,function(e){exports.DEBUG&&console.log(e.step,"RUTG[]"),e.round=qt},function(e){exports.DEBUG&&console.log(e.step,"RDTG[]"),e.round=jt},un,un,void 0,void 0,void 0,void 0,void 0,function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANCTRL[]",t)},Un.bind(void 0,0),Un.bind(void 0,1),function(e){const t=e.stack,n=t.pop();let o=0;exports.DEBUG&&console.log(e.step,"GETINFO[]",n),1&n&&(o=35),32&n&&(o|=4096),t.push(o)},void 0,function(e){const t=e.stack,n=t.pop(),o=t.pop(),s=t.pop();exports.DEBUG&&console.log(e.step,"ROLL[]"),t.push(o),t.push(n),t.push(s)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"MAX[]",n,o),t.push(Math.max(o,n))},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"MIN[]",n,o),t.push(Math.min(o,n))},function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANTYPE[]",t)},function(e){const t=e.stack.pop();let n=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"INSTCTRL[]",t,n),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,Tn.bind(void 0,1),Tn.bind(void 0,2),Tn.bind(void 0,3),Tn.bind(void 0,4),Tn.bind(void 0,5),Tn.bind(void 0,6),Tn.bind(void 0,7),Tn.bind(void 0,8),On.bind(void 0,1),On.bind(void 0,2),On.bind(void 0,3),On.bind(void 0,4),On.bind(void 0,5),On.bind(void 0,6),On.bind(void 0,7),On.bind(void 0,8),kn.bind(void 0,0,0,0,0,0),kn.bind(void 0,0,0,0,0,1),kn.bind(void 0,0,0,0,0,2),kn.bind(void 0,0,0,0,0,3),kn.bind(void 0,0,0,0,1,0),kn.bind(void 0,0,0,0,1,1),kn.bind(void 0,0,0,0,1,2),kn.bind(void 0,0,0,0,1,3),kn.bind(void 0,0,0,1,0,0),kn.bind(void 0,0,0,1,0,1),kn.bind(void 0,0,0,1,0,2),kn.bind(void 0,0,0,1,0,3),kn.bind(void 0,0,0,1,1,0),kn.bind(void 0,0,0,1,1,1),kn.bind(void 0,0,0,1,1,2),kn.bind(void 0,0,0,1,1,3),kn.bind(void 0,0,1,0,0,0),kn.bind(void 0,0,1,0,0,1),kn.bind(void 0,0,1,0,0,2),kn.bind(void 0,0,1,0,0,3),kn.bind(void 0,0,1,0,1,0),kn.bind(void 0,0,1,0,1,1),kn.bind(void 0,0,1,0,1,2),kn.bind(void 0,0,1,0,1,3),kn.bind(void 0,0,1,1,0,0),kn.bind(void 0,0,1,1,0,1),kn.bind(void 0,0,1,1,0,2),kn.bind(void 0,0,1,1,0,3),kn.bind(void 0,0,1,1,1,0),kn.bind(void 0,0,1,1,1,1),kn.bind(void 0,0,1,1,1,2),kn.bind(void 0,0,1,1,1,3),kn.bind(void 0,1,0,0,0,0),kn.bind(void 0,1,0,0,0,1),kn.bind(void 0,1,0,0,0,2),kn.bind(void 0,1,0,0,0,3),kn.bind(void 0,1,0,0,1,0),kn.bind(void 0,1,0,0,1,1),kn.bind(void 0,1,0,0,1,2),kn.bind(void 0,1,0,0,1,3),kn.bind(void 0,1,0,1,0,0),kn.bind(void 0,1,0,1,0,1),kn.bind(void 0,1,0,1,0,2),kn.bind(void 0,1,0,1,0,3),kn.bind(void 0,1,0,1,1,0),kn.bind(void 0,1,0,1,1,1),kn.bind(void 0,1,0,1,1,2),kn.bind(void 0,1,0,1,1,3),kn.bind(void 0,1,1,0,0,0),kn.bind(void 0,1,1,0,0,1),kn.bind(void 0,1,1,0,0,2),kn.bind(void 0,1,1,0,0,3),kn.bind(void 0,1,1,0,1,0),kn.bind(void 0,1,1,0,1,1),kn.bind(void 0,1,1,0,1,2),kn.bind(void 0,1,1,0,1,3),kn.bind(void 0,1,1,1,0,0),kn.bind(void 0,1,1,1,0,1),kn.bind(void 0,1,1,1,0,2),kn.bind(void 0,1,1,1,0,3),kn.bind(void 0,1,1,1,1,0),kn.bind(void 0,1,1,1,1,1),kn.bind(void 0,1,1,1,1,2),kn.bind(void 0,1,1,1,1,3)];const wn=Ft;function En(e){(e=e||{}).empty||(Gt(e.familyName,"When creating a new Font object, familyName is required."),Gt(e.styleName,"When creating a new Font object, styleName is required."),Gt(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Gt(e.ascender,"When creating a new Font object, ascender is required."),Gt(e.descender,"When creating a new Font object, descender is required."),Gt(e.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||e.familyName+e.styleName},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables={os2:{usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new pe.GlyphSet(this,e.glyphs||[]),this.encoding=new Q(this),this.position=new Rt(this),this.substitution=new It(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new wn(this):void 0}})}En.prototype.hasChar=function(e){return null!==this.encoding.charToGlyphIndex(e)},En.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},En.prototype.charToGlyph=function(e){const t=this.charToGlyphIndex(e);let n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},En.prototype.stringToGlyphs=function(e,t){t=t||this.defaultRenderOptions;const n=[];for(let t=0;t<e.length;t+=1){const o=e[t];n.push(this.charToGlyphIndex(o))}let o=n.length;if(t.features){const e=t.script||this.substitution.getDefaultScriptName();let s=[];t.features.liga&&(s=s.concat(this.substitution.getFeature("liga",e,t.language))),t.features.rlig&&(s=s.concat(this.substitution.getFeature("rlig",e,t.language)));for(let e=0;e<o;e+=1)for(let t=0;t<s.length;t++){const r=s[t],i=r.sub,a=i.length;let l=0;for(;l<a&&i[l]===n[e+l];)l++;l===a&&(n.splice(e,a,r.by),o=o-a+1)}}const s=new Array(o),r=this.glyphs.get(0);for(let e=0;e<o;e+=1)s[e]=this.glyphs.get(n[e])||r;return s},En.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},En.prototype.nameToGlyph=function(e){const t=this.nameToGlyphIndex(e);let n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},En.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},En.prototype.getKerningValue=function(e,t){return e=e.index||e,t=t.index||t,this.kerningPairs[e+","+t]||0},En.prototype.defaultRenderOptions={kerning:!0,features:{liga:!0,rlig:!0}},En.prototype.forEachGlyph=function(e,t,n,o,s,r){t=void 0!==t?t:0,n=void 0!==n?n:0,o=void 0!==o?o:72,s=s||this.defaultRenderOptions;const i=1/this.unitsPerEm*o,a=this.stringToGlyphs(e,s);let l;if(s.kerning){const e=s.script||this.position.getDefaultScriptName();l=this.position.getKerningTables(e,s.language)}for(let e=0;e<a.length;e+=1){const u=a[e];r.call(this,u,t,n,o,s),u.advanceWidth&&(t+=u.advanceWidth*i),s.kerning&&e<a.length-1&&(t+=(l?this.position.getKerningValue(l,u.index,a[e+1].index):this.getKerningValue(u,a[e+1]))*i),s.letterSpacing?t+=s.letterSpacing*o:s.tracking&&(t+=s.tracking/1e3*o)}return t},En.prototype.getPath=function(e,t,n,o,s){const r=new u;return this.forEachGlyph(e,t,n,o,s,function(e,t,n,o){const i=e.getPath(t,n,o,s,this);r.extend(i)}),r},En.prototype.getPaths=function(e,t,n,o,s){const r=[];return this.forEachGlyph(e,t,n,o,s,function(e,t,n,o){const i=e.getPath(t,n,o,s,this);r.push(i)}),r},En.prototype.getAdvanceWidth=function(e,t,n){return this.forEachGlyph(e,0,0,t,n,function(){})},En.prototype.draw=function(e,t,n,o,s,r){this.getPath(t,n,o,s,r).draw(e)},En.prototype.drawPoints=function(e,t,n,o,s,r){this.forEachGlyph(t,n,o,s,r,function(t,n,o,s){t.drawPoints(e,n,o,s)})},En.prototype.drawMetrics=function(e,t,n,o,s,r){this.forEachGlyph(t,n,o,s,r,function(t,n,o,s){t.drawMetrics(e,n,o,s)})},En.prototype.getEnglishName=function(e){const t=this.names[e];if(t)return t.en},En.prototype.validate=function(){const e=[],t=this;function n(t,n){t||e.push(n)}function o(e){const o=t.getEnglishName(e);n(o&&o.trim().length>0,"No English "+e+" specified.")}o("fontFamily"),o("weightName"),o("manufacturer"),o("copyright"),o("version"),n(this.unitsPerEm>0,"No unitsPerEm specified.")},En.prototype.toTables=function(){return St(this)},En.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},En.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},En.prototype.download=function(e){const t=this.getEnglishName("fontFamily"),o=this.getEnglishName("fontSubfamily");e=e||t.replace(/\s/g,"")+"-"+o+".otf";const s=this.toArrayBuffer();if("undefined"!=typeof window)window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem,window.requestFileSystem(window.TEMPORARY,s.byteLength,function(t){t.root.getFile(e,{create:!0},function(e){e.createWriter(function(t){const n=new DataView(s),o=new Blob([n],{type:"font/opentype"});t.write(o),t.addEventListener("writeend",function(){location.href=e.toURL()},!1)})})},function(e){throw new Error(e.name+": "+e.message)});else{const t=n(383),o=function(e){const t=new Buffer(e.byteLength),n=new Uint8Array(e);for(let e=0;e<t.length;++e)t[e]=n[e];return t}(s);t.writeFileSync(e,o)}},En.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},En.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},En.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};const Rn=En;function Ln(e,t,n){const o={},s=new z.Parser(e,t);return o.tag=s.parseTag(),o.minValue=s.parseFixed(),o.defaultValue=s.parseFixed(),o.maxValue=s.parseFixed(),s.skip("uShort",1),o.name=n[s.parseUShort()]||{},o}function Dn(e,t,n,o){const s={},r=new z.Parser(e,t);s.name=o[r.parseUShort()]||{},r.skip("uShort",1),s.coordinates={};for(let e=0;e<n.length;++e)s.coordinates[n[e].tag]=r.parseFixed();return s}const Cn=function(e,t,n){const o=new z.Parser(e,t),s=o.parseULong();h.argument(65536===s,"Unsupported fvar table version.");const r=o.parseOffset16();o.skip("uShort",1);const i=o.parseUShort(),a=o.parseUShort(),l=o.parseUShort(),u=o.parseUShort(),c=[];for(let o=0;o<i;o++)c.push(Ln(e,t+r+o*a,n));const p=[],f=t+r+i*a;for(let t=0;t<l;t++)p.push(Dn(e,f+t*u,c,n));return{axes:c,instances:p}},In=new Array(10);In[1]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{posFormat:1,coverage:this.parsePointer(_.coverage),value:this.parseValueRecord()}:2===t?{posFormat:2,coverage:this.parsePointer(_.coverage),values:this.parseValueRecordList()}:void h.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},In[2]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort(),n=this.parsePointer(_.coverage),o=this.parseUShort(),s=this.parseUShort();if(1===t)return{posFormat:t,coverage:n,valueFormat1:o,valueFormat2:s,pairSets:this.parseList(_.pointer(_.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(o),value2:this.parseValueRecord(s)}})))};if(2===t){const e=this.parsePointer(_.classDef),r=this.parsePointer(_.classDef),i=this.parseUShort(),a=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:o,valueFormat2:s,classDef1:e,classDef2:r,class1Count:i,class2Count:a,classRecords:this.parseList(i,_.list(a,function(){return{value1:this.parseValueRecord(o),value2:this.parseValueRecord(s)}}))}}h.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.")},In[3]=function(){return{error:"GPOS Lookup 3 not supported"}},In[4]=function(){return{error:"GPOS Lookup 4 not supported"}},In[5]=function(){return{error:"GPOS Lookup 5 not supported"}},In[6]=function(){return{error:"GPOS Lookup 6 not supported"}},In[7]=function(){return{error:"GPOS Lookup 7 not supported"}},In[8]=function(){return{error:"GPOS Lookup 8 not supported"}},In[9]=function(){return{error:"GPOS Lookup 9 not supported"}};new Array(10);const Mn=function(e,t){const n=new _(e,t=t||0),o=n.parseVersion(1);return h.argument(1===o||1.1===o,"Unsupported GPOS table version "+o),1===o?{version:o,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(In)}:{version:o,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(In),variations:n.parseFeatureVariationsList()}},Gn=function(e,t){const n=new z.Parser(e,t),o=n.parseUShort();if(0===o)return function(e){const t={};e.skip("uShort");const n=e.parseUShort();h.argument(0===n,"Unsupported kern sub-table version."),e.skip("uShort",2);const o=e.parseUShort();e.skip("uShort",3);for(let n=0;n<o;n+=1){const n=e.parseUShort(),o=e.parseUShort(),s=e.parseShort();t[n+","+o]=s}return t}(n);if(1===o)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 o=0;o<n;o+=1){const n=e.parseUShort(),o=e.parseUShort(),s=e.parseShort();t[n+","+o]=s}}return t}(n);throw new Error("Unsupported kern table version ("+o+").")},An=function(e,t,n,o){const s=new z.Parser(e,t),r=o?s.parseUShort:s.parseULong,i=[];for(let e=0;e<n+1;e+=1){let e=r.call(s);o&&(e*=2),i.push(e)}return i};function Pn(e,t){n(383).readFile(e,function(e,n){if(e)return t(e.message);t(null,Mt(n))})}function Bn(e,t){const n=new XMLHttpRequest;n.open("get",e,!0),n.responseType="arraybuffer",n.onload=function(){return n.response?t(null,n.response):t("Font could not be loaded: "+n.statusText)},n.onerror=function(){t("Font could not be loaded")},n.send()}function Nn(e,t){const n=[];let o=12;for(let s=0;s<t;s+=1){const t=z.getTag(e,o),s=z.getULong(e,o+4),r=z.getULong(e,o+8),i=z.getULong(e,o+12);n.push({tag:t,checksum:s,offset:r,length:i,compression:!1}),o+=16}return n}function Fn(e,t){if("WOFF"===t.compression){const n=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),o=new Uint8Array(t.length);if(s()(n,o),o.byteLength!==t.length)throw new Error("Decompression error: "+t.tag+" decompressed length doesn't match recorded length");return{data:new DataView(o.buffer,0),offset:0}}return{data:e,offset:t.offset}}function _n(e){let t,n;const o=new Rn({empty:!0}),s=new DataView(e,0);let r,i=[];const a=z.getTag(s,0);if(a===String.fromCharCode(0,1,0,0)||"true"===a||"typ1"===a)o.outlinesFormat="truetype",r=z.getUShort(s,4),i=Nn(s,r);else if("OTTO"===a)o.outlinesFormat="cff",r=z.getUShort(s,4),i=Nn(s,r);else{if("wOFF"!==a)throw new Error("Unsupported OpenType signature "+a);{const e=z.getTag(s,4);if(e===String.fromCharCode(0,1,0,0))o.outlinesFormat="truetype";else{if("OTTO"!==e)throw new Error("Unsupported OpenType flavor "+a);o.outlinesFormat="cff"}r=z.getUShort(s,12),i=function(e,t){const n=[];let o=44;for(let s=0;s<t;s+=1){const t=z.getTag(e,o),s=z.getULong(e,o+4),r=z.getULong(e,o+8),i=z.getULong(e,o+12);let a;a=r<i&&"WOFF",n.push({tag:t,offset:s,compression:a,compressedLength:r,length:i}),o+=20}return n}(s,r)}}let l,u,c,p,h,f,d,g,y,m,v;for(let e=0;e<r;e+=1){const r=i[e];let a;switch(r.tag){case"cmap":a=Fn(s,r),o.tables.cmap=q(a.data,a.offset),o.encoding=new J(o.tables.cmap);break;case"cvt ":a=Fn(s,r),v=new z.Parser(a.data,a.offset),o.tables.cvt=v.parseShortList(r.length/2);break;case"fvar":u=r;break;case"fpgm":a=Fn(s,r),v=new z.Parser(a.data,a.offset),o.tables.fpgm=v.parseByteList(r.length);break;case"head":a=Fn(s,r),o.tables.head=Ie(a.data,a.offset),o.unitsPerEm=o.tables.head.unitsPerEm,t=o.tables.head.indexToLocFormat;break;case"hhea":a=Fn(s,r),o.tables.hhea=Ge(a.data,a.offset),o.ascender=o.tables.hhea.ascender,o.descender=o.tables.hhea.descender,o.numberOfHMetrics=o.tables.hhea.numberOfHMetrics;break;case"hmtx":f=r;break;case"ltag":a=Fn(s,r),n=Fe(a.data,a.offset);break;case"maxp":a=Fn(s,r),o.tables.maxp=_e(a.data,a.offset),o.numGlyphs=o.tables.maxp.numGlyphs;break;case"name":y=r;break;case"OS/2":a=Fn(s,r),o.tables.os2=ot(a.data,a.offset);break;case"post":a=Fn(s,r),o.tables.post=it(a.data,a.offset),o.glyphNames=new $(o.tables.post);break;case"prep":a=Fn(s,r),v=new z.Parser(a.data,a.offset),o.tables.prep=v.parseByteList(r.length);break;case"glyf":c=r;break;case"loca":g=r;break;case"CFF ":l=r;break;case"kern":d=r;break;case"GPOS":p=r;break;case"GSUB":h=r;break;case"meta":m=r}}const b=Fn(s,y);if(o.tables.name=et(b.data,b.offset,n),o.names=o.tables.name,c&&g){const e=0===t,n=Fn(s,g),r=An(n.data,n.offset,o.numGlyphs,e),i=Fn(s,c);o.glyphs=ie.parse(i.data,i.offset,r,o)}else{if(!l)throw new Error("Font doesn't contain TrueType or CFF outlines.");{const e=Fn(s,l);De(e.data,e.offset,o)}}const x=Fn(s,f);if(Pe(x.data,x.offset,o.numberOfHMetrics,o.numGlyphs,o.glyphs),function(e){let t;const n=e.tables.cmap.glyphIndexMap,o=Object.keys(n);for(let s=0;s<o.length;s+=1){const r=o[s],i=n[r];t=e.glyphs.get(i),t.addUnicode(parseInt(r))}for(let n=0;n<e.glyphs.length;n+=1)t=e.glyphs.get(n),e.cffEncoding?e.isCIDFont?t.name="gid"+n:t.name=e.cffEncoding.charset[n]:e.glyphNames.names&&(t.name=e.glyphNames.glyphIndexToName(n))}(o),d){const e=Fn(s,d);o.kerningPairs=Gn(e.data,e.offset)}else o.kerningPairs={};if(p){const e=Fn(s,p);o.tables.gpos=Mn(e.data,e.offset)}if(h){const e=Fn(s,h);o.tables.gsub=pt(e.data,e.offset)}if(u){const e=Fn(s,u);o.tables.fvar=Cn(e.data,e.offset,o.names)}if(m){const e=Fn(s,m);o.tables.meta=ft(e.data,e.offset),o.metas=o.tables.meta}return o}function Hn(e,t){("undefined"==typeof window?Pn:Bn)(e,function(e,n){if(e)return t(e);let o;try{o=_n(n)}catch(e){return t(e,null)}return t(null,o)})}function zn(e){return _n(Mt(n(383).readFileSync(e)))}},694(e){function t(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function n(e,n){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=n,this.destLen=0,this.ltree=new t,this.dtree=new t}var o=new t,s=new t,r=new Uint8Array(30),i=new Uint16Array(30),a=new Uint8Array(30),l=new Uint16Array(30),u=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=new t,p=new Uint8Array(320);function h(e,t,n,o){var s,r;for(s=0;s<n;++s)e[s]=0;for(s=0;s<30-n;++s)e[s+n]=s/n|0;for(r=o,s=0;s<30;++s)t[s]=r,r+=1<<e[s]}var f=new Uint16Array(16);function d(e,t,n,o){var s,r;for(s=0;s<16;++s)e.table[s]=0;for(s=0;s<o;++s)e.table[t[n+s]]++;for(e.table[0]=0,r=0,s=0;s<16;++s)f[s]=r,r+=e.table[s];for(s=0;s<o;++s)t[n+s]&&(e.trans[f[t[n+s]]++]=s)}function g(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=1&e.tag;return e.tag>>>=1,t}function y(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var o=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,o+n}function m(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=0,o=0,s=0,r=e.tag;do{o=2*o+(1&r),r>>>=1,++s,n+=t.table[s],o-=t.table[s]}while(o>=0);return e.tag=r,e.bitcount-=s,t.trans[n+o]}function v(e,t,n){var o,s,r,i,a,l;for(o=y(e,5,257),s=y(e,5,1),r=y(e,4,4),i=0;i<19;++i)p[i]=0;for(i=0;i<r;++i){var h=y(e,3,0);p[u[i]]=h}for(d(c,p,0,19),a=0;a<o+s;){var f=m(e,c);switch(f){case 16:var g=p[a-1];for(l=y(e,2,3);l;--l)p[a++]=g;break;case 17:for(l=y(e,3,3);l;--l)p[a++]=0;break;case 18:for(l=y(e,7,11);l;--l)p[a++]=0;break;default:p[a++]=f}}d(t,p,0,o),d(n,p,o,s)}function b(e,t,n){for(;;){var o,s,u,c,p=m(e,t);if(256===p)return 0;if(p<256)e.dest[e.destLen++]=p;else for(o=y(e,r[p-=257],i[p]),s=m(e,n),c=u=e.destLen-y(e,a[s],l[s]);c<u+o;++c)e.dest[e.destLen++]=e.dest[c]}}function x(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(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}(o,s),h(r,i,4,3),h(a,l,2,1),r[28]=0,i[28]=258,e.exports=function(e,t){var r,i,a=new n(e,t);do{switch(r=g(a),y(a,2,0)){case 0:i=x(a);break;case 1:i=b(a,o,s);break;case 2:v(a,a.ltree,a.dtree),i=b(a,a.ltree,a.dtree);break;default:i=-3}if(0!==i)throw new Error("Data error")}while(!r);return a.destLen<a.dest.length?"function"==typeof a.dest.slice?a.dest.slice(0,a.destLen):a.dest.subarray(0,a.destLen):a.dest}},749(e,t,n){"use strict";const o=n(799),s=Symbol("max"),r=Symbol("length"),i=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),u=Symbol("dispose"),c=Symbol("noDisposeOnSet"),p=Symbol("lruList"),h=Symbol("cache"),f=Symbol("updateAgeOnGet"),d=()=>1,g=(e,t,n)=>{const o=e[h].get(t);if(o){const t=o.value;if(y(e,t)){if(v(e,o),!e[a])return}else n&&(e[f]&&(o.value.now=Date.now()),e[p].unshiftNode(o));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},m=e=>{if(e[r]>e[s])for(let t=e[p].tail;e[r]>e[s]&&null!==t;){const n=t.prev;v(e,t),t=n}},v=(e,t)=>{if(t){const n=t.value;e[u]&&e[u](n.key,n.value),e[r]-=n.length,e[h].delete(n.key),e[p].removeNode(t)}};class b{constructor(e,t,n,o,s){this.key=e,this.value=t,this.length=n,this.now=o,this.maxAge=s||0}}const x=(e,t,n,o)=>{let s=n.value;y(e,s)&&(v(e,n),e[a]||(s=void 0)),s&&t.call(o,s.value,s.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[s]=e.max||1/0;const t=e.length||d;if(this[i]="function"!=typeof t?d:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[u]=e.dispose,this[c]=e.noDisposeOnSet||!1,this[f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[s]=e||1/0,m(this)}get max(){return this[s]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,m(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=d),e!==this[i]&&(this[i]=e,this[r]=0,this[p].forEach(e=>{e.length=this[i](e.value,e.key),this[r]+=e.length})),m(this)}get lengthCalculator(){return this[i]}get length(){return this[r]}get itemCount(){return this[p].length}rforEach(e,t){t=t||this;for(let n=this[p].tail;null!==n;){const o=n.prev;x(this,e,n,t),n=o}}forEach(e,t){t=t||this;for(let n=this[p].head;null!==n;){const o=n.next;x(this,e,n,t),n=o}}keys(){return this[p].toArray().map(e=>e.key)}values(){return this[p].toArray().map(e=>e.value)}reset(){this[u]&&this[p]&&this[p].length&&this[p].forEach(e=>this[u](e.key,e.value)),this[h]=new Map,this[p]=new o,this[r]=0}dump(){return this[p].map(e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[p]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const o=n?Date.now():0,a=this[i](t,e);if(this[h].has(e)){if(a>this[s])return v(this,this[h].get(e)),!1;const i=this[h].get(e).value;return this[u]&&(this[c]||this[u](e,i.value)),i.now=o,i.maxAge=n,i.value=t,this[r]+=a-i.length,i.length=a,this.get(e),m(this),!0}const f=new b(e,t,a,o,n);return f.length>this[s]?(this[u]&&this[u](e,t),!1):(this[r]+=f.length,this[p].unshift(f),this[h].set(e,this[p].head),m(this),!0)}has(e){if(!this[h].has(e))return!1;const t=this[h].get(e).value;return!y(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[p].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[h].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const o=e[n],s=o.e||0;if(0===s)this.set(o.k,o.v);else{const e=s-t;e>0&&this.set(o.k,o.v,e)}}}prune(){this[h].forEach((e,t)=>g(this,t,!1))}}},792(e,t,n){"use strict";var o,s=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,s)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(o=function(e){return o=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},o(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=o(e),i=0;i<n.length;i++)"default"!==n[i]&&s(t,e,n[i]);return r(t,e),t}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){const o=[],s=(0,u.listGlyphsByIndex)(e.coverage);for(const{glyphId:r}of s){const s=(0,c.default)(e.inputClassDef,r);for(const[r,i]of s.entries()){if(null===i)continue;const s=e.chainClassSet[i];if(s)for(const[i,a]of s.entries()){const s={individual:{},range:[]};let l=(0,p.getInputTree)(s,a.lookupRecords,t,0,r).map(({entry:e,substitution:t})=>({entry:e,substitutions:[t]}));for(const[n,o]of a.input.entries())l=(0,p.processInputPosition)((0,c.listClassGlyphs)(e.inputClassDef,o),n+1,l,a.lookupRecords,t);for(const t of a.lookahead)l=(0,p.processLookaheadPosition)((0,c.listClassGlyphs)(e.lookaheadClassDef,t),l);for(const t of a.backtrack)l=(0,p.processBacktrackPosition)((0,c.listClassGlyphs)(e.backtrackClassDef,t),l);for(const{entry:e,substitutions:t}of l)e.lookup={substitutions:t,index:n,subIndex:i,length:a.input.length+1,contextRange:[-1*a.backtrack.length,1+a.input.length+a.lookahead.length]};o.push(s)}}}return(0,l.default)(o)};const l=a(n(975)),u=n(871),c=i(n(818)),p=n(393)},799(e,t,n){"use strict";function o(e){var t=this;if(t instanceof o||(t=new o),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var n=0,s=arguments.length;n<s;n++)t.push(arguments[n]);return t}function s(e,t,n){var o=t===e.head?new a(n,null,t,e):new a(n,t,t.next,e);return null===o.next&&(e.tail=o),null===o.prev&&(e.head=o),e.length++,o}function r(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function i(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,n,o){if(!(this instanceof a))return new a(e,t,n,o);this.list=o,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}e.exports=o,o.Node=a,o.create=o,o.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},o.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},o.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},o.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)r(this,arguments[e]);return this.length},o.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)i(this,arguments[e]);return this.length},o.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},o.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},o.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,o=0;null!==n;o++)e.call(t,n.value,o,this),n=n.next},o.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,o=this.length-1;null!==n;o--)e.call(t,n.value,o,this),n=n.prev},o.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},o.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},o.prototype.map=function(e,t){t=t||this;for(var n=new o,s=this.head;null!==s;)n.push(e.call(t,s.value,this)),s=s.next;return n},o.prototype.mapReverse=function(e,t){t=t||this;for(var n=new o,s=this.tail;null!==s;)n.push(e.call(t,s.value,this)),s=s.prev;return n},o.prototype.reduce=function(e,t){var n,o=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");o=this.head.next,n=this.head.value}for(var s=0;null!==o;s++)n=e(n,o.value,s),o=o.next;return n},o.prototype.reduceReverse=function(e,t){var n,o=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");o=this.tail.prev,n=this.tail.value}for(var s=this.length-1;null!==o;s--)n=e(n,o.value,s),o=o.prev;return n},o.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},o.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},o.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new o;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var s=0,r=this.head;null!==r&&s<e;s++)r=r.next;for(;null!==r&&s<t;s++,r=r.next)n.push(r.value);return n},o.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new o;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var s=this.length,r=this.tail;null!==r&&s>t;s--)r=r.prev;for(;null!==r&&s>e;s--,r=r.prev)n.push(r.value);return n},o.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var o=0,r=this.head;null!==r&&o<e;o++)r=r.next;var i=[];for(o=0;r&&o<t;o++)i.push(r.value),r=this.removeNode(r);for(null===r&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev),o=0;o<n.length;o++)r=s(this,r,n[o]);return i},o.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var o=n.prev;n.prev=n.next,n.next=o}return this.head=t,this.tail=e,this};try{n(259)(o)}catch(e){}},818(e,t){"use strict";function n(e,t){for(const n of e.ranges)if(n.start<=t&&n.end>=t)return n.classId;return null}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return 2===e.format?Array.isArray(t)?function(e,t){const o=t[0],s=n(e,o);let r=t[0]+1;const i=new Map;for(;r<t[1];)n(e,r)!==s&&(r-o<=1?i.set(o,s):i.set([o,r],s)),r++;return r-o<=1?i.set(o,s):i.set([o,r],s),i}(e,t):new Map([[t,n(e,t)]]):new Map([[t,null]])},t.listClassGlyphs=function(e,t){if(2===e.format){const n=[];for(const o of e.ranges)o.classId===t&&(o.end===o.start?n.push(o.start):n.push([o.start,o.end+1]));return n}return[]}},838(e,t){"use strict";function n(e,t){let n="",o=!1;for(;e.offset<e.input.length;){const r=e.input[e.offset++];if(o)/[\dA-Fa-f]/.test(r)?(e.offset--,n+=s(e)):"\n"!==r&&(n+=r),o=!1;else switch(r){case t:return n;case"\\":o=!0;break;default:n+=r}}throw new Error("Unterminated string")}function o(e){let t="",n=!1;for(;e.offset<e.input.length;){const o=e.input[e.offset++];if(n)/[\dA-Fa-f]/.test(o)?(e.offset--,t+=s(e)):t+=o,n=!1;else switch(o){case"\\":n=!0;break;case",":return t;default:/\s/.test(o)?t.endsWith(" ")||(t+=" "):t+=o}}return t}function s(e){let t="";for(;e.offset<e.input.length;){const n=e.input[e.offset++];if(/\s/.test(n))return r(t);if(t.length>=6||!/[\dA-Fa-f]/.test(n))return e.offset--,r(t);t+=n}return r(t)}function r(e){return String.fromCodePoint(parseInt(e,16))}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("string"!=typeof e)throw new Error("Font family must be a string");const t={input:e,offset:0},s=[];let r="";for(;t.offset<t.input.length;){const e=t.input[t.offset++];switch(e){case"'":case'"':r+=n(t,e);break;case",":s.push(r),r="";break;default:/\s/.test(e)||(t.offset--,r+=o(t),s.push(r),r="")}}return s}},871(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){switch(e.format){case 1:const n=e.glyphs.indexOf(t);return-1!==n?n:null;case 2:const o=e.ranges.find(e=>e.start<=t&&e.end>=t);return o?o.index:null}},t.listGlyphsByIndex=function(e){switch(e.format){case 1:return e.glyphs.map((e,t)=>({glyphId:e,index:t}));case 2:const t=[];for(const[n,o]of e.ranges.entries())o.end===o.start?t.push({glyphId:o.start,index:n}):t.push({glyphId:[o.start,o.end+1],index:n});return t}}},929(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){const r={individual:{},range:[]},i=(0,o.listGlyphsByIndex)(e.coverage);for(const{glyphId:o,index:a}of i){const i=e.chainRuleSets[a];if(i)for(const[e,a]of i.entries()){let i=(0,s.getInputTree)(r,a.lookupRecords,t,0,o).map(({entry:e,substitution:t})=>({entry:e,substitutions:[t]}));for(const[e,n]of a.input.entries())i=(0,s.processInputPosition)([n],e+1,i,a.lookupRecords,t);for(const e of a.lookahead)i=(0,s.processLookaheadPosition)([e],i);for(const e of a.backtrack)i=(0,s.processBacktrackPosition)([e],i);for(const{entry:t,substitutions:o}of i)t.lookup={substitutions:o,length:a.input.length+1,index:n,subIndex:e,contextRange:[-1*a.backtrack.length,1+a.input.length+a.lookahead.length]}}}return r};const o=n(871),s=n(393)},975(e,t){"use strict";function n(e,t,n){for(const[s,i]of Object.entries(t.individual))if(e.individual[s])o(e.individual[s],i,n);else{let t=!1;for(const[l,{range:u,entry:c}]of e.range.entries()){const p=r(Number(s),u);if(null!==p.both){t=!0,e.individual[s]=i,o(e.individual[s],a(c),n),e.range.splice(l,1);for(const t of p.second)Array.isArray(t)?e.range.push({range:t,entry:a(c)}):e.individual[t]=a(c)}}t||(e.individual[s]=i)}for(const{range:i,entry:l}of t.range){let t=[i];for(let i=0;i<e.range.length;i++){const{range:u,entry:c}=e.range[i];for(const[p,h]of t.entries()){if(!Array.isArray(h)){const s=r(h,u);if(null===s.both)continue;e.individual[h]=a(l),o(e.individual[h],a(c),n),e.range.splice(i,1),i--;for(const t of s.second)Array.isArray(t)?e.range.push({range:t,entry:a(c)}):e.individual[t]=a(c);t.splice(p,1,...s.first);break}{const r=s(h,u);if(null===r.both)continue;e.range.splice(i,1),i--;const p=a(c);Array.isArray(r.both)?e.range.push({range:r.both,entry:p}):e.individual[r.both]=p,o(p,a(l),n);for(const t of r.second)Array.isArray(t)?e.range.push({range:t,entry:a(c)}):e.individual[t]=a(c);t=r.first}}}for(const s of Object.keys(e.individual))for(const[i,u]of t.entries()){if(Array.isArray(u)){const c=r(Number(s),u);if(null===c.both)continue;o(e.individual[s],a(l),n),t.splice(i,1,...c.second);break}if(Number(s)===u){o(e.individual[s],a(l),n);break}}for(const n of t)Array.isArray(n)?e.range.push({range:n,entry:a(l)}):e.individual[n]=a(l)}}function o(e,t,o){let s=o.get(e);(null==s?void 0:s.has(t))||(s||(s=new Set,o.set(e,s)),s.add(t),t.lookup&&(!e.lookup||e.lookup.index>t.lookup.index||e.lookup.index===t.lookup.index&&e.lookup.subIndex>t.lookup.subIndex)&&(e.lookup=t.lookup),t.forward&&(e.forward?n(e.forward,t.forward,o):e.forward=t.forward),t.reverse&&(e.reverse?n(e.reverse,t.reverse,o):e.reverse=t.reverse))}function s(e,t){const n={first:[],second:[],both:null};if(e[0]<t[1]&&t[0]<e[1]){const o=Math.max(e[0],t[0]),s=Math.min(e[1],t[1]);n.both=i(o,s)}if(e[0]<t[0]){const o=e[0],s=Math.min(t[0],e[1]);n.first.push(i(o,s))}else if(t[0]<e[0]){const o=t[0],s=Math.min(t[1],e[0]);n.second.push(i(o,s))}if(e[1]>t[1]){const o=Math.max(e[0],t[1]),s=e[1];n.first.push(i(o,s))}else if(t[1]>e[1]){const o=Math.max(e[1],t[0]),s=t[1];n.second.push(i(o,s))}return n}function r(e,t){if(e<t[0]||e>t[1])return{first:[e],second:[t],both:null};const n={first:[],second:[],both:e};return t[0]<e&&n.second.push(i(t[0],e)),t[1]>e&&n.second.push(i(e+1,t[1])),n}function i(e,t){return t-e===1?e:[e,t]}function a(e,t=new Map){if(t.has(e))return t.get(e);const n={};return t.set(e,n),e.forward&&(n.forward=l(e.forward,t)),e.reverse&&(n.reverse=l(e.reverse,t)),e.lookup&&(n.lookup={contextRange:e.lookup.contextRange.slice(),index:e.lookup.index,length:e.lookup.length,subIndex:e.lookup.subIndex,substitutions:e.lookup.substitutions.slice()}),n}function l(e,t=new Map){const n={};for(const[o,s]of Object.entries(e.individual))n[o]=a(s,t);return{individual:n,range:e.range.map(({range:e,entry:n})=>({range:e.slice(),entry:a(n,t)}))}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t={individual:{},range:[]},o=new WeakMap;for(const s of e)n(t,s,o);return t}}},t={};function n(o){var s=t[o];if(void 0!==s)return s.exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.LigaturesAddon=void 0;const t=n(241);e.LigaturesAddon=class{_fallbackLigatures;_fontFeatureSettings;_terminal;_characterJoinerId;constructor(e){var t;this._fallbackLigatures=(null!==(t=null==e?void 0:e.fallbackLigatures)&&void 0!==t?t:["<--","<---","<<-","<-","->","->>","--\x3e","---\x3e","<==","<===","<<=","<=","=>","=>>","==>","===>",">=",">>=","<->","<--\x3e","<---\x3e","<----\x3e","<=>","<==>","<===>","<====>","::",":::","<~~","</","</>","/>","~~>","==","!=","/=","~=","<>","===","!==","!===","<:",":=","*=","*+","<*","<*>","*>","<|","<|>","|>","+*","=*","=:",":>","/*","*/","+++","\x3c!--","\x3c!---"]).sort((e,t)=>t.length-e.length),this._fontFeatureSettings=null==e?void 0:e.fontFeatureSettings}activate(e){var n;if(!e.element)throw new Error("Cannot activate LigaturesAddon before open is called");this._terminal=e,this._characterJoinerId=(0,t.enableLigatures)(e,this._fallbackLigatures),e.element.style.fontFeatureSettings=null!==(n=this._fontFeatureSettings)&&void 0!==n?n:'"calt" on'}dispose(){var e,t;void 0!==this._characterJoinerId&&(null===(e=this._terminal)||void 0===e||e.deregisterCharacterJoiner(this._characterJoinerId),this._characterJoinerId=void 0),(null===(t=this._terminal)||void 0===t?void 0:t.element)&&(this._terminal.element.style.fontFeatureSettings="")}}})(),o})());
|
|
3
|
+
//# sourceMappingURL=addon-ligatures.js.map
|