@imgly/psd-importer
Version:
Import PSD files into the Creative Editor Ecosystem
1 lines • 276 kB
JavaScript
"use strict";var vu=Object.create;var Ar=Object.defineProperty;var Iu=Object.getOwnPropertyDescriptor;var Cu=Object.getOwnPropertyNames;var yu=Object.getPrototypeOf,Bu=Object.prototype.hasOwnProperty;var Eu=(a,l)=>()=>(l||a((l={exports:{}}).exports,l),l.exports),mu=(a,l)=>{for(var A in l)Ar(a,A,{get:l[A],enumerable:!0})},Bi=(a,l,A,g)=>{if(l&&typeof l=="object"||typeof l=="function")for(let f of Cu(l))!Bu.call(a,f)&&f!==A&&Ar(a,f,{get:()=>l[f],enumerable:!(g=Iu(l,f))||g.enumerable});return a};var bu=(a,l,A)=>(A=a!=null?vu(yu(a)):{},Bi(l||!a||!a.__esModule?Ar(A,"default",{value:a,enumerable:!0}):A,a)),Qu=a=>Bi(Ar({},"__esModule",{value:!0}),a);var ji=Eu((yr,Xi)=>{(function(a,l){typeof yr=="object"&&typeof Xi<"u"?l(yr):typeof define=="function"&&define.amd?define(["exports"],l):(a=a||self,l(a.opentype={}))})(yr,function(a){"use strict";String.prototype.codePointAt||function(){var e=function(){try{var r={},n=Object.defineProperty,i=n(r,r,r)&&n}catch{}return i}(),t=function(r){if(this==null)throw TypeError();var n=String(this),i=n.length,s=r?Number(r):0;if(s!=s&&(s=0),!(s<0||s>=i)){var o=n.charCodeAt(s),c;return o>=55296&&o<=56319&&i>s+1&&(c=n.charCodeAt(s+1),c>=56320&&c<=57343)?(o-55296)*1024+c-56320+65536:o}};e?e(String.prototype,"codePointAt",{value:t,configurable:!0,writable:!0}):String.prototype.codePointAt=t}();var l=0,A=-3;function g(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function f(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new g,this.dtree=new g}var v=new g,B=new g,b=new Uint8Array(30),E=new Uint16Array(30),S=new Uint8Array(30),Q=new Uint16Array(30),D=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_=new g,F=new Uint8Array(320);function x(e,t,r,n){var i,s;for(i=0;i<r;++i)e[i]=0;for(i=0;i<30-r;++i)e[i+r]=i/r|0;for(s=n,i=0;i<30;++i)t[i]=s,s+=1<<e[i]}function H(e,t){var r;for(r=0;r<7;++r)e.table[r]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,r=0;r<24;++r)e.trans[r]=256+r;for(r=0;r<144;++r)e.trans[24+r]=r;for(r=0;r<8;++r)e.trans[168+r]=280+r;for(r=0;r<112;++r)e.trans[176+r]=144+r;for(r=0;r<5;++r)t.table[r]=0;for(t.table[5]=32,r=0;r<32;++r)t.trans[r]=r}var J=new Uint16Array(16);function z(e,t,r,n){var i,s;for(i=0;i<16;++i)e.table[i]=0;for(i=0;i<n;++i)e.table[t[r+i]]++;for(e.table[0]=0,s=0,i=0;i<16;++i)J[i]=s,s+=e.table[i];for(i=0;i<n;++i)t[r+i]&&(e.trans[J[t[r+i]]++]=i)}function ue(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=e.tag&1;return e.tag>>>=1,t}function re(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,n+r}function Se(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var r=0,n=0,i=0,s=e.tag;do n=2*n+(s&1),s>>>=1,++i,r+=t.table[i],n-=t.table[i];while(n>=0);return e.tag=s,e.bitcount-=i,t.trans[r+n]}function Be(e,t,r){var n,i,s,o,c,u;for(n=re(e,5,257),i=re(e,5,1),s=re(e,4,4),o=0;o<19;++o)F[o]=0;for(o=0;o<s;++o){var h=re(e,3,0);F[D[o]]=h}for(z(_,F,0,19),c=0;c<n+i;){var p=Se(e,_);switch(p){case 16:var I=F[c-1];for(u=re(e,2,3);u;--u)F[c++]=I;break;case 17:for(u=re(e,3,3);u;--u)F[c++]=0;break;case 18:for(u=re(e,7,11);u;--u)F[c++]=0;break;default:F[c++]=p;break}}z(t,F,0,n),z(r,F,n,i)}function Fe(e,t,r){for(;;){var n=Se(e,t);if(n===256)return l;if(n<256)e.dest[e.destLen++]=n;else{var i,s,o,c;for(n-=257,i=re(e,b[n],E[n]),s=Se(e,r),o=e.destLen-re(e,S[s],Q[s]),c=o;c<o+i;++c)e.dest[e.destLen++]=e.dest[c]}}}function ve(e){for(var t,r,n;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if(t=e.source[e.sourceIndex+1],t=256*t+e.source[e.sourceIndex],r=e.source[e.sourceIndex+3],r=256*r+e.source[e.sourceIndex+2],t!==(~r&65535))return A;for(e.sourceIndex+=4,n=t;n;--n)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,l}function rt(e,t){var r=new f(e,t),n,i,s;do{switch(n=ue(r),i=re(r,2,0),i){case 0:s=ve(r);break;case 1:s=Fe(r,v,B);break;case 2:Be(r,r.ltree,r.dtree),s=Fe(r,r.ltree,r.dtree);break;default:s=A}if(s!==l)throw new Error("Data error")}while(!n);return r.destLen<r.dest.length?typeof r.dest.slice=="function"?r.dest.slice(0,r.destLen):r.dest.subarray(0,r.destLen):r.dest}H(v,B),x(b,E,4,3),x(S,Q,2,1),b[28]=0,E[28]=258;var bt=rt;function Le(e,t,r,n,i){return Math.pow(1-i,3)*e+3*Math.pow(1-i,2)*i*t+3*(1-i)*Math.pow(i,2)*r+Math.pow(i,3)*n}function Me(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}Me.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},Me.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))},Me.prototype.addX=function(e){this.addPoint(e,null)},Me.prototype.addY=function(e){this.addPoint(null,e)},Me.prototype.addBezier=function(e,t,r,n,i,s,o,c){var u=[e,t],h=[r,n],p=[i,s],I=[o,c];this.addPoint(e,t),this.addPoint(o,c);for(var d=0;d<=1;d++){var C=6*u[d]-12*h[d]+6*p[d],w=-3*u[d]+9*h[d]-9*p[d]+3*I[d],M=3*h[d]-3*u[d];if(w===0){if(C===0)continue;var U=-M/C;0<U&&U<1&&(d===0&&this.addX(Le(u[d],h[d],p[d],I[d],U)),d===1&&this.addY(Le(u[d],h[d],p[d],I[d],U)));continue}var R=Math.pow(C,2)-4*M*w;if(!(R<0)){var V=(-C+Math.sqrt(R))/(2*w);0<V&&V<1&&(d===0&&this.addX(Le(u[d],h[d],p[d],I[d],V)),d===1&&this.addY(Le(u[d],h[d],p[d],I[d],V)));var N=(-C-Math.sqrt(R))/(2*w);0<N&&N<1&&(d===0&&this.addX(Le(u[d],h[d],p[d],I[d],N)),d===1&&this.addY(Le(u[d],h[d],p[d],I[d],N)))}}},Me.prototype.addQuad=function(e,t,r,n,i,s){var o=e+.6666666666666666*(r-e),c=t+2/3*(n-t),u=o+1/3*(i-e),h=c+1/3*(s-t);this.addBezier(e,t,o,c,u,h,i,s)};function se(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}se.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},se.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},se.prototype.curveTo=se.prototype.bezierCurveTo=function(e,t,r,n,i,s){this.commands.push({type:"C",x1:e,y1:t,x2:r,y2:n,x:i,y:s})},se.prototype.quadTo=se.prototype.quadraticCurveTo=function(e,t,r,n){this.commands.push({type:"Q",x1:e,y1:t,x:r,y:n})},se.prototype.close=se.prototype.closePath=function(){this.commands.push({type:"Z"})},se.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof Me){var 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)},se.prototype.getBoundingBox=function(){for(var e=new Me,t=0,r=0,n=0,i=0,s=0;s<this.commands.length;s++){var o=this.commands[s];switch(o.type){case"M":e.addPoint(o.x,o.y),t=n=o.x,r=i=o.y;break;case"L":e.addPoint(o.x,o.y),n=o.x,i=o.y;break;case"Q":e.addQuad(n,i,o.x1,o.y1,o.x,o.y),n=o.x,i=o.y;break;case"C":e.addBezier(n,i,o.x1,o.y1,o.x2,o.y2,o.x,o.y),n=o.x,i=o.y;break;case"Z":n=t,i=r;break;default:throw new Error("Unexpected path command "+o.type)}}return e.isEmpty()&&e.addPoint(0,0),e},se.prototype.draw=function(e){e.beginPath();for(var t=0;t<this.commands.length;t+=1){var r=this.commands[t];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"&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},se.prototype.toPathData=function(e){e=e!==void 0?e:2;function t(o){return Math.round(o)===o?""+Math.round(o):o.toFixed(e)}function r(){for(var o=arguments,c="",u=0;u<arguments.length;u+=1){var h=o[u];h>=0&&u>0&&(c+=" "),c+=t(h)}return c}for(var n="",i=0;i<this.commands.length;i+=1){var s=this.commands[i];s.type==="M"?n+="M"+r(s.x,s.y):s.type==="L"?n+="L"+r(s.x,s.y):s.type==="C"?n+="C"+r(s.x1,s.y1,s.x2,s.y2,s.x,s.y):s.type==="Q"?n+="Q"+r(s.x1,s.y1,s.x,s.y):s.type==="Z"&&(n+="Z")}return n},se.prototype.toSVG=function(e){var t='<path d="';return t+=this.toPathData(e),t+='"',this.fill&&this.fill!=="black"&&(this.fill===null?t+=' fill="none"':t+=' fill="'+this.fill+'"'),this.stroke&&(t+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),t+="/>",t},se.prototype.toDOMElement=function(e){var t=this.toPathData(e),r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",t),r};function Nt(e){throw new Error(e)}function Gt(e,t){e||Nt(t)}var T={fail:Nt,argument:Gt,assert:Gt},Ee=32768,ee=2147483648,ne={},k={},m={};function P(e){return function(){return e}}k.BYTE=function(e){return T.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]},m.BYTE=P(1),k.CHAR=function(e){return[e.charCodeAt(0)]},m.CHAR=P(1),k.CHARARRAY=function(e){typeof e>"u"&&(e="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var t=[],r=0;r<e.length;r+=1)t[r]=e.charCodeAt(r);return t},m.CHARARRAY=function(e){return typeof e>"u"?0:e.length},k.USHORT=function(e){return[e>>8&255,e&255]},m.USHORT=P(2),k.SHORT=function(e){return e>=Ee&&(e=-(2*Ee-e)),[e>>8&255,e&255]},m.SHORT=P(2),k.UINT24=function(e){return[e>>16&255,e>>8&255,e&255]},m.UINT24=P(3),k.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]},m.ULONG=P(4),k.LONG=function(e){return e>=ee&&(e=-(2*ee-e)),[e>>24&255,e>>16&255,e>>8&255,e&255]},m.LONG=P(4),k.FIXED=k.ULONG,m.FIXED=m.ULONG,k.FWORD=k.SHORT,m.FWORD=m.SHORT,k.UFWORD=k.USHORT,m.UFWORD=m.USHORT,k.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,e&255]},m.LONGDATETIME=P(8),k.TAG=function(e){return T.argument(e.length===4,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},m.TAG=P(4),k.Card8=k.BYTE,m.Card8=m.BYTE,k.Card16=k.USHORT,m.Card16=m.USHORT,k.OffSize=k.BYTE,m.OffSize=m.BYTE,k.SID=k.USHORT,m.SID=m.USHORT,k.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?k.NUMBER16(e):k.NUMBER32(e)},m.NUMBER=function(e){return k.NUMBER(e).length},k.NUMBER16=function(e){return[28,e>>8&255,e&255]},m.NUMBER16=P(3),k.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,e&255]},m.NUMBER32=P(5),k.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var n=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*n)/n).toString()}for(var i="",s=0,o=t.length;s<o;s+=1){var c=t[s];c==="e"?i+=t[++s]==="-"?"c":"b":c==="."?i+="a":c==="-"?i+="e":i+=c}i+=i.length&1?"f":"ff";for(var u=[30],h=0,p=i.length;h<p;h+=2)u.push(parseInt(i.substr(h,2),16));return u},m.REAL=function(e){return k.REAL(e).length},k.NAME=k.CHARARRAY,m.NAME=m.CHARARRAY,k.STRING=k.CHARARRAY,m.STRING=m.CHARARRAY,ne.UTF8=function(e,t,r){for(var n=[],i=r,s=0;s<i;s++,t+=1)n[s]=e.getUint8(t);return String.fromCharCode.apply(null,n)},ne.UTF16=function(e,t,r){for(var n=[],i=r/2,s=0;s<i;s++,t+=2)n[s]=e.getUint16(t);return String.fromCharCode.apply(null,n)},k.UTF16=function(e){for(var t=[],r=0;r<e.length;r+=1){var n=e.charCodeAt(r);t[t.length]=n>>8&255,t[t.length]=n&255}return t},m.UTF16=function(e){return e.length*2};var Z={"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"};ne.MACSTRING=function(e,t,r,n){var i=Z[n];if(i!==void 0){for(var s="",o=0;o<r;o++){var c=e.getUint8(t+o);c<=127?s+=String.fromCharCode(c):s+=i[c&127]}return s}};var X=typeof WeakMap=="function"&&new WeakMap,$,Ae=function(e){if(!$){$={};for(var t in Z)$[t]=new String(t)}var r=$[e];if(r!==void 0){if(X){var n=X.get(r);if(n!==void 0)return n}var i=Z[e];if(i!==void 0){for(var s={},o=0;o<i.length;o++)s[i.charCodeAt(o)]=o+128;return X&&X.set(r,s),s}}};k.MACSTRING=function(e,t){var r=Ae(t);if(r!==void 0){for(var n=[],i=0;i<e.length;i++){var s=e.charCodeAt(i);if(s>=128&&(s=r[s],s===void 0))return;n[i]=s}return n}},m.MACSTRING=function(e,t){var r=k.MACSTRING(e,t);return r!==void 0?r.length:0};function j(e){return e>=-128&&e<=127}function oe(e,t,r){for(var n=0,i=e.length;t<i&&n<64&&e[t]===0;)++t,++n;return r.push(128|n-1),t}function Ce(e,t,r){for(var n=0,i=e.length,s=t;s<i&&n<64;){var o=e[s];if(!j(o)||o===0&&s+1<i&&e[s+1]===0)break;++s,++n}r.push(n-1);for(var c=t;c<s;++c)r.push(e[c]+256&255);return s}function je(e,t,r){for(var n=0,i=e.length,s=t;s<i&&n<64;){var o=e[s];if(o===0||j(o)&&s+1<i&&j(e[s+1]))break;++s,++n}r.push(64|n-1);for(var c=t;c<s;++c){var u=e[c];r.push(u+65536>>8&255,u+256&255)}return s}k.VARDELTAS=function(e){for(var t=0,r=[];t<e.length;){var n=e[t];n===0?t=oe(e,t,r):n>=-128&&n<=127?t=Ce(e,t,r):t=je(e,t,r)}return r},k.INDEX=function(e){for(var t=1,r=[t],n=[],i=0;i<e.length;i+=1){var s=k.OBJECT(e[i]);Array.prototype.push.apply(n,s),t+=s.length,r.push(t)}if(n.length===0)return[0,0];for(var o=[],c=1+Math.floor(Math.log(t)/Math.log(2))/8|0,u=[void 0,k.BYTE,k.USHORT,k.UINT24,k.ULONG][c],h=0;h<r.length;h+=1){var p=u(r[h]);Array.prototype.push.apply(o,p)}return Array.prototype.concat(k.Card16(e.length),k.OffSize(c),o,n)},m.INDEX=function(e){return k.INDEX(e).length},k.DICT=function(e){for(var t=[],r=Object.keys(e),n=r.length,i=0;i<n;i+=1){var s=parseInt(r[i],0),o=e[s];t=t.concat(k.OPERAND(o.value,o.type)),t=t.concat(k.OPERATOR(s))}return t},m.DICT=function(e){return k.DICT(e).length},k.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},k.OPERAND=function(e,t){var r=[];if(Array.isArray(t))for(var n=0;n<t.length;n+=1)T.argument(e.length===t.length,"Not enough arguments given for type"+t),r=r.concat(k.OPERAND(e[n],t[n]));else if(t==="SID")r=r.concat(k.NUMBER(e));else if(t==="offset")r=r.concat(k.NUMBER32(e));else if(t==="number")r=r.concat(k.NUMBER(e));else if(t==="real")r=r.concat(k.REAL(e));else throw new Error("Unknown operand type "+t);return r},k.OP=k.BYTE,m.OP=m.BYTE;var Pe=typeof WeakMap=="function"&&new WeakMap;k.CHARSTRING=function(e){if(Pe){var t=Pe.get(e);if(t!==void 0)return t}for(var r=[],n=e.length,i=0;i<n;i+=1){var s=e[i];r=r.concat(k[s.type](s.value))}return Pe&&Pe.set(e,r),r},m.CHARSTRING=function(e){return k.CHARSTRING(e).length},k.OBJECT=function(e){var t=k[e.type];return T.argument(t!==void 0,"No encoding function for type "+e.type),t(e.value)},m.OBJECT=function(e){var t=m[e.type];return T.argument(t!==void 0,"No sizeOf function for type "+e.type),t(e.value)},k.TABLE=function(e){for(var t=[],r=e.fields.length,n=[],i=[],s=0;s<r;s+=1){var o=e.fields[s],c=k[o.type];T.argument(c!==void 0,"No encoding function for field type "+o.type+" ("+o.name+")");var u=e[o.name];u===void 0&&(u=o.value);var h=c(u);o.type==="TABLE"?(i.push(t.length),t=t.concat([0,0]),n.push(h)):t=t.concat(h)}for(var p=0;p<n.length;p+=1){var I=i[p],d=t.length;T.argument(d<65536,"Table "+e.tableName+" too big."),t[I]=d>>8,t[I+1]=d&255,t=t.concat(n[p])}return t},m.TABLE=function(e){for(var t=0,r=e.fields.length,n=0;n<r;n+=1){var i=e.fields[n],s=m[i.type];T.argument(s!==void 0,"No sizeOf function for field type "+i.type+" ("+i.name+")");var o=e[i.name];o===void 0&&(o=i.value),t+=s(o),i.type==="TABLE"&&(t+=2)}return t},k.RECORD=k.TABLE,m.RECORD=m.TABLE,k.LITERAL=function(e){return e},m.LITERAL=function(e){return e.length};function ce(e,t,r){if(t.length&&(t[0].name!=="coverageFormat"||t[0].value===1))for(var n=0;n<t.length;n+=1){var i=t[n];this[i.name]=i.value}if(this.tableName=e,this.fields=t,r)for(var s=Object.keys(r),o=0;o<s.length;o+=1){var c=s[o],u=r[c];this[c]!==void 0&&(this[c]=u)}}ce.prototype.encode=function(){return k.TABLE(this)},ce.prototype.sizeOf=function(){return m.TABLE(this)};function He(e,t,r){r===void 0&&(r=t.length);var n=new Array(t.length+1);n[0]={name:e+"Count",type:"USHORT",value:r};for(var i=0;i<t.length;i++)n[i+1]={name:e+i,type:"USHORT",value:t[i]};return n}function pt(e,t,r){var n=t.length,i=new Array(n+1);i[0]={name:e+"Count",type:"USHORT",value:n};for(var s=0;s<n;s++)i[s+1]={name:e+s,type:"TABLE",value:r(t[s],s)};return i}function nt(e,t,r){var n=t.length,i=[];i[0]={name:e+"Count",type:"USHORT",value:n};for(var s=0;s<n;s++)i=i.concat(r(t[s],s));return i}function ot(e){e.format===1?ce.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(He("glyph",e.glyphs))):e.format===2?ce.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(nt("rangeRecord",e.ranges,function(t){return[{name:"startGlyphID",type:"USHORT",value:t.start},{name:"endGlyphID",type:"USHORT",value:t.end},{name:"startCoverageIndex",type:"USHORT",value:t.index}]}))):T.assert(!1,"Coverage format must be 1 or 2.")}ot.prototype=Object.create(ce.prototype),ot.prototype.constructor=ot;function At(e){ce.call(this,"scriptListTable",nt("scriptRecord",e,function(t,r){var n=t.script,i=n.defaultLangSys;return T.assert(!!i,"Unable to write GSUB: script "+t.tag+" has no default language system."),[{name:"scriptTag"+r,type:"TAG",value:t.tag},{name:"script"+r,type:"TABLE",value:new ce("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new ce("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:i.reqFeatureIndex}].concat(He("featureIndex",i.featureIndexes)))}].concat(nt("langSys",n.langSysRecords,function(s,o){var c=s.langSys;return[{name:"langSysTag"+o,type:"TAG",value:s.tag},{name:"langSys"+o,type:"TABLE",value:new ce("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:c.reqFeatureIndex}].concat(He("featureIndex",c.featureIndexes)))}]})))}]}))}At.prototype=Object.create(ce.prototype),At.prototype.constructor=At;function Qt(e){ce.call(this,"featureListTable",nt("featureRecord",e,function(t,r){var n=t.feature;return[{name:"featureTag"+r,type:"TAG",value:t.tag},{name:"feature"+r,type:"TABLE",value:new ce("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat(He("lookupListIndex",n.lookupListIndexes)))}]}))}Qt.prototype=Object.create(ce.prototype),Qt.prototype.constructor=Qt;function St(e,t){ce.call(this,"lookupListTable",pt("lookup",e,function(r){var n=t[r.lookupType];return T.assert(!!n,"Unable to write GSUB lookup type "+r.lookupType+" tables."),new ce("lookupTable",[{name:"lookupType",type:"USHORT",value:r.lookupType},{name:"lookupFlag",type:"USHORT",value:r.lookupFlag}].concat(pt("subtable",r.subtables,n)))}))}St.prototype=Object.create(ce.prototype),St.prototype.constructor=St;var L={Table:ce,Record:ce,Coverage:ot,ScriptList:At,FeatureList:Qt,LookupList:St,ushortList:He,tableList:pt,recordList:nt};function jt(e,t){return e.getUint8(t)}function Zt(e,t){return e.getUint16(t,!1)}function As(e,t){return e.getInt16(t,!1)}function mr(e,t){return e.getUint32(t,!1)}function ea(e,t){var r=e.getInt16(t,!1),n=e.getUint16(t+2,!1);return r+n/65535}function ls(e,t){for(var r="",n=t;n<t+4;n+=1)r+=String.fromCharCode(e.getInt8(n));return r}function us(e,t,r){for(var n=0,i=0;i<r;i+=1)n<<=8,n+=e.getUint8(t+i);return n}function cs(e,t,r){for(var n=[],i=t;i<r;i+=1)n.push(e.getUint8(i));return n}function gs(e){for(var t="",r=0;r<e.length;r+=1)t+=String.fromCharCode(e[r]);return t}var hs={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function y(e,t){this.data=e,this.offset=t,this.relativeOffset=0}y.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},y.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},y.prototype.parseCard8=y.prototype.parseByte,y.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},y.prototype.parseCard16=y.prototype.parseUShort,y.prototype.parseSID=y.prototype.parseUShort,y.prototype.parseOffset16=y.prototype.parseUShort,y.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},y.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},y.prototype.parseULong=function(){var e=mr(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},y.prototype.parseOffset32=y.prototype.parseULong,y.prototype.parseFixed=function(){var e=ea(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},y.prototype.parseString=function(e){var t=this.data,r=this.offset+this.relativeOffset,n="";this.relativeOffset+=e;for(var i=0;i<e;i++)n+=String.fromCharCode(t.getUint8(r+i));return n},y.prototype.parseTag=function(){return this.parseString(4)},y.prototype.parseLongDateTime=function(){var e=mr(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},y.prototype.parseVersion=function(e){var t=Zt(this.data,this.offset+this.relativeOffset),r=Zt(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,e===void 0&&(e=4096),t+r/e/10},y.prototype.skip=function(e,t){t===void 0&&(t=1),this.relativeOffset+=hs[e]*t},y.prototype.parseULongList=function(e){e===void 0&&(e=this.parseULong());for(var t=new Array(e),r=this.data,n=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=r.getUint32(n),n+=4;return this.relativeOffset+=e*4,t},y.prototype.parseOffset16List=y.prototype.parseUShortList=function(e){e===void 0&&(e=this.parseUShort());for(var t=new Array(e),r=this.data,n=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=r.getUint16(n),n+=2;return this.relativeOffset+=e*2,t},y.prototype.parseShortList=function(e){for(var t=new Array(e),r=this.data,n=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=r.getInt16(n),n+=2;return this.relativeOffset+=e*2,t},y.prototype.parseByteList=function(e){for(var t=new Array(e),r=this.data,n=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=r.getUint8(n++);return this.relativeOffset+=e,t},y.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());for(var r=new Array(e),n=0;n<e;n++)r[n]=t.call(this);return r},y.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());for(var r=new Array(e),n=0;n<e;n++)r[n]=t.call(this);return r},y.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());for(var r=new Array(e),n=Object.keys(t),i=0;i<e;i++){for(var s={},o=0;o<n.length;o++){var c=n[o],u=t[c];s[c]=u.call(this)}r[i]=s}return r},y.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());for(var r=new Array(e),n=Object.keys(t),i=0;i<e;i++){for(var s={},o=0;o<n.length;o++){var c=n[o],u=t[c];s[c]=u.call(this)}r[i]=s}return r},y.prototype.parseStruct=function(e){if(typeof e=="function")return e.call(this);for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var i=t[n],s=e[i];r[i]=s.call(this)}return r},y.prototype.parseValueRecord=function(e){if(e===void 0&&(e=this.parseUShort()),e!==0){var 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}},y.prototype.parseValueRecordList=function(){for(var e=this.parseUShort(),t=this.parseUShort(),r=new Array(t),n=0;n<t;n++)r[n]=this.parseValueRecord(e);return r},y.prototype.parsePointer=function(e){var t=this.parseOffset16();if(t>0)return new y(this.data,this.offset+t).parseStruct(e)},y.prototype.parsePointer32=function(e){var t=this.parseOffset32();if(t>0)return new y(this.data,this.offset+t).parseStruct(e)},y.prototype.parseListOfLists=function(e){for(var t=this.parseOffset16List(),r=t.length,n=this.relativeOffset,i=new Array(r),s=0;s<r;s++){var o=t[s];if(o===0){i[s]=void 0;continue}if(this.relativeOffset=o,e){for(var c=this.parseOffset16List(),u=new Array(c.length),h=0;h<c.length;h++)this.relativeOffset=o+c[h],u[h]=e.call(this);i[s]=u}else i[s]=this.parseUShortList()}return this.relativeOffset=n,i},y.prototype.parseCoverage=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort(),r=this.parseUShort();if(t===1)return{format:1,glyphs:this.parseUShortList(r)};if(t===2){for(var n=new Array(r),i=0;i<r;i++)n[i]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:n}}throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.")},y.prototype.parseClassDef=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(t===2)return{format:2,ranges:this.parseRecordList({start:y.uShort,end:y.uShort,classId:y.uShort})};throw new Error("0x"+e.toString(16)+": ClassDef format must be 1 or 2.")},y.list=function(e,t){return function(){return this.parseList(e,t)}},y.list32=function(e,t){return function(){return this.parseList32(e,t)}},y.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},y.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},y.pointer=function(e){return function(){return this.parsePointer(e)}},y.pointer32=function(e){return function(){return this.parsePointer32(e)}},y.tag=y.prototype.parseTag,y.byte=y.prototype.parseByte,y.uShort=y.offset16=y.prototype.parseUShort,y.uShortList=y.prototype.parseUShortList,y.uLong=y.offset32=y.prototype.parseULong,y.uLongList=y.prototype.parseULongList,y.struct=y.prototype.parseStruct,y.coverage=y.prototype.parseCoverage,y.classDef=y.prototype.parseClassDef;var ta={reserved:y.uShort,reqFeatureIndex:y.uShort,featureIndexes:y.uShortList};y.prototype.parseScriptList=function(){return this.parsePointer(y.recordList({tag:y.tag,script:y.pointer({defaultLangSys:y.pointer(ta),langSysRecords:y.recordList({tag:y.tag,langSys:y.pointer(ta)})})}))||[]},y.prototype.parseFeatureList=function(){return this.parsePointer(y.recordList({tag:y.tag,feature:y.pointer({featureParams:y.offset16,lookupListIndexes:y.uShortList})}))||[]},y.prototype.parseLookupList=function(e){return this.parsePointer(y.list(y.pointer(function(){var t=this.parseUShort();T.argument(1<=t&&t<=9,"GPOS/GSUB lookup type "+t+" unknown.");var r=this.parseUShort(),n=r&16;return{lookupType:t,lookupFlag:r,subtables:this.parseList(y.pointer(e[t])),markFilteringSet:n?this.parseUShort():void 0}})))||[]},y.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var e=this.parseUShort(),t=this.parseUShort();T.argument(e===1&&t<1,"GPOS/GSUB feature variations table unknown.");var r=this.parseRecordList32({conditionSetOffset:y.offset32,featureTableSubstitutionOffset:y.offset32});return r})||[]};var G={getByte:jt,getCard8:jt,getUShort:Zt,getCard16:Zt,getShort:As,getULong:mr,getFixed:ea,getTag:ls,getOffset:us,getBytes:cs,bytesToString:gs,Parser:y};function fs(e,t){t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong();var r;e.groupCount=r=t.parseULong(),e.glyphIndexMap={};for(var n=0;n<r;n+=1)for(var i=t.parseULong(),s=t.parseULong(),o=t.parseULong(),c=i;c<=s;c+=1)e.glyphIndexMap[c]=o,o++}function ps(e,t,r,n,i){e.length=t.parseUShort(),e.language=t.parseUShort();var s;e.segCount=s=t.parseUShort()>>1,t.skip("uShort",3),e.glyphIndexMap={};for(var o=new G.Parser(r,n+i+14),c=new G.Parser(r,n+i+16+s*2),u=new G.Parser(r,n+i+16+s*4),h=new G.Parser(r,n+i+16+s*6),p=n+i+16+s*8,I=0;I<s-1;I+=1)for(var d=void 0,C=o.parseUShort(),w=c.parseUShort(),M=u.parseShort(),U=h.parseUShort(),R=w;R<=C;R+=1)U!==0?(p=h.offset+h.relativeOffset-2,p+=U,p+=(R-w)*2,d=G.getUShort(r,p),d!==0&&(d=d+M&65535)):d=R+M&65535,e.glyphIndexMap[R]=d}function ds(e,t){var r={};r.version=G.getUShort(e,t),T.argument(r.version===0,"cmap table version should be 0."),r.numTables=G.getUShort(e,t+2);for(var n=-1,i=r.numTables-1;i>=0;i-=1){var s=G.getUShort(e,t+4+i*8),o=G.getUShort(e,t+4+i*8+2);if(s===3&&(o===0||o===1||o===10)||s===0&&(o===0||o===1||o===2||o===3||o===4)){n=G.getULong(e,t+4+i*8+4);break}}if(n===-1)throw new Error("No valid cmap sub-tables found.");var c=new G.Parser(e,t+n);if(r.format=c.parseUShort(),r.format===12)fs(r,c);else if(r.format===4)ps(r,c,e,t,n);else throw new Error("Only format 4 and 12 cmap tables are supported (found format "+r.format+").");return r}function vs(e,t,r){e.segments.push({end:t,start:t,delta:-(t-r),offset:0,glyphIndex:r})}function Is(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}function Cs(e){var t=!0,r;for(r=e.length-1;r>0;r-=1){var n=e.get(r);if(n.unicode>65535){console.log("Adding CMAP format 12 (needed!)"),t=!1;break}}var i=[{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||(i=i.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),i=i.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var s=new L.Table("cmap",i);for(s.segments=[],r=0;r<e.length;r+=1){for(var o=e.get(r),c=0;c<o.unicodes.length;c+=1)vs(s,o.unicodes[c],r);s.segments=s.segments.sort(function(V,N){return V.start-N.start})}Is(s);var u=s.segments.length,h=0,p=[],I=[],d=[],C=[],w=[],M=[];for(r=0;r<u;r+=1){var U=s.segments[r];U.end<=65535&&U.start<=65535?(p=p.concat({name:"end_"+r,type:"USHORT",value:U.end}),I=I.concat({name:"start_"+r,type:"USHORT",value:U.start}),d=d.concat({name:"idDelta_"+r,type:"SHORT",value:U.delta}),C=C.concat({name:"idRangeOffset_"+r,type:"USHORT",value:U.offset}),U.glyphId!==void 0&&(w=w.concat({name:"glyph_"+r,type:"USHORT",value:U.glyphId}))):h+=1,!t&&U.glyphIndex!==void 0&&(M=M.concat({name:"cmap12Start_"+r,type:"ULONG",value:U.start}),M=M.concat({name:"cmap12End_"+r,type:"ULONG",value:U.end}),M=M.concat({name:"cmap12Glyph_"+r,type:"ULONG",value:U.glyphIndex}))}if(s.segCountX2=(u-h)*2,s.searchRange=Math.pow(2,Math.floor(Math.log(u-h)/Math.log(2)))*2,s.entrySelector=Math.log(s.searchRange/2)/Math.log(2),s.rangeShift=s.segCountX2-s.searchRange,s.fields=s.fields.concat(p),s.fields.push({name:"reservedPad",type:"USHORT",value:0}),s.fields=s.fields.concat(I),s.fields=s.fields.concat(d),s.fields=s.fields.concat(C),s.fields=s.fields.concat(w),s.cmap4Length=14+p.length*2+2+I.length*2+d.length*2+C.length*2+w.length*2,!t){var R=16+M.length*4;s.cmap12Offset=12+2*2+4+s.cmap4Length,s.fields=s.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:R},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:M.length/3}]),s.fields=s.fields.concat(M)}return s}var ra={parse:ds,make:Cs},$t=[".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"],ys=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],Bs=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],dt=[".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 na(e){this.font=e}na.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),r=this.font.glyphs;if(r){for(var n=0;n<r.length;n+=1)for(var i=r.get(n),s=0;s<i.unicodes.length;s+=1)if(i.unicodes[s]===t)return n}return null};function aa(e){this.cmap=e}aa.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0};function er(e,t){this.encoding=e,this.charset=t}er.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),r=this.encoding[t];return this.charset.indexOf(r)};function br(e){switch(e.version){case 1:this.names=dt.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(var t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<dt.length?this.names[t]=dt[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-dt.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(var r=0;r<e.numberOfGlyphs;r++)this.names[r]=dt[r+e.glyphNameIndex[r]];break;case 3:this.names=[];break;default:this.names=[];break}}br.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},br.prototype.glyphIndexToName=function(e){return this.names[e]};function Es(e){for(var t,r=e.tables.cmap.glyphIndexMap,n=Object.keys(r),i=0;i<n.length;i+=1){var s=n[i],o=r[s];t=e.glyphs.get(o),t.addUnicode(parseInt(s))}for(var c=0;c<e.glyphs.length;c+=1)t=e.glyphs.get(c),e.cffEncoding?e.isCIDFont?t.name="gid"+c:t.name=e.cffEncoding.charset[c]:e.glyphNames.names&&(t.name=e.glyphNames.glyphIndexToName(c))}function ms(e){e._IndexToUnicodeMap={};for(var t=e.tables.cmap.glyphIndexMap,r=Object.keys(t),n=0;n<r.length;n+=1){var i=r[n],s=t[i];e._IndexToUnicodeMap[s]===void 0?e._IndexToUnicodeMap[s]={unicodes:[parseInt(i)]}:e._IndexToUnicodeMap[s].unicodes.push(parseInt(i))}}function bs(e,t){t.lowMemory?ms(e):Es(e)}function Qs(e,t,r,n,i){e.beginPath(),e.moveTo(t,r),e.lineTo(n,i