modern-canvas 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3416,7 +3416,7 @@ class CanvasContext extends modernPath2d.Path2D {
3416
3416
  miterLimit: this.miterLimit ?? 10
3417
3417
  }
3418
3418
  });
3419
- this.curves.length = 0;
3419
+ this.curves = [this.currentCurve];
3420
3420
  }
3421
3421
  }
3422
3422
  fillRect(x, y, width, height) {
@@ -3439,7 +3439,7 @@ class CanvasContext extends modernPath2d.Path2D {
3439
3439
  texture,
3440
3440
  textureTransform: this.textureTransform
3441
3441
  });
3442
- this.curves.length = 0;
3442
+ this.curves = [this.currentCurve];
3443
3443
  }
3444
3444
  reset() {
3445
3445
  this.strokeStyle = void 0;
@@ -3449,7 +3449,7 @@ class CanvasContext extends modernPath2d.Path2D {
3449
3449
  this.lineJoin = void 0;
3450
3450
  this.lineWidth = void 0;
3451
3451
  this.miterLimit = void 0;
3452
- this.curves.length = 0;
3452
+ this.curves = [this.currentCurve];
3453
3453
  this._stroked.length = 0;
3454
3454
  this._filled.length = 0;
3455
3455
  }
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ uniform vec4 tint;
24
24
  void main(void) {
25
25
  gl_FragColor = texture2D(sampler, vUv) * tint;
26
26
  }`,uniforms:{sampler:0,projectionMatrix:new Float32Array([1,0,0,0,1,0,0,0,1]),modelViewMatrix:new Float32Array([1,0,0,0,1,0,0,0,1]),tint:new Float32Array([1,1,1,1])}})}}u(Qr,"_instance");class te extends Jr{static get instance(){return this._instance??(this._instance=new this)}static draw(r,e=Qr.instance,t){this.instance.draw(r,e,t)}constructor(){super({vertexAttributes:{position:new ze({buffer:new pt({data:new Float32Array([-1,-1,1,-1,1,1,-1,1]),dynamic:!1}),size:2,normalized:!1,type:"float"}),uv:new ze({buffer:new pt({data:new Float32Array([0,0,1,0,1,1,0,1]),dynamic:!1}),size:2,normalized:!1,type:"float"})},indexBuffer:new Jt({data:new Uint16Array([0,1,2,0,2,3]),dynamic:!1})})}}u(te,"_instance");class wl extends Jr{constructor(){const e=new pt({data:new Float32Array,dynamic:!0}),t=new pt({data:new Float32Array,dynamic:!0});super({vertexAttributes:{position:new ze({buffer:e,size:2,normalized:!1,type:"float"}),uv:new ze({buffer:t,size:2,normalized:!1,type:"float"})},indexBuffer:new Jt({data:new Uint16Array,dynamic:!0})});u(this,"positionBuffer");u(this,"uvBuffer");this.positionBuffer=e,this.uvBuffer=t}update(e,t,i){return this.positionBuffer.data=e,this.uvBuffer.data=t,this.indexBuffer.data=i,this}}var xl=Object.defineProperty,Sn=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&xl(r,e,i),i};class ei extends Kr{constructor(){super();u(this,"_starting",!1);u(this,"_nextDeltaTime",0);this._onNextTick=this._onNextTick.bind(this)}get starting(){return this._starting}get spf(){return this.fps?Math.floor(1e3/this.fps):0}start(e){return this._starting||(this._starting=!0,this.removeAllListeners(),this.on("process",e),ue.on(this._onNextTick,{sort:0})),this}stop(){return this._starting&&(this._starting=!1,ue.off(this._onNextTick,{sort:0})),this}_onNextTick(){const e=ue.elapsed*this.speed;if((this._nextDeltaTime-=e)<=0){const i=(this._nextDeltaTime=this.spf)||e;this.emit("process",i)}}}Sn([A({default:24})],ei.prototype,"fps"),Sn([A({default:1})],ei.prototype,"speed");class Je extends dt{constructor(e){super();u(this,"_array",[]);this.dim=e}get length(){return this.dim}_operate(e,t,i){const{dim:s,_array:o}=this;let a;typeof t=="number"?a=Array.from({length:s},()=>t):t instanceof it||t instanceof Je?a=t.toArray():a=t;let l,h=[];if(i?i instanceof Je?l=i:h=i:l=this,t instanceof it){const{cols:c}=t;switch(e){case"*":for(let f=0;f<s;f++){let p=0;for(let d=0;d<s;d++)p+=o[f]*a[d*c+f];h[f]=p}break;default:throw new Error(`Not support operator in '${this.toName()} ${e} ${t.toName()}'`)}}else switch(e){case"+":for(let c=0;c<s;c++)h[c]=o[c]+a[c];break;case"-":for(let c=0;c<s;c++)h[c]=o[c]-a[c];break;case"*":for(let c=0;c<s;c++)h[c]=o[c]*a[c];break;case"/":for(let c=0;c<s;c++)h[c]=o[c]/a[c];break;case"rot":{const c=Math.cos(a[0]),f=Math.sin(a[0]);h[0]=o[0]*c-o[1]*f,h[1]=o[1]*c+o[0]*f;break}case"==":{let c=!0;for(let f=0;f<s;f++)c=c&&o[f]===a[f];return c}case"=":for(let c=0;c<s;c++){const f=a[c];f!==void 0&&(o[c]=f)}return this._emitUpdate(o),this;default:throw new Error(`Not support operator in '${this.toName()} ${e} Vector'`)}return(l==null?void 0:l.set(h))??h}add(e,t){return this._operate("+",e,t)}sub(e,t){return this._operate("-",e,t)}multiply(e,t){return this._operate("*",e,t)}divide(e,t){return this._operate("/",e,t)}rotate(e){return this._operate("rot",e)}set(e,...t){return t.length&&typeof e=="number"&&(e=[e,...t]),this._operate("=",e)}equals(e){return this._operate("==",e)}clone(){const e=new this.constructor;return e.set(this.toArray()),e}onUpdate(e){return this.on("update",e),this}offUpdate(e){return this.off("update",e),this}_emitUpdate(e){this._onUpdate(e),this.emit("update",e)}_onUpdate(e){}toArray(){return this._array.slice()}toName(){return`Vector${this.dim}`}}class it extends dt{constructor(e,t,i){super();u(this,"_array",[]);this.rows=e,this.cols=t,i?this.set(i):this.identity()}get length(){return this.cols*this.rows}_operate(e,t,i){const{cols:s,rows:o,length:a,_array:l}=this;let h;typeof t=="number"?h=Array.from({length:a},()=>t):t instanceof Je||t instanceof it?h=t.toArray():h=t;let c,f=[];if(i?i instanceof Je||i instanceof it?c=i:f=i:t instanceof Je?c=new t.constructor:c=this,t instanceof Je){const{dim:p}=t;switch(e){case"*":for(let d=0;d<p;d++){let m=0;for(let v=0;v<s;v++)v<p&&(m+=l[d*s+v]*(h[v]??0));f[d]=m}break;default:throw new Error(`Not support operator in '${this.toName()} ${e} ${t.toName()}'`)}}else switch(e){case"*":for(let p=0;p<s;p++)for(let d=0;d<o;d++){const m=d*s;let v=0;for(let y=0;y<o;y++){const S=m+y,C=y*s+p;v+=l[S]*(h[C]??0)}f[m+p]=v}break;case"=":for(let p=0;p<a;p++){const d=h[p];d!==void 0&&(l[p]=d)}return this._emitUpdate(l),this;default:throw new Error(`Not support operator in '${this.toName()} ${e} Matrix2'`)}return(c==null?void 0:c.set(f))??f}identity(){const{cols:e,rows:t}=this,i=[];for(let s=0;s<e;s++)for(let o=0;o<t;o++){const a=o*e,l=s+a;i[l]=o+a===l?1:0}return this.set(i)}clone(){const e=new this.constructor;return e.set(this.toArray()),e}set(e){return this._operate("=",e)}multiply(e){return this._operate("*",e)}onUpdate(e){return this.on("update",e),this}offUpdate(e){return this.off("update",e),this}_emitUpdate(e){this._onUpdate(e),this.emit("update",e)}_onUpdate(e){}toArray(e=!1){const{cols:t,rows:i,_array:s}=this;if(e){const o=[];for(let a=0;a<i;a++)for(let l=0;l<t;l++)o[a+l*t]=s[l+a*t];return o}return s.slice()}toName(){return`Matrix${this.rows}(${this.rows}x${this.cols})`}toJSON(){return this._array}}class Pl extends it{constructor(r){super(2,2,r)}}let Ki=class extends it{constructor(r){super(3,3,r)}invert(){const[r,e,t,i,s,o,a,l,h]=this._array,c=h*s-o*l,f=o*a-h*i,p=l*i-s*a,d=r*c+e*f+t*p;if(d===0)return this.set([0,0,0,0,0,0,0,0,0]);const m=1/d;return this.set([c*m,(t*l-h*e)*m,(o*e-t*s)*m,f*m,(h*r-t*a)*m,(t*i-o*r)*m,p*m,(e*a-l*r)*m,(s*r-e*i)*m])}};class Mn extends it{constructor(r){super(4,4,r)}}class An extends Ki{constructor(r=0,e=0,t=0,i=0,s=!1){super(),this._x=r,this._y=e,this._width=t,this._height=i,this._flipY=s,this._performUpdateArray()}flipY(r){return this._flipY!==r&&(this._flipY=r,this._performUpdateArray()),this}translate(r,e){return(this._x!==r||this._y!==e)&&(this._x=r,this._y=e,this._performUpdateArray()),this}resize(r,e){return(this._width!==r||this._height!==e)&&(this._width=r,this._height=e,this._performUpdateArray()),this}_performUpdateArray(){const r=this._width,e=this._height;if(!r||!e)return;const t=this._x,i=this._y,s=this._flipY?-1:1,o=1/r*2,a=s*(1/e*2),l=-1-t*o,h=-s-i*a;this.set([o,0,l,0,a,h,0,0,1])}}class qe extends Ki{constructor(e=!0){super();u(this,"_cx",1);u(this,"_sx",0);u(this,"_cy",0);u(this,"_sy",1);u(this,"_translateX",0);u(this,"_translateY",0);u(this,"_translateZ",1);u(this,"_scaleX",1);u(this,"_scaleY",1);u(this,"_skewX",0);u(this,"_skewY",0);u(this,"_rotate",0);u(this,"dirtyId",0);u(this,"_needsUpdateArray",!1);u(this,"_needsUpdateFields",!1);this.autoUpdate=e}_onUpdate(e){super._onUpdate(e),this._requestUpdateFields()}_updateSkew(){this._cx=Math.cos(this._rotate+this._skewY),this._sx=Math.sin(this._rotate+this._skewY),this._cy=-Math.sin(this._rotate-this._skewX),this._sy=Math.cos(this._rotate-this._skewX)}_requestUpdateArray(){this.autoUpdate?this._performUpdateArray():this._needsUpdateArray=!0}_requestUpdateFields(){this.autoUpdate?this._performUpdateFields():this._needsUpdateFields=!0}_performUpdateArray(){const e=this._cx*this._scaleX,t=this._sx*this._scaleX,i=this._cy*this._scaleY,s=this._sy*this._scaleY,o=this._translateX,a=this._translateY,l=this._translateZ,h=this._array;this._array=[e,i,o,t,s,a,h[6],h[7],l],this.dirtyId++}_performUpdateFields(){const{a:e,c:t,tx:i,b:s,d:o,ty:a,tz:l}=this.toObject(),h=-Math.atan2(-t,o),c=Math.atan2(s,e),f=Math.abs(h+c);f<1e-5||Math.abs(le-f)<1e-5?(this._rotate=c,this._skewX=this._skewY=0):(this._rotate=0,this._skewX=h,this._skewY=c),this._scaleX=Math.sqrt(e*e+s*s),this._scaleY=Math.sqrt(t*t+o*o),this._translateX=i,this._translateY=a,this._translateZ=l,this.dirtyId++}skew(e,t){return this._skewX=e,this._skewY=t,this._updateSkew(),this._requestUpdateArray(),this}skewX(e){return this.skew(e,this._skewY)}skewY(e){return this.skew(this._skewX,e)}translate(e,t,i=1){return this._translateX=e,this._translateY=t,this._translateZ=i,this._requestUpdateArray(),this}translateX(e){return this.translate(e,this._translateY)}translateY(e){return this.translate(this._translateX,e)}translateZ(e){return this.translate(this._translateX,this._translateY,e)}translate3d(e,t,i){return this.translate(e,t,i)}scale(e,t,i=1){return this._scaleX=e,this._scaleY=t,this._requestUpdateArray(),this}scaleX(e){return this.scale(e,this._scaleY)}scaleY(e){return this.scale(this._scaleX,e)}scale3d(e,t,i){return this.scale(e,t,i)}rotate(e){return this._rotate=e,this._updateSkew(),this._requestUpdateArray(),this}rotateX(e){return this.scaleY(this._rotateToScale(e))}rotateY(e){return this.scaleX(this._rotateToScale(e))}rotateZ(e){return this.rotate(e)}rotate3d(e,t,i,s){const[o,a,l]=this._rotate3d(e,t,i,s);return o&&this.rotateX(o),a&&this.rotateY(a),l&&this.rotateZ(l),this}_rotateToScale(e){const t=e/le;return t<=.5?t*-4+1:(t-1)*4+1}_rotate3d(e,t,i,s){if(e===1&&t===0&&i===0)return[s,0,0];if(e===0&&t===1&&i===0)return[0,s,0];if(e===0&&t===0)return[0,0,s];{const o=Math.cos(s),a=Math.sin(s),l=o+e*e*(1-o),h=e*t*(1-o)-i*a,c=e*i*(1-o)+t*a,f=o+t*t*(1-o),p=t*i*(1-o)-e*a,d=o+i*i*(1-o),m=-Math.atan2(-p,f),v=-Math.atan2(c,Math.sqrt(p*p+d*d)),y=-Math.atan2(-h,l);return[m,v,y]}}applyToPoint(e,t){const{a:i,c:s,tx:o,b:a,d:l,ty:h}=this.toObject();return[i*e+s*t+o,a*e+l*t+h]}inverse(){return this.clone().invert()}update(){let e=!1;return this._needsUpdateArray&&(this._needsUpdateArray=!1,this._performUpdateArray(),e=!0),this._needsUpdateFields&&(this._needsUpdateFields=!1,this._performUpdateFields(),e=!0),e}isIdentity(){const{a:e,b:t,c:i,d:s,tx:o,ty:a}=this.toObject();return e===1&&t===0&&i===0&&s===1&&o===0&&a===0}toObject(){const[e,t,i,s,o,a,,,l]=this._array;return{a:e,c:t,tx:i,b:s,d:o,ty:a,tz:l}}}const On=Ee/180,Cl=180/Ee;function xt(n,r,e){return Math.max(n,Math.min(r,e))}function fe(n,r,e){return(1-e)*n+e*r}const El={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(n,r=20){if(!this.adaptive||!n||Number.isNaN(n))return r;let e=Math.ceil(n/this.maxLength);return e<this.minSegments?e=this.minSegments:e>this.maxSegments&&(e=this.maxSegments),e}};let Tl=class $i extends Je{get x(){return this._array[0]}set x(r){const[e,t]=this._array;e!==r&&this.set(r,t)}get y(){return this._array[1]}set y(r){const[e,t]=this._array;t!==r&&this.set(e,r)}get width(){return this.x}set width(r){this.x=r}get height(){return this.y}set height(r){this.y=r}constructor(r=0,e){super(2),this.set(typeof r=="number"?[r,e??r]:r)}update(r,e){const[t,i]=this._array;return(t!==r||i!==e)&&this.set(r,e),this}getLength(){const[r,e]=this._array;return Math.sqrt(r*r+e*e)}getAngle(){const[r,e]=this._array;return Math.atan2(-r,-e)+Math.PI}distanceTo(r){return Math.hypot(r.x-this.x,r.y-this.y)}normalize(){const[r,e]=this._array,t=1/(this.getLength()||1);return this.set(r*t,e*t),this}static lerp(r,e,t){return new $i(e).clone().sub(new $i(r)).multiply(t).add(new $i(r))}};class Sl extends Je{constructor(){super(3)}}class Un extends Je{constructor(r=0,e=0,t=0,i=0){super(4),this.set([r,e,t,i])}}var Ml=Object.defineProperty,Al=Object.getOwnPropertyDescriptor,Qt=(n,r,e,t)=>{for(var i=t>1?void 0:t?Al(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Ml(r,e,i),i},yr=(n=>(n[n.DEFAULT=0]="DEFAULT",n[n.FRONT=1]="FRONT",n[n.BACK=2]="BACK",n))(yr||{});g.Node=class extends Zi{constructor(e){super();u(this,"renderable");u(this,"name",`${this.tag}:${String(this.instanceId)}`);u(this,"mask");u(this,"_computedVisibleDelay",0);u(this,"_computedVisibleDuration",Number.MAX_SAFE_INTEGER);u(this,"_computedVisibility","visible");u(this,"_internalMode",0);u(this,"_readyed",!1);u(this,"_tree");u(this,"_parent");u(this,"_children",[]);u(this,"_meta",new Map);this.setProperties(e).on("enterTree",this._onEnterTree.bind(this)).on("exitTree",this._onExitTree.bind(this)).on("parented",this._onParented.bind(this)).on("unparented",this._onUnparented.bind(this)).on("ready",this._onReady.bind(this)).on("process",this._onProcess.bind(this))}get children(){return this.getChildren()}get visibleTimeline(){const e=this._computedVisibleDelay;return[e,e+this._computedVisibleDuration]}get visibleRelativeTime(){var e;return(((e=this._tree)==null?void 0:e.timeline.current)??0)-this.visibleTimeline[0]}get visibleProgress(){const[e,t]=this.visibleTimeline;return xt(0,this.visibleRelativeTime/(t-e),1)}get siblingIndex(){return this.getIndex()}set siblingIndex(e){var t;(t=this._parent)==null||t.moveChild(this,e)}get previousSibling(){var e;return(e=this._parent)==null?void 0:e.getChildren()[this.getIndex()-1]}get nextSibling(){var e;return(e=this._parent)==null?void 0:e.getChildren()[this.getIndex()+1]}get firstSibling(){var e;return(e=this._parent)==null?void 0:e.getChildren()[0]}get lastSibling(){var t;const e=(t=this._parent)==null?void 0:t.getChildren();return e?e[e.length-1]:void 0}hasMeta(e){return this._meta.has(e)}getMeta(e,t){return this._meta.get(e)??t}setMeta(e,t){this._meta.set(e,t)}deleteMeta(e){this._meta.delete(e)}clearMeta(){this._meta.clear()}setName(e){return this.name=e,this}getTree(){return this._tree}getViewport(){var e;return(e=this._tree)==null?void 0:e.getCurrentViewport()}getWindow(){var e;return(e=this._tree)==null?void 0:e.root}isInsideTree(){return!!this._tree}_setTree(e){const t=this._tree;if(e!==t){e?(this._tree=e,this.emit("enterTree")):t&&(this.emit("exitTree"),this._tree=e);for(let i=this._children.length,s=0;s<i;s++){const o=this._children[s];!e&&this.emit("childExitingTree",o),o._setTree(e),e&&this.emit("childEnteredTree",o)}e&&(this.emit("postEnterTree"),this._readyed||(this._readyed=!0,this.emit("ready")))}return this}isRenderable(){return this.renderable!==!1&&this.constructor.renderable&&this.isVisible()}isVisible(){return this._computedVisibility!=="hidden"}_updateVisibility(){var s;const e=this._parent;this._computedVisibleDelay=this.visibleDelay+((e==null?void 0:e._computedVisibleDelay)??0),e!=null&&e._computedVisibleDuration?this._computedVisibleDuration=Math.min(this._computedVisibleDelay+this.visibleDuration,e.visibleTimeline[1])-this._computedVisibleDelay:this._computedVisibleDuration=this.visibleDuration;let t=this.visibility??(e==null?void 0:e._computedVisibility)??"visible";const i=((s=this._tree)==null?void 0:s.timeline.current)??0;if(t!=="hidden"){const[o,a]=this.visibleTimeline;(i<o||i>a)&&(t="hidden")}this._computedVisibility=t}_onEnterTree(){this._enterTree(),this.emit("treeEntered")}_onExitTree(){this.emit("treeExiting"),this._exitTree(),this.emit("treeExited")}_onParented(){this._parented()}_onUnparented(){this._unparented()}_onReady(){this._ready()}_onProcess(e=0){this._updateVisibility();const t=this._tree;t==null||t.emit("nodeProcessing",this),this._process(e);const i=this.isRenderable();let s;if(t&&i){const o=t.renderStack.push(this);s=t.renderStack.currentCall,t.renderStack.currentCall=o}if(this.mask instanceof g.Node)this.getNode("__$mask")||(this.mask.renderable=!1,this.addChild(this.mask,1));else{const o=this.getNode("__$mask");o&&this.removeChild(o)}for(let o=this._children.length,a=0;a<o;a++)this._children[a].emit("process",e);t&&i&&(t.renderStack.currentCall=s),t==null||t.emit("nodeProcessed",this)}render(e,t){const i=this.mask;i&&(e.flush(),e.mask.push(this,i)),this._render(e),t==null||t(),i&&(e.flush(),e.mask.pop(this))}input(e){for(let t=this._children.length-1;t>=0;t--)this._children[t].input(e);this._input(e)}get parent(){return this._parent}hasParent(){return!!this._parent}getParent(){return this._parent}_setParent(e){var t;return(t=this._parent)!=null&&t.is(e)||(this._parent=e,this._setTree(e==null?void 0:e._tree),this.emit(e?"parented":"unparented")),this}getChildren(e=!1){switch(e){case!0:return this._children;case!1:return this._children.filter(t=>t._internalMode===0);default:return this._children.filter(t=>t._internalMode===e)}}getIndex(e=!1){var t;return((t=this._parent)==null?void 0:t.getChildren(e).indexOf(this))??0}getNode(e){return this._children.find(t=>t.name===e)}removeNode(e){var t;(t=this.getNode(e))==null||t.remove()}addSibling(e){return this.is(e)||!this.hasParent()||e.hasParent()?this:(e._internalMode=this._internalMode,this._parent.moveChild(e,this.getIndex(!0)+1),this)}addChild(e,t=e._internalMode){if(this.is(e)||e.hasParent())return this;switch(t){case 0:case 1:{const i=t===0?2:1,s=this._children.findIndex(o=>o._internalMode===i);s>-1?this._children.splice(s,0,e):this._children.push(e);break}case 2:this._children.push(e);break}return e._internalMode=t,e._setParent(this),this.emit("addChild",e),this}moveChild(e,t,i=e._internalMode){if(this.is(e)||e.hasParent()&&!this.is(e.parent))return this;e._internalMode=i;const s=this._children.indexOf(e);let o=this._children.findIndex(h=>{switch(i){case 0:return h._internalMode!==1;case 2:return h._internalMode===2;case 1:default:return!0}});o=o>-1?o:Math.max(0,this._children.length-1);let a=this._children.slice(o).findIndex(h=>{switch(i){case 1:return h._internalMode!==1;case 0:return h._internalMode===2;case 2:default:return!1}});a=a>-1?o+a:Math.max(0,this._children.length-1);const l=xt(o,t>-1?t:a,a);return l!==s&&(s>-1&&this._children.splice(s,1),e._setParent(this),l>-1&&l<this._children.length?this._children.splice(l,0,e):this._children.push(e),s>-1?this.emit("moveChild",e,l,s):this.emit("addChild",e)),this}removeChild(e){const t=e.getIndex(!0);return this.is(e.parent)&&t>-1&&(this._children.splice(t,1),e._setParent(void 0),this.emit("removeChild",e,t)),this}removeChildren(){this.children.forEach(e=>this.removeChild(e))}remove(){var e;(e=this._parent)==null||e.removeChild(this)}forEach(e){return this.children.forEach(e),this}deepForEach(e){return this.children.forEach(t=>{e(t),t.deepForEach(e)}),this}is(e){return!!(e&&this.instanceId===e.instanceId)}_enterTree(){}_ready(){}_exitTree(){}_parented(){}_unparented(){}_process(e){}_input(e){}_render(e){}toJSON(){return{tag:this.tag,props:super.toJSON(),children:this.children.map(e=>e.toJSON())}}static parse(e){if(Array.isArray(e))return e.map(l=>this.parse(l));const{tag:t,props:i,children:s}=e,o=Yr.get(t)??g.Node,a=new o(i);return s==null||s.forEach(l=>a.addChild(this.parse(l))),a}},Qt([A()],g.Node.prototype,"name",2),Qt([A()],g.Node.prototype,"mask",2),Qt([A({default:"visible"})],g.Node.prototype,"visibility",2),Qt([A({default:0})],g.Node.prototype,"visibleDelay",2),Qt([A({default:Number.MAX_SAFE_INTEGER})],g.Node.prototype,"visibleDuration",2),g.Node=Qt([H("Node")],g.Node);class Dn{constructor(){u(this,"currentCall");u(this,"calls",[])}createCall(r){return{renderable:r,parentCall:this.currentCall,fn:r.render.bind(r),calls:[]}}push(r){var t;const e=this.createCall(r);return(((t=this.currentCall)==null?void 0:t.calls)??this.calls).push(e),e}render(r){this.calls.forEach(function e(t){t.fn(r,()=>{t.calls.forEach(e)})}),this.calls=[]}}var Ol=Object.defineProperty,Ul=Object.getOwnPropertyDescriptor,vr=(n,r,e,t)=>{for(var i=t>1?void 0:t?Ul(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Ol(r,e,i),i};g.Timer=class extends g.Node{static from(r){const[e,t]=r?Array.isArray(r)?r:[0,r]:[];return new g.Timer({start:e,end:t})}constructor(r){super(),this.setProperties(r)}_onUpdateProperty(r,e,t){switch(super._onUpdateProperty(r,e,t),r){case"start":this.start=Math.min(e,this.end);break;case"end":this.end=e||Number.MAX_SAFE_INTEGER;break}}addTime(r){const e=this.start,t=this.end;let i=this.current+r;return this.loop&&i>t&&(i=e+i%t),this.current=xt(e,i,t),this.emit("update",this.current,r),this}_process(r){super._process(r),this.addTime(r)}},vr([A({default:0})],g.Timer.prototype,"start",2),vr([A({default:0})],g.Timer.prototype,"current",2),vr([A({default:Number.MAX_SAFE_INTEGER})],g.Timer.prototype,"end",2),vr([A({default:!1})],g.Timer.prototype,"loop",2),g.Timer=vr([H("Timer")],g.Timer);var Dl=Object.defineProperty,er=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&Dl(r,e,i),i};class de extends wt{constructor(e){super();u(this,"_isPowerOfTwo",!1);u(this,"_needsUpload",!1);this.source=e,this._updateSize()}static get EMPTY(){return new this({width:1,height:1,pixels:null})}static get WHITE(){return new this({width:1,height:1,pixels:new Uint8Array([255,255,255,255])})}static get BLACK(){return new this({width:1,height:1,pixels:new Uint8Array([0,0,0,255])})}static get RED(){return new this({width:1,height:1,pixels:new Uint8Array([255,0,0,255])})}static get GREEN(){return new this({width:1,height:1,pixels:new Uint8Array([0,255,0,255])})}static get BLUE(){return new this({width:1,height:1,pixels:new Uint8Array([0,0,255,255])})}get valid(){return!!(this.width&&this.height)}get realWidth(){return Math.round(this.width*this.pixelRatio)}get realHeight(){return Math.round(this.height*this.pixelRatio)}_refreshPOT(){this._isPowerOfTwo=zi(this.realWidth)&&zi(this.realHeight)}_glTextureOptions(e,t){let i=this.source;"pixels"in i&&(i={pixels:i.pixels,width:this.realWidth,height:this.realHeight});let s=this.wrapMode;return e.version===1&&!this._isPowerOfTwo&&(s="clamp_to_edge"),{value:i,target:"texture_2d",location:0,filterMode:this.filterMode,wrapMode:s,...t}}_glTexture(e,t){return e.getRelated(this,()=>e.texture.create(this._glTextureOptions(e,t)))}_onUpdateProperty(e,t,i){switch(super._onUpdateProperty(e,t,i),e){case"width":case"height":case"filterMode":case"wrapMode":case"pixelRatio":case"source":this.requestUpload();break}}_updateSize(){const e=this.source;"pixels"in e?(this.width=Math.max(this.width,e.width),this.height=Math.max(this.height,e.height)):(this.width=Number(e.naturalWidth||e.videoWidth||e.width||0),this.height=Number(e.naturalHeight||e.videoHeight||e.height||0))}requestUpload(){this._needsUpload=!0,this._updateSize(),this._refreshPOT()}upload(e,t){return this._needsUpload?(this._needsUpload=!1,e.texture.update(this._glTexture(e,t),this._glTextureOptions(e,t)),!0):!1}activate(e,t=0){e.texture.bind({target:"texture_2d",value:this._glTexture(e,{location:t}),location:t}),this.upload(e,{location:t})}inactivate(e){e.texture.unbind(this._glTexture(e))}destroy(){fn&&this.source instanceof ImageBitmap&&this.source.close()}}er([ee()],de.prototype,"source"),er([ee({default:0})],de.prototype,"width"),er([ee({default:0})],de.prototype,"height"),er([ee({default:"linear"})],de.prototype,"filterMode"),er([ee({default:"clamp_to_edge"})],de.prototype,"wrapMode"),er([ee({default:1})],de.prototype,"pixelRatio");function Il(n){return{autoLoad:!!((n==null?void 0:n.autoLoad)??!0),useBitmap:!!((n==null?void 0:n.useBitmap)??!0)&&ji,crossorigin:(n==null?void 0:n.crossorigin)??null}}class Rl extends de{constructor(e,t){const i=Il(t);super(e);u(this,"bitmap");u(this,"useBitmap");u(this,"preserveBitmap",!1);u(this,"_loadSource");u(this,"_loadBitmap");const s=e.src,o=s.includes(".svg")||s.startsWith("data:image/svg+xml");this.useBitmap=i.useBitmap&&!o,i.autoLoad&&this.load()}async load(){return this._loadSource||(this._loadSource=new Promise(e=>{this._loadSource=void 0;const t=this.source,i=()=>{t.onload=null,t.onerror=null},s=()=>{i(),this.requestUpload(),this.useBitmap?this.genBitmap().finally(()=>e(this)):e(this)},o=a=>{i(),console.warn(`Failed to load ImageTexture, src: ${t.src}`,a),this.emit("error",a),e(this)};t.complete&&t.src?s():(t.onload=s,t.onerror=o)})),this._loadSource}genBitmap(){if(this._loadBitmap)return this._loadBitmap;if(this.bitmap||!ji)return Promise.resolve(this);const e=this.source,t=!e.crossOrigin||e.crossOrigin==="anonymous";return this._loadBitmap=fetch(e.src,{mode:t?"cors":"no-cors"}).then(i=>i.blob()).then(i=>createImageBitmap(i,0,0,e.width,e.height,{premultiplyAlpha:"premultiply"})).then(i=>(this.bitmap=i,this.requestUpload(),this._loadBitmap=void 0,this)).catch(i=>(console.warn("Failed to genBitmap",i),this)),this._loadBitmap}_glTextureOptions(e){return{...super._glTextureOptions(e),value:this.bitmap??this.source}}upload(e){if(this.useBitmap){if(!this.bitmap)return this.genBitmap(),!1}else{const i=this.source;if(mr&&i instanceof HTMLImageElement&&(!i.complete||i.naturalWidth===0))return!1}const t=super.upload(e);return this.preserveBitmap&&this.bitmap&&(this.bitmap.close(),this.bitmap=void 0),t}}class Ji extends de{constructor(r,e=1,t=1){const i={width:e,height:t,pixels:null};r&&(ArrayBuffer.isView(r)?i.pixels=new Uint8Array(r.buffer):i.pixels=new Uint8Array(r)),super(i)}}var Bl=Object.defineProperty,In=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&Bl(r,e,i),i};function Ll(n){return{autoLoad:!!((n==null?void 0:n.autoLoad)??!0),autoPlay:!!((n==null?void 0:n.autoPlay)??!1),fps:Number((n==null?void 0:n.fps)??0),crossorigin:(n==null?void 0:n.crossorigin)??null,loop:!!((n==null?void 0:n.loop)??!1),muted:!!((n==null?void 0:n.muted)??!1),playsinline:!!((n==null?void 0:n.playsinline)??!0)}}const Qi=(Yt=class extends de{constructor(e,t){const i=Ll(t);if(!vn(e)){typeof e=="string"&&(e=[e]);const s=e[0].src||e[0],o=document.createElement("video");i.autoLoad&&o.setAttribute("preload","auto"),i.playsinline&&(o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline","")),i.muted&&(o.setAttribute("muted",""),o.muted=!0),i.loop&&o.setAttribute("loop",""),i.autoPlay&&o.setAttribute("autoplay",""),Pn(o,s,i.crossorigin);for(let a=0;a<e.length;++a){let{src:l,mime:h}=e[a];if(l=l||e[a],l.startsWith("data:"))h=l.slice(5,l.indexOf(";"));else if(!l.startsWith("blob:")){const f=l.split("?").shift().toLowerCase(),p=f.slice(f.lastIndexOf(".")+1);h=h||Yt.mimeTypes.get(p)||`video/${p}`}const c=document.createElement("source");c.src=l,h&&(c.type=h),o.appendChild(c)}e=o}super(e);u(this,"_spf",0);u(this,"_autoPlay",!1);u(this,"_sourceLoad");u(this,"_nextTime",0);u(this,"_connected",!1);u(this,"_requestId");u(this,"_resolve");u(this,"_reject");u(this,"_onPlayStart",()=>{this.valid||this._onCanPlay(),this._setupAutoUpdate()});u(this,"_onPlayStop",()=>{this._setupAutoUpdate()});u(this,"_onCanPlay",()=>{const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const t=this.valid;this._nextTime=0,this.requestUpload(),this._nextTime=0,!t&&this._resolve&&(this._resolve(this),this._sourceLoad=void 0,this._resolve=void 0,this._reject=void 0),this.isPlaying?this._onPlayStart():this._autoPlay&&e.play()});u(this,"_onError",e=>{this.source.removeEventListener("error",this._onError,!0),this.emit("error",e),this._reject&&(this._reject(e),this._reject=void 0,this._resolve=void 0)});u(this,"_onSeeked",()=>{this.autoUpdate&&!this.isPlaying&&(this._nextTime=0,this.requestUpload(),this._nextTime=0)});u(this,"_videoFrameRequestCallback",()=>{this.requestUpload(),this._requestId=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)});u(this,"requestUpload",()=>{const e=Math.floor(ue.elapsed*this.source.playbackRate);this._nextTime-=e,(!this._spf||this._nextTime<=0)&&(super.requestUpload(),this._nextTime=this._spf||0)});this.fps=i.fps,this._autoPlay=i.autoPlay,i.autoPlay&&this.load(),this._setupAutoUpdate()}get isReady(){return this.source.readyState>2}get isPlaying(){return!this.source.paused&&!this.source.ended&&this.isReady}get duration(){return this.source.duration}get seeking(){return this.source.seeking}get currentTime(){return this.source.currentTime}set currentTime(e){this.source.currentTime=e}_onUpdateProperty(e,t,i){switch(super._onUpdateProperty(e,t,i),e){case"fps":this._spf=t?Math.floor(1e3/t):0,this._setupAutoUpdate();break;case"autoUpdate":this._setupAutoUpdate();break}}_setupAutoUpdate(){this.autoUpdate&&this.isPlaying?!this.fps&&this.source.requestVideoFrameCallback?(this._connected&&(ue.off(this.requestUpload),this._connected=!1,this._nextTime=0),this._requestId===void 0&&(this._requestId=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._requestId!==void 0&&(this.source.cancelVideoFrameCallback(this._requestId),this._requestId=void 0),this._connected||(ue.on(this.requestUpload),this._connected=!0,this._nextTime=0)):(this._requestId!==void 0&&(this.source.cancelVideoFrameCallback(this._requestId),this._requestId=void 0),this._connected&&(ue.off(this.requestUpload),this._connected=!1,this._nextTime=0))}async load(){if(!this._sourceLoad){const e=this.source;(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this.isReady?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._sourceLoad=new Promise((t,i)=>{this.valid?(this._sourceLoad=void 0,t(this)):(this._resolve=t,this._reject=i,e.load())})}return this._sourceLoad}destroy(){this._setupAutoUpdate();const e=this.source;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load())}},u(Yt,"mimeTypes",new Map(Object.entries({ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"}))),Yt);In([ee({default:!0})],Qi.prototype,"autoUpdate"),In([ee({default:0})],Qi.prototype,"fps");let Rn=Qi;class es extends Ji{}var kl=Object.defineProperty,Nl=Object.getOwnPropertyDescriptor,_r=(n,r,e,t)=>{for(var i=t>1?void 0:t?Nl(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&kl(r,e,i),i};g.Viewport=class extends g.Node{constructor(e=!1){super();u(this,"_projection",new An);u(this,"_framebufferIndex",0);u(this,"_framebuffers",[{texture:new es,needsUpload:!1},{texture:new es,needsUpload:!1}]);this.flipY=e,this._projection.flipY(e)}get framebuffer(){return this._framebuffers[this._framebufferIndex]}get texture(){return this.framebuffer.texture}_glFramebufferOptions(e){const{width:t,height:i}=this,{pixelRatio:s}=e;return this._framebuffers.forEach(o=>{const a=o.texture;a.pixelRatio=s,a.width=t,a.height=i,a.upload(e)}),{width:t,height:i,colorTextures:[this.texture._glTexture(e)]}}_glFramebuffer(e){return e.getRelated(this.framebuffer,()=>e.framebuffer.create(this._glFramebufferOptions(e)))}_onUpdateProperty(e,t,i){switch(super._onUpdateProperty(e,t,i),e){case"x":case"y":this.requestUpload(),this._projection.translate(this.x,this.y);break;case"width":case"height":this.requestUpload(),this._projection.resize(this.width,this.height);break}}requestUpload(){this._framebuffers.forEach(e=>e.needsUpload=!0)}resize(e,t){this.width=e,this.height=t}upload(e){const t=this.framebuffer;return t.needsUpload?(t.needsUpload=!1,e.framebuffer.update(this._glFramebuffer(e),this._glFramebufferOptions(e)),!0):!1}activate(e){var t;e.flush(),(t=this._tree)==null||t.setCurrentViewport(this),e.framebuffer.bind(this._glFramebuffer(e)),this.upload(e)}redraw(e,t){e.flush();const i=this.framebuffer.texture;this._framebufferIndex=(this._framebufferIndex+1)%this._framebuffers.length,this.activate(e),e.clear(),i.activate(e,0),t()}activateWithCopy(e,t){this.resize(t.width,t.height),this.activate(e),e.clear(),t.texture.activate(e,0),te.draw(e,Qr.instance,{sampler:0})}render(e,t){var s,o;const i=(s=this._tree)==null?void 0:s.getCurrentViewport();this.activate(e),e.clear(),super.render(e,t),e.flush(),i?i.activate(e):(e.framebuffer.bind(null),(o=this._tree)==null||o.setCurrentViewport(void 0))}toProjectionArray(e=!1){return this._projection.toArray(e)}},_r([A({default:0})],g.Viewport.prototype,"x",2),_r([A({default:0})],g.Viewport.prototype,"y",2),_r([A({default:0})],g.Viewport.prototype,"width",2),_r([A({default:0})],g.Viewport.prototype,"height",2),g.Viewport=_r([H({tag:"Viewport",renderable:!0})],g.Viewport);class Bn extends ei{constructor(){super(...arguments);u(this,"renderStack",new Dn);u(this,"root",new g.Viewport(!0)._setTree(this));u(this,"timeline",new g.Timer({loop:!0})._setTree(this));u(this,"_currentViewport")}getCurrentViewport(){return this._currentViewport}setCurrentViewport(e){this._currentViewport=e}_render(e,t=0){return this.timeline.addTime(t),this.emit("processing"),this.root.emit("process",t),this.emit("processed"),e.program.uniforms.projectionMatrix=this.root.toProjectionArray(!0),this.renderStack.render(e),this._renderScreen(e),this}_renderScreen(e){e.state.reset();const t=e.pixelRatio,{width:i,height:s}=this.root;e.framebuffer.bind(null),e.viewport.bind({x:0,y:0,width:i*t,height:s*t}),e.clear();const o=this.root.texture;o.activate(e,0),te.draw(e),e.texture.unbind(o)}}var Fl={grad:.9,turn:360,rad:360/(2*Math.PI)},gt=function(n){return typeof n=="string"?n.length>0:typeof n=="number"},me=function(n,r,e){return r===void 0&&(r=0),e===void 0&&(e=Math.pow(10,r)),Math.round(e*n)/e+0},We=function(n,r,e){return r===void 0&&(r=0),e===void 0&&(e=1),n>e?e:n>r?n:r},Ln=function(n){return(n=isFinite(n)?n%360:0)>0?n:n+360},kn=function(n){return{r:We(n.r,0,255),g:We(n.g,0,255),b:We(n.b,0,255),a:We(n.a)}},ts=function(n){return{r:me(n.r),g:me(n.g),b:me(n.b),a:me(n.a,3)}},$l=/^#([0-9a-f]{3,8})$/i,ti=function(n){var r=n.toString(16);return r.length<2?"0"+r:r},Nn=function(n){var r=n.r,e=n.g,t=n.b,i=n.a,s=Math.max(r,e,t),o=s-Math.min(r,e,t),a=o?s===r?(e-t)/o:s===e?2+(t-r)/o:4+(r-e)/o:0;return{h:60*(a<0?a+6:a),s:s?o/s*100:0,v:s/255*100,a:i}},Fn=function(n){var r=n.h,e=n.s,t=n.v,i=n.a;r=r/360*6,e/=100,t/=100;var s=Math.floor(r),o=t*(1-e),a=t*(1-(r-s)*e),l=t*(1-(1-r+s)*e),h=s%6;return{r:255*[t,a,o,o,l,t][h],g:255*[l,t,t,a,o,o][h],b:255*[o,o,l,t,t,a][h],a:i}},$n=function(n){return{h:Ln(n.h),s:We(n.s,0,100),l:We(n.l,0,100),a:We(n.a)}},zn=function(n){return{h:me(n.h),s:me(n.s),l:me(n.l),a:me(n.a,3)}},Vn=function(n){return Fn((e=(r=n).s,{h:r.h,s:(e*=((t=r.l)<50?t:100-t)/100)>0?2*e/(t+e)*100:0,v:t+e,a:r.a}));var r,e,t},br=function(n){return{h:(r=Nn(n)).h,s:(i=(200-(e=r.s))*(t=r.v)/100)>0&&i<200?e*t/100/(i<=100?i:200-i)*100:0,l:i/2,a:r.a};var r,e,t,i},zl=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Vl=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,jl=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Gl=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rs={string:[[function(n){var r=$l.exec(n);return r?(n=r[1]).length<=4?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?me(parseInt(n[3]+n[3],16)/255,2):1}:n.length===6||n.length===8?{r:parseInt(n.substr(0,2),16),g:parseInt(n.substr(2,2),16),b:parseInt(n.substr(4,2),16),a:n.length===8?me(parseInt(n.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(n){var r=jl.exec(n)||Gl.exec(n);return r?r[2]!==r[4]||r[4]!==r[6]?null:kn({r:Number(r[1])/(r[2]?100/255:1),g:Number(r[3])/(r[4]?100/255:1),b:Number(r[5])/(r[6]?100/255:1),a:r[7]===void 0?1:Number(r[7])/(r[8]?100:1)}):null},"rgb"],[function(n){var r=zl.exec(n)||Vl.exec(n);if(!r)return null;var e,t,i=$n({h:(e=r[1],t=r[2],t===void 0&&(t="deg"),Number(e)*(Fl[t]||1)),s:Number(r[3]),l:Number(r[4]),a:r[5]===void 0?1:Number(r[5])/(r[6]?100:1)});return Vn(i)},"hsl"]],object:[[function(n){var r=n.r,e=n.g,t=n.b,i=n.a,s=i===void 0?1:i;return gt(r)&&gt(e)&&gt(t)?kn({r:Number(r),g:Number(e),b:Number(t),a:Number(s)}):null},"rgb"],[function(n){var r=n.h,e=n.s,t=n.l,i=n.a,s=i===void 0?1:i;if(!gt(r)||!gt(e)||!gt(t))return null;var o=$n({h:Number(r),s:Number(e),l:Number(t),a:Number(s)});return Vn(o)},"hsl"],[function(n){var r=n.h,e=n.s,t=n.v,i=n.a,s=i===void 0?1:i;if(!gt(r)||!gt(e)||!gt(t))return null;var o=function(a){return{h:Ln(a.h),s:We(a.s,0,100),v:We(a.v,0,100),a:We(a.a)}}({h:Number(r),s:Number(e),v:Number(t),a:Number(s)});return Fn(o)},"hsv"]]},jn=function(n,r){for(var e=0;e<r.length;e++){var t=r[e][0](n);if(t)return[t,r[e][1]]}return[null,void 0]},ql=function(n){return typeof n=="string"?jn(n.trim(),rs.string):typeof n=="object"&&n!==null?jn(n,rs.object):[null,void 0]},is=function(n,r){var e=br(n);return{h:e.h,s:We(e.s+100*r,0,100),l:e.l,a:e.a}},ss=function(n){return(299*n.r+587*n.g+114*n.b)/1e3/255},Gn=function(n,r){var e=br(n);return{h:e.h,s:e.s,l:We(e.l+100*r,0,100),a:e.a}},ns=function(){function n(r){this.parsed=ql(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return n.prototype.isValid=function(){return this.parsed!==null},n.prototype.brightness=function(){return me(ss(this.rgba),2)},n.prototype.isDark=function(){return ss(this.rgba)<.5},n.prototype.isLight=function(){return ss(this.rgba)>=.5},n.prototype.toHex=function(){return r=ts(this.rgba),e=r.r,t=r.g,i=r.b,o=(s=r.a)<1?ti(me(255*s)):"","#"+ti(e)+ti(t)+ti(i)+o;var r,e,t,i,s,o},n.prototype.toRgb=function(){return ts(this.rgba)},n.prototype.toRgbString=function(){return r=ts(this.rgba),e=r.r,t=r.g,i=r.b,(s=r.a)<1?"rgba("+e+", "+t+", "+i+", "+s+")":"rgb("+e+", "+t+", "+i+")";var r,e,t,i,s},n.prototype.toHsl=function(){return zn(br(this.rgba))},n.prototype.toHslString=function(){return r=zn(br(this.rgba)),e=r.h,t=r.s,i=r.l,(s=r.a)<1?"hsla("+e+", "+t+"%, "+i+"%, "+s+")":"hsl("+e+", "+t+"%, "+i+"%)";var r,e,t,i,s},n.prototype.toHsv=function(){return r=Nn(this.rgba),{h:me(r.h),s:me(r.s),v:me(r.v),a:me(r.a,3)};var r},n.prototype.invert=function(){return st({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},n.prototype.saturate=function(r){return r===void 0&&(r=.1),st(is(this.rgba,r))},n.prototype.desaturate=function(r){return r===void 0&&(r=.1),st(is(this.rgba,-r))},n.prototype.grayscale=function(){return st(is(this.rgba,-1))},n.prototype.lighten=function(r){return r===void 0&&(r=.1),st(Gn(this.rgba,r))},n.prototype.darken=function(r){return r===void 0&&(r=.1),st(Gn(this.rgba,-r))},n.prototype.rotate=function(r){return r===void 0&&(r=15),this.hue(this.hue()+r)},n.prototype.alpha=function(r){return typeof r=="number"?st({r:(e=this.rgba).r,g:e.g,b:e.b,a:r}):me(this.rgba.a,3);var e},n.prototype.hue=function(r){var e=br(this.rgba);return typeof r=="number"?st({h:r,s:e.s,l:e.l,a:e.a}):me(e.h)},n.prototype.isEqual=function(r){return this.toHex()===st(r).toHex()},n}(),st=function(n){return n instanceof ns?n:new ns(n)},qn=[],Wl=function(n){n.forEach(function(r){qn.indexOf(r)<0&&(r(ns,rs),qn.push(r))})};function Xl(n,r){var e={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},t={};for(var i in e)t[e[i]]=i;var s={};n.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,l,h=t[this.toHex()];if(h)return h;if(o!=null&&o.closest){var c=this.toRgb(),f=1/0,p="black";if(!s.length)for(var d in e)s[d]=new n(e[d]).toRgb();for(var m in e){var v=(a=c,l=s[m],Math.pow(a.r-l.r,2)+Math.pow(a.g-l.g,2)+Math.pow(a.b-l.b,2));v<f&&(f=v,p=m)}return p}},r.string.push([function(o){var a=o.toLowerCase(),l=a==="transparent"?"#0000":e[a];return l?new n(l).toRgb():null},"name"])}Wl([Xl]);class Pt{get value(){return this._value}set value(r){if(this._value===r)return;this._value=r;let e;typeof r=="number"?e={r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255}:e=r;const t=st(e);t.isValid()?this._colord=t:console.warn(`Unable to convert color ${r}`)}get r8(){return this._colord.rgba.r}get g8(){return this._colord.rgba.g}get b8(){return this._colord.rgba.b}get a8(){return this._colord.rgba.a*255&255}get r(){return this.r8/255}get g(){return this.g8/255}get b(){return this.b8/255}get a(){return this._colord.rgba.a}get rgb(){return(this.r8<<16)+(this.g8<<8)+this.b8}get bgr(){return(this.b8<<16)+(this.g8<<8)+this.r8}get abgr(){return(this.a8<<24)+this.bgr}constructor(r=0){this.value=r}toArgb(r=this.a,e=!0){if(r===1)return(255<<24)+this.rgb;if(r===0)return e?0:this.rgb;let t=this.r8,i=this.g8,s=this.b8;return e&&(t=t*r+.5|0,i=i*r+.5|0,s=s*r+.5|0),(r*255<<24)+(t<<16)+(i<<8)+s}toHex(){return this._colord.toHex()}toArray(){return[this.r,this.g,this.b,this.a]}}class os extends it{constructor(r){super(4,5,r)}hueRotate(r=0){const e=Math.sin(r),t=Math.cos(r),i=.213,s=.715,o=.072;return this.multiply([i+t*(1-i)+e*-i,s+t*-s+e*-s,o+t*-o+e*(1-o),0,0,i+t*-i+e*.143,s+t*(1-s)+e*.14,o+t*-o+e*-.283,0,0,i+t*-i+e*-(1-i),s+t*-s+e*s,o+t*(1-o)+e*o,0,0,0,0,0,1,0])}saturate(r=1){const e=(r-1)*2/3+1,t=(e-1)*-.5;return this.multiply([e,t,t,0,0,t,e,t,0,0,t,t,e,0,0,0,0,0,1,0])}brightness(r=1){const e=r;return this.multiply([e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0])}contrast(r=1){const e=r,t=-128*(e-1);return this.multiply([e,0,0,0,t,0,e,0,0,t,0,0,e,0,t,0,0,0,1,0])}invert(r=1){const e=fe(1,-1,r),t=fe(0,255,r);return this.multiply([e,0,0,0,t,0,e,0,0,t,0,0,e,0,t,0,0,0,1,0])}sepia(r=1){const e=xt(0,r,1);return this.multiply([fe(1,.393,e),fe(0,.7689999,e),fe(0,.18899999,e),0,0,fe(0,.349,e),fe(1,.6859999,e),fe(0,.16799999,e),0,0,fe(0,.272,e),fe(0,.5339999,e),fe(1,.13099999,e),0,0,0,0,0,1,0])}opacity(r=1){return this.multiply([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,r,0])}grayscale(r=1){const e=xt(0,r,1),t=fe(1,.3,e),i=fe(0,.3,e),s=fe(1,.59,e),o=fe(0,.59,e),a=fe(1,.11,e),l=fe(0,.11,e);return this.multiply([t,o,l,0,0,i,s,l,0,0,i,o,a,0,0,0,0,0,1,0])}multiply(r){const e=r,t=this._array;return this.set([t[0]*e[0]+t[1]*e[5]+t[2]*e[10]+t[3]*e[15],t[0]*e[1]+t[1]*e[6]+t[2]*e[11]+t[3]*e[16],t[0]*e[2]+t[1]*e[7]+t[2]*e[12]+t[3]*e[17],t[0]*e[3]+t[1]*e[8]+t[2]*e[13]+t[3]*e[18],t[0]*e[4]+t[1]*e[9]+t[2]*e[14]+t[3]*e[19]+t[4],t[5]*e[0]+t[6]*e[5]+t[7]*e[10]+t[8]*e[15],t[5]*e[1]+t[6]*e[6]+t[7]*e[11]+t[8]*e[16],t[5]*e[2]+t[6]*e[7]+t[7]*e[12]+t[8]*e[17],t[5]*e[3]+t[6]*e[8]+t[7]*e[13]+t[8]*e[18],t[5]*e[4]+t[6]*e[9]+t[7]*e[14]+t[8]*e[19]+t[9],t[10]*e[0]+t[11]*e[5]+t[12]*e[10]+t[13]*e[15],t[10]*e[1]+t[11]*e[6]+t[12]*e[11]+t[13]*e[16],t[10]*e[2]+t[11]*e[7]+t[12]*e[12]+t[13]*e[17],t[10]*e[3]+t[11]*e[8]+t[12]*e[13]+t[13]*e[18],t[10]*e[4]+t[11]*e[9]+t[12]*e[14]+t[13]*e[19]+t[14],t[15]*e[0]+t[16]*e[5]+t[17]*e[10]+t[18]*e[15],t[15]*e[1]+t[16]*e[6]+t[17]*e[11]+t[18]*e[16],t[15]*e[2]+t[16]*e[7]+t[17]*e[12]+t[18]*e[17],t[15]*e[3]+t[16]*e[8]+t[17]*e[13]+t[18]*e[18],t[15]*e[4]+t[16]*e[9]+t[17]*e[14]+t[18]*e[19]+t[19]])}toMatrix4(){const r=this._array;return new Mn([r[0],r[1],r[2],r[3],r[5],r[6],r[7],r[8],r[10],r[11],r[12],r[13],r[15],r[16],r[17],r[18]])}toVector4(){const r=this._array;return new Un(r[4]/255,r[9]/255,r[14]/255,r[19]/255)}}class as extends de{constructor(r){const e=new Pt(r);super({width:1,height:1,pixels:new Uint8Array([e.r8,e.g8,e.b8,e.a8])})}}function Hl(n,r,e=2){const t=r&&r.length,i=t?r[0]*e:n.length;let s=Wn(n,0,i,e,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,h;if(t&&(s=Ql(n,r,s,e)),n.length>80*e){a=1/0,l=1/0;let c=-1/0,f=-1/0;for(let p=e;p<i;p+=e){const d=n[p],m=n[p+1];d<a&&(a=d),m<l&&(l=m),d>c&&(c=d),m>f&&(f=m)}h=Math.max(c-a,f-l),h=h!==0?32767/h:0}return wr(s,o,e,a,l,h,0),o}function Wn(n,r,e,t,i){let s;if(i===ch(n,r,e,t)>0)for(let o=r;o<e;o+=t)s=Zn(o/t|0,n[o],n[o+1],s);else for(let o=e-t;o>=r;o-=t)s=Zn(o/t|0,n[o],n[o+1],s);return s&&tr(s,s.next)&&(Cr(s),s=s.next),s}function Bt(n,r){if(!n)return n;r||(r=n);let e=n,t;do if(t=!1,!e.steiner&&(tr(e,e.next)||se(e.prev,e,e.next)===0)){if(Cr(e),e=r=e.prev,e===e.next)break;t=!0}else e=e.next;while(t||e!==r);return r}function wr(n,r,e,t,i,s,o){if(!n)return;!o&&s&&sh(n,t,i,s);let a=n;for(;n.prev!==n.next;){const l=n.prev,h=n.next;if(s?Zl(n,t,i,s):Yl(n)){r.push(l.i,n.i,h.i),Cr(n),n=h.next,a=h.next;continue}if(n=h,n===a){o?o===1?(n=Kl(Bt(n),r),wr(n,r,e,t,i,s,2)):o===2&&Jl(n,r,e,t,i,s):wr(Bt(n),r,e,t,i,s,1);break}}}function Yl(n){const r=n.prev,e=n,t=n.next;if(se(r,e,t)>=0)return!1;const i=r.x,s=e.x,o=t.x,a=r.y,l=e.y,h=t.y,c=Math.min(i,s,o),f=Math.min(a,l,h),p=Math.max(i,s,o),d=Math.max(a,l,h);let m=t.next;for(;m!==r;){if(m.x>=c&&m.x<=p&&m.y>=f&&m.y<=d&&xr(i,a,s,l,o,h,m.x,m.y)&&se(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Zl(n,r,e,t){const i=n.prev,s=n,o=n.next;if(se(i,s,o)>=0)return!1;const a=i.x,l=s.x,h=o.x,c=i.y,f=s.y,p=o.y,d=Math.min(a,l,h),m=Math.min(c,f,p),v=Math.max(a,l,h),y=Math.max(c,f,p),S=ls(d,m,r,e,t),C=ls(v,y,r,e,t);let x=n.prevZ,T=n.nextZ;for(;x&&x.z>=S&&T&&T.z<=C;){if(x.x>=d&&x.x<=v&&x.y>=m&&x.y<=y&&x!==i&&x!==o&&xr(a,c,l,f,h,p,x.x,x.y)&&se(x.prev,x,x.next)>=0||(x=x.prevZ,T.x>=d&&T.x<=v&&T.y>=m&&T.y<=y&&T!==i&&T!==o&&xr(a,c,l,f,h,p,T.x,T.y)&&se(T.prev,T,T.next)>=0))return!1;T=T.nextZ}for(;x&&x.z>=S;){if(x.x>=d&&x.x<=v&&x.y>=m&&x.y<=y&&x!==i&&x!==o&&xr(a,c,l,f,h,p,x.x,x.y)&&se(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;T&&T.z<=C;){if(T.x>=d&&T.x<=v&&T.y>=m&&T.y<=y&&T!==i&&T!==o&&xr(a,c,l,f,h,p,T.x,T.y)&&se(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function Kl(n,r){let e=n;do{const t=e.prev,i=e.next.next;!tr(t,i)&&Hn(t,e,e.next,i)&&Pr(t,i)&&Pr(i,t)&&(r.push(t.i,e.i,i.i),Cr(e),Cr(e.next),e=n=i),e=e.next}while(e!==n);return Bt(e)}function Jl(n,r,e,t,i,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&ah(o,a)){let l=Yn(o,a);o=Bt(o,o.next),l=Bt(l,l.next),wr(o,r,e,t,i,s,0),wr(l,r,e,t,i,s,0);return}a=a.next}o=o.next}while(o!==n)}function Ql(n,r,e,t){const i=[];for(let s=0,o=r.length;s<o;s++){const a=r[s]*t,l=s<o-1?r[s+1]*t:n.length,h=Wn(n,a,l,t,!1);h===h.next&&(h.steiner=!0),i.push(oh(h))}i.sort(eh);for(let s=0;s<i.length;s++)e=th(i[s],e);return e}function eh(n,r){let e=n.x-r.x;if(e===0&&(e=n.y-r.y,e===0)){const t=(n.next.y-n.y)/(n.next.x-n.x),i=(r.next.y-r.y)/(r.next.x-r.x);e=t-i}return e}function th(n,r){const e=rh(n,r);if(!e)return r;const t=Yn(e,n);return Bt(t,t.next),Bt(e,e.next)}function rh(n,r){let e=r;const t=n.x,i=n.y;let s=-1/0,o;if(tr(n,e))return e;do{if(tr(n,e.next))return e.next;if(i<=e.y&&i>=e.next.y&&e.next.y!==e.y){const f=e.x+(i-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(f<=t&&f>s&&(s=f,o=e.x<e.next.x?e:e.next,f===t))return o}e=e.next}while(e!==r);if(!o)return null;const a=o,l=o.x,h=o.y;let c=1/0;e=o;do{if(t>=e.x&&e.x>=l&&t!==e.x&&Xn(i<h?t:s,i,l,h,i<h?s:t,i,e.x,e.y)){const f=Math.abs(i-e.y)/(t-e.x);Pr(e,n)&&(f<c||f===c&&(e.x>o.x||e.x===o.x&&ih(o,e)))&&(o=e,c=f)}e=e.next}while(e!==a);return o}function ih(n,r){return se(n.prev,n,r.prev)<0&&se(r.next,n,n.next)<0}function sh(n,r,e,t){let i=n;do i.z===0&&(i.z=ls(i.x,i.y,r,e,t)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,nh(i)}function nh(n){let r,e=1;do{let t=n,i;n=null;let s=null;for(r=0;t;){r++;let o=t,a=0;for(let h=0;h<e&&(a++,o=o.nextZ,!!o);h++);let l=e;for(;a>0||l>0&&o;)a!==0&&(l===0||!o||t.z<=o.z)?(i=t,t=t.nextZ,a--):(i=o,o=o.nextZ,l--),s?s.nextZ=i:n=i,i.prevZ=s,s=i;t=o}s.nextZ=null,e*=2}while(r>1);return n}function ls(n,r,e,t,i){return n=(n-e)*i|0,r=(r-t)*i|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,n|r<<1}function oh(n){let r=n,e=n;do(r.x<e.x||r.x===e.x&&r.y<e.y)&&(e=r),r=r.next;while(r!==n);return e}function Xn(n,r,e,t,i,s,o,a){return(i-o)*(r-a)>=(n-o)*(s-a)&&(n-o)*(t-a)>=(e-o)*(r-a)&&(e-o)*(s-a)>=(i-o)*(t-a)}function xr(n,r,e,t,i,s,o,a){return!(n===o&&r===a)&&Xn(n,r,e,t,i,s,o,a)}function ah(n,r){return n.next.i!==r.i&&n.prev.i!==r.i&&!lh(n,r)&&(Pr(n,r)&&Pr(r,n)&&hh(n,r)&&(se(n.prev,n,r.prev)||se(n,r.prev,r))||tr(n,r)&&se(n.prev,n,n.next)>0&&se(r.prev,r,r.next)>0)}function se(n,r,e){return(r.y-n.y)*(e.x-r.x)-(r.x-n.x)*(e.y-r.y)}function tr(n,r){return n.x===r.x&&n.y===r.y}function Hn(n,r,e,t){const i=ii(se(n,r,e)),s=ii(se(n,r,t)),o=ii(se(e,t,n)),a=ii(se(e,t,r));return!!(i!==s&&o!==a||i===0&&ri(n,e,r)||s===0&&ri(n,t,r)||o===0&&ri(e,n,t)||a===0&&ri(e,r,t))}function ri(n,r,e){return r.x<=Math.max(n.x,e.x)&&r.x>=Math.min(n.x,e.x)&&r.y<=Math.max(n.y,e.y)&&r.y>=Math.min(n.y,e.y)}function ii(n){return n>0?1:n<0?-1:0}function lh(n,r){let e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==r.i&&e.next.i!==r.i&&Hn(e,e.next,n,r))return!0;e=e.next}while(e!==n);return!1}function Pr(n,r){return se(n.prev,n,n.next)<0?se(n,r,n.next)>=0&&se(n,n.prev,r)>=0:se(n,r,n.prev)<0||se(n,n.next,r)<0}function hh(n,r){let e=n,t=!1;const i=(n.x+r.x)/2,s=(n.y+r.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&i<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(t=!t),e=e.next;while(e!==n);return t}function Yn(n,r){const e=hs(n.i,n.x,n.y),t=hs(r.i,r.x,r.y),i=n.next,s=r.prev;return n.next=r,r.prev=n,e.next=i,i.prev=e,t.next=e,e.prev=t,s.next=t,t.prev=s,t}function Zn(n,r,e,t){const i=hs(n,r,e);return t?(i.next=t.next,i.prev=t,t.next.prev=i,t.next=i):(i.prev=i,i.next=i),i}function Cr(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function hs(n,r,e){return{i:n,x:r,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function ch(n,r,e,t){let i=0;for(let s=r,o=e-t;s<e;s+=t)i+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return i}function uh(n,r,e,t={}){const{radius:i=1}=t;n.moveTo(r,e),n.arc(r,e,i,0,Math.PI*2)}const fh={arcs:"bevel",bevel:"bevel",miter:"miter","miter-clip":"miter",round:"round"};function cs(n,r){const{fill:e="#000",stroke:t="none",strokeWidth:i=t==="none"?0:1,strokeLinecap:s="round",strokeLinejoin:o="miter",strokeMiterlimit:a=0,strokeDasharray:l=[],strokeDashoffset:h=0,shadowOffsetX:c=0,shadowOffsetY:f=0,shadowBlur:p=0,shadowColor:d="rgba(0, 0, 0, 0)"}=r;n.fillStyle=e,n.strokeStyle=t,n.lineWidth=i,n.lineCap=s,n.lineJoin=fh[o],n.miterLimit=a,n.setLineDash(l),n.lineDashOffset=h,n.shadowOffsetX=c,n.shadowOffsetY=f,n.shadowBlur=p,n.shadowColor=d}class O{constructor(r=0,e=0){this.x=r,this.y=e}static get MAX(){return new O(1/0,1/0)}static get MIN(){return new O(-1/0,-1/0)}get array(){return[this.x,this.y]}set(r,e){return this.x=r,this.y=e,this}add(r){return this.x+=r.x,this.y+=r.y,this}sub(r){return this.x-=r.x,this.y-=r.y,this}multiply(r){return this.x*=r.x,this.y*=r.y,this}divide(r){return this.x/=r.x,this.y/=r.y,this}dot(r){return this.x*r.x+this.y*r.y}cross(r){return this.x*r.y-this.y*r.x}rotate(r,e={x:0,y:0}){const t=-r/180*Math.PI,i=this.x-e.x,s=-(this.y-e.y),o=Math.sin(t),a=Math.cos(t);return this.set(e.x+(i*a-s*o),e.y-(i*o+s*a)),this}distanceTo(r){return Math.sqrt(this.distanceToSquared(r))}distanceToSquared(r){const e=this.x-r.x,t=this.y-r.y;return e*e+t*t}lengthSquared(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.lengthSquared())}scale(r,e=r,t={x:0,y:0}){const i=r<0?t.x-this.x+t.x:this.x,s=e<0?t.y-this.y+t.y:this.y;return this.x=i*Math.abs(r),this.y=s*Math.abs(e),this}skew(r,e=0,t={x:0,y:0}){const i=this.x-t.x,s=this.y-t.y;return this.x=t.x+(i+Math.tan(r)*s),this.y=t.y+(s+Math.tan(e)*i),this}min(...r){return this.x=Math.min(this.x,...r.map(e=>e.x)),this.y=Math.min(this.y,...r.map(e=>e.y)),this}max(...r){return this.x=Math.max(this.x,...r.map(e=>e.x)),this.y=Math.max(this.y,...r.map(e=>e.y)),this}normalize(){return this.scale(1/(this.length()||1))}addVectors(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this}subVectors(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this}multiplyVectors(r,e){return this.x=r.x*e.x,this.y=r.y*e.y,this}divideVectors(r,e){return this.x=r.x/e.x,this.y=r.y/e.y,this}lerpVectors(r,e,t){return this.x=r.x+(e.x-r.x)*t,this.y=r.y+(e.y-r.y)*t,this}equals(r){return this.x===r.x&&this.y===r.y}applyMatrix3(r){const e=this.x,t=this.y,i=r.elements;return this.x=i[0]*e+i[3]*t+i[6],this.y=i[1]*e+i[4]*t+i[7],this}copy(r){return this.x=r.x,this.y=r.y,this}clone(){return new O(this.x,this.y)}}class Y{constructor(r=0,e=0,t=0,i=0){this.left=r,this.top=e,this.width=t,this.height=i}get x(){return this.left}set x(r){this.left=r}get y(){return this.top}set y(r){this.top=r}get right(){return this.left+this.width}get bottom(){return this.top+this.height}get center(){return new O((this.left+this.right)/2,(this.top+this.bottom)/2)}get array(){return[this.left,this.top,this.width,this.height]}static from(...r){if(r.length===0)return new Y;if(r.length===1)return r[0].clone();const e=r[0],t=r.slice(1).reduce((i,s)=>(i.left=Math.min(i.left,s.left),i.top=Math.min(i.top,s.top),i.right=Math.max(i.right,s.right),i.bottom=Math.max(i.bottom,s.bottom),i),{left:(e==null?void 0:e.left)??0,top:(e==null?void 0:e.top)??0,right:(e==null?void 0:e.right)??0,bottom:(e==null?void 0:e.bottom)??0});return new Y(t.left,t.top,t.right-t.left,t.bottom-t.top)}translate(r,e){return this.left+=r,this.top+=e,this}copy(r){return this.left=r.left,this.top=r.top,this.width=r.width,this.height=r.height,this}clone(){return new Y(this.left,this.top,this.width,this.height)}}class ke{constructor(r=1,e=0,t=0,i=0,s=1,o=0,a=0,l=0,h=1){u(this,"elements",[]);this.set(r,e,t,i,s,o,a,l,h)}set(r,e,t,i,s,o,a,l,h){const c=this.elements;return c[0]=r,c[1]=i,c[2]=a,c[3]=e,c[4]=s,c[5]=l,c[6]=t,c[7]=o,c[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(r){const e=this.elements,t=r.elements;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this}multiply(r){return this.multiplyMatrices(this,r)}premultiply(r){return this.multiplyMatrices(r,this)}multiplyMatrices(r,e){const t=r.elements,i=e.elements,s=this.elements,o=t[0],a=t[3],l=t[6],h=t[1],c=t[4],f=t[7],p=t[2],d=t[5],m=t[8],v=i[0],y=i[3],S=i[6],C=i[1],x=i[4],T=i[7],b=i[2],P=i[5],E=i[8];return s[0]=o*v+a*C+l*b,s[3]=o*y+a*x+l*P,s[6]=o*S+a*T+l*E,s[1]=h*v+c*C+f*b,s[4]=h*y+c*x+f*P,s[7]=h*S+c*T+f*E,s[2]=p*v+d*C+m*b,s[5]=p*y+d*x+m*P,s[8]=p*S+d*T+m*E,this}invert(){const r=this.elements,e=r[0],t=r[1],i=r[2],s=r[3],o=r[4],a=r[5],l=r[6],h=r[7],c=r[8],f=c*o-a*h,p=a*l-c*s,d=h*s-o*l,m=e*f+t*p+i*d;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/m;return r[0]=f*v,r[1]=(i*h-c*t)*v,r[2]=(a*t-i*o)*v,r[3]=p*v,r[4]=(c*e-i*l)*v,r[5]=(i*s-a*e)*v,r[6]=d*v,r[7]=(t*l-h*e)*v,r[8]=(o*e-t*s)*v,this}transpose(){let r;const e=this.elements;return r=e[1],e[1]=e[3],e[3]=r,r=e[2],e[2]=e[6],e[6]=r,r=e[5],e[5]=e[7],e[7]=r,this}scale(r,e){return this.premultiply(us.makeScale(r,e)),this}rotate(r){return this.premultiply(us.makeRotation(-r)),this}translate(r,e){return this.premultiply(us.makeTranslation(r,e)),this}makeTranslation(r,e){return this.set(1,0,r,0,1,e,0,0,1),this}makeRotation(r){const e=Math.cos(r),t=Math.sin(r);return this.set(e,-t,0,t,e,0,0,0,1),this}makeScale(r,e){return this.set(r,0,0,0,e,0,0,0,1),this}fromArray(r,e=0){for(let t=0;t<9;t++)this.elements[t]=r[t+e];return this}clone(){return new this.constructor().fromArray(this.elements)}}const us=new ke;function Kn(n,r,e,t){const i=n*e+r*t,s=Math.sqrt(n*n+r*r)*Math.sqrt(e*e+t*t);let o=Math.acos(Math.max(-1,Math.min(1,i/s)));return n*t-r*e<0&&(o=-o),o}function dh(n,r,e,t,i,s,o,a){if(r===0||e===0){n.lineTo(a.x,a.y);return}t=t*Math.PI/180,r=Math.abs(r),e=Math.abs(e);const l=(o.x-a.x)/2,h=(o.y-a.y)/2,c=Math.cos(t)*l+Math.sin(t)*h,f=-Math.sin(t)*l+Math.cos(t)*h;let p=r*r,d=e*e;const m=c*c,v=f*f,y=m/p+v/d;if(y>1){const F=Math.sqrt(y);r=F*r,e=F*e,p=r*r,d=e*e}const S=p*v+d*m,C=(p*d-S)/S;let x=Math.sqrt(Math.max(0,C));i===s&&(x=-x);const T=x*r*f/e,b=-x*e*c/r,P=Math.cos(t)*T-Math.sin(t)*b+(o.x+a.x)/2,E=Math.sin(t)*T+Math.cos(t)*b+(o.y+a.y)/2,w=Kn(1,0,(c-T)/r,(f-b)/e),D=Kn((c-T)/r,(f-b)/e,(-c-T)/r,(-f-b)/e)%(Math.PI*2);n.ellipse(P,E,r,e,t,w,w+D,s===0)}const he={SEPARATOR:/[ \t\r\n,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/\d/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};function nt(n,r,e=0){let a=0,l=!0,h="",c="";const f=[];function p(y,S,C){const x=new SyntaxError(`Unexpected character "${y}" at index ${S}.`);throw x.partial=C,x}function d(){h!==""&&(c===""?f.push(Number(h)):f.push(Number(h)*10**Number(c))),h="",c=""}let m;const v=n.length;for(let y=0;y<v;y++){if(m=n[y],Array.isArray(r)&&r.includes(f.length%e)&&he.FLAGS.test(m)){a=1,h=m,d();continue}if(a===0){if(he.WHITESPACE.test(m))continue;if(he.DIGIT.test(m)||he.SIGN.test(m)){a=1,h=m;continue}if(he.POINT.test(m)){a=2,h=m;continue}he.COMMA.test(m)&&(l&&p(m,y,f),l=!0)}if(a===1){if(he.DIGIT.test(m)){h+=m;continue}if(he.POINT.test(m)){h+=m,a=2;continue}if(he.EXP.test(m)){a=3;continue}he.SIGN.test(m)&&h.length===1&&he.SIGN.test(h[0])&&p(m,y,f)}if(a===2){if(he.DIGIT.test(m)){h+=m;continue}if(he.EXP.test(m)){a=3;continue}he.POINT.test(m)&&h[h.length-1]==="."&&p(m,y,f)}if(a===3){if(he.DIGIT.test(m)){c+=m;continue}if(he.SIGN.test(m)){if(c===""){c+=m;continue}c.length===1&&he.SIGN.test(c)&&p(m,y,f)}}he.WHITESPACE.test(m)?(d(),a=0,l=!1):he.COMMA.test(m)?(d(),a=0,l=!0):he.SIGN.test(m)?(d(),a=1,h=m):he.POINT.test(m)?(d(),a=2,h=m):p(m,y,f)}return d(),f}function rr(n,r){return n-(r-n)}function Jn(n,r){const e=new O,t=new O;for(let i=0,s=n.length;i<s;i++){const o=n[i];if(o.type==="m"||o.type==="M")o.type==="m"?e.add(o):e.copy(o),r.moveTo(e.x,e.y),t.copy(e);else if(o.type==="h"||o.type==="H")o.type==="h"?e.x+=o.x:e.x=o.x,r.lineTo(e.x,e.y),t.copy(e);else if(o.type==="v"||o.type==="V")o.type==="v"?e.y+=o.y:e.y=o.y,r.lineTo(e.x,e.y),t.copy(e);else if(o.type==="l"||o.type==="L")o.type==="l"?e.add(o):e.copy(o),r.lineTo(e.x,e.y),t.copy(e);else if(o.type==="c"||o.type==="C")o.type==="c"?(r.bezierCurveTo(e.x+o.x1,e.y+o.y1,e.x+o.x2,e.y+o.y2,e.x+o.x,e.y+o.y),t.x=e.x+o.x2,t.y=e.y+o.y2,e.add(o)):(r.bezierCurveTo(o.x1,o.y1,o.x2,o.y2,o.x,o.y),t.x=o.x2,t.y=o.y2,e.copy(o));else if(o.type==="s"||o.type==="S")o.type==="s"?(r.bezierCurveTo(rr(e.x,t.x),rr(e.y,t.y),e.x+o.x2,e.y+o.y2,e.x+o.x,e.y+o.y),t.x=e.x+o.x2,t.y=e.y+o.y2,e.add(o)):(r.bezierCurveTo(rr(e.x,t.x),rr(e.y,t.y),o.x2,o.y2,o.x,o.y),t.x=o.x2,t.y=o.y2,e.copy(o));else if(o.type==="q"||o.type==="Q")o.type==="q"?(r.quadraticCurveTo(e.x+o.x1,e.y+o.y1,e.x+o.x,e.y+o.y),t.x=e.x+o.x1,t.y=e.y+o.y1,e.add(o)):(r.quadraticCurveTo(o.x1,o.y1,o.x,o.y),t.x=o.x1,t.y=o.y1,e.copy(o));else if(o.type==="t"||o.type==="T"){const a=rr(e.x,t.x),l=rr(e.y,t.y);t.x=a,t.y=l,o.type==="t"?(r.quadraticCurveTo(a,l,e.x+o.x,e.y+o.y),e.add(o)):(r.quadraticCurveTo(a,l,o.x,o.y),e.copy(o))}else if(o.type==="a"||o.type==="A"){const a=e.clone();if(o.type==="a"){if(o.x===0&&o.y===0)continue;e.add(o)}else{if(e.equals(o))continue;e.copy(o)}t.copy(e),dh(r,o.rx,o.ry,o.angle,o.largeArcFlag,o.sweepFlag,a,e)}else o.type==="z"||o.type==="Z"?(r.startPoint&&e.copy(r.startPoint),r.closePath()):console.warn("Unsupported commands",o)}}function ph(n){let r,e;const t=[];for(let i=0,s=n.length;i<s;i++){const o=n[i];switch(o.type){case"m":case"M":if(o.x.toFixed(4)===(e==null?void 0:e.x.toFixed(4))&&o.y.toFixed(4)===(e==null?void 0:e.y.toFixed(4)))continue;t.push(`${o.type} ${o.x} ${o.y}`),e={x:o.x,y:o.y},r={x:o.x,y:o.y};break;case"h":case"H":t.push(`${o.type} ${o.x}`),e={x:o.x,y:(e==null?void 0:e.y)??0};break;case"v":case"V":t.push(`${o.type} ${o.y}`),e={x:(e==null?void 0:e.x)??0,y:o.y};break;case"l":case"L":t.push(`${o.type} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"c":case"C":t.push(`${o.type} ${o.x1} ${o.y1} ${o.x2} ${o.y2} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"s":case"S":t.push(`${o.type} ${o.x2} ${o.y2} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"q":case"Q":t.push(`${o.type} ${o.x1} ${o.y1} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"t":case"T":t.push(`${o.type} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"a":case"A":t.push(`${o.type} ${o.rx} ${o.ry} ${o.angle} ${o.largeArcFlag} ${o.sweepFlag} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"z":case"Z":t.push(o.type),r&&(e={x:r.x,y:r.y});break}}return t.join(" ")}const gh=/[a-df-z][^a-df-z]*/gi;function Qn(n){const r=[],e=n.match(gh);if(!e)return r;for(let t=0,i=e.length;t<i;t++){const s=e[t],o=s.charAt(0),a=s.slice(1).trim();let l;switch(o){case"m":case"M":l=nt(a);for(let h=0,c=l.length;h<c;h+=2)h===0?r.push({type:o,x:l[h],y:l[h+1]}):r.push({type:o==="m"?"l":"L",x:l[h],y:l[h+1]});break;case"h":case"H":l=nt(a);for(let h=0,c=l.length;h<c;h++)r.push({type:o,x:l[h]});break;case"v":case"V":l=nt(a);for(let h=0,c=l.length;h<c;h++)r.push({type:o,y:l[h]});break;case"l":case"L":l=nt(a);for(let h=0,c=l.length;h<c;h+=2)r.push({type:o,x:l[h],y:l[h+1]});break;case"c":case"C":l=nt(a);for(let h=0,c=l.length;h<c;h+=6)r.push({type:o,x1:l[h],y1:l[h+1],x2:l[h+2],y2:l[h+3],x:l[h+4],y:l[h+5]});break;case"s":case"S":l=nt(a);for(let h=0,c=l.length;h<c;h+=4)r.push({type:o,x2:l[h],y2:l[h+1],x:l[h+2],y:l[h+3]});break;case"q":case"Q":l=nt(a);for(let h=0,c=l.length;h<c;h+=4)r.push({type:o,x1:l[h],y1:l[h+1],x:l[h+2],y:l[h+3]});break;case"t":case"T":l=nt(a);for(let h=0,c=l.length;h<c;h+=2)r.push({type:o,x:l[h],y:l[h+1]});break;case"a":case"A":l=nt(a,[3,4],7);for(let h=0,c=l.length;h<c;h+=7)r.push({type:o,rx:l[h],ry:l[h+1],angle:l[h+2],largeArcFlag:l[h+3],sweepFlag:l[h+4],x:l[h+5],y:l[h+6]});break;case"z":case"Z":r.push({type:o});break;default:console.warn(s)}}return r}function eo(n,r,e,t,i){const s=(t-r)*.5,o=(i-e)*.5,a=n*n,l=n*a;return(2*e-2*t+s+o)*l+(-3*e+3*t-2*s-o)*a+s*n+e}function mh(n,r){const e=1-n;return e*e*e*r}function yh(n,r){const e=1-n;return 3*e*e*n*r}function vh(n,r){return 3*(1-n)*n*n*r}function _h(n,r){return n*n*n*r}function to(n,r,e,t,i){return mh(n,r)+yh(n,e)+vh(n,t)+_h(n,i)}function bh(n,r={}){let{vertices:e=[],indices:t=[],holes:i=[],verticesStride:s=2,verticesOffset:o=0,indicesOffset:a=0}=r;const l=Hl(n,i,2);if(l){for(let c=0;c<l.length;c+=3)t[a++]=l[c]+o,t[a++]=l[c+1]+o,t[a++]=l[c+2]+o;let h=o*s;for(let c=0;c<n.length;c+=2)e[h]=n[c],e[h+1]=n[c+1],h+=s}return{vertices:e,indices:t}}const wh=8,si=11920929e-14,xh=1;function Ph(n,r,e,t,i,s,o,a,l=.5,h){const f=Math.min(.99,Math.max(0,l));let p=(xh-f)/1;return p*=p,fs(n,r,e,t,i,s,o,a,h,p,0),h.push(o,a),h}function fs(n,r,e,t,i,s,o,a,l,h,c){if(c>wh)return;const f=(n+e)/2,p=(r+t)/2,d=(e+i)/2,m=(t+s)/2,v=(i+o)/2,y=(s+a)/2,S=(f+d)/2,C=(p+m)/2,x=(d+v)/2,T=(m+y)/2,b=(S+x)/2,P=(C+T)/2;if(c>0){let E=o-n,w=a-r;const D=Math.abs((e-o)*w-(t-a)*E),F=Math.abs((i-o)*w-(s-a)*E);if(D>si&&F>si){if((D+F)*(D+F)<=h*(E*E+w*w)){l.push(b,P);return}}else if(D>si){if(D*D<=h*(E*E+w*w)){l.push(b,P);return}}else if(F>si){if(F*F<=h*(E*E+w*w)){l.push(b,P);return}}else if(E=b-(n+o)/2,w=P-(r+a)/2,E*E+w*w<=h){l.push(b,P);return}}fs(n,r,f,p,S,C,b,P,l,h,c+1),fs(b,P,x,T,v,y,o,a,l,h,c+1)}const Ch=8,Eh=11920929e-14,Th=1;function Sh(n,r,e,t,i,s,o=.5,a){const h=Math.min(.99,Math.max(0,o));let c=(Th-h)/1;return c*=c,ds(a,n,r,e,t,i,s,c,0),a.push(i,s),a}function ds(n,r,e,t,i,s,o,a,l){if(l>Ch)return;const h=(r+t)/2,c=(e+i)/2,f=(t+s)/2,p=(i+o)/2,d=(h+f)/2,m=(c+p)/2;let v=s-r,y=o-e;const S=Math.abs((t-s)*y-(i-o)*v);if(S>Eh){if(S*S<=a*(v*v+y*y)){n.push(d,m);return}}else if(v=d-(r+s)/2,y=m-(e+o)/2,v*v+y*y<=a){n.push(d,m);return}ds(n,r,e,h,c,d,m,a,l+1),ds(n,d,m,f,p,s,o,a,l+1)}function Mh(n,r){const e=1-n;return e*e*r}function Ah(n,r){return 2*(1-n)*n*r}function Oh(n,r){return n*n*r}function ro(n,r,e,t){return Mh(n,r)+Ah(n,e)+Oh(n,t)}const Uh=1e-4,io=1e-4;function so(n,r={}){const{vertices:e=[],indices:t=[],lineStyle:i={alignment:.5,cap:"butt",join:"miter",width:1,miterLimit:10},flipAlignment:s=!1,closed:o=!0}=r,a=Uh;if(n.length===0)return{vertices:e,indices:t};const l=i;let h=l.alignment;if(i.alignment!==.5){let k=Dh(n);s&&(k*=-1),h=(h-.5)*k+.5}const c={x:n[0],y:n[1]},f={x:n[n.length-2],y:n[n.length-1]},p=o,d=Math.abs(c.x-f.x)<a&&Math.abs(c.y-f.y)<a;if(p){n=n.slice(),d&&(n.pop(),n.pop(),f.x=n[n.length-2],f.y=n[n.length-1]);const k=(c.x+f.x)*.5,L=(f.y+c.y)*.5;n.unshift(k,L),n.push(k,L)}const m=e,v=n.length/2;let y=n.length;const S=m.length/2,C=l.width/2,x=C*C,T=l.miterLimit*l.miterLimit;let b=n[0],P=n[1],E=n[2],w=n[3],D=0,F=0,B=-(P-w),U=b-E,V=0,M=0,N=Math.sqrt(B*B+U*U);B/=N,U/=N,B*=C,U*=C;const q=h,R=(1-q)*2,I=q*2;p||(l.cap==="round"?y+=Lt(b-B*(R-I)*.5,P-U*(R-I)*.5,b-B*R,P-U*R,b+B*I,P+U*I,m,!0)+2:l.cap==="square"&&(y+=no(b,P,B,U,R,I,!0,m))),m.push(b-B*R,P-U*R),m.push(b+B*I,P+U*I);for(let k=1;k<v-1;++k){b=n[(k-1)*2],P=n[(k-1)*2+1],E=n[k*2],w=n[k*2+1],D=n[(k+1)*2],F=n[(k+1)*2+1],B=-(P-w),U=b-E,N=Math.sqrt(B*B+U*U),B/=N,U/=N,B*=C,U*=C,V=-(w-F),M=E-D,N=Math.sqrt(V*V+M*M),V/=N,M/=N,V*=C,M*=C;const L=E-b,K=P-w,X=E-D,W=F-w,G=L*X+K*W,Q=K*X-W*L,Z=Q<0;if(Math.abs(Q)<.001*Math.abs(G)){m.push(E-B*R,w-U*R),m.push(E+B*I,w+U*I),G>=0&&(l.join==="round"?y+=Lt(E,w,E-B*R,w-U*R,E-V*R,w-M*R,m,!1)+4:y+=2,m.push(E-V*I,w-M*I),m.push(E+V*R,w+M*R));continue}const ae=(-B+b)*(-U+w)-(-B+E)*(-U+P),ut=(-V+D)*(-M+w)-(-V+E)*(-M+F),Ze=(L*ut-X*ae)/Q,Le=(W*ae-K*ut)/Q,Fe=(Ze-E)*(Ze-E)+(Le-w)*(Le-w),Ce=E+(Ze-E)*R,$e=w+(Le-w)*R,tt=E-(Ze-E)*I,rt=w-(Le-w)*I,Ke=Math.min(L*L+K*K,X*X+W*W),il=Z?R:I,Qd=Ke+il*il*x;Fe<=Qd?l.join==="bevel"||Fe/x>T?(Z?(m.push(Ce,$e),m.push(E+B*I,w+U*I),m.push(Ce,$e),m.push(E+V*I,w+M*I)):(m.push(E-B*R,w-U*R),m.push(tt,rt),m.push(E-V*R,w-M*R),m.push(tt,rt)),y+=2):l.join==="round"?Z?(m.push(Ce,$e),m.push(E+B*I,w+U*I),y+=Lt(E,w,E+B*I,w+U*I,E+V*I,w+M*I,m,!0)+4,m.push(Ce,$e),m.push(E+V*I,w+M*I)):(m.push(E-B*R,w-U*R),m.push(tt,rt),y+=Lt(E,w,E-B*R,w-U*R,E-V*R,w-M*R,m,!1)+4,m.push(E-V*R,w-M*R),m.push(tt,rt)):(m.push(Ce,$e),m.push(tt,rt)):(m.push(E-B*R,w-U*R),m.push(E+B*I,w+U*I),l.join==="round"?Z?y+=Lt(E,w,E+B*I,w+U*I,E+V*I,w+M*I,m,!0)+2:y+=Lt(E,w,E-B*R,w-U*R,E-V*R,w-M*R,m,!1)+2:l.join==="miter"&&Fe/x<=T&&(Z?(m.push(tt,rt),m.push(tt,rt)):(m.push(Ce,$e),m.push(Ce,$e)),y+=2),m.push(E-V*R,w-M*R),m.push(E+V*I,w+M*I),y+=2)}b=n[(v-2)*2],P=n[(v-2)*2+1],E=n[(v-1)*2],w=n[(v-1)*2+1],B=-(P-w),U=b-E,N=Math.sqrt(B*B+U*U),B/=N,U/=N,B*=C,U*=C,m.push(E-B*R,w-U*R),m.push(E+B*I,w+U*I),p||(l.cap==="round"?y+=Lt(E-B*(R-I)*.5,w-U*(R-I)*.5,E-B*R,w-U*R,E+B*I,w+U*I,m,!1)+2:l.cap==="square"&&(y+=no(E,w,B,U,R,I,!1,m)));const j=io*io;for(let k=S;k<y+S-2;++k)b=m[k*2],P=m[k*2+1],E=m[(k+1)*2],w=m[(k+1)*2+1],D=m[(k+2)*2],F=m[(k+2)*2+1],!(Math.abs(b*(w-F)+E*(F-P)+D*(P-w))<j)&&t.push(k,k+1,k+2);return{vertices:e,indices:t}}function Dh(n){const r=n.length;if(r<6)return 1;let e=0;for(let t=0,i=n[r-2],s=n[r-1];t<r;t+=2){const o=n[t],a=n[t+1];e+=(o-i)*(a+s),i=o,s=a}return e<0?-1:1}function no(n,r,e,t,i,s,o,a){const l=n-e*i,h=r-t*i,c=n+e*s,f=r+t*s;let p,d;o?(p=t,d=-e):(p=-t,d=e);const m=l+p,v=h+d,y=c+p,S=f+d;return a.push(m,v),a.push(y,S),2}function Lt(n,r,e,t,i,s,o,a){const l=e-n,h=t-r;let c=Math.atan2(l,h),f=Math.atan2(i-n,s-r);a&&c<f?c+=Math.PI*2:!a&&c>f&&(f+=Math.PI*2);let p=c;const d=f-c,m=Math.abs(d),v=Math.sqrt(l*l+h*h),y=(15*m*Math.sqrt(v)/Math.PI>>0)+1,S=d/y;if(p+=S,a){o.push(n,r),o.push(e,t);for(let C=1,x=p;C<y;C++,x+=S)o.push(n,r),o.push(n+Math.sin(x)*v,r+Math.cos(x)*v);o.push(n,r),o.push(i,s)}else{o.push(e,t),o.push(n,r);for(let C=1,x=p;C<y;C++,x+=S)o.push(n+Math.sin(x)*v,r+Math.cos(x)*v),o.push(n,r);o.push(i,s),o.push(n,r)}return y*2}class ir{constructor(){u(this,"arcLengthDivision",200);u(this,"_arcLengths")}getPointAt(r,e=new O){return this.getPoint(this.getUToTMapping(r),e)}isClockwise(){const r=this.getPoint(1),e=this.getPoint(.5),t=this.getPoint(1);return(e.x-r.x)*(t.y-e.y)-(e.y-r.y)*(t.x-e.x)<0}getControlPointRefs(){return[]}applyTransform(r){return this.getControlPointRefs().forEach(e=>{e.applyMatrix3(r)}),this}getUnevenPointArray(r=5,e=[]){const t=new O;for(let i=0,s=Math.max(1,r)-1;i<=s;i++)this.getPoint(i/s,t),e.push(t.x,t.y);return e}getSpacedPointArray(r=5,e=[]){const t=new O;for(let i=0,s=Math.max(1,r)-1;i<=s;i++)this.getPointAt(i/s,t),e.push(t.x,t.y);return e}getAdaptivePointArray(r=[]){return this.getUnevenPointArray(5,r)}_pointArrayToPoint(r,e=[]){for(let t=0,i=r.length;t<i;t+=2){const s=r[t],o=r[t+1];e.push(new O(s,o))}return e}getSpacedPoints(r,e=[]){const t=this.getSpacedPointArray(r);return this._pointArrayToPoint(t,e),e}getUnevenPoints(r,e=[]){const t=this.getUnevenPointArray(r);return this._pointArrayToPoint(t,e),e}getAdaptivePoints(r=[]){const e=this.getAdaptivePointArray();return this._pointArrayToPoint(e,r),r}getPoints(r,e=[]){let t;return r?t=this.getUnevenPointArray(r):t=this.getAdaptivePointArray(),this._pointArrayToPoint(t,e),e}getLength(){const r=this.getLengths();return r[r.length-1]}getLengths(){return(!this._arcLengths||this._arcLengths.length!==this.arcLengthDivision+1)&&this.updateLengths(),this._arcLengths}updateLengths(){const r=this.arcLengthDivision,e=[0];for(let t=0,i=this.getPoint(0),s=1;s<=r;s++){const o=this.getPoint(s/r);t+=o.distanceTo(i),e.push(t),i=o}this._arcLengths=e}getUToTMapping(r,e){const t=this.getLengths(),i=t.length,s=e??r*t[i-1];if(i<2)return s/t[0];let o=0,a=0,l=i-1,h;for(;a<=l;)if(o=Math.floor(a+(l-a)/2),h=t[o]-s,h<0)a=o+1;else if(h>0)l=o-1;else{l=o;break}if(o=l,t[o]===s)return o/(i-1);const c=t[o],p=t[o+1]-c,d=(s-c)/p;return(o+d)/(i-1)}getTangent(r,e=new O){const i=Math.max(0,r-1e-4),s=Math.min(1,r+1e-4);return e.copy(this.getPoint(s).sub(this.getPoint(i)).normalize())}getTangentAt(r,e){return this.getTangent(this.getUToTMapping(r),e)}getNormal(r,e=new O){return this.getTangent(r,e),e.set(-e.y,e.x).normalize()}getNormalAt(r,e){return this.getNormal(this.getUToTMapping(r),e)}getTForPoint(r,e=.001){let t=0,i=1,s=(t+i)/2;for(;i-t>e;){s=(t+i)/2;const o=this.getPoint(s);if(o.distanceTo(r)<e)return s;o.x<r.x?t=s:i=s}return s}getMinMax(r=O.MAX,e=O.MIN){const t=this.getPoints();for(let i=0,s=t.length;i<s;i++){const o=t[i];r.min(o),e.max(o)}return{min:r,max:e}}getBoundingBox(){const{min:r,max:e}=this.getMinMax();return new Y(r.x,r.y,e.x-r.x,e.y-r.y)}fillTriangulate(r){return bh(this.getPoints().reduce((e,t)=>(e.push(t.x,t.y),e),[]),r)}strokeTriangulate(r){return so(this.getPoints().reduce((e,t)=>(e.push(t.x,t.y),e),[]),r)}toCommands(){const r=[],e=this.getPoints();for(let t=0,i=e.length;t<i;t++){const s=e[t];t===0?r.push({type:"M",x:s.x,y:s.y}):r.push({type:"L",x:s.x,y:s.y})}return r}toData(){return ph(this.toCommands())}drawTo(r){return this.toCommands().forEach(e=>{switch(e.type){case"M":r.moveTo(e.x,e.y);break;case"L":r.lineTo(e.x,e.y);break}}),this}copy(r){return this.arcLengthDivision=r.arcLengthDivision,this}clone(){return new this.constructor().copy(this)}}const Ih=new ke,oo=new ke,ao=new ke,ni=new O;class ps extends ir{constructor(r=new O,e=new O,t=new O,i=0,s=0,o=Math.PI*2,a=!1){super(),this._center=r,this._radius=e,this._diff=t,this.rotate=i,this.startAngle=s,this.endAngle=o,this.clockwise=a}get cx(){return this._center.x}set cx(r){this._center.x=r}get cy(){return this._center.y}set cy(r){this._center.y=r}get rx(){return this._radius.x}set rx(r){this._radius.x=r}get ry(){return this._radius.y}set ry(r){this._radius.y=r}get dx(){return this._diff.x}set dx(r){this._diff.x=r}get dy(){return this._diff.y}set dy(r){this._diff.y=r}isClockwise(){return this.clockwise}getPoint(r,e=new O){const t=Math.PI*2;let i=this.endAngle-this.startAngle;const s=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=t;for(;i>t;)i-=t;i<Number.EPSILON&&(s?i=0:i=t),this.clockwise&&!s&&(i===t?i=-t:i=i-t);const o=this.startAngle+r*i;let a=this.cx+this.rx*Math.cos(o),l=this.cy+this.ry*Math.sin(o);if(this.rotate!==0){const h=Math.cos(this.rotate),c=Math.sin(this.rotate),f=a-this.cx,p=l-this.cy;a=f*h-p*c+this.cx,l=f*c+p*h+this.cy}return e.set(a,l)}toCommands(){const{cx:r,cy:e,rx:t,ry:i,startAngle:s,endAngle:o,clockwise:a,rotate:l}=this,h=r+t*Math.cos(s)*Math.cos(l)-i*Math.sin(s)*Math.sin(l),c=e+t*Math.cos(s)*Math.sin(l)+i*Math.sin(s)*Math.cos(l),f=Math.abs(s-o),p=f>Math.PI?1:0,d=a?1:0,m=l*180/Math.PI;if(f>=2*Math.PI){const v=s+Math.PI,y=r+t*Math.cos(v)*Math.cos(l)-i*Math.sin(v)*Math.sin(l),S=e+t*Math.cos(v)*Math.sin(l)+i*Math.sin(v)*Math.cos(l);return[{type:"M",x:h,y:c},{type:"A",rx:t,ry:i,angle:m,largeArcFlag:0,sweepFlag:d,x:y,y:S},{type:"A",rx:t,ry:i,angle:m,largeArcFlag:0,sweepFlag:d,x:h,y:c}]}else{const v=r+t*Math.cos(o)*Math.cos(l)-i*Math.sin(o)*Math.sin(l),y=e+t*Math.cos(o)*Math.sin(l)+i*Math.sin(o)*Math.cos(l);return[{type:"M",x:h,y:c},{type:"A",rx:t,ry:i,angle:m,largeArcFlag:p,sweepFlag:d,x:v,y}]}}drawTo(r){const{cx:e,cy:t,rx:i,ry:s,rotate:o,startAngle:a,endAngle:l,clockwise:h}=this;return r.ellipse(e,t,i,s,o,a,l,!h),this}applyTransform(r){return ni.set(this.cx,this.cy),ni.applyMatrix3(r),this.cx=ni.x,this.cy=ni.y,Lh(r)?Rh(this,r):Bh(this,r),this}getControlPointRefs(){return[this._center]}getAdaptivePointArray(r=[]){const{cx:e,cy:t,rx:i,ry:s,dx:o,dy:a}=this;if(!(i>=0&&s>=0&&o>=0&&a>=0))return r;const l=Math.ceil(2.3*Math.sqrt(i+s)),h=l*8+(o?4:0)+(a?4:0);if(h===0)return r;const c=[];if(l===0)c[0]=c[6]=e+o,c[1]=c[3]=t+a,c[2]=c[4]=e-o,c[5]=c[7]=t-a;else{let f=0,p=l*4+(o?2:0)+2,d=p,m=h,v=o+i,y=a,S=e+v,C=e-v,x=t+y;if(c[f++]=S,c[f++]=x,c[--p]=x,c[--p]=C,a){const b=t-y;c[d++]=C,c[d++]=b,c[--m]=b,c[--m]=S}for(let b=1;b<l;b++){const P=Math.PI/2*(b/l),E=o+Math.cos(P)*i,w=a+Math.sin(P)*s,D=e+E,F=e-E,B=t+w,U=t-w;c[f++]=D,c[f++]=B,c[--p]=B,c[--p]=F,c[d++]=F,c[d++]=U,c[--m]=U,c[--m]=D}v=o,y=a+s,S=e+v,C=e-v,x=t+y;const T=t-y;c[f++]=S,c[f++]=x,c[--m]=T,c[--m]=S,o&&(c[f++]=C,c[f++]=x,c[--m]=T,c[--m]=C)}return Array.prototype.push.apply(r,c),r}fillTriangulate(r={}){let{vertices:e=[],indices:t=[],verticesStride:i=2,verticesOffset:s=0,indicesOffset:o=0}=r;const a=this.getAdaptivePointArray();if(a.length===0)return{vertices:e,indices:t};let l=0,h=0;for(let p=0;p<a.length;p+=2)l+=a[p],h+=a[p+1];l/=a.length/2,h/=a.length/2;let c=s;e[c*i]=l,e[c*i+1]=h;const f=c++;for(let p=0;p<a.length;p+=2)e[c*i]=a[p],e[c*i+1]=a[p+1],p>0&&(t[o++]=c,t[o++]=f,t[o++]=c-1),c++;return t[o++]=f+1,t[o++]=f,t[o++]=c-1,{vertices:e,indices:t}}getMinMax(r=O.MAX,e=O.MIN){const{cx:t,cy:i,rx:s,ry:o,rotate:a}=this,l=Math.cos(a),h=Math.sin(a),c=Math.sqrt(s*s*l*l+o*o*h*h),f=Math.sqrt(s*s*h*h+o*o*l*l);return r.x=Math.min(r.x,t-c),r.y=Math.min(r.y,i-f),e.x=Math.max(e.x,t+c),e.y=Math.max(e.y,i+f),{min:r,max:e}}copy(r){return super.copy(r),this.cx=r.cx,this.cy=r.cy,this.rx=r.rx,this.ry=r.ry,this.dx=r.dx,this.dy=r.dy,this.startAngle=r.startAngle,this.endAngle=r.endAngle,this.clockwise=r.clockwise,this.rotate=r.rotate,this}}function Rh(n,r){const e=n.rx,t=n.ry,i=Math.cos(n.rotate),s=Math.sin(n.rotate),o=new O(e*i,e*s),a=new O(-t*s,t*i),l=o.applyMatrix3(r),h=a.applyMatrix3(r),c=Ih.set(l.x,h.x,0,l.y,h.y,0,0,0,1),f=oo.copy(c).invert(),m=ao.copy(f).transpose().multiply(f).elements,v=kh(m[0],m[1],m[4]),y=Math.sqrt(v.rt1),S=Math.sqrt(v.rt2);if(n.rx=1/y,n.ry=1/S,n.rotate=Math.atan2(v.sn,v.cs),!((n.endAngle-n.startAngle)%(2*Math.PI)<Number.EPSILON)){const x=oo.set(y,0,0,0,S,0,0,0,1),T=ao.set(v.cs,v.sn,0,-v.sn,v.cs,0,0,0,1),b=x.multiply(T).multiply(c),P=E=>{const{x:w,y:D}=new O(Math.cos(E),Math.sin(E)).applyMatrix3(b);return Math.atan2(D,w)};n.startAngle=P(n.startAngle),n.endAngle=P(n.endAngle),lo(r)&&(n.clockwise=!n.clockwise)}}function Bh(n,r){const e=ho(r),t=co(r);n.rx*=e,n.ry*=t;const i=e>Number.EPSILON?Math.atan2(r.elements[1],r.elements[0]):Math.atan2(-r.elements[3],r.elements[4]);n.rotate+=i,lo(r)&&(n.startAngle*=-1,n.endAngle*=-1,n.clockwise=!n.clockwise)}function lo(n){const r=n.elements;return r[0]*r[4]-r[1]*r[3]<0}function Lh(n){const r=n.elements,e=r[0]*r[3]+r[1]*r[4];if(e===0)return!1;const t=ho(n),i=co(n);return Math.abs(e/(t*i))>Number.EPSILON}function ho(n){const r=n.elements;return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function co(n){const r=n.elements;return Math.sqrt(r[3]*r[3]+r[4]*r[4])}function kh(n,r,e){let t,i,s,o,a;const l=n+e,h=n-e,c=Math.sqrt(h*h+4*r*r);return l>0?(t=.5*(l+c),a=1/t,i=n*a*e-r*a*r):l<0?i=.5*(l-c):(t=.5*c,i=-.5*c),h>0?s=h+c:s=h-c,Math.abs(s)>2*Math.abs(r)?(a=-2*r/s,o=1/Math.sqrt(1+a*a),s=a*o):Math.abs(r)===0?(s=1,o=0):(a=-.5*s/r,s=1/Math.sqrt(1+a*a),o=a*s),h>0&&(a=s,s=-o,o=a),{rt1:t,rt2:i,cs:s,sn:o}}class Nh extends ps{constructor(r=0,e=0,t=1,i=0,s=Math.PI*2,o=!1){super(new O(r,e),new O(t,t),new O(0,0),0,i,s,o)}drawTo(r){const{cx:e,cy:t,rx:i,startAngle:s,endAngle:o,clockwise:a}=this;return r.arc(e,t,i,s,o,!a),this}getAdaptivePointArray(r=[]){const{cx:e,cy:t,rx:i,startAngle:s,endAngle:o,clockwise:a}=this;let l=Math.abs(s-o);(!a&&s>o||a&&o>s)&&(l=2*Math.PI-l);let h=Math.max(6,Math.floor(6*i**(1/3)*(l/Math.PI)));h=Math.max(h,3);let c=l/h,f=s;c*=a?1:-1;for(let p=0;p<h+1;p++){const d=Math.cos(f),m=Math.sin(f),v=e+d*i,y=t+m*i;r.push(v,y),f+=c}return r}}class gs extends ir{constructor(r=[]){super(),this.curves=r}addCurve(r){return this.curves.push(r),this}getPoint(r,e=new O){const t=r*this.getLength(),i=this.getLengths();let s=0;for(;s<i.length;){if(i[s]>=t){const o=i[s]-t,a=this.curves[s],l=a.getLength();return a.getPointAt(l===0?0:1-o/l,e)}s++}return e}updateLengths(){const r=[];for(let e=0,t=0,i=this.curves.length;e<i;e++)t+=this.curves[e].getLength(),r.push(t);this._arcLengths=r}getControlPointRefs(){return this.curves.flatMap(r=>r.getControlPointRefs())}getAdaptivePointArray(r=[]){let e;return this.curves.forEach(t=>{t.getAdaptivePointArray(r),e&&r[e-1]===r[e+1]&&r[e]===r[e+2]&&r.splice(e+1,2),e=r.length-1}),r}getMinMax(r=O.MAX,e=O.MIN){return this.curves.forEach(t=>t.getMinMax(r,e)),{min:r,max:e}}getBoundingBox(){const{min:r,max:e}=this.getMinMax();return new Y(r.x,r.y,e.x-r.x,e.y-r.y)}toCommands(){return this.curves.flatMap(r=>r.toCommands())}drawTo(r){var t;const e=(t=this.curves[0])==null?void 0:t.getPoint(0);return e&&r.moveTo(e.x,e.y),this.curves.forEach(i=>i.drawTo(r)),this}copy(r){return super.copy(r),this.curves=r.curves.map(e=>e.clone()),this}}class ms extends ir{constructor(r=new O,e=new O,t=new O,i=new O){super(),this.p1=r,this.cp1=e,this.cp2=t,this.p2=i}static from(r,e,t,i,s,o,a,l){return new ms(new O(r,e),new O(t,i),new O(s,o),new O(a,l))}getPoint(r,e=new O){const{p1:t,cp1:i,cp2:s,p2:o}=this;return e.set(to(r,t.x,i.x,s.x,o.x),to(r,t.y,i.y,s.y,o.y))}getAdaptivePointArray(r=[]){return Ph(this.p1.x,this.p1.y,this.cp1.x,this.cp1.y,this.cp2.x,this.cp2.y,this.p2.x,this.p2.y,.5,r)}getControlPointRefs(){return[this.p1,this.cp1,this.cp2,this.p2]}_solveQuadratic(r,e,t){const i=e*e-4*r*t;if(i<0)return[];const s=Math.sqrt(i),o=(-e+s)/(2*r),a=(-e-s)/(2*r);return[o,a].filter(l=>l>=0&&l<=1)}getMinMax(r=O.MAX,e=O.MIN){const{p1:t,cp1:i,cp2:s,p2:o}=this,a=this._solveQuadratic(3*(i.x-t.x),6*(s.x-i.x),3*(o.x-s.x)),l=this._solveQuadratic(3*(i.y-t.y),6*(s.y-i.y),3*(o.y-s.y)),h=[0,1,...a,...l];return((f,p)=>{for(const d of f)for(let m=0;m<=p;m++){const v=m/p-.5,y=Math.min(1,Math.max(0,d+v)),S=this.getPoint(y);r.x=Math.min(r.x,S.x),r.y=Math.min(r.y,S.y),e.x=Math.max(e.x,S.x),e.y=Math.max(e.y,S.y)}})(h,10),{min:r,max:e}}toCommands(){const{p1:r,cp1:e,cp2:t,p2:i}=this;return[{type:"M",x:r.x,y:r.y},{type:"C",x1:e.x,y1:e.y,x2:t.x,y2:t.y,x:i.x,y:i.y}]}drawTo(r){const{p1:e,cp1:t,cp2:i,p2:s}=this;return r.lineTo(e.x,e.y),r.bezierCurveTo(t.x,t.y,i.x,i.y,s.x,s.y),this}copy(r){return super.copy(r),this.p1.copy(r.p1),this.cp1.copy(r.cp1),this.cp2.copy(r.cp2),this.p2.copy(r.p2),this}}class Fh extends ps{constructor(r=0,e=0,t=1,i=1,s=0,o=0,a=Math.PI*2,l=!1){super(new O(r,e),new O(t,i),new O,s,o,a,l)}drawTo(r){return r.ellipse(this.cx,this.cy,this.rx,this.ry,this.rotate,this.startAngle,this.endAngle,!this.clockwise),this}}class Ct extends ir{constructor(r=new O,e=new O){super(),this.p1=r,this.p2=e}static from(r,e,t,i){return new Ct(new O(r,e),new O(t,i))}getPoint(r,e=new O){return r===1?e.copy(this.p2):e.copy(this.p2).sub(this.p1).scale(r).add(this.p1),e}getPointAt(r,e=new O){return this.getPoint(r,e)}getTangent(r,e=new O){return e.subVectors(this.p2,this.p1).normalize()}getTangentAt(r,e=new O){return this.getTangent(r,e)}getControlPointRefs(){return[this.p1,this.p2]}getAdaptivePointArray(r=[]){return r.push(this.p1.x,this.p1.y,this.p2.x,this.p2.y),r}getMinMax(r=O.MAX,e=O.MIN){const{p1:t,p2:i}=this;return r.x=Math.min(r.x,t.x,i.x),r.y=Math.min(r.y,t.y,i.y),e.x=Math.max(e.x,t.x,i.x),e.y=Math.max(e.y,t.y,i.y),{min:r,max:e}}toCommands(){const{p1:r,p2:e}=this;return[{type:"M",x:r.x,y:r.y},{type:"L",x:e.x,y:e.y}]}drawTo(r){const{p1:e,p2:t}=this;return r.lineTo(e.x,e.y),r.lineTo(t.x,t.y),this}copy(r){return super.copy(r),this.p1.copy(r.p1),this.p2.copy(r.p2),this}}class $h extends gs{}class ys extends ir{constructor(r=new O,e=new O,t=new O){super(),this.p1=r,this.cp=e,this.p2=t}static from(r,e,t,i,s,o){return new ys(new O(r,e),new O(t,i),new O(s,o))}getPoint(r,e=new O){const{p1:t,cp:i,p2:s}=this;return e.set(ro(r,t.x,i.x,s.x),ro(r,t.y,i.y,s.y)),e}getControlPointRefs(){return[this.p1,this.cp,this.p2]}getAdaptivePointArray(r=[]){return Sh(this.p1.x,this.p1.y,this.cp.x,this.cp.y,this.p2.x,this.p2.y,.5,r)}getMinMax(r=O.MAX,e=O.MIN){const{p1:t,cp:i,p2:s}=this,o=.5*(t.x+i.x),a=.5*(t.y+i.y),l=.5*(t.x+s.x),h=.5*(t.y+s.y);return r.x=Math.min(r.x,t.x,s.x,o,l),r.y=Math.min(r.y,t.y,s.y,a,h),e.x=Math.max(e.x,t.x,s.x,o,l),e.y=Math.max(e.y,t.y,s.y,a,h),{min:r,max:e}}toCommands(){const{p1:r,cp:e,p2:t}=this;return[{type:"M",x:r.x,y:r.y},{type:"Q",x1:e.x,y1:e.y,x:t.x,y:t.y}]}drawTo(r){const{p1:e,cp:t,p2:i}=this;return r.lineTo(e.x,e.y),r.quadraticCurveTo(t.x,t.y,i.x,i.y),this}copy(r){return super.copy(r),this.p1.copy(r.p1),this.cp.copy(r.cp),this.p2.copy(r.p2),this}}class zh extends $h{constructor(r=0,e=0,t=0,i=0){super(),this.x=r,this.y=e,this.width=t,this.height=i,this.update()}update(){const{x:r,y:e,width:t,height:i}=this,s=[new O(r,e),new O(r+t,e),new O(r+t,e+i),new O(r,e+i)];return this.curves=[new Ct(s[0],s[1]),new Ct(s[1],s[2]),new Ct(s[2],s[3]),new Ct(s[3],s[0])],this}drawTo(r){return r.rect(this.x,this.y,this.width,this.height),this}fillTriangulate(r={}){let{vertices:e=[],indices:t=[],verticesStride:i=2,verticesOffset:s=0,indicesOffset:o=0}=r;const{x:a,y:l,width:h,height:c}=this,f=[a,l,a+h,l,a+h,l+c,a,l+c];let p=0;s*=i,e[s+p]=f[0],e[s+p+1]=f[1],p+=i,e[s+p]=f[2],e[s+p+1]=f[3],p+=i,e[s+p]=f[6],e[s+p+1]=f[7],p+=i,e[s+p]=f[4],e[s+p+1]=f[5],p+=i;const d=s/i;return t[o++]=d,t[o++]=d+1,t[o++]=d+2,t[o++]=d+1,t[o++]=d+3,t[o++]=d+2,{vertices:e,indices:t}}copy(r){return super.copy(r),this.x=r.x,this.y=r.y,this.width=r.width,this.height=r.height,this.update(),this}}class Vh extends ps{constructor(r=0,e=0,t=1,i=1,s=1){super(),this.x=r,this.y=e,this.width=t,this.height=i,this.radius=s,this.update()}update(){const{x:r,y:e,width:t,height:i,radius:s}=this,o=t/2,a=i/2,l=r+o,h=e+a,c=Math.max(0,Math.min(s,Math.min(o,a))),f=c,p=o-c,d=a-f;return this._center=new O(l,h),this._radius=new O(c,f),this._diff=new O(p,d),this}drawTo(r){const{x:e,y:t,width:i,height:s,radius:o}=this;return r.roundRect(e,t,i,s,o),this}copy(r){return super.copy(r),this.x=r.x,this.y=r.y,this.width=r.width,this.height=r.height,this.radius=r.radius,this.update(),this}}class jh extends ir{constructor(r=[]){super(),this.points=r}getPoint(r,e=new O){const{points:t}=this,i=(t.length-1)*r,s=Math.floor(i),o=i-s,a=t[s===0?s:s-1],l=t[s],h=t[s>t.length-2?t.length-1:s+1],c=t[s>t.length-3?t.length-1:s+2];return e.set(eo(o,a.x,l.x,h.x,c.x),eo(o,a.y,l.y,h.y,c.y)),e}getControlPointRefs(){return this.points}copy(r){super.copy(r),this.points=[];for(let e=0,t=r.points.length;e<t;e++)this.points.push(r.points[e].clone());return this}}class Er extends gs{constructor(e){super();u(this,"startPoint");u(this,"currentPoint");u(this,"autoClose",!1);e&&this.addPoints(e)}addPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++){const{x:s,y:o}=e[t];this.lineTo(s,o)}return this}addCommands(e){return Jn(e,this),this}addData(e){return this.addCommands(Qn(e)),this}getUnevenPointArray(e=40,t=[]){return super.getUnevenPointArray(e,t),this.autoClose&&t.length>=4&&t[0]!==t[t.length-2]&&t[1]!==t[t.length-1]&&t.push(t[0],t[1]),t}getSpacedPointArray(e=40,t=[]){return super.getSpacedPointArray(e,t),this.autoClose&&t.length>=4&&t[0]!==t[t.length-2]&&t[1]!==t[t.length-1]&&t.push(t[0],t[1]),t}_setCurrentPoint(e){return this.currentPoint=new O(e.x,e.y),this.startPoint||(this.startPoint=this.currentPoint.clone()),this}_connetLineTo(e){if(this.curves.length>0){const t=e.getPoint(0);(!this.currentPoint||!t.equals(this.currentPoint))&&this.lineTo(t.x,t.y)}return this}closePath(){const e=this.startPoint;if(e){const t=this.currentPoint;t&&!e.equals(t)&&(this.curves.push(new Ct(t,e)),t.copy(e)),this.startPoint=void 0}return this}moveTo(e,t){return this.currentPoint=new O(e,t),this.startPoint=this.currentPoint.clone(),this}lineTo(e,t){const i=this.currentPoint;return i!=null&&i.equals({x:e,y:t})||this.curves.push(Ct.from((i==null?void 0:i.x)??0,(i==null?void 0:i.y)??0,e,t)),this._setCurrentPoint({x:e,y:t}),this}bezierCurveTo(e,t,i,s,o,a){const l=this.currentPoint;return l!=null&&l.equals({x:o,y:a})||this.curves.push(ms.from((l==null?void 0:l.x)??0,(l==null?void 0:l.y)??0,e,t,i,s,o,a)),this._setCurrentPoint({x:o,y:a}),this}quadraticCurveTo(e,t,i,s){const o=this.currentPoint;return o!=null&&o.equals({x:i,y:s})||this.curves.push(ys.from((o==null?void 0:o.x)??0,(o==null?void 0:o.y)??0,e,t,i,s)),this._setCurrentPoint({x:i,y:s}),this}arc(e,t,i,s,o,a){const l=new Nh(e,t,i,s,o,!a);return this._connetLineTo(l),this.curves.push(l),this._setCurrentPoint(l.getPoint(1)),this}relativeArc(e,t,i,s,o,a){var l,h;return e+=((l=this.currentPoint)==null?void 0:l.x)??0,t+=((h=this.currentPoint)==null?void 0:h.y)??0,this.arc(e,t,i,s,o,a),this}arcTo(e,t,i,s,o){return console.warn("Method arcTo not supported yet"),this}ellipse(e,t,i,s,o,a,l,h=!0){const c=new Fh(e,t,i,s,o,a,l,!h);return this._connetLineTo(c),this.curves.push(c),this._setCurrentPoint(c.getPoint(1)),this}relativeEllipse(e,t,i,s,o,a,l,h){var c,f;return e+=((c=this.currentPoint)==null?void 0:c.x)??0,t+=((f=this.currentPoint)==null?void 0:f.y)??0,this.ellipse(e,t,i,s,o,a,l,h),this}rect(e,t,i,s){const o=new zh(e,t,i,s);return this._connetLineTo(o),this.curves.push(o),this._setCurrentPoint({x:e,y:t}),this}roundRect(e,t,i,s,o){const a=new Vh(e,t,i,s,o);return this._connetLineTo(a),this.curves.push(a),this._setCurrentPoint({x:e,y:t}),this}splineThru(e){const t=this.currentPoint??new O;return this.curves.push(new jh([t].concat(e))),this._setCurrentPoint(e[e.length-1]),this}drawTo(e){var i;const t=(i=this.curves[0])==null?void 0:i.getPoint(0);return t&&e.moveTo(t.x,t.y),this.curves.forEach(s=>s.drawTo(e)),this.autoClose&&e.closePath(),this}copy(e){var t;return super.copy(e),this.autoClose=e.autoClose,this.currentPoint=(t=e.currentPoint)==null?void 0:t.clone(),this}}function Gh(n){return n.replace(/[^a-z0-9]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase()}function qh(n,r,e,t){const i=r.clone().sub(n),s=t.clone().sub(e),o=e.clone().sub(n),a=i.cross(s);if(a===0)return new O((n.x+e.x)/2,(n.y+e.y)/2);const l=o.cross(s)/a;return Math.abs(l)>1?new O((n.x+e.x)/2,(n.y+e.y)/2):new O(n.x+l*i.x,n.y+l*i.y)}class Ue extends gs{constructor(e,t={}){super();u(this,"currentCurve",new Er);u(this,"style");this.curves.push(this.currentCurve),this.style=t,e&&(e instanceof Ue?this.addPath(e):Array.isArray(e)?this.addCommands(e):this.addData(e))}get startPoint(){return this.currentCurve.startPoint}get currentPoint(){return this.currentCurve.currentPoint}get strokeWidth(){return this.style.strokeWidth??((this.style.stroke??"none")==="none"?0:1)}addPath(e){return e instanceof Ue?this.curves.push(...e.curves.map(t=>t.clone())):this.curves.push(e),this}closePath(){const e=this.startPoint;return e&&(this.currentCurve.closePath(),this.currentCurve.curves.length>0&&(this.currentCurve=new Er().moveTo(e.x,e.y),this.curves.push(this.currentCurve))),this}moveTo(e,t){var i;return(i=this.currentCurve.currentPoint)!=null&&i.equals({x:e,y:t})||(this.currentCurve.curves.length&&(this.currentCurve=new Er,this.curves.push(this.currentCurve)),this.currentCurve.moveTo(e,t)),this}lineTo(e,t){return this.currentCurve.lineTo(e,t),this}bezierCurveTo(e,t,i,s,o,a){return this.currentCurve.bezierCurveTo(e,t,i,s,o,a),this}quadraticCurveTo(e,t,i,s){return this.currentCurve.quadraticCurveTo(e,t,i,s),this}arc(e,t,i,s,o,a){return this.currentCurve.arc(e,t,i,s,o,a),this}arcTo(e,t,i,s,o){return this.currentCurve.arcTo(e,t,i,s,o),this}ellipse(e,t,i,s,o,a,l,h){return this.currentCurve.ellipse(e,t,i,s,o,a,l,h),this}rect(e,t,i,s){return this.currentCurve.rect(e,t,i,s),this}roundRect(e,t,i,s,o){return this.currentCurve.roundRect(e,t,i,s,o),this}addCommands(e){return Jn(e,this),this}addData(e){return this.addCommands(Qn(e)),this}splineThru(e){return this.currentCurve.splineThru(e),this}scale(e,t=e,i={x:0,y:0}){return this.getControlPointRefs().forEach(s=>{s.scale(e,t,i)}),this}skew(e,t=0,i={x:0,y:0}){return this.getControlPointRefs().forEach(s=>{s.skew(e,t,i)}),this}rotate(e,t={x:0,y:0}){return this.getControlPointRefs().forEach(i=>{i.rotate(e,t)}),this}bold(e){if(e===0)return this;const t=this.curves,i=[],s=[],o=[];t.forEach((l,h)=>{if(!l.getLength())return;const c=l.getControlPointRefs(),f=l.isClockwise();o[h]=c,s[h]=f;const p=c[0],d=c[c.length-1]??p;i.push({start:f?d:p,end:f?p:d,index:h})});const a=[];return i.forEach((l,h)=>{a[h]=[],i.forEach((c,f)=>{f!==h&&c.start.equals(l.end)&&a[h].push(c.index)})}),t.forEach((l,h)=>{if(!l.getLength())return;const c=s[h];o[h].forEach(p=>{const d=l.getTForPoint(p),m=l.getNormal(d).scale(c?e:-e);p.add(m)})}),a.forEach((l,h)=>{const c=o[h];l.forEach(f=>{const p=o[f],d=qh(c[c.length-1],c[c.length-2]??c[c.length-1],p[0],p[1]??p[0]);d&&(c[c.length-1].copy(d),p[0].copy(d))})}),this}applyTransform(e){return this.curves.forEach(t=>t.applyTransform(e)),this}getMinMax(e=O.MAX,t=O.MIN,i=!0){const s=this.strokeWidth;return this.curves.forEach(o=>{if(o.getMinMax(e,t),i&&s>1){const a=s/2,l=o.isClockwise(),h=[];for(let c=0;c<=1;c+=1/o.arcLengthDivision){const f=o.getPoint(c),p=o.getNormal(c),d=p.clone().scale(l?a:-a),m=p.clone().scale(l?-a:a);h.push(f.clone().add(d),f.clone().add(m),f.clone().add({x:a,y:0}),f.clone().add({x:-a,y:0}),f.clone().add({x:0,y:a}),f.clone().add({x:0,y:-a}),f.clone().add({x:a,y:a}),f.clone().add({x:-a,y:-a}))}e.min(...h),t.max(...h)}}),{min:e,max:t}}getBoundingBox(e=!0){const{min:t,max:i}=this.getMinMax(void 0,void 0,e);return new Y(t.x,t.y,i.x-t.x,i.y-t.y)}drawTo(e,t={}){t={...this.style,...t};const{fill:i="#000",stroke:s="none"}=t;return e.beginPath(),e.save(),cs(e,t),this.curves.forEach(o=>{o.drawTo(e)}),i!=="none"&&e.fill(),s!=="none"&&e.stroke(),e.restore(),this}drawControlPointsTo(e,t={}){t={...this.style,...t};const{fill:i="#000",stroke:s="none"}=t;return e.beginPath(),e.save(),cs(e,t),this.getControlPointRefs().forEach(o=>{uh(e,o.x,o.y,{radius:4})}),i!=="none"&&e.fill(),s!=="none"&&e.stroke(),e.restore(),this}toCommands(){return this.curves.flatMap(e=>e.toCommands())}toData(){return this.curves.filter(e=>e.curves.length).map(e=>e.toData()).join(" ")}toSVGPathString(){const e={...this.style,fill:this.style.fill??"#000",stroke:this.style.stroke??"none"},t={};for(const s in e)e[s]!==void 0&&(t[Gh(s)]=e[s]);Object.assign(t,{"stroke-width":`${this.strokeWidth}px`});let i="";for(const s in t)t[s]!==void 0&&(i+=`${s}:${t[s]};`);return`<path d="${this.toData()}" style="${i}"></path>`}copy(e){return super.copy(e),this.currentCurve=e.currentCurve.clone(),this.style={...e.style},this}}class vs{constructor(r=[]){this.paths=r}getBoundingBox(r=!0){if(!this.paths.length)return;const e=O.MAX,t=O.MIN;return this.paths.forEach(i=>i.getMinMax(e,t,r)),new Y(e.x,e.y,t.x-e.x,t.y-e.y)}toSVGString(){const{x:r,y:e,width:t,height:i}=this.getBoundingBox(),s=this.paths.map(o=>o.toSVGPathString()).join("");return`<svg viewBox="${r} ${e} ${t} ${i}" width="${t}px" height="${i}px" xmlns="http://www.w3.org/2000/svg">${s}</svg>`}toSVGUrl(){return`data:image/svg+xml;base64,${btoa(this.toSVGString())}`}toSVG(){return new DOMParser().parseFromString(this.toSVGString(),"image/svg+xml").documentElement}toCanvas(r={}){const{pixelRatio:e=2,...t}=r,{left:i,top:s,width:o,height:a}=this.getBoundingBox(),l=document.createElement("canvas");l.width=o*e,l.height=a*e,l.style.width=`${o}px`,l.style.height=`${a}px`;const h=l.getContext("2d");return h&&(h.scale(e,e),h.translate(-i,-s),this.paths.forEach(c=>{c.drawTo(h,t)})),l}}const uo="data:image/svg+xml;",fo=`${uo}base64,`,po=`${uo}charset=utf8,`;function go(n){if(typeof n=="string"){let r;n.startsWith(fo)?(n=n.substring(fo.length,n.length),r=atob(n)):n.startsWith(po)?(n=n.substring(po.length,n.length),r=decodeURIComponent(n)):r=n;const e=new DOMParser().parseFromString(r,"text/xml"),t=e.querySelector("parsererror");if(t)throw new Error(`${t.textContent??"parser error"}
27
- ${r}`);return e.documentElement}else return n}const Wh="px",Xh=90,mo=["mm","cm","in","pt","pc","px"],yo={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:72/6,pc:1,px:-1},px:{px:1}};function J(n){let r="px";if(typeof n=="string"||n instanceof String)for(let t=0,i=mo.length;t<i;t++){const s=mo[t];if(n.endsWith(s)){r=s,n=n.substring(0,n.length-s.length);break}}let e;return e=yo[r][Wh],e<0&&(e=yo[r].in*Xh),e*Number.parseFloat(n)}const Hh=new ke,oi=new ke,vo=new ke,_o=new ke;function Yh(n,r,e){if(!(n.hasAttribute("transform")||n.nodeName==="use"&&(n.hasAttribute("x")||n.hasAttribute("y"))))return null;const t=Zh(n);return e.length>0&&t.premultiply(e[e.length-1]),r.copy(t),e.push(t),t}function Zh(n){const r=new ke,e=Hh;if(n.nodeName==="use"&&(n.hasAttribute("x")||n.hasAttribute("y"))&&r.translate(J(n.getAttribute("x")),J(n.getAttribute("y"))),n.hasAttribute("transform")){const t=n.getAttribute("transform").split(")");for(let i=t.length-1;i>=0;i--){const s=t[i].trim();if(s==="")continue;const o=s.indexOf("("),a=s.length;if(o>0&&o<a){const l=s.slice(0,o),h=nt(s.slice(o+1));switch(e.identity(),l){case"translate":if(h.length>=1){const c=h[0];let f=0;h.length>=2&&(f=h[1]),e.translate(c,f)}break;case"rotate":if(h.length>=1){let c=0,f=0,p=0;c=h[0]*Math.PI/180,h.length>=3&&(f=h[1],p=h[2]),oi.makeTranslation(-f,-p),vo.makeRotation(c),_o.multiplyMatrices(vo,oi),oi.makeTranslation(f,p),e.multiplyMatrices(oi,_o)}break;case"scale":h.length>=1&&e.scale(h[0],h[1]??h[0]);break;case"skewX":h.length===1&&e.set(1,Math.tan(h[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":h.length===1&&e.set(1,0,0,Math.tan(h[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":h.length===6&&e.set(h[0],h[2],h[4],h[1],h[3],h[5],0,0,1);break}}r.premultiply(e)}}return r}function Kh(n){return new Ue().addPath(new Er().arc(J(n.getAttribute("cx")||0),J(n.getAttribute("cy")||0),J(n.getAttribute("r")||0),0,Math.PI*2))}function Jh(n,r){if(!(!n.sheet||!n.sheet.cssRules||!n.sheet.cssRules.length))for(let e=0;e<n.sheet.cssRules.length;e++){const t=n.sheet.cssRules[e];if(t.type!==1)continue;const i=t.selectorText.split(/,/g).filter(Boolean).map(o=>o.trim()),s={};for(let o=t.style.length,a=0;a<o;a++){const l=t.style.item(a);s[l]=t.style.getPropertyValue(l)}for(let o=0;o<i.length;o++)r[i[o]]=Object.assign(r[i[o]]||{},{...s})}}function Qh(n){return new Ue().addPath(new Er().ellipse(J(n.getAttribute("cx")||0),J(n.getAttribute("cy")||0),J(n.getAttribute("rx")||0),J(n.getAttribute("ry")||0),0,0,Math.PI*2))}function ec(n){return new Ue().moveTo(J(n.getAttribute("x1")||0),J(n.getAttribute("y1")||0)).lineTo(J(n.getAttribute("x2")||0),J(n.getAttribute("y2")||0))}function tc(n){const r=new Ue,e=n.getAttribute("d");return!e||e==="none"?null:(r.addData(e),r)}const rc=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function ic(n){var t;const r=new Ue;let e=0;return(t=n.getAttribute("points"))==null||t.replace(rc,(i,s,o)=>{const a=J(s),l=J(o);return e===0?r.moveTo(a,l):r.lineTo(a,l),e++,i}),r.currentPath.autoClose=!0,r}const sc=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function nc(n){var t;const r=new Ue;let e=0;return(t=n.getAttribute("points"))==null||t.replace(sc,(i,s,o)=>{const a=J(s),l=J(o);return e===0?r.moveTo(a,l):r.lineTo(a,l),e++,i}),r.currentPath.autoClose=!1,r}function oc(n){const r=J(n.getAttribute("x")||0),e=J(n.getAttribute("y")||0),t=J(n.getAttribute("rx")||n.getAttribute("ry")||0),i=J(n.getAttribute("ry")||n.getAttribute("rx")||0),s=J(n.getAttribute("width")),o=J(n.getAttribute("height")),a=1-.551915024494,l=new Ue;return l.moveTo(r+t,e),l.lineTo(r+s-t,e),(t!==0||i!==0)&&l.bezierCurveTo(r+s-t*a,e,r+s,e+i*a,r+s,e+i),l.lineTo(r+s,e+o-i),(t!==0||i!==0)&&l.bezierCurveTo(r+s,e+o-i*a,r+s-t*a,e+o,r+s-t,e+o),l.lineTo(r+t,e+o),(t!==0||i!==0)&&l.bezierCurveTo(r+t*a,e+o,r,e+o-i*a,r,e+o-i),l.lineTo(r,e+i),(t!==0||i!==0)&&l.bezierCurveTo(r,e+i*a,r+t*a,e,r+t,e),l}function ot(n,r,e){r=Object.assign({},r);let t={};if(n.hasAttribute("class")){const h=n.getAttribute("class").split(/\s/).filter(Boolean).map(c=>c.trim());for(let c=0;c<h.length;c++)t=Object.assign(t,e[`.${h[c]}`])}n.hasAttribute("id")&&(t=Object.assign(t,e[`#${n.getAttribute("id")}`]));for(let h=n.style.length,c=0;c<h;c++){const f=n.style.item(c),p=n.style.getPropertyValue(f);r[f]=p,t[f]=p}function i(h,c,f=s){n.hasAttribute(h)&&(r[c]=f(n.getAttribute(h))),t[h]&&(r[c]=f(t[h]))}function s(h){return h.startsWith("url")&&console.warn("url access in attributes is not implemented."),h}function o(h){return Math.max(0,Math.min(1,J(h)))}function a(h){return Math.max(0,J(h))}function l(h){return h.split(" ").filter(c=>c!=="").map(c=>J(c))}return i("fill","fill"),i("fill-opacity","fillOpacity",o),i("fill-rule","fillRule"),i("opacity","opacity",o),i("stroke","stroke"),i("stroke-opacity","strokeOpacity",o),i("stroke-width","strokeWidth",a),i("stroke-linecap","strokeLinecap"),i("stroke-linejoin","strokeLinejoin"),i("stroke-miterlimit","strokeMiterlimit",a),i("stroke-dasharray","strokeDasharray",l),i("stroke-dashoffset","strokeDashoffset",J),i("visibility","visibility"),r}function _s(n,r,e=[],t={}){var f;if(n.nodeType!==1)return e;let i=!1,s=null,o={...r};switch(n.nodeName){case"svg":o=ot(n,o,t);break;case"style":Jh(n,t);break;case"g":o=ot(n,o,t);break;case"path":o=ot(n,o,t),n.hasAttribute("d")&&(s=tc(n));break;case"rect":o=ot(n,o,t),s=oc(n);break;case"polygon":o=ot(n,o,t),s=ic(n);break;case"polyline":o=ot(n,o,t),s=nc(n);break;case"circle":o=ot(n,o,t),s=Kh(n);break;case"ellipse":o=ot(n,o,t),s=Qh(n);break;case"line":o=ot(n,o,t),s=ec(n);break;case"defs":i=!0;break;case"use":{o=ot(n,o,t);const d=(n.getAttributeNS("http://www.w3.org/1999/xlink","href")||n.getAttribute("href")||"").substring(1),m=(f=n.viewportElement)==null?void 0:f.getElementById(d);m?_s(m,o,e,t):console.warn(`'use node' references non-existent node id: ${d}`);break}default:console.warn(n);break}if(o.display==="none")return e;Object.assign(r,o);const a=new ke,l=[],h=Yh(n,a,l);s&&(s.applyTransform(a),e.push(s),s.style=r);const c=n.childNodes;for(let p=0,d=c.length;p<d;p++){const m=c[p];i&&m.nodeName!=="style"&&m.nodeName!=="defs"||_s(m,r,e,t)}return h&&(l.pop(),l.length>0?a.copy(l[l.length-1]):a.identity()),e}function bo(n){return new vs(_s(go(n),{}))}class wo extends Ue{constructor(){super(...arguments);u(this,"textureTransform");u(this,"fillStyle");u(this,"strokeStyle");u(this,"lineCap");u(this,"lineJoin");u(this,"lineWidth");u(this,"miterLimit");u(this,"_defaultStyle",de.EMPTY);u(this,"_stroked",[]);u(this,"_filled",[])}stroke(){let e=this._defaultStyle;this.strokeStyle&&(this.strokeStyle instanceof de?e=this.strokeStyle:e=new as(this.strokeStyle)),this.curves.length&&(this._stroked.push({shapes:this.curves.slice(),texture:e,textureTransform:this.textureTransform,style:{alignment:.5,cap:this.lineCap??"butt",join:this.lineJoin??"miter",width:this.lineWidth??1,miterLimit:this.miterLimit??10}}),this.curves.length=0)}fillRect(e,t,i,s){this.rect(e,t,i,s).fill()}strokeRect(e,t,i,s){this.rect(e,t,i,s).stroke()}fill(){let e=this._defaultStyle;this.fillStyle&&(this.fillStyle instanceof de?e=this.fillStyle:e=new as(this.fillStyle)),this._filled.push({shapes:this.curves.slice(),texture:e,textureTransform:this.textureTransform}),this.curves.length=0}reset(){this.strokeStyle=void 0,this.fillStyle=void 0,this.textureTransform=void 0,this.lineCap=void 0,this.lineJoin=void 0,this.lineWidth=void 0,this.miterLimit=void 0,this.curves.length=0,this._stroked.length=0,this._filled.length=0}buildUvs(e,t,i,s,o){if(s){let a=s.width,l=s.height;o&&([a,l]=o.applyToPoint(a,l));for(let h=t.length,c=e;c<h;c+=2)i.push(t[c]/a,t[c+1]/l)}else for(let a=t.length,l=e;l<a;l+=2)i.push(0,0)}toBatchables(){const e=[];let t=[],i=[],s=[],o=0,a;const l=h=>{e.push({type:h,vertices:t,indices:i,uvs:s,texture:a}),t=[],i=[],s=[],a=void 0};for(let h=this._stroked.length,c=0;c<h;c++){o=t.length;const f=this._stroked[c];a??(a=f.texture);const p=[];for(let d=f.shapes.length,m=0;m<d;m++)f.shapes[m].getAdaptivePointArray(p);so(p,{vertices:t,indices:i,lineStyle:f.style,flipAlignment:!1,closed:!0}),this.buildUvs(o,t,s,f.texture,f.textureTransform),l("stroke")}for(let h=this._filled.length,c=0;c<h;c++){const f=this._filled[c];a??(a=f.texture),a!==f.texture&&l("fill"),o=t.length;for(let p=f.shapes.length,d=0;d<p;d++)f.shapes[d].fillTriangulate({vertices:t,indices:i});this.buildUvs(o,t,s,f.texture,f.textureTransform)}return t.length&&l("fill"),e}}class Et{}class xo extends Et{install(r){const e=async t=>{const{parseFont:i}=await Promise.resolve().then(()=>hf);return await r.fetch(t).then(s=>s.arrayBuffer()).then(s=>i(s))};return this.load=t=>r.loadBy(t,()=>e(t)),["woff","ttf"].forEach(t=>{r.register(t,e)}),r.font=this,this}}class Po extends Et{install(r){const e=async t=>{const{decodeFrames:i}=await import("modern-gif");return await r.fetch(t).then(s=>s.arrayBuffer()).then(s=>i(s)).then(s=>new hi(s.map(o=>({duration:o.delay,texture:new Ji(o.data,o.width,o.height)}))))};return this.load=t=>r.loadBy(t,()=>e(t)),["image/gif"].forEach(t=>{r.register(t,e)}),r.gif=this,this}}class Co extends Et{install(r){const e=t=>r.fetch(t).then(i=>i.json());return this.load=t=>r.loadBy(t,()=>e(t)),["json"].forEach(t=>{r.register(t,e)}),r.json=this,this}}class Eo extends Et{install(r){const e=async(t,i)=>(await import("lottie-web").then(o=>o.default)).loadAnimation({container:null,renderer:"canvas",rendererSettings:{context:i.getContext("2d")},loop:!1,autoplay:!1,animationData:await r.fetch(t).then(o=>o.json())});return this.load=(t,i)=>r.loadBy(t,()=>e(t,i)),["lottie"].forEach(t=>{r.register(t,e)}),r.lottie=this,this}}class To extends Et{install(r){const e=async t=>await r.fetch(t).then(i=>i.text());return this.load=t=>r.loadBy(t,()=>e(t)),r.text=this,this}}class So extends Et{install(r){const e=t=>r.fetchImageBitmap(t,{premultiplyAlpha:"premultiply"}).then(i=>new de(i));return this.load=t=>r.loadBy(t,()=>e(t)),["image/gif","image/jpeg","image/png","image/tiff","image/vnd.wap.wbmp","image/x-icon","image/x-jng","image/x-ms-bmp","image/svg+xml","image/webp"].forEach(t=>{r.register(t,e)}),r.texture=this,this}}class Mo extends Et{install(r){const e=t=>new Rn(t).load();return this.load=t=>r.loadBy(t,()=>e(t)),["video/3gpp","video/mpeg","video/quicktime","video/x-flv","video/x-mng","video/x-ms-asf","video/x-ms-wmv","video/x-msvideo","video/mp4"].forEach(t=>{r.register(t,e)}),r.video=this,this}}const ac=Object.entries({"text/html":["html","htm","shtml"],"text/css":["css"],"text/xml":["xml"],"image/gif":["gif"],"image/jpeg":["jpeg","jpg"],"application/x-javascript":["js"],"application/atom+xml":["atom"],"application/rss+xml":["rss"],"text/mathml":["mml"],"text/plain":["txt"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/x-component":["htc"],"image/png":["png"],"image/tiff":["tif","tiff"],"image/vnd.wap.wbmp":["wbmp"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-ms-bmp":["bmp"],"image/svg+xml":["svg"],"image/webp":["webp"],"application/java-archive":["jar","war","ear"],"application/mac-binhex40":["hqx"],"application/msword":["doc"],"application/pdf":["pdf"],"application/postscript":["ps","eps","ai"],"application/rtf":["rtf"],"application/vnd.ms-excel":["xls"],"application/vnd.ms-powerpoint":["ppt"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/x-7z-compressed":["7z"],"application/x-cocoa":["cco"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-makeself":["run"],"application/x-perl":["pl","pm"],"application/x-pilot":["prc","pdb"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-sea":["sea"],"application/x-shockwave-flash":["swf"],"application/x-stuffit":["sit"],"application/x-tcl":["tcl","tk"],"application/x-x509-ca-cert":["der","pem","crt"],"application/x-xpinstall":["xpi"],"application/xhtml+xml":["xhtml"],"application/zip":["zip"],"application/octet-stream":["bin","exe","dll","deb","dmg","eot","iso","img","msi","msp","msm"],"audio/midi":["mid","midi","kar"],"audio/mpeg":["mp3"],"audio/ogg":["ogg"],"audio/x-realaudio":["ra"],"video/3gpp":["3gpp","3gp"],"video/mpeg":["mpeg","mpg"],"video/quicktime":["mov"],"video/x-flv":["flv"],"video/x-mng":["mng"],"video/x-ms-asf":["asx","asf"],"video/x-ms-wmv":["wmv"],"video/x-msvideo":["avi"],"video/mp4":["m4v","mp4"]});function lc(n){for(const[r,e]of ac)if(e.includes(n))return r}async function hc(n){var e,t;let r;if(n.startsWith("data:"))r=(e=n.match(/^data:(.+?);/))==null?void 0:e[1];else if(n.startsWith("http")){const i=(t=n.split(/[#?]/)[0].split(".").pop())==null?void 0:t.trim();i&&(r=lc(i))}return r??await fetch(n).then(i=>i.headers.get("Content-Type"))??""}const ai="WeakRef"in globalThis;class Ao{constructor(){u(this,"defaultHandler",r=>this.fetch(r));u(this,"_handlers",new Map);u(this,"_handleing",new Map);u(this,"_handled",new Map);u(this,"_gc",ai?new FinalizationRegistry(r=>{const e=this.get(r);e&&"destroy"in e&&e.destroy(),this._handled.delete(r)}):void 0);ai||ue.on(this.gc.bind(this),{sort:2})}use(r){return r.install(this),this}register(r,e){return this._handlers.set(r,e),this}fetch(r){return fetch(r)}_fixSVG(r){const e=new DOMParser().parseFromString(decodeURIComponent(r.split(",")[1]),"image/svg+xml").documentElement;return e.setAttribute("width","512"),e.setAttribute("height","512"),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e.outerHTML)}`}async fetchImageBitmap(r,e){return r.startsWith("http")?await this.fetch(r).then(t=>t.blob()).then(t=>t.type==="image/svg+xml"?t.text().then(i=>this.fetchImageBitmap(this._fixSVG(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`),e)):createImageBitmap(t,e)):(r.startsWith("data:image/svg+xml;")&&(r=this._fixSVG(r)),new Promise(t=>{const i=new Image;i.src=r,i.onload=()=>i.decode().finally(()=>t(i))}).then(t=>createImageBitmap(t,e)))}get(r){let e=this._handled.get(r);return ai&&e instanceof WeakRef&&(e=e.deref(),e||this._handleing.delete(r)),e}set(r,e){let t=e;ai&&typeof e=="object"&&(this._gc.register(e,r),t=new WeakRef(e)),this._handled.set(r,t)}async loadBy(r,e){const t=this.get(r)??this._handleing.get(r);if(t)return t;const i=e().then(s=>(this.set(r,s),s)).finally(()=>{this._handleing.delete(r)});return this._handleing.set(r,i),i}async load(r,e){return this.loadBy(r,async()=>{const t=await hc(r);return(this._handlers.get(t)??this.defaultHandler)(r,e)})}async waitUntilLoad(){await Promise.all(Array.from(this._handleing.values()))}gc(){this._handled.forEach((r,e)=>{const t=this.get(e);t&&"destroy"in t&&t.destroy()}),this._handled.clear()}}const mt=new Ao().use(new xo).use(new Po).use(new Co).use(new Eo).use(new To).use(new So).use(new Mo);class Tr{}class Oo extends Tr{install(r){bt(r,"backgroundColor"),bt(r,"backgroundImage"),r.prototype.getComputedBackgroundImage=cc}}async function cc(){if(this.backgroundImage)return await mt.texture.load(this.backgroundImage)}class Uo extends Tr{install(r){bt(r,"filter",{default:""}),r.prototype.getComputedFilter=uc,r.prototype.getComputedFilterColorMatrix=fc}}const Do={brightness:1,contrast:1,grayscale:0,"hue-rotate":0,invert:0,opacity:1,saturate:1,sepia:0};function uc(){const n=gr(this.filter).reduce((r,{name:e,args:t})=>(r[e]=t[0].normalizedIntValue,r),{});return Object.keys(Do).forEach(r=>{n[r]=n[r]??Do[r]}),n}function fc(){const n=new os,r=this.getComputedFilter();for(const e in r){const t=r[e];switch(e){case"hue-rotate":n.hueRotate(t*le);break;case"saturate":n.saturate(t);break;case"brightness":n.brightness(t);break;case"contrast":n.contrast(t);break;case"invert":n.invert(t);break;case"sepia":n.sepia(t);break;case"opacity":n.opacity(t);break;case"grayscale":n.grayscale(t);break}}return n}function dc(){return{shadowColor:"transparent",shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0}}function Io(){return{left:0,top:0,width:0,height:0,rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function pc(){return{overflow:"visible",visibility:"visible",filter:"none",opacity:1,marginLeft:0,marginTop:0,marginRight:0,marginBottom:0,paddingLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,...Io(),backgroundImage:"none",backgroundColor:"transparent",...dc(),borderRadius:0,borderColor:"transparent",borderWidth:1}}function Ro(){return{writingMode:"horizontal-tb",verticalAlign:"baseline",lineHeight:1.2,letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textWrap:"wrap",textAlign:"start",textIndent:0,textTransform:"none",textOrientation:"mixed",textDecoration:"none",textStrokeWidth:0,textStrokeColor:"black",color:"black",listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside",highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function gc(){return{...pc(),...Ro()}}class Bo extends Tr{install(r){const e=Ro();for(const t in e)bt(r,t,{default:e[t]});bt(r,"direction",{default:"inherit"})}}class Lo extends Tr{install(r){const e=Io();for(const t in e)bt(r,t,{default:e[t]});r.prototype.getComputedTransform=mc,r.prototype.getComputedTransformOrigin=yc}}function mc(){const n=new qe,r=new qe(!1),e=new qe(!1).scale(this.scaleX,this.scaleY).translate(this.left,this.top).rotate(this.rotate*On);let t=this.transform;(!t||t==="none")&&(t=""),gr(t,{width:this.width,height:this.height}).forEach(({name:f,args:p})=>{const d=p.map(m=>m.normalizedIntValue);switch(n.identity(),f){case"translate":n.translate(d[0]*this.width,(d[1]??d[0])*this.height);break;case"translateX":n.translateX(d[0]*this.width);break;case"translateY":n.translateY(d[0]*this.height);break;case"translateZ":n.translateZ(d[0]);break;case"translate3d":n.translate3d(d[0]*this.width,(d[1]??d[0])*this.height,d[2]??d[1]??d[0]);break;case"scale":n.scale(d[0],d[1]??d[0]);break;case"scaleX":n.scaleX(d[0]);break;case"scaleY":n.scaleY(d[0]);break;case"scale3d":n.scale3d(d[0],d[1]??d[0],d[2]??d[1]??d[0]);break;case"rotate":n.rotate(d[0]*le);break;case"rotateX":n.rotateX(d[0]*le);break;case"rotateY":n.rotateY(d[0]*le);break;case"rotateZ":n.rotateZ(d[0]*le);break;case"rotate3d":n.rotate3d(d[0]*le,(d[1]??d[0])*le,(d[2]??d[1]??d[0])*le,(d[3]??d[2]??d[1]??d[0])*le);break;case"skew":n.skew(d[0],d[0]??d[1]);break;case"skewX":n.skewX(d[0]);break;case"skewY":n.skewY(d[0]);break;case"matrix":n.set(d);break}r.multiply(n)}),e.update(),r.update();const i=e.toArray(),s=r.toArray(),o=[s[0]*i[0]+s[3]*i[1],s[1]*i[0]+s[4]*i[1],s[2]*i[0]+s[5]*i[1]+i[2],s[0]*i[3]+s[3]*i[4],s[1]*i[3]+s[4]*i[4],s[2]*i[3]+s[5]*i[4]+i[5],0,0,1],[a,l]=this.getComputedTransformOrigin(),h=a*this.width,c=l*this.height;return o[2]+=o[0]*-h+o[1]*-c+h,o[5]+=o[3]*-h+o[4]*-c+c,new qe().set(o)}function yc(){const[n,r=n]=this.transformOrigin.split(" ");return[n,r].map(e=>{switch(e=e.trim(),e){case"left":case"top":return 0;case"center":return .5;case"right":case"bottom":return 1;default:return Number(e)}})}var vc=Object.defineProperty,kt=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&vc(r,e,i),i};class at extends Kr{constructor(r){super(),this.setProperties(r)}_onUpdateProperty(r,e,t){switch(super._onUpdateProperty(r,e,t),r){case"fontSize":e<=0&&(this.fontSize=14);break;case"fontWeight":e||(this.fontWeight="normal");break;case"lineHeight":e||(this.lineHeight=1);break}}}kt([A({default:"#000000"})],at.prototype,"shadowColor"),kt([A({default:0})],at.prototype,"shadowOffsetX"),kt([A({default:0})],at.prototype,"shadowOffsetY"),kt([A({default:0})],at.prototype,"shadowBlur"),kt([A({default:1})],at.prototype,"opacity"),kt([A({default:0})],at.prototype,"borderRadius"),kt([A({default:"visible"})],at.prototype,"overflow"),[Oo,Uo,Bo,Lo].forEach(n=>{new n().install(at)});var _c=Object.defineProperty,bc=Object.getOwnPropertyDescriptor,bs=(n,r,e,t)=>{for(var i=t>1?void 0:t?bc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&_c(r,e,i),i};g.CanvasItem=class extends g.Node{constructor(e){super();u(this,"tint");u(this,"blendMode");u(this,"opacity",1);u(this,"_parentOpacity");u(this,"_tint",new Pt(4294967295));u(this,"_backgroundColor",new Pt(0));u(this,"_backgroundImage");u(this,"context",new wo);u(this,"_resetContext",!0);u(this,"_redrawing",!1);u(this,"_reflowing",!1);u(this,"_repainting",!1);u(this,"_originalBatchables",[]);u(this,"_layoutedBatchables",[]);u(this,"_batchables",[]);this._onUpdateStyleProperty=this._onUpdateStyleProperty.bind(this),this.setProperties(e),this.style=new at}get style(){return this._style}set style(e){var t;e.on("updateProperty",this._onUpdateStyleProperty),(t=this._style)==null||t.off("updateProperty",this._onUpdateStyleProperty),this._style=e}setProperties(e){if(e){const{style:t,...i}=e;t&&this.style.setProperties(t),super.setProperties(i)}return this}_onUpdateProperty(e,t,i,s){switch(super._onUpdateProperty(e,t,i,s),e){case"blendMode":this.requestRepaint();break;case"tint":this._tint.value=t||4294967295,this.requestRepaint();break}}_onUpdateStyleProperty(e,t,i,s){switch(e){case"backgroundColor":this._updateBackgroundColor();break;case"backgroundImage":this._updateBackgroundImage();break;case"opacity":this._updateOpacity();break;case"filter":this.requestRepaint();break;case"borderRadius":this.requestRedraw();break}}_updateBackgroundColor(){this._backgroundColor.value=this.style.backgroundColor||0,this._originalBatchables.length?this.requestRepaint():this._backgroundColor.a>0&&this.requestRedraw()}async _updateBackgroundImage(){this._backgroundImage=await this.style.getComputedBackgroundImage(),this.requestRedraw()}_updateOpacity(){var t;const e=xt(0,this.style.opacity,1)*(((t=this._parent)==null?void 0:t.opacity)??1);this.opacity!==e&&(this.opacity=e,this.requestRepaint())}isVisible(){return this.opacity>0&&super.isVisible()}requestRedraw(){this._redrawing=!0}requestReflow(){this._reflowing=!0}requestRepaint(){this._repainting=!0}_process(e){var i;const t=(i=this._parent)==null?void 0:i.opacity;t!==this._parentOpacity&&(this._parentOpacity=t,this._updateOpacity()),super._process(e)}_draw(){this._drawBackground(),this._drawContent()}_drawBackground(){const e=this._backgroundImage;e!=null&&e.valid&&(this.context.fillStyle=e,this.context.textureTransform=new qe().scale(this.style.width/e.width,this.style.height/e.height),this._fill())}_drawContent(){this._fill()}_fill(){this.style.borderRadius?this.context.roundRect(0,0,this.style.width,this.style.height,this.style.borderRadius):this.context.rect(0,0,this.style.width,this.style.height),this.context.fill()}_relayout(e){return this._reflow(e)}_reflow(e){return this._repaint(e)}_repaint(e){const t=this.style.getComputedFilterColorMatrix();return e.map(i=>({...i,backgroundColor:this._backgroundColor.abgr,tint:this._tint.toArgb(this.opacity,!0),colorMatrix:t.toMatrix4().toArray(!0),colorMatrixOffset:t.toVector4().toArray(),blendMode:this.blendMode}))}_render(e){let t;this._redrawing?(this._draw(),this._originalBatchables=this.context.toBatchables(),this._layoutedBatchables=this._relayout(this._originalBatchables),t=this._layoutedBatchables,this._resetContext&&this.context.reset()):this._reflowing?(this._layoutedBatchables=this._reflow(this._originalBatchables),t=this._layoutedBatchables):this._repainting&&(t=this._repaint(this._layoutedBatchables)),t&&(this._batchables=t,this._redrawing=!1,this._reflowing=!1,this._repainting=!1),this._batchables.forEach(i=>{var s,o;(s=i.texture)==null||s.upload(e),e.batch2D.render({...i,texture:(o=i.texture)==null?void 0:o._glTexture(e)})}),super._render(e)}toJSON(){const e=super.toJSON();return{...e,props:{style:this.style.toJSON(),...e.props}}}},bs([A()],g.CanvasItem.prototype,"tint",2),bs([A()],g.CanvasItem.prototype,"blendMode",2),g.CanvasItem=bs([H("CanvasItem")],g.CanvasItem);var wc=Object.defineProperty,xc=Object.getOwnPropertyDescriptor,Nt=(n,r,e,t)=>{for(var i=t>1?void 0:t?xc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&wc(r,e,i),i};const ko=n=>n,No=sr(.25,.1,.25,1),Fo=sr(.42,0,1,1),$o=sr(0,0,.58,1),zo=sr(.42,0,.58,1);function sr(n,r,e,t){const s=3*n-3*e+1,o=3*e-6*n,a=3*n,l=3*r-3*t+1,h=3*t-6*r,c=3*r,f=v=>(3*s*v+2*o)*v+a,p=v=>((s*v+o)*v+a)*v,d=v=>((l*v+h)*v+c)*v;function m(v){let y=v,S,C;for(let b=0;b<8;b++){if(C=p(y)-v,Math.abs(C)<1e-6)return y;if(S=f(y),Math.abs(S)<1e-6)break;y-=C/S}let x=1,T=0;for(y=v;x>T;){if(C=p(y)-v,Math.abs(C)<1e-6)return y;C>0?x=y:T=y,y=(x+T)/2}return y}return v=>d(m(v))}const li={linear:ko,ease:No,easeIn:Fo,easeOut:$o,easeInOut:zo};g.Animation2D=class extends g.Node{constructor(e){super();u(this,"easing");u(this,"_keyframes",[]);u(this,"_starting",!1);u(this,"_startProps",new WeakMap);this._onUpdateTime=this._onUpdateTime.bind(this),this.setProperties(e)}_enterTree(){var e;(e=this._tree)==null||e.timeline.on("update",this._onUpdateTime),this._updateStartProps()}_exitTree(){var e;(e=this._tree)==null||e.timeline.off("update",this._onUpdateTime),this.cancel()}_onUpdateProperty(e,t,i){switch(super._onUpdateProperty(e,t,i),e){case"mode":case"keyframes":this._updateKeyframes();break}}_getTargets(){var t;let e;switch(this.mode){case"sibling":e=((t=this.getParent())==null?void 0:t.getChildren(!0).filter(i=>i instanceof g.CanvasItem))??[];break;case"parent":default:e=[this.getParent()].filter(Boolean);break}return e.map(i=>i.style)}_updateKeyframes(){const e=[],t=this.keyframes;for(let o=t.length,a=0;a<o;a++){const{offset:l=a===0?0:a/(o-1),easing:h="linear",...c}=t[a];e.push({offset:l,easing:this._parseEasing(h),props:c})}const i=e[0],s=e[e.length-1];i&&i.offset!==0&&e.unshift({offset:0,easing:this._parseEasing("linear"),props:{}}),s&&s.offset!==1&&e.push({offset:1,easing:this._parseEasing("linear"),props:{}}),this._keyframes=e,this._updateStartProps()}_onUpdateTime(){if(!this.keyframes.length)return;if(this.isVisible())this._starting||(this._starting=!0,this._updateStartProps());else{if(!this._starting)return;this._starting=!1}const e=this._getTargets(),t=1/e.length,i=this.visibleProgress;e.forEach((s,o)=>{const a=t===1?i:xt(0,Math.max(0,i-t*o)/t,1),l=this._startProps.get(s);if(!l)return;const h=this._parseKeyframes(a,l);h!=null&&h.length&&this._commitStyle(a,s,l,h[0],h[1])})}_updateStartProps(){this.cancel(),this._getTargets().forEach(e=>{const t=new Map,i=this._keyframes;for(let s=i.length,o=0;o<s;o++)Object.keys(i[o].props).forEach(a=>{t.set(a,e[a])});this._startProps.set(e,t)})}_parseEasing(e){if(!e)return li.linear;if(e in li)return li[e];const t=e.replace(/cubic-bezier\((.+)\)/,"$1").split(",").map(i=>Number(i));return sr(t[0],t[1],t[2],t[3])}_parseKeyframes(e,t){let i;const s=this._keyframes;for(let o=s.length,a=0;a<o;a++){const l=s[a],{offset:h,easing:c}=l,f={...l.props};if(i&&e<=h){const{offset:p,easing:d}=i,m={...i.props};return t.forEach((v,y)=>{(!(y in m)||m[y]===null)&&(m[y]=v),(!(y in f)||f[y]===null)&&(f[y]=v)}),[{offset:p,easing:d,props:m},{offset:h,easing:c,props:f}]}i=l}return null}_commitStyle(e,t,i,s,o){const{offset:a,easing:l,props:h}=s,{offset:c,props:f}=o,p=c-a,d=l((e-a)/p),m={width:t.width,height:t.height,fontSize:t.fontSize};i.forEach((v,y)=>{t[y]=this._getDiffValue(y,h[y],f[y],d,m)})}_getDiffValue(e,t,i,s,o){let a,l;if(t===void 0||i===void 0)if(t!==void 0)a=pr(e,String(t),o),l=Vi(a);else if(i!==void 0)l=pr(e,String(i),o),a=Vi(l);else return;else a=pr(e,String(t),o),l=pr(e,String(i),o);if(Array.isArray(a)&&Array.isArray(l)){const h=new Set,c={},f={};a.forEach(({name:d,args:m})=>{c[d]=m,h.add(d)}),l.forEach(({name:d,args:m})=>{f[d]=m,h.add(d)});let p="";return h.forEach(d=>{var S,C;const m=Math.max(((S=c[d])==null?void 0:S.length)??0,((C=f[d])==null?void 0:C.length)??0),v=c[d],y=f[d];p+=`${d}(${Array.from({length:m},(x,T)=>{const b=v==null?void 0:v[T],P=y==null?void 0:y[T],E=(b==null?void 0:b.normalizedIntValue)??0,w=(P==null?void 0:P.normalizedIntValue)??0;return Number.isNaN(E)||Number.isNaN(w)?(P==null?void 0:P.value)??0:fe(E,w,s)}).join(", ")}) `}),p}else if(!Array.isArray(a)&&!Array.isArray(l))return Number.isNaN(a.normalizedIntValue)||Number.isNaN(l.normalizedIntValue)?l.value:fe(a.normalizedIntValue,l.normalizedIntValue,s)}cancel(){this._getTargets().forEach(e=>{var t;(t=this._startProps.get(e))==null||t.forEach((i,s)=>{e[s]=i}),this._startProps.delete(e)})}},Nt([A({default:"parent"})],g.Animation2D.prototype,"mode",2),Nt([A({default:!1})],g.Animation2D.prototype,"loop",2),Nt([A({default:[]})],g.Animation2D.prototype,"keyframes",2),Nt([A()],g.Animation2D.prototype,"easing",2),Nt([A({alias:"visibleDelay",default:0})],g.Animation2D.prototype,"delay",2),Nt([A({alias:"visibleDuration",default:2e3})],g.Animation2D.prototype,"duration",2),g.Animation2D=Nt([H("Animation2D")],g.Animation2D);var Pc=Object.defineProperty,Cc=Object.getOwnPropertyDescriptor,Ec=(n,r,e,t)=>{for(var i=t>1?void 0:t?Cc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Pc(r,e,i),i};g.Node2D=class extends g.CanvasItem{constructor(e){super();u(this,"_transform",new qe);u(this,"_parentTransformDirtyId");this.setProperties(e)}getBoundingBox(){let{left:e,top:t,width:i,height:s,rotate:o}=this.style;if(o){o=Math.abs(o%180),o=o/180*Math.PI;const a=Math.abs(Math.sin(o)),l=Math.abs(Math.cos(o)),h=s*a+i*l,c=s*l+i*a;e+=(i-h)/2,t+=(s-c)/2,i=h,s=c}return new Y(e,t,i,s)}_onUpdateStyleProperty(e,t,i){switch(super._onUpdateStyleProperty(e,t,i),e){case"width":case"height":this.mask instanceof g.Node2D&&(this.mask.style.width=this.style.width,this.mask.style.height=this.style.height),this.requestRedraw();case"scaleX":case"scaleY":case"left":case"top":case"rotate":case"transform":case"transformOrigin":this._updateTransform();break;case"overflow":this._updateOverflow();break}}_updateTransform(){const e=this.getParent(),t=e==null?void 0:e._transform;this._parentTransformDirtyId=t==null?void 0:t.dirtyId;const i=this.style.getComputedTransform().toArray();let s;if(t){const o=t.toArray();s=[i[0]*o[0]+i[3]*o[1],i[1]*o[0]+i[4]*o[1],i[2]*o[0]+i[5]*o[1]+o[2],i[0]*o[3]+i[3]*o[4],i[1]*o[3]+i[4]*o[4],i[2]*o[3]+i[5]*o[4]+o[5],0,0,1]}else s=i;this._transform.set(s),this._updateOverflow(),this.requestReflow()}_updateOverflow(){if(this.style.overflow==="hidden"){const[e,t,i,s,o,a]=this._transform.toArray(),l=this.style.width,h=this.style.height;this.mask={x:i,y:a,width:e*l+t*h,height:s*l+o*h}}else this.mask=void 0}_transformVertices(e){const[t,i,s,o,a,l]=this._transform.toArray(),h=e.slice();for(let c=e.length,f=0;f<c;f+=2){const p=e[f],d=e[f+1];h[f]=t*p+i*d+s,h[f+1]=o*p+a*d+l}return h}_reflow(e){return super._reflow(e.map(t=>({...t,vertices:this._transformVertices(t.vertices)})))}_process(e){var i;const t=this.getParent();((i=t==null?void 0:t._transform)==null?void 0:i.dirtyId)!==this._parentTransformDirtyId&&this._updateTransform(),super._process(e)}input(e){if(super.input(e),!e.target&&this.isRenderable()){const{screenX:t,screenY:i}=e;if(t&&i){const{width:s,height:o}=this.style,[a,l]=this._transform.inverse().applyToPoint(t,i);a>=0&&a<s&&l>=0&&l<o&&(e.target=this)}}}},g.Node2D=Ec([H({tag:"Node2D",renderable:!0})],g.Node2D);var Tc=Object.defineProperty,Sc=Object.getOwnPropertyDescriptor,ge=(n,r,e,t)=>{for(var i=t>1?void 0:t?Sc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Tc(r,e,i),i};function ye(n){return function(r,e){Object.defineProperty(r.constructor.prototype,e,{get(){return n!=null&&n.method?(...t)=>(this.context[e].call(this.context,...t),n.redraw&&this.requestRedraw(),r):this.context[e]},set(t){this.context[e]=t},configurable:!0,enumerable:!0})}}g.Graphics2D=class extends g.Node2D{constructor(){super(...arguments);u(this,"_resetContext",!1);u(this,"lineCap");u(this,"lineJoin");u(this,"fillStyle");u(this,"strokeStyle");u(this,"lineWidth");u(this,"miterLimit")}drawCircle(e,t,i){return this.arc(e+i,t+i,i,0,le),this.fill(),this}drawEllipse(e,t,i,s){const o=i/2,a=s/2;return this.ellipse(e+o,t+a,o,a,0,0,le),this.fill(),this}},ge([ye()],g.Graphics2D.prototype,"lineCap",2),ge([ye()],g.Graphics2D.prototype,"lineJoin",2),ge([ye()],g.Graphics2D.prototype,"fillStyle",2),ge([ye()],g.Graphics2D.prototype,"strokeStyle",2),ge([ye()],g.Graphics2D.prototype,"lineWidth",2),ge([ye()],g.Graphics2D.prototype,"miterLimit",2),ge([ye({method:!0})],g.Graphics2D.prototype,"rect",2),ge([ye({method:!0,redraw:!0})],g.Graphics2D.prototype,"fillRect",2),ge([ye({method:!0,redraw:!0})],g.Graphics2D.prototype,"strokeRect",2),ge([ye({method:!0})],g.Graphics2D.prototype,"roundRect",2),ge([ye({method:!0})],g.Graphics2D.prototype,"ellipse",2),ge([ye({method:!0})],g.Graphics2D.prototype,"arc",2),ge([ye({method:!0})],g.Graphics2D.prototype,"beginPath",2),ge([ye({method:!0})],g.Graphics2D.prototype,"moveTo",2),ge([ye({method:!0})],g.Graphics2D.prototype,"lineTo",2),ge([ye({method:!0})],g.Graphics2D.prototype,"closePath",2),ge([ye({method:!0,redraw:!0})],g.Graphics2D.prototype,"fill",2),ge([ye({method:!0,redraw:!0})],g.Graphics2D.prototype,"stroke",2),g.Graphics2D=ge([H("Graphics2D")],g.Graphics2D);class hi extends wt{constructor(e){super();u(this,"frames");let t;if(Array.isArray(e))t=e;else if(e instanceof de)t=[{texture:e,duration:0}];else throw new TypeError("Failed new Image2DResource");this.frames=t,this.updateDuration()}updateDuration(){return this.duration=this.frames.reduce((e,t)=>t.duration+e,0),this}destroy(){this.frames.forEach(e=>{e.texture.destroy()})}}var Mc=Object.defineProperty,Ac=Object.getOwnPropertyDescriptor,ci=(n,r,e,t)=>{for(var i=t>1?void 0:t?Ac(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Mc(r,e,i),i};g.Image2D=class extends g.Node2D{constructor(e){super();u(this,"resource");u(this,"_frameIndex",0);u(this,"_complete",!1);u(this,"_wait",Promise.resolve());this.setProperties(e)}get currentTexture(){var e,t;return(t=(e=this.resource)==null?void 0:e.frames[this._frameIndex])==null?void 0:t.texture}get duration(){var e;return((e=this.resource)==null?void 0:e.duration)??0}get naturalWidth(){var e;return((e=this.currentTexture)==null?void 0:e.realWidth)??0}get naturalHeight(){var e;return((e=this.currentTexture)==null?void 0:e.realHeight)??0}get complete(){return this._complete}_onUpdateProperty(e,t,i){switch(super._onUpdateProperty(e,t,i),e){case"src":this._wait=this._load(t);break}}decode(){return this._wait}setResource(e){let t;if(e instanceof hi?t=e:t=new hi(e),this.resource=t.updateDuration(),this.currentTexture&&(!this.style.width||!this.style.height)){const i=this.currentTexture;this.style.width=i.realWidth,this.style.height=i.realHeight}return this}async _load(e){if(this._complete=!1,e)try{this.setResource(this.gif?await mt.gif.load(e):await mt.texture.load(e)),this.requestRedraw(),this.emit("load")}catch(t){console.warn(t),this.emit("error",t)}else this.resource=void 0;this._complete=!0}_getCurrentTime(){var i;const e=((i=this.resource)==null?void 0:i.duration)??0;if(!e||!this._tree)return 0;const t=this.visibleRelativeTime;return t<0?0:t%e}_updateFrameIndex(){if(!this.resource)return this;const e=this._getCurrentTime(),t=this.resource.frames,i=t.length;if(i<=1&&this._frameIndex===0)return this;let s=i-1;for(let o=0,a=0;a<i;a++)if(o+=t[a].duration??0,o>=e){s=a;break}return this._frameIndex!==s&&(this._frameIndex=s,this.requestRepaint()),this}_process(e){this._updateFrameIndex(),super._process(e)}_drawContent(){const e=this.currentTexture;e!=null&&e.valid&&(this.context.fillStyle=e,this.context.textureTransform=new qe().scale(this.style.width/e.width,this.style.height/e.height),super._drawContent())}_repaint(e){const t=this.currentTexture;return super._repaint(e.map((i,s)=>(this._backgroundImage?s===1:s===0)&&i.type==="fill"?{...i,texture:t!=null&&t.valid?t:void 0}:i))}},ci([ee()],g.Image2D.prototype,"resource",2),ci([A({default:!1})],g.Image2D.prototype,"gif",2),ci([A({default:""})],g.Image2D.prototype,"src",2),g.Image2D=ci([H("Image2D")],g.Image2D);var Oc=Object.defineProperty,Uc=Object.getOwnPropertyDescriptor,ws=(n,r,e,t)=>{for(var i=t>1?void 0:t?Uc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Oc(r,e,i),i};g.Lottie2D=class extends g.Node2D{constructor(e){super();u(this,"duration",0);u(this,"texture",new de(document.createElement("canvas")));u(this,"animation");this.setProperties(e)}_onUpdateProperty(e,t,i){switch(super._onUpdateProperty(e,t,i),e){case"src":this._load();break}}_onUpdateStyleProperty(e,t,i){switch(super._onUpdateStyleProperty(e,t,i),e){case"width":this.texture.source.width=this.style.width*this.pixelRatio;break;case"height":this.texture.source.height=this.style.height*this.pixelRatio;break}}async _load(){this.animation=await mt.lottie.load(this.src,this.texture.source),this.duration=this.animation.getDuration(!1)*1e3,this.texture.requestUpload(),this.requestRedraw()}_process(e){var t;(t=this.animation)==null||t.goToAndStop(this.visibleRelativeTime,!1),this.texture.requestUpload(),this.requestRepaint(),super._process(e)}_drawContent(){const e=this.texture;e.valid&&(this.context.fillStyle=e,this.context.textureTransform=new qe().scale(this.style.width/e.width,this.style.height/e.height),super._drawContent())}},ws([A({default:2})],g.Lottie2D.prototype,"pixelRatio",2),ws([A({default:""})],g.Lottie2D.prototype,"src",2),g.Lottie2D=ws([H("Lottie2D")],g.Lottie2D);var Te=Uint8Array,Ve=Uint16Array,xs=Int32Array,ui=new Te([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]),fi=new Te([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]),Ps=new Te([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Vo=function(n,r){for(var e=new Ve(31),t=0;t<31;++t)e[t]=r+=1<<n[t-1];for(var i=new xs(e[30]),t=1;t<30;++t)for(var s=e[t];s<e[t+1];++s)i[s]=s-e[t]<<5|t;return{b:e,r:i}},jo=Vo(ui,2),Go=jo.b,Cs=jo.r;Go[28]=258,Cs[258]=28;for(var qo=Vo(fi,0),Dc=qo.b,Wo=qo.r,Es=new Ve(32768),re=0;re<32768;++re){var Tt=(re&43690)>>1|(re&21845)<<1;Tt=(Tt&52428)>>2|(Tt&13107)<<2,Tt=(Tt&61680)>>4|(Tt&3855)<<4,Es[re]=((Tt&65280)>>8|(Tt&255)<<8)>>1}for(var lt=function(n,r,e){for(var t=n.length,i=0,s=new Ve(r);i<t;++i)n[i]&&++s[n[i]-1];var o=new Ve(r);for(i=1;i<r;++i)o[i]=o[i-1]+s[i-1]<<1;var a;if(e){a=new Ve(1<<r);var l=15-r;for(i=0;i<t;++i)if(n[i])for(var h=i<<4|n[i],c=r-n[i],f=o[n[i]-1]++<<c,p=f|(1<<c)-1;f<=p;++f)a[Es[f]>>l]=h}else for(a=new Ve(t),i=0;i<t;++i)n[i]&&(a[i]=Es[o[n[i]-1]++]>>15-n[i]);return a},St=new Te(288),re=0;re<144;++re)St[re]=8;for(var re=144;re<256;++re)St[re]=9;for(var re=256;re<280;++re)St[re]=7;for(var re=280;re<288;++re)St[re]=8;for(var Sr=new Te(32),re=0;re<32;++re)Sr[re]=5;var Ic=lt(St,9,0),Rc=lt(St,9,1),Bc=lt(Sr,5,0),Lc=lt(Sr,5,1),Ts=function(n){for(var r=n[0],e=1;e<n.length;++e)n[e]>r&&(r=n[e]);return r},Qe=function(n,r,e){var t=r/8|0;return(n[t]|n[t+1]<<8)>>(r&7)&e},Ss=function(n,r){var e=r/8|0;return(n[e]|n[e+1]<<8|n[e+2]<<16)>>(r&7)},Ms=function(n){return(n+7)/8|0},Xo=function(n,r,e){return(e==null||e>n.length)&&(e=n.length),new Te(n.subarray(r,e))},kc=["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"],et=function(n,r,e){var t=new Error(r||kc[n]);if(t.code=n,Error.captureStackTrace&&Error.captureStackTrace(t,et),!e)throw t;return t},Nc=function(n,r,e,t){var i=n.length,s=0;if(!i||r.f&&!r.l)return e||new Te(0);var o=!e,a=o||r.i!=2,l=r.i;o&&(e=new Te(i*3));var h=function(Le){var Fe=e.length;if(Le>Fe){var Ce=new Te(Math.max(Fe*2,Le));Ce.set(e),e=Ce}},c=r.f||0,f=r.p||0,p=r.b||0,d=r.l,m=r.d,v=r.m,y=r.n,S=i*8;do{if(!d){c=Qe(n,f,1);var C=Qe(n,f+1,3);if(f+=3,C)if(C==1)d=Rc,m=Lc,v=9,y=5;else if(C==2){var P=Qe(n,f,31)+257,E=Qe(n,f+10,15)+4,w=P+Qe(n,f+5,31)+1;f+=14;for(var D=new Te(w),F=new Te(19),B=0;B<E;++B)F[Ps[B]]=Qe(n,f+B*3,7);f+=E*3;for(var U=Ts(F),V=(1<<U)-1,M=lt(F,U,1),B=0;B<w;){var N=M[Qe(n,f,V)];f+=N&15;var x=N>>4;if(x<16)D[B++]=x;else{var q=0,R=0;for(x==16?(R=3+Qe(n,f,3),f+=2,q=D[B-1]):x==17?(R=3+Qe(n,f,7),f+=3):x==18&&(R=11+Qe(n,f,127),f+=7);R--;)D[B++]=q}}var I=D.subarray(0,P),j=D.subarray(P);v=Ts(I),y=Ts(j),d=lt(I,v,1),m=lt(j,y,1)}else et(1);else{var x=Ms(f)+4,T=n[x-4]|n[x-3]<<8,b=x+T;if(b>i){l&&et(0);break}a&&h(p+T),e.set(n.subarray(x,b),p),r.b=p+=T,r.p=f=b*8,r.f=c;continue}if(f>S){l&&et(0);break}}a&&h(p+131072);for(var k=(1<<v)-1,L=(1<<y)-1,K=f;;K=f){var q=d[Ss(n,f)&k],X=q>>4;if(f+=q&15,f>S){l&&et(0);break}if(q||et(2),X<256)e[p++]=X;else if(X==256){K=f,d=null;break}else{var W=X-254;if(X>264){var B=X-257,G=ui[B];W=Qe(n,f,(1<<G)-1)+Go[B],f+=G}var Q=m[Ss(n,f)&L],Z=Q>>4;Q||et(3),f+=Q&15;var j=Dc[Z];if(Z>3){var G=fi[Z];j+=Ss(n,f)&(1<<G)-1,f+=G}if(f>S){l&&et(0);break}a&&h(p+131072);var ae=p+W;if(p<j){var ut=s-j,Ze=Math.min(j,ae);for(ut+p<0&&et(3);p<Ze;++p)e[p]=t[ut+p]}for(;p<ae;++p)e[p]=e[p-j]}}r.l=d,r.p=K,r.b=p,r.f=c,d&&(c=1,r.m=v,r.d=m,r.n=y)}while(!c);return p!=e.length&&o?Xo(e,0,p):e.subarray(0,p)},yt=function(n,r,e){e<<=r&7;var t=r/8|0;n[t]|=e,n[t+1]|=e>>8},Mr=function(n,r,e){e<<=r&7;var t=r/8|0;n[t]|=e,n[t+1]|=e>>8,n[t+2]|=e>>16},As=function(n,r){for(var e=[],t=0;t<n.length;++t)n[t]&&e.push({s:t,f:n[t]});var i=e.length,s=e.slice();if(!i)return{t:Ko,l:0};if(i==1){var o=new Te(e[0].s+1);return o[e[0].s]=1,{t:o,l:1}}e.sort(function(b,P){return b.f-P.f}),e.push({s:-1,f:25001});var a=e[0],l=e[1],h=0,c=1,f=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=e[e[h].f<e[f].f?h++:f++],l=e[h!=c&&e[h].f<e[f].f?h++:f++],e[c++]={s:-1,f:a.f+l.f,l:a,r:l};for(var p=s[0].s,t=1;t<i;++t)s[t].s>p&&(p=s[t].s);var d=new Ve(p+1),m=Os(e[c-1],d,0);if(m>r){var t=0,v=0,y=m-r,S=1<<y;for(s.sort(function(P,E){return d[E.s]-d[P.s]||P.f-E.f});t<i;++t){var C=s[t].s;if(d[C]>r)v+=S-(1<<m-d[C]),d[C]=r;else break}for(v>>=y;v>0;){var x=s[t].s;d[x]<r?v-=1<<r-d[x]++-1:++t}for(;t>=0&&v;--t){var T=s[t].s;d[T]==r&&(--d[T],++v)}m=r}return{t:new Te(d),l:m}},Os=function(n,r,e){return n.s==-1?Math.max(Os(n.l,r,e+1),Os(n.r,r,e+1)):r[n.s]=e},Ho=function(n){for(var r=n.length;r&&!n[--r];);for(var e=new Ve(++r),t=0,i=n[0],s=1,o=function(l){e[t++]=l},a=1;a<=r;++a)if(n[a]==i&&a!=r)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=n[a]}return{c:e.subarray(0,t),n:r}},Ar=function(n,r){for(var e=0,t=0;t<r.length;++t)e+=n[t]*r[t];return e},Yo=function(n,r,e){var t=e.length,i=Ms(r+2);n[i]=t&255,n[i+1]=t>>8,n[i+2]=n[i]^255,n[i+3]=n[i+1]^255;for(var s=0;s<t;++s)n[i+s+4]=e[s];return(i+4+t)*8},Zo=function(n,r,e,t,i,s,o,a,l,h,c){yt(r,c++,e),++i[256];for(var f=As(i,15),p=f.t,d=f.l,m=As(s,15),v=m.t,y=m.l,S=Ho(p),C=S.c,x=S.n,T=Ho(v),b=T.c,P=T.n,E=new Ve(19),w=0;w<C.length;++w)++E[C[w]&31];for(var w=0;w<b.length;++w)++E[b[w]&31];for(var D=As(E,7),F=D.t,B=D.l,U=19;U>4&&!F[Ps[U-1]];--U);var V=h+5<<3,M=Ar(i,St)+Ar(s,Sr)+o,N=Ar(i,p)+Ar(s,v)+o+14+3*U+Ar(E,F)+2*E[16]+3*E[17]+7*E[18];if(l>=0&&V<=M&&V<=N)return Yo(r,c,n.subarray(l,l+h));var q,R,I,j;if(yt(r,c,1+(N<M)),c+=2,N<M){q=lt(p,d,0),R=p,I=lt(v,y,0),j=v;var k=lt(F,B,0);yt(r,c,x-257),yt(r,c+5,P-1),yt(r,c+10,U-4),c+=14;for(var w=0;w<U;++w)yt(r,c+3*w,F[Ps[w]]);c+=3*U;for(var L=[C,b],K=0;K<2;++K)for(var X=L[K],w=0;w<X.length;++w){var W=X[w]&31;yt(r,c,k[W]),c+=F[W],W>15&&(yt(r,c,X[w]>>5&127),c+=X[w]>>12)}}else q=Ic,R=St,I=Bc,j=Sr;for(var w=0;w<a;++w){var G=t[w];if(G>255){var W=G>>18&31;Mr(r,c,q[W+257]),c+=R[W+257],W>7&&(yt(r,c,G>>23&31),c+=ui[W]);var Q=G&31;Mr(r,c,I[Q]),c+=j[Q],Q>3&&(Mr(r,c,G>>5&8191),c+=fi[Q])}else Mr(r,c,q[G]),c+=R[G]}return Mr(r,c,q[256]),c+R[256]},Fc=new xs([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ko=new Te(0),$c=function(n,r,e,t,i,s){var o=s.z||n.length,a=new Te(t+o+5*(1+Math.ceil(o/7e3))+i),l=a.subarray(t,a.length-i),h=s.l,c=(s.r||0)&7;if(r){c&&(l[0]=s.r>>3);for(var f=Fc[r-1],p=f>>13,d=f&8191,m=(1<<e)-1,v=s.p||new Ve(32768),y=s.h||new Ve(m+1),S=Math.ceil(e/3),C=2*S,x=function($e){return(n[$e]^n[$e+1]<<S^n[$e+2]<<C)&m},T=new xs(25e3),b=new Ve(288),P=new Ve(32),E=0,w=0,D=s.i||0,F=0,B=s.w||0,U=0;D+2<o;++D){var V=x(D),M=D&32767,N=y[V];if(v[M]=N,y[V]=M,B<=D){var q=o-D;if((E>7e3||F>24576)&&(q>423||!h)){c=Zo(n,l,0,T,b,P,w,F,U,D-U,c),F=E=w=0,U=D;for(var R=0;R<286;++R)b[R]=0;for(var R=0;R<30;++R)P[R]=0}var I=2,j=0,k=d,L=M-N&32767;if(q>2&&V==x(D-L))for(var K=Math.min(p,q)-1,X=Math.min(32767,D),W=Math.min(258,q);L<=X&&--k&&M!=N;){if(n[D+I]==n[D+I-L]){for(var G=0;G<W&&n[D+G]==n[D+G-L];++G);if(G>I){if(I=G,j=L,G>K)break;for(var Q=Math.min(L,G-2),Z=0,R=0;R<Q;++R){var ae=D-L+R&32767,ut=v[ae],Ze=ae-ut&32767;Ze>Z&&(Z=Ze,N=ae)}}}M=N,N=v[M],L+=M-N&32767}if(j){T[F++]=268435456|Cs[I]<<18|Wo[j];var Le=Cs[I]&31,Fe=Wo[j]&31;w+=ui[Le]+fi[Fe],++b[257+Le],++P[Fe],B=D+I,++E}else T[F++]=n[D],++b[n[D]]}}for(D=Math.max(D,B);D<o;++D)T[F++]=n[D],++b[n[D]];c=Zo(n,l,h,T,b,P,w,F,U,D-U,c),h||(s.r=c&7|l[c/8|0]<<3,c-=7,s.h=y,s.p=v,s.i=D,s.w=B)}else{for(var D=s.w||0;D<o+h;D+=65535){var Ce=D+65535;Ce>=o&&(l[c/8|0]=h,Ce=o),c=Yo(l,c+1,n.subarray(D,Ce))}s.i=o}return Xo(a,0,t+Ms(c)+i)},Jo=function(){var n=1,r=0;return{p:function(e){for(var t=n,i=r,s=e.length|0,o=0;o!=s;){for(var a=Math.min(o+2655,s);o<a;++o)i+=t+=e[o];t=(t&65535)+15*(t>>16),i=(i&65535)+15*(i>>16)}n=t,r=i},d:function(){return n%=65521,r%=65521,(n&255)<<24|(n&65280)<<8|(r&255)<<8|r>>8}}},zc=function(n,r,e,t,i){if(!i&&(i={l:1},r.dictionary)){var s=r.dictionary.subarray(-32768),o=new Te(s.length+n.length);o.set(s),o.set(n,s.length),n=o,i.w=s.length}return $c(n,r.level==null?6:r.level,r.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):20:12+r.mem,e,t,i)},Qo=function(n,r,e){for(;e;++r)n[r]=e,e>>>=8},Vc=function(n,r){var e=r.level,t=e==0?0:e<6?1:e==9?3:2;if(n[0]=120,n[1]=t<<6|(r.dictionary&&32),n[1]|=31-(n[0]<<8|n[1])%31,r.dictionary){var i=Jo();i.p(r.dictionary),Qo(n,2,i.d())}},jc=function(n,r){return((n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31)&&et(6,"invalid zlib data"),(n[1]>>5&1)==+!r&&et(6,"invalid zlib data: "+(n[1]&32?"need":"unexpected")+" dictionary"),(n[1]>>3&4)+2};function Gc(n,r){r||(r={});var e=Jo();e.p(n);var t=zc(n,r,r.dictionary?6:2,4);return Vc(t,r),Qo(t,t.length-4,e.d()),t}function qc(n,r){return Nc(n.subarray(jc(n,r),-4),{i:2},r,r)}var Wc=typeof TextDecoder<"u"&&new TextDecoder,Xc=0;try{Wc.decode(Ko,{stream:!0}),Xc=1}catch{}const Hc="modern-font";function Or(n,r){if(!n)throw new Error(`[${Hc}] ${r}`)}function Yc(n){if("buffer"in n){const r=n.buffer;return n.byteOffset>0||n.byteLength<n.buffer.byteLength?r.slice(n.byteOffset,n.byteOffset+n.byteLength):r}else return n}function nr(n){return"buffer"in n?new DataView(n.buffer,n.byteOffset,n.byteLength):new DataView(n)}function Zc(n){let r="";for(let e=0,t=n.length,i;e<t;e++)i=n.charCodeAt(e),i!==0&&(r+=String.fromCharCode(i));return r}function di(n){n=Zc(n);const r=[];for(let e=0,t=n.length,i;e<t;e++)i=n.charCodeAt(e),r.push(i>>8),r.push(i&255);return r}function Kc(n){let r="";for(let e=0,t=n.length;e<t;e++)n[e]<127?r+=String.fromCharCode(n[e]):r+=`%${(256+n[e]).toString(16).slice(1)}`;return unescape(r)}function Jc(n){let r="";for(let e=0,t=n.length;e<t;e+=2)r+=String.fromCharCode((n[e]<<8)+n[e+1]);return r}var Qc=Object.defineProperty,Se=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&Qc(r,e,i),i};const Ur={int8:1,int16:2,int32:4,uint8:1,uint16:2,uint32:4,float32:4,float64:8,fixed:4,longDateTime:8,char:1};function Me(){return function(n,r){Object.defineProperty(n.constructor.prototype,r,{get(){if(typeof r=="string"){if(r.startsWith("read"))return(...e)=>this.read(r.substring(4).toLowerCase(),...e);if(r.startsWith("write"))return(...e)=>this.write(r.substring(5).toLowerCase(),...e)}},configurable:!0,enumerable:!0})}}class ve extends DataView{constructor(e,t,i,s){super(Yc(e),t,i);u(this,"cursor",0);this.littleEndian=s}readColumn(e){if(e.size){const t=Array.from({length:e.size},(i,s)=>this.read(e.type,e.offset+s));switch(e.type){case"char":return t.join("");default:return t}}else return this.read(e.type,e.offset)}writeColumn(e,t){e.size?Array.from({length:e.size},(i,s)=>{this.write(e.type,t[s],e.offset+s)}):this.write(e.type,t,e.offset)}read(e,t=this.cursor,i=this.littleEndian){var h;switch(e){case"char":return this.readChar(t);case"fixed":return this.readFixed(t,i);case"longDateTime":return this.readLongDateTime(t,i)}const s=`get${e.replace(/^\S/,c=>c.toUpperCase())}`,o=this,a=(h=o[s])==null?void 0:h.bind(o),l=a==null?void 0:a(t,i);return this.cursor+=Ur[e],l}readUint24(e=this.cursor){const[t,i,s]=this.readBytes(e,3);return(t<<16)+(i<<8)+s}readBytes(e,t){t==null&&(t=e,e=this.cursor);const i=[];for(let s=0;s<t;++s)i.push(this.getUint8(e+s));return this.cursor=e+t,i}readString(e,t){const i=this.readBytes(e,t);let s="";for(let o=0,a=i.length;o<a;o++)s+=String.fromCharCode(i[o]);return s}readFixed(e,t){const i=this.readInt32(e,t)/65536;return Math.ceil(i*1e5)/1e5}readLongDateTime(e=this.cursor,t){const i=this.readUint32(e+4,t),s=new Date;return s.setTime(i*1e3+-20775456e5),s}readChar(e){return this.readString(e,1)}write(e,t,i=this.cursor,s=this.littleEndian){var c;switch(e){case"char":return this.writeChar(t,i);case"fixed":return this.writeFixed(t,i);case"longDateTime":return this.writeLongDateTime(t,i)}const o=`set${e.replace(/^\S/,f=>f.toUpperCase())}`,a=this,l=(c=a[o])==null?void 0:c.bind(a),h=l==null?void 0:l(i,t,s);return this.cursor+=Ur[e.toLowerCase()],h}writeString(e="",t=this.cursor){const i=e.replace(/[^\x00-\xFF]/g,"11").length;this.seek(t);for(let s=0,o=e.length,a;s<o;++s)a=e.charCodeAt(s)||0,a>127?this.writeUint16(a):this.writeUint8(a);return this.cursor+=i,this}writeChar(e,t){return this.writeString(e,t)}writeFixed(e,t){return this.writeInt32(Math.round(e*65536),t),this}writeLongDateTime(e,t=this.cursor){typeof e>"u"?e=-20775456e5:typeof e.getTime=="function"?e=e.getTime():/^\d+$/.test(e)?e=+e:e=Date.parse(e);const s=Math.round((e- -20775456e5)/1e3);return this.writeUint32(0,t),this.writeUint32(s,t+4),this}writeBytes(e,t=this.cursor){let i;if(Array.isArray(e)){i=e.length;for(let s=0;s<i;++s)this.setUint8(t+s,e[s])}else{const s=nr(e);i=s.byteLength;for(let o=0;o<i;++o)this.setUint8(t+o,s.getUint8(o))}return this.cursor=t+i,this}seek(e){return this.cursor=e,this}}Se([Me()],ve.prototype,"readInt8"),Se([Me()],ve.prototype,"readInt16"),Se([Me()],ve.prototype,"readInt32"),Se([Me()],ve.prototype,"readUint8"),Se([Me()],ve.prototype,"readUint16"),Se([Me()],ve.prototype,"readUint32"),Se([Me()],ve.prototype,"readFloat32"),Se([Me()],ve.prototype,"readFloat64"),Se([Me()],ve.prototype,"writeInt8"),Se([Me()],ve.prototype,"writeInt16"),Se([Me()],ve.prototype,"writeInt32"),Se([Me()],ve.prototype,"writeUint8"),Se([Me()],ve.prototype,"writeUint16"),Se([Me()],ve.prototype,"writeUint32"),Se([Me()],ve.prototype,"writeFloat32"),Se([Me()],ve.prototype,"writeFloat64");const ea=new WeakMap;function _(n){const r=typeof n=="object"?n:{type:n},{size:e=1,type:t}=r;return(i,s)=>{if(typeof s!="string")return;let o=ea.get(i);o||(o={columns:[],byteLength:0},ea.set(i,o));const a={...r,name:s,byteLength:e*Ur[t],offset:r.offset??o.columns.reduce((l,h)=>l+h.byteLength,0)};o.columns.push(a),o.byteLength=o.columns.reduce((l,h)=>l+Ur[h.type]*(h.size??1),0),Object.defineProperty(i.constructor.prototype,s,{get(){return this.view.readColumn(a)},set(l){this.view.writeColumn(a,l)},configurable:!0,enumerable:!0})}}class je{constructor(r,e,t,i){u(this,"view");this.view=new ve(r,e,t,i)}}class pi extends je{get buffer(){return this.view.buffer}toBuffer(){return this.view.buffer.slice(this.view.byteOffset,this.view.byteOffset+this.view.byteLength)}toBlob(){return new Blob([new Uint8Array(this.view.buffer,this.view.byteOffset,this.view.byteLength)],{type:this.mimeType})}toFontFace(r){return new FontFace(r,this.view.buffer)}}var eu=Object.defineProperty,De=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&eu(r,e,i),i};const Ie=class sl extends pi{constructor(){super(...arguments);u(this,"format","EmbeddedOpenType");u(this,"mimeType","application/vnd.ms-fontobject")}static from(e){const t=e.sfnt,s=t.name.names,o=di(s.fontFamily||""),a=o.length,l=di(s.fontStyle||""),h=l.length,c=di(s.version||""),f=c.length,p=di(s.fullName||""),d=p.length,m=86+a+4+h+4+f+4+d+2+e.view.byteLength,v=new sl(new ArrayBuffer(m),0,m,!0);v.EOTSize=v.view.byteLength,v.FontDataSize=e.view.byteLength,v.Version=131073,v.Flags=0,v.Charset=1,v.MagicNumber=20556,v.Padding1=0,v.CheckSumAdjustment=t.head.checkSumAdjustment;const y=t.os2;return y&&(v.FontPANOSE=y.fontPANOSE,v.Italic=y.fsSelection,v.Weight=y.usWeightClass,v.fsType=y.fsType,v.UnicodeRange=y.ulUnicodeRange,v.CodePageRange=y.ulCodePageRange),v.view.writeUint16(a),v.view.writeBytes(o),v.view.writeUint16(0),v.view.writeUint16(h),v.view.writeBytes(l),v.view.writeUint16(0),v.view.writeUint16(f),v.view.writeBytes(c),v.view.writeUint16(0),v.view.writeUint16(d),v.view.writeBytes(p),v.view.writeUint16(0),v.view.writeUint16(0),v.view.writeBytes(e.view),v}};De([_("uint32")],Ie.prototype,"EOTSize"),De([_("uint32")],Ie.prototype,"FontDataSize"),De([_("uint32")],Ie.prototype,"Version"),De([_("uint32")],Ie.prototype,"Flags"),De([_({type:"uint8",size:10})],Ie.prototype,"FontPANOSE"),De([_("uint8")],Ie.prototype,"Charset"),De([_("uint8")],Ie.prototype,"Italic"),De([_("uint32")],Ie.prototype,"Weight"),De([_("uint16")],Ie.prototype,"fsType"),De([_("uint16")],Ie.prototype,"MagicNumber"),De([_({type:"uint8",size:16})],Ie.prototype,"UnicodeRange"),De([_({type:"uint8",size:8})],Ie.prototype,"CodePageRange"),De([_("uint32")],Ie.prototype,"CheckSumAdjustment"),De([_({type:"uint8",size:16})],Ie.prototype,"Reserved"),De([_("uint16")],Ie.prototype,"Padding1");var tu=Object.defineProperty,gi=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&tu(r,e,i),i};class or extends je{constructor(r,e){super(r,e,16)}}gi([_({type:"char",size:4})],or.prototype,"tag"),gi([_("uint32")],or.prototype,"checkSum"),gi([_("uint32")],or.prototype,"offset"),gi([_("uint32")],or.prototype,"length");const Us=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],ru=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];class Ds{constructor(r){u(this,"index");u(this,"name");u(this,"isComposite",!1);u(this,"components",[]);u(this,"pathCommands",[]);const e={...r};if(this.index=e.index??0,e.name===".notdef"?e.unicode=void 0:e.name===".null"&&(e.unicode=0),e.unicode===0&&e.name!==".null")throw new Error('The unicode value "0" is reserved for the glyph name ".null" and cannot be used by any other glyph.');this.name=e.name??null,e.unicode&&(this.unicode=e.unicode),e.unicodes?this.unicodes=e.unicodes:e.unicode&&(this.unicodes=[e.unicode])}getPathCommands(r=0,e=0,t=72,i={},s){const o=1/((s==null?void 0:s.unitsPerEm)??1e3)*t,{xScale:a=o,yScale:l=o}=i,h=this.pathCommands,c=[];for(let f=0,p=h.length;f<p;f+=1){const d=h[f];d.type==="M"?c.push({type:"M",x:r+d.x*a,y:e+-d.y*l}):d.type==="L"?c.push({type:"L",x:r+d.x*a,y:e+-d.y*l}):d.type==="Q"?c.push({type:"Q",x1:r+d.x1*a,y1:e+-d.y1*l,x:r+d.x*a,y:e+-d.y*l}):d.type==="C"?c.push({type:"C",x1:r+d.x1*a,y1:e+-d.y1*l,x2:r+d.x2*a,y2:e+-d.y2*l,x:r+d.x*a,y:e+-d.y*l}):d.type==="Z"&&c.push({type:"Z"})}return c}}class iu extends Ds{parse(r,e,t){const i=this,{nominalWidthX:s,defaultWidthX:o,gsubrsBias:a,subrsBias:l}=r,h=r.topDict.paintType,c=this.index;let f,p,d,m;const v=[],y=[];let S=0,C=!1,x=!1,T=o,b=0,P=0;function E(M,N){v.push({type:"L",x:M,y:N})}function w(M,N,q,R,I,j){v.push({type:"C",x1:M,y1:N,x2:q,y2:R,x:I,y:j})}function D(M,N){x&&h!==2&&F(),x=!0,v.push({type:"M",x:M,y:N})}function F(){v.push({type:"Z"})}function B(M){v.push(...M)}function U(){y.length%2!==0&&!C&&(T=y.shift()+s),S+=y.length>>1,y.length=0,C=!0}function V(M){let N,q,R,I,j,k,L,K,X,W,G,Q,Z=0;for(;Z<M.length;){let ae=M[Z++];switch(ae){case 1:U();break;case 3:U();break;case 4:y.length>1&&!C&&(T=y.shift()+s,C=!0),P+=y.pop(),D(b,P);break;case 5:for(;y.length>0;)b+=y.shift(),P+=y.shift(),E(b,P);break;case 6:for(;y.length>0&&(b+=y.shift(),E(b,P),y.length!==0);)P+=y.shift(),E(b,P);break;case 7:for(;y.length>0&&(P+=y.shift(),E(b,P),y.length!==0);)b+=y.shift(),E(b,P);break;case 8:for(;y.length>0;)f=b+y.shift(),p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),b=d+y.shift(),P=m+y.shift(),w(f,p,d,m,b,P);break;case 10:j=y.pop()+l,k=r.subrs[j],k&&V(k);break;case 11:return;case 12:switch(ae=M[Z],Z+=1,ae){case 35:f=b+y.shift(),p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),L=d+y.shift(),K=m+y.shift(),X=L+y.shift(),W=K+y.shift(),G=X+y.shift(),Q=W+y.shift(),b=G+y.shift(),P=Q+y.shift(),y.shift(),w(f,p,d,m,L,K),w(X,W,G,Q,b,P);break;case 34:f=b+y.shift(),p=P,d=f+y.shift(),m=p+y.shift(),L=d+y.shift(),K=m,X=L+y.shift(),W=m,G=X+y.shift(),Q=P,b=G+y.shift(),w(f,p,d,m,L,K),w(X,W,G,Q,b,P);break;case 36:f=b+y.shift(),p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),L=d+y.shift(),K=m,X=L+y.shift(),W=m,G=X+y.shift(),Q=W+y.shift(),b=G+y.shift(),w(f,p,d,m,L,K),w(X,W,G,Q,b,P);break;case 37:f=b+y.shift(),p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),L=d+y.shift(),K=m+y.shift(),X=L+y.shift(),W=K+y.shift(),G=X+y.shift(),Q=W+y.shift(),Math.abs(G-b)>Math.abs(Q-P)?b=G+y.shift():P=Q+y.shift(),w(f,p,d,m,L,K),w(X,W,G,Q,b,P);break;default:console.warn(`Glyph ${c}: unknown operator ${1200+ae}`),y.length=0}break;case 14:if(y.length>=4){const ut=Us[y.pop()],Ze=Us[y.pop()],Le=y.pop(),Fe=y.pop();if(ut&&Ze){i.isComposite=!0,i.components=[];const Ce=r.charset.indexOf(ut),$e=r.charset.indexOf(Ze);i.components.push({glyphIndex:$e,dx:0,dy:0}),i.components.push({glyphIndex:Ce,dx:Fe,dy:Le}),B(t.get($e).pathCommands);const tt=JSON.parse(JSON.stringify(t.get(Ce).pathCommands));for(let rt=0;rt<tt.length;rt+=1){const Ke=tt[rt];Ke.type!=="Z"&&(Ke.x+=Fe,Ke.y+=Le),(Ke.type==="Q"||Ke.type==="C")&&(Ke.x1+=Fe,Ke.y1+=Le),Ke.type==="C"&&(Ke.x2+=Fe,Ke.y2+=Le)}B(tt)}}else y.length>0&&!C&&(T=y.shift()+s,C=!0);x&&h!==2&&(F(),x=!1);break;case 18:U();break;case 19:case 20:U(),Z+=S+7>>3;break;case 21:y.length>2&&!C&&(T=y.shift()+s,C=!0),P+=y.pop(),b+=y.pop(),D(b,P);break;case 22:y.length>1&&!C&&(T=y.shift()+s,C=!0),b+=y.pop(),D(b,P);break;case 23:U();break;case 24:for(;y.length>2;)f=b+y.shift(),p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),b=d+y.shift(),P=m+y.shift(),w(f,p,d,m,b,P);b+=y.shift(),P+=y.shift(),E(b,P);break;case 25:for(;y.length>6;)b+=y.shift(),P+=y.shift(),E(b,P);f=b+y.shift(),p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),b=d+y.shift(),P=m+y.shift(),w(f,p,d,m,b,P);break;case 26:for(y.length%2&&(b+=y.shift());y.length>0;)f=b,p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),b=d,P=m+y.shift(),w(f,p,d,m,b,P);break;case 27:for(y.length%2&&(P+=y.shift());y.length>0;)f=b+y.shift(),p=P,d=f+y.shift(),m=p+y.shift(),b=d+y.shift(),P=m,w(f,p,d,m,b,P);break;case 28:N=M[Z],q=M[Z+1],y.push((N<<24|q<<16)>>16),Z+=2;break;case 29:j=y.pop()+a,k=r.gsubrs[j],k&&V(k);break;case 30:for(;y.length>0&&(f=b,p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),b=d+y.shift(),P=m+(y.length===1?y.shift():0),w(f,p,d,m,b,P),y.length!==0);)f=b+y.shift(),p=P,d=f+y.shift(),m=p+y.shift(),P=m+y.shift(),b=d+(y.length===1?y.shift():0),w(f,p,d,m,b,P);break;case 31:for(;y.length>0&&(f=b+y.shift(),p=P,d=f+y.shift(),m=p+y.shift(),P=m+y.shift(),b=d+(y.length===1?y.shift():0),w(f,p,d,m,b,P),y.length!==0);)f=b,p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),b=d+y.shift(),P=m+(y.length===1?y.shift():0),w(f,p,d,m,b,P);break;default:ae<32?console.warn(`Glyph ${c}: unknown operator ${ae}`):ae<247?y.push(ae-139):ae<251?(N=M[Z],Z+=1,y.push((ae-247)*256+N+108)):ae<255?(N=M[Z],Z+=1,y.push(-(ae-251)*256-N-108)):(N=M[Z],q=M[Z+1],R=M[Z+2],I=M[Z+3],Z+=4,y.push((N<<24|q<<16|R<<8|I)/65536))}}}V(e),this.pathCommands=v,C&&(this.advanceWidth=T)}}class Is{constructor(r){u(this,"_items",[]);this._sfnt=r}get(r){const e=this._items[r];let t;if(e)t=e;else{t=this._get(r);const i=this._sfnt.hmtx.metrics[r];i&&(t.advanceWidth=t.advanceWidth||i.advanceWidth,t.leftSideBearing=t.leftSideBearing||i.leftSideBearing);const s=this._sfnt.cmap.glyphIndexToUnicodesMap.get(r);s&&(t.unicode??(t.unicode=s[0]),t.unicodes??(t.unicodes=s)),this._items[r]=t}return t}}class su extends Is{get length(){return this._sfnt.cff.charStringsIndex.offsets.length-1}_get(r){const e=this._sfnt.cff,t=new iu({index:r});return t.parse(e,e.charStringsIndex.get(r),this),t.name=e.charset[r],t}}var nu=Object.defineProperty,ta=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&nu(r,e,i),i};class mi extends je{constructor(e,t,i,s){super(e,t,i,s);u(this,"_offsets");u(this,"_objects");this._init()}get offsets(){return this._offsets??(this._offsets=this.readOffsets())}get objects(){return this._objects??(this._objects=this.readObjects())}_init(){const e=this.view,t=this.count,i=this.offsetSize;this.objectOffset=(t+1)*i+2,this.endOffset=e.byteOffset+this.objectOffset+this.offsets[t]}readOffsets(){const e=this.view,t=this.count,i=this.offsetSize;e.seek(3);const s=[];for(let o=0,a=t+1;o<a;o++){const l=this.view;let h=0;for(let c=0;c<i;c++)h<<=8,h+=l.readUint8();s.push(h)}return s}readObjects(){const e=[];for(let t=0,i=this.count;t<i;t++)e.push(this.get(t));return e}get(e){const t=this.offsets,i=this.objectOffset,s=i+t[e],a=i+t[e+1]-s;return this._isString?this.view.readString(s,a):this.view.readBytes(s,a)}}ta([_("uint16")],mi.prototype,"count"),ta([_("uint8")],mi.prototype,"offsetSize");class yi extends mi{constructor(){super(...arguments);u(this,"_isString",!1)}}class ra extends mi{constructor(){super(...arguments);u(this,"_isString",!0)}}const ou=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],au=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"],lu=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],hu=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"];function vi(n,r){return r<=390?ou[r]:n[r-391]}function ie(n,r="number",e){return(t,i)=>{if(typeof i!="string")return;const s={type:r,operator:n,default:e??r==="number"?0:void 0};Object.defineProperty(t.constructor.prototype,i,{get(){return this._getProp(s)},set(o){this._setProp(s,o)},configurable:!0,enumerable:!0})}}class ia extends je{constructor(){super(...arguments);u(this,"_dict");u(this,"_stringIndex")}get dict(){return this._dict??(this._dict=this._readDict())}setStringIndex(e){return this._stringIndex=e,this}_readFloatOperand(){const e=this.view;let t="";const i=15,s=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const o=e.readUint8(),a=o>>4,l=o&15;if(a===i||(t+=s[a],l===i))break;t+=s[l]}return Number.parseFloat(t)}_readOperand(e){const t=this.view;let i,s,o,a;if(e===28)return i=t.readUint8(),s=t.readUint8(),i<<8|s;if(e===29)return i=t.readUint8(),s=t.readUint8(),o=t.readUint8(),a=t.readUint8(),i<<24|s<<16|o<<8|a;if(e===30)return this._readFloatOperand();if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return i=t.readUint8(),(e-247)*256+i+108;if(e>=251&&e<=254)return i=t.readUint8(),-(e-251)*256-i-108;throw new Error(`invalid b0 ${e}, at: ${t.cursor}`)}_readDict(){const e=this.view;e.seek(0);let t=[];const i=e.cursor+e.byteLength,s={};for(;e.cursor<i;){let o=e.readUint8();o<=21?(o===12&&(o=1200+e.readUint8()),s[o]=t,t=[]):t.push(this._readOperand(o))}return s}_getProp(e){var i;const t=this.dict[e.operator]??e.default;switch(e.type){case"number":return t[0];case"string":return vi(((i=this._stringIndex)==null?void 0:i.objects)??[],t[0]);case"number[]":return t}return t}_setProp(e,t){}}var cu=Object.defineProperty,Rs=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&cu(r,e,i),i};class _i extends ia{}Rs([ie(19)],_i.prototype,"subrs"),Rs([ie(20)],_i.prototype,"defaultWidthX"),Rs([ie(21)],_i.prototype,"nominalWidthX");var uu=Object.defineProperty,ce=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&uu(r,e,i),i};class oe extends ia{}ce([ie(0,"string")],oe.prototype,"version"),ce([ie(1,"string")],oe.prototype,"notice"),ce([ie(1200,"string")],oe.prototype,"copyright"),ce([ie(2,"string")],oe.prototype,"fullName"),ce([ie(3,"string")],oe.prototype,"familyName"),ce([ie(4,"string")],oe.prototype,"weight"),ce([ie(1201)],oe.prototype,"isFixedPitch"),ce([ie(1202)],oe.prototype,"italicAngle"),ce([ie(1203,"number",-100)],oe.prototype,"underlinePosition"),ce([ie(1204,"number",50)],oe.prototype,"underlineThickness"),ce([ie(1205)],oe.prototype,"paintType"),ce([ie(1206,"number",2)],oe.prototype,"charstringType"),ce([ie(1207,"number[]",[.001,0,0,.001,0,0])],oe.prototype,"fontMatrix"),ce([ie(13)],oe.prototype,"uniqueId"),ce([ie(5,"number[]",[0,0,0,0])],oe.prototype,"fontBBox"),ce([ie(1208)],oe.prototype,"strokeWidth"),ce([ie(14)],oe.prototype,"xuid"),ce([ie(15)],oe.prototype,"charset"),ce([ie(16)],oe.prototype,"encoding"),ce([ie(17)],oe.prototype,"charStrings"),ce([ie(18,"number[]",[0,0])],oe.prototype,"private");function we(n,r=n){return e=>{Ft.tableDefinitions.set(n,{tag:n,prop:r,class:e}),Object.defineProperty(Ft.prototype,r,{get(){return this.get(n)},set(t){return this.set(n,t)},configurable:!0,enumerable:!0})}}const Zt=class Zt{constructor(r){u(this,"tables",new Map);u(this,"tableViews",new Map);(r instanceof Map?r:new Map(Object.entries(r))).forEach((t,i)=>{this.tableViews.set(i,new DataView(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)))})}get hasGlyf(){return this.tableViews.has("glyf")}get names(){return this.name.names}get unitsPerEm(){return this.head.unitsPerEm}get ascender(){return this.hhea.ascent}get descender(){return this.hhea.descent}get createdTimestamp(){return this.head.created}get modifiedTimestamp(){return this.head.modified}get glyphs(){return this.hasGlyf?this.glyf.glyphs:this.cff.glyphs}charToGlyphIndex(r){let e=this.cmap.unicodeToGlyphIndexMap.get(r.codePointAt(0));if(e===void 0&&!this.hasGlyf){const{encoding:t,charset:i}=this.cff;e=i.indexOf(t[r.codePointAt(0)])}return e??0}charToGlyph(r){return this.glyphs.get(this.charToGlyphIndex(r))}textToGlyphIndexes(r){const e=[];for(const t of r)e.push(this.charToGlyphIndex(t));return e}textToGlyphs(r){const e=this.glyphs,t=this.textToGlyphIndexes(r),i=t.length,s=Array.from({length:i}),o=e.get(0);for(let a=0;a<i;a+=1)s[a]=e.get(t[a])||o;return s}getPathCommands(r,e,t,i,s){const o=[];return this.forEachGlyph(r,e,t,i,s,(a,l,h,c,f)=>{o.push(...a.getPathCommands(l,h,c,f,this))}),o}getAdvanceWidth(r,e,t){return this.forEachGlyph(r,0,0,e,t,()=>{})}forEachGlyph(r,e=0,t=0,i=72,s={},o){const a=1/this.unitsPerEm*i,l=this.textToGlyphs(r);for(let h=0;h<l.length;h+=1){const c=l[h];o.call(this,c,e,t,i,s),c.advanceWidth&&(e+=c.advanceWidth*a),s.letterSpacing?e+=s.letterSpacing*i:s.tracking&&(e+=s.tracking/1e3*i)}return e}clone(){return new Zt(this.tableViews)}delete(r){const e=Zt.tableDefinitions.get(r);return e?(this.tableViews.delete(r),this.tables.delete(e.prop),this):this}set(r,e){const t=Zt.tableDefinitions.get(r);return t&&this.tables.set(t.prop,e),this.tableViews.set(r,e.view),this}get(r){const e=Zt.tableDefinitions.get(r);if(!e)return;let t=this.tables.get(e.prop);if(!t){const i=e.class;if(i){const s=this.tableViews.get(r);if(!s)return;t=new i(s.buffer,s.byteOffset,s.byteLength).setSfnt(this),this.tables.set(e.prop,t)}}return t}};u(Zt,"tableDefinitions",new Map);let Ft=Zt;class Ae extends je{setSfnt(r){return this._sfnt=r,this}getSfnt(){return this._sfnt}}var fu=Object.defineProperty,du=Object.getOwnPropertyDescriptor,Dr=(n,r,e,t)=>{for(var i=t>1?void 0:t?du(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&fu(r,e,i),i};let $t=class extends Ae{constructor(r,e,t,i){super(r,e,t,i);u(this,"_glyphs");u(this,"privateDict");u(this,"subrsIndex");this._init()}get glyphs(){return this._glyphs??(this._glyphs=new su(this._sfnt))}get gsubrs(){return this.globalSubrIndex.objects}get gsubrsBias(){return this._calcSubroutineBias(this.globalSubrIndex.objects)}get defaultWidthX(){var r;return((r=this.privateDict)==null?void 0:r.defaultWidthX)??0}get nominalWidthX(){var r;return((r=this.privateDict)==null?void 0:r.nominalWidthX)??0}get subrs(){var r;return((r=this.subrsIndex)==null?void 0:r.objects)??[]}get subrsBias(){return this._calcSubroutineBias(this.subrs)}_init(){const r=this.view,{buffer:e,byteOffset:t}=r,i=t+4;this.nameIndex=new ra(e,i),this.topDictIndex=new yi(e,this.nameIndex.endOffset),this.stringIndex=new ra(e,this.topDictIndex.endOffset),this.globalSubrIndex=new yi(e,this.stringIndex.endOffset),this.topDict=new oe(new Uint8Array(this.topDictIndex.objects[0]).buffer).setStringIndex(this.stringIndex);const s=this.topDict.private[0],o=this.topDict.private[1];s&&(this.privateDict=new _i(e,t+o,s).setStringIndex(this.stringIndex),this.privateDict.subrs&&(this.subrsIndex=new yi(e,t+o+this.privateDict.subrs))),this.charStringsIndex=new yi(e,t+this.topDict.charStrings);const a=this.charStringsIndex.offsets.length-1;this.topDict.charset===0?this.charset=au:this.topDict.charset===1?this.charset=lu:this.topDict.charset===2?this.charset=hu:this.charset=this._readCharset(t+this.topDict.charset,a,this.stringIndex.objects),this.topDict.encoding===0?this.encoding=Us:this.topDict.encoding===1?this.encoding=ru:this.encoding=this._readEncoding(t+this.topDict.encoding)}_readCharset(r,e,t){const i=this.view;i.seek(r);let s,o,a;e-=1;const l=[".notdef"],h=i.readUint8();if(h===0)for(s=0;s<e;s+=1)o=i.readUint16(),l.push(vi(t,o));else if(h===1)for(;l.length<=e;)for(o=i.readUint16(),a=i.readUint8(),s=0;s<=a;s+=1)l.push(vi(t,o)),o+=1;else if(h===2)for(;l.length<=e;)for(o=i.readUint16(),a=i.readUint16(),s=0;s<=a;s+=1)l.push(vi(t,o)),o+=1;else throw new Error(`Unknown charset format ${h}`);return l}_readEncoding(r){const e=this.view;e.seek(r);let t,i;const s={},o=e.readUint8();if(o===0){const a=e.readUint8();for(t=0;t<a;t+=1)i=e.readUint8(),s[i]=t}else if(o===1){const a=e.readUint8();for(i=1,t=0;t<a;t+=1){const l=e.readUint8(),h=e.readUint8();for(let c=l;c<=l+h;c+=1)s[c]=i,i+=1}}else console.warn(`unknown encoding format:${o}`);return s}_calcSubroutineBias(r){let e;return r.length<1240?e=107:r.length<33900?e=1131:e=32768,e}};Dr([_("uint8")],$t.prototype,"majorVersion",2),Dr([_("uint8")],$t.prototype,"minorVersion",2),Dr([_("uint8")],$t.prototype,"headerSize",2),Dr([_("uint8")],$t.prototype,"offsetSize",2),$t=Dr([we("CFF ","cff")],$t);var pu=Object.defineProperty,bi=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&pu(r,e,i),i};const Ir=class nl extends je{constructor(r=new ArrayBuffer(262),e){super(r,e,262)}static from(r){const e=new nl;return e.format=0,e.length=e.view.byteLength,e.language=0,r.forEach((t,i)=>{i<256&&t<256&&e.view.writeUint8(t,6+i)}),e}getUnicodeToGlyphIndexMap(){const r=new Map;return this.glyphIndexArray.forEach((e,t)=>{r.set(t,e)}),r}};bi([_("uint16")],Ir.prototype,"format"),bi([_("uint16")],Ir.prototype,"length"),bi([_("uint16")],Ir.prototype,"language"),bi([_({type:"uint8",size:256})],Ir.prototype,"glyphIndexArray");let Bs=Ir;var gu=Object.defineProperty,Ls=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&gu(r,e,i),i};class Rr extends je{get subHeaderKeys(){return this.view.seek(6),Array.from({length:256},()=>this.view.readUint16()/8)}get maxSubHeaderKey(){return this.subHeaderKeys.reduce((r,e)=>Math.max(r,e),0)}get subHeaders(){const r=this.maxSubHeaderKey;return this.view.seek(6+256*2),Array.from({length:r},(e,t)=>({firstCode:this.view.readUint16(),entryCount:this.view.readUint16(),idDelta:this.view.readUint16(),idRangeOffset:(this.view.readUint16()-(r-t)*8-2)/2}))}get glyphIndexArray(){const r=this.maxSubHeaderKey,e=6+256*2+r*8;this.view.seek(e);const t=(this.view.byteLength-e)/2;return Array.from({length:t},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(r){const e=new Map,t=this.subHeaderKeys,i=this.maxSubHeaderKey,s=this.subHeaders,o=this.glyphIndexArray,a=t.findIndex(h=>h===i);let l=0;for(let h=0;h<256;h++)if(t[h]===0)h>=a||h<s[0].firstCode||h>=s[0].firstCode+s[0].entryCount||s[0].idRangeOffset+(h-s[0].firstCode)>=o.length?l=0:(l=o[s[0].idRangeOffset+(h-s[0].firstCode)],l!==0&&(l=l+s[0].idDelta)),l!==0&&l<r&&e.set(h,l);else{const c=t[h];for(let f=0,p=s[c].entryCount;f<p;f++)if(s[c].idRangeOffset+f>=o.length?l=0:(l=o[s[c].idRangeOffset+f],l!==0&&(l=l+s[c].idDelta)),l!==0&&l<r){const d=(h<<8|f+s[c].firstCode)%65535;e.set(d,l)}}return e}}Ls([_("uint16")],Rr.prototype,"format"),Ls([_("uint16")],Rr.prototype,"length"),Ls([_("uint16")],Rr.prototype,"language");function sa(n){return n>32767?n-65536:n<-32767?n+65536:n}function ks(n,r){let e;const t=[];let i={};return n.forEach((s,o)=>{r&&o>r||((!e||o!==e.unicode+1||s!==e.glyphIndex+1)&&(e?(i.end=e.unicode,t.push(i),i={start:o,startId:s,delta:sa(s-o)}):(i.start=Number(o),i.startId=s,i.delta=sa(s-o))),e={unicode:o,glyphIndex:s})}),e&&(i.end=e.unicode,t.push(i)),t}var mu=Object.defineProperty,zt=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&mu(r,e,i),i};const Mt=class ol extends je{get endCode(){const r=this.segCountX2;return this.view.seek(14),Array.from({length:r/2},()=>this.view.readUint16())}set endCode(r){this.view.seek(14),r.forEach(e=>this.view.writeUint16(e))}get reservedPad(){return this.view.readUint16(14+this.segCountX2)}set reservedPad(r){this.view.writeUint16(r,14+this.segCountX2)}get startCode(){const r=this.segCountX2;return this.view.seek(14+r+2),Array.from({length:r/2},()=>this.view.readUint16())}set startCode(r){this.view.seek(14+this.segCountX2+2),r.forEach(e=>this.view.writeUint16(e))}get idDelta(){const r=this.segCountX2;return this.view.seek(14+r+2+r),Array.from({length:r/2},()=>this.view.readUint16())}set idDelta(r){const e=this.segCountX2;this.view.seek(14+e+2+e),r.forEach(t=>this.view.writeUint16(t))}get idRangeOffsetCursor(){const r=this.segCountX2;return 14+r+2+r*2}get idRangeOffset(){const r=this.segCountX2;return this.view.seek(this.idRangeOffsetCursor),Array.from({length:r/2},()=>this.view.readUint16())}set idRangeOffset(r){this.view.seek(this.idRangeOffsetCursor),r.forEach(e=>this.view.writeUint16(e))}get glyphIndexArrayCursor(){const r=this.segCountX2;return 14+r+2+r*3}get glyphIndexArray(){const r=this.glyphIndexArrayCursor;this.view.seek(r);const e=(this.view.byteLength-r)/2;return Array.from({length:e},()=>this.view.readUint16())}static from(r){const e=ks(r,65535),t=e.length+1,i=Math.floor(Math.log(t)/Math.LN2),s=2*2**i,o=new ol(new ArrayBuffer(24+e.length*8));return o.format=4,o.length=o.view.byteLength,o.language=0,o.segCountX2=t*2,o.searchRange=s,o.entrySelector=i,o.rangeShift=2*t-s,o.endCode=[...e.map(a=>a.end),65535],o.reservedPad=0,o.startCode=[...e.map(a=>a.start),65535],o.idDelta=[...e.map(a=>a.delta),1],o.idRangeOffset=Array.from({length:t},()=>0),o}getUnicodeToGlyphIndexMap(){const r=new Map,e=this.segCountX2/2,t=(this.glyphIndexArrayCursor-this.idRangeOffsetCursor)/2,i=this.startCode,s=this.endCode,o=this.idRangeOffset,a=this.idDelta,l=this.glyphIndexArray;for(let h=0;h<e;++h)for(let c=i[h],f=s[h];c<=f;++c)if(o[h]===0)r.set(c,(c+a[h])%65536);else{const p=h+o[h]/2+(c-i[h])-t,d=l[p];d!==0?r.set(c,(d+a[h])%65536):r.set(c,0)}return r.delete(65535),r}};zt([_("uint16")],Mt.prototype,"format"),zt([_("uint16")],Mt.prototype,"length"),zt([_("uint16")],Mt.prototype,"language"),zt([_("uint16")],Mt.prototype,"segCountX2"),zt([_("uint16")],Mt.prototype,"searchRange"),zt([_("uint16")],Mt.prototype,"entrySelector"),zt([_("uint16")],Mt.prototype,"rangeShift");let Ns=Mt;var yu=Object.defineProperty,Br=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&yu(r,e,i),i};class Vt extends je{get glyphIndexArray(){return this.view.seek(12),Array.from({length:this.entryCount},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(){const r=this.glyphIndexArray,e=new Map;return r.forEach((t,i)=>{e.set(i,t)}),e}}Br([_("uint16")],Vt.prototype,"format"),Br([_("uint16")],Vt.prototype,"length"),Br([_("uint16")],Vt.prototype,"language"),Br([_("uint16")],Vt.prototype,"firstCode"),Br([_("uint16")],Vt.prototype,"entryCount");var vu=Object.defineProperty,Lr=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&vu(r,e,i),i};const ar=class al extends je{get groups(){const r=this.nGroups;return this.view.seek(16),Array.from({length:r},()=>({startCharCode:this.view.readUint32(),endCharCode:this.view.readUint32(),startGlyphCode:this.view.readUint32()}))}static from(r){const e=ks(r),t=new al(new ArrayBuffer(16+e.length*12));return t.format=12,t.reserved=0,t.length=t.view.byteLength,t.language=0,t.nGroups=e.length,e.forEach(i=>{t.view.writeUint32(i.start),t.view.writeUint32(i.end),t.view.writeUint32(i.startId)}),t}getUnicodeToGlyphIndexMap(){const r=new Map,e=this.groups;for(let t=0,i=e.length;t<i;t++){const s=e[t];let o=s.startGlyphCode,a=s.startCharCode;const l=s.endCharCode;for(;a<=l;)r.set(a++,o++)}return r}};Lr([_("uint16")],ar.prototype,"format"),Lr([_("uint16")],ar.prototype,"reserved"),Lr([_("uint32")],ar.prototype,"length"),Lr([_("uint32")],ar.prototype,"language"),Lr([_("uint32")],ar.prototype,"nGroups");let Fs=ar;var _u=Object.defineProperty,$s=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&_u(r,e,i),i};class kr extends je{getVarSelectorRecords(){const r=this.numVarSelectorRecords;return this.view.seek(10),Array.from({length:r},()=>{const e={varSelector:this.view.readUint24(),defaultUVSOffset:this.view.readUint32(),unicodeValueRanges:[],nonDefaultUVSOffset:this.view.readUint32(),uVSMappings:[]};if(e.defaultUVSOffset){this.view.seek(e.defaultUVSOffset);const t=this.view.readUint32();e.unicodeValueRanges=Array.from({length:t},()=>({startUnicodeValue:this.view.readUint24(),additionalCount:this.view.readUint8()}))}if(e.nonDefaultUVSOffset){this.view.seek(e.nonDefaultUVSOffset);const t=this.view.readUint32();e.uVSMappings=Array.from({length:t},()=>({unicodeValue:this.view.readUint24(),glyphID:this.view.readUint16()}))}return e})}getUnicodeToGlyphIndexMap(){const r=new Map,e=this.getVarSelectorRecords();for(let t=0,i=e.length;t<i;t++){const{uVSMappings:s}=e[t];s.forEach(o=>{r.set(o.unicodeValue,o.glyphID)})}return r}}$s([_("uint16")],kr.prototype,"format"),$s([_("uint32")],kr.prototype,"length"),$s([_("uint32")],kr.prototype,"numVarSelectorRecords");var bu=Object.defineProperty,wu=Object.getOwnPropertyDescriptor,zs=(n,r,e,t)=>{for(var i=t>1?void 0:t?wu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&bu(r,e,i),i};let lr=class extends Ae{constructor(){super(...arguments);u(this,"_unicodeToGlyphIndexMap");u(this,"_glyphIndexToUnicodesMap")}static from(r){const e=Array.from(r.keys()).some(f=>f>65535),t=Ns.from(r),i=Bs.from(r),s=e?Fs.from(r):void 0,o=4+(s?32:24),a=o+t.view.byteLength,l=a+i.view.byteLength,h=[{platformID:0,platformSpecificID:3,offset:o},{platformID:1,platformSpecificID:0,offset:a},{platformID:3,platformSpecificID:1,offset:o},s&&{platformID:3,platformSpecificID:10,offset:l}].filter(Boolean),c=new lr(new ArrayBuffer(4+8*h.length+t.view.byteLength+i.view.byteLength+((s==null?void 0:s.view.byteLength)??0)));return c.numberSubtables=h.length,c.view.seek(4),h.forEach(f=>{c.view.writeUint16(f.platformID),c.view.writeUint16(f.platformSpecificID),c.view.writeUint32(f.offset)}),c.view.writeBytes(t.view,o),c.view.writeBytes(i.view,a),s&&c.view.writeBytes(s.view,l),c}get unicodeToGlyphIndexMap(){return this._unicodeToGlyphIndexMap??(this._unicodeToGlyphIndexMap=this.readunicodeToGlyphIndexMap())}get glyphIndexToUnicodesMap(){if(!this._glyphIndexToUnicodesMap){const r=new Map,e=this.unicodeToGlyphIndexMap,t=Array.from(e.keys());for(let i=0,s=t.length;i<s;i++){const o=t[i],a=e.get(o);r.has(a)?r.get(a).push(o):r.set(a,[o])}this._glyphIndexToUnicodesMap=r}return this._glyphIndexToUnicodesMap}readSubtables(){const r=this.numberSubtables;return this.view.seek(4),Array.from({length:r},()=>({platformID:this.view.readUint16(),platformSpecificID:this.view.readUint16(),offset:this.view.readUint32()})).map(e=>{this.view.seek(e.offset);const t=this.view.readUint16();let i;switch(t){case 0:i=new Bs(this.view.buffer,e.offset);break;case 2:i=new Rr(this.view.buffer,e.offset,this.view.readUint16());break;case 4:i=new Ns(this.view.buffer,e.offset,this.view.readUint16());break;case 6:i=new Vt(this.view.buffer,e.offset,this.view.readUint16());break;case 12:i=new Fs(this.view.buffer,e.offset,this.view.readUint32(e.offset+4));break;case 14:default:i=new kr(this.view.buffer,e.offset,this.view.readUint32());break}return{...e,format:t,view:i}})}readunicodeToGlyphIndexMap(){var a,l,h,c,f;const r=this.readSubtables(),e=(a=r.find(p=>p.format===0))==null?void 0:a.view,t=(l=r.find(p=>p.platformID===3&&p.platformSpecificID===3&&p.format===2))==null?void 0:l.view,i=(h=r.find(p=>p.platformID===3&&p.platformSpecificID===1&&p.format===4))==null?void 0:h.view,s=(c=r.find(p=>p.platformID===3&&p.platformSpecificID===10&&p.format===12))==null?void 0:c.view,o=(f=r.find(p=>p.platformID===0&&p.platformSpecificID===5&&p.format===14))==null?void 0:f.view;return new Map([...(e==null?void 0:e.getUnicodeToGlyphIndexMap())??[],...(t==null?void 0:t.getUnicodeToGlyphIndexMap(this._sfnt.maxp.numGlyphs))??[],...(i==null?void 0:i.getUnicodeToGlyphIndexMap())??[],...(s==null?void 0:s.getUnicodeToGlyphIndexMap())??[],...(o==null?void 0:o.getUnicodeToGlyphIndexMap())??[]])}};zs([_("uint16")],lr.prototype,"version",2),zs([_("uint16")],lr.prototype,"numberSubtables",2),lr=zs([we("cmap")],lr);class xu extends Ds{_parseContours(r){const e=[];let t=[];for(let i=0;i<r.length;i+=1){const s=r[i];t.push(s),s.lastPointOfContour&&(e.push(t),t=[])}return Or(t.length===0,"There are still points left in the current contour."),e}_transformPoints(r,e){const t=[];for(let i=0;i<r.length;i+=1){const s=r[i],o={x:e.xScale*s.x+e.scale10*s.y+e.dx,y:e.scale01*s.x+e.yScale*s.y+e.dy,onCurve:s.onCurve,lastPointOfContour:s.lastPointOfContour};t.push(o)}return t}_parseGlyphCoordinate(r,e,t,i,s){let o;return(e&i)>0?(o=r.view.readUint8(),e&s||(o=-o),o=t+o):(e&s)>0?o=t:o=t+r.view.readInt16(),o}parse(r,e,t){r.view.seek(e);const i=this.numberOfContours=r.view.readInt16();if(this.xMin=r.view.readInt16(),this.yMin=r.view.readInt16(),this.xMax=r.view.readInt16(),this.yMax=r.view.readInt16(),i>0){const a=this.endPointIndices=[];for(let v=0;v<i;v++)a.push(r.view.readUint16());const l=this.instructionLength=r.view.readUint16();Or(l<5e3,`Bad instructionLength:${l}`);const h=this.instructions=[];for(let v=0;v<l;++v)h.push(r.view.readUint8());const c=r.view.byteOffset,f=a[a.length-1]+1;Or(f<2e4,`Bad numberOfCoordinates:${c}`);const p=[];let d,m=0;for(;m<f;)if(d=r.view.readUint8(),p.push(d),m++,d&8&&m<f){const v=r.view.readUint8();for(let y=0;y<v;y++)p.push(d),m++}if(Or(p.length===f,`Bad flags length: ${p.length}, numberOfCoordinates: ${f}`),a.length>0){const v=[];let y;if(f>0){for(let x=0;x<f;x+=1)d=p[x],y={},y.onCurve=!!(d&1),y.lastPointOfContour=a.includes(x),v.push(y);let S=0;for(let x=0;x<f;x+=1)d=p[x],y=v[x],y.x=this._parseGlyphCoordinate(r,d,S,2,16),S=y.x;let C=0;for(let x=0;x<f;x+=1)d=p[x],y=v[x],y.y=this._parseGlyphCoordinate(r,d,C,4,32),C=y.y}this.points=v}else this.points=[]}else if(i===0)this.points=[];else{this.isComposite=!0,this.points=[],this.components=[];let a,l=!0;for(;l;){a=r.view.readUint16();const h={glyphIndex:r.view.readUint16(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(a&1)>0?(a&2)>0?(h.dx=r.view.readInt16(),h.dy=r.view.readInt16()):h.matchedPoints=[r.view.readUint16(),r.view.readUint16()]:(a&2)>0?(h.dx=r.view.readInt8(),h.dy=r.view.readInt8()):h.matchedPoints=[r.view.readUint8(),r.view.readUint8()],(a&8)>0?h.xScale=h.yScale=r.view.readInt16()/16384:(a&64)>0?(h.xScale=r.view.readInt16()/16384,h.yScale=r.view.readInt16()/16384):(a&128)>0&&(h.xScale=r.view.readInt16()/16384,h.scale01=r.view.readInt16()/16384,h.scale10=r.view.readInt16()/16384,h.yScale=r.view.readInt16()/16384),this.components.push(h),l=!!(a&32)}if(a&256){this.instructionLength=r.view.readUint16(),this.instructions=[];for(let h=0;h<this.instructionLength;h+=1)this.instructions.push(r.view.readUint8())}}if(this.isComposite)for(let a=0;a<this.components.length;a+=1){const l=this.components[a],h=t.get(l.glyphIndex);if(h.getPathCommands(),h.points){let c;if(l.matchedPoints===void 0)c=this._transformPoints(h.points,l);else{Or(l.matchedPoints[0]>this.points.length-1||l.matchedPoints[1]>h.points.length-1,`Matched points out of range in ${this.name}`);const f=this.points[l.matchedPoints[0]];let p=h.points[l.matchedPoints[1]];const d={xScale:l.xScale,scale01:l.scale01,scale10:l.scale10,yScale:l.yScale,dx:0,dy:0};p=this._transformPoints([p],d)[0],d.dx=f.x-p.x,d.dy=f.y-p.y,c=this._transformPoints(h.points,d)}this.points=this.points.concat(c)}}const s=[],o=this._parseContours(this.points);for(let a=0,l=o.length;a<l;++a){const h=o[a];let c=h[h.length-1],f=h[0];c.onCurve?s.push({type:"M",x:c.x,y:c.y}):f.onCurve?s.push({type:"M",x:f.x,y:f.y}):s.push({type:"M",x:(c.x+f.x)*.5,y:(c.y+f.y)*.5});for(let p=0,d=h.length;p<d;++p)if(c=f,f=h[(p+1)%d],c.onCurve)s.push({type:"L",x:c.x,y:c.y});else{let m=f;f.onCurve||(m={x:(c.x+f.x)*.5,y:(c.y+f.y)*.5}),s.push({type:"Q",x1:c.x,y1:c.y,x:m.x,y:m.y})}s.push({type:"Z"})}this.pathCommands=s}}class Pu extends Is{get length(){return this._sfnt.loca.locations.length}_get(r){const e=this._sfnt.loca.locations,t=e[r],i=new xu({index:r});return t!==e[r+1]&&i.parse(this._sfnt.glyf,t,this),i}}var Cu=Object.defineProperty,Eu=Object.getOwnPropertyDescriptor,Tu=(n,r,e,t)=>{for(var i=t>1?void 0:t?Eu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Cu(r,e,i),i};let wi=class extends Ae{constructor(){super(...arguments);u(this,"_glyphs")}static from(r){const e=r.reduce((i,s)=>i+s.byteLength,0),t=new wi(new ArrayBuffer(e));return r.forEach(i=>{t.view.writeBytes(i)}),t}get glyphs(){return this._glyphs??(this._glyphs=new Pu(this._sfnt))}};wi=Tu([we("glyf")],wi);var Su=Object.defineProperty,Mu=Object.getOwnPropertyDescriptor,Au=(n,r,e,t)=>{for(var i=t>1?void 0:t?Mu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Su(r,e,i),i};let Vs=class extends Ae{};Vs=Au([we("GPOS","gpos")],Vs);var Ou=Object.defineProperty,Uu=Object.getOwnPropertyDescriptor,jt=(n,r,e,t)=>{for(var i=t>1?void 0:t?Uu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Ou(r,e,i),i};let vt=class extends Ae{};jt([_("uint16")],vt.prototype,"majorVersion",2),jt([_("uint16")],vt.prototype,"minorVersion",2),jt([_("uint16")],vt.prototype,"scriptListOffset",2),jt([_("uint16")],vt.prototype,"featureListOffset",2),jt([_("uint16")],vt.prototype,"lookupListOffset",2),jt([_("uint16")],vt.prototype,"featureVariationsOffset",2),vt=jt([we("GSUB","gsub")],vt);var Du=Object.defineProperty,Iu=Object.getOwnPropertyDescriptor,_e=(n,r,e,t)=>{for(var i=t>1?void 0:t?Iu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Du(r,e,i),i};let pe=class extends Ae{constructor(n=new ArrayBuffer(54),r){super(n,r,Math.min(54,n.byteLength-(r??0)))}};_e([_("fixed")],pe.prototype,"version",2),_e([_("fixed")],pe.prototype,"fontRevision",2),_e([_("uint32")],pe.prototype,"checkSumAdjustment",2),_e([_("uint32")],pe.prototype,"magickNumber",2),_e([_("uint16")],pe.prototype,"flags",2),_e([_("uint16")],pe.prototype,"unitsPerEm",2),_e([_({type:"longDateTime"})],pe.prototype,"created",2),_e([_({type:"longDateTime"})],pe.prototype,"modified",2),_e([_("int16")],pe.prototype,"xMin",2),_e([_("int16")],pe.prototype,"yMin",2),_e([_("int16")],pe.prototype,"xMax",2),_e([_("int16")],pe.prototype,"yMax",2),_e([_("uint16")],pe.prototype,"macStyle",2),_e([_("uint16")],pe.prototype,"lowestRecPPEM",2),_e([_("int16")],pe.prototype,"fontDirectionHint",2),_e([_("int16")],pe.prototype,"indexToLocFormat",2),_e([_("int16")],pe.prototype,"glyphDataFormat",2),pe=_e([we("head")],pe);var Ru=Object.defineProperty,Bu=Object.getOwnPropertyDescriptor,Re=(n,r,e,t)=>{for(var i=t>1?void 0:t?Bu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Ru(r,e,i),i};let xe=class extends Ae{constructor(n=new ArrayBuffer(36),r){super(n,r,Math.min(36,n.byteLength-(r??0)))}};Re([_("fixed")],xe.prototype,"version",2),Re([_("int16")],xe.prototype,"ascent",2),Re([_("int16")],xe.prototype,"descent",2),Re([_("int16")],xe.prototype,"lineGap",2),Re([_("uint16")],xe.prototype,"advanceWidthMax",2),Re([_("int16")],xe.prototype,"minLeftSideBearing",2),Re([_("int16")],xe.prototype,"minRightSideBearing",2),Re([_("int16")],xe.prototype,"xMaxExtent",2),Re([_("int16")],xe.prototype,"caretSlopeRise",2),Re([_("int16")],xe.prototype,"caretSlopeRun",2),Re([_("int16")],xe.prototype,"caretOffset",2),Re([_({type:"int16",size:4})],xe.prototype,"reserved",2),Re([_("int16")],xe.prototype,"metricDataFormat",2),Re([_("uint16")],xe.prototype,"numOfLongHorMetrics",2),xe=Re([we("hhea")],xe);var Lu=Object.defineProperty,ku=Object.getOwnPropertyDescriptor,Nu=(n,r,e,t)=>{for(var i=t>1?void 0:t?ku(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Lu(r,e,i),i};let xi=class extends Ae{constructor(){super(...arguments);u(this,"_metrics")}static from(r){const e=r.length*4,t=new xi(new ArrayBuffer(e));return r.forEach(i=>{t.view.writeUint16(i.advanceWidth),t.view.writeUint16(i.leftSideBearing)}),t}get metrics(){return this._metrics??(this._metrics=this.readMetrics())}readMetrics(){const r=this._sfnt.maxp.numGlyphs,e=this._sfnt.hhea.numOfLongHorMetrics;let t=0;const i=this.view;return i.seek(0),Array.from({length:r}).map((s,o)=>(o<e&&(t=i.readUint16()),{advanceWidth:t,leftSideBearing:i.readUint16()}))}};xi=Nu([we("hmtx")],xi);var Fu=Object.defineProperty,$u=Object.getOwnPropertyDescriptor,zu=(n,r,e,t)=>{for(var i=t>1?void 0:t?$u(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Fu(r,e,i),i};let js=class extends Ae{};js=zu([we("kern","kern")],js);var Vu=Object.defineProperty,ju=Object.getOwnPropertyDescriptor,Gu=(n,r,e,t)=>{for(var i=t>1?void 0:t?ju(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Vu(r,e,i),i};let Pi=class extends Ae{constructor(){super(...arguments);u(this,"_locations")}static from(r,e=1){const t=r.length*(e?4:2),i=new Pi(new ArrayBuffer(t));return r.forEach(s=>{e?i.view.writeUint32(s):i.view.writeUint16(s/2)}),i}get locations(){return this._locations??(this._locations=this.readLocations())}readLocations(){const r=this._sfnt.maxp.numGlyphs,e=this._sfnt.head.indexToLocFormat,t=this.view;return t.seek(0),Array.from({length:r}).map(()=>e?t.readUint32():t.readUint16()*2)}};Pi=Gu([we("loca")],Pi);var qu=Object.defineProperty,Wu=Object.getOwnPropertyDescriptor,Oe=(n,r,e,t)=>{for(var i=t>1?void 0:t?Wu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&qu(r,e,i),i};let be=class extends Ae{constructor(n=new ArrayBuffer(32),r){super(n,r,Math.min(32,n.byteLength-(r??0)))}};Oe([_("fixed")],be.prototype,"version",2),Oe([_("uint16")],be.prototype,"numGlyphs",2),Oe([_("uint16")],be.prototype,"maxPoints",2),Oe([_("uint16")],be.prototype,"maxContours",2),Oe([_("uint16")],be.prototype,"maxComponentPoints",2),Oe([_("uint16")],be.prototype,"maxComponentContours",2),Oe([_("uint16")],be.prototype,"maxZones",2),Oe([_("uint16")],be.prototype,"maxTwilightPoints",2),Oe([_("uint16")],be.prototype,"maxStorage",2),Oe([_("uint16")],be.prototype,"maxFunctionDefs",2),Oe([_("uint16")],be.prototype,"maxInstructionDefs",2),Oe([_("uint16")],be.prototype,"maxStackElements",2),Oe([_("uint16")],be.prototype,"maxSizeOfInstructions",2),Oe([_("uint16")],be.prototype,"maxComponentElements",2),Oe([_("uint16")],be.prototype,"maxComponentDepth",2),be=Oe([we("maxp")],be);var Xu=Object.defineProperty,Hu=Object.getOwnPropertyDescriptor,Ci=(n,r,e,t)=>{for(var i=t>1?void 0:t?Hu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Xu(r,e,i),i};const na={0:"copyright",1:"fontFamily",2:"fontSubFamily",3:"uniqueSubFamily",4:"fullName",5:"version",6:"postScriptName",7:"tradeMark",8:"manufacturer",9:"designer",10:"description",11:"urlOfFontVendor",12:"urlOfFontDesigner",13:"licence",14:"urlOfLicence",16:"preferredFamily",17:"preferredSubFamily",18:"compatibleFull",19:"sampleText"},Gs={Unicode:0,Macintosh:1,reserved:2,Microsoft:3},Yu={Default:0,"Version1.1":1,ISO10646:2,UnicodeBMP:3,UnicodenonBMP:4,UnicodeVariationSequences:5,FullUnicodecoverage:6},oa={Symbol:0,UCS2:1,ShiftJIS:2,PRC:3,BigFive:4,Johab:5,UCS4:6};let hr=class extends Ae{constructor(){super(...arguments);u(this,"_names")}get names(){return this._names??(this._names=this.readNames())}readNames(){const r=this.count;this.view.seek(6);const e=[];for(let l=0;l<r;++l)e.push({platform:this.view.readUint16(),encoding:this.view.readUint16(),language:this.view.readUint16(),nameId:this.view.readUint16(),length:this.view.readUint16(),offset:this.view.readUint16()});const t=this.stringOffset;for(let l=0;l<r;++l){const h=e[l];h.name=this.view.readBytes(t+h.offset,h.length)}let i=Gs.Macintosh,s=Yu.Default,o=0;e.some(l=>l.platform===Gs.Microsoft&&l.encoding===oa.UCS2&&l.language===1033)&&(i=Gs.Microsoft,s=oa.UCS2,o=1033);const a={};for(let l=0;l<r;++l){const h=e[l];h.platform===i&&h.encoding===s&&h.language===o&&na[h.nameId]&&(a[na[h.nameId]]=o===0?Kc(h.name):Jc(h.name))}return a}};Ci([_("uint16")],hr.prototype,"format",2),Ci([_("uint16")],hr.prototype,"count",2),Ci([_("uint16")],hr.prototype,"stringOffset",2),hr=Ci([we("name")],hr);var Zu=Object.defineProperty,Ku=Object.getOwnPropertyDescriptor,z=(n,r,e,t)=>{for(var i=t>1?void 0:t?Ku(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Zu(r,e,i),i};let $=class extends Ae{get fontPANOSE(){return[this.bFamilyType,this.bSerifStyle,this.bWeight,this.bProportion,this.bContrast,this.bStrokeVariation,this.bArmStyle,this.bLetterform,this.bMidline,this.bXHeight]}};z([_("uint16")],$.prototype,"version",2),z([_("int16")],$.prototype,"xAvgCharWidth",2),z([_("uint16")],$.prototype,"usWeightClass",2),z([_("uint16")],$.prototype,"usWidthClass",2),z([_("uint16")],$.prototype,"fsType",2),z([_("uint16")],$.prototype,"ySubscriptXSize",2),z([_("uint16")],$.prototype,"ySubscriptYSize",2),z([_("uint16")],$.prototype,"ySubscriptXOffset",2),z([_("uint16")],$.prototype,"ySubscriptYOffset",2),z([_("uint16")],$.prototype,"ySuperscriptXSize",2),z([_("uint16")],$.prototype,"ySuperscriptYSize",2),z([_("uint16")],$.prototype,"ySuperscriptXOffset",2),z([_("uint16")],$.prototype,"ySuperscriptYOffset",2),z([_("uint16")],$.prototype,"yStrikeoutSize",2),z([_("uint16")],$.prototype,"yStrikeoutPosition",2),z([_("uint16")],$.prototype,"sFamilyClass",2),z([_({type:"uint8"})],$.prototype,"bFamilyType",2),z([_({type:"uint8"})],$.prototype,"bSerifStyle",2),z([_({type:"uint8"})],$.prototype,"bWeight",2),z([_({type:"uint8"})],$.prototype,"bProportion",2),z([_({type:"uint8"})],$.prototype,"bContrast",2),z([_({type:"uint8"})],$.prototype,"bStrokeVariation",2),z([_({type:"uint8"})],$.prototype,"bArmStyle",2),z([_({type:"uint8"})],$.prototype,"bLetterform",2),z([_({type:"uint8"})],$.prototype,"bMidline",2),z([_({type:"uint8"})],$.prototype,"bXHeight",2),z([_({type:"uint8",size:16})],$.prototype,"ulUnicodeRange",2),z([_({type:"char",size:4})],$.prototype,"achVendID",2),z([_("uint16")],$.prototype,"fsSelection",2),z([_("uint16")],$.prototype,"usFirstCharIndex",2),z([_("uint16")],$.prototype,"usLastCharIndex",2),z([_("int16")],$.prototype,"sTypoAscender",2),z([_("int16")],$.prototype,"sTypoDescender",2),z([_("int16")],$.prototype,"sTypoLineGap",2),z([_("uint16")],$.prototype,"usWinAscent",2),z([_("uint16")],$.prototype,"usWinDescent",2),z([_({offset:72,type:"uint8",size:8})],$.prototype,"ulCodePageRange",2),z([_({offset:72,type:"int16"})],$.prototype,"sxHeight",2),z([_("int16")],$.prototype,"sCapHeight",2),z([_("uint16")],$.prototype,"usDefaultChar",2),z([_("uint16")],$.prototype,"usBreakChar",2),z([_("uint16")],$.prototype,"usMaxContext",2),$=z([we("OS/2","os2")],$);var Ju=Object.defineProperty,Qu=Object.getOwnPropertyDescriptor,ht=(n,r,e,t)=>{for(var i=t>1?void 0:t?Qu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Ju(r,e,i),i};let Xe=class extends Ae{constructor(n=new ArrayBuffer(32),r,e){super(n,r,e)}};ht([_("fixed")],Xe.prototype,"format",2),ht([_("fixed")],Xe.prototype,"italicAngle",2),ht([_("int16")],Xe.prototype,"underlinePosition",2),ht([_("int16")],Xe.prototype,"underlineThickness",2),ht([_("uint32")],Xe.prototype,"isFixedPitch",2),ht([_("uint32")],Xe.prototype,"minMemType42",2),ht([_("uint32")],Xe.prototype,"maxMemType42",2),ht([_("uint32")],Xe.prototype,"minMemType1",2),ht([_("uint32")],Xe.prototype,"maxMemType1",2),Xe=ht([we("post")],Xe);var ef=Object.defineProperty,tf=Object.getOwnPropertyDescriptor,Be=(n,r,e,t)=>{for(var i=t>1?void 0:t?tf(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&ef(r,e,i),i};let Pe=class extends Ae{constructor(n=new ArrayBuffer(36),r){super(n,r,Math.min(36,n.byteLength-(r??0)))}};Be([_("fixed")],Pe.prototype,"version",2),Be([_("int16")],Pe.prototype,"vertTypoAscender",2),Be([_("int16")],Pe.prototype,"vertTypoDescender",2),Be([_("int16")],Pe.prototype,"vertTypoLineGap",2),Be([_("int16")],Pe.prototype,"advanceHeightMax",2),Be([_("int16")],Pe.prototype,"minTopSideBearing",2),Be([_("int16")],Pe.prototype,"minBottomSideBearing",2),Be([_("int16")],Pe.prototype,"yMaxExtent",2),Be([_("int16")],Pe.prototype,"caretSlopeRise",2),Be([_("int16")],Pe.prototype,"caretSlopeRun",2),Be([_("int16")],Pe.prototype,"caretOffset",2),Be([_({type:"int16",size:4})],Pe.prototype,"reserved",2),Be([_("int16")],Pe.prototype,"metricDataFormat",2),Be([_("int16")],Pe.prototype,"numOfLongVerMetrics",2),Pe=Be([we("vhea")],Pe);var rf=Object.defineProperty,sf=Object.getOwnPropertyDescriptor,nf=(n,r,e,t)=>{for(var i=t>1?void 0:t?sf(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&rf(r,e,i),i};let Ei=class extends Ae{constructor(){super(...arguments);u(this,"_metrics")}static from(r){const e=r.length*4,t=new Ei(new ArrayBuffer(e));return r.forEach(i=>{t.view.writeUint16(i.advanceHeight),t.view.writeInt16(i.topSideBearing)}),t}get metrics(){return this._metrics??(this._metrics=this.readMetrics())}readMetrics(){var s;const r=this._sfnt.maxp.numGlyphs,e=((s=this._sfnt.vhea)==null?void 0:s.numOfLongVerMetrics)??0,t=this.view;t.seek(0);let i=0;return Array.from({length:r}).map((o,a)=>(a<e&&(i=t.readUint16()),{advanceHeight:i,topSideBearing:t.readUint8()}))}};Ei=nf([we("vmtx")],Ei);var of=Object.defineProperty,Nr=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&of(r,e,i),i};class He extends pi{constructor(){super(...arguments);u(this,"format","TrueType");u(this,"mimeType","font/ttf");u(this,"_sfnt")}get sfnt(){return this._sfnt||(this._sfnt=this.createSfnt()),this._sfnt}static is(e){return typeof e=="number"?this.signature.has(e):this.signature.has(nr(e).getUint32(0))}static checksum(e){const t=nr(e);let i=t.byteLength;for(;i%4;)i++;let s=0;for(let o=0,a=i/4;o<a;o+=4)o*4<i-4&&(s+=t.getUint32(o*4,!1));return s&4294967295}static from(e){const t=p=>p+3&-4,i=e.tableViews.size,s=Array.from(e.tableViews.values()).reduce((p,d)=>p+t(d.byteLength),0),o=new this(new ArrayBuffer(12+i*16+s));o.scalerType=65536,o.numTables=i;const a=Math.log(2);o.searchRange=Math.floor(Math.log(i)/a)*16,o.entrySelector=Math.floor(o.searchRange/a),o.rangeShift=i*16-o.searchRange;let l=12+i*16,h=0;const c=o.getDirectories();e.tableViews.forEach((p,d)=>{const m=c[h++];m.tag=d,m.checkSum=this.checksum(p),m.offset=l,m.length=p.byteLength,o.view.writeBytes(p,l),l+=t(m.length)});const f=o.createSfnt().head;return f.checkSumAdjustment=0,f.checkSumAdjustment=2981146554-this.checksum(o.view),o}getDirectories(){let e=this.view.byteOffset+12;return Array.from({length:this.numTables},()=>{const t=new or(this.view.buffer,e);return e+=t.view.byteLength,t})}createSfnt(){return new Ft(this.getDirectories().reduce((e,t)=>(e[t.tag]=new DataView(this.view.buffer,this.view.byteOffset+t.offset,t.length),e),{}))}}u(He,"signature",new Set([65536,1953658213,1954115633])),Nr([_("uint32")],He.prototype,"scalerType"),Nr([_("uint16")],He.prototype,"numTables"),Nr([_("uint16")],He.prototype,"searchRange"),Nr([_("uint16")],He.prototype,"entrySelector"),Nr([_("uint16")],He.prototype,"rangeShift");class Ti extends He{constructor(){super(...arguments);u(this,"format","OpenType");u(this,"mimeType","font/otf")}static from(e){return super.from(e)}}u(Ti,"signature",new Set([1330926671]));var af=Object.defineProperty,Fr=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&af(r,e,i),i};class Gt extends je{constructor(r,e){super(r,e,20)}}Fr([_({type:"char",size:4})],Gt.prototype,"tag"),Fr([_("uint32")],Gt.prototype,"offset"),Fr([_("uint32")],Gt.prototype,"compLength"),Fr([_("uint32")],Gt.prototype,"origLength"),Fr([_("uint32")],Gt.prototype,"origChecksum");var lf=Object.defineProperty,Ge=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&lf(r,e,i),i};const Ne=(It=class extends pi{constructor(){super(...arguments);u(this,"format","WOFF");u(this,"mimeType","font/woff");u(this,"_sfnt")}get subfontFormat(){return He.is(this.flavor)?"TrueType":Ti.is(this.flavor)?"OpenType":"Open"}get sfnt(){return this._sfnt||(this._sfnt=this.createSfnt()),this._sfnt}static is(e){return typeof e=="number"?this.signature.has(e):this.signature.has(nr(e).getUint32(0))}static checkSum(e){const t=nr(e),i=t.byteLength,s=Math.floor(i/4);let o=0,a=0;for(;a<s;)o+=t.getUint32(4*a++,!1);let l=i-s*4;if(l){let h=s*4;for(;l>0;)o+=t.getUint8(h)<<l*8,h++,l--}return o%4294967296}static from(e,t=new ArrayBuffer(0)){const i=p=>p+3&-4,s=[];e.tableViews.forEach((p,d)=>{const m=nr(Gc(new Uint8Array(p.buffer,p.byteOffset,p.byteLength)));s.push({tag:d,view:m.byteLength<p.byteLength?m:p,rawView:p})});const o=s.length,a=s.reduce((p,d)=>p+i(d.view.byteLength),0),l=new It(new ArrayBuffer(44+20*o+a+t.byteLength));l.signature=2001684038,l.flavor=65536,l.length=l.view.byteLength,l.numTables=o,l.totalSfntSize=12+16*o+s.reduce((p,d)=>p+i(d.rawView.byteLength),0);let h=44+o*20,c=0;const f=l.getDirectories();return s.forEach(p=>{const d=f[c++];d.tag=p.tag,d.offset=h,d.compLength=p.view.byteLength,d.origChecksum=It.checkSum(p.rawView),d.origLength=p.rawView.byteLength,l.view.writeBytes(p.view,h),h+=i(d.compLength)}),l.view.writeBytes(t),l}getDirectories(){let e=44;return Array.from({length:this.numTables},()=>{const t=new Gt(this.view.buffer,e);return e+=t.view.byteLength,t})}createSfnt(){return new Ft(this.getDirectories().reduce((e,t)=>{const i=t.tag,s=this.view.byteOffset+t.offset,o=t.compLength,a=t.origLength,l=s+o;return e[i]=o>=a?new DataView(this.view.buffer,s,o):new DataView(qc(new Uint8Array(this.view.buffer.slice(s,l))).buffer),e},{}))}},u(It,"signature",new Set([2001684038])),It);Ge([_("uint32")],Ne.prototype,"signature"),Ge([_("uint32")],Ne.prototype,"flavor"),Ge([_("uint32")],Ne.prototype,"length"),Ge([_("uint16")],Ne.prototype,"numTables"),Ge([_("uint16")],Ne.prototype,"reserved"),Ge([_("uint32")],Ne.prototype,"totalSfntSize"),Ge([_("uint16")],Ne.prototype,"majorVersion"),Ge([_("uint16")],Ne.prototype,"minorVersion"),Ge([_("uint32")],Ne.prototype,"metaOffset"),Ge([_("uint32")],Ne.prototype,"metaLength"),Ge([_("uint32")],Ne.prototype,"metaOrigLength"),Ge([_("uint32")],Ne.prototype,"privOffset"),Ge([_("uint32")],Ne.prototype,"privLength");let Si=Ne;function aa(n,r=!0){if(He.is(n))return new He(n);if(Ti.is(n))return new Ti(n);if(Si.is(n))return new Si(n);if(r)throw new Error("Failed to parseFont")}const Li=class Li{constructor(){u(this,"fallbackFont");u(this,"loading",new Map);u(this,"loaded",new Map);u(this,"familyToUrl",new Map)}_createRequest(r,e){const t=new AbortController;return{url:r,when:fetch(r,{...Li.defaultRequestInit,...e,signal:t.signal}).then(i=>i.arrayBuffer()),cancel:()=>t.abort()}}injectFontFace(r,e){return document.fonts.add(new FontFace(r,e)),this}injectStyleTag(r,e){const t=document.createElement("style");return t.appendChild(document.createTextNode(`@font-face {
27
+ ${r}`);return e.documentElement}else return n}const Wh="px",Xh=90,mo=["mm","cm","in","pt","pc","px"],yo={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:72/6,pc:1,px:-1},px:{px:1}};function J(n){let r="px";if(typeof n=="string"||n instanceof String)for(let t=0,i=mo.length;t<i;t++){const s=mo[t];if(n.endsWith(s)){r=s,n=n.substring(0,n.length-s.length);break}}let e;return e=yo[r][Wh],e<0&&(e=yo[r].in*Xh),e*Number.parseFloat(n)}const Hh=new ke,oi=new ke,vo=new ke,_o=new ke;function Yh(n,r,e){if(!(n.hasAttribute("transform")||n.nodeName==="use"&&(n.hasAttribute("x")||n.hasAttribute("y"))))return null;const t=Zh(n);return e.length>0&&t.premultiply(e[e.length-1]),r.copy(t),e.push(t),t}function Zh(n){const r=new ke,e=Hh;if(n.nodeName==="use"&&(n.hasAttribute("x")||n.hasAttribute("y"))&&r.translate(J(n.getAttribute("x")),J(n.getAttribute("y"))),n.hasAttribute("transform")){const t=n.getAttribute("transform").split(")");for(let i=t.length-1;i>=0;i--){const s=t[i].trim();if(s==="")continue;const o=s.indexOf("("),a=s.length;if(o>0&&o<a){const l=s.slice(0,o),h=nt(s.slice(o+1));switch(e.identity(),l){case"translate":if(h.length>=1){const c=h[0];let f=0;h.length>=2&&(f=h[1]),e.translate(c,f)}break;case"rotate":if(h.length>=1){let c=0,f=0,p=0;c=h[0]*Math.PI/180,h.length>=3&&(f=h[1],p=h[2]),oi.makeTranslation(-f,-p),vo.makeRotation(c),_o.multiplyMatrices(vo,oi),oi.makeTranslation(f,p),e.multiplyMatrices(oi,_o)}break;case"scale":h.length>=1&&e.scale(h[0],h[1]??h[0]);break;case"skewX":h.length===1&&e.set(1,Math.tan(h[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":h.length===1&&e.set(1,0,0,Math.tan(h[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":h.length===6&&e.set(h[0],h[2],h[4],h[1],h[3],h[5],0,0,1);break}}r.premultiply(e)}}return r}function Kh(n){return new Ue().addPath(new Er().arc(J(n.getAttribute("cx")||0),J(n.getAttribute("cy")||0),J(n.getAttribute("r")||0),0,Math.PI*2))}function Jh(n,r){if(!(!n.sheet||!n.sheet.cssRules||!n.sheet.cssRules.length))for(let e=0;e<n.sheet.cssRules.length;e++){const t=n.sheet.cssRules[e];if(t.type!==1)continue;const i=t.selectorText.split(/,/g).filter(Boolean).map(o=>o.trim()),s={};for(let o=t.style.length,a=0;a<o;a++){const l=t.style.item(a);s[l]=t.style.getPropertyValue(l)}for(let o=0;o<i.length;o++)r[i[o]]=Object.assign(r[i[o]]||{},{...s})}}function Qh(n){return new Ue().addPath(new Er().ellipse(J(n.getAttribute("cx")||0),J(n.getAttribute("cy")||0),J(n.getAttribute("rx")||0),J(n.getAttribute("ry")||0),0,0,Math.PI*2))}function ec(n){return new Ue().moveTo(J(n.getAttribute("x1")||0),J(n.getAttribute("y1")||0)).lineTo(J(n.getAttribute("x2")||0),J(n.getAttribute("y2")||0))}function tc(n){const r=new Ue,e=n.getAttribute("d");return!e||e==="none"?null:(r.addData(e),r)}const rc=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function ic(n){var t;const r=new Ue;let e=0;return(t=n.getAttribute("points"))==null||t.replace(rc,(i,s,o)=>{const a=J(s),l=J(o);return e===0?r.moveTo(a,l):r.lineTo(a,l),e++,i}),r.currentPath.autoClose=!0,r}const sc=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function nc(n){var t;const r=new Ue;let e=0;return(t=n.getAttribute("points"))==null||t.replace(sc,(i,s,o)=>{const a=J(s),l=J(o);return e===0?r.moveTo(a,l):r.lineTo(a,l),e++,i}),r.currentPath.autoClose=!1,r}function oc(n){const r=J(n.getAttribute("x")||0),e=J(n.getAttribute("y")||0),t=J(n.getAttribute("rx")||n.getAttribute("ry")||0),i=J(n.getAttribute("ry")||n.getAttribute("rx")||0),s=J(n.getAttribute("width")),o=J(n.getAttribute("height")),a=1-.551915024494,l=new Ue;return l.moveTo(r+t,e),l.lineTo(r+s-t,e),(t!==0||i!==0)&&l.bezierCurveTo(r+s-t*a,e,r+s,e+i*a,r+s,e+i),l.lineTo(r+s,e+o-i),(t!==0||i!==0)&&l.bezierCurveTo(r+s,e+o-i*a,r+s-t*a,e+o,r+s-t,e+o),l.lineTo(r+t,e+o),(t!==0||i!==0)&&l.bezierCurveTo(r+t*a,e+o,r,e+o-i*a,r,e+o-i),l.lineTo(r,e+i),(t!==0||i!==0)&&l.bezierCurveTo(r,e+i*a,r+t*a,e,r+t,e),l}function ot(n,r,e){r=Object.assign({},r);let t={};if(n.hasAttribute("class")){const h=n.getAttribute("class").split(/\s/).filter(Boolean).map(c=>c.trim());for(let c=0;c<h.length;c++)t=Object.assign(t,e[`.${h[c]}`])}n.hasAttribute("id")&&(t=Object.assign(t,e[`#${n.getAttribute("id")}`]));for(let h=n.style.length,c=0;c<h;c++){const f=n.style.item(c),p=n.style.getPropertyValue(f);r[f]=p,t[f]=p}function i(h,c,f=s){n.hasAttribute(h)&&(r[c]=f(n.getAttribute(h))),t[h]&&(r[c]=f(t[h]))}function s(h){return h.startsWith("url")&&console.warn("url access in attributes is not implemented."),h}function o(h){return Math.max(0,Math.min(1,J(h)))}function a(h){return Math.max(0,J(h))}function l(h){return h.split(" ").filter(c=>c!=="").map(c=>J(c))}return i("fill","fill"),i("fill-opacity","fillOpacity",o),i("fill-rule","fillRule"),i("opacity","opacity",o),i("stroke","stroke"),i("stroke-opacity","strokeOpacity",o),i("stroke-width","strokeWidth",a),i("stroke-linecap","strokeLinecap"),i("stroke-linejoin","strokeLinejoin"),i("stroke-miterlimit","strokeMiterlimit",a),i("stroke-dasharray","strokeDasharray",l),i("stroke-dashoffset","strokeDashoffset",J),i("visibility","visibility"),r}function _s(n,r,e=[],t={}){var f;if(n.nodeType!==1)return e;let i=!1,s=null,o={...r};switch(n.nodeName){case"svg":o=ot(n,o,t);break;case"style":Jh(n,t);break;case"g":o=ot(n,o,t);break;case"path":o=ot(n,o,t),n.hasAttribute("d")&&(s=tc(n));break;case"rect":o=ot(n,o,t),s=oc(n);break;case"polygon":o=ot(n,o,t),s=ic(n);break;case"polyline":o=ot(n,o,t),s=nc(n);break;case"circle":o=ot(n,o,t),s=Kh(n);break;case"ellipse":o=ot(n,o,t),s=Qh(n);break;case"line":o=ot(n,o,t),s=ec(n);break;case"defs":i=!0;break;case"use":{o=ot(n,o,t);const d=(n.getAttributeNS("http://www.w3.org/1999/xlink","href")||n.getAttribute("href")||"").substring(1),m=(f=n.viewportElement)==null?void 0:f.getElementById(d);m?_s(m,o,e,t):console.warn(`'use node' references non-existent node id: ${d}`);break}default:console.warn(n);break}if(o.display==="none")return e;Object.assign(r,o);const a=new ke,l=[],h=Yh(n,a,l);s&&(s.applyTransform(a),e.push(s),s.style=r);const c=n.childNodes;for(let p=0,d=c.length;p<d;p++){const m=c[p];i&&m.nodeName!=="style"&&m.nodeName!=="defs"||_s(m,r,e,t)}return h&&(l.pop(),l.length>0?a.copy(l[l.length-1]):a.identity()),e}function bo(n){return new vs(_s(go(n),{}))}class wo extends Ue{constructor(){super(...arguments);u(this,"textureTransform");u(this,"fillStyle");u(this,"strokeStyle");u(this,"lineCap");u(this,"lineJoin");u(this,"lineWidth");u(this,"miterLimit");u(this,"_defaultStyle",de.EMPTY);u(this,"_stroked",[]);u(this,"_filled",[])}stroke(){let e=this._defaultStyle;this.strokeStyle&&(this.strokeStyle instanceof de?e=this.strokeStyle:e=new as(this.strokeStyle)),this.curves.length&&(this._stroked.push({shapes:this.curves.slice(),texture:e,textureTransform:this.textureTransform,style:{alignment:.5,cap:this.lineCap??"butt",join:this.lineJoin??"miter",width:this.lineWidth??1,miterLimit:this.miterLimit??10}}),this.curves=[this.currentCurve])}fillRect(e,t,i,s){this.rect(e,t,i,s).fill()}strokeRect(e,t,i,s){this.rect(e,t,i,s).stroke()}fill(){let e=this._defaultStyle;this.fillStyle&&(this.fillStyle instanceof de?e=this.fillStyle:e=new as(this.fillStyle)),this._filled.push({shapes:this.curves.slice(),texture:e,textureTransform:this.textureTransform}),this.curves=[this.currentCurve]}reset(){this.strokeStyle=void 0,this.fillStyle=void 0,this.textureTransform=void 0,this.lineCap=void 0,this.lineJoin=void 0,this.lineWidth=void 0,this.miterLimit=void 0,this.curves=[this.currentCurve],this._stroked.length=0,this._filled.length=0}buildUvs(e,t,i,s,o){if(s){let a=s.width,l=s.height;o&&([a,l]=o.applyToPoint(a,l));for(let h=t.length,c=e;c<h;c+=2)i.push(t[c]/a,t[c+1]/l)}else for(let a=t.length,l=e;l<a;l+=2)i.push(0,0)}toBatchables(){const e=[];let t=[],i=[],s=[],o=0,a;const l=h=>{e.push({type:h,vertices:t,indices:i,uvs:s,texture:a}),t=[],i=[],s=[],a=void 0};for(let h=this._stroked.length,c=0;c<h;c++){o=t.length;const f=this._stroked[c];a??(a=f.texture);const p=[];for(let d=f.shapes.length,m=0;m<d;m++)f.shapes[m].getAdaptivePointArray(p);so(p,{vertices:t,indices:i,lineStyle:f.style,flipAlignment:!1,closed:!0}),this.buildUvs(o,t,s,f.texture,f.textureTransform),l("stroke")}for(let h=this._filled.length,c=0;c<h;c++){const f=this._filled[c];a??(a=f.texture),a!==f.texture&&l("fill"),o=t.length;for(let p=f.shapes.length,d=0;d<p;d++)f.shapes[d].fillTriangulate({vertices:t,indices:i});this.buildUvs(o,t,s,f.texture,f.textureTransform)}return t.length&&l("fill"),e}}class Et{}class xo extends Et{install(r){const e=async t=>{const{parseFont:i}=await Promise.resolve().then(()=>hf);return await r.fetch(t).then(s=>s.arrayBuffer()).then(s=>i(s))};return this.load=t=>r.loadBy(t,()=>e(t)),["woff","ttf"].forEach(t=>{r.register(t,e)}),r.font=this,this}}class Po extends Et{install(r){const e=async t=>{const{decodeFrames:i}=await import("modern-gif");return await r.fetch(t).then(s=>s.arrayBuffer()).then(s=>i(s)).then(s=>new hi(s.map(o=>({duration:o.delay,texture:new Ji(o.data,o.width,o.height)}))))};return this.load=t=>r.loadBy(t,()=>e(t)),["image/gif"].forEach(t=>{r.register(t,e)}),r.gif=this,this}}class Co extends Et{install(r){const e=t=>r.fetch(t).then(i=>i.json());return this.load=t=>r.loadBy(t,()=>e(t)),["json"].forEach(t=>{r.register(t,e)}),r.json=this,this}}class Eo extends Et{install(r){const e=async(t,i)=>(await import("lottie-web").then(o=>o.default)).loadAnimation({container:null,renderer:"canvas",rendererSettings:{context:i.getContext("2d")},loop:!1,autoplay:!1,animationData:await r.fetch(t).then(o=>o.json())});return this.load=(t,i)=>r.loadBy(t,()=>e(t,i)),["lottie"].forEach(t=>{r.register(t,e)}),r.lottie=this,this}}class To extends Et{install(r){const e=async t=>await r.fetch(t).then(i=>i.text());return this.load=t=>r.loadBy(t,()=>e(t)),r.text=this,this}}class So extends Et{install(r){const e=t=>r.fetchImageBitmap(t,{premultiplyAlpha:"premultiply"}).then(i=>new de(i));return this.load=t=>r.loadBy(t,()=>e(t)),["image/gif","image/jpeg","image/png","image/tiff","image/vnd.wap.wbmp","image/x-icon","image/x-jng","image/x-ms-bmp","image/svg+xml","image/webp"].forEach(t=>{r.register(t,e)}),r.texture=this,this}}class Mo extends Et{install(r){const e=t=>new Rn(t).load();return this.load=t=>r.loadBy(t,()=>e(t)),["video/3gpp","video/mpeg","video/quicktime","video/x-flv","video/x-mng","video/x-ms-asf","video/x-ms-wmv","video/x-msvideo","video/mp4"].forEach(t=>{r.register(t,e)}),r.video=this,this}}const ac=Object.entries({"text/html":["html","htm","shtml"],"text/css":["css"],"text/xml":["xml"],"image/gif":["gif"],"image/jpeg":["jpeg","jpg"],"application/x-javascript":["js"],"application/atom+xml":["atom"],"application/rss+xml":["rss"],"text/mathml":["mml"],"text/plain":["txt"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/x-component":["htc"],"image/png":["png"],"image/tiff":["tif","tiff"],"image/vnd.wap.wbmp":["wbmp"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-ms-bmp":["bmp"],"image/svg+xml":["svg"],"image/webp":["webp"],"application/java-archive":["jar","war","ear"],"application/mac-binhex40":["hqx"],"application/msword":["doc"],"application/pdf":["pdf"],"application/postscript":["ps","eps","ai"],"application/rtf":["rtf"],"application/vnd.ms-excel":["xls"],"application/vnd.ms-powerpoint":["ppt"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/x-7z-compressed":["7z"],"application/x-cocoa":["cco"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-makeself":["run"],"application/x-perl":["pl","pm"],"application/x-pilot":["prc","pdb"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-sea":["sea"],"application/x-shockwave-flash":["swf"],"application/x-stuffit":["sit"],"application/x-tcl":["tcl","tk"],"application/x-x509-ca-cert":["der","pem","crt"],"application/x-xpinstall":["xpi"],"application/xhtml+xml":["xhtml"],"application/zip":["zip"],"application/octet-stream":["bin","exe","dll","deb","dmg","eot","iso","img","msi","msp","msm"],"audio/midi":["mid","midi","kar"],"audio/mpeg":["mp3"],"audio/ogg":["ogg"],"audio/x-realaudio":["ra"],"video/3gpp":["3gpp","3gp"],"video/mpeg":["mpeg","mpg"],"video/quicktime":["mov"],"video/x-flv":["flv"],"video/x-mng":["mng"],"video/x-ms-asf":["asx","asf"],"video/x-ms-wmv":["wmv"],"video/x-msvideo":["avi"],"video/mp4":["m4v","mp4"]});function lc(n){for(const[r,e]of ac)if(e.includes(n))return r}async function hc(n){var e,t;let r;if(n.startsWith("data:"))r=(e=n.match(/^data:(.+?);/))==null?void 0:e[1];else if(n.startsWith("http")){const i=(t=n.split(/[#?]/)[0].split(".").pop())==null?void 0:t.trim();i&&(r=lc(i))}return r??await fetch(n).then(i=>i.headers.get("Content-Type"))??""}const ai="WeakRef"in globalThis;class Ao{constructor(){u(this,"defaultHandler",r=>this.fetch(r));u(this,"_handlers",new Map);u(this,"_handleing",new Map);u(this,"_handled",new Map);u(this,"_gc",ai?new FinalizationRegistry(r=>{const e=this.get(r);e&&"destroy"in e&&e.destroy(),this._handled.delete(r)}):void 0);ai||ue.on(this.gc.bind(this),{sort:2})}use(r){return r.install(this),this}register(r,e){return this._handlers.set(r,e),this}fetch(r){return fetch(r)}_fixSVG(r){const e=new DOMParser().parseFromString(decodeURIComponent(r.split(",")[1]),"image/svg+xml").documentElement;return e.setAttribute("width","512"),e.setAttribute("height","512"),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e.outerHTML)}`}async fetchImageBitmap(r,e){return r.startsWith("http")?await this.fetch(r).then(t=>t.blob()).then(t=>t.type==="image/svg+xml"?t.text().then(i=>this.fetchImageBitmap(this._fixSVG(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`),e)):createImageBitmap(t,e)):(r.startsWith("data:image/svg+xml;")&&(r=this._fixSVG(r)),new Promise(t=>{const i=new Image;i.src=r,i.onload=()=>i.decode().finally(()=>t(i))}).then(t=>createImageBitmap(t,e)))}get(r){let e=this._handled.get(r);return ai&&e instanceof WeakRef&&(e=e.deref(),e||this._handleing.delete(r)),e}set(r,e){let t=e;ai&&typeof e=="object"&&(this._gc.register(e,r),t=new WeakRef(e)),this._handled.set(r,t)}async loadBy(r,e){const t=this.get(r)??this._handleing.get(r);if(t)return t;const i=e().then(s=>(this.set(r,s),s)).finally(()=>{this._handleing.delete(r)});return this._handleing.set(r,i),i}async load(r,e){return this.loadBy(r,async()=>{const t=await hc(r);return(this._handlers.get(t)??this.defaultHandler)(r,e)})}async waitUntilLoad(){await Promise.all(Array.from(this._handleing.values()))}gc(){this._handled.forEach((r,e)=>{const t=this.get(e);t&&"destroy"in t&&t.destroy()}),this._handled.clear()}}const mt=new Ao().use(new xo).use(new Po).use(new Co).use(new Eo).use(new To).use(new So).use(new Mo);class Tr{}class Oo extends Tr{install(r){bt(r,"backgroundColor"),bt(r,"backgroundImage"),r.prototype.getComputedBackgroundImage=cc}}async function cc(){if(this.backgroundImage)return await mt.texture.load(this.backgroundImage)}class Uo extends Tr{install(r){bt(r,"filter",{default:""}),r.prototype.getComputedFilter=uc,r.prototype.getComputedFilterColorMatrix=fc}}const Do={brightness:1,contrast:1,grayscale:0,"hue-rotate":0,invert:0,opacity:1,saturate:1,sepia:0};function uc(){const n=gr(this.filter).reduce((r,{name:e,args:t})=>(r[e]=t[0].normalizedIntValue,r),{});return Object.keys(Do).forEach(r=>{n[r]=n[r]??Do[r]}),n}function fc(){const n=new os,r=this.getComputedFilter();for(const e in r){const t=r[e];switch(e){case"hue-rotate":n.hueRotate(t*le);break;case"saturate":n.saturate(t);break;case"brightness":n.brightness(t);break;case"contrast":n.contrast(t);break;case"invert":n.invert(t);break;case"sepia":n.sepia(t);break;case"opacity":n.opacity(t);break;case"grayscale":n.grayscale(t);break}}return n}function dc(){return{shadowColor:"transparent",shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0}}function Io(){return{left:0,top:0,width:0,height:0,rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function pc(){return{overflow:"visible",visibility:"visible",filter:"none",opacity:1,marginLeft:0,marginTop:0,marginRight:0,marginBottom:0,paddingLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,...Io(),backgroundImage:"none",backgroundColor:"transparent",...dc(),borderRadius:0,borderColor:"transparent",borderWidth:1}}function Ro(){return{writingMode:"horizontal-tb",verticalAlign:"baseline",lineHeight:1.2,letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textWrap:"wrap",textAlign:"start",textIndent:0,textTransform:"none",textOrientation:"mixed",textDecoration:"none",textStrokeWidth:0,textStrokeColor:"black",color:"black",listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside",highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function gc(){return{...pc(),...Ro()}}class Bo extends Tr{install(r){const e=Ro();for(const t in e)bt(r,t,{default:e[t]});bt(r,"direction",{default:"inherit"})}}class Lo extends Tr{install(r){const e=Io();for(const t in e)bt(r,t,{default:e[t]});r.prototype.getComputedTransform=mc,r.prototype.getComputedTransformOrigin=yc}}function mc(){const n=new qe,r=new qe(!1),e=new qe(!1).scale(this.scaleX,this.scaleY).translate(this.left,this.top).rotate(this.rotate*On);let t=this.transform;(!t||t==="none")&&(t=""),gr(t,{width:this.width,height:this.height}).forEach(({name:f,args:p})=>{const d=p.map(m=>m.normalizedIntValue);switch(n.identity(),f){case"translate":n.translate(d[0]*this.width,(d[1]??d[0])*this.height);break;case"translateX":n.translateX(d[0]*this.width);break;case"translateY":n.translateY(d[0]*this.height);break;case"translateZ":n.translateZ(d[0]);break;case"translate3d":n.translate3d(d[0]*this.width,(d[1]??d[0])*this.height,d[2]??d[1]??d[0]);break;case"scale":n.scale(d[0],d[1]??d[0]);break;case"scaleX":n.scaleX(d[0]);break;case"scaleY":n.scaleY(d[0]);break;case"scale3d":n.scale3d(d[0],d[1]??d[0],d[2]??d[1]??d[0]);break;case"rotate":n.rotate(d[0]*le);break;case"rotateX":n.rotateX(d[0]*le);break;case"rotateY":n.rotateY(d[0]*le);break;case"rotateZ":n.rotateZ(d[0]*le);break;case"rotate3d":n.rotate3d(d[0]*le,(d[1]??d[0])*le,(d[2]??d[1]??d[0])*le,(d[3]??d[2]??d[1]??d[0])*le);break;case"skew":n.skew(d[0],d[0]??d[1]);break;case"skewX":n.skewX(d[0]);break;case"skewY":n.skewY(d[0]);break;case"matrix":n.set(d);break}r.multiply(n)}),e.update(),r.update();const i=e.toArray(),s=r.toArray(),o=[s[0]*i[0]+s[3]*i[1],s[1]*i[0]+s[4]*i[1],s[2]*i[0]+s[5]*i[1]+i[2],s[0]*i[3]+s[3]*i[4],s[1]*i[3]+s[4]*i[4],s[2]*i[3]+s[5]*i[4]+i[5],0,0,1],[a,l]=this.getComputedTransformOrigin(),h=a*this.width,c=l*this.height;return o[2]+=o[0]*-h+o[1]*-c+h,o[5]+=o[3]*-h+o[4]*-c+c,new qe().set(o)}function yc(){const[n,r=n]=this.transformOrigin.split(" ");return[n,r].map(e=>{switch(e=e.trim(),e){case"left":case"top":return 0;case"center":return .5;case"right":case"bottom":return 1;default:return Number(e)}})}var vc=Object.defineProperty,kt=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&vc(r,e,i),i};class at extends Kr{constructor(r){super(),this.setProperties(r)}_onUpdateProperty(r,e,t){switch(super._onUpdateProperty(r,e,t),r){case"fontSize":e<=0&&(this.fontSize=14);break;case"fontWeight":e||(this.fontWeight="normal");break;case"lineHeight":e||(this.lineHeight=1);break}}}kt([A({default:"#000000"})],at.prototype,"shadowColor"),kt([A({default:0})],at.prototype,"shadowOffsetX"),kt([A({default:0})],at.prototype,"shadowOffsetY"),kt([A({default:0})],at.prototype,"shadowBlur"),kt([A({default:1})],at.prototype,"opacity"),kt([A({default:0})],at.prototype,"borderRadius"),kt([A({default:"visible"})],at.prototype,"overflow"),[Oo,Uo,Bo,Lo].forEach(n=>{new n().install(at)});var _c=Object.defineProperty,bc=Object.getOwnPropertyDescriptor,bs=(n,r,e,t)=>{for(var i=t>1?void 0:t?bc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&_c(r,e,i),i};g.CanvasItem=class extends g.Node{constructor(e){super();u(this,"tint");u(this,"blendMode");u(this,"opacity",1);u(this,"_parentOpacity");u(this,"_tint",new Pt(4294967295));u(this,"_backgroundColor",new Pt(0));u(this,"_backgroundImage");u(this,"context",new wo);u(this,"_resetContext",!0);u(this,"_redrawing",!1);u(this,"_reflowing",!1);u(this,"_repainting",!1);u(this,"_originalBatchables",[]);u(this,"_layoutedBatchables",[]);u(this,"_batchables",[]);this._onUpdateStyleProperty=this._onUpdateStyleProperty.bind(this),this.setProperties(e),this.style=new at}get style(){return this._style}set style(e){var t;e.on("updateProperty",this._onUpdateStyleProperty),(t=this._style)==null||t.off("updateProperty",this._onUpdateStyleProperty),this._style=e}setProperties(e){if(e){const{style:t,...i}=e;t&&this.style.setProperties(t),super.setProperties(i)}return this}_onUpdateProperty(e,t,i,s){switch(super._onUpdateProperty(e,t,i,s),e){case"blendMode":this.requestRepaint();break;case"tint":this._tint.value=t||4294967295,this.requestRepaint();break}}_onUpdateStyleProperty(e,t,i,s){switch(e){case"backgroundColor":this._updateBackgroundColor();break;case"backgroundImage":this._updateBackgroundImage();break;case"opacity":this._updateOpacity();break;case"filter":this.requestRepaint();break;case"borderRadius":this.requestRedraw();break}}_updateBackgroundColor(){this._backgroundColor.value=this.style.backgroundColor||0,this._originalBatchables.length?this.requestRepaint():this._backgroundColor.a>0&&this.requestRedraw()}async _updateBackgroundImage(){this._backgroundImage=await this.style.getComputedBackgroundImage(),this.requestRedraw()}_updateOpacity(){var t;const e=xt(0,this.style.opacity,1)*(((t=this._parent)==null?void 0:t.opacity)??1);this.opacity!==e&&(this.opacity=e,this.requestRepaint())}isVisible(){return this.opacity>0&&super.isVisible()}requestRedraw(){this._redrawing=!0}requestReflow(){this._reflowing=!0}requestRepaint(){this._repainting=!0}_process(e){var i;const t=(i=this._parent)==null?void 0:i.opacity;t!==this._parentOpacity&&(this._parentOpacity=t,this._updateOpacity()),super._process(e)}_draw(){this._drawBackground(),this._drawContent()}_drawBackground(){const e=this._backgroundImage;e!=null&&e.valid&&(this.context.fillStyle=e,this.context.textureTransform=new qe().scale(this.style.width/e.width,this.style.height/e.height),this._fill())}_drawContent(){this._fill()}_fill(){this.style.borderRadius?this.context.roundRect(0,0,this.style.width,this.style.height,this.style.borderRadius):this.context.rect(0,0,this.style.width,this.style.height),this.context.fill()}_relayout(e){return this._reflow(e)}_reflow(e){return this._repaint(e)}_repaint(e){const t=this.style.getComputedFilterColorMatrix();return e.map(i=>({...i,backgroundColor:this._backgroundColor.abgr,tint:this._tint.toArgb(this.opacity,!0),colorMatrix:t.toMatrix4().toArray(!0),colorMatrixOffset:t.toVector4().toArray(),blendMode:this.blendMode}))}_render(e){let t;this._redrawing?(this._draw(),this._originalBatchables=this.context.toBatchables(),this._layoutedBatchables=this._relayout(this._originalBatchables),t=this._layoutedBatchables,this._resetContext&&this.context.reset()):this._reflowing?(this._layoutedBatchables=this._reflow(this._originalBatchables),t=this._layoutedBatchables):this._repainting&&(t=this._repaint(this._layoutedBatchables)),t&&(this._batchables=t,this._redrawing=!1,this._reflowing=!1,this._repainting=!1),this._batchables.forEach(i=>{var s,o;(s=i.texture)==null||s.upload(e),e.batch2D.render({...i,texture:(o=i.texture)==null?void 0:o._glTexture(e)})}),super._render(e)}toJSON(){const e=super.toJSON();return{...e,props:{style:this.style.toJSON(),...e.props}}}},bs([A()],g.CanvasItem.prototype,"tint",2),bs([A()],g.CanvasItem.prototype,"blendMode",2),g.CanvasItem=bs([H("CanvasItem")],g.CanvasItem);var wc=Object.defineProperty,xc=Object.getOwnPropertyDescriptor,Nt=(n,r,e,t)=>{for(var i=t>1?void 0:t?xc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&wc(r,e,i),i};const ko=n=>n,No=sr(.25,.1,.25,1),Fo=sr(.42,0,1,1),$o=sr(0,0,.58,1),zo=sr(.42,0,.58,1);function sr(n,r,e,t){const s=3*n-3*e+1,o=3*e-6*n,a=3*n,l=3*r-3*t+1,h=3*t-6*r,c=3*r,f=v=>(3*s*v+2*o)*v+a,p=v=>((s*v+o)*v+a)*v,d=v=>((l*v+h)*v+c)*v;function m(v){let y=v,S,C;for(let b=0;b<8;b++){if(C=p(y)-v,Math.abs(C)<1e-6)return y;if(S=f(y),Math.abs(S)<1e-6)break;y-=C/S}let x=1,T=0;for(y=v;x>T;){if(C=p(y)-v,Math.abs(C)<1e-6)return y;C>0?x=y:T=y,y=(x+T)/2}return y}return v=>d(m(v))}const li={linear:ko,ease:No,easeIn:Fo,easeOut:$o,easeInOut:zo};g.Animation2D=class extends g.Node{constructor(e){super();u(this,"easing");u(this,"_keyframes",[]);u(this,"_starting",!1);u(this,"_startProps",new WeakMap);this._onUpdateTime=this._onUpdateTime.bind(this),this.setProperties(e)}_enterTree(){var e;(e=this._tree)==null||e.timeline.on("update",this._onUpdateTime),this._updateStartProps()}_exitTree(){var e;(e=this._tree)==null||e.timeline.off("update",this._onUpdateTime),this.cancel()}_onUpdateProperty(e,t,i){switch(super._onUpdateProperty(e,t,i),e){case"mode":case"keyframes":this._updateKeyframes();break}}_getTargets(){var t;let e;switch(this.mode){case"sibling":e=((t=this.getParent())==null?void 0:t.getChildren(!0).filter(i=>i instanceof g.CanvasItem))??[];break;case"parent":default:e=[this.getParent()].filter(Boolean);break}return e.map(i=>i.style)}_updateKeyframes(){const e=[],t=this.keyframes;for(let o=t.length,a=0;a<o;a++){const{offset:l=a===0?0:a/(o-1),easing:h="linear",...c}=t[a];e.push({offset:l,easing:this._parseEasing(h),props:c})}const i=e[0],s=e[e.length-1];i&&i.offset!==0&&e.unshift({offset:0,easing:this._parseEasing("linear"),props:{}}),s&&s.offset!==1&&e.push({offset:1,easing:this._parseEasing("linear"),props:{}}),this._keyframes=e,this._updateStartProps()}_onUpdateTime(){if(!this.keyframes.length)return;if(this.isVisible())this._starting||(this._starting=!0,this._updateStartProps());else{if(!this._starting)return;this._starting=!1}const e=this._getTargets(),t=1/e.length,i=this.visibleProgress;e.forEach((s,o)=>{const a=t===1?i:xt(0,Math.max(0,i-t*o)/t,1),l=this._startProps.get(s);if(!l)return;const h=this._parseKeyframes(a,l);h!=null&&h.length&&this._commitStyle(a,s,l,h[0],h[1])})}_updateStartProps(){this.cancel(),this._getTargets().forEach(e=>{const t=new Map,i=this._keyframes;for(let s=i.length,o=0;o<s;o++)Object.keys(i[o].props).forEach(a=>{t.set(a,e[a])});this._startProps.set(e,t)})}_parseEasing(e){if(!e)return li.linear;if(e in li)return li[e];const t=e.replace(/cubic-bezier\((.+)\)/,"$1").split(",").map(i=>Number(i));return sr(t[0],t[1],t[2],t[3])}_parseKeyframes(e,t){let i;const s=this._keyframes;for(let o=s.length,a=0;a<o;a++){const l=s[a],{offset:h,easing:c}=l,f={...l.props};if(i&&e<=h){const{offset:p,easing:d}=i,m={...i.props};return t.forEach((v,y)=>{(!(y in m)||m[y]===null)&&(m[y]=v),(!(y in f)||f[y]===null)&&(f[y]=v)}),[{offset:p,easing:d,props:m},{offset:h,easing:c,props:f}]}i=l}return null}_commitStyle(e,t,i,s,o){const{offset:a,easing:l,props:h}=s,{offset:c,props:f}=o,p=c-a,d=l((e-a)/p),m={width:t.width,height:t.height,fontSize:t.fontSize};i.forEach((v,y)=>{t[y]=this._getDiffValue(y,h[y],f[y],d,m)})}_getDiffValue(e,t,i,s,o){let a,l;if(t===void 0||i===void 0)if(t!==void 0)a=pr(e,String(t),o),l=Vi(a);else if(i!==void 0)l=pr(e,String(i),o),a=Vi(l);else return;else a=pr(e,String(t),o),l=pr(e,String(i),o);if(Array.isArray(a)&&Array.isArray(l)){const h=new Set,c={},f={};a.forEach(({name:d,args:m})=>{c[d]=m,h.add(d)}),l.forEach(({name:d,args:m})=>{f[d]=m,h.add(d)});let p="";return h.forEach(d=>{var S,C;const m=Math.max(((S=c[d])==null?void 0:S.length)??0,((C=f[d])==null?void 0:C.length)??0),v=c[d],y=f[d];p+=`${d}(${Array.from({length:m},(x,T)=>{const b=v==null?void 0:v[T],P=y==null?void 0:y[T],E=(b==null?void 0:b.normalizedIntValue)??0,w=(P==null?void 0:P.normalizedIntValue)??0;return Number.isNaN(E)||Number.isNaN(w)?(P==null?void 0:P.value)??0:fe(E,w,s)}).join(", ")}) `}),p}else if(!Array.isArray(a)&&!Array.isArray(l))return Number.isNaN(a.normalizedIntValue)||Number.isNaN(l.normalizedIntValue)?l.value:fe(a.normalizedIntValue,l.normalizedIntValue,s)}cancel(){this._getTargets().forEach(e=>{var t;(t=this._startProps.get(e))==null||t.forEach((i,s)=>{e[s]=i}),this._startProps.delete(e)})}},Nt([A({default:"parent"})],g.Animation2D.prototype,"mode",2),Nt([A({default:!1})],g.Animation2D.prototype,"loop",2),Nt([A({default:[]})],g.Animation2D.prototype,"keyframes",2),Nt([A()],g.Animation2D.prototype,"easing",2),Nt([A({alias:"visibleDelay",default:0})],g.Animation2D.prototype,"delay",2),Nt([A({alias:"visibleDuration",default:2e3})],g.Animation2D.prototype,"duration",2),g.Animation2D=Nt([H("Animation2D")],g.Animation2D);var Pc=Object.defineProperty,Cc=Object.getOwnPropertyDescriptor,Ec=(n,r,e,t)=>{for(var i=t>1?void 0:t?Cc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Pc(r,e,i),i};g.Node2D=class extends g.CanvasItem{constructor(e){super();u(this,"_transform",new qe);u(this,"_parentTransformDirtyId");this.setProperties(e)}getBoundingBox(){let{left:e,top:t,width:i,height:s,rotate:o}=this.style;if(o){o=Math.abs(o%180),o=o/180*Math.PI;const a=Math.abs(Math.sin(o)),l=Math.abs(Math.cos(o)),h=s*a+i*l,c=s*l+i*a;e+=(i-h)/2,t+=(s-c)/2,i=h,s=c}return new Y(e,t,i,s)}_onUpdateStyleProperty(e,t,i){switch(super._onUpdateStyleProperty(e,t,i),e){case"width":case"height":this.mask instanceof g.Node2D&&(this.mask.style.width=this.style.width,this.mask.style.height=this.style.height),this.requestRedraw();case"scaleX":case"scaleY":case"left":case"top":case"rotate":case"transform":case"transformOrigin":this._updateTransform();break;case"overflow":this._updateOverflow();break}}_updateTransform(){const e=this.getParent(),t=e==null?void 0:e._transform;this._parentTransformDirtyId=t==null?void 0:t.dirtyId;const i=this.style.getComputedTransform().toArray();let s;if(t){const o=t.toArray();s=[i[0]*o[0]+i[3]*o[1],i[1]*o[0]+i[4]*o[1],i[2]*o[0]+i[5]*o[1]+o[2],i[0]*o[3]+i[3]*o[4],i[1]*o[3]+i[4]*o[4],i[2]*o[3]+i[5]*o[4]+o[5],0,0,1]}else s=i;this._transform.set(s),this._updateOverflow(),this.requestReflow()}_updateOverflow(){if(this.style.overflow==="hidden"){const[e,t,i,s,o,a]=this._transform.toArray(),l=this.style.width,h=this.style.height;this.mask={x:i,y:a,width:e*l+t*h,height:s*l+o*h}}else this.mask=void 0}_transformVertices(e){const[t,i,s,o,a,l]=this._transform.toArray(),h=e.slice();for(let c=e.length,f=0;f<c;f+=2){const p=e[f],d=e[f+1];h[f]=t*p+i*d+s,h[f+1]=o*p+a*d+l}return h}_reflow(e){return super._reflow(e.map(t=>({...t,vertices:this._transformVertices(t.vertices)})))}_process(e){var i;const t=this.getParent();((i=t==null?void 0:t._transform)==null?void 0:i.dirtyId)!==this._parentTransformDirtyId&&this._updateTransform(),super._process(e)}input(e){if(super.input(e),!e.target&&this.isRenderable()){const{screenX:t,screenY:i}=e;if(t&&i){const{width:s,height:o}=this.style,[a,l]=this._transform.inverse().applyToPoint(t,i);a>=0&&a<s&&l>=0&&l<o&&(e.target=this)}}}},g.Node2D=Ec([H({tag:"Node2D",renderable:!0})],g.Node2D);var Tc=Object.defineProperty,Sc=Object.getOwnPropertyDescriptor,ge=(n,r,e,t)=>{for(var i=t>1?void 0:t?Sc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Tc(r,e,i),i};function ye(n){return function(r,e){Object.defineProperty(r.constructor.prototype,e,{get(){return n!=null&&n.method?(...t)=>(this.context[e].call(this.context,...t),n.redraw&&this.requestRedraw(),r):this.context[e]},set(t){this.context[e]=t},configurable:!0,enumerable:!0})}}g.Graphics2D=class extends g.Node2D{constructor(){super(...arguments);u(this,"_resetContext",!1);u(this,"lineCap");u(this,"lineJoin");u(this,"fillStyle");u(this,"strokeStyle");u(this,"lineWidth");u(this,"miterLimit")}drawCircle(e,t,i){return this.arc(e+i,t+i,i,0,le),this.fill(),this}drawEllipse(e,t,i,s){const o=i/2,a=s/2;return this.ellipse(e+o,t+a,o,a,0,0,le),this.fill(),this}},ge([ye()],g.Graphics2D.prototype,"lineCap",2),ge([ye()],g.Graphics2D.prototype,"lineJoin",2),ge([ye()],g.Graphics2D.prototype,"fillStyle",2),ge([ye()],g.Graphics2D.prototype,"strokeStyle",2),ge([ye()],g.Graphics2D.prototype,"lineWidth",2),ge([ye()],g.Graphics2D.prototype,"miterLimit",2),ge([ye({method:!0})],g.Graphics2D.prototype,"rect",2),ge([ye({method:!0,redraw:!0})],g.Graphics2D.prototype,"fillRect",2),ge([ye({method:!0,redraw:!0})],g.Graphics2D.prototype,"strokeRect",2),ge([ye({method:!0})],g.Graphics2D.prototype,"roundRect",2),ge([ye({method:!0})],g.Graphics2D.prototype,"ellipse",2),ge([ye({method:!0})],g.Graphics2D.prototype,"arc",2),ge([ye({method:!0})],g.Graphics2D.prototype,"beginPath",2),ge([ye({method:!0})],g.Graphics2D.prototype,"moveTo",2),ge([ye({method:!0})],g.Graphics2D.prototype,"lineTo",2),ge([ye({method:!0})],g.Graphics2D.prototype,"closePath",2),ge([ye({method:!0,redraw:!0})],g.Graphics2D.prototype,"fill",2),ge([ye({method:!0,redraw:!0})],g.Graphics2D.prototype,"stroke",2),g.Graphics2D=ge([H("Graphics2D")],g.Graphics2D);class hi extends wt{constructor(e){super();u(this,"frames");let t;if(Array.isArray(e))t=e;else if(e instanceof de)t=[{texture:e,duration:0}];else throw new TypeError("Failed new Image2DResource");this.frames=t,this.updateDuration()}updateDuration(){return this.duration=this.frames.reduce((e,t)=>t.duration+e,0),this}destroy(){this.frames.forEach(e=>{e.texture.destroy()})}}var Mc=Object.defineProperty,Ac=Object.getOwnPropertyDescriptor,ci=(n,r,e,t)=>{for(var i=t>1?void 0:t?Ac(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Mc(r,e,i),i};g.Image2D=class extends g.Node2D{constructor(e){super();u(this,"resource");u(this,"_frameIndex",0);u(this,"_complete",!1);u(this,"_wait",Promise.resolve());this.setProperties(e)}get currentTexture(){var e,t;return(t=(e=this.resource)==null?void 0:e.frames[this._frameIndex])==null?void 0:t.texture}get duration(){var e;return((e=this.resource)==null?void 0:e.duration)??0}get naturalWidth(){var e;return((e=this.currentTexture)==null?void 0:e.realWidth)??0}get naturalHeight(){var e;return((e=this.currentTexture)==null?void 0:e.realHeight)??0}get complete(){return this._complete}_onUpdateProperty(e,t,i){switch(super._onUpdateProperty(e,t,i),e){case"src":this._wait=this._load(t);break}}decode(){return this._wait}setResource(e){let t;if(e instanceof hi?t=e:t=new hi(e),this.resource=t.updateDuration(),this.currentTexture&&(!this.style.width||!this.style.height)){const i=this.currentTexture;this.style.width=i.realWidth,this.style.height=i.realHeight}return this}async _load(e){if(this._complete=!1,e)try{this.setResource(this.gif?await mt.gif.load(e):await mt.texture.load(e)),this.requestRedraw(),this.emit("load")}catch(t){console.warn(t),this.emit("error",t)}else this.resource=void 0;this._complete=!0}_getCurrentTime(){var i;const e=((i=this.resource)==null?void 0:i.duration)??0;if(!e||!this._tree)return 0;const t=this.visibleRelativeTime;return t<0?0:t%e}_updateFrameIndex(){if(!this.resource)return this;const e=this._getCurrentTime(),t=this.resource.frames,i=t.length;if(i<=1&&this._frameIndex===0)return this;let s=i-1;for(let o=0,a=0;a<i;a++)if(o+=t[a].duration??0,o>=e){s=a;break}return this._frameIndex!==s&&(this._frameIndex=s,this.requestRepaint()),this}_process(e){this._updateFrameIndex(),super._process(e)}_drawContent(){const e=this.currentTexture;e!=null&&e.valid&&(this.context.fillStyle=e,this.context.textureTransform=new qe().scale(this.style.width/e.width,this.style.height/e.height),super._drawContent())}_repaint(e){const t=this.currentTexture;return super._repaint(e.map((i,s)=>(this._backgroundImage?s===1:s===0)&&i.type==="fill"?{...i,texture:t!=null&&t.valid?t:void 0}:i))}},ci([ee()],g.Image2D.prototype,"resource",2),ci([A({default:!1})],g.Image2D.prototype,"gif",2),ci([A({default:""})],g.Image2D.prototype,"src",2),g.Image2D=ci([H("Image2D")],g.Image2D);var Oc=Object.defineProperty,Uc=Object.getOwnPropertyDescriptor,ws=(n,r,e,t)=>{for(var i=t>1?void 0:t?Uc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Oc(r,e,i),i};g.Lottie2D=class extends g.Node2D{constructor(e){super();u(this,"duration",0);u(this,"texture",new de(document.createElement("canvas")));u(this,"animation");this.setProperties(e)}_onUpdateProperty(e,t,i){switch(super._onUpdateProperty(e,t,i),e){case"src":this._load();break}}_onUpdateStyleProperty(e,t,i){switch(super._onUpdateStyleProperty(e,t,i),e){case"width":this.texture.source.width=this.style.width*this.pixelRatio;break;case"height":this.texture.source.height=this.style.height*this.pixelRatio;break}}async _load(){this.animation=await mt.lottie.load(this.src,this.texture.source),this.duration=this.animation.getDuration(!1)*1e3,this.texture.requestUpload(),this.requestRedraw()}_process(e){var t;(t=this.animation)==null||t.goToAndStop(this.visibleRelativeTime,!1),this.texture.requestUpload(),this.requestRepaint(),super._process(e)}_drawContent(){const e=this.texture;e.valid&&(this.context.fillStyle=e,this.context.textureTransform=new qe().scale(this.style.width/e.width,this.style.height/e.height),super._drawContent())}},ws([A({default:2})],g.Lottie2D.prototype,"pixelRatio",2),ws([A({default:""})],g.Lottie2D.prototype,"src",2),g.Lottie2D=ws([H("Lottie2D")],g.Lottie2D);var Te=Uint8Array,Ve=Uint16Array,xs=Int32Array,ui=new Te([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]),fi=new Te([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]),Ps=new Te([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Vo=function(n,r){for(var e=new Ve(31),t=0;t<31;++t)e[t]=r+=1<<n[t-1];for(var i=new xs(e[30]),t=1;t<30;++t)for(var s=e[t];s<e[t+1];++s)i[s]=s-e[t]<<5|t;return{b:e,r:i}},jo=Vo(ui,2),Go=jo.b,Cs=jo.r;Go[28]=258,Cs[258]=28;for(var qo=Vo(fi,0),Dc=qo.b,Wo=qo.r,Es=new Ve(32768),re=0;re<32768;++re){var Tt=(re&43690)>>1|(re&21845)<<1;Tt=(Tt&52428)>>2|(Tt&13107)<<2,Tt=(Tt&61680)>>4|(Tt&3855)<<4,Es[re]=((Tt&65280)>>8|(Tt&255)<<8)>>1}for(var lt=function(n,r,e){for(var t=n.length,i=0,s=new Ve(r);i<t;++i)n[i]&&++s[n[i]-1];var o=new Ve(r);for(i=1;i<r;++i)o[i]=o[i-1]+s[i-1]<<1;var a;if(e){a=new Ve(1<<r);var l=15-r;for(i=0;i<t;++i)if(n[i])for(var h=i<<4|n[i],c=r-n[i],f=o[n[i]-1]++<<c,p=f|(1<<c)-1;f<=p;++f)a[Es[f]>>l]=h}else for(a=new Ve(t),i=0;i<t;++i)n[i]&&(a[i]=Es[o[n[i]-1]++]>>15-n[i]);return a},St=new Te(288),re=0;re<144;++re)St[re]=8;for(var re=144;re<256;++re)St[re]=9;for(var re=256;re<280;++re)St[re]=7;for(var re=280;re<288;++re)St[re]=8;for(var Sr=new Te(32),re=0;re<32;++re)Sr[re]=5;var Ic=lt(St,9,0),Rc=lt(St,9,1),Bc=lt(Sr,5,0),Lc=lt(Sr,5,1),Ts=function(n){for(var r=n[0],e=1;e<n.length;++e)n[e]>r&&(r=n[e]);return r},Qe=function(n,r,e){var t=r/8|0;return(n[t]|n[t+1]<<8)>>(r&7)&e},Ss=function(n,r){var e=r/8|0;return(n[e]|n[e+1]<<8|n[e+2]<<16)>>(r&7)},Ms=function(n){return(n+7)/8|0},Xo=function(n,r,e){return(e==null||e>n.length)&&(e=n.length),new Te(n.subarray(r,e))},kc=["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"],et=function(n,r,e){var t=new Error(r||kc[n]);if(t.code=n,Error.captureStackTrace&&Error.captureStackTrace(t,et),!e)throw t;return t},Nc=function(n,r,e,t){var i=n.length,s=0;if(!i||r.f&&!r.l)return e||new Te(0);var o=!e,a=o||r.i!=2,l=r.i;o&&(e=new Te(i*3));var h=function(Le){var Fe=e.length;if(Le>Fe){var Ce=new Te(Math.max(Fe*2,Le));Ce.set(e),e=Ce}},c=r.f||0,f=r.p||0,p=r.b||0,d=r.l,m=r.d,v=r.m,y=r.n,S=i*8;do{if(!d){c=Qe(n,f,1);var C=Qe(n,f+1,3);if(f+=3,C)if(C==1)d=Rc,m=Lc,v=9,y=5;else if(C==2){var P=Qe(n,f,31)+257,E=Qe(n,f+10,15)+4,w=P+Qe(n,f+5,31)+1;f+=14;for(var D=new Te(w),F=new Te(19),B=0;B<E;++B)F[Ps[B]]=Qe(n,f+B*3,7);f+=E*3;for(var U=Ts(F),V=(1<<U)-1,M=lt(F,U,1),B=0;B<w;){var N=M[Qe(n,f,V)];f+=N&15;var x=N>>4;if(x<16)D[B++]=x;else{var q=0,R=0;for(x==16?(R=3+Qe(n,f,3),f+=2,q=D[B-1]):x==17?(R=3+Qe(n,f,7),f+=3):x==18&&(R=11+Qe(n,f,127),f+=7);R--;)D[B++]=q}}var I=D.subarray(0,P),j=D.subarray(P);v=Ts(I),y=Ts(j),d=lt(I,v,1),m=lt(j,y,1)}else et(1);else{var x=Ms(f)+4,T=n[x-4]|n[x-3]<<8,b=x+T;if(b>i){l&&et(0);break}a&&h(p+T),e.set(n.subarray(x,b),p),r.b=p+=T,r.p=f=b*8,r.f=c;continue}if(f>S){l&&et(0);break}}a&&h(p+131072);for(var k=(1<<v)-1,L=(1<<y)-1,K=f;;K=f){var q=d[Ss(n,f)&k],X=q>>4;if(f+=q&15,f>S){l&&et(0);break}if(q||et(2),X<256)e[p++]=X;else if(X==256){K=f,d=null;break}else{var W=X-254;if(X>264){var B=X-257,G=ui[B];W=Qe(n,f,(1<<G)-1)+Go[B],f+=G}var Q=m[Ss(n,f)&L],Z=Q>>4;Q||et(3),f+=Q&15;var j=Dc[Z];if(Z>3){var G=fi[Z];j+=Ss(n,f)&(1<<G)-1,f+=G}if(f>S){l&&et(0);break}a&&h(p+131072);var ae=p+W;if(p<j){var ut=s-j,Ze=Math.min(j,ae);for(ut+p<0&&et(3);p<Ze;++p)e[p]=t[ut+p]}for(;p<ae;++p)e[p]=e[p-j]}}r.l=d,r.p=K,r.b=p,r.f=c,d&&(c=1,r.m=v,r.d=m,r.n=y)}while(!c);return p!=e.length&&o?Xo(e,0,p):e.subarray(0,p)},yt=function(n,r,e){e<<=r&7;var t=r/8|0;n[t]|=e,n[t+1]|=e>>8},Mr=function(n,r,e){e<<=r&7;var t=r/8|0;n[t]|=e,n[t+1]|=e>>8,n[t+2]|=e>>16},As=function(n,r){for(var e=[],t=0;t<n.length;++t)n[t]&&e.push({s:t,f:n[t]});var i=e.length,s=e.slice();if(!i)return{t:Ko,l:0};if(i==1){var o=new Te(e[0].s+1);return o[e[0].s]=1,{t:o,l:1}}e.sort(function(b,P){return b.f-P.f}),e.push({s:-1,f:25001});var a=e[0],l=e[1],h=0,c=1,f=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=e[e[h].f<e[f].f?h++:f++],l=e[h!=c&&e[h].f<e[f].f?h++:f++],e[c++]={s:-1,f:a.f+l.f,l:a,r:l};for(var p=s[0].s,t=1;t<i;++t)s[t].s>p&&(p=s[t].s);var d=new Ve(p+1),m=Os(e[c-1],d,0);if(m>r){var t=0,v=0,y=m-r,S=1<<y;for(s.sort(function(P,E){return d[E.s]-d[P.s]||P.f-E.f});t<i;++t){var C=s[t].s;if(d[C]>r)v+=S-(1<<m-d[C]),d[C]=r;else break}for(v>>=y;v>0;){var x=s[t].s;d[x]<r?v-=1<<r-d[x]++-1:++t}for(;t>=0&&v;--t){var T=s[t].s;d[T]==r&&(--d[T],++v)}m=r}return{t:new Te(d),l:m}},Os=function(n,r,e){return n.s==-1?Math.max(Os(n.l,r,e+1),Os(n.r,r,e+1)):r[n.s]=e},Ho=function(n){for(var r=n.length;r&&!n[--r];);for(var e=new Ve(++r),t=0,i=n[0],s=1,o=function(l){e[t++]=l},a=1;a<=r;++a)if(n[a]==i&&a!=r)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=n[a]}return{c:e.subarray(0,t),n:r}},Ar=function(n,r){for(var e=0,t=0;t<r.length;++t)e+=n[t]*r[t];return e},Yo=function(n,r,e){var t=e.length,i=Ms(r+2);n[i]=t&255,n[i+1]=t>>8,n[i+2]=n[i]^255,n[i+3]=n[i+1]^255;for(var s=0;s<t;++s)n[i+s+4]=e[s];return(i+4+t)*8},Zo=function(n,r,e,t,i,s,o,a,l,h,c){yt(r,c++,e),++i[256];for(var f=As(i,15),p=f.t,d=f.l,m=As(s,15),v=m.t,y=m.l,S=Ho(p),C=S.c,x=S.n,T=Ho(v),b=T.c,P=T.n,E=new Ve(19),w=0;w<C.length;++w)++E[C[w]&31];for(var w=0;w<b.length;++w)++E[b[w]&31];for(var D=As(E,7),F=D.t,B=D.l,U=19;U>4&&!F[Ps[U-1]];--U);var V=h+5<<3,M=Ar(i,St)+Ar(s,Sr)+o,N=Ar(i,p)+Ar(s,v)+o+14+3*U+Ar(E,F)+2*E[16]+3*E[17]+7*E[18];if(l>=0&&V<=M&&V<=N)return Yo(r,c,n.subarray(l,l+h));var q,R,I,j;if(yt(r,c,1+(N<M)),c+=2,N<M){q=lt(p,d,0),R=p,I=lt(v,y,0),j=v;var k=lt(F,B,0);yt(r,c,x-257),yt(r,c+5,P-1),yt(r,c+10,U-4),c+=14;for(var w=0;w<U;++w)yt(r,c+3*w,F[Ps[w]]);c+=3*U;for(var L=[C,b],K=0;K<2;++K)for(var X=L[K],w=0;w<X.length;++w){var W=X[w]&31;yt(r,c,k[W]),c+=F[W],W>15&&(yt(r,c,X[w]>>5&127),c+=X[w]>>12)}}else q=Ic,R=St,I=Bc,j=Sr;for(var w=0;w<a;++w){var G=t[w];if(G>255){var W=G>>18&31;Mr(r,c,q[W+257]),c+=R[W+257],W>7&&(yt(r,c,G>>23&31),c+=ui[W]);var Q=G&31;Mr(r,c,I[Q]),c+=j[Q],Q>3&&(Mr(r,c,G>>5&8191),c+=fi[Q])}else Mr(r,c,q[G]),c+=R[G]}return Mr(r,c,q[256]),c+R[256]},Fc=new xs([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ko=new Te(0),$c=function(n,r,e,t,i,s){var o=s.z||n.length,a=new Te(t+o+5*(1+Math.ceil(o/7e3))+i),l=a.subarray(t,a.length-i),h=s.l,c=(s.r||0)&7;if(r){c&&(l[0]=s.r>>3);for(var f=Fc[r-1],p=f>>13,d=f&8191,m=(1<<e)-1,v=s.p||new Ve(32768),y=s.h||new Ve(m+1),S=Math.ceil(e/3),C=2*S,x=function($e){return(n[$e]^n[$e+1]<<S^n[$e+2]<<C)&m},T=new xs(25e3),b=new Ve(288),P=new Ve(32),E=0,w=0,D=s.i||0,F=0,B=s.w||0,U=0;D+2<o;++D){var V=x(D),M=D&32767,N=y[V];if(v[M]=N,y[V]=M,B<=D){var q=o-D;if((E>7e3||F>24576)&&(q>423||!h)){c=Zo(n,l,0,T,b,P,w,F,U,D-U,c),F=E=w=0,U=D;for(var R=0;R<286;++R)b[R]=0;for(var R=0;R<30;++R)P[R]=0}var I=2,j=0,k=d,L=M-N&32767;if(q>2&&V==x(D-L))for(var K=Math.min(p,q)-1,X=Math.min(32767,D),W=Math.min(258,q);L<=X&&--k&&M!=N;){if(n[D+I]==n[D+I-L]){for(var G=0;G<W&&n[D+G]==n[D+G-L];++G);if(G>I){if(I=G,j=L,G>K)break;for(var Q=Math.min(L,G-2),Z=0,R=0;R<Q;++R){var ae=D-L+R&32767,ut=v[ae],Ze=ae-ut&32767;Ze>Z&&(Z=Ze,N=ae)}}}M=N,N=v[M],L+=M-N&32767}if(j){T[F++]=268435456|Cs[I]<<18|Wo[j];var Le=Cs[I]&31,Fe=Wo[j]&31;w+=ui[Le]+fi[Fe],++b[257+Le],++P[Fe],B=D+I,++E}else T[F++]=n[D],++b[n[D]]}}for(D=Math.max(D,B);D<o;++D)T[F++]=n[D],++b[n[D]];c=Zo(n,l,h,T,b,P,w,F,U,D-U,c),h||(s.r=c&7|l[c/8|0]<<3,c-=7,s.h=y,s.p=v,s.i=D,s.w=B)}else{for(var D=s.w||0;D<o+h;D+=65535){var Ce=D+65535;Ce>=o&&(l[c/8|0]=h,Ce=o),c=Yo(l,c+1,n.subarray(D,Ce))}s.i=o}return Xo(a,0,t+Ms(c)+i)},Jo=function(){var n=1,r=0;return{p:function(e){for(var t=n,i=r,s=e.length|0,o=0;o!=s;){for(var a=Math.min(o+2655,s);o<a;++o)i+=t+=e[o];t=(t&65535)+15*(t>>16),i=(i&65535)+15*(i>>16)}n=t,r=i},d:function(){return n%=65521,r%=65521,(n&255)<<24|(n&65280)<<8|(r&255)<<8|r>>8}}},zc=function(n,r,e,t,i){if(!i&&(i={l:1},r.dictionary)){var s=r.dictionary.subarray(-32768),o=new Te(s.length+n.length);o.set(s),o.set(n,s.length),n=o,i.w=s.length}return $c(n,r.level==null?6:r.level,r.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):20:12+r.mem,e,t,i)},Qo=function(n,r,e){for(;e;++r)n[r]=e,e>>>=8},Vc=function(n,r){var e=r.level,t=e==0?0:e<6?1:e==9?3:2;if(n[0]=120,n[1]=t<<6|(r.dictionary&&32),n[1]|=31-(n[0]<<8|n[1])%31,r.dictionary){var i=Jo();i.p(r.dictionary),Qo(n,2,i.d())}},jc=function(n,r){return((n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31)&&et(6,"invalid zlib data"),(n[1]>>5&1)==+!r&&et(6,"invalid zlib data: "+(n[1]&32?"need":"unexpected")+" dictionary"),(n[1]>>3&4)+2};function Gc(n,r){r||(r={});var e=Jo();e.p(n);var t=zc(n,r,r.dictionary?6:2,4);return Vc(t,r),Qo(t,t.length-4,e.d()),t}function qc(n,r){return Nc(n.subarray(jc(n,r),-4),{i:2},r,r)}var Wc=typeof TextDecoder<"u"&&new TextDecoder,Xc=0;try{Wc.decode(Ko,{stream:!0}),Xc=1}catch{}const Hc="modern-font";function Or(n,r){if(!n)throw new Error(`[${Hc}] ${r}`)}function Yc(n){if("buffer"in n){const r=n.buffer;return n.byteOffset>0||n.byteLength<n.buffer.byteLength?r.slice(n.byteOffset,n.byteOffset+n.byteLength):r}else return n}function nr(n){return"buffer"in n?new DataView(n.buffer,n.byteOffset,n.byteLength):new DataView(n)}function Zc(n){let r="";for(let e=0,t=n.length,i;e<t;e++)i=n.charCodeAt(e),i!==0&&(r+=String.fromCharCode(i));return r}function di(n){n=Zc(n);const r=[];for(let e=0,t=n.length,i;e<t;e++)i=n.charCodeAt(e),r.push(i>>8),r.push(i&255);return r}function Kc(n){let r="";for(let e=0,t=n.length;e<t;e++)n[e]<127?r+=String.fromCharCode(n[e]):r+=`%${(256+n[e]).toString(16).slice(1)}`;return unescape(r)}function Jc(n){let r="";for(let e=0,t=n.length;e<t;e+=2)r+=String.fromCharCode((n[e]<<8)+n[e+1]);return r}var Qc=Object.defineProperty,Se=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&Qc(r,e,i),i};const Ur={int8:1,int16:2,int32:4,uint8:1,uint16:2,uint32:4,float32:4,float64:8,fixed:4,longDateTime:8,char:1};function Me(){return function(n,r){Object.defineProperty(n.constructor.prototype,r,{get(){if(typeof r=="string"){if(r.startsWith("read"))return(...e)=>this.read(r.substring(4).toLowerCase(),...e);if(r.startsWith("write"))return(...e)=>this.write(r.substring(5).toLowerCase(),...e)}},configurable:!0,enumerable:!0})}}class ve extends DataView{constructor(e,t,i,s){super(Yc(e),t,i);u(this,"cursor",0);this.littleEndian=s}readColumn(e){if(e.size){const t=Array.from({length:e.size},(i,s)=>this.read(e.type,e.offset+s));switch(e.type){case"char":return t.join("");default:return t}}else return this.read(e.type,e.offset)}writeColumn(e,t){e.size?Array.from({length:e.size},(i,s)=>{this.write(e.type,t[s],e.offset+s)}):this.write(e.type,t,e.offset)}read(e,t=this.cursor,i=this.littleEndian){var h;switch(e){case"char":return this.readChar(t);case"fixed":return this.readFixed(t,i);case"longDateTime":return this.readLongDateTime(t,i)}const s=`get${e.replace(/^\S/,c=>c.toUpperCase())}`,o=this,a=(h=o[s])==null?void 0:h.bind(o),l=a==null?void 0:a(t,i);return this.cursor+=Ur[e],l}readUint24(e=this.cursor){const[t,i,s]=this.readBytes(e,3);return(t<<16)+(i<<8)+s}readBytes(e,t){t==null&&(t=e,e=this.cursor);const i=[];for(let s=0;s<t;++s)i.push(this.getUint8(e+s));return this.cursor=e+t,i}readString(e,t){const i=this.readBytes(e,t);let s="";for(let o=0,a=i.length;o<a;o++)s+=String.fromCharCode(i[o]);return s}readFixed(e,t){const i=this.readInt32(e,t)/65536;return Math.ceil(i*1e5)/1e5}readLongDateTime(e=this.cursor,t){const i=this.readUint32(e+4,t),s=new Date;return s.setTime(i*1e3+-20775456e5),s}readChar(e){return this.readString(e,1)}write(e,t,i=this.cursor,s=this.littleEndian){var c;switch(e){case"char":return this.writeChar(t,i);case"fixed":return this.writeFixed(t,i);case"longDateTime":return this.writeLongDateTime(t,i)}const o=`set${e.replace(/^\S/,f=>f.toUpperCase())}`,a=this,l=(c=a[o])==null?void 0:c.bind(a),h=l==null?void 0:l(i,t,s);return this.cursor+=Ur[e.toLowerCase()],h}writeString(e="",t=this.cursor){const i=e.replace(/[^\x00-\xFF]/g,"11").length;this.seek(t);for(let s=0,o=e.length,a;s<o;++s)a=e.charCodeAt(s)||0,a>127?this.writeUint16(a):this.writeUint8(a);return this.cursor+=i,this}writeChar(e,t){return this.writeString(e,t)}writeFixed(e,t){return this.writeInt32(Math.round(e*65536),t),this}writeLongDateTime(e,t=this.cursor){typeof e>"u"?e=-20775456e5:typeof e.getTime=="function"?e=e.getTime():/^\d+$/.test(e)?e=+e:e=Date.parse(e);const s=Math.round((e- -20775456e5)/1e3);return this.writeUint32(0,t),this.writeUint32(s,t+4),this}writeBytes(e,t=this.cursor){let i;if(Array.isArray(e)){i=e.length;for(let s=0;s<i;++s)this.setUint8(t+s,e[s])}else{const s=nr(e);i=s.byteLength;for(let o=0;o<i;++o)this.setUint8(t+o,s.getUint8(o))}return this.cursor=t+i,this}seek(e){return this.cursor=e,this}}Se([Me()],ve.prototype,"readInt8"),Se([Me()],ve.prototype,"readInt16"),Se([Me()],ve.prototype,"readInt32"),Se([Me()],ve.prototype,"readUint8"),Se([Me()],ve.prototype,"readUint16"),Se([Me()],ve.prototype,"readUint32"),Se([Me()],ve.prototype,"readFloat32"),Se([Me()],ve.prototype,"readFloat64"),Se([Me()],ve.prototype,"writeInt8"),Se([Me()],ve.prototype,"writeInt16"),Se([Me()],ve.prototype,"writeInt32"),Se([Me()],ve.prototype,"writeUint8"),Se([Me()],ve.prototype,"writeUint16"),Se([Me()],ve.prototype,"writeUint32"),Se([Me()],ve.prototype,"writeFloat32"),Se([Me()],ve.prototype,"writeFloat64");const ea=new WeakMap;function _(n){const r=typeof n=="object"?n:{type:n},{size:e=1,type:t}=r;return(i,s)=>{if(typeof s!="string")return;let o=ea.get(i);o||(o={columns:[],byteLength:0},ea.set(i,o));const a={...r,name:s,byteLength:e*Ur[t],offset:r.offset??o.columns.reduce((l,h)=>l+h.byteLength,0)};o.columns.push(a),o.byteLength=o.columns.reduce((l,h)=>l+Ur[h.type]*(h.size??1),0),Object.defineProperty(i.constructor.prototype,s,{get(){return this.view.readColumn(a)},set(l){this.view.writeColumn(a,l)},configurable:!0,enumerable:!0})}}class je{constructor(r,e,t,i){u(this,"view");this.view=new ve(r,e,t,i)}}class pi extends je{get buffer(){return this.view.buffer}toBuffer(){return this.view.buffer.slice(this.view.byteOffset,this.view.byteOffset+this.view.byteLength)}toBlob(){return new Blob([new Uint8Array(this.view.buffer,this.view.byteOffset,this.view.byteLength)],{type:this.mimeType})}toFontFace(r){return new FontFace(r,this.view.buffer)}}var eu=Object.defineProperty,De=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&eu(r,e,i),i};const Ie=class sl extends pi{constructor(){super(...arguments);u(this,"format","EmbeddedOpenType");u(this,"mimeType","application/vnd.ms-fontobject")}static from(e){const t=e.sfnt,s=t.name.names,o=di(s.fontFamily||""),a=o.length,l=di(s.fontStyle||""),h=l.length,c=di(s.version||""),f=c.length,p=di(s.fullName||""),d=p.length,m=86+a+4+h+4+f+4+d+2+e.view.byteLength,v=new sl(new ArrayBuffer(m),0,m,!0);v.EOTSize=v.view.byteLength,v.FontDataSize=e.view.byteLength,v.Version=131073,v.Flags=0,v.Charset=1,v.MagicNumber=20556,v.Padding1=0,v.CheckSumAdjustment=t.head.checkSumAdjustment;const y=t.os2;return y&&(v.FontPANOSE=y.fontPANOSE,v.Italic=y.fsSelection,v.Weight=y.usWeightClass,v.fsType=y.fsType,v.UnicodeRange=y.ulUnicodeRange,v.CodePageRange=y.ulCodePageRange),v.view.writeUint16(a),v.view.writeBytes(o),v.view.writeUint16(0),v.view.writeUint16(h),v.view.writeBytes(l),v.view.writeUint16(0),v.view.writeUint16(f),v.view.writeBytes(c),v.view.writeUint16(0),v.view.writeUint16(d),v.view.writeBytes(p),v.view.writeUint16(0),v.view.writeUint16(0),v.view.writeBytes(e.view),v}};De([_("uint32")],Ie.prototype,"EOTSize"),De([_("uint32")],Ie.prototype,"FontDataSize"),De([_("uint32")],Ie.prototype,"Version"),De([_("uint32")],Ie.prototype,"Flags"),De([_({type:"uint8",size:10})],Ie.prototype,"FontPANOSE"),De([_("uint8")],Ie.prototype,"Charset"),De([_("uint8")],Ie.prototype,"Italic"),De([_("uint32")],Ie.prototype,"Weight"),De([_("uint16")],Ie.prototype,"fsType"),De([_("uint16")],Ie.prototype,"MagicNumber"),De([_({type:"uint8",size:16})],Ie.prototype,"UnicodeRange"),De([_({type:"uint8",size:8})],Ie.prototype,"CodePageRange"),De([_("uint32")],Ie.prototype,"CheckSumAdjustment"),De([_({type:"uint8",size:16})],Ie.prototype,"Reserved"),De([_("uint16")],Ie.prototype,"Padding1");var tu=Object.defineProperty,gi=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&tu(r,e,i),i};class or extends je{constructor(r,e){super(r,e,16)}}gi([_({type:"char",size:4})],or.prototype,"tag"),gi([_("uint32")],or.prototype,"checkSum"),gi([_("uint32")],or.prototype,"offset"),gi([_("uint32")],or.prototype,"length");const Us=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],ru=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];class Ds{constructor(r){u(this,"index");u(this,"name");u(this,"isComposite",!1);u(this,"components",[]);u(this,"pathCommands",[]);const e={...r};if(this.index=e.index??0,e.name===".notdef"?e.unicode=void 0:e.name===".null"&&(e.unicode=0),e.unicode===0&&e.name!==".null")throw new Error('The unicode value "0" is reserved for the glyph name ".null" and cannot be used by any other glyph.');this.name=e.name??null,e.unicode&&(this.unicode=e.unicode),e.unicodes?this.unicodes=e.unicodes:e.unicode&&(this.unicodes=[e.unicode])}getPathCommands(r=0,e=0,t=72,i={},s){const o=1/((s==null?void 0:s.unitsPerEm)??1e3)*t,{xScale:a=o,yScale:l=o}=i,h=this.pathCommands,c=[];for(let f=0,p=h.length;f<p;f+=1){const d=h[f];d.type==="M"?c.push({type:"M",x:r+d.x*a,y:e+-d.y*l}):d.type==="L"?c.push({type:"L",x:r+d.x*a,y:e+-d.y*l}):d.type==="Q"?c.push({type:"Q",x1:r+d.x1*a,y1:e+-d.y1*l,x:r+d.x*a,y:e+-d.y*l}):d.type==="C"?c.push({type:"C",x1:r+d.x1*a,y1:e+-d.y1*l,x2:r+d.x2*a,y2:e+-d.y2*l,x:r+d.x*a,y:e+-d.y*l}):d.type==="Z"&&c.push({type:"Z"})}return c}}class iu extends Ds{parse(r,e,t){const i=this,{nominalWidthX:s,defaultWidthX:o,gsubrsBias:a,subrsBias:l}=r,h=r.topDict.paintType,c=this.index;let f,p,d,m;const v=[],y=[];let S=0,C=!1,x=!1,T=o,b=0,P=0;function E(M,N){v.push({type:"L",x:M,y:N})}function w(M,N,q,R,I,j){v.push({type:"C",x1:M,y1:N,x2:q,y2:R,x:I,y:j})}function D(M,N){x&&h!==2&&F(),x=!0,v.push({type:"M",x:M,y:N})}function F(){v.push({type:"Z"})}function B(M){v.push(...M)}function U(){y.length%2!==0&&!C&&(T=y.shift()+s),S+=y.length>>1,y.length=0,C=!0}function V(M){let N,q,R,I,j,k,L,K,X,W,G,Q,Z=0;for(;Z<M.length;){let ae=M[Z++];switch(ae){case 1:U();break;case 3:U();break;case 4:y.length>1&&!C&&(T=y.shift()+s,C=!0),P+=y.pop(),D(b,P);break;case 5:for(;y.length>0;)b+=y.shift(),P+=y.shift(),E(b,P);break;case 6:for(;y.length>0&&(b+=y.shift(),E(b,P),y.length!==0);)P+=y.shift(),E(b,P);break;case 7:for(;y.length>0&&(P+=y.shift(),E(b,P),y.length!==0);)b+=y.shift(),E(b,P);break;case 8:for(;y.length>0;)f=b+y.shift(),p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),b=d+y.shift(),P=m+y.shift(),w(f,p,d,m,b,P);break;case 10:j=y.pop()+l,k=r.subrs[j],k&&V(k);break;case 11:return;case 12:switch(ae=M[Z],Z+=1,ae){case 35:f=b+y.shift(),p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),L=d+y.shift(),K=m+y.shift(),X=L+y.shift(),W=K+y.shift(),G=X+y.shift(),Q=W+y.shift(),b=G+y.shift(),P=Q+y.shift(),y.shift(),w(f,p,d,m,L,K),w(X,W,G,Q,b,P);break;case 34:f=b+y.shift(),p=P,d=f+y.shift(),m=p+y.shift(),L=d+y.shift(),K=m,X=L+y.shift(),W=m,G=X+y.shift(),Q=P,b=G+y.shift(),w(f,p,d,m,L,K),w(X,W,G,Q,b,P);break;case 36:f=b+y.shift(),p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),L=d+y.shift(),K=m,X=L+y.shift(),W=m,G=X+y.shift(),Q=W+y.shift(),b=G+y.shift(),w(f,p,d,m,L,K),w(X,W,G,Q,b,P);break;case 37:f=b+y.shift(),p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),L=d+y.shift(),K=m+y.shift(),X=L+y.shift(),W=K+y.shift(),G=X+y.shift(),Q=W+y.shift(),Math.abs(G-b)>Math.abs(Q-P)?b=G+y.shift():P=Q+y.shift(),w(f,p,d,m,L,K),w(X,W,G,Q,b,P);break;default:console.warn(`Glyph ${c}: unknown operator ${1200+ae}`),y.length=0}break;case 14:if(y.length>=4){const ut=Us[y.pop()],Ze=Us[y.pop()],Le=y.pop(),Fe=y.pop();if(ut&&Ze){i.isComposite=!0,i.components=[];const Ce=r.charset.indexOf(ut),$e=r.charset.indexOf(Ze);i.components.push({glyphIndex:$e,dx:0,dy:0}),i.components.push({glyphIndex:Ce,dx:Fe,dy:Le}),B(t.get($e).pathCommands);const tt=JSON.parse(JSON.stringify(t.get(Ce).pathCommands));for(let rt=0;rt<tt.length;rt+=1){const Ke=tt[rt];Ke.type!=="Z"&&(Ke.x+=Fe,Ke.y+=Le),(Ke.type==="Q"||Ke.type==="C")&&(Ke.x1+=Fe,Ke.y1+=Le),Ke.type==="C"&&(Ke.x2+=Fe,Ke.y2+=Le)}B(tt)}}else y.length>0&&!C&&(T=y.shift()+s,C=!0);x&&h!==2&&(F(),x=!1);break;case 18:U();break;case 19:case 20:U(),Z+=S+7>>3;break;case 21:y.length>2&&!C&&(T=y.shift()+s,C=!0),P+=y.pop(),b+=y.pop(),D(b,P);break;case 22:y.length>1&&!C&&(T=y.shift()+s,C=!0),b+=y.pop(),D(b,P);break;case 23:U();break;case 24:for(;y.length>2;)f=b+y.shift(),p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),b=d+y.shift(),P=m+y.shift(),w(f,p,d,m,b,P);b+=y.shift(),P+=y.shift(),E(b,P);break;case 25:for(;y.length>6;)b+=y.shift(),P+=y.shift(),E(b,P);f=b+y.shift(),p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),b=d+y.shift(),P=m+y.shift(),w(f,p,d,m,b,P);break;case 26:for(y.length%2&&(b+=y.shift());y.length>0;)f=b,p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),b=d,P=m+y.shift(),w(f,p,d,m,b,P);break;case 27:for(y.length%2&&(P+=y.shift());y.length>0;)f=b+y.shift(),p=P,d=f+y.shift(),m=p+y.shift(),b=d+y.shift(),P=m,w(f,p,d,m,b,P);break;case 28:N=M[Z],q=M[Z+1],y.push((N<<24|q<<16)>>16),Z+=2;break;case 29:j=y.pop()+a,k=r.gsubrs[j],k&&V(k);break;case 30:for(;y.length>0&&(f=b,p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),b=d+y.shift(),P=m+(y.length===1?y.shift():0),w(f,p,d,m,b,P),y.length!==0);)f=b+y.shift(),p=P,d=f+y.shift(),m=p+y.shift(),P=m+y.shift(),b=d+(y.length===1?y.shift():0),w(f,p,d,m,b,P);break;case 31:for(;y.length>0&&(f=b+y.shift(),p=P,d=f+y.shift(),m=p+y.shift(),P=m+y.shift(),b=d+(y.length===1?y.shift():0),w(f,p,d,m,b,P),y.length!==0);)f=b,p=P+y.shift(),d=f+y.shift(),m=p+y.shift(),b=d+y.shift(),P=m+(y.length===1?y.shift():0),w(f,p,d,m,b,P);break;default:ae<32?console.warn(`Glyph ${c}: unknown operator ${ae}`):ae<247?y.push(ae-139):ae<251?(N=M[Z],Z+=1,y.push((ae-247)*256+N+108)):ae<255?(N=M[Z],Z+=1,y.push(-(ae-251)*256-N-108)):(N=M[Z],q=M[Z+1],R=M[Z+2],I=M[Z+3],Z+=4,y.push((N<<24|q<<16|R<<8|I)/65536))}}}V(e),this.pathCommands=v,C&&(this.advanceWidth=T)}}class Is{constructor(r){u(this,"_items",[]);this._sfnt=r}get(r){const e=this._items[r];let t;if(e)t=e;else{t=this._get(r);const i=this._sfnt.hmtx.metrics[r];i&&(t.advanceWidth=t.advanceWidth||i.advanceWidth,t.leftSideBearing=t.leftSideBearing||i.leftSideBearing);const s=this._sfnt.cmap.glyphIndexToUnicodesMap.get(r);s&&(t.unicode??(t.unicode=s[0]),t.unicodes??(t.unicodes=s)),this._items[r]=t}return t}}class su extends Is{get length(){return this._sfnt.cff.charStringsIndex.offsets.length-1}_get(r){const e=this._sfnt.cff,t=new iu({index:r});return t.parse(e,e.charStringsIndex.get(r),this),t.name=e.charset[r],t}}var nu=Object.defineProperty,ta=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&nu(r,e,i),i};class mi extends je{constructor(e,t,i,s){super(e,t,i,s);u(this,"_offsets");u(this,"_objects");this._init()}get offsets(){return this._offsets??(this._offsets=this.readOffsets())}get objects(){return this._objects??(this._objects=this.readObjects())}_init(){const e=this.view,t=this.count,i=this.offsetSize;this.objectOffset=(t+1)*i+2,this.endOffset=e.byteOffset+this.objectOffset+this.offsets[t]}readOffsets(){const e=this.view,t=this.count,i=this.offsetSize;e.seek(3);const s=[];for(let o=0,a=t+1;o<a;o++){const l=this.view;let h=0;for(let c=0;c<i;c++)h<<=8,h+=l.readUint8();s.push(h)}return s}readObjects(){const e=[];for(let t=0,i=this.count;t<i;t++)e.push(this.get(t));return e}get(e){const t=this.offsets,i=this.objectOffset,s=i+t[e],a=i+t[e+1]-s;return this._isString?this.view.readString(s,a):this.view.readBytes(s,a)}}ta([_("uint16")],mi.prototype,"count"),ta([_("uint8")],mi.prototype,"offsetSize");class yi extends mi{constructor(){super(...arguments);u(this,"_isString",!1)}}class ra extends mi{constructor(){super(...arguments);u(this,"_isString",!0)}}const ou=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],au=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"],lu=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],hu=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"];function vi(n,r){return r<=390?ou[r]:n[r-391]}function ie(n,r="number",e){return(t,i)=>{if(typeof i!="string")return;const s={type:r,operator:n,default:e??r==="number"?0:void 0};Object.defineProperty(t.constructor.prototype,i,{get(){return this._getProp(s)},set(o){this._setProp(s,o)},configurable:!0,enumerable:!0})}}class ia extends je{constructor(){super(...arguments);u(this,"_dict");u(this,"_stringIndex")}get dict(){return this._dict??(this._dict=this._readDict())}setStringIndex(e){return this._stringIndex=e,this}_readFloatOperand(){const e=this.view;let t="";const i=15,s=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const o=e.readUint8(),a=o>>4,l=o&15;if(a===i||(t+=s[a],l===i))break;t+=s[l]}return Number.parseFloat(t)}_readOperand(e){const t=this.view;let i,s,o,a;if(e===28)return i=t.readUint8(),s=t.readUint8(),i<<8|s;if(e===29)return i=t.readUint8(),s=t.readUint8(),o=t.readUint8(),a=t.readUint8(),i<<24|s<<16|o<<8|a;if(e===30)return this._readFloatOperand();if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return i=t.readUint8(),(e-247)*256+i+108;if(e>=251&&e<=254)return i=t.readUint8(),-(e-251)*256-i-108;throw new Error(`invalid b0 ${e}, at: ${t.cursor}`)}_readDict(){const e=this.view;e.seek(0);let t=[];const i=e.cursor+e.byteLength,s={};for(;e.cursor<i;){let o=e.readUint8();o<=21?(o===12&&(o=1200+e.readUint8()),s[o]=t,t=[]):t.push(this._readOperand(o))}return s}_getProp(e){var i;const t=this.dict[e.operator]??e.default;switch(e.type){case"number":return t[0];case"string":return vi(((i=this._stringIndex)==null?void 0:i.objects)??[],t[0]);case"number[]":return t}return t}_setProp(e,t){}}var cu=Object.defineProperty,Rs=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&cu(r,e,i),i};class _i extends ia{}Rs([ie(19)],_i.prototype,"subrs"),Rs([ie(20)],_i.prototype,"defaultWidthX"),Rs([ie(21)],_i.prototype,"nominalWidthX");var uu=Object.defineProperty,ce=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&uu(r,e,i),i};class oe extends ia{}ce([ie(0,"string")],oe.prototype,"version"),ce([ie(1,"string")],oe.prototype,"notice"),ce([ie(1200,"string")],oe.prototype,"copyright"),ce([ie(2,"string")],oe.prototype,"fullName"),ce([ie(3,"string")],oe.prototype,"familyName"),ce([ie(4,"string")],oe.prototype,"weight"),ce([ie(1201)],oe.prototype,"isFixedPitch"),ce([ie(1202)],oe.prototype,"italicAngle"),ce([ie(1203,"number",-100)],oe.prototype,"underlinePosition"),ce([ie(1204,"number",50)],oe.prototype,"underlineThickness"),ce([ie(1205)],oe.prototype,"paintType"),ce([ie(1206,"number",2)],oe.prototype,"charstringType"),ce([ie(1207,"number[]",[.001,0,0,.001,0,0])],oe.prototype,"fontMatrix"),ce([ie(13)],oe.prototype,"uniqueId"),ce([ie(5,"number[]",[0,0,0,0])],oe.prototype,"fontBBox"),ce([ie(1208)],oe.prototype,"strokeWidth"),ce([ie(14)],oe.prototype,"xuid"),ce([ie(15)],oe.prototype,"charset"),ce([ie(16)],oe.prototype,"encoding"),ce([ie(17)],oe.prototype,"charStrings"),ce([ie(18,"number[]",[0,0])],oe.prototype,"private");function we(n,r=n){return e=>{Ft.tableDefinitions.set(n,{tag:n,prop:r,class:e}),Object.defineProperty(Ft.prototype,r,{get(){return this.get(n)},set(t){return this.set(n,t)},configurable:!0,enumerable:!0})}}const Zt=class Zt{constructor(r){u(this,"tables",new Map);u(this,"tableViews",new Map);(r instanceof Map?r:new Map(Object.entries(r))).forEach((t,i)=>{this.tableViews.set(i,new DataView(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)))})}get hasGlyf(){return this.tableViews.has("glyf")}get names(){return this.name.names}get unitsPerEm(){return this.head.unitsPerEm}get ascender(){return this.hhea.ascent}get descender(){return this.hhea.descent}get createdTimestamp(){return this.head.created}get modifiedTimestamp(){return this.head.modified}get glyphs(){return this.hasGlyf?this.glyf.glyphs:this.cff.glyphs}charToGlyphIndex(r){let e=this.cmap.unicodeToGlyphIndexMap.get(r.codePointAt(0));if(e===void 0&&!this.hasGlyf){const{encoding:t,charset:i}=this.cff;e=i.indexOf(t[r.codePointAt(0)])}return e??0}charToGlyph(r){return this.glyphs.get(this.charToGlyphIndex(r))}textToGlyphIndexes(r){const e=[];for(const t of r)e.push(this.charToGlyphIndex(t));return e}textToGlyphs(r){const e=this.glyphs,t=this.textToGlyphIndexes(r),i=t.length,s=Array.from({length:i}),o=e.get(0);for(let a=0;a<i;a+=1)s[a]=e.get(t[a])||o;return s}getPathCommands(r,e,t,i,s){const o=[];return this.forEachGlyph(r,e,t,i,s,(a,l,h,c,f)=>{o.push(...a.getPathCommands(l,h,c,f,this))}),o}getAdvanceWidth(r,e,t){return this.forEachGlyph(r,0,0,e,t,()=>{})}forEachGlyph(r,e=0,t=0,i=72,s={},o){const a=1/this.unitsPerEm*i,l=this.textToGlyphs(r);for(let h=0;h<l.length;h+=1){const c=l[h];o.call(this,c,e,t,i,s),c.advanceWidth&&(e+=c.advanceWidth*a),s.letterSpacing?e+=s.letterSpacing*i:s.tracking&&(e+=s.tracking/1e3*i)}return e}clone(){return new Zt(this.tableViews)}delete(r){const e=Zt.tableDefinitions.get(r);return e?(this.tableViews.delete(r),this.tables.delete(e.prop),this):this}set(r,e){const t=Zt.tableDefinitions.get(r);return t&&this.tables.set(t.prop,e),this.tableViews.set(r,e.view),this}get(r){const e=Zt.tableDefinitions.get(r);if(!e)return;let t=this.tables.get(e.prop);if(!t){const i=e.class;if(i){const s=this.tableViews.get(r);if(!s)return;t=new i(s.buffer,s.byteOffset,s.byteLength).setSfnt(this),this.tables.set(e.prop,t)}}return t}};u(Zt,"tableDefinitions",new Map);let Ft=Zt;class Ae extends je{setSfnt(r){return this._sfnt=r,this}getSfnt(){return this._sfnt}}var fu=Object.defineProperty,du=Object.getOwnPropertyDescriptor,Dr=(n,r,e,t)=>{for(var i=t>1?void 0:t?du(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&fu(r,e,i),i};let $t=class extends Ae{constructor(r,e,t,i){super(r,e,t,i);u(this,"_glyphs");u(this,"privateDict");u(this,"subrsIndex");this._init()}get glyphs(){return this._glyphs??(this._glyphs=new su(this._sfnt))}get gsubrs(){return this.globalSubrIndex.objects}get gsubrsBias(){return this._calcSubroutineBias(this.globalSubrIndex.objects)}get defaultWidthX(){var r;return((r=this.privateDict)==null?void 0:r.defaultWidthX)??0}get nominalWidthX(){var r;return((r=this.privateDict)==null?void 0:r.nominalWidthX)??0}get subrs(){var r;return((r=this.subrsIndex)==null?void 0:r.objects)??[]}get subrsBias(){return this._calcSubroutineBias(this.subrs)}_init(){const r=this.view,{buffer:e,byteOffset:t}=r,i=t+4;this.nameIndex=new ra(e,i),this.topDictIndex=new yi(e,this.nameIndex.endOffset),this.stringIndex=new ra(e,this.topDictIndex.endOffset),this.globalSubrIndex=new yi(e,this.stringIndex.endOffset),this.topDict=new oe(new Uint8Array(this.topDictIndex.objects[0]).buffer).setStringIndex(this.stringIndex);const s=this.topDict.private[0],o=this.topDict.private[1];s&&(this.privateDict=new _i(e,t+o,s).setStringIndex(this.stringIndex),this.privateDict.subrs&&(this.subrsIndex=new yi(e,t+o+this.privateDict.subrs))),this.charStringsIndex=new yi(e,t+this.topDict.charStrings);const a=this.charStringsIndex.offsets.length-1;this.topDict.charset===0?this.charset=au:this.topDict.charset===1?this.charset=lu:this.topDict.charset===2?this.charset=hu:this.charset=this._readCharset(t+this.topDict.charset,a,this.stringIndex.objects),this.topDict.encoding===0?this.encoding=Us:this.topDict.encoding===1?this.encoding=ru:this.encoding=this._readEncoding(t+this.topDict.encoding)}_readCharset(r,e,t){const i=this.view;i.seek(r);let s,o,a;e-=1;const l=[".notdef"],h=i.readUint8();if(h===0)for(s=0;s<e;s+=1)o=i.readUint16(),l.push(vi(t,o));else if(h===1)for(;l.length<=e;)for(o=i.readUint16(),a=i.readUint8(),s=0;s<=a;s+=1)l.push(vi(t,o)),o+=1;else if(h===2)for(;l.length<=e;)for(o=i.readUint16(),a=i.readUint16(),s=0;s<=a;s+=1)l.push(vi(t,o)),o+=1;else throw new Error(`Unknown charset format ${h}`);return l}_readEncoding(r){const e=this.view;e.seek(r);let t,i;const s={},o=e.readUint8();if(o===0){const a=e.readUint8();for(t=0;t<a;t+=1)i=e.readUint8(),s[i]=t}else if(o===1){const a=e.readUint8();for(i=1,t=0;t<a;t+=1){const l=e.readUint8(),h=e.readUint8();for(let c=l;c<=l+h;c+=1)s[c]=i,i+=1}}else console.warn(`unknown encoding format:${o}`);return s}_calcSubroutineBias(r){let e;return r.length<1240?e=107:r.length<33900?e=1131:e=32768,e}};Dr([_("uint8")],$t.prototype,"majorVersion",2),Dr([_("uint8")],$t.prototype,"minorVersion",2),Dr([_("uint8")],$t.prototype,"headerSize",2),Dr([_("uint8")],$t.prototype,"offsetSize",2),$t=Dr([we("CFF ","cff")],$t);var pu=Object.defineProperty,bi=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&pu(r,e,i),i};const Ir=class nl extends je{constructor(r=new ArrayBuffer(262),e){super(r,e,262)}static from(r){const e=new nl;return e.format=0,e.length=e.view.byteLength,e.language=0,r.forEach((t,i)=>{i<256&&t<256&&e.view.writeUint8(t,6+i)}),e}getUnicodeToGlyphIndexMap(){const r=new Map;return this.glyphIndexArray.forEach((e,t)=>{r.set(t,e)}),r}};bi([_("uint16")],Ir.prototype,"format"),bi([_("uint16")],Ir.prototype,"length"),bi([_("uint16")],Ir.prototype,"language"),bi([_({type:"uint8",size:256})],Ir.prototype,"glyphIndexArray");let Bs=Ir;var gu=Object.defineProperty,Ls=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&gu(r,e,i),i};class Rr extends je{get subHeaderKeys(){return this.view.seek(6),Array.from({length:256},()=>this.view.readUint16()/8)}get maxSubHeaderKey(){return this.subHeaderKeys.reduce((r,e)=>Math.max(r,e),0)}get subHeaders(){const r=this.maxSubHeaderKey;return this.view.seek(6+256*2),Array.from({length:r},(e,t)=>({firstCode:this.view.readUint16(),entryCount:this.view.readUint16(),idDelta:this.view.readUint16(),idRangeOffset:(this.view.readUint16()-(r-t)*8-2)/2}))}get glyphIndexArray(){const r=this.maxSubHeaderKey,e=6+256*2+r*8;this.view.seek(e);const t=(this.view.byteLength-e)/2;return Array.from({length:t},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(r){const e=new Map,t=this.subHeaderKeys,i=this.maxSubHeaderKey,s=this.subHeaders,o=this.glyphIndexArray,a=t.findIndex(h=>h===i);let l=0;for(let h=0;h<256;h++)if(t[h]===0)h>=a||h<s[0].firstCode||h>=s[0].firstCode+s[0].entryCount||s[0].idRangeOffset+(h-s[0].firstCode)>=o.length?l=0:(l=o[s[0].idRangeOffset+(h-s[0].firstCode)],l!==0&&(l=l+s[0].idDelta)),l!==0&&l<r&&e.set(h,l);else{const c=t[h];for(let f=0,p=s[c].entryCount;f<p;f++)if(s[c].idRangeOffset+f>=o.length?l=0:(l=o[s[c].idRangeOffset+f],l!==0&&(l=l+s[c].idDelta)),l!==0&&l<r){const d=(h<<8|f+s[c].firstCode)%65535;e.set(d,l)}}return e}}Ls([_("uint16")],Rr.prototype,"format"),Ls([_("uint16")],Rr.prototype,"length"),Ls([_("uint16")],Rr.prototype,"language");function sa(n){return n>32767?n-65536:n<-32767?n+65536:n}function ks(n,r){let e;const t=[];let i={};return n.forEach((s,o)=>{r&&o>r||((!e||o!==e.unicode+1||s!==e.glyphIndex+1)&&(e?(i.end=e.unicode,t.push(i),i={start:o,startId:s,delta:sa(s-o)}):(i.start=Number(o),i.startId=s,i.delta=sa(s-o))),e={unicode:o,glyphIndex:s})}),e&&(i.end=e.unicode,t.push(i)),t}var mu=Object.defineProperty,zt=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&mu(r,e,i),i};const Mt=class ol extends je{get endCode(){const r=this.segCountX2;return this.view.seek(14),Array.from({length:r/2},()=>this.view.readUint16())}set endCode(r){this.view.seek(14),r.forEach(e=>this.view.writeUint16(e))}get reservedPad(){return this.view.readUint16(14+this.segCountX2)}set reservedPad(r){this.view.writeUint16(r,14+this.segCountX2)}get startCode(){const r=this.segCountX2;return this.view.seek(14+r+2),Array.from({length:r/2},()=>this.view.readUint16())}set startCode(r){this.view.seek(14+this.segCountX2+2),r.forEach(e=>this.view.writeUint16(e))}get idDelta(){const r=this.segCountX2;return this.view.seek(14+r+2+r),Array.from({length:r/2},()=>this.view.readUint16())}set idDelta(r){const e=this.segCountX2;this.view.seek(14+e+2+e),r.forEach(t=>this.view.writeUint16(t))}get idRangeOffsetCursor(){const r=this.segCountX2;return 14+r+2+r*2}get idRangeOffset(){const r=this.segCountX2;return this.view.seek(this.idRangeOffsetCursor),Array.from({length:r/2},()=>this.view.readUint16())}set idRangeOffset(r){this.view.seek(this.idRangeOffsetCursor),r.forEach(e=>this.view.writeUint16(e))}get glyphIndexArrayCursor(){const r=this.segCountX2;return 14+r+2+r*3}get glyphIndexArray(){const r=this.glyphIndexArrayCursor;this.view.seek(r);const e=(this.view.byteLength-r)/2;return Array.from({length:e},()=>this.view.readUint16())}static from(r){const e=ks(r,65535),t=e.length+1,i=Math.floor(Math.log(t)/Math.LN2),s=2*2**i,o=new ol(new ArrayBuffer(24+e.length*8));return o.format=4,o.length=o.view.byteLength,o.language=0,o.segCountX2=t*2,o.searchRange=s,o.entrySelector=i,o.rangeShift=2*t-s,o.endCode=[...e.map(a=>a.end),65535],o.reservedPad=0,o.startCode=[...e.map(a=>a.start),65535],o.idDelta=[...e.map(a=>a.delta),1],o.idRangeOffset=Array.from({length:t},()=>0),o}getUnicodeToGlyphIndexMap(){const r=new Map,e=this.segCountX2/2,t=(this.glyphIndexArrayCursor-this.idRangeOffsetCursor)/2,i=this.startCode,s=this.endCode,o=this.idRangeOffset,a=this.idDelta,l=this.glyphIndexArray;for(let h=0;h<e;++h)for(let c=i[h],f=s[h];c<=f;++c)if(o[h]===0)r.set(c,(c+a[h])%65536);else{const p=h+o[h]/2+(c-i[h])-t,d=l[p];d!==0?r.set(c,(d+a[h])%65536):r.set(c,0)}return r.delete(65535),r}};zt([_("uint16")],Mt.prototype,"format"),zt([_("uint16")],Mt.prototype,"length"),zt([_("uint16")],Mt.prototype,"language"),zt([_("uint16")],Mt.prototype,"segCountX2"),zt([_("uint16")],Mt.prototype,"searchRange"),zt([_("uint16")],Mt.prototype,"entrySelector"),zt([_("uint16")],Mt.prototype,"rangeShift");let Ns=Mt;var yu=Object.defineProperty,Br=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&yu(r,e,i),i};class Vt extends je{get glyphIndexArray(){return this.view.seek(12),Array.from({length:this.entryCount},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(){const r=this.glyphIndexArray,e=new Map;return r.forEach((t,i)=>{e.set(i,t)}),e}}Br([_("uint16")],Vt.prototype,"format"),Br([_("uint16")],Vt.prototype,"length"),Br([_("uint16")],Vt.prototype,"language"),Br([_("uint16")],Vt.prototype,"firstCode"),Br([_("uint16")],Vt.prototype,"entryCount");var vu=Object.defineProperty,Lr=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&vu(r,e,i),i};const ar=class al extends je{get groups(){const r=this.nGroups;return this.view.seek(16),Array.from({length:r},()=>({startCharCode:this.view.readUint32(),endCharCode:this.view.readUint32(),startGlyphCode:this.view.readUint32()}))}static from(r){const e=ks(r),t=new al(new ArrayBuffer(16+e.length*12));return t.format=12,t.reserved=0,t.length=t.view.byteLength,t.language=0,t.nGroups=e.length,e.forEach(i=>{t.view.writeUint32(i.start),t.view.writeUint32(i.end),t.view.writeUint32(i.startId)}),t}getUnicodeToGlyphIndexMap(){const r=new Map,e=this.groups;for(let t=0,i=e.length;t<i;t++){const s=e[t];let o=s.startGlyphCode,a=s.startCharCode;const l=s.endCharCode;for(;a<=l;)r.set(a++,o++)}return r}};Lr([_("uint16")],ar.prototype,"format"),Lr([_("uint16")],ar.prototype,"reserved"),Lr([_("uint32")],ar.prototype,"length"),Lr([_("uint32")],ar.prototype,"language"),Lr([_("uint32")],ar.prototype,"nGroups");let Fs=ar;var _u=Object.defineProperty,$s=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&_u(r,e,i),i};class kr extends je{getVarSelectorRecords(){const r=this.numVarSelectorRecords;return this.view.seek(10),Array.from({length:r},()=>{const e={varSelector:this.view.readUint24(),defaultUVSOffset:this.view.readUint32(),unicodeValueRanges:[],nonDefaultUVSOffset:this.view.readUint32(),uVSMappings:[]};if(e.defaultUVSOffset){this.view.seek(e.defaultUVSOffset);const t=this.view.readUint32();e.unicodeValueRanges=Array.from({length:t},()=>({startUnicodeValue:this.view.readUint24(),additionalCount:this.view.readUint8()}))}if(e.nonDefaultUVSOffset){this.view.seek(e.nonDefaultUVSOffset);const t=this.view.readUint32();e.uVSMappings=Array.from({length:t},()=>({unicodeValue:this.view.readUint24(),glyphID:this.view.readUint16()}))}return e})}getUnicodeToGlyphIndexMap(){const r=new Map,e=this.getVarSelectorRecords();for(let t=0,i=e.length;t<i;t++){const{uVSMappings:s}=e[t];s.forEach(o=>{r.set(o.unicodeValue,o.glyphID)})}return r}}$s([_("uint16")],kr.prototype,"format"),$s([_("uint32")],kr.prototype,"length"),$s([_("uint32")],kr.prototype,"numVarSelectorRecords");var bu=Object.defineProperty,wu=Object.getOwnPropertyDescriptor,zs=(n,r,e,t)=>{for(var i=t>1?void 0:t?wu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&bu(r,e,i),i};let lr=class extends Ae{constructor(){super(...arguments);u(this,"_unicodeToGlyphIndexMap");u(this,"_glyphIndexToUnicodesMap")}static from(r){const e=Array.from(r.keys()).some(f=>f>65535),t=Ns.from(r),i=Bs.from(r),s=e?Fs.from(r):void 0,o=4+(s?32:24),a=o+t.view.byteLength,l=a+i.view.byteLength,h=[{platformID:0,platformSpecificID:3,offset:o},{platformID:1,platformSpecificID:0,offset:a},{platformID:3,platformSpecificID:1,offset:o},s&&{platformID:3,platformSpecificID:10,offset:l}].filter(Boolean),c=new lr(new ArrayBuffer(4+8*h.length+t.view.byteLength+i.view.byteLength+((s==null?void 0:s.view.byteLength)??0)));return c.numberSubtables=h.length,c.view.seek(4),h.forEach(f=>{c.view.writeUint16(f.platformID),c.view.writeUint16(f.platformSpecificID),c.view.writeUint32(f.offset)}),c.view.writeBytes(t.view,o),c.view.writeBytes(i.view,a),s&&c.view.writeBytes(s.view,l),c}get unicodeToGlyphIndexMap(){return this._unicodeToGlyphIndexMap??(this._unicodeToGlyphIndexMap=this.readunicodeToGlyphIndexMap())}get glyphIndexToUnicodesMap(){if(!this._glyphIndexToUnicodesMap){const r=new Map,e=this.unicodeToGlyphIndexMap,t=Array.from(e.keys());for(let i=0,s=t.length;i<s;i++){const o=t[i],a=e.get(o);r.has(a)?r.get(a).push(o):r.set(a,[o])}this._glyphIndexToUnicodesMap=r}return this._glyphIndexToUnicodesMap}readSubtables(){const r=this.numberSubtables;return this.view.seek(4),Array.from({length:r},()=>({platformID:this.view.readUint16(),platformSpecificID:this.view.readUint16(),offset:this.view.readUint32()})).map(e=>{this.view.seek(e.offset);const t=this.view.readUint16();let i;switch(t){case 0:i=new Bs(this.view.buffer,e.offset);break;case 2:i=new Rr(this.view.buffer,e.offset,this.view.readUint16());break;case 4:i=new Ns(this.view.buffer,e.offset,this.view.readUint16());break;case 6:i=new Vt(this.view.buffer,e.offset,this.view.readUint16());break;case 12:i=new Fs(this.view.buffer,e.offset,this.view.readUint32(e.offset+4));break;case 14:default:i=new kr(this.view.buffer,e.offset,this.view.readUint32());break}return{...e,format:t,view:i}})}readunicodeToGlyphIndexMap(){var a,l,h,c,f;const r=this.readSubtables(),e=(a=r.find(p=>p.format===0))==null?void 0:a.view,t=(l=r.find(p=>p.platformID===3&&p.platformSpecificID===3&&p.format===2))==null?void 0:l.view,i=(h=r.find(p=>p.platformID===3&&p.platformSpecificID===1&&p.format===4))==null?void 0:h.view,s=(c=r.find(p=>p.platformID===3&&p.platformSpecificID===10&&p.format===12))==null?void 0:c.view,o=(f=r.find(p=>p.platformID===0&&p.platformSpecificID===5&&p.format===14))==null?void 0:f.view;return new Map([...(e==null?void 0:e.getUnicodeToGlyphIndexMap())??[],...(t==null?void 0:t.getUnicodeToGlyphIndexMap(this._sfnt.maxp.numGlyphs))??[],...(i==null?void 0:i.getUnicodeToGlyphIndexMap())??[],...(s==null?void 0:s.getUnicodeToGlyphIndexMap())??[],...(o==null?void 0:o.getUnicodeToGlyphIndexMap())??[]])}};zs([_("uint16")],lr.prototype,"version",2),zs([_("uint16")],lr.prototype,"numberSubtables",2),lr=zs([we("cmap")],lr);class xu extends Ds{_parseContours(r){const e=[];let t=[];for(let i=0;i<r.length;i+=1){const s=r[i];t.push(s),s.lastPointOfContour&&(e.push(t),t=[])}return Or(t.length===0,"There are still points left in the current contour."),e}_transformPoints(r,e){const t=[];for(let i=0;i<r.length;i+=1){const s=r[i],o={x:e.xScale*s.x+e.scale10*s.y+e.dx,y:e.scale01*s.x+e.yScale*s.y+e.dy,onCurve:s.onCurve,lastPointOfContour:s.lastPointOfContour};t.push(o)}return t}_parseGlyphCoordinate(r,e,t,i,s){let o;return(e&i)>0?(o=r.view.readUint8(),e&s||(o=-o),o=t+o):(e&s)>0?o=t:o=t+r.view.readInt16(),o}parse(r,e,t){r.view.seek(e);const i=this.numberOfContours=r.view.readInt16();if(this.xMin=r.view.readInt16(),this.yMin=r.view.readInt16(),this.xMax=r.view.readInt16(),this.yMax=r.view.readInt16(),i>0){const a=this.endPointIndices=[];for(let v=0;v<i;v++)a.push(r.view.readUint16());const l=this.instructionLength=r.view.readUint16();Or(l<5e3,`Bad instructionLength:${l}`);const h=this.instructions=[];for(let v=0;v<l;++v)h.push(r.view.readUint8());const c=r.view.byteOffset,f=a[a.length-1]+1;Or(f<2e4,`Bad numberOfCoordinates:${c}`);const p=[];let d,m=0;for(;m<f;)if(d=r.view.readUint8(),p.push(d),m++,d&8&&m<f){const v=r.view.readUint8();for(let y=0;y<v;y++)p.push(d),m++}if(Or(p.length===f,`Bad flags length: ${p.length}, numberOfCoordinates: ${f}`),a.length>0){const v=[];let y;if(f>0){for(let x=0;x<f;x+=1)d=p[x],y={},y.onCurve=!!(d&1),y.lastPointOfContour=a.includes(x),v.push(y);let S=0;for(let x=0;x<f;x+=1)d=p[x],y=v[x],y.x=this._parseGlyphCoordinate(r,d,S,2,16),S=y.x;let C=0;for(let x=0;x<f;x+=1)d=p[x],y=v[x],y.y=this._parseGlyphCoordinate(r,d,C,4,32),C=y.y}this.points=v}else this.points=[]}else if(i===0)this.points=[];else{this.isComposite=!0,this.points=[],this.components=[];let a,l=!0;for(;l;){a=r.view.readUint16();const h={glyphIndex:r.view.readUint16(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(a&1)>0?(a&2)>0?(h.dx=r.view.readInt16(),h.dy=r.view.readInt16()):h.matchedPoints=[r.view.readUint16(),r.view.readUint16()]:(a&2)>0?(h.dx=r.view.readInt8(),h.dy=r.view.readInt8()):h.matchedPoints=[r.view.readUint8(),r.view.readUint8()],(a&8)>0?h.xScale=h.yScale=r.view.readInt16()/16384:(a&64)>0?(h.xScale=r.view.readInt16()/16384,h.yScale=r.view.readInt16()/16384):(a&128)>0&&(h.xScale=r.view.readInt16()/16384,h.scale01=r.view.readInt16()/16384,h.scale10=r.view.readInt16()/16384,h.yScale=r.view.readInt16()/16384),this.components.push(h),l=!!(a&32)}if(a&256){this.instructionLength=r.view.readUint16(),this.instructions=[];for(let h=0;h<this.instructionLength;h+=1)this.instructions.push(r.view.readUint8())}}if(this.isComposite)for(let a=0;a<this.components.length;a+=1){const l=this.components[a],h=t.get(l.glyphIndex);if(h.getPathCommands(),h.points){let c;if(l.matchedPoints===void 0)c=this._transformPoints(h.points,l);else{Or(l.matchedPoints[0]>this.points.length-1||l.matchedPoints[1]>h.points.length-1,`Matched points out of range in ${this.name}`);const f=this.points[l.matchedPoints[0]];let p=h.points[l.matchedPoints[1]];const d={xScale:l.xScale,scale01:l.scale01,scale10:l.scale10,yScale:l.yScale,dx:0,dy:0};p=this._transformPoints([p],d)[0],d.dx=f.x-p.x,d.dy=f.y-p.y,c=this._transformPoints(h.points,d)}this.points=this.points.concat(c)}}const s=[],o=this._parseContours(this.points);for(let a=0,l=o.length;a<l;++a){const h=o[a];let c=h[h.length-1],f=h[0];c.onCurve?s.push({type:"M",x:c.x,y:c.y}):f.onCurve?s.push({type:"M",x:f.x,y:f.y}):s.push({type:"M",x:(c.x+f.x)*.5,y:(c.y+f.y)*.5});for(let p=0,d=h.length;p<d;++p)if(c=f,f=h[(p+1)%d],c.onCurve)s.push({type:"L",x:c.x,y:c.y});else{let m=f;f.onCurve||(m={x:(c.x+f.x)*.5,y:(c.y+f.y)*.5}),s.push({type:"Q",x1:c.x,y1:c.y,x:m.x,y:m.y})}s.push({type:"Z"})}this.pathCommands=s}}class Pu extends Is{get length(){return this._sfnt.loca.locations.length}_get(r){const e=this._sfnt.loca.locations,t=e[r],i=new xu({index:r});return t!==e[r+1]&&i.parse(this._sfnt.glyf,t,this),i}}var Cu=Object.defineProperty,Eu=Object.getOwnPropertyDescriptor,Tu=(n,r,e,t)=>{for(var i=t>1?void 0:t?Eu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Cu(r,e,i),i};let wi=class extends Ae{constructor(){super(...arguments);u(this,"_glyphs")}static from(r){const e=r.reduce((i,s)=>i+s.byteLength,0),t=new wi(new ArrayBuffer(e));return r.forEach(i=>{t.view.writeBytes(i)}),t}get glyphs(){return this._glyphs??(this._glyphs=new Pu(this._sfnt))}};wi=Tu([we("glyf")],wi);var Su=Object.defineProperty,Mu=Object.getOwnPropertyDescriptor,Au=(n,r,e,t)=>{for(var i=t>1?void 0:t?Mu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Su(r,e,i),i};let Vs=class extends Ae{};Vs=Au([we("GPOS","gpos")],Vs);var Ou=Object.defineProperty,Uu=Object.getOwnPropertyDescriptor,jt=(n,r,e,t)=>{for(var i=t>1?void 0:t?Uu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Ou(r,e,i),i};let vt=class extends Ae{};jt([_("uint16")],vt.prototype,"majorVersion",2),jt([_("uint16")],vt.prototype,"minorVersion",2),jt([_("uint16")],vt.prototype,"scriptListOffset",2),jt([_("uint16")],vt.prototype,"featureListOffset",2),jt([_("uint16")],vt.prototype,"lookupListOffset",2),jt([_("uint16")],vt.prototype,"featureVariationsOffset",2),vt=jt([we("GSUB","gsub")],vt);var Du=Object.defineProperty,Iu=Object.getOwnPropertyDescriptor,_e=(n,r,e,t)=>{for(var i=t>1?void 0:t?Iu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Du(r,e,i),i};let pe=class extends Ae{constructor(n=new ArrayBuffer(54),r){super(n,r,Math.min(54,n.byteLength-(r??0)))}};_e([_("fixed")],pe.prototype,"version",2),_e([_("fixed")],pe.prototype,"fontRevision",2),_e([_("uint32")],pe.prototype,"checkSumAdjustment",2),_e([_("uint32")],pe.prototype,"magickNumber",2),_e([_("uint16")],pe.prototype,"flags",2),_e([_("uint16")],pe.prototype,"unitsPerEm",2),_e([_({type:"longDateTime"})],pe.prototype,"created",2),_e([_({type:"longDateTime"})],pe.prototype,"modified",2),_e([_("int16")],pe.prototype,"xMin",2),_e([_("int16")],pe.prototype,"yMin",2),_e([_("int16")],pe.prototype,"xMax",2),_e([_("int16")],pe.prototype,"yMax",2),_e([_("uint16")],pe.prototype,"macStyle",2),_e([_("uint16")],pe.prototype,"lowestRecPPEM",2),_e([_("int16")],pe.prototype,"fontDirectionHint",2),_e([_("int16")],pe.prototype,"indexToLocFormat",2),_e([_("int16")],pe.prototype,"glyphDataFormat",2),pe=_e([we("head")],pe);var Ru=Object.defineProperty,Bu=Object.getOwnPropertyDescriptor,Re=(n,r,e,t)=>{for(var i=t>1?void 0:t?Bu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Ru(r,e,i),i};let xe=class extends Ae{constructor(n=new ArrayBuffer(36),r){super(n,r,Math.min(36,n.byteLength-(r??0)))}};Re([_("fixed")],xe.prototype,"version",2),Re([_("int16")],xe.prototype,"ascent",2),Re([_("int16")],xe.prototype,"descent",2),Re([_("int16")],xe.prototype,"lineGap",2),Re([_("uint16")],xe.prototype,"advanceWidthMax",2),Re([_("int16")],xe.prototype,"minLeftSideBearing",2),Re([_("int16")],xe.prototype,"minRightSideBearing",2),Re([_("int16")],xe.prototype,"xMaxExtent",2),Re([_("int16")],xe.prototype,"caretSlopeRise",2),Re([_("int16")],xe.prototype,"caretSlopeRun",2),Re([_("int16")],xe.prototype,"caretOffset",2),Re([_({type:"int16",size:4})],xe.prototype,"reserved",2),Re([_("int16")],xe.prototype,"metricDataFormat",2),Re([_("uint16")],xe.prototype,"numOfLongHorMetrics",2),xe=Re([we("hhea")],xe);var Lu=Object.defineProperty,ku=Object.getOwnPropertyDescriptor,Nu=(n,r,e,t)=>{for(var i=t>1?void 0:t?ku(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Lu(r,e,i),i};let xi=class extends Ae{constructor(){super(...arguments);u(this,"_metrics")}static from(r){const e=r.length*4,t=new xi(new ArrayBuffer(e));return r.forEach(i=>{t.view.writeUint16(i.advanceWidth),t.view.writeUint16(i.leftSideBearing)}),t}get metrics(){return this._metrics??(this._metrics=this.readMetrics())}readMetrics(){const r=this._sfnt.maxp.numGlyphs,e=this._sfnt.hhea.numOfLongHorMetrics;let t=0;const i=this.view;return i.seek(0),Array.from({length:r}).map((s,o)=>(o<e&&(t=i.readUint16()),{advanceWidth:t,leftSideBearing:i.readUint16()}))}};xi=Nu([we("hmtx")],xi);var Fu=Object.defineProperty,$u=Object.getOwnPropertyDescriptor,zu=(n,r,e,t)=>{for(var i=t>1?void 0:t?$u(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Fu(r,e,i),i};let js=class extends Ae{};js=zu([we("kern","kern")],js);var Vu=Object.defineProperty,ju=Object.getOwnPropertyDescriptor,Gu=(n,r,e,t)=>{for(var i=t>1?void 0:t?ju(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Vu(r,e,i),i};let Pi=class extends Ae{constructor(){super(...arguments);u(this,"_locations")}static from(r,e=1){const t=r.length*(e?4:2),i=new Pi(new ArrayBuffer(t));return r.forEach(s=>{e?i.view.writeUint32(s):i.view.writeUint16(s/2)}),i}get locations(){return this._locations??(this._locations=this.readLocations())}readLocations(){const r=this._sfnt.maxp.numGlyphs,e=this._sfnt.head.indexToLocFormat,t=this.view;return t.seek(0),Array.from({length:r}).map(()=>e?t.readUint32():t.readUint16()*2)}};Pi=Gu([we("loca")],Pi);var qu=Object.defineProperty,Wu=Object.getOwnPropertyDescriptor,Oe=(n,r,e,t)=>{for(var i=t>1?void 0:t?Wu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&qu(r,e,i),i};let be=class extends Ae{constructor(n=new ArrayBuffer(32),r){super(n,r,Math.min(32,n.byteLength-(r??0)))}};Oe([_("fixed")],be.prototype,"version",2),Oe([_("uint16")],be.prototype,"numGlyphs",2),Oe([_("uint16")],be.prototype,"maxPoints",2),Oe([_("uint16")],be.prototype,"maxContours",2),Oe([_("uint16")],be.prototype,"maxComponentPoints",2),Oe([_("uint16")],be.prototype,"maxComponentContours",2),Oe([_("uint16")],be.prototype,"maxZones",2),Oe([_("uint16")],be.prototype,"maxTwilightPoints",2),Oe([_("uint16")],be.prototype,"maxStorage",2),Oe([_("uint16")],be.prototype,"maxFunctionDefs",2),Oe([_("uint16")],be.prototype,"maxInstructionDefs",2),Oe([_("uint16")],be.prototype,"maxStackElements",2),Oe([_("uint16")],be.prototype,"maxSizeOfInstructions",2),Oe([_("uint16")],be.prototype,"maxComponentElements",2),Oe([_("uint16")],be.prototype,"maxComponentDepth",2),be=Oe([we("maxp")],be);var Xu=Object.defineProperty,Hu=Object.getOwnPropertyDescriptor,Ci=(n,r,e,t)=>{for(var i=t>1?void 0:t?Hu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Xu(r,e,i),i};const na={0:"copyright",1:"fontFamily",2:"fontSubFamily",3:"uniqueSubFamily",4:"fullName",5:"version",6:"postScriptName",7:"tradeMark",8:"manufacturer",9:"designer",10:"description",11:"urlOfFontVendor",12:"urlOfFontDesigner",13:"licence",14:"urlOfLicence",16:"preferredFamily",17:"preferredSubFamily",18:"compatibleFull",19:"sampleText"},Gs={Unicode:0,Macintosh:1,reserved:2,Microsoft:3},Yu={Default:0,"Version1.1":1,ISO10646:2,UnicodeBMP:3,UnicodenonBMP:4,UnicodeVariationSequences:5,FullUnicodecoverage:6},oa={Symbol:0,UCS2:1,ShiftJIS:2,PRC:3,BigFive:4,Johab:5,UCS4:6};let hr=class extends Ae{constructor(){super(...arguments);u(this,"_names")}get names(){return this._names??(this._names=this.readNames())}readNames(){const r=this.count;this.view.seek(6);const e=[];for(let l=0;l<r;++l)e.push({platform:this.view.readUint16(),encoding:this.view.readUint16(),language:this.view.readUint16(),nameId:this.view.readUint16(),length:this.view.readUint16(),offset:this.view.readUint16()});const t=this.stringOffset;for(let l=0;l<r;++l){const h=e[l];h.name=this.view.readBytes(t+h.offset,h.length)}let i=Gs.Macintosh,s=Yu.Default,o=0;e.some(l=>l.platform===Gs.Microsoft&&l.encoding===oa.UCS2&&l.language===1033)&&(i=Gs.Microsoft,s=oa.UCS2,o=1033);const a={};for(let l=0;l<r;++l){const h=e[l];h.platform===i&&h.encoding===s&&h.language===o&&na[h.nameId]&&(a[na[h.nameId]]=o===0?Kc(h.name):Jc(h.name))}return a}};Ci([_("uint16")],hr.prototype,"format",2),Ci([_("uint16")],hr.prototype,"count",2),Ci([_("uint16")],hr.prototype,"stringOffset",2),hr=Ci([we("name")],hr);var Zu=Object.defineProperty,Ku=Object.getOwnPropertyDescriptor,z=(n,r,e,t)=>{for(var i=t>1?void 0:t?Ku(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Zu(r,e,i),i};let $=class extends Ae{get fontPANOSE(){return[this.bFamilyType,this.bSerifStyle,this.bWeight,this.bProportion,this.bContrast,this.bStrokeVariation,this.bArmStyle,this.bLetterform,this.bMidline,this.bXHeight]}};z([_("uint16")],$.prototype,"version",2),z([_("int16")],$.prototype,"xAvgCharWidth",2),z([_("uint16")],$.prototype,"usWeightClass",2),z([_("uint16")],$.prototype,"usWidthClass",2),z([_("uint16")],$.prototype,"fsType",2),z([_("uint16")],$.prototype,"ySubscriptXSize",2),z([_("uint16")],$.prototype,"ySubscriptYSize",2),z([_("uint16")],$.prototype,"ySubscriptXOffset",2),z([_("uint16")],$.prototype,"ySubscriptYOffset",2),z([_("uint16")],$.prototype,"ySuperscriptXSize",2),z([_("uint16")],$.prototype,"ySuperscriptYSize",2),z([_("uint16")],$.prototype,"ySuperscriptXOffset",2),z([_("uint16")],$.prototype,"ySuperscriptYOffset",2),z([_("uint16")],$.prototype,"yStrikeoutSize",2),z([_("uint16")],$.prototype,"yStrikeoutPosition",2),z([_("uint16")],$.prototype,"sFamilyClass",2),z([_({type:"uint8"})],$.prototype,"bFamilyType",2),z([_({type:"uint8"})],$.prototype,"bSerifStyle",2),z([_({type:"uint8"})],$.prototype,"bWeight",2),z([_({type:"uint8"})],$.prototype,"bProportion",2),z([_({type:"uint8"})],$.prototype,"bContrast",2),z([_({type:"uint8"})],$.prototype,"bStrokeVariation",2),z([_({type:"uint8"})],$.prototype,"bArmStyle",2),z([_({type:"uint8"})],$.prototype,"bLetterform",2),z([_({type:"uint8"})],$.prototype,"bMidline",2),z([_({type:"uint8"})],$.prototype,"bXHeight",2),z([_({type:"uint8",size:16})],$.prototype,"ulUnicodeRange",2),z([_({type:"char",size:4})],$.prototype,"achVendID",2),z([_("uint16")],$.prototype,"fsSelection",2),z([_("uint16")],$.prototype,"usFirstCharIndex",2),z([_("uint16")],$.prototype,"usLastCharIndex",2),z([_("int16")],$.prototype,"sTypoAscender",2),z([_("int16")],$.prototype,"sTypoDescender",2),z([_("int16")],$.prototype,"sTypoLineGap",2),z([_("uint16")],$.prototype,"usWinAscent",2),z([_("uint16")],$.prototype,"usWinDescent",2),z([_({offset:72,type:"uint8",size:8})],$.prototype,"ulCodePageRange",2),z([_({offset:72,type:"int16"})],$.prototype,"sxHeight",2),z([_("int16")],$.prototype,"sCapHeight",2),z([_("uint16")],$.prototype,"usDefaultChar",2),z([_("uint16")],$.prototype,"usBreakChar",2),z([_("uint16")],$.prototype,"usMaxContext",2),$=z([we("OS/2","os2")],$);var Ju=Object.defineProperty,Qu=Object.getOwnPropertyDescriptor,ht=(n,r,e,t)=>{for(var i=t>1?void 0:t?Qu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Ju(r,e,i),i};let Xe=class extends Ae{constructor(n=new ArrayBuffer(32),r,e){super(n,r,e)}};ht([_("fixed")],Xe.prototype,"format",2),ht([_("fixed")],Xe.prototype,"italicAngle",2),ht([_("int16")],Xe.prototype,"underlinePosition",2),ht([_("int16")],Xe.prototype,"underlineThickness",2),ht([_("uint32")],Xe.prototype,"isFixedPitch",2),ht([_("uint32")],Xe.prototype,"minMemType42",2),ht([_("uint32")],Xe.prototype,"maxMemType42",2),ht([_("uint32")],Xe.prototype,"minMemType1",2),ht([_("uint32")],Xe.prototype,"maxMemType1",2),Xe=ht([we("post")],Xe);var ef=Object.defineProperty,tf=Object.getOwnPropertyDescriptor,Be=(n,r,e,t)=>{for(var i=t>1?void 0:t?tf(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&ef(r,e,i),i};let Pe=class extends Ae{constructor(n=new ArrayBuffer(36),r){super(n,r,Math.min(36,n.byteLength-(r??0)))}};Be([_("fixed")],Pe.prototype,"version",2),Be([_("int16")],Pe.prototype,"vertTypoAscender",2),Be([_("int16")],Pe.prototype,"vertTypoDescender",2),Be([_("int16")],Pe.prototype,"vertTypoLineGap",2),Be([_("int16")],Pe.prototype,"advanceHeightMax",2),Be([_("int16")],Pe.prototype,"minTopSideBearing",2),Be([_("int16")],Pe.prototype,"minBottomSideBearing",2),Be([_("int16")],Pe.prototype,"yMaxExtent",2),Be([_("int16")],Pe.prototype,"caretSlopeRise",2),Be([_("int16")],Pe.prototype,"caretSlopeRun",2),Be([_("int16")],Pe.prototype,"caretOffset",2),Be([_({type:"int16",size:4})],Pe.prototype,"reserved",2),Be([_("int16")],Pe.prototype,"metricDataFormat",2),Be([_("int16")],Pe.prototype,"numOfLongVerMetrics",2),Pe=Be([we("vhea")],Pe);var rf=Object.defineProperty,sf=Object.getOwnPropertyDescriptor,nf=(n,r,e,t)=>{for(var i=t>1?void 0:t?sf(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&rf(r,e,i),i};let Ei=class extends Ae{constructor(){super(...arguments);u(this,"_metrics")}static from(r){const e=r.length*4,t=new Ei(new ArrayBuffer(e));return r.forEach(i=>{t.view.writeUint16(i.advanceHeight),t.view.writeInt16(i.topSideBearing)}),t}get metrics(){return this._metrics??(this._metrics=this.readMetrics())}readMetrics(){var s;const r=this._sfnt.maxp.numGlyphs,e=((s=this._sfnt.vhea)==null?void 0:s.numOfLongVerMetrics)??0,t=this.view;t.seek(0);let i=0;return Array.from({length:r}).map((o,a)=>(a<e&&(i=t.readUint16()),{advanceHeight:i,topSideBearing:t.readUint8()}))}};Ei=nf([we("vmtx")],Ei);var of=Object.defineProperty,Nr=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&of(r,e,i),i};class He extends pi{constructor(){super(...arguments);u(this,"format","TrueType");u(this,"mimeType","font/ttf");u(this,"_sfnt")}get sfnt(){return this._sfnt||(this._sfnt=this.createSfnt()),this._sfnt}static is(e){return typeof e=="number"?this.signature.has(e):this.signature.has(nr(e).getUint32(0))}static checksum(e){const t=nr(e);let i=t.byteLength;for(;i%4;)i++;let s=0;for(let o=0,a=i/4;o<a;o+=4)o*4<i-4&&(s+=t.getUint32(o*4,!1));return s&4294967295}static from(e){const t=p=>p+3&-4,i=e.tableViews.size,s=Array.from(e.tableViews.values()).reduce((p,d)=>p+t(d.byteLength),0),o=new this(new ArrayBuffer(12+i*16+s));o.scalerType=65536,o.numTables=i;const a=Math.log(2);o.searchRange=Math.floor(Math.log(i)/a)*16,o.entrySelector=Math.floor(o.searchRange/a),o.rangeShift=i*16-o.searchRange;let l=12+i*16,h=0;const c=o.getDirectories();e.tableViews.forEach((p,d)=>{const m=c[h++];m.tag=d,m.checkSum=this.checksum(p),m.offset=l,m.length=p.byteLength,o.view.writeBytes(p,l),l+=t(m.length)});const f=o.createSfnt().head;return f.checkSumAdjustment=0,f.checkSumAdjustment=2981146554-this.checksum(o.view),o}getDirectories(){let e=this.view.byteOffset+12;return Array.from({length:this.numTables},()=>{const t=new or(this.view.buffer,e);return e+=t.view.byteLength,t})}createSfnt(){return new Ft(this.getDirectories().reduce((e,t)=>(e[t.tag]=new DataView(this.view.buffer,this.view.byteOffset+t.offset,t.length),e),{}))}}u(He,"signature",new Set([65536,1953658213,1954115633])),Nr([_("uint32")],He.prototype,"scalerType"),Nr([_("uint16")],He.prototype,"numTables"),Nr([_("uint16")],He.prototype,"searchRange"),Nr([_("uint16")],He.prototype,"entrySelector"),Nr([_("uint16")],He.prototype,"rangeShift");class Ti extends He{constructor(){super(...arguments);u(this,"format","OpenType");u(this,"mimeType","font/otf")}static from(e){return super.from(e)}}u(Ti,"signature",new Set([1330926671]));var af=Object.defineProperty,Fr=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&af(r,e,i),i};class Gt extends je{constructor(r,e){super(r,e,20)}}Fr([_({type:"char",size:4})],Gt.prototype,"tag"),Fr([_("uint32")],Gt.prototype,"offset"),Fr([_("uint32")],Gt.prototype,"compLength"),Fr([_("uint32")],Gt.prototype,"origLength"),Fr([_("uint32")],Gt.prototype,"origChecksum");var lf=Object.defineProperty,Ge=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&lf(r,e,i),i};const Ne=(It=class extends pi{constructor(){super(...arguments);u(this,"format","WOFF");u(this,"mimeType","font/woff");u(this,"_sfnt")}get subfontFormat(){return He.is(this.flavor)?"TrueType":Ti.is(this.flavor)?"OpenType":"Open"}get sfnt(){return this._sfnt||(this._sfnt=this.createSfnt()),this._sfnt}static is(e){return typeof e=="number"?this.signature.has(e):this.signature.has(nr(e).getUint32(0))}static checkSum(e){const t=nr(e),i=t.byteLength,s=Math.floor(i/4);let o=0,a=0;for(;a<s;)o+=t.getUint32(4*a++,!1);let l=i-s*4;if(l){let h=s*4;for(;l>0;)o+=t.getUint8(h)<<l*8,h++,l--}return o%4294967296}static from(e,t=new ArrayBuffer(0)){const i=p=>p+3&-4,s=[];e.tableViews.forEach((p,d)=>{const m=nr(Gc(new Uint8Array(p.buffer,p.byteOffset,p.byteLength)));s.push({tag:d,view:m.byteLength<p.byteLength?m:p,rawView:p})});const o=s.length,a=s.reduce((p,d)=>p+i(d.view.byteLength),0),l=new It(new ArrayBuffer(44+20*o+a+t.byteLength));l.signature=2001684038,l.flavor=65536,l.length=l.view.byteLength,l.numTables=o,l.totalSfntSize=12+16*o+s.reduce((p,d)=>p+i(d.rawView.byteLength),0);let h=44+o*20,c=0;const f=l.getDirectories();return s.forEach(p=>{const d=f[c++];d.tag=p.tag,d.offset=h,d.compLength=p.view.byteLength,d.origChecksum=It.checkSum(p.rawView),d.origLength=p.rawView.byteLength,l.view.writeBytes(p.view,h),h+=i(d.compLength)}),l.view.writeBytes(t),l}getDirectories(){let e=44;return Array.from({length:this.numTables},()=>{const t=new Gt(this.view.buffer,e);return e+=t.view.byteLength,t})}createSfnt(){return new Ft(this.getDirectories().reduce((e,t)=>{const i=t.tag,s=this.view.byteOffset+t.offset,o=t.compLength,a=t.origLength,l=s+o;return e[i]=o>=a?new DataView(this.view.buffer,s,o):new DataView(qc(new Uint8Array(this.view.buffer.slice(s,l))).buffer),e},{}))}},u(It,"signature",new Set([2001684038])),It);Ge([_("uint32")],Ne.prototype,"signature"),Ge([_("uint32")],Ne.prototype,"flavor"),Ge([_("uint32")],Ne.prototype,"length"),Ge([_("uint16")],Ne.prototype,"numTables"),Ge([_("uint16")],Ne.prototype,"reserved"),Ge([_("uint32")],Ne.prototype,"totalSfntSize"),Ge([_("uint16")],Ne.prototype,"majorVersion"),Ge([_("uint16")],Ne.prototype,"minorVersion"),Ge([_("uint32")],Ne.prototype,"metaOffset"),Ge([_("uint32")],Ne.prototype,"metaLength"),Ge([_("uint32")],Ne.prototype,"metaOrigLength"),Ge([_("uint32")],Ne.prototype,"privOffset"),Ge([_("uint32")],Ne.prototype,"privLength");let Si=Ne;function aa(n,r=!0){if(He.is(n))return new He(n);if(Ti.is(n))return new Ti(n);if(Si.is(n))return new Si(n);if(r)throw new Error("Failed to parseFont")}const Li=class Li{constructor(){u(this,"fallbackFont");u(this,"loading",new Map);u(this,"loaded",new Map);u(this,"familyToUrl",new Map)}_createRequest(r,e){const t=new AbortController;return{url:r,when:fetch(r,{...Li.defaultRequestInit,...e,signal:t.signal}).then(i=>i.arrayBuffer()),cancel:()=>t.abort()}}injectFontFace(r,e){return document.fonts.add(new FontFace(r,e)),this}injectStyleTag(r,e){const t=document.createElement("style");return t.appendChild(document.createTextNode(`@font-face {
28
28
  font-family: "${r}";
29
29
  src: url(${e});
30
30
  }`)),document.head.appendChild(t),this}_parseUrls(r){const e=Array.from(new Set([...r.split(","),r]));return Array.from(new Set(e.map(t=>this.familyToUrl.get(t.trim())??this.familyToUrl.get(t)??t)))}get(r){let e;return r&&(e=this._parseUrls(r).reduce((i,s)=>i||this.loaded.get(s),void 0)),e??this.fallbackFont}set(r,e){return this.familyToUrl.set(r,e.src),this.loaded.set(e.src,e),this}delete(r){return this._parseUrls(r).forEach(e=>{this.familyToUrl.delete(e),this.loaded.delete(e)}),this}clear(){return this.familyToUrl.clear(),this.loading.clear(),this.loaded.clear(),this}async load(r,e={}){const{cancelOther:t,injectFontFace:i=!0,injectStyleTag:s=!0,...o}=e,{src:a}=r;if(this.loaded.has(a))return t&&(this.loading.forEach(p=>p.cancel()),this.loading.clear()),c(this.loaded.get(a));let l=this.loading.get(a);return l||(l=this._createRequest(a,o),this.loading.set(a,l)),t&&this.loading.forEach((p,d)=>{p!==l&&(p.cancel(),this.loading.delete(d))}),l.when.then(p=>{if(this.loaded.has(a))return c(this.loaded.get(a));{const d=f(p);return e.noAdd||this.loaded.set(r.src,d),d.familySet.forEach(m=>{this.familyToUrl.set(m,a),typeof document<"u"&&(i&&this.injectFontFace(m,p),s&&this.injectStyleTag(m,a))}),d}}).catch(p=>{if(p instanceof DOMException&&p.message==="The user aborted a request.")return f();throw p}).finally(()=>{this.loading.delete(a)});function h(){return r.family?Array.isArray(r.family)?r.family:[r.family]:[]}function c(p){return h().forEach(d=>{p.familySet.add(d)}),p}function f(p=new ArrayBuffer(0)){let d;function m(){return d||(d=p.byteLength?aa(p,!1):void 0),d}function v(){const y=m();if(y instanceof He||y instanceof Si)return y.sfnt}return{...r,buffer:p,familySet:new Set(h()),getFont:m,getSfnt:v}}}async waitUntilLoad(){await Promise.all(Array.from(this.loading.values()).map(r=>r.when))}};u(Li,"defaultRequestInit",{cache:"force-cache"});let Mi=Li;const la=new Mi,hf=Object.freeze(Object.defineProperty({__proto__:null,BaseFont:pi,get Cff(){return $t},get Cmap(){return lr},CmapSubtableFormat0:Bs,CmapSubtableFormat12:Fs,CmapSubtableFormat14:kr,CmapSubtableFormat2:Rr,CmapSubtableFormat4:Ns,CmapSubtableFormat6:Vt,FontDataObject:je,FontDataView:ve,Fonts:Mi,get Glyf(){return wi},Glyph:Ds,GlyphSet:Is,get Gpos(){return Vs},get Gsub(){return vt},get Head(){return pe},get Hhea(){return xe},get Hmtx(){return xi},get Kern(){return js},get Loca(){return Pi},get Maxp(){return be},get Name(){return hr},get Os2(){return $},get Post(){return Xe},Sfnt:Ft,TableDirectory:or,Ttf:He,get Vhea(){return Pe},get Vmtx(){return Ei},Woff:Si,WoffTableDirectoryEntry:Gt,createCmapSegments:ks,dataTypeToByteLength:Ur,defineColumn:_,defineSfntTable:we,fonts:la,parseFont:aa},Symbol.toStringTag,{value:"Module"}));function qs(n,r,e){if(typeof r=="string"&&r.startsWith("linear-gradient")){const{x0:t,y0:i,x1:s,y1:o,stops:a}=cf(r,e.left,e.top,e.width,e.height),l=n.createLinearGradient(t,i,s,o);return a.forEach(h=>l.addColorStop(h.offset,h.color)),l}return r}function Ai(n,r,e){n!=null&&n.color&&(n.color=qs(e,n.color,r)),n!=null&&n.backgroundColor&&(n.backgroundColor=qs(e,n.backgroundColor,r)),n!=null&&n.textStrokeColor&&(n.textStrokeColor=qs(e,n.textStrokeColor,r))}function cf(n,r,e,t,i){var d;const s=((d=n.match(/linear-gradient\((.+)\)$/))==null?void 0:d[1])??"",o=s.split(",")[0],a=o.includes("deg")?o:"0deg",l=s.replace(a,"").matchAll(/(#|rgba|rgb)(.+?) ([\d.]+%)/gi),c=(Number(a.replace("deg",""))||0)*Math.PI/180,f=t*Math.sin(c),p=i*Math.cos(c);return{x0:r+t/2-f,y0:e+i/2+p,x1:r+t/2+f,y1:e+i/2-p,stops:Array.from(l).map(m=>{let v=m[2];return v.startsWith("(")?v=v.split(",").length>3?`rgba${v}`:`rgb${v}`:v=`#${v}`,{offset:Number(m[3].replace("%",""))/100,color:v}})}}function $r(n){const{ctx:r,path:e,fontSize:t,clipRect:i}=n;r.save(),r.beginPath();const s=e.style,o={...s,fill:n.color??s.fill,stroke:n.textStrokeColor??s.stroke,strokeWidth:n.textStrokeWidth?n.textStrokeWidth*t:s.strokeWidth,shadowOffsetX:(n.shadowOffsetX??0)*t,shadowOffsetY:(n.shadowOffsetY??0)*t,shadowBlur:(n.shadowBlur??0)*t,shadowColor:n.shadowColor};i&&(r.rect(i.left,i.top,i.width,i.height),r.clip(),r.beginPath()),e.drawTo(r,o),r.restore()}function uf(n,r,e){const{left:t,top:i,width:s,height:o}=e,a=n.canvas;a.dataset.viewBox=`${t} ${i} ${s} ${o}`,a.dataset.pixelRatio=String(r);const l=s,h=o;a.width=Math.max(1,Math.ceil(l*r)),a.height=Math.max(1,Math.ceil(h*r)),a.style.width=`${l}px`,a.style.height=`${h}px`,n.clearRect(0,0,a.width,a.height),n.scale(r,r),n.translate(-t,-i)}function ff(n,r){const{paragraphs:e,computedStyle:t,glyphBox:i}=r;Ai(t,i,n),e.forEach(s=>{Ai(s.computedStyle,s.lineBox,n),s.fragments.forEach(o=>{Ai(o.computedStyle,o.inlineBox,n)})})}const df=new Set(["©","®","÷"]),pf=new Set(["—","…","“","”","﹏","﹋","﹌","‘","’","˜"]),gf={1:"italic",32:"bold"},mf={1:"italic",2:"bold"},ha={100:-.2,200:-.1,300:0,400:0,normal:0,500:.1,600:.2,700:.3,bold:.3,800:.4,900:.5};class yf{constructor(r,e,t){u(this,"path",new Ue);u(this,"lineBox",new Y);u(this,"inlineBox",new Y);u(this,"glyphBox");u(this,"advanceWidth",0);u(this,"advanceHeight",0);u(this,"underlinePosition",0);u(this,"underlineThickness",0);u(this,"strikeoutPosition",0);u(this,"strikeoutSize",0);u(this,"ascender",0);u(this,"descender",0);u(this,"typoAscender",0);u(this,"typoDescender",0);u(this,"typoLineGap",0);u(this,"winAscent",0);u(this,"winDescent",0);u(this,"xHeight",0);u(this,"capHeight",0);u(this,"baseline",0);u(this,"centerDiviation",0);u(this,"fontStyle");this.content=r,this.index=e,this.parent=t}get center(){var r;return(r=this.glyphBox)==null?void 0:r.center}get computedStyle(){return this.parent.computedStyle}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get fontSize(){return this.computedStyle.fontSize}get fontHeight(){return this.fontSize*this.computedStyle.lineHeight}_getFontSfnt(r){const e=this.computedStyle.fontFamily,t=r??la,i=e?t.get(e):t.fallbackFont;return i==null?void 0:i.getSfnt()}updateGlyph(r=this._getFontSfnt()){if(!r)return this;const{hhea:e,os2:t,post:i,head:s}=r,o=s.unitsPerEm,a=e.ascent,l=e.descent,{content:h,computedStyle:c,isVertical:f}=this,{fontSize:p}=c,d=o/p,m=r.getAdvanceWidth(h,p),v=(a+Math.abs(l))/d,y=a/d;return this.advanceWidth=m,this.advanceHeight=v,this.inlineBox.width=f?v:m,this.inlineBox.height=f?m:v,this.underlinePosition=(a-i.underlinePosition)/d,this.underlineThickness=i.underlineThickness/d,this.strikeoutPosition=(a-t.yStrikeoutPosition)/d,this.strikeoutSize=t.yStrikeoutSize/d,this.ascender=a/d,this.descender=l/d,this.typoAscender=t.sTypoAscender/d,this.typoDescender=t.sTypoDescender/d,this.typoLineGap=t.sTypoLineGap/d,this.winAscent=t.usWinAscent/d,this.winDescent=t.usWinDescent/d,this.xHeight=t.sxHeight/d,this.capHeight=t.sCapHeight/d,this.baseline=y,this.centerDiviation=v/2-y,this.fontStyle=gf[t.fsSelection]??mf[s.macStyle],this}update(r){const e=this._getFontSfnt(r);if(!e)return this;this.updateGlyph(e);const{isVertical:t,content:i,computedStyle:s,baseline:o,inlineBox:a,ascender:l,descender:h,typoAscender:c,fontStyle:f,advanceWidth:p,advanceHeight:d}=this,{left:m,top:v}=a,y=s.fontStyle==="italic"&&f!=="italic";let S=m,C=v+o,x;const T=new Ue;if(t&&(S+=(d-p)/2,Math.abs(p-d)>.1&&(C-=(l-c)/(l+Math.abs(h))*d),x=void 0),t&&!df.has(i)&&(i.codePointAt(0)<=256||pf.has(i))){T.addCommands(e.getPathCommands(i,S,v+o-(d-p)/2,s.fontSize));const P={y:v-(d-p)/2+d/2,x:S+p/2};y&&this._italic(T,t?{x:P.x,y:v-(d-p)/2+o}:void 0),T.rotate(90,P)}else x!==void 0?(T.addCommands(e.glyphs.get(x).getPathCommands(S,C,s.fontSize)),y&&this._italic(T,t?{x:S+p/2,y:v+c/(l+Math.abs(h))*d}:void 0)):(T.addCommands(e.getPathCommands(i,S,C,s.fontSize)),y&&this._italic(T,t?{x:S+d/2,y:C}:void 0));const b=s.fontWeight??400;return b in ha&&(b===700||b==="bold")&&f!=="bold"&&T.bold(ha[b]*s.fontSize*.05),T.style={fill:s.color,stroke:s.textStrokeWidth?s.textStrokeColor:"none",strokeWidth:s.textStrokeWidth?s.textStrokeWidth*s.fontSize*.03:0},this.path=T,this.glyphBox=this.getGlyphBoundingBox(),this}_italic(r,e){r.skew(-.24,0,e||{y:this.inlineBox.top+this.baseline,x:this.inlineBox.left+this.inlineBox.width/2})}getGlyphMinMax(r,e,t){var i;if((i=this.path.curves[0])!=null&&i.curves.length)return this.path.getMinMax(r,e,t)}getGlyphBoundingBox(r){const e=this.getGlyphMinMax(void 0,void 0,r);if(!e)return;const{min:t,max:i}=e;return new Y(t.x,t.y,i.x-t.x,i.y-t.y)}drawTo(r,e={}){const t=this.computedStyle,i={ctx:r,path:this.path,fontSize:t.fontSize,color:t.color,...e};if(this.glyphBox)$r(i);else{r.save(),r.beginPath();const s=this.path.style,o={...s,fill:i.color??s.fill,stroke:i.textStrokeColor??s.stroke,strokeWidth:i.textStrokeWidth?i.textStrokeWidth*i.fontSize:s.strokeWidth,shadowOffsetX:(i.shadowOffsetX??0)*i.fontSize,shadowOffsetY:(i.shadowOffsetY??0)*i.fontSize,shadowBlur:(i.shadowBlur??0)*i.fontSize,shadowColor:i.shadowColor};cs(r,o),r.font=`${i.fontSize}px ${i.fontFamily}`,this.isVertical?(r.textBaseline="middle",r.fillText(this.content,this.inlineBox.left,this.inlineBox.top+this.inlineBox.height/2)):(r.textBaseline="alphabetic",r.fillText(this.content,this.inlineBox.left,this.inlineBox.top+this.baseline)),r.restore()}}}function Ws(n,r){return typeof n=="number"?n:n.endsWith("%")?(n=n.substring(0,n.length-1),Math.ceil(Number(n)/100*r.total)):n.endsWith("rem")?(n=n.substring(0,n.length-3),Number(n)*r.fontSize):n.endsWith("em")?(n=n.substring(0,n.length-2),Number(n)*r.fontSize):Number(n)}function ca(n){const r=At(n)?{}:n;return Object.keys(r).reduce((e,t)=>{let i=r[t];const s=ua(t),o=ua(i);return s&&(t=s),o&&(i=o),e[t]=i,e},{})}function At(n){return!n||n==="none"}function vf(n,r){const e=Object.keys(n),t=Object.keys(r);return Array.from(new Set([...e,...t])).every(s=>cr(n[s],r[s]))}function cr(n,r){const e=typeof n;return e===typeof r?e==="object"?vf(n,r):n===r:!1}function ua(n){const r=n.startsWith("#")?n.slice(1):n;if(!/^(?:[0-9A-F]{3}|[0-9A-F]{6})$/i.test(r))return null;const t=r.length===3?r.split("").map(a=>a+a).join(""):r,i=Number.parseInt(t.slice(0,2),16),s=Number.parseInt(t.slice(2,4),16),o=Number.parseInt(t.slice(4,6),16);return`rgb(${i}, ${s}, ${o})`}function Xs(n){if(!n)return n;const r={};for(const e in n)n[e]!==""&&n[e]!==void 0&&(r[e]=n[e]);return r}function Hs(n){return n.startsWith("http://")||n.startsWith("https://")||n.startsWith("blob://")}class _f{constructor(r,e={},t){u(this,"inlineBox",new Y);this.content=r,this.style=e,this.parent=t,this.updateComputedStyle().initCharacters()}get computedContent(){const r=this.computedStyle;return r.textTransform==="uppercase"?this.content.toUpperCase():r.textTransform==="lowercase"?this.content.toLowerCase():this.content}updateComputedStyle(){return this.computedStyle={...this.parent.computedStyle,...Xs(this.style)},this}initCharacters(){const r=[];let e=0;for(const t of this.computedContent)r.push(new yf(t,e++,this));return this.characters=r,this}}class zr{constructor(r,e){u(this,"lineBox",new Y);u(this,"fragments",[]);this.style=r,this.parentStyle=e,this.updateComputedStyle()}updateComputedStyle(){return this.computedStyle={...Xs(this.parentStyle),...Xs(this.style)},this}addFragment(r,e){const t=new _f(r,e,this);return this.fragments.push(t),t}}function rp(n){return n}const dr=class dr{_styleToDomStyle(r){const e={};for(const t in r){const i=r[t];dr.notZeroStyles.has(t)&&i===0||(typeof i=="number"&&dr.pxStyles.has(t)?e[t]=`${i}px`:e[t]=i)}return e}createParagraphDom(r,e){const t=document.createDocumentFragment(),i=document.createElement("section"),s={...e},o=e.writingMode.includes("horizontal");switch(e.textAlign){case"start":case"left":s.justifyContent="start";break;case"center":s.justifyContent="center";break;case"end":case"right":s.justifyContent="end";break}switch(e.verticalAlign){case"top":s.alignItems="top";break;case"middle":s.alignItems="center";break;case"bottom":s.alignItems="end";break}const a=!!(s.justifyContent||s.alignItems);Object.assign(i.style,{boxSizing:"border-box",display:a?"inline-flex":void 0,width:"max-content",height:"max-content",whiteSpace:"pre-wrap",wordBreak:"break-all",...this._styleToDomStyle(s),position:"fixed",visibility:"hidden"});const l=document.createElement("ul");return Object.assign(l.style,{verticalAlign:"inherit",listStyleType:"inherit",padding:"0",margin:"0",width:a&&o?"100%":void 0,height:a&&!o?"100%":void 0}),r.forEach(h=>{const c=document.createElement("li");Object.assign(c.style,{verticalAlign:"inherit",...this._styleToDomStyle(h.style)}),h.fragments.forEach(f=>{const p=document.createElement("span");Object.assign(p.style,{verticalAlign:"inherit",...this._styleToDomStyle(f.style)}),p.appendChild(document.createTextNode(f.content)),c.appendChild(p)}),l.appendChild(c)}),i.appendChild(l),t.appendChild(i),document.body.appendChild(t),{dom:i,destory:()=>{var h;return(h=i.parentNode)==null?void 0:h.removeChild(i)}}}measureDomText(r){const e=document.createRange();e.selectNodeContents(r);const t=r.data??"";let i=0;return Array.from(t).map(s=>{var f;const o=i+=t.substring(i).indexOf(s),a=o+s.length;i+=s.length,e.setStart(r,Math.max(o,0)),e.setEnd(r,a);const l=((f=e.getClientRects)==null?void 0:f.call(e))??[e.getBoundingClientRect()];let h=l[l.length-1];l.length>1&&h.width<2&&(h=l[l.length-2]);const c=e.toString();if(c!==""&&h&&h.width+h.height!==0)return{content:c,top:h.top,left:h.left,height:h.height,width:h.width}}).filter(Boolean)}measureDom(r){const e=[],t=[],i=[];return r.querySelectorAll("li").forEach((s,o)=>{const a=s.getBoundingClientRect();e.push({paragraphIndex:o,left:a.left,top:a.top,width:a.width,height:a.height}),s.querySelectorAll(":scope > *").forEach((l,h)=>{const c=l.getBoundingClientRect();t.push({paragraphIndex:o,fragmentIndex:h,left:c.left,top:c.top,width:c.width,height:c.height});let f=0;!l.children.length&&l.firstChild instanceof window.Text?this.measureDomText(l.firstChild).forEach(p=>{i.push({...p,newParagraphIndex:-1,paragraphIndex:o,fragmentIndex:h,characterIndex:f++,textWidth:-1,textHeight:-1})}):l.querySelectorAll(":scope > *").forEach(p=>{p.firstChild instanceof window.Text&&this.measureDomText(p.firstChild).forEach(d=>{i.push({...d,newParagraphIndex:-1,paragraphIndex:o,fragmentIndex:h,characterIndex:f++,textWidth:-1,textHeight:-1})})})})}),{paragraphs:e,fragments:t,characters:i}}measureParagraphDom(r,e){const t=e.getBoundingClientRect(),i=this.measureDom(e);i.paragraphs.forEach(a=>{const l=r[a.paragraphIndex];l.lineBox.left=a.left-t.left,l.lineBox.top=a.top-t.top,l.lineBox.width=a.width,l.lineBox.height=a.height}),i.fragments.forEach(a=>{const l=r[a.paragraphIndex].fragments[a.fragmentIndex];l.inlineBox.left=a.left-t.left,l.inlineBox.top=a.top-t.top,l.inlineBox.width=a.width,l.inlineBox.height=a.height});const s=[];let o=0;return i.characters.forEach(a=>{const{paragraphIndex:l,fragmentIndex:h,characterIndex:c}=a;s.push({...a,newParagraphIndex:l,left:a.left-t.left,top:a.top-t.top});const f=r[l].fragments[h].characters[c],{fontHeight:p,isVertical:d}=f,m=s[o];f.inlineBox.left=m.left,f.inlineBox.top=m.top,f.inlineBox.width=m.width,f.inlineBox.height=m.height,d?(f.lineBox.left=m.left+(m.width-p)/2,f.lineBox.top=m.top,f.lineBox.width=p,f.lineBox.height=m.height):(f.lineBox.left=m.left,f.lineBox.top=m.top+(m.height-p)/2,f.lineBox.width=m.width,f.lineBox.height=p),o++}),{paragraphs:r,boundingBox:new Y(0,0,t.width,t.height)}}measure(r,e,t){let i;t||({dom:t,destory:i}=this.createParagraphDom(r,e));const s=this.measureParagraphDom(r,t);return i==null||i(),s}};u(dr,"notZeroStyles",new Set(["width","height"])),u(dr,"pxStyles",new Set(["width","height","fontSize","letterSpacing","textStrokeWidth","textIndent","shadowOffsetX","shadowOffsetY","shadowBlur","marginLeft","marginTop","marginRight","marginBottom","paddingLeft","paddingTop","paddingRight","paddingBottom"]));let Ys=dr;class bf{constructor(){u(this,"eventListeners",new Map)}addEventListener(r,e,t){const i={value:e,options:t},s=this.eventListeners.get(r);return s?Array.isArray(s)?s.push(i):this.eventListeners.set(r,[s,i]):this.eventListeners.set(r,i),this}removeEventListener(r,e,t){var s,o;if(!e)return this.eventListeners.delete(r),this;const i=this.eventListeners.get(r);if(!i)return this;if(Array.isArray(i)){const a=[];for(let l=0,h=i.length;l<h;l++){const c=i[l];(c.value!==e||typeof t=="object"&&(t!=null&&t.once)&&(typeof c.options=="boolean"||!((s=c.options)!=null&&s.once)))&&a.push(c)}a.length?this.eventListeners.set(r,a.length===1?a[0]:a):this.eventListeners.delete(r)}else i.value===e&&(typeof t=="boolean"||!(t!=null&&t.once)||typeof i.options=="boolean"||(o=i.options)!=null&&o.once)&&this.eventListeners.delete(r);return this}removeAllListeners(){return this.eventListeners.clear(),this}hasEventListener(r){return this.eventListeners.has(r)}dispatchEvent(r,e){var i,s;const t=this.eventListeners.get(r);if(t){if(Array.isArray(t))for(let o=t.length,a=0;a<o;a++){const l=t[a];typeof l.options=="object"&&((i=l.options)!=null&&i.once)&&this.off(r,l.value,l.options),l.value.apply(this,[e])}else typeof t.options=="object"&&((s=t.options)!=null&&s.once)&&this.off(r,t.value,t.options),t.value.apply(this,[e]);return!0}else return!1}on(r,e,t){return this.addEventListener(r,e,t)}once(r,e){return this.addEventListener(r,e,{once:!0})}off(r,e,t){return this.removeEventListener(r,e,t)}emit(r,e){this.dispatchEvent(r,e)}}function Zs(n){const{highlight:r,highlightImage:e,highlightReferImage:t,highlightColormap:i,highlightLine:s,highlightSize:o,highlightThickness:a}=n;return{image:(r==null?void 0:r.image)??e??"none",referImage:(r==null?void 0:r.referImage)??t??"none",colormap:(r==null?void 0:r.colormap)??i??"none",line:(r==null?void 0:r.line)??s??"none",size:(r==null?void 0:r.size)??o??"cover",thickness:(r==null?void 0:r.thickness)??a??"100%"}}function wf(){const n=[],r=[],e=new Map,t=new Map;async function i(o){if(!e.has(o)){e.set(o,o);try{e.set(o,await fetch(o).then(a=>a.text()))}catch(a){console.warn(a),e.delete(o)}}}function s(o){let a=t.get(o);if(!a){const l=go(Hs(o)?e.get(o)??o:o),h=bo(l);a={dom:l,pathSet:h},t.set(o,a)}return a}return{name:"highlight",paths:n,load:async o=>{const a=new Set;o.forEachCharacter(l=>{const{computedStyle:h}=l,{image:c,referImage:f}=Zs(h);Hs(c)&&a.add(c),Hs(f)&&a.add(f)}),await Promise.all(Array.from(a).map(l=>i(l)))},update:o=>{r.length=0,n.length=0;let a=[],l,h;o.forEachCharacter(c=>{const{computedStyle:f}=c,p=Zs(f),{image:d,colormap:m,line:v,size:y,thickness:S}=p;if(At(d))l!=null&&l.length&&(l=[],a.push(l));else{const{inlineBox:C,isVertical:x}=c,{fontSize:T}=f;(!h||cr(h.image,d)&&cr(h.colormap,m)&&cr(h.line,v)&&cr(h.size,y)&&cr(h.thickness,S))&&(l!=null&&l.length)&&(x?l[0].inlineBox.left===C.left:l[0].inlineBox.top===C.top)&&l[0].fontSize===T?l.push(c):(l=[],l.push(c),a.push(l))}h=p}),a=a.filter(c=>c.length);for(let c=0;c<a.length;c++){const f=a[c],p=f[0],d=Y.from(...f.filter(I=>I.glyphBox).map(I=>I.glyphBox)),{computedStyle:m}=p,{fontSize:v,writingMode:y}=m,{image:S,referImage:C,colormap:x,line:T,size:b,thickness:P}=Zs(m),E=y.includes("vertical"),w=Ws(P,{fontSize:v,total:d.width})/d.width,D=ca(x),{pathSet:F,dom:B}=s(S),U=F.getBoundingBox(!0),V=v/U.width*2,M=new Y().copy(d);E&&(M.width=d.height,M.height=d.width,M.left=d.left+d.width);const N=Math.floor(M.width);let q=N;if(b!=="cover"&&(q=Ws(b,{fontSize:v,total:d.width})||N,M.width=q),!At(C)&&At(T)){const I=s(C).pathSet.getBoundingBox(!0);U.copy(I)}else{let I;if(At(T))if(U.width/U.height>4){I="underline";const j=B.getAttribute("viewBox");if(j){const[k,L,K,X]=j.split(" ").map(G=>Number(G)),W=L+X/2;U.y<W&&U.y+U.height>W?I="line-through":U.y+U.height<W?I="overline":I="underline"}}else I="outline";else I=T;switch(I){case"outline":{const j=M.width*.2,k=M.height*.2;M.width+=j,M.height+=k,E?(M.x-=k/2,M.y-=j/2,M.x+=M.height):(M.x-=j/2,M.y-=k/2);break}case"overline":M.height=U.height*V,E?M.x=p.inlineBox.left+p.inlineBox.width:M.y=p.inlineBox.top;break;case"line-through":M.height=U.height*V,E?M.x=p.inlineBox.left+p.inlineBox.width-p.strikeoutPosition+M.height/2:M.y=p.inlineBox.top+p.strikeoutPosition-M.height/2;break;case"underline":M.height=U.height*V,E?M.x=p.inlineBox.left+p.inlineBox.width-p.underlinePosition:M.y=p.inlineBox.top+p.underlinePosition;break}}const R=new ke().translate(-U.x,-U.y).scale(M.width/U.width,M.height/U.height);E&&R.rotate(-Math.PI/2),R.translate(M.x,M.y);for(let I=0;I<Math.ceil(N/q);I++){const j=R.clone();E?j.translate(0,I*M.width):j.translate(I*M.width,0),F.paths.forEach(k=>{const L=k.clone().applyTransform(j);L.style.strokeWidth&&(L.style.strokeWidth*=V*w),L.style.strokeMiterlimit&&(L.style.strokeMiterlimit*=V),L.style.strokeDashoffset&&(L.style.strokeDashoffset*=V),L.style.strokeDasharray&&(L.style.strokeDasharray=L.style.strokeDasharray.map(K=>K*V)),L.style.fill&&L.style.fill in D&&(L.style.fill=D[L.style.fill]),L.style.stroke&&L.style.stroke in D&&(L.style.stroke=D[L.style.stroke]),n.push(L),N!==q&&(E?r[n.length-1]=new Y(d.left-d.width*2,d.top,d.width*4,d.height):r[n.length-1]=new Y(d.left,d.top-d.height*2,d.width,d.height*4))})}}},renderOrder:-1,render:(o,a)=>{n.forEach((l,h)=>{if($r({ctx:o,path:l,fontSize:a.computedStyle.fontSize,clipRect:r[h]}),a.debug){const c=new vs([l]).getBoundingBox();c&&o.strokeRect(c.x,c.y,c.width,c.height)}})}}}function xf(n,r){return`<svg width="${n*2}" height="${n*2}" xmlns="http://www.w3.org/2000/svg">
package/dist/index.mjs CHANGED
@@ -3410,7 +3410,7 @@ class CanvasContext extends Path2D {
3410
3410
  miterLimit: this.miterLimit ?? 10
3411
3411
  }
3412
3412
  });
3413
- this.curves.length = 0;
3413
+ this.curves = [this.currentCurve];
3414
3414
  }
3415
3415
  }
3416
3416
  fillRect(x, y, width, height) {
@@ -3433,7 +3433,7 @@ class CanvasContext extends Path2D {
3433
3433
  texture,
3434
3434
  textureTransform: this.textureTransform
3435
3435
  });
3436
- this.curves.length = 0;
3436
+ this.curves = [this.currentCurve];
3437
3437
  }
3438
3438
  reset() {
3439
3439
  this.strokeStyle = void 0;
@@ -3443,7 +3443,7 @@ class CanvasContext extends Path2D {
3443
3443
  this.lineJoin = void 0;
3444
3444
  this.lineWidth = void 0;
3445
3445
  this.miterLimit = void 0;
3446
- this.curves.length = 0;
3446
+ this.curves = [this.currentCurve];
3447
3447
  this._stroked.length = 0;
3448
3448
  this._filled.length = 0;
3449
3449
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-canvas",
3
3
  "type": "module",
4
- "version": "0.1.3",
4
+ "version": "0.1.4",
5
5
  "packageManager": "pnpm@9.15.1",
6
6
  "description": "A JavaScript WebGL rendering engine.",
7
7
  "author": "wxm",