conformtools 0.6.19 → 0.6.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{account-KSE6H6DJ.js → account-VD3EE5UT.js} +1 -1
- package/dist/{agent-hook-setup-SHZOVJYL.js → agent-hook-setup-D2QNHA3V.js} +1 -1
- package/dist/{analysis-engine-KUGSWNQB.js → analysis-engine-VNGF3DE4.js} +1 -1
- package/dist/{bridge-REYIYXUU.js → bridge-MLBUD6XW.js} +1 -1
- package/dist/browser/timeline_core_bg.wasm +0 -0
- package/dist/{chunk-ND2YUUUH.js → chunk-2S2ZPQQD.js} +1 -1
- package/dist/{chunk-HKHEL4MZ.js → chunk-2WNNDPVR.js} +1 -1
- package/dist/chunk-2XQ42O7E.js +7 -0
- package/dist/{chunk-GTN62ZQV.js → chunk-3WJSWOCS.js} +1 -1
- package/dist/{chunk-WM7ESQLY.js → chunk-4UT55WZA.js} +1 -1
- package/dist/{chunk-TD3ZHREE.js → chunk-4V3KLFCJ.js} +1 -1
- package/dist/chunk-6IL7M3VP.js +162 -0
- package/dist/chunk-A7AYMSY7.js +9 -0
- package/dist/chunk-GBNPOZ32.js +10 -0
- package/dist/{chunk-BD54PRSN.js → chunk-GHP6HDLM.js} +1 -1
- package/dist/{chunk-3DYCTUSQ.js → chunk-HCT34NDA.js} +1 -1
- package/dist/{chunk-NHVH373D.js → chunk-HROU7LLU.js} +1 -1
- package/dist/{chunk-3J2FARFO.js → chunk-IPQLKAF2.js} +1 -1
- package/dist/chunk-JVJUJKUP.js +5 -0
- package/dist/chunk-M545OKDZ.js +6 -0
- package/dist/chunk-MU5AGXSH.js +3 -0
- package/dist/chunk-OSPDH2RK.js +6 -0
- package/dist/{chunk-WNDA7QSY.js → chunk-V2FVIZT7.js} +1 -1
- package/dist/{chunk-4KMSOMLG.js → chunk-WYI4LL4P.js} +207 -196
- package/dist/chunk-ZAL7Y5VZ.js +7 -0
- package/dist/{claude-setup-ZOEQ5NXE.js → claude-setup-AI4WXN2V.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{demo-engine-ZX24TAXA.js → demo-engine-MOHHYVGV.js} +1 -1
- package/dist/{engine-K6QYU5KJ.js → engine-WMOJ3HRU.js} +2 -2
- package/dist/{framing-B6LP7MS2.js → framing-U46POZQG.js} +1 -1
- package/dist/gfx-worker.js +1 -1
- package/dist/{h264-YX5KP63E.js → h264-4ETGWMKR.js} +1 -1
- package/dist/{h264-mxf-VAHIJCA7.js → h264-mxf-EFHHQL7X.js} +1 -1
- package/dist/hook.js +3 -3
- package/dist/host-relink-MVHI3YQI.js +10 -0
- package/dist/hosted-6BLHLZXM.js +3 -0
- package/dist/hosts-7UO4QETB.js +3 -0
- package/dist/http.js +2 -2
- package/dist/{inspect-QRHOFMC2.js → inspect-5TMUYGAL.js} +16 -16
- package/dist/{isobmff-RHP3N5K2.js → isobmff-55TPOVCK.js} +1 -1
- package/dist/{mc-video-CHBOYPI5.js → mc-video-GKWEWCEQ.js} +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{media-TPGEESEU.js → media-HCKSVARE.js} +1 -1
- package/dist/{mxf-R2ONKSYU.js → mxf-AJTCMKTX.js} +1 -1
- package/dist/{ops-MKDFWWPG.js → ops-UGZODMYE.js} +1 -1
- package/dist/{probe-CHT266NN.js → probe-YOYK7HR5.js} +1 -1
- package/dist/{r3d-F4OWLQE2.js → r3d-XHSJUARW.js} +1 -1
- package/dist/{sequence-patch-6FSMBG7O.js → sequence-patch-5MFTY52Q.js} +1 -1
- package/dist/{store-CFQHKBGL.js → store-6XN5Q6UG.js} +1 -1
- package/dist/{timeline-MZ6A3PQX.js → timeline-TFF3L7JP.js} +1 -1
- package/package.json +5 -5
- package/dist/chunk-4PV2UTKG.js +0 -10
- package/dist/chunk-BZQAUU3D.js +0 -6
- package/dist/chunk-CUZVK2JJ.js +0 -6
- package/dist/chunk-HZG55H3B.js +0 -3
- package/dist/chunk-MJKISVPS.js +0 -7
- package/dist/chunk-NQD6H7SY.js +0 -7
- package/dist/chunk-PY6HS3EP.js +0 -10
- package/dist/chunk-UWEM5YEM.js +0 -161
- package/dist/chunk-XQON6ASI.js +0 -5
- package/dist/host-relink-VYEOE3NE.js +0 -10
- package/dist/hosted-NLYSTYYN.js +0 -3
- package/dist/hosts-47EW33NY.js +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{a as ca,b as ua,c as fa,d as pa,e as ha,f as da,g as ga,h as ma,j as ya,k as ba,m as va,n as xa,o as Sa,q as Ta,r as ka}from"./chunk-N34DQ6MH.js";import{d as la}from"./chunk-NU3X7P4N.js";import{Ha as ia,a as aa}from"./chunk-L2RTMZCN.js";import{a as Te}from"./chunk-COALWMI7.js";import{
|
|
3
|
+
import{a as ca,b as ua,c as fa,d as pa,e as ha,f as da,g as ga,h as ma,j as ya,k as ba,m as va,n as xa,o as Sa,q as Ta,r as ka}from"./chunk-N34DQ6MH.js";import{d as la}from"./chunk-NU3X7P4N.js";import{Ha as ia,a as aa}from"./chunk-L2RTMZCN.js";import{a as Te}from"./chunk-COALWMI7.js";import{A as Nn,B as Us,C as _n,O as Gn,P as ra,Q as oa,a as As,aa as st,b as Is,ba as en,ca as it,da as xe,e as Fs,h as Ds,o as Qo,p as Jo,q as ea,t as ta,v as na,w as sa,x as Jt,y as _t,z as Bn}from"./chunk-MU5AGXSH.js";import{c as Yp,f as Zp}from"./chunk-PSANHDZM.js";var Ma=Yp((Ua,Wn)=>{var Da=(()=>{var c=Object.defineProperty,p=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyNames,v=Object.prototype.hasOwnProperty,x=(e,t)=>{for(var n in t)c(e,n,{get:t[n],enumerable:!0})},g=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of h(t))!v.call(e,r)&&r!==n&&c(e,r,{get:()=>t[r],enumerable:!(s=p(t,r))||s.enumerable});return e},y=e=>g(c({},"__esModule",{value:!0}),e),w={};x(w,{BoundingBox:()=>Qe,Font:()=>Xo,Glyph:()=>Dt,Path:()=>vt,_parse:()=>B,load:()=>zp,loadSync:()=>Xp,parse:()=>Wp});var O=0,R=-3;function A(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function E(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new A,this.dtree=new A}var F=new A,N=new A,D=new Uint8Array(30),L=new Uint16Array(30),M=new Uint8Array(30),U=new Uint16Array(30),_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Y=new A,Z=new Uint8Array(320);function ee(e,t,n,s){var r,o;for(r=0;r<n;++r)e[r]=0;for(r=0;r<30-n;++r)e[r+n]=r/n|0;for(o=s,r=0;r<30;++r)t[r]=o,o+=1<<e[r]}function oe(e,t){var n;for(n=0;n<7;++n)e.table[n]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,n=0;n<24;++n)e.trans[n]=256+n;for(n=0;n<144;++n)e.trans[24+n]=n;for(n=0;n<8;++n)e.trans[168+n]=280+n;for(n=0;n<112;++n)e.trans[176+n]=144+n;for(n=0;n<5;++n)t.table[n]=0;for(t.table[5]=32,n=0;n<32;++n)t.trans[n]=n}var K=new Uint16Array(16);function he(e,t,n,s){var r,o;for(r=0;r<16;++r)e.table[r]=0;for(r=0;r<s;++r)e.table[t[n+r]]++;for(e.table[0]=0,o=0,r=0;r<16;++r)K[r]=o,o+=e.table[r];for(r=0;r<s;++r)t[n+r]&&(e.trans[K[t[n+r]]++]=r)}function Se(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=e.tag&1;return e.tag>>>=1,t}function ke(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var s=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,s+n}function Et(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=0,s=0,r=0,o=e.tag;do s=2*s+(o&1),o>>>=1,++r,n+=t.table[r],s-=t.table[r];while(s>=0);return e.tag=o,e.bitcount-=r,t.trans[n+s]}function ne(e,t,n){var s,r,o,a,i,l;for(s=ke(e,5,257),r=ke(e,5,1),o=ke(e,4,4),a=0;a<19;++a)Z[a]=0;for(a=0;a<o;++a){var f=ke(e,3,0);Z[_[a]]=f}for(he(Y,Z,0,19),i=0;i<s+r;){var u=Et(e,Y);switch(u){case 16:var m=Z[i-1];for(l=ke(e,2,3);l;--l)Z[i++]=m;break;case 17:for(l=ke(e,3,3);l;--l)Z[i++]=0;break;case 18:for(l=ke(e,7,11);l;--l)Z[i++]=0;break;default:Z[i++]=u;break}}he(t,Z,0,s),he(n,Z,s,r)}function te(e,t,n){for(;;){var s=Et(e,t);if(s===256)return O;if(s<256)e.dest[e.destLen++]=s;else{var r,o,a,i;for(s-=257,r=ke(e,D[s],L[s]),o=Et(e,n),a=e.destLen-ke(e,M[o],U[o]),i=a;i<a+r;++i)e.dest[e.destLen++]=e.dest[i]}}}function ge(e){for(var t,n,s;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if(t=e.source[e.sourceIndex+1],t=256*t+e.source[e.sourceIndex],n=e.source[e.sourceIndex+3],n=256*n+e.source[e.sourceIndex+2],t!==(~n&65535))return R;for(e.sourceIndex+=4,s=t;s;--s)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,O}function Ee(e,t){var n=new E(e,t),s,r,o;do{switch(s=Se(n),r=ke(n,2,0),r){case 0:o=ge(n);break;case 1:o=te(n,F,N);break;case 2:ne(n,n.ltree,n.dtree),o=te(n,n.ltree,n.dtree);break;default:o=R}if(o!==O)throw new Error("Data error")}while(!s);return n.destLen<n.dest.length?typeof n.dest.slice=="function"?n.dest.slice(0,n.destLen):n.dest.subarray(0,n.destLen):n.dest}oe(F,N),ee(D,L,4,3),ee(M,U,2,1),D[28]=0,L[28]=258;function Ue(e,t,n,s,r){return Math.pow(1-r,3)*e+3*Math.pow(1-r,2)*r*t+3*(1-r)*Math.pow(r,2)*n+Math.pow(r,3)*s}function pe(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}pe.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},pe.prototype.addPoint=function(e,t){typeof e=="number"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof t=="number"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},pe.prototype.addX=function(e){this.addPoint(e,null)},pe.prototype.addY=function(e){this.addPoint(null,e)},pe.prototype.addBezier=function(e,t,n,s,r,o,a,i){let l=[e,t],f=[n,s],u=[r,o],m=[a,i];this.addPoint(e,t),this.addPoint(a,i);for(let d=0;d<=1;d++){let S=6*l[d]-12*f[d]+6*u[d],b=-3*l[d]+9*f[d]-9*u[d]+3*m[d],T=3*f[d]-3*l[d];if(b===0){if(S===0)continue;let X=-T/S;0<X&&X<1&&(d===0&&this.addX(Ue(l[d],f[d],u[d],m[d],X)),d===1&&this.addY(Ue(l[d],f[d],u[d],m[d],X)));continue}let C=Math.pow(S,2)-4*T*b;if(C<0)continue;let W=(-S+Math.sqrt(C))/(2*b);0<W&&W<1&&(d===0&&this.addX(Ue(l[d],f[d],u[d],m[d],W)),d===1&&this.addY(Ue(l[d],f[d],u[d],m[d],W)));let V=(-S-Math.sqrt(C))/(2*b);0<V&&V<1&&(d===0&&this.addX(Ue(l[d],f[d],u[d],m[d],V)),d===1&&this.addY(Ue(l[d],f[d],u[d],m[d],V)))}},pe.prototype.addQuad=function(e,t,n,s,r,o){let a=e+.6666666666666666*(n-e),i=t+2/3*(s-t),l=a+1/3*(r-e),f=i+1/3*(o-t);this.addBezier(e,t,a,i,l,f,r,o)};var Qe=pe;function de(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}var $t={};function or(e,t){let n=Math.floor(e),s=e-n;if($t[t]||($t[t]={}),$t[t][s]!==void 0){let o=$t[t][s];return n+o}let r=+(Math.round(s+"e+"+t)+"e-"+t);return $t[t][s]=r,n+r}function ar(e){let t=[[]],n=0,s=0;for(let r=0;r<e.length;r+=1){let o=t[t.length-1],a=e[r],i=o[0],l=o[1],f=o[o.length-1],u=e[r+1];o.push(a),a.type==="M"?(n=a.x,s=a.y):a.type==="L"&&(!u||u.type==="Z")?Math.abs(a.x-n)>1||Math.abs(a.y-s)>1||o.pop():a.type==="L"&&f&&f.x===a.x&&f.y===a.y?o.pop():a.type==="Z"&&(i&&l&&f&&i.type==="M"&&l.type==="L"&&f.type==="L"&&f.x===i.x&&f.y===i.y&&(o.shift(),o[0].type="M"),r+1<e.length&&t.push([]))}return e=[].concat.apply([],t),e}function ri(e){return Object.assign({},{decimalPlaces:2,optimize:!0,flipY:!0,flipYBase:void 0,scale:1,x:0,y:0},e)}function oi(e){return parseInt(e)===e&&(e={decimalPlaces:e,flipY:!1}),Object.assign({},{decimalPlaces:2,optimize:!0,flipY:!0,flipYBase:void 0},e)}de.prototype.fromSVG=function(e,t={}){typeof SVGPathElement<"u"&&e instanceof SVGPathElement&&(e=e.getAttribute("d")),t=ri(t),this.commands=[];let n="0123456789",s="MmLlQqCcZzHhVv",r="SsTtAa",o="-+",a={},i=[""],l=!1;function f(b){return b.filter(T=>T.length).map(T=>{let C=parseFloat(T);return(t.decimalPlaces||t.decimalPlaces===0)&&(C=or(C,t.decimalPlaces)),C})}function u(b){if(!this.commands.length)return b;let T=this.commands[this.commands.length-1];for(let C=0;C<b.length;C++)b[C]+=T[C&1?"y":"x"];return b}function m(){if(a.type===void 0)return;let b=a.type.toUpperCase(),T=b!=="Z"&&a.type.toUpperCase()!==a.type,C=f(i);if(i=[""],!C.length&&b!=="Z")return;T&&b!=="H"&&b!=="V"&&(C=u.apply(this,[C]));let W=this.commands.length&&this.commands[this.commands.length-1].x||0,V=this.commands.length&&this.commands[this.commands.length-1].y||0;switch(b){case"M":this.moveTo(...C);break;case"L":this.lineTo(...C);break;case"V":for(let X=0;X<C.length;X++){let Q=0;T&&(Q=this.commands.length&&this.commands[this.commands.length-1].y||0),this.lineTo(W,C[X]+Q)}break;case"H":for(let X=0;X<C.length;X++){let Q=0;T&&(Q=this.commands.length&&this.commands[this.commands.length-1].x||0),this.lineTo(C[X]+Q,V)}break;case"C":this.bezierCurveTo(...C);break;case"Q":this.quadraticCurveTo(...C);break;case"Z":(this.commands.length<1||this.commands[this.commands.length-1].type!=="Z")&&this.close();break}if(this.commands.length)for(let X in this.commands[this.commands.length-1])this.commands[this.commands.length-1][X]===void 0&&(this.commands[this.commands.length-1][X]=0)}for(let b=0;b<e.length;b++){let T=e.charAt(b),C=i[i.length-1];if(n.indexOf(T)>-1)i[i.length-1]+=T;else if(o.indexOf(T)>-1)if(!a.type&&!this.commands.length&&(a.type="L"),T==="-")!a.type||C.indexOf("-")>0?l=!0:C.length?i.push("-"):i[i.length-1]=T;else if(!a.type||C.length>0)l=!0;else continue;else if(s.indexOf(T)>-1)a.type?(m.apply(this),a={type:T}):a.type=T;else{if(r.indexOf(T)>-1)throw new Error("Unsupported path command: "+T+". Currently supported commands are "+s.split("").join(", ")+".");` ,
|
|
4
4
|
\r\f\v`.indexOf(T)>-1?i.push(""):T==="."?!a.type||C.indexOf(T)>-1?l=!0:i[i.length-1]+=T:l=!0}if(l)throw new Error("Unexpected character: "+T+" at offset "+b)}m.apply(this),t.optimize&&(this.commands=ar(this.commands));let d=t.flipY,S=t.flipYBase;if(d===!0&&t.flipYBase===void 0){let b=this.getBoundingBox();S=b.y1+b.y2}for(let b in this.commands){let T=this.commands[b];for(let C in T)["x","x1","x2"].includes(C)?this.commands[b][C]=t.x+T[C]*t.scale:["y","y1","y2"].includes(C)&&(this.commands[b][C]=t.y+(d?S-T[C]:T[C])*t.scale)}return this},de.fromSVG=function(e,t){return new de().fromSVG(e,t)},de.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},de.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},de.prototype.curveTo=de.prototype.bezierCurveTo=function(e,t,n,s,r,o){this.commands.push({type:"C",x1:e,y1:t,x2:n,y2:s,x:r,y:o})},de.prototype.quadTo=de.prototype.quadraticCurveTo=function(e,t,n,s){this.commands.push({type:"Q",x1:e,y1:t,x:n,y:s})},de.prototype.close=de.prototype.closePath=function(){this.commands.push({type:"Z"})},de.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof Qe){let t=e;this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),this.close();return}Array.prototype.push.apply(this.commands,e)},de.prototype.getBoundingBox=function(){let e=new Qe,t=0,n=0,s=0,r=0;for(let o=0;o<this.commands.length;o++){let a=this.commands[o];switch(a.type){case"M":e.addPoint(a.x,a.y),t=s=a.x,n=r=a.y;break;case"L":e.addPoint(a.x,a.y),s=a.x,r=a.y;break;case"Q":e.addQuad(s,r,a.x1,a.y1,a.x,a.y),s=a.x,r=a.y;break;case"C":e.addBezier(s,r,a.x1,a.y1,a.x2,a.y2,a.x,a.y),s=a.x,r=a.y;break;case"Z":s=t,r=n;break;default:throw new Error("Unexpected path command "+a.type)}}return e.isEmpty()&&e.addPoint(0,0),e},de.prototype.draw=function(e){let t=this._layers;if(t&&t.length){for(let s=0;s<t.length;s++)this.draw.call(t[s],e);return}let n=this._image;if(n){e.drawImage(n.image,n.x,n.y,n.width,n.height);return}e.beginPath();for(let s=0;s<this.commands.length;s+=1){let r=this.commands[s];r.type==="M"?e.moveTo(r.x,r.y):r.type==="L"?e.lineTo(r.x,r.y):r.type==="C"?e.bezierCurveTo(r.x1,r.y1,r.x2,r.y2,r.x,r.y):r.type==="Q"?e.quadraticCurveTo(r.x1,r.y1,r.x,r.y):r.type==="Z"&&this.stroke&&this.strokeWidth&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},de.prototype.toPathData=function(e){e=oi(e);function t(i){let l=or(i,e.decimalPlaces);return Math.round(i)===l?""+l:l.toFixed(e.decimalPlaces)}function n(){let i="";for(let l=0;l<arguments.length;l+=1){let f=arguments[l];f>=0&&l>0&&(i+=" "),i+=t(f)}return i}let s=this.commands;e.optimize&&(s=JSON.parse(JSON.stringify(this.commands)),s=ar(s));let r=e.flipY,o=e.flipYBase;if(r===!0&&o===void 0){let i=new de;i.extend(s);let l=i.getBoundingBox();o=l.y1+l.y2}let a="";for(let i=0;i<s.length;i+=1){let l=s[i];l.type==="M"?a+="M"+n(l.x,r?o-l.y:l.y):l.type==="L"?a+="L"+n(l.x,r?o-l.y:l.y):l.type==="C"?a+="C"+n(l.x1,r?o-l.y1:l.y1,l.x2,r?o-l.y2:l.y2,l.x,r?o-l.y:l.y):l.type==="Q"?a+="Q"+n(l.x1,r?o-l.y1:l.y1,l.x,r?o-l.y:l.y):l.type==="Z"&&(a+="Z")}return a},de.prototype.toSVG=function(e,t){this._layers&&this._layers.length&&console.warn("toSVG() does not support colr font layers yet"),this._image&&console.warn("toSVG() does not support SVG glyphs yet"),t||(t=this.toPathData(e));let n='<path d="';return n+=t,n+='"',this.fill!==void 0&&this.fill!=="black"&&(this.fill===null?n+=' fill="none"':n+=' fill="'+this.fill+'"'),this.stroke&&(n+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),n+="/>",n},de.prototype.toDOMElement=function(e,t){this._layers&&this._layers.length&&console.warn("toDOMElement() does not support colr font layers yet"),t||(t=this.toPathData(e));let n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",t),this.fill!==void 0&&this.fill!=="black"&&(this.fill===null?n.setAttribute("fill","none"):n.setAttribute("fill",this.fill)),this.stroke&&(n.setAttribute("stroke",this.stroke),n.setAttribute("stroke-width",this.strokeWidth)),n};var vt=de;function ir(e){throw new Error(e)}function lr(e,t){e||ir(t)}var $={fail:ir,argument:lr,assert:lr},cr=32768,ur=2147483648,ai=-32768,ii=32767+1/65536,Rt={},P={},q={};function We(e){return function(){return e}}P.BYTE=function(e){return $.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]},q.BYTE=We(1),P.CHAR=function(e){return[e.charCodeAt(0)]},q.CHAR=We(1),P.CHARARRAY=function(e){(e===null||typeof e>"u")&&(e="",console.warn("CHARARRAY with undefined or null value encountered and treated as an empty string. This is probably caused by a missing glyph name."));let t=[];for(let n=0;n<e.length;n+=1)t[n]=e.charCodeAt(n);return t},q.CHARARRAY=function(e){return typeof e>"u"?0:e.length},P.USHORT=function(e){return[e>>8&255,e&255]},q.USHORT=We(2),P.SHORT=function(e){return e>=cr&&(e=-(2*cr-e)),[e>>8&255,e&255]},q.SHORT=We(2),P.UINT24=function(e){return[e>>16&255,e>>8&255,e&255]},q.UINT24=We(3),P.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]},q.ULONG=We(4),P.LONG=function(e){return e>=ur&&(e=-(2*ur-e)),[e>>24&255,e>>16&255,e>>8&255,e&255]},q.LONG=We(4),P.FLOAT=function(e){if(e>ii||e<ai)throw new Error(`Value ${e} is outside the range of representable values in 16.16 format`);let t=Math.round(e*65536)<<0;return P.ULONG(t)},q.FLOAT=q.ULONG,P.FIXED=P.ULONG,q.FIXED=q.ULONG,P.FWORD=P.SHORT,q.FWORD=q.SHORT,P.UFWORD=P.USHORT,q.UFWORD=q.USHORT,P.F2DOT14=function(e){return P.USHORT(e*16384)},q.F2DOT14=q.USHORT,P.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,e&255]},q.LONGDATETIME=We(8),P.TAG=function(e){return $.argument(e.length===4,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},q.TAG=We(4),P.Card8=P.BYTE,q.Card8=q.BYTE,P.Card16=P.USHORT,q.Card16=q.USHORT,P.OffSize=P.BYTE,q.OffSize=q.BYTE,P.SID=P.USHORT,q.SID=q.USHORT,P.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?(e=e-108,[(e>>8)+247,e&255]):e>=-1131&&e<=-108?(e=-e-108,[(e>>8)+251,e&255]):e>=-32768&&e<=32767?P.NUMBER16(e):P.NUMBER32(e)},q.NUMBER=function(e){return P.NUMBER(e).length},P.NUMBER16=function(e){return[28,e>>8&255,e&255]},q.NUMBER16=We(3),P.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,e&255]},q.NUMBER32=We(5),P.REAL=function(e){let t=e.toString(),n=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(n){let o=parseFloat("1e"+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*o)/o).toString()}let s="";for(let o=0,a=t.length;o<a;o+=1){let i=t[o];i==="e"?s+=t[++o]==="-"?"c":"b":i==="."?s+="a":i==="-"?s+="e":s+=i}s+=s.length&1?"f":"ff";let r=[30];for(let o=0,a=s.length;o<a;o+=2)r.push(parseInt(s.substr(o,2),16));return r},q.REAL=function(e){return P.REAL(e).length},P.NAME=P.CHARARRAY,q.NAME=q.CHARARRAY,P.STRING=P.CHARARRAY,q.STRING=q.CHARARRAY,Rt.UTF8=function(e,t,n){let s=[],r=n;for(let o=0;o<r;o++,t+=1)s[o]=e.getUint8(t);return String.fromCharCode.apply(null,s)},Rt.UTF16=function(e,t,n){let s=[],r=n/2;for(let o=0;o<r;o++,t+=2)s[o]=e.getUint16(t);return String.fromCharCode.apply(null,s)},P.UTF16=function(e){let t=[];for(let n=0;n<e.length;n+=1){let s=e.charCodeAt(n);t[t.length]=s>>8&255,t[t.length]=s&255}return t},q.UTF16=function(e){return e.length*2};var ln={"x-mac-croatian":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\u0160\u2122\xB4\xA8\u2260\u017D\xD8\u221E\xB1\u2264\u2265\u2206\xB5\u2202\u2211\u220F\u0161\u222B\xAA\xBA\u03A9\u017E\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u0106\xAB\u010C\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u0110\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\uF8FF\xA9\u2044\u20AC\u2039\u203A\xC6\xBB\u2013\xB7\u201A\u201E\u2030\xC2\u0107\xC1\u010D\xC8\xCD\xCE\xCF\xCC\xD3\xD4\u0111\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u03C0\xCB\u02DA\xB8\xCA\xE6\u02C7","x-mac-cyrillic":"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u2020\xB0\u0490\xA3\xA7\u2022\xB6\u0406\xAE\xA9\u2122\u0402\u0452\u2260\u0403\u0453\u221E\xB1\u2264\u2265\u0456\xB5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040A\u045A\u0458\u0405\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\u040B\u045B\u040C\u045C\u0455\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u201E\u040E\u045E\u040F\u045F\u2116\u0401\u0451\u044F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E","x-mac-gaelic":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u1E02\xB1\u2264\u2265\u1E03\u010A\u010B\u1E0A\u1E0B\u1E1E\u1E1F\u0120\u0121\u1E40\xE6\xF8\u1E41\u1E56\u1E57\u027C\u0192\u017F\u1E60\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\u1E61\u1E9B\xFF\u0178\u1E6A\u20AC\u2039\u203A\u0176\u0177\u1E6B\xB7\u1EF2\u1EF3\u204A\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\u2663\xD2\xDA\xDB\xD9\u0131\xDD\xFD\u0174\u0175\u1E84\u1E85\u1E80\u1E81\u1E82\u1E83","x-mac-greek":"\xC4\xB9\xB2\xC9\xB3\xD6\xDC\u0385\xE0\xE2\xE4\u0384\xA8\xE7\xE9\xE8\xEA\xEB\xA3\u2122\xEE\xEF\u2022\xBD\u2030\xF4\xF6\xA6\u20AC\xF9\xFB\xFC\u2020\u0393\u0394\u0398\u039B\u039E\u03A0\xDF\xAE\xA9\u03A3\u03AA\xA7\u2260\xB0\xB7\u0391\xB1\u2264\u2265\xA5\u0392\u0395\u0396\u0397\u0399\u039A\u039C\u03A6\u03AB\u03A8\u03A9\u03AC\u039D\xAC\u039F\u03A1\u2248\u03A4\xAB\xBB\u2026\xA0\u03A5\u03A7\u0386\u0388\u0153\u2013\u2015\u201C\u201D\u2018\u2019\xF7\u0389\u038A\u038C\u038E\u03AD\u03AE\u03AF\u03CC\u038F\u03CD\u03B1\u03B2\u03C8\u03B4\u03B5\u03C6\u03B3\u03B7\u03B9\u03BE\u03BA\u03BB\u03BC\u03BD\u03BF\u03C0\u03CE\u03C1\u03C3\u03C4\u03B8\u03C9\u03C2\u03C7\u03C5\u03B6\u03CA\u03CB\u0390\u03B0\xAD","x-mac-icelandic":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\xDD\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\xD0\xF0\xDE\xFE\xFD\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7","x-mac-inuit":"\u1403\u1404\u1405\u1406\u140A\u140B\u1431\u1432\u1433\u1434\u1438\u1439\u1449\u144E\u144F\u1450\u1451\u1455\u1456\u1466\u146D\u146E\u146F\u1470\u1472\u1473\u1483\u148B\u148C\u148D\u148E\u1490\u1491\xB0\u14A1\u14A5\u14A6\u2022\xB6\u14A7\xAE\xA9\u2122\u14A8\u14AA\u14AB\u14BB\u14C2\u14C3\u14C4\u14C5\u14C7\u14C8\u14D0\u14EF\u14F0\u14F1\u14F2\u14F4\u14F5\u1505\u14D5\u14D6\u14D7\u14D8\u14DA\u14DB\u14EA\u1528\u1529\u152A\u152B\u152D\u2026\xA0\u152E\u153E\u1555\u1556\u1557\u2013\u2014\u201C\u201D\u2018\u2019\u1558\u1559\u155A\u155D\u1546\u1547\u1548\u1549\u154B\u154C\u1550\u157F\u1580\u1581\u1582\u1583\u1584\u1585\u158F\u1590\u1591\u1592\u1593\u1594\u1595\u1671\u1672\u1673\u1674\u1675\u1676\u1596\u15A0\u15A1\u15A2\u15A3\u15A4\u15A5\u15A6\u157C\u0141\u0142","x-mac-ce":"\xC4\u0100\u0101\xC9\u0104\xD6\xDC\xE1\u0105\u010C\xE4\u010D\u0106\u0107\xE9\u0179\u017A\u010E\xED\u010F\u0112\u0113\u0116\xF3\u0117\xF4\xF6\xF5\xFA\u011A\u011B\xFC\u2020\xB0\u0118\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\u0119\xA8\u2260\u0123\u012E\u012F\u012A\u2264\u2265\u012B\u0136\u2202\u2211\u0142\u013B\u013C\u013D\u013E\u0139\u013A\u0145\u0146\u0143\xAC\u221A\u0144\u0147\u2206\xAB\xBB\u2026\xA0\u0148\u0150\xD5\u0151\u014C\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\u014D\u0154\u0155\u0158\u2039\u203A\u0159\u0156\u0157\u0160\u201A\u201E\u0161\u015A\u015B\xC1\u0164\u0165\xCD\u017D\u017E\u016A\xD3\xD4\u016B\u016E\xDA\u016F\u0170\u0171\u0172\u0173\xDD\xFD\u0137\u017B\u0141\u017C\u0122\u02C7",macintosh:"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\u2039\u203A\uFB01\uFB02\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7","x-mac-romanian":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\u0102\u0218\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\u0103\u0219\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\u2039\u203A\u021A\u021B\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7","x-mac-turkish":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u011E\u011F\u0130\u0131\u015E\u015F\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\uF8A0\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"};Rt.MACSTRING=function(e,t,n,s){let r=ln[s];if(r===void 0)return;let o="";for(let a=0;a<n;a++){let i=e.getUint8(t+a);i<=127?o+=String.fromCharCode(i):o+=r[i&127]}return o};var cn=typeof WeakMap=="function"&&new WeakMap,un,li=function(e){if(!un){un={};for(let r in ln)un[r]=new String(r)}let t=un[e];if(t===void 0)return;if(cn){let r=cn.get(t);if(r!==void 0)return r}let n=ln[e];if(n===void 0)return;let s={};for(let r=0;r<n.length;r++)s[n.charCodeAt(r)]=r+128;return cn&&cn.set(t,s),s};P.MACSTRING=function(e,t){let n=li(t);if(n===void 0)return;let s=[];for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o>=128&&(o=n[o],o===void 0))return;s[r]=o}return s},q.MACSTRING=function(e,t){let n=P.MACSTRING(e,t);return n!==void 0?n.length:0};function Qn(e){return e>=-128&&e<=127}function ci(e,t,n){let s=0,r=e.length;for(;t<r&&s<64&&e[t]===0;)++t,++s;return n.push(128|s-1),t}function ui(e,t,n){let s=0,r=e.length,o=t;for(;o<r&&s<64;){let a=e[o];if(!Qn(a)||a===0&&o+1<r&&e[o+1]===0)break;++o,++s}n.push(s-1);for(let a=t;a<o;++a)n.push(e[a]+256&255);return o}function fi(e,t,n){let s=0,r=e.length,o=t;for(;o<r&&s<64;){let a=e[o];if(a===0||Qn(a)&&o+1<r&&Qn(e[o+1]))break;++o,++s}n.push(64|s-1);for(let a=t;a<o;++a){let i=e[a];n.push(i+65536>>8&255,i+256&255)}return o}P.VARDELTAS=function(e){let t=0,n=[];for(;t<e.length;){let s=e[t];s===0?t=ci(e,t,n):s>=-128&&s<=127?t=ui(e,t,n):t=fi(e,t,n)}return n},P.INDEX=function(e){let t=1,n=[t],s=[];for(let i=0;i<e.length;i+=1){let l=P.OBJECT(e[i]);Array.prototype.push.apply(s,l),t+=l.length,n.push(t)}if(s.length===0)return[0,0];let r=[],o=1+Math.floor(Math.log(t)/Math.log(2))/8|0,a=[void 0,P.BYTE,P.USHORT,P.UINT24,P.ULONG][o];for(let i=0;i<n.length;i+=1){let l=a(n[i]);Array.prototype.push.apply(r,l)}return Array.prototype.concat(P.Card16(e.length),P.OffSize(o),r,s)},q.INDEX=function(e){return P.INDEX(e).length},P.DICT=function(e){let t=[],n=Object.keys(e),s=n.length;for(let r=0;r<s;r+=1){let o=parseInt(n[r],0),a=e[o],i=P.OPERAND(a.value,a.type),l=P.OPERATOR(o);for(let f=0;f<i.length;f++)t.push(i[f]);for(let f=0;f<l.length;f++)t.push(l[f])}return t},q.DICT=function(e){return P.DICT(e).length},P.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},P.OPERAND=function(e,t){let n=[];if(Array.isArray(t))for(let s=0;s<t.length;s+=1){$.argument(e.length===t.length,"Not enough arguments given for type"+t);let r=P.OPERAND(e[s],t[s]);for(let o=0;o<r.length;o++)n.push(r[o])}else if(t==="SID"){let s=P.NUMBER(e);for(let r=0;r<s.length;r++)n.push(s[r])}else if(t==="offset"){let s=P.NUMBER32(e);for(let r=0;r<s.length;r++)n.push(s[r])}else if(t==="number"){let s=P.NUMBER(e);for(let r=0;r<s.length;r++)n.push(s[r])}else if(t==="real"){let s=P.REAL(e);for(let r=0;r<s.length;r++)n.push(s[r])}else throw new Error("Unknown operand type "+t);return n},P.OP=P.BYTE,q.OP=q.BYTE;var fn=typeof WeakMap=="function"&&new WeakMap;P.CHARSTRING=function(e){if(fn){let s=fn.get(e);if(s!==void 0)return s}let t=[],n=e.length;for(let s=0;s<n;s+=1){let r=e[s],o=P[r.type](r.value);for(let a=0;a<o.length;a++)t.push(o[a])}return fn&&fn.set(e,t),t},q.CHARSTRING=function(e){return P.CHARSTRING(e).length},P.OBJECT=function(e){let t=P[e.type];return $.argument(t!==void 0,"No encoding function for type "+e.type),t(e.value)},q.OBJECT=function(e){let t=q[e.type];return $.argument(t!==void 0,"No sizeOf function for type "+e.type),t(e.value)},P.TABLE=function(e){let t=[],n=(e.fields||[]).length,s=[],r=[];for(let o=0;o<n;o+=1){let a=e.fields[o],i=P[a.type];$.argument(i!==void 0,"No encoding function for field type "+a.type+" ("+a.name+")");let l=e[a.name];l===void 0&&(l=a.value);let f=i(l);if(a.type==="TABLE")l.fields!==null&&(r.push(t.length),s.push(f)),t.push(0,0);else for(let u=0;u<f.length;u++)t.push(f[u])}for(let o=0;o<s.length;o+=1){let a=r[o],i=t.length;$.argument(i<65536,"Table "+e.tableName+" too big."),t[a]=i>>8,t[a+1]=i&255;for(let l=0;l<s[o].length;l++)t.push(s[o][l])}return t},q.TABLE=function(e){let t=0,n=(e.fields||[]).length;for(let s=0;s<n;s+=1){let r=e.fields[s],o=q[r.type];$.argument(o!==void 0,"No sizeOf function for field type "+r.type+" ("+r.name+")");let a=e[r.name];a===void 0&&(a=r.value),t+=o(a),r.type==="TABLE"&&(t+=2)}return t},P.RECORD=P.TABLE,q.RECORD=q.TABLE,P.LITERAL=function(e){return e},q.LITERAL=function(e){return e.length};function ye(e,t,n){if(t&&t.length)for(let s=0;s<t.length;s+=1){let r=t[s];this[r.name]=r.value}if(this.tableName=e,this.fields=t,n){let s=Object.keys(n);for(let r=0;r<s.length;r+=1){let o=s[r],a=n[o];this[o]!==void 0&&(this[o]=a)}}}ye.prototype.encode=function(){return P.TABLE(this)},ye.prototype.sizeOf=function(){return q.TABLE(this)};function At(e,t,n){n===void 0&&(n=t.length);let s=new Array(t.length+1);s[0]={name:e+"Count",type:"USHORT",value:n};for(let r=0;r<t.length;r++)s[r+1]={name:e+r,type:"USHORT",value:t[r]};return s}function Jn(e,t,n){let s=t.length,r=new Array(s+1);r[0]={name:e+"Count",type:"USHORT",value:s};for(let o=0;o<s;o++)r[o+1]={name:e+o,type:"TABLE",value:n(t[o],o)};return r}function It(e,t,n){let s=t.length,r=[];r[0]={name:e+"Count",type:"USHORT",value:s};for(let o=0;o<s;o++)r=r.concat(n(t[o],o));return r}function pn(e){e.format===1?ye.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(At("glyph",e.glyphs))):e.format===2?ye.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(It("rangeRecord",e.ranges,function(t,n){return[{name:"startGlyphID"+n,type:"USHORT",value:t.start},{name:"endGlyphID"+n,type:"USHORT",value:t.end},{name:"startCoverageIndex"+n,type:"USHORT",value:t.index}]}))):$.assert(!1,"Coverage format must be 1 or 2.")}pn.prototype=Object.create(ye.prototype),pn.prototype.constructor=pn;function hn(e){ye.call(this,"scriptListTable",It("scriptRecord",e,function(t,n){let s=t.script,r=s.defaultLangSys;return $.assert(!!r,"Unable to write GSUB: script "+t.tag+" has no default language system."),[{name:"scriptTag"+n,type:"TAG",value:t.tag},{name:"script"+n,type:"TABLE",value:new ye("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new ye("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:r.reqFeatureIndex}].concat(At("featureIndex",r.featureIndexes)))}].concat(It("langSys",s.langSysRecords,function(o,a){let i=o.langSys;return[{name:"langSysTag"+a,type:"TAG",value:o.tag},{name:"langSys"+a,type:"TABLE",value:new ye("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:i.reqFeatureIndex}].concat(At("featureIndex",i.featureIndexes)))}]})))}]}))}hn.prototype=Object.create(ye.prototype),hn.prototype.constructor=hn;function dn(e){ye.call(this,"featureListTable",It("featureRecord",e,function(t,n){let s=t.feature;return[{name:"featureTag"+n,type:"TAG",value:t.tag},{name:"feature"+n,type:"TABLE",value:new ye("featureTable",[{name:"featureParams",type:"USHORT",value:s.featureParams}].concat(At("lookupListIndex",s.lookupListIndexes)))}]}))}dn.prototype=Object.create(ye.prototype),dn.prototype.constructor=dn;function gn(e,t){ye.call(this,"lookupListTable",Jn("lookup",e,function(n){let s=t[n.lookupType];return $.assert(!!s,"Unable to write GSUB lookup type "+n.lookupType+" tables."),new ye("lookupTable",[{name:"lookupType",type:"USHORT",value:n.lookupType},{name:"lookupFlag",type:"USHORT",value:n.lookupFlag}].concat(Jn("subtable",n.subtables,s)))}))}gn.prototype=Object.create(ye.prototype),gn.prototype.constructor=gn;function mn(e){e.format===1?ye.call(this,"classDefTable",[{name:"classFormat",type:"USHORT",value:1},{name:"startGlyphID",type:"USHORT",value:e.startGlyph}].concat(At("glyph",e.classes))):e.format===2?ye.call(this,"classDefTable",[{name:"classFormat",type:"USHORT",value:2}].concat(It("rangeRecord",e.ranges,function(t,n){return[{name:"startGlyphID"+n,type:"USHORT",value:t.start},{name:"endGlyphID"+n,type:"USHORT",value:t.end},{name:"class"+n,type:"USHORT",value:t.classId}]}))):$.assert(!1,"Class format must be 1 or 2.")}mn.prototype=Object.create(ye.prototype),mn.prototype.constructor=mn;var I={Table:ye,Record:ye,Coverage:pn,ClassDef:mn,ScriptList:hn,FeatureList:dn,LookupList:gn,ushortList:At,tableList:Jn,recordList:It};function fr(e,t){return e.getUint8(t)}function yn(e,t){return e.getUint16(t,!1)}function pi(e,t){return e.getInt16(t,!1)}function pr(e,t){return(e.getUint16(t)<<8)+e.getUint8(t+2)}function es(e,t){return e.getUint32(t,!1)}function hi(e,t){return e.getInt32(t,!1)}function hr(e,t){let n=e.getInt16(t,!1),s=e.getUint16(t+2,!1);return n+s/65535}function di(e,t){let n="";for(let s=t;s<t+4;s+=1)n+=String.fromCharCode(e.getInt8(s));return n}function gi(e,t,n){let s=0;for(let r=0;r<n;r+=1)s<<=8,s+=e.getUint8(t+r);return s}function mi(e,t,n){let s=[];for(let r=t;r<n;r+=1)s.push(e.getUint8(r));return s}function yi(e){let t="";for(let n=0;n<e.length;n+=1)t+=String.fromCharCode(e[n]);return t}var bi={byte:1,uShort:2,f2dot14:2,short:2,uInt24:3,uLong:4,fixed:4,longDateTime:8,tag:4},we={LONG_WORDS:32768,WORD_DELTA_COUNT_MASK:32767,SHARED_POINT_NUMBERS:32768,COUNT_MASK:4095,EMBEDDED_PEAK_TUPLE:32768,INTERMEDIATE_REGION:16384,PRIVATE_POINT_NUMBERS:8192,TUPLE_INDEX_MASK:4095,POINTS_ARE_WORDS:128,POINT_RUN_COUNT_MASK:127,DELTAS_ARE_ZERO:128,DELTAS_ARE_WORDS:64,DELTA_RUN_COUNT_MASK:63,INNER_INDEX_BIT_COUNT_MASK:15,MAP_ENTRY_SIZE_MASK:48};function k(e,t){this.data=e,this.offset=t,this.relativeOffset=0}k.prototype.parseByte=function(){let e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},k.prototype.parseChar=function(){let e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},k.prototype.parseCard8=k.prototype.parseByte,k.prototype.parseUShort=function(){let e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},k.prototype.parseCard16=k.prototype.parseUShort,k.prototype.parseSID=k.prototype.parseUShort,k.prototype.parseOffset16=k.prototype.parseUShort,k.prototype.parseShort=function(){let e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},k.prototype.parseF2Dot14=function(){let e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},k.prototype.parseUInt24=function(){let e=pr(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=3,e},k.prototype.parseULong=function(){let e=es(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},k.prototype.parseLong=function(){let e=hi(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},k.prototype.parseOffset32=k.prototype.parseULong,k.prototype.parseFixed=function(){let e=hr(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},k.prototype.parseString=function(e){let t=this.data,n=this.offset+this.relativeOffset,s="";this.relativeOffset+=e;for(let r=0;r<e;r++)s+=String.fromCharCode(t.getUint8(n+r));return s},k.prototype.parseTag=function(){return this.parseString(4)},k.prototype.parseLongDateTime=function(){let e=es(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},k.prototype.parseVersion=function(e){let t=yn(this.data,this.offset+this.relativeOffset),n=yn(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,e===void 0&&(e=4096),t+n/e/10},k.prototype.skip=function(e,t){t===void 0&&(t=1),this.relativeOffset+=bi[e]*t},k.prototype.parseULongList=function(e){e===void 0&&(e=this.parseULong());let t=new Array(e),n=this.data,s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint32(s),s+=4;return this.relativeOffset+=e*4,t},k.prototype.parseOffset16List=k.prototype.parseUShortList=function(e){e===void 0&&(e=this.parseUShort());let t=new Array(e),n=this.data,s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint16(s),s+=2;return this.relativeOffset+=e*2,t},k.prototype.parseShortList=function(e){let t=new Array(e),n=this.data,s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getInt16(s),s+=2;return this.relativeOffset+=e*2,t},k.prototype.parseByteList=function(e){let t=new Array(e),n=this.data,s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint8(s++);return this.relativeOffset+=e,t},k.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());let n=new Array(e);for(let s=0;s<e;s++)n[s]=t.call(this);return n},k.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());let n=new Array(e);for(let s=0;s<e;s++)n[s]=t.call(this);return n},k.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());let n=new Array(e),s=Object.keys(t);for(let r=0;r<e;r++){let o={};for(let a=0;a<s.length;a++){let i=s[a],l=t[i];o[i]=l.call(this)}n[r]=o}return n},k.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());let n=new Array(e),s=Object.keys(t);for(let r=0;r<e;r++){let o={};for(let a=0;a<s.length;a++){let i=s[a],l=t[i];o[i]=l.call(this)}n[r]=o}return n},k.prototype.parseTupleRecords=function(e,t){let n=[];for(let s=0;s<e;s++){let r=[];for(let o=0;o<t;o++)r.push(this.parseF2Dot14());n.push(r)}return n},k.prototype.parseStruct=function(e){if(typeof e=="function")return e.call(this);{let t=Object.keys(e),n={};for(let s=0;s<t.length;s++){let r=t[s],o=e[r];n[r]=o.call(this)}return n}},k.prototype.parseValueRecord=function(e){if(e===void 0&&(e=this.parseUShort()),e===0)return;let t={};return e&1&&(t.xPlacement=this.parseShort()),e&2&&(t.yPlacement=this.parseShort()),e&4&&(t.xAdvance=this.parseShort()),e&8&&(t.yAdvance=this.parseShort()),e&16&&(t.xPlaDevice=void 0,this.parseShort()),e&32&&(t.yPlaDevice=void 0,this.parseShort()),e&64&&(t.xAdvDevice=void 0,this.parseShort()),e&128&&(t.yAdvDevice=void 0,this.parseShort()),t},k.prototype.parseValueRecordList=function(){let e=this.parseUShort(),t=this.parseUShort(),n=new Array(t);for(let s=0;s<t;s++)n[s]=this.parseValueRecord(e);return n},k.prototype.parsePointer=function(e){let t=this.parseOffset16();if(t>0)return new k(this.data,this.offset+t).parseStruct(e)},k.prototype.parsePointer32=function(e){let t=this.parseOffset32();if(t>0)return new k(this.data,this.offset+t).parseStruct(e)},k.prototype.parseListOfLists=function(e){let t=this.parseOffset16List(),n=t.length,s=this.relativeOffset,r=new Array(n);for(let o=0;o<n;o++){let a=t[o];if(a===0){r[o]=void 0;continue}if(this.relativeOffset=a,e){let i=this.parseOffset16List(),l=new Array(i.length);for(let f=0;f<i.length;f++)this.relativeOffset=a+i[f],l[f]=e.call(this);r[o]=l}else r[o]=this.parseUShortList()}return this.relativeOffset=s,r},k.prototype.parseCoverage=function(){let e=this.offset+this.relativeOffset,t=this.parseUShort(),n=this.parseUShort();if(t===1)return{format:1,glyphs:this.parseUShortList(n)};if(t===2){let s=new Array(n);for(let r=0;r<n;r++)s[r]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:s}}throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.")},k.prototype.parseClassDef=function(){let e=this.offset+this.relativeOffset,t=this.parseUShort();return t===1?{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()}:t===2?{format:2,ranges:this.parseRecordList({start:k.uShort,end:k.uShort,classId:k.uShort})}:(console.warn(`0x${e.toString(16)}: This font file uses an invalid ClassDef format of ${t}. It might be corrupted and should be reacquired if it doesn't display as intended.`),{format:t})},k.list=function(e,t){return function(){return this.parseList(e,t)}},k.list32=function(e,t){return function(){return this.parseList32(e,t)}},k.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},k.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},k.pointer=function(e){return function(){return this.parsePointer(e)}},k.pointer32=function(e){return function(){return this.parsePointer32(e)}},k.tag=k.prototype.parseTag,k.byte=k.prototype.parseByte,k.uShort=k.offset16=k.prototype.parseUShort,k.uShortList=k.prototype.parseUShortList,k.uInt24=k.prototype.parseUInt24,k.uLong=k.offset32=k.prototype.parseULong,k.uLongList=k.prototype.parseULongList,k.fixed=k.prototype.parseFixed,k.f2Dot14=k.prototype.parseF2Dot14,k.struct=k.prototype.parseStruct,k.coverage=k.prototype.parseCoverage,k.classDef=k.prototype.parseClassDef;var dr={reserved:k.uShort,reqFeatureIndex:k.uShort,featureIndexes:k.uShortList};k.prototype.parseScriptList=function(){return this.parsePointer(k.recordList({tag:k.tag,script:k.pointer({defaultLangSys:k.pointer(dr),langSysRecords:k.recordList({tag:k.tag,langSys:k.pointer(dr)})})}))||[]},k.prototype.parseFeatureList=function(){return this.parsePointer(k.recordList({tag:k.tag,feature:k.pointer({featureParams:k.offset16,lookupListIndexes:k.uShortList})}))||[]},k.prototype.parseLookupList=function(e){return this.parsePointer(k.list(k.pointer(function(){let t=this.parseUShort();$.argument(1<=t&&t<=9,"GPOS/GSUB lookup type "+t+" unknown.");let n=this.parseUShort(),s=n&16;return{lookupType:t,lookupFlag:n,subtables:this.parseList(k.pointer(e[t])),markFilteringSet:s?this.parseUShort():void 0}})))||[]},k.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){let e=this.parseUShort(),t=this.parseUShort();return $.argument(e===1&&t<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:k.offset32,featureTableSubstitutionOffset:k.offset32})})||[]},k.prototype.parseVariationStore=function(){let e=this.relativeOffset,t=this.parseUShort(),n={itemVariationStore:this.parseItemVariationStore()};return this.relativeOffset=e+t+2,n},k.prototype.parseItemVariationStore=function(){let e=this.relativeOffset,t={format:this.parseUShort(),variationRegions:[],itemVariationSubtables:[]},n=this.parseOffset32(),s=this.parseUShort(),r=this.parseULongList(s);this.relativeOffset=e+n,t.variationRegions=this.parseVariationRegionList();for(let o=0;o<s;o++){let a=r[o];this.relativeOffset=e+a,t.itemVariationSubtables.push(this.parseItemVariationSubtable())}return t},k.prototype.parseVariationRegionList=function(){let e=this.parseUShort(),t=this.parseUShort();return this.parseRecordList(t,{regionAxes:k.recordList(e,{startCoord:k.f2Dot14,peakCoord:k.f2Dot14,endCoord:k.f2Dot14})})},k.prototype.parseItemVariationSubtable=function(){let e=this.parseUShort(),t=this.parseUShort(),n=this.parseUShortList(),s=n.length;return{regionIndexes:n,deltaSets:e&&s?this.parseDeltaSets(e,t,s):[]}},k.prototype.parseDeltaSetIndexMap=function(){let e=this.parseByte(),t=this.parseByte(),n=[],s=0;switch(e){case 0:s=this.parseUShort();break;case 1:s=this.parseULong();break;default:console.error(`unsupported DeltaSetIndexMap format ${e}`)}if(!s)return{format:e,entryFormat:t};let r=(t&we.INNER_INDEX_BIT_COUNT_MASK)+1,o=((t&we.MAP_ENTRY_SIZE_MASK)>>4)+1;for(let a=0;a<s;a++){let i;if(o===1)i=this.parseByte();else if(o===2)i=this.parseUShort();else if(o===3)i=this.parseUInt24();else if(o===4)i=this.parseULong();else throw new Error(`Invalid entry size of ${o}`);let l=i>>r,f=i&(1<<r)-1;n.push({outerIndex:l,innerIndex:f})}return{format:e,entryFormat:t,map:n}},k.prototype.parseDeltaSets=function(e,t,n){let s=Array.from({length:e},()=>[]),r=t&we.LONG_WORDS,o=t&we.WORD_DELTA_COUNT_MASK;if(o>n)throw Error("wordCount must be less than or equal to regionIndexCount");let a=(r?this.parseLong:this.parseShort).bind(this),i=(r?this.parseShort:this.parseChar).bind(this);for(let l=0;l<e;l++)for(let f=0;f<n;f++)f<o?s[l].push(a()):s[l].push(i());return s},k.prototype.parseTupleVariationStoreList=function(e,t,n){let s=this.parseUShort(),o=this.parseUShort()&1,a=this.parseOffset32(),i=(o?this.parseULong:this.parseUShort).bind(this),l={},f=i();o||(f*=2);let u;for(let m=0;m<s;m++){u=i(),o||(u*=2);let d=u-f;l[m]=d?this.parseTupleVariationStore(a+f,e,t,n,m):void 0,f=u}return l},k.prototype.parseTupleVariationStore=function(e,t,n,s,r){let o=this.relativeOffset;this.relativeOffset=e,n==="cvar"&&(this.relativeOffset+=4);let a=this.parseUShort(),i=!!(a&we.SHARED_POINT_NUMBERS),l=a&we.COUNT_MASK,f=this.parseOffset16(),u=[],m=[];for(let b=0;b<l;b++){let T=this.parseTupleVariationHeader(t,n);u.push(T)}this.relativeOffset!==e+f&&(console.warn(`Unexpected offset after parsing tuple variation headers! Expected ${e+f}, actually ${this.relativeOffset}`),this.relativeOffset=e+f),i&&(m=this.parsePackedPointNumbers());let d=this.relativeOffset;for(let b=0;b<l;b++){let T=u[b];T.privatePoints=[],this.relativeOffset=d,n==="cvar"&&!T.peakTuple&&console.warn("An embedded peak tuple is required in TupleVariationHeaders for the cvar table."),T.flags.privatePointNumbers&&(T.privatePoints=this.parsePackedPointNumbers()),delete T.flags;let C=this.offset,W=this.relativeOffset,V=X=>{let Q,ie,ce=()=>{let ue=0;if(n==="gvar"){if(ue=T.privatePoints.length||m.length,!ue){let ve=s.get(r);ve.path,ue=ve.points.length,ue+=4}}else n==="cvar"&&(ue=s.length);this.offset=C,this.relativeOffset=W,Q=this.parsePackedDeltas(ue),n==="gvar"&&(ie=this.parsePackedDeltas(ue))};return{configurable:!0,get:function(){return Q===void 0&&ce(),X==="deltasY"?ie:Q},set:function(ue){Q===void 0&&ce(),X==="deltasY"?ie=ue:Q=ue}}};Object.defineProperty(T,"deltas",V.call(this,"deltas")),n==="gvar"&&Object.defineProperty(T,"deltasY",V.call(this,"deltasY")),d+=T.variationDataSize,delete T.variationDataSize}this.relativeOffset=o;let S={headers:u};return S.sharedPoints=m,S},k.prototype.parseTupleVariationHeader=function(e,t){let n=this.parseUShort(),s=this.parseUShort(),r=!!(s&we.EMBEDDED_PEAK_TUPLE),o=!!(s&we.INTERMEDIATE_REGION),a=!!(s&we.PRIVATE_POINT_NUMBERS),i=r?void 0:s&we.TUPLE_INDEX_MASK,l=r?this.parseTupleRecords(1,e)[0]:void 0,f=o?this.parseTupleRecords(1,e)[0]:void 0,u=o?this.parseTupleRecords(1,e)[0]:void 0,m={variationDataSize:n,peakTuple:l,intermediateStartTuple:f,intermediateEndTuple:u,flags:{embeddedPeakTuple:r,intermediateRegion:o,privatePointNumbers:a}};return t==="gvar"&&(m.sharedTupleRecordsIndex=i),m},k.prototype.parsePackedPointNumbers=function(){let e=this.parseByte(),t=[],n=e;if(e>=128){let r=this.parseByte();n=(e&we.POINT_RUN_COUNT_MASK)<<8|r}let s=0;for(;t.length<n;){let r=this.parseByte(),o=!!(r&we.POINTS_ARE_WORDS),a=(r&we.POINT_RUN_COUNT_MASK)+1;for(let i=0;i<a&&t.length<n;i++){let l;o?l=this.parseUShort():l=this.parseByte(),s=s+l,t.push(s)}}return t},k.prototype.parsePackedDeltas=function(e){let t=[];for(;t.length<e;){let n=this.parseByte(),s=!!(n&we.DELTAS_ARE_ZERO),r=!!(n&we.DELTAS_ARE_WORDS),o=(n&we.DELTA_RUN_COUNT_MASK)+1;for(let a=0;a<o&&t.length<e;a++)s?t.push(0):r?t.push(this.parseShort()):t.push(this.parseChar())}return t};var B={getByte:fr,getCard8:fr,getUShort:yn,getCard16:yn,getShort:pi,getUInt24:pr,getULong:es,getFixed:hr,getTag:di,getOffset:gi,getBytes:mi,bytesToString:yi,Parser:k},bn=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],gr={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"},vi={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},mr={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 xi(e,t,n){switch(e){case 0:if(t===65535)return"und";if(n)return n[t];break;case 1:return gr[t];case 3:return mr[t]}}var ts="utf-16",Si={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"},Ti={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 ns(e,t,n){switch(e){case 0:return ts;case 1:return Ti[n]||Si[t];case 3:if(t===1||t===10)return ts;break}}var yr={0:"unicode",1:"macintosh",2:"reserved",3:"windows"};function ki(e){return yr[e]}function wi(e,t,n){let s={},r=new B.Parser(e,t),o=r.parseUShort(),a=r.parseUShort(),i=r.offset+r.parseUShort();for(let l=0;l<a;l++){let f=r.parseUShort(),u=r.parseUShort(),m=r.parseUShort(),d=r.parseUShort(),S=bn[d]||d,b=r.parseUShort(),T=r.parseUShort(),C=xi(f,m,n),W=ns(f,u,m),V=ki(f);if(W!==void 0&&C!==void 0&&V!==void 0){let X;if(W===ts?X=Rt.UTF16(e,i+T,b):X=Rt.MACSTRING(e,i+T,b,W),X){let Q=s[V];Q===void 0&&(Q=s[V]={});let ie=Q[S];ie===void 0&&(ie=Q[S]={}),ie[C]=X}}}return o===1&&r.parseUShort(),s}function vn(e){let t={};for(let n in e)t[e[n]]=parseInt(n);return t}function br(e,t,n,s,r,o){return new I.Record("NameRecord",[{name:"platformID",type:"USHORT",value:e},{name:"encodingID",type:"USHORT",value:t},{name:"languageID",type:"USHORT",value:n},{name:"nameID",type:"USHORT",value:s},{name:"length",type:"USHORT",value:r},{name:"offset",type:"USHORT",value:o}])}function Ci(e,t){let n=e.length,s=t.length-n+1;e:for(let r=0;r<s;r++)for(;r<s;r++){for(let o=0;o<n;o++)if(t[r+o]!==e[o])continue e;return r}return-1}function vr(e,t){let n=Ci(e,t);if(n<0){n=t.length;let s=0,r=e.length;for(;s<r;++s)t.push(e[s])}return n}function Oi(e,t){let n=vn(yr),s=vn(gr),r=vn(mr),o=[],a=[];for(let l in e){let f,u=[],m={},d=vn(bn),S=n[l];for(let b in e[l]){let T=d[b];if(T===void 0&&(T=b),f=parseInt(T),isNaN(f))throw new Error('Name table entry "'+b+'" does not exist, see nameTableNames for complete list.');m[f]=e[l][b],u.push(f)}for(let b=0;b<u.length;b++){f=u[b];let T=m[f];for(let C in T){let W=T[C];if(S===1||S===0){let V=s[C],X=vi[V],Q=ns(S,X,V),ie=P.MACSTRING(W,Q);if(S===0&&(V=t.indexOf(C),V<0&&(V=t.length,t.push(C)),X=4,ie=P.UTF16(W)),ie!==void 0){let ce=vr(ie,a);o.push(br(S,X,V,f,ie.length,ce))}}if(S===3){let V=r[C];if(V!==void 0){let X=P.UTF16(W),Q=vr(X,a);o.push(br(3,1,V,f,X.length,Q))}}}}}o.sort(function(l,f){return l.platformID-f.platformID||l.encodingID-f.encodingID||l.languageID-f.languageID||l.nameID-f.nameID});let i=new I.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:o.length},{name:"stringOffset",type:"USHORT",value:6+o.length*12}]);for(let l=0;l<o.length;l++)i.fields.push({name:"record_"+l,type:"RECORD",value:o[l]});return i.fields.push({name:"strings",type:"LITERAL",value:a}),i}function xn(e,t,n=[]){if(t<256&&t in bn){if(n.length&&!n.includes(parseInt(t)))return;t=bn[t]}for(let s in e)for(let r in e[s])if(r===t||parseInt(r)===t)return e[s][r]}var xr={parse:wi,make:Oi,getNameByID:xn};function Li(e,t,n,s){e.length=t.parseUShort(),e.language=t.parseUShort()-1;let r=t.parseByteList(e.length),o=Object.assign({},r),a=ns(n,s,e.language),i=ln[a];for(let l=0;l<i.length;l++)o[i.charCodeAt(l)]=r[128+l];e.glyphIndexMap=o}function Ei(e,t,n){t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong();let s;e.groupCount=s=t.parseULong(),e.glyphIndexMap={};for(let r=0;r<s;r+=1){let o=t.parseULong(),a=t.parseULong(),i=t.parseULong();for(let l=o;l<=a;l+=1)e.glyphIndexMap[l]=i,n===12&&i++}}function Ri(e,t,n,s,r){e.length=t.parseUShort(),e.language=t.parseUShort();let o;e.segCount=o=t.parseUShort()>>1,t.skip("uShort",3),e.glyphIndexMap={};let a=new B.Parser(n,s+r+14),i=new B.Parser(n,s+r+16+o*2),l=new B.Parser(n,s+r+16+o*4),f=new B.Parser(n,s+r+16+o*6),u=s+r+16+o*8;for(let m=0;m<o-1;m+=1){let d,S=a.parseUShort(),b=i.parseUShort(),T=l.parseShort(),C=f.parseUShort();for(let W=b;W<=S;W+=1)C!==0?(u=f.offset+f.relativeOffset-2,u+=C,u+=(W-b)*2,d=B.getUShort(n,u),d!==0&&(d=d+T&65535)):d=W+T&65535,e.glyphIndexMap[W]=d}}function Ai(e,t){let n={};t.skip("uLong");let s=t.parseULong();for(let r=0;r<s;r+=1){let o=t.parseUInt24(),a={varSelector:o},i=t.parseOffset32(),l=t.parseOffset32(),f=t.relativeOffset;i&&(t.relativeOffset=i,a.defaultUVS=t.parseStruct({ranges:function(){return t.parseRecordList32({startUnicodeValue:t.parseUInt24,additionalCount:t.parseByte})}})),l&&(t.relativeOffset=l,a.nonDefaultUVS=t.parseStruct({uvsMappings:function(){let u={},m=t.parseRecordList32({unicodeValue:t.parseUInt24,glyphID:t.parseUShort});for(let d=0;d<m.length;d+=1)u[m[d].unicodeValue]=m[d];return u}})),n[o]=a,t.relativeOffset=f}e.varSelectorList=n}function Ii(e,t){let n={};n.version=B.getUShort(e,t),$.argument(n.version===0,"cmap table version should be 0."),n.numTables=B.getUShort(e,t+2);let s=null,r=-1,o=-1,a=null,i=null,l=[0,1,2,3,4,6],f=[0,1,10];for(let m=n.numTables-1;m>=0;m-=1)if(a=B.getUShort(e,t+4+m*8),i=B.getUShort(e,t+4+m*8+2),a===3&&f.includes(i)||a===0&&l.includes(i)||a===1&&i===0){if(o>0)continue;if(o=B.getULong(e,t+4+m*8+4),s)break}else if(a===0&&i===5){if(r=B.getULong(e,t+4+m*8+4),s=new B.Parser(e,t+r),s.parseUShort()!==14)r=-1,s=null;else if(o>0)break}if(o===-1)throw new Error("No valid cmap sub-tables found.");let u=new B.Parser(e,t+o);if(n.format=u.parseUShort(),n.format===0)Li(n,u,a,i);else if(n.format===12||n.format===13)Ei(n,u,n.format);else if(n.format===4)Ri(n,u,e,t,o);else throw new Error("Only format 0 (platformId 1, encodingId 0), 4, 12 and 14 cmap tables are supported (found format "+n.format+", platformId "+a+", encodingId "+i+").");return s&&Ai(n,s),n}function Fi(e,t,n){e.segments.push({end:t,start:t,delta:-(t-n),offset:0,glyphIndex:n})}function Di(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}function Ui(e){if(e.length===0)return e;let t=[e[0]];for(let n=1;n<e.length;n++){let s=t[t.length-1],r=e[n];s.end+1===r.start&&s.delta===r.delta&&r.end!==65535?s.end=r.end:t.push(r)}return t}function Mi(e){let t=!0,n;for(n=e.length-1;n>0;n-=1)if(e.get(n).unicode>65535){t=!1;break}let s=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:t?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:t?12:20}];t||s.push({name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}),s.push({name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0});let r=new I.Table("cmap",s);for(r.segments=[],n=0;n<e.length;n+=1){let S=e.get(n);for(let b=0;b<S.unicodes.length;b+=1)Fi(r,S.unicodes[b],n)}r.segments.sort(function(S,b){return S.start-b.start}),r.segments=Ui(r.segments),Di(r);let o=r.segments.length,a=0,i=[],l=[],f=[],u=[],m=[],d=[];for(n=0;n<o;n+=1){let S=r.segments[n];S.end<=65535&&S.start<=65535?(i.push({name:"end_"+n,type:"USHORT",value:S.end}),l.push({name:"start_"+n,type:"USHORT",value:S.start}),f.push({name:"idDelta_"+n,type:"SHORT",value:S.delta}),u.push({name:"idRangeOffset_"+n,type:"USHORT",value:S.offset}),S.glyphId!==void 0&&m.push({name:"glyph_"+n,type:"USHORT",value:S.glyphId})):a+=1,!t&&S.glyphIndex!==void 0&&(d.push({name:"cmap12Start_"+n,type:"ULONG",value:S.start}),d.push({name:"cmap12End_"+n,type:"ULONG",value:S.end}),d.push({name:"cmap12Glyph_"+n,type:"ULONG",value:S.glyphIndex}))}r.segCountX2=(o-a)*2,r.searchRange=Math.pow(2,Math.floor(Math.log(o-a)/Math.log(2)))*2,r.entrySelector=Math.log(r.searchRange/2)/Math.log(2),r.rangeShift=r.segCountX2-r.searchRange;for(let S=0;S<i.length;S++)r.fields.push(i[S]);r.fields.push({name:"reservedPad",type:"USHORT",value:0});for(let S=0;S<l.length;S++)r.fields.push(l[S]);for(let S=0;S<f.length;S++)r.fields.push(f[S]);for(let S=0;S<u.length;S++)r.fields.push(u[S]);for(let S=0;S<m.length;S++)r.fields.push(m[S]);if(r.cmap4Length=14+i.length*2+2+l.length*2+f.length*2+u.length*2+m.length*2,!t){let S=16+d.length*4;r.cmap12Offset=20+r.cmap4Length,r.fields.push({name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:S},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:d.length/3});for(let b=0;b<d.length;b++)r.fields.push(d[b])}return r}var Sr={parse:Ii,make:Mi},Sn=[".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"],Pi=[".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"],Bi=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],Ni=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"],ss=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],_i=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],xt=[".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 Tr(e){this.font=e}Tr.prototype.charToGlyphIndex=function(e){let t=e.codePointAt(0),n=this.font.glyphs;if(n)for(let s=0;s<n.length;s+=1){let r=n.get(s);for(let o=0;o<r.unicodes.length;o+=1)if(r.unicodes[o]===t)return s}return null};function kr(e){this.cmap=e}kr.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0};function wr(e,t){this.encoding=e,this.charset=t}wr.prototype.charToGlyphIndex=function(e){let t=e.codePointAt(0),n=this.encoding[t];return this.charset.indexOf(n)};function rs(e){switch(e.version){case 1:this.names=xt.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(let t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<xt.length?this.names[t]=xt[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-xt.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(let t=0;t<e.numberOfGlyphs;t++)this.names[t]=xt[t+e.glyphNameIndex[t]];break;case 3:this.names=[];break;default:this.names=[];break}}rs.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},rs.prototype.glyphIndexToName=function(e){return this.names[e]};function Gi(e){let t,n=e.tables.cmap.glyphIndexMap,s=Object.keys(n);for(let r=0;r<s.length;r+=1){let o=s[r],a=n[o];t=e.glyphs.get(a),t.addUnicode(parseInt(o))}for(let r=0;r<e.glyphs.length;r+=1)t=e.glyphs.get(r),e.cffEncoding?t.name=e.cffEncoding.charset[r]:e.glyphNames.names&&(t.name=e.glyphNames.glyphIndexToName(r))}function Hi(e){e._IndexToUnicodeMap={};let t=e.tables.cmap.glyphIndexMap,n=Object.keys(t);for(let s=0;s<n.length;s+=1){let r=n[s],o=t[r];e._IndexToUnicodeMap[o]===void 0?e._IndexToUnicodeMap[o]={unicodes:[parseInt(r)]}:e._IndexToUnicodeMap[o].unicodes.push(parseInt(r))}}function Vi(e,t){t.lowMemory?Hi(e):Gi(e)}function ji(e,t,n,s,r){e.beginPath(),e.moveTo(t,n),e.lineTo(s,r),e.stroke()}var St={line:ji};function $i(e,t){let n=new k(e,t),s=n.parseShort();s!==0&&console.warn("Only CPALv0 is currently fully supported.");let r=n.parseShort(),o=n.parseShort(),a=n.parseShort(),i=n.parseOffset32(),l=n.parseUShortList(o);n.relativeOffset=i;let f=n.parseULongList(a);return n.relativeOffset=i,{version:s,numPaletteEntries:r,colorRecords:f,colorRecordIndices:l}}function Wi({version:e=0,numPaletteEntries:t=0,colorRecords:n=[],colorRecordIndices:s=[0]}){return $.argument(e===0,"Only CPALv0 are supported."),$.argument(n.length,"No colorRecords given."),$.argument(s.length,"No colorRecordIndices given."),s.length>1&&$.argument(t,"Can't infer numPaletteEntries on multiple colorRecordIndices"),new I.Table("CPAL",[{name:"version",type:"USHORT",value:e},{name:"numPaletteEntries",type:"USHORT",value:t||n.length},{name:"numPalettes",type:"USHORT",value:s.length},{name:"numColorRecords",type:"USHORT",value:n.length},{name:"colorRecordsArrayOffset",type:"ULONG",value:12+2*s.length},...s.map((r,o)=>({name:"colorRecordIndices_"+o,type:"USHORT",value:r})),...n.map((r,o)=>({name:"colorRecords_"+o,type:"ULONG",value:r}))])}function Cr(e){var t=(e&4278190080)>>24,n=(e&16711680)>>16,s=(e&65280)>>8,r=e&255;return t=t+256&255,n=n+256&255,s=s+256&255,r=(r+256&255)/255,{b:t,g:n,r:s,a:r}}function os(e,t,n=0,s="hexa"){if(t==65535)return"currentColor";let r=e&&e.tables&&e.tables.cpal;if(!r)return"currentColor";if(n>r.colorRecordIndices.length-1)throw new Error(`Palette index out of range (colorRecordIndices.length: ${r.colorRecordIndices.length}, index: ${t})`);if(t>r.numPaletteEntries)throw new Error(`Color index out of range (numPaletteEntries: ${r.numPaletteEntries}, index: ${t})`);let o=r.colorRecordIndices[n]+t;if(o>r.colorRecords)throw new Error(`Color index out of range (colorRecords.length: ${r.colorRecords.length}, lookupIndex: ${o})`);let a=Cr(r.colorRecords[o]);return s==="bgra"?a:Ft(a,s)}function ze(e){return("0"+parseInt(e).toString(16)).slice(-2)}function zi(e){let t=e.r/255,n=e.g/255,s=e.b/255,r=Math.max(t,n,s),o=Math.min(t,n,s),a,i,l=(r+o)/2;if(r===o)a=i=0;else{let f=r-o;switch(i=l>.5?f/(2-r-o):f/(r+o),r){case t:a=(n-s)/f+(n<s?6:0);break;case n:a=(s-t)/f+2;break;case s:a=(t-n)/f+4;break}a/=6}return{h:a*360,s:i*100,l:l*100}}function Xi(e){let{h:t,s:n,l:s,a:r}=e;t=t%360,n/=100,s/=100;let o=(1-Math.abs(2*s-1))*n,a=o*(1-Math.abs(t/60%2-1)),i=s-o/2,l=0,f=0,u=0;return 0<=t&&t<60?(l=o,f=a,u=0):60<=t&&t<120?(l=a,f=o,u=0):120<=t&&t<180?(l=0,f=o,u=a):180<=t&&t<240?(l=0,f=a,u=o):240<=t&&t<300?(l=a,f=0,u=o):300<=t&&t<=360&&(l=o,f=0,u=a),{r:Math.round((l+i)*255),g:Math.round((f+i)*255),b:Math.round((u+i)*255),a:r}}function Or(e){return parseInt(`0x${ze(e.b)}${ze(e.g)}${ze(e.r)}${ze(e.a*255)}`,16)}function Tn(e,t="hexa"){let n=t=="raw"||t=="cpal",s=Number.isInteger(e),r=!0;if(s&&n||e==="currentColor")return e;if(typeof e=="object"){if(t=="bgra")return e;if(n)return Or(e)}else if(!s&&/^#([a-f0-9]{3}|[a-f0-9]{4}|[a-f0-9]{6}|[a-f0-9]{8})$/i.test(e.trim())){switch(e=e.trim().substring(1),e.length){case 3:e={r:parseInt(e[0].repeat(2),16),g:parseInt(e[1].repeat(2),16),b:parseInt(e[2].repeat(2),16),a:1};break;case 4:e={r:parseInt(e[0].repeat(2),16),g:parseInt(e[1].repeat(2),16),b:parseInt(e[2].repeat(2),16),a:parseInt(e[3].repeat(2),16)/255};break;case 6:e={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16),a:1};break;case 8:e={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16),a:parseInt(e[6]+e[7],16)/255};break}if(t=="bgra")return e}else if(typeof document<"u"&&/^[a-z]+$/i.test(e)){let o=document.createElement("canvas").getContext("2d");o.fillStyle=e;let a=Ft(o.fillStyle,"hexa");a==="#000000ff"&&e.toLowerCase()!=="black"?r=!1:e=a}else{e=e.trim();let o=/rgba?\(\s*(?:(\d*\.\d+)(%?)|(\d+)(%?))\s*(?:,|\s*)\s*(?:(\d*\.\d+)(%?)|(\d+)(%?))\s*(?:,|\s*)\s*(?:(\d*\.\d+)(%?)|(\d+)(%?))\s*(?:(?:,|\s|\/)\s*(?:(0*(?:\.\d+)?()|0*1(?:\.0+)?())|(?:\.\d+)|(\d+)(%)|(\d*\.\d+)(%)))?\s*\)/;if(o.test(e)){let a=e.match(o).filter(i=>typeof i<"u");e={r:Math.round(parseFloat(a[1])/(a[2]?.39215686274509803:1)),g:Math.round(parseFloat(a[3])/(a[4]?.39215686274509803:1)),b:Math.round(parseFloat(a[5])/(a[6]?.39215686274509803:1)),a:a[7]?parseFloat(a[7])/(a[8]?100:1):1}}else{let a=/hsla?\(\s*(?:(\d*\.\d+|\d+)(deg|turn|))\s*(?:,|\s*)\s*(?:(\d*\.\d+)%?|(\d+)%?)\s*(?:,|\s*)\s*(?:(\d*\.\d+)%?|(\d+)%?)\s*(?:(?:,|\s|\/)\s*(?:(0*(?:\.\d+)?()|0*1(?:\.0+)?())|(?:\.\d+)|(\d+)(%)|(\d*\.\d+)(%)))?\s*\)/;if(a.test(e)){let i=e.match(a).filter(l=>typeof l<"u");e=Xi({h:parseFloat(i[1])*(i[2]==="turn"?360:1),s:parseFloat(i[3]),l:parseFloat(i[4]),a:i[5]?parseFloat(i[5])/(i[6]?100:1):1})}else r=!1}}if(!r)throw new Error(`Invalid color format: ${e}`);return Ft(e,t)}function Ft(e,t="hexa"){if(e==="currentColor")return e;if(Number.isInteger(e)){if(t=="raw"||t=="cpal")return e;e=Cr(e)}else typeof e!="object"&&(e=Tn(e,"bgra"));let n=["hsl","hsla"].includes(t)?zi(e):null;switch(t){case"rgba":return`rgba(${e.r}, ${e.g}, ${e.b}, ${parseFloat(e.a.toFixed(3))})`;case"rgb":return`rgb(${e.r}, ${e.g}, ${e.b})`;case"hex":case"hex6":case"hex-6":return`#${ze(e.r)}${ze(e.g)}${ze(e.b)}`;case"hexa":case"hex8":case"hex-8":return`#${ze(e.r)}${ze(e.g)}${ze(e.b)}${ze(e.a*255)}`;case"hsl":return`hsl(${n.h.toFixed(2)}, ${n.s.toFixed(2)}%, ${n.l.toFixed(2)}%)`;case"hsla":return`hsla(${n.h.toFixed(2)}, ${n.s.toFixed(2)}%, ${n.l.toFixed(2)}%, ${parseFloat(e.a.toFixed(3))})`;case"bgra":return e;case"raw":case"cpal":return Or(e);default:throw new Error("Unknown color format: "+t)}}var Lr={parse:$i,make:Wi,getPaletteColor:os,parseColor:Tn,formatColor:Ft};function qi(e,t){let n=t||new vt;return{configurable:!0,get:function(){return typeof n=="function"&&(n=n()),n},set:function(s){n=s}}}function Ce(e){this.bindConstructorValues(e)}Ce.prototype.bindConstructorValues=function(e){if(this.index=e.index||0,e.name===".notdef"?e.unicode=void 0:e.name===".null"&&(e.unicode=0),e.unicode===0&&e.name!==".null")throw new Error('The unicode value "0" is reserved for the glyph name ".null" and cannot be used by any other glyph.');this.name=e.name||null,this.unicode=e.unicode,this.unicodes=e.unicodes||(e.unicode!==void 0?[e.unicode]:[]),"xMin"in e&&(this.xMin=e.xMin),"yMin"in e&&(this.yMin=e.yMin),"xMax"in e&&(this.xMax=e.xMax),"yMax"in e&&(this.yMax=e.yMax),"advanceWidth"in e&&(this.advanceWidth=e.advanceWidth),"leftSideBearing"in e&&(this.leftSideBearing=e.leftSideBearing),"points"in e&&(this.points=e.points),Object.defineProperty(this,"path",qi(this,e.path))},Ce.prototype.addUnicode=function(e){this.unicodes.length===0&&(this.unicode=e),this.unicodes.push(e)},Ce.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},Ce.prototype.getPath=function(e,t,n,s,r){e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:72,s=Object.assign({},r&&r.defaultRenderOptions,s);let o,a,i=s.xScale,l=s.yScale,f=1/(this.path.unitsPerEm||1e3)*n,u=this;r&&r.variation&&(u=r.variation.getTransform(this,s.variation),o=u.path.commands),s.hinting&&r&&r.hinting&&(a=u.path&&r.hinting.exec(u,n,s)),a?(o=r.hinting.getCommands(a),e=Math.round(e),t=Math.round(t),i=l=1):(o=u.path.commands,i===void 0&&(i=f),l===void 0&&(l=f));let m=new vt;if(s.drawSVG){let d=this.getSvgImage(r);if(d){let S=new vt;return S._image={image:d.image,x:e+d.leftSideBearing*f,y:t-d.baseline*f,width:d.image.width*f,height:d.image.height*f},m._layers=[S],m}}if(s.drawLayers){let d=this.getLayers(r);if(d&&d.length){m._layers=[];for(let S=0;S<d.length;S+=1){let b=d[S],T=os(r,b.paletteIndex,s.usePalette);T==="currentColor"?T=s.fill||"black":T=Ft(T,s.colorFormat||"rgba"),s=Object.assign({},s,{fill:T}),m._layers.push(this.getPath.call(b.glyph,e,t,n,s,r))}return m}}m.fill=s.fill||this.path.fill,m.stroke=this.path.stroke,m.strokeWidth=this.path.strokeWidth*f;for(let d=0;d<o.length;d+=1){let S=o[d];S.type==="M"?m.moveTo(e+S.x*i,t+-S.y*l):S.type==="L"?m.lineTo(e+S.x*i,t+-S.y*l):S.type==="Q"?m.quadraticCurveTo(e+S.x1*i,t+-S.y1*l,e+S.x*i,t+-S.y*l):S.type==="C"?m.curveTo(e+S.x1*i,t+-S.y1*l,e+S.x2*i,t+-S.y2*l,e+S.x*i,t+-S.y*l):S.type==="Z"&&m.stroke&&m.strokeWidth&&m.closePath()}return m},Ce.prototype.getLayers=function(e){if(!e)throw new Error("The font object is required to read the colr/cpal tables in order to get the layers.");return e.layers.get(this.index)},Ce.prototype.getSvgImage=function(e){if(!e)throw new Error("The font object is required to read the svg table in order to get the image.");return e.svgImages.get(this.index)},Ce.prototype.getContours=function(e=null){if(this.points===void 0&&!e)return[];let t=[],n=[],s=e||this.points;for(let r=0;r<s.length;r+=1){let o=s[r];n.push(o),o.lastPointOfContour&&(t.push(n),n=[])}return $.argument(n.length===0,"There are still points left in the current contour."),t},Ce.prototype.getMetrics=function(){let e=this.path.commands,t=[],n=[];for(let r=0;r<e.length;r+=1){let o=e[r];o.type!=="Z"&&(t.push(o.x),n.push(o.y)),(o.type==="Q"||o.type==="C")&&(t.push(o.x1),n.push(o.y1)),o.type==="C"&&(t.push(o.x2),n.push(o.y2))}let s={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,n),leftSideBearing:this.leftSideBearing};return isFinite(s.xMin)||(s.xMin=0),isFinite(s.xMax)||(s.xMax=this.advanceWidth),isFinite(s.yMin)||(s.yMin=0),isFinite(s.yMax)||(s.yMax=0),s.rightSideBearing=this.advanceWidth-s.leftSideBearing-(s.xMax-s.xMin),s},Ce.prototype.draw=function(e,t,n,s,r,o){r=Object.assign({},o&&o.defaultRenderOptions,r),this.getPath(t,n,s,r,o).draw(e)},Ce.prototype.drawPoints=function(e,t,n,s,r,o){if(r=Object.assign({},o&&o.defaultRenderOptions,r),r.drawLayers){let d=this.getLayers(o);if(d&&d.length){for(let S=0;S<d.length;S+=1)d[S].glyph.index!==this.index&&this.drawPoints.call(d[S].glyph,e,t,n,s);return}}function a(d,S,b,T){e.beginPath();for(let C=0;C<d.length;C+=1)e.moveTo(S+d[C].x*T,b+d[C].y*T),e.arc(S+d[C].x*T,b+d[C].y*T,2,0,Math.PI*2,!1);e.fill()}t=t!==void 0?t:0,n=n!==void 0?n:0,s=s!==void 0?s:24;let i=1/this.path.unitsPerEm*s,l=[],f=[],m=this.path.commands;o&&o.variation&&(m=o.variation.getTransform(this,r.variation).path.commands);for(let d=0;d<m.length;d+=1){let S=m[d];S.x!==void 0&&l.push({x:S.x,y:-S.y}),S.x1!==void 0&&f.push({x:S.x1,y:-S.y1}),S.x2!==void 0&&f.push({x:S.x2,y:-S.y2})}e.fillStyle="blue",a(l,t,n,i),e.fillStyle="red",a(f,t,n,i)},Ce.prototype.drawMetrics=function(e,t,n,s){let r;t=t!==void 0?t:0,n=n!==void 0?n:0,s=s!==void 0?s:24,r=1/this.path.unitsPerEm*s,e.lineWidth=1,e.strokeStyle="black",St.line(e,t,-1e4,t,1e4),St.line(e,-1e4,n,1e4,n);let o=this.xMin||0,a=this.yMin||0,i=this.xMax||0,l=this.yMax||0,f=this.advanceWidth||0;e.strokeStyle="blue",St.line(e,t+o*r,-1e4,t+o*r,1e4),St.line(e,t+i*r,-1e4,t+i*r,1e4),St.line(e,-1e4,n+-a*r,1e4,n+-a*r),St.line(e,-1e4,n+-l*r,1e4,n+-l*r),e.strokeStyle="green",St.line(e,t+f*r,-1e4,t+f*r,1e4)},Ce.prototype.toPathData=function(e,t){e=Object.assign({},{variation:t&&t.defaultRenderOptions.variation},e);let n=this;t&&t.variation&&(n=t.variation.getTransform(this,e.variation));let s=n.points&&e.pointsTransform?e.pointsTransform(n.points):n.path;return e.pathTransform&&(s=e.pathTransform(s)),s.toPathData(e)},Ce.prototype.fromSVG=function(e,t={}){return this.path.fromSVG(e,t)},Ce.prototype.toSVG=function(e,t){let n=this.toPathData.apply(this,[e,t]);return this.path.toSVG(e,n)},Ce.prototype.toDOMElement=function(e,t){e=Object.assign({},{variation:t&&t.defaultRenderOptions.variation},e);let n=this.path;return t&&t.variation&&(n=t.variation.getTransform(this,e.variation).path),n.toDOMElement(e)};var Dt=Ce;function Ut(e,t,n){Object.defineProperty(e,t,{get:function(){return typeof e[n]>"u"&&e.path,e[n]},set:function(s){e[n]=s},enumerable:!0,configurable:!0})}function kn(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(let n=0;n<t.length;n++){let s=t[n];s.path.unitsPerEm=e.unitsPerEm,this.glyphs[n]=s}this.length=t&&t.length||0}typeof Symbol<"u"&&Symbol.iterator&&(kn.prototype[Symbol.iterator]=function(){let e=-1;return{next:function(){e++;let t=e>=this.length-1;return{value:this.get(e),done:t}}.bind(this)}}),kn.prototype.get=function(e){if(this.font._push&&this.glyphs[e]===void 0){this.font._push(e),typeof this.glyphs[e]=="function"&&(this.glyphs[e]=this.glyphs[e]());let t=this.glyphs[e],n=this.font._IndexToUnicodeMap[e];if(n)for(let s=0;s<n.unicodes.length;s++)t.addUnicode(n.unicodes[s]);this.font.cffEncoding?t.name=this.font.cffEncoding.charset[e]:this.font.glyphNames.names&&(t.name=this.font.glyphNames.glyphIndexToName(e)),this.glyphs[e].advanceWidth=this.font._hmtxTableData[e].advanceWidth,this.glyphs[e].leftSideBearing=this.font._hmtxTableData[e].leftSideBearing}else typeof this.glyphs[e]=="function"&&(this.glyphs[e]=this.glyphs[e]());return this.glyphs[e]},kn.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};function Yi(e,t){return new Dt({index:t,font:e})}function Zi(e,t,n,s,r,o){return function(){let a=new Dt({index:t,font:e});return a.path=function(){n(a,s,r);let i=o(e.glyphs,a);return i.unitsPerEm=e.unitsPerEm,i},Ut(a,"numberOfContours","_numberOfContours"),Ut(a,"xMin","_xMin"),Ut(a,"xMax","_xMax"),Ut(a,"yMin","_yMin"),Ut(a,"yMax","_yMax"),Ut(a,"points","_points"),a}}function Ki(e,t,n,s,r){return function(){let o=new Dt({index:t,font:e});return o.path=function(){let a=n(e,o,s,r);return a.unitsPerEm=e.unitsPerEm,a},o}}var Je={GlyphSet:kn,glyphLoader:Yi,ttfGlyphLoader:Zi,cffGlyphLoader:Ki};function Er(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(!Er(e[n],t[n]))return!1;return!0}else return!1}var Rr=10;function wn(e){let t;return e.length<1240?t=107:e.length<33900?t=1131:t=32768,t}function et(e,t,n,s){let r=[],o=[],a=s>1?B.getULong(e,t):B.getCard16(e,t),i=s>1?4:2,l,f;if(a!==0){let u=B.getByte(e,t+i);l=t+(a+1)*u+i;let m=t+i+1;for(let d=0;d<a+1;d+=1)r.push(B.getOffset(e,m,u)),m+=u;f=l+r[a]}else f=t+i;for(let u=0;u<r.length-1;u+=1){let m=B.getBytes(e,l+r[u],l+r[u+1]);n&&(m=n(m,e,t,s)),o.push(m)}return{objects:o,startOffset:t,endOffset:f}}function Qi(e,t,n){let s=[],r=n>1?B.getULong(e,t):B.getCard16(e,t),o=n>1?4:2,a,i;if(r!==0){let l=B.getByte(e,t+o);a=t+(r+1)*l+o;let f=t+o+1;for(let u=0;u<r+1;u+=1)s.push(B.getOffset(e,f,l)),f+=l;i=a+s[r]}else i=t+o;return{offsets:s,startOffset:t,endOffset:i}}function Ji(e,t,n,s,r,o){let a=o>1?B.getULong(n,s):B.getCard16(n,s),i=o>1?4:2,l=0;if(a!==0){let u=B.getByte(n,s+i);l=s+(a+1)*u+i}let f=B.getBytes(n,l+t[e],l+t[e+1]);return r&&(f=r(f)),f}function el(e){let t="",s=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){let r=e.parseByte(),o=r>>4,a=r&15;if(o===15||(t+=s[o],a===15))break;t+=s[a]}return parseFloat(t)}function tl(e,t){let n,s,r,o;if(t===28)return n=e.parseByte(),s=e.parseByte(),n<<8|s;if(t===29)return n=e.parseByte(),s=e.parseByte(),r=e.parseByte(),o=e.parseByte(),n<<24|s<<16|r<<8|o;if(t===30)return el(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return n=e.parseByte(),(t-247)*256+n+108;if(t>=251&&t<=254)return n=e.parseByte(),-(t-251)*256-n-108;throw new Error("Invalid b0 "+t)}function nl(e){let t={};for(let n=0;n<e.length;n+=1){let s=e[n][0],r=e[n][1],o;if(r.length===1?o=r[0]:o=r,Object.prototype.hasOwnProperty.call(t,s)&&!isNaN(t[s]))throw new Error("Object "+t+" already has key "+s);t[s]=o}return t}function as(e,t,n,s){t=t!==void 0?t:0;let r=new B.Parser(e,t),o=[],a=[];n=n!==void 0?n:e.byteLength;let i=s<2?22:28;for(;r.relativeOffset<n;){let l=r.parseByte();if(l<i){if(l===12&&(l=1200+r.parseByte()),s>1&&l===23){ul(a);continue}o.push([l,a]),a=[]}else a.push(tl(r,l,s))}return nl(o)}function Wt(e,t){return t<=390?t=Sn[t]:e?t=e[t-391]:t=void 0,t}function is(e,t,n){let s={},r;for(let o=0;o<t.length;o+=1){let a=t[o];if(Array.isArray(a.type)){let i=[];i.length=a.type.length;for(let l=0;l<a.type.length;l++)r=e[a.op]!==void 0?e[a.op][l]:void 0,r===void 0&&(r=a.value!==void 0&&a.value[l]!==void 0?a.value[l]:null),a.type[l]==="SID"&&(r=Wt(n,r)),i[l]=r;s[a.name]=i}else r=e[a.op],r===void 0&&(r=a.value!==void 0?a.value:null),a.type==="SID"&&(r=Wt(n,r)),s[a.name]=r}return s}function sl(e,t){let n={};if(n.formatMajor=B.getCard8(e,t),n.formatMinor=B.getCard8(e,t+1),n.formatMajor>2)throw new Error(`Unsupported CFF table version ${n.formatMajor}.${n.formatMinor}`);return n.size=B.getCard8(e,t+2),n.formatMajor<2?(n.offsetSize=B.getCard8(e,t+3),n.startOffset=t,n.endOffset=t+4):(n.topDictLength=B.getCard16(e,t+3),n.endOffset=t+8),n}var Ar=[{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"}],Ir=[{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"charStrings",op:17,type:"offset"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"vstore",op:24,type:"offset"}],Fr=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}],Dr=[{name:"blueValues",op:6,type:"delta"},{name:"otherBlues",op:7,type:"delta"},{name:"familyBlues",op:7,type:"delta"},{name:"familyBlues",op:8,type:"delta"},{name:"familyOtherBlues",op:9,type:"delta"},{name:"blueScale",op:1209,type:"number",value:.039625},{name:"blueShift",op:1210,type:"number",value:7},{name:"blueFuzz",op:1211,type:"number",value:1},{name:"stdHW",op:10,type:"number"},{name:"stdVW",op:11,type:"number"},{name:"stemSnapH",op:1212,type:"number"},{name:"stemSnapV",op:1213,type:"number"},{name:"languageGroup",op:1217,type:"number",value:0},{name:"expansionFactor",op:1218,type:"number",value:.06},{name:"vsindex",op:22,type:"number",value:0},{name:"subrs",op:19,type:"offset"}],rl=[{name:"private",op:18,type:["number","offset"],value:[0,0]}];function ol(e,t,n,s){let r=as(e,t,e.byteLength,s);return is(r,s>1?Ir:Ar,n)}function ls(e,t,n,s,r){let o=as(e,t,n,r);return is(o,r>1?Dr:Fr,s)}function al(e,t,n){let s=as(e,t,void 0,n);return is(s,rl)}function il(e,t,n){let s=[];for(let r=0;r<n.length;r++){let o=new DataView(new Uint8Array(n[r]).buffer),a=al(o,0,2),i=a.private[0],l=a.private[1];if(i!==0&&l!==0){let f=ls(e,l+t,i,[],2);if(f.subrs){let u=l+f.subrs,m=et(e,u+t,void 0,2);a._subrs=m.objects,a._subrsBias=wn(a._subrs)}a._privateDict=f}s.push(a)}return s}function cs(e,t,n,s,r){let o=[];for(let a=0;a<n.length;a+=1){let i=new DataView(new Uint8Array(n[a]).buffer),l=ol(i,0,s,r);l._subrs=[],l._subrsBias=0,l._defaultWidthX=0,l._nominalWidthX=0;let f=r<2?l.private[0]:0,u=r<2?l.private[1]:0;if(f!==0&&u!==0){let m=ls(e,u+t,f,s,r);if(l._defaultWidthX=m.defaultWidthX,l._nominalWidthX=m.nominalWidthX,m.subrs!==0){let d=u+m.subrs,S=et(e,d+t,void 0,r);l._subrs=S.objects,l._subrsBias=wn(l._subrs)}l._privateDict=m}o.push(l)}return o}function ll(e,t,n,s,r){let o,a,i=new B.Parser(e,t);n-=1;let l=[".notdef"],f=i.parseCard8();if(f===0)for(let u=0;u<n;u+=1)o=i.parseSID(),r?l.push(o):l.push(Wt(s,o)||o);else if(f===1)for(;l.length<=n;){o=i.parseSID(),a=i.parseCard8();for(let u=0;u<=a;u+=1)r?l.push("cid"+("00000"+o).slice(-5)):l.push(Wt(s,o)||o),o+=1}else if(f===2)for(;l.length<=n;){o=i.parseSID(),a=i.parseCard16();for(let u=0;u<=a;u+=1)r?l.push("cid"+("00000"+o).slice(-5)):l.push(Wt(s,o)||o),o+=1}else throw new Error("Unknown charset format "+f);return l}function cl(e,t){let n,s={},r=new B.Parser(e,t),o=r.parseCard8();if(o===0){let a=r.parseCard8();for(let i=0;i<a;i+=1)n=r.parseCard8(),s[n]=i}else if(o===1){let a=r.parseCard8();n=1;for(let i=0;i<a;i+=1){let l=r.parseCard8(),f=r.parseCard8();for(let u=l;u<=l+f;u+=1)s[u]=n,n+=1}}else throw new Error("Unknown encoding format "+o);return s}function ul(e){let t=e.pop();for(;e.length>t;)e.pop()}function Ur(e,t){let n=e.tables.cff&&e.tables.cff.topDict&&e.tables.cff.topDict.paintType||0;return n===2&&(t.fill=null,t.stroke="black",t.strokeWidth=e.tables.cff.topDict.strokeWidth||0),n}function us(e,t,n,s,r){let o,a,i,l,f=new vt,u=[],m=0,d=!1,S=!1,b=0,T=0,C,W,V,X,Q=0,ie=[],ce,ue=0,ve=e.tables.cff2||e.tables.cff;if(V=ve.topDict._defaultWidthX,X=ve.topDict._nominalWidthX,r=r||e.variation&&e.variation.get(),t.getBlendPath||(t.getBlendPath=function(G){return us(e,t,n,s,G)}),e.isCIDFont||s>1){let G=ve.topDict._fdSelect?ve.topDict._fdSelect[t.index]:0,H=ve.topDict._fdArray[G];C=H._subrs,W=H._subrsBias,s>1?(ie=ve.topDict._vstore.itemVariationStore,Q=H._privateDict.vsindex):(V=H._defaultWidthX,X=H._nominalWidthX)}else C=ve.topDict._subrs,W=ve.topDict._subrsBias;let Ye=Ur(e,f),J=V;function Ne(G,H){S&&Ye!==2&&f.closePath(),f.moveTo(G,H),S=!0}function Ae(){let G;G=(u.length&1)!==0,G&&!d&&(J=u.shift()+X),m+=u.length>>1,u.length=0,d=!0}function z(G){let H,Oe,gt,Un,Ct,Ze,Ie,Ve,Le,_e,Fe,De,be=0;for(;be<G.length;){let $e=G[be];switch(be+=1,$e){case 1:Ae();break;case 3:Ae();break;case 4:u.length>1&&!d&&(J=u.shift()+X,d=!0),T+=u.pop(),Ne(b,T);break;case 5:for(;u.length>0;)b+=u.shift(),T+=u.shift(),f.lineTo(b,T);break;case 6:for(;u.length>0&&(b+=u.shift(),f.lineTo(b,T),u.length!==0);)T+=u.shift(),f.lineTo(b,T);break;case 7:for(;u.length>0&&(T+=u.shift(),f.lineTo(b,T),u.length!==0);)b+=u.shift(),f.lineTo(b,T);break;case 8:for(;u.length>0;)o=b+u.shift(),a=T+u.shift(),i=o+u.shift(),l=a+u.shift(),b=i+u.shift(),T=l+u.shift(),f.curveTo(o,a,i,l,b,T);break;case 10:if(Ct=u.pop()+W,Ze=C[Ct],Ze){if(ue>=Rr){console.warn("CFF charstring subroutine call depth exceeded, skipping callsubr");break}ue++,z(Ze),ue--}break;case 11:if(s>1){console.error("CFF CharString operator return (11) is not supported in CFF2");break}return;case 12:switch($e=G[be],be+=1,$e){case 35:o=b+u.shift(),a=T+u.shift(),i=o+u.shift(),l=a+u.shift(),Ie=i+u.shift(),Ve=l+u.shift(),Le=Ie+u.shift(),_e=Ve+u.shift(),Fe=Le+u.shift(),De=_e+u.shift(),b=Fe+u.shift(),T=De+u.shift(),u.shift(),f.curveTo(o,a,i,l,Ie,Ve),f.curveTo(Le,_e,Fe,De,b,T);break;case 34:o=b+u.shift(),a=T,i=o+u.shift(),l=a+u.shift(),Ie=i+u.shift(),Ve=l,Le=Ie+u.shift(),_e=l,Fe=Le+u.shift(),De=T,b=Fe+u.shift(),f.curveTo(o,a,i,l,Ie,Ve),f.curveTo(Le,_e,Fe,De,b,T);break;case 36:o=b+u.shift(),a=T+u.shift(),i=o+u.shift(),l=a+u.shift(),Ie=i+u.shift(),Ve=l,Le=Ie+u.shift(),_e=l,Fe=Le+u.shift(),De=_e+u.shift(),b=Fe+u.shift(),f.curveTo(o,a,i,l,Ie,Ve),f.curveTo(Le,_e,Fe,De,b,T);break;case 37:o=b+u.shift(),a=T+u.shift(),i=o+u.shift(),l=a+u.shift(),Ie=i+u.shift(),Ve=l+u.shift(),Le=Ie+u.shift(),_e=Ve+u.shift(),Fe=Le+u.shift(),De=_e+u.shift(),Math.abs(Fe-b)>Math.abs(De-T)?b=Fe+u.shift():T=De+u.shift(),f.curveTo(o,a,i,l,Ie,Ve),f.curveTo(Le,_e,Fe,De,b,T);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+$e),u.length=0}break;case 14:if(s>1){console.error("CFF CharString operator endchar (14) is not supported in CFF2");break}if(u.length>=4){let Ot=ss[u.pop()],Nt=ss[u.pop()],Mn=u.pop(),Pn=u.pop();if(Ot&&Nt){t.isComposite=!0,t.components=[];let Zo=e.cffEncoding.charset.indexOf(Ot),Ko=e.cffEncoding.charset.indexOf(Nt);t.components.push({glyphIndex:Ko,dx:0,dy:0}),t.components.push({glyphIndex:Zo,dx:Pn,dy:Mn}),f.extend(e.glyphs.get(Ko).path);let qp=e.glyphs.get(Zo),Es=JSON.parse(JSON.stringify(qp.path.commands));for(let Rs=0;Rs<Es.length;Rs+=1){let nt=Es[Rs];nt.type!=="Z"&&(nt.x+=Pn,nt.y+=Mn),(nt.type==="Q"||nt.type==="C")&&(nt.x1+=Pn,nt.y1+=Mn),nt.type==="C"&&(nt.x2+=Pn,nt.y2+=Mn)}f.extend(Es)}}else u.length>0&&!d&&(J=u.shift()+X,d=!0);S&&Ye!==2&&(f.closePath(),S=!1);break;case 15:if(s<2){console.error("CFF2 CharString operator vsindex (15) is not supported in CFF");break}Q=u.pop();break;case 16:if(s<2){console.error("CFF2 CharString operator blend (16) is not supported in CFF");break}ce||(ce=e.variation&&r&&e.variation.process.getBlendVector(ie,Q,r));var fe=u.pop(),Me=ce?ce.length:ie.itemVariationSubtables[Q].regionIndexes.length,je=fe*Me,Ke=u.length-je,at=Ke-fe;if(ce)for(let Ot=0;Ot<fe;Ot++){var Yo=u[at+Ot];for(let Nt=0;Nt<Me;Nt++)Yo+=ce[Nt]*u[Ke++];u[at+Ot]=Yo}for(;je--;)u.pop();break;case 18:Ae();break;case 19:case 20:Ae(),be+=m+7>>3;break;case 21:u.length>2&&!d&&(J=u.shift()+X,d=!0),T+=u.pop(),b+=u.pop(),Ne(b,T);break;case 22:u.length>1&&!d&&(J=u.shift()+X,d=!0),b+=u.pop(),Ne(b,T);break;case 23:Ae();break;case 24:for(;u.length>2;)o=b+u.shift(),a=T+u.shift(),i=o+u.shift(),l=a+u.shift(),b=i+u.shift(),T=l+u.shift(),f.curveTo(o,a,i,l,b,T);b+=u.shift(),T+=u.shift(),f.lineTo(b,T);break;case 25:for(;u.length>6;)b+=u.shift(),T+=u.shift(),f.lineTo(b,T);o=b+u.shift(),a=T+u.shift(),i=o+u.shift(),l=a+u.shift(),b=i+u.shift(),T=l+u.shift(),f.curveTo(o,a,i,l,b,T);break;case 26:for(u.length&1&&(b+=u.shift());u.length>0;)o=b,a=T+u.shift(),i=o+u.shift(),l=a+u.shift(),b=i,T=l+u.shift(),f.curveTo(o,a,i,l,b,T);break;case 27:for(u.length&1&&(T+=u.shift());u.length>0;)o=b+u.shift(),a=T,i=o+u.shift(),l=a+u.shift(),b=i+u.shift(),T=l,f.curveTo(o,a,i,l,b,T);break;case 28:H=G[be],Oe=G[be+1],u.push((H<<24|Oe<<16)>>16),be+=2;break;case 29:if(Ct=u.pop()+e.gsubrsBias,Ze=e.gsubrs[Ct],Ze){if(ue>=Rr){console.warn("CFF charstring subroutine call depth exceeded, skipping callgsubr");break}ue++,z(Ze),ue--}break;case 30:for(;u.length>0&&(o=b,a=T+u.shift(),i=o+u.shift(),l=a+u.shift(),b=i+u.shift(),T=l+(u.length===1?u.shift():0),f.curveTo(o,a,i,l,b,T),u.length!==0);)o=b+u.shift(),a=T,i=o+u.shift(),l=a+u.shift(),T=l+u.shift(),b=i+(u.length===1?u.shift():0),f.curveTo(o,a,i,l,b,T);break;case 31:for(;u.length>0&&(o=b+u.shift(),a=T,i=o+u.shift(),l=a+u.shift(),T=l+u.shift(),b=i+(u.length===1?u.shift():0),f.curveTo(o,a,i,l,b,T),u.length!==0);)o=b,a=T+u.shift(),i=o+u.shift(),l=a+u.shift(),b=i+u.shift(),T=l+(u.length===1?u.shift():0),f.curveTo(o,a,i,l,b,T);break;default:$e<32?console.log("Glyph "+t.index+": unknown operator "+$e):$e<247?u.push($e-139):$e<251?(H=G[be],be+=1,u.push(($e-247)*256+H+108)):$e<255?(H=G[be],be+=1,u.push(-($e-251)*256-H-108)):(H=G[be],Oe=G[be+1],gt=G[be+2],Un=G[be+3],be+=4,u.push((H<<24|Oe<<16|gt<<8|Un)/65536))}}}return z(n),e.variation&&r&&(f.commands=f.commands.map(G=>{let H=Object.keys(G);for(let Oe=0;Oe<H.length;Oe++){let gt=H[Oe];gt!=="type"&&(G[gt]=Math.round(G[gt]))}return G})),d&&(t.advanceWidth=J),f}function Mr(e,t,n,s,r){let o=[],a,i=new B.Parser(e,t),l=i.parseCard8();if(l===0)for(let f=0;f<n;f++){if(a=i.parseCard8(),a>=s)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+s+")");o.push(a)}else if(l===3||r>1&&l===4){let f=l===4?i.parseULong():i.parseCard16(),u=l===4?i.parseULong():i.parseCard16();if(u!==0)throw new Error(`CFF Table CID Font FDSelect format ${l} range has bad initial GID ${u}`);let m;for(let d=0;d<f;d++){if(a=l===4?i.parseUShort():i.parseCard8(),m=l===4?i.parseULong():i.parseCard16(),a>=s)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+s+")");if(m>n)throw new Error(`CFF Table CID Font FDSelect format ${r} range has bad GID ${m}`);for(;u<m;u++)o.push(a);u=m}if(m!==n)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final (Sentinal) GID "+m)}else throw new Error("CFF Table CID Font FDSelect table has unsupported format "+l);return o}function fl(e,t,n,s){let r,o=sl(e,t);o.formatMajor===2?r=n.tables.cff2={}:r=n.tables.cff={};let a=o.formatMajor>1?null:et(e,o.endOffset,B.bytesToString),i=o.formatMajor>1?null:et(e,a.endOffset),l=o.formatMajor>1?null:et(e,i.endOffset,B.bytesToString),f=et(e,o.formatMajor>1?t+o.size+o.topDictLength:l.endOffset,void 0,o.formatMajor);n.gsubrs=f.objects,n.gsubrsBias=wn(n.gsubrs);let u;if(o.formatMajor>1){let d=t+o.size,S=B.getBytes(e,d,d+o.topDictLength);u=cs(e,0,[S],void 0,o.formatMajor)[0]}else{let d=cs(e,t,i.objects,l.objects,o.formatMajor);if(d.length!==1)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+d.length);u=d[0]}if(r.topDict=u,u._privateDict&&(n.defaultWidthX=u._privateDict.defaultWidthX,n.nominalWidthX=u._privateDict.nominalWidthX),o.formatMajor<2&&u.ros[0]!==void 0&&u.ros[1]!==void 0&&(n.isCIDFont=!0),o.formatMajor>1){let d=u.fdArray,S=u.fdSelect;if(!d)throw new Error("This is a CFF2 font, but FDArray information is missing");let b=et(e,t+d,null,o.formatMajor),T=il(e,t,b.objects);u._fdArray=T,S&&(u._fdSelect=Mr(e,t+S,n.numGlyphs,T.length,o.formatMajor))}else if(n.isCIDFont){let d=u.fdArray,S=u.fdSelect;if(d===0||S===0)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");d+=t;let b=et(e,d),T=cs(e,t,b.objects,l.objects,o.formatMajor);u._fdArray=T,S+=t,u._fdSelect=Mr(e,S,n.numGlyphs,T.length,o.formatMajor)}if(o.formatMajor<2){let d=t+u.private[1],S=ls(e,d,u.private[0],l.objects,o.formatMajor);if(n.defaultWidthX=S.defaultWidthX,n.nominalWidthX=S.nominalWidthX,S.subrs!==0){let b=d+S.subrs,T=et(e,b);n.subrs=T.objects,n.subrsBias=wn(n.subrs)}else n.subrs=[],n.subrsBias=0}let m;if(s.lowMemory?(m=Qi(e,t+u.charStrings,o.formatMajor),n.nGlyphs=m.offsets.length-(o.formatMajor>1?1:0)):(m=et(e,t+u.charStrings,null,o.formatMajor),n.nGlyphs=m.objects.length),o.formatMajor>1&&n.tables.maxp&&n.nGlyphs!==n.tables.maxp.numGlyphs&&console.error(`Glyph count in the CFF2 table (${n.nGlyphs}) must correspond to the glyph count in the maxp table (${n.tables.maxp.numGlyphs})`),o.formatMajor<2){let d=[],S=[];u.charset===0?d=Pi:u.charset===1?d=Bi:u.charset===2?d=Ni:d=ll(e,t+u.charset,n.nGlyphs,l.objects,n.isCIDFont),u.encoding===0?S=ss:u.encoding===1?S=_i:S=cl(e,t+u.encoding),n.cffEncoding=new wr(S,d),n.encoding=n.encoding||n.cffEncoding}if(n.glyphs=new Je.GlyphSet(n),s.lowMemory)n._push=function(d){let S=Ji(d,m.offsets,e,t+u.charStrings,void 0,o.formatMajor);n.glyphs.push(d,Je.cffGlyphLoader(n,d,us,S,o.formatMajor))};else for(let d=0;d<n.nGlyphs;d+=1){let S=m.objects[d];n.glyphs.push(d,Je.cffGlyphLoader(n,d,us,S,o.formatMajor))}if(u.vstore){let d=new B.Parser(e,t+u.vstore);u._vstore=d.parseVariationStore()}}function Pr(e,t){let n,s=Sn.indexOf(e);return s>=0&&(n=s),s=t.indexOf(e),s>=0?n=s+Sn.length:(n=Sn.length+t.length,t.push(e)),n}function pl(){return new I.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function hl(e){let t=new I.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);t.names=[];for(let n=0;n<e.length;n+=1)t.names.push({name:"name_"+n,type:"NAME",value:e[n]});return t}function Br(e,t,n){let s={};for(let r=0;r<e.length;r+=1){let o=e[r],a=t[o.name];a!==void 0&&!Er(a,o.value)&&(o.type==="SID"&&(a=Pr(a,n)),s[o.op]={name:o.name,type:o.type,value:a})}return s}function Nr(e,t,n){let s=new I.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return s.dict=Br(n>1?Ir:Ar,e,t),s}function _r(e){let t=new I.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}function dl(e){let t=new I.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);t.strings=[];for(let n=0;n<e.length;n+=1)t.strings.push({name:"string_"+n,type:"STRING",value:e[n]});return t}function gl(){return new I.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function ml(e,t){let n=new I.Record("Charsets",[{name:"format",type:"Card8",value:0}]);for(let s=0;s<e.length;s+=1){let r=e[s],o=Pr(r,t);n.fields.push({name:"glyph_"+s,type:"SID",value:o})}return n}function yl(e,t){let n=[],s=e.path;t<2&&n.push({name:"width",type:"NUMBER",value:e.advanceWidth});let r=0,o=0;for(let a=0;a<s.commands.length;a+=1){let i,l,f=s.commands[a];if(f.type==="Q"){let u=.3333333333333333,m=2/3;f={type:"C",x:f.x,y:f.y,x1:Math.round(u*r+m*f.x1),y1:Math.round(u*o+m*f.y1),x2:Math.round(u*f.x+m*f.x1),y2:Math.round(u*f.y+m*f.y1)}}if(f.type==="M")i=Math.round(f.x-r),l=Math.round(f.y-o),n.push({name:"dx",type:"NUMBER",value:i}),n.push({name:"dy",type:"NUMBER",value:l}),n.push({name:"rmoveto",type:"OP",value:21}),r=Math.round(f.x),o=Math.round(f.y);else if(f.type==="L")i=Math.round(f.x-r),l=Math.round(f.y-o),n.push({name:"dx",type:"NUMBER",value:i}),n.push({name:"dy",type:"NUMBER",value:l}),n.push({name:"rlineto",type:"OP",value:5}),r=Math.round(f.x),o=Math.round(f.y);else if(f.type==="C"){let u=Math.round(f.x1-r),m=Math.round(f.y1-o),d=Math.round(f.x2-f.x1),S=Math.round(f.y2-f.y1);i=Math.round(f.x-f.x2),l=Math.round(f.y-f.y2),n.push({name:"dx1",type:"NUMBER",value:u}),n.push({name:"dy1",type:"NUMBER",value:m}),n.push({name:"dx2",type:"NUMBER",value:d}),n.push({name:"dy2",type:"NUMBER",value:S}),n.push({name:"dx",type:"NUMBER",value:i}),n.push({name:"dy",type:"NUMBER",value:l}),n.push({name:"rrcurveto",type:"OP",value:8}),r=Math.round(f.x),o=Math.round(f.y)}}return t<2&&n.push({name:"endchar",type:"OP",value:14}),n}function bl(e,t){let n=new I.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]);for(let s=0;s<e.length;s+=1){let r=e.get(s),o=yl(r,t);n.charStrings.push({name:r.name,type:"CHARSTRING",value:o})}return n}function vl(e,t,n){let s=new I.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return s.dict=Br(n>1?Dr:Fr,e,t),s}function xl(e,t){let s=new I.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),r=1/t.unitsPerEm,o={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[r,0,0,r,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},a=t&&t.topDict||{};a.paintType&&(o.paintType=a.paintType,o.strokeWidth=a.strokeWidth||0);let i={},l=[],f;for(let S=1;S<e.length;S+=1)f=e.get(S),l.push(f.name);let u=[];s.header=pl(),s.nameIndex=hl([t.postScriptName]);let m=Nr(o,u);s.topDictIndex=_r(m),s.globalSubrIndex=gl(),s.charsets=ml(l,u),s.charStringsIndex=bl(e,1),s.privateDict=vl(i,u),s.stringIndex=dl(u);let d=s.header.sizeOf()+s.nameIndex.sizeOf()+s.topDictIndex.sizeOf()+s.stringIndex.sizeOf()+s.globalSubrIndex.sizeOf();return o.charset=d,o.encoding=0,o.charStrings=o.charset+s.charsets.sizeOf(),o.private[1]=o.charStrings+s.charStringsIndex.sizeOf(),m=Nr(o,u),s.topDictIndex=_r(m),s}var fs={parse:fl,make:xl};function Sl(e,t){let n={},s=new B.Parser(e,t);return n.version=s.parseVersion(),n.fontRevision=Math.round(s.parseFixed()*1e3)/1e3,n.checkSumAdjustment=s.parseULong(),n.magicNumber=s.parseULong(),$.argument(n.magicNumber===1594834165,"Font header has wrong magic number."),n.flags=s.parseUShort(),n.unitsPerEm=s.parseUShort(),n.created=s.parseLongDateTime(),n.modified=s.parseLongDateTime(),n.xMin=s.parseShort(),n.yMin=s.parseShort(),n.xMax=s.parseShort(),n.yMax=s.parseShort(),n.macStyle=s.parseUShort(),n.lowestRecPPEM=s.parseUShort(),n.fontDirectionHint=s.parseShort(),n.indexToLocFormat=s.parseShort(),n.glyphDataFormat=s.parseShort(),n}function Tl(e){let t=Math.round(new Date().getTime()/1e3)+2082844800,n=t,s=e.macStyle||0;return e.createdTimestamp&&(n=e.createdTimestamp+2082844800),new I.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:n},{name:"modified",type:"LONGDATETIME",value:t},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:s},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],e)}var Gr={parse:Sl,make:Tl};function kl(e,t){let n={},s=new B.Parser(e,t);return n.version=s.parseVersion(),n.ascender=s.parseShort(),n.descender=s.parseShort(),n.lineGap=s.parseShort(),n.advanceWidthMax=s.parseUShort(),n.minLeftSideBearing=s.parseShort(),n.minRightSideBearing=s.parseShort(),n.xMaxExtent=s.parseShort(),n.caretSlopeRise=s.parseShort(),n.caretSlopeRun=s.parseShort(),n.caretOffset=s.parseShort(),s.relativeOffset+=8,n.metricDataFormat=s.parseShort(),n.numberOfHMetrics=s.parseUShort(),n}function wl(e){return new I.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],e)}var Hr={parse:kl,make:wl};function Cl(e,t,n,s,r){let o,a,i=new B.Parser(e,t);for(let l=0;l<s;l+=1){l<n&&(o=i.parseUShort(),a=i.parseShort());let f=r.get(l);f.advanceWidth=o,f.leftSideBearing=a}}function Ol(e,t,n,s,r){e._hmtxTableData={};let o,a,i=new B.Parser(t,n);for(let l=0;l<r;l+=1)l<s&&(o=i.parseUShort(),a=i.parseShort()),e._hmtxTableData[l]={advanceWidth:o,leftSideBearing:a}}function Ll(e,t,n,s,r,o,a){a.lowMemory?Ol(e,t,n,s,r):Cl(t,n,s,r,o)}function El(e){let t=new I.Table("hmtx",[]);for(let n=0;n<e.length;n+=1){let s=e.get(n),r=s.advanceWidth||0,o=s.leftSideBearing||0;t.fields.push({name:"advanceWidth_"+n,type:"USHORT",value:r}),t.fields.push({name:"leftSideBearing_"+n,type:"SHORT",value:o})}return t}var Vr={parse:Ll,make:El};function Rl(e){let t=new I.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]),n="",s=12+e.length*4;for(let r=0;r<e.length;++r){let o=n.indexOf(e[r]);o<0&&(o=n.length,n+=e[r]),t.fields.push({name:"offset "+r,type:"USHORT",value:s+o}),t.fields.push({name:"length "+r,type:"USHORT",value:e[r].length})}return t.fields.push({name:"stringPool",type:"CHARARRAY",value:n}),t}function Al(e,t){let n=new B.Parser(e,t),s=n.parseULong();$.argument(s===1,"Unsupported ltag table version."),n.skip("uLong",1);let r=n.parseULong(),o=[];for(let a=0;a<r;a++){let i="",l=t+n.parseUShort(),f=n.parseUShort();for(let u=l;u<l+f;++u)i+=String.fromCharCode(e.getInt8(u));o.push(i)}return o}var jr={make:Rl,parse:Al};function Il(e,t){let n={},s=new B.Parser(e,t);return n.version=s.parseVersion(),n.numGlyphs=s.parseUShort(),n.version===1&&(n.maxPoints=s.parseUShort(),n.maxContours=s.parseUShort(),n.maxCompositePoints=s.parseUShort(),n.maxCompositeContours=s.parseUShort(),n.maxZones=s.parseUShort(),n.maxTwilightPoints=s.parseUShort(),n.maxStorage=s.parseUShort(),n.maxFunctionDefs=s.parseUShort(),n.maxInstructionDefs=s.parseUShort(),n.maxStackElements=s.parseUShort(),n.maxSizeOfInstructions=s.parseUShort(),n.maxComponentElements=s.parseUShort(),n.maxComponentDepth=s.parseUShort()),n}function Fl(e){return new I.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])}var $r={parse:Il,make:Fl},ps=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];function Dl(e){for(let t=0;t<ps.length;t+=1){let n=ps[t];if(e>=n.begin&&e<n.end)return t}return-1}function Ul(e,t){let n={},s=new B.Parser(e,t);n.version=s.parseUShort(),n.xAvgCharWidth=s.parseShort(),n.usWeightClass=s.parseUShort(),n.usWidthClass=s.parseUShort(),n.fsType=s.parseUShort(),n.ySubscriptXSize=s.parseShort(),n.ySubscriptYSize=s.parseShort(),n.ySubscriptXOffset=s.parseShort(),n.ySubscriptYOffset=s.parseShort(),n.ySuperscriptXSize=s.parseShort(),n.ySuperscriptYSize=s.parseShort(),n.ySuperscriptXOffset=s.parseShort(),n.ySuperscriptYOffset=s.parseShort(),n.yStrikeoutSize=s.parseShort(),n.yStrikeoutPosition=s.parseShort(),n.sFamilyClass=s.parseShort(),n.panose=[];for(let r=0;r<10;r++)n.panose[r]=s.parseByte();return n.ulUnicodeRange1=s.parseULong(),n.ulUnicodeRange2=s.parseULong(),n.ulUnicodeRange3=s.parseULong(),n.ulUnicodeRange4=s.parseULong(),n.achVendID=String.fromCharCode(s.parseByte(),s.parseByte(),s.parseByte(),s.parseByte()),n.fsSelection=s.parseUShort(),n.usFirstCharIndex=s.parseUShort(),n.usLastCharIndex=s.parseUShort(),n.sTypoAscender=s.parseShort(),n.sTypoDescender=s.parseShort(),n.sTypoLineGap=s.parseShort(),n.usWinAscent=s.parseUShort(),n.usWinDescent=s.parseUShort(),n.version>=1&&(n.ulCodePageRange1=s.parseULong(),n.ulCodePageRange2=s.parseULong()),n.version>=2&&(n.sxHeight=s.parseShort(),n.sCapHeight=s.parseShort(),n.usDefaultChar=s.parseUShort(),n.usBreakChar=s.parseUShort(),n.usMaxContent=s.parseUShort()),n}function Ml(e){return new I.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)}var hs={parse:Ul,make:Ml,unicodeRanges:ps,getUnicodeRange:Dl};function Pl(e,t){let n={},s=new B.Parser(e,t);switch(n.version=s.parseVersion(),n.italicAngle=s.parseFixed(),n.underlinePosition=s.parseShort(),n.underlineThickness=s.parseShort(),n.isFixedPitch=s.parseULong(),n.minMemType42=s.parseULong(),n.maxMemType42=s.parseULong(),n.minMemType1=s.parseULong(),n.maxMemType1=s.parseULong(),n.version){case 1:n.names=xt.slice();break;case 2:n.numberOfGlyphs=s.parseUShort(),n.glyphNameIndex=new Array(n.numberOfGlyphs);for(let r=0;r<n.numberOfGlyphs;r++)n.glyphNameIndex[r]=s.parseUShort();n.names=[];for(let r=0;r<n.numberOfGlyphs;r++)if(n.glyphNameIndex[r]>=xt.length){let o=s.parseChar();n.names.push(s.parseString(o))}break;case 2.5:n.numberOfGlyphs=s.parseUShort(),n.offset=new Array(n.numberOfGlyphs);for(let r=0;r<n.numberOfGlyphs;r++)n.offset[r]=s.parseChar();break}return n}function Bl(e){let{italicAngle:t=Math.round((e.italicAngle||0)*65536),underlinePosition:n=0,underlineThickness:s=0,isFixedPitch:r=0,minMemType42:o=0,maxMemType42:a=0,minMemType1:i=0,maxMemType1:l=0}=e.tables.post||{};return new I.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:t},{name:"underlinePosition",type:"FWORD",value:n},{name:"underlineThickness",type:"FWORD",value:s},{name:"isFixedPitch",type:"ULONG",value:r},{name:"minMemType42",type:"ULONG",value:o},{name:"maxMemType42",type:"ULONG",value:a},{name:"minMemType1",type:"ULONG",value:i},{name:"maxMemType1",type:"ULONG",value:l}])}var Wr={parse:Pl,make:Bl},Xe=new Array(9);Xe[1]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();if(n===1)return{substFormat:1,coverage:this.parsePointer(k.coverage),deltaGlyphId:this.parseShort()};if(n===2)return{substFormat:2,coverage:this.parsePointer(k.coverage),substitute:this.parseOffset16List()};$.assert(!1,"0x"+t.toString(16)+": lookup type 1 format must be 1 or 2.")},Xe[2]=function(){let t=this.parseUShort();return $.argument(t===1,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(k.coverage),sequences:this.parseListOfLists()}},Xe[3]=function(){let t=this.parseUShort();return $.argument(t===1,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(k.coverage),alternateSets:this.parseListOfLists()}},Xe[4]=function(){let t=this.parseUShort();return $.argument(t===1,"GSUB ligature table identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(k.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var Mt={sequenceIndex:k.uShort,lookupListIndex:k.uShort};Xe[5]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();if(n===1)return{substFormat:n,coverage:this.parsePointer(k.coverage),ruleSets:this.parseListOfLists(function(){let s=this.parseUShort(),r=this.parseUShort();return{input:this.parseUShortList(s-1),lookupRecords:this.parseRecordList(r,Mt)}})};if(n===2)return{substFormat:n,coverage:this.parsePointer(k.coverage),classDef:this.parsePointer(k.classDef),classSets:this.parseListOfLists(function(){let s=this.parseUShort(),r=this.parseUShort();return{classes:this.parseUShortList(s-1),lookupRecords:this.parseRecordList(r,Mt)}})};if(n===3){let s=this.parseUShort(),r=this.parseUShort();return{substFormat:n,coverages:this.parseList(s,k.pointer(k.coverage)),lookupRecords:this.parseRecordList(r,Mt)}}$.assert(!1,"0x"+t.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},Xe[6]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();if(n===1)return{substFormat:1,coverage:this.parsePointer(k.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Mt)}})};if(n===2)return{substFormat:2,coverage:this.parsePointer(k.coverage),backtrackClassDef:this.parsePointer(k.classDef),inputClassDef:this.parsePointer(k.classDef),lookaheadClassDef:this.parsePointer(k.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Mt)}})};if(n===3)return{substFormat:3,backtrackCoverage:this.parseList(k.pointer(k.coverage)),inputCoverage:this.parseList(k.pointer(k.coverage)),lookaheadCoverage:this.parseList(k.pointer(k.coverage)),lookupRecords:this.parseRecordList(Mt)};$.assert(!1,"0x"+t.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},Xe[7]=function(){let t=this.parseUShort();$.argument(t===1,"GSUB Extension Substitution subtable identifier-format must be 1");let n=this.parseUShort(),s=new k(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:n,extension:Xe[n].call(s)}},Xe[8]=function(){let t=this.parseUShort();return $.argument(t===1,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(k.coverage),backtrackCoverage:this.parseList(k.pointer(k.coverage)),lookaheadCoverage:this.parseList(k.pointer(k.coverage)),substitutes:this.parseUShortList()}};function Nl(e,t){t=t||0;let n=new k(e,t),s=n.parseVersion(1);return $.argument(s===1||s===1.1,"Unsupported GSUB table version."),s===1?{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(Xe)}:{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(Xe),variations:n.parseFeatureVariationsList()}}var Tt=new Array(9);Tt[1]=function(t){if(t.substFormat===1)return new I.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new I.Coverage(t.coverage)},{name:"deltaGlyphID",type:"SHORT",value:t.deltaGlyphId}]);if(t.substFormat===2)return new I.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new I.Coverage(t.coverage)}].concat(I.ushortList("substitute",t.substitute)));$.fail("Lookup type 1 substFormat must be 1 or 2.")},Tt[2]=function(t){return $.assert(t.substFormat===1,"Lookup type 2 substFormat must be 1."),new I.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new I.Coverage(t.coverage)}].concat(I.tableList("seqSet",t.sequences,function(n){return new I.Table("sequenceSetTable",I.ushortList("sequence",n))})))},Tt[3]=function(t){return $.assert(t.substFormat===1,"Lookup type 3 substFormat must be 1."),new I.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new I.Coverage(t.coverage)}].concat(I.tableList("altSet",t.alternateSets,function(n){return new I.Table("alternateSetTable",I.ushortList("alternate",n))})))},Tt[4]=function(t){return $.assert(t.substFormat===1,"Lookup type 4 substFormat must be 1."),new I.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new I.Coverage(t.coverage)}].concat(I.tableList("ligSet",t.ligatureSets,function(n){return new I.Table("ligatureSetTable",I.tableList("ligature",n,function(s){return new I.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:s.ligGlyph}].concat(I.ushortList("component",s.components,s.components.length+1)))}))})))},Tt[5]=function(t){if(t.substFormat===1)return new I.Table("contextualSubstitutionTable",[{name:"substFormat",type:"USHORT",value:t.substFormat},{name:"coverage",type:"TABLE",value:new I.Coverage(t.coverage)}].concat(I.tableList("sequenceRuleSet",t.ruleSets,function(n){return n?new I.Table("sequenceRuleSetTable",I.tableList("sequenceRule",n,function(s){let r=I.ushortList("seqLookup",[],s.lookupRecords.length).concat(I.ushortList("inputSequence",s.input,s.input.length+1));[r[0],r[1]]=[r[1],r[0]];for(let o=0;o<s.lookupRecords.length;o++){let a=s.lookupRecords[o];r=r.concat({name:"sequenceIndex"+o,type:"USHORT",value:a.sequenceIndex}).concat({name:"lookupListIndex"+o,type:"USHORT",value:a.lookupListIndex})}return new I.Table("sequenceRuleTable",r)})):new I.Table("NULL",null)})));if(t.substFormat===2)return new I.Table("contextualSubstitutionTable",[{name:"substFormat",type:"USHORT",value:t.substFormat},{name:"coverage",type:"TABLE",value:new I.Coverage(t.coverage)},{name:"classDef",type:"TABLE",value:new I.ClassDef(t.classDef)}].concat(I.tableList("classSeqRuleSet",t.classSets,function(n){return n?new I.Table("classSeqRuleSetTable",I.tableList("classSeqRule",n,function(s){let r=I.ushortList("classes",s.classes,s.classes.length+1).concat(I.ushortList("seqLookupCount",[],s.lookupRecords.length));for(let o=0;o<s.lookupRecords.length;o++){let a=s.lookupRecords[o];r=r.concat({name:"sequenceIndex"+o,type:"USHORT",value:a.sequenceIndex}).concat({name:"lookupListIndex"+o,type:"USHORT",value:a.lookupListIndex})}return new I.Table("classSeqRuleTable",r)})):new I.Table("NULL",null)})));if(t.substFormat===3){let n=[{name:"substFormat",type:"USHORT",value:t.substFormat}];n.push({name:"inputGlyphCount",type:"USHORT",value:t.coverages.length}),n.push({name:"substitutionCount",type:"USHORT",value:t.lookupRecords.length});for(let r=0;r<t.coverages.length;r++){let o=t.coverages[r];n.push({name:"inputCoverage"+r,type:"TABLE",value:new I.Coverage(o)})}for(let r=0;r<t.lookupRecords.length;r++){let o=t.lookupRecords[r];n=n.concat({name:"sequenceIndex"+r,type:"USHORT",value:o.sequenceIndex}).concat({name:"lookupListIndex"+r,type:"USHORT",value:o.lookupListIndex})}return new I.Table("contextualSubstitutionTable",n)}$.assert(!1,"lookup type 5 format must be 1, 2 or 3.")},Tt[6]=function(t){if(t.substFormat===1)return new I.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:t.substFormat},{name:"coverage",type:"TABLE",value:new I.Coverage(t.coverage)}].concat(I.tableList("chainRuleSet",t.chainRuleSets,function(s){return new I.Table("chainRuleSetTable",I.tableList("chainRule",s,function(r){let o=I.ushortList("backtrackGlyph",r.backtrack,r.backtrack.length).concat(I.ushortList("inputGlyph",r.input,r.input.length+1)).concat(I.ushortList("lookaheadGlyph",r.lookahead,r.lookahead.length)).concat(I.ushortList("substitution",[],r.lookupRecords.length));for(let a=0;a<r.lookupRecords.length;a++){let i=r.lookupRecords[a];o=o.concat({name:"sequenceIndex"+a,type:"USHORT",value:i.sequenceIndex}).concat({name:"lookupListIndex"+a,type:"USHORT",value:i.lookupListIndex})}return new I.Table("chainRuleTable",o)}))})));if(t.substFormat===2)$.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(t.substFormat===3){let n=[{name:"substFormat",type:"USHORT",value:t.substFormat}];n.push({name:"backtrackGlyphCount",type:"USHORT",value:t.backtrackCoverage.length});for(let r=0;r<t.backtrackCoverage.length;r++){let o=t.backtrackCoverage[r];n.push({name:"backtrackCoverage"+r,type:"TABLE",value:new I.Coverage(o)})}n.push({name:"inputGlyphCount",type:"USHORT",value:t.inputCoverage.length});for(let r=0;r<t.inputCoverage.length;r++){let o=t.inputCoverage[r];n.push({name:"inputCoverage"+r,type:"TABLE",value:new I.Coverage(o)})}n.push({name:"lookaheadGlyphCount",type:"USHORT",value:t.lookaheadCoverage.length});for(let r=0;r<t.lookaheadCoverage.length;r++){let o=t.lookaheadCoverage[r];n.push({name:"lookaheadCoverage"+r,type:"TABLE",value:new I.Coverage(o)})}n.push({name:"substitutionCount",type:"USHORT",value:t.lookupRecords.length});for(let r=0;r<t.lookupRecords.length;r++){let o=t.lookupRecords[r];n=n.concat({name:"sequenceIndex"+r,type:"USHORT",value:o.sequenceIndex}).concat({name:"lookupListIndex"+r,type:"USHORT",value:o.lookupListIndex})}return new I.Table("chainContextTable",n)}$.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};function _l(e){return new I.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new I.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new I.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new I.LookupList(e.lookups,Tt)}])}var zr={parse:Nl,make:_l};function Gl(e,t){let n=new B.Parser(e,t),s=n.parseULong();$.argument(s===1,"Unsupported META table version."),n.parseULong(),n.parseULong();let r=n.parseULong(),o={};for(let a=0;a<r;a++){let i=n.parseTag(),l=n.parseULong(),f=n.parseULong();if(i==="appl"||i==="bild")continue;let u=Rt.UTF8(e,t+l,f);o[i]=u}return o}function Hl(e){let t=Object.keys(e).length,n="",s=16+t*12,r=new I.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:s},{name:"numTags",type:"ULONG",value:t}]);for(let o in e){let a=n.length;n+=e[o],r.fields.push({name:"tag "+o,type:"TAG",value:o}),r.fields.push({name:"offset "+o,type:"ULONG",value:s+a}),r.fields.push({name:"length "+o,type:"ULONG",value:e[o].length})}return r.fields.push({name:"stringPool",type:"CHARARRAY",value:n}),r}var Xr={parse:Gl,make:Hl};function Vl(e,t){let n=new k(e,t),s=n.parseUShort();s!==0&&console.warn("Only COLRv0 is currently fully supported. A subset of color glyphs might be available in this font if provided in the v0 format.");let r=n.parseUShort(),o=n.parseOffset32(),a=n.parseOffset32(),i=n.parseUShort();n.relativeOffset=o;let l=n.parseRecordList(r,{glyphID:k.uShort,firstLayerIndex:k.uShort,numLayers:k.uShort});n.relativeOffset=a;let f=n.parseRecordList(i,{glyphID:k.uShort,paletteIndex:k.uShort});return{version:s,baseGlyphRecords:l,layerRecords:f}}function jl({version:e=0,baseGlyphRecords:t=[],layerRecords:n=[]}){$.argument(e===0,"Only COLRv0 supported.");let s=14,r=s+t.length*6;return new I.Table("COLR",[{name:"version",type:"USHORT",value:e},{name:"numBaseGlyphRecords",type:"USHORT",value:t.length},{name:"baseGlyphRecordsOffset",type:"ULONG",value:s},{name:"layerRecordsOffset",type:"ULONG",value:r},{name:"numLayerRecords",type:"USHORT",value:n.length},...t.map((o,a)=>[{name:"glyphID_"+a,type:"USHORT",value:o.glyphID},{name:"firstLayerIndex_"+a,type:"USHORT",value:o.firstLayerIndex},{name:"numLayers_"+a,type:"USHORT",value:o.numLayers}]).flat(),...n.map((o,a)=>[{name:"LayerGlyphID_"+a,type:"USHORT",value:o.glyphID},{name:"paletteIndex_"+a,type:"USHORT",value:o.paletteIndex}]).flat()])}var qr={parse:Vl,make:jl};function $l(e,t){return[{name:"tag_"+e,type:"TAG",value:t.tag},{name:"minValue_"+e,type:"FIXED",value:t.minValue<<16},{name:"defaultValue_"+e,type:"FIXED",value:t.defaultValue<<16},{name:"maxValue_"+e,type:"FIXED",value:t.maxValue<<16},{name:"flags_"+e,type:"USHORT",value:0},{name:"nameID_"+e,type:"USHORT",value:t.axisNameID}]}function Wl(e,t,n){let s={},r=new B.Parser(e,t);s.tag=r.parseTag(),s.minValue=r.parseFixed(),s.defaultValue=r.parseFixed(),s.maxValue=r.parseFixed(),r.skip("uShort",1);let o=r.parseUShort();return s.axisNameID=o,s.name=xn(n,o),s}function zl(e,t,n,s={}){let r=[{name:"nameID_"+e,type:"USHORT",value:t.subfamilyNameID},{name:"flags_"+e,type:"USHORT",value:0}];for(let o=0;o<n.length;++o){let a=n[o].tag;r.push({name:"axis_"+e+" "+a,type:"FIXED",value:t.coordinates[a]<<16})}return s&&s.postScriptNameID&&r.push({name:"postScriptNameID_",type:"USHORT",value:t.postScriptNameID!==void 0?t.postScriptNameID:65535}),r}function Xl(e,t,n,s,r){let o={},a=new B.Parser(e,t),i=a.parseUShort();o.subfamilyNameID=i,o.name=xn(s,i,[2,17]),a.skip("uShort",1),o.coordinates={};for(let f=0;f<n.length;++f)o.coordinates[n[f].tag]=a.parseFixed();if(a.relativeOffset===r)return o.postScriptNameID=void 0,o.postScriptName=void 0,o;let l=a.parseUShort();return o.postScriptNameID=l==65535?void 0:l,o.postScriptName=o.postScriptNameID!==void 0?xn(s,l,[6]):"",o}function ql(e,t){let n=new I.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:e.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:e.instances.length},{name:"instanceSize",type:"USHORT",value:4+e.axes.length*4}]);n.offsetToData=n.sizeOf();for(let r=0;r<e.axes.length;r++)n.fields=n.fields.concat($l(r,e.axes[r],t));let s={};for(let r=0;r<e.instances.length;r++)if(e.instances[r].postScriptNameID!==void 0){n.instanceSize+=2,s.postScriptNameID=!0;break}for(let r=0;r<e.instances.length;r++)n.fields=n.fields.concat(zl(r,e.instances[r],e.axes,s));return n}function Yl(e,t,n){let s=new B.Parser(e,t),r=s.parseULong();$.argument(r===65536,"Unsupported fvar table version.");let o=s.parseOffset16();s.skip("uShort",1);let a=s.parseUShort(),i=s.parseUShort(),l=s.parseUShort(),f=s.parseUShort(),u=[];for(let S=0;S<a;S++)u.push(Wl(e,t+o+S*i,n));let m=[],d=t+o+a*i;for(let S=0;S<l;S++)m.push(Xl(e,d+S*f,u,n,f));return{axes:u,instances:m}}var Yr={make:ql,parse:Yl},Zl={tag:k.tag,nameID:k.uShort,ordering:k.uShort},zt=new Array(5);zt[1]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),value:this.parseFixed()}},zt[2]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),nominalValue:this.parseFixed(),rangeMinValue:this.parseFixed(),rangeMaxValue:this.parseFixed()}},zt[3]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),value:this.parseFixed(),linkedValue:this.parseFixed()}},zt[4]=function(){let t=this.parseUShort();return{flags:this.parseUShort(),valueNameID:this.parseUShort(),axisValues:this.parseList(t,function(){return{axisIndex:this.parseUShort(),value:this.parseFixed()}})}};function Kl(){let e=this.parseUShort(),t=zt[e],n={format:e};return t===void 0?(console.warn(`Unknown axis value table format ${e}`),n):Object.assign(n,this.parseStruct(t.bind(this)))}function Ql(e,t,n){t||(t=0);let s=new B.Parser(e,t),r=s.parseUShort(),o=s.parseUShort();r!==1&&console.warn(`Unsupported STAT table version ${r}.${o}`);let a=[r,o],i=s.parseUShort(),l=s.parseUShort(),f=s.parseOffset32(),u=s.parseUShort(),m=s.parseOffset32(),d=r>1||o>0?s.parseUShort():void 0;n!==void 0&&$.argument(l>=n.axes.length,"STAT axis count must be greater than or equal to fvar axis count"),u>0&&$.argument(l>=0,"STAT axis count must be greater than 0 if STAT axis value count is greater than 0");let S=[];for(let C=0;C<l;C++)s.offset=t+f,s.relativeOffset=C*i,S.push(s.parseStruct(Zl));s.offset=t,s.relativeOffset=m;let b=s.parseUShortList(u),T=[];for(let C=0;C<u;C++)s.offset=t+m,s.relativeOffset=b[C],T.push(Kl.apply(s));return{version:a,axes:S,values:T,elidedFallbackNameID:d}}var Xt=new Array(5);Xt[1]=function(t,n){return[{name:`format${t}`,type:"USHORT",value:1},{name:`axisIndex${t}`,type:"USHORT",value:n.axisIndex},{name:`flags${t}`,type:"USHORT",value:n.flags},{name:`valueNameID${t}`,type:"USHORT",value:n.valueNameID},{name:`value${t}`,type:"FLOAT",value:n.value}]},Xt[2]=function(t,n){return[{name:`format${t}`,type:"USHORT",value:2},{name:`axisIndex${t}`,type:"USHORT",value:n.axisIndex},{name:`flags${t}`,type:"USHORT",value:n.flags},{name:`valueNameID${t}`,type:"USHORT",value:n.valueNameID},{name:`nominalValue${t}`,type:"FLOAT",value:n.nominalValue},{name:`rangeMinValue${t}`,type:"FLOAT",value:n.rangeMinValue},{name:`rangeMaxValue${t}`,type:"FLOAT",value:n.rangeMaxValue}]},Xt[3]=function(t,n){return[{name:`format${t}`,type:"USHORT",value:3},{name:`axisIndex${t}`,type:"USHORT",value:n.axisIndex},{name:`flags${t}`,type:"USHORT",value:n.flags},{name:`valueNameID${t}`,type:"USHORT",value:n.valueNameID},{name:`value${t}`,type:"FLOAT",value:n.value},{name:`linkedValue${t}`,type:"FLOAT",value:n.linkedValue}]},Xt[4]=function(t,n){let s=[{name:`format${t}`,type:"USHORT",value:4},{name:`axisCount${t}`,type:"USHORT",value:n.axisValues.length},{name:`flags${t}`,type:"USHORT",value:n.flags},{name:`valueNameID${t}`,type:"USHORT",value:n.valueNameID}];for(let r=0;r<n.axisValues.length;r++)s=s.concat([{name:`format${t}axisIndex${r}`,type:"USHORT",value:n.axisValues[r].axisIndex},{name:`format${t}value${r}`,type:"FLOAT",value:n.axisValues[r].value}]);return s};function Jl(e,t){return new I.Record("axisRecord_"+e,[{name:"axisTag_"+e,type:"TAG",value:t.tag},{name:"axisNameID_"+e,type:"USHORT",value:t.nameID},{name:"axisOrdering_"+e,type:"USHORT",value:t.ordering}])}function ec(e,t){let n=t.format,s=Xt[n];$.argument(s!==void 0,`Unknown axis value table format ${n}`);let r=s(e,t);return new I.Table("axisValueTable_"+e,r)}function tc(e){let t=new I.Table("STAT",[{name:"majorVersion",type:"USHORT",value:1},{name:"minorVersion",type:"USHORT",value:2},{name:"designAxisSize",type:"USHORT",value:8},{name:"designAxisCount",type:"USHORT",value:e.axes.length},{name:"designAxesOffset",type:"ULONG",value:0},{name:"axisValueCount",type:"USHORT",value:e.values.length},{name:"offsetToAxisValueOffsets",type:"ULONG",value:0},{name:"elidedFallbackNameID",type:"USHORT",value:e.elidedFallbackNameID}]);t.designAxesOffset=t.offsetToAxisValueOffsets=t.sizeOf();for(let o=0;o<e.axes.length;o++){let a=Jl(o,e.axes[o]);t.offsetToAxisValueOffsets+=a.sizeOf(),t.fields=t.fields.concat(a.fields)}let n=[],s=[],r=e.values.length*2;for(let o=0;o<e.values.length;o++){let a=ec(o,e.values[o]);n.push({name:"offset_"+o,type:"USHORT",value:r}),r+=a.sizeOf(),s=s.concat(a.fields)}return t.fields=t.fields.concat(n),t.fields=t.fields.concat(s),t}var Zr={make:tc,parse:Ql};function nc(e,t){return new I.Record("axisValueMap_"+e,[{name:"fromCoordinate_"+e,type:"F2DOT14",value:t.fromCoordinate},{name:"toCoordinate_"+e,type:"F2DOT14",value:t.toCoordinate}])}function sc(e,t){let n=new I.Record("segmentMap_"+e,[{name:"positionMapCount_"+e,type:"USHORT",value:t.axisValueMaps.length}]),s=[];for(let r=0;r<t.axisValueMaps.length;r++){let o=nc(`${e}_${r}`,t.axisValueMaps[r]);s=s.concat(o.fields)}return n.fields=n.fields.concat(s),n}function rc(e,t){$.argument(e.axisSegmentMaps.length===t.axes.length,"avar axis count must correspond to fvar axis count");let n=new I.Table("avar",[{name:"majorVersion",type:"USHORT",value:1},{name:"minorVersion",type:"USHORT",value:0},{name:"reserved",type:"USHORT",value:0},{name:"axisCount",type:"USHORT",value:e.axisSegmentMaps.length}]);for(let s=0;s<e.axisSegmentMaps.length;s++){let r=sc(s,e.axisSegmentMaps[s]);n.fields=n.fields.concat(r.fields)}return n}function oc(e,t,n){t||(t=0);let s=new k(e,t),r=s.parseUShort(),o=s.parseUShort();r!==1&&console.warn(`Unsupported avar table version ${r}.${o}`),s.skip("uShort",1);let a=s.parseUShort();$.argument(a===n.axes.length,"avar axis count must correspond to fvar axis count");let i=[];for(let l=0;l<a;l++){let f=[],u=s.parseUShort();for(let m=0;m<u;m++){let d=s.parseF2Dot14(),S=s.parseF2Dot14();f.push({fromCoordinate:d,toCoordinate:S})}i.push({axisValueMaps:f})}return{version:[r,o],axisSegmentMaps:i}}var Kr={make:rc,parse:oc};function ac(e,t,n,s){let r=new B.Parser(e,t),o=r.parseTupleVariationStore(r.relativeOffset,n.axes.length,"cvar",s),a=r.parseUShort(),i=r.parseUShort();return a!==1&&console.warn(`Unsupported cvar table version ${a}.${i}`),{version:[a,i],...o}}function ic(){console.warn("Writing of cvar tables is not yet supported.")}var Qr={make:ic,parse:ac};function lc(e,t,n,s){let r=new B.Parser(e,t),o=r.parseUShort(),a=r.parseUShort();o!==1&&console.warn(`Unsupported gvar table version ${o}.${a}`);let i=r.parseUShort();i!==n.axes.length&&console.warn(`axisCount ${i} in gvar table does not match the number of axes ${n.axes.length} in the fvar table!`);let l=r.parseUShort(),f=r.parsePointer32(function(){return this.parseTupleRecords(l,i)}),u=r.parseTupleVariationStoreList(i,"gvar",s);return{version:[o,a],sharedTuples:f,glyphVariations:u}}function cc(){console.warn("Writing of gvar tables is not yet supported.")}var Jr={make:cc,parse:lc};function uc(e,t){let n={},s=new B.Parser(e,t);n.version=s.parseUShort(),$.argument(n.version<=1,"Unsupported gasp table version."),n.numRanges=s.parseUShort(),n.gaspRanges=[];for(let r=0;r<n.numRanges;r++)n.gaspRanges[r]={rangeMaxPPEM:s.parseUShort(),rangeGaspBehavior:s.parseUShort()};return n}function fc(e){let t=new I.Table("gasp",[{name:"version",type:"USHORT",value:1},{name:"numRanges",type:"USHORT",value:e.numRanges}]);for(let n in e.gaspRanges)t.fields.push({name:"rangeMaxPPEM",type:"USHORT",value:e.gaspRanges[n].rangeMaxPPEM}),t.fields.push({name:"rangeGaspBehavior",type:"USHORT",value:e.gaspRanges[n].rangeGaspBehavior});return t}var eo={parse:uc,make:fc};function pc(e,t){let n=new Map,s=e.buffer,r=new k(e,t);if(r.parseUShort()!==0)return n;r.relativeOffset=r.parseOffset32();let a=e.byteOffset+t+r.relativeOffset,i=r.parseUShort(),l=new Map;for(let f=0;f<i;f++){let u=r.parseUShort(),m=r.parseUShort(),d=a+r.parseOffset32(),S=r.parseULong(),b=l.get(d);b===void 0&&(b=new Uint8Array(s,d,S),l.set(d,b));for(let T=u;T<=m;T++)n.set(T,b)}return n}function hc(e){let t=Array.from(e.keys()).sort(),n=[],s=[],r=new Map,o=0,a={endGlyphID:null};for(let d=0,S=t.length;d<S;d++){let b=t[d],T=e.get(b),C=r.get(T);C===void 0&&(C=o,s.push(T),r.set(T,C),o+=T.byteLength),b-1===a.endGlyphID&&C===a.svgDocOffset?a.endGlyphID=b:(a={startGlyphID:b,endGlyphID:b,svgDocOffset:C,svgDocLength:T.byteLength},n.push(a))}let i=n.length,l=s.length,f=2+i*12,u=new Array(4+i*4+l),m=0;u[m++]={name:"version",type:"USHORT",value:0},u[m++]={name:"svgDocumentListOffset",type:"ULONG",value:10},u[m++]={name:"reserved",type:"ULONG",value:0},u[m++]={name:"numEntries",type:"USHORT",value:i};for(let d=0;d<i;d++){let S="documentRecord_"+d,{startGlyphID:b,endGlyphID:T,svgDocOffset:C,svgDocLength:W}=n[d];u[m++]={name:S+"_startGlyphID",type:"USHORT",value:b},u[m++]={name:S+"_endGlyphID",type:"USHORT",value:T},u[m++]={name:S+"_svgDocOffset",type:"ULONG",value:f+C},u[m++]={name:S+"_svgDocLength",type:"ULONG",value:W}}for(let d=0;d<l;d++)u[m++]={name:"svgDoc_"+d,type:"LITERAL",value:s[d]};return new I.Table("SVG ",u)}var to={make:hc,parse:pc};function no(e){return Math.log(e)/Math.log(2)|0}function ds(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 so(e,t,n,s){return new I.Record("Table Record",[{name:"tag",type:"TAG",value:e!==void 0?e:""},{name:"checkSum",type:"ULONG",value:t!==void 0?t:0},{name:"offset",type:"ULONG",value:n!==void 0?n:0},{name:"length",type:"ULONG",value:s!==void 0?s:0}])}function ro(e){let t=new I.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);t.tables=e,t.numTables=e.length;let n=Math.pow(2,no(t.numTables));t.searchRange=16*n,t.entrySelector=no(n),t.rangeShift=t.numTables*16-t.searchRange;let s=[],r=[],o=t.sizeOf()+so().sizeOf()*t.numTables;for(;o%4!==0;)o+=1,r.push({name:"padding",type:"BYTE",value:0});for(let a=0;a<e.length;a+=1){let i=e[a];$.argument(i.tableName.length===4,"Table name"+i.tableName+" is invalid.");let l=i.sizeOf(),f=so(i.tableName,ds(i.encode()),o,l);for(s.push({name:f.tag+" Table Record",type:"RECORD",value:f}),r.push({name:i.tableName+" table",type:"RECORD",value:i}),o+=l,$.argument(!isNaN(o),"Something went wrong calculating the offset.");o%4!==0;)o+=1,r.push({name:"padding",type:"BYTE",value:0})}return s.sort(function(a,i){return a.value.tag>i.value.tag?1:-1}),t.fields=t.fields.concat(s),t.fields=t.fields.concat(r),t}function oo(e,t,n){for(let s=0;s<t.length;s+=1){let r=e.charToGlyphIndex(t[s]);if(r>0)return e.glyphs.get(r).getMetrics()}return n}function dc(e){let t=0;for(let n=0;n<e.length;n+=1)t+=e[n];return t/e.length}function gc(e){let t=[],n=[],s=[],r=[],o=[],a=[],i=[],l,f=0,u=0,m=0,d=0,S=0;for(let fe=0;fe<e.glyphs.length;fe+=1){let Me=e.glyphs.get(fe),je=Me.unicode|0;if(isNaN(Me.advanceWidth))throw new Error("Glyph "+Me.name+" ("+fe+"): advanceWidth is not a number.");(l>je||l===void 0)&&je>0&&(l=je),f<je&&(f=je);let Ke=hs.getUnicodeRange(je);if(Ke<32)u|=1<<Ke;else if(Ke<64)m|=1<<Ke-32;else if(Ke<96)d|=1<<Ke-64;else if(Ke<123)S|=1<<Ke-96;else throw new Error("Unicode ranges bits > 123 are reserved for internal usage");if(Me.name===".notdef")continue;let at=Me.getMetrics();t.push(at.xMin),n.push(at.yMin),s.push(at.xMax),r.push(at.yMax),a.push(at.leftSideBearing),i.push(at.rightSideBearing),o.push(Me.advanceWidth)}let b={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,s),yMax:Math.max.apply(null,r),advanceWidthMax:Math.max.apply(null,o),advanceWidthAvg:dc(o),minLeftSideBearing:Math.min.apply(null,a),maxLeftSideBearing:Math.max.apply(null,a),minRightSideBearing:Math.min.apply(null,i)};b.ascender=e.ascender,b.descender=e.descender;let T=0;e.weightClass>=600&&(T|=e.macStyleValues.BOLD),e.italicAngle<0&&(T|=e.macStyleValues.ITALIC);let C=Gr.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:b.xMin,yMin:b.yMin,xMax:b.xMax,yMax:b.yMax,lowestRecPPEM:3,macStyle:T,createdTimestamp:e.createdTimestamp}),W=Hr.make({ascender:b.ascender,descender:b.descender,advanceWidthMax:b.advanceWidthMax,minLeftSideBearing:b.minLeftSideBearing,minRightSideBearing:b.minRightSideBearing,xMaxExtent:b.maxLeftSideBearing+(b.xMax-b.xMin),numberOfHMetrics:e.glyphs.length}),V=$r.make(e.glyphs.length),X=hs.make(Object.assign({xAvgCharWidth:Math.round(b.advanceWidthAvg),usFirstCharIndex:l,usLastCharIndex:f,ulUnicodeRange1:u,ulUnicodeRange2:m,ulUnicodeRange3:d,ulUnicodeRange4:S,sTypoAscender:b.ascender,sTypoDescender:b.descender,sTypoLineGap:0,usWinAscent:b.yMax,usWinDescent:Math.abs(b.yMin),ulCodePageRange1:1,sxHeight:oo(e,"xyvw",{yMax:Math.round(b.ascender/2)}).yMax,sCapHeight:oo(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",b).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0},e.tables.os2)),Q=Vr.make(e.glyphs),ie=Sr.make(e.glyphs),ce=e.getEnglishName("fontFamily"),ue=e.getEnglishName("fontSubfamily"),ve=ce+" "+ue,Ye=e.getEnglishName("postScriptName");Ye||(Ye=ce.replace(/\s/g,"")+"-"+ue);let J={};for(let fe in e.names)J[fe]=e.names[fe];J.unicode=J.unicode||{},J.macintosh=J.macintosh||{},J.windows=J.windows||{};let Ne=e.names.unicode||{},Ae=e.names.macintosh||{},z=e.names.windows||{};for(let fe in J){if(J[fe]=J[fe]||{},!J[fe].uniqueID){let Me=e.getEnglishName("manufacturer")||"";J[fe].uniqueID={en:`${Me}: ${ve}`}}J[fe].postScriptName||(J[fe].postScriptName={en:Ye})}J.unicode.preferredFamily||(J.unicode.preferredFamily=Ne.fontFamily||Ae.fontFamily||z.fontFamily),J.macintosh.preferredFamily||(J.macintosh.preferredFamily=Ae.fontFamily||Ne.fontFamily||z.fontFamily),J.windows.preferredFamily||(J.windows.preferredFamily=z.fontFamily||Ne.fontFamily||Ae.fontFamily),J.unicode.preferredSubfamily||(J.unicode.preferredSubfamily=Ne.fontSubfamily||Ae.fontSubfamily||z.fontSubfamily),J.macintosh.preferredSubfamily||(J.macintosh.preferredSubfamily=Ae.fontSubfamily||Ne.fontSubfamily||z.fontSubfamily),J.windows.preferredSubfamily||(J.windows.preferredSubfamily=z.fontSubfamily||Ne.fontSubfamily||Ae.fontSubfamily);let G=[],H=xr.make(J,G),Oe=G.length>0?jr.make(G):void 0,gt=Wr.make(e),Un=fs.make(e.glyphs,{version:e.getEnglishName("version"),fullName:ve,familyName:ce,weightName:ue,postScriptName:Ye,unitsPerEm:e.unitsPerEm,fontBBox:[0,b.yMin,b.ascender,b.advanceWidthMax],topDict:e.tables.cff&&e.tables.cff.topDict||{}}),Ct=e.metas&&Object.keys(e.metas).length>0?Xr.make(e.metas):void 0,Ze=[C,W,V,X,H,ie,gt,Un,Q];Oe&&Ze.push(Oe);let Ie={gsub:zr,cpal:Lr,colr:qr,stat:Zr,avar:Kr,cvar:Qr,fvar:Yr,gvar:Jr,gasp:eo,svg:to},Ve={avar:[e.tables.fvar],fvar:[e.names]};for(let fe in Ie){let Me=e.tables[fe];if(Me){let je=Ie[fe].make.call(e,Me,...Ve[fe]||[]);je&&Ze.push(je)}}Ct&&Ze.push(Ct);let Le=ro(Ze),_e=Le.encode(),Fe=ds(_e),De=Le.fields,be=!1;for(let fe=0;fe<De.length;fe+=1)if(De[fe].name==="head table"){De[fe].value.checkSumAdjustment=2981146554-Fe,be=!0;break}if(!be)throw new Error("Could not find head table with checkSum to adjust.");return Le}var mc={make:ro,fontToTable:gc,computeCheckSum:ds};function gs(e,t){let n=0,s=e.length-1;for(;n<=s;){let r=n+s>>>1,o=e[r].tag;if(o===t)return r;o<t?n=r+1:s=r-1}return-n-1}function ao(e,t){let n=0,s=e.length-1;for(;n<=s;){let r=n+s>>>1,o=e[r];if(o===t)return r;o<t?n=r+1:s=r-1}return-n-1}function io(e,t){let n,s=0,r=e.length-1;for(;s<=r;){let o=s+r>>>1;n=e[o];let a=n.start;if(a===t)return n;a<t?s=o+1:r=o-1}if(s>0)return n=e[s-1],t>n.end?0:n}function lo(e,t){this.font=e,this.tableName=t}lo.prototype={searchTag:gs,binSearch:ao,getTable:function(e){let t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){let e=this.getTable();return e?e.scripts.map(function(t){return t.tag}):[]},getDefaultScriptName:function(){let e=this.getTable();if(!e)return;let t=!1;for(let n=0;n<e.scripts.length;n++){let s=e.scripts[n].tag;if(s==="DFLT")return s;s==="latn"&&(t=!0)}if(t)return"latn"},getScriptTable:function(e,t){let n=this.getTable(t);if(n){e=e||"DFLT";let s=n.scripts,r=gs(n.scripts,e);if(r>=0)return s[r].script;if(t){let o={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return s.splice(-1-r,0,o),o.script}}},getLangSysTable:function(e,t,n){let s=this.getScriptTable(e,n);if(s){if(!t||t==="dflt"||t==="DFLT")return s.defaultLangSys;let r=gs(s.langSysRecords,t);if(r>=0)return s.langSysRecords[r].langSys;if(n){let o={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return s.langSysRecords.splice(-1-r,0,o),o.langSys}}},getFeatureTable:function(e,t,n,s){let r=this.getLangSysTable(e,t,s);if(r){let o,a=r.featureIndexes,i=this.font.tables[this.tableName].features;for(let l=0;l<a.length;l++)if(o=i[a[l]],o.tag===n)return o.feature;if(s){let l=i.length;return $.assert(l===0||n>=i[l-1].tag,"Features must be added in alphabetical order."),o={tag:n,feature:{params:0,lookupListIndexes:[]}},i.push(o),a.push(l),o.feature}}},getLookupTables:function(e,t,n,s,r){let o=this.getFeatureTable(e,t,n,r),a=[];if(o){let i,l=o.lookupListIndexes,f=this.font.tables[this.tableName].lookups;for(let u=0;u<l.length;u++)i=f[l[u]],i.lookupType===s&&a.push(i);if(a.length===0&&r){i={lookupType:s,lookupFlag:0,subtables:[],markFilteringSet:void 0};let u=f.length;return f.push(i),l.push(u),[i]}}return a},getGlyphClass:function(e,t){switch(e.format){case 1:return e.startGlyph<=t&&t<e.startGlyph+e.classes.length?e.classes[t-e.startGlyph]:0;case 2:{let n=io(e.ranges,t);return n?n.classId:0}}},getCoverageIndex:function(e,t){switch(e.format){case 1:{let n=ao(e.glyphs,t);return n>=0?n:-1}case 2:{let n=io(e.ranges,t);return n?n.index+t-n.start:-1}}},expandCoverage:function(e){if(e.format===1)return e.glyphs;{let t=[],n=e.ranges;for(let s=0;s<n.length;s++){let r=n[s],o=r.start,a=r.end;for(let i=o;i<=a;i++)t.push(i)}return t}}};var Cn=lo;function qt(e){Cn.call(this,e,"gpos")}qt.prototype=Cn.prototype,qt.prototype.init=function(){let e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},qt.prototype.getKerningValue=function(e,t,n){for(let s=0;s<e.length;s++){let r=e[s].subtables;for(let o=0;o<r.length;o++){let a=r[o],i=this.getCoverageIndex(a.coverage,t);if(!(i<0))switch(a.posFormat){case 1:{let l=a.pairSets[i];for(let f=0;f<l.length;f++){let u=l[f];if(u.secondGlyph===n)return u.value1&&u.value1.xAdvance||0}break}case 2:{let l=this.getGlyphClass(a.classDef1,t),f=this.getGlyphClass(a.classDef2,n),u=a.classRecords[l][f];return u.value1&&u.value1.xAdvance||0}}}}return 0},qt.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,"kern",2)};var yc=qt;function bc(e,t){let n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}function vc(e,t,n){let s=0,r=e.length-1,o=null;for(;s<=r;){let a=Math.floor((s+r)/2),i=e[a],l=i[t];if(l<n)s=a+1;else if(l>n)r=a-1;else{o=i;break}}return o}function xc(e,t,n){let s=0,r=e.length-1;for(;s<=r;){let o=Math.floor((s+r)/2),a=e[o];if(a[t]<n)s=o+1;else if(a[t]>n)r=o-1;else return o}return-1}function Sc(e,t,n){let s=0,r=e.length,o=(a,i)=>a[t]-i[t];for(;s<r;){let a=s+r>>>1;o(e[a],n)<0?s=a+1:r=a}return e.splice(s,0,n),s}function co(e){return e[0]===31&&e[1]===139&&e[2]===8}function Tc(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=10,s=e.byteLength-8,r=t.getInt8(3);if(r&4&&(n+=2+t.getUint16(n,!0)),r&8)for(;n<s&&e[n++]!==0;);if(r&16)for(;n<s&&e[n++]!==0;);if(r&2&&(n+=2),n>=s)throw new Error("Can't find compressed blocks");let o=t.getUint32(t.byteLength-4,!0);return Ee(e.subarray(n,s),new Uint8Array(o))}function uo(e){return{x:e.x,y:e.y,onCurve:e.onCurve,lastPointOfContour:e.lastPointOfContour}}function kc(e){return{glyphIndex:e.glyphIndex,xScale:e.xScale,scale01:e.scale01,scale10:e.scale10,yScale:e.yScale,dx:e.dx,dy:e.dy}}function Pe(e){Cn.call(this,e,"gsub")}function ms(e,t,n){let s=e.subtables;for(let r=0;r<s.length;r++){let o=s[r];if(o.substFormat===t)return o}if(n)return s.push(n),n}Pe.prototype=Cn.prototype,Pe.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},Pe.prototype.getSingle=function(e,t,n){let s=[],r=this.getLookupTables(t,n,e,1);for(let o=0;o<r.length;o++){let a=r[o].subtables;for(let i=0;i<a.length;i++){let l=a[i],f=this.expandCoverage(l.coverage),u;if(l.substFormat===1){let m=l.deltaGlyphId;for(u=0;u<f.length;u++){let d=f[u];s.push({sub:d,by:d+m})}}else{let m=l.substitute;for(u=0;u<f.length;u++)s.push({sub:f[u],by:m[u]})}}}return s},Pe.prototype.getMultiple=function(e,t,n){let s=[],r=this.getLookupTables(t,n,e,2);for(let o=0;o<r.length;o++){let a=r[o].subtables;for(let i=0;i<a.length;i++){let l=a[i],f=this.expandCoverage(l.coverage),u;for(u=0;u<f.length;u++){let m=f[u],d=l.sequences[u];s.push({sub:m,by:d})}}}return s},Pe.prototype.getAlternates=function(e,t,n){let s=[],r=this.getLookupTables(t,n,e,3);for(let o=0;o<r.length;o++){let a=r[o].subtables;for(let i=0;i<a.length;i++){let l=a[i],f=this.expandCoverage(l.coverage),u=l.alternateSets;for(let m=0;m<f.length;m++)s.push({sub:f[m],by:u[m]})}}return s},Pe.prototype.getLigatures=function(e,t,n){let s=[],r=this.getLookupTables(t,n,e,4);for(let o=0;o<r.length;o++){let a=r[o].subtables;for(let i=0;i<a.length;i++){let l=a[i],f=this.expandCoverage(l.coverage),u=l.ligatureSets;for(let m=0;m<f.length;m++){let d=f[m],S=u[m];for(let b=0;b<S.length;b++){let T=S[b];s.push({sub:[d].concat(T.components),by:T.ligGlyph})}}}}return s},Pe.prototype.addSingle=function(e,t,n,s){let r=this.getLookupTables(n,s,e,1,!0)[0],o=ms(r,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});$.assert(o.coverage.format===1,"Single: unable to modify coverage table format "+o.coverage.format);let a=t.sub,i=this.binSearch(o.coverage.glyphs,a);i<0&&(i=-1-i,o.coverage.glyphs.splice(i,0,a),o.substitute.splice(i,0,0)),o.substitute[i]=t.by},Pe.prototype.addMultiple=function(e,t,n,s){$.assert(t.by instanceof Array&&t.by.length>1,'Multiple: "by" must be an array of two or more ids');let r=this.getLookupTables(n,s,e,2,!0)[0],o=ms(r,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});$.assert(o.coverage.format===1,"Multiple: unable to modify coverage table format "+o.coverage.format);let a=t.sub,i=this.binSearch(o.coverage.glyphs,a);i<0&&(i=-1-i,o.coverage.glyphs.splice(i,0,a),o.sequences.splice(i,0,0)),o.sequences[i]=t.by},Pe.prototype.addAlternate=function(e,t,n,s){let r=this.getLookupTables(n,s,e,3,!0)[0],o=ms(r,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});$.assert(o.coverage.format===1,"Alternate: unable to modify coverage table format "+o.coverage.format);let a=t.sub,i=this.binSearch(o.coverage.glyphs,a);i<0&&(i=-1-i,o.coverage.glyphs.splice(i,0,a),o.alternateSets.splice(i,0,0)),o.alternateSets[i]=t.by},Pe.prototype.addLigature=function(e,t,n,s){let r=this.getLookupTables(n,s,e,4,!0)[0],o=r.subtables[0];o||(o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},r.subtables[0]=o),$.assert(o.coverage.format===1,"Ligature: unable to modify coverage table format "+o.coverage.format);let a=t.sub[0],i=t.sub.slice(1),l={ligGlyph:t.by,components:i},f=this.binSearch(o.coverage.glyphs,a);if(f>=0){let u=o.ligatureSets[f];for(let m=0;m<u.length;m++)if(bc(u[m].components,i))return;u.push(l)}else f=-1-f,o.coverage.glyphs.splice(f,0,a),o.ligatureSets.splice(f,0,[l])},Pe.prototype.getFeature=function(e,t,n){if(/ss\d\d/.test(e))return this.getSingle(e,t,n);switch(e){case"aalt":case"salt":return this.getSingle(e,t,n).concat(this.getAlternates(e,t,n));case"dlig":case"liga":case"rlig":return this.getLigatures(e,t,n);case"ccmp":return this.getMultiple(e,t,n).concat(this.getLigatures(e,t,n));case"stch":return this.getMultiple(e,t,n)}},Pe.prototype.add=function(e,t,n,s){if(/ss\d\d/.test(e))return this.addSingle(e,t,n,s);switch(e){case"aalt":case"salt":return typeof t.by=="number"?this.addSingle(e,t,n,s):this.addAlternate(e,t,n,s);case"dlig":case"liga":case"rlig":return this.addLigature(e,t,n,s);case"ccmp":return t.by instanceof Array?this.addMultiple(e,t,n,s):this.addLigature(e,t,n,s)}};var wc=Pe,fo=class{constructor(e){this.defaultValue=255,this.font=e}cpal(){return this.font.tables&&this.font.tables.cpal?this.font.tables.cpal:!1}getAll(e){let t=[],n=this.cpal();if(!n)return t;for(let s=0;s<n.colorRecordIndices.length;s++){let r=n.colorRecordIndices[s],o=[];for(let a=r;a<r+n.numPaletteEntries;a++)o.push(Ft(n.colorRecords[a],e||"hexa"));t.push(o)}return t}toCPALcolor(e){return Array.isArray(e)?e.map(t=>Tn(t,"raw")):Tn(e,"raw")}fillPalette(e,t=[],n=this.cpal().numPaletteEntries){return e=Number.isInteger(e)?this.get(e,"raw"):e,Object.assign(Array(n).fill(this.defaultValue),this.toCPALcolor(e).concat(this.toCPALcolor(t)))}extend(e){if(this.ensureCPAL(Array(e).fill(this.defaultValue)))return;let t=this.cpal(),n=t.numPaletteEntries+e,s=this.getAll().map(r=>this.fillPalette(r,[],n));t.numPaletteEntries=n,t.colorRecords=this.toCPALcolor(s.flat()),this.updateIndices()}get(e,t="hexa"){return this.getAll(t)[e]||null}getColor(e,t=0,n="hexa"){return os(this.font,e,t,n)}setColor(e,t,n=0){e=parseInt(e),n=parseInt(n);let s=this.getAll("raw"),r=s[n];if(!r)throw Error(`paletteIndex ${n} out of range`);let o=this.cpal(),a=o.numPaletteEntries;Array.isArray(t)||(t=[t]),t.length+e>a&&(this.extend(t.length+e-a),s=this.getAll("raw"),r=s[n]);for(let i=0;i<t.length;i++)r[i+e]=this.toCPALcolor(t[i]);o.colorRecords=s.flat(),this.updateIndices()}add(e){if(this.ensureCPAL(e))return;let t=this.cpal(),n=t.numPaletteEntries;e&&e.length?(e=this.toCPALcolor(e),e.length>n?this.extend(e.length-n):e.length<n&&(e=this.fillPalette(e)),t.colorRecordIndices.push(t.colorRecords.length),t.colorRecords.push(...e)):(t.colorRecordIndices.push(t.colorRecords.length),t.colorRecords.push(...Array(n).fill(this.defaultValue)))}delete(e){let t=this.getAll("raw");delete t[e];let n=this.cpal();n.colorRecordIndices.pop(),n.colorRecords=t.flat()}deleteColor(e,t){if(e===t)throw Error("replacementIndex cannot be the same as colorIndex");let n=this.cpal(),s=this.getAll("raw"),r=[];if(t>n.numPaletteEntries-1)throw Error(`Replacement index out of range: numPaletteEntries after deletion: ${n.numPaletteEntries-1}, replacementIndex: ${t})`);for(let i=0;i<s.length;i++){let f=s[i].filter((u,m)=>m!==e);r.push(f)}let o=this.font.tables.colr;if(o){let i=o.layerRecords;for(let l=0;l<i.length;l++){let f=i[l].paletteIndex;if(f>e)i[l].paletteIndex-=1;else if(f===e){let u=0;for(let m=0;m<s.length;m++)if(t>e&&t<=e+s[m].length){u++;break}i[l].paletteIndex=t-u}}this.font.tables.colr={...o,layerRecords:i}}let a=r.flat();for(let i=0;i<s.length;i++)n.colorRecordIndices[i]-=i;n.numPaletteEntries=Math.max(0,n.numPaletteEntries-1),n.colorRecords=this.toCPALcolor(a)}ensureCPAL(e){return this.cpal()?!1:(!e||!e.length?e=[this.defaultValue]:e=this.toCPALcolor(e),this.font.tables.cpal={version:0,numPaletteEntries:e.length,colorRecords:e,colorRecordIndices:[0]},!0)}updateIndices(){let e=this.cpal(),t=Math.ceil(e.colorRecords.length/e.numPaletteEntries);e.colorRecordIndices=[];for(let n=0;n<t;n++)e.colorRecordIndices.push(n*e.numPaletteEntries)}},Cc=class{constructor(e){this.font=e}ensureCOLR(){return this.font.tables.colr||(this.font.tables.colr={version:0,baseGlyphRecords:[],layerRecords:[]}),this.font}get(e){let t=this.font,n=[],s=t.tables.colr,r=t.tables.cpal;if(!s||!r)return n;let o=vc(s.baseGlyphRecords,"glyphID",e);if(!o)return n;let a=o.firstLayerIndex,i=o.numLayers;for(let l=0;l<i;l++){let f=s.layerRecords[a+l];n.push({glyph:t.glyphs.get(f.glyphID),paletteIndex:f.paletteIndex})}return n}add(e,t,n){let s=this.get(e);t=Array.isArray(t)?t:[t],n===void 0||n===1/0||n>s.length?n=s.length:n<0&&(n=s.length+1+n%(s.length+1),n>=s.length+1&&(n-=s.length+1));let r=[];for(let o=0;o<n;o++){let a=Number.isInteger(s[o].glyph)?s[o].glyph:s[o].glyph.index;r.push({glyphID:a,paletteIndex:s[o].paletteIndex})}for(let o of t){let a=Number.isInteger(o.glyph)?o.glyph:o.glyph.index;r.push({glyphID:a,paletteIndex:o.paletteIndex})}for(let o=n;o<s.length;o++){let a=Number.isInteger(s[o].glyph)?s[o].glyph:s[o].glyph.index;r.push({glyphID:a,paletteIndex:s[o].paletteIndex})}this.updateColrTable(e,r)}setPaletteIndex(e,t,n){let s=this.get(e);s[t]?(s=s.map((r,o)=>({glyphID:r.glyph.index,paletteIndex:o===t?n:r.paletteIndex})),this.updateColrTable(e,s)):console.error("Invalid layer index")}remove(e,t,n=t){let s=this.get(e);s=s.map(r=>({glyphID:r.glyph.index,paletteIndex:r.paletteIndex})),s.splice(t,n-t+1),this.updateColrTable(e,s)}updateColrTable(e,t){this.ensureCOLR();let s=this.font.tables.colr,r=xc(s.baseGlyphRecords,"glyphID",e);if(r===-1){let u={glyphID:e,firstLayerIndex:s.layerRecords.length,numLayers:0};r=Sc(s.baseGlyphRecords,"glyphID",u)}let a=s.baseGlyphRecords[r],i=a.numLayers,l=t.length,f=l-i;if(f>0){let u=t.slice(i).map(m=>({glyphID:m.glyphID,paletteIndex:m.paletteIndex}));s.layerRecords.splice(a.firstLayerIndex+i,0,...u)}else f<0&&s.layerRecords.splice(a.firstLayerIndex+l,-f);for(let u=0;u<Math.min(i,l);u++)s.layerRecords[a.firstLayerIndex+u]={glyphID:t[u].glyphID,paletteIndex:t[u].paletteIndex};if(a.numLayers=l,f!==0)for(let u=0;u<s.baseGlyphRecords.length;u++){let m=s.baseGlyphRecords[u];u===r||m.firstLayerIndex<a.firstLayerIndex||(s.baseGlyphRecords[u].firstLayerIndex+=f)}}},Oc=class{constructor(e){this.font=e,this.cache=new WeakMap}get(e){let t=this.getOrCreateSvgImageCacheEntry(e);return t&&t.image}getAsync(e){let t=this.getOrCreateSvgImageCacheEntry(e);return t&&t.promise}getOrCreateSvgImageCacheEntry(e){let t=this.font.tables.svg;if(t===void 0)return;let n=t.get(e);if(n===void 0)return;let s=this.cache.get(n);s===void 0&&(s=Lc(n),this.cache.set(n,s));let r=s.images.get(e);return r===void 0&&(r=Ec(this.font,s.template,e),r.promise.then(o=>{if(r.image=o,typeof this.font.onGlyphUpdated=="function")try{this.font.onGlyphUpdated(e)}catch(a){console.error("font.onGlyphUpdated",e,a)}}),s.images.set(e,r)),r}};function Lc(e){return{template:Rc(e).then(Fc),images:new Map}}function Ec(e,t,n){return{promise:t.then(s=>{let r;typeof s=="string"?r=s:(s[4]=n,r=s.join(""));let o=Dc(r,e.unitsPerEm);return o.image.decode().then(()=>o)}),image:void 0}}var Rc=typeof DecompressionStream=="function"?Ic:Ac;function Ac(e){try{return Promise.resolve(new TextDecoder().decode(co(e)?Tc(e):e))}catch(t){return Promise.reject(t)}}function Ic(e){if(co(e))return new Response(new Response(e).body.pipeThrough(new DecompressionStream("gzip"))).text();try{return Promise.resolve(new TextDecoder().decode(e))}catch(t){return Promise.reject(t)}}function Fc(e){let t=e.indexOf("<svg"),n=e.indexOf(">",t+4)+1;if(/ id=['"]glyph\d+['"]/.test(e.substring(t,n)))return e;let s=e.lastIndexOf("</svg>");return[e.substring(0,n),"<defs>",e.substring(n,s),'</defs><use href="#glyph',"",'"/>',e.substring(s)]}function Dc(e,t){let s=new DOMParser().parseFromString(e,"image/svg+xml").documentElement,r=s.viewBox.baseVal,o=s.width.baseVal,a=s.height.baseVal,i=1,l=1;r.width>0&&r.height>0&&(o.unitType===1?(i=o.valueInSpecifiedUnits/r.width,l=a.unitType===1?a.valueInSpecifiedUnits/r.height:i):a.unitType===1?(l=a.valueInSpecifiedUnits/r.height,i=l):t&&(i=t/r.width,l=t/r.height));let f=document.createElement("div");f.style.position="fixed",f.style.visibility="hidden",f.appendChild(s),document.body.appendChild(f);let u=s.getBBox();document.body.removeChild(f);let m=(u.x-r.x)*i,d=(r.y-u.y)*l,S=u.width*i,b=u.height*l;s.setAttribute("viewBox",[u.x,u.y,u.width,u.height].join(" ")),i!==1&&s.setAttribute("width",S),l!==1&&s.setAttribute("height",b);let T=new Image(S,b);return T.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(s.outerHTML),{leftSideBearing:m,baseline:d,image:T}}var ys=new WeakMap;function po(e,t,n,s,r){let o;return(t&s)>0?(o=e.parseByte(),(t&r)===0&&(o=-o),o=n+o):(t&r)>0?o=n:o=n+e.parseShort(),o}function ho(e,t,n){let s=new B.Parser(t,n);e._numberOfContours=s.parseShort(),e._xMin=s.parseShort(),e._yMin=s.parseShort(),e._xMax=s.parseShort(),e._yMax=s.parseShort();let r,o;if(e._numberOfContours>0){let a=e.endPointIndices=[];for(let l=0;l<e._numberOfContours;l+=1)a.push(s.parseUShort());e.instructionLength=s.parseUShort(),e.instructions=[];for(let l=0;l<e.instructionLength;l+=1)e.instructions.push(s.parseByte());let i=a[a.length-1]+1;r=[];for(let l=0;l<i;l+=1)if(o=s.parseByte(),r.push(o),(o&8)>0){let f=s.parseByte();for(let u=0;u<f;u+=1)r.push(o),l+=1}if($.argument(r.length===i,"Bad flags."),a.length>0){let l=[],f;if(i>0){for(let d=0;d<i;d+=1)o=r[d],f={},f.onCurve=!!(o&1),f.lastPointOfContour=a.indexOf(d)>=0,l.push(f);let u=0;for(let d=0;d<i;d+=1)o=r[d],f=l[d],f.x=po(s,o,u,2,16),u=f.x;let m=0;for(let d=0;d<i;d+=1)o=r[d],f=l[d],f.y=po(s,o,m,4,32),m=f.y}e.points=l}else e.points=[]}else if(e._numberOfContours===0)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];let a=!0;for(;a;){r=s.parseUShort();let i={glyphIndex:s.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(r&1)>0?(r&2)>0?(i.dx=s.parseShort(),i.dy=s.parseShort()):i.matchedPoints=[s.parseUShort(),s.parseUShort()]:(r&2)>0?(i.dx=s.parseChar(),i.dy=s.parseChar()):i.matchedPoints=[s.parseByte(),s.parseByte()],(r&8)>0?i.xScale=i.yScale=s.parseF2Dot14():(r&64)>0?(i.xScale=s.parseF2Dot14(),i.yScale=s.parseF2Dot14()):(r&128)>0&&(i.xScale=s.parseF2Dot14(),i.scale01=s.parseF2Dot14(),i.scale10=s.parseF2Dot14(),i.yScale=s.parseF2Dot14()),e.components.push(i),a=!!(r&32)}if(r&256){e.instructionLength=s.parseUShort(),e.instructions=[];for(let i=0;i<e.instructionLength;i+=1)e.instructions.push(s.parseByte())}}}function On(e,t){let n=[];for(let s=0;s<e.length;s+=1){let r=e[s],o={x:t.xScale*r.x+t.scale10*r.y+t.dx,y:t.scale01*r.x+t.yScale*r.y+t.dy,onCurve:r.onCurve,lastPointOfContour:r.lastPointOfContour};n.push(o)}return n}function Uc(e){let t=[],n=[];for(let s=0;s<e.length;s+=1){let r=e[s];n.push(r),r.lastPointOfContour&&(t.push(n),n=[])}return $.argument(n.length===0,"There are still points left in the current contour."),t}function bs(e){let t=new vt;if(!e)return t;let n=Uc(e);for(let s=0;s<n.length;++s){let r=n[s],o=r[r.length-1],a=r[0];if(o.onCurve)t.moveTo(o.x,o.y);else if(a.onCurve)t.moveTo(a.x,a.y);else{let i={x:(o.x+a.x)*.5,y:(o.y+a.y)*.5};t.moveTo(i.x,i.y)}for(let i=0;i<r.length;++i)if(o=a,a=r[(i+1)%r.length],o.onCurve)t.lineTo(o.x,o.y);else{let l=a;a.onCurve||(l={x:(o.x+a.x)*.5,y:(o.y+a.y)*.5}),t.quadraticCurveTo(o.x,o.y,l.x,l.y)}t.closePath()}return t}function go(e,t){if(t.isComposite){ys.has(e)||ys.set(e,new Set);let n=ys.get(e);n.add(t.index);try{for(let s=0;s<t.components.length;s+=1){let r=t.components[s];if(n.has(r.glyphIndex))continue;let o=e.get(r.glyphIndex);if(o.getPath(),o.points){let a;if(r.matchedPoints===void 0)a=On(o.points,r);else{if(r.matchedPoints[0]>t.points.length-1||r.matchedPoints[1]>o.points.length-1)throw Error("Matched points out of range in "+t.name);let i=t.points[r.matchedPoints[0]],l=o.points[r.matchedPoints[1]],f={xScale:r.xScale,scale01:r.scale01,scale10:r.scale10,yScale:r.yScale,dx:0,dy:0};l=On([l],f)[0],f.dx=i.x-l.x,f.dy=i.y-l.y,a=On(o.points,f)}t.points=t.points.concat(a)}}}finally{n.delete(t.index)}}return bs(t.points)}function Mc(e,t,n,s){let r=new Je.GlyphSet(s);for(let o=0;o<n.length-1;o+=1){let a=n[o],i=n[o+1];a!==i?r.push(o,Je.ttfGlyphLoader(s,o,ho,e,t+a,go)):r.push(o,Je.glyphLoader(s,o))}return r}function Pc(e,t,n,s){let r=new Je.GlyphSet(s);return s._push=function(o){let a=n[o],i=n[o+1];a!==i?r.push(o,Je.ttfGlyphLoader(s,o,ho,e,t+a,go)):r.push(o,Je.glyphLoader(s,o))},r}function Bc(e,t,n,s,r){return r.lowMemory?Pc(e,t,n,s):Mc(e,t,n,s)}var mo={getPath:bs,parse:Bc},Nc=class{constructor(e){this.font=e}normalizeCoordTags(e){for(let t in e)if(t.length<4){let n=t.padEnd(4," ");e[n]===void 0&&(e[n]=e[t]),delete e[t]}}getNormalizedCoords(e){e||(e=this.font.variation.get());let t=[];this.normalizeCoordTags(e);for(let n=0;n<this.fvar().axes.length;n++){let s=this.fvar().axes[n],r=e[s.tag];r===void 0&&(r=s.defaultValue),r<s.defaultValue?t.push((r-s.defaultValue+Number.EPSILON)/(s.defaultValue-s.minValue+Number.EPSILON)):t.push((r-s.defaultValue+Number.EPSILON)/(s.maxValue-s.defaultValue+Number.EPSILON))}if(this.avar())for(let n=0;n<this.avar().axisSegmentMaps.length;n++){let s=this.avar().axisSegmentMaps[n];for(let r=0;r<s.axisValueMaps.length;r++){let o=s.axisValueMaps[r];if(r>=1&&t[n]<o.fromCoordinate){let a=s.axisValueMaps[r-1];t[n]=((t[n]-a.fromCoordinate)*(o.toCoordinate-a.toCoordinate)+Number.EPSILON)/(o.fromCoordinate-a.fromCoordinate+Number.EPSILON)+a.toCoordinate;break}}}return t}interpolatePoints(e,t,n){if(e.length===0)return;let s=0;for(;s<e.length;){let r=s,o=s,a=e[o];for(;!a.lastPointOfContour;)a=e[++o];for(;s<=o&&!n[s];)s++;if(s>o)continue;let i=s,l=s;for(s++;s<=o;)n[s]&&(this.deltaInterpolate(l+1,s-1,l,s,t,e),l=s),s++;l===i?this.deltaShift(r,o,l,t,e):(this.deltaInterpolate(l+1,o,l,i,t,e),i>0&&this.deltaInterpolate(r,i-1,l,i,t,e)),s=o+1}}deltaInterpolate(e,t,n,s,r,o){if(e>t)return;let a=["x","y"];for(let l=0;l<a.length;l++){let f=a[l];if(r[n][f]>r[s][f]){var i=n;n=s,s=i}let u=r[n][f],m=r[s][f],d=o[n][f],S=o[s][f];if(u!==m||d===S){let b=u===m?0:(S-d)/(m-u);for(let T=e;T<=t;T++){let C=r[T][f];C<=u?C+=d-u:C>=m?C+=S-m:C=d+(C-u)*b,o[T][f]=C}}}}deltaShift(e,t,n,s,r){let o=r[n].x-s[n].x,a=r[n].y-s[n].y;if(!(o===0&&a===0))for(let i=e;i<=t;i++)i!==n&&(r[i].x+=o,r[i].y+=a)}transformComponents(e,t,n,s,r,o){let a=0;for(let i=0;i<e.components.length;i++){let l=e.components[i],f=this.font.glyphs.get(l.glyphIndex),u=kc(l),m=s.indexOf(i);m>-1&&(u.dx+=Math.round(r.deltas[m]*o),u.dy+=Math.round(r.deltasY[m]*o));let d=On(this.getTransform(f,n).points,u);t.splice(a,d.length,...d),a+=f.points.length}}applyTupleVariationStore(e,t,n,s="gvar",r={}){n||(n=this.font.variation.get());let o=this.getNormalizedCoords(n),{headers:a,sharedPoints:i}=e,l=this.fvar().axes.length,f;s==="gvar"?f=t.map(uo):s==="cvar"&&(f=[...t]);for(let u=0;u<a.length;u++){let m=a[u],d=1;for(let b=0;b<l;b++){let T=[0];switch(s){case"gvar":T=m.peakTuple?m.peakTuple:this.gvar().sharedTuples[m.sharedTupleRecordsIndex];break;case"cvar":T=m.peakTuple;break}if(T[b]!==0){if(o[b]===0){d=0;break}if(m.intermediateStartTuple)if(o[b]<m.intermediateStartTuple[b]||o[b]>m.intermediateEndTuple[b]){d=0;break}else o[b]<T[b]?d=d*(o[b]-m.intermediateStartTuple[b]+Number.EPSILON)/(T[b]-m.intermediateStartTuple[b]+Number.EPSILON):d=d*(m.intermediateEndTuple[b]-o[b]+Number.EPSILON)/(m.intermediateEndTuple[b]-T[b]+Number.EPSILON);else{if(o[b]<Math.min(0,T[b])||o[b]>Math.max(0,T[b])){d=0;break}d=(d*o[b]+Number.EPSILON)/(T[b]+Number.EPSILON)}}}if(d===0)continue;let S=m.privatePoints.length?m.privatePoints:i;if(s==="gvar"&&r.glyph&&r.glyph.isComposite)this.transformComponents(r.glyph,f,n,S,m,d);else if(S.length===0)for(let b=0;b<f.length;b++){let T=f[b];s==="gvar"?f[b]={x:Math.round(T.x+m.deltas[b]*d),y:Math.round(T.y+m.deltasY[b]*d),onCurve:T.onCurve,lastPointOfContour:T.lastPointOfContour}:s==="cvar"&&(f[b]=Math.round(T+m.deltas[b]*d))}else{let b;s==="gvar"?b=f.map(uo):s==="cvar"&&(b=f);let T=Array(t.length).fill(!1);for(let C=0;C<S.length;C++){let W=S[C];if(W<t.length){let V=b[W];s==="gvar"?(T[W]=!0,V.x+=m.deltas[C]*d,V.y+=m.deltasY[C]*d):s==="cvar"&&(f[W]=Math.round(V+m.deltas[C]*d))}}if(s==="gvar"){this.interpolatePoints(b,f,T);for(let C=0;C<t.length;C++){let W=b[C].x-f[C].x,V=b[C].y-f[C].y;f[C].x=Math.round(f[C].x+W),f[C].y=Math.round(f[C].y+V)}}}}return f}getTransform(e,t){Number.isInteger(e)&&(e=this.font.glyphs.get(e));let n=e.getBlendPath,s=!!(e.points&&e.points.length),r=e;if(n||s){if(t||(t=this.font.variation.get()),s){let o=this.gvar()&&this.gvar().glyphVariations[e.index];if(o){let a=e.points,i=this.applyTupleVariationStore(o,a,t,"gvar",{glyph:e});r=new Dt(Object.assign({},e,{points:i,path:bs(i)}))}}else if(n){let o=e.getBlendPath(t);r=new Dt(Object.assign({},e,{path:o}))}}return this.font.tables.hvar&&(e._advanceWidth=typeof e._advanceWidth<"u"?e._advanceWidth:e.advanceWidth,e.advanceWidth=r.advanceWidth=Math.round(e._advanceWidth+this.getVariableAdjustment(r.index,"hvar","advanceWidth",t)),e._leftSideBearing=typeof e._leftSideBearing<"u"?e._leftSideBearing:e.leftSideBearing,e.leftSideBearing=r.leftSideBearing=Math.round(e._leftSideBearing+this.getVariableAdjustment(r.index,"hvar","lsb",t))),r}getCvarTransform(e){let t=this.font.tables.cvt,n=this.cvar();return!t||!t.length||!n||!n.headers.length?t:this.applyTupleVariationStore(n,t,e,"cvar")}getVariableAdjustment(e,t,n,s){s=s||this.font.variation.get();let r,o,a=this.font.tables[t];if(!a)throw Error(`trying to get variation adjustment from non-existent table "${a}"`);if(!a.itemVariationStore)throw Error(`trying to get variation adjustment from table "${a}" which does not have an itemVariationStore`);let i=a[n]&&a[n].map.length;if(i){let l=e;l>=i&&(l=i-1),{outerIndex:r,innerIndex:o}=a[n].map[l]}else r=0,o=e;return this.getDelta(a.itemVariationStore,r,o,s)}getDelta(e,t,n,s){if(t>=e.itemVariationSubtables.length)return 0;let r=e.itemVariationSubtables[t];if(n>=r.deltaSets.length)return 0;let o=r.deltaSets[n],a=this.getBlendVector(e,t,s),i=0;for(let l=0;l<r.regionIndexes.length;l++)i+=o[l]*a[l];return i}getBlendVector(e,t,n){n||(n=this.font.variation.get());let s=e.itemVariationSubtables[t],r=this.getNormalizedCoords(n),o=[];for(let a=0;a<s.regionIndexes.length;a++){let i=1,l=s.regionIndexes[a],f=e.variationRegions[l].regionAxes;for(let u=0;u<f.length;u++){let m=f[u],d;m.startCoord>m.peakCoord||m.peakCoord>m.endCoord||m.startCoord<0&&m.endCoord>0&&m.peakCoord!==0||m.peakCoord===0?d=1:r[u]<m.startCoord||r[u]>m.endCoord?d=0:r[u]===m.peakCoord?d=1:r[u]<m.peakCoord?d=(r[u]-m.startCoord+Number.EPSILON)/(m.peakCoord-m.startCoord+Number.EPSILON):d=(m.endCoord-r[u]+Number.EPSILON)/(m.endCoord-m.peakCoord+Number.EPSILON),i*=d}o[a]=i}return o}avar(){return this.font.tables.avar}cvar(){return this.font.tables.cvar}fvar(){return this.font.tables.fvar}gvar(){return this.font.tables.gvar}hvar(){return this.font.tables.hvar}},_c=class{constructor(e){this.font=e,this.process=new Nc(this.font),this.activateDefaultVariation(),this.getTransform=this.process.getTransform.bind(this.process)}activateDefaultVariation(){let e=this.getDefaultInstanceIndex();e>-1?this.set(e):this.set(this.getDefaultCoordinates())}getDefaultCoordinates(){return this.fvar().axes.reduce((e,t)=>(e[t.tag]=t.defaultValue,e),{})}getDefaultInstanceIndex(){let e=this.getDefaultCoordinates(),t=this.getInstanceIndex(e);return t<0&&(t=this.fvar().instances.findIndex(n=>n.name&&n.name.en==="Regular")),t}getInstanceIndex(e){return this.fvar().instances.findIndex(t=>Object.keys(e).every(n=>t.coordinates[n]===e[n]))}getInstance(e){return this.fvar().instances&&this.fvar().instances[e]}set(e){let t;if(Number.isInteger(e)){let n=this.getInstance(e);if(!n)throw Error(`Invalid instance index ${e}`);t={...n.coordinates}}else t=e,this.process.normalizeCoordTags(t);t=Object.assign({},this.font.defaultRenderOptions.variation,t),this.font.defaultRenderOptions=Object.assign({},this.font.defaultRenderOptions,{variation:t})}get(){return Object.assign({},this.font.defaultRenderOptions.variation)}avar(){return this.font.tables.avar}cvar(){return this.font.tables.cvar}fvar(){return this.font.tables.fvar}gvar(){return this.font.tables.gvar}hvar(){return this.font.tables.hvar}},yo=1e6,Ln=64,En=1e4,bo,kt,vo,vs;function xo(e){this.font=e,this.getCommands=function(t){return mo.getPath(t).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Gc(e){return e}function So(e){return Math.sign(e)*Math.round(Math.abs(e))}function Hc(e){return Math.sign(e)*Math.round(Math.abs(e*2))/2}function Vc(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function jc(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function $c(e){return Math.sign(e)*Math.floor(Math.abs(e))}var To=function(e){let t=this.srPeriod,n=this.srPhase,s=this.srThreshold,r=1;return e<0&&(e=-e,r=-1),e+=s-n,e=Math.trunc(e/t)*t,e+=n,e<0?n*r:e*r},tt={x:1,y:0,axis:"x",distance:function(e,t,n,s){return(n?e.xo:e.x)-(s?t.xo:t.x)},interpolate:function(e,t,n,s){let r,o,a,i,l,f,u;if(!s||s===this){if(r=e.xo-t.xo,o=e.xo-n.xo,l=t.x-t.xo,f=n.x-n.xo,a=Math.abs(r),i=Math.abs(o),u=a+i,u===0){e.x=e.xo+(l+f)/2;return}e.x=e.xo+(l*i+f*a)/u;return}if(r=s.distance(e,t,!0,!0),o=s.distance(e,n,!0,!0),l=s.distance(t,t,!1,!0),f=s.distance(n,n,!1,!0),a=Math.abs(r),i=Math.abs(o),u=a+i,u===0){tt.setRelative(e,e,(l+f)/2,s,!0);return}tt.setRelative(e,e,(l*i+f*a)/u,s,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,n,s,r){if(!s||s===this){e.x=(r?t.xo:t.x)+n;return}let o=r?t.xo:t.x,a=r?t.yo:t.y,i=o+n*s.x,l=a+n*s.y;e.x=i+(e.y-l)/s.normalSlope},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},rt={x:0,y:1,axis:"y",distance:function(e,t,n,s){return(n?e.yo:e.y)-(s?t.yo:t.y)},interpolate:function(e,t,n,s){let r,o,a,i,l,f,u;if(!s||s===this){if(r=e.yo-t.yo,o=e.yo-n.yo,l=t.y-t.yo,f=n.y-n.yo,a=Math.abs(r),i=Math.abs(o),u=a+i,u===0){e.y=e.yo+(l+f)/2;return}e.y=e.yo+(l*i+f*a)/u;return}if(r=s.distance(e,t,!0,!0),o=s.distance(e,n,!0,!0),l=s.distance(t,t,!1,!0),f=s.distance(n,n,!1,!0),a=Math.abs(r),i=Math.abs(o),u=a+i,u===0){rt.setRelative(e,e,(l+f)/2,s,!0);return}rt.setRelative(e,e,(l*i+f*a)/u,s,!0)},normalSlope:0,setRelative:function(e,t,n,s,r){if(!s||s===this){e.y=(r?t.yo:t.y)+n;return}let o=r?t.xo:t.x,a=r?t.yo:t.y,i=o+n*s.x,l=a+n*s.y;e.y=l+s.normalSlope*(e.x-i)},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};Object.freeze(tt),Object.freeze(rt);function Yt(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}Yt.prototype.distance=function(e,t,n,s){return this.x*tt.distance(e,t,n,s)+this.y*rt.distance(e,t,n,s)},Yt.prototype.interpolate=function(e,t,n,s){let r,o,a,i,l,f,u;if(a=s.distance(e,t,!0,!0),i=s.distance(e,n,!0,!0),r=s.distance(t,t,!1,!0),o=s.distance(n,n,!1,!0),l=Math.abs(a),f=Math.abs(i),u=l+f,u===0){this.setRelative(e,e,(r+o)/2,s,!0);return}this.setRelative(e,e,(r*f+o*l)/u,s,!0)},Yt.prototype.setRelative=function(e,t,n,s,r){s=s||this;let o=r?t.xo:t.x,a=r?t.yo:t.y,i=o+n*s.x,l=a+n*s.y,f=s.normalSlope,u=this.slope,m=e.x,d=e.y;e.x=(u*m-f*i+l-d)/(u-f),e.y=u*(e.x-m)+d},Yt.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0};function Zt(e,t){let n=Math.sqrt(e*e+t*t);return e/=n,t/=n,e===1&&t===0?tt:e===0&&t===1?rt:new Yt(e,t)}function ot(e,t,n,s){this.x=this.xo=Math.round(e*64)/64,this.y=this.yo=Math.round(t*64)/64,this.lastPointOfContour=n,this.onCurve=s,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}ot.prototype.nextTouched=function(e){let t=this.nextPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},ot.prototype.prevTouched=function(e){let t=this.prevPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var Kt=Object.freeze(new ot(0,0)),Wc={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function lt(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=tt,this.round=So}}xo.prototype.exec=function(e,t){if(typeof t!="number")throw new Error("Point size is not a number!");if(this._errorState>2)return;let n=this.font,s=this._prepState;if(!s||s.ppem!==t){let r=this._fpgmState;if(!r){lt.prototype=Wc,r=this._fpgmState=new lt("fpgm",n.tables.fpgm),r.funcs=[],r.font=n,r.instructionCount=0,r.callDepth=0;try{kt(r)}catch(a){console.log("Hinting error in FPGM:"+a),this._errorState=3;return}}lt.prototype=r,s=this._prepState=new lt("prep",n.tables.prep),s.ppem=t,s.instructionCount=0,s.callDepth=0;let o=n.variation&&n.variation.process.getCvarTransform()||n.tables.cvt;if(o){let a=s.cvt=new Array(o.length),i=t/n.unitsPerEm;for(let l=0;l<o.length;l++)a[l]=o[l]*i}else s.cvt=[];try{kt(s)}catch(a){this._errorState<2&&console.log("Hinting error in PREP:"+a),this._errorState=2}}if(!(this._errorState>1))try{return vo(e,s)}catch(r){this._errorState<1&&(console.log("Hinting error:"+r),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}},vo=function(e,t){let n=t.ppem/t.font.unitsPerEm,s=n,r=e.components,o,a,i;if(lt.prototype=t,!r)i=new lt("glyf",e.instructions),i.instructionCount=0,i.callDepth=0,vs(e,i,n,s),a=i.gZone;else{let l=t.font;a=[],o=[];for(let f=0;f<r.length;f++){let u=r[f],m=l.glyphs.get(u.glyphIndex);i=new lt("glyf",m.instructions),i.instructionCount=0,i.callDepth=0,vs(m,i,n,s);let d=Math.round(u.dx*n),S=Math.round(u.dy*s),b=i.gZone,T=i.contours;for(let W=0;W<b.length;W++){let V=b[W];V.xTouched=V.yTouched=!1,V.xo=V.x=V.x+d,V.yo=V.y=V.y+S}let C=a.length;a.push.apply(a,b);for(let W=0;W<T.length;W++)o.push(T[W]+C)}e.instructions&&!i.inhibitGridFit&&(i=new lt("glyf",e.instructions),i.gZone=i.z0=i.z1=i.z2=a,i.contours=o,a.push(new ot(0,0),new ot(Math.round(e.advanceWidth*n),0)),kt(i),a.length-=2)}return a},vs=function(e,t,n,s){let r=e.points||[],o=r.length,a=t.gZone=t.z0=t.z1=t.z2=[],i=t.contours=[],l;for(let m=0;m<o;m++)l=r[m],a[m]=new ot(l.x*n,l.y*s,l.lastPointOfContour,l.onCurve);let f,u;for(let m=0;m<o;m++)l=a[m],f||(f=l,i.push(m)),l.lastPointOfContour?(l.nextPointOnContour=f,f.prevPointOnContour=l,f=void 0):(u=a[m+1],l.nextPointOnContour=u,u.prevPointOnContour=l);t.inhibitGridFit||(a.push(new ot(0,0),new ot(Math.round(e.advanceWidth*n),0)),kt(t),a.length-=2)},kt=function(e){let t=e.prog;if(!t)return;let n=t.length,s;for(e.ip=0;e.ip<n;e.ip++){if(++e.instructionCount>yo)throw new Error("Hinting instructions exceeded maximum of "+yo);if(s=bo[t[e.ip]],!s)throw new Error("unknown instruction: 0x"+Number(t[e.ip]).toString(16));s(e)}};function Rn(e){let t=e.tZone=new Array(e.gZone.length);for(let n=0;n<t.length;n++)t[n]=new ot(0,0)}function ko(e,t){let n=e.prog,s=e.ip,r=1,o;do if(o=n[++s],o===88)r++;else if(o===89)r--;else if(o===64)s+=n[s+1]+1;else if(o===65)s+=2*n[s+1]+1;else if(o>=176&&o<=183)s+=o-176+1;else if(o>=184&&o<=191)s+=(o-184+1)*2;else if(t&&r===1&&o===27)break;while(r>0);e.ip=s}function wo(e,t){t.fv=t.pv=t.dpv=e}function Co(e,t){t.pv=t.dpv=e}function Oo(e,t){t.fv=e}function Lo(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],a=t.z1[r],i,l;e?(i=o.y-a.y,l=a.x-o.x):(i=a.x-o.x,l=a.y-o.y),t.pv=t.dpv=Zt(i,l)}function Eo(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],a=t.z1[r],i,l;e?(i=o.y-a.y,l=a.x-o.x):(i=a.x-o.x,l=a.y-o.y),t.fv=Zt(i,l)}function zc(e){let t=e.stack,n=t.pop(),s=t.pop();e.pv=e.dpv=Zt(s,n)}function Xc(e){let t=e.stack,n=t.pop(),s=t.pop();e.fv=Zt(s,n)}function qc(e){let t=e.stack,n=e.pv;t.push(n.x*16384),t.push(n.y*16384)}function Yc(e){let t=e.stack,n=e.fv;t.push(n.x*16384),t.push(n.y*16384)}function Zc(e){e.fv=e.pv}function Kc(e){let t=e.stack,n=t.pop(),s=t.pop(),r=t.pop(),o=t.pop(),a=t.pop(),i=e.z0,l=e.z1,f=i[n],u=i[s],m=l[r],d=l[o],S=e.z2[a],b=f.x,T=f.y,C=u.x,W=u.y,V=m.x,X=m.y,Q=d.x,ie=d.y,ce=(b-C)*(X-ie)-(T-W)*(V-Q),ue=b*W-T*C,ve=V*ie-X*Q;S.x=(ue*(V-Q)-ve*(b-C))/ce,S.y=(ue*(X-ie)-ve*(T-W))/ce}function Qc(e){e.rp0=e.stack.pop()}function Jc(e){e.rp1=e.stack.pop()}function eu(e){e.rp2=e.stack.pop()}function tu(e){let t=e.stack.pop();switch(e.zp0=t,t){case 0:e.tZone||Rn(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function nu(e){let t=e.stack.pop();switch(e.zp1=t,t){case 0:e.tZone||Rn(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function su(e){let t=e.stack.pop();switch(e.zp2=t,t){case 0:e.tZone||Rn(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function ru(e){let t=e.stack.pop();switch(e.zp0=e.zp1=e.zp2=t,t){case 0:e.tZone||Rn(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 ou(e){e.loop=e.stack.pop(),e.loop>En&&(e.loop=En)}function au(e){e.round=So}function iu(e){e.round=Vc}function lu(e){let t=e.stack.pop();e.minDis=t/64}function cu(e){ko(e,!1)}function uu(e){let t=e.stack.pop();e.ip+=t-1}function fu(e){let t=e.stack.pop();e.cvCutIn=t/64}function pu(e){let t=e.stack;t.push(t[t.length-1])}function xs(e){e.stack.pop()}function hu(e){e.stack.length=0}function du(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n),t.push(s)}function gu(e){let t=e.stack;t.push(t.length)}function mu(e){let t=e.stack,n=t.pop(),s=t.pop();if(s>En&&(s=En),++e.callDepth>Ln)throw new Error("Hinting call depth exceeded maximum of "+Ln);let r=e.ip,o=e.prog;e.prog=e.funcs[n];for(let a=0;a<s;a++)kt(e);e.ip=r,e.prog=o,e.callDepth--}function yu(e){let t=e.stack.pop();if(++e.callDepth>Ln)throw new Error("Hinting call depth exceeded maximum of "+Ln);let n=e.ip,s=e.prog;e.prog=e.funcs[t],kt(e),e.ip=n,e.prog=s,e.callDepth--}function bu(e){let t=e.stack,n=t.pop();t.push(t[t.length-n])}function vu(e){let t=e.stack,n=t.pop();t.push(t.splice(t.length-n,1)[0])}function xu(e){if(e.env!=="fpgm")throw new Error("FDEF not allowed here");let t=e.stack,n=e.prog,s=e.ip,r=t.pop(),o=s;for(;n[++s]!==45;);e.ip=s,e.funcs[r]=n.slice(o+1,s)}function Ro(e,t){let n=t.stack.pop(),s=t.z0[n],r=t.fv,o=t.pv,a=o.distance(s,Kt);e&&(a=t.round(a)),r.setRelative(s,Kt,a,o),r.touch(s),t.rp0=t.rp1=n}function Ao(e,t){let n=t.z2,s=n.length-2,r,o,a;for(let i=0;i<s;i++)r=n[i],!e.touched(r)&&(o=r.prevTouched(e),o!==r&&(a=r.nextTouched(e),o===a&&e.setRelative(r,r,e.distance(o,o,!1,!0),e,!0),e.interpolate(r,o,a,e)))}function Io(e,t){let n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,a=t.pv,i=t.loop,l=t.z2;for(;i--;){let f=n.pop(),u=l[f],m=a.distance(r,r,!1,!0);o.setRelative(u,u,m,a),o.touch(u)}t.loop=1}function Fo(e,t){let n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,a=t.pv,i=n.pop(),l=t.z2[t.contours[i]],f=l,u=a.distance(r,r,!1,!0);do f!==r&&o.setRelative(f,f,u,a),f=f.nextPointOnContour;while(f!==l)}function Do(e,t){let n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,a=t.pv,i=n.pop(),l;switch(i){case 0:l=t.tZone;break;case 1:l=t.gZone;break;default:throw new Error("Invalid zone")}let f,u=a.distance(r,r,!1,!0),m=l.length-2;for(let d=0;d<m;d++)f=l[d],o.setRelative(f,f,u,a)}function Su(e){let t=e.stack,n=e.loop,s=e.fv,r=t.pop()/64,o=e.z2;for(;n--;){let a=t.pop(),i=o[a];s.setRelative(i,i,r),s.touch(i)}e.loop=1}function Tu(e){let t=e.stack,n=e.rp1,s=e.rp2,r=e.loop,o=e.z0[n],a=e.z1[s],i=e.fv,l=e.dpv,f=e.z2;for(;r--;){let u=t.pop(),m=f[u];i.interpolate(m,o,a,l),i.touch(m)}e.loop=1}function Uo(e,t){let n=t.stack,s=n.pop()/64,r=n.pop(),o=t.z1[r],a=t.z0[t.rp0],i=t.fv,l=t.pv;i.setRelative(o,a,s,l),i.touch(o),t.rp1=t.rp0,t.rp2=r,e&&(t.rp0=r)}function ku(e){let t=e.stack,n=e.rp0,s=e.z0[n],r=e.loop,o=e.fv,a=e.pv,i=e.z1;for(;r--;){let l=t.pop(),f=i[l];o.setRelative(f,s,0,a),o.touch(f)}e.loop=1}function wu(e){e.round=Hc}function Mo(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z0[r],a=t.fv,i=t.pv,l=t.cvt[s],f=i.distance(o,Kt);e&&(Math.abs(f-l)<t.cvCutIn&&(f=l),f=t.round(f)),a.setRelative(o,Kt,f,i),t.zp0===0&&(o.xo=o.x,o.yo=o.y),a.touch(o),t.rp0=t.rp1=r}function Cu(e){let t=e.prog,n=e.ip,s=e.stack,r=t[++n];for(let o=0;o<r;o++)s.push(t[++n]);e.ip=n}function Ou(e){let t=e.ip,n=e.prog,s=e.stack,r=n[++t];for(let o=0;o<r;o++){let a=n[++t]<<8|n[++t];a&32768&&(a=-((a^65535)+1)),s.push(a)}e.ip=t}function Lu(e){let t=e.stack,n=e.store;n||(n=e.store=[]);let s=t.pop(),r=t.pop();n[r]=s}function Eu(e){let t=e.stack,n=e.store,s=t.pop(),r=n&&n[s]||0;t.push(r)}function Ru(e){let t=e.stack,n=t.pop(),s=t.pop();e.cvt[s]=n/64}function Au(e){let t=e.stack,n=t.pop();t.push(e.cvt[n]*64)}function Po(e,t){let n=t.stack,s=n.pop(),r=t.z2[s];n.push(t.dpv.distance(r,Kt,e,!1)*64)}function Bo(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z1[s],a=t.z0[r],i=t.dpv.distance(a,o,e,e);t.stack.push(Math.round(i*64))}function Iu(e){e.stack.push(e.ppem)}function Fu(e){e.autoFlip=!0}function Du(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s<n?1:0)}function Uu(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s<=n?1:0)}function Mu(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s>n?1:0)}function Pu(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s>=n?1:0)}function Bu(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n===s?1:0)}function Nu(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n!==s?1:0)}function _u(e){let t=e.stack,n=t.pop();t.push(Math.trunc(n)&1?1:0)}function Gu(e){let t=e.stack,n=t.pop();t.push(Math.trunc(n)&1?0:1)}function Hu(e){let t=e.stack.pop(),n;t||ko(e,!0)}function Vu(e){}function ju(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n&&s?1:0)}function $u(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n||s?1:0)}function Wu(e){let t=e.stack,n=t.pop();t.push(n?0:1)}function Ss(e,t){let n=t.stack,s=n.pop(),r=t.fv,o=t.pv,a=t.ppem,i=t.deltaBase+(e-1)*16,l=t.deltaShift,f=t.z0;for(let u=0;u<s;u++){let m=n.pop(),d=n.pop();if(i+((d&240)>>4)!==a)continue;let b=(d&15)-8;b>=0&&b++;let T=f[m];r.setRelative(T,T,b*l,o)}}function zu(e){let n=e.stack.pop();e.deltaBase=n}function Xu(e){let n=e.stack.pop();e.deltaShift=Math.pow(.5,n)}function qu(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s+n)}function Yu(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s-n)}function Zu(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s*64/n)}function Ku(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s*n/64)}function Qu(e){let t=e.stack,n=t.pop();t.push(Math.abs(n))}function Ju(e){let t=e.stack,n=t.pop();t.push(-n)}function ef(e){let t=e.stack,n=t.pop();t.push(Math.floor(n/64)*64)}function tf(e){let t=e.stack,n=t.pop();t.push(Math.ceil(n/64)*64)}function An(e,t){let n=t.stack,s=n.pop();n.push(t.round(s/64)*64)}function nf(e){let t=e.stack,n=t.pop(),s=t.pop();e.cvt[s]=n*e.ppem/e.font.unitsPerEm}function Ts(e,t){let n=t.stack,s=n.pop(),r=t.ppem,o=t.deltaBase+(e-1)*16,a=t.deltaShift;for(let i=0;i<s;i++){let l=n.pop(),f=n.pop();if(o+((f&240)>>4)!==r)continue;let m=(f&15)-8;m>=0&&m++;let d=m*a;t.cvt[l]+=d}}function sf(e){let t=e.stack.pop();e.round=To;let n;switch(t&192){case 0:n=.5;break;case 64:n=1;break;case 128:n=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=n,t&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw new Error("invalid SROUND value")}t&=15,t===0?e.srThreshold=0:e.srThreshold=(t/8-.5)*n}function rf(e){let t=e.stack.pop();e.round=To;let n;switch(t&192){case 0:n=Math.sqrt(2)/2;break;case 64:n=Math.sqrt(2);break;case 128:n=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=n,t&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw new Error("invalid S45ROUND value")}t&=15,t===0?e.srThreshold=0:e.srThreshold=(t/8-.5)*n}function of(e){e.round=Gc}function af(e){e.round=jc}function lf(e){e.round=$c}function cf(e){let t=e.stack.pop()}function No(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],a=t.z1[r],i,l;e?(i=o.y-a.y,l=a.x-o.x):(i=a.x-o.x,l=a.y-o.y),t.dpv=Zt(i,l)}function uf(e){let t=e.stack,n=t.pop(),s=0;n&1&&(s=35),n&32&&(s|=4096),t.push(s)}function ff(e){let t=e.stack,n=t.pop(),s=t.pop(),r=t.pop();t.push(s),t.push(n),t.push(r)}function pf(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(Math.max(s,n))}function hf(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(Math.min(s,n))}function df(e){let t=e.stack.pop()}function gf(e){let t=e.stack.pop(),n=e.stack.pop();switch(t){case 1:e.inhibitGridFit=!!n;return;case 2:e.ignoreCvt=!!n;return;default:throw new Error("invalid INSTCTRL[] selector")}}function ct(e,t){let n=t.stack,s=t.prog,r=t.ip;for(let o=0;o<e;o++)n.push(s[++r]);t.ip=r}function ut(e,t){let n=t.ip,s=t.prog,r=t.stack;for(let o=0;o<e;o++){let a=s[++n]<<8|s[++n];a&32768&&(a=-((a^65535)+1)),r.push(a)}t.ip=n}function j(e,t,n,s,r,o){let a=o.stack,i=e&&a.pop(),l=a.pop(),f=o.rp0,u=o.z0[f],m=o.z1[l],d=o.minDis,S=o.fv,b=o.dpv,T,C,W,V;C=T=b.distance(m,u,!0,!0),W=C>=0?1:-1,C=Math.abs(C),e&&(V=o.cvt[i],s&&Math.abs(C-V)<o.cvCutIn&&(C=V)),n&&C<d&&(C=d),s&&(C=o.round(C)),S.setRelative(m,u,W*C,b),S.touch(m),o.rp1=o.rp0,o.rp2=l,t&&(o.rp0=l)}bo=[wo.bind(void 0,rt),wo.bind(void 0,tt),Co.bind(void 0,rt),Co.bind(void 0,tt),Oo.bind(void 0,rt),Oo.bind(void 0,tt),Lo.bind(void 0,0),Lo.bind(void 0,1),Eo.bind(void 0,0),Eo.bind(void 0,1),zc,Xc,qc,Yc,Zc,Kc,Qc,Jc,eu,tu,nu,su,ru,ou,au,iu,lu,cu,uu,fu,void 0,void 0,pu,xs,hu,du,gu,bu,vu,void 0,void 0,void 0,mu,yu,xu,void 0,Ro.bind(void 0,0),Ro.bind(void 0,1),Ao.bind(void 0,rt),Ao.bind(void 0,tt),Io.bind(void 0,0),Io.bind(void 0,1),Fo.bind(void 0,0),Fo.bind(void 0,1),Do.bind(void 0,0),Do.bind(void 0,1),Su,Tu,Uo.bind(void 0,0),Uo.bind(void 0,1),ku,wu,Mo.bind(void 0,0),Mo.bind(void 0,1),Cu,Ou,Lu,Eu,Ru,Au,Po.bind(void 0,0),Po.bind(void 0,1),void 0,Bo.bind(void 0,0),Bo.bind(void 0,1),Iu,void 0,Fu,void 0,void 0,Du,Uu,Mu,Pu,Bu,Nu,_u,Gu,Hu,Vu,ju,$u,Wu,Ss.bind(void 0,1),zu,Xu,qu,Yu,Zu,Ku,Qu,Ju,ef,tf,An.bind(void 0,0),An.bind(void 0,1),An.bind(void 0,2),An.bind(void 0,3),void 0,void 0,void 0,void 0,nf,Ss.bind(void 0,2),Ss.bind(void 0,3),Ts.bind(void 0,1),Ts.bind(void 0,2),Ts.bind(void 0,3),sf,rf,void 0,void 0,of,void 0,af,lf,xs,xs,void 0,void 0,void 0,void 0,void 0,cf,No.bind(void 0,0),No.bind(void 0,1),uf,void 0,ff,pf,hf,df,gf,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,ct.bind(void 0,1),ct.bind(void 0,2),ct.bind(void 0,3),ct.bind(void 0,4),ct.bind(void 0,5),ct.bind(void 0,6),ct.bind(void 0,7),ct.bind(void 0,8),ut.bind(void 0,1),ut.bind(void 0,2),ut.bind(void 0,3),ut.bind(void 0,4),ut.bind(void 0,5),ut.bind(void 0,6),ut.bind(void 0,7),ut.bind(void 0,8),j.bind(void 0,0,0,0,0,0),j.bind(void 0,0,0,0,0,1),j.bind(void 0,0,0,0,0,2),j.bind(void 0,0,0,0,0,3),j.bind(void 0,0,0,0,1,0),j.bind(void 0,0,0,0,1,1),j.bind(void 0,0,0,0,1,2),j.bind(void 0,0,0,0,1,3),j.bind(void 0,0,0,1,0,0),j.bind(void 0,0,0,1,0,1),j.bind(void 0,0,0,1,0,2),j.bind(void 0,0,0,1,0,3),j.bind(void 0,0,0,1,1,0),j.bind(void 0,0,0,1,1,1),j.bind(void 0,0,0,1,1,2),j.bind(void 0,0,0,1,1,3),j.bind(void 0,0,1,0,0,0),j.bind(void 0,0,1,0,0,1),j.bind(void 0,0,1,0,0,2),j.bind(void 0,0,1,0,0,3),j.bind(void 0,0,1,0,1,0),j.bind(void 0,0,1,0,1,1),j.bind(void 0,0,1,0,1,2),j.bind(void 0,0,1,0,1,3),j.bind(void 0,0,1,1,0,0),j.bind(void 0,0,1,1,0,1),j.bind(void 0,0,1,1,0,2),j.bind(void 0,0,1,1,0,3),j.bind(void 0,0,1,1,1,0),j.bind(void 0,0,1,1,1,1),j.bind(void 0,0,1,1,1,2),j.bind(void 0,0,1,1,1,3),j.bind(void 0,1,0,0,0,0),j.bind(void 0,1,0,0,0,1),j.bind(void 0,1,0,0,0,2),j.bind(void 0,1,0,0,0,3),j.bind(void 0,1,0,0,1,0),j.bind(void 0,1,0,0,1,1),j.bind(void 0,1,0,0,1,2),j.bind(void 0,1,0,0,1,3),j.bind(void 0,1,0,1,0,0),j.bind(void 0,1,0,1,0,1),j.bind(void 0,1,0,1,0,2),j.bind(void 0,1,0,1,0,3),j.bind(void 0,1,0,1,1,0),j.bind(void 0,1,0,1,1,1),j.bind(void 0,1,0,1,1,2),j.bind(void 0,1,0,1,1,3),j.bind(void 0,1,1,0,0,0),j.bind(void 0,1,1,0,0,1),j.bind(void 0,1,1,0,0,2),j.bind(void 0,1,1,0,0,3),j.bind(void 0,1,1,0,1,0),j.bind(void 0,1,1,0,1,1),j.bind(void 0,1,1,0,1,2),j.bind(void 0,1,1,0,1,3),j.bind(void 0,1,1,1,0,0),j.bind(void 0,1,1,1,0,1),j.bind(void 0,1,1,1,0,2),j.bind(void 0,1,1,1,0,3),j.bind(void 0,1,1,1,1,0),j.bind(void 0,1,1,1,1,1),j.bind(void 0,1,1,1,1,2),j.bind(void 0,1,1,1,1,3)];var mf=xo;function Pt(e){this.char=e,this.state={},this.activeState=null}function ks(e,t,n){this.contextName=n,this.startIndex=e,this.endOffset=t}function yf(e,t,n){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=t,this.checkEnd=n}function Re(e,t){this.context=e,this.index=t,this.length=e.length,this.current=e[t],this.backtrack=e.slice(0,t),this.lookahead=e.slice(t+1)}function In(e){this.eventId=e,this.subscribers=[]}function bf(e){let t=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];for(let s=0;s<t.length;s++){let r=t[s];Object.defineProperty(this.events,r,{value:new In(r)})}if(e)for(let s=0;s<t.length;s++){let r=t[s],o=e[r];typeof o=="function"&&this.events[r].subscribe(o)}let n=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];for(let s=0;s<n.length;s++){let r=n[s];this.events[r].subscribe(this.updateContextsRanges)}}function me(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],bf.call(this,e)}Pt.prototype.setState=function(e,t){return this.state[e]=t,this.activeState={key:e,value:this.state[e]},this.activeState},Pt.prototype.getState=function(e){return this.state[e]||null},me.prototype.inboundIndex=function(e){return e>=0&&e<this.tokens.length},me.prototype.composeRUD=function(e){let n=e.map(r=>this[r[0]].apply(this,r.slice(1).concat(!0))),s=r=>typeof r=="object"&&Object.prototype.hasOwnProperty.call(r,"FAIL");if(n.every(s))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:n.filter(s)};this.dispatch("composeRUD",[n.filter(r=>!s(r))])},me.prototype.replaceRange=function(e,t,n,s){t=t!==null?t:this.tokens.length;let r=n.every(o=>o instanceof Pt);if(!isNaN(e)&&this.inboundIndex(e)&&r){let o=this.tokens.splice.apply(this.tokens,[e,t].concat(n));return s||this.dispatch("replaceToken",[e,t,n]),[o,n]}else return{FAIL:"replaceRange: invalid tokens or startIndex."}},me.prototype.replaceToken=function(e,t,n){if(!isNaN(e)&&this.inboundIndex(e)&&t instanceof Pt){let s=this.tokens.splice(e,1,t);return n||this.dispatch("replaceToken",[e,t]),[s[0],t]}else return{FAIL:"replaceToken: invalid token or index."}},me.prototype.removeRange=function(e,t,n){t=isNaN(t)?this.tokens.length:t;let s=this.tokens.splice(e,t);return n||this.dispatch("removeRange",[s,e,t]),s},me.prototype.removeToken=function(e,t){if(!isNaN(e)&&this.inboundIndex(e)){let n=this.tokens.splice(e,1);return t||this.dispatch("removeToken",[n,e]),n}else return{FAIL:"removeToken: invalid token index."}},me.prototype.insertToken=function(e,t,n){return e.every(r=>r instanceof Pt)?(this.tokens.splice.apply(this.tokens,[t,0].concat(e)),n||this.dispatch("insertToken",[e,t]),e):{FAIL:"insertToken: invalid token(s)."}},me.prototype.registerModifier=function(e,t,n){this.events.newToken.subscribe(function(s,r){let o=[s,r],a=t===null||t.apply(this,o)===!0,i=[s,r];if(a){let l=n.apply(this,i);s.setState(e,l)}}),this.registeredModifiers.push(e)},In.prototype.subscribe=function(e){return typeof e=="function"?this.subscribers.push(e)-1:{FAIL:`invalid '${this.eventId}' event handler`}},In.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)},Re.prototype.setCurrentIndex=function(e){this.index=e,this.current=this.context[e],this.backtrack=this.context.slice(0,e),this.lookahead=this.context.slice(e+1)},Re.prototype.get=function(e){switch(!0){case e===0:return this.current;case(e<0&&Math.abs(e)<=this.backtrack.length):return this.backtrack.slice(e)[0];case(e>0&&e<=this.lookahead.length):return this.lookahead[e-1];default:return null}},me.prototype.rangeToText=function(e){if(e instanceof ks)return this.getRangeTokens(e).map(t=>t.char).join("")},me.prototype.getText=function(){return this.tokens.map(e=>e.char).join("")},me.prototype.getContext=function(e){let t=this.registeredContexts[e];return t||null},me.prototype.on=function(e,t){let n=this.events[e];return n?n.subscribe(t):null},me.prototype.dispatch=function(e,t){let n=this.events[e];if(n instanceof In)for(let s=0;s<n.subscribers.length;s++)n.subscribers[s].apply(this,t||[])},me.prototype.registerContextChecker=function(e,t,n){if(this.getContext(e))return{FAIL:`context name '${e}' is already registered.`};if(typeof t!="function")return{FAIL:"missing context start check."};if(typeof n!="function")return{FAIL:"missing context end check."};let s=new yf(e,t,n);return this.registeredContexts[e]=s,this.contextCheckers.push(s),s},me.prototype.getRangeTokens=function(e){let t=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,t))},me.prototype.getContextRanges=function(e){let t=this.getContext(e);return t?t.ranges:{FAIL:`context checker '${e}' is not registered.`}},me.prototype.resetContextsRanges=function(){let e=this.registeredContexts;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];n.ranges=[]}},me.prototype.updateContextsRanges=function(){this.resetContextsRanges();let e=this.tokens.map(t=>t.char);for(let t=0;t<e.length;t++){let n=new Re(e,t);this.runContextCheck(n)}this.dispatch("updateContextsRanges",[this.registeredContexts])},me.prototype.setEndOffset=function(e,t){let n=this.getContext(t).openRange.startIndex,s=new ks(n,e,t),r=this.getContext(t).ranges;return s.rangeId=`${t}.${r.length}`,r.push(s),this.getContext(t).openRange=null,s},me.prototype.runContextCheck=function(e){let t=e.index;for(let n=0;n<this.contextCheckers.length;n++){let s=this.contextCheckers[n],r=s.contextName,o=this.getContext(r).openRange;if(!o&&s.checkStart(e)&&(o=new ks(t,null,r),this.getContext(r).openRange=o,this.dispatch("contextStart",[r,t])),o&&s.checkEnd(e)){let a=t-o.startIndex+1,i=this.setEndOffset(a,r);this.dispatch("contextEnd",[r,i])}}},me.prototype.tokenize=function(e){this.tokens=[],this.resetContextsRanges();let t=Array.from(e);this.dispatch("start");for(let n=0;n<t.length;n++){let s=t[n],r=new Re(t,n);this.dispatch("next",[r]),this.runContextCheck(r);let o=new Pt(s);this.tokens.push(o),this.dispatch("newToken",[o,r])}return this.dispatch("end",[this.tokens]),this.tokens};var vf=me;function ft(e){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e)}function _o(e){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(e)}function pt(e){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e)}function Fn(e){return/[\u0E00-\u0E7F]/.test(e)}function Dn(e){return/[A-z]/.test(e)}function xf(e){return/\s/.test(e)}function Be(e){this.font=e,this.features={}}function ht(e){this.id=e.id,this.tag=e.tag,this.substitution=e.substitution}function dt(e,t){if(!e)return-1;switch(t.format){case 1:return t.glyphs.indexOf(e);case 2:{let n=t.ranges;for(let s=0;s<n.length;s++){let r=n[s];if(e>=r.start&&e<=r.end){let o=e-r.start;return r.index+o}}break}default:return-1}return-1}function Sf(e,t){return dt(e,t.coverage)===-1?null:e+t.deltaGlyphId}function Tf(e,t){let n=dt(e,t.coverage);return n===-1?null:t.substitute[n]}function ws(e,t){let n=[];for(let s=0;s<e.length;s++){let r=e[s],o=t.current;o=Array.isArray(o)?o[0]:o;let a=dt(o,r);a!==-1&&n.push(a)}return n.length!==e.length?-1:n}function kf(e,t){let n=t.inputCoverage.length+t.lookaheadCoverage.length+t.backtrackCoverage.length;if(e.context.length<n)return[];let s=ws(t.inputCoverage,e);if(s===-1)return[];let r=t.inputCoverage.length-1;if(e.lookahead.length<t.lookaheadCoverage.length)return[];let o=e.lookahead.slice(r);for(;o.length&&pt(o[0].char);)o.shift();let a=new Re(o,0),i=ws(t.lookaheadCoverage,a),l=[].concat(e.backtrack);for(l.reverse();l.length&&pt(l[0].char);)l.shift();if(l.length<t.backtrackCoverage.length)return[];let f=new Re(l,0),u=ws(t.backtrackCoverage,f),m=s.length===t.inputCoverage.length&&i.length===t.lookaheadCoverage.length&&u.length===t.backtrackCoverage.length,d=[];if(m)for(let S=0;S<t.lookupRecords.length;S++){let b=t.lookupRecords[S],T=b.lookupListIndex,C=this.getLookupByIndex(T);for(let W=0;W<C.subtables.length;W++){let V=C.subtables[W],X,Q=this.getSubstitutionType(C,V);if(Q==="71"?(Q=this.getSubstitutionType(V,V.extension),X=this.getLookupMethod(V,V.extension),V=V.extension):X=this.getLookupMethod(C,V),Q==="12"){let ie=e.get(b.sequenceIndex),ce=X(ie);ce&&d.push(ce)}else if(Q==="21"){let ie=e.get(b.sequenceIndex),ce=X(ie);ce&&d.push(ce)}else throw new Error(`Substitution type ${Q} is not supported in chaining substitution`)}}return d}function wf(e,t){let n=e.current,s=dt(n,t.coverage);if(s===-1)return null;let r,o=t.ligatureSets[s];for(let a=0;a<o.length;a++){r=o[a];for(let i=0;i<r.components.length;i++){let l=e.lookahead[i],f=r.components[i];if(l!==f)break;if(i===r.components.length-1)return r}}return null}function Cf(e,t){let n=e.current;if(dt(n,t.coverage)===-1)return null;for(let r of t.ruleSets)for(let o of r){let a=!0;for(let i=0;i<o.input.length;i++)if(e.lookahead[i]!==o.input[i]){a=!1;break}if(a){let i=[];i.push(n);for(let f=0;f<o.input.length;f++)i.push(o.input[f]);let l=(f,u)=>{let{lookupListIndex:m,sequenceIndex:d}=u,{subtables:S}=this.getLookupByIndex(m);for(let b of S)dt(f[d],b.coverage)!==-1&&(f[d]=b.deltaGlyphId)};for(let f=0;f<o.lookupRecords.length;f++){let u=o.lookupRecords[f];l(i,u)}return i}}return null}function Of(e,t){if(e.context.length<t.coverages.length)return[];for(let s=0;s<t.coverages.length;s++){let r=e.get(s);if(r=Array.isArray(r)?r[0]:r,dt(r,t.coverages[s])===-1)return[]}let n=[];for(let s=0;s<t.lookupRecords.length;s++){let r=t.lookupRecords[s],o=r.lookupListIndex,a=this.getLookupByIndex(o);for(let i=0;i<a.subtables.length;i++){let l=a.subtables[i],f,u=this.getSubstitutionType(a,l);if(u==="71"?(u=this.getSubstitutionType(l,l.extension),f=this.getLookupMethod(l,l.extension),l=l.extension):f=this.getLookupMethod(a,l),u==="12"){let m=e.get(r.sequenceIndex),d=f(m);d&&n.push(d)}else if(u==="21"){let m=e.get(r.sequenceIndex),d=f(m);d&&n.push(d)}}}return n}function Lf(e,t){let n=dt(e,t.coverage);return n===-1?null:t.sequences[n]}Be.prototype.getDefaultScriptFeaturesIndexes=function(){let e=this.font.tables.gsub.scripts;for(let t=0;t<e.length;t++){let n=e[t];if(n.tag==="DFLT")return n.script.defaultLangSys.featureIndexes}return[]},Be.prototype.getScriptFeaturesIndexes=function(e){if(!this.font.tables.gsub)return[];if(!e)return this.getDefaultScriptFeaturesIndexes();let n=this.font.tables.gsub.scripts;for(let s=0;s<n.length;s++){let r=n[s];if(r.tag===e&&r.script.defaultLangSys)return r.script.defaultLangSys.featureIndexes;{let o=r.langSysRecords;if(o)for(let a=0;a<o.length;a++){let i=o[a];if(i.tag===e)return i.langSys.featureIndexes}}}return this.getDefaultScriptFeaturesIndexes()},Be.prototype.mapTagsToFeatures=function(e,t){let n={};for(let s=0;s<e.length;s++){let r=e[s].tag,o=e[s].feature;n[r]=o}this.features[t].tags=n},Be.prototype.getScriptFeatures=function(e){let t=this.features[e];if(Object.prototype.hasOwnProperty.call(this.features,e))return t;let n=this.getScriptFeaturesIndexes(e);if(!n)return null;let s=this.font.tables.gsub;return t=n.map(r=>s.features[r]),this.features[e]=t,this.mapTagsToFeatures(t,e),t},Be.prototype.getSubstitutionType=function(e,t){let n=e.lookupType.toString(),s=t.substFormat.toString();return n+s},Be.prototype.getLookupMethod=function(e,t){let n=this.getSubstitutionType(e,t);switch(n){case"11":return s=>Sf.apply(this,[s,t]);case"12":return s=>Tf.apply(this,[s,t]);case"63":return s=>kf.apply(this,[s,t]);case"41":return s=>wf.apply(this,[s,t]);case"21":return s=>Lf.apply(this,[s,t]);case"51":return s=>Cf.apply(this,[s,t]);case"53":return s=>Of.apply(this,[s,t]);default:throw new Error(`substitutionType : ${n} lookupType: ${e.lookupType} - substFormat: ${t.substFormat} is not yet supported`)}},Be.prototype.lookupFeature=function(e){let t=e.contextParams,n=t.index,s=this.getFeature({tag:e.tag,script:e.script});if(!s)return new Error(`font '${(this.font.names.unicode||this.font.names.windows||this.font.names.macintosh).fullName.en}' doesn't support feature '${e.tag}' for script '${e.script}'.`);let r=this.getFeatureLookups(s),o=[].concat(t.context);for(let a=0;a<r.length;a++){let i=r[a],l=this.getLookupSubtables(i);for(let f=0;f<l.length;f++){let u=l[f],m=this.getSubstitutionType(i,u),d;m==="71"?(m=this.getSubstitutionType(u,u.extension),d=this.getLookupMethod(u,u.extension),u=u.extension):d=this.getLookupMethod(i,u);let S;switch(m){case"11":S=d(t.current),S&&o.splice(n,1,new ht({id:11,tag:e.tag,substitution:S}));break;case"12":S=d(t.current),S&&o.splice(n,1,new ht({id:12,tag:e.tag,substitution:S}));break;case"63":S=d(t),Array.isArray(S)&&S.length&&o.splice(n,1,new ht({id:63,tag:e.tag,substitution:S}));break;case"41":S=d(t),S&&o.splice(n,1,new ht({id:41,tag:e.tag,substitution:S}));break;case"21":S=d(t.current),S&&o.splice(n,1,new ht({id:21,tag:e.tag,substitution:S}));break;case"51":case"53":S=d(t),Array.isArray(S)&&S.length&&o.splice(n,1,new ht({id:parseInt(m),tag:e.tag,substitution:S}));break}t=new Re(o,n),!(Array.isArray(S)&&!S.length)&&(S=null)}}return o.length?o:null},Be.prototype.supports=function(e){if(!e.script)return!1;this.getScriptFeatures(e.script);let t=Object.prototype.hasOwnProperty.call(this.features,e.script);if(!e.tag)return t;let n=this.features[e.script].some(s=>s.tag===e.tag);return t&&n},Be.prototype.getLookupSubtables=function(e){return e.subtables||null},Be.prototype.getLookupByIndex=function(e){return this.font.tables.gsub.lookups[e]||null},Be.prototype.getFeatureLookups=function(e){return e.lookupListIndexes.map(this.getLookupByIndex.bind(this))},Be.prototype.getFeature=function(t){if(!this.font)return{FAIL:"No font was found"};Object.prototype.hasOwnProperty.call(this.features,t.script)||this.getScriptFeatures(t.script);let n=this.features[t.script];return n?n.tags[t.tag]?this.features[t.script].tags[t.tag]:null:{FAIL:`No feature for script ${t.script}`}};var Ef=Be;function Rf(e){let t=e.current,n=e.get(-1);return n===null&&ft(t)||!ft(n)&&ft(t)}function Af(e){let t=e.get(1);return t===null||!ft(t)}var If={startCheck:Rf,endCheck:Af};function Ff(e){let t=e.current,n=e.get(-1);return(ft(t)||pt(t))&&!ft(n)}function Df(e){let t=e.get(1);switch(!0){case t===null:return!0;case(!ft(t)&&!pt(t)):{let n=xf(t);if(!n)return!0;if(n){let s=!1;if(s=e.lookahead.some(r=>ft(r)||pt(r)),!s)return!0}break}default:return!1}}var Uf={startCheck:Ff,endCheck:Df};function Mf(e,t,n){t[n].setState(e.tag,e.substitution)}function Pf(e,t,n){t[n].setState(e.tag,e.substitution)}function Cs(e,t,n){for(let s=0;s<e.substitution.length;s++){let r=e.substitution[s],o=t[n+s];if(Array.isArray(r)){r.length?o.setState(e.tag,r[0]):o.setState("deleted",!0);continue}o.setState(e.tag,r)}}function Bf(e,t,n){let s=t[n];s.setState(e.tag,e.substitution.ligGlyph);let r=e.substitution.components.length;for(let o=0;o<r;o++)s=t[n+o+1],s.setState("deleted",!0)}var Go={11:Mf,12:Pf,63:Cs,41:Bf,51:Cs,53:Cs};function Nf(e,t,n){e instanceof ht&&Go[e.id]&&Go[e.id](e,t,n)}var wt=Nf;function _f(e){let t=[].concat(e.backtrack);for(let n=t.length-1;n>=0;n--){let s=t[n],r=_o(s),o=pt(s);if(!r&&!o)return!0;if(r)return!1}return!1}function Gf(e){if(_o(e.current))return!1;for(let t=0;t<e.lookahead.length;t++){let n=e.lookahead[t];if(!pt(n))return!0}return!1}function Hf(e){let t="arab",n=this.featuresTags[t],s=this.tokenizer.getRangeTokens(e);if(s.length===1)return;let r=new Re(s.map(a=>a.getState("glyphIndex")),0),o=new Re(s.map(a=>a.char),0);for(let a=0;a<s.length;a++){let i=s[a];if(pt(i.char))continue;r.setCurrentIndex(a),o.setCurrentIndex(a);let l=0;_f(o)&&(l|=1),Gf(o)&&(l|=2);let f;switch(l){case 1:f="fina";break;case 2:f="init";break;case 3:f="medi";break}if(n.indexOf(f)===-1)continue;let u=this.query.lookupFeature({tag:f,script:t,contextParams:r});if(u instanceof Error){console.info(u.message);continue}for(let m=0;m<u.length;m++){let d=u[m];d instanceof ht&&(wt(d,s,m),r.context[m]=d.substitution)}}}var Vf=Hf;function Ho(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function jf(e){let t="arab",n=this.tokenizer.getRangeTokens(e),s=Ho(n);for(let r=0;r<s.context.length;r++){s.setCurrentIndex(r);let o=this.query.lookupFeature({tag:"rlig",script:t,contextParams:s});if(o.length){for(let a=0;a<o.length;a++){let i=o[a];wt(i,n,r)}s=Ho(n)}}}var $f=jf;function Wf(e){return e.index===0&&e.context.length>1}function zf(e){return e.index===e.context.length-1}var Xf={startCheck:Wf,endCheck:zf};function Vo(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function qf(e){let t="delf",n="ccmp",s=this.tokenizer.getRangeTokens(e),r=Vo(s);for(let o=0;o<r.context.length;o++){if(!this.query.getFeature({tag:n,script:t,contextParams:r}))continue;r.setCurrentIndex(o);let a=this.query.lookupFeature({tag:n,script:t,contextParams:r});if(a.length){for(let i=0;i<a.length;i++){let l=a[i];wt(l,s,o)}r=Vo(s)}}}var Yf=qf;function Zf(e){let t=e.current,n=e.get(-1);return n===null&&Dn(t)||!Dn(n)&&Dn(t)}function Kf(e){let t=e.get(1);return t===null||!Dn(t)}var Qf={startCheck:Zf,endCheck:Kf};function jo(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function Jf(e){let t="latn",n=this.tokenizer.getRangeTokens(e),s=jo(n);for(let r=0;r<s.context.length;r++){s.setCurrentIndex(r);let o=this.query.lookupFeature({tag:"liga",script:t,contextParams:s});if(o.length){for(let a=0;a<o.length;a++){let i=o[a];wt(i,n,r)}s=jo(n)}}}var ep=Jf;function tp(e){let t=e.current,n=e.get(-1);return n===null&&Fn(t)||!Fn(n)&&Fn(t)}function np(e){let t=e.get(1);return t===null||!Fn(t)}var sp={startCheck:tp,endCheck:np};function $o(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function rp(e){let t="thai",n=this.tokenizer.getRangeTokens(e),s=$o(n,0);for(let r=0;r<s.context.length;r++){s.setCurrentIndex(r);let o=this.query.lookupFeature({tag:"ccmp",script:t,contextParams:s});if(o.length){for(let a=0;a<o.length;a++){let i=o[a];wt(i,n,r)}s=$o(n,r)}}}var op=rp;function Wo(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function ap(e){let t="thai",n=this.tokenizer.getRangeTokens(e),s=Wo(n,0);for(let r=0;r<s.context.length;r++){s.setCurrentIndex(r);let o=this.query.lookupFeature({tag:"liga",script:t,contextParams:s});if(o.length){for(let a=0;a<o.length;a++){let i=o[a];wt(i,n,r)}s=Wo(n,r)}}}var ip=ap;function zo(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function lp(e){let t="thai",n=this.tokenizer.getRangeTokens(e),s=zo(n,0);for(let r=0;r<s.context.length;r++){s.setCurrentIndex(r);let o=this.query.lookupFeature({tag:"rlig",script:t,contextParams:s});if(o.length){for(let a=0;a<o.length;a++){let i=o[a];wt(i,n,r)}s=zo(n,r)}}}var cp=lp;function Os(e){if(e===null)return!1;let t=e.codePointAt(0);return t>=6155&&t<=6157||t>=65024&&t<=65039||t>=917760&&t<=917999}function up(e){let t=e.current,n=e.get(1);return n===null&&Os(t)||Os(n)}function fp(e){let t=e.get(1);return t===null||!Os(t)}var pp={startCheck:up,endCheck:fp};function hp(e){let t=this.query.font,n=this.tokenizer.getRangeTokens(e);if(n[1].setState("deleted",!0),t.tables.cmap&&t.tables.cmap.varSelectorList){let s=n[0].char.codePointAt(0),r=n[1].char.codePointAt(0),o=t.tables.cmap.varSelectorList[r];if(o!==void 0&&o.nonDefaultUVS){let a=o.nonDefaultUVS.uvsMappings;if(a[s]){let i=a[s].glyphID;t.glyphs.glyphs[i]!==void 0&&n[0].setState("glyphIndex",i)}}}}var dp=hp;function He(e){this.baseDir=e||"ltr",this.tokenizer=new vf,this.featuresTags={}}He.prototype.setText=function(e){this.text=e},He.prototype.contextChecks={ccmpReplacementCheck:Xf,latinWordCheck:Qf,arabicWordCheck:If,arabicSentenceCheck:Uf,thaiWordCheck:sp,unicodeVariationSequenceCheck:pp};function Bt(e){let t=this.contextChecks[`${e}Check`];return this.tokenizer.registerContextChecker(e,t.startCheck,t.endCheck)}function gp(){return Bt.call(this,"ccmpReplacement"),Bt.call(this,"latinWord"),Bt.call(this,"arabicWord"),Bt.call(this,"arabicSentence"),Bt.call(this,"thaiWord"),Bt.call(this,"unicodeVariationSequence"),this.tokenizer.tokenize(this.text)}function mp(){let e=this.tokenizer.getContextRanges("arabicSentence");for(let t=0;t<e.length;t++){let n=e[t],s=this.tokenizer.getRangeTokens(n);this.tokenizer.replaceRange(n.startIndex,n.endOffset,s.reverse())}}He.prototype.registerFeatures=function(e,t){let n=t.filter(s=>this.query.supports({script:e,tag:s}));Object.prototype.hasOwnProperty.call(this.featuresTags,e)?this.featuresTags[e]=this.featuresTags[e].concat(n):this.featuresTags[e]=n},He.prototype.applyFeatures=function(e,t){if(!e)throw new Error("No valid font was provided to apply features");this.query||(this.query=new Ef(e));for(let n=0;n<t.length;n++){let s=t[n];this.query.supports({script:s.script})&&this.registerFeatures(s.script,s.tags)}},He.prototype.registerModifier=function(e,t,n){this.tokenizer.registerModifier(e,t,n)};function Qt(){if(this.tokenizer.registeredModifiers.indexOf("glyphIndex")===-1)throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function yp(){if(!Object.prototype.hasOwnProperty.call(this.featuresTags,"arab"))return;Qt.call(this);let t=this.tokenizer.getContextRanges("arabicWord");for(let n=0;n<t.length;n++){let s=t[n];Vf.call(this,s)}}function bp(){Qt.call(this);let e=this.tokenizer.getContextRanges("ccmpReplacement");for(let t=0;t<e.length;t++){let n=e[t];Yf.call(this,n)}}function vp(){if(!this.hasFeatureEnabled("arab","rlig"))return;Qt.call(this);let e=this.tokenizer.getContextRanges("arabicWord");for(let t=0;t<e.length;t++){let n=e[t];$f.call(this,n)}}function xp(){if(!this.hasFeatureEnabled("latn","liga"))return;Qt.call(this);let e=this.tokenizer.getContextRanges("latinWord");for(let t=0;t<e.length;t++){let n=e[t];ep.call(this,n)}}function Sp(){let e=this.tokenizer.getContextRanges("unicodeVariationSequence");for(let t=0;t<e.length;t++){let n=e[t];dp.call(this,n)}}function Tp(){Qt.call(this);let e=this.tokenizer.getContextRanges("thaiWord");for(let t=0;t<e.length;t++){let n=e[t];this.hasFeatureEnabled("thai","liga")&&ip.call(this,n),this.hasFeatureEnabled("thai","rlig")&&cp.call(this,n),this.hasFeatureEnabled("thai","ccmp")&&op.call(this,n)}}He.prototype.checkContextReady=function(e){return!!this.tokenizer.getContext(e)},He.prototype.applyFeaturesToContexts=function(){this.checkContextReady("ccmpReplacement")&&bp.call(this),this.checkContextReady("arabicWord")&&(yp.call(this),vp.call(this)),this.checkContextReady("latinWord")&&xp.call(this),this.checkContextReady("arabicSentence")&&mp.call(this),this.checkContextReady("thaiWord")&&Tp.call(this),this.checkContextReady("unicodeVariationSequence")&&Sp.call(this)},He.prototype.hasFeatureEnabled=function(e,t){return(this.featuresTags[e]||[]).indexOf(t)!==-1},He.prototype.processText=function(e){(!this.text||this.text!==e)&&(this.setText(e),gp.call(this),this.applyFeaturesToContexts())},He.prototype.getBidiText=function(e){return this.processText(e),this.tokenizer.getText()},He.prototype.getTextGlyphs=function(e){this.processText(e);let t=[];for(let n=0;n<this.tokenizer.tokens.length;n++){let s=this.tokenizer.tokens[n];if(s.state.deleted)continue;let r=s.activeState.value;t.push(Array.isArray(r)?r[0]:r)}return t};var kp=He;function Ls(e){return{fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||(e.familyName+e.styleName).replace(/\s/g,"")},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}}}function le(e){if(e=e||{},e.tables=e.tables||{},!e.empty){if(!e.familyName)throw new Error("When creating a new Font object, familyName is required.");if(!e.styleName)throw new Error("When creating a new Font object, styleName is required.");if(!e.unitsPerEm)throw new Error("When creating a new Font object, unitsPerEm is required.");if(!e.ascender)throw new Error("When creating a new Font object, ascender is required.");if(e.descender>0)throw new Error("When creating a new Font object, negative descender value is required.");this.names={},this.names.unicode=Ls(e),this.names.macintosh=Ls(e),this.names.windows=Ls(e),this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.italicAngle=e.italicAngle||0,this.weightClass=e.weightClass||0;let t=0;e.fsSelection?t=e.fsSelection:(this.italicAngle<0?t|=this.fsSelectionValues.ITALIC:this.italicAngle>0&&(t|=this.fsSelectionValues.OBLIQUE),this.weightClass>=600&&(t|=this.fsSelectionValues.BOLD),t===0&&(t=this.fsSelectionValues.REGULAR)),(!e.panose||!Array.isArray(e.panose))&&(e.panose=[0,0,0,0,0,0,0,0,0]),this.tables=Object.assign(e.tables,{os2:Object.assign({usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,bFamilyType:e.panose[0]||0,bSerifStyle:e.panose[1]||0,bWeight:e.panose[2]||0,bProportion:e.panose[3]||0,bContrast:e.panose[4]||0,bStrokeVariation:e.panose[5]||0,bArmStyle:e.panose[6]||0,bLetterform:e.panose[7]||0,bMidline:e.panose[8]||0,bXHeight:e.panose[9]||0,fsSelection:t},e.tables.os2)})}this.supported=!0,this.glyphs=new Je.GlyphSet(this,e.glyphs||[]),this.encoding=new Tr(this),this.position=new yc(this),this.substitution=new wc(this),this.tables=this.tables||{},this.tables=new Proxy(this.tables,{set:(t,n,s)=>(t[n]=s,t.fvar&&(t.gvar||t.cff2)&&!this.variation&&(this.variation=new _c(this)),!0)}),this.palettes=new fo(this),this.layers=new Cc(this),this.svgImages=new Oc(this),this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:this.outlinesFormat==="truetype"?this._hinting=new mf(this):null}})}le.prototype.hasChar=function(e){return this.encoding.charToGlyphIndex(e)>0},le.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},le.prototype.charToGlyph=function(e){let t=this.charToGlyphIndex(e),n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},le.prototype.updateFeatures=function(e){return this.defaultRenderOptions.features.map(t=>t.script==="latn"?{script:"latn",tags:t.tags.filter(n=>e[n])}:t)},le.prototype.stringToGlyphIndexes=function(e,t){let n=new kp,s=o=>this.charToGlyphIndex(o.char);n.registerModifier("glyphIndex",null,s);let r=t?this.updateFeatures(t.features):this.defaultRenderOptions.features;return n.applyFeatures(this,r),n.getTextGlyphs(e)},le.prototype.stringToGlyphs=function(e,t){let n=this.stringToGlyphIndexes(e,t),s=n.length,r=new Array(s),o=this.glyphs.get(0);for(let a=0;a<s;a+=1)r[a]=this.glyphs.get(n[a])||o;return r},le.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},le.prototype.nameToGlyph=function(e){let t=this.nameToGlyphIndex(e),n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},le.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},le.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;let n=this.position.defaultKerningTables;return n?this.position.getKerningValue(n,e,t):this.kerningPairs[e+","+t]||0},le.prototype.defaultRenderOptions={kerning:!0,features:[{script:"arab",tags:["init","medi","fina","rlig"]},{script:"latn",tags:["liga","rlig"]},{script:"thai",tags:["liga","rlig","ccmp"]}],hinting:!1,usePalette:0,drawLayers:!0,drawSVG:!0},le.prototype.forEachGlyph=function(e,t,n,s,r,o){t=t!==void 0?t:0,n=n!==void 0?n:0,s=s!==void 0?s:72,r=Object.assign({},this.defaultRenderOptions,r);let a=1/this.unitsPerEm*s,i=this.stringToGlyphs(e,r),l;if(r.kerning){let f=r.script||this.position.getDefaultScriptName();l=this.position.getKerningTables(f,r.language)}for(let f=0;f<i.length;f+=1){let u=i[f];if(o.call(this,u,t,n,s,r),u.advanceWidth&&(t+=u.advanceWidth*a),r.kerning&&f<i.length-1){let m=l?this.position.getKerningValue(l,u.index,i[f+1].index):this.getKerningValue(u,i[f+1]);t+=m*a}r.letterSpacing?t+=r.letterSpacing*s:r.tracking&&(t+=r.tracking/1e3*s)}return t},le.prototype.getPath=function(e,t,n,s,r){r=Object.assign({},this.defaultRenderOptions,r);let o=new vt;if(o._layers=[],Ur(this,o,s),o.stroke){let a=1/(o.unitsPerEm||1e3)*s;o.strokeWidth*=a}return this.forEachGlyph(e,t,n,s,r,(a,i,l,f)=>{let u=a.getPath(i,l,f,r,this);if(r.drawSVG||r.drawLayers){let m=u._layers;if(m&&m.length){for(let d=0;d<m.length;d++){let S=m[d];o._layers.push(S)}return}}o.extend(u)}),o},le.prototype.getPaths=function(e,t,n,s,r){r=Object.assign({},this.defaultRenderOptions,r);let o=[];return this.forEachGlyph(e,t,n,s,r,function(a,i,l,f){let u=a.getPath(i,l,f,r,this);o.push(u)}),o},le.prototype.getAdvanceWidth=function(e,t,n){return n=Object.assign({},this.defaultRenderOptions,n),this.forEachGlyph(e,0,0,t,n,function(){})},le.prototype.draw=function(e,t,n,s,r,o){this.getPath(t,n,s,r,o).draw(e)},le.prototype.drawPoints=function(e,t,n,s,r,o){o=Object.assign({},this.defaultRenderOptions,o),this.forEachGlyph(t,n,s,r,o,function(a,i,l,f){a.drawPoints(e,i,l,f,o,this)})},le.prototype.drawMetrics=function(e,t,n,s,r,o){o=Object.assign({},this.defaultRenderOptions,o),this.forEachGlyph(t,n,s,r,o,function(a,i,l,f){a.drawMetrics(e,i,l,f)})},le.prototype.getEnglishName=function(e){let t=(this.names.unicode||this.names.macintosh||this.names.windows)[e];if(t)return t.en},le.prototype.validate=function(){let e=[],t=this;function n(r,o){r||(console.warn(`[opentype.js] ${o}`),e.push(o))}function s(r){let o=t.getEnglishName(r);n(o&&o.trim().length>0,"No English "+r+" specified.")}if(s("fontFamily"),s("weightName"),s("manufacturer"),s("copyright"),s("version"),n(this.unitsPerEm>0,"No unitsPerEm specified."),this.tables.colr){let r=this.tables.colr.baseGlyphRecords,o=-1;for(let a=0;a<r.length;a++){let i=r[a].glyphID;if(n(o<r[a].glyphID,`baseGlyphs must be sorted by GlyphID in ascending order, but glyphID ${i} comes after ${o}`),o>r[a].glyphID)break;o=i}}return e},le.prototype.toTables=function(){return mc.fontToTable(this)},le.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},le.prototype.toArrayBuffer=function(){let t=this.toTables().encode(),n=new ArrayBuffer(t.length),s=new Uint8Array(n);for(let r=0;r<t.length;r++)s[r]=t[r];return n},le.prototype.download=function(){console.error("DEPRECATED: platform-specific actions are to be implemented on user-side")},le.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},le.prototype.macStyleValues={BOLD:1,ITALIC:2,UNDERLINE:4,OUTLINED:8,SHADOW:16,CONDENSED:32,EXTENDED:64},le.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},le.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var Xo=le;function wp(e,t){let n=new B.Parser(e,t),s=n.parseUShort(),r=n.parseUShort();s!==1&&console.warn(`Unsupported hvar table version ${s}.${r}`);let o=[s,r],a=n.parsePointer32(function(){return this.parseItemVariationStore()}),i=n.parsePointer32(function(){return this.parseDeltaSetIndexMap()}),l=n.parsePointer32(function(){return this.parseDeltaSetIndexMap()}),f=n.parsePointer32(function(){return this.parseDeltaSetIndexMap()});return{version:o,itemVariationStore:a,advanceWidth:i,lsb:l,rsb:f}}function Cp(){console.warn("Writing of hvar tables is not yet supported.")}var Op={make:Cp,parse:wp},Lp=function(){return{coverage:this.parsePointer(k.coverage),attachPoints:this.parseList(k.pointer(k.uShortList))}},Ep=function(){var e=this.parseUShort();if($.argument(e===1||e===2||e===3,"Unsupported CaretValue table version."),e===1)return{coordinate:this.parseShort()};if(e===2)return{pointindex:this.parseShort()};if(e===3)return{coordinate:this.parseShort()}},Rp=function(){return this.parseList(k.pointer(Ep))},Ap=function(){return{coverage:this.parsePointer(k.coverage),ligGlyphs:this.parseList(k.pointer(Rp))}},Ip=function(){return this.parseUShort(),this.parseList(k.pointer(k.coverage))};function Fp(e,t){t=t||0;let n=new k(e,t),s=n.parseVersion(1);$.argument(s===1||s===1.2||s===1.3,"Unsupported GDEF table version.");var r={version:s,classDef:n.parsePointer(k.classDef),attachList:n.parsePointer(Lp),ligCaretList:n.parsePointer(Ap),markAttachClassDef:n.parsePointer(k.classDef)};return s>=1.2&&(r.markGlyphSets=n.parsePointer(Ip)),r}var Dp={parse:Fp},qe=new Array(10);qe[1]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();if(n===1)return{posFormat:1,coverage:this.parsePointer(k.coverage),value:this.parseValueRecord()};if(n===2)return{posFormat:2,coverage:this.parsePointer(k.coverage),values:this.parseValueRecordList()};$.assert(!1,"0x"+t.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},qe[2]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();$.assert(n===1||n===2,"0x"+t.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");let s=this.parsePointer(k.coverage),r=this.parseUShort(),o=this.parseUShort();if(n===1)return{posFormat:n,coverage:s,valueFormat1:r,valueFormat2:o,pairSets:this.parseList(k.pointer(k.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(r),value2:this.parseValueRecord(o)}})))};if(n===2){let a=this.parsePointer(k.classDef),i=this.parsePointer(k.classDef),l=this.parseUShort(),f=this.parseUShort();return{posFormat:n,coverage:s,valueFormat1:r,valueFormat2:o,classDef1:a,classDef2:i,class1Count:l,class2Count:f,classRecords:this.parseList(l,k.list(f,function(){return{value1:this.parseValueRecord(r),value2:this.parseValueRecord(o)}}))}}},qe[3]=function(){return{error:"GPOS Lookup 3 not supported"}},qe[4]=function(){return{error:"GPOS Lookup 4 not supported"}},qe[5]=function(){return{error:"GPOS Lookup 5 not supported"}},qe[6]=function(){return{error:"GPOS Lookup 6 not supported"}},qe[7]=function(){return{error:"GPOS Lookup 7 not supported"}},qe[8]=function(){return{error:"GPOS Lookup 8 not supported"}},qe[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function Up(e,t){t=t||0;let n=new k(e,t),s=n.parseVersion(1);return $.argument(s===1||s===1.1,"Unsupported GPOS table version "+s),s===1?{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(qe)}:{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(qe),variations:n.parseFeatureVariationsList()}}var Mp=new Array(10);function Pp(e){return new I.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new I.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new I.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new I.LookupList(e.lookups,Mp)}])}var Bp={parse:Up,make:Pp};function Np(e){let t={};e.skip("uShort");let n=e.parseUShort();$.argument(n===0,"Unsupported kern sub-table version."),e.skip("uShort",2);let s=e.parseUShort();e.skip("uShort",3);for(let r=0;r<s;r+=1){let o=e.parseUShort(),a=e.parseUShort(),i=e.parseShort();t[o+","+a]=i}return t}function _p(e){let t={};e.skip("uShort"),e.parseULong()>1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");let r=e.parseUShort()&255;if(e.skip("uShort"),r===0){let o=e.parseUShort();e.skip("uShort",3);for(let a=0;a<o;a+=1){let i=e.parseUShort(),l=e.parseUShort(),f=e.parseShort();t[i+","+l]=f}}return t}function Gp(e,t){let n=new B.Parser(e,t),s=n.parseUShort();if(s===0)return Np(n);if(s===1)return _p(n);throw new Error("Unsupported kern table version ("+s+").")}var Hp={parse:Gp};function Vp(e,t,n,s){let r=new B.Parser(e,t),o=s?r.parseUShort:r.parseULong,a=[];for(let i=0;i<n+1;i+=1){let l=o.call(r);s&&(l*=2),a.push(l)}return a}var jp={parse:Vp};function qo(e,t){let n=[],s=12;for(let r=0;r<t;r+=1){let o=B.getTag(e,s),a=B.getULong(e,s+4),i=B.getULong(e,s+8),l=B.getULong(e,s+12);n.push({tag:o,checksum:a,offset:i,length:l,compression:!1}),s+=16}return n}function $p(e,t){let n=[],s=44;for(let r=0;r<t;r+=1){let o=B.getTag(e,s),a=B.getULong(e,s+4),i=B.getULong(e,s+8),l=B.getULong(e,s+12),f;i<l?f="WOFF":f=!1,n.push({tag:o,offset:a,compression:f,compressedLength:i,length:l}),s+=20}return n}function ae(e,t){if(t.compression==="WOFF"){let n=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),s=new Uint8Array(t.length);if(Ee(n,s),s.byteLength!==t.length)throw new Error("Decompression error: "+t.tag+" decompressed length doesn't match recorded length");return{data:new DataView(s.buffer,0),offset:0}}else return{data:e,offset:t.offset}}function Wp(e,t={}){let n,s,r=new Xo({empty:!0});e.constructor!==ArrayBuffer&&(e=new Uint8Array(e).buffer);let o=new DataView(e,0),a,i=[],l=B.getTag(o,0);if(l==="\0\0\0"||l==="true"||l==="typ1")r.outlinesFormat="truetype",a=B.getUShort(o,4),i=qo(o,a);else if(l==="OTTO")r.outlinesFormat="cff",a=B.getUShort(o,4),i=qo(o,a);else if(l==="wOFF"){let z=B.getTag(o,4);if(z==="\0\0\0")r.outlinesFormat="truetype";else if(z==="OTTO")r.outlinesFormat="cff";else throw new Error("Unsupported OpenType flavor "+l);a=B.getUShort(o,12),i=$p(o,a)}else if(l==="wOF2"){let z="https://github.com/opentypejs/opentype.js/issues/183#issuecomment-1147228025";throw new Error("WOFF2 require an external decompressor library, see examples at: "+z)}else throw new Error("Unsupported OpenType signature "+l);let f,u,m,d,S,b,T,C,W,V,X,Q,ie,ce,ue,ve,Ye,J;for(let z=0;z<a;z+=1){let G=i[z],H;switch(G.tag){case"avar":T=G;break;case"cmap":H=ae(o,G),r.tables.cmap=Sr.parse(H.data,H.offset),r.encoding=new kr(r.tables.cmap);break;case"cvt ":H=ae(o,G),J=new B.Parser(H.data,H.offset),r.tables.cvt=J.parseShortList(G.length/2);break;case"fvar":m=G;break;case"STAT":d=G;break;case"gvar":S=G;break;case"cvar":b=G;break;case"fpgm":H=ae(o,G),J=new B.Parser(H.data,H.offset),r.tables.fpgm=J.parseByteList(G.length);break;case"head":H=ae(o,G),r.tables.head=Gr.parse(H.data,H.offset),r.unitsPerEm=r.tables.head.unitsPerEm,n=r.tables.head.indexToLocFormat;break;case"hhea":H=ae(o,G),r.tables.hhea=Hr.parse(H.data,H.offset),r.ascender=r.tables.hhea.ascender,r.descender=r.tables.hhea.descender,r.numberOfHMetrics=r.tables.hhea.numberOfHMetrics;break;case"HVAR":ie=G;break;case"hmtx":Q=G;break;case"ltag":H=ae(o,G),s=jr.parse(H.data,H.offset);break;case"COLR":H=ae(o,G),r.tables.colr=qr.parse(H.data,H.offset);break;case"CPAL":H=ae(o,G),r.tables.cpal=Lr.parse(H.data,H.offset);break;case"maxp":H=ae(o,G),r.tables.maxp=$r.parse(H.data,H.offset),r.numGlyphs=r.tables.maxp.numGlyphs;break;case"name":ve=G;break;case"OS/2":H=ae(o,G),r.tables.os2=hs.parse(H.data,H.offset);break;case"post":H=ae(o,G),r.tables.post=Wr.parse(H.data,H.offset),r.glyphNames=new rs(r.tables.post);break;case"prep":H=ae(o,G),J=new B.Parser(H.data,H.offset),r.tables.prep=J.parseByteList(G.length);break;case"glyf":C=G;break;case"loca":ue=G;break;case"CFF ":f=G;break;case"CFF2":u=G;break;case"kern":ce=G;break;case"GDEF":W=G;break;case"GPOS":V=G;break;case"GSUB":X=G;break;case"meta":Ye=G;break;case"gasp":try{H=ae(o,G),r.tables.gasp=eo.parse(H.data,H.offset)}catch(Oe){console.warn("Failed to parse gasp table, skipping."),console.warn(Oe)}break;case"SVG ":H=ae(o,G),r.tables.svg=to.parse(H.data,H.offset);break;default:break}}let Ne=ae(o,ve);if(r.tables.name=xr.parse(Ne.data,Ne.offset,s),r.names=r.tables.name,C&&ue){let z=n===0,G=ae(o,ue),H=jp.parse(G.data,G.offset,r.numGlyphs,z),Oe=ae(o,C);r.glyphs=mo.parse(Oe.data,Oe.offset,H,r,t)}else if(f){let z=ae(o,f);fs.parse(z.data,z.offset,r,t)}else if(u){let z=ae(o,u);fs.parse(z.data,z.offset,r,t)}else throw new Error("Font doesn't contain TrueType, CFF or CFF2 outlines.");let Ae=ae(o,Q);if(Vr.parse(r,Ae.data,Ae.offset,r.numberOfHMetrics,r.numGlyphs,r.glyphs,t),Vi(r,t),ce){let z=ae(o,ce);r.kerningPairs=Hp.parse(z.data,z.offset)}else r.kerningPairs={};if(W){let z=ae(o,W);r.tables.gdef=Dp.parse(z.data,z.offset)}if(V){let z=ae(o,V);r.tables.gpos=Bp.parse(z.data,z.offset),r.position.init()}if(X){let z=ae(o,X);r.tables.gsub=zr.parse(z.data,z.offset)}if(m){let z=ae(o,m);r.tables.fvar=Yr.parse(z.data,z.offset,r.names)}if(d){let z=ae(o,d);r.tables.stat=Zr.parse(z.data,z.offset,r.tables.fvar)}if(S){m||console.warn("This font provides a gvar table, but no fvar table, which is required for variable fonts."),C||console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");let z=ae(o,S);r.tables.gvar=Jr.parse(z.data,z.offset,r.tables.fvar,r.glyphs)}if(b){m||console.warn("This font provides a cvar table, but no fvar table, which is required for variable fonts."),r.tables.cvt||console.warn("This font provides a cvar table, but no cvt table which could be made variable."),C||console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");let z=ae(o,b);r.tables.cvar=Qr.parse(z.data,z.offset,r.tables.fvar,r.tables.cvt||[])}if(T){m||console.warn("This font provides an avar table, but no fvar table, which is required for variable fonts.");let z=ae(o,T);r.tables.avar=Kr.parse(z.data,z.offset,r.tables.fvar)}if(ie){m||console.warn("This font provides an HVAR table, but no fvar table, which is required for variable fonts."),Q||console.warn("This font provides an HVAR table, but no hmtx table to vary.");let z=ae(o,ie);r.tables.hvar=Op.parse(z.data,z.offset,r.tables.fvar)}if(Ye){let z=ae(o,Ye);r.tables.meta=Xr.parse(z.data,z.offset),r.metas=r.tables.meta}return r.palettes=new fo(r),r}function zp(){console.error("DEPRECATED! migrate to: opentype.parse(buffer, opt) See: https://github.com/opentypejs/opentype.js/issues/675")}function Xp(){console.error('DEPRECATED! migrate to: opentype.parse(require("fs").readFileSync(url), opt)')}return y(w)})();(function(c,p){typeof define=="function"&&define.amd?define(p):typeof Wn=="object"&&Wn.exports?Wn.exports=p():c.opentype=p()})(typeof self<"u"?self:Ua,()=>({...Da,default:Da}))});function mt(c){return Math.min(c.w,c.h)/100}function tn(c,p=.04){let h=c.w*p,v=c.h*p,x=c.w*(1-p),g=c.h*(1-p),y=c.chrome;return y&&(y.left&&(h=Math.max(h,c.w*y.left)),y.right&&(x=Math.min(x,c.w*(1-y.right))),y.top&&(v=Math.max(v,c.h*y.top)),y.bottom&&(g=Math.min(g,c.h*(1-y.bottom)))),{x0:h,y0:v,x1:x,y1:g,w:x-h,h:g-v}}var wa={"top-left":{rx:0,ry:0,bx:0,by:0,sx:1,sy:1},top:{rx:.5,ry:0,bx:.5,by:0,sx:0,sy:1},"top-right":{rx:1,ry:0,bx:1,by:0,sx:-1,sy:1},left:{rx:0,ry:.5,bx:0,by:.5,sx:1,sy:0},center:{rx:.5,ry:.5,bx:.5,by:.5,sx:0,sy:0},right:{rx:1,ry:.5,bx:1,by:.5,sx:-1,sy:0},"bottom-left":{rx:0,ry:1,bx:0,by:1,sx:1,sy:-1},bottom:{rx:.5,ry:1,bx:.5,by:1,sx:0,sy:-1},"bottom-right":{rx:1,ry:1,bx:1,by:1,sx:-1,sy:-1}};function Kp(c,p,h,v,x,g){let y=wa[h]||wa["bottom-left"],w=mt(c),O=p.x0+y.rx*p.w-y.bx*x+y.sx*(v?.x??0)*w,R=p.y0+y.ry*p.h-y.by*g+y.sy*(v?.y??0)*w;return{x:O,y:R}}function Qp(c,p,h=mt(p)){let v=c.sizeHpct!=null?c.sizeHpct/100*p.h:c.sizeLu*h;return c.minLu!=null&&(v=Math.max(v,c.minLu*h)),v}function Ms(c,p,h,v,x,g){let y=String(p??"").split(/\s+/).filter(Boolean);if(!y.length)return[""];let w=[],O=y[0];for(let R=1;R<y.length;R++){let A=O+" "+y[R];c(A,h,v,x)<=g?O=A:(w.push(O),O=y[R])}return w.push(O),w}function Hn(c,p,h,v={}){let x=mt(c),g=v.safe||tn(c,v.actionPct),y=(p.plate?.padLu??0)*x,w=Math.min(p.maxWidthLu!=null?p.maxWidthLu*x:g.w,g.w)-2*y,O=0,R=0,A=(p.gapLu??1.5)*x,E=p.children.map((_,Y)=>{let Z=Qp(_,c,x),ee=_.family||"system",oe=Z*(_.lineHeight??1.18),K=Ms(h,_.text,Z,_.weight??400,ee,w),he=0;for(let ke of K)he=Math.max(he,h(ke,Z,_.weight??400,ee));let Se=K.length*oe;return O=Math.max(O,he),R+=Se+(Y>0?A:0),{run:_,lines:K,fontPx:Z,lineHeightPx:oe,w:he,h:Se,family:ee}}),F=O+2*y,N=R+2*y,{x:D,y:L}=Kp(c,g,p.anchor,p.inset,F,N),M=L+y;for(let _ of E){let Y=_.run.align||"left";_.x=Y==="center"?D+F/2:Y==="right"?D+F-y:D+y,_.align=Y,_.y=M,M+=_.h+A}let U=p.plate?{x:D,y:L,w:F,h:N,radiusPx:(p.plate.radiusLu??0)*x}:null;return{box:{x:D,y:L,w:F,h:N},plate:U,runs:E,safe:g}}var Gt={system:'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif',mono:"ui-monospace,SFMono-Regular,Menlo,Consolas,monospace",serif:'Georgia,"Times New Roman",serif'},Ht=[{id:"inter",label:"Inter",kind:"sans",cssFamily:"GFX Inter",license:"OFL-1.1",embeddable:!0,files:{400:"/fonts/gfx/Inter-Regular.ttf",700:"/fonts/gfx/Inter-Bold.ttf"}},{id:"condensed",label:"Barlow Condensed",kind:"sans",cssFamily:"GFX Barlow Condensed",license:"OFL-1.1",embeddable:!0,files:{400:"/fonts/gfx/BarlowCondensed-Regular.ttf",700:"/fonts/gfx/BarlowCondensed-Bold.ttf"}},{id:"jetmono",label:"JetBrains Mono",kind:"mono",cssFamily:"GFX JetBrains Mono",license:"OFL-1.1",embeddable:!0,files:{400:"/fonts/gfx/JetBrainsMono-Regular.ttf",700:"/fonts/gfx/JetBrainsMono-Bold.ttf"}},{id:"instrument",label:"Instrument Serif",kind:"serif",cssFamily:"GFX Instrument Serif",license:"OFL-1.1",embeddable:!0,files:{400:"/fonts/gfx/InstrumentSerif-Regular.ttf"}},{id:"system",label:"System sans",kind:"sans",stack:Gt.system,embeddable:!1,files:{}},{id:"mono",label:"System mono",kind:"mono",stack:Gt.mono,embeddable:!1,files:{}},{id:"serif",label:"System serif",kind:"serif",stack:Gt.serif,embeddable:!1,files:{}}],Jp=Object.fromEntries(Ht.map(c=>[c.id,c])),Ca=new Map;function Oa({id:c,label:p,cssFamily:h,kind:v="sans",embeddable:x=!0,outlines:g=!1}){let y={id:c,label:p,kind:v,cssFamily:h,embeddable:x,outlines:g,custom:!0,files:{}};return Ca.set(c,y),y}function Vn(c){return Jp[c]??Ca.get(c)}function Ps(c){let p=Vn(c);return p?p.cssFamily?`"${p.cssFamily}", ${Gt[p.kind]||Gt.system}`:p.stack:Gt.system}function eh(c,p,h,v){let x=3*c,g=3*(h-c)-x,y=1-x-g,w=3*p,O=3*(v-p)-w,R=1-w-O,A=D=>((y*D+g)*D+x)*D,E=D=>((R*D+O)*D+w)*D,F=D=>(3*y*D+2*g)*D+x,N=D=>{let L=D;for(let _=0;_<8;_++){let Y=A(L)-D;if(Math.abs(Y)<1e-7)return L;let Z=F(L);if(Math.abs(Z)<1e-7)break;L-=Y/Z}let M=0,U=1;L=D;for(let _=0;_<40;_++){let Y=A(L)-D;if(Math.abs(Y)<1e-7)break;Y<0?M=L:U=L,L=(M+U)/2}return L};return D=>D<=0?0:D>=1?1:E(N(D))}var nn={linear:{x1:.333,y1:.333,x2:.667,y2:.667},inOut:{x1:.42,y1:0,x2:.58,y2:1},inSine:{x1:.12,y1:0,x2:.39,y2:0},outSine:{x1:.61,y1:1,x2:.88,y2:1},inOutSine:{x1:.37,y1:0,x2:.63,y2:1},inQuad:{x1:.11,y1:0,x2:.5,y2:0},outQuad:{x1:.5,y1:1,x2:.89,y2:1},inOutQuad:{x1:.45,y1:0,x2:.55,y2:1},inCubic:{x1:.32,y1:0,x2:.67,y2:0},outCubic:{x1:.215,y1:.61,x2:.355,y2:1},inOutCubic:{x1:.65,y1:0,x2:.35,y2:1},inQuart:{x1:.5,y1:0,x2:.75,y2:0},outQuart:{x1:.25,y1:1,x2:.5,y2:1},inOutQuart:{x1:.76,y1:0,x2:.24,y2:1},inExpo:{x1:.7,y1:0,x2:.84,y2:0},outExpo:{x1:.16,y1:1,x2:.3,y2:1},inOutExpo:{x1:.87,y1:0,x2:.13,y2:1},inCirc:{x1:.55,y1:0,x2:1,y2:.45},outCirc:{x1:0,y1:.55,x2:.45,y2:1},inOutCirc:{x1:.85,y1:0,x2:.15,y2:1},inBack:{x1:.36,y1:0,x2:.66,y2:-.56},outBack:{x1:.34,y1:1.56,x2:.64,y2:1},inOutBack:{x1:.68,y1:-.6,x2:.32,y2:1.6}};function Bs(c=.5){let p=Math.max(0,Math.min(1,c)),h=1-.85*p,v=6+12*p,x=v*Math.sqrt(Math.max(1e-6,1-h*h)),g=w=>1-Math.exp(-h*v*w)*(Math.cos(x*w)+h*v/x*Math.sin(x*w)),y=g(1)||1;return w=>w<=0?0:w>=1?1:g(w)/y}var sn={springSoft:Bs(.15),outSpring:Bs(.5),springLoose:Bs(.9),outElastic:c=>c<=0?0:c>=1?1:Math.pow(2,-10*c)*Math.sin((c*10-.75)*(2*Math.PI/3))+1,outBounce:c=>c<1/2.75?7.5625*c*c:c<2/2.75?7.5625*(c-=1.5/2.75)*c+.75:c<2.5/2.75?7.5625*(c-=2.25/2.75)*c+.9375:7.5625*(c-=2.625/2.75)*c+.984375},Xh=[...Object.keys(nn),...Object.keys(sn)],La=c=>Object.hasOwn(sn,c),th=24;function Ea(c,p=th){let h=sn[c];if(!h)return[];let v=[];for(let x=1;x<p;x++){let g=x/p;v.push({x:g,y:h(g)})}return v}function Ra(c){if(c==="linear"||!c)return h=>h;if(sn[c]){let h=sn[c];return v=>v<=0?0:v>=1?1:h(v)}let p=nn[c]||nn.linear;return eh(p.x1,p.y1,p.x2,p.y2)}function Vt(c){let p=nn[c]||nn.linear;return{o:{x:[p.x1],y:[p.y1]},i:{x:[p.x2],y:[p.y2]}}}var jt=(c,p,h)=>`${c} ${p}px ${Ps(h)}`,Aa=new Proxy({},{get:(c,p)=>Ra(p)});function rn(c,p){if(!c||!c.length)return;if(p<=c[0].t)return c[0].v;let h=c[c.length-1];if(p>=h.t)return h.v;for(let v=0;v<c.length-1;v++){let x=c[v],g=c[v+1];if(p>=x.t&&p<=g.t){let y=(p-x.t)/(g.t-x.t||1),w=(Aa[g.ease]||Aa.linear)(y);return x.v+(g.v-x.v)*w}}return h.v}function jn(c,p){let h=c.variants&&c.variants[p.group];if(!h)return c;let v={...c,...h};return h.inset&&(v.inset={...c.inset,...h.inset}),h.plate&&(v.plate={...c.plate,...h.plate}),h.children&&c.children&&(v.children=c.children.map((x,g)=>h.children[g]?{...x,...h.children[g]}:x)),delete v.variants,v}function $n(c){return(p,h,v,x)=>(c.font=jt(v,h,x),c.measureText(p).width)}function Ns(c,p,h,v,x,g){g=Math.max(0,Math.min(g,v/2,x/2)),c.beginPath(),c.moveTo(p+g,h),c.arcTo(p+v,h,p+v,h+x,g),c.arcTo(p+v,h+x,p,h+x,g),c.arcTo(p,h+x,p,h,g),c.arcTo(p,h,p+v,h,g),c.closePath()}function Gs(c,p,h){let v=p.w,x=mt(p),g=c.lineLu*x,y=v*(c.paraWidthFrac??.8),w=[],O=0;for(let A of c.rows){let E,F;if(A.gap!=null)E=g*A.gap;else if(A.head!=null)E=g*1.8;else if(A.images!=null)E=(A.images.heightLu??c.lineLu*4)*x+g*.4;else if(A.image!=null)E=(A.image.heightLu??c.lineLu*4)*x+g*.4;else if(A.para!=null){let N=Math.round(g*(c.paraLuFactor??.48));F=h?Ms(h,A.para,N,400,c.family||"system",y):[String(A.para)],E=F.length*N*(c.paraLineHeight??1.35)+g*.4}else E=g;w.push({row:A,h:E,lines:F}),O+=E}let R=O+p.h+g;return{rows:w,total:O,travel:R,line:g,u:x,paraW:y}}function nh(c,p,h,v,x,g,y){let w=x.w,O=x.h,{rows:R,travel:A,line:E,u:F}=Gs(p,x,g),N=w*(p.gutterFrac??.5),D=(p.colGapLu??3)*F,L=-O+h/v*A;c.save(),c.textBaseline="middle";let M=-L;for(let{row:U,h:_,lines:Y}of R)if(M+=_,!(M<-_-E||M>O+_+E)&&U.gap==null)if(U.head!=null)c.fillStyle=p.headColor||"#ffffff",c.textAlign="center",c.font=jt(700,Math.round(E*.6),p.family),c.fillText(String(U.head).toUpperCase(),w/2,M);else if(U.images!=null){let Z=(U.images.heightLu??p.lineLu*4)*F,ee=(p.imageGapLu??3)*F,oe=U.images.srcs.map(K=>y?.[K]).filter(Boolean).map(K=>({d:K,w:Z*((K.width||1)/(K.height||1))}));if(oe.length){let K=oe.reduce((Se,ke)=>Se+ke.w,0)+ee*(oe.length-1),he=w/2-K/2;for(let Se of oe)c.drawImage(Se.d,he,M-Z,Se.w,Z),he+=Se.w+ee}}else if(U.image!=null){let Z=y?.[U.image.src];if(Z){let ee=(U.image.heightLu??p.lineLu*4)*F,oe=U.image.widthLu!=null?U.image.widthLu*F:ee*((Z.width||1)/(Z.height||1));c.drawImage(Z,w/2-oe/2,M-ee,oe,ee)}}else if(U.para!=null){let Z=Math.round(E*(p.paraLuFactor??.48)),ee=Z*(p.paraLineHeight??1.35);c.font=jt(400,Z,p.family),c.fillStyle=U.color||p.nameColor||"#ffffff",c.textAlign="center";let oe=Y??[String(U.para)];for(let K=0;K<oe.length;K++)c.fillText(oe[K],w/2,M-(oe.length-1-K)*ee)}else U.text!=null?(c.font=jt(U.weight??500,Math.round(E*.48),p.family),c.fillStyle=U.color||p.nameColor||"#ffffff",c.textAlign="center",c.fillText(String(U.text),w/2,M)):(c.font=jt(400,Math.round(E*.48),p.family),c.fillStyle=p.roleColor||"#b9c2cc",c.textAlign="right",c.fillText(U.role||"",N-D/2,M),c.fillStyle=p.nameColor||"#ffffff",c.textAlign="left",c.fillText(U.name||"",N+D/2,M));c.restore()}function Fa(c){for(let p of c?.elements??[])for(let h of p.rows??[])if(h.image!=null||h.images!=null)return!0;return!1}function _s(c,p){let h=c.anim;return{alpha:h?.opacity?rn(h.opacity,p):c.opacity??1,slideLu:h?.slideLu?rn(h.slideLu,p):c.slideLu??0,riseLu:h?.riseLu?rn(h.riseLu,p):c.riseLu??0,scale:h?.scale?rn(h.scale,p):c.scale??1,reveal:h?.reveal?rn(h.reveal,p):c.reveal??1,revealAxis:h?.revealAxis||"x"}}function sh(c,p,h){let v=Math.max(1,c.children?.length??1);for(let x=0;x<v;x++){let g=_s(c,p-x*h);if(g.alpha>0&&g.reveal>0)return!0}return!1}function rh(c,p,h,v="",x="x"){if(c.beginPath(),x==="y"){let y=p.h*h,w=v.startsWith("top")?p.y:p.y+p.h-y;c.rect(p.x-2,w,p.w+4,y)}else{let y=p.w*h,w=v.includes("right")?p.x+p.w-y:v.includes("left")?p.x:p.x+(p.w-y)/2;c.rect(w,p.y-2,y,p.h+4)}c.clip()}function Ia(c,p,h,v,x){if(c.translate(p.slideLu*v,p.riseLu*v),p.scale!==1){let g=h.box.x+h.box.w/2,y=h.box.y+h.box.h/2;c.translate(g,y),c.scale(p.scale,p.scale),c.translate(-g,-y)}p.reveal<1&&rh(c,h.box,p.reveal,x,p.revealAxis)}function Hs(c,p,h,v,x,g){let y=v.w,w=v.h,O=mt(v);c.clearRect(0,0,y,w),p.bg&&(c.fillStyle=p.bg,c.fillRect(0,0,y,w));let R=tn(v,p.actionPct);for(let A of p.elements){let E=jn(A,v);if(E.type==="crawl"){nh(c,E,h,p.duration,v,x,g);continue}let F=E.stagger??0,N=_s(E,h);if(!sh(E,h,F))continue;let D=Hn(v,E,x,{safe:R});if(D.plate&&E.plate&&N.alpha>0){c.save(),Ia(c,N,D,O,E.anchor),c.globalAlpha=N.alpha;let L=D.plate,M=E.plate;if(M.color){if(M.colorB){let U=c.createLinearGradient(L.x,0,L.x+L.w,0);U.addColorStop(0,M.color),U.addColorStop(1,M.colorB),c.fillStyle=U}else c.fillStyle=M.color;Ns(c,L.x,L.y,L.w,L.h,L.radiusPx),c.fill()}if(M.stroke){let U=Math.max(1,(M.strokeLu??.25)*O);c.strokeStyle=M.stroke,c.lineWidth=U,Ns(c,L.x+U/2,L.y+U/2,L.w-U,L.h-U,Math.max(0,L.radiusPx-U/2)),c.stroke()}M.accent&&(c.fillStyle=M.accent,Ns(c,L.x,L.y,Math.max(2,(M.accentLu??.7)*O),L.h,L.radiusPx),c.fill()),c.restore()}for(let L=0;L<D.runs.length;L++){let M=D.runs[L],U=F?_s(E,h-L*F):N;if(!(U.alpha<=0)){c.save(),Ia(c,U,D,O,E.anchor),c.globalAlpha=U.alpha,c.textBaseline="top",c.font=jt(M.run.weight??400,M.fontPx,M.family),c.fillStyle=M.run.color||"#ffffff",c.textAlign=M.align;for(let _=0;_<M.lines.length;_++)c.fillText(M.lines[_],M.x,M.y+_*M.lineHeightPx);c.restore()}}}c.globalAlpha=1}var Qa=Zp(Ma(),1);import{createCanvas as an,GlobalFonts as Js,loadImage as Ka}from"@napi-rs/canvas";import{Buffer as wh}from"node:buffer";import{Worker as Oh}from"node:worker_threads";import{existsSync as Lh}from"node:fs";var Pa=(c,p,h)=>{let v=p.position?p.position.slug:p.key||"main",x=h.id===`${h.w}x${h.h}`?h.id:`${h.id}_${h.w}x${h.h}`;return`${c}/${v}/${c}_${v}_${x}.mov`};function Vs(c){let p=[],h=[],v="",x=!1,g=String(c??"").replace(/\r\n?/g,`
|
|
5
5
|
`);for(let y=0;y<g.length;y++){let w=g[y];if(x){w==='"'?g[y+1]==='"'?(v+='"',y++):x=!1:v+=w;continue}if(w==='"'){x=!0;continue}if(w===","){h.push(v),v="";continue}if(w===`
|
|
6
6
|
`){h.push(v),p.push(h),h=[],v="";continue}v+=w}for(h.push(v),p.push(h);p.length&&p[p.length-1].every(y=>y.trim()==="");)p.pop();return p.map(y=>y.map(w=>w.trim()))}var oh={section:["section","head","heading","category","group"],role:["role","job title","job","position","credit","department"],name:["name","name/company","person","company","crew","value"],text:["text","line","centered"],note:["paragraph","special thanks","special thanks text","thanks","blurb"],kind:["type","graphic","kind"]};function Ba(c){let p={};return c.forEach((h,v)=>{let x=h.toLowerCase().trim();for(let[g,y]of Object.entries(oh))y.includes(x)&&p[g]===void 0&&(p[g]=v)}),p}function ah(c){let p=Ba(c);return Object.keys(p).length>=2||p.role!==void 0&&p.name!==void 0}function Na(c){let p=Vs(c),h=[];if(!p.length)return{text:"",warnings:["No credit rows were recognised in that file."],imported:0};let v=ah(p[0]),x=v?Ba(p[0]):{},g=v?p.slice(1):p,y=!v||x.role===void 0&&x.name===void 0&&x.section===void 0&&x.text===void 0&&x.note===void 0;if(v){let E=p[0].length,F=g.filter(N=>N.some(D=>D!=="")&&N.length!==E).length;F&&h.push(`${F} row${F===1?"":"s"} had a different number of columns than the header \u2014 check that the right cells landed in the right place.`)}let w=[],O=null,R=E=>{E===""&&(w.length===0||w[w.length-1]==="")||w.push(E)};for(let E of g){if(E.every(_=>_==="")){R("");continue}let F=_=>_===void 0?"":(E[_]??"").trim();if(x.kind!==void 0){let _=F(x.kind).toLowerCase();if(_&&!_.startsWith("credit"))continue}if(y){let[_="",Y=""]=E;_&&Y?R(`${_} | ${Y}`):_?R(_):Y&&R(Y);continue}let N=F(x.section),D=F(x.role),L=F(x.name),M=F(x.text),U=F(x.note);N&&N!==O&&(w.length&&R(""),R(`# ${N}`),O=N),D&&L?R(`${D} | ${L}`):(D||L)&&R(D||L),M&&R(M),U&&R(`> ${U}`)}for(;w.length&&w[w.length-1]==="";)w.pop();let A=w.join(`
|