ocearo-ui 0.1.21 → 2.0.0
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/404.html +1 -1
- package/README.fr.md +123 -133
- package/README.md +120 -134
- package/__next.__PAGE__.txt +19 -5
- package/__next._full.txt +11 -11
- package/__next._tree.txt +2 -2
- package/_next/static/chunks/0-c2-u5p6bxzo.js +1 -0
- package/_next/static/chunks/01atsfq_4opab.js +1 -0
- package/_next/static/chunks/0cx639tthxlz4.js +1 -0
- package/_next/static/chunks/0h2qsuyze9ds1.js +1 -0
- package/_next/static/chunks/0iqdztntvxh3c.js +119 -0
- package/_next/static/chunks/0iztd835j5p1n.js +700 -0
- package/_next/static/chunks/{2nxsyowmuwpjy.js → 0jfox92up1jvy.js} +1 -1
- package/_next/static/chunks/0jpa5m78l0ib0.js +1 -0
- package/_next/static/chunks/0kpstejrka-7k.js +1 -0
- package/_next/static/chunks/0n95joti2n2py.js +3 -0
- package/_next/static/chunks/0oaqe70syw_b5.js +1 -0
- package/_next/static/chunks/0ohleay4roayh.js +353 -0
- package/_next/static/chunks/0on1skx9l54-9.js +1 -0
- package/_next/static/chunks/0w_skktmh3e48.js +1 -0
- package/_next/static/chunks/0y-dctk-kmqss.js +1 -0
- package/_next/static/chunks/0yiqocv54ogoq.js +1 -0
- package/_next/static/chunks/0zlk2mlkvbtj1.js +1 -0
- package/_next/static/chunks/0zwc9m4qgtwle.js +1 -0
- package/_next/static/chunks/11awvgcou7v4r.js +1 -0
- package/_next/static/chunks/144mjqdrx42lq.js +1 -0
- package/_next/static/chunks/1d81m3g9jqkob.js +1 -0
- package/_next/static/chunks/1ed7ayfg19cjb.js +1 -0
- package/_next/static/chunks/1epya-yh2wvj2.js +1 -0
- package/_next/static/chunks/1exvcc71cgr4t.js +446 -0
- package/_next/static/chunks/1fzzb4jtgv5gg.js +9 -0
- package/_next/static/chunks/1g8fbzv0hu0i2.js +1 -0
- package/_next/static/chunks/1gaiqhzy_0d7s.js +1 -0
- package/_next/static/chunks/1gq4t2dyr7rq3.js +1 -0
- package/_next/static/chunks/1l-jew0-1-3eq.js +30 -0
- package/_next/static/chunks/1ptj3mv8b_tzs.js +1 -0
- package/_next/static/chunks/1w1xks0hp_tlr.js +346 -0
- package/_next/static/chunks/1xekc18cyi4sx.js +1 -0
- package/_next/static/chunks/1y35unwvy8p98.js +1 -0
- package/_next/static/chunks/2aq8orcir5h03.js +1 -0
- package/_next/static/chunks/2fdpvhx4oo81h.js +1 -0
- package/_next/static/chunks/2g-xpe7xnropn.js +409 -0
- package/_next/static/chunks/2kmptoy43h0mx.js +1 -0
- package/_next/static/chunks/2n86yq1wz1yx7.js +1 -0
- package/_next/static/chunks/2r_h93rt76vka.js +1 -0
- package/_next/static/chunks/2rebcvig176xk.js +564 -0
- package/_next/static/chunks/2w71oj1brox5z.js +1 -0
- package/_next/static/chunks/2wayx8t5r5fi9.js +1 -0
- package/_next/static/chunks/2y3d8zopa8r5r.css +3 -0
- package/_next/static/chunks/3--qzv1u6c7_7.js +1 -0
- package/_next/static/chunks/31lugryguappr.js +1 -0
- package/_next/static/chunks/32j_j396qs7be.js +1 -0
- package/_next/static/chunks/32yn_fc-es66m.js +22 -0
- package/_next/static/chunks/34_oyzp8_pi_m.js +1 -0
- package/_next/static/chunks/34wvn5zw0a69w.js +1 -0
- package/_next/static/chunks/37t6vg8fb1-z8.js +1 -0
- package/_next/static/chunks/3k5itcabq5oqs.js +9 -0
- package/_next/static/chunks/3ktj0iemsr1m-.js +1 -0
- package/_next/static/chunks/3nm7o0eq5abhg.js +1 -0
- package/_next/static/chunks/3s6nzrbk-8mnv.js +31 -0
- package/_next/static/chunks/3td9mnhvcj9cq.js +1 -0
- package/_next/static/chunks/3xjnsskh0tayo.js +1 -0
- package/_next/static/chunks/3zqx8h9yg5-ch.js +1 -0
- package/_next/static/chunks/turbopack-1h111qg8l92rw.js +1 -0
- package/_not-found/__next._full.txt +12 -12
- package/_not-found/__next._not-found.__PAGE__.txt +19 -2
- package/_not-found/__next._tree.txt +2 -2
- package/_not-found.html +1 -1
- package/_not-found.txt +12 -12
- package/boats/boats.json +40 -5
- package/index.html +1 -1
- package/index.txt +11 -11
- package/package.json +14 -14
- package/settings/__next._full.txt +14 -14
- package/settings/__next._tree.txt +2 -2
- package/settings/__next.settings.__PAGE__.txt +22 -5
- package/settings.html +1 -1
- package/settings.txt +14 -14
- package/__next._head.txt +0 -6
- package/__next._index.txt +0 -5
- package/_next/static/chunks/009rlietvsaq2.js +0 -1
- package/_next/static/chunks/070stlm97b9a2.js +0 -1
- package/_next/static/chunks/08gn5_gd6amkq.js +0 -1
- package/_next/static/chunks/0abo2oxxw3hpi.js +0 -1
- package/_next/static/chunks/0jzbiie0nzar2.js +0 -1
- package/_next/static/chunks/0l9s4rhr00adq.js +0 -1
- package/_next/static/chunks/0ri_um14-5x7u.js +0 -1
- package/_next/static/chunks/0utifqhyv2cuc.js +0 -1
- package/_next/static/chunks/0uvr7xkt_5uno.js +0 -1
- package/_next/static/chunks/0wzr1__so6xme.js +0 -1
- package/_next/static/chunks/0zjxnzbxh76mt.js +0 -1
- package/_next/static/chunks/11ln9lzzbo35q.js +0 -1
- package/_next/static/chunks/1bz0tcmhjmjgh.js +0 -1
- package/_next/static/chunks/1d4h-sglyo8ft.js +0 -1
- package/_next/static/chunks/1gizigk3w6q7j.js +0 -31
- package/_next/static/chunks/1porlo35ga4zu.js +0 -1
- package/_next/static/chunks/1ptwltjb3h6jf.js +0 -4
- package/_next/static/chunks/1sq_733weprvs.js +0 -1
- package/_next/static/chunks/1w1ua0-p5lk1e.js +0 -38
- package/_next/static/chunks/1wv5e5qomv-7g.css +0 -3
- package/_next/static/chunks/27hn45pv56pv7.js +0 -393
- package/_next/static/chunks/28y-j215vt42m.js +0 -1
- package/_next/static/chunks/29-ag86gvlc40.js +0 -9
- package/_next/static/chunks/2a0yjir_3mk1m.js +0 -1
- package/_next/static/chunks/2atijj_pkc4uc.js +0 -2
- package/_next/static/chunks/2baz6j1q913qw.js +0 -1
- package/_next/static/chunks/2ccpehidlaq88.js +0 -1
- package/_next/static/chunks/2lez3uww9j4t0.js +0 -135
- package/_next/static/chunks/2lvvt2f1l5sfu.js +0 -1
- package/_next/static/chunks/2nd5amcst4lhp.js +0 -1
- package/_next/static/chunks/2pwmb4pkqygy_.js +0 -1
- package/_next/static/chunks/2rsdqsatgq9ta.js +0 -1
- package/_next/static/chunks/2uao1hfsz-oy8.js +0 -1
- package/_next/static/chunks/2urimbxg5bqv3.js +0 -1
- package/_next/static/chunks/2yghvponatk1x.js +0 -135
- package/_next/static/chunks/31i14-jemhnic.js +0 -863
- package/_next/static/chunks/32cbrrsp-x35l.js +0 -1
- package/_next/static/chunks/36ra6xjie0dsv.js +0 -9
- package/_next/static/chunks/3dt63tw_9r0jt.js +0 -38
- package/_next/static/chunks/3iuz3f0429awx.js +0 -1
- package/_next/static/chunks/3jh1u-s3k0bkk.js +0 -1
- package/_next/static/chunks/3jupxlga7r_do.js +0 -1
- package/_next/static/chunks/3m57lnggu30tr.js +0 -243
- package/_next/static/chunks/3rhgquok36e79.js +0 -1
- package/_next/static/chunks/3sgrkzk20mxs6.js +0 -54
- package/_next/static/chunks/42dfiu6iby3fq.js +0 -1
- package/_next/static/chunks/43ps2cu5ahf8n.js +0 -3
- package/_next/static/chunks/turbopack-0pirmko-w-775.js +0 -1
- package/_not-found/__next._head.txt +0 -6
- package/_not-found/__next._index.txt +0 -5
- package/_not-found/__next._not-found.txt +0 -5
- package/boats/ais/ais-30.glb +0 -0
- package/boats/ais/ais-31.glb +0 -0
- package/boats/ais/ais-35.glb +0 -0
- package/boats/ais/ais-36.glb +0 -0
- package/boats/ais/ais-37.glb +0 -0
- package/boats/ais/ais-40.glb +0 -0
- package/boats/ais/ais-50.glb +0 -0
- package/boats/ais/ais-60.glb +0 -0
- package/boats/ais/ais-70.glb +0 -0
- package/boats/ais/ais-80.glb +0 -0
- package/settings/__next._head.txt +0 -6
- package/settings/__next._index.txt +0 -5
- package/settings/__next.settings.txt +0 -5
- /package/_next/static/{hlKDicTyNGfd7dmHqo5m5 → baa0rBM5TIECz8JV_tLT6}/_buildManifest.js +0 -0
- /package/_next/static/{hlKDicTyNGfd7dmHqo5m5 → baa0rBM5TIECz8JV_tLT6}/_clientMiddlewareManifest.js +0 -0
- /package/_next/static/{hlKDicTyNGfd7dmHqo5m5 → baa0rBM5TIECz8JV_tLT6}/_ssgManifest.js +0 -0
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,32189,(e,t,r)=>{"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},65156,(e,t,r)=>{"use strict";var a=e.r(32189);function n(){}function i(){}i.resetWarningCache=n,t.exports=function(){function e(e,t,r,n,i,o){if(o!==a){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:n};return r.PropTypes=r,r}},57384,(e,t,r)=>{t.exports=e.r(65156)()},84226,16196,e=>{"use strict";let t,r;var a=e.i(43476),n=e.i(71645),i=e.i(57384),o=e.i(67561),s=e.i(46991),l=e.i(85709),u=e.i(83402),f=e.i(90072),h=e.i(31067),d=f;function c(){var e=Object.create(null);function t(e,t){var r=void 0;self.troikaDefine=function(e){return r=e};var a=URL.createObjectURL(new Blob(["/** "+e.replace(/\*/g,"")+" **/\n\ntroikaDefine(\n"+t+"\n)"],{type:"application/javascript"}));try{importScripts(a)}catch(e){console.error(e)}return URL.revokeObjectURL(a),delete self.troikaDefine,r}self.addEventListener("message",function(r){var a=r.data,n=a.messageId,i=a.action,o=a.data;try{"registerModule"===i&&function r(a,n){var i=a.id,o=a.name,s=a.dependencies;void 0===s&&(s=[]);var l=a.init;void 0===l&&(l=function(){});var u=a.getTransferables;if(void 0===u&&(u=null),!e[i])try{s=s.map(function(t){return t&&t.isWorkerModule&&(r(t,function(e){if(e instanceof Error)throw e}),t=e[t.id].value),t}),l=t("<"+o+">.init",l),u&&(u=t("<"+o+">.getTransferables",u));var f=null;"function"==typeof l?f=l.apply(void 0,s):console.error("worker module init function failed to rehydrate"),e[i]={id:i,value:f,getTransferables:u},n(f)}catch(e){e&&e.noLog||console.error(e),n(e)}}(o,function(e){e instanceof Error?postMessage({messageId:n,success:!1,error:e.message}):postMessage({messageId:n,success:!0,result:{isCallable:"function"==typeof e}})}),"callModule"===i&&function(t,r){var a,n=t.id,i=t.args;e[n]&&"function"==typeof e[n].value||r(Error("Worker module "+n+": not found or its 'init' did not return a function"));try{var o=(a=e[n]).value.apply(a,i);o&&"function"==typeof o.then?o.then(s,function(e){return r(e instanceof Error?e:Error(""+e))}):s(o)}catch(e){r(e)}function s(t){try{var a=e[n].getTransferables&&e[n].getTransferables(t);a&&Array.isArray(a)&&a.length||(a=void 0),r(t,a)}catch(e){console.error(e),r(e)}}}(o,function(e,t){e instanceof Error?postMessage({messageId:n,success:!1,error:e.message}):postMessage({messageId:n,success:!0,result:e},t||void 0)})}catch(e){postMessage({messageId:n,success:!1,error:e.stack})}})}e.i(47167);var v=function(){var e=!1;if("u">typeof window&&void 0!==window.document)try{new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"}))).terminate(),e=!0}catch(e){console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+e.message+"]")}return v=function(){return e},e},p=0,g=0,m=!1,y=Object.create(null),b=Object.create(null),x=Object.create(null);function S(e){if((!e||"function"!=typeof e.init)&&!m)throw Error("requires `options.init` function");var t,r=e.dependencies,a=e.init,n=e.getTransferables,i=e.workerId,o=((t=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return t._getInitResult().then(function(t){if("function"==typeof t)return t.apply(void 0,e);throw Error("Worker module function was called but `init` did not return a callable function")})})._getInitResult=function(){var r=e.dependencies,a=e.init,n=Promise.all(r=Array.isArray(r)?r.map(function(e){return e&&(e=e.onMainThread||e)._getInitResult&&(e=e._getInitResult()),e}):[]).then(function(e){return a.apply(null,e)});return t._getInitResult=function(){return n},n},t);null==i&&(i="#default");var s="workerModule"+ ++p,l=e.name||s,u=null;function f(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(!v())return o.apply(void 0,e);if(!u){u=T(i,"registerModule",f.workerModuleData);var r=function(){u=null,b[i].delete(r)};(b[i]||(b[i]=new Set)).add(r)}return u.then(function(t){if(t.isCallable)return T(i,"callModule",{id:s,args:e});throw Error("Worker module function was called but `init` did not return a callable function")})}return r=r&&r.map(function(e){return"function"!=typeof e||e.workerModuleData||(m=!0,e=S({workerId:i,name:"<"+l+"> function dependency: "+e.name,init:"function(){return (\n"+U(e)+"\n)}"}),m=!1),e&&e.workerModuleData&&(e=e.workerModuleData),e}),f.workerModuleData={isWorkerModule:!0,id:s,name:l,dependencies:r,init:U(a),getTransferables:n&&U(n)},f.onMainThread=o,f}function U(e){var t=e.toString();return!/^function/.test(t)&&/^\w+\s*\(/.test(t)&&(t="function "+t),t}function T(e,t,r){return new Promise(function(a,n){var i=++g;x[i]=function(e){e.success?a(e.result):n(Error("Error in worker "+t+" call: "+e.error))},(function(e){var t=y[e];if(!t){var r=U(c);(t=y[e]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+e.replace(/\*/g,"")+" **/\n\n;("+r+")()"],{type:"application/javascript"})))).onmessage=function(e){var t=e.data,r=t.messageId,a=x[r];if(!a)throw Error("WorkerModule response with empty or unknown messageId");delete x[r],a(t)}}return t})(e).postMessage({messageId:i,action:t,data:r})})}function k(){return function(e){function t(e,t){for(var r,a,n,i,o,s=/([MLQCZ])([^MLQCZ]*)/g;r=s.exec(e);){var l=r[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(e){return parseFloat(e)});switch(r[1]){case"M":i=a=l[0],o=n=l[1];break;case"L":(l[0]!==i||l[1]!==o)&&t("L",i,o,i=l[0],o=l[1]);break;case"Q":t("Q",i,o,i=l[2],o=l[3],l[0],l[1]);break;case"C":t("C",i,o,i=l[4],o=l[5],l[0],l[1],l[2],l[3]);break;case"Z":(i!==a||o!==n)&&t("L",i,o,a,n)}}}function r(e,r,a){void 0===a&&(a=16);var n={x:0,y:0};t(e,function(e,t,i,o,s,l,u,f,h){switch(e){case"L":r(t,i,o,s);break;case"Q":for(var d=t,c=i,v=1;v<a;v++)!function(e,t,r,a,n,i,o,s){var l=1-o;s.x=l*l*e+2*l*o*r+o*o*n,s.y=l*l*t+2*l*o*a+o*o*i}(t,i,l,u,o,s,v/(a-1),n),r(d,c,n.x,n.y),d=n.x,c=n.y;break;case"C":for(var p=t,g=i,m=1;m<a;m++)!function(e,t,r,a,n,i,o,s,l,u){var f=1-l;u.x=f*f*f*e+3*f*f*l*r+3*f*l*l*n+l*l*l*o,u.y=f*f*f*t+3*f*f*l*a+3*f*l*l*i+l*l*l*s}(t,i,l,u,f,h,o,s,m/(a-1),n),r(p,g,n.x,n.y),p=n.x,g=n.y}})}var a="precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",n=new WeakMap,i={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function o(e,t){var r=e.getContext?e.getContext("webgl",i):e,a=n.get(r);if(!a){var o="u">typeof WebGL2RenderingContext&&r instanceof WebGL2RenderingContext,s={},l={},u={},f=-1,h=[];function d(e){var t=s[e];if(!t&&!(t=s[e]=r.getExtension(e)))throw Error(e+" not supported");return t}function c(e,t){var a=r.createShader(t);return r.shaderSource(a,e),r.compileShader(a),a}function v(){s={},l={},u={},f=-1,h.length=0}r.canvas.addEventListener("webglcontextlost",function(e){v(),e.preventDefault()},!1),n.set(r,a={gl:r,isWebGL2:o,getExtension:d,withProgram:function(e,t,a,n){if(!l[e]){var i={},s={},u=r.createProgram();r.attachShader(u,c(t,r.VERTEX_SHADER)),r.attachShader(u,c(a,r.FRAGMENT_SHADER)),r.linkProgram(u),l[e]={program:u,transaction:function(e){r.useProgram(u),e({setUniform:function(e,t){for(var a=[],n=arguments.length-2;n-- >0;)a[n]=arguments[n+2];var i=s[t]||(s[t]=r.getUniformLocation(u,t));r["uniform"+e].apply(r,[i].concat(a))},setAttribute:function(e,t,a,n,s){var l=i[e];l||(l=i[e]={buf:r.createBuffer(),loc:r.getAttribLocation(u,e),data:null}),r.bindBuffer(r.ARRAY_BUFFER,l.buf),r.vertexAttribPointer(l.loc,t,r.FLOAT,!1,0,0),r.enableVertexAttribArray(l.loc),o?r.vertexAttribDivisor(l.loc,n):d("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(l.loc,n),s!==l.data&&(r.bufferData(r.ARRAY_BUFFER,s,a),l.data=s)}})}}}l[e].transaction(n)},withTexture:function(e,t){f++;try{r.activeTexture(r.TEXTURE0+f);var a=u[e];a||(a=u[e]=r.createTexture(),r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST)),r.bindTexture(r.TEXTURE_2D,a),t(a,f)}finally{f--}},withTextureFramebuffer:function(e,t,a){var n=r.createFramebuffer();h.push(n),r.bindFramebuffer(r.FRAMEBUFFER,n),r.activeTexture(r.TEXTURE0+t),r.bindTexture(r.TEXTURE_2D,e),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0);try{a(n)}finally{r.deleteFramebuffer(n),r.bindFramebuffer(r.FRAMEBUFFER,h[--h.length-1]||null)}},handleContextLoss:v})}t(a)}function s(e,t,r,n,i,s,l,u){void 0===l&&(l=15),void 0===u&&(u=null),o(e,function(e){var o=e.gl,f=e.withProgram;(0,e.withTexture)("copy",function(e,h){o.texImage2D(o.TEXTURE_2D,0,o.RGBA,i,s,0,o.RGBA,o.UNSIGNED_BYTE,t),f("copy",a,"precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",function(e){var t=e.setUniform;(0,e.setAttribute)("aUV",2,o.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),t("1i","image",h),o.bindFramebuffer(o.FRAMEBUFFER,u||null),o.disable(o.BLEND),o.colorMask(8&l,4&l,2&l,1&l),o.viewport(r,n,i,s),o.scissor(r,n,i,s),o.drawArrays(o.TRIANGLES,0,3)})})})}var l=Object.freeze({__proto__:null,withWebGLContext:o,renderImageData:s,resizeWebGLCanvasWithoutClearing:function(e,t,r){var a=e.width,n=e.height;o(e,function(i){var o=i.gl,l=new Uint8Array(a*n*4);o.readPixels(0,0,a,n,o.RGBA,o.UNSIGNED_BYTE,l),e.width=t,e.height=r,s(o,l,0,0,a,n)})}});function u(e,t,a,n,i,o){void 0===o&&(o=1);var s=new Uint8Array(e*t),l=n[2]-n[0],u=n[3]-n[1],f=[];r(a,function(e,t,r,a){f.push({x1:e,y1:t,x2:r,y2:a,minX:Math.min(e,r),minY:Math.min(t,a),maxX:Math.max(e,r),maxY:Math.max(t,a)})}),f.sort(function(e,t){return e.maxX-t.maxX});for(var h=0;h<e;h++)for(var d=0;d<t;d++){var c=function(e,t){for(var r=1/0,a=1/0,n=f.length;n--;){var i=f[n];if(i.maxX+a<=e)break;if(e+a>i.minX&&t-a<i.maxY&&t+a>i.minY){var o=function(e,t,r,a,n,i){var o=n-r,s=i-a,l=o*o+s*s,u=l?Math.max(0,Math.min(1,((e-r)*o+(t-a)*s)/l)):0,f=e-(r+u*o),h=t-(a+u*s);return f*f+h*h}(e,t,i.x1,i.y1,i.x2,i.y2);o<r&&(a=Math.sqrt(r=o))}}return function(e,t){for(var r=0,a=f.length;a--;){var n=f[a];if(n.maxX<=e)break;n.y1>t!=n.y2>t&&e<(n.x2-n.x1)*(t-n.y1)/(n.y2-n.y1)+n.x1&&(r+=n.y1<n.y2?1:-1)}return 0!==r}(e,t)&&(a=-a),a}(n[0]+l*(h+.5)/e,n[1]+u*(d+.5)/t),v=Math.pow(1-Math.abs(c)/i,o)/2;c<0&&(v=1-v),v=Math.max(0,Math.min(255,Math.round(255*v))),s[d*e+h]=v}return s}function f(e,t,r,a,n,i,o,s,l,u){void 0===i&&(i=1),void 0===s&&(s=0),void 0===l&&(l=0),void 0===u&&(u=0),h(e,t,r,a,n,i,o,null,s,l,u)}function h(e,t,r,a,n,i,o,l,f,h,d){void 0===i&&(i=1),void 0===f&&(f=0),void 0===h&&(h=0),void 0===d&&(d=0);for(var c=u(e,t,r,a,n,i),v=new Uint8Array(4*c.length),p=0;p<c.length;p++)v[4*p+d]=c[p];s(o,v,f,h,e,t,1<<3-d,l)}var d=Object.freeze({__proto__:null,generate:u,generateIntoCanvas:f,generateIntoFramebuffer:h}),c=new Float32Array([0,0,2,0,0,2]),v=null,p=!1,g={},m=new WeakMap;function y(e){if(!p&&!U(e))throw Error("WebGL generation not supported")}function b(e,t,r,a,n,i,s){if(void 0===i&&(i=1),void 0===s&&(s=null),!s&&!(s=v)){var l="function"==typeof OffscreenCanvas?new OffscreenCanvas(1,1):"u">typeof document?document.createElement("canvas"):null;if(!l)throw Error("OffscreenCanvas or DOM canvas not supported");s=v=l.getContext("webgl",{depth:!1})}y(s);var u=new Uint8Array(e*t*4);o(s,function(o){var s=o.gl,l=o.withTexture,f=o.withTextureFramebuffer;l("readable",function(o,l){s.texImage2D(s.TEXTURE_2D,0,s.RGBA,e,t,0,s.RGBA,s.UNSIGNED_BYTE,null),f(o,l,function(o){S(e,t,r,a,n,i,s,o,0,0,0),s.readPixels(0,0,e,t,s.RGBA,s.UNSIGNED_BYTE,u)})})});for(var f=new Uint8Array(e*t),h=0,d=0;h<u.length;h+=4)f[d++]=u[h];return f}function x(e,t,r,a,n,i,o,s,l,u){void 0===i&&(i=1),void 0===s&&(s=0),void 0===l&&(l=0),void 0===u&&(u=0),S(e,t,r,a,n,i,o,null,s,l,u)}function S(e,t,n,i,s,l,u,f,h,d,v){void 0===l&&(l=1),void 0===h&&(h=0),void 0===d&&(d=0),void 0===v&&(v=0),y(u);var p=[];r(n,function(e,t,r,a){p.push(e,t,r,a)}),p=new Float32Array(p),o(u,function(r){var n=r.gl,o=r.isWebGL2,u=r.getExtension,g=r.withProgram,m=r.withTexture,y=r.withTextureFramebuffer,b=r.handleContextLoss;if(m("rawDistances",function(r,m){(e!==r._lastWidth||t!==r._lastHeight)&&n.texImage2D(n.TEXTURE_2D,0,n.RGBA,r._lastWidth=e,r._lastHeight=t,0,n.RGBA,n.UNSIGNED_BYTE,null),g("main","precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}","precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}",function(a){var f=a.setAttribute,h=a.setUniform,d=!o&&u("ANGLE_instanced_arrays"),v=!o&&u("EXT_blend_minmax");f("aUV",2,n.STATIC_DRAW,0,c),f("aLineSegment",4,n.DYNAMIC_DRAW,1,p),h.apply(void 0,["4f","uGlyphBounds"].concat(i)),h("1f","uMaxDistance",s),h("1f","uExponent",l),y(r,m,function(r){n.enable(n.BLEND),n.colorMask(!0,!0,!0,!0),n.viewport(0,0,e,t),n.scissor(0,0,e,t),n.blendFunc(n.ONE,n.ONE),n.blendEquationSeparate(n.FUNC_ADD,o?n.MAX:v.MAX_EXT),n.clear(n.COLOR_BUFFER_BIT),o?n.drawArraysInstanced(n.TRIANGLES,0,3,p.length/4):d.drawArraysInstancedANGLE(n.TRIANGLES,0,3,p.length/4)})}),g("post",a,"precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}",function(r){r.setAttribute("aUV",2,n.STATIC_DRAW,0,c),r.setUniform("1i","tex",m),n.bindFramebuffer(n.FRAMEBUFFER,f),n.disable(n.BLEND),n.colorMask(0===v,1===v,2===v,3===v),n.viewport(h,d,e,t),n.scissor(h,d,e,t),n.drawArrays(n.TRIANGLES,0,3)})}),n.isContextLost())throw b(),Error("webgl context lost")})}function U(e){var t=e&&e!==v?e.canvas||e:g,r=m.get(t);if(void 0===r){p=!0;var a=null;try{var n=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],i=b(4,4,"M8,8L16,8L24,24L16,24Z",[0,0,32,32],24,1,e);(r=i&&n.length===i.length&&i.every(function(e,t){return e===n[t]}))||(a="bad trial run results",console.info(n,i))}catch(e){r=!1,a=e.message}a&&console.warn("WebGL SDF generation not supported:",a),p=!1,m.set(t,r)}return r}var T=Object.freeze({__proto__:null,generate:b,generateIntoCanvas:x,generateIntoFramebuffer:S,isSupported:U});return e.forEachPathCommand=t,e.generate=function(e,t,r,a,n,i){void 0===n&&(n=Math.max(a[2]-a[0],a[3]-a[1])/2),void 0===i&&(i=1);try{return b.apply(T,arguments)}catch(e){return console.info("WebGL SDF generation failed, falling back to JS",e),u.apply(d,arguments)}},e.generateIntoCanvas=function(e,t,r,a,n,i,o,s,l,u){void 0===n&&(n=Math.max(a[2]-a[0],a[3]-a[1])/2),void 0===i&&(i=1),void 0===s&&(s=0),void 0===l&&(l=0),void 0===u&&(u=0);try{return x.apply(T,arguments)}catch(e){return console.info("WebGL SDF generation failed, falling back to JS",e),f.apply(d,arguments)}},e.javascript=d,e.pathToLineSegments=r,e.webgl=T,e.webglUtils=l,Object.defineProperty(e,"__esModule",{value:!0}),e}({})}var w=e.i(8560),_=f;let C=/\bvoid\s+main\s*\(\s*\)\s*{/g;function F(e){return e.replace(/^[ \t]*#include +<([\w\d./]+)>/gm,function(e,t){let r=w.ShaderChunk[t];return r?F(r):e})}let D=[];for(let e=0;e<256;e++)D[e]=(e<16?"0":"")+e.toString(16);let M=Object.assign||function(){let e=arguments[0];for(let t=1,r=arguments.length;t<r;t++){let r=arguments[t];if(r)for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},A=Date.now(),E=new WeakMap,I=new Map,R=1e10;function P(e,t){let r,a,n=(r=JSON.stringify(t,G),null==(a=L.get(r))&&L.set(r,a=++B),a),i=E.get(e);if(i||E.set(e,i=Object.create(null)),i[n])return new i[n];let o=`_onBeforeCompile${n}`,s=function(r,a){e.onBeforeCompile.call(this,r,a);let i=this.customProgramCacheKey()+"|"+r.vertexShader+"|"+r.fragmentShader,s=I[i];if(!s){let e=function(e,{vertexShader:t,fragmentShader:r},a,n){let{vertexDefs:i,vertexMainIntro:o,vertexMainOutro:s,vertexTransform:l,fragmentDefs:u,fragmentMainIntro:f,fragmentMainOutro:h,fragmentColorTransform:d,customRewriter:c,timeUniform:v}=a;if(i=i||"",o=o||"",s=s||"",u=u||"",f=f||"",h=h||"",(l||c)&&(t=F(t)),(d||c)&&(r=F(r=r.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm,"\n//!BEGIN_POST_CHUNK $1\n$&\n//!END_POST_CHUNK\n"))),c){let e=c({vertexShader:t,fragmentShader:r});t=e.vertexShader,r=e.fragmentShader}if(d){let e=[];r=r.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,t=>(e.push(t),"")),h=`${d}
|
|
2
|
-
${e.join("\n")}
|
|
3
|
-
${h}`}if(v){let e=`
|
|
4
|
-
uniform float ${v};
|
|
5
|
-
`;i=e+i,u=e+u}return l&&(t=`vec3 troika_position_${n};
|
|
6
|
-
vec3 troika_normal_${n};
|
|
7
|
-
vec2 troika_uv_${n};
|
|
8
|
-
${t}
|
|
9
|
-
`,i=`${i}
|
|
10
|
-
void troikaVertexTransform${n}(inout vec3 position, inout vec3 normal, inout vec2 uv) {
|
|
11
|
-
${l}
|
|
12
|
-
}
|
|
13
|
-
`,o=`
|
|
14
|
-
troika_position_${n} = vec3(position);
|
|
15
|
-
troika_normal_${n} = vec3(normal);
|
|
16
|
-
troika_uv_${n} = vec2(uv);
|
|
17
|
-
troikaVertexTransform${n}(troika_position_${n}, troika_normal_${n}, troika_uv_${n});
|
|
18
|
-
${o}
|
|
19
|
-
`,t=t.replace(/\b(position|normal|uv)\b/g,(e,t,r,a)=>/\battribute\s+vec[23]\s+$/.test(a.substr(0,r))?t:`troika_${t}_${n}`),e.map&&e.map.channel>0||(t=t.replace(/\bMAP_UV\b/g,`troika_uv_${n}`))),{vertexShader:t=O(t,n,i,o,s),fragmentShader:r=O(r,n,u,f,h)}}(this,r,t,n);s=I[i]=e}r.vertexShader=s.vertexShader,r.fragmentShader=s.fragmentShader,M(r.uniforms,this.uniforms),t.timeUniform&&(r.uniforms[t.timeUniform]={get value(){return Date.now()-A}}),this[o]&&this[o](r)},l=function(){return u(t.chained?e:e.clone())},u=function(r){let a,i,o,s,l=Object.create(r,f);return Object.defineProperty(l,"baseMaterial",{value:e}),Object.defineProperty(l,"id",{value:R++}),a=0xffffffff*Math.random()|0,i=0xffffffff*Math.random()|0,o=0xffffffff*Math.random()|0,s=0xffffffff*Math.random()|0,l.uuid=(D[255&a]+D[a>>8&255]+D[a>>16&255]+D[a>>24&255]+"-"+D[255&i]+D[i>>8&255]+"-"+D[i>>16&15|64]+D[i>>24&255]+"-"+D[63&o|128]+D[o>>8&255]+"-"+D[o>>16&255]+D[o>>24&255]+D[255&s]+D[s>>8&255]+D[s>>16&255]+D[s>>24&255]).toUpperCase(),l.uniforms=M({},r.uniforms,t.uniforms),l.defines=M({},r.defines,t.defines),l.defines[`TROIKA_DERIVED_MATERIAL_${n}`]="",l.extensions=M({},r.extensions,t.extensions),l._listeners=void 0,l},f={constructor:{value:l},isDerivedMaterial:{value:!0},type:{get:()=>e.type,set:t=>{e.type=t}},isDerivedFrom:{writable:!0,configurable:!0,value:function(e){let t=this.baseMaterial;return e===t||t.isDerivedMaterial&&t.isDerivedFrom(e)||!1}},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return e.customProgramCacheKey()+"|"+n}},onBeforeCompile:{get:()=>s,set(e){this[o]=e}},copy:{writable:!0,configurable:!0,value:function(t){return e.copy.call(this,t),e.isShaderMaterial||e.isDerivedMaterial||(M(this.extensions,t.extensions),M(this.defines,t.defines),M(this.uniforms,_.UniformsUtils.clone(t.uniforms))),this}},clone:{writable:!0,configurable:!0,value:function(){return u(new e.constructor).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let r=this._depthMaterial;return r||((r=this._depthMaterial=P(e.isDerivedMaterial?e.getDepthMaterial():new _.MeshDepthMaterial({depthPacking:_.RGBADepthPacking}),t)).defines.IS_DEPTH_MATERIAL="",r.uniforms=this.uniforms),r}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let r=this._distanceMaterial;return r||((r=this._distanceMaterial=P(e.isDerivedMaterial?e.getDistanceMaterial():new _.MeshDistanceMaterial,t)).defines.IS_DISTANCE_MATERIAL="",r.uniforms=this.uniforms),r}},dispose:{writable:!0,configurable:!0,value(){let{_depthMaterial:t,_distanceMaterial:r}=this;t&&t.dispose(),r&&r.dispose(),e.dispose.call(this)}}};return i[n]=l,new l}function O(e,t,r,a,n){return(a||n||r)&&(e=e.replace(C,`
|
|
20
|
-
${r}
|
|
21
|
-
void troikaOrigMain${t}() {`)+`
|
|
22
|
-
void main() {
|
|
23
|
-
${a}
|
|
24
|
-
troikaOrigMain${t}();
|
|
25
|
-
${n}
|
|
26
|
-
}`),e}function G(e,t){return"uniforms"===e?void 0:"function"==typeof t?t.toString():t}let B=0,L=new Map,z=`
|
|
27
|
-
uniform vec3 pointA;
|
|
28
|
-
uniform vec3 controlA;
|
|
29
|
-
uniform vec3 controlB;
|
|
30
|
-
uniform vec3 pointB;
|
|
31
|
-
uniform float radius;
|
|
32
|
-
varying float bezierT;
|
|
33
|
-
|
|
34
|
-
vec3 cubicBezier(vec3 p1, vec3 c1, vec3 c2, vec3 p2, float t) {
|
|
35
|
-
float t2 = 1.0 - t;
|
|
36
|
-
float b0 = t2 * t2 * t2;
|
|
37
|
-
float b1 = 3.0 * t * t2 * t2;
|
|
38
|
-
float b2 = 3.0 * t * t * t2;
|
|
39
|
-
float b3 = t * t * t;
|
|
40
|
-
return b0 * p1 + b1 * c1 + b2 * c2 + b3 * p2;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
vec3 cubicBezierDerivative(vec3 p1, vec3 c1, vec3 c2, vec3 p2, float t) {
|
|
44
|
-
float t2 = 1.0 - t;
|
|
45
|
-
return -3.0 * p1 * t2 * t2 +
|
|
46
|
-
c1 * (3.0 * t2 * t2 - 6.0 * t2 * t) +
|
|
47
|
-
c2 * (6.0 * t2 * t - 3.0 * t * t) +
|
|
48
|
-
3.0 * p2 * t * t;
|
|
49
|
-
}
|
|
50
|
-
`,W=`
|
|
51
|
-
float t = position.y;
|
|
52
|
-
bezierT = t;
|
|
53
|
-
vec3 bezierCenterPos = cubicBezier(pointA, controlA, controlB, pointB, t);
|
|
54
|
-
vec3 bezierDir = normalize(cubicBezierDerivative(pointA, controlA, controlB, pointB, t));
|
|
55
|
-
|
|
56
|
-
// Make "sideways" always perpendicular to the camera ray; this ensures that any twists
|
|
57
|
-
// in the cylinder occur where you won't see them:
|
|
58
|
-
vec3 viewDirection = normalMatrix * vec3(0.0, 0.0, 1.0);
|
|
59
|
-
if (bezierDir == viewDirection) {
|
|
60
|
-
bezierDir = normalize(cubicBezierDerivative(pointA, controlA, controlB, pointB, t == 1.0 ? t - 0.0001 : t + 0.0001));
|
|
61
|
-
}
|
|
62
|
-
vec3 sideways = normalize(cross(bezierDir, viewDirection));
|
|
63
|
-
vec3 upish = normalize(cross(sideways, bezierDir));
|
|
64
|
-
|
|
65
|
-
// Build a matrix for transforming this disc in the cylinder:
|
|
66
|
-
mat4 discTx;
|
|
67
|
-
discTx[0].xyz = sideways * radius;
|
|
68
|
-
discTx[1].xyz = bezierDir * radius;
|
|
69
|
-
discTx[2].xyz = upish * radius;
|
|
70
|
-
discTx[3].xyz = bezierCenterPos;
|
|
71
|
-
discTx[3][3] = 1.0;
|
|
72
|
-
|
|
73
|
-
// Apply transform, ignoring original y
|
|
74
|
-
position = (discTx * vec4(position.x, 0.0, position.z, 1.0)).xyz;
|
|
75
|
-
normal = normalize(mat3(discTx) * normal);
|
|
76
|
-
`,j=`
|
|
77
|
-
uniform vec3 dashing;
|
|
78
|
-
varying float bezierT;
|
|
79
|
-
`,V=`
|
|
80
|
-
if (dashing.x + dashing.y > 0.0) {
|
|
81
|
-
float dashFrac = mod(bezierT - dashing.z, dashing.x + dashing.y);
|
|
82
|
-
if (dashFrac > dashing.x) {
|
|
83
|
-
discard;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
`,N=null,q=new _.MeshStandardMaterial({color:0xffffff,side:_.DoubleSide});class X extends _.Mesh{static getGeometry(){return N||(N=new _.CylinderGeometry(1,1,1,6,64).translate(0,.5,0))}constructor(){super(X.getGeometry(),q),this.pointA=new _.Vector3,this.controlA=new _.Vector3,this.controlB=new _.Vector3,this.pointB=new _.Vector3,this.radius=.01,this.dashArray=new _.Vector2,this.dashOffset=0,this.frustumCulled=!1}get material(){let e=this._derivedMaterial,t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=q.clone());return e&&e.baseMaterial===t||(e=this._derivedMaterial=P(t,{chained:!0,uniforms:{pointA:{value:new _.Vector3},controlA:{value:new _.Vector3},controlB:{value:new _.Vector3},pointB:{value:new _.Vector3},radius:{value:.01},dashing:{value:new _.Vector3}},vertexDefs:z,vertexTransform:W,fragmentDefs:j,fragmentMainIntro:V}),t.addEventListener("dispose",function r(){t.removeEventListener("dispose",r),e.dispose()})),e}set material(e){this._baseMaterial=e}get customDepthMaterial(){return this.material.getDepthMaterial()}set customDepthMaterial(e){}get customDistanceMaterial(){return this.material.getDistanceMaterial()}set customDistanceMaterial(e){}onBeforeRender(){let{uniforms:e}=this.material,{pointA:t,controlA:r,controlB:a,pointB:n,radius:i,dashArray:o,dashOffset:s}=this;e.pointA.value.copy(t),e.controlA.value.copy(r),e.controlB.value.copy(a),e.pointB.value.copy(n),e.radius.value=i,e.dashing.value.set(o.x,o.y,s||0)}raycast(){}}let $=S({name:"Typr Font Parser",dependencies:[function(){var e,t,r;return"u"<typeof window&&(self.window=self),(e={},(t={parse:function(e){var r=t._bin,a=new Uint8Array(e);if("ttcf"==r.readASCII(a,0,4)){var n=4;r.readUshort(a,n),n+=2,r.readUshort(a,n),n+=2;var i=r.readUint(a,n);n+=4;for(var o=[],s=0;s<i;s++){var l=r.readUint(a,n);n+=4,o.push(t._readFont(a,l))}return o}return[t._readFont(a,0)]},_readFont:function(e,r){var a=t._bin,n=r;a.readFixed(e,r),r+=4;var i=a.readUshort(e,r);r+=2,a.readUshort(e,r),r+=2,a.readUshort(e,r),r+=2,a.readUshort(e,r),r+=2;for(var o=["cmap","head","hhea","maxp","hmtx","name","OS/2","post","loca","glyf","kern","CFF ","GDEF","GPOS","GSUB","SVG "],s={_data:e,_offset:n},l={},u=0;u<i;u++){var f=a.readASCII(e,r,4);r+=4,a.readUint(e,r),r+=4;var h=a.readUint(e,r);r+=4;var d=a.readUint(e,r);r+=4,l[f]={offset:h,length:d}}for(u=0;u<o.length;u++){var c=o[u];l[c]&&(s[c.trim()]=t[c.trim()].parse(e,l[c].offset,l[c].length,s))}return s},_tabOffset:function(e,r,a){for(var n=t._bin,i=n.readUshort(e,a+4),o=a+12,s=0;s<i;s++){var l=n.readASCII(e,o,4);o+=4,n.readUint(e,o),o+=4;var u=n.readUint(e,o);if(o+=4,n.readUint(e,o),o+=4,l==r)return u}return 0}})._bin={readFixed:function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<8|e[t+3])/65540},readF2dot14:function(e,r){return t._bin.readShort(e,r)/16384},readInt:function(e,r){return t._bin._view(e).getInt32(r)},readInt8:function(e,r){return t._bin._view(e).getInt8(r)},readShort:function(e,r){return t._bin._view(e).getInt16(r)},readUshort:function(e,r){return t._bin._view(e).getUint16(r)},readUshorts:function(e,r,a){for(var n=[],i=0;i<a;i++)n.push(t._bin.readUshort(e,r+2*i));return n},readUint:function(e,r){return t._bin._view(e).getUint32(r)},readUint64:function(e,r){return 0x100000000*t._bin.readUint(e,r)+t._bin.readUint(e,r+4)},readASCII:function(e,t,r){for(var a="",n=0;n<r;n++)a+=String.fromCharCode(e[t+n]);return a},readUnicode:function(e,t,r){for(var a="",n=0;n<r;n++)a+=String.fromCharCode(e[t++]<<8|e[t++]);return a},_tdec:"u">typeof window&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(e,r,a){var n=t._bin._tdec;return n&&0==r&&a==e.length?n.decode(e):t._bin.readASCII(e,r,a)},readBytes:function(e,t,r){for(var a=[],n=0;n<r;n++)a.push(e[t+n]);return a},readASCIIArray:function(e,t,r){for(var a=[],n=0;n<r;n++)a.push(String.fromCharCode(e[t+n]));return a},_view:function(e){return e._dataView||(e._dataView=e.buffer?new DataView(e.buffer,e.byteOffset,e.byteLength):new DataView(new Uint8Array(e).buffer))}},t._lctf={},t._lctf.parse=function(e,r,a,n,i){var o=t._bin,s={},l=r;o.readFixed(e,r),r+=4;var u=o.readUshort(e,r);r+=2;var f=o.readUshort(e,r);r+=2;var h=o.readUshort(e,r);return r+=2,s.scriptList=t._lctf.readScriptList(e,l+u),s.featureList=t._lctf.readFeatureList(e,l+f),s.lookupList=t._lctf.readLookupList(e,l+h,i),s},t._lctf.readLookupList=function(e,r,a){var n=t._bin,i=r,o=[],s=n.readUshort(e,r);r+=2;for(var l=0;l<s;l++){var u=n.readUshort(e,r);r+=2;var f=t._lctf.readLookupTable(e,i+u,a);o.push(f)}return o},t._lctf.readLookupTable=function(e,r,a){var n=t._bin,i=r,o={tabs:[]};o.ltype=n.readUshort(e,r),r+=2,o.flag=n.readUshort(e,r),r+=2;var s=n.readUshort(e,r);r+=2;for(var l=o.ltype,u=0;u<s;u++){var f=n.readUshort(e,r);r+=2;var h=a(e,l,i+f,o);o.tabs.push(h)}return o},t._lctf.numOfOnes=function(e){for(var t=0,r=0;r<32;r++)0!=(e>>>r&1)&&t++;return t},t._lctf.readClassDef=function(e,r){var a=t._bin,n=[],i=a.readUshort(e,r);if(r+=2,1==i){var o=a.readUshort(e,r);r+=2;var s=a.readUshort(e,r);r+=2;for(var l=0;l<s;l++)n.push(o+l),n.push(o+l),n.push(a.readUshort(e,r)),r+=2}if(2==i){var u=a.readUshort(e,r);for(r+=2,l=0;l<u;l++)n.push(a.readUshort(e,r)),r+=2,n.push(a.readUshort(e,r)),r+=2,n.push(a.readUshort(e,r)),r+=2}return n},t._lctf.getInterval=function(e,t){for(var r=0;r<e.length;r+=3){var a=e[r],n=e[r+1];if(e[r+2],a<=t&&t<=n)return r}return -1},t._lctf.readCoverage=function(e,r){var a=t._bin,n={};n.fmt=a.readUshort(e,r),r+=2;var i=a.readUshort(e,r);return r+=2,1==n.fmt&&(n.tab=a.readUshorts(e,r,i)),2==n.fmt&&(n.tab=a.readUshorts(e,r,3*i)),n},t._lctf.coverageIndex=function(e,r){var a=e.tab;if(1==e.fmt)return a.indexOf(r);if(2==e.fmt){var n=t._lctf.getInterval(a,r);if(-1!=n)return a[n+2]+(r-a[n])}return -1},t._lctf.readFeatureList=function(e,r){var a=t._bin,n=r,i=[],o=a.readUshort(e,r);r+=2;for(var s=0;s<o;s++){var l=a.readASCII(e,r,4);r+=4;var u=a.readUshort(e,r);r+=2;var f=t._lctf.readFeatureTable(e,n+u);f.tag=l.trim(),i.push(f)}return i},t._lctf.readFeatureTable=function(e,r){var a=t._bin,n=r,i={},o=a.readUshort(e,r);r+=2,o>0&&(i.featureParams=n+o);var s=a.readUshort(e,r);r+=2,i.tab=[];for(var l=0;l<s;l++)i.tab.push(a.readUshort(e,r+2*l));return i},t._lctf.readScriptList=function(e,r){var a=t._bin,n=r,i={},o=a.readUshort(e,r);r+=2;for(var s=0;s<o;s++){var l=a.readASCII(e,r,4);r+=4;var u=a.readUshort(e,r);r+=2,i[l.trim()]=t._lctf.readScriptTable(e,n+u)}return i},t._lctf.readScriptTable=function(e,r){var a=t._bin,n=r,i={},o=a.readUshort(e,r);r+=2,o>0&&(i.default=t._lctf.readLangSysTable(e,n+o));var s=a.readUshort(e,r);r+=2;for(var l=0;l<s;l++){var u=a.readASCII(e,r,4);r+=4;var f=a.readUshort(e,r);r+=2,i[u.trim()]=t._lctf.readLangSysTable(e,n+f)}return i},t._lctf.readLangSysTable=function(e,r){var a=t._bin,n={};a.readUshort(e,r),r+=2,n.reqFeature=a.readUshort(e,r),r+=2;var i=a.readUshort(e,r);return r+=2,n.features=a.readUshorts(e,r,i),n},t.CFF={},t.CFF.parse=function(e,r,a){var n=t._bin;(e=new Uint8Array(e.buffer,r,a))[r=0],e[++r],e[++r],e[++r],r++;var i=[];r=t.CFF.readIndex(e,r,i);for(var o=[],s=0;s<i.length-1;s++)o.push(n.readASCII(e,r+i[s],i[s+1]-i[s]));r+=i[i.length-1];var l=[];r=t.CFF.readIndex(e,r,l);var u=[];for(s=0;s<l.length-1;s++)u.push(t.CFF.readDict(e,r+l[s],r+l[s+1]));r+=l[l.length-1];var f=u[0],h=[];r=t.CFF.readIndex(e,r,h);var d=[];for(s=0;s<h.length-1;s++)d.push(n.readASCII(e,r+h[s],h[s+1]-h[s]));if(r+=h[h.length-1],t.CFF.readSubrs(e,r,f),f.CharStrings){r=f.CharStrings,h=[],r=t.CFF.readIndex(e,r,h);var c=[];for(s=0;s<h.length-1;s++)c.push(n.readBytes(e,r+h[s],h[s+1]-h[s]));f.CharStrings=c}if(f.ROS){r=f.FDArray;var v=[];for(r=t.CFF.readIndex(e,r,v),f.FDArray=[],s=0;s<v.length-1;s++){var p=t.CFF.readDict(e,r+v[s],r+v[s+1]);t.CFF._readFDict(e,p,d),f.FDArray.push(p)}r+=v[v.length-1],r=f.FDSelect,f.FDSelect=[];var g=e[r];if(r++,3!=g)throw g;var m=n.readUshort(e,r);for(r+=2,s=0;s<m+1;s++)f.FDSelect.push(n.readUshort(e,r),e[r+2]),r+=3}return f.Encoding&&(f.Encoding=t.CFF.readEncoding(e,f.Encoding,f.CharStrings.length)),f.charset&&(f.charset=t.CFF.readCharset(e,f.charset,f.CharStrings.length)),t.CFF._readFDict(e,f,d),f},t.CFF._readFDict=function(e,r,a){var n;for(var i in r.Private&&(n=r.Private[1],r.Private=t.CFF.readDict(e,n,n+r.Private[0]),r.Private.Subrs&&t.CFF.readSubrs(e,n+r.Private.Subrs,r.Private)),r)-1!=["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(i)&&(r[i]=a[r[i]-426+35])},t.CFF.readSubrs=function(e,r,a){var n=t._bin,i=[];r=t.CFF.readIndex(e,r,i);var o=i.length;a.Bias=o<1240?107:o<33900?1131:32768,a.Subrs=[];for(var s=0;s<i.length-1;s++)a.Subrs.push(n.readBytes(e,r+i[s],i[s+1]-i[s]))},t.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],t.CFF.glyphByUnicode=function(e,t){for(var r=0;r<e.charset.length;r++)if(e.charset[r]==t)return r;return -1},t.CFF.glyphBySE=function(e,r){return r<0||r>255?-1:t.CFF.glyphByUnicode(e,t.CFF.tableSE[r])},t.CFF.readEncoding=function(e,r,a){t._bin;var n=[".notdef"],i=e[r];if(r++,0!=i)throw"error: unknown encoding format: "+i;var o=e[r];r++;for(var s=0;s<o;s++)n.push(e[r+s]);return n},t.CFF.readCharset=function(e,r,a){var n=t._bin,i=[".notdef"],o=e[r];if(r++,0==o)for(var s=0;s<a;s++){var l=n.readUshort(e,r);r+=2,i.push(l)}else{if(1!=o&&2!=o)throw"error: format: "+o;for(;i.length<a;){l=n.readUshort(e,r),r+=2;var u=0;for(1==o?(u=e[r],r++):(u=n.readUshort(e,r),r+=2),s=0;s<=u;s++)i.push(l),l++}}return i},t.CFF.readIndex=function(e,r,a){var n=t._bin,i=n.readUshort(e,r)+1,o=e[r+=2];if(r++,1==o)for(var s=0;s<i;s++)a.push(e[r+s]);else if(2==o)for(s=0;s<i;s++)a.push(n.readUshort(e,r+2*s));else if(3==o)for(s=0;s<i;s++)a.push(0xffffff&n.readUint(e,r+3*s-1));else if(1!=i)throw"unsupported offset size: "+o+", count: "+i;return(r+=i*o)-1},t.CFF.getCharString=function(e,r,a){var n=t._bin,i=e[r],o=e[r+1];e[r+2],e[r+3],e[r+4];var s=1,l=null,u=null;i<=20&&(l=i,s=1),12==i&&(l=100*i+o,s=2),21<=i&&i<=27&&(l=i,s=1),28==i&&(u=n.readShort(e,r+1),s=3),29<=i&&i<=31&&(l=i,s=1),32<=i&&i<=246&&(u=i-139,s=1),247<=i&&i<=250&&(u=256*(i-247)+o+108,s=2),251<=i&&i<=254&&(u=-(256*(i-251))-o-108,s=2),255==i&&(u=n.readInt(e,r+1)/65535,s=5),a.val=null!=u?u:"o"+l,a.size=s},t.CFF.readCharString=function(e,r,a){for(var n=r+a,i=t._bin,o=[];r<n;){var s=e[r],l=e[r+1];e[r+2],e[r+3],e[r+4];var u=1,f=null,h=null;s<=20&&(f=s,u=1),12==s&&(f=100*s+l,u=2),19!=s&&20!=s||(f=s,u=2),21<=s&&s<=27&&(f=s,u=1),28==s&&(h=i.readShort(e,r+1),u=3),29<=s&&s<=31&&(f=s,u=1),32<=s&&s<=246&&(h=s-139,u=1),247<=s&&s<=250&&(h=256*(s-247)+l+108,u=2),251<=s&&s<=254&&(h=-(256*(s-251))-l-108,u=2),255==s&&(h=i.readInt(e,r+1)/65535,u=5),o.push(null!=h?h:"o"+f),r+=u}return o},t.CFF.readDict=function(e,r,a){for(var n=t._bin,i={},o=[];r<a;){var s=e[r],l=e[r+1];e[r+2],e[r+3],e[r+4];var u=1,f=null,h=null;if(28==s&&(h=n.readShort(e,r+1),u=3),29==s&&(h=n.readInt(e,r+1),u=5),32<=s&&s<=246&&(h=s-139,u=1),247<=s&&s<=250&&(h=256*(s-247)+l+108,u=2),251<=s&&s<=254&&(h=-(256*(s-251))-l-108,u=2),255==s)throw h=n.readInt(e,r+1)/65535,u=5,"unknown number";if(30==s){var d=[];for(u=1;;){var c=e[r+u];u++;var v=c>>4,p=15&c;if(15!=v&&d.push(v),15!=p&&d.push(p),15==p)break}for(var g="",m=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],y=0;y<d.length;y++)g+=m[d[y]];h=parseFloat(g)}s<=21&&(f=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][s],u=1,12==s)&&(f=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][l],u=2),null!=f?(i[f]=1==o.length?o[0]:o,o=[]):o.push(h),r+=u}return i},t.cmap={},t.cmap.parse=function(e,r,a){e=new Uint8Array(e.buffer,r,a),r=0;var n=t._bin,i={};n.readUshort(e,r),r+=2;var o=n.readUshort(e,r);r+=2;var s=[];i.tables=[];for(var l=0;l<o;l++){var u=n.readUshort(e,r);r+=2;var f=n.readUshort(e,r);r+=2;var h=n.readUint(e,r);r+=4;var d="p"+u+"e"+f,c=s.indexOf(h);if(-1==c){c=i.tables.length,s.push(h);var v,p=n.readUshort(e,h);0==p?v=t.cmap.parse0(e,h):4==p?v=t.cmap.parse4(e,h):6==p?v=t.cmap.parse6(e,h):12==p?v=t.cmap.parse12(e,h):console.debug("unknown format: "+p,u,f,h),i.tables.push(v)}if(null!=i[d])throw"multiple tables for one platform+encoding";i[d]=c}return i},t.cmap.parse0=function(e,r){var a=t._bin,n={};n.format=a.readUshort(e,r),r+=2;var i=a.readUshort(e,r);r+=2,a.readUshort(e,r),r+=2,n.map=[];for(var o=0;o<i-6;o++)n.map.push(e[r+o]);return n},t.cmap.parse4=function(e,r){var a=t._bin,n=r,i={};i.format=a.readUshort(e,r),r+=2;var o=a.readUshort(e,r);r+=2,a.readUshort(e,r),r+=2;var s=a.readUshort(e,r);r+=2;var l=s/2;i.searchRange=a.readUshort(e,r),r+=2,i.entrySelector=a.readUshort(e,r),r+=2,i.rangeShift=a.readUshort(e,r),r+=2,i.endCount=a.readUshorts(e,r,l),r+=2*l,r+=2,i.startCount=a.readUshorts(e,r,l),r+=2*l,i.idDelta=[];for(var u=0;u<l;u++)i.idDelta.push(a.readShort(e,r)),r+=2;for(i.idRangeOffset=a.readUshorts(e,r,l),r+=2*l,i.glyphIdArray=[];r<n+o;)i.glyphIdArray.push(a.readUshort(e,r)),r+=2;return i},t.cmap.parse6=function(e,r){var a=t._bin,n={};n.format=a.readUshort(e,r),r+=2,a.readUshort(e,r),r+=2,a.readUshort(e,r),r+=2,n.firstCode=a.readUshort(e,r),r+=2;var i=a.readUshort(e,r);r+=2,n.glyphIdArray=[];for(var o=0;o<i;o++)n.glyphIdArray.push(a.readUshort(e,r)),r+=2;return n},t.cmap.parse12=function(e,r){var a=t._bin,n={};n.format=a.readUshort(e,r),r+=2,r+=2,a.readUint(e,r),r+=4,a.readUint(e,r),r+=4;var i=a.readUint(e,r);r+=4,n.groups=[];for(var o=0;o<i;o++){var s=r+12*o,l=a.readUint(e,s+0),u=a.readUint(e,s+4),f=a.readUint(e,s+8);n.groups.push([l,u,f])}return n},t.glyf={},t.glyf.parse=function(e,t,r,a){for(var n=[],i=0;i<a.maxp.numGlyphs;i++)n.push(null);return n},t.glyf._parseGlyf=function(e,r){var a,n=t._bin,i=e._data,o=t._tabOffset(i,"glyf",e._offset)+e.loca[r];if(e.loca[r]==e.loca[r+1])return null;var s={};if(s.noc=n.readShort(i,o),o+=2,s.xMin=n.readShort(i,o),o+=2,s.yMin=n.readShort(i,o),o+=2,s.xMax=n.readShort(i,o),o+=2,s.yMax=n.readShort(i,o),o+=2,s.xMin>=s.xMax||s.yMin>=s.yMax)return null;if(s.noc>0){s.endPts=[];for(var l=0;l<s.noc;l++)s.endPts.push(n.readUshort(i,o)),o+=2;var u=n.readUshort(i,o);if(o+=2,i.length-o<u)return null;s.instructions=n.readBytes(i,o,u),o+=u;var f=s.endPts[s.noc-1]+1;for(l=0,s.flags=[];l<f;l++){var h=i[o];if(o++,s.flags.push(h),0!=(8&h)){var d=i[o];o++;for(var c=0;c<d;c++)s.flags.push(h),l++}}for(l=0,s.xs=[];l<f;l++){var v=0!=(2&s.flags[l]),p=0!=(16&s.flags[l]);v?(s.xs.push(p?i[o]:-i[o]),o++):p?s.xs.push(0):(s.xs.push(n.readShort(i,o)),o+=2)}for(l=0,s.ys=[];l<f;l++)v=0!=(4&s.flags[l]),p=0!=(32&s.flags[l]),v?(s.ys.push(p?i[o]:-i[o]),o++):p?s.ys.push(0):(s.ys.push(n.readShort(i,o)),o+=2);var g=0,m=0;for(l=0;l<f;l++)g+=s.xs[l],m+=s.ys[l],s.xs[l]=g,s.ys[l]=m}else{s.parts=[];do{a=n.readUshort(i,o),o+=2;var y={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(s.parts.push(y),y.glyphIndex=n.readUshort(i,o),o+=2,1&a){var b=n.readShort(i,o);o+=2;var x=n.readShort(i,o);o+=2}else b=n.readInt8(i,o),o++,x=n.readInt8(i,o),o++;2&a?(y.m.tx=b,y.m.ty=x):(y.p1=b,y.p2=x),8&a?(y.m.a=y.m.d=n.readF2dot14(i,o),o+=2):64&a?(y.m.a=n.readF2dot14(i,o),o+=2,y.m.d=n.readF2dot14(i,o),o+=2):128&a&&(y.m.a=n.readF2dot14(i,o),o+=2,y.m.b=n.readF2dot14(i,o),o+=2,y.m.c=n.readF2dot14(i,o),o+=2,y.m.d=n.readF2dot14(i,o),o+=2)}while(32&a)if(256&a){var S=n.readUshort(i,o);for(o+=2,s.instr=[],l=0;l<S;l++)s.instr.push(i[o]),o++}}return s},t.GDEF={},t.GDEF.parse=function(e,r,a,n){var i=r;r+=4;var o=t._bin.readUshort(e,r);return{glyphClassDef:0===o?null:t._lctf.readClassDef(e,i+o)}},t.GPOS={},t.GPOS.parse=function(e,r,a,n){return t._lctf.parse(e,r,a,n,t.GPOS.subt)},t.GPOS.subt=function(e,r,a,n){var i=t._bin,o=a,s={};if(s.fmt=i.readUshort(e,a),a+=2,1==r||2==r||3==r||7==r||8==r&&s.fmt<=2){var l=i.readUshort(e,a);a+=2,s.coverage=t._lctf.readCoverage(e,l+o)}if(1==r&&1==s.fmt){var u=i.readUshort(e,a);a+=2,0!=u&&(s.pos=t.GPOS.readValueRecord(e,a,u))}else if(2==r&&s.fmt>=1&&s.fmt<=2){u=i.readUshort(e,a),a+=2;var f=i.readUshort(e,a);a+=2;var h=t._lctf.numOfOnes(u),d=t._lctf.numOfOnes(f);if(1==s.fmt){s.pairsets=[];var c=i.readUshort(e,a);a+=2;for(var v=0;v<c;v++){var p=o+i.readUshort(e,a);a+=2;var g=i.readUshort(e,p);p+=2;for(var m=[],y=0;y<g;y++){var b=i.readUshort(e,p);p+=2,0!=u&&(w=t.GPOS.readValueRecord(e,p,u),p+=2*h),0!=f&&(_=t.GPOS.readValueRecord(e,p,f),p+=2*d),m.push({gid2:b,val1:w,val2:_})}s.pairsets.push(m)}}if(2==s.fmt){var x=i.readUshort(e,a);a+=2;var S=i.readUshort(e,a);a+=2;var U=i.readUshort(e,a);a+=2;var T=i.readUshort(e,a);for(a+=2,s.classDef1=t._lctf.readClassDef(e,o+x),s.classDef2=t._lctf.readClassDef(e,o+S),s.matrix=[],v=0;v<U;v++){var k=[];for(y=0;y<T;y++){var w=null,_=null;0!=u&&(w=t.GPOS.readValueRecord(e,a,u),a+=2*h),0!=f&&(_=t.GPOS.readValueRecord(e,a,f),a+=2*d),k.push({val1:w,val2:_})}s.matrix.push(k)}}}else if(4==r&&1==s.fmt)s.markCoverage=t._lctf.readCoverage(e,i.readUshort(e,a)+o),s.baseCoverage=t._lctf.readCoverage(e,i.readUshort(e,a+2)+o),s.markClassCount=i.readUshort(e,a+4),s.markArray=t.GPOS.readMarkArray(e,i.readUshort(e,a+6)+o),s.baseArray=t.GPOS.readBaseArray(e,i.readUshort(e,a+8)+o,s.markClassCount);else if(6==r&&1==s.fmt)s.mark1Coverage=t._lctf.readCoverage(e,i.readUshort(e,a)+o),s.mark2Coverage=t._lctf.readCoverage(e,i.readUshort(e,a+2)+o),s.markClassCount=i.readUshort(e,a+4),s.mark1Array=t.GPOS.readMarkArray(e,i.readUshort(e,a+6)+o),s.mark2Array=t.GPOS.readBaseArray(e,i.readUshort(e,a+8)+o,s.markClassCount);else{if(9==r&&1==s.fmt){var C=i.readUshort(e,a);a+=2;var F=i.readUint(e,a);if(a+=4,9==n.ltype)n.ltype=C;else if(n.ltype!=C)throw"invalid extension substitution";return t.GPOS.subt(e,n.ltype,o+F)}console.debug("unsupported GPOS table LookupType",r,"format",s.fmt)}return s},t.GPOS.readValueRecord=function(e,r,a){var n=t._bin,i=[];return i.push(1&a?n.readShort(e,r):0),r+=1&a?2:0,i.push(2&a?n.readShort(e,r):0),r+=2&a?2:0,i.push(4&a?n.readShort(e,r):0),r+=4&a?2:0,i.push(8&a?n.readShort(e,r):0),r+=8&a?2:0,i},t.GPOS.readBaseArray=function(e,r,a){var n=t._bin,i=[],o=r,s=n.readUshort(e,r);r+=2;for(var l=0;l<s;l++){for(var u=[],f=0;f<a;f++)u.push(t.GPOS.readAnchorRecord(e,o+n.readUshort(e,r))),r+=2;i.push(u)}return i},t.GPOS.readMarkArray=function(e,r){var a=t._bin,n=[],i=r,o=a.readUshort(e,r);r+=2;for(var s=0;s<o;s++){var l=t.GPOS.readAnchorRecord(e,a.readUshort(e,r+2)+i);l.markClass=a.readUshort(e,r),n.push(l),r+=4}return n},t.GPOS.readAnchorRecord=function(e,r){var a=t._bin,n={};return n.fmt=a.readUshort(e,r),n.x=a.readShort(e,r+2),n.y=a.readShort(e,r+4),n},t.GSUB={},t.GSUB.parse=function(e,r,a,n){return t._lctf.parse(e,r,a,n,t.GSUB.subt)},t.GSUB.subt=function(e,r,a,n){var i=t._bin,o=a,s={};if(s.fmt=i.readUshort(e,a),a+=2,1!=r&&2!=r&&4!=r&&5!=r&&6!=r)return null;if(1==r||2==r||4==r||5==r&&s.fmt<=2||6==r&&s.fmt<=2){var l=i.readUshort(e,a);a+=2,s.coverage=t._lctf.readCoverage(e,o+l)}if(1==r&&s.fmt>=1&&s.fmt<=2){if(1==s.fmt)s.delta=i.readShort(e,a),a+=2;else if(2==s.fmt){var u=i.readUshort(e,a);a+=2,s.newg=i.readUshorts(e,a,u),a+=2*s.newg.length}}else if(2==r&&1==s.fmt){u=i.readUshort(e,a),a+=2,s.seqs=[];for(var f=0;f<u;f++){var h=i.readUshort(e,a)+o;a+=2;var d=i.readUshort(e,h);s.seqs.push(i.readUshorts(e,h+2,d))}}else if(4==r)for(s.vals=[],u=i.readUshort(e,a),a+=2,f=0;f<u;f++){var c=i.readUshort(e,a);a+=2,s.vals.push(t.GSUB.readLigatureSet(e,o+c))}else if(5==r&&2==s.fmt){if(2==s.fmt){var v=i.readUshort(e,a);a+=2,s.cDef=t._lctf.readClassDef(e,o+v),s.scset=[];var p=i.readUshort(e,a);for(a+=2,f=0;f<p;f++){var g=i.readUshort(e,a);a+=2,s.scset.push(0==g?null:t.GSUB.readSubClassSet(e,o+g))}}}else if(6==r&&3==s.fmt){if(3==s.fmt){for(f=0;f<3;f++){u=i.readUshort(e,a),a+=2;for(var m=[],y=0;y<u;y++)m.push(t._lctf.readCoverage(e,o+i.readUshort(e,a+2*y)));a+=2*u,0==f&&(s.backCvg=m),1==f&&(s.inptCvg=m),2==f&&(s.ahedCvg=m)}u=i.readUshort(e,a),a+=2,s.lookupRec=t.GSUB.readSubstLookupRecords(e,a,u)}}else{if(7==r&&1==s.fmt){var b=i.readUshort(e,a);a+=2;var x=i.readUint(e,a);if(a+=4,9==n.ltype)n.ltype=b;else if(n.ltype!=b)throw"invalid extension substitution";return t.GSUB.subt(e,n.ltype,o+x)}console.debug("unsupported GSUB table LookupType",r,"format",s.fmt)}return s},t.GSUB.readSubClassSet=function(e,r){var a=t._bin.readUshort,n=r,i=[],o=a(e,r);r+=2;for(var s=0;s<o;s++){var l=a(e,r);r+=2,i.push(t.GSUB.readSubClassRule(e,n+l))}return i},t.GSUB.readSubClassRule=function(e,r){var a=t._bin.readUshort,n={},i=a(e,r),o=a(e,r+=2);r+=2,n.input=[];for(var s=0;s<i-1;s++)n.input.push(a(e,r)),r+=2;return n.substLookupRecords=t.GSUB.readSubstLookupRecords(e,r,o),n},t.GSUB.readSubstLookupRecords=function(e,r,a){for(var n=t._bin.readUshort,i=[],o=0;o<a;o++)i.push(n(e,r),n(e,r+2)),r+=4;return i},t.GSUB.readChainSubClassSet=function(e,r){var a=t._bin,n=r,i=[],o=a.readUshort(e,r);r+=2;for(var s=0;s<o;s++){var l=a.readUshort(e,r);r+=2,i.push(t.GSUB.readChainSubClassRule(e,n+l))}return i},t.GSUB.readChainSubClassRule=function(e,r){for(var a=t._bin,n={},i=["backtrack","input","lookahead"],o=0;o<i.length;o++){var s=a.readUshort(e,r);r+=2,1==o&&s--,n[i[o]]=a.readUshorts(e,r,s),r+=2*n[i[o]].length}return s=a.readUshort(e,r),r+=2,n.subst=a.readUshorts(e,r,2*s),r+=2*n.subst.length,n},t.GSUB.readLigatureSet=function(e,r){var a=t._bin,n=r,i=[],o=a.readUshort(e,r);r+=2;for(var s=0;s<o;s++){var l=a.readUshort(e,r);r+=2,i.push(t.GSUB.readLigature(e,n+l))}return i},t.GSUB.readLigature=function(e,r){var a=t._bin,n={chain:[]};n.nglyph=a.readUshort(e,r),r+=2;var i=a.readUshort(e,r);r+=2;for(var o=0;o<i-1;o++)n.chain.push(a.readUshort(e,r)),r+=2;return n},t.head={},t.head.parse=function(e,r,a){var n=t._bin,i={};return n.readFixed(e,r),r+=4,i.fontRevision=n.readFixed(e,r),r+=4,n.readUint(e,r),r+=4,n.readUint(e,r),r+=4,i.flags=n.readUshort(e,r),r+=2,i.unitsPerEm=n.readUshort(e,r),r+=2,i.created=n.readUint64(e,r),r+=8,i.modified=n.readUint64(e,r),r+=8,i.xMin=n.readShort(e,r),r+=2,i.yMin=n.readShort(e,r),r+=2,i.xMax=n.readShort(e,r),r+=2,i.yMax=n.readShort(e,r),r+=2,i.macStyle=n.readUshort(e,r),r+=2,i.lowestRecPPEM=n.readUshort(e,r),r+=2,i.fontDirectionHint=n.readShort(e,r),r+=2,i.indexToLocFormat=n.readShort(e,r),r+=2,i.glyphDataFormat=n.readShort(e,r),r+=2,i},t.hhea={},t.hhea.parse=function(e,r,a){var n=t._bin,i={};return n.readFixed(e,r),r+=4,i.ascender=n.readShort(e,r),r+=2,i.descender=n.readShort(e,r),r+=2,i.lineGap=n.readShort(e,r),r+=2,i.advanceWidthMax=n.readUshort(e,r),r+=2,i.minLeftSideBearing=n.readShort(e,r),r+=2,i.minRightSideBearing=n.readShort(e,r),r+=2,i.xMaxExtent=n.readShort(e,r),r+=2,i.caretSlopeRise=n.readShort(e,r),r+=2,i.caretSlopeRun=n.readShort(e,r),r+=2,i.caretOffset=n.readShort(e,r),r+=2,r+=8,i.metricDataFormat=n.readShort(e,r),r+=2,i.numberOfHMetrics=n.readUshort(e,r),r+=2,i},t.hmtx={},t.hmtx.parse=function(e,r,a,n){for(var i=t._bin,o={aWidth:[],lsBearing:[]},s=0,l=0,u=0;u<n.maxp.numGlyphs;u++)u<n.hhea.numberOfHMetrics&&(s=i.readUshort(e,r),r+=2,l=i.readShort(e,r),r+=2),o.aWidth.push(s),o.lsBearing.push(l);return o},t.kern={},t.kern.parse=function(e,r,a,n){var i=t._bin,o=i.readUshort(e,r);if(r+=2,1==o)return t.kern.parseV1(e,r-2,a,n);var s=i.readUshort(e,r);r+=2;for(var l={glyph1:[],rval:[]},u=0;u<s;u++){r+=2,a=i.readUshort(e,r),r+=2;var f=i.readUshort(e,r);r+=2;var h=f>>>8;if(0!=(h&=15))throw"unknown kern table format: "+h;r=t.kern.readFormat0(e,r,l)}return l},t.kern.parseV1=function(e,r,a,n){var i=t._bin;i.readFixed(e,r),r+=4;var o=i.readUint(e,r);r+=4;for(var s={glyph1:[],rval:[]},l=0;l<o;l++){i.readUint(e,r),r+=4;var u=i.readUshort(e,r);r+=2,i.readUshort(e,r),r+=2;var f=u>>>8;if(0!=(f&=15))throw"unknown kern table format: "+f;r=t.kern.readFormat0(e,r,s)}return s},t.kern.readFormat0=function(e,r,a){var n=t._bin,i=-1,o=n.readUshort(e,r);r+=2,n.readUshort(e,r),r+=2,n.readUshort(e,r),r+=2,n.readUshort(e,r),r+=2;for(var s=0;s<o;s++){var l=n.readUshort(e,r);r+=2;var u=n.readUshort(e,r);r+=2;var f=n.readShort(e,r);r+=2,l!=i&&(a.glyph1.push(l),a.rval.push({glyph2:[],vals:[]}));var h=a.rval[a.rval.length-1];h.glyph2.push(u),h.vals.push(f),i=l}return r},t.loca={},t.loca.parse=function(e,r,a,n){var i=t._bin,o=[],s=n.head.indexToLocFormat,l=n.maxp.numGlyphs+1;if(0==s)for(var u=0;u<l;u++)o.push(i.readUshort(e,r+(u<<1))<<1);if(1==s)for(u=0;u<l;u++)o.push(i.readUint(e,r+(u<<2)));return o},t.maxp={},t.maxp.parse=function(e,r,a){var n=t._bin,i={},o=n.readUint(e,r);return r+=4,i.numGlyphs=n.readUshort(e,r),r+=2,65536==o&&(i.maxPoints=n.readUshort(e,r),r+=2,i.maxContours=n.readUshort(e,r),r+=2,i.maxCompositePoints=n.readUshort(e,r),r+=2,i.maxCompositeContours=n.readUshort(e,r),r+=2,i.maxZones=n.readUshort(e,r),r+=2,i.maxTwilightPoints=n.readUshort(e,r),r+=2,i.maxStorage=n.readUshort(e,r),r+=2,i.maxFunctionDefs=n.readUshort(e,r),r+=2,i.maxInstructionDefs=n.readUshort(e,r),r+=2,i.maxStackElements=n.readUshort(e,r),r+=2,i.maxSizeOfInstructions=n.readUshort(e,r),r+=2,i.maxComponentElements=n.readUshort(e,r),r+=2,i.maxComponentDepth=n.readUshort(e,r),r+=2),i},t.name={},t.name.parse=function(e,r,a){var n=t._bin,i={};n.readUshort(e,r),r+=2;var o=n.readUshort(e,r);r+=2,n.readUshort(e,r);for(var s,l=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],u=r+=2,f=0;f<o;f++){var h=n.readUshort(e,r);r+=2;var d=n.readUshort(e,r);r+=2;var c=n.readUshort(e,r);r+=2;var v=n.readUshort(e,r);r+=2;var p=n.readUshort(e,r);r+=2;var g=n.readUshort(e,r);r+=2;var m,y=l[v],b=u+12*o+g;if(0==h)m=n.readUnicode(e,b,p/2);else if(3==h&&0==d)m=n.readUnicode(e,b,p/2);else if(0==d)m=n.readASCII(e,b,p);else if(1==d)m=n.readUnicode(e,b,p/2);else if(3==d)m=n.readUnicode(e,b,p/2);else{if(1!=h)throw"unknown encoding "+d+", platformID: "+h;m=n.readASCII(e,b,p),console.debug("reading unknown MAC encoding "+d+" as ASCII")}var x="p"+h+","+c.toString(16);null==i[x]&&(i[x]={}),i[x][void 0!==y?y:v]=m,i[x]._lang=c}for(var S in i)if(null!=i[S].postScriptName&&1033==i[S]._lang)return i[S];for(var S in i)if(null!=i[S].postScriptName&&0==i[S]._lang)return i[S];for(var S in i)if(null!=i[S].postScriptName&&3084==i[S]._lang)return i[S];for(var S in i)if(null!=i[S].postScriptName)return i[S];for(var S in i){s=S;break}return console.debug("returning name table with languageID "+i[s]._lang),i[s]},t["OS/2"]={},t["OS/2"].parse=function(e,r,a){var n=t._bin.readUshort(e,r);r+=2;var i={};if(0==n)t["OS/2"].version0(e,r,i);else if(1==n)t["OS/2"].version1(e,r,i);else if(2==n||3==n||4==n)t["OS/2"].version2(e,r,i);else{if(5!=n)throw"unknown OS/2 table version: "+n;t["OS/2"].version5(e,r,i)}return i},t["OS/2"].version0=function(e,r,a){var n=t._bin;return a.xAvgCharWidth=n.readShort(e,r),r+=2,a.usWeightClass=n.readUshort(e,r),r+=2,a.usWidthClass=n.readUshort(e,r),r+=2,a.fsType=n.readUshort(e,r),r+=2,a.ySubscriptXSize=n.readShort(e,r),r+=2,a.ySubscriptYSize=n.readShort(e,r),r+=2,a.ySubscriptXOffset=n.readShort(e,r),r+=2,a.ySubscriptYOffset=n.readShort(e,r),r+=2,a.ySuperscriptXSize=n.readShort(e,r),r+=2,a.ySuperscriptYSize=n.readShort(e,r),r+=2,a.ySuperscriptXOffset=n.readShort(e,r),r+=2,a.ySuperscriptYOffset=n.readShort(e,r),r+=2,a.yStrikeoutSize=n.readShort(e,r),r+=2,a.yStrikeoutPosition=n.readShort(e,r),r+=2,a.sFamilyClass=n.readShort(e,r),r+=2,a.panose=n.readBytes(e,r,10),r+=10,a.ulUnicodeRange1=n.readUint(e,r),r+=4,a.ulUnicodeRange2=n.readUint(e,r),r+=4,a.ulUnicodeRange3=n.readUint(e,r),r+=4,a.ulUnicodeRange4=n.readUint(e,r),r+=4,a.achVendID=[n.readInt8(e,r),n.readInt8(e,r+1),n.readInt8(e,r+2),n.readInt8(e,r+3)],r+=4,a.fsSelection=n.readUshort(e,r),r+=2,a.usFirstCharIndex=n.readUshort(e,r),r+=2,a.usLastCharIndex=n.readUshort(e,r),r+=2,a.sTypoAscender=n.readShort(e,r),r+=2,a.sTypoDescender=n.readShort(e,r),r+=2,a.sTypoLineGap=n.readShort(e,r),r+=2,a.usWinAscent=n.readUshort(e,r),r+=2,a.usWinDescent=n.readUshort(e,r),r+=2},t["OS/2"].version1=function(e,r,a){var n=t._bin;return r=t["OS/2"].version0(e,r,a),a.ulCodePageRange1=n.readUint(e,r),r+=4,a.ulCodePageRange2=n.readUint(e,r),r+=4},t["OS/2"].version2=function(e,r,a){var n=t._bin;return r=t["OS/2"].version1(e,r,a),a.sxHeight=n.readShort(e,r),r+=2,a.sCapHeight=n.readShort(e,r),r+=2,a.usDefault=n.readUshort(e,r),r+=2,a.usBreak=n.readUshort(e,r),r+=2,a.usMaxContext=n.readUshort(e,r),r+=2},t["OS/2"].version5=function(e,r,a){var n=t._bin;return r=t["OS/2"].version2(e,r,a),a.usLowerOpticalPointSize=n.readUshort(e,r),r+=2,a.usUpperOpticalPointSize=n.readUshort(e,r),r+=2},t.post={},t.post.parse=function(e,r,a){var n=t._bin,i={};return i.version=n.readFixed(e,r),r+=4,i.italicAngle=n.readFixed(e,r),r+=4,i.underlinePosition=n.readShort(e,r),r+=2,i.underlineThickness=n.readShort(e,r),r+=2,i},null==t&&(t={}),null==t.U&&(t.U={}),t.U.codeToGlyph=function(e,t){var r=e.cmap,a=-1;if(null!=r.p0e4?a=r.p0e4:null!=r.p3e1?a=r.p3e1:null!=r.p1e0?a=r.p1e0:null!=r.p0e3&&(a=r.p0e3),-1==a)throw"no familiar platform and encoding!";var n=r.tables[a];if(0==n.format)return t>=n.map.length?0:n.map[t];if(4==n.format){for(var i=-1,o=0;o<n.endCount.length;o++)if(t<=n.endCount[o]){i=o;break}return -1==i||n.startCount[i]>t?0:65535&(0!=n.idRangeOffset[i]?n.glyphIdArray[t-n.startCount[i]+(n.idRangeOffset[i]>>1)-(n.idRangeOffset.length-i)]:t+n.idDelta[i])}if(12==n.format){if(t>n.groups[n.groups.length-1][1])return 0;for(o=0;o<n.groups.length;o++){var s=n.groups[o];if(s[0]<=t&&t<=s[1])return s[2]+(t-s[0])}return 0}throw"unknown cmap table format "+n.format},t.U.glyphToPath=function(e,r){var a={cmds:[],crds:[]};if(e.SVG&&e.SVG.entries[r]){var n=e.SVG.entries[r];return null==n?a:("string"==typeof n&&(n=t.SVG.toPath(n),e.SVG.entries[r]=n),n)}if(e.CFF){var i={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:e.CFF.Private?e.CFF.Private.defaultWidthX:0,open:!1},o=e.CFF,s=e.CFF.Private;if(o.ROS){for(var l=0;o.FDSelect[l+2]<=r;)l+=2;s=o.FDArray[o.FDSelect[l+1]].Private}t.U._drawCFF(e.CFF.CharStrings[r],i,o,s,a)}else e.glyf&&t.U._drawGlyf(r,e,a);return a},t.U._drawGlyf=function(e,r,a){var n=r.glyf[e];null==n&&(n=r.glyf[e]=t.glyf._parseGlyf(r,e)),null!=n&&(n.noc>-1?t.U._simpleGlyph(n,a):t.U._compoGlyph(n,r,a))},t.U._simpleGlyph=function(e,r){for(var a=0;a<e.noc;a++){for(var n=0==a?0:e.endPts[a-1]+1,i=e.endPts[a],o=n;o<=i;o++){var s=o==n?i:o-1,l=o==i?n:o+1,u=1&e.flags[o],f=1&e.flags[s],h=1&e.flags[l],d=e.xs[o],c=e.ys[o];if(o==n)if(u){if(!f){t.U.P.moveTo(r,d,c);continue}t.U.P.moveTo(r,e.xs[s],e.ys[s])}else f?t.U.P.moveTo(r,e.xs[s],e.ys[s]):t.U.P.moveTo(r,(e.xs[s]+d)/2,(e.ys[s]+c)/2);u?f&&t.U.P.lineTo(r,d,c):h?t.U.P.qcurveTo(r,d,c,e.xs[l],e.ys[l]):t.U.P.qcurveTo(r,d,c,(d+e.xs[l])/2,(c+e.ys[l])/2)}t.U.P.closePath(r)}},t.U._compoGlyph=function(e,r,a){for(var n=0;n<e.parts.length;n++){var i={cmds:[],crds:[]},o=e.parts[n];t.U._drawGlyf(o.glyphIndex,r,i);for(var s=o.m,l=0;l<i.crds.length;l+=2){var u=i.crds[l],f=i.crds[l+1];a.crds.push(u*s.a+f*s.b+s.tx),a.crds.push(u*s.c+f*s.d+s.ty)}for(l=0;l<i.cmds.length;l++)a.cmds.push(i.cmds[l])}},t.U._getGlyphClass=function(e,r){var a=t._lctf.getInterval(r,e);return -1==a?0:r[a+2]},t.U._applySubs=function(e,r,a,n){for(var i=e.length-r-1,o=0;o<a.tabs.length;o++)if(null!=a.tabs[o]){var s,l=a.tabs[o];if(!l.coverage||-1!=(s=t._lctf.coverageIndex(l.coverage,e[r]))){if(1==a.ltype)e[r],1==l.fmt?e[r]=e[r]+l.delta:e[r]=l.newg[s];else if(4==a.ltype)for(var u=l.vals[s],f=0;f<u.length;f++){var h=u[f],d=h.chain.length;if(!(d>i)){for(var c=!0,v=0,p=0;p<d;p++){for(;-1==e[r+v+(1+p)];)v++;h.chain[p]!=e[r+v+(1+p)]&&(c=!1)}if(c){for(p=0,e[r]=h.nglyph;p<d+v;p++)e[r+p+1]=-1;break}}}else if(5==a.ltype&&2==l.fmt)for(var g=t._lctf.getInterval(l.cDef,e[r]),m=l.cDef[g+2],y=l.scset[m],b=0;b<y.length;b++){var x=y[b],S=x.input;if(!(S.length>i)){for(c=!0,p=0;p<S.length;p++){var U=t._lctf.getInterval(l.cDef,e[r+1+p]);if(-1==g&&l.cDef[U+2]!=S[p]){c=!1;break}}if(c){var T=x.substLookupRecords;for(f=0;f<T.length;f+=2)T[f],T[f+1]}}}else if(6==a.ltype&&3==l.fmt){if(!t.U._glsCovered(e,l.backCvg,r-l.backCvg.length)||!t.U._glsCovered(e,l.inptCvg,r)||!t.U._glsCovered(e,l.ahedCvg,r+l.inptCvg.length))continue;var k=l.lookupRec;for(b=0;b<k.length;b+=2){g=k[b];var w=n[k[b+1]];t.U._applySubs(e,r+g,w,n)}}}}},t.U._glsCovered=function(e,r,a){for(var n=0;n<r.length;n++)if(-1==t._lctf.coverageIndex(r[n],e[a+n]))return!1;return!0},t.U.glyphsToPath=function(e,r,a){for(var n={cmds:[],crds:[]},i=0,o=0;o<r.length;o++){var s=r[o];if(-1!=s){for(var l=o<r.length-1&&-1!=r[o+1]?r[o+1]:0,u=t.U.glyphToPath(e,s),f=0;f<u.crds.length;f+=2)n.crds.push(u.crds[f]+i),n.crds.push(u.crds[f+1]);for(a&&n.cmds.push(a),f=0;f<u.cmds.length;f++)n.cmds.push(u.cmds[f]);a&&n.cmds.push("X"),i+=e.hmtx.aWidth[s],o<r.length-1&&(i+=t.U.getPairAdjustment(e,s,l))}}return n},t.U.P={},t.U.P.moveTo=function(e,t,r){e.cmds.push("M"),e.crds.push(t,r)},t.U.P.lineTo=function(e,t,r){e.cmds.push("L"),e.crds.push(t,r)},t.U.P.curveTo=function(e,t,r,a,n,i,o){e.cmds.push("C"),e.crds.push(t,r,a,n,i,o)},t.U.P.qcurveTo=function(e,t,r,a,n){e.cmds.push("Q"),e.crds.push(t,r,a,n)},t.U.P.closePath=function(e){e.cmds.push("Z")},t.U._drawCFF=function(e,r,a,n,i){for(var o=r.stack,s=r.nStems,l=r.haveWidth,u=r.width,f=r.open,h=0,d=r.x,c=r.y,v=0,p=0,g=0,m=0,y=0,b=0,x=0,S=0,U=0,T=0,k={val:0,size:0};h<e.length;){t.CFF.getCharString(e,h,k);var w=k.val;if(h+=k.size,"o1"==w||"o18"==w)o.length%2==0||l||(u=o.shift()+n.nominalWidthX),s+=o.length>>1,o.length=0,l=!0;else if("o3"==w||"o23"==w)o.length%2==0||l||(u=o.shift()+n.nominalWidthX),s+=o.length>>1,o.length=0,l=!0;else if("o4"==w)o.length>1&&!l&&(u=o.shift()+n.nominalWidthX,l=!0),f&&t.U.P.closePath(i),c+=o.pop(),t.U.P.moveTo(i,d,c),f=!0;else if("o5"==w)for(;o.length>0;)d+=o.shift(),c+=o.shift(),t.U.P.lineTo(i,d,c);else if("o6"==w||"o7"==w)for(var _=o.length,C="o6"==w,F=0;F<_;F++){var D=o.shift();C?d+=D:c+=D,C=!C,t.U.P.lineTo(i,d,c)}else if("o8"==w||"o24"==w){_=o.length;for(var M=0;M+6<=_;)v=d+o.shift(),p=c+o.shift(),g=v+o.shift(),m=p+o.shift(),d=g+o.shift(),c=m+o.shift(),t.U.P.curveTo(i,v,p,g,m,d,c),M+=6;"o24"==w&&(d+=o.shift(),c+=o.shift(),t.U.P.lineTo(i,d,c))}else{if("o11"==w)break;if("o1234"==w||"o1235"==w||"o1236"==w||"o1237"==w)"o1234"==w&&(p=c,g=(v=d+o.shift())+o.shift(),T=m=p+o.shift(),b=m,S=c,d=(x=(y=(U=g+o.shift())+o.shift())+o.shift())+o.shift(),t.U.P.curveTo(i,v,p,g,m,U,T),t.U.P.curveTo(i,y,b,x,S,d,c)),"o1235"==w&&(v=d+o.shift(),p=c+o.shift(),g=v+o.shift(),m=p+o.shift(),U=g+o.shift(),T=m+o.shift(),y=U+o.shift(),b=T+o.shift(),x=y+o.shift(),S=b+o.shift(),d=x+o.shift(),c=S+o.shift(),o.shift(),t.U.P.curveTo(i,v,p,g,m,U,T),t.U.P.curveTo(i,y,b,x,S,d,c)),"o1236"==w&&(v=d+o.shift(),p=c+o.shift(),g=v+o.shift(),T=m=p+o.shift(),b=m,x=(y=(U=g+o.shift())+o.shift())+o.shift(),S=b+o.shift(),d=x+o.shift(),t.U.P.curveTo(i,v,p,g,m,U,T),t.U.P.curveTo(i,y,b,x,S,d,c)),"o1237"==w&&(v=d+o.shift(),p=c+o.shift(),g=v+o.shift(),m=p+o.shift(),U=g+o.shift(),T=m+o.shift(),y=U+o.shift(),b=T+o.shift(),Math.abs((x=y+o.shift())-d)>Math.abs((S=b+o.shift())-c)?d=x+o.shift():c=S+o.shift(),t.U.P.curveTo(i,v,p,g,m,U,T),t.U.P.curveTo(i,y,b,x,S,d,c));else if("o14"==w){if(o.length>0&&!l&&(u=o.shift()+a.nominalWidthX,l=!0),4==o.length){var A=o.shift(),E=o.shift(),I=o.shift(),R=o.shift(),P=t.CFF.glyphBySE(a,I),O=t.CFF.glyphBySE(a,R);t.U._drawCFF(a.CharStrings[P],r,a,n,i),r.x=A,r.y=E,t.U._drawCFF(a.CharStrings[O],r,a,n,i)}f&&(t.U.P.closePath(i),f=!1)}else if("o19"==w||"o20"==w)o.length%2==0||l||(u=o.shift()+n.nominalWidthX),s+=o.length>>1,o.length=0,l=!0,h+=s+7>>3;else if("o21"==w)o.length>2&&!l&&(u=o.shift()+n.nominalWidthX,l=!0),c+=o.pop(),d+=o.pop(),f&&t.U.P.closePath(i),t.U.P.moveTo(i,d,c),f=!0;else if("o22"==w)o.length>1&&!l&&(u=o.shift()+n.nominalWidthX,l=!0),d+=o.pop(),f&&t.U.P.closePath(i),t.U.P.moveTo(i,d,c),f=!0;else if("o25"==w){for(;o.length>6;)d+=o.shift(),c+=o.shift(),t.U.P.lineTo(i,d,c);v=d+o.shift(),p=c+o.shift(),g=v+o.shift(),m=p+o.shift(),d=g+o.shift(),c=m+o.shift(),t.U.P.curveTo(i,v,p,g,m,d,c)}else if("o26"==w)for(o.length%2&&(d+=o.shift());o.length>0;)v=d,p=c+o.shift(),d=g=v+o.shift(),c=(m=p+o.shift())+o.shift(),t.U.P.curveTo(i,v,p,g,m,d,c);else if("o27"==w)for(o.length%2&&(c+=o.shift());o.length>0;)p=c,g=(v=d+o.shift())+o.shift(),m=p+o.shift(),d=g+o.shift(),c=m,t.U.P.curveTo(i,v,p,g,m,d,c);else if("o10"==w||"o29"==w){var G="o10"==w?n:a;if(0==o.length)console.debug("error: empty stack");else{var B=o.pop(),L=G.Subrs[B+G.Bias];r.x=d,r.y=c,r.nStems=s,r.haveWidth=l,r.width=u,r.open=f,t.U._drawCFF(L,r,a,n,i),d=r.x,c=r.y,s=r.nStems,l=r.haveWidth,u=r.width,f=r.open}}else if("o30"==w||"o31"==w){var z=o.length,W=(M=0,"o31"==w);for(M+=z-(_=-3&z);M<_;)W?(p=c,g=(v=d+o.shift())+o.shift(),c=(m=p+o.shift())+o.shift(),_-M==5?(d=g+o.shift(),M++):d=g,W=!1):(v=d,p=c+o.shift(),g=v+o.shift(),m=p+o.shift(),d=g+o.shift(),_-M==5?(c=m+o.shift(),M++):c=m,W=!0),t.U.P.curveTo(i,v,p,g,m,d,c),M+=4}else{if("o"==(w+"").charAt(0))throw console.debug("Unknown operation: "+w,e),w;o.push(w)}}}r.x=d,r.y=c,r.nStems=s,r.haveWidth=l,r.width=u,r.open=f},e.Typr=r=t,e.default={Typr:r},Object.defineProperty(e,"__esModule",{value:!0}),e).Typr},function(){return function(e){var t=Uint8Array,r=Uint16Array,a=Uint32Array,n=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(e,t){for(var n=new r(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];var o=new a(n[30]);for(i=1;i<30;++i)for(var s=n[i];s<n[i+1];++s)o[s]=s-n[i]<<5|i;return[n,o]},l=s(n,2),u=l[0],f=l[1];u[28]=258,f[258]=28;for(var h=s(i,0)[0],d=new r(32768),c=0;c<32768;++c){var v=(43690&c)>>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>>2|(13107&v)<<2))>>>4|(3855&v)<<4,d[c]=((65280&v)>>>8|(255&v)<<8)>>>1}var p=function(e,t,a){for(var n=e.length,i=0,o=new r(t);i<n;++i)++o[e[i]-1];var s,l=new r(t);for(i=0;i<t;++i)l[i]=l[i-1]+o[i-1]<<1;if(a){s=new r(1<<t);var u=15-t;for(i=0;i<n;++i)if(e[i])for(var f=i<<4|e[i],h=t-e[i],c=l[e[i]-1]++<<h,v=c|(1<<h)-1;c<=v;++c)s[d[c]>>>u]=f}else for(s=new r(n),i=0;i<n;++i)e[i]&&(s[i]=d[l[e[i]-1]++]>>>15-e[i]);return s},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var m=new t(32);for(c=0;c<32;++c)m[c]=5;var y=p(g,9,1),b=p(m,5,1),x=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},S=function(e,t,r){var a=t/8|0;return(e[a]|e[a+1]<<8)>>(7&t)&r},U=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(7&t)},T=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],k=function(e,t,r){var a=Error(t||T[e]);if(a.code=e,Error.captureStackTrace&&Error.captureStackTrace(a,k),!r)throw a;return a},w=function(e,s,l){var f,d,c,v,g=e.length;if(!g||l&&!l.l&&g<5)return s||new t(0);var m=!s||l,T=!l||l.i;l||(l={}),s||(s=new t(3*g));var w,_=function(e){var r=s.length;if(e>r){var a=new t(Math.max(2*r,e));a.set(s),s=a}},C=l.f||0,F=l.p||0,D=l.b||0,M=l.l,A=l.d,E=l.m,I=l.n,R=8*g;do{if(!M){l.f=C=S(e,F,1);var P=S(e,F+1,3);if(F+=3,!P){var O=e[($=((w=F)/8|0)+(7&w&&1)+4)-4]|e[$-3]<<8,G=$+O;if(G>g){T&&k(0);break}m&&_(D+O),s.set(e.subarray($,G),D),l.b=D+=O,l.p=F=8*G;continue}if(1==P)M=y,A=b,E=9,I=5;else if(2==P){var B=S(e,F,31)+257,L=S(e,F+10,15)+4,z=B+S(e,F+5,31)+1;F+=14;for(var W=new t(z),j=new t(19),V=0;V<L;++V)j[o[V]]=S(e,F+3*V,7);F+=3*L;var N=x(j),q=(1<<N)-1,X=p(j,N,1);for(V=0;V<z;){var $,H=X[S(e,F,q)];if(F+=15&H,($=H>>>4)<16)W[V++]=$;else{var Y=0,K=0;for(16==$?(K=3+S(e,F,3),F+=2,Y=W[V-1]):17==$?(K=3+S(e,F,7),F+=3):18==$&&(K=11+S(e,F,127),F+=7);K--;)W[V++]=Y}}var Z=W.subarray(0,B),Q=W.subarray(B);E=x(Z),I=x(Q),M=p(Z,E,1),A=p(Q,I,1)}else k(1);if(F>R){T&&k(0);break}}m&&_(D+131072);for(var J=(1<<E)-1,ee=(1<<I)-1,et=F;;et=F){var er=(Y=M[U(e,F)&J])>>>4;if((F+=15&Y)>R){T&&k(0);break}if(Y||k(2),er<256)s[D++]=er;else{if(256==er){et=F,M=null;break}var ea=er-254;if(er>264){var en=n[V=er-257];ea=S(e,F,(1<<en)-1)+u[V],F+=en}var ei=A[U(e,F)&ee],eo=ei>>>4;if(ei||k(3),F+=15&ei,Q=h[eo],eo>3&&(en=i[eo],Q+=U(e,F)&(1<<en)-1,F+=en),F>R){T&&k(0);break}m&&_(D+131072);for(var es=D+ea;D<es;D+=4)s[D]=s[D-Q],s[D+1]=s[D+1-Q],s[D+2]=s[D+2-Q],s[D+3]=s[D+3-Q];D=es}}l.l=M,l.p=et,l.b=D,M&&(C=1,l.m=E,l.d=A,l.n=I)}while(!C)return D==s.length?s:(f=s,(d=0)<0&&(d=0),(null==(c=D)||c>f.length)&&(c=f.length),(v=new(f instanceof r?r:f instanceof a?a:t)(c-d)).set(f.subarray(d,c)),v)},_=new t(0),C="u">typeof TextDecoder&&new TextDecoder;try{C.decode(_,{stream:!0})}catch(e){}return e.convert_streams=function(e){var t=new DataView(e),r=0;function a(){var e=t.getUint16(r);return r+=2,e}function n(){var e=t.getUint32(r);return r+=4,e}function i(e){m.setUint16(y,e),y+=2}function o(e){m.setUint32(y,e),y+=4}for(var s={signature:n(),flavor:n(),length:n(),numTables:a(),reserved:a(),totalSfntSize:n(),majorVersion:a(),minorVersion:a(),metaOffset:n(),metaLength:n(),metaOrigLength:n(),privOffset:n(),privLength:n()},l=0;Math.pow(2,l)<=s.numTables;)l++;l--;for(var u=16*Math.pow(2,l),f=16*s.numTables-u,h=12,d=[],c=0;c<s.numTables;c++)d.push({tag:n(),offset:n(),compLength:n(),origLength:n(),origChecksum:n()}),h+=16;var v,p=new Uint8Array(12+16*d.length+d.reduce(function(e,t){return e+t.origLength+4},0)),g=p.buffer,m=new DataView(g),y=0;return o(s.flavor),i(s.numTables),i(u),i(l),i(f),d.forEach(function(e){o(e.tag),o(e.origChecksum),o(h),o(e.origLength),e.outOffset=h,(h+=e.origLength)%4!=0&&(h+=4-h%4)}),d.forEach(function(t){var r=e.slice(t.offset,t.offset+t.compLength);if(t.compLength!=t.origLength){var a=new Uint8Array(t.origLength);w(new Uint8Array(r,2),a)}else a=new Uint8Array(r);p.set(a,t.outOffset);var n=0;(h=t.outOffset+t.origLength)%4!=0&&(n=4-h%4),p.set(new Uint8Array(n).buffer,t.outOffset+t.origLength),v=h+n}),g.slice(0,v)},Object.defineProperty(e,"__esModule",{value:!0}),e}({}).convert_streams},function(e,t){let r,a={M:2,L:2,Q:4,C:6,Z:0},n={C:"18g,ca,368,1kz",D:"17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",R:"17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",L:"x9u,jff,a,fd,jv",T:"4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"},i=[null,"isol","init","fina","medi"];function o(t,r){let a=t.GDEF&&t.GDEF.glyphClassDef;return a?e.U._getGlyphClass(r,a):0}function s(...e){for(let t=0;t<e.length;t++)if("number"==typeof e[t])return e[t]}return function(l){var u;let f,h,d,c,v,p,g=new Uint8Array(l,0,4),m=e._bin.readASCII(g,0,4);if("wOFF"===m)l=t(l);else if("wOF2"===m)throw Error("woff2 fonts not supported");return u=e.parse(l)[0],f=Object.create(null),h=u["OS/2"],d=u.hhea,c=u.head.unitsPerEm,v=s(h&&h.sTypoAscender,d&&d.ascender,c),p={unitsPerEm:c,ascender:v,descender:s(h&&h.sTypoDescender,d&&d.descender,0),capHeight:s(h&&h.sCapHeight,v),xHeight:s(h&&h.sxHeight,v),lineGap:s(h&&h.sTypoLineGap,d&&d.lineGap),supportsCodePoint:t=>e.U.codeToGlyph(u,t)>0,forEachGlyph(t,s,l,h){let d=0,c=1/p.unitsPerEm*s,v=function(t,a){let o=[];for(let r=0;r<a.length;r++){let n=a.codePointAt(r);n>65535&&r++,o.push(e.U.codeToGlyph(t,n))}let s=t.GSUB;if(s){let t,{lookupList:l,featureList:u}=s,f=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,h=[];u.forEach(s=>{if(f.test(s.tag))for(let u=0;u<s.tab.length;u++){if(h[s.tab[u]])continue;h[s.tab[u]]=!0;let f=l[s.tab[u]],d=/^(isol|init|fina|medi)$/.test(s.tag);d&&!t&&(t=function(e){let t=new Uint8Array(e.length),a=32,i=1,o=-1;for(let s=0;s<e.length;s++){let l=e.codePointAt(s),u=0|function(e){if(!r){let e={R:2,L:1,D:4,C:16,U:32,T:8};for(let t in r=new Map,n){let a=0;n[t].split(",").forEach(n=>{let[i,o]=n.split("+");i=parseInt(i,36),o=o?parseInt(o,36):0,r.set(a+=i,e[t]);for(let n=o;n--;)r.set(++a,e[t])})}}return r.get(e)||32}(l),f=1;!(8&u)&&(21&a?22&u?(f=3,(1===i||3===i)&&t[o]++):33&u&&(2===i||4===i)&&t[o]--:34&a&&(2===i||4===i)&&t[o]--,i=t[s]=f,a=u,o=s,l>65535&&s++)}return t}(a));for(let r=0;r<o.length;r++)t&&d&&i[t[r]]!==s.tag||e.U._applySubs(o,r,f,l)}})}return o}(u,t),g=0,m=function(t,r){let a=new Int16Array(3*r.length),n=0;for(;n<r.length;n++){let u=r[n];if(-1===u)continue;a[3*n+2]=t.hmtx.aWidth[u];let f=t.GPOS;if(f){let h=f.lookupList;for(let f=0;f<h.length;f++){let d=h[f];for(let f=0;f<d.tabs.length;f++){let h=d.tabs[f];if(1===d.ltype){if(-1!==e._lctf.coverageIndex(h.coverage,u)&&h.pos){l(h.pos,n);break}}else if(2===d.ltype){let t=null,a=i();if(-1!==a){let i=e._lctf.coverageIndex(h.coverage,r[a]);if(-1!==i){if(1===h.fmt){let e=h.pairsets[i];for(let r=0;r<e.length;r++)e[r].gid2===u&&(t=e[r])}else if(2===h.fmt){let n=e.U._getGlyphClass(r[a],h.classDef1),i=e.U._getGlyphClass(u,h.classDef2);t=h.matrix[n][i]}if(t){t.val1&&l(t.val1,a),t.val2&&l(t.val2,n);break}}}}else if(4===d.ltype){let t=e._lctf.coverageIndex(h.markCoverage,u);if(-1!==t){let o=i(s),l=-1===o?-1:e._lctf.coverageIndex(h.baseCoverage,r[o]);if(-1!==l){let e=h.markArray[t],r=h.baseArray[l][e.markClass];a[3*n]=r.x-e.x+a[3*o]-a[3*o+2],a[3*n+1]=r.y-e.y+a[3*o+1];break}}}else if(6===d.ltype){let s=e._lctf.coverageIndex(h.mark1Coverage,u);if(-1!==s){let l=i();if(-1!==l){let i=r[l];if(3===o(t,i)){let t=e._lctf.coverageIndex(h.mark2Coverage,i);if(-1!==t){let e=h.mark1Array[s],r=h.mark2Array[t][e.markClass];a[3*n]=r.x-e.x+a[3*l]-a[3*l+2],a[3*n+1]=r.y-e.y+a[3*l+1];break}}}}}}}}else if(t.kern&&!t.cff){let e=i();if(-1!==e){let n=t.kern.glyph1.indexOf(r[e]);if(-1!==n){let r=t.kern.rval[n].glyph2.indexOf(u);-1!==r&&(a[3*e+2]+=t.kern.rval[n].vals[r])}}}}return a;function i(e){for(let t=n-1;t>=0;t--)if(-1!==r[t]&&(!e||e(r[t])))return t;return -1}function s(e){return 1===o(t,e)}function l(e,t){for(let r=0;r<3;r++)a[3*t+r]+=e[r]||0}}(u,v);return v.forEach((r,n)=>{if(-1!==r){let t=f[r];if(!t){let n,i,o,s,{cmds:l,crds:h}=e.U.glyphToPath(u,r),d="",c=0;for(let e=0,t=l.length;e<t;e++){let t=a[l[e]];d+=l[e];for(let e=1;e<=t;e++)d+=(e>1?",":"")+h[c++]}if(h.length){n=i=1/0,o=s=-1/0;for(let e=0,t=h.length;e<t;e+=2){let t=h[e],r=h[e+1];t<n&&(n=t),r<i&&(i=r),t>o&&(o=t),r>s&&(s=r)}}else n=o=i=s=0;t=f[r]={index:r,advanceWidth:u.hmtx.aWidth[r],xMin:n,yMin:i,xMax:o,yMax:s,path:d}}h.call(null,t,d+m[3*n]*c,m[3*n+1]*c,g),d+=m[3*n+2]*c,l&&(d+=l*s)}g+=t.codePointAt(g)>65535?2:1}),d}}}}],init:(e,t,r)=>r(e(),t())}),H=S({name:"FontResolver",dependencies:[function(e,t){let r=Object.create(null),a=Object.create(null);function n(t,n){let i=r[t];if(i)n(i);else if(a[t])a[t].push(n);else{a[t]=[n];let i=e=>{console.error(`Failure loading font ${t}`,e)};try{let n=new XMLHttpRequest;n.open("get",t,!0),n.responseType="arraybuffer",n.onload=function(){if(n.status>=400)i(Error(n.statusText));else if(n.status>0)try{var o;let i=e(n.response);i.src=t,(o=i).src=t,r[t]=o,a[t].forEach(e=>e(o)),delete a[t]}catch(e){i(e)}},n.onerror=i,n.send()}catch(e){i(e)}}}return function(e,a,{lang:i,fonts:o=[],style:s="normal",weight:l="normal",unicodeFontsURL:u}={}){let f=new Uint8Array(e.length),h=[];e.length||p();let d=new Map,c=[];if("italic"!==s&&(s="normal"),"number"!=typeof l&&(l="bold"===l?700:400),o&&!Array.isArray(o)&&(o=[o]),(o=o.slice().filter(e=>!e.lang||e.lang.test(i)).reverse()).length){let t=0;!function a(i=0){for(let s=i,l=e.length;s<l;s++){let i=e.codePointAt(s);if(1===t&&h[f[s-1]].supportsCodePoint(i)||s>0&&/\s/.test(e[s]))f[s]=f[s-1],2===t&&(c[c.length-1][1]=s);else for(let e=f[s],l=o.length;e<=l;e++)if(e===l)(2===t?c[c.length-1]:c[c.length]=[s,s])[1]=s,t=2;else{f[s]=e;let{src:l,unicodeRange:u}=o[e];if(!u||function(e,t){for(let r=0;r<t.length;r++){let[a,n=a]=t[r];if(a<=e&&e<=n)return!0}return!1}(i,u)){let e=r[l];if(!e)return void n(l,()=>{a(s)});if(e.supportsCodePoint(i)){let r=d.get(e);"number"!=typeof r&&(r=h.length,h.push(e),d.set(e,r)),f[s]=r,t=1;break}}}i>65535&&s+1<l&&(f[s+1]=f[s],s++,2===t&&(c[c.length-1][1]=s))}v()}()}else c.push([0,e.length-1]),v();function v(){if(c.length){let r=c.map(t=>e.substring(t[0],t[1]+1)).join("\n");t.getFontsForString(r,{lang:i||void 0,style:s,weight:l,dataUrl:u}).then(({fontUrls:e,chars:t})=>{let r=h.length,a=0;c.forEach(e=>{for(let n=0,i=e[1]-e[0];n<=i;n++)f[e[0]+n]=t[a++]+r;a++});let i=0;e.forEach((t,a)=>{n(t,t=>{h[a+r]=t,++i===e.length&&p()})})})}else p()}function p(){a({chars:f,fonts:h})}}},$,function(){return function(e){var t=function(){this.buckets=new Map};t.prototype.add=function(e){var t=e>>5;this.buckets.set(t,(this.buckets.get(t)||0)|1<<(31&e))},t.prototype.has=function(e){var t=this.buckets.get(e>>5);return void 0!==t&&0!=(t&1<<(31&e))},t.prototype.serialize=function(){var e=[];return this.buckets.forEach(function(t,r){e.push((+r).toString(36)+":"+t.toString(36))}),e.join(",")},t.prototype.deserialize=function(e){var t=this;this.buckets.clear(),e.split(",").forEach(function(e){var r=e.split(":");t.buckets.set(parseInt(r[0],36),parseInt(r[1],36))})};function r(e,t){var r=255&e,a=t.codePointAt(r/6|0);return 0!=((a=(a||48)-48)&1<<r%6)}function a(e,t){e.replace(/U\+/gi,"").replace(/^,+|,+$/g,"").split(/,+/).map(function(e){return e.split("-").map(function(e){return parseInt(e.trim(),16)})}).forEach(function(e){var r=e[0],a=e[1];void 0===a&&(a=r),function(e,r){for(var a=e;a<=r;a++)t(a)}(r,a)})}var n,i={},o={},s=new WeakMap,l="https://cdn.jsdelivr.net/gh/lojjic/unicode-font-resolver@v1.0.1/packages/data",u=new Map;function f(e,t,r){return e[t]?t:e[r]?r:function(e){for(var t in e)return t}(e)}return e.CodePointSet=t,e.clearCache=function(){i={},o={}},e.getFontsForString=function(e,h){void 0===h&&(h={});var d=h.lang;void 0===d&&(d=/\p{Script=Hangul}/u.test(e)?"ko":/\p{Script=Hiragana}|\p{Script=Katakana}/u.test(e)?"ja":"en");var c=h.category;void 0===c&&(c="sans-serif");var v=h.style;void 0===v&&(v="normal");var p=h.weight;void 0===p&&(p=400);var g=(h.dataUrl||l).replace(/\/$/g,""),m=new Map,y=new Uint8Array(e.length),b={},x={},S=Array(e.length),U=new Map,T=!1;function k(e){var t=u.get(e);return t||(t=fetch(g+"/"+e).then(function(e){if(!e.ok)throw Error(e.statusText);return e.json().then(function(e){if(!Array.isArray(e)||1!==e[0])throw Error("Incorrect schema version; need 1, got "+e[0]);return e[1]})}).catch(function(t){if(g!==l)return T||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+g+'", trying default CDN. '+t.message),T=!0),g=l,u.delete(e),k(e);throw t}),u.set(e,t)),t}for(var w=0;w<e.length;w++)!function(t){var r=e.codePointAt(t),a=function(e){var t=(-256&e).toString(16),r=((-256&e)+256-1).toString(16);return"codepoint-index/plane"+(e>>16)+"/"+t+"-"+r+".json"}(r);S[t]=a,i[a]||U.has(a)||U.set(a,k(a).then(function(e){i[a]=e})),r>65535&&(w=++t)}(w);return Promise.all(U.values()).then(function(){U.clear();for(var t=0;t<e.length;t++)!function(a){var n=e.codePointAt(a),s=null,l=i[S[a]],u=void 0;for(var f in l){var h=x[f];if(void 0===h&&(h=x[f]=new RegExp(f).test(d||"en")),h){for(var c in u=f,l[f])if(r(n,l[f][c])){s=c;break}break}}if(!s){e:for(var v in l)if(v!==u){for(var p in l[v])if(r(n,l[v][p])){s=p;break e}}}s||(console.debug("No font coverage for U+"+n.toString(16)),s="latin"),S[a]=s,o[s]||U.has(s)||U.set(s,k("font-meta/"+s+".json").then(function(e){o[s]=e})),n>65535&&(t=++a)}(t);return Promise.all(U.values())}).then(function(){for(var r,i=null,l=0;l<e.length;l++){var u=e.codePointAt(l);if(i&&(n||(n=new Set,a("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000",function(e){n.add(e)})),n.has(u)||(function(e){var r=s.get(e);return r||(r=new t,a(e.ranges,function(e){return r.add(e)}),s.set(e,r)),r})(i).has(u)))y[l]=y[l-1];else{var h=b[(i=o[S[l]]).id];if(!h){var d=i.typeforms,x=f(d,c,"sans-serif"),U=f(d[x],v,"normal"),T=function(e,t){var r=t;if(!e.includes(r)){r=1/0;for(var a=0;a<e.length;a++)Math.abs(e[a]-t)<Math.abs(r-t)&&(r=e[a])}return r}(null==(r=d[x])?void 0:r[U],p);h=b[i.id]=g+"/font-files/"+i.id+"/"+x+"."+U+"."+T+".woff"}var k=m.get(h);null==k&&(k=m.size,m.set(h,k)),y[l]=k}u>65535&&(y[++l]=y[l-1])}return{fontUrls:Array.from(m.keys()),chars:y}})},Object.defineProperty(e,"__esModule",{value:!0}),e}({})}],init:(e,t,r)=>e(t,r())}),Y=()=>(self.performance||Date).now(),K=k(),Z=[],Q=0;function J(){let e=Y();for(;Z.length&&Y()-e<5;)Z.shift()();Q=Z.length?setTimeout(J,0):0}let ee={},et=0;function er(e,t,r,a,n,i,o,s,l,u){let f="TroikaTextSDFGenerator_JS_"+et++%4,h=ee[f];return h||(h=ee[f]={workerModule:S({name:f,workerId:f,dependencies:[k,Y],init(e,t){let r=e().javascript.generate;return function(...e){let a=t();return{textureData:r(...e),timing:t()-a}}},getTransferables:e=>[e.textureData.buffer]}),requests:0,idleTimer:null}),h.requests++,clearTimeout(h.idleTimer),h.workerModule(e,t,r,a,n,i).then(({textureData:r,timing:a})=>{let n=Y(),i=new Uint8Array(4*r.length);for(let e=0;e<r.length;e++)i[4*e+u]=r[e];return K.webglUtils.renderImageData(o,i,s,l,e,t,1<<3-u),a+=Y()-n,0==--h.requests&&(h.idleTimer=setTimeout(()=>{b[f]&&b[f].forEach(function(e){e()}),y[f]&&(y[f].terminate(),delete y[f])},2e3)),{timing:a}})}let ea=K.webglUtils.resizeWebGLCanvasWithoutClearing,en={defaultFontURL:null,unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048,useWorker:!0},ei=new d.Color;function eo(){return(self.performance||Date).now()}let es=Object.create(null);function el(e,t){e=function(e,t){for(let r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}({},e);let r=eo(),{defaultFontURL:a}=en,n=[];if(a&&n.push({label:"default",src:ef(a)}),e.font&&n.push({label:"user",src:ef(e.font)}),e.font=n,e.text=""+e.text,e.sdfGlyphSize=e.sdfGlyphSize||en.sdfGlyphSize,e.unicodeFontsURL=e.unicodeFontsURL||en.unicodeFontsURL,null!=e.colorRanges){let t={};for(let r in e.colorRanges)if(e.colorRanges.hasOwnProperty(r)){let a=e.colorRanges[r];"number"!=typeof a&&(a=ei.set(a).getHex()),t[r]=a}e.colorRanges=t}Object.freeze(e);let{textureWidth:i,sdfExponent:o}=en,{sdfGlyphSize:s}=e,l=i/s*4,u=es[s];if(!u){var f;let e,t=document.createElement("canvas");t.width=i,t.height=256*s/l,(u=es[s]={glyphCount:0,sdfGlyphSize:s,sdfCanvas:t,sdfTexture:new d.Texture(t,void 0,void 0,void 0,d.LinearFilter,d.LinearFilter),contextLost:!1,glyphsByFont:new Map}).sdfTexture.generateMipmaps=!1,(e=(f=u).sdfCanvas).addEventListener("webglcontextlost",e=>{console.log("Context Lost",e),e.preventDefault(),f.contextLost=!0}),e.addEventListener("webglcontextrestored",e=>{console.log("Context Restored",e),f.contextLost=!1;let t=[];f.glyphsByFont.forEach(e=>{e.forEach(e=>{t.push(eu(e,f,!0))})}),Promise.all(t).then(()=>{eh(f),f.sdfTexture.needsUpdate=!0})})}let{sdfTexture:h,sdfCanvas:c}=u;(en.useWorker?ec:ev)(e).then(a=>{let{glyphIds:n,glyphFontIndices:f,fontData:d,glyphPositions:v,fontSize:p,timings:g}=a,m=[],y=new Float32Array(4*n.length),b=0,x=0,S=eo(),U=d.map(e=>{let t=u.glyphsByFont.get(e.src);return t||u.glyphsByFont.set(e.src,t=new Map),t});n.forEach((e,t)=>{let r=f[t],{src:i,unitsPerEm:o}=d[r],l=U[r].get(e);if(!l){let{path:t,pathBounds:n}=a.glyphData[i][e],o=Math.max(n[2]-n[0],n[3]-n[1])/s*(en.sdfMargin*s+.5),f=u.glyphCount++,h=[n[0]-o,n[1]-o,n[2]+o,n[3]+o];U[r].set(e,l={path:t,atlasIndex:f,sdfViewBox:h}),m.push(l)}let{sdfViewBox:h}=l,c=v[x++],g=v[x++],S=p/o;y[b++]=c+h[0]*S,y[b++]=g+h[1]*S,y[b++]=c+h[2]*S,y[b++]=g+h[3]*S,n[t]=l.atlasIndex}),g.quads=(g.quads||0)+(eo()-S);let T=eo();g.sdf={};let k=c.height,w=Math.pow(2,Math.ceil(Math.log2(Math.ceil(u.glyphCount/l)*s)));w>k&&(console.info(`Increasing SDF texture size ${k}->${w}`),ea(c,i,w),h.dispose()),Promise.all(m.map(t=>eu(t,u,e.gpuAccelerateSDF).then(({timing:e})=>{g.sdf[t.atlasIndex]=e}))).then(()=>{m.length&&!u.contextLost&&(eh(u),h.needsUpdate=!0),g.sdfTotal=eo()-T,g.total=eo()-r,t(Object.freeze({parameters:e,sdfTexture:h,sdfGlyphSize:s,sdfExponent:o,glyphBounds:y,glyphAtlasIndices:n,glyphColors:a.glyphColors,caretPositions:a.caretPositions,chunkedBounds:a.chunkedBounds,ascender:a.ascender,descender:a.descender,lineHeight:a.lineHeight,capHeight:a.capHeight,xHeight:a.xHeight,topBaseline:a.topBaseline,blockBounds:a.blockBounds,visibleBounds:a.visibleBounds,timings:a.timings}))})}),Promise.resolve().then(()=>{!u.contextLost&&(c._warm||(K.webgl.isSupported(c),c._warm=!0))})}function eu({path:e,atlasIndex:r,sdfViewBox:a},{sdfGlyphSize:n,sdfCanvas:i,contextLost:o},s){if(o)return Promise.resolve({timing:-1});let{textureWidth:l,sdfExponent:u}=en,f=Math.max(a[2]-a[0],a[3]-a[1]),h=Math.floor(r/4),d=h%(l/n)*n,c=Math.floor(h/(l/n))*n;return function(e,r,a,n,i,o,s,l,u,f,h=!0){return h?((...e)=>new Promise((t,r)=>{Z.push(()=>{let a=Y();try{K.webgl.generateIntoCanvas(...e),t({timing:Y()-a})}catch(e){r(e)}}),Q||(Q=setTimeout(J,0))}))(e,r,a,n,i,o,s,l,u,f).then(null,h=>(t||(console.warn("WebGL SDF generation failed, falling back to JS",h),t=!0),er(e,r,a,n,i,o,s,l,u,f))):er(e,r,a,n,i,o,s,l,u,f)}(n,n,e,a,f,u,i,d,c,r%4,s)}function ef(e){return r||(r="u"<typeof document?{}:document.createElement("a")),r.href=e,r.href}function eh(e){if("function"!=typeof createImageBitmap){console.info("Safari<15: applying SDF canvas workaround");let{sdfCanvas:t,sdfTexture:r}=e,{width:a,height:n}=t,i=e.sdfCanvas.getContext("webgl"),o=r.image.data;o&&o.length===a*n*4||(o=new Uint8Array(a*n*4),r.image={width:a,height:n,data:o},r.flipY=!1,r.isDataTexture=!0),i.readPixels(0,0,a,n,i.RGBA,i.UNSIGNED_BYTE,o)}}let ed=S({name:"Typesetter",dependencies:[function(e,t){let r=1/0,a=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,n="[^\\S\\u00A0]",i=RegExp(`${n}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function o({text:h="",font:d,lang:c,sdfGlyphSize:v=64,fontSize:p=400,fontWeight:g=1,fontStyle:m="normal",letterSpacing:y=0,lineHeight:b="normal",maxWidth:x=r,direction:S,textAlign:U="left",textIndent:T=0,whiteSpace:k="normal",overflowWrap:w="normal",anchorX:_=0,anchorY:C=0,metricsOnly:F=!1,unicodeFontsURL:D,preResolvedFonts:M=null,includeCaretPositions:A=!1,chunkedBoundsSize:E=8192,colorRanges:I=null},R){let P=u(),O={fontLoad:0,typesetting:0};h.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),h=h.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),p*=1,y*=1,x*=1,b=b||"normal",T*=1,function({text:t,lang:r,fonts:a,style:n,weight:i,preResolvedFonts:o,unicodeFontsURL:s},l){let u=({chars:e,fonts:t})=>{let r,a,n=[];for(let i=0;i<e.length;i++)e[i]!==a?(a=e[i],n.push(r={start:i,end:i,fontObj:t[e[i]]})):r.end=i;l(n)};o?u(o):e(t,u,{lang:r,fonts:a,style:n,weight:i,unicodeFontsURL:s})}({text:h,lang:c,style:m,weight:g,fonts:"string"==typeof d?[{src:d}]:d,unicodeFontsURL:D,preResolvedFonts:M},e=>{O.fontLoad=u()-P;let o=isFinite(x),d=null,c=null,v=null,g=null,m=null,D=null,M=null,G=null,B=0,L=0,z="nowrap"!==k,W=new Map,j=u(),V=T,N=0,q=new f,X=[q];e.forEach(e=>{let t,r,{fontObj:s}=e,{ascender:l,descender:u,unitsPerEm:d,lineGap:c,capHeight:v,xHeight:g}=s,m=W.get(s);if(!m){let e=p/d,t="normal"===b?(l-u+c)*e:b*p,r=(t-(l-u)*e)/2,a=Math.min(t,(l-u)*e),n=(l+u)/2*e+a/2;m={index:W.size,src:s.src,fontObj:s,fontSizeMult:e,unitsPerEm:d,ascender:l*e,descender:u*e,capHeight:v*e,xHeight:g*e,lineHeight:t,baseline:-r-l*e,caretTop:n,caretBottom:n-a},W.set(s,m)}let{fontSizeMult:S}=m,U=h.slice(e.start,e.end+1);s.forEachGlyph(U,p,y,(s,l,u,d)=>{let c;l+=N,d+=e.start,t=l,r=s;let v=h.charAt(d),g=s.advanceWidth*S,b=q.count;if("isEmpty"in s||(s.isWhitespace=!!v&&new RegExp(n).test(v),s.canBreakAfter=!!v&&i.test(v),s.isEmpty=s.xMin===s.xMax||s.yMin===s.yMax||a.test(v)),!s.isWhitespace&&!s.isEmpty&&L++,z&&o&&!s.isWhitespace&&l+g+V>x&&b){if(q.glyphAt(b-1).glyphObj.canBreakAfter)c=new f,V=-l;else for(let e=b;e--;)if(0===e&&"break-word"===w){c=new f,V=-l;break}else if(q.glyphAt(e).glyphObj.canBreakAfter){let t=(c=q.splitAt(e+1)).glyphAt(0).x;V-=t;for(let e=c.count;e--;)c.glyphAt(e).x-=t;break}c&&(q.isSoftWrapped=!0,q=c,X.push(q),B=x)}let U=q.glyphAt(q.count);U.glyphObj=s,U.x=l+V,U.y=u,U.width=g,U.charIndex=d,U.fontData=m,"\n"===v&&(q=new f,X.push(q),V=-(l+g+y*p)+T)}),N=t+r.advanceWidth*S+y*p});let $=0;X.forEach(e=>{let t=!0;for(let r=e.count;r--;){let a=e.glyphAt(r);t&&!a.glyphObj.isWhitespace&&(e.width=a.x+a.width,e.width>B&&(B=e.width),t=!1);let{lineHeight:n,capHeight:i,xHeight:o,baseline:s}=a.fontData;n>e.lineHeight&&(e.lineHeight=n);let l=s-e.baseline;l<0&&(e.baseline+=l,e.cap+=l,e.ex+=l),e.cap=Math.max(e.cap,e.baseline+i),e.ex=Math.max(e.ex,e.baseline+o)}e.baseline-=$,e.cap-=$,e.ex-=$,$+=e.lineHeight});let H=0,Y=0;if(_&&("number"==typeof _?H=-_:"string"==typeof _&&(H=-B*("left"===_?0:"center"===_?.5:"right"===_?1:s(_)))),C&&("number"==typeof C?Y=-C:"string"==typeof C&&(Y="top"===C?0:"top-baseline"===C?-X[0].baseline:"top-cap"===C?-X[0].cap:"top-ex"===C?-X[0].ex:"middle"===C?$/2:"bottom"===C?$:"bottom-baseline"===C?-X[X.length-1].baseline:s(C)*$)),!F){let e,a,n=t.getEmbeddingLevels(h,S);d=new Uint16Array(L),c=new Uint8Array(L),v=new Float32Array(2*L),g={},M=[r,r,-r,-r],G=[],A&&(D=new Float32Array(4*h.length)),I&&(m=new Uint8Array(3*L));let i=0,o=-1,s=-1;if(X.forEach((u,f)=>{let{count:p,width:y}=u;if(p>0){let f,b=0;for(let e=p;e--&&u.glyphAt(e).glyphObj.isWhitespace;)b++;let x=0,S=0;if("center"===U)x=(B-y)/2;else if("right"===U)x=B-y;else if("justify"===U&&u.isSoftWrapped){let e=0;for(let t=p-b;t--;)u.glyphAt(t).glyphObj.isWhitespace&&e++;S=(B-y)/e}if(S||x){let e=0;for(let t=0;t<p;t++){let r=u.glyphAt(t),a=r.glyphObj;r.x+=x+e,0!==S&&a.isWhitespace&&t<p-b&&(e+=S,r.width+=S)}}let T=t.getReorderSegments(h,n,u.glyphAt(0).charIndex,u.glyphAt(u.count-1).charIndex);for(let e=0;e<T.length;e++){let[t,r]=T[e],a=1/0,n=-1/0;for(let e=0;e<p;e++)if(u.glyphAt(e).charIndex>=t){let t=e,i=e;for(;i<p;i++){let e=u.glyphAt(i);if(e.charIndex>r)break;i<p-b&&(a=Math.min(a,e.x),n=Math.max(n,e.x+e.width))}for(let e=t;e<i;e++){let t=u.glyphAt(e);t.x=n-(t.x+t.width-a)}break}}let k=e=>f=e;for(let y=0;y<p;y++){let p=u.glyphAt(y),b=(f=p.glyphObj).index,x=1&n.levels[p.charIndex];if(x){let e=t.getMirroredCharacter(h[p.charIndex]);e&&p.fontData.fontObj.forEachGlyph(e,0,0,k)}if(A){let{charIndex:e,fontData:t}=p,r=p.x+H,a=p.x+p.width+H;D[4*e]=x?a:r,D[4*e+1]=x?r:a,D[4*e+2]=u.baseline+t.caretBottom+Y,D[4*e+3]=u.baseline+t.caretTop+Y;let n=e-o;n>1&&l(D,o,n),o=e}if(I){let{charIndex:e}=p;for(;e>s;)s++,I.hasOwnProperty(s)&&(a=I[s])}if(!f.isWhitespace&&!f.isEmpty){let t=i++,{fontSizeMult:n,src:o,index:s}=p.fontData,l=g[o]||(g[o]={});l[b]||(l[b]={path:f.path,pathBounds:[f.xMin,f.yMin,f.xMax,f.yMax]});let h=p.x+H,y=p.y+u.baseline+Y;v[2*t]=h,v[2*t+1]=y;let x=h+f.xMin*n,S=y+f.yMin*n,U=h+f.xMax*n,T=y+f.yMax*n;x<M[0]&&(M[0]=x),S<M[1]&&(M[1]=S),U>M[2]&&(M[2]=U),T>M[3]&&(M[3]=T),t%E==0&&(e={start:t,end:t,rect:[r,r,-r,-r]},G.push(e)),e.end++;let k=e.rect;if(x<k[0]&&(k[0]=x),S<k[1]&&(k[1]=S),U>k[2]&&(k[2]=U),T>k[3]&&(k[3]=T),d[t]=b,c[t]=s,I){let e=3*t;m[e]=a>>16&255,m[e+1]=a>>8&255,m[e+2]=255&a}}}}}),D){let e=h.length-o;e>1&&l(D,o,e)}}let K=[];W.forEach(({index:e,src:t,unitsPerEm:r,ascender:a,descender:n,lineHeight:i,capHeight:o,xHeight:s})=>{K[e]={src:t,unitsPerEm:r,ascender:a,descender:n,lineHeight:i,capHeight:o,xHeight:s}}),O.typesetting=u()-j,R({glyphIds:d,glyphFontIndices:c,glyphPositions:v,glyphData:g,fontData:K,caretPositions:D,glyphColors:m,chunkedBounds:G,fontSize:p,topBaseline:Y+X[0].baseline,blockBounds:[H,Y-$,H+B,Y],visibleBounds:M,timings:O})})}function s(e){let t=e.match(/^([\d.]+)%$/),r=t?parseFloat(t[1]):NaN;return isNaN(r)?0:r/100}function l(e,t,r){let a=e[4*t],n=e[4*t+1],i=e[4*t+2],o=e[4*t+3],s=(n-a)/r;for(let n=0;n<r;n++){let r=(t+n)*4;e[r]=a+s*n,e[r+1]=a+s*(n+1),e[r+2]=i,e[r+3]=o}}function u(){return(self.performance||Date).now()}function f(){this.data=[]}let h=["glyphObj","x","y","width","charIndex","fontData"];return f.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/h.length)},glyphAt(e){let t=f.flyweight;return t.data=this.data,t.index=e,t},splitAt(e){let t=new f;return t.data=this.data.splice(e*h.length),t}},f.flyweight=h.reduce((e,t,r,a)=>(Object.defineProperty(e,t,{get(){return this.data[this.index*h.length+r]},set(e){this.data[this.index*h.length+r]=e}}),e),{data:null,index:0}),{typeset:o,measure:function(e,t){o({...e,metricsOnly:!0},e=>{let[r,a,n,i]=e.blockBounds;t({width:n-r,height:i-a})})}}},H,function(){return function(e){var t,r,a,n,i={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},o={},s={};o.L=1,s[1]="L",Object.keys(i).forEach(function(e,t){o[e]=1<<t+1,s[o[e]]=e}),Object.freeze(o);var l=o.LRI|o.RLI|o.FSI,u=o.L|o.R|o.AL,f=o.B|o.S|o.WS|o.ON|o.FSI|o.LRI|o.RLI|o.PDI,h=o.BN|o.RLE|o.LRE|o.RLO|o.LRO|o.PDF,d=o.S|o.WS|o.B|l|o.PDI|h,c=null;function v(e){if(!c){c=new Map;var t=function(e){if(i.hasOwnProperty(e)){var t=0;i[e].split(",").forEach(function(r){var a=r.split("+"),n=a[0],i=a[1];n=parseInt(n,36),i=i?parseInt(i,36):0,c.set(t+=n,o[e]);for(var s=0;s<i;s++)c.set(++t,o[e])})}};for(var r in i)t(r)}return c.get(e.codePointAt(0))||o.L}function p(e,t){var r,a=0,n=new Map,i=t&&new Map;return e.split(",").forEach(function e(o){if(-1!==o.indexOf("+"))for(var s=+o;s--;)e(r);else{r=o;var l=o.split(">"),u=l[0],f=l[1];u=String.fromCodePoint(a+=parseInt(u,36)),f=String.fromCodePoint(a+=parseInt(f,36)),n.set(u,f),t&&i.set(f,u)}}),{map:n,reverseMap:i}}function g(){if(!t){var e=p("14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",!0),n=e.map,i=e.reverseMap;t=n,r=i,a=p("6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye",!1).map}}function m(e){return g(),t.get(e)||null}function y(e){return g(),r.get(e)||null}function b(e){return g(),a.get(e)||null}var x=o.L,S=o.R,U=o.EN,T=o.ES,k=o.ET,w=o.AN,_=o.CS,C=o.B,F=o.S,D=o.ON,M=o.BN,A=o.NSM,E=o.AL,I=o.LRO,R=o.RLO,P=o.LRE,O=o.RLE,G=o.PDF,B=o.LRI,L=o.RLI,z=o.FSI,W=o.PDI;function j(e){if(!n){var t=p("14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",!0),r=t.map;t.reverseMap.forEach(function(e,t){r.set(t,e)}),n=r}return n.get(e)||null}function V(e,t,r,a){var n=e.length;r=Math.max(0,null==r?0:+r),a=Math.min(n-1,null==a?n-1:+a);var i=[];return t.paragraphs.forEach(function(n){var o=Math.max(r,n.start),s=Math.min(a,n.end);if(o<s){for(var l=t.levels.slice(o,s+1),u=s;u>=o&&v(e[u])&d;u--)l[u]=n.level;for(var f=n.level,h=1/0,c=0;c<l.length;c++){var p=l[c];p>f&&(f=p),p<h&&(h=1|p)}for(var g=f;g>=h;g--)for(var m=0;m<l.length;m++)if(l[m]>=g){for(var y=m;m+1<l.length&&l[m+1]>=g;)m++;m>y&&i.push([y+o,m+o])}}}),i}function N(e,t,r,a){for(var n=V(e,t,r,a),i=[],o=0;o<e.length;o++)i[o]=o;return n.forEach(function(e){for(var t=e[0],r=e[1],a=i.slice(t,r+1),n=a.length;n--;)i[r-n]=a[n]}),i}return e.closingToOpeningBracket=y,e.getBidiCharType=v,e.getBidiCharTypeName=function(e){return s[v(e)]},e.getCanonicalBracket=b,e.getEmbeddingLevels=function(e,t){for(var r=new Uint32Array(e.length),a=0;a<e.length;a++)r[a]=v(e[a]);var n=new Map;function i(e,t){var a=r[e];r[e]=t,n.set(a,n.get(a)-1),a&f&&n.set(f,n.get(f)-1),n.set(t,(n.get(t)||0)+1),t&f&&n.set(f,(n.get(f)||0)+1)}for(var o=new Uint8Array(e.length),s=new Map,c=[],p=null,g=0;g<e.length;g++)p||c.push(p={start:g,end:e.length-1,level:"rtl"===t?1:"ltr"===t?0:tM(g,!1)}),r[g]&C&&(p.end=g,p=null);for(var j=O|P|R|I|l|W|G|C,V=function(e){return e+(1&e?1:2)},N=function(e){return e+(1&e?2:1)},q=0;q<c.length;q++){var X=[{_level:(p=c[q]).level,_override:0,_isolate:0}],$=void 0,H=0,Y=0,K=0;n.clear();for(var Z=p.start;Z<=p.end;Z++){var Q=r[Z];if($=X[X.length-1],n.set(Q,(n.get(Q)||0)+1),Q&f&&n.set(f,(n.get(f)||0)+1),Q&j)if(Q&(O|P)){o[Z]=$._level;var J=(Q===O?N:V)($._level);!(J<=125)||H||Y?!H&&Y++:X.push({_level:J,_override:0,_isolate:0})}else if(Q&(R|I)){o[Z]=$._level;var ee=(Q===R?N:V)($._level);!(ee<=125)||H||Y?!H&&Y++:X.push({_level:ee,_override:Q&R?S:x,_isolate:0})}else if(Q&l){Q&z&&(Q=1===tM(Z+1,!0)?L:B),o[Z]=$._level,$._override&&i(Z,$._override);var et=(Q===L?N:V)($._level);et<=125&&0===H&&0===Y?(K++,X.push({_level:et,_override:0,_isolate:1,_isolInitIndex:Z})):H++}else if(Q&W){if(H>0)H--;else if(K>0){for(Y=0;!X[X.length-1]._isolate;)X.pop();var er=X[X.length-1]._isolInitIndex;null!=er&&(s.set(er,Z),s.set(Z,er)),X.pop(),K--}$=X[X.length-1],o[Z]=$._level,$._override&&i(Z,$._override)}else Q&G?(0===H&&(Y>0?Y--:!$._isolate&&X.length>1&&(X.pop(),$=X[X.length-1])),o[Z]=$._level):Q&C&&(o[Z]=p.level);else o[Z]=$._level,$._override&&Q!==M&&i(Z,$._override)}for(var ea=[],en=null,ei=p.start;ei<=p.end;ei++){var eo=r[ei];if(!(eo&h)){var es=o[ei],el=eo&l,eu=eo===W;en&&es===en._level?(en._end=ei,en._endsWithIsolInit=el):ea.push(en={_start:ei,_end:ei,_level:es,_startsWithPDI:eu,_endsWithIsolInit:el})}}for(var ef=[],eh=0;eh<ea.length;eh++){var ed=ea[eh];if(!ed._startsWithPDI||ed._startsWithPDI&&!s.has(ed._start)){for(var ec=[en=ed],ev=void 0;en&&en._endsWithIsolInit&&null!=(ev=s.get(en._end));)for(var ep=eh+1;ep<ea.length;ep++)if(ea[ep]._start===ev){ec.push(en=ea[ep]);break}for(var eg=[],em=0;em<ec.length;em++)for(var ey=ec[em],eb=ey._start;eb<=ey._end;eb++)eg.push(eb);for(var ex=o[eg[0]],eS=p.level,eU=eg[0]-1;eU>=0;eU--)if(!(r[eU]&h)){eS=o[eU];break}var eT=eg[eg.length-1],ek=o[eT],ew=p.level;if(!(r[eT]&l)){for(var e_=eT+1;e_<=p.end;e_++)if(!(r[e_]&h)){ew=o[e_];break}}ef.push({_seqIndices:eg,_sosType:Math.max(eS,ex)%2?S:x,_eosType:Math.max(ew,ek)%2?S:x})}}for(var eC=0;eC<ef.length;eC++){var eF=ef[eC],eD=eF._seqIndices,eM=eF._sosType,eA=eF._eosType,eE=1&o[eD[0]]?S:x;if(n.get(A))for(var eI=0;eI<eD.length;eI++){var eR=eD[eI];if(r[eR]&A){for(var eP=eM,eO=eI-1;eO>=0;eO--)if(!(r[eD[eO]]&h)){eP=r[eD[eO]];break}i(eR,eP&(l|W)?D:eP)}}if(n.get(U))for(var eG=0;eG<eD.length;eG++){var eB=eD[eG];if(r[eB]&U)for(var eL=eG-1;eL>=-1;eL--){var ez=-1===eL?eM:r[eD[eL]];if(ez&u){ez===E&&i(eB,w);break}}}if(n.get(E))for(var eW=0;eW<eD.length;eW++){var ej=eD[eW];r[ej]&E&&i(ej,S)}if(n.get(T)||n.get(_))for(var eV=1;eV<eD.length-1;eV++){var eN=eD[eV];if(r[eN]&(T|_)){for(var eq=0,eX=0,e$=eV-1;e$>=0&&(eq=r[eD[e$]])&h;e$--);for(var eH=eV+1;eH<eD.length&&(eX=r[eD[eH]])&h;eH++);eq===eX&&(r[eN]===T?eq===U:eq&(U|w))&&i(eN,eq)}}if(n.get(U)){for(var eY=0;eY<eD.length;eY++)if(r[eD[eY]]&U){for(var eK=eY-1;eK>=0&&r[eD[eK]]&(k|h);eK--)i(eD[eK],U);for(eY++;eY<eD.length&&r[eD[eY]]&(k|h|U);eY++)r[eD[eY]]!==U&&i(eD[eY],U)}}if(n.get(k)||n.get(T)||n.get(_))for(var eZ=0;eZ<eD.length;eZ++){var eQ=eD[eZ];if(r[eQ]&(k|T|_)){i(eQ,D);for(var eJ=eZ-1;eJ>=0&&r[eD[eJ]]&h;eJ--)i(eD[eJ],D);for(var e1=eZ+1;e1<eD.length&&r[eD[e1]]&h;e1++)i(eD[e1],D)}}if(n.get(U))for(var e2=0,e0=eM;e2<eD.length;e2++){var e3=eD[e2],e4=r[e3];e4&U?e0===x&&i(e3,x):e4&u&&(e0=e4)}if(n.get(f)){for(var e5=S|U|w,e6=e5|x,e8=[],e7=[],e9=0;e9<eD.length;e9++)if(r[eD[e9]]&f){var te=e[eD[e9]],tt=void 0;if(null!==m(te))if(e7.length<63)e7.push({char:te,seqIndex:e9});else break;else if(null!==(tt=y(te)))for(var tr=e7.length-1;tr>=0;tr--){var ta=e7[tr].char;if(ta===tt||ta===y(b(te))||m(b(ta))===te){e8.push([e7[tr].seqIndex,e9]),e7.length=tr;break}}}e8.sort(function(e,t){return e[0]-t[0]});for(var tn=0;tn<e8.length;tn++){for(var ti=e8[tn],to=ti[0],ts=ti[1],tl=!1,tu=0,tf=to+1;tf<ts;tf++){var th=eD[tf];if(r[th]&e6){tl=!0;var td=r[th]&e5?S:x;if(td===eE){tu=td;break}}}if(tl&&!tu){tu=eM;for(var tc=to-1;tc>=0;tc--){var tv=eD[tc];if(r[tv]&e6){var tp=r[tv]&e5?S:x;tu=tp!==eE?tp:eE;break}}}if(tu){if(r[eD[to]]=r[eD[ts]]=tu,tu!==eE){for(var tg=to+1;tg<eD.length;tg++)if(!(r[eD[tg]]&h)){v(e[eD[tg]])&A&&(r[eD[tg]]=tu);break}}if(tu!==eE){for(var tm=ts+1;tm<eD.length;tm++)if(!(r[eD[tm]]&h)){v(e[eD[tm]])&A&&(r[eD[tm]]=tu);break}}}}for(var ty=0;ty<eD.length;ty++)if(r[eD[ty]]&f){for(var tb=ty,tx=ty,tS=eM,tU=ty-1;tU>=0;tU--)if(r[eD[tU]]&h)tb=tU;else{tS=r[eD[tU]]&e5?S:x;break}for(var tT=eA,tk=ty+1;tk<eD.length;tk++)if(r[eD[tk]]&(f|h))tx=tk;else{tT=r[eD[tk]]&e5?S:x;break}for(var tw=tb;tw<=tx;tw++)r[eD[tw]]=tS===tT?tS:eE;ty=tx}}}for(var t_=p.start;t_<=p.end;t_++){var tC=o[t_],tF=r[t_];if(1&tC?tF&(x|U|w)&&o[t_]++:tF&S?o[t_]++:tF&(w|U)&&(o[t_]+=2),tF&h&&(o[t_]=0===t_?p.level:o[t_-1]),t_===p.end||v(e[t_])&(F|C))for(var tD=t_;tD>=0&&v(e[tD])&d;tD--)o[tD]=p.level}}return{levels:o,paragraphs:c};function tM(t,a){for(var n=t;n<e.length;n++){var i=r[n];if(i&(S|E))return 1;if(i&(C|x)||a&&i===W)break;if(i&l){var o=function(t){for(var a=1,n=t+1;n<e.length;n++){var i=r[n];if(i&C)break;if(i&W){if(0==--a)return n}else i&l&&a++}return -1}(n);n=-1===o?e.length:o}}return 0}},e.getMirroredCharacter=j,e.getMirroredCharactersMap=function(e,t,r,a){var n=e.length;r=Math.max(0,null==r?0:+r),a=Math.min(n-1,null==a?n-1:+a);for(var i=new Map,o=r;o<=a;o++)if(1&t[o]){var s=j(e[o]);null!==s&&i.set(o,s)}return i},e.getReorderSegments=V,e.getReorderedIndices=N,e.getReorderedString=function(e,t,r,a){var n=N(e,t,r,a),i=[].concat(e);return n.forEach(function(r,a){i[a]=(1&t.levels[r]?j(e[r]):null)||e[r]}),i.join("")},e.openingToClosingBracket=m,Object.defineProperty(e,"__esModule",{value:!0}),e}({})}],init:(e,t,r)=>e(t,r())}),ec=S({name:"Typesetter",dependencies:[ed],init:e=>function(t){return new Promise(r=>{e.typeset(t,r)})},getTransferables(e){let t=[];for(let r in e)e[r]&&e[r].buffer&&t.push(e[r].buffer);return t}}),ev=ec.onMainThread,ep={},eg="aTroikaGlyphIndex";class em extends d.InstancedBufferGeometry{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new d.Sphere,this.boundingBox=new d.Box3}computeBoundingSphere(){}computeBoundingBox(){}set detail(e){if(e!==this._detail){var t;let r;this._detail=e,("number"!=typeof e||e<1)&&(e=1);let a=((r=ep[t=e])||(r=ep[t]=new d.PlaneGeometry(1,1,t,t).translate(.5,.5,0)),r);["position","normal","uv"].forEach(e=>{this.attributes[e]=a.attributes[e].clone()}),this.setIndex(a.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,t,r,a,n){this.updateAttributeData("aTroikaGlyphBounds",e,4),this.updateAttributeData(eg,t,1),this.updateAttributeData("aTroikaGlyphColor",n,3),this._blockBounds=r,this._chunkedBounds=a,this.instanceCount=t.length,this._updateBounds()}_updateBounds(){let e=this._blockBounds;if(e){let{curveRadius:t,boundingBox:r}=this;if(t){let{PI:a,floor:n,min:i,max:o,sin:s,cos:l}=Math,u=a/2,f=2*a,h=Math.abs(t),d=e[0]/h,c=e[2]/h,v=n((d+u)/f)!==n((c+u)/f)?-h:i(s(d)*h,s(c)*h),p=n((d-u)/f)!==n((c-u)/f)?h:o(s(d)*h,s(c)*h),g=n((d+a)/f)!==n((c+a)/f)?2*h:o(h-l(d)*h,h-l(c)*h);r.min.set(v,e[1],t<0?-g:0),r.max.set(p,e[3],t<0?0:g)}else r.min.set(e[0],e[1],0),r.max.set(e[2],e[3],0);r.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let t=this.getAttribute(eg).count,r=this._chunkedBounds;if(r)for(let a=r.length;a--;){t=r[a].end;let n=r[a].rect;if(n[1]<e.w&&n[3]>e.y&&n[0]<e.z&&n[2]>e.x)break}this.instanceCount=t}updateAttributeData(e,t,r){let a=this.getAttribute(e);t?a&&a.array.length===t.length?(a.array.set(t),a.needsUpdate=!0):(this.setAttribute(e,new d.InstancedBufferAttribute(t,r)),delete this._maxInstanceCount,this.dispose()):a&&this.deleteAttribute(e)}}let ey=`
|
|
87
|
-
uniform vec2 uTroikaSDFTextureSize;
|
|
88
|
-
uniform float uTroikaSDFGlyphSize;
|
|
89
|
-
uniform vec4 uTroikaTotalBounds;
|
|
90
|
-
uniform vec4 uTroikaClipRect;
|
|
91
|
-
uniform mat3 uTroikaOrient;
|
|
92
|
-
uniform bool uTroikaUseGlyphColors;
|
|
93
|
-
uniform float uTroikaEdgeOffset;
|
|
94
|
-
uniform float uTroikaBlurRadius;
|
|
95
|
-
uniform vec2 uTroikaPositionOffset;
|
|
96
|
-
uniform float uTroikaCurveRadius;
|
|
97
|
-
attribute vec4 aTroikaGlyphBounds;
|
|
98
|
-
attribute float aTroikaGlyphIndex;
|
|
99
|
-
attribute vec3 aTroikaGlyphColor;
|
|
100
|
-
varying vec2 vTroikaGlyphUV;
|
|
101
|
-
varying vec4 vTroikaTextureUVBounds;
|
|
102
|
-
varying float vTroikaTextureChannel;
|
|
103
|
-
varying vec3 vTroikaGlyphColor;
|
|
104
|
-
varying vec2 vTroikaGlyphDimensions;
|
|
105
|
-
`,eb=`
|
|
106
|
-
vec4 bounds = aTroikaGlyphBounds;
|
|
107
|
-
bounds.xz += uTroikaPositionOffset.x;
|
|
108
|
-
bounds.yw -= uTroikaPositionOffset.y;
|
|
109
|
-
|
|
110
|
-
vec4 outlineBounds = vec4(
|
|
111
|
-
bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius,
|
|
112
|
-
bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius
|
|
113
|
-
);
|
|
114
|
-
vec4 clippedBounds = vec4(
|
|
115
|
-
clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),
|
|
116
|
-
clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)
|
|
117
|
-
);
|
|
118
|
-
|
|
119
|
-
vec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);
|
|
120
|
-
|
|
121
|
-
position.xy = mix(bounds.xy, bounds.zw, clippedXY);
|
|
122
|
-
|
|
123
|
-
uv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);
|
|
124
|
-
|
|
125
|
-
float rad = uTroikaCurveRadius;
|
|
126
|
-
if (rad != 0.0) {
|
|
127
|
-
float angle = position.x / rad;
|
|
128
|
-
position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);
|
|
129
|
-
normal.xz = vec2(sin(angle), cos(angle));
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
position = uTroikaOrient * position;
|
|
133
|
-
normal = uTroikaOrient * normal;
|
|
134
|
-
|
|
135
|
-
vTroikaGlyphUV = clippedXY.xy;
|
|
136
|
-
vTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
float txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;
|
|
140
|
-
vec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;
|
|
141
|
-
vec2 txStartUV = txUvPerSquare * vec2(
|
|
142
|
-
mod(floor(aTroikaGlyphIndex / 4.0), txCols),
|
|
143
|
-
floor(floor(aTroikaGlyphIndex / 4.0) / txCols)
|
|
144
|
-
);
|
|
145
|
-
vTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);
|
|
146
|
-
vTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);
|
|
147
|
-
`,ex=`
|
|
148
|
-
uniform sampler2D uTroikaSDFTexture;
|
|
149
|
-
uniform vec2 uTroikaSDFTextureSize;
|
|
150
|
-
uniform float uTroikaSDFGlyphSize;
|
|
151
|
-
uniform float uTroikaSDFExponent;
|
|
152
|
-
uniform float uTroikaEdgeOffset;
|
|
153
|
-
uniform float uTroikaFillOpacity;
|
|
154
|
-
uniform float uTroikaBlurRadius;
|
|
155
|
-
uniform vec3 uTroikaStrokeColor;
|
|
156
|
-
uniform float uTroikaStrokeWidth;
|
|
157
|
-
uniform float uTroikaStrokeOpacity;
|
|
158
|
-
uniform bool uTroikaSDFDebug;
|
|
159
|
-
varying vec2 vTroikaGlyphUV;
|
|
160
|
-
varying vec4 vTroikaTextureUVBounds;
|
|
161
|
-
varying float vTroikaTextureChannel;
|
|
162
|
-
varying vec2 vTroikaGlyphDimensions;
|
|
163
|
-
|
|
164
|
-
float troikaSdfValueToSignedDistance(float alpha) {
|
|
165
|
-
// Inverse of exponential encoding in webgl-sdf-generator
|
|
166
|
-
|
|
167
|
-
float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);
|
|
168
|
-
float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;
|
|
169
|
-
float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);
|
|
170
|
-
return signedDist;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
float troikaGlyphUvToSdfValue(vec2 glyphUV) {
|
|
174
|
-
vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);
|
|
175
|
-
vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);
|
|
176
|
-
float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1
|
|
177
|
-
return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
float troikaGlyphUvToDistance(vec2 uv) {
|
|
181
|
-
return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
float troikaGetAADist() {
|
|
185
|
-
|
|
186
|
-
#if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300
|
|
187
|
-
return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;
|
|
188
|
-
#else
|
|
189
|
-
return vTroikaGlyphDimensions.x / 64.0;
|
|
190
|
-
#endif
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
float troikaGetFragDistValue() {
|
|
194
|
-
vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);
|
|
195
|
-
float distance = troikaGlyphUvToDistance(clampedGlyphUV);
|
|
196
|
-
|
|
197
|
-
// Extrapolate distance when outside bounds:
|
|
198
|
-
distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 :
|
|
199
|
-
length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return distance;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
float troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {
|
|
207
|
-
#if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)
|
|
208
|
-
float alpha = step(-distanceOffset, -distance);
|
|
209
|
-
#else
|
|
210
|
-
|
|
211
|
-
float alpha = smoothstep(
|
|
212
|
-
distanceOffset + aaDist,
|
|
213
|
-
distanceOffset - aaDist,
|
|
214
|
-
distance
|
|
215
|
-
);
|
|
216
|
-
#endif
|
|
217
|
-
|
|
218
|
-
return alpha;
|
|
219
|
-
}
|
|
220
|
-
`,eS=`
|
|
221
|
-
float aaDist = troikaGetAADist();
|
|
222
|
-
float fragDistance = troikaGetFragDistValue();
|
|
223
|
-
float edgeAlpha = uTroikaSDFDebug ?
|
|
224
|
-
troikaGlyphUvToSdfValue(vTroikaGlyphUV) :
|
|
225
|
-
troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius));
|
|
226
|
-
|
|
227
|
-
#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)
|
|
228
|
-
vec4 fillRGBA = gl_FragColor;
|
|
229
|
-
fillRGBA.a *= uTroikaFillOpacity;
|
|
230
|
-
vec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);
|
|
231
|
-
if (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;
|
|
232
|
-
gl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(
|
|
233
|
-
-uTroikaStrokeWidth - aaDist,
|
|
234
|
-
-uTroikaStrokeWidth + aaDist,
|
|
235
|
-
fragDistance
|
|
236
|
-
));
|
|
237
|
-
gl_FragColor.a *= edgeAlpha;
|
|
238
|
-
#endif
|
|
239
|
-
|
|
240
|
-
if (edgeAlpha == 0.0) {
|
|
241
|
-
discard;
|
|
242
|
-
}
|
|
243
|
-
`,eU=new d.MeshBasicMaterial({color:0xffffff,side:d.DoubleSide,transparent:!0}),eT=new d.Matrix4,ek=new d.Vector3,ew=new d.Vector3,e_=[],eC=new d.Vector3,eF="+x+y";function eD(e){return Array.isArray(e)?e[0]:e}let eM=()=>{let e=new d.Mesh(new d.PlaneGeometry(1,1),eU);return eM=()=>e,e},eA=()=>{let e=new d.Mesh(new d.PlaneGeometry(1,1,32,1),eU);return eA=()=>e,e},eE={type:"syncstart"},eI={type:"synccomplete"},eR=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],eP=eR.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class eO extends d.Mesh{constructor(){super(new em,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=8421504,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=eF,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(eE),el({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);let r=this._queuedSyncs;r&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{r.forEach(e=>e&&e())})),this.dispatchEvent(eI),e&&e()})))}onBeforeRender(e,t,r,a,n,i){this.sync(),n.isTroikaTextMaterial&&this._prepareForRender(n)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){let t;return(t=P(e,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new d.Vector2},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new d.Vector4(0,0,0,0)},uTroikaClipRect:{value:new d.Vector4(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new d.Vector2},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new d.Color},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new d.Matrix3},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:ey,vertexTransform:eb,fragmentDefs:ex,fragmentColorTransform:eS,customRewriter({vertexShader:e,fragmentShader:t}){let r=/\buniform\s+vec3\s+diffuse\b/;return r.test(t)&&(t=t.replace(r,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),r.test(e)||(e=e.replace(C,"uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n"))),{vertexShader:e,fragmentShader:t}}})).transparent=!0,t.forceSinglePass=!0,Object.defineProperties(t,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),t}get material(){let e=this._derivedMaterial,t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=eU.clone());if(e&&e.isDerivedFrom(t)||(e=this._derivedMaterial=this.createDerivedMaterial(t),t.addEventListener("dispose",function r(){t.removeEventListener("dispose",r),e.dispose()})),!this.hasOutline())return e;{let t=e._outlineMtl;return t||((t=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}})).isTextOutlineMaterial=!0,t.depthWrite=!1,t.map=null,e.addEventListener("dispose",function r(){e.removeEventListener("dispose",r),t.dispose()})),[t,e]}}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return eD(this.material).getDepthMaterial()}set customDepthMaterial(e){}get customDistanceMaterial(){return eD(this.material).getDistanceMaterial()}set customDistanceMaterial(e){}_prepareForRender(e){let t=e.isTextOutlineMaterial,r=e.uniforms,a=this.textRenderInfo;if(a){let e,n,i,{sdfTexture:o,blockBounds:s}=a;r.uTroikaSDFTexture.value=o,r.uTroikaSDFTextureSize.value.set(o.image.width,o.image.height),r.uTroikaSDFGlyphSize.value=a.sdfGlyphSize,r.uTroikaSDFExponent.value=a.sdfExponent,r.uTroikaTotalBounds.value.fromArray(s),r.uTroikaUseGlyphColors.value=!t&&!!a.glyphColors;let l=0,u=0,f=0,h=0,d=0;if(t){let{outlineWidth:t,outlineOffsetX:r,outlineOffsetY:a,outlineBlur:n,outlineOpacity:i}=this;l=this._parsePercent(t)||0,u=Math.max(0,this._parsePercent(n)||0),e=i,h=this._parsePercent(r)||0,d=this._parsePercent(a)||0}else(f=Math.max(0,this._parsePercent(this.strokeWidth)||0))&&(i=this.strokeColor,r.uTroikaStrokeColor.value.set(null==i?8421504:i),null==(n=this.strokeOpacity)&&(n=1)),e=this.fillOpacity;r.uTroikaEdgeOffset.value=l,r.uTroikaPositionOffset.value.set(h,d),r.uTroikaBlurRadius.value=u,r.uTroikaStrokeWidth.value=f,r.uTroikaStrokeOpacity.value=n,r.uTroikaFillOpacity.value=null==e?1:e,r.uTroikaCurveRadius.value=this.curveRadius||0;let c=this.clipRect;if(c&&Array.isArray(c)&&4===c.length)r.uTroikaClipRect.value.fromArray(c);else{let e=100*(this.fontSize||.1);r.uTroikaClipRect.value.set(s[0]-e,s[1]-e,s[2]+e,s[3]+e)}this.geometry.applyClipRect(r.uTroikaClipRect.value)}r.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;let n=t?this.outlineColor||0:this.color;if(null==n)delete e.color;else{let t=e.hasOwnProperty("color")?e.color:e.color=new d.Color;(n!==t._input||"object"==typeof n)&&t.set(t._input=n)}let i=this.orientation||eF;if(i!==e._orientation){let t=r.uTroikaOrient.value,a=(i=i.replace(/[^-+xyz]/g,""))!==eF&&i.match(/^([-+])([xyz])([-+])([xyz])$/);if(a){let[,e,r,n,i]=a;ek.set(0,0,0)[r]="-"===e?1:-1,ew.set(0,0,0)[i]="-"===n?-1:1,eT.lookAt(eC,ek.cross(ew),ew),t.setFromMatrix4(eT)}else t.identity();e._orientation=i}}_parsePercent(e){if("string"==typeof e){let t=e.match(/^(-?[\d.]+)%$/),r=t?parseFloat(t[1]):NaN;e=(isNaN(r)?0:r/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new d.Vector2){t.copy(e);let r=this.curveRadius;return r&&(t.x=Math.atan2(e.x,Math.abs(r)-Math.abs(e.z))*Math.abs(r)),t}worldPositionToTextCoords(e,t=new d.Vector2){return ek.copy(e),this.localPositionToTextCoords(this.worldToLocal(ek),t)}raycast(e,t){let{textRenderInfo:r,curveRadius:a}=this;if(r){let n=r.blockBounds,i=a?eA():eM(),o=i.geometry,{position:s,uv:l}=o.attributes;for(let e=0;e<l.count;e++){let t=n[0]+l.getX(e)*(n[2]-n[0]),r=n[1]+l.getY(e)*(n[3]-n[1]),i=0;a&&(i=a-Math.cos(t/a)*a,t=Math.sin(t/a)*a),s.setXYZ(e,t,r,i)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,i.matrixWorld=this.matrixWorld,i.material.side=this.material.side,e_.length=0,i.raycast(e,e_);for(let e=0;e<e_.length;e++)e_[e].object=this,t.push(e_[e])}}copy(e){let t=this.geometry;return super.copy(e),this.geometry=t,eP.forEach(t=>{this[t]=e[t]}),this}clone(){return new this.constructor().copy(this)}}eR.forEach(e=>{let t="_private_"+e;Object.defineProperty(eO.prototype,e,{get(){return this[t]},set(e){e!==this[t]&&(this[t]=e,this._needsSync=!0)}})}),new d.Box3,new d.Color,new WeakMap,new WeakMap;var eG=e.i(28600),eB=e.i(20284);let eL=n.forwardRef(({sdfGlyphSize:e=64,anchorX:t="center",anchorY:r="middle",font:a,fontSize:i=1,children:o,characters:s,onSync:l,...u},f)=>{let d=(0,eG.useThree)(({invalidate:e})=>e),[c]=n.useState(()=>new eO),[v,p]=n.useMemo(()=>{let e=[],t="";return n.Children.forEach(o,r=>{"string"==typeof r||"number"==typeof r?t+=r:e.push(r)}),[e,t]},[o]);return(0,eB.suspend)(()=>new Promise(e=>(function({font:e,characters:t,sdfGlyphSize:r},a){el({font:e,sdfGlyphSize:r,text:Array.isArray(t)?t.join("\n"):""+t},a)})({font:a,characters:s},e)),["troika-text",a,s]),n.useLayoutEffect(()=>void c.sync(()=>{d(),l&&l(c)})),n.useEffect(()=>()=>c.dispose(),[c]),n.createElement("primitive",(0,h.default)({object:c,ref:f,font:a,text:p,anchorX:t,anchorY:r,fontSize:i,sdfGlyphSize:e},u),v)});e.s(["Text",0,eL],16196);let ez=({position:e=[0,0,0],rotation:t=[0,0,0],speed:r,color:n,fontSize:i=.5,textPosition:s=[0,.8,0],arrowSize:l=1})=>{let{nightMode:u}=(0,o.useOcearoContext)(),h=n||(u?o.oNight:"#ffffff");return(0,a.jsxs)("group",{position:e,rotation:t,children:[(0,a.jsx)(eL,{characters:".0123456789",color:h,fontSize:i*l,position:s,font:"fonts/Roboto-Bold.ttf",anchorX:"center",anchorY:"middle",children:r.toFixed(1)}),(0,a.jsxs)("mesh",{children:[(0,a.jsx)("shapeGeometry",{args:[new f.Shape([new f.Vector2(0,0),new f.Vector2(.5*l*Math.cos(5*Math.PI/6),.5*l*Math.sin(5*Math.PI/6)),new f.Vector2(0,-.577*l),new f.Vector2(0,-.577*l),new f.Vector2(-.5*l*Math.cos(5*Math.PI/6),.5*l*Math.sin(5*Math.PI/6)),new f.Vector2(0,0)])]}),(0,a.jsx)("meshStandardMaterial",{color:h,side:f.DoubleSide})]})]})};ez.propTypes={position:i.default.oneOfType([i.default.instanceOf(f.Vector3),i.default.arrayOf(i.default.number)]).isRequired,rotation:i.default.arrayOf(i.default.number).isRequired,speed:i.default.number.isRequired,color:i.default.oneOfType([i.default.string,i.default.number]).isRequired,fontSize:i.default.number,textPosition:i.default.arrayOf(i.default.number),arrowSize:i.default.number};let eW=({outerRadius:e})=>{(0,o.useOcearoContext)();let t=u.default.get("preferredWindSpeedPath")||"speedTrue",r=u.default.get("preferredWindDirectionPath")||"directionTrue",i=u.default.get("preferredHeadingPath")||"courseOverGroundTrue",h=(0,n.useMemo)(()=>["environment.wind.angleTrueGround","environment.wind.speedOverGround","environment.wind.directionTrue","environment.wind.speedTrue","environment.wind.angleApparent","environment.wind.speedApparent","environment.wind.angleTrueWater","navigation.headingTrue","navigation.headingMagnetic","navigation.courseOverGroundTrue","navigation.courseOverGroundMagnetic"],[]),d=(0,l.useSignalKPaths)(h),c=(0,n.useMemo)(()=>{if("directionTrue"===r){let e=d[`environment.wind.${r}`]??d["environment.wind.directionTrue"];if(null!=e)return Math.PI/2-(e-(d[`navigation.${i}`]??d["navigation.headingTrue"]??d["navigation.courseOverGroundTrue"]??0));let t=d["environment.wind.angleTrueGround"]??d["environment.wind.angleTrueWater"];if(null!=t)return Math.PI/2-t}else{let e=d[`environment.wind.${r}`]??d["environment.wind.angleTrueGround"]??d["environment.wind.angleTrueWater"];if(null!=e)return Math.PI/2-e;let t=d["environment.wind.directionTrue"];if(null!=t)return Math.PI/2-(t-(d[`navigation.${i}`]??d["navigation.headingTrue"]??d["navigation.courseOverGroundTrue"]??0))}return Math.PI/2},[d,r,i]),v=(0,n.useMemo)(()=>{let e=d[`environment.wind.${t}`]??d["environment.wind.speedOverGround"]??d["environment.wind.speedTrue"];return(0,s.convertSpeedUnit)(e)||0},[d,t]),p=(0,n.useMemo)(()=>Math.PI/2-(d["environment.wind.angleApparent"]||0),[d]),g=(0,n.useMemo)(()=>(0,s.convertSpeedUnit)(d["environment.wind.speedApparent"])||0,[d]),m=(0,n.useMemo)(()=>new f.Vector3((e+.7)*Math.cos(c),0,-(e+.7)*Math.sin(c)),[e,c]),y=(0,n.useMemo)(()=>new f.Vector3((e+.7)*Math.cos(p),0,-(e+.7)*Math.sin(p)),[e,p]);return(0,a.jsxs)("group",{children:[v>0&&!0!==u.default.get("hideTrueWind")&&(0,a.jsx)(ez,{position:m,rotation:[-Math.PI/2,0,-(Math.PI/2-c)],speed:v,color:o.oGreen,fontSize:1}),g>0&&(0,a.jsx)(ez,{position:y,rotation:[-Math.PI/2,0,-(Math.PI/2-p)],speed:g,color:o.oBlue,fontSize:1})]})};eW.propTypes={outerRadius:i.default.number.isRequired},e.s(["default",0,eW],84226)}]);
|