modern-canvas 0.4.42 → 0.4.43
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 +33 -44
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +33 -44
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -9018,51 +9018,40 @@ class BaseElement2DFill extends CoreObject {
|
|
|
9018
9018
|
);
|
|
9019
9019
|
}
|
|
9020
9020
|
_getDrawOptions() {
|
|
9021
|
-
let textureTransform;
|
|
9022
9021
|
let disableWrapMode = false;
|
|
9023
|
-
|
|
9024
|
-
|
|
9025
|
-
|
|
9026
|
-
const {
|
|
9027
|
-
|
|
9028
|
-
|
|
9029
|
-
|
|
9030
|
-
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
const h = Math.abs(1 + (-top + -bottom)) * height;
|
|
9057
|
-
const scaleX = 1 / w;
|
|
9058
|
-
const scaleY = 1 / h;
|
|
9059
|
-
const translateX = -left * width * scaleX;
|
|
9060
|
-
const translateY = -top * height * scaleY;
|
|
9061
|
-
textureTransform.scale(scaleX, scaleY).translate(translateX, translateY);
|
|
9062
|
-
disableWrapMode = true;
|
|
9063
|
-
} else {
|
|
9064
|
-
textureTransform.scale(1 / width, 1 / height);
|
|
9065
|
-
}
|
|
9022
|
+
const { width, height } = this.parent.size;
|
|
9023
|
+
const textureTransform = new Transform2D().scale(1 / width, 1 / height);
|
|
9024
|
+
if (this.cropRect) {
|
|
9025
|
+
const {
|
|
9026
|
+
left = 0,
|
|
9027
|
+
top = 0,
|
|
9028
|
+
right = 0,
|
|
9029
|
+
bottom = 0
|
|
9030
|
+
} = this.cropRect;
|
|
9031
|
+
textureTransform.scale(
|
|
9032
|
+
Math.abs(1 - (left + right)),
|
|
9033
|
+
Math.abs(1 - (top + bottom))
|
|
9034
|
+
).translate(left, top);
|
|
9035
|
+
disableWrapMode = true;
|
|
9036
|
+
}
|
|
9037
|
+
if (this.tile) {
|
|
9038
|
+
const {
|
|
9039
|
+
translateX = 0,
|
|
9040
|
+
translateY = 0,
|
|
9041
|
+
scaleX = 1,
|
|
9042
|
+
scaleY = 1
|
|
9043
|
+
// flip, TODO
|
|
9044
|
+
// alignment, TODO
|
|
9045
|
+
} = this.tile;
|
|
9046
|
+
textureTransform.translate(-translateX / width, -translateY / height).scale(1 / scaleX, 1 / scaleY);
|
|
9047
|
+
disableWrapMode = true;
|
|
9048
|
+
} else if (this.stretchRect) {
|
|
9049
|
+
const { left = 0, top = 0, right = 0, bottom = 0 } = this.stretchRect;
|
|
9050
|
+
textureTransform.scale(
|
|
9051
|
+
Math.abs(1 - (-left + -right)),
|
|
9052
|
+
Math.abs(1 - (-top + -bottom))
|
|
9053
|
+
).translate(-left, -top);
|
|
9054
|
+
disableWrapMode = true;
|
|
9066
9055
|
}
|
|
9067
9056
|
return { disableWrapMode, textureTransform };
|
|
9068
9057
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1908,7 +1908,7 @@ declare class BaseElement2DFill extends CoreObject {
|
|
|
1908
1908
|
canDraw(): boolean;
|
|
1909
1909
|
protected _getDrawOptions(): {
|
|
1910
1910
|
disableWrapMode: boolean;
|
|
1911
|
-
textureTransform
|
|
1911
|
+
textureTransform: Transform2D;
|
|
1912
1912
|
};
|
|
1913
1913
|
draw(): void;
|
|
1914
1914
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1908,7 +1908,7 @@ declare class BaseElement2DFill extends CoreObject {
|
|
|
1908
1908
|
canDraw(): boolean;
|
|
1909
1909
|
protected _getDrawOptions(): {
|
|
1910
1910
|
disableWrapMode: boolean;
|
|
1911
|
-
textureTransform
|
|
1911
|
+
textureTransform: Transform2D;
|
|
1912
1912
|
};
|
|
1913
1913
|
draw(): void;
|
|
1914
1914
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1908,7 +1908,7 @@ declare class BaseElement2DFill extends CoreObject {
|
|
|
1908
1908
|
canDraw(): boolean;
|
|
1909
1909
|
protected _getDrawOptions(): {
|
|
1910
1910
|
disableWrapMode: boolean;
|
|
1911
|
-
textureTransform
|
|
1911
|
+
textureTransform: Transform2D;
|
|
1912
1912
|
};
|
|
1913
1913
|
draw(): void;
|
|
1914
1914
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(g,tt){typeof exports=="object"&&typeof module<"u"?tt(exports):typeof define=="function"&&define.amd?define(["exports"],tt):(g=typeof globalThis<"u"?globalThis:g||self,tt(g.modernCanvas={}))})(this,function(g){"use strict";var dB=Object.defineProperty;var IB=(g,tt,Jt)=>tt in g?dB(g,tt,{enumerable:!0,configurable:!0,writable:!0,value:Jt}):g[tt]=Jt;var u=(g,tt,Jt)=>IB(g,typeof tt!="symbol"?tt+"":tt,Jt);var kA,EA;var tt=typeof document<"u"?document.currentScript:null;const Jt=Math.PI,At=Jt*2;let Th=0;function co(r){var A;return((A=r==null?void 0:r.__SPECTOR_Object_TAG)==null?void 0:A.id)??++Th}function ys(r){return!(r&r-1)&&!!r}const Gh=/([\w-]+)\((.+?)\)/g,Lh=/[^,]+/g,Oh=/([-e.\d]+)(.*)/;function ms(r){return Array.isArray(r)?r.map(A=>({name:A.name,args:A.args.map(e=>({...e,normalizedIntValue:e.normalizedDefaultIntValue}))})):{...r,normalizedIntValue:r.normalizedDefaultIntValue}}function Bi(r,A,e={}){const t=Ei(A,e);return t.length?t:go(r,A,e)}function Ei(r,A={}){const e=[];let t;for(;(t=Gh.exec(r))!==null;){const[,i,s]=t;i&&e.push({name:i,args:Hh(i,s,A)})}return e}function Hh(r,A,e={}){const t=[];let i,s=0;for(;(i=Lh.exec(A))!==null;)t.push(go(r,i[0],{...e,index:s++}));return t}function go(r,A,e={}){const{width:t=1,height:i=1,index:s=0}=e,n=A.match(Oh),o={unit:(n==null?void 0:n[2])??null,value:A,intValue:Number(n==null?void 0:n[1]),normalizedIntValue:0,normalizedDefaultIntValue:0};switch(r){case"scale":case"scaleX":case"scaleY":case"scale3d":o.normalizedDefaultIntValue=1;break}switch(o.unit){case"%":o.normalizedIntValue=o.intValue/100;break;case"rad":o.normalizedIntValue=o.intValue/At;break;case"deg":o.normalizedIntValue=o.intValue/360;break;case"px":switch(s){case 0:o.normalizedIntValue=o.intValue/t;break;case 1:o.normalizedIntValue=o.intValue/i;break}break;case"turn":case"em":case"rem":default:o.normalizedIntValue=o.intValue;break}return o}const uo="WebGL2RenderingContext"in globalThis,fo="ImageBitmap"in globalThis,Io="ResizeObserver"in globalThis,NA="PointerEvent"in globalThis,po="WheelEvent"in globalThis,Jh="MouseEvent"in globalThis,Kt="ontouchstart"in globalThis,Bo="onclick"in globalThis,ws="createImageBitmap"in globalThis,vs="AudioContext"in globalThis,_s="webkitAudioContext"in globalThis,bs="OfflineAudioContext"in globalThis,Eo="webkitOfflineAudioContext"in globalThis,Co=vs||_s,Ci=typeof window<"u",Ds=globalThis.devicePixelRatio||1,xs=r=>r!==null&&typeof r=="object"&&r.nodeType===1,Qo=r=>xs(r)&&r.tagName==="VIDEO",Kh=r=>xs(r)&&r.tagName==="IMG";function yo(r){return typeof r=="object"&&r!==null&&r.nodeType===1&&r.tagName==="CANVAS"}function mo(r){return uo&&r instanceof globalThis.WebGL2RenderingContext}function wo(){if(Ci)return globalThis.document.createElement("canvas")}function vo(r,A=globalThis.location){if(r.startsWith("data:"))return"";A=A||globalThis.location;const e=new URL(r,document.baseURI);return e.hostname!==A.hostname||e.port!==A.port||e.protocol!==A.protocol?"anonymous":""}function _o(r,A,e){e===null&&!A.startsWith("data:")?r.crossOrigin=vo(A):e!==!1&&(r.crossOrigin=typeof e=="string"?e:"anonymous")}class FA{constructor(){u(this,"_map",new WeakMap)}_toRaw(A){if(A&&typeof A=="object"){const e=A.__v_raw;e&&(A=this._toRaw(e))}return A}delete(A){return this._map.delete(this._toRaw(A))}get(A){return this._map.get(this._toRaw(A))}has(A){return this._map.has(this._toRaw(A))}set(A,e){return this._map.set(this._toRaw(A),this._toRaw(e)),this}}const bo=new FA;function or(r){let A=bo.get(r);if(!A){const e=Object.getPrototypeOf(r);A=new Map(e?or(e):void 0),bo.set(r,A)}return A}function Qi(r,A,e={}){or(r).set(A,e);const{default:t,alias:i}=e;let s=Object.getOwnPropertyDescriptor(r.prototype,A);if(!s){const n=i??Symbol.for(String(A));s={get(){return this[n]},set(o){this[n]=o}}}Object.defineProperty(r.prototype,A,{get(){var n;return((n=s.get)==null?void 0:n.call(this))??t},set(n){var a,l,h;const o=((a=s.get)==null?void 0:a.call(this))??t;(l=s.set)==null||l.call(this,n),(h=this.requestUpdate)==null||h.call(this,A,o,e)},configurable:!0,enumerable:!0})}function M(r){return function(A,e){Qi(A.constructor,e,r)}}const ar=new Map;function ne(r,A){return function(e){Object.defineProperty(e.prototype,"tag",{value:r,enumerable:!0,configurable:!0}),A&&Object.keys(A).forEach(t=>{Qi(e,t,{default:A[t]})}),ar.set(r,e)}}function Be(r){return M({...r,protected:!0})}function Yh(r="node",A={}){const e=ar.get(r);if(!e)throw new Error(`Failed to createNode, tag: ${r}`);return new e().setProperties(A)}class Se{static get currentTime(){return this._currentTime}static get elapsed(){return this._elapsed}static on(A,e={}){const{sort:t=0,once:i=!1}=e;this._queue[t]||(this._queue[t]=[]),this._queue[t].push({cb:A,once:i})}static off(A,e={}){const{sort:t=0}=e,i=this._queue[t];if(!i)return;const s=[];for(let n=i.length,o=0;o<n;o++){const a=i[o];a.cb!==A&&s.push(a)}s.length?this._queue[t]=s:this._queue.splice(t,1)}static start(){"requestAnimationFrame"in globalThis&&(this._currentTime=performance.now(),this._requestId=requestAnimationFrame(A=>this._update(A)))}static stop(){this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=void 0)}static _update(A){this._elapsed=A-this._currentTime,this._currentTime=A,this._requestId=requestAnimationFrame(e=>this._update(e)),this._performUpdate()}static _performUpdate(){const A=this._queue,e=[];for(let t=A.length,i=t;i>=0;i--){const s=A[i];if(!s)continue;const n=[];for(let o=s.length,a=0;a<o;a++){const l=s[a];try{l.cb()}catch(h){console.warn(h)}l.once||n.push(l)}n.length&&(e[i]=n)}this._queue=e}}u(Se,"_queue",[]),u(Se,"_currentTime",0),u(Se,"_elapsed",0),u(Se,"_requestId"),Se.start();async function Ss(r){return new Promise(A=>{Se.on(()=>{r==null||r(),A()},{sort:1,once:!0})})}let Yt=class{constructor(){u(this,"eventListeners",new Map)}removeAllListeners(){return this.eventListeners.clear(),this}hasEventListener(A){return this.eventListeners.has(A)}on(A,e,t){const i={value:e,options:t},s=this.eventListeners.get(A);return s?Array.isArray(s)?s.push(i):this.eventListeners.set(A,[s,i]):this.eventListeners.set(A,i),this}once(A,e){return this.on(A,e,{once:!0})}off(A,e,t){var s,n;if(!e)return this.eventListeners.delete(A),this;const i=this.eventListeners.get(A);if(!i)return this;if(Array.isArray(i)){const o=[];for(let a=0,l=i.length;a<l;a++){const h=i[a];(h.value!==e||typeof t=="object"&&(t!=null&&t.once)&&(typeof h.options=="boolean"||!((s=h.options)!=null&&s.once)))&&o.push(h)}o.length?this.eventListeners.set(A,o.length===1?o[0]:o):this.eventListeners.delete(A)}else i.value===e&&(typeof t=="boolean"||!(t!=null&&t.once)||typeof i.options=="boolean"||(n=i.options)!=null&&n.once)&&this.eventListeners.delete(A);return this}emit(A,...e){var i,s;const t=this.eventListeners.get(A);if(t){if(Array.isArray(t))for(let n=t.length,o=0;o<n;o++){const a=t[o];typeof a.options=="object"&&((i=a.options)!=null&&i.once)&&this.off(A,a.value,a.options),a.value.apply(this,e)}else typeof t.options=="object"&&((s=t.options)!=null&&s.once)&&this.off(A,t.value,t.options),t.value.apply(this,e);return!0}else return!1}},zh=0;class rA extends Yt{constructor(){super(...arguments);u(this,"instanceId",++zh);u(this,"_defaultProperties");u(this,"_updatedProperties",new Map);u(this,"_changedProperties",new Set);u(this,"_updatingPromise",Promise.resolve());u(this,"_updating",!1)}is(e){return!!(e&&this.instanceId===e.instanceId)}async _enqueueUpdate(){this._updating=!0;try{await this._updatingPromise}catch(e){Promise.reject(e)}await Ss(),this._updating&&(this.update(),this._updating=!1)}update(){this._update(this._updatedProperties),this._updatedProperties=new Map}_update(e){}_updateProperty(e,t,i,s){}isDirty(e){return this._updatedProperties.has(e)}getPropertyDeclarations(){return or(this.constructor)}getPropertyDeclaration(e){return this.getPropertyDeclarations().get(e)}getDefaultProperties(){if(!this._defaultProperties){this._defaultProperties={};for(const[e,t]of this.getPropertyDeclarations())!t.protected&&!t.alias&&(this._defaultProperties[e]=t.default)}return this._defaultProperties}getProperty(e){return this[e]}setProperty(e,t){return this[e]=t,this}getProperties(e){const t={};for(const[i,s]of this.getPropertyDeclarations())!s.protected&&!s.alias&&(!e||e.includes(i))&&(t[i]=this.getProperty(i));return t}setProperties(e){if(e&&typeof e=="object")for(const[t]of this.getPropertyDeclarations())t in e&&this.setProperty(t,e[t]);return this}requestUpdate(e,t,i){if(e!==void 0){const s=this[e];if(!Object.is(s,t))this._updatedProperties.set(e,t),this._changedProperties.add(e),i??(i=this.getPropertyDeclaration(e)),this._updateProperty(e,s,t,i),this.emit("updateProperty",e,s,t,i);else return}this._updating||(this._updatingPromise=this._enqueueUpdate())}toJSON(){const e={},t=this.getProperties(Array.from(this._changedProperties));for(const i in t){const s=t[i];s&&typeof s=="object"&&"toJSON"in s&&typeof s.toJSON=="function"?e[i]=s.toJSON():e[i]=s}return e}clone(){return new this.constructor(this.toJSON())}free(){this.removeAllListeners()}}class Do extends rA{}class lr{constructor(){u(this,"bubbles",!0);u(this,"cancelable",!1);u(this,"which");u(this,"cancelBubble",!0);u(this,"returnValue");u(this,"srcElement");u(this,"composed",!1);u(this,"currentTarget");u(this,"defaultPrevented",!1);u(this,"eventPhase",lr.prototype.NONE);u(this,"isTrusted");u(this,"target");u(this,"timeStamp");u(this,"type");u(this,"nativeEvent");u(this,"originalEvent");u(this,"propagationStopped",!1);u(this,"propagationImmediatelyStopped",!1);u(this,"path");u(this,"detail");u(this,"view");u(this,"layer",{x:0,y:0});u(this,"page",{x:0,y:0});u(this,"NONE",0);u(this,"CAPTURING_PHASE",1);u(this,"AT_TARGET",2);u(this,"BUBBLING_PHASE",3)}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}initEvent(...A){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(...A){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}composedPath(){return this.path}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class Ms extends lr{constructor(){super(...arguments);u(this,"altKey");u(this,"button");u(this,"buttons");u(this,"ctrlKey");u(this,"metaKey");u(this,"relatedTarget");u(this,"shiftKey");u(this,"client",{x:0,y:0});u(this,"movement",{x:0,y:0});u(this,"offset",{x:0,y:0});u(this,"global",{x:0,y:0});u(this,"screen",{x:0,y:0})}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(e){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(...e){throw new Error("Method not implemented.")}}class xo extends Ms{constructor(){super(...arguments);u(this,"width",0);u(this,"height",0);u(this,"isPrimary",!1);u(this,"pointerType");u(this,"pressure");u(this,"tangentialPressure");u(this,"tiltX");u(this,"tiltY");u(this,"twist")}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class yi extends Ms{constructor(){super(...arguments);u(this,"deltaMode");u(this,"deltaX");u(this,"deltaY");u(this,"deltaZ");u(this,"DOM_DELTA_PIXEL",0);u(this,"DOM_DELTA_LINE",1);u(this,"DOM_DELTA_PAGE",2)}}u(yi,"DOM_DELTA_PIXEL",0),u(yi,"DOM_DELTA_LINE",1),u(yi,"DOM_DELTA_PAGE",2);const Wh={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class So extends Yt{constructor(){super(...arguments);u(this,"target");u(this,"cursor","default");u(this,"cursorStyles",{default:"inherit",pointer:"pointer"});u(this,"setuped",!1);u(this,"event");u(this,"enableMoveEvent",!0);u(this,"enableWheelEvent",!0);u(this,"enableClickEvent",!0);u(this,"onPointerDown",e=>{if(Kt&&e.pointerType==="touch")return;const t=this.normalize(e);for(let i=0,s=t.length;i<s;i++)this.emit("pointerdown",this.event=this.clonePointerEvent(t[i]));this.setCursor(this.cursor)});u(this,"onPointerOver",e=>{if(!this.enableClickEvent||Kt&&e.pointerType==="touch")return;const t=this.normalize(e);for(let i=0,s=t.length;i<s;i++)this.emit("pointerover",this.event=this.clonePointerEvent(t[i]))});u(this,"onPointerMove",e=>{if(!this.enableMoveEvent||Kt&&e.pointerType==="touch")return;const t=this.normalize(e);for(let i=0,s=t.length;i<s;i++)this.emit("pointermove",this.event=this.clonePointerEvent(t[i]))});u(this,"onPointerUp",e=>{if(!this.enableClickEvent||Kt&&e.pointerType==="touch")return;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);const i=t!==this.target?"outside":"",s=this.normalize(e);for(let n=0,o=s.length;n<o;n++){const a=this.clonePointerEvent(s[n]);a.type+=i,this.emit("pointerup",this.event=a)}});u(this,"onWheel",e=>{if(!this.enableWheelEvent)return;const t=this.normalize(e);for(let i=0,s=t.length;i<s;i++)this.emit("wheel",this.event=this.cloneWheelEvent(t[i]))})}setTarget(e){this.removeEventListeners(),this.target=e,this.addEventListeners()}removeEventListeners(){if(!this.setuped||!this.target)return;const e=this.target.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):NA&&(e.touchAction=""),NA?(this.target.removeEventListener("pointerdown",this.onPointerDown),this.target.removeEventListener("pointerleave",this.onPointerOver),this.target.removeEventListener("pointerover",this.onPointerOver),this.target.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.target.ownerDocument.removeEventListener("pointerup",this.onPointerUp)):(this.target.removeEventListener("mousedown",this.onPointerDown),this.target.removeEventListener("mouseout",this.onPointerOver),this.target.removeEventListener("mouseover",this.onPointerOver),this.target.ownerDocument.removeEventListener("mousemove",this.onPointerMove),this.target.ownerDocument.removeEventListener("mouseup",this.onPointerUp)),Kt&&(this.target.removeEventListener("touchstart",this.onPointerDown),this.target.removeEventListener("touchmove",this.onPointerMove),this.target.removeEventListener("touchend",this.onPointerUp)),this.target.removeEventListener("wheel",this.onWheel),this.target=void 0,this.setuped=!1}addEventListeners(){if(this.setuped||!this.target)return;const e=this.target.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):NA&&(e.touchAction="none")),NA?(this.target.addEventListener("pointerdown",this.onPointerDown),this.target.addEventListener("pointerleave",this.onPointerOver),this.target.addEventListener("pointerover",this.onPointerOver),this.target.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.target.ownerDocument.addEventListener("pointerup",this.onPointerUp)):(this.target.addEventListener("mousedown",this.onPointerDown),this.target.addEventListener("mouseout",this.onPointerOver),this.target.addEventListener("mouseover",this.onPointerOver),this.target.ownerDocument.addEventListener("mousemove",this.onPointerMove),this.target.ownerDocument.addEventListener("mouseup",this.onPointerUp)),Kt&&(this.target.addEventListener("touchstart",this.onPointerDown),this.target.addEventListener("touchmove",this.onPointerMove),this.target.addEventListener("touchend",this.onPointerUp)),this.target.addEventListener("wheel",this.onWheel),this.setuped=!0}normalize(e){const t=[];if(Kt&&e instanceof globalThis.TouchEvent)for(let i=0,s=e.changedTouches.length;i<s;i++){const n=e.changedTouches[i];typeof n.button>"u"&&(n.button=0),typeof n.buttons>"u"&&(n.buttons=1),typeof n.isPrimary>"u"&&(n.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof n.width>"u"&&(n.width=n.radiusX||1),typeof n.height>"u"&&(n.height=n.radiusY||1),typeof n.tiltX>"u"&&(n.tiltX=0),typeof n.tiltY>"u"&&(n.tiltY=0),typeof n.pointerType>"u"&&(n.pointerType="touch"),typeof n.pointerId>"u"&&(n.pointerId=n.identifier||0),typeof n.pressure>"u"&&(n.pressure=n.force||.5),typeof n.twist>"u"&&(n.twist=0),typeof n.tangentialPressure>"u"&&(n.tangentialPressure=0),typeof n.layerX>"u"&&(n.layerX=n.offsetX=n.clientX),typeof n.layerY>"u"&&(n.layerY=n.offsetY=n.clientY),n.type=e.type,t.push(n)}else if(po&&e instanceof globalThis.WheelEvent)t.push(e);else if(NA&&e instanceof globalThis.PointerEvent)t.push(e);else{const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=1),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),t.push(i)}return t}cloneWheelEvent(e){const t=new yi;return this.copyMouseEvent(t,e),t.wheelDeltaY=e.wheelDeltaY,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.x=t.screen.x,t.global.y=t.screen.y,t.offset.x=t.screen.x,t.offset.y=t.screen.y,t.nativeEvent=e,t.type=e.type,t}clonePointerEvent(e){const t=new xo;return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,t.isTrusted=e.isTrusted,this.copyMouseEvent(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.x=t.screen.x,t.global.y=t.screen.y,t.offset.x=t.screen.x,t.offset.y=t.screen.y,t.type==="pointerleave"?t.type="pointerout":t.type.startsWith("mouse")?t.type=t.type.replace("mouse","pointer"):t.type.startsWith("touch")&&(t.type=Wh[t.type]||t.type),t}copyMouseEvent(e,t){e.preventDefault=t.preventDefault.bind(t),e.stopPropagation=t.stopPropagation.bind(t),e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}setCursor(e){if(!this.target||(e=e||"default",this.cursor===e))return;this.cursor=e;const t=!(globalThis.OffscreenCanvas&&this.target instanceof OffscreenCanvas),i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.target.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.target.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.target.style.cursor=e)}mapPositionToPoint(e,t,i){if(!this.target)return;const s=Number(this.target.getAttribute("width"))||0,n=Number(this.target.getAttribute("height"))||0,o=Number(this.target.getAttribute("data-pixel-ratio"))||1,a=this.target.isConnected?this.target.getBoundingClientRect():{width:s,height:n,left:0,top:0},l=1/o;e.x=(t-a.left)*(s/a.width)*l,e.y=(i-a.top)*(n/a.height)*l}}class zt extends Do{}var Vh={grad:.9,turn:360,rad:360/(2*Math.PI)},Wt=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},Ue=function(r,A,e){return A===void 0&&(A=0),e===void 0&&(e=Math.pow(10,A)),Math.round(e*r)/e+0},pt=function(r,A,e){return A===void 0&&(A=0),e===void 0&&(e=1),r>e?e:r>A?r:A},Mo=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},Ro=function(r){return{r:pt(r.r,0,255),g:pt(r.g,0,255),b:pt(r.b,0,255),a:pt(r.a)}},Rs=function(r){return{r:Ue(r.r),g:Ue(r.g),b:Ue(r.b),a:Ue(r.a,3)}},qh=/^#([0-9a-f]{3,8})$/i,hr=function(r){var A=r.toString(16);return A.length<2?"0"+A:A},Po=function(r){var A=r.r,e=r.g,t=r.b,i=r.a,s=Math.max(A,e,t),n=s-Math.min(A,e,t),o=n?s===A?(e-t)/n:s===e?2+(t-A)/n:4+(A-e)/n:0;return{h:60*(o<0?o+6:o),s:s?n/s*100:0,v:s/255*100,a:i}},ko=function(r){var A=r.h,e=r.s,t=r.v,i=r.a;A=A/360*6,e/=100,t/=100;var s=Math.floor(A),n=t*(1-e),o=t*(1-(A-s)*e),a=t*(1-(1-A+s)*e),l=s%6;return{r:255*[t,o,n,n,a,t][l],g:255*[a,t,t,o,n,n][l],b:255*[n,n,a,t,t,o][l],a:i}},Uo=function(r){return{h:Mo(r.h),s:pt(r.s,0,100),l:pt(r.l,0,100),a:pt(r.a)}},No=function(r){return{h:Ue(r.h),s:Ue(r.s),l:Ue(r.l),a:Ue(r.a,3)}},Fo=function(r){return ko((e=(A=r).s,{h:A.h,s:(e*=((t=A.l)<50?t:100-t)/100)>0?2*e/(t+e)*100:0,v:t+e,a:A.a}));var A,e,t},mi=function(r){return{h:(A=Po(r)).h,s:(i=(200-(e=A.s))*(t=A.v)/100)>0&&i<200?e*t/100/(i<=100?i:200-i)*100:0,l:i/2,a:A.a};var A,e,t,i},Xh=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,jh=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Zh=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,$h=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ps={string:[[function(r){var A=qh.exec(r);return A?(r=A[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:r.length===4?Ue(parseInt(r[3]+r[3],16)/255,2):1}:r.length===6||r.length===8?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:r.length===8?Ue(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var A=Zh.exec(r)||$h.exec(r);return A?A[2]!==A[4]||A[4]!==A[6]?null:Ro({r:Number(A[1])/(A[2]?100/255:1),g:Number(A[3])/(A[4]?100/255:1),b:Number(A[5])/(A[6]?100/255:1),a:A[7]===void 0?1:Number(A[7])/(A[8]?100:1)}):null},"rgb"],[function(r){var A=Xh.exec(r)||jh.exec(r);if(!A)return null;var e,t,i=Uo({h:(e=A[1],t=A[2],t===void 0&&(t="deg"),Number(e)*(Vh[t]||1)),s:Number(A[3]),l:Number(A[4]),a:A[5]===void 0?1:Number(A[5])/(A[6]?100:1)});return Fo(i)},"hsl"]],object:[[function(r){var A=r.r,e=r.g,t=r.b,i=r.a,s=i===void 0?1:i;return Wt(A)&&Wt(e)&&Wt(t)?Ro({r:Number(A),g:Number(e),b:Number(t),a:Number(s)}):null},"rgb"],[function(r){var A=r.h,e=r.s,t=r.l,i=r.a,s=i===void 0?1:i;if(!Wt(A)||!Wt(e)||!Wt(t))return null;var n=Uo({h:Number(A),s:Number(e),l:Number(t),a:Number(s)});return Fo(n)},"hsl"],[function(r){var A=r.h,e=r.s,t=r.v,i=r.a,s=i===void 0?1:i;if(!Wt(A)||!Wt(e)||!Wt(t))return null;var n=function(o){return{h:Mo(o.h),s:pt(o.s,0,100),v:pt(o.v,0,100),a:pt(o.a)}}({h:Number(A),s:Number(e),v:Number(t),a:Number(s)});return ko(n)},"hsv"]]},To=function(r,A){for(var e=0;e<A.length;e++){var t=A[e][0](r);if(t)return[t,A[e][1]]}return[null,void 0]},ec=function(r){return typeof r=="string"?To(r.trim(),Ps.string):typeof r=="object"&&r!==null?To(r,Ps.object):[null,void 0]},ks=function(r,A){var e=mi(r);return{h:e.h,s:pt(e.s+100*A,0,100),l:e.l,a:e.a}},Us=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},Go=function(r,A){var e=mi(r);return{h:e.h,s:e.s,l:pt(e.l+100*A,0,100),a:e.a}},Ns=function(){function r(A){this.parsed=ec(A)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return this.parsed!==null},r.prototype.brightness=function(){return Ue(Us(this.rgba),2)},r.prototype.isDark=function(){return Us(this.rgba)<.5},r.prototype.isLight=function(){return Us(this.rgba)>=.5},r.prototype.toHex=function(){return A=Rs(this.rgba),e=A.r,t=A.g,i=A.b,n=(s=A.a)<1?hr(Ue(255*s)):"","#"+hr(e)+hr(t)+hr(i)+n;var A,e,t,i,s,n},r.prototype.toRgb=function(){return Rs(this.rgba)},r.prototype.toRgbString=function(){return A=Rs(this.rgba),e=A.r,t=A.g,i=A.b,(s=A.a)<1?"rgba("+e+", "+t+", "+i+", "+s+")":"rgb("+e+", "+t+", "+i+")";var A,e,t,i,s},r.prototype.toHsl=function(){return No(mi(this.rgba))},r.prototype.toHslString=function(){return A=No(mi(this.rgba)),e=A.h,t=A.s,i=A.l,(s=A.a)<1?"hsla("+e+", "+t+"%, "+i+"%, "+s+")":"hsl("+e+", "+t+"%, "+i+"%)";var A,e,t,i,s},r.prototype.toHsv=function(){return A=Po(this.rgba),{h:Ue(A.h),s:Ue(A.s),v:Ue(A.v),a:Ue(A.a,3)};var A},r.prototype.invert=function(){return xt({r:255-(A=this.rgba).r,g:255-A.g,b:255-A.b,a:A.a});var A},r.prototype.saturate=function(A){return A===void 0&&(A=.1),xt(ks(this.rgba,A))},r.prototype.desaturate=function(A){return A===void 0&&(A=.1),xt(ks(this.rgba,-A))},r.prototype.grayscale=function(){return xt(ks(this.rgba,-1))},r.prototype.lighten=function(A){return A===void 0&&(A=.1),xt(Go(this.rgba,A))},r.prototype.darken=function(A){return A===void 0&&(A=.1),xt(Go(this.rgba,-A))},r.prototype.rotate=function(A){return A===void 0&&(A=15),this.hue(this.hue()+A)},r.prototype.alpha=function(A){return typeof A=="number"?xt({r:(e=this.rgba).r,g:e.g,b:e.b,a:A}):Ue(this.rgba.a,3);var e},r.prototype.hue=function(A){var e=mi(this.rgba);return typeof A=="number"?xt({h:A,s:e.s,l:e.l,a:e.a}):Ue(e.h)},r.prototype.isEqual=function(A){return this.toHex()===xt(A).toHex()},r}(),xt=function(r){return r instanceof Ns?r:new Ns(r)},Lo=[],tc=function(r){r.forEach(function(A){Lo.indexOf(A)<0&&(A(Ns,Ps),Lo.push(A))})};function Ac(r,A){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={};r.prototype.toName=function(n){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,a,l=t[this.toHex()];if(l)return l;if(n!=null&&n.closest){var h=this.toRgb(),c=1/0,f="black";if(!s.length)for(var I in e)s[I]=new r(e[I]).toRgb();for(var d in e){var C=(o=h,a=s[d],Math.pow(o.r-a.r,2)+Math.pow(o.g-a.g,2)+Math.pow(o.b-a.b,2));C<c&&(c=C,f=d)}return f}},A.string.push([function(n){var o=n.toLowerCase(),a=o==="transparent"?"#0000":e[o];return a?new r(a).toRgb():null},"name"])}function he(r){return r==null||r==="none"}function TA(r,A=0,e=10**A){return Math.round(e*r)/e+0}function Fs(r,A=!1){if(typeof r!="object"||!r)return r;if(Array.isArray(r))return A?r.map(t=>Fs(t,A)):r;const e={};for(const t in r){const i=r[t];i!=null&&(A?e[t]=Fs(i,A):e[t]=i)}return e}function Ts(r,A){const e={};return A.forEach(t=>{t in r&&(e[t]=r[t])}),e}function Gs(r){let A;return typeof r=="number"?A={r:r>>24&255,g:r>>16&255,b:r>>8&255,a:(r&255)/255}:A=r,xt(A)}function ic(r){return{r:TA(r.r),g:TA(r.g),b:TA(r.b),a:TA(r.a,3)}}function cr(r){const A=r.toString(16);return A.length<2?`0${A}`:A}const Oo="#000000FF";function rc(r){return Gs(r).isValid()}function ht(r,A=!1){const e=Gs(r);if(!e.isValid()){if(typeof r=="string")return r;const o=`Failed to normalizeColor ${r}`;if(A)throw new Error(o);return console.warn(o),Oo}const{r:t,g:i,b:s,a:n}=ic(e.rgba);return`#${cr(t)}${cr(i)}${cr(s)}${cr(TA(n*255))}`}var gr=gr||{};gr.parse=function(){const r={linearGradient:/^(-(webkit|o|ms|moz)-)?(linear-gradient)/i,repeatingLinearGradient:/^(-(webkit|o|ms|moz)-)?(repeating-linear-gradient)/i,radialGradient:/^(-(webkit|o|ms|moz)-)?(radial-gradient)/i,repeatingRadialGradient:/^(-(webkit|o|ms|moz)-)?(repeating-radial-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?((\d*\.\d+)|(\d+\.?)))px/,percentageValue:/^(-?((\d*\.\d+)|(\d+\.?)))%/,emValue:/^(-?((\d*\.\d+)|(\d+\.?)))em/,angleValue:/^(-?((\d*\.\d+)|(\d+\.?)))deg/,radianValue:/^(-?((\d*\.\d+)|(\d+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^#([0-9a-f]+)/i,literalColor:/^([a-z]+)/i,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-z0-9-,\s#]+)/i,number:/^((\d*\.\d+)|(\d+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i};let A="";function e(N){const U=new Error(`${A}: ${N}`);throw U.source=A,U}function t(){const N=i();return A.length>0&&e("Invalid input not EOF"),N}function i(){return w(s)}function s(){return n("linear-gradient",r.linearGradient,a)||n("repeating-linear-gradient",r.repeatingLinearGradient,a)||n("radial-gradient",r.radialGradient,c)||n("repeating-radial-gradient",r.repeatingRadialGradient,c)}function n(N,U,X){return o(U,ee=>{const oe=X();return oe&&(J(r.comma)||e("Missing comma before color stops")),{type:N,orientation:oe,colorStops:w(R)}})}function o(N,U){const X=J(N);if(X){J(r.startCall)||e("Missing (");const ee=U(X);return J(r.endCall)||e("Missing )"),ee}}function a(){const N=l();if(N)return N;const U=ie("position-keyword",r.positionKeywords,1);return U?{type:"directional",value:U.value}:h()}function l(){return ie("directional",r.sideOrCorner,1)}function h(){return ie("angular",r.angleValue,1)||ie("angular",r.radianValue,1)}function c(){let N,U=f(),X;return U&&(N=[],N.push(U),X=A,J(r.comma)&&(U=f(),U?N.push(U):A=X)),N}function f(){let N=I()||d();if(N)N.at=p();else{const U=C();if(U){N=U;const X=p();X&&(N.at=X)}else{const X=p();if(X)N={type:"default-radial",at:X};else{const ee=S();ee&&(N={type:"default-radial",at:ee})}}}return N}function I(){const N=ie("shape",/^(circle)/i,0);return N&&(N.style=q()||C()),N}function d(){const N=ie("shape",/^(ellipse)/i,0);return N&&(N.style=S()||L()||C()),N}function C(){return ie("extent-keyword",r.extentKeywords,1)}function p(){if(ie("position",/^at/,0)){const N=S();return N||e("Missing positioning value"),N}}function S(){const N=P();if(N.x||N.y)return{type:"position",value:N}}function P(){return{x:L(),y:L()}}function w(N){let U=N();const X=[];if(U)for(X.push(U);J(r.comma);)U=N(),U?X.push(U):e("One extra comma");return X}function R(){const N=_();return N||e("Expected color definition"),N.length=L(),N}function _(){return b()||K()||V()||z()||D()||Ae()||m()}function m(){return ie("literal",r.literalColor,0)}function b(){return ie("hex",r.hexColor,1)}function D(){return o(r.rgbColor,()=>({type:"rgb",value:w(W)}))}function z(){return o(r.rgbaColor,()=>({type:"rgba",value:w(W)}))}function Ae(){return o(r.varColor,()=>({type:"var",value:te()}))}function V(){return o(r.hslColor,()=>{J(r.percentageValue)&&e("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");const U=W();J(r.comma);let X=J(r.percentageValue);const ee=X?X[1]:null;J(r.comma),X=J(r.percentageValue);const oe=X?X[1]:null;return(!ee||!oe)&&e("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[U,ee,oe]}})}function K(){return o(r.hslaColor,()=>{const N=W();J(r.comma);let U=J(r.percentageValue);const X=U?U[1]:null;J(r.comma),U=J(r.percentageValue);const ee=U?U[1]:null;J(r.comma);const oe=W();return(!X||!ee)&&e("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[N,X,ee,oe]}})}function te(){return J(r.variableName)[1]}function W(){return J(r.number)[1]}function L(){return ie("%",r.percentageValue,1)||se()||H()||q()}function se(){return ie("position-keyword",r.positionKeywords,1)}function H(){return o(r.calcValue,()=>{let N=1,U=0;for(;N>0&&U<A.length;){const ee=A.charAt(U);ee==="("?N++:ee===")"&&N--,U++}N>0&&e("Missing closing parenthesis in calc() expression");const X=A.substring(0,U-1);return $(U-1),{type:"calc",value:X}})}function q(){return ie("px",r.pixelValue,1)||ie("em",r.emValue,1)}function ie(N,U,X){const ee=J(U);if(ee)return{type:N,value:ee[X]}}function J(N){let U,X;return X=/^\s+/.exec(A),X&&$(X[0].length),U=N.exec(A),U&&$(U[0].length),U}function $(N){A=A.substr(N)}return function(N){return A=N.toString().trim(),A.endsWith(";")&&(A=A.slice(0,-1)),t()}}();const sc=gr.parse.bind(gr);var ur=ur||{};ur.stringify=function(){var r={"visit_linear-gradient":function(A){return r.visit_gradient(A)},"visit_repeating-linear-gradient":function(A){return r.visit_gradient(A)},"visit_radial-gradient":function(A){return r.visit_gradient(A)},"visit_repeating-radial-gradient":function(A){return r.visit_gradient(A)},visit_gradient:function(A){var e=r.visit(A.orientation);return e&&(e+=", "),A.type+"("+e+r.visit(A.colorStops)+")"},visit_shape:function(A){var e=A.value,t=r.visit(A.at),i=r.visit(A.style);return i&&(e+=" "+i),t&&(e+=" at "+t),e},"visit_default-radial":function(A){var e="",t=r.visit(A.at);return t&&(e+=t),e},"visit_extent-keyword":function(A){var e=A.value,t=r.visit(A.at);return t&&(e+=" at "+t),e},"visit_position-keyword":function(A){return A.value},visit_position:function(A){return r.visit(A.value.x)+" "+r.visit(A.value.y)},"visit_%":function(A){return A.value+"%"},visit_em:function(A){return A.value+"em"},visit_px:function(A){return A.value+"px"},visit_calc:function(A){return"calc("+A.value+")"},visit_literal:function(A){return r.visit_color(A.value,A)},visit_hex:function(A){return r.visit_color("#"+A.value,A)},visit_rgb:function(A){return r.visit_color("rgb("+A.value.join(", ")+")",A)},visit_rgba:function(A){return r.visit_color("rgba("+A.value.join(", ")+")",A)},visit_hsl:function(A){return r.visit_color("hsl("+A.value[0]+", "+A.value[1]+"%, "+A.value[2]+"%)",A)},visit_hsla:function(A){return r.visit_color("hsla("+A.value[0]+", "+A.value[1]+"%, "+A.value[2]+"%, "+A.value[3]+")",A)},visit_var:function(A){return r.visit_color("var("+A.value+")",A)},visit_color:function(A,e){var t=A,i=r.visit(e.length);return i&&(t+=" "+i),t},visit_angular:function(A){return A.value+"deg"},visit_directional:function(A){return"to "+A.value},visit_array:function(A){var e="",t=A.length;return A.forEach(function(i,s){e+=r.visit(i),s<t-1&&(e+=", ")}),e},visit_object:function(A){return A.width&&A.height?r.visit(A.width)+" "+r.visit(A.height):""},visit:function(A){if(!A)return"";if(A instanceof Array)return r.visit_array(A);if(typeof A=="object"&&!A.type)return r.visit_object(A);if(A.type){var e=r["visit_"+A.type];if(e)return e(A);throw Error("Missing visitor visit_"+A.type)}else throw Error("Invalid node.")}};return function(A){return r.visit(A)}}(),ur.stringify.bind(ur);function Ho(r){const A=r.length-1;return r.map((e,t)=>{var o;const i=e.value;let s=TA(t/A,3),n="#00000000";switch(e.type){case"rgb":n=ht({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0)});break;case"rgba":n=ht({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0),a:Number(i[3]??0)});break;case"literal":n=ht(e.value);break;case"hex":n=ht(`#${e.value}`);break}switch((o=e.length)==null?void 0:o.type){case"%":s=Number(e.length.value)/100;break}return{offset:s,color:n}})}function Jo(r){var e;let A=0;switch((e=r.orientation)==null?void 0:e.type){case"angular":A=Number(r.orientation.value);break}return{type:"linear-gradient",angle:A,stops:Ho(r.colorStops)}}function Ko(r){var A;return(A=r.orientation)==null||A.map(e=>{switch(e==null?void 0:e.type){case"shape":case"default-radial":case"extent-keyword":default:return null}}),{type:"radial-gradient",stops:Ho(r.colorStops)}}function wi(r){return r.startsWith("linear-gradient(")||r.startsWith("radial-gradient(")}function nc(r){return sc(r).map(A=>{switch(A==null?void 0:A.type){case"linear-gradient":return Jo(A);case"repeating-linear-gradient":return{...Jo(A),repeat:!0};case"radial-gradient":return Ko(A);case"repeating-radial-gradient":return{...Ko(A),repeat:!0};default:return}}).filter(Boolean)}function oc(r){let A;return typeof r=="string"?A={color:r}:A=r,{color:ht(A.color)}}function ac(r){let A;if(typeof r=="string"?A={image:r}:A=r,A.image){const{type:e,...t}=nc(A.image)[0]??{};switch(e){case"radial-gradient":return{radialGradient:t};case"linear-gradient":return{linearGradient:t}}}return A}function lc(r){let A;return typeof r=="string"?A={image:r}:A=r,A}function hc(r){let A;return typeof r=="string"?A={preset:r}:A=r,{preset:A.preset,foregroundColor:he(A.foregroundColor)?void 0:ht(A.foregroundColor),backgroundColor:he(A.backgroundColor)?void 0:ht(A.backgroundColor)}}function cc(r){return!he(r.color)}function gc(r){return typeof r=="string"?rc(r):cc(r)}function uc(r){return!he(r.image)&&wi(r.image)||!!r.linearGradient||!!r.radialGradient}function fc(r){return typeof r=="string"?wi(r):uc(r)}function dc(r){return!he(r.image)&&!wi(r.image)}function Ic(r){return typeof r=="string"?!wi(r):dc(r)}function pc(r){return!he(r.preset)}function Bc(r){return typeof r=="string"?!1:pc(r)}function yA(r){if(gc(r))return oc(r);if(fc(r))return ac(r);if(Ic(r))return lc(r);if(Bc(r))return hc(r);throw new Error("Unknown fill property object")}function Ec(r){return typeof r=="string"?{...yA(r)}:{...yA(r),...Ts(r,["fillWithShape"])}}function Cc(r){return typeof r=="string"?{...yA(r)}:{...yA(r),...Ts(r,["fillWithShape"])}}function Qc(r){return typeof r=="string"?{...yA(r)}:{...yA(r),...Ts(r,["width","style","headEnd","tailEnd"])}}function yc(r){return typeof r=="string"?{color:ht(r)}:{...r,color:he(r.color)?Oo:ht(r.color)}}function mc(){return{boxShadow:"none"}}function wc(r){return typeof r=="string"?r.startsWith("<svg")?{svg:r}:{paths:[{data:r}]}:Array.isArray(r)?{paths:r.map(A=>typeof A=="string"?{data:A}:A)}:r}function vc(){return{overflow:"visible",direction:void 0,display:void 0,boxSizing:void 0,width:void 0,height:void 0,maxHeight:void 0,maxWidth:void 0,minHeight:void 0,minWidth:void 0,position:void 0,left:0,top:0,right:void 0,bottom:void 0,borderTop:void 0,borderLeft:void 0,borderRight:void 0,borderBottom:void 0,borderWidth:0,border:void 0,flex:void 0,flexBasis:void 0,flexDirection:void 0,flexGrow:void 0,flexShrink:void 0,flexWrap:void 0,justifyContent:void 0,gap:void 0,alignContent:void 0,alignItems:void 0,alignSelf:void 0,marginTop:void 0,marginLeft:void 0,marginRight:void 0,marginBottom:void 0,margin:void 0,paddingTop:void 0,paddingLeft:void 0,paddingRight:void 0,paddingBottom:void 0,padding:void 0}}function _c(){return{rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function bc(){return{...vc(),..._c(),...mc(),backgroundImage:"none",backgroundSize:"auto, auto",backgroundColor:"none",backgroundColormap:"none",borderRadius:0,borderColor:"none",borderStyle:"solid",outlineWidth:0,outlineOffset:0,outlineColor:"rgb(0, 0, 0)",outlineStyle:"none",visibility:"visible",filter:"none",opacity:1,pointerEvents:"auto",maskImage:"none"}}function Dc(){return{highlight:{},highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function xc(){return{listStyle:{},listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside"}}function Sc(){return{...Dc(),color:"rgb(0, 0, 0)",verticalAlign:"baseline",letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textTransform:"none",textOrientation:"mixed",textDecoration:"none"}}function Mc(){return{...xc(),writingMode:"horizontal-tb",textWrap:"wrap",textAlign:"start",textIndent:0,lineHeight:1.2}}function Rc(){return{...Mc(),...Sc(),textStrokeWidth:0,textStrokeColor:"rgb(0, 0, 0)"}}function fr(r){return Fs({...r,color:he(r.color)?void 0:ht(r.color),backgroundColor:he(r.backgroundColor)?void 0:ht(r.backgroundColor),borderColor:he(r.borderColor)?void 0:ht(r.borderColor),outlineColor:he(r.outlineColor)?void 0:ht(r.outlineColor),shadowColor:he(r.shadowColor)?void 0:ht(r.shadowColor)})}function Yo(){return{...bc(),...Rc()}}function zo(r=""){return(Array.isArray(r)?r:[r]).map(e=>typeof e=="string"?{fragments:[{content:e}]}:"content"in e?{fragments:[fr(e)]}:"fragments"in e?{...fr(e),fragments:e.fragments.map(t=>fr(t))}:Array.isArray(e)?{fragments:e.map(t=>typeof t=="string"?{content:t}:fr(t))}:{fragments:[]})}function Pc(r){return typeof r=="string"?{content:[{fragments:[{content:r}]}]}:"content"in r?{...r,content:zo(r.content)}:{content:zo(r)}}tc([Ac]);class Vt{get value(){return this._value}set value(A){this._colord=Gs(A??"none")}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(A=0){this.value=A}toHex(){return this._colord.toHex()}toRgb(){return this._colord.toRgb()}toRgbString(){return this._colord.toRgbString()}toHsl(){return this._colord.toHsl()}toHslString(){return this._colord.toHslString()}toHsv(){return this._colord.toHsv()}toArgb(A=this.a,e=!0){if(A===1)return(255<<24)+this.rgb;if(A===0)return e?0:this.rgb;let t=this.r8,i=this.g8,s=this.b8;return e&&(t=t*A+.5|0,i=i*A+.5|0,s=s*A+.5|0),(A*255<<24)+(t<<16)+(i<<8)+s}toArray(){return[this.r,this.g,this.b,this.a]}}class mt extends Yt{constructor(e){super();u(this,"_array",[]);this.dim=e}get length(){return this.dim}_operate(e,t,i){const{dim:s,_array:n}=this;let o;typeof t=="number"?o=Array.from({length:s},()=>t):t instanceof St||t instanceof mt?o=t.toArray():o=t;let a,l=[];if(i?i instanceof mt?a=i:l=i:a=this,t instanceof St){const{cols:h}=t;switch(e){case"*":for(let c=0;c<s;c++){let f=0;for(let I=0;I<s;I++)f+=n[c]*o[I*h+c];l[c]=f}break;default:throw new Error(`Not support operator in '${this.toName()} ${e} ${t.toName()}'`)}}else switch(e){case"+":for(let h=0;h<s;h++)l[h]=n[h]+o[h];break;case"-":for(let h=0;h<s;h++)l[h]=n[h]-o[h];break;case"*":for(let h=0;h<s;h++)l[h]=n[h]*o[h];break;case"/":for(let h=0;h<s;h++)l[h]=n[h]/o[h];break;case"rot":{const h=Math.cos(o[0]),c=Math.sin(o[0]);l[0]=n[0]*h-n[1]*c,l[1]=n[1]*h+n[0]*c;break}case"==":{let h=!0;for(let c=0;c<s;c++)h=h&&n[c]===o[c];return h}case"=":for(let h=0;h<s;h++){const c=o[h];c!==void 0&&(n[h]=c)}return this._onUpdate(n),this.emit("update",n),this;default:throw new Error(`Not support operator in '${this.toName()} ${e} Vector'`)}return(a==null?void 0:a.set(l))??l}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)}copy(e){return this.set(e)}clone(){const e=new this.constructor;return e.set(this.toArray()),e}_onUpdate(e){}toArray(){return this._array.slice()}toName(){return`Vector${this.dim}`}}class St extends Yt{constructor(e,t,i){super();u(this,"_array",[]);u(this,"dirtyId",0);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:n,length:o,_array:a}=this;let l;typeof t=="number"?l=Array.from({length:o},()=>t):t instanceof mt||t instanceof St?l=t.toArray():l=t;let h,c=[];if(i?i instanceof mt||i instanceof St?h=i:c=i:t instanceof mt?h=new t.constructor:h=this,t instanceof mt){const{dim:f}=t;switch(e){case"*":for(let I=0;I<f;I++){let d=0;for(let C=0;C<s;C++)C<f&&(d+=a[I*s+C]*(l[C]??0));c[I]=d}break;default:throw new Error(`Not support operator in '${this.toName()} ${e} ${t.toName()}'`)}}else switch(e){case"*":for(let f=0;f<s;f++)for(let I=0;I<n;I++){const d=I*s;let C=0;for(let p=0;p<n;p++){const S=d+p,P=p*s+f;C+=a[S]*(l[P]??0)}c[d+f]=C}break;case"=":for(let f=0;f<o;f++){const I=l[f];I!==void 0&&(a[f]=I)}return this._onUpdate(a),this.emit("update",a),this;default:throw new Error(`Not support operator in '${this.toName()} ${e} Matrix2'`)}return(h==null?void 0:h.set(c))??c}identity(){const{cols:e,rows:t}=this,i=[];for(let s=0;s<e;s++)for(let n=0;n<t;n++){const o=n*e,a=s+o;i[a]=n+o===a?1:0}return this.set(i)}set(e){return this._operate("=",e)}copy(e){return this.set(e)}clone(){const e=new this.constructor;return e.set(this.toArray()),e}multiply(e,t){return this._operate("*",e,t)}_onUpdate(e){this.dirtyId++}toArray(e=!1){const{cols:t,rows:i,_array:s}=this;if(e){const n=[];for(let o=0;o<i;o++)for(let a=0;a<t;a++)n[o+a*t]=s[a+o*t];return n}return s.slice()}toName(){return`Matrix${this.rows}(${this.rows}x${this.cols})`}toJSON(){return this._array}}class Wo extends St{constructor(A){super(4,4,A)}}const Vo=Jt/180,kc=180/Jt;function Mt(r,A,e){return Math.max(r,Math.min(A,e))}function Me(r,A,e){return(1-e)*r+e*A}const Uc={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(r,A=20){if(!this.adaptive||!r||Number.isNaN(r))return A;let e=Math.ceil(r/this.maxLength);return e<this.minSegments?e=this.minSegments:e>this.maxSegments&&(e=this.maxSegments),e}};class qo extends mt{constructor(A=0,e=0,t=0,i=0){super(4),this.set([A,e,t,i])}}class Ls extends St{constructor(A){super(4,5,A)}hueRotate(A=0){const e=Math.sin(A),t=Math.cos(A),i=.213,s=.715,n=.072;return this.multiply([i+t*(1-i)+e*-.213,s+t*-.715+e*-.715,n+t*-.072+e*(1-n),0,0,i+t*-.213+e*.143,s+t*(1-s)+e*.14,n+t*-.072+e*-.283,0,0,i+t*-.213+e*-.787,s+t*-.715+e*s,n+t*(1-n)+e*n,0,0,0,0,0,1,0])}saturate(A=1){const e=(A-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(A=1){const e=A;return this.multiply([e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0])}contrast(A=1){const e=A,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(A=1){const e=Me(1,-1,A),t=Me(0,255,A);return this.multiply([e,0,0,0,t,0,e,0,0,t,0,0,e,0,t,0,0,0,1,0])}sepia(A=1){const e=Mt(0,A,1);return this.multiply([Me(1,.393,e),Me(0,.7689999,e),Me(0,.18899999,e),0,0,Me(0,.349,e),Me(1,.6859999,e),Me(0,.16799999,e),0,0,Me(0,.272,e),Me(0,.5339999,e),Me(1,.13099999,e),0,0,0,0,0,1,0])}opacity(A=1){return this.multiply([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,A,0])}grayscale(A=1){const e=Mt(0,A,1),t=Me(1,.3,e),i=Me(0,.3,e),s=Me(1,.59,e),n=Me(0,.59,e),o=Me(1,.11,e),a=Me(0,.11,e);return this.multiply([t,n,a,0,0,i,s,a,0,0,i,n,o,0,0,0,0,0,1,0])}multiply(A){const e=A,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 A=this._array;return new Wo([A[0],A[1],A[2],A[3],A[5],A[6],A[7],A[8],A[10],A[11],A[12],A[13],A[15],A[16],A[17],A[18]])}toVector4(){const A=this._array;return new qo(A[4]/255,A[9]/255,A[14]/255,A[19]/255)}}class Nc extends St{constructor(A){super(2,2,A)}}let Os=class extends St{constructor(A){super(3,3,A)}invert(){const[A,e,t,i,s,n,o,a,l]=this._array,h=l*s-n*a,c=n*o-l*i,f=a*i-s*o,I=A*h+e*c+t*f;if(I===0)return this.set([0,0,0,0,0,0,0,0,0]);const d=1/I;return this.set([h*d,(t*a-l*e)*d,(n*e-t*s)*d,c*d,(l*A-t*o)*d,(t*i-n*A)*d,f*d,(e*o-a*A)*d,(s*A-e*i)*d])}};class Xo extends Os{constructor(A=0,e=0,t=0,i=0,s=!1){super(),this._x=A,this._y=e,this._width=t,this._height=i,this._flipY=s,this._performUpdateArray()}flipY(A){return this._flipY!==A&&(this._flipY=A,this._performUpdateArray()),this}translate(A,e){return(this._x!==A||this._y!==e)&&(this._x=A,this._y=e,this._performUpdateArray()),this}resize(A,e){return(this._width!==A||this._height!==e)&&(this._width=A,this._height=e,this._performUpdateArray()),this}_performUpdateArray(){const A=this._width,e=this._height;if(!A||!e)return;const t=this._x,i=this._y,s=this._flipY?-1:1,n=1/A*2,o=s*(1/e*2),a=-1-t*n,l=-s-i*o;this.set([n,0,a,0,o,l,0,0,1])}}let wt=class Qs extends mt{get x(){return this._array[0]}set x(A){const[e,t]=this._array;e!==A&&this.set(A,t)}get y(){return this._array[1]}set y(A){const[e,t]=this._array;t!==A&&this.set(e,A)}get width(){return this.x}set width(A){this.x=A}get height(){return this.y}set height(A){this.y=A}get left(){return this.x}set left(A){this.x=A}get top(){return this.y}set top(A){this.y=A}constructor(A=0,e){super(2),this.set(typeof A=="number"?[A,e??A]:A)}update(A,e){const[t,i]=this._array;return(t!==A||i!==e)&&this.set(A,e),this}getLength(){const[A,e]=this._array;return Math.sqrt(A*A+e*e)}getAngle(){const[A,e]=this._array;return Math.atan2(-A,-e)+Math.PI}distanceTo(A){return Math.hypot(A.x-this.x,A.y-this.y)}normalize(){const[A,e]=this._array,t=1/(this.getLength()||1);return this.set(A*t,e*t),this}static lerp(A,e,t){return new Qs(e).clone().sub(new Qs(A)).multiply(t).add(new Qs(A))}};class Hs{constructor(...A){u(this,"end",new wt);u(this,"position");u(this,"size");const e=new wt,t=new wt;switch(A.length){case 0:break;case 1:e.set(A[0].position),t.set(A[0].size);break;case 2:e.set(A[0]),t.set(A[1]);break;default:e.set(A[0],A[1]),t.set(A[2],A[3]);break}this.update=this.update.bind(this),this.position=e.on("update",this.update),this.size=t.on("update",this.update),this.update()}get x(){return this.position.x}get y(){return this.position.y}get left(){return this.position.x}get top(){return this.position.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get width(){return this.size.x}get height(){return this.size.y}update(){return this.end.set(this.position.x+this.size.x,this.position.y+this.size.y),this}toArray(){return[this.x,this.y,this.width,this.height]}}const BA=class BA extends Os{premultiply(A){return A.multiply(this,this)}skewX(A){return this.skew(A,0)}skewY(A){return this.skew(0,A)}skew(A,e){return this.premultiply(BA._t2d.makeSkew(A,e))}makeSkew(A,e){const t=Math.tan(A),i=Math.tan(e);return this.set([1,i,0,t,1,0,0,0,1]),this}translateX(A){return this.translate(A,0)}translateY(A){return this.translate(0,A)}translateZ(A){return this.translate(0,0,A)}translate3d(A,e,t){return this.translate(A,e,t)}translate(A,e,t=0){return this.premultiply(BA._t2d.makeTranslation(A,e,t))}makeTranslation(A,e,t=0){return this.set([1,0,A,0,1,e,0,0,1]),this}scaleX(A){return this.scale(A,1)}scaleY(A){return this.scale(1,A)}scale3d(A,e,t=1){return this.scale(A,e,t)}scale(A,e,t=1){return this.premultiply(BA._t2d.makeScale(A,e,t))}makeScale(A,e,t=1){return this.set([A,0,0,0,e,0,0,0,1]),this}rotateX(A){return this.scaleY(this._rotateToScale(A))}rotateY(A){return this.scaleX(this._rotateToScale(A))}rotateZ(A){return this.rotate(A)}rotate(A){return this.premultiply(BA._t2d.makeRotation(A))}rotate3d(A,e,t,i){const[s,n,o]=this._rotate3d(A,e,t,i);return s&&this.rotateX(s),n&&this.rotateY(n),o&&this.rotateZ(o),this}_rotateToScale(A){const e=A/At;return e<=.5?e*-4+1:(e-1)*4+1}_rotate3d(A,e,t,i){if(A===1&&e===0&&t===0)return[i,0,0];if(A===0&&e===1&&t===0)return[0,i,0];if(A===0&&e===0)return[0,0,i];{const s=Math.cos(i),n=Math.sin(i),o=s+A*A*(1-s),a=A*e*(1-s)-t*n,l=A*t*(1-s)+e*n,h=s+e*e*(1-s),c=e*t*(1-s)-A*n,f=s+t*t*(1-s),I=-Math.atan2(-c,h),d=-Math.atan2(l,Math.sqrt(c*c+f*f)),C=-Math.atan2(-a,o);return[I,d,C]}}makeRotation(A){const e=Math.cos(A),t=Math.sin(A);return this.set([e,-t,0,t,e,0,0,0,1]),this}applyToPoint(A,e){const{a:t,c:i,tx:s,b:n,d:o,ty:a}=this.toObject();return[t*A+i*e+s,n*A+o*e+a]}inverse(){return this.clone().invert()}isIdentity(){const{a:A,b:e,c:t,d:i,tx:s,ty:n}=this.toObject();return A===1&&e===0&&t===0&&i===1&&s===0&&n===0}toObject(){const[A,e,t,i,s,n,,,o]=this._array;return{a:A,c:e,tx:t,b:i,d:s,ty:n,tz:o}}};u(BA,"_t2d",new BA);let Bt=BA;class Fc extends mt{constructor(){super(3)}}var Tc=Object.defineProperty,jo=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Tc(A,e,i),i};class dr extends rA{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){this._starting||(this._starting=!0,this.off("process"),this.on("process",e),Se.on(this._onNextTick,{sort:0}))}stop(){this._starting&&(this._starting=!1,Se.off(this._onNextTick,{sort:0}))}_onNextTick(){const e=Se.elapsed*this.speed;if((this._nextDeltaTime-=e)<=0){const i=(this._nextDeltaTime=this.spf)||e;this.emit("process",i)}}free(){super.free(),this.stop()}}jo([M({default:24})],dr.prototype,"fps"),jo([M({default:1})],dr.prototype,"speed");class Zo{constructor(){u(this,"view");u(this,"pixelRatio",Ds);u(this,"screen",{x:0,y:0,width:0,height:0});u(this,"related",new FA)}getRelated(A,e){let t=this.related.get(A);return t||(e?(this.related.set(A,t=e()),t):(console.warn("Failed to get related",A),null))}resize(A,e,t=!0){this.view&&(this.view.width=Math.floor(A*this.pixelRatio),this.view.height=Math.floor(e*this.pixelRatio)),this.screen.width=A,this.screen.height=e,t&&this.view&&(this.view.style.width=`${A}px`,this.view.style.height=`${e}px`)}}var GA=(r=>(r.NORMAL="normal",r.ADD="add",r.MULTIPLY="multiply",r.SCREEN="screen",r.NONE="none",r.NORMAL_NPM="normal_npm",r.ADD_NPM="add_npm",r.SCREEN_NPM="screen_npm",r.SRC_IN="src_in",r.SRC_OUT="src_out",r.SRC_ATOP="src_atop",r.DST_OVER="dst_over",r.DST_IN="dst_in",r.DST_OUT="dst_out",r.DST_ATOP="dst_atop",r.XOR="xor",r.SUBTRACT="subtract",r))(GA||{});function $o(r){return{normal:[r.ONE,r.ONE_MINUS_SRC_ALPHA],add:[r.ONE,r.ONE],multiply:[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],screen:[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],none:[0,0],normal_npm:[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],add_npm:[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],screen_npm:[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],src_in:[r.DST_ALPHA,r.ZERO],src_out:[r.ONE_MINUS_DST_ALPHA,r.ZERO],src_atop:[r.DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],dst_over:[r.ONE_MINUS_DST_ALPHA,r.ONE],dst_in:[r.ZERO,r.SRC_ALPHA],dst_out:[r.ZERO,r.ONE_MINUS_SRC_ALPHA],dst_atop:[r.ONE_MINUS_DST_ALPHA,r.SRC_ALPHA],xor:[r.ONE_MINUS_DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],subtract:[r.ONE,r.ONE,r.ONE,r.ONE,r.FUNC_REVERSE_SUBTRACT,r.FUNC_ADD]}}class Et{get gl(){return this._renderer.gl}install(A){this._renderer=A}onUpdateContext(){}flush(){}reset(){}free(){}}const ss=class ss{constructor(A){u(this,"_blendMode",GA.NORMAL);u(this,"_polygonOffset",0);u(this,"bitmap",0);if(A)for(const e in A)this[e]=A[e]}static _init(){this._properties.forEach((A,e)=>{Object.defineProperty(this.prototype,A,{get(){return!!(this.bitmap&1<<e)},set(t){!!(this.bitmap&1<<e)!==t&&(this.bitmap^=1<<e)},enumerable:!0,configurable:!0})})}static for2D(){const A=new ss;return A.depthTest=!1,A.blend=!0,A}get blendMode(){return this._blendMode}set blendMode(A){this.blend=A!==GA.NONE,this._blendMode=A}get polygonOffset(){return this._polygonOffset}set polygonOffset(A){this.offsets=!!A,this._polygonOffset=A}};u(ss,"_properties",["blend","offsets","culling","depthTest","clockwiseFrontFace","depthMask"]);let mA=ss;mA._init();class ea extends Et{constructor(){super(...arguments);u(this,"_blendEq",!1);u(this,"_setters",mA._properties.map(e=>this[`set${e.replace(/^\S/,t=>t.toUpperCase())}`]));u(this,"boundStateBitmap",0);u(this,"boundBlendMode");u(this,"blendModes");u(this,"defaultState",new mA({blend:!0}))}install(e){super.install(e),e.state=this}onUpdateContext(){super.onUpdateContext(),this.blendModes=$o(this._renderer.gl)}toggle(e,t){this._renderer.gl[t?"enable":"disable"](e)}setBlend(e){this.toggle(this._renderer.gl.BLEND,e)}setOffsets(e){this.toggle(this._renderer.gl.POLYGON_OFFSET_FILL,e)}setCulling(e){this.toggle(this._renderer.gl.CULL_FACE,e)}setDepthTest(e){this.toggle(this._renderer.gl.DEPTH_TEST,e)}setDepthMask(e){this._renderer.gl.depthMask(e)}setClockwiseFrontFace(e){const t=this._renderer.gl;t.frontFace(t[e?"CW":"CCW"])}setBlendMode(e){if(e===this.boundBlendMode)return;this.boundBlendMode=e;const t=this.blendModes[e],i=this._renderer.gl;t.length===2?i.blendFunc(t[0],t[1]):i.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=!0,i.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}setPolygonOffset(e,t){this._renderer.gl.polygonOffset(e,t)}bind(e){var t;if(this.boundStateBitmap!==e.bitmap){let i=this.boundStateBitmap^e.bitmap,s=0;for(;i;)i&1&&((t=this._setters[s])==null||t.call(this,!!(e.bitmap&1<<s))),i=i>>1,s++;this.boundStateBitmap=e.bitmap}e.blend&&this.setBlendMode(e.blendMode),e.offsets&&this.setPolygonOffset(1,e.polygonOffset)}reset(){super.reset();const e=this._renderer.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),this.bind(this.defaultState),this._blendEq=!0,this.setBlendMode(GA.NORMAL)}}class ta extends Et{constructor(){super(...arguments);u(this,"_state",mA.for2D());u(this,"_batchSize",4096*4);u(this,"_drawCallUid",0);u(this,"_defaultModulate",4294967295);u(this,"_defaultBackgroundColor",0);u(this,"_defaultColorMatrixOffset",[0,0,0,0]);u(this,"_defaultColorMatrix",[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);u(this,"_batchables",[]);u(this,"_vertexCount",0);u(this,"_indexCount",0);u(this,"_attributeBuffer",[]);u(this,"_indexBuffers",[]);u(this,"_shaders",new Map);u(this,"_attributes",{aTextureId:{size:1,normalized:!0,type:"float"},aPosition:{size:2,normalized:!1,type:"float"},aUv:{size:2,normalized:!1,type:"float"},aModulate:{size:4,normalized:!0,type:"unsigned_byte"},aBackgroundColor:{size:4,normalized:!0,type:"unsigned_byte"},aDisableWrapMode:{size:4,normalized:!0,type:"float"},aColorMatrixOffset:{size:4,normalized:!1,type:"float"},aColorMatrix:{size:4,normalized:!1,type:"float"}});u(this,"_vertexSize",31)}install(e){super.install(e),e.batch2D=this}_getShader(e){let t=this._shaders.get(e);return t||this._shaders.set(e,t=this._createShader(e)),t}_createShader(e){const t=this._renderer,i=t.program.create({vert:`precision highp float;
|
|
1
|
+
(function(g,tt){typeof exports=="object"&&typeof module<"u"?tt(exports):typeof define=="function"&&define.amd?define(["exports"],tt):(g=typeof globalThis<"u"?globalThis:g||self,tt(g.modernCanvas={}))})(this,function(g){"use strict";var dB=Object.defineProperty;var IB=(g,tt,Jt)=>tt in g?dB(g,tt,{enumerable:!0,configurable:!0,writable:!0,value:Jt}):g[tt]=Jt;var u=(g,tt,Jt)=>IB(g,typeof tt!="symbol"?tt+"":tt,Jt);var kA,EA;var tt=typeof document<"u"?document.currentScript:null;const Jt=Math.PI,At=Jt*2;let Th=0;function co(r){var A;return((A=r==null?void 0:r.__SPECTOR_Object_TAG)==null?void 0:A.id)??++Th}function ys(r){return!(r&r-1)&&!!r}const Gh=/([\w-]+)\((.+?)\)/g,Lh=/[^,]+/g,Oh=/([-e.\d]+)(.*)/;function ms(r){return Array.isArray(r)?r.map(A=>({name:A.name,args:A.args.map(e=>({...e,normalizedIntValue:e.normalizedDefaultIntValue}))})):{...r,normalizedIntValue:r.normalizedDefaultIntValue}}function Bi(r,A,e={}){const t=Ei(A,e);return t.length?t:go(r,A,e)}function Ei(r,A={}){const e=[];let t;for(;(t=Gh.exec(r))!==null;){const[,i,s]=t;i&&e.push({name:i,args:Hh(i,s,A)})}return e}function Hh(r,A,e={}){const t=[];let i,s=0;for(;(i=Lh.exec(A))!==null;)t.push(go(r,i[0],{...e,index:s++}));return t}function go(r,A,e={}){const{width:t=1,height:i=1,index:s=0}=e,n=A.match(Oh),o={unit:(n==null?void 0:n[2])??null,value:A,intValue:Number(n==null?void 0:n[1]),normalizedIntValue:0,normalizedDefaultIntValue:0};switch(r){case"scale":case"scaleX":case"scaleY":case"scale3d":o.normalizedDefaultIntValue=1;break}switch(o.unit){case"%":o.normalizedIntValue=o.intValue/100;break;case"rad":o.normalizedIntValue=o.intValue/At;break;case"deg":o.normalizedIntValue=o.intValue/360;break;case"px":switch(s){case 0:o.normalizedIntValue=o.intValue/t;break;case 1:o.normalizedIntValue=o.intValue/i;break}break;case"turn":case"em":case"rem":default:o.normalizedIntValue=o.intValue;break}return o}const uo="WebGL2RenderingContext"in globalThis,fo="ImageBitmap"in globalThis,Io="ResizeObserver"in globalThis,NA="PointerEvent"in globalThis,po="WheelEvent"in globalThis,Jh="MouseEvent"in globalThis,Kt="ontouchstart"in globalThis,Bo="onclick"in globalThis,ws="createImageBitmap"in globalThis,vs="AudioContext"in globalThis,_s="webkitAudioContext"in globalThis,bs="OfflineAudioContext"in globalThis,Eo="webkitOfflineAudioContext"in globalThis,Co=vs||_s,Ci=typeof window<"u",Ds=globalThis.devicePixelRatio||1,xs=r=>r!==null&&typeof r=="object"&&r.nodeType===1,Qo=r=>xs(r)&&r.tagName==="VIDEO",Kh=r=>xs(r)&&r.tagName==="IMG";function yo(r){return typeof r=="object"&&r!==null&&r.nodeType===1&&r.tagName==="CANVAS"}function mo(r){return uo&&r instanceof globalThis.WebGL2RenderingContext}function wo(){if(Ci)return globalThis.document.createElement("canvas")}function vo(r,A=globalThis.location){if(r.startsWith("data:"))return"";A=A||globalThis.location;const e=new URL(r,document.baseURI);return e.hostname!==A.hostname||e.port!==A.port||e.protocol!==A.protocol?"anonymous":""}function _o(r,A,e){e===null&&!A.startsWith("data:")?r.crossOrigin=vo(A):e!==!1&&(r.crossOrigin=typeof e=="string"?e:"anonymous")}class FA{constructor(){u(this,"_map",new WeakMap)}_toRaw(A){if(A&&typeof A=="object"){const e=A.__v_raw;e&&(A=this._toRaw(e))}return A}delete(A){return this._map.delete(this._toRaw(A))}get(A){return this._map.get(this._toRaw(A))}has(A){return this._map.has(this._toRaw(A))}set(A,e){return this._map.set(this._toRaw(A),this._toRaw(e)),this}}const bo=new FA;function or(r){let A=bo.get(r);if(!A){const e=Object.getPrototypeOf(r);A=new Map(e?or(e):void 0),bo.set(r,A)}return A}function Qi(r,A,e={}){or(r).set(A,e);const{default:t,alias:i}=e;let s=Object.getOwnPropertyDescriptor(r.prototype,A);if(!s){const n=i??Symbol.for(String(A));s={get(){return this[n]},set(o){this[n]=o}}}Object.defineProperty(r.prototype,A,{get(){var n;return((n=s.get)==null?void 0:n.call(this))??t},set(n){var a,l,h;const o=((a=s.get)==null?void 0:a.call(this))??t;(l=s.set)==null||l.call(this,n),(h=this.requestUpdate)==null||h.call(this,A,o,e)},configurable:!0,enumerable:!0})}function M(r){return function(A,e){Qi(A.constructor,e,r)}}const ar=new Map;function ne(r,A){return function(e){Object.defineProperty(e.prototype,"tag",{value:r,enumerable:!0,configurable:!0}),A&&Object.keys(A).forEach(t=>{Qi(e,t,{default:A[t]})}),ar.set(r,e)}}function Be(r){return M({...r,protected:!0})}function Yh(r="node",A={}){const e=ar.get(r);if(!e)throw new Error(`Failed to createNode, tag: ${r}`);return new e().setProperties(A)}class Se{static get currentTime(){return this._currentTime}static get elapsed(){return this._elapsed}static on(A,e={}){const{sort:t=0,once:i=!1}=e;this._queue[t]||(this._queue[t]=[]),this._queue[t].push({cb:A,once:i})}static off(A,e={}){const{sort:t=0}=e,i=this._queue[t];if(!i)return;const s=[];for(let n=i.length,o=0;o<n;o++){const a=i[o];a.cb!==A&&s.push(a)}s.length?this._queue[t]=s:this._queue.splice(t,1)}static start(){"requestAnimationFrame"in globalThis&&(this._currentTime=performance.now(),this._requestId=requestAnimationFrame(A=>this._update(A)))}static stop(){this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=void 0)}static _update(A){this._elapsed=A-this._currentTime,this._currentTime=A,this._requestId=requestAnimationFrame(e=>this._update(e)),this._performUpdate()}static _performUpdate(){const A=this._queue,e=[];for(let t=A.length,i=t;i>=0;i--){const s=A[i];if(!s)continue;const n=[];for(let o=s.length,a=0;a<o;a++){const l=s[a];try{l.cb()}catch(h){console.warn(h)}l.once||n.push(l)}n.length&&(e[i]=n)}this._queue=e}}u(Se,"_queue",[]),u(Se,"_currentTime",0),u(Se,"_elapsed",0),u(Se,"_requestId"),Se.start();async function Ss(r){return new Promise(A=>{Se.on(()=>{r==null||r(),A()},{sort:1,once:!0})})}let Yt=class{constructor(){u(this,"eventListeners",new Map)}removeAllListeners(){return this.eventListeners.clear(),this}hasEventListener(A){return this.eventListeners.has(A)}on(A,e,t){const i={value:e,options:t},s=this.eventListeners.get(A);return s?Array.isArray(s)?s.push(i):this.eventListeners.set(A,[s,i]):this.eventListeners.set(A,i),this}once(A,e){return this.on(A,e,{once:!0})}off(A,e,t){var s,n;if(!e)return this.eventListeners.delete(A),this;const i=this.eventListeners.get(A);if(!i)return this;if(Array.isArray(i)){const o=[];for(let a=0,l=i.length;a<l;a++){const h=i[a];(h.value!==e||typeof t=="object"&&(t!=null&&t.once)&&(typeof h.options=="boolean"||!((s=h.options)!=null&&s.once)))&&o.push(h)}o.length?this.eventListeners.set(A,o.length===1?o[0]:o):this.eventListeners.delete(A)}else i.value===e&&(typeof t=="boolean"||!(t!=null&&t.once)||typeof i.options=="boolean"||(n=i.options)!=null&&n.once)&&this.eventListeners.delete(A);return this}emit(A,...e){var i,s;const t=this.eventListeners.get(A);if(t){if(Array.isArray(t))for(let n=t.length,o=0;o<n;o++){const a=t[o];typeof a.options=="object"&&((i=a.options)!=null&&i.once)&&this.off(A,a.value,a.options),a.value.apply(this,e)}else typeof t.options=="object"&&((s=t.options)!=null&&s.once)&&this.off(A,t.value,t.options),t.value.apply(this,e);return!0}else return!1}},zh=0;class rA extends Yt{constructor(){super(...arguments);u(this,"instanceId",++zh);u(this,"_defaultProperties");u(this,"_updatedProperties",new Map);u(this,"_changedProperties",new Set);u(this,"_updatingPromise",Promise.resolve());u(this,"_updating",!1)}is(e){return!!(e&&this.instanceId===e.instanceId)}async _enqueueUpdate(){this._updating=!0;try{await this._updatingPromise}catch(e){Promise.reject(e)}await Ss(),this._updating&&(this.update(),this._updating=!1)}update(){this._update(this._updatedProperties),this._updatedProperties=new Map}_update(e){}_updateProperty(e,t,i,s){}isDirty(e){return this._updatedProperties.has(e)}getPropertyDeclarations(){return or(this.constructor)}getPropertyDeclaration(e){return this.getPropertyDeclarations().get(e)}getDefaultProperties(){if(!this._defaultProperties){this._defaultProperties={};for(const[e,t]of this.getPropertyDeclarations())!t.protected&&!t.alias&&(this._defaultProperties[e]=t.default)}return this._defaultProperties}getProperty(e){return this[e]}setProperty(e,t){return this[e]=t,this}getProperties(e){const t={};for(const[i,s]of this.getPropertyDeclarations())!s.protected&&!s.alias&&(!e||e.includes(i))&&(t[i]=this.getProperty(i));return t}setProperties(e){if(e&&typeof e=="object")for(const[t]of this.getPropertyDeclarations())t in e&&this.setProperty(t,e[t]);return this}requestUpdate(e,t,i){if(e!==void 0){const s=this[e];if(!Object.is(s,t))this._updatedProperties.set(e,t),this._changedProperties.add(e),i??(i=this.getPropertyDeclaration(e)),this._updateProperty(e,s,t,i),this.emit("updateProperty",e,s,t,i);else return}this._updating||(this._updatingPromise=this._enqueueUpdate())}toJSON(){const e={},t=this.getProperties(Array.from(this._changedProperties));for(const i in t){const s=t[i];s&&typeof s=="object"&&"toJSON"in s&&typeof s.toJSON=="function"?e[i]=s.toJSON():e[i]=s}return e}clone(){return new this.constructor(this.toJSON())}free(){this.removeAllListeners()}}class Do extends rA{}class lr{constructor(){u(this,"bubbles",!0);u(this,"cancelable",!1);u(this,"which");u(this,"cancelBubble",!0);u(this,"returnValue");u(this,"srcElement");u(this,"composed",!1);u(this,"currentTarget");u(this,"defaultPrevented",!1);u(this,"eventPhase",lr.prototype.NONE);u(this,"isTrusted");u(this,"target");u(this,"timeStamp");u(this,"type");u(this,"nativeEvent");u(this,"originalEvent");u(this,"propagationStopped",!1);u(this,"propagationImmediatelyStopped",!1);u(this,"path");u(this,"detail");u(this,"view");u(this,"layer",{x:0,y:0});u(this,"page",{x:0,y:0});u(this,"NONE",0);u(this,"CAPTURING_PHASE",1);u(this,"AT_TARGET",2);u(this,"BUBBLING_PHASE",3)}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}initEvent(...A){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(...A){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}composedPath(){return this.path}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class Ms extends lr{constructor(){super(...arguments);u(this,"altKey");u(this,"button");u(this,"buttons");u(this,"ctrlKey");u(this,"metaKey");u(this,"relatedTarget");u(this,"shiftKey");u(this,"client",{x:0,y:0});u(this,"movement",{x:0,y:0});u(this,"offset",{x:0,y:0});u(this,"global",{x:0,y:0});u(this,"screen",{x:0,y:0})}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(e){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(...e){throw new Error("Method not implemented.")}}class xo extends Ms{constructor(){super(...arguments);u(this,"width",0);u(this,"height",0);u(this,"isPrimary",!1);u(this,"pointerType");u(this,"pressure");u(this,"tangentialPressure");u(this,"tiltX");u(this,"tiltY");u(this,"twist")}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class yi extends Ms{constructor(){super(...arguments);u(this,"deltaMode");u(this,"deltaX");u(this,"deltaY");u(this,"deltaZ");u(this,"DOM_DELTA_PIXEL",0);u(this,"DOM_DELTA_LINE",1);u(this,"DOM_DELTA_PAGE",2)}}u(yi,"DOM_DELTA_PIXEL",0),u(yi,"DOM_DELTA_LINE",1),u(yi,"DOM_DELTA_PAGE",2);const Wh={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class So extends Yt{constructor(){super(...arguments);u(this,"target");u(this,"cursor","default");u(this,"cursorStyles",{default:"inherit",pointer:"pointer"});u(this,"setuped",!1);u(this,"event");u(this,"enableMoveEvent",!0);u(this,"enableWheelEvent",!0);u(this,"enableClickEvent",!0);u(this,"onPointerDown",e=>{if(Kt&&e.pointerType==="touch")return;const t=this.normalize(e);for(let i=0,s=t.length;i<s;i++)this.emit("pointerdown",this.event=this.clonePointerEvent(t[i]));this.setCursor(this.cursor)});u(this,"onPointerOver",e=>{if(!this.enableClickEvent||Kt&&e.pointerType==="touch")return;const t=this.normalize(e);for(let i=0,s=t.length;i<s;i++)this.emit("pointerover",this.event=this.clonePointerEvent(t[i]))});u(this,"onPointerMove",e=>{if(!this.enableMoveEvent||Kt&&e.pointerType==="touch")return;const t=this.normalize(e);for(let i=0,s=t.length;i<s;i++)this.emit("pointermove",this.event=this.clonePointerEvent(t[i]))});u(this,"onPointerUp",e=>{if(!this.enableClickEvent||Kt&&e.pointerType==="touch")return;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);const i=t!==this.target?"outside":"",s=this.normalize(e);for(let n=0,o=s.length;n<o;n++){const a=this.clonePointerEvent(s[n]);a.type+=i,this.emit("pointerup",this.event=a)}});u(this,"onWheel",e=>{if(!this.enableWheelEvent)return;const t=this.normalize(e);for(let i=0,s=t.length;i<s;i++)this.emit("wheel",this.event=this.cloneWheelEvent(t[i]))})}setTarget(e){this.removeEventListeners(),this.target=e,this.addEventListeners()}removeEventListeners(){if(!this.setuped||!this.target)return;const e=this.target.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):NA&&(e.touchAction=""),NA?(this.target.removeEventListener("pointerdown",this.onPointerDown),this.target.removeEventListener("pointerleave",this.onPointerOver),this.target.removeEventListener("pointerover",this.onPointerOver),this.target.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.target.ownerDocument.removeEventListener("pointerup",this.onPointerUp)):(this.target.removeEventListener("mousedown",this.onPointerDown),this.target.removeEventListener("mouseout",this.onPointerOver),this.target.removeEventListener("mouseover",this.onPointerOver),this.target.ownerDocument.removeEventListener("mousemove",this.onPointerMove),this.target.ownerDocument.removeEventListener("mouseup",this.onPointerUp)),Kt&&(this.target.removeEventListener("touchstart",this.onPointerDown),this.target.removeEventListener("touchmove",this.onPointerMove),this.target.removeEventListener("touchend",this.onPointerUp)),this.target.removeEventListener("wheel",this.onWheel),this.target=void 0,this.setuped=!1}addEventListeners(){if(this.setuped||!this.target)return;const e=this.target.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):NA&&(e.touchAction="none")),NA?(this.target.addEventListener("pointerdown",this.onPointerDown),this.target.addEventListener("pointerleave",this.onPointerOver),this.target.addEventListener("pointerover",this.onPointerOver),this.target.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.target.ownerDocument.addEventListener("pointerup",this.onPointerUp)):(this.target.addEventListener("mousedown",this.onPointerDown),this.target.addEventListener("mouseout",this.onPointerOver),this.target.addEventListener("mouseover",this.onPointerOver),this.target.ownerDocument.addEventListener("mousemove",this.onPointerMove),this.target.ownerDocument.addEventListener("mouseup",this.onPointerUp)),Kt&&(this.target.addEventListener("touchstart",this.onPointerDown),this.target.addEventListener("touchmove",this.onPointerMove),this.target.addEventListener("touchend",this.onPointerUp)),this.target.addEventListener("wheel",this.onWheel),this.setuped=!0}normalize(e){const t=[];if(Kt&&e instanceof globalThis.TouchEvent)for(let i=0,s=e.changedTouches.length;i<s;i++){const n=e.changedTouches[i];typeof n.button>"u"&&(n.button=0),typeof n.buttons>"u"&&(n.buttons=1),typeof n.isPrimary>"u"&&(n.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof n.width>"u"&&(n.width=n.radiusX||1),typeof n.height>"u"&&(n.height=n.radiusY||1),typeof n.tiltX>"u"&&(n.tiltX=0),typeof n.tiltY>"u"&&(n.tiltY=0),typeof n.pointerType>"u"&&(n.pointerType="touch"),typeof n.pointerId>"u"&&(n.pointerId=n.identifier||0),typeof n.pressure>"u"&&(n.pressure=n.force||.5),typeof n.twist>"u"&&(n.twist=0),typeof n.tangentialPressure>"u"&&(n.tangentialPressure=0),typeof n.layerX>"u"&&(n.layerX=n.offsetX=n.clientX),typeof n.layerY>"u"&&(n.layerY=n.offsetY=n.clientY),n.type=e.type,t.push(n)}else if(po&&e instanceof globalThis.WheelEvent)t.push(e);else if(NA&&e instanceof globalThis.PointerEvent)t.push(e);else{const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=1),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),t.push(i)}return t}cloneWheelEvent(e){const t=new yi;return this.copyMouseEvent(t,e),t.wheelDeltaY=e.wheelDeltaY,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.x=t.screen.x,t.global.y=t.screen.y,t.offset.x=t.screen.x,t.offset.y=t.screen.y,t.nativeEvent=e,t.type=e.type,t}clonePointerEvent(e){const t=new xo;return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,t.isTrusted=e.isTrusted,this.copyMouseEvent(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.x=t.screen.x,t.global.y=t.screen.y,t.offset.x=t.screen.x,t.offset.y=t.screen.y,t.type==="pointerleave"?t.type="pointerout":t.type.startsWith("mouse")?t.type=t.type.replace("mouse","pointer"):t.type.startsWith("touch")&&(t.type=Wh[t.type]||t.type),t}copyMouseEvent(e,t){e.preventDefault=t.preventDefault.bind(t),e.stopPropagation=t.stopPropagation.bind(t),e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}setCursor(e){if(!this.target||(e=e||"default",this.cursor===e))return;this.cursor=e;const t=!(globalThis.OffscreenCanvas&&this.target instanceof OffscreenCanvas),i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.target.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.target.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.target.style.cursor=e)}mapPositionToPoint(e,t,i){if(!this.target)return;const s=Number(this.target.getAttribute("width"))||0,n=Number(this.target.getAttribute("height"))||0,o=Number(this.target.getAttribute("data-pixel-ratio"))||1,a=this.target.isConnected?this.target.getBoundingClientRect():{width:s,height:n,left:0,top:0},l=1/o;e.x=(t-a.left)*(s/a.width)*l,e.y=(i-a.top)*(n/a.height)*l}}class zt extends Do{}var Vh={grad:.9,turn:360,rad:360/(2*Math.PI)},Wt=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},Ue=function(r,A,e){return A===void 0&&(A=0),e===void 0&&(e=Math.pow(10,A)),Math.round(e*r)/e+0},pt=function(r,A,e){return A===void 0&&(A=0),e===void 0&&(e=1),r>e?e:r>A?r:A},Mo=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},Ro=function(r){return{r:pt(r.r,0,255),g:pt(r.g,0,255),b:pt(r.b,0,255),a:pt(r.a)}},Rs=function(r){return{r:Ue(r.r),g:Ue(r.g),b:Ue(r.b),a:Ue(r.a,3)}},qh=/^#([0-9a-f]{3,8})$/i,hr=function(r){var A=r.toString(16);return A.length<2?"0"+A:A},Po=function(r){var A=r.r,e=r.g,t=r.b,i=r.a,s=Math.max(A,e,t),n=s-Math.min(A,e,t),o=n?s===A?(e-t)/n:s===e?2+(t-A)/n:4+(A-e)/n:0;return{h:60*(o<0?o+6:o),s:s?n/s*100:0,v:s/255*100,a:i}},ko=function(r){var A=r.h,e=r.s,t=r.v,i=r.a;A=A/360*6,e/=100,t/=100;var s=Math.floor(A),n=t*(1-e),o=t*(1-(A-s)*e),a=t*(1-(1-A+s)*e),l=s%6;return{r:255*[t,o,n,n,a,t][l],g:255*[a,t,t,o,n,n][l],b:255*[n,n,a,t,t,o][l],a:i}},Uo=function(r){return{h:Mo(r.h),s:pt(r.s,0,100),l:pt(r.l,0,100),a:pt(r.a)}},No=function(r){return{h:Ue(r.h),s:Ue(r.s),l:Ue(r.l),a:Ue(r.a,3)}},Fo=function(r){return ko((e=(A=r).s,{h:A.h,s:(e*=((t=A.l)<50?t:100-t)/100)>0?2*e/(t+e)*100:0,v:t+e,a:A.a}));var A,e,t},mi=function(r){return{h:(A=Po(r)).h,s:(i=(200-(e=A.s))*(t=A.v)/100)>0&&i<200?e*t/100/(i<=100?i:200-i)*100:0,l:i/2,a:A.a};var A,e,t,i},Xh=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,jh=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Zh=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,$h=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ps={string:[[function(r){var A=qh.exec(r);return A?(r=A[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:r.length===4?Ue(parseInt(r[3]+r[3],16)/255,2):1}:r.length===6||r.length===8?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:r.length===8?Ue(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var A=Zh.exec(r)||$h.exec(r);return A?A[2]!==A[4]||A[4]!==A[6]?null:Ro({r:Number(A[1])/(A[2]?100/255:1),g:Number(A[3])/(A[4]?100/255:1),b:Number(A[5])/(A[6]?100/255:1),a:A[7]===void 0?1:Number(A[7])/(A[8]?100:1)}):null},"rgb"],[function(r){var A=Xh.exec(r)||jh.exec(r);if(!A)return null;var e,t,i=Uo({h:(e=A[1],t=A[2],t===void 0&&(t="deg"),Number(e)*(Vh[t]||1)),s:Number(A[3]),l:Number(A[4]),a:A[5]===void 0?1:Number(A[5])/(A[6]?100:1)});return Fo(i)},"hsl"]],object:[[function(r){var A=r.r,e=r.g,t=r.b,i=r.a,s=i===void 0?1:i;return Wt(A)&&Wt(e)&&Wt(t)?Ro({r:Number(A),g:Number(e),b:Number(t),a:Number(s)}):null},"rgb"],[function(r){var A=r.h,e=r.s,t=r.l,i=r.a,s=i===void 0?1:i;if(!Wt(A)||!Wt(e)||!Wt(t))return null;var n=Uo({h:Number(A),s:Number(e),l:Number(t),a:Number(s)});return Fo(n)},"hsl"],[function(r){var A=r.h,e=r.s,t=r.v,i=r.a,s=i===void 0?1:i;if(!Wt(A)||!Wt(e)||!Wt(t))return null;var n=function(o){return{h:Mo(o.h),s:pt(o.s,0,100),v:pt(o.v,0,100),a:pt(o.a)}}({h:Number(A),s:Number(e),v:Number(t),a:Number(s)});return ko(n)},"hsv"]]},To=function(r,A){for(var e=0;e<A.length;e++){var t=A[e][0](r);if(t)return[t,A[e][1]]}return[null,void 0]},ec=function(r){return typeof r=="string"?To(r.trim(),Ps.string):typeof r=="object"&&r!==null?To(r,Ps.object):[null,void 0]},ks=function(r,A){var e=mi(r);return{h:e.h,s:pt(e.s+100*A,0,100),l:e.l,a:e.a}},Us=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},Go=function(r,A){var e=mi(r);return{h:e.h,s:e.s,l:pt(e.l+100*A,0,100),a:e.a}},Ns=function(){function r(A){this.parsed=ec(A)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return this.parsed!==null},r.prototype.brightness=function(){return Ue(Us(this.rgba),2)},r.prototype.isDark=function(){return Us(this.rgba)<.5},r.prototype.isLight=function(){return Us(this.rgba)>=.5},r.prototype.toHex=function(){return A=Rs(this.rgba),e=A.r,t=A.g,i=A.b,n=(s=A.a)<1?hr(Ue(255*s)):"","#"+hr(e)+hr(t)+hr(i)+n;var A,e,t,i,s,n},r.prototype.toRgb=function(){return Rs(this.rgba)},r.prototype.toRgbString=function(){return A=Rs(this.rgba),e=A.r,t=A.g,i=A.b,(s=A.a)<1?"rgba("+e+", "+t+", "+i+", "+s+")":"rgb("+e+", "+t+", "+i+")";var A,e,t,i,s},r.prototype.toHsl=function(){return No(mi(this.rgba))},r.prototype.toHslString=function(){return A=No(mi(this.rgba)),e=A.h,t=A.s,i=A.l,(s=A.a)<1?"hsla("+e+", "+t+"%, "+i+"%, "+s+")":"hsl("+e+", "+t+"%, "+i+"%)";var A,e,t,i,s},r.prototype.toHsv=function(){return A=Po(this.rgba),{h:Ue(A.h),s:Ue(A.s),v:Ue(A.v),a:Ue(A.a,3)};var A},r.prototype.invert=function(){return xt({r:255-(A=this.rgba).r,g:255-A.g,b:255-A.b,a:A.a});var A},r.prototype.saturate=function(A){return A===void 0&&(A=.1),xt(ks(this.rgba,A))},r.prototype.desaturate=function(A){return A===void 0&&(A=.1),xt(ks(this.rgba,-A))},r.prototype.grayscale=function(){return xt(ks(this.rgba,-1))},r.prototype.lighten=function(A){return A===void 0&&(A=.1),xt(Go(this.rgba,A))},r.prototype.darken=function(A){return A===void 0&&(A=.1),xt(Go(this.rgba,-A))},r.prototype.rotate=function(A){return A===void 0&&(A=15),this.hue(this.hue()+A)},r.prototype.alpha=function(A){return typeof A=="number"?xt({r:(e=this.rgba).r,g:e.g,b:e.b,a:A}):Ue(this.rgba.a,3);var e},r.prototype.hue=function(A){var e=mi(this.rgba);return typeof A=="number"?xt({h:A,s:e.s,l:e.l,a:e.a}):Ue(e.h)},r.prototype.isEqual=function(A){return this.toHex()===xt(A).toHex()},r}(),xt=function(r){return r instanceof Ns?r:new Ns(r)},Lo=[],tc=function(r){r.forEach(function(A){Lo.indexOf(A)<0&&(A(Ns,Ps),Lo.push(A))})};function Ac(r,A){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={};r.prototype.toName=function(n){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,a,l=t[this.toHex()];if(l)return l;if(n!=null&&n.closest){var h=this.toRgb(),c=1/0,f="black";if(!s.length)for(var I in e)s[I]=new r(e[I]).toRgb();for(var d in e){var C=(o=h,a=s[d],Math.pow(o.r-a.r,2)+Math.pow(o.g-a.g,2)+Math.pow(o.b-a.b,2));C<c&&(c=C,f=d)}return f}},A.string.push([function(n){var o=n.toLowerCase(),a=o==="transparent"?"#0000":e[o];return a?new r(a).toRgb():null},"name"])}function he(r){return r==null||r==="none"}function TA(r,A=0,e=10**A){return Math.round(e*r)/e+0}function Fs(r,A=!1){if(typeof r!="object"||!r)return r;if(Array.isArray(r))return A?r.map(t=>Fs(t,A)):r;const e={};for(const t in r){const i=r[t];i!=null&&(A?e[t]=Fs(i,A):e[t]=i)}return e}function Ts(r,A){const e={};return A.forEach(t=>{t in r&&(e[t]=r[t])}),e}function Gs(r){let A;return typeof r=="number"?A={r:r>>24&255,g:r>>16&255,b:r>>8&255,a:(r&255)/255}:A=r,xt(A)}function ic(r){return{r:TA(r.r),g:TA(r.g),b:TA(r.b),a:TA(r.a,3)}}function cr(r){const A=r.toString(16);return A.length<2?`0${A}`:A}const Oo="#000000FF";function rc(r){return Gs(r).isValid()}function ht(r,A=!1){const e=Gs(r);if(!e.isValid()){if(typeof r=="string")return r;const o=`Failed to normalizeColor ${r}`;if(A)throw new Error(o);return console.warn(o),Oo}const{r:t,g:i,b:s,a:n}=ic(e.rgba);return`#${cr(t)}${cr(i)}${cr(s)}${cr(TA(n*255))}`}var gr=gr||{};gr.parse=function(){const r={linearGradient:/^(-(webkit|o|ms|moz)-)?(linear-gradient)/i,repeatingLinearGradient:/^(-(webkit|o|ms|moz)-)?(repeating-linear-gradient)/i,radialGradient:/^(-(webkit|o|ms|moz)-)?(radial-gradient)/i,repeatingRadialGradient:/^(-(webkit|o|ms|moz)-)?(repeating-radial-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?((\d*\.\d+)|(\d+\.?)))px/,percentageValue:/^(-?((\d*\.\d+)|(\d+\.?)))%/,emValue:/^(-?((\d*\.\d+)|(\d+\.?)))em/,angleValue:/^(-?((\d*\.\d+)|(\d+\.?)))deg/,radianValue:/^(-?((\d*\.\d+)|(\d+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^#([0-9a-f]+)/i,literalColor:/^([a-z]+)/i,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-z0-9-,\s#]+)/i,number:/^((\d*\.\d+)|(\d+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i};let A="";function e(N){const U=new Error(`${A}: ${N}`);throw U.source=A,U}function t(){const N=i();return A.length>0&&e("Invalid input not EOF"),N}function i(){return w(s)}function s(){return n("linear-gradient",r.linearGradient,a)||n("repeating-linear-gradient",r.repeatingLinearGradient,a)||n("radial-gradient",r.radialGradient,c)||n("repeating-radial-gradient",r.repeatingRadialGradient,c)}function n(N,U,X){return o(U,ee=>{const oe=X();return oe&&(J(r.comma)||e("Missing comma before color stops")),{type:N,orientation:oe,colorStops:w(R)}})}function o(N,U){const X=J(N);if(X){J(r.startCall)||e("Missing (");const ee=U(X);return J(r.endCall)||e("Missing )"),ee}}function a(){const N=l();if(N)return N;const U=ie("position-keyword",r.positionKeywords,1);return U?{type:"directional",value:U.value}:h()}function l(){return ie("directional",r.sideOrCorner,1)}function h(){return ie("angular",r.angleValue,1)||ie("angular",r.radianValue,1)}function c(){let N,U=f(),X;return U&&(N=[],N.push(U),X=A,J(r.comma)&&(U=f(),U?N.push(U):A=X)),N}function f(){let N=I()||d();if(N)N.at=p();else{const U=C();if(U){N=U;const X=p();X&&(N.at=X)}else{const X=p();if(X)N={type:"default-radial",at:X};else{const ee=S();ee&&(N={type:"default-radial",at:ee})}}}return N}function I(){const N=ie("shape",/^(circle)/i,0);return N&&(N.style=q()||C()),N}function d(){const N=ie("shape",/^(ellipse)/i,0);return N&&(N.style=S()||L()||C()),N}function C(){return ie("extent-keyword",r.extentKeywords,1)}function p(){if(ie("position",/^at/,0)){const N=S();return N||e("Missing positioning value"),N}}function S(){const N=P();if(N.x||N.y)return{type:"position",value:N}}function P(){return{x:L(),y:L()}}function w(N){let U=N();const X=[];if(U)for(X.push(U);J(r.comma);)U=N(),U?X.push(U):e("One extra comma");return X}function R(){const N=_();return N||e("Expected color definition"),N.length=L(),N}function _(){return b()||K()||V()||z()||D()||Ae()||m()}function m(){return ie("literal",r.literalColor,0)}function b(){return ie("hex",r.hexColor,1)}function D(){return o(r.rgbColor,()=>({type:"rgb",value:w(W)}))}function z(){return o(r.rgbaColor,()=>({type:"rgba",value:w(W)}))}function Ae(){return o(r.varColor,()=>({type:"var",value:te()}))}function V(){return o(r.hslColor,()=>{J(r.percentageValue)&&e("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");const U=W();J(r.comma);let X=J(r.percentageValue);const ee=X?X[1]:null;J(r.comma),X=J(r.percentageValue);const oe=X?X[1]:null;return(!ee||!oe)&&e("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[U,ee,oe]}})}function K(){return o(r.hslaColor,()=>{const N=W();J(r.comma);let U=J(r.percentageValue);const X=U?U[1]:null;J(r.comma),U=J(r.percentageValue);const ee=U?U[1]:null;J(r.comma);const oe=W();return(!X||!ee)&&e("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[N,X,ee,oe]}})}function te(){return J(r.variableName)[1]}function W(){return J(r.number)[1]}function L(){return ie("%",r.percentageValue,1)||se()||H()||q()}function se(){return ie("position-keyword",r.positionKeywords,1)}function H(){return o(r.calcValue,()=>{let N=1,U=0;for(;N>0&&U<A.length;){const ee=A.charAt(U);ee==="("?N++:ee===")"&&N--,U++}N>0&&e("Missing closing parenthesis in calc() expression");const X=A.substring(0,U-1);return $(U-1),{type:"calc",value:X}})}function q(){return ie("px",r.pixelValue,1)||ie("em",r.emValue,1)}function ie(N,U,X){const ee=J(U);if(ee)return{type:N,value:ee[X]}}function J(N){let U,X;return X=/^\s+/.exec(A),X&&$(X[0].length),U=N.exec(A),U&&$(U[0].length),U}function $(N){A=A.substr(N)}return function(N){return A=N.toString().trim(),A.endsWith(";")&&(A=A.slice(0,-1)),t()}}();const sc=gr.parse.bind(gr);var ur=ur||{};ur.stringify=function(){var r={"visit_linear-gradient":function(A){return r.visit_gradient(A)},"visit_repeating-linear-gradient":function(A){return r.visit_gradient(A)},"visit_radial-gradient":function(A){return r.visit_gradient(A)},"visit_repeating-radial-gradient":function(A){return r.visit_gradient(A)},visit_gradient:function(A){var e=r.visit(A.orientation);return e&&(e+=", "),A.type+"("+e+r.visit(A.colorStops)+")"},visit_shape:function(A){var e=A.value,t=r.visit(A.at),i=r.visit(A.style);return i&&(e+=" "+i),t&&(e+=" at "+t),e},"visit_default-radial":function(A){var e="",t=r.visit(A.at);return t&&(e+=t),e},"visit_extent-keyword":function(A){var e=A.value,t=r.visit(A.at);return t&&(e+=" at "+t),e},"visit_position-keyword":function(A){return A.value},visit_position:function(A){return r.visit(A.value.x)+" "+r.visit(A.value.y)},"visit_%":function(A){return A.value+"%"},visit_em:function(A){return A.value+"em"},visit_px:function(A){return A.value+"px"},visit_calc:function(A){return"calc("+A.value+")"},visit_literal:function(A){return r.visit_color(A.value,A)},visit_hex:function(A){return r.visit_color("#"+A.value,A)},visit_rgb:function(A){return r.visit_color("rgb("+A.value.join(", ")+")",A)},visit_rgba:function(A){return r.visit_color("rgba("+A.value.join(", ")+")",A)},visit_hsl:function(A){return r.visit_color("hsl("+A.value[0]+", "+A.value[1]+"%, "+A.value[2]+"%)",A)},visit_hsla:function(A){return r.visit_color("hsla("+A.value[0]+", "+A.value[1]+"%, "+A.value[2]+"%, "+A.value[3]+")",A)},visit_var:function(A){return r.visit_color("var("+A.value+")",A)},visit_color:function(A,e){var t=A,i=r.visit(e.length);return i&&(t+=" "+i),t},visit_angular:function(A){return A.value+"deg"},visit_directional:function(A){return"to "+A.value},visit_array:function(A){var e="",t=A.length;return A.forEach(function(i,s){e+=r.visit(i),s<t-1&&(e+=", ")}),e},visit_object:function(A){return A.width&&A.height?r.visit(A.width)+" "+r.visit(A.height):""},visit:function(A){if(!A)return"";if(A instanceof Array)return r.visit_array(A);if(typeof A=="object"&&!A.type)return r.visit_object(A);if(A.type){var e=r["visit_"+A.type];if(e)return e(A);throw Error("Missing visitor visit_"+A.type)}else throw Error("Invalid node.")}};return function(A){return r.visit(A)}}(),ur.stringify.bind(ur);function Ho(r){const A=r.length-1;return r.map((e,t)=>{var o;const i=e.value;let s=TA(t/A,3),n="#00000000";switch(e.type){case"rgb":n=ht({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0)});break;case"rgba":n=ht({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0),a:Number(i[3]??0)});break;case"literal":n=ht(e.value);break;case"hex":n=ht(`#${e.value}`);break}switch((o=e.length)==null?void 0:o.type){case"%":s=Number(e.length.value)/100;break}return{offset:s,color:n}})}function Jo(r){var e;let A=0;switch((e=r.orientation)==null?void 0:e.type){case"angular":A=Number(r.orientation.value);break}return{type:"linear-gradient",angle:A,stops:Ho(r.colorStops)}}function Ko(r){var A;return(A=r.orientation)==null||A.map(e=>{switch(e==null?void 0:e.type){case"shape":case"default-radial":case"extent-keyword":default:return null}}),{type:"radial-gradient",stops:Ho(r.colorStops)}}function wi(r){return r.startsWith("linear-gradient(")||r.startsWith("radial-gradient(")}function nc(r){return sc(r).map(A=>{switch(A==null?void 0:A.type){case"linear-gradient":return Jo(A);case"repeating-linear-gradient":return{...Jo(A),repeat:!0};case"radial-gradient":return Ko(A);case"repeating-radial-gradient":return{...Ko(A),repeat:!0};default:return}}).filter(Boolean)}function oc(r){let A;return typeof r=="string"?A={color:r}:A=r,{color:ht(A.color)}}function ac(r){let A;if(typeof r=="string"?A={image:r}:A=r,A.image){const{type:e,...t}=nc(A.image)[0]??{};switch(e){case"radial-gradient":return{radialGradient:t};case"linear-gradient":return{linearGradient:t}}}return A}function lc(r){let A;return typeof r=="string"?A={image:r}:A=r,A}function hc(r){let A;return typeof r=="string"?A={preset:r}:A=r,{preset:A.preset,foregroundColor:he(A.foregroundColor)?void 0:ht(A.foregroundColor),backgroundColor:he(A.backgroundColor)?void 0:ht(A.backgroundColor)}}function cc(r){return!he(r.color)}function gc(r){return typeof r=="string"?rc(r):cc(r)}function uc(r){return!he(r.image)&&wi(r.image)||!!r.linearGradient||!!r.radialGradient}function fc(r){return typeof r=="string"?wi(r):uc(r)}function dc(r){return!he(r.image)&&!wi(r.image)}function Ic(r){return typeof r=="string"?!wi(r):dc(r)}function pc(r){return!he(r.preset)}function Bc(r){return typeof r=="string"?!1:pc(r)}function yA(r){return gc(r)?oc(r):fc(r)?ac(r):Ic(r)?lc(r):Bc(r)?hc(r):{}}function Ec(r){return typeof r=="string"?{...yA(r)}:{...yA(r),...Ts(r,["fillWithShape"])}}function Cc(r){return typeof r=="string"?{...yA(r)}:{...yA(r),...Ts(r,["fillWithShape"])}}function Qc(r){return typeof r=="string"?{...yA(r)}:{...yA(r),...Ts(r,["width","style","headEnd","tailEnd"])}}function yc(r){return typeof r=="string"?{color:ht(r)}:{...r,color:he(r.color)?Oo:ht(r.color)}}function mc(){return{boxShadow:"none"}}function wc(r){return typeof r=="string"?r.startsWith("<svg")?{svg:r}:{paths:[{data:r}]}:Array.isArray(r)?{paths:r.map(A=>typeof A=="string"?{data:A}:A)}:r}function vc(){return{overflow:"visible",direction:void 0,display:void 0,boxSizing:void 0,width:void 0,height:void 0,maxHeight:void 0,maxWidth:void 0,minHeight:void 0,minWidth:void 0,position:void 0,left:0,top:0,right:void 0,bottom:void 0,borderTop:void 0,borderLeft:void 0,borderRight:void 0,borderBottom:void 0,borderWidth:0,border:void 0,flex:void 0,flexBasis:void 0,flexDirection:void 0,flexGrow:void 0,flexShrink:void 0,flexWrap:void 0,justifyContent:void 0,gap:void 0,alignContent:void 0,alignItems:void 0,alignSelf:void 0,marginTop:void 0,marginLeft:void 0,marginRight:void 0,marginBottom:void 0,margin:void 0,paddingTop:void 0,paddingLeft:void 0,paddingRight:void 0,paddingBottom:void 0,padding:void 0}}function _c(){return{rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function bc(){return{...vc(),..._c(),...mc(),backgroundImage:"none",backgroundSize:"auto, auto",backgroundColor:"none",backgroundColormap:"none",borderRadius:0,borderColor:"none",borderStyle:"solid",outlineWidth:0,outlineOffset:0,outlineColor:"rgb(0, 0, 0)",outlineStyle:"none",visibility:"visible",filter:"none",opacity:1,pointerEvents:"auto",maskImage:"none"}}function Dc(){return{highlight:{},highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function xc(){return{listStyle:{},listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside"}}function Sc(){return{...Dc(),color:"rgb(0, 0, 0)",verticalAlign:"baseline",letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textTransform:"none",textOrientation:"mixed",textDecoration:"none"}}function Mc(){return{...xc(),writingMode:"horizontal-tb",textWrap:"wrap",textAlign:"start",textIndent:0,lineHeight:1.2}}function Rc(){return{...Mc(),...Sc(),textStrokeWidth:0,textStrokeColor:"rgb(0, 0, 0)"}}function fr(r){return Fs({...r,color:he(r.color)?void 0:ht(r.color),backgroundColor:he(r.backgroundColor)?void 0:ht(r.backgroundColor),borderColor:he(r.borderColor)?void 0:ht(r.borderColor),outlineColor:he(r.outlineColor)?void 0:ht(r.outlineColor),shadowColor:he(r.shadowColor)?void 0:ht(r.shadowColor)})}function Yo(){return{...bc(),...Rc()}}function zo(r=""){return(Array.isArray(r)?r:[r]).map(e=>typeof e=="string"?{fragments:[{content:e}]}:"content"in e?{fragments:[fr(e)]}:"fragments"in e?{...fr(e),fragments:e.fragments.map(t=>fr(t))}:Array.isArray(e)?{fragments:e.map(t=>typeof t=="string"?{content:t}:fr(t))}:{fragments:[]})}function Pc(r){return typeof r=="string"?{content:[{fragments:[{content:r}]}]}:"content"in r?{...r,content:zo(r.content)}:{content:zo(r)}}tc([Ac]);class Vt{get value(){return this._value}set value(A){this._colord=Gs(A??"none")}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(A=0){this.value=A}toHex(){return this._colord.toHex()}toRgb(){return this._colord.toRgb()}toRgbString(){return this._colord.toRgbString()}toHsl(){return this._colord.toHsl()}toHslString(){return this._colord.toHslString()}toHsv(){return this._colord.toHsv()}toArgb(A=this.a,e=!0){if(A===1)return(255<<24)+this.rgb;if(A===0)return e?0:this.rgb;let t=this.r8,i=this.g8,s=this.b8;return e&&(t=t*A+.5|0,i=i*A+.5|0,s=s*A+.5|0),(A*255<<24)+(t<<16)+(i<<8)+s}toArray(){return[this.r,this.g,this.b,this.a]}}class mt extends Yt{constructor(e){super();u(this,"_array",[]);this.dim=e}get length(){return this.dim}_operate(e,t,i){const{dim:s,_array:n}=this;let o;typeof t=="number"?o=Array.from({length:s},()=>t):t instanceof St||t instanceof mt?o=t.toArray():o=t;let a,l=[];if(i?i instanceof mt?a=i:l=i:a=this,t instanceof St){const{cols:h}=t;switch(e){case"*":for(let c=0;c<s;c++){let f=0;for(let I=0;I<s;I++)f+=n[c]*o[I*h+c];l[c]=f}break;default:throw new Error(`Not support operator in '${this.toName()} ${e} ${t.toName()}'`)}}else switch(e){case"+":for(let h=0;h<s;h++)l[h]=n[h]+o[h];break;case"-":for(let h=0;h<s;h++)l[h]=n[h]-o[h];break;case"*":for(let h=0;h<s;h++)l[h]=n[h]*o[h];break;case"/":for(let h=0;h<s;h++)l[h]=n[h]/o[h];break;case"rot":{const h=Math.cos(o[0]),c=Math.sin(o[0]);l[0]=n[0]*h-n[1]*c,l[1]=n[1]*h+n[0]*c;break}case"==":{let h=!0;for(let c=0;c<s;c++)h=h&&n[c]===o[c];return h}case"=":for(let h=0;h<s;h++){const c=o[h];c!==void 0&&(n[h]=c)}return this._onUpdate(n),this.emit("update",n),this;default:throw new Error(`Not support operator in '${this.toName()} ${e} Vector'`)}return(a==null?void 0:a.set(l))??l}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)}copy(e){return this.set(e)}clone(){const e=new this.constructor;return e.set(this.toArray()),e}_onUpdate(e){}toArray(){return this._array.slice()}toName(){return`Vector${this.dim}`}}class St extends Yt{constructor(e,t,i){super();u(this,"_array",[]);u(this,"dirtyId",0);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:n,length:o,_array:a}=this;let l;typeof t=="number"?l=Array.from({length:o},()=>t):t instanceof mt||t instanceof St?l=t.toArray():l=t;let h,c=[];if(i?i instanceof mt||i instanceof St?h=i:c=i:t instanceof mt?h=new t.constructor:h=this,t instanceof mt){const{dim:f}=t;switch(e){case"*":for(let I=0;I<f;I++){let d=0;for(let C=0;C<s;C++)C<f&&(d+=a[I*s+C]*(l[C]??0));c[I]=d}break;default:throw new Error(`Not support operator in '${this.toName()} ${e} ${t.toName()}'`)}}else switch(e){case"*":for(let f=0;f<s;f++)for(let I=0;I<n;I++){const d=I*s;let C=0;for(let p=0;p<n;p++){const S=d+p,P=p*s+f;C+=a[S]*(l[P]??0)}c[d+f]=C}break;case"=":for(let f=0;f<o;f++){const I=l[f];I!==void 0&&(a[f]=I)}return this._onUpdate(a),this.emit("update",a),this;default:throw new Error(`Not support operator in '${this.toName()} ${e} Matrix2'`)}return(h==null?void 0:h.set(c))??c}identity(){const{cols:e,rows:t}=this,i=[];for(let s=0;s<e;s++)for(let n=0;n<t;n++){const o=n*e,a=s+o;i[a]=n+o===a?1:0}return this.set(i)}set(e){return this._operate("=",e)}copy(e){return this.set(e)}clone(){const e=new this.constructor;return e.set(this.toArray()),e}multiply(e,t){return this._operate("*",e,t)}_onUpdate(e){this.dirtyId++}toArray(e=!1){const{cols:t,rows:i,_array:s}=this;if(e){const n=[];for(let o=0;o<i;o++)for(let a=0;a<t;a++)n[o+a*t]=s[a+o*t];return n}return s.slice()}toName(){return`Matrix${this.rows}(${this.rows}x${this.cols})`}toJSON(){return this._array}}class Wo extends St{constructor(A){super(4,4,A)}}const Vo=Jt/180,kc=180/Jt;function Mt(r,A,e){return Math.max(r,Math.min(A,e))}function Me(r,A,e){return(1-e)*r+e*A}const Uc={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(r,A=20){if(!this.adaptive||!r||Number.isNaN(r))return A;let e=Math.ceil(r/this.maxLength);return e<this.minSegments?e=this.minSegments:e>this.maxSegments&&(e=this.maxSegments),e}};class qo extends mt{constructor(A=0,e=0,t=0,i=0){super(4),this.set([A,e,t,i])}}class Ls extends St{constructor(A){super(4,5,A)}hueRotate(A=0){const e=Math.sin(A),t=Math.cos(A),i=.213,s=.715,n=.072;return this.multiply([i+t*(1-i)+e*-.213,s+t*-.715+e*-.715,n+t*-.072+e*(1-n),0,0,i+t*-.213+e*.143,s+t*(1-s)+e*.14,n+t*-.072+e*-.283,0,0,i+t*-.213+e*-.787,s+t*-.715+e*s,n+t*(1-n)+e*n,0,0,0,0,0,1,0])}saturate(A=1){const e=(A-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(A=1){const e=A;return this.multiply([e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0])}contrast(A=1){const e=A,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(A=1){const e=Me(1,-1,A),t=Me(0,255,A);return this.multiply([e,0,0,0,t,0,e,0,0,t,0,0,e,0,t,0,0,0,1,0])}sepia(A=1){const e=Mt(0,A,1);return this.multiply([Me(1,.393,e),Me(0,.7689999,e),Me(0,.18899999,e),0,0,Me(0,.349,e),Me(1,.6859999,e),Me(0,.16799999,e),0,0,Me(0,.272,e),Me(0,.5339999,e),Me(1,.13099999,e),0,0,0,0,0,1,0])}opacity(A=1){return this.multiply([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,A,0])}grayscale(A=1){const e=Mt(0,A,1),t=Me(1,.3,e),i=Me(0,.3,e),s=Me(1,.59,e),n=Me(0,.59,e),o=Me(1,.11,e),a=Me(0,.11,e);return this.multiply([t,n,a,0,0,i,s,a,0,0,i,n,o,0,0,0,0,0,1,0])}multiply(A){const e=A,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 A=this._array;return new Wo([A[0],A[1],A[2],A[3],A[5],A[6],A[7],A[8],A[10],A[11],A[12],A[13],A[15],A[16],A[17],A[18]])}toVector4(){const A=this._array;return new qo(A[4]/255,A[9]/255,A[14]/255,A[19]/255)}}class Nc extends St{constructor(A){super(2,2,A)}}let Os=class extends St{constructor(A){super(3,3,A)}invert(){const[A,e,t,i,s,n,o,a,l]=this._array,h=l*s-n*a,c=n*o-l*i,f=a*i-s*o,I=A*h+e*c+t*f;if(I===0)return this.set([0,0,0,0,0,0,0,0,0]);const d=1/I;return this.set([h*d,(t*a-l*e)*d,(n*e-t*s)*d,c*d,(l*A-t*o)*d,(t*i-n*A)*d,f*d,(e*o-a*A)*d,(s*A-e*i)*d])}};class Xo extends Os{constructor(A=0,e=0,t=0,i=0,s=!1){super(),this._x=A,this._y=e,this._width=t,this._height=i,this._flipY=s,this._performUpdateArray()}flipY(A){return this._flipY!==A&&(this._flipY=A,this._performUpdateArray()),this}translate(A,e){return(this._x!==A||this._y!==e)&&(this._x=A,this._y=e,this._performUpdateArray()),this}resize(A,e){return(this._width!==A||this._height!==e)&&(this._width=A,this._height=e,this._performUpdateArray()),this}_performUpdateArray(){const A=this._width,e=this._height;if(!A||!e)return;const t=this._x,i=this._y,s=this._flipY?-1:1,n=1/A*2,o=s*(1/e*2),a=-1-t*n,l=-s-i*o;this.set([n,0,a,0,o,l,0,0,1])}}let wt=class Qs extends mt{get x(){return this._array[0]}set x(A){const[e,t]=this._array;e!==A&&this.set(A,t)}get y(){return this._array[1]}set y(A){const[e,t]=this._array;t!==A&&this.set(e,A)}get width(){return this.x}set width(A){this.x=A}get height(){return this.y}set height(A){this.y=A}get left(){return this.x}set left(A){this.x=A}get top(){return this.y}set top(A){this.y=A}constructor(A=0,e){super(2),this.set(typeof A=="number"?[A,e??A]:A)}update(A,e){const[t,i]=this._array;return(t!==A||i!==e)&&this.set(A,e),this}getLength(){const[A,e]=this._array;return Math.sqrt(A*A+e*e)}getAngle(){const[A,e]=this._array;return Math.atan2(-A,-e)+Math.PI}distanceTo(A){return Math.hypot(A.x-this.x,A.y-this.y)}normalize(){const[A,e]=this._array,t=1/(this.getLength()||1);return this.set(A*t,e*t),this}static lerp(A,e,t){return new Qs(e).clone().sub(new Qs(A)).multiply(t).add(new Qs(A))}};class Hs{constructor(...A){u(this,"end",new wt);u(this,"position");u(this,"size");const e=new wt,t=new wt;switch(A.length){case 0:break;case 1:e.set(A[0].position),t.set(A[0].size);break;case 2:e.set(A[0]),t.set(A[1]);break;default:e.set(A[0],A[1]),t.set(A[2],A[3]);break}this.update=this.update.bind(this),this.position=e.on("update",this.update),this.size=t.on("update",this.update),this.update()}get x(){return this.position.x}get y(){return this.position.y}get left(){return this.position.x}get top(){return this.position.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get width(){return this.size.x}get height(){return this.size.y}update(){return this.end.set(this.position.x+this.size.x,this.position.y+this.size.y),this}toArray(){return[this.x,this.y,this.width,this.height]}}const BA=class BA extends Os{premultiply(A){return A.multiply(this,this)}skewX(A){return this.skew(A,0)}skewY(A){return this.skew(0,A)}skew(A,e){return this.premultiply(BA._t2d.makeSkew(A,e))}makeSkew(A,e){const t=Math.tan(A),i=Math.tan(e);return this.set([1,i,0,t,1,0,0,0,1]),this}translateX(A){return this.translate(A,0)}translateY(A){return this.translate(0,A)}translateZ(A){return this.translate(0,0,A)}translate3d(A,e,t){return this.translate(A,e,t)}translate(A,e,t=0){return this.premultiply(BA._t2d.makeTranslation(A,e,t))}makeTranslation(A,e,t=0){return this.set([1,0,A,0,1,e,0,0,1]),this}scaleX(A){return this.scale(A,1)}scaleY(A){return this.scale(1,A)}scale3d(A,e,t=1){return this.scale(A,e,t)}scale(A,e,t=1){return this.premultiply(BA._t2d.makeScale(A,e,t))}makeScale(A,e,t=1){return this.set([A,0,0,0,e,0,0,0,1]),this}rotateX(A){return this.scaleY(this._rotateToScale(A))}rotateY(A){return this.scaleX(this._rotateToScale(A))}rotateZ(A){return this.rotate(A)}rotate(A){return this.premultiply(BA._t2d.makeRotation(A))}rotate3d(A,e,t,i){const[s,n,o]=this._rotate3d(A,e,t,i);return s&&this.rotateX(s),n&&this.rotateY(n),o&&this.rotateZ(o),this}_rotateToScale(A){const e=A/At;return e<=.5?e*-4+1:(e-1)*4+1}_rotate3d(A,e,t,i){if(A===1&&e===0&&t===0)return[i,0,0];if(A===0&&e===1&&t===0)return[0,i,0];if(A===0&&e===0)return[0,0,i];{const s=Math.cos(i),n=Math.sin(i),o=s+A*A*(1-s),a=A*e*(1-s)-t*n,l=A*t*(1-s)+e*n,h=s+e*e*(1-s),c=e*t*(1-s)-A*n,f=s+t*t*(1-s),I=-Math.atan2(-c,h),d=-Math.atan2(l,Math.sqrt(c*c+f*f)),C=-Math.atan2(-a,o);return[I,d,C]}}makeRotation(A){const e=Math.cos(A),t=Math.sin(A);return this.set([e,-t,0,t,e,0,0,0,1]),this}applyToPoint(A,e){const{a:t,c:i,tx:s,b:n,d:o,ty:a}=this.toObject();return[t*A+i*e+s,n*A+o*e+a]}inverse(){return this.clone().invert()}isIdentity(){const{a:A,b:e,c:t,d:i,tx:s,ty:n}=this.toObject();return A===1&&e===0&&t===0&&i===1&&s===0&&n===0}toObject(){const[A,e,t,i,s,n,,,o]=this._array;return{a:A,c:e,tx:t,b:i,d:s,ty:n,tz:o}}};u(BA,"_t2d",new BA);let Bt=BA;class Fc extends mt{constructor(){super(3)}}var Tc=Object.defineProperty,jo=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Tc(A,e,i),i};class dr extends rA{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){this._starting||(this._starting=!0,this.off("process"),this.on("process",e),Se.on(this._onNextTick,{sort:0}))}stop(){this._starting&&(this._starting=!1,Se.off(this._onNextTick,{sort:0}))}_onNextTick(){const e=Se.elapsed*this.speed;if((this._nextDeltaTime-=e)<=0){const i=(this._nextDeltaTime=this.spf)||e;this.emit("process",i)}}free(){super.free(),this.stop()}}jo([M({default:24})],dr.prototype,"fps"),jo([M({default:1})],dr.prototype,"speed");class Zo{constructor(){u(this,"view");u(this,"pixelRatio",Ds);u(this,"screen",{x:0,y:0,width:0,height:0});u(this,"related",new FA)}getRelated(A,e){let t=this.related.get(A);return t||(e?(this.related.set(A,t=e()),t):(console.warn("Failed to get related",A),null))}resize(A,e,t=!0){this.view&&(this.view.width=Math.floor(A*this.pixelRatio),this.view.height=Math.floor(e*this.pixelRatio)),this.screen.width=A,this.screen.height=e,t&&this.view&&(this.view.style.width=`${A}px`,this.view.style.height=`${e}px`)}}var GA=(r=>(r.NORMAL="normal",r.ADD="add",r.MULTIPLY="multiply",r.SCREEN="screen",r.NONE="none",r.NORMAL_NPM="normal_npm",r.ADD_NPM="add_npm",r.SCREEN_NPM="screen_npm",r.SRC_IN="src_in",r.SRC_OUT="src_out",r.SRC_ATOP="src_atop",r.DST_OVER="dst_over",r.DST_IN="dst_in",r.DST_OUT="dst_out",r.DST_ATOP="dst_atop",r.XOR="xor",r.SUBTRACT="subtract",r))(GA||{});function $o(r){return{normal:[r.ONE,r.ONE_MINUS_SRC_ALPHA],add:[r.ONE,r.ONE],multiply:[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],screen:[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],none:[0,0],normal_npm:[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],add_npm:[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],screen_npm:[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],src_in:[r.DST_ALPHA,r.ZERO],src_out:[r.ONE_MINUS_DST_ALPHA,r.ZERO],src_atop:[r.DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],dst_over:[r.ONE_MINUS_DST_ALPHA,r.ONE],dst_in:[r.ZERO,r.SRC_ALPHA],dst_out:[r.ZERO,r.ONE_MINUS_SRC_ALPHA],dst_atop:[r.ONE_MINUS_DST_ALPHA,r.SRC_ALPHA],xor:[r.ONE_MINUS_DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],subtract:[r.ONE,r.ONE,r.ONE,r.ONE,r.FUNC_REVERSE_SUBTRACT,r.FUNC_ADD]}}class Et{get gl(){return this._renderer.gl}install(A){this._renderer=A}onUpdateContext(){}flush(){}reset(){}free(){}}const ss=class ss{constructor(A){u(this,"_blendMode",GA.NORMAL);u(this,"_polygonOffset",0);u(this,"bitmap",0);if(A)for(const e in A)this[e]=A[e]}static _init(){this._properties.forEach((A,e)=>{Object.defineProperty(this.prototype,A,{get(){return!!(this.bitmap&1<<e)},set(t){!!(this.bitmap&1<<e)!==t&&(this.bitmap^=1<<e)},enumerable:!0,configurable:!0})})}static for2D(){const A=new ss;return A.depthTest=!1,A.blend=!0,A}get blendMode(){return this._blendMode}set blendMode(A){this.blend=A!==GA.NONE,this._blendMode=A}get polygonOffset(){return this._polygonOffset}set polygonOffset(A){this.offsets=!!A,this._polygonOffset=A}};u(ss,"_properties",["blend","offsets","culling","depthTest","clockwiseFrontFace","depthMask"]);let mA=ss;mA._init();class ea extends Et{constructor(){super(...arguments);u(this,"_blendEq",!1);u(this,"_setters",mA._properties.map(e=>this[`set${e.replace(/^\S/,t=>t.toUpperCase())}`]));u(this,"boundStateBitmap",0);u(this,"boundBlendMode");u(this,"blendModes");u(this,"defaultState",new mA({blend:!0}))}install(e){super.install(e),e.state=this}onUpdateContext(){super.onUpdateContext(),this.blendModes=$o(this._renderer.gl)}toggle(e,t){this._renderer.gl[t?"enable":"disable"](e)}setBlend(e){this.toggle(this._renderer.gl.BLEND,e)}setOffsets(e){this.toggle(this._renderer.gl.POLYGON_OFFSET_FILL,e)}setCulling(e){this.toggle(this._renderer.gl.CULL_FACE,e)}setDepthTest(e){this.toggle(this._renderer.gl.DEPTH_TEST,e)}setDepthMask(e){this._renderer.gl.depthMask(e)}setClockwiseFrontFace(e){const t=this._renderer.gl;t.frontFace(t[e?"CW":"CCW"])}setBlendMode(e){if(e===this.boundBlendMode)return;this.boundBlendMode=e;const t=this.blendModes[e],i=this._renderer.gl;t.length===2?i.blendFunc(t[0],t[1]):i.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=!0,i.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}setPolygonOffset(e,t){this._renderer.gl.polygonOffset(e,t)}bind(e){var t;if(this.boundStateBitmap!==e.bitmap){let i=this.boundStateBitmap^e.bitmap,s=0;for(;i;)i&1&&((t=this._setters[s])==null||t.call(this,!!(e.bitmap&1<<s))),i=i>>1,s++;this.boundStateBitmap=e.bitmap}e.blend&&this.setBlendMode(e.blendMode),e.offsets&&this.setPolygonOffset(1,e.polygonOffset)}reset(){super.reset();const e=this._renderer.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),this.bind(this.defaultState),this._blendEq=!0,this.setBlendMode(GA.NORMAL)}}class ta extends Et{constructor(){super(...arguments);u(this,"_state",mA.for2D());u(this,"_batchSize",4096*4);u(this,"_drawCallUid",0);u(this,"_defaultModulate",4294967295);u(this,"_defaultBackgroundColor",0);u(this,"_defaultColorMatrixOffset",[0,0,0,0]);u(this,"_defaultColorMatrix",[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);u(this,"_batchables",[]);u(this,"_vertexCount",0);u(this,"_indexCount",0);u(this,"_attributeBuffer",[]);u(this,"_indexBuffers",[]);u(this,"_shaders",new Map);u(this,"_attributes",{aTextureId:{size:1,normalized:!0,type:"float"},aPosition:{size:2,normalized:!1,type:"float"},aUv:{size:2,normalized:!1,type:"float"},aModulate:{size:4,normalized:!0,type:"unsigned_byte"},aBackgroundColor:{size:4,normalized:!0,type:"unsigned_byte"},aDisableWrapMode:{size:4,normalized:!0,type:"float"},aColorMatrixOffset:{size:4,normalized:!1,type:"float"},aColorMatrix:{size:4,normalized:!1,type:"float"}});u(this,"_vertexSize",31)}install(e){super.install(e),e.batch2D=this}_getShader(e){let t=this._shaders.get(e);return t||this._shaders.set(e,t=this._createShader(e)),t}_createShader(e){const t=this._renderer,i=t.program.create({vert:`precision highp float;
|
|
2
2
|
attribute float aTextureId;
|
|
3
3
|
attribute vec2 aPosition;
|
|
4
4
|
attribute vec2 aUv;
|
|
@@ -854,7 +854,7 @@ void main() {
|
|
|
854
854
|
color /= total;
|
|
855
855
|
|
|
856
856
|
gl_FragColor = color;
|
|
857
|
-
}`})),Ti([M()],g.ZoomBlurEffect.prototype,"center",2),Ti([M({default:20})],g.ZoomBlurEffect.prototype,"innerRadius",2),Ti([M({default:-1})],g.ZoomBlurEffect.prototype,"radius",2),Ti([M({default:.1})],g.ZoomBlurEffect.prototype,"strength",2),g.ZoomBlurEffect=Ti([ne("ZoomBlurEffect")],g.ZoomBlurEffect);var mf=Object.defineProperty,Ut=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&mf(A,e,i),i};class it extends rA{constructor(e){super();u(this,"_texture");this.parent=e}_setProperties(e){return super.setProperties(e)}setProperties(e){return this._setProperties(he(e)?void 0:yA(e))}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"color":case"cropRect":case"stretchRect":case"dpi":case"rotateWithShape":case"tile":case"opacity":this.parent.requestRedraw();break;case"image":case"linearGradient":case"radialGradient":this._updateTexture();break}}async loadTexture(){return this.linearGradient||this.radialGradient?new Er(this.linearGradient??this.radialGradient,this.parent.size.width,this.parent.size.height):he(this.image)?void 0:await Lt.texture.load(this.image)}async _updateTexture(){this._texture=await this.loadTexture(),this.parent.requestRedraw()}canDraw(){return!!(this._texture||this.color)}_getDrawOptions(){let e,t=!1;if(this._texture&&this._texture.source instanceof ImageBitmap){e=new Bt;const{width:i,height:s}=this._texture,{width:n,height:o}=this.parent.size;if(this.cropRect){const{left:a=0,top:l=0,right:h=0,bottom:c=0}=this.cropRect,f=Math.abs(1+(a+h))*n,I=Math.abs(1+(l+c))*o,d=1/f,C=1/I,p=a*n*d,S=l*o*C;e.scale(d,C).translate(p,S)}if(this.tile){const{translateX:a=0,translateY:l=0,scaleX:h=1,scaleY:c=1}=this.tile;e.scale(1/i,1/s).scale(1/h,1/c).translate(-a/i,-l/s),t=!0}else if(this.stretchRect){const{left:a=0,top:l=0,right:h=0,bottom:c=0}=this.stretchRect,f=Math.abs(1+(-a+-h))*n,I=Math.abs(1+(-l+-c))*o,d=1/f,C=1/I,p=-a*n*d,S=-l*o*C;e.scale(d,C).translate(p,S),t=!0}else e.scale(1/n,1/o)}return{disableWrapMode:t,textureTransform:e}}draw(){const e=this.parent.context,{textureTransform:t,disableWrapMode:i}=this._getDrawOptions();e.textureTransform=t,e.fillStyle=this._texture??this.color,e.fill({disableWrapMode:i})}}Ut([M()],it.prototype,"color"),Ut([M()],it.prototype,"image"),Ut([M()],it.prototype,"linearGradient"),Ut([M()],it.prototype,"radialGradient"),Ut([M()],it.prototype,"cropRect"),Ut([M()],it.prototype,"stretchRect"),Ut([M()],it.prototype,"dpi"),Ut([M()],it.prototype,"rotateWithShape"),Ut([M()],it.prototype,"tile"),Ut([M()],it.prototype,"opacity");var wf=Object.defineProperty,vf=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&wf(A,e,i),i};class un extends it{setProperties(A){return super._setProperties(he(A)?void 0:Ec(A))}}vf([M()],un.prototype,"fillWithShape");var _f=Object.defineProperty,bf=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&_f(A,e,i),i};class fn extends it{setProperties(A){return super._setProperties(he(A)?void 0:Cc(A))}}bf([M()],fn.prototype,"fillWithShape");var Df=Object.defineProperty,dn=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Df(A,e,i),i};class Gi extends it{setProperties(A){return super._setProperties(he(A)?void 0:Qc(A))}_updateProperty(A,e,t,i){switch(super._updateProperty(A,e,t,i),A){case"width":case"style":this.parent.requestRedraw();break}}canDraw(){return!!(this.width||super.canDraw())}draw(){const A=this.parent.context,{textureTransform:e,disableWrapMode:t}=this._getDrawOptions();A.lineWidth=this.width,A.textureTransform=e,A.strokeStyle=this._texture??this.color,A.stroke({disableWrapMode:t})}}dn([M({default:0})],Gi.prototype,"color"),dn([M({default:0})],Gi.prototype,"width"),dn([M({default:"solid"})],Gi.prototype,"style");var xf=Object.defineProperty,br=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&xf(A,e,i),i};class VA extends rA{constructor(A){super(),this.parent=A}setProperties(A){return super.setProperties(he(A)?void 0:yc(A))}_updateProperty(A,e,t,i){switch(super._updateProperty(A,e,t,i),A){case"color":case"blur":case"offsetX":case"offsetY":this.updateEffect();break}}updateEffect(){const A="__$shadow";let e=this.parent.getNode(A);this.blur||this.offsetX||this.offsetY?(e||(e=new g.DropShadowEffect({name:A}),this.parent.appendChild(e,"back")),e.setProperties(this.getProperties())):e&&this.parent.removeChild(e)}}br([M({default:"#000000"})],VA.prototype,"color"),br([M({default:0})],VA.prototype,"blur"),br([M({default:0})],VA.prototype,"offsetY"),br([M({default:0})],VA.prototype,"offsetX");var Sf=Object.defineProperty,Dr=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Sf(A,e,i),i};class qA extends rA{constructor(e){super();u(this,"_path2DSet",new nA);this.parent=e,this._updatePath2DSet()}setProperties(e){return super.setProperties(he(e)?void 0:wc(e))}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"svg":case"data":case"viewBox":this._updatePath2DSet(),this.parent.requestRedraw();break}}_updatePath2DSet(){var o;let e;if(this.svg){const a=on(this.svg);this._path2DSet=ln(a),e=this._path2DSet.viewBox??this.viewBox}else e=this.viewBox,(o=this.data)==null||o.forEach((a,l)=>{const{data:h,...c}=a,f=new Ne;f.style=c,f.addData(h),this._path2DSet.paths[l]=f});const[t,i,s,n]=e;this._path2DSet.paths.forEach(a=>{a.applyTransform(new Ke().translate(-t,-i).scale(1/s,1/n))})}draw(){if(this._path2DSet.paths.length){const e=this.parent.context,{width:t,height:i}=this.parent.size;this._path2DSet.paths.forEach(s=>{e.addPath(s.clone().applyTransform(new Ke().scale(t,i)))})}else this.drawRect()}drawRect(){const e=this.parent.context,{width:t,height:i}=this.parent.size,{borderRadius:s}=this.parent.style;t&&i&&(s?e.roundRect(0,0,t,i,s):e.rect(0,0,t,i))}}Dr([M()],qA.prototype,"preset"),Dr([M()],qA.prototype,"svg"),Dr([M({default:[0,0,1,1]})],qA.prototype,"viewBox"),Dr([M({default:[]})],qA.prototype,"data");class Li extends zt{constructor(A){super(),this.setProperties(A)}}const XA=Yo();delete XA.top,delete XA.left,delete XA.width,delete XA.height;for(const r in XA)Qi(Li,r,{default:XA[r]});var qe=Uint8Array,ut=Uint16Array,In=Int32Array,xr=new qe([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]),Sr=new qe([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]),pn=new qe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Bl=function(r,A){for(var e=new ut(31),t=0;t<31;++t)e[t]=A+=1<<r[t-1];for(var i=new In(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}},El=Bl(xr,2),Cl=El.b,Bn=El.r;Cl[28]=258,Bn[258]=28;for(var Ql=Bl(Sr,0),Mf=Ql.b,yl=Ql.r,En=new ut(32768),Qe=0;Qe<32768;++Qe){var lA=(Qe&43690)>>1|(Qe&21845)<<1;lA=(lA&52428)>>2|(lA&13107)<<2,lA=(lA&61680)>>4|(lA&3855)<<4,En[Qe]=((lA&65280)>>8|(lA&255)<<8)>>1}for(var Nt=function(r,A,e){for(var t=r.length,i=0,s=new ut(A);i<t;++i)r[i]&&++s[r[i]-1];var n=new ut(A);for(i=1;i<A;++i)n[i]=n[i-1]+s[i-1]<<1;var o;if(e){o=new ut(1<<A);var a=15-A;for(i=0;i<t;++i)if(r[i])for(var l=i<<4|r[i],h=A-r[i],c=n[r[i]-1]++<<h,f=c|(1<<h)-1;c<=f;++c)o[En[c]>>a]=l}else for(o=new ut(t),i=0;i<t;++i)r[i]&&(o[i]=En[n[r[i]-1]++]>>15-r[i]);return o},hA=new qe(288),Qe=0;Qe<144;++Qe)hA[Qe]=8;for(var Qe=144;Qe<256;++Qe)hA[Qe]=9;for(var Qe=256;Qe<280;++Qe)hA[Qe]=7;for(var Qe=280;Qe<288;++Qe)hA[Qe]=8;for(var Oi=new qe(32),Qe=0;Qe<32;++Qe)Oi[Qe]=5;var Rf=Nt(hA,9,0),Pf=Nt(hA,9,1),kf=Nt(Oi,5,0),Uf=Nt(Oi,5,1),Cn=function(r){for(var A=r[0],e=1;e<r.length;++e)r[e]>A&&(A=r[e]);return A},vt=function(r,A,e){var t=A/8|0;return(r[t]|r[t+1]<<8)>>(A&7)&e},Qn=function(r,A){var e=A/8|0;return(r[e]|r[e+1]<<8|r[e+2]<<16)>>(A&7)},yn=function(r){return(r+7)/8|0},ml=function(r,A,e){return(e==null||e>r.length)&&(e=r.length),new qe(r.subarray(A,e))},Nf=["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"],_t=function(r,A,e){var t=new Error(A||Nf[r]);if(t.code=r,Error.captureStackTrace&&Error.captureStackTrace(t,_t),!e)throw t;return t},Ff=function(r,A,e,t){var i=r.length,s=0;if(!i||A.f&&!A.l)return e||new qe(0);var n=!e,o=n||A.i!=2,a=A.i;n&&(e=new qe(i*3));var l=function(He){var ge=e.length;if(He>ge){var we=new qe(Math.max(ge*2,He));we.set(e),e=we}},h=A.f||0,c=A.p||0,f=A.b||0,I=A.l,d=A.d,C=A.m,p=A.n,S=i*8;do{if(!I){h=vt(r,c,1);var P=vt(r,c+1,3);if(c+=3,P)if(P==1)I=Pf,d=Uf,C=9,p=5;else if(P==2){var m=vt(r,c,31)+257,b=vt(r,c+10,15)+4,D=m+vt(r,c+5,31)+1;c+=14;for(var z=new qe(D),Ae=new qe(19),V=0;V<b;++V)Ae[pn[V]]=vt(r,c+V*3,7);c+=b*3;for(var K=Cn(Ae),te=(1<<K)-1,W=Nt(Ae,K,1),V=0;V<D;){var L=W[vt(r,c,te)];c+=L&15;var w=L>>4;if(w<16)z[V++]=w;else{var se=0,H=0;for(w==16?(H=3+vt(r,c,3),c+=2,se=z[V-1]):w==17?(H=3+vt(r,c,7),c+=3):w==18&&(H=11+vt(r,c,127),c+=7);H--;)z[V++]=se}}var q=z.subarray(0,m),ie=z.subarray(m);C=Cn(q),p=Cn(ie),I=Nt(q,C,1),d=Nt(ie,p,1)}else _t(1);else{var w=yn(c)+4,R=r[w-4]|r[w-3]<<8,_=w+R;if(_>i){a&&_t(0);break}o&&l(f+R),e.set(r.subarray(w,_),f),A.b=f+=R,A.p=c=_*8,A.f=h;continue}if(c>S){a&&_t(0);break}}o&&l(f+131072);for(var J=(1<<C)-1,$=(1<<p)-1,N=c;;N=c){var se=I[Qn(r,c)&J],U=se>>4;if(c+=se&15,c>S){a&&_t(0);break}if(se||_t(2),U<256)e[f++]=U;else if(U==256){N=c,I=null;break}else{var X=U-254;if(U>264){var V=U-257,ee=xr[V];X=vt(r,c,(1<<ee)-1)+Cl[V],c+=ee}var oe=d[Qn(r,c)&$],j=oe>>4;oe||_t(3),c+=oe&15;var ie=Mf[j];if(j>3){var ee=Sr[j];ie+=Qn(r,c)&(1<<ee)-1,c+=ee}if(c>S){a&&_t(0);break}o&&l(f+131072);var pe=f+X;if(f<ie){var at=s-ie,lt=Math.min(ie,pe);for(at+f<0&&_t(3);f<lt;++f)e[f]=t[at+f]}for(;f<pe;++f)e[f]=e[f-ie]}}A.l=I,A.p=N,A.b=f,A.f=h,I&&(h=1,A.m=C,A.d=d,A.n=p)}while(!h);return f!=e.length&&n?ml(e,0,f):e.subarray(0,f)},Zt=function(r,A,e){e<<=A&7;var t=A/8|0;r[t]|=e,r[t+1]|=e>>8},Hi=function(r,A,e){e<<=A&7;var t=A/8|0;r[t]|=e,r[t+1]|=e>>8,r[t+2]|=e>>16},mn=function(r,A){for(var e=[],t=0;t<r.length;++t)r[t]&&e.push({s:t,f:r[t]});var i=e.length,s=e.slice();if(!i)return{t:bl,l:0};if(i==1){var n=new qe(e[0].s+1);return n[e[0].s]=1,{t:n,l:1}}e.sort(function(_,m){return _.f-m.f}),e.push({s:-1,f:25001});var o=e[0],a=e[1],l=0,h=1,c=2;for(e[0]={s:-1,f:o.f+a.f,l:o,r:a};h!=i-1;)o=e[e[l].f<e[c].f?l++:c++],a=e[l!=h&&e[l].f<e[c].f?l++:c++],e[h++]={s:-1,f:o.f+a.f,l:o,r:a};for(var f=s[0].s,t=1;t<i;++t)s[t].s>f&&(f=s[t].s);var I=new ut(f+1),d=wn(e[h-1],I,0);if(d>A){var t=0,C=0,p=d-A,S=1<<p;for(s.sort(function(m,b){return I[b.s]-I[m.s]||m.f-b.f});t<i;++t){var P=s[t].s;if(I[P]>A)C+=S-(1<<d-I[P]),I[P]=A;else break}for(C>>=p;C>0;){var w=s[t].s;I[w]<A?C-=1<<A-I[w]++-1:++t}for(;t>=0&&C;--t){var R=s[t].s;I[R]==A&&(--I[R],++C)}d=A}return{t:new qe(I),l:d}},wn=function(r,A,e){return r.s==-1?Math.max(wn(r.l,A,e+1),wn(r.r,A,e+1)):A[r.s]=e},wl=function(r){for(var A=r.length;A&&!r[--A];);for(var e=new ut(++A),t=0,i=r[0],s=1,n=function(a){e[t++]=a},o=1;o<=A;++o)if(r[o]==i&&o!=A)++s;else{if(!i&&s>2){for(;s>138;s-=138)n(32754);s>2&&(n(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(n(i),--s;s>6;s-=6)n(8304);s>2&&(n(s-3<<5|8208),s=0)}for(;s--;)n(i);s=1,i=r[o]}return{c:e.subarray(0,t),n:A}},Ji=function(r,A){for(var e=0,t=0;t<A.length;++t)e+=r[t]*A[t];return e},vl=function(r,A,e){var t=e.length,i=yn(A+2);r[i]=t&255,r[i+1]=t>>8,r[i+2]=r[i]^255,r[i+3]=r[i+1]^255;for(var s=0;s<t;++s)r[i+s+4]=e[s];return(i+4+t)*8},_l=function(r,A,e,t,i,s,n,o,a,l,h){Zt(A,h++,e),++i[256];for(var c=mn(i,15),f=c.t,I=c.l,d=mn(s,15),C=d.t,p=d.l,S=wl(f),P=S.c,w=S.n,R=wl(C),_=R.c,m=R.n,b=new ut(19),D=0;D<P.length;++D)++b[P[D]&31];for(var D=0;D<_.length;++D)++b[_[D]&31];for(var z=mn(b,7),Ae=z.t,V=z.l,K=19;K>4&&!Ae[pn[K-1]];--K);var te=l+5<<3,W=Ji(i,hA)+Ji(s,Oi)+n,L=Ji(i,f)+Ji(s,C)+n+14+3*K+Ji(b,Ae)+2*b[16]+3*b[17]+7*b[18];if(a>=0&&te<=W&&te<=L)return vl(A,h,r.subarray(a,a+l));var se,H,q,ie;if(Zt(A,h,1+(L<W)),h+=2,L<W){se=Nt(f,I,0),H=f,q=Nt(C,p,0),ie=C;var J=Nt(Ae,V,0);Zt(A,h,w-257),Zt(A,h+5,m-1),Zt(A,h+10,K-4),h+=14;for(var D=0;D<K;++D)Zt(A,h+3*D,Ae[pn[D]]);h+=3*K;for(var $=[P,_],N=0;N<2;++N)for(var U=$[N],D=0;D<U.length;++D){var X=U[D]&31;Zt(A,h,J[X]),h+=Ae[X],X>15&&(Zt(A,h,U[D]>>5&127),h+=U[D]>>12)}}else se=Rf,H=hA,q=kf,ie=Oi;for(var D=0;D<o;++D){var ee=t[D];if(ee>255){var X=ee>>18&31;Hi(A,h,se[X+257]),h+=H[X+257],X>7&&(Zt(A,h,ee>>23&31),h+=xr[X]);var oe=ee&31;Hi(A,h,q[oe]),h+=ie[oe],oe>3&&(Hi(A,h,ee>>5&8191),h+=Sr[oe])}else Hi(A,h,se[ee]),h+=H[ee]}return Hi(A,h,se[256]),h+H[256]},Tf=new In([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bl=new qe(0),Gf=function(r,A,e,t,i,s){var n=s.z||r.length,o=new qe(t+n+5*(1+Math.ceil(n/7e3))+i),a=o.subarray(t,o.length-i),l=s.l,h=(s.r||0)&7;if(A){h&&(a[0]=s.r>>3);for(var c=Tf[A-1],f=c>>13,I=c&8191,d=(1<<e)-1,C=s.p||new ut(32768),p=s.h||new ut(d+1),S=Math.ceil(e/3),P=2*S,w=function(Je){return(r[Je]^r[Je+1]<<S^r[Je+2]<<P)&d},R=new In(25e3),_=new ut(288),m=new ut(32),b=0,D=0,z=s.i||0,Ae=0,V=s.w||0,K=0;z+2<n;++z){var te=w(z),W=z&32767,L=p[te];if(C[W]=L,p[te]=W,V<=z){var se=n-z;if((b>7e3||Ae>24576)&&(se>423||!l)){h=_l(r,a,0,R,_,m,D,Ae,K,z-K,h),Ae=b=D=0,K=z;for(var H=0;H<286;++H)_[H]=0;for(var H=0;H<30;++H)m[H]=0}var q=2,ie=0,J=I,$=W-L&32767;if(se>2&&te==w(z-$))for(var N=Math.min(f,se)-1,U=Math.min(32767,z),X=Math.min(258,se);$<=U&&--J&&W!=L;){if(r[z+q]==r[z+q-$]){for(var ee=0;ee<X&&r[z+ee]==r[z+ee-$];++ee);if(ee>q){if(q=ee,ie=$,ee>N)break;for(var oe=Math.min($,ee-2),j=0,H=0;H<oe;++H){var pe=z-$+H&32767,at=C[pe],lt=pe-at&32767;lt>j&&(j=lt,L=pe)}}}W=L,L=C[W],$+=W-L&32767}if(ie){R[Ae++]=268435456|Bn[q]<<18|yl[ie];var He=Bn[q]&31,ge=yl[ie]&31;D+=xr[He]+Sr[ge],++_[257+He],++m[ge],V=z+q,++b}else R[Ae++]=r[z],++_[r[z]]}}for(z=Math.max(z,V);z<n;++z)R[Ae++]=r[z],++_[r[z]];h=_l(r,a,l,R,_,m,D,Ae,K,z-K,h),l||(s.r=h&7|a[h/8|0]<<3,h-=7,s.h=p,s.p=C,s.i=z,s.w=V)}else{for(var z=s.w||0;z<n+l;z+=65535){var we=z+65535;we>=n&&(a[h/8|0]=l,we=n),h=vl(a,h+1,r.subarray(z,we))}s.i=n}return ml(o,0,t+yn(h)+i)},Dl=function(){var r=1,A=0;return{p:function(e){for(var t=r,i=A,s=e.length|0,n=0;n!=s;){for(var o=Math.min(n+2655,s);n<o;++n)i+=t+=e[n];t=(t&65535)+15*(t>>16),i=(i&65535)+15*(i>>16)}r=t,A=i},d:function(){return r%=65521,A%=65521,(r&255)<<24|(r&65280)<<8|(A&255)<<8|A>>8}}},Lf=function(r,A,e,t,i){if(!i&&(i={l:1},A.dictionary)){var s=A.dictionary.subarray(-32768),n=new qe(s.length+r.length);n.set(s),n.set(r,s.length),r=n,i.w=s.length}return Gf(r,A.level==null?6:A.level,A.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+A.mem,e,t,i)},xl=function(r,A,e){for(;e;++A)r[A]=e,e>>>=8},Of=function(r,A){var e=A.level,t=e==0?0:e<6?1:e==9?3:2;if(r[0]=120,r[1]=t<<6|(A.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,A.dictionary){var i=Dl();i.p(A.dictionary),xl(r,2,i.d())}},Hf=function(r,A){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&_t(6,"invalid zlib data"),(r[1]>>5&1)==1&&_t(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function Jf(r,A){A||(A={});var e=Dl();e.p(r);var t=Lf(r,A,A.dictionary?6:2,4);return Of(t,A),xl(t,t.length-4,e.d()),t}function Kf(r,A){return Ff(r.subarray(Hf(r),-4),{i:2},A,A)}var Yf=typeof TextDecoder<"u"&&new TextDecoder,zf=0;try{Yf.decode(bl,{stream:!0}),zf=1}catch{}const Wf="modern-font";function Ki(r,A){if(!r)throw new Error(`[${Wf}] ${A}`)}function Vf(r){if("buffer"in r){const A=r.buffer;return r.byteOffset>0||r.byteLength<r.buffer.byteLength?A.slice(r.byteOffset,r.byteOffset+r.byteLength):A}else return r}function jA(r){return"buffer"in r?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(r)}function qf(r){let A="";for(let e=0,t=r.length,i;e<t;e++)i=r.charCodeAt(e),i!==0&&(A+=String.fromCharCode(i));return A}function Mr(r){r=qf(r);const A=[];for(let e=0,t=r.length,i;e<t;e++)i=r.charCodeAt(e),A.push(i>>8),A.push(i&255);return A}function Xf(r){let A="";for(let e=0,t=r.length;e<t;e++)r[e]<127?A+=String.fromCharCode(r[e]):A+=`%${(256+r[e]).toString(16).slice(1)}`;return unescape(A)}function jf(r){let A="";for(let e=0,t=r.length;e<t;e+=2)A+=String.fromCharCode((r[e]<<8)+r[e+1]);return A}var Zf=Object.defineProperty,Xe=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Zf(A,e,i),i};const Yi={int8:1,int16:2,int32:4,uint8:1,uint16:2,uint32:4,float32:4,float64:8,fixed:4,longDateTime:8,char:1};function je(){return function(r,A){Object.defineProperty(r.constructor.prototype,A,{get(){if(typeof A=="string"){if(A.startsWith("read"))return(...e)=>this.read(A.substring(4).toLowerCase(),...e);if(A.startsWith("write"))return(...e)=>this.write(A.substring(5).toLowerCase(),...e)}},configurable:!0,enumerable:!0})}}class Fe extends DataView{constructor(e,t,i,s){super(Vf(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 l;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/,h=>h.toUpperCase())}`,n=this,o=(l=n[s])==null?void 0:l.bind(n),a=o==null?void 0:o(t,i);return this.cursor+=Yi[e],a}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 n=0,o=i.length;n<o;n++)s+=String.fromCharCode(i[n]);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 h;switch(e){case"char":return this.writeChar(t,i);case"fixed":return this.writeFixed(t,i);case"longDateTime":return this.writeLongDateTime(t,i)}const n=`set${e.replace(/^\S/,c=>c.toUpperCase())}`,o=this,a=(h=o[n])==null?void 0:h.bind(o),l=a==null?void 0:a(i,t,s);return this.cursor+=Yi[e.toLowerCase()],l}writeString(e="",t=this.cursor){const i=e.replace(/[^\x00-\xFF]/g,"11").length;this.seek(t);for(let s=0,n=e.length,o;s<n;++s)o=e.charCodeAt(s)||0,o>127?this.writeUint16(o):this.writeUint8(o);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=jA(e);i=s.byteLength;for(let n=0;n<i;++n)this.setUint8(t+n,s.getUint8(n))}return this.cursor=t+i,this}seek(e){return this.cursor=e,this}}Xe([je()],Fe.prototype,"readInt8"),Xe([je()],Fe.prototype,"readInt16"),Xe([je()],Fe.prototype,"readInt32"),Xe([je()],Fe.prototype,"readUint8"),Xe([je()],Fe.prototype,"readUint16"),Xe([je()],Fe.prototype,"readUint32"),Xe([je()],Fe.prototype,"readFloat32"),Xe([je()],Fe.prototype,"readFloat64"),Xe([je()],Fe.prototype,"writeInt8"),Xe([je()],Fe.prototype,"writeInt16"),Xe([je()],Fe.prototype,"writeInt32"),Xe([je()],Fe.prototype,"writeUint8"),Xe([je()],Fe.prototype,"writeUint16"),Xe([je()],Fe.prototype,"writeUint32"),Xe([je()],Fe.prototype,"writeFloat32"),Xe([je()],Fe.prototype,"writeFloat64");const Sl=new WeakMap;function y(r){const A=typeof r=="object"?r:{type:r},{size:e=1,type:t}=A;return(i,s)=>{if(typeof s!="string")return;let n=Sl.get(i);n||(n={columns:[],byteLength:0},Sl.set(i,n));const o={...A,name:s,byteLength:e*Yi[t],offset:A.offset??n.columns.reduce((a,l)=>a+l.byteLength,0)};n.columns.push(o),n.byteLength=n.columns.reduce((a,l)=>a+Yi[l.type]*(l.size??1),0),Object.defineProperty(i.constructor.prototype,s,{get(){return this.view.readColumn(o)},set(a){this.view.writeColumn(o,a)},configurable:!0,enumerable:!0})}}class ft{constructor(A,e,t,i){u(this,"view");this.view=new Fe(A,e,t,i)}}class Rr extends ft{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(A){return new FontFace(A,this.view.buffer)}}var $f=Object.defineProperty,rt=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&$f(A,e,i),i};const st=class kh extends Rr{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,n=Mr(s.fontFamily||""),o=n.length,a=Mr(s.fontStyle||""),l=a.length,h=Mr(s.version||""),c=h.length,f=Mr(s.fullName||""),I=f.length,d=86+o+4+l+4+c+4+I+2+e.view.byteLength,C=new kh(new ArrayBuffer(d),0,d,!0);C.EOTSize=C.view.byteLength,C.FontDataSize=e.view.byteLength,C.Version=131073,C.Flags=0,C.Charset=1,C.MagicNumber=20556,C.Padding1=0,C.CheckSumAdjustment=t.head.checkSumAdjustment;const p=t.os2;return p&&(C.FontPANOSE=p.fontPANOSE,C.Italic=p.fsSelection,C.Weight=p.usWeightClass,C.fsType=p.fsType,C.UnicodeRange=p.ulUnicodeRange,C.CodePageRange=p.ulCodePageRange),C.view.writeUint16(o),C.view.writeBytes(n),C.view.writeUint16(0),C.view.writeUint16(l),C.view.writeBytes(a),C.view.writeUint16(0),C.view.writeUint16(c),C.view.writeBytes(h),C.view.writeUint16(0),C.view.writeUint16(I),C.view.writeBytes(f),C.view.writeUint16(0),C.view.writeUint16(0),C.view.writeBytes(e.view),C}};rt([y("uint32")],st.prototype,"EOTSize"),rt([y("uint32")],st.prototype,"FontDataSize"),rt([y("uint32")],st.prototype,"Version"),rt([y("uint32")],st.prototype,"Flags"),rt([y({type:"uint8",size:10})],st.prototype,"FontPANOSE"),rt([y("uint8")],st.prototype,"Charset"),rt([y("uint8")],st.prototype,"Italic"),rt([y("uint32")],st.prototype,"Weight"),rt([y("uint16")],st.prototype,"fsType"),rt([y("uint16")],st.prototype,"MagicNumber"),rt([y({type:"uint8",size:16})],st.prototype,"UnicodeRange"),rt([y({type:"uint8",size:8})],st.prototype,"CodePageRange"),rt([y("uint32")],st.prototype,"CheckSumAdjustment"),rt([y({type:"uint8",size:16})],st.prototype,"Reserved"),rt([y("uint16")],st.prototype,"Padding1");var ed=Object.defineProperty,Pr=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&ed(A,e,i),i};class ZA extends ft{constructor(A,e){super(A,e,16)}}Pr([y({type:"char",size:4})],ZA.prototype,"tag"),Pr([y("uint32")],ZA.prototype,"checkSum"),Pr([y("uint32")],ZA.prototype,"offset"),Pr([y("uint32")],ZA.prototype,"length");const vn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],td=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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 _n{constructor(A){u(this,"index");u(this,"name");u(this,"isComposite",!1);u(this,"components",[]);u(this,"pathCommands",[]);const e={...A};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(A=0,e=0,t=72,i={},s){const n=1/((s==null?void 0:s.unitsPerEm)??1e3)*t,{xScale:o=n,yScale:a=n}=i,l=this.pathCommands,h=[];for(let c=0,f=l.length;c<f;c+=1){const I=l[c];I.type==="M"?h.push({type:"M",x:A+I.x*o,y:e+-I.y*a}):I.type==="L"?h.push({type:"L",x:A+I.x*o,y:e+-I.y*a}):I.type==="Q"?h.push({type:"Q",x1:A+I.x1*o,y1:e+-I.y1*a,x:A+I.x*o,y:e+-I.y*a}):I.type==="C"?h.push({type:"C",x1:A+I.x1*o,y1:e+-I.y1*a,x2:A+I.x2*o,y2:e+-I.y2*a,x:A+I.x*o,y:e+-I.y*a}):I.type==="Z"&&h.push({type:"Z"})}return h}}class Ad extends _n{parse(A,e,t){const i=this,{nominalWidthX:s,defaultWidthX:n,gsubrsBias:o,subrsBias:a}=A,l=A.topDict.paintType,h=this.index;let c,f,I,d;const C=[],p=[];let S=0,P=!1,w=!1,R=n,_=0,m=0;function b(W,L){C.push({type:"L",x:W,y:L})}function D(W,L,se,H,q,ie){C.push({type:"C",x1:W,y1:L,x2:se,y2:H,x:q,y:ie})}function z(W,L){w&&l!==2&&Ae(),w=!0,C.push({type:"M",x:W,y:L})}function Ae(){C.push({type:"Z"})}function V(W){C.push(...W)}function K(){p.length%2!==0&&!P&&(R=p.shift()+s),S+=p.length>>1,p.length=0,P=!0}function te(W){let L,se,H,q,ie,J,$,N,U,X,ee,oe,j=0;for(;j<W.length;){let pe=W[j++];switch(pe){case 1:K();break;case 3:K();break;case 4:p.length>1&&!P&&(R=p.shift()+s,P=!0),m+=p.pop(),z(_,m);break;case 5:for(;p.length>0;)_+=p.shift(),m+=p.shift(),b(_,m);break;case 6:for(;p.length>0&&(_+=p.shift(),b(_,m),p.length!==0);)m+=p.shift(),b(_,m);break;case 7:for(;p.length>0&&(m+=p.shift(),b(_,m),p.length!==0);)_+=p.shift(),b(_,m);break;case 8:for(;p.length>0;)c=_+p.shift(),f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),_=I+p.shift(),m=d+p.shift(),D(c,f,I,d,_,m);break;case 10:ie=p.pop()+a,J=A.subrs[ie],J&&te(J);break;case 11:return;case 12:switch(pe=W[j],j+=1,pe){case 35:c=_+p.shift(),f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),$=I+p.shift(),N=d+p.shift(),U=$+p.shift(),X=N+p.shift(),ee=U+p.shift(),oe=X+p.shift(),_=ee+p.shift(),m=oe+p.shift(),p.shift(),D(c,f,I,d,$,N),D(U,X,ee,oe,_,m);break;case 34:c=_+p.shift(),f=m,I=c+p.shift(),d=f+p.shift(),$=I+p.shift(),N=d,U=$+p.shift(),X=d,ee=U+p.shift(),oe=m,_=ee+p.shift(),D(c,f,I,d,$,N),D(U,X,ee,oe,_,m);break;case 36:c=_+p.shift(),f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),$=I+p.shift(),N=d,U=$+p.shift(),X=d,ee=U+p.shift(),oe=X+p.shift(),_=ee+p.shift(),D(c,f,I,d,$,N),D(U,X,ee,oe,_,m);break;case 37:c=_+p.shift(),f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),$=I+p.shift(),N=d+p.shift(),U=$+p.shift(),X=N+p.shift(),ee=U+p.shift(),oe=X+p.shift(),Math.abs(ee-_)>Math.abs(oe-m)?_=ee+p.shift():m=oe+p.shift(),D(c,f,I,d,$,N),D(U,X,ee,oe,_,m);break;default:console.warn(`Glyph ${h}: unknown operator ${1200+pe}`),p.length=0}break;case 14:if(p.length>=4){const at=vn[p.pop()],lt=vn[p.pop()],He=p.pop(),ge=p.pop();if(at&<){i.isComposite=!0,i.components=[];const we=A.charset.indexOf(at),Je=A.charset.indexOf(lt);i.components.push({glyphIndex:Je,dx:0,dy:0}),i.components.push({glyphIndex:we,dx:ge,dy:He}),V(t.get(Je).pathCommands);const Ve=JSON.parse(JSON.stringify(t.get(we).pathCommands));for(let xe=0;xe<Ve.length;xe+=1){const et=Ve[xe];et.type!=="Z"&&(et.x+=ge,et.y+=He),(et.type==="Q"||et.type==="C")&&(et.x1+=ge,et.y1+=He),et.type==="C"&&(et.x2+=ge,et.y2+=He)}V(Ve)}}else p.length>0&&!P&&(R=p.shift()+s,P=!0);w&&l!==2&&(Ae(),w=!1);break;case 18:K();break;case 19:case 20:K(),j+=S+7>>3;break;case 21:p.length>2&&!P&&(R=p.shift()+s,P=!0),m+=p.pop(),_+=p.pop(),z(_,m);break;case 22:p.length>1&&!P&&(R=p.shift()+s,P=!0),_+=p.pop(),z(_,m);break;case 23:K();break;case 24:for(;p.length>2;)c=_+p.shift(),f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),_=I+p.shift(),m=d+p.shift(),D(c,f,I,d,_,m);_+=p.shift(),m+=p.shift(),b(_,m);break;case 25:for(;p.length>6;)_+=p.shift(),m+=p.shift(),b(_,m);c=_+p.shift(),f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),_=I+p.shift(),m=d+p.shift(),D(c,f,I,d,_,m);break;case 26:for(p.length%2&&(_+=p.shift());p.length>0;)c=_,f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),_=I,m=d+p.shift(),D(c,f,I,d,_,m);break;case 27:for(p.length%2&&(m+=p.shift());p.length>0;)c=_+p.shift(),f=m,I=c+p.shift(),d=f+p.shift(),_=I+p.shift(),m=d,D(c,f,I,d,_,m);break;case 28:L=W[j],se=W[j+1],p.push((L<<24|se<<16)>>16),j+=2;break;case 29:ie=p.pop()+o,J=A.gsubrs[ie],J&&te(J);break;case 30:for(;p.length>0&&(c=_,f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),_=I+p.shift(),m=d+(p.length===1?p.shift():0),D(c,f,I,d,_,m),p.length!==0);)c=_+p.shift(),f=m,I=c+p.shift(),d=f+p.shift(),m=d+p.shift(),_=I+(p.length===1?p.shift():0),D(c,f,I,d,_,m);break;case 31:for(;p.length>0&&(c=_+p.shift(),f=m,I=c+p.shift(),d=f+p.shift(),m=d+p.shift(),_=I+(p.length===1?p.shift():0),D(c,f,I,d,_,m),p.length!==0);)c=_,f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),_=I+p.shift(),m=d+(p.length===1?p.shift():0),D(c,f,I,d,_,m);break;default:pe<32?console.warn(`Glyph ${h}: unknown operator ${pe}`):pe<247?p.push(pe-139):pe<251?(L=W[j],j+=1,p.push((pe-247)*256+L+108)):pe<255?(L=W[j],j+=1,p.push(-(pe-251)*256-L-108)):(L=W[j],se=W[j+1],H=W[j+2],q=W[j+3],j+=4,p.push((L<<24|se<<16|H<<8|q)/65536))}}}te(e),this.pathCommands=C,P&&(this.advanceWidth=R)}}class bn{constructor(A){u(this,"_items",[]);this._sfnt=A}get(A){const e=this._items[A];let t;if(e)t=e;else{t=this._get(A);const i=this._sfnt.hmtx.metrics[A];i&&(t.advanceWidth=t.advanceWidth||i.advanceWidth,t.leftSideBearing=t.leftSideBearing||i.leftSideBearing);const s=this._sfnt.cmap.glyphIndexToUnicodesMap.get(A);s&&(t.unicode??(t.unicode=s[0]),t.unicodes??(t.unicodes=s)),this._items[A]=t}return t}}class id extends bn{get length(){return this._sfnt.cff.charStringsIndex.offsets.length-1}_get(A){const e=this._sfnt.cff,t=new Ad({index:A});return t.parse(e,e.charStringsIndex.get(A),this),t.name=e.charset[A],t}}var rd=Object.defineProperty,Ml=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&rd(A,e,i),i};class kr extends ft{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 n=0,o=t+1;n<o;n++){const a=this.view;let l=0;for(let h=0;h<i;h++)l<<=8,l+=a.readUint8();s.push(l)}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],o=i+t[e+1]-s;return this._isString?this.view.readString(s,o):this.view.readBytes(s,o)}}Ml([y("uint16")],kr.prototype,"count"),Ml([y("uint8")],kr.prototype,"offsetSize");class Ur extends kr{constructor(){super(...arguments);u(this,"_isString",!1)}}class Rl extends kr{constructor(){super(...arguments);u(this,"_isString",!0)}}const sd=[".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"],nd=[".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"],od=[".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"],ad=[".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 Nr(r,A){return A<=390?sd[A]:r[A-391]}function ye(r,A="number",e){return(t,i)=>{if(typeof i!="string")return;const s={type:A,operator:r,default:e??A==="number"?0:void 0};Object.defineProperty(t.constructor.prototype,i,{get(){return this._getProp(s)},set(n){this._setProp(s,n)},configurable:!0,enumerable:!0})}}class Pl extends ft{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 n=e.readUint8(),o=n>>4,a=n&15;if(o===i||(t+=s[o],a===i))break;t+=s[a]}return Number.parseFloat(t)}_readOperand(e){const t=this.view;let i,s,n,o;if(e===28)return i=t.readUint8(),s=t.readUint8(),i<<8|s;if(e===29)return i=t.readUint8(),s=t.readUint8(),n=t.readUint8(),o=t.readUint8(),i<<24|s<<16|n<<8|o;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 n=e.readUint8();n<=21?(n===12&&(n=1200+e.readUint8()),s[n]=t,t=[]):t.push(this._readOperand(n))}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 Nr(((i=this._stringIndex)==null?void 0:i.objects)??[],t[0]);case"number[]":return t}return t}_setProp(e,t){}}var ld=Object.defineProperty,Dn=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&ld(A,e,i),i};class Fr extends Pl{}Dn([ye(19)],Fr.prototype,"subrs"),Dn([ye(20)],Fr.prototype,"defaultWidthX"),Dn([ye(21)],Fr.prototype,"nominalWidthX");var hd=Object.defineProperty,De=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&hd(A,e,i),i};class ve extends Pl{}De([ye(0,"string")],ve.prototype,"version"),De([ye(1,"string")],ve.prototype,"notice"),De([ye(1200,"string")],ve.prototype,"copyright"),De([ye(2,"string")],ve.prototype,"fullName"),De([ye(3,"string")],ve.prototype,"familyName"),De([ye(4,"string")],ve.prototype,"weight"),De([ye(1201)],ve.prototype,"isFixedPitch"),De([ye(1202)],ve.prototype,"italicAngle"),De([ye(1203,"number",-100)],ve.prototype,"underlinePosition"),De([ye(1204,"number",50)],ve.prototype,"underlineThickness"),De([ye(1205)],ve.prototype,"paintType"),De([ye(1206,"number",2)],ve.prototype,"charstringType"),De([ye(1207,"number[]",[.001,0,0,.001,0,0])],ve.prototype,"fontMatrix"),De([ye(13)],ve.prototype,"uniqueId"),De([ye(5,"number[]",[0,0,0,0])],ve.prototype,"fontBBox"),De([ye(1208)],ve.prototype,"strokeWidth"),De([ye(14)],ve.prototype,"xuid"),De([ye(15)],ve.prototype,"charset"),De([ye(16)],ve.prototype,"encoding"),De([ye(17)],ve.prototype,"charStrings"),De([ye(18,"number[]",[0,0])],ve.prototype,"private");function Ye(r,A=r){return e=>{DA.tableDefinitions.set(r,{tag:r,prop:A,class:e}),Object.defineProperty(DA.prototype,A,{get(){return this.get(r)},set(t){return this.set(r,t)},configurable:!0,enumerable:!0})}}const UA=class UA{constructor(A){u(this,"tables",new Map);u(this,"tableViews",new Map);(A instanceof Map?A:new Map(Object.entries(A))).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 numGlyphs(){return this.maxp.numGlyphs}get unicodes(){return this.cmap.glyphIndexToUnicodesMap}get glyphs(){return this.hasGlyf?this.glyf.glyphs:this.cff.glyphs}charToGlyphIndex(A){let e=this.cmap.unicodeToGlyphIndexMap.get(A.codePointAt(0));if(e===void 0&&!this.hasGlyf){const{encoding:t,charset:i}=this.cff;e=i.indexOf(t[A.codePointAt(0)])}return e??0}charToGlyph(A){return this.glyphs.get(this.charToGlyphIndex(A))}textToGlyphIndexes(A){const e=[];for(const t of A)e.push(this.charToGlyphIndex(t));return e}textToGlyphs(A){const e=this.glyphs,t=this.textToGlyphIndexes(A),i=t.length,s=Array.from({length:i}),n=e.get(0);for(let o=0;o<i;o+=1)s[o]=e.get(t[o])||n;return s}getPathCommands(A,e,t,i,s){const n=[];return this.forEachGlyph(A,e,t,i,s,(o,a,l,h,c)=>{n.push(...o.getPathCommands(a,l,h,c,this))}),n}getAdvanceWidth(A,e,t){return this.forEachGlyph(A,0,0,e,t,()=>{})}forEachGlyph(A,e=0,t=0,i=72,s={},n){const o=1/this.unitsPerEm*i,a=this.textToGlyphs(A);for(let l=0;l<a.length;l+=1){const h=a[l];n.call(this,h,e,t,i,s),h.advanceWidth&&(e+=h.advanceWidth*o),s.letterSpacing?e+=s.letterSpacing*i:s.tracking&&(e+=s.tracking/1e3*i)}return e}clone(){return new UA(this.tableViews)}delete(A){const e=UA.tableDefinitions.get(A);return e?(this.tableViews.delete(A),this.tables.delete(e.prop),this):this}set(A,e){const t=UA.tableDefinitions.get(A);return t&&this.tables.set(t.prop,e),this.tableViews.set(A,e.view),this}get(A){const e=UA.tableDefinitions.get(A);if(!e)return;let t=this.tables.get(e.prop);if(!t){const i=e.class;if(i){const s=this.tableViews.get(A);if(!s)return;t=new i(s.buffer,s.byteOffset,s.byteLength).setSFNT(this),this.tables.set(e.prop,t)}}return t}};u(UA,"tableDefinitions",new Map);let DA=UA;class Ze extends ft{setSFNT(A){return this._sfnt=A,this}getSFNT(){return this._sfnt}}var cd=Object.defineProperty,gd=Object.getOwnPropertyDescriptor,zi=(r,A,e,t)=>{for(var i=t>1?void 0:t?gd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&cd(A,e,i),i};let xA=class extends Ze{constructor(A,e,t,i){super(A,e,t,i);u(this,"_glyphs");u(this,"privateDict");u(this,"subrsIndex");this._init()}get glyphs(){return this._glyphs??(this._glyphs=new id(this._sfnt))}get gsubrs(){return this.globalSubrIndex.objects}get gsubrsBias(){return this._calcSubroutineBias(this.globalSubrIndex.objects)}get defaultWidthX(){var A;return((A=this.privateDict)==null?void 0:A.defaultWidthX)??0}get nominalWidthX(){var A;return((A=this.privateDict)==null?void 0:A.nominalWidthX)??0}get subrs(){var A;return((A=this.subrsIndex)==null?void 0:A.objects)??[]}get subrsBias(){return this._calcSubroutineBias(this.subrs)}_init(){const A=this.view,{buffer:e,byteOffset:t}=A,i=t+4;this.nameIndex=new Rl(e,i),this.topDictIndex=new Ur(e,this.nameIndex.endOffset),this.stringIndex=new Rl(e,this.topDictIndex.endOffset),this.globalSubrIndex=new Ur(e,this.stringIndex.endOffset),this.topDict=new ve(new Uint8Array(this.topDictIndex.objects[0]).buffer).setStringIndex(this.stringIndex);const s=this.topDict.private[0],n=this.topDict.private[1];s&&(this.privateDict=new Fr(e,t+n,s).setStringIndex(this.stringIndex),this.privateDict.subrs&&(this.subrsIndex=new Ur(e,t+n+this.privateDict.subrs))),this.charStringsIndex=new Ur(e,t+this.topDict.charStrings);const o=this.charStringsIndex.offsets.length-1;this.topDict.charset===0?this.charset=nd:this.topDict.charset===1?this.charset=od:this.topDict.charset===2?this.charset=ad:this.charset=this._readCharset(t+this.topDict.charset,o,this.stringIndex.objects),this.topDict.encoding===0?this.encoding=vn:this.topDict.encoding===1?this.encoding=td:this.encoding=this._readEncoding(t+this.topDict.encoding)}_readCharset(A,e,t){const i=this.view;i.seek(A);let s,n,o;e-=1;const a=[".notdef"],l=i.readUint8();if(l===0)for(s=0;s<e;s+=1)n=i.readUint16(),a.push(Nr(t,n));else if(l===1)for(;a.length<=e;)for(n=i.readUint16(),o=i.readUint8(),s=0;s<=o;s+=1)a.push(Nr(t,n)),n+=1;else if(l===2)for(;a.length<=e;)for(n=i.readUint16(),o=i.readUint16(),s=0;s<=o;s+=1)a.push(Nr(t,n)),n+=1;else throw new Error(`Unknown charset format ${l}`);return a}_readEncoding(A){const e=this.view;e.seek(A);let t,i;const s={},n=e.readUint8();if(n===0){const o=e.readUint8();for(t=0;t<o;t+=1)i=e.readUint8(),s[i]=t}else if(n===1){const o=e.readUint8();for(i=1,t=0;t<o;t+=1){const a=e.readUint8(),l=e.readUint8();for(let h=a;h<=a+l;h+=1)s[h]=i,i+=1}}else console.warn(`unknown encoding format:${n}`);return s}_calcSubroutineBias(A){let e;return A.length<1240?e=107:A.length<33900?e=1131:e=32768,e}};zi([y("uint8")],xA.prototype,"majorVersion",2),zi([y("uint8")],xA.prototype,"minorVersion",2),zi([y("uint8")],xA.prototype,"headerSize",2),zi([y("uint8")],xA.prototype,"offsetSize",2),xA=zi([Ye("CFF ","cff")],xA);var ud=Object.defineProperty,Tr=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&ud(A,e,i),i};const Wi=class Uh extends ft{constructor(A=new ArrayBuffer(262),e){super(A,e,262)}static from(A){const e=new Uh;return e.format=0,e.length=e.view.byteLength,e.language=0,A.forEach((t,i)=>{i<256&&t<256&&e.view.writeUint8(t,6+i)}),e}getUnicodeToGlyphIndexMap(){const A=new Map;return this.glyphIndexArray.forEach((e,t)=>{A.set(t,e)}),A}};Tr([y("uint16")],Wi.prototype,"format"),Tr([y("uint16")],Wi.prototype,"length"),Tr([y("uint16")],Wi.prototype,"language"),Tr([y({type:"uint8",size:256})],Wi.prototype,"glyphIndexArray");let xn=Wi;var fd=Object.defineProperty,Sn=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&fd(A,e,i),i};class Vi extends ft{get subHeaderKeys(){return this.view.seek(6),Array.from({length:256},()=>this.view.readUint16()/8)}get maxSubHeaderKey(){return this.subHeaderKeys.reduce((A,e)=>Math.max(A,e),0)}get subHeaders(){const A=this.maxSubHeaderKey;return this.view.seek(6+256*2),Array.from({length:A},(e,t)=>({firstCode:this.view.readUint16(),entryCount:this.view.readUint16(),idDelta:this.view.readUint16(),idRangeOffset:(this.view.readUint16()-(A-t)*8-2)/2}))}get glyphIndexArray(){const A=this.maxSubHeaderKey,e=6+256*2+A*8;this.view.seek(e);const t=(this.view.byteLength-e)/2;return Array.from({length:t},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(A){const e=new Map,t=this.subHeaderKeys,i=this.maxSubHeaderKey,s=this.subHeaders,n=this.glyphIndexArray,o=t.findIndex(l=>l===i);let a=0;for(let l=0;l<256;l++)if(t[l]===0)l>=o||l<s[0].firstCode||l>=s[0].firstCode+s[0].entryCount||s[0].idRangeOffset+(l-s[0].firstCode)>=n.length?a=0:(a=n[s[0].idRangeOffset+(l-s[0].firstCode)],a!==0&&(a=a+s[0].idDelta)),a!==0&&a<A&&e.set(l,a);else{const h=t[l];for(let c=0,f=s[h].entryCount;c<f;c++)if(s[h].idRangeOffset+c>=n.length?a=0:(a=n[s[h].idRangeOffset+c],a!==0&&(a=a+s[h].idDelta)),a!==0&&a<A){const I=(l<<8|c+s[h].firstCode)%65535;e.set(I,a)}}return e}}Sn([y("uint16")],Vi.prototype,"format"),Sn([y("uint16")],Vi.prototype,"length"),Sn([y("uint16")],Vi.prototype,"language");function kl(r){return r>32767?r-65536:r<-32767?r+65536:r}function Mn(r,A){let e;const t=[];let i={};return r.forEach((s,n)=>{A&&n>A||((!e||n!==e.unicode+1||s!==e.glyphIndex+1)&&(e?(i.end=e.unicode,t.push(i),i={start:n,startId:s,delta:kl(s-n)}):(i.start=Number(n),i.startId=s,i.delta=kl(s-n))),e={unicode:n,glyphIndex:s})}),e&&(i.end=e.unicode,t.push(i)),t}var dd=Object.defineProperty,SA=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&dd(A,e,i),i};const cA=class Nh extends ft{get endCode(){const A=this.segCountX2;return this.view.seek(14),Array.from({length:A/2},()=>this.view.readUint16())}set endCode(A){this.view.seek(14),A.forEach(e=>this.view.writeUint16(e))}get reservedPad(){return this.view.readUint16(14+this.segCountX2)}set reservedPad(A){this.view.writeUint16(A,14+this.segCountX2)}get startCode(){const A=this.segCountX2;return this.view.seek(14+A+2),Array.from({length:A/2},()=>this.view.readUint16())}set startCode(A){this.view.seek(14+this.segCountX2+2),A.forEach(e=>this.view.writeUint16(e))}get idDelta(){const A=this.segCountX2;return this.view.seek(14+A+2+A),Array.from({length:A/2},()=>this.view.readUint16())}set idDelta(A){const e=this.segCountX2;this.view.seek(14+e+2+e),A.forEach(t=>this.view.writeUint16(t))}get idRangeOffsetCursor(){const A=this.segCountX2;return 14+A+2+A*2}get idRangeOffset(){const A=this.segCountX2;return this.view.seek(this.idRangeOffsetCursor),Array.from({length:A/2},()=>this.view.readUint16())}set idRangeOffset(A){this.view.seek(this.idRangeOffsetCursor),A.forEach(e=>this.view.writeUint16(e))}get glyphIndexArrayCursor(){const A=this.segCountX2;return 14+A+2+A*3}get glyphIndexArray(){const A=this.glyphIndexArrayCursor;this.view.seek(A);const e=(this.view.byteLength-A)/2;return Array.from({length:e},()=>this.view.readUint16())}static from(A){const e=Mn(A,65535),t=e.length+1,i=Math.floor(Math.log(t)/Math.LN2),s=2*2**i,n=new Nh(new ArrayBuffer(24+e.length*8));return n.format=4,n.length=n.view.byteLength,n.language=0,n.segCountX2=t*2,n.searchRange=s,n.entrySelector=i,n.rangeShift=2*t-s,n.endCode=[...e.map(o=>o.end),65535],n.reservedPad=0,n.startCode=[...e.map(o=>o.start),65535],n.idDelta=[...e.map(o=>o.delta),1],n.idRangeOffset=Array.from({length:t},()=>0),n}getUnicodeToGlyphIndexMap(){const A=new Map,e=this.segCountX2/2,t=(this.glyphIndexArrayCursor-this.idRangeOffsetCursor)/2,i=this.startCode,s=this.endCode,n=this.idRangeOffset,o=this.idDelta,a=this.glyphIndexArray;for(let l=0;l<e;++l)for(let h=i[l],c=s[l];h<=c;++h)if(n[l]===0)A.set(h,(h+o[l])%65536);else{const f=l+n[l]/2+(h-i[l])-t,I=a[f];I!==0?A.set(h,(I+o[l])%65536):A.set(h,0)}return A.delete(65535),A}};SA([y("uint16")],cA.prototype,"format"),SA([y("uint16")],cA.prototype,"length"),SA([y("uint16")],cA.prototype,"language"),SA([y("uint16")],cA.prototype,"segCountX2"),SA([y("uint16")],cA.prototype,"searchRange"),SA([y("uint16")],cA.prototype,"entrySelector"),SA([y("uint16")],cA.prototype,"rangeShift");let Rn=cA;var Id=Object.defineProperty,qi=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Id(A,e,i),i};class MA extends ft{get glyphIndexArray(){return this.view.seek(12),Array.from({length:this.entryCount},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(){const A=this.glyphIndexArray,e=new Map;return A.forEach((t,i)=>{e.set(i,t)}),e}}qi([y("uint16")],MA.prototype,"format"),qi([y("uint16")],MA.prototype,"length"),qi([y("uint16")],MA.prototype,"language"),qi([y("uint16")],MA.prototype,"firstCode"),qi([y("uint16")],MA.prototype,"entryCount");var pd=Object.defineProperty,Xi=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&pd(A,e,i),i};const $A=class Fh extends ft{get groups(){const A=this.nGroups;return this.view.seek(16),Array.from({length:A},()=>({startCharCode:this.view.readUint32(),endCharCode:this.view.readUint32(),startGlyphCode:this.view.readUint32()}))}static from(A){const e=Mn(A),t=new Fh(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 A=new Map,e=this.groups;for(let t=0,i=e.length;t<i;t++){const s=e[t];let n=s.startGlyphCode,o=s.startCharCode;const a=s.endCharCode;for(;o<=a;)A.set(o++,n++)}return A}};Xi([y("uint16")],$A.prototype,"format"),Xi([y("uint16")],$A.prototype,"reserved"),Xi([y("uint32")],$A.prototype,"length"),Xi([y("uint32")],$A.prototype,"language"),Xi([y("uint32")],$A.prototype,"nGroups");let Pn=$A;var Bd=Object.defineProperty,kn=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Bd(A,e,i),i};class ji extends ft{getVarSelectorRecords(){const A=this.numVarSelectorRecords;return this.view.seek(10),Array.from({length:A},()=>{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 A=new Map,e=this.getVarSelectorRecords();for(let t=0,i=e.length;t<i;t++){const{uVSMappings:s}=e[t];s.forEach(n=>{A.set(n.unicodeValue,n.glyphID)})}return A}}kn([y("uint16")],ji.prototype,"format"),kn([y("uint32")],ji.prototype,"length"),kn([y("uint32")],ji.prototype,"numVarSelectorRecords");var Ed=Object.defineProperty,Cd=Object.getOwnPropertyDescriptor,Un=(r,A,e,t)=>{for(var i=t>1?void 0:t?Cd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Ed(A,e,i),i};let ei=class extends Ze{constructor(){super(...arguments);u(this,"_unicodeToGlyphIndexMap");u(this,"_glyphIndexToUnicodesMap")}static from(A){const e=Array.from(A.keys()).some(c=>c>65535),t=Rn.from(A),i=xn.from(A),s=e?Pn.from(A):void 0,n=4+(s?32:24),o=n+t.view.byteLength,a=o+i.view.byteLength,l=[{platformID:0,platformSpecificID:3,offset:n},{platformID:1,platformSpecificID:0,offset:o},{platformID:3,platformSpecificID:1,offset:n},s&&{platformID:3,platformSpecificID:10,offset:a}].filter(Boolean),h=new ei(new ArrayBuffer(4+8*l.length+t.view.byteLength+i.view.byteLength+((s==null?void 0:s.view.byteLength)??0)));return h.numberSubtables=l.length,h.view.seek(4),l.forEach(c=>{h.view.writeUint16(c.platformID),h.view.writeUint16(c.platformSpecificID),h.view.writeUint32(c.offset)}),h.view.writeBytes(t.view,n),h.view.writeBytes(i.view,o),s&&h.view.writeBytes(s.view,a),h}get unicodeToGlyphIndexMap(){return this._unicodeToGlyphIndexMap??(this._unicodeToGlyphIndexMap=this.readunicodeToGlyphIndexMap())}get glyphIndexToUnicodesMap(){if(!this._glyphIndexToUnicodesMap){const A=new Map,e=this.unicodeToGlyphIndexMap,t=Array.from(e.keys());for(let i=0,s=t.length;i<s;i++){const n=t[i],o=e.get(n);A.has(o)?A.get(o).push(n):A.set(o,[n])}this._glyphIndexToUnicodesMap=A}return this._glyphIndexToUnicodesMap}readSubtables(){const A=this.numberSubtables;return this.view.seek(4),Array.from({length:A},()=>({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 xn(this.view.buffer,e.offset);break;case 2:i=new Vi(this.view.buffer,e.offset,this.view.readUint16());break;case 4:i=new Rn(this.view.buffer,e.offset,this.view.readUint16());break;case 6:i=new MA(this.view.buffer,e.offset,this.view.readUint16());break;case 12:i=new Pn(this.view.buffer,e.offset,this.view.readUint32(e.offset+4));break;case 14:default:i=new ji(this.view.buffer,e.offset,this.view.readUint32());break}return{...e,format:t,view:i}})}readunicodeToGlyphIndexMap(){var o,a,l,h,c;const A=this.readSubtables(),e=(o=A.find(f=>f.format===0))==null?void 0:o.view,t=(a=A.find(f=>f.platformID===3&&f.platformSpecificID===3&&f.format===2))==null?void 0:a.view,i=(l=A.find(f=>f.platformID===3&&f.platformSpecificID===1&&f.format===4))==null?void 0:l.view,s=(h=A.find(f=>f.platformID===3&&f.platformSpecificID===10&&f.format===12))==null?void 0:h.view,n=(c=A.find(f=>f.platformID===0&&f.platformSpecificID===5&&f.format===14))==null?void 0:c.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())??[],...(n==null?void 0:n.getUnicodeToGlyphIndexMap())??[]])}};Un([y("uint16")],ei.prototype,"version",2),Un([y("uint16")],ei.prototype,"numberSubtables",2),ei=Un([Ye("cmap")],ei);class Qd extends _n{_parseContours(A){const e=[];let t=[];for(let i=0;i<A.length;i+=1){const s=A[i];t.push(s),s.lastPointOfContour&&(e.push(t),t=[])}return Ki(t.length===0,"There are still points left in the current contour."),e}_transformPoints(A,e){const t=[];for(let i=0;i<A.length;i+=1){const s=A[i],n={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(n)}return t}_parseGlyphCoordinate(A,e,t,i,s){let n;return(e&i)>0?(n=A.view.readUint8(),(e&s)===0&&(n=-n),n=t+n):(e&s)>0?n=t:n=t+A.view.readInt16(),n}parse(A,e,t){A.view.seek(e);const i=this.numberOfContours=A.view.readInt16();if(this.xMin=A.view.readInt16(),this.yMin=A.view.readInt16(),this.xMax=A.view.readInt16(),this.yMax=A.view.readInt16(),i>0){const o=this.endPointIndices=[];for(let C=0;C<i;C++)o.push(A.view.readUint16());const a=this.instructionLength=A.view.readUint16();Ki(a<5e3,`Bad instructionLength:${a}`);const l=this.instructions=[];for(let C=0;C<a;++C)l.push(A.view.readUint8());const h=A.view.byteOffset,c=o[o.length-1]+1;Ki(c<2e4,`Bad numberOfCoordinates:${h}`);const f=[];let I,d=0;for(;d<c;)if(I=A.view.readUint8(),f.push(I),d++,I&8&&d<c){const C=A.view.readUint8();for(let p=0;p<C;p++)f.push(I),d++}if(Ki(f.length===c,`Bad flags length: ${f.length}, numberOfCoordinates: ${c}`),o.length>0){const C=[];let p;if(c>0){for(let w=0;w<c;w+=1)I=f[w],p={},p.onCurve=!!(I&1),p.lastPointOfContour=o.includes(w),C.push(p);let S=0;for(let w=0;w<c;w+=1)I=f[w],p=C[w],p.x=this._parseGlyphCoordinate(A,I,S,2,16),S=p.x;let P=0;for(let w=0;w<c;w+=1)I=f[w],p=C[w],p.y=this._parseGlyphCoordinate(A,I,P,4,32),P=p.y}this.points=C}else this.points=[]}else if(i===0)this.points=[];else{this.isComposite=!0,this.points=[],this.components=[];let o,a=!0;for(;a;){o=A.view.readUint16();const l={glyphIndex:A.view.readUint16(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(o&1)>0?(o&2)>0?(l.dx=A.view.readInt16(),l.dy=A.view.readInt16()):l.matchedPoints=[A.view.readUint16(),A.view.readUint16()]:(o&2)>0?(l.dx=A.view.readInt8(),l.dy=A.view.readInt8()):l.matchedPoints=[A.view.readUint8(),A.view.readUint8()],(o&8)>0?l.xScale=l.yScale=A.view.readInt16()/16384:(o&64)>0?(l.xScale=A.view.readInt16()/16384,l.yScale=A.view.readInt16()/16384):(o&128)>0&&(l.xScale=A.view.readInt16()/16384,l.scale01=A.view.readInt16()/16384,l.scale10=A.view.readInt16()/16384,l.yScale=A.view.readInt16()/16384),this.components.push(l),a=!!(o&32)}if(o&256){this.instructionLength=A.view.readUint16(),this.instructions=[];for(let l=0;l<this.instructionLength;l+=1)this.instructions.push(A.view.readUint8())}}if(this.isComposite)for(let o=0;o<this.components.length;o+=1){const a=this.components[o],l=t.get(a.glyphIndex);if(l.getPathCommands(),l.points){let h;if(a.matchedPoints===void 0)h=this._transformPoints(l.points,a);else{Ki(a.matchedPoints[0]>this.points.length-1||a.matchedPoints[1]>l.points.length-1,`Matched points out of range in ${this.name}`);const c=this.points[a.matchedPoints[0]];let f=l.points[a.matchedPoints[1]];const I={xScale:a.xScale,scale01:a.scale01,scale10:a.scale10,yScale:a.yScale,dx:0,dy:0};f=this._transformPoints([f],I)[0],I.dx=c.x-f.x,I.dy=c.y-f.y,h=this._transformPoints(l.points,I)}this.points=this.points.concat(h)}}const s=[],n=this._parseContours(this.points);for(let o=0,a=n.length;o<a;++o){const l=n[o];let h=l[l.length-1],c=l[0];h.onCurve?s.push({type:"M",x:h.x,y:h.y}):c.onCurve?s.push({type:"M",x:c.x,y:c.y}):s.push({type:"M",x:(h.x+c.x)*.5,y:(h.y+c.y)*.5});for(let f=0,I=l.length;f<I;++f)if(h=c,c=l[(f+1)%I],h.onCurve)s.push({type:"L",x:h.x,y:h.y});else{let d=c;c.onCurve||(d={x:(h.x+c.x)*.5,y:(h.y+c.y)*.5}),s.push({type:"Q",x1:h.x,y1:h.y,x:d.x,y:d.y})}s.push({type:"Z"})}this.pathCommands=s}}class yd extends bn{get length(){return this._sfnt.loca.locations.length}_get(A){const e=this._sfnt.loca.locations,t=e[A],i=new Qd({index:A});return t!==e[A+1]&&i.parse(this._sfnt.glyf,t,this),i}}var md=Object.getOwnPropertyDescriptor,wd=(r,A,e,t)=>{for(var i=t>1?void 0:t?md(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let Gr=class extends Ze{constructor(){super(...arguments);u(this,"_glyphs")}static from(A){const e=A.reduce((i,s)=>i+s.byteLength,0),t=new Gr(new ArrayBuffer(e));return A.forEach(i=>{t.view.writeBytes(i)}),t}get glyphs(){return this._glyphs??(this._glyphs=new yd(this._sfnt))}};Gr=wd([Ye("glyf")],Gr);var vd=Object.getOwnPropertyDescriptor,_d=(r,A,e,t)=>{for(var i=t>1?void 0:t?vd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let Nn=class extends Ze{};Nn=_d([Ye("GPOS","gpos")],Nn);var bd=Object.defineProperty,Dd=Object.getOwnPropertyDescriptor,RA=(r,A,e,t)=>{for(var i=t>1?void 0:t?Dd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&bd(A,e,i),i};let $t=class extends Ze{};RA([y("uint16")],$t.prototype,"majorVersion",2),RA([y("uint16")],$t.prototype,"minorVersion",2),RA([y("uint16")],$t.prototype,"scriptListOffset",2),RA([y("uint16")],$t.prototype,"featureListOffset",2),RA([y("uint16")],$t.prototype,"lookupListOffset",2),RA([y("uint16")],$t.prototype,"featureVariationsOffset",2),$t=RA([Ye("GSUB","gsub")],$t);var xd=Object.defineProperty,Sd=Object.getOwnPropertyDescriptor,Te=(r,A,e,t)=>{for(var i=t>1?void 0:t?Sd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&xd(A,e,i),i};let Re=class extends Ze{constructor(r=new ArrayBuffer(54),A){super(r,A,Math.min(54,r.byteLength-(A??0)))}};Te([y("fixed")],Re.prototype,"version",2),Te([y("fixed")],Re.prototype,"fontRevision",2),Te([y("uint32")],Re.prototype,"checkSumAdjustment",2),Te([y("uint32")],Re.prototype,"magickNumber",2),Te([y("uint16")],Re.prototype,"flags",2),Te([y("uint16")],Re.prototype,"unitsPerEm",2),Te([y({type:"longDateTime"})],Re.prototype,"created",2),Te([y({type:"longDateTime"})],Re.prototype,"modified",2),Te([y("int16")],Re.prototype,"xMin",2),Te([y("int16")],Re.prototype,"yMin",2),Te([y("int16")],Re.prototype,"xMax",2),Te([y("int16")],Re.prototype,"yMax",2),Te([y("uint16")],Re.prototype,"macStyle",2),Te([y("uint16")],Re.prototype,"lowestRecPPEM",2),Te([y("int16")],Re.prototype,"fontDirectionHint",2),Te([y("int16")],Re.prototype,"indexToLocFormat",2),Te([y("int16")],Re.prototype,"glyphDataFormat",2),Re=Te([Ye("head")],Re);var Md=Object.defineProperty,Rd=Object.getOwnPropertyDescriptor,nt=(r,A,e,t)=>{for(var i=t>1?void 0:t?Rd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Md(A,e,i),i};let ze=class extends Ze{constructor(r=new ArrayBuffer(36),A){super(r,A,Math.min(36,r.byteLength-(A??0)))}};nt([y("fixed")],ze.prototype,"version",2),nt([y("int16")],ze.prototype,"ascent",2),nt([y("int16")],ze.prototype,"descent",2),nt([y("int16")],ze.prototype,"lineGap",2),nt([y("uint16")],ze.prototype,"advanceWidthMax",2),nt([y("int16")],ze.prototype,"minLeftSideBearing",2),nt([y("int16")],ze.prototype,"minRightSideBearing",2),nt([y("int16")],ze.prototype,"xMaxExtent",2),nt([y("int16")],ze.prototype,"caretSlopeRise",2),nt([y("int16")],ze.prototype,"caretSlopeRun",2),nt([y("int16")],ze.prototype,"caretOffset",2),nt([y({type:"int16",size:4})],ze.prototype,"reserved",2),nt([y("int16")],ze.prototype,"metricDataFormat",2),nt([y("uint16")],ze.prototype,"numOfLongHorMetrics",2),ze=nt([Ye("hhea")],ze);var Pd=Object.getOwnPropertyDescriptor,kd=(r,A,e,t)=>{for(var i=t>1?void 0:t?Pd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let Lr=class extends Ze{constructor(){super(...arguments);u(this,"_metrics")}static from(A){const e=A.length*4,t=new Lr(new ArrayBuffer(e));return A.forEach(i=>{t.view.writeUint16(i.advanceWidth),t.view.writeUint16(i.leftSideBearing)}),t}get metrics(){return this._metrics??(this._metrics=this.readMetrics())}readMetrics(){const A=this._sfnt.maxp.numGlyphs,e=this._sfnt.hhea.numOfLongHorMetrics;let t=0;const i=this.view;return i.seek(0),Array.from({length:A}).map((s,n)=>(n<e&&(t=i.readUint16()),{advanceWidth:t,leftSideBearing:i.readUint16()}))}};Lr=kd([Ye("hmtx")],Lr);var Ud=Object.getOwnPropertyDescriptor,Nd=(r,A,e,t)=>{for(var i=t>1?void 0:t?Ud(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let Fn=class extends Ze{};Fn=Nd([Ye("kern","kern")],Fn);var Fd=Object.getOwnPropertyDescriptor,Td=(r,A,e,t)=>{for(var i=t>1?void 0:t?Fd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let Or=class extends Ze{constructor(){super(...arguments);u(this,"_locations")}static from(A,e=1){const t=A.length*(e?4:2),i=new Or(new ArrayBuffer(t));return A.forEach(s=>{e?i.view.writeUint32(s):i.view.writeUint16(s/2)}),i}get locations(){return this._locations??(this._locations=this.readLocations())}readLocations(){const A=this._sfnt.maxp.numGlyphs,e=this._sfnt.head.indexToLocFormat,t=this.view;return t.seek(0),Array.from({length:A}).map(()=>e?t.readUint32():t.readUint16()*2)}};Or=Td([Ye("loca")],Or);var Gd=Object.defineProperty,Ld=Object.getOwnPropertyDescriptor,$e=(r,A,e,t)=>{for(var i=t>1?void 0:t?Ld(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Gd(A,e,i),i};let Ge=class extends Ze{constructor(r=new ArrayBuffer(32),A){super(r,A,Math.min(32,r.byteLength-(A??0)))}};$e([y("fixed")],Ge.prototype,"version",2),$e([y("uint16")],Ge.prototype,"numGlyphs",2),$e([y("uint16")],Ge.prototype,"maxPoints",2),$e([y("uint16")],Ge.prototype,"maxContours",2),$e([y("uint16")],Ge.prototype,"maxComponentPoints",2),$e([y("uint16")],Ge.prototype,"maxComponentContours",2),$e([y("uint16")],Ge.prototype,"maxZones",2),$e([y("uint16")],Ge.prototype,"maxTwilightPoints",2),$e([y("uint16")],Ge.prototype,"maxStorage",2),$e([y("uint16")],Ge.prototype,"maxFunctionDefs",2),$e([y("uint16")],Ge.prototype,"maxInstructionDefs",2),$e([y("uint16")],Ge.prototype,"maxStackElements",2),$e([y("uint16")],Ge.prototype,"maxSizeOfInstructions",2),$e([y("uint16")],Ge.prototype,"maxComponentElements",2),$e([y("uint16")],Ge.prototype,"maxComponentDepth",2),Ge=$e([Ye("maxp")],Ge);var Od=Object.defineProperty,Hd=Object.getOwnPropertyDescriptor,Hr=(r,A,e,t)=>{for(var i=t>1?void 0:t?Hd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Od(A,e,i),i};const Ul={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"},Tn={Macintosh:1,Microsoft:3},Jd={Default:0},Nl={UCS2:1};let ti=class extends Ze{constructor(){super(...arguments);u(this,"_names")}get names(){return this._names??(this._names=this.readNames())}readNames(){const A=this.count;this.view.seek(6);const e=[];for(let a=0;a<A;++a)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 a=0;a<A;++a){const l=e[a];l.name=this.view.readBytes(t+l.offset,l.length)}let i=Tn.Macintosh,s=Jd.Default,n=0;e.some(a=>a.platform===Tn.Microsoft&&a.encoding===Nl.UCS2&&a.language===1033)&&(i=Tn.Microsoft,s=Nl.UCS2,n=1033);const o={};for(let a=0;a<A;++a){const l=e[a];l.platform===i&&l.encoding===s&&l.language===n&&Ul[l.nameId]&&(o[Ul[l.nameId]]=n===0?Xf(l.name):jf(l.name))}return o}};Hr([y("uint16")],ti.prototype,"format",2),Hr([y("uint16")],ti.prototype,"count",2),Hr([y("uint16")],ti.prototype,"stringOffset",2),ti=Hr([Ye("name")],ti);var Kd=Object.defineProperty,Yd=Object.getOwnPropertyDescriptor,le=(r,A,e,t)=>{for(var i=t>1?void 0:t?Yd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Kd(A,e,i),i};let ae=class extends Ze{get fontPANOSE(){return[this.bFamilyType,this.bSerifStyle,this.bWeight,this.bProportion,this.bContrast,this.bStrokeVariation,this.bArmStyle,this.bLetterform,this.bMidline,this.bXHeight]}};le([y("uint16")],ae.prototype,"version",2),le([y("int16")],ae.prototype,"xAvgCharWidth",2),le([y("uint16")],ae.prototype,"usWeightClass",2),le([y("uint16")],ae.prototype,"usWidthClass",2),le([y("uint16")],ae.prototype,"fsType",2),le([y("uint16")],ae.prototype,"ySubscriptXSize",2),le([y("uint16")],ae.prototype,"ySubscriptYSize",2),le([y("uint16")],ae.prototype,"ySubscriptXOffset",2),le([y("uint16")],ae.prototype,"ySubscriptYOffset",2),le([y("uint16")],ae.prototype,"ySuperscriptXSize",2),le([y("uint16")],ae.prototype,"ySuperscriptYSize",2),le([y("uint16")],ae.prototype,"ySuperscriptXOffset",2),le([y("uint16")],ae.prototype,"ySuperscriptYOffset",2),le([y("uint16")],ae.prototype,"yStrikeoutSize",2),le([y("uint16")],ae.prototype,"yStrikeoutPosition",2),le([y("uint16")],ae.prototype,"sFamilyClass",2),le([y({type:"uint8"})],ae.prototype,"bFamilyType",2),le([y({type:"uint8"})],ae.prototype,"bSerifStyle",2),le([y({type:"uint8"})],ae.prototype,"bWeight",2),le([y({type:"uint8"})],ae.prototype,"bProportion",2),le([y({type:"uint8"})],ae.prototype,"bContrast",2),le([y({type:"uint8"})],ae.prototype,"bStrokeVariation",2),le([y({type:"uint8"})],ae.prototype,"bArmStyle",2),le([y({type:"uint8"})],ae.prototype,"bLetterform",2),le([y({type:"uint8"})],ae.prototype,"bMidline",2),le([y({type:"uint8"})],ae.prototype,"bXHeight",2),le([y({type:"uint8",size:16})],ae.prototype,"ulUnicodeRange",2),le([y({type:"char",size:4})],ae.prototype,"achVendID",2),le([y("uint16")],ae.prototype,"fsSelection",2),le([y("uint16")],ae.prototype,"usFirstCharIndex",2),le([y("uint16")],ae.prototype,"usLastCharIndex",2),le([y("int16")],ae.prototype,"sTypoAscender",2),le([y("int16")],ae.prototype,"sTypoDescender",2),le([y("int16")],ae.prototype,"sTypoLineGap",2),le([y("uint16")],ae.prototype,"usWinAscent",2),le([y("uint16")],ae.prototype,"usWinDescent",2),le([y({offset:72,type:"uint8",size:8})],ae.prototype,"ulCodePageRange",2),le([y({offset:72,type:"int16"})],ae.prototype,"sxHeight",2),le([y("int16")],ae.prototype,"sCapHeight",2),le([y("uint16")],ae.prototype,"usDefaultChar",2),le([y("uint16")],ae.prototype,"usBreakChar",2),le([y("uint16")],ae.prototype,"usMaxContext",2),ae=le([Ye("OS/2","os2")],ae);var zd=Object.defineProperty,Wd=Object.getOwnPropertyDescriptor,Ft=(r,A,e,t)=>{for(var i=t>1?void 0:t?Wd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&zd(A,e,i),i};let Ct=class extends Ze{constructor(r=new ArrayBuffer(32),A,e){super(r,A,e)}};Ft([y("fixed")],Ct.prototype,"format",2),Ft([y("fixed")],Ct.prototype,"italicAngle",2),Ft([y("int16")],Ct.prototype,"underlinePosition",2),Ft([y("int16")],Ct.prototype,"underlineThickness",2),Ft([y("uint32")],Ct.prototype,"isFixedPitch",2),Ft([y("uint32")],Ct.prototype,"minMemType42",2),Ft([y("uint32")],Ct.prototype,"maxMemType42",2),Ft([y("uint32")],Ct.prototype,"minMemType1",2),Ft([y("uint32")],Ct.prototype,"maxMemType1",2),Ct=Ft([Ye("post")],Ct);var Vd=Object.defineProperty,qd=Object.getOwnPropertyDescriptor,ot=(r,A,e,t)=>{for(var i=t>1?void 0:t?qd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Vd(A,e,i),i};let We=class extends Ze{constructor(r=new ArrayBuffer(36),A){super(r,A,Math.min(36,r.byteLength-(A??0)))}};ot([y("fixed")],We.prototype,"version",2),ot([y("int16")],We.prototype,"vertTypoAscender",2),ot([y("int16")],We.prototype,"vertTypoDescender",2),ot([y("int16")],We.prototype,"vertTypoLineGap",2),ot([y("int16")],We.prototype,"advanceHeightMax",2),ot([y("int16")],We.prototype,"minTopSideBearing",2),ot([y("int16")],We.prototype,"minBottomSideBearing",2),ot([y("int16")],We.prototype,"yMaxExtent",2),ot([y("int16")],We.prototype,"caretSlopeRise",2),ot([y("int16")],We.prototype,"caretSlopeRun",2),ot([y("int16")],We.prototype,"caretOffset",2),ot([y({type:"int16",size:4})],We.prototype,"reserved",2),ot([y("int16")],We.prototype,"metricDataFormat",2),ot([y("int16")],We.prototype,"numOfLongVerMetrics",2),We=ot([Ye("vhea")],We);var Xd=Object.getOwnPropertyDescriptor,jd=(r,A,e,t)=>{for(var i=t>1?void 0:t?Xd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let Jr=class extends Ze{constructor(){super(...arguments);u(this,"_metrics")}static from(A){const e=A.length*4,t=new Jr(new ArrayBuffer(e));return A.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 A=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:A}).map((n,o)=>(o<e&&(i=t.readUint16()),{advanceHeight:i,topSideBearing:t.readUint8()}))}};Jr=jd([Ye("vmtx")],Jr);var Zd=Object.defineProperty,Zi=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Zd(A,e,i),i};class Qt extends Rr{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(jA(e).getUint32(0))}static checksum(e){const t=jA(e);let i=t.byteLength;for(;i%4;)i++;let s=0;for(let n=0,o=i/4;n<o;n+=4)n*4<i-4&&(s+=t.getUint32(n*4,!1));return s&4294967295}static from(e){const t=f=>f+3&-4,i=e.tableViews.size,s=Array.from(e.tableViews.values()).reduce((f,I)=>f+t(I.byteLength),0),n=new this(new ArrayBuffer(12+i*16+s));n.scalerType=65536,n.numTables=i;const o=Math.log(2);n.searchRange=Math.floor(Math.log(i)/o)*16,n.entrySelector=Math.floor(n.searchRange/o),n.rangeShift=i*16-n.searchRange;let a=12+i*16,l=0;const h=n.getDirectories();e.tableViews.forEach((f,I)=>{const d=h[l++];d.tag=I,d.checkSum=this.checksum(f),d.offset=a,d.length=f.byteLength,n.view.writeBytes(f,a),a+=t(d.length)});const c=n.createSFNT().head;return c.checkSumAdjustment=0,c.checkSumAdjustment=2981146554-this.checksum(n.view),n}getDirectories(){let e=this.view.byteOffset+12;return Array.from({length:this.numTables},()=>{const t=new ZA(this.view.buffer,e);return e+=t.view.byteLength,t})}createSFNT(){return new DA(this.getDirectories().reduce((e,t)=>(e[t.tag]=new DataView(this.view.buffer,this.view.byteOffset+t.offset,t.length),e),{}))}}u(Qt,"signature",new Set([65536,1953658213,1954115633])),Zi([y("uint32")],Qt.prototype,"scalerType"),Zi([y("uint16")],Qt.prototype,"numTables"),Zi([y("uint16")],Qt.prototype,"searchRange"),Zi([y("uint16")],Qt.prototype,"entrySelector"),Zi([y("uint16")],Qt.prototype,"rangeShift");class Kr extends Qt{constructor(){super(...arguments);u(this,"format","OpenType");u(this,"mimeType","font/otf")}static from(e){return super.from(e)}}u(Kr,"signature",new Set([1330926671]));var $d=Object.defineProperty,$i=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&$d(A,e,i),i};class PA extends ft{constructor(A,e){super(A,e,20)}}$i([y({type:"char",size:4})],PA.prototype,"tag"),$i([y("uint32")],PA.prototype,"offset"),$i([y("uint32")],PA.prototype,"compLength"),$i([y("uint32")],PA.prototype,"origLength"),$i([y("uint32")],PA.prototype,"origChecksum");var eI=Object.defineProperty,dt=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&eI(A,e,i),i};const ct=(EA=class extends Rr{constructor(){super(...arguments);u(this,"format","WOFF");u(this,"mimeType","font/woff");u(this,"_sfnt")}get subfontFormat(){return Qt.is(this.flavor)?"TrueType":Kr.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(jA(e).getUint32(0))}static checkSum(e){const t=jA(e),i=t.byteLength,s=Math.floor(i/4);let n=0,o=0;for(;o<s;)n+=t.getUint32(4*o++,!1);let a=i-s*4;if(a){let l=s*4;for(;a>0;)n+=t.getUint8(l)<<a*8,l++,a--}return n%4294967296}static from(e,t=new ArrayBuffer(0)){const i=f=>f+3&-4,s=[];e.tableViews.forEach((f,I)=>{const d=jA(Jf(new Uint8Array(f.buffer,f.byteOffset,f.byteLength)));s.push({tag:I,view:d.byteLength<f.byteLength?d:f,rawView:f})});const n=s.length,o=s.reduce((f,I)=>f+i(I.view.byteLength),0),a=new EA(new ArrayBuffer(44+20*n+o+t.byteLength));a.signature=2001684038,a.flavor=65536,a.length=a.view.byteLength,a.numTables=n,a.totalSFNTSize=12+16*n+s.reduce((f,I)=>f+i(I.rawView.byteLength),0);let l=44+n*20,h=0;const c=a.getDirectories();return s.forEach(f=>{const I=c[h++];I.tag=f.tag,I.offset=l,I.compLength=f.view.byteLength,I.origChecksum=EA.checkSum(f.rawView),I.origLength=f.rawView.byteLength,a.view.writeBytes(f.view,l),l+=i(I.compLength)}),a.view.writeBytes(t),a}getDirectories(){let e=44;return Array.from({length:this.numTables},()=>{const t=new PA(this.view.buffer,e);return e+=t.view.byteLength,t})}createSFNT(){return new DA(this.getDirectories().reduce((e,t)=>{const i=t.tag,s=this.view.byteOffset+t.offset,n=t.compLength,o=t.origLength,a=s+n;return e[i]=n>=o?new DataView(this.view.buffer,s,n):new DataView(Kf(new Uint8Array(this.view.buffer.slice(s,a))).buffer),e},{}))}},u(EA,"signature",new Set([2001684038])),EA);dt([y("uint32")],ct.prototype,"signature"),dt([y("uint32")],ct.prototype,"flavor"),dt([y("uint32")],ct.prototype,"length"),dt([y("uint16")],ct.prototype,"numTables"),dt([y("uint16")],ct.prototype,"reserved"),dt([y("uint32")],ct.prototype,"totalSFNTSize"),dt([y("uint16")],ct.prototype,"majorVersion"),dt([y("uint16")],ct.prototype,"minorVersion"),dt([y("uint32")],ct.prototype,"metaOffset"),dt([y("uint32")],ct.prototype,"metaLength"),dt([y("uint32")],ct.prototype,"metaOrigLength"),dt([y("uint32")],ct.prototype,"privOffset"),dt([y("uint32")],ct.prototype,"privLength");let Yr=ct;function Fl(r,A=!0){if(Qt.is(r))return new Qt(r);if(Kr.is(r))return new Kr(r);if(Yr.is(r))return new Yr(r);if(A)throw new Error("Failed to parseFont")}function Tl(r,A=!0){const e=Fl(r,!1);if(e)return e;if(A)throw new Error("Failed to parseFont")}const os=class os{constructor(){u(this,"fallbackFont");u(this,"loading",new Map);u(this,"loaded",new Map);u(this,"familyToUrl",new Map)}setFallbackFont(A){this.fallbackFont=A}async loadFallbackFont(A,e={}){this.fallbackFont=await this.load(A,e)}_createRequest(A,e){const t=new AbortController;return{url:A,when:fetch(A,{...os.defaultRequestInit,...e,signal:t.signal}).then(i=>i.arrayBuffer()),cancel:()=>t.abort()}}injectFontFace(A,e){return document.fonts.add(new FontFace(A,e)),this}injectStyleTag(A,e){const t=document.createElement("style");return t.appendChild(document.createTextNode(`@font-face {
|
|
857
|
+
}`})),Ti([M()],g.ZoomBlurEffect.prototype,"center",2),Ti([M({default:20})],g.ZoomBlurEffect.prototype,"innerRadius",2),Ti([M({default:-1})],g.ZoomBlurEffect.prototype,"radius",2),Ti([M({default:.1})],g.ZoomBlurEffect.prototype,"strength",2),g.ZoomBlurEffect=Ti([ne("ZoomBlurEffect")],g.ZoomBlurEffect);var mf=Object.defineProperty,Ut=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&mf(A,e,i),i};class it extends rA{constructor(e){super();u(this,"_texture");this.parent=e}_setProperties(e){return super.setProperties(e)}setProperties(e){return this._setProperties(he(e)?void 0:yA(e))}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"color":case"cropRect":case"stretchRect":case"dpi":case"rotateWithShape":case"tile":case"opacity":this.parent.requestRedraw();break;case"image":case"linearGradient":case"radialGradient":this._updateTexture();break}}async loadTexture(){return this.linearGradient||this.radialGradient?new Er(this.linearGradient??this.radialGradient,this.parent.size.width,this.parent.size.height):he(this.image)?void 0:await Lt.texture.load(this.image)}async _updateTexture(){this._texture=await this.loadTexture(),this.parent.requestRedraw()}canDraw(){return!!(this._texture||this.color)}_getDrawOptions(){let e=!1;const{width:t,height:i}=this.parent.size,s=new Bt().scale(1/t,1/i);if(this.cropRect){const{left:n=0,top:o=0,right:a=0,bottom:l=0}=this.cropRect;s.scale(Math.abs(1-(n+a)),Math.abs(1-(o+l))).translate(n,o),e=!0}if(this.tile){const{translateX:n=0,translateY:o=0,scaleX:a=1,scaleY:l=1}=this.tile;s.translate(-n/t,-o/i).scale(1/a,1/l),e=!0}else if(this.stretchRect){const{left:n=0,top:o=0,right:a=0,bottom:l=0}=this.stretchRect;s.scale(Math.abs(1-(-n+-a)),Math.abs(1-(-o+-l))).translate(-n,-o),e=!0}return{disableWrapMode:e,textureTransform:s}}draw(){const e=this.parent.context,{textureTransform:t,disableWrapMode:i}=this._getDrawOptions();e.textureTransform=t,e.fillStyle=this._texture??this.color,e.fill({disableWrapMode:i})}}Ut([M()],it.prototype,"color"),Ut([M()],it.prototype,"image"),Ut([M()],it.prototype,"linearGradient"),Ut([M()],it.prototype,"radialGradient"),Ut([M()],it.prototype,"cropRect"),Ut([M()],it.prototype,"stretchRect"),Ut([M()],it.prototype,"dpi"),Ut([M()],it.prototype,"rotateWithShape"),Ut([M()],it.prototype,"tile"),Ut([M()],it.prototype,"opacity");var wf=Object.defineProperty,vf=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&wf(A,e,i),i};class un extends it{setProperties(A){return super._setProperties(he(A)?void 0:Ec(A))}}vf([M()],un.prototype,"fillWithShape");var _f=Object.defineProperty,bf=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&_f(A,e,i),i};class fn extends it{setProperties(A){return super._setProperties(he(A)?void 0:Cc(A))}}bf([M()],fn.prototype,"fillWithShape");var Df=Object.defineProperty,dn=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Df(A,e,i),i};class Gi extends it{setProperties(A){return super._setProperties(he(A)?void 0:Qc(A))}_updateProperty(A,e,t,i){switch(super._updateProperty(A,e,t,i),A){case"width":case"style":this.parent.requestRedraw();break}}canDraw(){return!!(this.width||super.canDraw())}draw(){const A=this.parent.context,{textureTransform:e,disableWrapMode:t}=this._getDrawOptions();A.lineWidth=this.width,A.textureTransform=e,A.strokeStyle=this._texture??this.color,A.stroke({disableWrapMode:t})}}dn([M({default:0})],Gi.prototype,"color"),dn([M({default:0})],Gi.prototype,"width"),dn([M({default:"solid"})],Gi.prototype,"style");var xf=Object.defineProperty,br=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&xf(A,e,i),i};class VA extends rA{constructor(A){super(),this.parent=A}setProperties(A){return super.setProperties(he(A)?void 0:yc(A))}_updateProperty(A,e,t,i){switch(super._updateProperty(A,e,t,i),A){case"color":case"blur":case"offsetX":case"offsetY":this.updateEffect();break}}updateEffect(){const A="__$shadow";let e=this.parent.getNode(A);this.blur||this.offsetX||this.offsetY?(e||(e=new g.DropShadowEffect({name:A}),this.parent.appendChild(e,"back")),e.setProperties(this.getProperties())):e&&this.parent.removeChild(e)}}br([M({default:"#000000"})],VA.prototype,"color"),br([M({default:0})],VA.prototype,"blur"),br([M({default:0})],VA.prototype,"offsetY"),br([M({default:0})],VA.prototype,"offsetX");var Sf=Object.defineProperty,Dr=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Sf(A,e,i),i};class qA extends rA{constructor(e){super();u(this,"_path2DSet",new nA);this.parent=e,this._updatePath2DSet()}setProperties(e){return super.setProperties(he(e)?void 0:wc(e))}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"svg":case"data":case"viewBox":this._updatePath2DSet(),this.parent.requestRedraw();break}}_updatePath2DSet(){var o;let e;if(this.svg){const a=on(this.svg);this._path2DSet=ln(a),e=this._path2DSet.viewBox??this.viewBox}else e=this.viewBox,(o=this.data)==null||o.forEach((a,l)=>{const{data:h,...c}=a,f=new Ne;f.style=c,f.addData(h),this._path2DSet.paths[l]=f});const[t,i,s,n]=e;this._path2DSet.paths.forEach(a=>{a.applyTransform(new Ke().translate(-t,-i).scale(1/s,1/n))})}draw(){if(this._path2DSet.paths.length){const e=this.parent.context,{width:t,height:i}=this.parent.size;this._path2DSet.paths.forEach(s=>{e.addPath(s.clone().applyTransform(new Ke().scale(t,i)))})}else this.drawRect()}drawRect(){const e=this.parent.context,{width:t,height:i}=this.parent.size,{borderRadius:s}=this.parent.style;t&&i&&(s?e.roundRect(0,0,t,i,s):e.rect(0,0,t,i))}}Dr([M()],qA.prototype,"preset"),Dr([M()],qA.prototype,"svg"),Dr([M({default:[0,0,1,1]})],qA.prototype,"viewBox"),Dr([M({default:[]})],qA.prototype,"data");class Li extends zt{constructor(A){super(),this.setProperties(A)}}const XA=Yo();delete XA.top,delete XA.left,delete XA.width,delete XA.height;for(const r in XA)Qi(Li,r,{default:XA[r]});var qe=Uint8Array,ut=Uint16Array,In=Int32Array,xr=new qe([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]),Sr=new qe([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]),pn=new qe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Bl=function(r,A){for(var e=new ut(31),t=0;t<31;++t)e[t]=A+=1<<r[t-1];for(var i=new In(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}},El=Bl(xr,2),Cl=El.b,Bn=El.r;Cl[28]=258,Bn[258]=28;for(var Ql=Bl(Sr,0),Mf=Ql.b,yl=Ql.r,En=new ut(32768),Qe=0;Qe<32768;++Qe){var lA=(Qe&43690)>>1|(Qe&21845)<<1;lA=(lA&52428)>>2|(lA&13107)<<2,lA=(lA&61680)>>4|(lA&3855)<<4,En[Qe]=((lA&65280)>>8|(lA&255)<<8)>>1}for(var Nt=function(r,A,e){for(var t=r.length,i=0,s=new ut(A);i<t;++i)r[i]&&++s[r[i]-1];var n=new ut(A);for(i=1;i<A;++i)n[i]=n[i-1]+s[i-1]<<1;var o;if(e){o=new ut(1<<A);var a=15-A;for(i=0;i<t;++i)if(r[i])for(var l=i<<4|r[i],h=A-r[i],c=n[r[i]-1]++<<h,f=c|(1<<h)-1;c<=f;++c)o[En[c]>>a]=l}else for(o=new ut(t),i=0;i<t;++i)r[i]&&(o[i]=En[n[r[i]-1]++]>>15-r[i]);return o},hA=new qe(288),Qe=0;Qe<144;++Qe)hA[Qe]=8;for(var Qe=144;Qe<256;++Qe)hA[Qe]=9;for(var Qe=256;Qe<280;++Qe)hA[Qe]=7;for(var Qe=280;Qe<288;++Qe)hA[Qe]=8;for(var Oi=new qe(32),Qe=0;Qe<32;++Qe)Oi[Qe]=5;var Rf=Nt(hA,9,0),Pf=Nt(hA,9,1),kf=Nt(Oi,5,0),Uf=Nt(Oi,5,1),Cn=function(r){for(var A=r[0],e=1;e<r.length;++e)r[e]>A&&(A=r[e]);return A},vt=function(r,A,e){var t=A/8|0;return(r[t]|r[t+1]<<8)>>(A&7)&e},Qn=function(r,A){var e=A/8|0;return(r[e]|r[e+1]<<8|r[e+2]<<16)>>(A&7)},yn=function(r){return(r+7)/8|0},ml=function(r,A,e){return(e==null||e>r.length)&&(e=r.length),new qe(r.subarray(A,e))},Nf=["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"],_t=function(r,A,e){var t=new Error(A||Nf[r]);if(t.code=r,Error.captureStackTrace&&Error.captureStackTrace(t,_t),!e)throw t;return t},Ff=function(r,A,e,t){var i=r.length,s=0;if(!i||A.f&&!A.l)return e||new qe(0);var n=!e,o=n||A.i!=2,a=A.i;n&&(e=new qe(i*3));var l=function(He){var ge=e.length;if(He>ge){var we=new qe(Math.max(ge*2,He));we.set(e),e=we}},h=A.f||0,c=A.p||0,f=A.b||0,I=A.l,d=A.d,C=A.m,p=A.n,S=i*8;do{if(!I){h=vt(r,c,1);var P=vt(r,c+1,3);if(c+=3,P)if(P==1)I=Pf,d=Uf,C=9,p=5;else if(P==2){var m=vt(r,c,31)+257,b=vt(r,c+10,15)+4,D=m+vt(r,c+5,31)+1;c+=14;for(var z=new qe(D),Ae=new qe(19),V=0;V<b;++V)Ae[pn[V]]=vt(r,c+V*3,7);c+=b*3;for(var K=Cn(Ae),te=(1<<K)-1,W=Nt(Ae,K,1),V=0;V<D;){var L=W[vt(r,c,te)];c+=L&15;var w=L>>4;if(w<16)z[V++]=w;else{var se=0,H=0;for(w==16?(H=3+vt(r,c,3),c+=2,se=z[V-1]):w==17?(H=3+vt(r,c,7),c+=3):w==18&&(H=11+vt(r,c,127),c+=7);H--;)z[V++]=se}}var q=z.subarray(0,m),ie=z.subarray(m);C=Cn(q),p=Cn(ie),I=Nt(q,C,1),d=Nt(ie,p,1)}else _t(1);else{var w=yn(c)+4,R=r[w-4]|r[w-3]<<8,_=w+R;if(_>i){a&&_t(0);break}o&&l(f+R),e.set(r.subarray(w,_),f),A.b=f+=R,A.p=c=_*8,A.f=h;continue}if(c>S){a&&_t(0);break}}o&&l(f+131072);for(var J=(1<<C)-1,$=(1<<p)-1,N=c;;N=c){var se=I[Qn(r,c)&J],U=se>>4;if(c+=se&15,c>S){a&&_t(0);break}if(se||_t(2),U<256)e[f++]=U;else if(U==256){N=c,I=null;break}else{var X=U-254;if(U>264){var V=U-257,ee=xr[V];X=vt(r,c,(1<<ee)-1)+Cl[V],c+=ee}var oe=d[Qn(r,c)&$],j=oe>>4;oe||_t(3),c+=oe&15;var ie=Mf[j];if(j>3){var ee=Sr[j];ie+=Qn(r,c)&(1<<ee)-1,c+=ee}if(c>S){a&&_t(0);break}o&&l(f+131072);var pe=f+X;if(f<ie){var at=s-ie,lt=Math.min(ie,pe);for(at+f<0&&_t(3);f<lt;++f)e[f]=t[at+f]}for(;f<pe;++f)e[f]=e[f-ie]}}A.l=I,A.p=N,A.b=f,A.f=h,I&&(h=1,A.m=C,A.d=d,A.n=p)}while(!h);return f!=e.length&&n?ml(e,0,f):e.subarray(0,f)},Zt=function(r,A,e){e<<=A&7;var t=A/8|0;r[t]|=e,r[t+1]|=e>>8},Hi=function(r,A,e){e<<=A&7;var t=A/8|0;r[t]|=e,r[t+1]|=e>>8,r[t+2]|=e>>16},mn=function(r,A){for(var e=[],t=0;t<r.length;++t)r[t]&&e.push({s:t,f:r[t]});var i=e.length,s=e.slice();if(!i)return{t:bl,l:0};if(i==1){var n=new qe(e[0].s+1);return n[e[0].s]=1,{t:n,l:1}}e.sort(function(_,m){return _.f-m.f}),e.push({s:-1,f:25001});var o=e[0],a=e[1],l=0,h=1,c=2;for(e[0]={s:-1,f:o.f+a.f,l:o,r:a};h!=i-1;)o=e[e[l].f<e[c].f?l++:c++],a=e[l!=h&&e[l].f<e[c].f?l++:c++],e[h++]={s:-1,f:o.f+a.f,l:o,r:a};for(var f=s[0].s,t=1;t<i;++t)s[t].s>f&&(f=s[t].s);var I=new ut(f+1),d=wn(e[h-1],I,0);if(d>A){var t=0,C=0,p=d-A,S=1<<p;for(s.sort(function(m,b){return I[b.s]-I[m.s]||m.f-b.f});t<i;++t){var P=s[t].s;if(I[P]>A)C+=S-(1<<d-I[P]),I[P]=A;else break}for(C>>=p;C>0;){var w=s[t].s;I[w]<A?C-=1<<A-I[w]++-1:++t}for(;t>=0&&C;--t){var R=s[t].s;I[R]==A&&(--I[R],++C)}d=A}return{t:new qe(I),l:d}},wn=function(r,A,e){return r.s==-1?Math.max(wn(r.l,A,e+1),wn(r.r,A,e+1)):A[r.s]=e},wl=function(r){for(var A=r.length;A&&!r[--A];);for(var e=new ut(++A),t=0,i=r[0],s=1,n=function(a){e[t++]=a},o=1;o<=A;++o)if(r[o]==i&&o!=A)++s;else{if(!i&&s>2){for(;s>138;s-=138)n(32754);s>2&&(n(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(n(i),--s;s>6;s-=6)n(8304);s>2&&(n(s-3<<5|8208),s=0)}for(;s--;)n(i);s=1,i=r[o]}return{c:e.subarray(0,t),n:A}},Ji=function(r,A){for(var e=0,t=0;t<A.length;++t)e+=r[t]*A[t];return e},vl=function(r,A,e){var t=e.length,i=yn(A+2);r[i]=t&255,r[i+1]=t>>8,r[i+2]=r[i]^255,r[i+3]=r[i+1]^255;for(var s=0;s<t;++s)r[i+s+4]=e[s];return(i+4+t)*8},_l=function(r,A,e,t,i,s,n,o,a,l,h){Zt(A,h++,e),++i[256];for(var c=mn(i,15),f=c.t,I=c.l,d=mn(s,15),C=d.t,p=d.l,S=wl(f),P=S.c,w=S.n,R=wl(C),_=R.c,m=R.n,b=new ut(19),D=0;D<P.length;++D)++b[P[D]&31];for(var D=0;D<_.length;++D)++b[_[D]&31];for(var z=mn(b,7),Ae=z.t,V=z.l,K=19;K>4&&!Ae[pn[K-1]];--K);var te=l+5<<3,W=Ji(i,hA)+Ji(s,Oi)+n,L=Ji(i,f)+Ji(s,C)+n+14+3*K+Ji(b,Ae)+2*b[16]+3*b[17]+7*b[18];if(a>=0&&te<=W&&te<=L)return vl(A,h,r.subarray(a,a+l));var se,H,q,ie;if(Zt(A,h,1+(L<W)),h+=2,L<W){se=Nt(f,I,0),H=f,q=Nt(C,p,0),ie=C;var J=Nt(Ae,V,0);Zt(A,h,w-257),Zt(A,h+5,m-1),Zt(A,h+10,K-4),h+=14;for(var D=0;D<K;++D)Zt(A,h+3*D,Ae[pn[D]]);h+=3*K;for(var $=[P,_],N=0;N<2;++N)for(var U=$[N],D=0;D<U.length;++D){var X=U[D]&31;Zt(A,h,J[X]),h+=Ae[X],X>15&&(Zt(A,h,U[D]>>5&127),h+=U[D]>>12)}}else se=Rf,H=hA,q=kf,ie=Oi;for(var D=0;D<o;++D){var ee=t[D];if(ee>255){var X=ee>>18&31;Hi(A,h,se[X+257]),h+=H[X+257],X>7&&(Zt(A,h,ee>>23&31),h+=xr[X]);var oe=ee&31;Hi(A,h,q[oe]),h+=ie[oe],oe>3&&(Hi(A,h,ee>>5&8191),h+=Sr[oe])}else Hi(A,h,se[ee]),h+=H[ee]}return Hi(A,h,se[256]),h+H[256]},Tf=new In([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bl=new qe(0),Gf=function(r,A,e,t,i,s){var n=s.z||r.length,o=new qe(t+n+5*(1+Math.ceil(n/7e3))+i),a=o.subarray(t,o.length-i),l=s.l,h=(s.r||0)&7;if(A){h&&(a[0]=s.r>>3);for(var c=Tf[A-1],f=c>>13,I=c&8191,d=(1<<e)-1,C=s.p||new ut(32768),p=s.h||new ut(d+1),S=Math.ceil(e/3),P=2*S,w=function(Je){return(r[Je]^r[Je+1]<<S^r[Je+2]<<P)&d},R=new In(25e3),_=new ut(288),m=new ut(32),b=0,D=0,z=s.i||0,Ae=0,V=s.w||0,K=0;z+2<n;++z){var te=w(z),W=z&32767,L=p[te];if(C[W]=L,p[te]=W,V<=z){var se=n-z;if((b>7e3||Ae>24576)&&(se>423||!l)){h=_l(r,a,0,R,_,m,D,Ae,K,z-K,h),Ae=b=D=0,K=z;for(var H=0;H<286;++H)_[H]=0;for(var H=0;H<30;++H)m[H]=0}var q=2,ie=0,J=I,$=W-L&32767;if(se>2&&te==w(z-$))for(var N=Math.min(f,se)-1,U=Math.min(32767,z),X=Math.min(258,se);$<=U&&--J&&W!=L;){if(r[z+q]==r[z+q-$]){for(var ee=0;ee<X&&r[z+ee]==r[z+ee-$];++ee);if(ee>q){if(q=ee,ie=$,ee>N)break;for(var oe=Math.min($,ee-2),j=0,H=0;H<oe;++H){var pe=z-$+H&32767,at=C[pe],lt=pe-at&32767;lt>j&&(j=lt,L=pe)}}}W=L,L=C[W],$+=W-L&32767}if(ie){R[Ae++]=268435456|Bn[q]<<18|yl[ie];var He=Bn[q]&31,ge=yl[ie]&31;D+=xr[He]+Sr[ge],++_[257+He],++m[ge],V=z+q,++b}else R[Ae++]=r[z],++_[r[z]]}}for(z=Math.max(z,V);z<n;++z)R[Ae++]=r[z],++_[r[z]];h=_l(r,a,l,R,_,m,D,Ae,K,z-K,h),l||(s.r=h&7|a[h/8|0]<<3,h-=7,s.h=p,s.p=C,s.i=z,s.w=V)}else{for(var z=s.w||0;z<n+l;z+=65535){var we=z+65535;we>=n&&(a[h/8|0]=l,we=n),h=vl(a,h+1,r.subarray(z,we))}s.i=n}return ml(o,0,t+yn(h)+i)},Dl=function(){var r=1,A=0;return{p:function(e){for(var t=r,i=A,s=e.length|0,n=0;n!=s;){for(var o=Math.min(n+2655,s);n<o;++n)i+=t+=e[n];t=(t&65535)+15*(t>>16),i=(i&65535)+15*(i>>16)}r=t,A=i},d:function(){return r%=65521,A%=65521,(r&255)<<24|(r&65280)<<8|(A&255)<<8|A>>8}}},Lf=function(r,A,e,t,i){if(!i&&(i={l:1},A.dictionary)){var s=A.dictionary.subarray(-32768),n=new qe(s.length+r.length);n.set(s),n.set(r,s.length),r=n,i.w=s.length}return Gf(r,A.level==null?6:A.level,A.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+A.mem,e,t,i)},xl=function(r,A,e){for(;e;++A)r[A]=e,e>>>=8},Of=function(r,A){var e=A.level,t=e==0?0:e<6?1:e==9?3:2;if(r[0]=120,r[1]=t<<6|(A.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,A.dictionary){var i=Dl();i.p(A.dictionary),xl(r,2,i.d())}},Hf=function(r,A){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&_t(6,"invalid zlib data"),(r[1]>>5&1)==1&&_t(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function Jf(r,A){A||(A={});var e=Dl();e.p(r);var t=Lf(r,A,A.dictionary?6:2,4);return Of(t,A),xl(t,t.length-4,e.d()),t}function Kf(r,A){return Ff(r.subarray(Hf(r),-4),{i:2},A,A)}var Yf=typeof TextDecoder<"u"&&new TextDecoder,zf=0;try{Yf.decode(bl,{stream:!0}),zf=1}catch{}const Wf="modern-font";function Ki(r,A){if(!r)throw new Error(`[${Wf}] ${A}`)}function Vf(r){if("buffer"in r){const A=r.buffer;return r.byteOffset>0||r.byteLength<r.buffer.byteLength?A.slice(r.byteOffset,r.byteOffset+r.byteLength):A}else return r}function jA(r){return"buffer"in r?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(r)}function qf(r){let A="";for(let e=0,t=r.length,i;e<t;e++)i=r.charCodeAt(e),i!==0&&(A+=String.fromCharCode(i));return A}function Mr(r){r=qf(r);const A=[];for(let e=0,t=r.length,i;e<t;e++)i=r.charCodeAt(e),A.push(i>>8),A.push(i&255);return A}function Xf(r){let A="";for(let e=0,t=r.length;e<t;e++)r[e]<127?A+=String.fromCharCode(r[e]):A+=`%${(256+r[e]).toString(16).slice(1)}`;return unescape(A)}function jf(r){let A="";for(let e=0,t=r.length;e<t;e+=2)A+=String.fromCharCode((r[e]<<8)+r[e+1]);return A}var Zf=Object.defineProperty,Xe=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Zf(A,e,i),i};const Yi={int8:1,int16:2,int32:4,uint8:1,uint16:2,uint32:4,float32:4,float64:8,fixed:4,longDateTime:8,char:1};function je(){return function(r,A){Object.defineProperty(r.constructor.prototype,A,{get(){if(typeof A=="string"){if(A.startsWith("read"))return(...e)=>this.read(A.substring(4).toLowerCase(),...e);if(A.startsWith("write"))return(...e)=>this.write(A.substring(5).toLowerCase(),...e)}},configurable:!0,enumerable:!0})}}class Fe extends DataView{constructor(e,t,i,s){super(Vf(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 l;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/,h=>h.toUpperCase())}`,n=this,o=(l=n[s])==null?void 0:l.bind(n),a=o==null?void 0:o(t,i);return this.cursor+=Yi[e],a}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 n=0,o=i.length;n<o;n++)s+=String.fromCharCode(i[n]);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 h;switch(e){case"char":return this.writeChar(t,i);case"fixed":return this.writeFixed(t,i);case"longDateTime":return this.writeLongDateTime(t,i)}const n=`set${e.replace(/^\S/,c=>c.toUpperCase())}`,o=this,a=(h=o[n])==null?void 0:h.bind(o),l=a==null?void 0:a(i,t,s);return this.cursor+=Yi[e.toLowerCase()],l}writeString(e="",t=this.cursor){const i=e.replace(/[^\x00-\xFF]/g,"11").length;this.seek(t);for(let s=0,n=e.length,o;s<n;++s)o=e.charCodeAt(s)||0,o>127?this.writeUint16(o):this.writeUint8(o);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=jA(e);i=s.byteLength;for(let n=0;n<i;++n)this.setUint8(t+n,s.getUint8(n))}return this.cursor=t+i,this}seek(e){return this.cursor=e,this}}Xe([je()],Fe.prototype,"readInt8"),Xe([je()],Fe.prototype,"readInt16"),Xe([je()],Fe.prototype,"readInt32"),Xe([je()],Fe.prototype,"readUint8"),Xe([je()],Fe.prototype,"readUint16"),Xe([je()],Fe.prototype,"readUint32"),Xe([je()],Fe.prototype,"readFloat32"),Xe([je()],Fe.prototype,"readFloat64"),Xe([je()],Fe.prototype,"writeInt8"),Xe([je()],Fe.prototype,"writeInt16"),Xe([je()],Fe.prototype,"writeInt32"),Xe([je()],Fe.prototype,"writeUint8"),Xe([je()],Fe.prototype,"writeUint16"),Xe([je()],Fe.prototype,"writeUint32"),Xe([je()],Fe.prototype,"writeFloat32"),Xe([je()],Fe.prototype,"writeFloat64");const Sl=new WeakMap;function y(r){const A=typeof r=="object"?r:{type:r},{size:e=1,type:t}=A;return(i,s)=>{if(typeof s!="string")return;let n=Sl.get(i);n||(n={columns:[],byteLength:0},Sl.set(i,n));const o={...A,name:s,byteLength:e*Yi[t],offset:A.offset??n.columns.reduce((a,l)=>a+l.byteLength,0)};n.columns.push(o),n.byteLength=n.columns.reduce((a,l)=>a+Yi[l.type]*(l.size??1),0),Object.defineProperty(i.constructor.prototype,s,{get(){return this.view.readColumn(o)},set(a){this.view.writeColumn(o,a)},configurable:!0,enumerable:!0})}}class ft{constructor(A,e,t,i){u(this,"view");this.view=new Fe(A,e,t,i)}}class Rr extends ft{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(A){return new FontFace(A,this.view.buffer)}}var $f=Object.defineProperty,rt=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&$f(A,e,i),i};const st=class kh extends Rr{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,n=Mr(s.fontFamily||""),o=n.length,a=Mr(s.fontStyle||""),l=a.length,h=Mr(s.version||""),c=h.length,f=Mr(s.fullName||""),I=f.length,d=86+o+4+l+4+c+4+I+2+e.view.byteLength,C=new kh(new ArrayBuffer(d),0,d,!0);C.EOTSize=C.view.byteLength,C.FontDataSize=e.view.byteLength,C.Version=131073,C.Flags=0,C.Charset=1,C.MagicNumber=20556,C.Padding1=0,C.CheckSumAdjustment=t.head.checkSumAdjustment;const p=t.os2;return p&&(C.FontPANOSE=p.fontPANOSE,C.Italic=p.fsSelection,C.Weight=p.usWeightClass,C.fsType=p.fsType,C.UnicodeRange=p.ulUnicodeRange,C.CodePageRange=p.ulCodePageRange),C.view.writeUint16(o),C.view.writeBytes(n),C.view.writeUint16(0),C.view.writeUint16(l),C.view.writeBytes(a),C.view.writeUint16(0),C.view.writeUint16(c),C.view.writeBytes(h),C.view.writeUint16(0),C.view.writeUint16(I),C.view.writeBytes(f),C.view.writeUint16(0),C.view.writeUint16(0),C.view.writeBytes(e.view),C}};rt([y("uint32")],st.prototype,"EOTSize"),rt([y("uint32")],st.prototype,"FontDataSize"),rt([y("uint32")],st.prototype,"Version"),rt([y("uint32")],st.prototype,"Flags"),rt([y({type:"uint8",size:10})],st.prototype,"FontPANOSE"),rt([y("uint8")],st.prototype,"Charset"),rt([y("uint8")],st.prototype,"Italic"),rt([y("uint32")],st.prototype,"Weight"),rt([y("uint16")],st.prototype,"fsType"),rt([y("uint16")],st.prototype,"MagicNumber"),rt([y({type:"uint8",size:16})],st.prototype,"UnicodeRange"),rt([y({type:"uint8",size:8})],st.prototype,"CodePageRange"),rt([y("uint32")],st.prototype,"CheckSumAdjustment"),rt([y({type:"uint8",size:16})],st.prototype,"Reserved"),rt([y("uint16")],st.prototype,"Padding1");var ed=Object.defineProperty,Pr=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&ed(A,e,i),i};class ZA extends ft{constructor(A,e){super(A,e,16)}}Pr([y({type:"char",size:4})],ZA.prototype,"tag"),Pr([y("uint32")],ZA.prototype,"checkSum"),Pr([y("uint32")],ZA.prototype,"offset"),Pr([y("uint32")],ZA.prototype,"length");const vn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],td=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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 _n{constructor(A){u(this,"index");u(this,"name");u(this,"isComposite",!1);u(this,"components",[]);u(this,"pathCommands",[]);const e={...A};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(A=0,e=0,t=72,i={},s){const n=1/((s==null?void 0:s.unitsPerEm)??1e3)*t,{xScale:o=n,yScale:a=n}=i,l=this.pathCommands,h=[];for(let c=0,f=l.length;c<f;c+=1){const I=l[c];I.type==="M"?h.push({type:"M",x:A+I.x*o,y:e+-I.y*a}):I.type==="L"?h.push({type:"L",x:A+I.x*o,y:e+-I.y*a}):I.type==="Q"?h.push({type:"Q",x1:A+I.x1*o,y1:e+-I.y1*a,x:A+I.x*o,y:e+-I.y*a}):I.type==="C"?h.push({type:"C",x1:A+I.x1*o,y1:e+-I.y1*a,x2:A+I.x2*o,y2:e+-I.y2*a,x:A+I.x*o,y:e+-I.y*a}):I.type==="Z"&&h.push({type:"Z"})}return h}}class Ad extends _n{parse(A,e,t){const i=this,{nominalWidthX:s,defaultWidthX:n,gsubrsBias:o,subrsBias:a}=A,l=A.topDict.paintType,h=this.index;let c,f,I,d;const C=[],p=[];let S=0,P=!1,w=!1,R=n,_=0,m=0;function b(W,L){C.push({type:"L",x:W,y:L})}function D(W,L,se,H,q,ie){C.push({type:"C",x1:W,y1:L,x2:se,y2:H,x:q,y:ie})}function z(W,L){w&&l!==2&&Ae(),w=!0,C.push({type:"M",x:W,y:L})}function Ae(){C.push({type:"Z"})}function V(W){C.push(...W)}function K(){p.length%2!==0&&!P&&(R=p.shift()+s),S+=p.length>>1,p.length=0,P=!0}function te(W){let L,se,H,q,ie,J,$,N,U,X,ee,oe,j=0;for(;j<W.length;){let pe=W[j++];switch(pe){case 1:K();break;case 3:K();break;case 4:p.length>1&&!P&&(R=p.shift()+s,P=!0),m+=p.pop(),z(_,m);break;case 5:for(;p.length>0;)_+=p.shift(),m+=p.shift(),b(_,m);break;case 6:for(;p.length>0&&(_+=p.shift(),b(_,m),p.length!==0);)m+=p.shift(),b(_,m);break;case 7:for(;p.length>0&&(m+=p.shift(),b(_,m),p.length!==0);)_+=p.shift(),b(_,m);break;case 8:for(;p.length>0;)c=_+p.shift(),f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),_=I+p.shift(),m=d+p.shift(),D(c,f,I,d,_,m);break;case 10:ie=p.pop()+a,J=A.subrs[ie],J&&te(J);break;case 11:return;case 12:switch(pe=W[j],j+=1,pe){case 35:c=_+p.shift(),f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),$=I+p.shift(),N=d+p.shift(),U=$+p.shift(),X=N+p.shift(),ee=U+p.shift(),oe=X+p.shift(),_=ee+p.shift(),m=oe+p.shift(),p.shift(),D(c,f,I,d,$,N),D(U,X,ee,oe,_,m);break;case 34:c=_+p.shift(),f=m,I=c+p.shift(),d=f+p.shift(),$=I+p.shift(),N=d,U=$+p.shift(),X=d,ee=U+p.shift(),oe=m,_=ee+p.shift(),D(c,f,I,d,$,N),D(U,X,ee,oe,_,m);break;case 36:c=_+p.shift(),f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),$=I+p.shift(),N=d,U=$+p.shift(),X=d,ee=U+p.shift(),oe=X+p.shift(),_=ee+p.shift(),D(c,f,I,d,$,N),D(U,X,ee,oe,_,m);break;case 37:c=_+p.shift(),f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),$=I+p.shift(),N=d+p.shift(),U=$+p.shift(),X=N+p.shift(),ee=U+p.shift(),oe=X+p.shift(),Math.abs(ee-_)>Math.abs(oe-m)?_=ee+p.shift():m=oe+p.shift(),D(c,f,I,d,$,N),D(U,X,ee,oe,_,m);break;default:console.warn(`Glyph ${h}: unknown operator ${1200+pe}`),p.length=0}break;case 14:if(p.length>=4){const at=vn[p.pop()],lt=vn[p.pop()],He=p.pop(),ge=p.pop();if(at&<){i.isComposite=!0,i.components=[];const we=A.charset.indexOf(at),Je=A.charset.indexOf(lt);i.components.push({glyphIndex:Je,dx:0,dy:0}),i.components.push({glyphIndex:we,dx:ge,dy:He}),V(t.get(Je).pathCommands);const Ve=JSON.parse(JSON.stringify(t.get(we).pathCommands));for(let xe=0;xe<Ve.length;xe+=1){const et=Ve[xe];et.type!=="Z"&&(et.x+=ge,et.y+=He),(et.type==="Q"||et.type==="C")&&(et.x1+=ge,et.y1+=He),et.type==="C"&&(et.x2+=ge,et.y2+=He)}V(Ve)}}else p.length>0&&!P&&(R=p.shift()+s,P=!0);w&&l!==2&&(Ae(),w=!1);break;case 18:K();break;case 19:case 20:K(),j+=S+7>>3;break;case 21:p.length>2&&!P&&(R=p.shift()+s,P=!0),m+=p.pop(),_+=p.pop(),z(_,m);break;case 22:p.length>1&&!P&&(R=p.shift()+s,P=!0),_+=p.pop(),z(_,m);break;case 23:K();break;case 24:for(;p.length>2;)c=_+p.shift(),f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),_=I+p.shift(),m=d+p.shift(),D(c,f,I,d,_,m);_+=p.shift(),m+=p.shift(),b(_,m);break;case 25:for(;p.length>6;)_+=p.shift(),m+=p.shift(),b(_,m);c=_+p.shift(),f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),_=I+p.shift(),m=d+p.shift(),D(c,f,I,d,_,m);break;case 26:for(p.length%2&&(_+=p.shift());p.length>0;)c=_,f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),_=I,m=d+p.shift(),D(c,f,I,d,_,m);break;case 27:for(p.length%2&&(m+=p.shift());p.length>0;)c=_+p.shift(),f=m,I=c+p.shift(),d=f+p.shift(),_=I+p.shift(),m=d,D(c,f,I,d,_,m);break;case 28:L=W[j],se=W[j+1],p.push((L<<24|se<<16)>>16),j+=2;break;case 29:ie=p.pop()+o,J=A.gsubrs[ie],J&&te(J);break;case 30:for(;p.length>0&&(c=_,f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),_=I+p.shift(),m=d+(p.length===1?p.shift():0),D(c,f,I,d,_,m),p.length!==0);)c=_+p.shift(),f=m,I=c+p.shift(),d=f+p.shift(),m=d+p.shift(),_=I+(p.length===1?p.shift():0),D(c,f,I,d,_,m);break;case 31:for(;p.length>0&&(c=_+p.shift(),f=m,I=c+p.shift(),d=f+p.shift(),m=d+p.shift(),_=I+(p.length===1?p.shift():0),D(c,f,I,d,_,m),p.length!==0);)c=_,f=m+p.shift(),I=c+p.shift(),d=f+p.shift(),_=I+p.shift(),m=d+(p.length===1?p.shift():0),D(c,f,I,d,_,m);break;default:pe<32?console.warn(`Glyph ${h}: unknown operator ${pe}`):pe<247?p.push(pe-139):pe<251?(L=W[j],j+=1,p.push((pe-247)*256+L+108)):pe<255?(L=W[j],j+=1,p.push(-(pe-251)*256-L-108)):(L=W[j],se=W[j+1],H=W[j+2],q=W[j+3],j+=4,p.push((L<<24|se<<16|H<<8|q)/65536))}}}te(e),this.pathCommands=C,P&&(this.advanceWidth=R)}}class bn{constructor(A){u(this,"_items",[]);this._sfnt=A}get(A){const e=this._items[A];let t;if(e)t=e;else{t=this._get(A);const i=this._sfnt.hmtx.metrics[A];i&&(t.advanceWidth=t.advanceWidth||i.advanceWidth,t.leftSideBearing=t.leftSideBearing||i.leftSideBearing);const s=this._sfnt.cmap.glyphIndexToUnicodesMap.get(A);s&&(t.unicode??(t.unicode=s[0]),t.unicodes??(t.unicodes=s)),this._items[A]=t}return t}}class id extends bn{get length(){return this._sfnt.cff.charStringsIndex.offsets.length-1}_get(A){const e=this._sfnt.cff,t=new Ad({index:A});return t.parse(e,e.charStringsIndex.get(A),this),t.name=e.charset[A],t}}var rd=Object.defineProperty,Ml=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&rd(A,e,i),i};class kr extends ft{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 n=0,o=t+1;n<o;n++){const a=this.view;let l=0;for(let h=0;h<i;h++)l<<=8,l+=a.readUint8();s.push(l)}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],o=i+t[e+1]-s;return this._isString?this.view.readString(s,o):this.view.readBytes(s,o)}}Ml([y("uint16")],kr.prototype,"count"),Ml([y("uint8")],kr.prototype,"offsetSize");class Ur extends kr{constructor(){super(...arguments);u(this,"_isString",!1)}}class Rl extends kr{constructor(){super(...arguments);u(this,"_isString",!0)}}const sd=[".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"],nd=[".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"],od=[".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"],ad=[".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 Nr(r,A){return A<=390?sd[A]:r[A-391]}function ye(r,A="number",e){return(t,i)=>{if(typeof i!="string")return;const s={type:A,operator:r,default:e??A==="number"?0:void 0};Object.defineProperty(t.constructor.prototype,i,{get(){return this._getProp(s)},set(n){this._setProp(s,n)},configurable:!0,enumerable:!0})}}class Pl extends ft{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 n=e.readUint8(),o=n>>4,a=n&15;if(o===i||(t+=s[o],a===i))break;t+=s[a]}return Number.parseFloat(t)}_readOperand(e){const t=this.view;let i,s,n,o;if(e===28)return i=t.readUint8(),s=t.readUint8(),i<<8|s;if(e===29)return i=t.readUint8(),s=t.readUint8(),n=t.readUint8(),o=t.readUint8(),i<<24|s<<16|n<<8|o;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 n=e.readUint8();n<=21?(n===12&&(n=1200+e.readUint8()),s[n]=t,t=[]):t.push(this._readOperand(n))}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 Nr(((i=this._stringIndex)==null?void 0:i.objects)??[],t[0]);case"number[]":return t}return t}_setProp(e,t){}}var ld=Object.defineProperty,Dn=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&ld(A,e,i),i};class Fr extends Pl{}Dn([ye(19)],Fr.prototype,"subrs"),Dn([ye(20)],Fr.prototype,"defaultWidthX"),Dn([ye(21)],Fr.prototype,"nominalWidthX");var hd=Object.defineProperty,De=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&hd(A,e,i),i};class ve extends Pl{}De([ye(0,"string")],ve.prototype,"version"),De([ye(1,"string")],ve.prototype,"notice"),De([ye(1200,"string")],ve.prototype,"copyright"),De([ye(2,"string")],ve.prototype,"fullName"),De([ye(3,"string")],ve.prototype,"familyName"),De([ye(4,"string")],ve.prototype,"weight"),De([ye(1201)],ve.prototype,"isFixedPitch"),De([ye(1202)],ve.prototype,"italicAngle"),De([ye(1203,"number",-100)],ve.prototype,"underlinePosition"),De([ye(1204,"number",50)],ve.prototype,"underlineThickness"),De([ye(1205)],ve.prototype,"paintType"),De([ye(1206,"number",2)],ve.prototype,"charstringType"),De([ye(1207,"number[]",[.001,0,0,.001,0,0])],ve.prototype,"fontMatrix"),De([ye(13)],ve.prototype,"uniqueId"),De([ye(5,"number[]",[0,0,0,0])],ve.prototype,"fontBBox"),De([ye(1208)],ve.prototype,"strokeWidth"),De([ye(14)],ve.prototype,"xuid"),De([ye(15)],ve.prototype,"charset"),De([ye(16)],ve.prototype,"encoding"),De([ye(17)],ve.prototype,"charStrings"),De([ye(18,"number[]",[0,0])],ve.prototype,"private");function Ye(r,A=r){return e=>{DA.tableDefinitions.set(r,{tag:r,prop:A,class:e}),Object.defineProperty(DA.prototype,A,{get(){return this.get(r)},set(t){return this.set(r,t)},configurable:!0,enumerable:!0})}}const UA=class UA{constructor(A){u(this,"tables",new Map);u(this,"tableViews",new Map);(A instanceof Map?A:new Map(Object.entries(A))).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 numGlyphs(){return this.maxp.numGlyphs}get unicodes(){return this.cmap.glyphIndexToUnicodesMap}get glyphs(){return this.hasGlyf?this.glyf.glyphs:this.cff.glyphs}charToGlyphIndex(A){let e=this.cmap.unicodeToGlyphIndexMap.get(A.codePointAt(0));if(e===void 0&&!this.hasGlyf){const{encoding:t,charset:i}=this.cff;e=i.indexOf(t[A.codePointAt(0)])}return e??0}charToGlyph(A){return this.glyphs.get(this.charToGlyphIndex(A))}textToGlyphIndexes(A){const e=[];for(const t of A)e.push(this.charToGlyphIndex(t));return e}textToGlyphs(A){const e=this.glyphs,t=this.textToGlyphIndexes(A),i=t.length,s=Array.from({length:i}),n=e.get(0);for(let o=0;o<i;o+=1)s[o]=e.get(t[o])||n;return s}getPathCommands(A,e,t,i,s){const n=[];return this.forEachGlyph(A,e,t,i,s,(o,a,l,h,c)=>{n.push(...o.getPathCommands(a,l,h,c,this))}),n}getAdvanceWidth(A,e,t){return this.forEachGlyph(A,0,0,e,t,()=>{})}forEachGlyph(A,e=0,t=0,i=72,s={},n){const o=1/this.unitsPerEm*i,a=this.textToGlyphs(A);for(let l=0;l<a.length;l+=1){const h=a[l];n.call(this,h,e,t,i,s),h.advanceWidth&&(e+=h.advanceWidth*o),s.letterSpacing?e+=s.letterSpacing*i:s.tracking&&(e+=s.tracking/1e3*i)}return e}clone(){return new UA(this.tableViews)}delete(A){const e=UA.tableDefinitions.get(A);return e?(this.tableViews.delete(A),this.tables.delete(e.prop),this):this}set(A,e){const t=UA.tableDefinitions.get(A);return t&&this.tables.set(t.prop,e),this.tableViews.set(A,e.view),this}get(A){const e=UA.tableDefinitions.get(A);if(!e)return;let t=this.tables.get(e.prop);if(!t){const i=e.class;if(i){const s=this.tableViews.get(A);if(!s)return;t=new i(s.buffer,s.byteOffset,s.byteLength).setSFNT(this),this.tables.set(e.prop,t)}}return t}};u(UA,"tableDefinitions",new Map);let DA=UA;class Ze extends ft{setSFNT(A){return this._sfnt=A,this}getSFNT(){return this._sfnt}}var cd=Object.defineProperty,gd=Object.getOwnPropertyDescriptor,zi=(r,A,e,t)=>{for(var i=t>1?void 0:t?gd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&cd(A,e,i),i};let xA=class extends Ze{constructor(A,e,t,i){super(A,e,t,i);u(this,"_glyphs");u(this,"privateDict");u(this,"subrsIndex");this._init()}get glyphs(){return this._glyphs??(this._glyphs=new id(this._sfnt))}get gsubrs(){return this.globalSubrIndex.objects}get gsubrsBias(){return this._calcSubroutineBias(this.globalSubrIndex.objects)}get defaultWidthX(){var A;return((A=this.privateDict)==null?void 0:A.defaultWidthX)??0}get nominalWidthX(){var A;return((A=this.privateDict)==null?void 0:A.nominalWidthX)??0}get subrs(){var A;return((A=this.subrsIndex)==null?void 0:A.objects)??[]}get subrsBias(){return this._calcSubroutineBias(this.subrs)}_init(){const A=this.view,{buffer:e,byteOffset:t}=A,i=t+4;this.nameIndex=new Rl(e,i),this.topDictIndex=new Ur(e,this.nameIndex.endOffset),this.stringIndex=new Rl(e,this.topDictIndex.endOffset),this.globalSubrIndex=new Ur(e,this.stringIndex.endOffset),this.topDict=new ve(new Uint8Array(this.topDictIndex.objects[0]).buffer).setStringIndex(this.stringIndex);const s=this.topDict.private[0],n=this.topDict.private[1];s&&(this.privateDict=new Fr(e,t+n,s).setStringIndex(this.stringIndex),this.privateDict.subrs&&(this.subrsIndex=new Ur(e,t+n+this.privateDict.subrs))),this.charStringsIndex=new Ur(e,t+this.topDict.charStrings);const o=this.charStringsIndex.offsets.length-1;this.topDict.charset===0?this.charset=nd:this.topDict.charset===1?this.charset=od:this.topDict.charset===2?this.charset=ad:this.charset=this._readCharset(t+this.topDict.charset,o,this.stringIndex.objects),this.topDict.encoding===0?this.encoding=vn:this.topDict.encoding===1?this.encoding=td:this.encoding=this._readEncoding(t+this.topDict.encoding)}_readCharset(A,e,t){const i=this.view;i.seek(A);let s,n,o;e-=1;const a=[".notdef"],l=i.readUint8();if(l===0)for(s=0;s<e;s+=1)n=i.readUint16(),a.push(Nr(t,n));else if(l===1)for(;a.length<=e;)for(n=i.readUint16(),o=i.readUint8(),s=0;s<=o;s+=1)a.push(Nr(t,n)),n+=1;else if(l===2)for(;a.length<=e;)for(n=i.readUint16(),o=i.readUint16(),s=0;s<=o;s+=1)a.push(Nr(t,n)),n+=1;else throw new Error(`Unknown charset format ${l}`);return a}_readEncoding(A){const e=this.view;e.seek(A);let t,i;const s={},n=e.readUint8();if(n===0){const o=e.readUint8();for(t=0;t<o;t+=1)i=e.readUint8(),s[i]=t}else if(n===1){const o=e.readUint8();for(i=1,t=0;t<o;t+=1){const a=e.readUint8(),l=e.readUint8();for(let h=a;h<=a+l;h+=1)s[h]=i,i+=1}}else console.warn(`unknown encoding format:${n}`);return s}_calcSubroutineBias(A){let e;return A.length<1240?e=107:A.length<33900?e=1131:e=32768,e}};zi([y("uint8")],xA.prototype,"majorVersion",2),zi([y("uint8")],xA.prototype,"minorVersion",2),zi([y("uint8")],xA.prototype,"headerSize",2),zi([y("uint8")],xA.prototype,"offsetSize",2),xA=zi([Ye("CFF ","cff")],xA);var ud=Object.defineProperty,Tr=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&ud(A,e,i),i};const Wi=class Uh extends ft{constructor(A=new ArrayBuffer(262),e){super(A,e,262)}static from(A){const e=new Uh;return e.format=0,e.length=e.view.byteLength,e.language=0,A.forEach((t,i)=>{i<256&&t<256&&e.view.writeUint8(t,6+i)}),e}getUnicodeToGlyphIndexMap(){const A=new Map;return this.glyphIndexArray.forEach((e,t)=>{A.set(t,e)}),A}};Tr([y("uint16")],Wi.prototype,"format"),Tr([y("uint16")],Wi.prototype,"length"),Tr([y("uint16")],Wi.prototype,"language"),Tr([y({type:"uint8",size:256})],Wi.prototype,"glyphIndexArray");let xn=Wi;var fd=Object.defineProperty,Sn=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&fd(A,e,i),i};class Vi extends ft{get subHeaderKeys(){return this.view.seek(6),Array.from({length:256},()=>this.view.readUint16()/8)}get maxSubHeaderKey(){return this.subHeaderKeys.reduce((A,e)=>Math.max(A,e),0)}get subHeaders(){const A=this.maxSubHeaderKey;return this.view.seek(6+256*2),Array.from({length:A},(e,t)=>({firstCode:this.view.readUint16(),entryCount:this.view.readUint16(),idDelta:this.view.readUint16(),idRangeOffset:(this.view.readUint16()-(A-t)*8-2)/2}))}get glyphIndexArray(){const A=this.maxSubHeaderKey,e=6+256*2+A*8;this.view.seek(e);const t=(this.view.byteLength-e)/2;return Array.from({length:t},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(A){const e=new Map,t=this.subHeaderKeys,i=this.maxSubHeaderKey,s=this.subHeaders,n=this.glyphIndexArray,o=t.findIndex(l=>l===i);let a=0;for(let l=0;l<256;l++)if(t[l]===0)l>=o||l<s[0].firstCode||l>=s[0].firstCode+s[0].entryCount||s[0].idRangeOffset+(l-s[0].firstCode)>=n.length?a=0:(a=n[s[0].idRangeOffset+(l-s[0].firstCode)],a!==0&&(a=a+s[0].idDelta)),a!==0&&a<A&&e.set(l,a);else{const h=t[l];for(let c=0,f=s[h].entryCount;c<f;c++)if(s[h].idRangeOffset+c>=n.length?a=0:(a=n[s[h].idRangeOffset+c],a!==0&&(a=a+s[h].idDelta)),a!==0&&a<A){const I=(l<<8|c+s[h].firstCode)%65535;e.set(I,a)}}return e}}Sn([y("uint16")],Vi.prototype,"format"),Sn([y("uint16")],Vi.prototype,"length"),Sn([y("uint16")],Vi.prototype,"language");function kl(r){return r>32767?r-65536:r<-32767?r+65536:r}function Mn(r,A){let e;const t=[];let i={};return r.forEach((s,n)=>{A&&n>A||((!e||n!==e.unicode+1||s!==e.glyphIndex+1)&&(e?(i.end=e.unicode,t.push(i),i={start:n,startId:s,delta:kl(s-n)}):(i.start=Number(n),i.startId=s,i.delta=kl(s-n))),e={unicode:n,glyphIndex:s})}),e&&(i.end=e.unicode,t.push(i)),t}var dd=Object.defineProperty,SA=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&dd(A,e,i),i};const cA=class Nh extends ft{get endCode(){const A=this.segCountX2;return this.view.seek(14),Array.from({length:A/2},()=>this.view.readUint16())}set endCode(A){this.view.seek(14),A.forEach(e=>this.view.writeUint16(e))}get reservedPad(){return this.view.readUint16(14+this.segCountX2)}set reservedPad(A){this.view.writeUint16(A,14+this.segCountX2)}get startCode(){const A=this.segCountX2;return this.view.seek(14+A+2),Array.from({length:A/2},()=>this.view.readUint16())}set startCode(A){this.view.seek(14+this.segCountX2+2),A.forEach(e=>this.view.writeUint16(e))}get idDelta(){const A=this.segCountX2;return this.view.seek(14+A+2+A),Array.from({length:A/2},()=>this.view.readUint16())}set idDelta(A){const e=this.segCountX2;this.view.seek(14+e+2+e),A.forEach(t=>this.view.writeUint16(t))}get idRangeOffsetCursor(){const A=this.segCountX2;return 14+A+2+A*2}get idRangeOffset(){const A=this.segCountX2;return this.view.seek(this.idRangeOffsetCursor),Array.from({length:A/2},()=>this.view.readUint16())}set idRangeOffset(A){this.view.seek(this.idRangeOffsetCursor),A.forEach(e=>this.view.writeUint16(e))}get glyphIndexArrayCursor(){const A=this.segCountX2;return 14+A+2+A*3}get glyphIndexArray(){const A=this.glyphIndexArrayCursor;this.view.seek(A);const e=(this.view.byteLength-A)/2;return Array.from({length:e},()=>this.view.readUint16())}static from(A){const e=Mn(A,65535),t=e.length+1,i=Math.floor(Math.log(t)/Math.LN2),s=2*2**i,n=new Nh(new ArrayBuffer(24+e.length*8));return n.format=4,n.length=n.view.byteLength,n.language=0,n.segCountX2=t*2,n.searchRange=s,n.entrySelector=i,n.rangeShift=2*t-s,n.endCode=[...e.map(o=>o.end),65535],n.reservedPad=0,n.startCode=[...e.map(o=>o.start),65535],n.idDelta=[...e.map(o=>o.delta),1],n.idRangeOffset=Array.from({length:t},()=>0),n}getUnicodeToGlyphIndexMap(){const A=new Map,e=this.segCountX2/2,t=(this.glyphIndexArrayCursor-this.idRangeOffsetCursor)/2,i=this.startCode,s=this.endCode,n=this.idRangeOffset,o=this.idDelta,a=this.glyphIndexArray;for(let l=0;l<e;++l)for(let h=i[l],c=s[l];h<=c;++h)if(n[l]===0)A.set(h,(h+o[l])%65536);else{const f=l+n[l]/2+(h-i[l])-t,I=a[f];I!==0?A.set(h,(I+o[l])%65536):A.set(h,0)}return A.delete(65535),A}};SA([y("uint16")],cA.prototype,"format"),SA([y("uint16")],cA.prototype,"length"),SA([y("uint16")],cA.prototype,"language"),SA([y("uint16")],cA.prototype,"segCountX2"),SA([y("uint16")],cA.prototype,"searchRange"),SA([y("uint16")],cA.prototype,"entrySelector"),SA([y("uint16")],cA.prototype,"rangeShift");let Rn=cA;var Id=Object.defineProperty,qi=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Id(A,e,i),i};class MA extends ft{get glyphIndexArray(){return this.view.seek(12),Array.from({length:this.entryCount},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(){const A=this.glyphIndexArray,e=new Map;return A.forEach((t,i)=>{e.set(i,t)}),e}}qi([y("uint16")],MA.prototype,"format"),qi([y("uint16")],MA.prototype,"length"),qi([y("uint16")],MA.prototype,"language"),qi([y("uint16")],MA.prototype,"firstCode"),qi([y("uint16")],MA.prototype,"entryCount");var pd=Object.defineProperty,Xi=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&pd(A,e,i),i};const $A=class Fh extends ft{get groups(){const A=this.nGroups;return this.view.seek(16),Array.from({length:A},()=>({startCharCode:this.view.readUint32(),endCharCode:this.view.readUint32(),startGlyphCode:this.view.readUint32()}))}static from(A){const e=Mn(A),t=new Fh(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 A=new Map,e=this.groups;for(let t=0,i=e.length;t<i;t++){const s=e[t];let n=s.startGlyphCode,o=s.startCharCode;const a=s.endCharCode;for(;o<=a;)A.set(o++,n++)}return A}};Xi([y("uint16")],$A.prototype,"format"),Xi([y("uint16")],$A.prototype,"reserved"),Xi([y("uint32")],$A.prototype,"length"),Xi([y("uint32")],$A.prototype,"language"),Xi([y("uint32")],$A.prototype,"nGroups");let Pn=$A;var Bd=Object.defineProperty,kn=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Bd(A,e,i),i};class ji extends ft{getVarSelectorRecords(){const A=this.numVarSelectorRecords;return this.view.seek(10),Array.from({length:A},()=>{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 A=new Map,e=this.getVarSelectorRecords();for(let t=0,i=e.length;t<i;t++){const{uVSMappings:s}=e[t];s.forEach(n=>{A.set(n.unicodeValue,n.glyphID)})}return A}}kn([y("uint16")],ji.prototype,"format"),kn([y("uint32")],ji.prototype,"length"),kn([y("uint32")],ji.prototype,"numVarSelectorRecords");var Ed=Object.defineProperty,Cd=Object.getOwnPropertyDescriptor,Un=(r,A,e,t)=>{for(var i=t>1?void 0:t?Cd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Ed(A,e,i),i};let ei=class extends Ze{constructor(){super(...arguments);u(this,"_unicodeToGlyphIndexMap");u(this,"_glyphIndexToUnicodesMap")}static from(A){const e=Array.from(A.keys()).some(c=>c>65535),t=Rn.from(A),i=xn.from(A),s=e?Pn.from(A):void 0,n=4+(s?32:24),o=n+t.view.byteLength,a=o+i.view.byteLength,l=[{platformID:0,platformSpecificID:3,offset:n},{platformID:1,platformSpecificID:0,offset:o},{platformID:3,platformSpecificID:1,offset:n},s&&{platformID:3,platformSpecificID:10,offset:a}].filter(Boolean),h=new ei(new ArrayBuffer(4+8*l.length+t.view.byteLength+i.view.byteLength+((s==null?void 0:s.view.byteLength)??0)));return h.numberSubtables=l.length,h.view.seek(4),l.forEach(c=>{h.view.writeUint16(c.platformID),h.view.writeUint16(c.platformSpecificID),h.view.writeUint32(c.offset)}),h.view.writeBytes(t.view,n),h.view.writeBytes(i.view,o),s&&h.view.writeBytes(s.view,a),h}get unicodeToGlyphIndexMap(){return this._unicodeToGlyphIndexMap??(this._unicodeToGlyphIndexMap=this.readunicodeToGlyphIndexMap())}get glyphIndexToUnicodesMap(){if(!this._glyphIndexToUnicodesMap){const A=new Map,e=this.unicodeToGlyphIndexMap,t=Array.from(e.keys());for(let i=0,s=t.length;i<s;i++){const n=t[i],o=e.get(n);A.has(o)?A.get(o).push(n):A.set(o,[n])}this._glyphIndexToUnicodesMap=A}return this._glyphIndexToUnicodesMap}readSubtables(){const A=this.numberSubtables;return this.view.seek(4),Array.from({length:A},()=>({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 xn(this.view.buffer,e.offset);break;case 2:i=new Vi(this.view.buffer,e.offset,this.view.readUint16());break;case 4:i=new Rn(this.view.buffer,e.offset,this.view.readUint16());break;case 6:i=new MA(this.view.buffer,e.offset,this.view.readUint16());break;case 12:i=new Pn(this.view.buffer,e.offset,this.view.readUint32(e.offset+4));break;case 14:default:i=new ji(this.view.buffer,e.offset,this.view.readUint32());break}return{...e,format:t,view:i}})}readunicodeToGlyphIndexMap(){var o,a,l,h,c;const A=this.readSubtables(),e=(o=A.find(f=>f.format===0))==null?void 0:o.view,t=(a=A.find(f=>f.platformID===3&&f.platformSpecificID===3&&f.format===2))==null?void 0:a.view,i=(l=A.find(f=>f.platformID===3&&f.platformSpecificID===1&&f.format===4))==null?void 0:l.view,s=(h=A.find(f=>f.platformID===3&&f.platformSpecificID===10&&f.format===12))==null?void 0:h.view,n=(c=A.find(f=>f.platformID===0&&f.platformSpecificID===5&&f.format===14))==null?void 0:c.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())??[],...(n==null?void 0:n.getUnicodeToGlyphIndexMap())??[]])}};Un([y("uint16")],ei.prototype,"version",2),Un([y("uint16")],ei.prototype,"numberSubtables",2),ei=Un([Ye("cmap")],ei);class Qd extends _n{_parseContours(A){const e=[];let t=[];for(let i=0;i<A.length;i+=1){const s=A[i];t.push(s),s.lastPointOfContour&&(e.push(t),t=[])}return Ki(t.length===0,"There are still points left in the current contour."),e}_transformPoints(A,e){const t=[];for(let i=0;i<A.length;i+=1){const s=A[i],n={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(n)}return t}_parseGlyphCoordinate(A,e,t,i,s){let n;return(e&i)>0?(n=A.view.readUint8(),(e&s)===0&&(n=-n),n=t+n):(e&s)>0?n=t:n=t+A.view.readInt16(),n}parse(A,e,t){A.view.seek(e);const i=this.numberOfContours=A.view.readInt16();if(this.xMin=A.view.readInt16(),this.yMin=A.view.readInt16(),this.xMax=A.view.readInt16(),this.yMax=A.view.readInt16(),i>0){const o=this.endPointIndices=[];for(let C=0;C<i;C++)o.push(A.view.readUint16());const a=this.instructionLength=A.view.readUint16();Ki(a<5e3,`Bad instructionLength:${a}`);const l=this.instructions=[];for(let C=0;C<a;++C)l.push(A.view.readUint8());const h=A.view.byteOffset,c=o[o.length-1]+1;Ki(c<2e4,`Bad numberOfCoordinates:${h}`);const f=[];let I,d=0;for(;d<c;)if(I=A.view.readUint8(),f.push(I),d++,I&8&&d<c){const C=A.view.readUint8();for(let p=0;p<C;p++)f.push(I),d++}if(Ki(f.length===c,`Bad flags length: ${f.length}, numberOfCoordinates: ${c}`),o.length>0){const C=[];let p;if(c>0){for(let w=0;w<c;w+=1)I=f[w],p={},p.onCurve=!!(I&1),p.lastPointOfContour=o.includes(w),C.push(p);let S=0;for(let w=0;w<c;w+=1)I=f[w],p=C[w],p.x=this._parseGlyphCoordinate(A,I,S,2,16),S=p.x;let P=0;for(let w=0;w<c;w+=1)I=f[w],p=C[w],p.y=this._parseGlyphCoordinate(A,I,P,4,32),P=p.y}this.points=C}else this.points=[]}else if(i===0)this.points=[];else{this.isComposite=!0,this.points=[],this.components=[];let o,a=!0;for(;a;){o=A.view.readUint16();const l={glyphIndex:A.view.readUint16(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(o&1)>0?(o&2)>0?(l.dx=A.view.readInt16(),l.dy=A.view.readInt16()):l.matchedPoints=[A.view.readUint16(),A.view.readUint16()]:(o&2)>0?(l.dx=A.view.readInt8(),l.dy=A.view.readInt8()):l.matchedPoints=[A.view.readUint8(),A.view.readUint8()],(o&8)>0?l.xScale=l.yScale=A.view.readInt16()/16384:(o&64)>0?(l.xScale=A.view.readInt16()/16384,l.yScale=A.view.readInt16()/16384):(o&128)>0&&(l.xScale=A.view.readInt16()/16384,l.scale01=A.view.readInt16()/16384,l.scale10=A.view.readInt16()/16384,l.yScale=A.view.readInt16()/16384),this.components.push(l),a=!!(o&32)}if(o&256){this.instructionLength=A.view.readUint16(),this.instructions=[];for(let l=0;l<this.instructionLength;l+=1)this.instructions.push(A.view.readUint8())}}if(this.isComposite)for(let o=0;o<this.components.length;o+=1){const a=this.components[o],l=t.get(a.glyphIndex);if(l.getPathCommands(),l.points){let h;if(a.matchedPoints===void 0)h=this._transformPoints(l.points,a);else{Ki(a.matchedPoints[0]>this.points.length-1||a.matchedPoints[1]>l.points.length-1,`Matched points out of range in ${this.name}`);const c=this.points[a.matchedPoints[0]];let f=l.points[a.matchedPoints[1]];const I={xScale:a.xScale,scale01:a.scale01,scale10:a.scale10,yScale:a.yScale,dx:0,dy:0};f=this._transformPoints([f],I)[0],I.dx=c.x-f.x,I.dy=c.y-f.y,h=this._transformPoints(l.points,I)}this.points=this.points.concat(h)}}const s=[],n=this._parseContours(this.points);for(let o=0,a=n.length;o<a;++o){const l=n[o];let h=l[l.length-1],c=l[0];h.onCurve?s.push({type:"M",x:h.x,y:h.y}):c.onCurve?s.push({type:"M",x:c.x,y:c.y}):s.push({type:"M",x:(h.x+c.x)*.5,y:(h.y+c.y)*.5});for(let f=0,I=l.length;f<I;++f)if(h=c,c=l[(f+1)%I],h.onCurve)s.push({type:"L",x:h.x,y:h.y});else{let d=c;c.onCurve||(d={x:(h.x+c.x)*.5,y:(h.y+c.y)*.5}),s.push({type:"Q",x1:h.x,y1:h.y,x:d.x,y:d.y})}s.push({type:"Z"})}this.pathCommands=s}}class yd extends bn{get length(){return this._sfnt.loca.locations.length}_get(A){const e=this._sfnt.loca.locations,t=e[A],i=new Qd({index:A});return t!==e[A+1]&&i.parse(this._sfnt.glyf,t,this),i}}var md=Object.getOwnPropertyDescriptor,wd=(r,A,e,t)=>{for(var i=t>1?void 0:t?md(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let Gr=class extends Ze{constructor(){super(...arguments);u(this,"_glyphs")}static from(A){const e=A.reduce((i,s)=>i+s.byteLength,0),t=new Gr(new ArrayBuffer(e));return A.forEach(i=>{t.view.writeBytes(i)}),t}get glyphs(){return this._glyphs??(this._glyphs=new yd(this._sfnt))}};Gr=wd([Ye("glyf")],Gr);var vd=Object.getOwnPropertyDescriptor,_d=(r,A,e,t)=>{for(var i=t>1?void 0:t?vd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let Nn=class extends Ze{};Nn=_d([Ye("GPOS","gpos")],Nn);var bd=Object.defineProperty,Dd=Object.getOwnPropertyDescriptor,RA=(r,A,e,t)=>{for(var i=t>1?void 0:t?Dd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&bd(A,e,i),i};let $t=class extends Ze{};RA([y("uint16")],$t.prototype,"majorVersion",2),RA([y("uint16")],$t.prototype,"minorVersion",2),RA([y("uint16")],$t.prototype,"scriptListOffset",2),RA([y("uint16")],$t.prototype,"featureListOffset",2),RA([y("uint16")],$t.prototype,"lookupListOffset",2),RA([y("uint16")],$t.prototype,"featureVariationsOffset",2),$t=RA([Ye("GSUB","gsub")],$t);var xd=Object.defineProperty,Sd=Object.getOwnPropertyDescriptor,Te=(r,A,e,t)=>{for(var i=t>1?void 0:t?Sd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&xd(A,e,i),i};let Re=class extends Ze{constructor(r=new ArrayBuffer(54),A){super(r,A,Math.min(54,r.byteLength-(A??0)))}};Te([y("fixed")],Re.prototype,"version",2),Te([y("fixed")],Re.prototype,"fontRevision",2),Te([y("uint32")],Re.prototype,"checkSumAdjustment",2),Te([y("uint32")],Re.prototype,"magickNumber",2),Te([y("uint16")],Re.prototype,"flags",2),Te([y("uint16")],Re.prototype,"unitsPerEm",2),Te([y({type:"longDateTime"})],Re.prototype,"created",2),Te([y({type:"longDateTime"})],Re.prototype,"modified",2),Te([y("int16")],Re.prototype,"xMin",2),Te([y("int16")],Re.prototype,"yMin",2),Te([y("int16")],Re.prototype,"xMax",2),Te([y("int16")],Re.prototype,"yMax",2),Te([y("uint16")],Re.prototype,"macStyle",2),Te([y("uint16")],Re.prototype,"lowestRecPPEM",2),Te([y("int16")],Re.prototype,"fontDirectionHint",2),Te([y("int16")],Re.prototype,"indexToLocFormat",2),Te([y("int16")],Re.prototype,"glyphDataFormat",2),Re=Te([Ye("head")],Re);var Md=Object.defineProperty,Rd=Object.getOwnPropertyDescriptor,nt=(r,A,e,t)=>{for(var i=t>1?void 0:t?Rd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Md(A,e,i),i};let ze=class extends Ze{constructor(r=new ArrayBuffer(36),A){super(r,A,Math.min(36,r.byteLength-(A??0)))}};nt([y("fixed")],ze.prototype,"version",2),nt([y("int16")],ze.prototype,"ascent",2),nt([y("int16")],ze.prototype,"descent",2),nt([y("int16")],ze.prototype,"lineGap",2),nt([y("uint16")],ze.prototype,"advanceWidthMax",2),nt([y("int16")],ze.prototype,"minLeftSideBearing",2),nt([y("int16")],ze.prototype,"minRightSideBearing",2),nt([y("int16")],ze.prototype,"xMaxExtent",2),nt([y("int16")],ze.prototype,"caretSlopeRise",2),nt([y("int16")],ze.prototype,"caretSlopeRun",2),nt([y("int16")],ze.prototype,"caretOffset",2),nt([y({type:"int16",size:4})],ze.prototype,"reserved",2),nt([y("int16")],ze.prototype,"metricDataFormat",2),nt([y("uint16")],ze.prototype,"numOfLongHorMetrics",2),ze=nt([Ye("hhea")],ze);var Pd=Object.getOwnPropertyDescriptor,kd=(r,A,e,t)=>{for(var i=t>1?void 0:t?Pd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let Lr=class extends Ze{constructor(){super(...arguments);u(this,"_metrics")}static from(A){const e=A.length*4,t=new Lr(new ArrayBuffer(e));return A.forEach(i=>{t.view.writeUint16(i.advanceWidth),t.view.writeUint16(i.leftSideBearing)}),t}get metrics(){return this._metrics??(this._metrics=this.readMetrics())}readMetrics(){const A=this._sfnt.maxp.numGlyphs,e=this._sfnt.hhea.numOfLongHorMetrics;let t=0;const i=this.view;return i.seek(0),Array.from({length:A}).map((s,n)=>(n<e&&(t=i.readUint16()),{advanceWidth:t,leftSideBearing:i.readUint16()}))}};Lr=kd([Ye("hmtx")],Lr);var Ud=Object.getOwnPropertyDescriptor,Nd=(r,A,e,t)=>{for(var i=t>1?void 0:t?Ud(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let Fn=class extends Ze{};Fn=Nd([Ye("kern","kern")],Fn);var Fd=Object.getOwnPropertyDescriptor,Td=(r,A,e,t)=>{for(var i=t>1?void 0:t?Fd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let Or=class extends Ze{constructor(){super(...arguments);u(this,"_locations")}static from(A,e=1){const t=A.length*(e?4:2),i=new Or(new ArrayBuffer(t));return A.forEach(s=>{e?i.view.writeUint32(s):i.view.writeUint16(s/2)}),i}get locations(){return this._locations??(this._locations=this.readLocations())}readLocations(){const A=this._sfnt.maxp.numGlyphs,e=this._sfnt.head.indexToLocFormat,t=this.view;return t.seek(0),Array.from({length:A}).map(()=>e?t.readUint32():t.readUint16()*2)}};Or=Td([Ye("loca")],Or);var Gd=Object.defineProperty,Ld=Object.getOwnPropertyDescriptor,$e=(r,A,e,t)=>{for(var i=t>1?void 0:t?Ld(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Gd(A,e,i),i};let Ge=class extends Ze{constructor(r=new ArrayBuffer(32),A){super(r,A,Math.min(32,r.byteLength-(A??0)))}};$e([y("fixed")],Ge.prototype,"version",2),$e([y("uint16")],Ge.prototype,"numGlyphs",2),$e([y("uint16")],Ge.prototype,"maxPoints",2),$e([y("uint16")],Ge.prototype,"maxContours",2),$e([y("uint16")],Ge.prototype,"maxComponentPoints",2),$e([y("uint16")],Ge.prototype,"maxComponentContours",2),$e([y("uint16")],Ge.prototype,"maxZones",2),$e([y("uint16")],Ge.prototype,"maxTwilightPoints",2),$e([y("uint16")],Ge.prototype,"maxStorage",2),$e([y("uint16")],Ge.prototype,"maxFunctionDefs",2),$e([y("uint16")],Ge.prototype,"maxInstructionDefs",2),$e([y("uint16")],Ge.prototype,"maxStackElements",2),$e([y("uint16")],Ge.prototype,"maxSizeOfInstructions",2),$e([y("uint16")],Ge.prototype,"maxComponentElements",2),$e([y("uint16")],Ge.prototype,"maxComponentDepth",2),Ge=$e([Ye("maxp")],Ge);var Od=Object.defineProperty,Hd=Object.getOwnPropertyDescriptor,Hr=(r,A,e,t)=>{for(var i=t>1?void 0:t?Hd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Od(A,e,i),i};const Ul={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"},Tn={Macintosh:1,Microsoft:3},Jd={Default:0},Nl={UCS2:1};let ti=class extends Ze{constructor(){super(...arguments);u(this,"_names")}get names(){return this._names??(this._names=this.readNames())}readNames(){const A=this.count;this.view.seek(6);const e=[];for(let a=0;a<A;++a)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 a=0;a<A;++a){const l=e[a];l.name=this.view.readBytes(t+l.offset,l.length)}let i=Tn.Macintosh,s=Jd.Default,n=0;e.some(a=>a.platform===Tn.Microsoft&&a.encoding===Nl.UCS2&&a.language===1033)&&(i=Tn.Microsoft,s=Nl.UCS2,n=1033);const o={};for(let a=0;a<A;++a){const l=e[a];l.platform===i&&l.encoding===s&&l.language===n&&Ul[l.nameId]&&(o[Ul[l.nameId]]=n===0?Xf(l.name):jf(l.name))}return o}};Hr([y("uint16")],ti.prototype,"format",2),Hr([y("uint16")],ti.prototype,"count",2),Hr([y("uint16")],ti.prototype,"stringOffset",2),ti=Hr([Ye("name")],ti);var Kd=Object.defineProperty,Yd=Object.getOwnPropertyDescriptor,le=(r,A,e,t)=>{for(var i=t>1?void 0:t?Yd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Kd(A,e,i),i};let ae=class extends Ze{get fontPANOSE(){return[this.bFamilyType,this.bSerifStyle,this.bWeight,this.bProportion,this.bContrast,this.bStrokeVariation,this.bArmStyle,this.bLetterform,this.bMidline,this.bXHeight]}};le([y("uint16")],ae.prototype,"version",2),le([y("int16")],ae.prototype,"xAvgCharWidth",2),le([y("uint16")],ae.prototype,"usWeightClass",2),le([y("uint16")],ae.prototype,"usWidthClass",2),le([y("uint16")],ae.prototype,"fsType",2),le([y("uint16")],ae.prototype,"ySubscriptXSize",2),le([y("uint16")],ae.prototype,"ySubscriptYSize",2),le([y("uint16")],ae.prototype,"ySubscriptXOffset",2),le([y("uint16")],ae.prototype,"ySubscriptYOffset",2),le([y("uint16")],ae.prototype,"ySuperscriptXSize",2),le([y("uint16")],ae.prototype,"ySuperscriptYSize",2),le([y("uint16")],ae.prototype,"ySuperscriptXOffset",2),le([y("uint16")],ae.prototype,"ySuperscriptYOffset",2),le([y("uint16")],ae.prototype,"yStrikeoutSize",2),le([y("uint16")],ae.prototype,"yStrikeoutPosition",2),le([y("uint16")],ae.prototype,"sFamilyClass",2),le([y({type:"uint8"})],ae.prototype,"bFamilyType",2),le([y({type:"uint8"})],ae.prototype,"bSerifStyle",2),le([y({type:"uint8"})],ae.prototype,"bWeight",2),le([y({type:"uint8"})],ae.prototype,"bProportion",2),le([y({type:"uint8"})],ae.prototype,"bContrast",2),le([y({type:"uint8"})],ae.prototype,"bStrokeVariation",2),le([y({type:"uint8"})],ae.prototype,"bArmStyle",2),le([y({type:"uint8"})],ae.prototype,"bLetterform",2),le([y({type:"uint8"})],ae.prototype,"bMidline",2),le([y({type:"uint8"})],ae.prototype,"bXHeight",2),le([y({type:"uint8",size:16})],ae.prototype,"ulUnicodeRange",2),le([y({type:"char",size:4})],ae.prototype,"achVendID",2),le([y("uint16")],ae.prototype,"fsSelection",2),le([y("uint16")],ae.prototype,"usFirstCharIndex",2),le([y("uint16")],ae.prototype,"usLastCharIndex",2),le([y("int16")],ae.prototype,"sTypoAscender",2),le([y("int16")],ae.prototype,"sTypoDescender",2),le([y("int16")],ae.prototype,"sTypoLineGap",2),le([y("uint16")],ae.prototype,"usWinAscent",2),le([y("uint16")],ae.prototype,"usWinDescent",2),le([y({offset:72,type:"uint8",size:8})],ae.prototype,"ulCodePageRange",2),le([y({offset:72,type:"int16"})],ae.prototype,"sxHeight",2),le([y("int16")],ae.prototype,"sCapHeight",2),le([y("uint16")],ae.prototype,"usDefaultChar",2),le([y("uint16")],ae.prototype,"usBreakChar",2),le([y("uint16")],ae.prototype,"usMaxContext",2),ae=le([Ye("OS/2","os2")],ae);var zd=Object.defineProperty,Wd=Object.getOwnPropertyDescriptor,Ft=(r,A,e,t)=>{for(var i=t>1?void 0:t?Wd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&zd(A,e,i),i};let Ct=class extends Ze{constructor(r=new ArrayBuffer(32),A,e){super(r,A,e)}};Ft([y("fixed")],Ct.prototype,"format",2),Ft([y("fixed")],Ct.prototype,"italicAngle",2),Ft([y("int16")],Ct.prototype,"underlinePosition",2),Ft([y("int16")],Ct.prototype,"underlineThickness",2),Ft([y("uint32")],Ct.prototype,"isFixedPitch",2),Ft([y("uint32")],Ct.prototype,"minMemType42",2),Ft([y("uint32")],Ct.prototype,"maxMemType42",2),Ft([y("uint32")],Ct.prototype,"minMemType1",2),Ft([y("uint32")],Ct.prototype,"maxMemType1",2),Ct=Ft([Ye("post")],Ct);var Vd=Object.defineProperty,qd=Object.getOwnPropertyDescriptor,ot=(r,A,e,t)=>{for(var i=t>1?void 0:t?qd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Vd(A,e,i),i};let We=class extends Ze{constructor(r=new ArrayBuffer(36),A){super(r,A,Math.min(36,r.byteLength-(A??0)))}};ot([y("fixed")],We.prototype,"version",2),ot([y("int16")],We.prototype,"vertTypoAscender",2),ot([y("int16")],We.prototype,"vertTypoDescender",2),ot([y("int16")],We.prototype,"vertTypoLineGap",2),ot([y("int16")],We.prototype,"advanceHeightMax",2),ot([y("int16")],We.prototype,"minTopSideBearing",2),ot([y("int16")],We.prototype,"minBottomSideBearing",2),ot([y("int16")],We.prototype,"yMaxExtent",2),ot([y("int16")],We.prototype,"caretSlopeRise",2),ot([y("int16")],We.prototype,"caretSlopeRun",2),ot([y("int16")],We.prototype,"caretOffset",2),ot([y({type:"int16",size:4})],We.prototype,"reserved",2),ot([y("int16")],We.prototype,"metricDataFormat",2),ot([y("int16")],We.prototype,"numOfLongVerMetrics",2),We=ot([Ye("vhea")],We);var Xd=Object.getOwnPropertyDescriptor,jd=(r,A,e,t)=>{for(var i=t>1?void 0:t?Xd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let Jr=class extends Ze{constructor(){super(...arguments);u(this,"_metrics")}static from(A){const e=A.length*4,t=new Jr(new ArrayBuffer(e));return A.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 A=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:A}).map((n,o)=>(o<e&&(i=t.readUint16()),{advanceHeight:i,topSideBearing:t.readUint8()}))}};Jr=jd([Ye("vmtx")],Jr);var Zd=Object.defineProperty,Zi=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Zd(A,e,i),i};class Qt extends Rr{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(jA(e).getUint32(0))}static checksum(e){const t=jA(e);let i=t.byteLength;for(;i%4;)i++;let s=0;for(let n=0,o=i/4;n<o;n+=4)n*4<i-4&&(s+=t.getUint32(n*4,!1));return s&4294967295}static from(e){const t=f=>f+3&-4,i=e.tableViews.size,s=Array.from(e.tableViews.values()).reduce((f,I)=>f+t(I.byteLength),0),n=new this(new ArrayBuffer(12+i*16+s));n.scalerType=65536,n.numTables=i;const o=Math.log(2);n.searchRange=Math.floor(Math.log(i)/o)*16,n.entrySelector=Math.floor(n.searchRange/o),n.rangeShift=i*16-n.searchRange;let a=12+i*16,l=0;const h=n.getDirectories();e.tableViews.forEach((f,I)=>{const d=h[l++];d.tag=I,d.checkSum=this.checksum(f),d.offset=a,d.length=f.byteLength,n.view.writeBytes(f,a),a+=t(d.length)});const c=n.createSFNT().head;return c.checkSumAdjustment=0,c.checkSumAdjustment=2981146554-this.checksum(n.view),n}getDirectories(){let e=this.view.byteOffset+12;return Array.from({length:this.numTables},()=>{const t=new ZA(this.view.buffer,e);return e+=t.view.byteLength,t})}createSFNT(){return new DA(this.getDirectories().reduce((e,t)=>(e[t.tag]=new DataView(this.view.buffer,this.view.byteOffset+t.offset,t.length),e),{}))}}u(Qt,"signature",new Set([65536,1953658213,1954115633])),Zi([y("uint32")],Qt.prototype,"scalerType"),Zi([y("uint16")],Qt.prototype,"numTables"),Zi([y("uint16")],Qt.prototype,"searchRange"),Zi([y("uint16")],Qt.prototype,"entrySelector"),Zi([y("uint16")],Qt.prototype,"rangeShift");class Kr extends Qt{constructor(){super(...arguments);u(this,"format","OpenType");u(this,"mimeType","font/otf")}static from(e){return super.from(e)}}u(Kr,"signature",new Set([1330926671]));var $d=Object.defineProperty,$i=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&$d(A,e,i),i};class PA extends ft{constructor(A,e){super(A,e,20)}}$i([y({type:"char",size:4})],PA.prototype,"tag"),$i([y("uint32")],PA.prototype,"offset"),$i([y("uint32")],PA.prototype,"compLength"),$i([y("uint32")],PA.prototype,"origLength"),$i([y("uint32")],PA.prototype,"origChecksum");var eI=Object.defineProperty,dt=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&eI(A,e,i),i};const ct=(EA=class extends Rr{constructor(){super(...arguments);u(this,"format","WOFF");u(this,"mimeType","font/woff");u(this,"_sfnt")}get subfontFormat(){return Qt.is(this.flavor)?"TrueType":Kr.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(jA(e).getUint32(0))}static checkSum(e){const t=jA(e),i=t.byteLength,s=Math.floor(i/4);let n=0,o=0;for(;o<s;)n+=t.getUint32(4*o++,!1);let a=i-s*4;if(a){let l=s*4;for(;a>0;)n+=t.getUint8(l)<<a*8,l++,a--}return n%4294967296}static from(e,t=new ArrayBuffer(0)){const i=f=>f+3&-4,s=[];e.tableViews.forEach((f,I)=>{const d=jA(Jf(new Uint8Array(f.buffer,f.byteOffset,f.byteLength)));s.push({tag:I,view:d.byteLength<f.byteLength?d:f,rawView:f})});const n=s.length,o=s.reduce((f,I)=>f+i(I.view.byteLength),0),a=new EA(new ArrayBuffer(44+20*n+o+t.byteLength));a.signature=2001684038,a.flavor=65536,a.length=a.view.byteLength,a.numTables=n,a.totalSFNTSize=12+16*n+s.reduce((f,I)=>f+i(I.rawView.byteLength),0);let l=44+n*20,h=0;const c=a.getDirectories();return s.forEach(f=>{const I=c[h++];I.tag=f.tag,I.offset=l,I.compLength=f.view.byteLength,I.origChecksum=EA.checkSum(f.rawView),I.origLength=f.rawView.byteLength,a.view.writeBytes(f.view,l),l+=i(I.compLength)}),a.view.writeBytes(t),a}getDirectories(){let e=44;return Array.from({length:this.numTables},()=>{const t=new PA(this.view.buffer,e);return e+=t.view.byteLength,t})}createSFNT(){return new DA(this.getDirectories().reduce((e,t)=>{const i=t.tag,s=this.view.byteOffset+t.offset,n=t.compLength,o=t.origLength,a=s+n;return e[i]=n>=o?new DataView(this.view.buffer,s,n):new DataView(Kf(new Uint8Array(this.view.buffer.slice(s,a))).buffer),e},{}))}},u(EA,"signature",new Set([2001684038])),EA);dt([y("uint32")],ct.prototype,"signature"),dt([y("uint32")],ct.prototype,"flavor"),dt([y("uint32")],ct.prototype,"length"),dt([y("uint16")],ct.prototype,"numTables"),dt([y("uint16")],ct.prototype,"reserved"),dt([y("uint32")],ct.prototype,"totalSFNTSize"),dt([y("uint16")],ct.prototype,"majorVersion"),dt([y("uint16")],ct.prototype,"minorVersion"),dt([y("uint32")],ct.prototype,"metaOffset"),dt([y("uint32")],ct.prototype,"metaLength"),dt([y("uint32")],ct.prototype,"metaOrigLength"),dt([y("uint32")],ct.prototype,"privOffset"),dt([y("uint32")],ct.prototype,"privLength");let Yr=ct;function Fl(r,A=!0){if(Qt.is(r))return new Qt(r);if(Kr.is(r))return new Kr(r);if(Yr.is(r))return new Yr(r);if(A)throw new Error("Failed to parseFont")}function Tl(r,A=!0){const e=Fl(r,!1);if(e)return e;if(A)throw new Error("Failed to parseFont")}const os=class os{constructor(){u(this,"fallbackFont");u(this,"loading",new Map);u(this,"loaded",new Map);u(this,"familyToUrl",new Map)}setFallbackFont(A){this.fallbackFont=A}async loadFallbackFont(A,e={}){this.fallbackFont=await this.load(A,e)}_createRequest(A,e){const t=new AbortController;return{url:A,when:fetch(A,{...os.defaultRequestInit,...e,signal:t.signal}).then(i=>i.arrayBuffer()),cancel:()=>t.abort()}}injectFontFace(A,e){return document.fonts.add(new FontFace(A,e)),this}injectStyleTag(A,e){const t=document.createElement("style");return t.appendChild(document.createTextNode(`@font-face {
|
|
858
858
|
font-family: "${A}";
|
|
859
859
|
src: url(${e});
|
|
860
860
|
}`)),document.head.appendChild(t),this}_parseUrls(A){const e=Array.from(new Set([...A.split(","),A]));return Array.from(new Set(e.map(t=>this.familyToUrl.get(t.trim())??this.familyToUrl.get(t)??t)))}get(A){let e;return A&&(e=this._parseUrls(A).reduce((i,s)=>i||this.loaded.get(s),void 0)),e??this.fallbackFont}set(A,e){return this.familyToUrl.set(A,e.src),this.loaded.set(e.src,e),this}delete(A){return this._parseUrls(A).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(A,e={}){const{cancelOther:t,injectFontFace:i=!0,injectStyleTag:s=!0,...n}=e;let o,a;if(typeof A=="string"?o=A:{src:o,family:a}=A,this.loaded.has(o))return t&&(this.loading.forEach(I=>I.cancel()),this.loading.clear()),c(this.loaded.get(o));let l=this.loading.get(o);return l||(l=this._createRequest(o,n),this.loading.set(o,l)),t&&this.loading.forEach((I,d)=>{I!==l&&(I.cancel(),this.loading.delete(d))}),l.when.then(I=>{if(this.loaded.has(o))return c(this.loaded.get(o));{const d=f(I);return e.noAdd||this.loaded.set(o,d),d.familySet.forEach(C=>{this.familyToUrl.set(C,o),typeof document<"u"&&(i&&this.injectFontFace(C,I),s&&this.injectStyleTag(C,o))}),d}}).catch(I=>{if(I instanceof DOMException&&I.message==="The user aborted a request.")return f();throw I}).finally(()=>{this.loading.delete(o)});function h(){return a?Array.isArray(a)?a:[a]:[]}function c(I){return h().forEach(d=>{I.familySet.add(d)}),I}function f(I=new ArrayBuffer(0)){let d;function C(){return d||(d=I.byteLength?Tl(I,!1):void 0),d}function p(){const S=C();if(S instanceof Qt||S instanceof Yr)return S.sfnt}return{src:o,family:a,buffer:I,familySet:new Set(h()),getFont:C,getSFNT:p}}}async waitUntilLoad(){await Promise.all(Array.from(this.loading.values()).map(A=>A.when))}};u(os,"defaultRequestInit",{cache:"force-cache"});let zr=os;const Gl=new zr,tI=Object.freeze(Object.defineProperty({__proto__:null,BaseFont:Rr,get Cff(){return xA},get Cmap(){return ei},CmapSubtableFormat0:xn,CmapSubtableFormat12:Pn,CmapSubtableFormat14:ji,CmapSubtableFormat2:Vi,CmapSubtableFormat4:Rn,CmapSubtableFormat6:MA,FontDataObject:ft,FontDataView:Fe,Fonts:zr,get Glyf(){return Gr},Glyph:_n,GlyphSet:bn,get Gpos(){return Nn},get Gsub(){return $t},get Head(){return Re},get Hhea(){return ze},get Hmtx(){return Lr},get Kern(){return Fn},get Loca(){return Or},get Maxp(){return Ge},get Name(){return ti},get Os2(){return ae},get Post(){return Ct},SFNT:DA,TTF:Qt,TableDirectory:ZA,get Vhea(){return We},get Vmtx(){return Jr},WOFF:Yr,WOFFTableDirectoryEntry:PA,createCmapSegments:Mn,dataTypeToByteLength:Yi,defineColumn:y,defineSFNTTable:Ye,fonts:Gl,parseFont:Tl,parseSFNTFont:Fl},Symbol.toStringTag,{value:"Module"}));function Gn(r,A,e){if(typeof A=="string"&&A.startsWith("linear-gradient")){const{x0:t,y0:i,x1:s,y1:n,stops:o}=AI(A,e.left,e.top,e.width,e.height),a=r.createLinearGradient(t,i,s,n);return o.forEach(l=>a.addColorStop(l.offset,l.color)),a}return A}function Wr(r,A,e){r!=null&&r.color&&(r.color=Gn(e,r.color,A)),r!=null&&r.backgroundColor&&(r.backgroundColor=Gn(e,r.backgroundColor,A)),r!=null&&r.textStrokeColor&&(r.textStrokeColor=Gn(e,r.textStrokeColor,A))}function AI(r,A,e,t,i){var I;const s=((I=r.match(/linear-gradient\((.+)\)$/))==null?void 0:I[1])??"",n=s.split(",")[0],o=n.includes("deg")?n:"0deg",a=s.replace(o,"").matchAll(/(#|rgba|rgb)(.+?) ([\d.]+%)/gi),h=(Number(o.replace("deg",""))||0)*Math.PI/180,c=t*Math.sin(h),f=i*Math.cos(h);return{x0:A+t/2-c,y0:e+i/2+f,x1:A+t/2+c,y1:e+i/2-f,stops:Array.from(a).map(d=>{let C=d[2];return C.startsWith("(")?C=C.split(",").length>3?`rgba${C}`:`rgb${C}`:C=`#${C}`,{offset:Number(d[3].replace("%",""))/100,color:C}})}}function Ai(r){const{ctx:A,path:e,fontSize:t,clipRect:i}=r;A.save(),A.beginPath();const s=e.style,n={...s,fill:r.color??s.fill,stroke:r.textStrokeColor??s.stroke,strokeWidth:r.textStrokeWidth?r.textStrokeWidth*t:s.strokeWidth,strokeLinecap:"round",strokeLinejoin:"round",shadowOffsetX:(r.shadowOffsetX??0)*t,shadowOffsetY:(r.shadowOffsetY??0)*t,shadowBlur:(r.shadowBlur??0)*t,shadowColor:r.shadowColor};i&&(A.rect(i.left,i.top,i.width,i.height),A.clip(),A.beginPath()),e.drawTo(A,n),A.restore()}function iI(r,A,e){const{left:t,top:i,width:s,height:n}=e,o=r.canvas;o.dataset.viewBox=`${t} ${i} ${s} ${n}`,o.dataset.pixelRatio=String(A);const a=s,l=n;o.width=Math.max(1,Math.ceil(a*A)),o.height=Math.max(1,Math.ceil(l*A)),o.style.width=`${a}px`,o.style.height=`${l}px`,r.clearRect(0,0,o.width,o.height),r.scale(A,A),r.translate(-t,-i)}function rI(r,A){const{paragraphs:e,computedStyle:t,glyphBox:i}=A;Wr(t,i,r),e.forEach(s=>{Wr(s.computedStyle,s.lineBox,r),s.fragments.forEach(n=>{Wr(n.computedStyle,n.inlineBox,r)})})}const sI=new Set(["©","®","÷"]),nI=new Set(["—","…","“","”","﹏","﹋","﹌","‘","’","˜"]),oI={1:"italic",32:"bold"},aI={1:"italic",2:"bold"},Ll={100:-.2,200:-.1,300:0,400:0,normal:0,500:.1,600:.2,700:.3,bold:.3,800:.4,900:.5};class lI{constructor(A,e,t){u(this,"path",new Ne);u(this,"lineBox",new ce);u(this,"inlineBox",new ce);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=A,this.index=e,this.parent=t}get compatibleGlyphBox(){const A=this.computedStyle.fontSize*.8;return this.glyphBox??(this.isVertical?new ce(this.lineBox.left+this.lineBox.width/2-A/2,this.lineBox.top,A,this.lineBox.height):new ce(this.lineBox.left,this.lineBox.top+this.lineBox.height/2-A/2,this.lineBox.width,A))}get center(){return this.compatibleGlyphBox.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(A){const e=this.computedStyle.fontFamily,t=A??Gl,i=e?t.get(e):t.fallbackFont;return i==null?void 0:i.getSFNT()}updateGlyph(A=this._getFontSFNT()){if(!A)return this;const{hhea:e,os2:t,post:i,head:s}=A,n=s.unitsPerEm,o=e.ascent,a=e.descent,{content:l,computedStyle:h,isVertical:c}=this,{fontSize:f}=h,I=n/f,d=A.getAdvanceWidth(l,f),C=(o+Math.abs(a))/I,p=o/I;return this.advanceWidth=d,this.advanceHeight=C,this.inlineBox.width=c?C:d,this.inlineBox.height=c?d:C,this.underlinePosition=(o-i.underlinePosition)/I,this.underlineThickness=i.underlineThickness/I,this.strikeoutPosition=(o-t.yStrikeoutPosition)/I,this.strikeoutSize=t.yStrikeoutSize/I,this.ascender=o/I,this.descender=a/I,this.typoAscender=t.sTypoAscender/I,this.typoDescender=t.sTypoDescender/I,this.typoLineGap=t.sTypoLineGap/I,this.winAscent=t.usWinAscent/I,this.winDescent=t.usWinDescent/I,this.xHeight=t.sxHeight/I,this.capHeight=t.sCapHeight/I,this.baseline=p,this.centerDiviation=C/2-p,this.fontStyle=oI[t.fsSelection]??aI[s.macStyle],this}update(A){const e=this._getFontSFNT(A);if(!e)return this;this.updateGlyph(e);const{isVertical:t,content:i,computedStyle:s,baseline:n,inlineBox:o,ascender:a,descender:l,typoAscender:h,fontStyle:c,advanceWidth:f,advanceHeight:I}=this,{left:d,top:C}=o,p=s.fontStyle==="italic"&&c!=="italic";let S=d,P=C+n,w;const R=new Ne;if(t&&(S+=(I-f)/2,Math.abs(f-I)>.1&&(P-=(a-h)/(a+Math.abs(l))*I),w=void 0),t&&!sI.has(i)&&(i.codePointAt(0)<=256||nI.has(i))){R.addCommands(e.getPathCommands(i,S,C+n-(I-f)/2,s.fontSize));const m={y:C-(I-f)/2+I/2,x:S+f/2};p&&this._italic(R,t?{x:m.x,y:C-(I-f)/2+n}:void 0),R.rotate(90,m)}else w!==void 0?(R.addCommands(e.glyphs.get(w).getPathCommands(S,P,s.fontSize)),p&&this._italic(R,t?{x:S+f/2,y:C+h/(a+Math.abs(l))*I}:void 0)):(R.addCommands(e.getPathCommands(i,S,P,s.fontSize)),p&&this._italic(R,t?{x:S+I/2,y:P}:void 0));const _=s.fontWeight??400;return _ in Ll&&(_===700||_==="bold")&&c!=="bold"&&R.bold(Ll[_]*s.fontSize*.05),R.style={fill:s.color,stroke:s.textStrokeWidth?s.textStrokeColor:"none",strokeWidth:s.textStrokeWidth?s.textStrokeWidth*s.fontSize*.03:0},this.path=R,this.glyphBox=this.getGlyphBoundingBox(),this}_italic(A,e){A.skew(-.24,0,e||{y:this.inlineBox.top+this.baseline,x:this.inlineBox.left+this.inlineBox.width/2})}getGlyphMinMax(A,e,t){var i;if((i=this.path.curves[0])!=null&&i.curves.length)return this.path.getMinMax(A,e,t)}getGlyphBoundingBox(A){const e=this.getGlyphMinMax(void 0,void 0,A);if(!e)return;const{min:t,max:i}=e;return new ce(t.x,t.y,i.x-t.x,i.y-t.y)}drawTo(A,e={}){const t=this.computedStyle,i={ctx:A,path:this.path,fontSize:t.fontSize,color:t.color,...e};if(this.glyphBox)Ai(i);else{A.save(),A.beginPath();const s=this.path.style,n={...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};$s(A,n),A.font=`${i.fontSize}px ${i.fontFamily}`,this.isVertical?(A.textBaseline="middle",A.fillText(this.content,this.inlineBox.left,this.inlineBox.top+this.inlineBox.height/2)):(A.textBaseline="alphabetic",A.fillText(this.content,this.inlineBox.left,this.inlineBox.top+this.baseline)),A.restore()}}}function Ol(){const r=new Map;async function A(t){if(!r.has(t)){r.set(t,t);try{r.set(t,await fetch(t).then(i=>i.text()))}catch(i){console.warn(i),r.delete(t)}}}function e(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("blob://")}return{loaded:r,needsLoad:e,load:A}}function Hl(r){const A=new Map;function e(t){let i=A.get(t);if(!i){const s=on(r.needsLoad(t)?r.loaded.get(t)??t:t),n=ln(s);i={dom:s,pathSet:n},A.set(t,i)}return i}return{parsed:A,parse:e}}function Ln(r,A){return typeof r=="number"?r:r.endsWith("%")?(r=r.substring(0,r.length-1),Math.ceil(Number(r)/100*A.total)):r.endsWith("rem")?(r=r.substring(0,r.length-3),Number(r)*A.fontSize):r.endsWith("em")?(r=r.substring(0,r.length-2),Number(r)*A.fontSize):Number(r)}function On(r){return he(r)?{}:r}function hI(r,A){const e=Object.keys(r),t=Object.keys(A);return Array.from(new Set([...e,...t])).every(s=>ii(r[s],A[s]))}function ii(r,A){const e=typeof r;return e===typeof A?e==="object"?hI(r,A):r===A:!1}function Hn(r){if(!r)return r;const A={};for(const e in r)r[e]!==""&&r[e]!==void 0&&(A[e]=r[e]);return A}class cI{constructor(A,e={},t){u(this,"inlineBox",new ce);this.content=A,this.style=e,this.parent=t,this.updateComputedStyle().initCharacters()}get computedContent(){const A=this.computedStyle;return A.textTransform==="uppercase"?this.content.toUpperCase():A.textTransform==="lowercase"?this.content.toLowerCase():this.content}updateComputedStyle(){return this.computedStyle={...this.parent.computedStyle,...Hn(this.style)},this}initCharacters(){const A=[];let e=0;for(const t of this.computedContent)A.push(new lI(t,e++,this));return this.characters=A,this}}class er{constructor(A,e){u(this,"lineBox",new ce);u(this,"fragments",[]);this.style=A,this.parentStyle=e,this.updateComputedStyle()}updateComputedStyle(){return this.computedStyle={...Hn(this.parentStyle),...Hn(this.style)},this}addFragment(A,e){const t=new cI(A,e,this);return this.fragments.push(t),t}}function pB(r){return r}const di=class di{_styleToDomStyle(A){const e={};for(const t in A){const i=A[t];di.notZeroStyles.has(t)&&i===0||(typeof i=="number"&&di.pxStyles.has(t)?e[t]=`${i}px`:e[t]=i)}return e}createParagraphDom(A,e){const t=document.createDocumentFragment(),i=document.createElement("section"),s={...e},n=e.writingMode.includes("horizontal");switch(e.textAlign){case"start":case"left":s.justifyContent="flex-start";break;case"center":s.justifyContent="center";break;case"end":case"right":s.justifyContent="flex-end";break}switch(e.verticalAlign){case"top":s.alignItems="flex-start";break;case"middle":s.alignItems="center";break;case"bottom":s.alignItems="flex-end";break}const o=!!(s.justifyContent||s.alignItems);Object.assign(i.style,{...this._styleToDomStyle({...s,boxSizing:s.boxSizing??"border-box",display:s.display??(o?"inline-flex":void 0),width:s.width??"max-content",height:s.height??"max-content"}),whiteSpace:"pre-wrap",wordBreak:"break-all",position:"fixed",visibility:"hidden"});const a=document.createElement("ul");return Object.assign(a.style,{verticalAlign:"inherit",listStyleType:"inherit",padding:"0",margin:"0",width:o&&n?"100%":void 0,height:o&&!n?"100%":void 0}),A.forEach(l=>{const h=document.createElement("li");Object.assign(h.style,{verticalAlign:"inherit",...this._styleToDomStyle(l.style)}),l.fragments.forEach(c=>{const f=document.createElement("span");Object.assign(f.style,{verticalAlign:"inherit",...this._styleToDomStyle(c.style)}),f.appendChild(document.createTextNode(c.content)),h.appendChild(f)}),a.appendChild(h)}),i.appendChild(a),t.appendChild(i),document.body.appendChild(t),{dom:i,destory:()=>{var l;return(l=i.parentNode)==null?void 0:l.removeChild(i)}}}measureDomText(A){const e=document.createRange();e.selectNodeContents(A);const t=A.data??"";let i=0;return Array.from(t).map(s=>{var c;const n=i+=t.substring(i).indexOf(s),o=n+s.length;i+=s.length,e.setStart(A,Math.max(n,0)),e.setEnd(A,o);const a=((c=e.getClientRects)==null?void 0:c.call(e))??[e.getBoundingClientRect()];let l=a[a.length-1];a.length>1&&l.width<2&&(l=a[a.length-2]);const h=e.toString();if(h!==""&&l&&l.width+l.height!==0)return{content:h,top:l.top,left:l.left,height:l.height,width:l.width}}).filter(Boolean)}measureDom(A){const e=[],t=[],i=[];return A.querySelectorAll("li").forEach((s,n)=>{const o=s.getBoundingClientRect();e.push({paragraphIndex:n,left:o.left,top:o.top,width:o.width,height:o.height}),s.querySelectorAll(":scope > *").forEach((a,l)=>{const h=a.getBoundingClientRect();t.push({paragraphIndex:n,fragmentIndex:l,left:h.left,top:h.top,width:h.width,height:h.height});let c=0;!a.children.length&&a.firstChild instanceof window.Text?this.measureDomText(a.firstChild).forEach(f=>{i.push({...f,newParagraphIndex:-1,paragraphIndex:n,fragmentIndex:l,characterIndex:c++,textWidth:-1,textHeight:-1})}):a.querySelectorAll(":scope > *").forEach(f=>{f.firstChild instanceof window.Text&&this.measureDomText(f.firstChild).forEach(I=>{i.push({...I,newParagraphIndex:-1,paragraphIndex:n,fragmentIndex:l,characterIndex:c++,textWidth:-1,textHeight:-1})})})})}),{paragraphs:e,fragments:t,characters:i}}measureParagraphDom(A,e){const t=e.getBoundingClientRect(),i=this.measureDom(e);i.paragraphs.forEach(o=>{const a=A[o.paragraphIndex];a.lineBox.left=o.left-t.left,a.lineBox.top=o.top-t.top,a.lineBox.width=o.width,a.lineBox.height=o.height}),i.fragments.forEach(o=>{const a=A[o.paragraphIndex].fragments[o.fragmentIndex];a.inlineBox.left=o.left-t.left,a.inlineBox.top=o.top-t.top,a.inlineBox.width=o.width,a.inlineBox.height=o.height});const s=[];let n=0;return i.characters.forEach(o=>{const{paragraphIndex:a,fragmentIndex:l,characterIndex:h}=o;s.push({...o,newParagraphIndex:a,left:o.left-t.left,top:o.top-t.top});const c=A[a].fragments[l].characters[h],{fontHeight:f,isVertical:I}=c,d=s[n];c.inlineBox.left=d.left,c.inlineBox.top=d.top,c.inlineBox.width=d.width,c.inlineBox.height=d.height,I?(c.lineBox.left=d.left+(d.width-f)/2,c.lineBox.top=d.top,c.lineBox.width=f,c.lineBox.height=d.height):(c.lineBox.left=d.left,c.lineBox.top=d.top+(d.height-f)/2,c.lineBox.width=d.width,c.lineBox.height=f),n++}),{paragraphs:A,boundingBox:new ce(0,0,t.width,t.height)}}measure(A,e,t){let i;t||({dom:t,destory:i}=this.createParagraphDom(A,e));const s=this.measureParagraphDom(A,t);return i==null||i(),s}};u(di,"notZeroStyles",new Set(["width","height"])),u(di,"pxStyles",new Set(["width","height","fontSize","letterSpacing","textStrokeWidth","textIndent","shadowOffsetX","shadowOffsetY","shadowBlur","margin","marginLeft","marginTop","marginRight","marginBottom","padding","paddingLeft","paddingTop","paddingRight","paddingBottom"]));let Jn=di;class gI{constructor(){u(this,"eventListeners",new Map)}addEventListener(A,e,t){const i={value:e,options:t},s=this.eventListeners.get(A);return s?Array.isArray(s)?s.push(i):this.eventListeners.set(A,[s,i]):this.eventListeners.set(A,i),this}removeEventListener(A,e,t){var s,n;if(!e)return this.eventListeners.delete(A),this;const i=this.eventListeners.get(A);if(!i)return this;if(Array.isArray(i)){const o=[];for(let a=0,l=i.length;a<l;a++){const h=i[a];(h.value!==e||typeof t=="object"&&(t!=null&&t.once)&&(typeof h.options=="boolean"||!((s=h.options)!=null&&s.once)))&&o.push(h)}o.length?this.eventListeners.set(A,o.length===1?o[0]:o):this.eventListeners.delete(A)}else i.value===e&&(typeof t=="boolean"||!(t!=null&&t.once)||typeof i.options=="boolean"||(n=i.options)!=null&&n.once)&&this.eventListeners.delete(A);return this}removeAllListeners(){return this.eventListeners.clear(),this}hasEventListener(A){return this.eventListeners.has(A)}dispatchEvent(A,e){var i,s;const t=this.eventListeners.get(A);if(t){if(Array.isArray(t))for(let n=t.length,o=0;o<n;o++){const a=t[o];typeof a.options=="object"&&((i=a.options)!=null&&i.once)&&this.off(A,a.value,a.options),a.value.apply(this,[e])}else typeof t.options=="object"&&((s=t.options)!=null&&s.once)&&this.off(A,t.value,t.options),t.value.apply(this,[e]);return!0}else return!1}on(A,e,t){return this.addEventListener(A,e,t)}once(A,e){return this.addEventListener(A,e,{once:!0})}off(A,e,t){return this.removeEventListener(A,e,t)}emit(A,e){this.dispatchEvent(A,e)}}function uI(){const r=new nA,A=Ol(),e=Hl(A);return{name:"background",pathSet:r,load:async t=>{const{backgroundImage:i}=t.style;i&&A.needsLoad(i)&&await A.load(i)},update:t=>{r.paths.length=0;const{style:i,lineBox:s,isVertical:n}=t,{backgroundImage:o,backgroundSize:a,backgroundColormap:l}=i;if(he(o))return;const{pathSet:h}=e.parse(o),c=h.getBoundingBox(!0);let f,I,d,C;n?{x:I,y:f,width:C,height:d}=s:{x:f,y:I,width:d,height:C}=s;const p=On(l??"none"),S=h.paths.map(_=>{const m=_.clone();return m.style.fill&&m.style.fill in p&&(m.style.fill=p[m.style.fill]),m.style.stroke&&m.style.stroke in p&&(m.style.stroke=p[m.style.stroke]),m});let P,w;if(a==="rigid"){P=Math.max(t.fontSize*5/c.width),w=P;const _=new G;_.x=c.width-d/P,_.y=c.height-C/w,S.forEach(m=>{m.applyTransform(b=>{const D=b.x>c.left+c.width/2,z=b.y>c.top+c.height/2;D&&(b.x-=_.x),z&&(b.y-=_.y)})})}else P=d/c.width,w=C/c.height;const R=new Ke;R.translate(-c.x,-c.y),R.scale(P,w),n&&(R.translate(-d/2,-C/2),R.rotate(-Math.PI/2),R.translate(C/2,d/2)),R.translate(f,I),S.forEach(_=>{_.applyTransform(m=>{m.applyMatrix3(R)})}),r.paths.push(...S)},renderOrder:-2,render:(t,i)=>{const{boundingBox:s,computedStyle:n}=i;he(n.backgroundColor)||(t.fillStyle=n.backgroundColor,t.fillRect(...s.array)),r.paths.forEach(o=>{if(Ai({ctx:t,path:o,fontSize:n.fontSize}),i.debug){const a=new nA([o]).getBoundingBox();a&&t.strokeRect(a.x,a.y,a.width,a.height)}}),i.paragraphs.forEach(o=>{const{lineBox:a,style:l}=o;he(l.backgroundColor)||(t.fillStyle=l.backgroundColor,t.fillRect(...a.array)),o.fragments.forEach(h=>{const{inlineBox:c,style:f}=h;he(f.backgroundColor)||(t.fillStyle=f.backgroundColor,t.fillRect(...c.array))})})}}}function Kn(r){const{highlight:A,highlightImage:e,highlightReferImage:t,highlightColormap:i,highlightLine:s,highlightSize:n,highlightThickness:o}=r;return{image:(A==null?void 0:A.image)??e??"none",referImage:(A==null?void 0:A.referImage)??t??"none",colormap:(A==null?void 0:A.colormap)??i??"none",line:(A==null?void 0:A.line)??s??"none",size:(A==null?void 0:A.size)??n??"cover",thickness:(A==null?void 0:A.thickness)??o??"100%"}}function fI(){const r=new nA,A=[],e=Ol(),t=Hl(e);return{name:"highlight",pathSet:r,load:async i=>{const s=new Set;i.forEachCharacter(n=>{const{computedStyle:o}=n,{image:a,referImage:l}=Kn(o);a&&e.needsLoad(a)&&s.add(a),l&&e.needsLoad(l)&&s.add(l)}),await Promise.all(Array.from(s).map(n=>e.load(n)))},update:i=>{A.length=0,r.paths.length=0;let s=[],n,o;i.forEachCharacter(a=>{const{computedStyle:l}=a,h=Kn(l),{image:c,colormap:f,line:I,size:d,thickness:C}=h;if(he(c))n!=null&&n.length&&(n=[],s.push(n));else{const{inlineBox:p,isVertical:S}=a,{fontSize:P}=l;(!o||ii(o.image,c)&&ii(o.colormap,f)&&ii(o.line,I)&&ii(o.size,d)&&ii(o.thickness,C))&&(n!=null&&n.length)&&(S?n[0].inlineBox.left===p.left:n[0].inlineBox.top===p.top)&&n[0].fontSize===P?n.push(a):(n=[],n.push(a),s.push(n))}o=h}),s=s.filter(a=>a.length);for(let a=0;a<s.length;a++){const l=s[a],h=l[0],c=ce.from(...l.map(J=>J.compatibleGlyphBox));if(!c.height||!c.width)continue;const{computedStyle:f,isVertical:I,inlineBox:d,compatibleGlyphBox:C,strikeoutPosition:p,underlinePosition:S}=h,{fontSize:P}=f,{image:w,referImage:R,colormap:_,line:m,size:b,thickness:D}=Kn(f),z=Ln(D,{fontSize:P,total:c.width})/c.width,Ae=On(_),{pathSet:V,dom:K}=t.parse(w),te=V.getBoundingBox(!0),W=P/te.width*2,L=new ce().copy(c);I&&(L.width=c.height,L.height=c.width,L.left=c.left+c.width);const se=Math.floor(L.width);let H=se;b!=="cover"&&(H=Ln(b,{fontSize:P,total:c.width})||se,L.width=H);const q=!he(R)&&he(m);if(q)te.copy(t.parse(R).pathSet.getBoundingBox(!0));else{let J;if(he(m))if(te.width/te.height>4){J="underline";const $=K.getAttribute("viewBox");if($){const[N,U,X,ee]=$.split(" ").map(j=>Number(j)),oe=U+ee/2;te.y<oe&&te.y+te.height>oe?J="line-through":te.y+te.height<oe?J="overline":J="underline"}}else J="outline";else J=m;switch(J){case"outline":{const $=L.width*.2,N=L.height*.2;I?(L.x-=N/2,L.y-=$/2,L.x-=L.height):(L.x-=$/2,L.y-=N/2),L.width+=$,L.height+=N;break}case"overline":L.height=te.height*W,I?L.x=d.left+d.width:L.y=d.top;break;case"line-through":L.height=te.height*W,I?L.x=d.left+d.width-p+L.height/2:L.y=d.top+p-L.height/2;break;case"underline":L.height=te.height*W,I?L.x=C.left+C.width-S:L.y=d.top+S;break}}const ie=new Ke;if(ie.translate(-te.x,-te.y),ie.scale(L.width/te.width,L.height/te.height),I){const J=L.width/2,$=L.height/2;q||ie.translate(-J,-$),ie.rotate(-Math.PI/2),q||ie.translate($,J)}ie.translate(L.x,L.y);for(let J=0;J<Math.ceil(se/H);J++){const $=ie.clone();I?$.translate(0,J*L.width):$.translate(J*L.width,0),V.paths.forEach(N=>{const U=N.clone().applyTransform($);U.style.strokeWidth&&(U.style.strokeWidth*=W*z),U.style.strokeMiterlimit&&(U.style.strokeMiterlimit*=W),U.style.strokeDashoffset&&(U.style.strokeDashoffset*=W),U.style.strokeDasharray&&(U.style.strokeDasharray=U.style.strokeDasharray.map(X=>X*W)),U.style.fill&&U.style.fill in Ae&&(U.style.fill=Ae[U.style.fill]),U.style.stroke&&U.style.stroke in Ae&&(U.style.stroke=Ae[U.style.stroke]),r.paths.push(U),se!==H&&(I?A[r.paths.length-1]=new ce(c.left-c.width*2,c.top,c.width*4,c.height):A[r.paths.length-1]=new ce(c.left,c.top-c.height*2,c.width,c.height*4))})}}},renderOrder:-1,getBoundingBox:()=>{const i=[];return r.paths.forEach((s,n)=>{const o=A[n];let a=s.getBoundingBox();if(o){const l=Math.max(a.x,o.x),h=Math.max(a.y,o.y),c=Math.min(a.right,o.right),f=Math.min(a.bottom,o.bottom);a=new ce(l,h,c-l,f-h)}i.push(a)}),ce.from(...i)},render:(i,s)=>{r.paths.forEach((n,o)=>{if(Ai({ctx:i,path:n,fontSize:s.computedStyle.fontSize,clipRect:A[o]}),s.debug){const a=new nA([n]).getBoundingBox();a&&i.strokeRect(a.x,a.y,a.width,a.height)}})}}}function dI(r,A){return`<svg width="${r*2}" height="${r*2}" xmlns="http://www.w3.org/2000/svg">
|
package/dist/index.mjs
CHANGED
|
@@ -9012,51 +9012,40 @@ class BaseElement2DFill extends CoreObject {
|
|
|
9012
9012
|
);
|
|
9013
9013
|
}
|
|
9014
9014
|
_getDrawOptions() {
|
|
9015
|
-
let textureTransform;
|
|
9016
9015
|
let disableWrapMode = false;
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
const {
|
|
9021
|
-
|
|
9022
|
-
|
|
9023
|
-
|
|
9024
|
-
|
|
9025
|
-
|
|
9026
|
-
|
|
9027
|
-
|
|
9028
|
-
|
|
9029
|
-
|
|
9030
|
-
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
const h = Math.abs(1 + (-top + -bottom)) * height;
|
|
9051
|
-
const scaleX = 1 / w;
|
|
9052
|
-
const scaleY = 1 / h;
|
|
9053
|
-
const translateX = -left * width * scaleX;
|
|
9054
|
-
const translateY = -top * height * scaleY;
|
|
9055
|
-
textureTransform.scale(scaleX, scaleY).translate(translateX, translateY);
|
|
9056
|
-
disableWrapMode = true;
|
|
9057
|
-
} else {
|
|
9058
|
-
textureTransform.scale(1 / width, 1 / height);
|
|
9059
|
-
}
|
|
9016
|
+
const { width, height } = this.parent.size;
|
|
9017
|
+
const textureTransform = new Transform2D().scale(1 / width, 1 / height);
|
|
9018
|
+
if (this.cropRect) {
|
|
9019
|
+
const {
|
|
9020
|
+
left = 0,
|
|
9021
|
+
top = 0,
|
|
9022
|
+
right = 0,
|
|
9023
|
+
bottom = 0
|
|
9024
|
+
} = this.cropRect;
|
|
9025
|
+
textureTransform.scale(
|
|
9026
|
+
Math.abs(1 - (left + right)),
|
|
9027
|
+
Math.abs(1 - (top + bottom))
|
|
9028
|
+
).translate(left, top);
|
|
9029
|
+
disableWrapMode = true;
|
|
9030
|
+
}
|
|
9031
|
+
if (this.tile) {
|
|
9032
|
+
const {
|
|
9033
|
+
translateX = 0,
|
|
9034
|
+
translateY = 0,
|
|
9035
|
+
scaleX = 1,
|
|
9036
|
+
scaleY = 1
|
|
9037
|
+
// flip, TODO
|
|
9038
|
+
// alignment, TODO
|
|
9039
|
+
} = this.tile;
|
|
9040
|
+
textureTransform.translate(-translateX / width, -translateY / height).scale(1 / scaleX, 1 / scaleY);
|
|
9041
|
+
disableWrapMode = true;
|
|
9042
|
+
} else if (this.stretchRect) {
|
|
9043
|
+
const { left = 0, top = 0, right = 0, bottom = 0 } = this.stretchRect;
|
|
9044
|
+
textureTransform.scale(
|
|
9045
|
+
Math.abs(1 - (-left + -right)),
|
|
9046
|
+
Math.abs(1 - (-top + -bottom))
|
|
9047
|
+
).translate(-left, -top);
|
|
9048
|
+
disableWrapMode = true;
|
|
9060
9049
|
}
|
|
9061
9050
|
return { disableWrapMode, textureTransform };
|
|
9062
9051
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "modern-canvas",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.43",
|
|
5
5
|
"packageManager": "pnpm@9.15.1",
|
|
6
6
|
"description": "A JavaScript WebGL rendering engine.",
|
|
7
7
|
"author": "wxm",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"colord": "^2.9.3",
|
|
71
71
|
"earcut": "^3.0.1",
|
|
72
72
|
"modern-font": "^0.4.1",
|
|
73
|
-
"modern-idoc": "^0.6.
|
|
73
|
+
"modern-idoc": "^0.6.9",
|
|
74
74
|
"modern-path2d": "^1.3.0",
|
|
75
75
|
"modern-text": "^1.4.2",
|
|
76
76
|
"yoga-layout": "^3.2.1"
|