@zyzgroup/core-web 0.0.62 → 0.0.64
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/animate_ce.css +15 -0
- package/dist/better.css +11 -9
- package/dist/effects.css +20 -0
- package/dist/theme.css +4 -4
- package/dist/zyzgroup_core_web.iife.js +20 -24
- package/dist/zyzgroup_core_web.iife.js.map +1 -1
- package/dist/zyzgroup_core_web.js +9333 -15375
- package/dist/zyzgroup_core_web.js.map +1 -1
- package/dist/zyzgroup_core_web.umd.cjs +20 -24
- package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/types/animate/AnimateOperation.d.ts +35 -30
- package/types/animate/AnimateOperation.d.ts.map +1 -1
- package/types/animate/animateInWeb.d.ts +1 -0
- package/types/animate/animateInWeb.d.ts.map +1 -1
- package/types/canvas/Canvas.d.ts +35 -0
- package/types/canvas/Canvas.d.ts.map +1 -0
- package/types/canvas/CanvasOperation.d.ts +17 -8
- package/types/canvas/CanvasOperation.d.ts.map +1 -1
- package/types/canvas/index.d.ts +1 -0
- package/types/canvas/index.d.ts.map +1 -1
- package/types/dom/DOMEventBus.d.ts +41 -19
- package/types/dom/DOMEventBus.d.ts.map +1 -1
- package/types/dom/DOMParse.d.ts +28 -0
- package/types/dom/DOMParse.d.ts.map +1 -0
- package/types/dom/DOMUtil.d.ts +57 -12
- package/types/dom/DOMUtil.d.ts.map +1 -1
- package/types/dom/index.d.ts +2 -5
- package/types/dom/index.d.ts.map +1 -1
- package/types/env.d.ts +1 -0
- package/types/env.d.ts.map +1 -1
- package/types/fetch.d.ts +1 -0
- package/types/fetch.d.ts.map +1 -1
- package/types/file.d.ts.map +1 -1
- package/types/{UPNG.d.ts → image/UPNG.d.ts} +1 -1
- package/types/image/UPNG.d.ts.map +1 -0
- package/types/image/image-gif.d.ts.map +1 -0
- package/types/{image.d.ts → image/image.d.ts} +5 -1
- package/types/image/image.d.ts.map +1 -0
- package/types/image/index.d.ts +4 -0
- package/types/image/index.d.ts.map +1 -0
- package/types/image/qrcode.d.ts.map +1 -0
- package/types/index.d.ts +2 -4
- package/types/index.d.ts.map +1 -1
- package/types/math/Arc.d.ts +24 -0
- package/types/math/Arc.d.ts.map +1 -0
- package/types/math/CubicBezier.d.ts +28 -0
- package/types/math/CubicBezier.d.ts.map +1 -0
- package/types/math/Ellipse.d.ts +18 -0
- package/types/math/Ellipse.d.ts.map +1 -0
- package/types/math/Line.d.ts +20 -0
- package/types/math/Line.d.ts.map +1 -0
- package/types/math/Matrix.d.ts +1 -1
- package/types/math/Matrix.d.ts.map +1 -1
- package/types/{shape → math}/PathGroup.d.ts +18 -25
- package/types/math/PathGroup.d.ts.map +1 -0
- package/types/math/Point.d.ts +27 -0
- package/types/math/Point.d.ts.map +1 -0
- package/types/math/Points.d.ts +23 -0
- package/types/math/Points.d.ts.map +1 -0
- package/types/math/QuadraticBezier.d.ts +22 -0
- package/types/math/QuadraticBezier.d.ts.map +1 -0
- package/types/math/Rect.d.ts +29 -0
- package/types/math/Rect.d.ts.map +1 -0
- package/types/math/Shape.d.ts +68 -0
- package/types/math/Shape.d.ts.map +1 -0
- package/types/math/ShapeFromSVG.d.ts +30 -0
- package/types/math/ShapeFromSVG.d.ts.map +1 -0
- package/types/math/index.d.ts +13 -1
- package/types/math/index.d.ts.map +1 -1
- package/types/math/math.d.ts +3 -2
- package/types/math/math.d.ts.map +1 -1
- package/types/math/shapes/Arrow.d.ts +10 -0
- package/types/math/shapes/Arrow.d.ts.map +1 -0
- package/types/math/shapes/Fox.d.ts +10 -0
- package/types/math/shapes/Fox.d.ts.map +1 -0
- package/types/math/shapes/index.d.ts +3 -0
- package/types/math/shapes/index.d.ts.map +1 -0
- package/types/position.d.ts +37 -13
- package/types/position.d.ts.map +1 -1
- package/types/{shape/shapes → shapes}/ShapeArmyAnts.d.ts +1 -1
- package/types/shapes/ShapeArmyAnts.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeBase.d.ts +2 -2
- package/types/shapes/ShapeBase.d.ts.map +1 -0
- package/types/shapes/ShapeHeart.d.ts +15 -0
- package/types/shapes/ShapeHeart.d.ts.map +1 -0
- package/types/shapes/ShapeLight.d.ts.map +1 -0
- package/types/shapes/ShapePoint3d.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeRabbit.d.ts +1 -1
- package/types/shapes/ShapeRabbit.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeShip.d.ts +1 -1
- package/types/shapes/ShapeShip.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeSlider.d.ts +1 -1
- package/types/shapes/ShapeSlider.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeSpirograph.d.ts +1 -1
- package/types/shapes/ShapeSpirograph.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeStar.d.ts +1 -1
- package/types/shapes/ShapeStar.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeTiger.d.ts +1 -1
- package/types/shapes/ShapeTiger.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeTree.d.ts +1 -1
- package/types/shapes/ShapeTree.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeTriangle.d.ts +1 -1
- package/types/shapes/ShapeTriangle.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeTriangleLight.d.ts +1 -1
- package/types/shapes/ShapeTriangleLight.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/index.d.ts +1 -7
- package/types/shapes/index.d.ts.map +1 -0
- package/types/svg/DOMSVGUtil.d.ts +61 -0
- package/types/svg/DOMSVGUtil.d.ts.map +1 -0
- package/types/svg/SVGParse.d.ts +16 -0
- package/types/svg/SVGParse.d.ts.map +1 -0
- package/types/svg/YZRaphael.d.ts +1 -0
- package/types/svg/YZRaphael.d.ts.map +1 -0
- package/types/svg/index.d.ts +2 -2
- package/types/svg/index.d.ts.map +1 -1
- package/types/svg/lib/point-in-path.d.ts.map +1 -1
- package/types/svg/line2c.d.ts +4 -0
- package/types/svg/line2c.d.ts.map +1 -0
- package/types/theme.d.ts +35 -11
- package/types/theme.d.ts.map +1 -1
- package/dist/example.css +0 -41
- package/types/UPNG.d.ts.map +0 -1
- package/types/dom/DOMDetect.d.ts +0 -19
- package/types/dom/DOMDetect.d.ts.map +0 -1
- package/types/dom/DOMEvent.d.ts +0 -7
- package/types/dom/DOMEvent.d.ts.map +0 -1
- package/types/dom/DOMMedia.d.ts +0 -8
- package/types/dom/DOMMedia.d.ts.map +0 -1
- package/types/dom/DOMQuery.d.ts +0 -82
- package/types/dom/DOMQuery.d.ts.map +0 -1
- package/types/dom/DOMScroll.d.ts +0 -11
- package/types/dom/DOMScroll.d.ts.map +0 -1
- package/types/image-gif.d.ts.map +0 -1
- package/types/image.d.ts.map +0 -1
- package/types/qrcode.d.ts.map +0 -1
- package/types/shape/Arc.d.ts +0 -22
- package/types/shape/Arc.d.ts.map +0 -1
- package/types/shape/CubicBezier.d.ts +0 -18
- package/types/shape/CubicBezier.d.ts.map +0 -1
- package/types/shape/Line.d.ts +0 -13
- package/types/shape/Line.d.ts.map +0 -1
- package/types/shape/PathGroup.d.ts.map +0 -1
- package/types/shape/Point.d.ts +0 -25
- package/types/shape/Point.d.ts.map +0 -1
- package/types/shape/Polygon.d.ts +0 -20
- package/types/shape/Polygon.d.ts.map +0 -1
- package/types/shape/QuadraticBezier.d.ts +0 -16
- package/types/shape/QuadraticBezier.d.ts.map +0 -1
- package/types/shape/Rect.d.ts +0 -18
- package/types/shape/Rect.d.ts.map +0 -1
- package/types/shape/SportBase.d.ts +0 -49
- package/types/shape/SportBase.d.ts.map +0 -1
- package/types/shape/YZRaphael.d.ts +0 -4
- package/types/shape/YZRaphael.d.ts.map +0 -1
- package/types/shape/index.d.ts +0 -7
- package/types/shape/index.d.ts.map +0 -1
- package/types/shape/shapes/ShapeArmyAnts.d.ts.map +0 -1
- package/types/shape/shapes/ShapeArrow.d.ts +0 -8
- package/types/shape/shapes/ShapeArrow.d.ts.map +0 -1
- package/types/shape/shapes/ShapeBall.d.ts +0 -9
- package/types/shape/shapes/ShapeBall.d.ts.map +0 -1
- package/types/shape/shapes/ShapeBase.d.ts.map +0 -1
- package/types/shape/shapes/ShapeFox.d.ts +0 -8
- package/types/shape/shapes/ShapeFox.d.ts.map +0 -1
- package/types/shape/shapes/ShapeLight.d.ts.map +0 -1
- package/types/shape/shapes/ShapeLine.d.ts +0 -32
- package/types/shape/shapes/ShapeLine.d.ts.map +0 -1
- package/types/shape/shapes/ShapePoint3d.d.ts.map +0 -1
- package/types/shape/shapes/ShapeRabbit.d.ts.map +0 -1
- package/types/shape/shapes/ShapeRect.d.ts +0 -18
- package/types/shape/shapes/ShapeRect.d.ts.map +0 -1
- package/types/shape/shapes/ShapeSegment.d.ts +0 -19
- package/types/shape/shapes/ShapeSegment.d.ts.map +0 -1
- package/types/shape/shapes/ShapeShip.d.ts.map +0 -1
- package/types/shape/shapes/ShapeSlider.d.ts.map +0 -1
- package/types/shape/shapes/ShapeSmileFace.d.ts +0 -6
- package/types/shape/shapes/ShapeSmileFace.d.ts.map +0 -1
- package/types/shape/shapes/ShapeSpirograph.d.ts.map +0 -1
- package/types/shape/shapes/ShapeStar.d.ts.map +0 -1
- package/types/shape/shapes/ShapeTiger.d.ts.map +0 -1
- package/types/shape/shapes/ShapeTree.d.ts.map +0 -1
- package/types/shape/shapes/ShapeTriangle.d.ts.map +0 -1
- package/types/shape/shapes/ShapeTriangleLight.d.ts.map +0 -1
- package/types/shape/shapes/index.d.ts.map +0 -1
- package/types/svg/SVGOperation.d.ts +0 -75
- package/types/svg/SVGOperation.d.ts.map +0 -1
- package/types/svg/lib/a2c.d.ts +0 -3
- package/types/svg/lib/a2c.d.ts.map +0 -1
- package/types/svg/lib/abs-svg-path.d.ts +0 -3
- package/types/svg/lib/abs-svg-path.d.ts.map +0 -1
- package/types/svg/lib/index.d.ts +0 -8
- package/types/svg/lib/index.d.ts.map +0 -1
- package/types/svg/lib/is-svg-path.d.ts +0 -3
- package/types/svg/lib/is-svg-path.d.ts.map +0 -1
- package/types/svg/lib/normalize-svg-path.d.ts +0 -3
- package/types/svg/lib/normalize-svg-path.d.ts.map +0 -1
- package/types/svg/lib/parse-svg-path.d.ts +0 -3
- package/types/svg/lib/parse-svg-path.d.ts.map +0 -1
- package/types/svg/lib/point-at-length.d.ts +0 -13
- package/types/svg/lib/point-at-length.d.ts.map +0 -1
- package/types/svg/lib/point-svg-path.d.ts +0 -12
- package/types/svg/lib/point-svg-path.d.ts.map +0 -1
- package/types/svg/lib/rel-svg-path.d.ts +0 -3
- package/types/svg/lib/rel-svg-path.d.ts.map +0 -1
- package/types/svg/rappar.d.ts +0 -3
- package/types/svg/rappar.d.ts.map +0 -1
- /package/types/{image-gif.d.ts → image/image-gif.d.ts} +0 -0
- /package/types/{qrcode.d.ts → image/qrcode.d.ts} +0 -0
- /package/types/{shape/shapes → shapes}/ShapeLight.d.ts +0 -0
- /package/types/{shape/shapes → shapes}/ShapePoint3d.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ZYZGroupCoreWeb=function(
|
|
1
|
+
var ZYZGroupCoreWeb=function(d){"use strict";const Di=typeof window=="object"&&typeof document=="object";typeof process<"u"&&process.versions!=null&&process.versions.node!=null;const Be=s=>{let t=null;switch(s){case"any-character":t=/[^]/;break;case"bin":t=/^(0b)?[0-1]+$/;break;case"oct":t=/^(0o)?[0-7]+$/i;break;case"hex":t=/^(0x)?[0-9a-fA-F]+$/i;break;case"int":t=/^[-+]?[0-9]+$/;break;case"number":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;break;case"number-single":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/i;break;case"split":t=/\s*,\s*/gi;break;case"svg-segment":t=/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi;break;case"mobile-china":t=/^\+[1-9]{1}[0-9]{10}$/g;break;case"phone-number":t=/^[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}$/gi;break;case"email":t=/^[A-Za-z0-9_!#$%&'*+/=?`{|}~^.-]+@[A-Za-z0-9._-]+$/gm;break;case"ip":t=/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;break;case"whitespace":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]/g;break;case"commaSpaces":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/;break;case"trim":t=/^\s+|\s+$/g;break;case"base64-data":t=/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i;break;case"var-name":t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;break;case"element-url":t=/^url\(['"]?(.+?)['"]?\)$/i;break;case"hex-color":t=/^#([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;break;case"color":t=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i;break;case"bezier":t=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/;break;case"chinese-name":t=/^(?:[\u4e00-\u9fa5·]{2,16})$/;break;case"chinese":t=new RegExp(String.raw`
|
|
2
2
|
[\u{FA0E}\u{FA0F}\u{FA11}\u{FA13}\u{FA14}\u{FA1F}\u{FA21}\u{FA23}\u{FA24}\u{FA27}-\u{FA29}]
|
|
3
3
|
|[\u{4E00}-\u{9FCC}]
|
|
4
4
|
|[\u{3400}-\u{4DB5}]
|
|
@@ -7,38 +7,34 @@ var ZYZGroupCoreWeb=function(O){"use strict";const Xi=typeof window=="object"&&t
|
|
|
7
7
|
|[\u{2B740}-\u{2B81D}]
|
|
8
8
|
|[\u{2B820}-\u{2CEAF}]
|
|
9
9
|
|[\u{2CEB0}-\u{2EBEF}]
|
|
10
|
-
`.replace(/\s+/g,""),"u");break;case"mime-image":t=/^image\//;break;case"mime-video":t=/^video\//;break;case"mime-audio":t=/^audio\//;break;case"mime-document-word":t=/^application\/(?:vnd\.openxmlformats-officedocument\.wordprocessingml\.document|msword|vnd\.ms-word\.document\.macroenabled\.12|vnd\.openxmlformats-officedocument\.wordprocessingml\.template|vnd\.ms-word\.template\.macroenabled\.12)$/;break;case"mime-document-excel":t=/^application\/(?:vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|vnd\.ms-excel|vnd\.ms-excel\.sheet\.macroenabled\.12|vnd\.openxmlformats-officedocument\.spreadsheetml\.template|vnd\.ms-excel\.template\.macroenabled\.12)$/;break;case"mime-document-ppt":t=/^application\/(?:vnd\.ms-powerpoint|vnd\.openxmlformats-officedocument\.presentationml\.presentation|vnd\.ms-powerpoint\.presentation\.macroenabled\.12|vnd\.openxmlformats-officedocument\.presentationml\.template|vnd\.ms-powerpoint\.template\.macroenabled\.12)$/;break;case"mime-document-json":t=/^application\/json$/;break;case"mime-document-xml":t=/^(?:application|text)\/(?:xml|xhtml\+xml)$/;break}return t};function vc(n){const t={matchIndex:-1,fullMatch:null,groupMatchs:[]};if(n){t.matchIndex=typeof n.index=="number"?n.index:-1;for(let e=0,i=n.length;e<i;e++)e==0?t.fullMatch=n[e]:t.groupMatchs.push(n[e])}return t}const aa=(n,t)=>{typeof n=="string"&&(n=mc(n)||new RegExp(n));const e=[],i=t.matchAll(n);for(const r of i)e.push(vc(r));return e};function oa(n){return n.replace(/(^\w|[_-]\w)/g,function(t){return t.slice(-1).toUpperCase()})}function la(n){let t="";for(let e=0,i=n.length;e<i;e++){const r=n.charCodeAt(e);r>=1&&r<=127?t+=n.charAt(e):r>2047?(t+=String.fromCharCode(224|r>>12&15),t+=String.fromCharCode(128|r>>6&63),t+=String.fromCharCode(128|r>>0&63)):(t+=String.fromCharCode(192|r>>6&31),t+=String.fromCharCode(128|r>>0&63))}return t}var Ue=(n=>(n.UNKNOWN="",n.HTML="text/html",n.CSS="text/css",n.XML="text/xml",n.TEXT="text/plain",n.MD="text/plain",n.JPEG="image/jpeg",n.PNG="image/png",n.GIF="image/gif",n.WEBP="image/webp",n.SVG="image/svg+xml",n.ICO="image/x-icon",n.MPEG="audio/mpeg",n.MP3="audio/mpeg",n.OGG="audio/ogg",n.WAV="audio/wav",n.MP4="video/mp4",n.WEBM="video/webm",n.JSON="application/json",n.JAVASCRIPT="application/javascript",n.ECMASCRIPT="application/ecmascript",n.EXCEL="application/vnb.ms-excel",n.XWWW="application/x-www-form-urlencoded",n.DOC="application/msword",n.CSV="application/x-csv",n.PDF="application/pdf",n.ZIP="application/zip",n.TGZ="application/x-gtar",n.TAR_GZ="application/x-gzip",n.EOT="appliaction/vnd.ms-fontobject",n.TTF="aplication/font-sfnt",n))(Ue||{});const Fn=(n,t=16)=>(n=n.toLowerCase(),(n.indexOf("0b")==0||n.indexOf("0o")==0||n.indexOf("0x")==0)&&(n=n.slice(2)),parseInt(n,t));function _c(){const n=Uint32Array.of(305419896),t=new Uint8Array(n.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const ca=n=>{let t=Ue.UNKNOWN;switch(new DataView(n).getUint32(0,_c()).toString(16).toUpperCase()){case"FFD8FFDB":t=Ue.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Ue.JPEG;break;case"89504E47":t=Ue.PNG;break;case"47494638":t=Ue.GIF;break;case"52494646":t=Ue.WEBP;break;case"25504446":t=Ue.PDF;break;case"504B0304":t=Ue.ZIP;break}return t},ha=function(){const n=[];return{writeByte(t){n.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,i=t.length){for(let r=0;r<i;r++)this.writeByte(t[r+e])},writeString(t){for(let e=0,i=t.length;e<i;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return n},toString(){let t="[";for(let e=0,i=n.length;e<i;e++)e>0&&(t+=","),t+=n[e];return t+="]",t}}},wc=function(){let n=0,t=0,e=0,i="";const r=function(a){if(!(a<0)){if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47}throw new Error("n:"+a)},s=function(a){i+=String.fromCharCode(r(a&63))};return{writeByte(a){for(n=n<<8|a&255,t+=8,e+=1;t>=6;)s(n>>>t-6),t-=6},flush(){if(t>0&&(s(n<<6-t),n=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)i+="="}},toString(){return i}}};function yc(n){const t=typeof n;return t!=="object"?t:Object.prototype.toString.call(n).replace(/^\[object (\S+)\]$/,"$1").toLowerCase()}function Gr(n){return yc(n)==="object"}function fa(n,t=new WeakMap){if(n==null)return n;if(n.constructor===Date)return new Date(n);if(n.constructor===RegExp)return new RegExp(n);if(typeof n!="object")return n;if(t.has(n))return t.get(n);const e=Object.getOwnPropertyDescriptors(n),i=Object.create(Object.getPrototypeOf(n),e);t.set(n,i);for(const r of Reflect.ownKeys(n))i[r]=Gr(n[r])?fa(n[r],t):n[r];return i}function Hr(n,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(n-t)<e}function ua(n,t=12){return+n.toPrecision(t)}var xc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yi(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var da={exports:{}},zn=typeof Reflect=="object"?Reflect:null,pa=zn&&typeof zn.apply=="function"?zn.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)},Zi;zn&&typeof zn.ownKeys=="function"?Zi=zn.ownKeys:Object.getOwnPropertySymbols?Zi=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Zi=function(t){return Object.getOwnPropertyNames(t)};function bc(n){console&&console.warn&&console.warn(n)}var ga=Number.isNaN||function(t){return t!==t};function Ut(){Ut.init.call(this)}da.exports=Ut,da.exports.once=kc,Ut.EventEmitter=Ut,Ut.prototype._events=void 0,Ut.prototype._eventsCount=0,Ut.prototype._maxListeners=void 0;var ma=10;function $i(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}Object.defineProperty(Ut,"defaultMaxListeners",{enumerable:!0,get:function(){return ma},set:function(n){if(typeof n!="number"||n<0||ga(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");ma=n}}),Ut.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ut.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||ga(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function va(n){return n._maxListeners===void 0?Ut.defaultMaxListeners:n._maxListeners}Ut.prototype.getMaxListeners=function(){return va(this)},Ut.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var r=t==="error",s=this._events;if(s!==void 0)r=r&&s.error===void 0;else if(!r)return!1;if(r){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var l=s[t];if(l===void 0)return!1;if(typeof l=="function")pa(l,this,e);else for(var c=l.length,f=ba(l,c),i=0;i<c;++i)pa(f[i],this,e);return!0};function _a(n,t,e,i){var r,s,a;if($i(e),s=n._events,s===void 0?(s=n._events=Object.create(null),n._eventsCount=0):(s.newListener!==void 0&&(n.emit("newListener",t,e.listener?e.listener:e),s=n._events),a=s[t]),a===void 0)a=s[t]=e,++n._eventsCount;else if(typeof a=="function"?a=s[t]=i?[e,a]:[a,e]:i?a.unshift(e):a.push(e),r=va(n),r>0&&a.length>r&&!a.warned){a.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=n,o.type=t,o.count=a.length,bc(o)}return n}Ut.prototype.addListener=function(t,e){return _a(this,t,e,!1)},Ut.prototype.on=Ut.prototype.addListener,Ut.prototype.prependListener=function(t,e){return _a(this,t,e,!0)};function Tc(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function wa(n,t,e){var i={fired:!1,wrapFn:void 0,target:n,type:t,listener:e},r=Tc.bind(i);return r.listener=e,i.wrapFn=r,r}Ut.prototype.once=function(t,e){return $i(e),this.on(t,wa(this,t,e)),this},Ut.prototype.prependOnceListener=function(t,e){return $i(e),this.prependListener(t,wa(this,t,e)),this},Ut.prototype.removeListener=function(t,e){var i,r,s,a,o;if($i(e),r=this._events,r===void 0)return this;if(i=r[t],i===void 0)return this;if(i===e||i.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,i.listener||e));else if(typeof i!="function"){for(s=-1,a=i.length-1;a>=0;a--)if(i[a]===e||i[a].listener===e){o=i[a].listener,s=a;break}if(s<0)return this;s===0?i.shift():Cc(i,s),i.length===1&&(r[t]=i[0]),r.removeListener!==void 0&&this.emit("removeListener",t,o||e)}return this},Ut.prototype.off=Ut.prototype.removeListener,Ut.prototype.removeAllListeners=function(t){var e,i,r;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[t]),this;if(arguments.length===0){var s=Object.keys(i),a;for(r=0;r<s.length;++r)a=s[r],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(e=i[t],typeof e=="function")this.removeListener(t,e);else if(e!==void 0)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this};function ya(n,t,e){var i=n._events;if(i===void 0)return[];var r=i[t];return r===void 0?[]:typeof r=="function"?e?[r.listener||r]:[r]:e?Ec(r):ba(r,r.length)}Ut.prototype.listeners=function(t){return ya(this,t,!0)},Ut.prototype.rawListeners=function(t){return ya(this,t,!1)},Ut.listenerCount=function(n,t){return typeof n.listenerCount=="function"?n.listenerCount(t):xa.call(n,t)},Ut.prototype.listenerCount=xa;function xa(n){var t=this._events;if(t!==void 0){var e=t[n];if(typeof e=="function")return 1;if(e!==void 0)return e.length}return 0}Ut.prototype.eventNames=function(){return this._eventsCount>0?Zi(this._events):[]};function ba(n,t){for(var e=new Array(t),i=0;i<t;++i)e[i]=n[i];return e}function Cc(n,t){for(;t+1<n.length;t++)n[t]=n[t+1];n.pop()}function Ec(n){for(var t=new Array(n.length),e=0;e<t.length;++e)t[e]=n[e].listener||n[e];return t}function kc(n,t){return new Promise(function(e,i){function r(a){n.removeListener(t,s),i(a)}function s(){typeof n.removeListener=="function"&&n.removeListener("error",r),e([].slice.call(arguments))}Ta(n,t,s,{once:!0}),t!=="error"&&Sc(n,r,{once:!0})})}function Sc(n,t,e){typeof n.on=="function"&&Ta(n,"error",t,e)}function Ta(n,t,e,i){if(typeof n.on=="function")i.once?n.once(t,e):n.on(t,e);else if(typeof n.addEventListener=="function")n.addEventListener(t,function r(s){i.once&&n.removeEventListener(t,r),e(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof n)}class Ac{events;constructor(){this.events={}}on(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e)}addListener(t,e){this.on(t,e)}prependListener(t,e){this.events[t]||(this.events[t]=[]),this.events[t].unshift(e)}removeListener(t,e){this.events[t]&&(this.events[t]=this.events[t].filter(i=>i!==e))}off(t,e){this.removeListener(t,e)}removeAllListeners(t){t?this.events[t]=[]:this.events={}}emit(t,...e){this.events[t]&&this.events[t].forEach(i=>{Reflect.apply(i,this,e)})}once(t,e){const r=(()=>{let s=!1;return(...a)=>{s||(s=!0,Reflect.apply(e,this,a),this.off(t,r))}})();this.on(t,r)}}var Ca=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Pc(n,t={}){var e=1,i=1;function r(j){var ct=j.match(/\n/g);ct&&(e+=ct.length);var L=j.lastIndexOf(`
|
|
11
|
-
`);i=~L?j.length-L:i+j.length}function s(){var j={line:e,column:i};return function(ct){return ct.position=new a(j),y(),ct}}function a(j){this.start=j,this.end={line:e,column:i},this.source=t.source}a.prototype.content=n;var o=[];function l(j){var ct=new Error(t.source+":"+e+":"+i+": "+j);if(ct.reason=j,ct.filename=t.source,ct.line=e,ct.column=i,ct.source=n,t.silent)o.push(ct);else throw ct}function c(){var j=p();return{type:"stylesheet",stylesheet:{source:t.source,rules:j,parsingErrors:o}}}function f(){return u(/^{\s*/)}function g(){return u(/^}/)}function p(){var j,ct=[];for(y(),x(ct);n.length&&n.charAt(0)!="}"&&(j=St()||vt());)j!==!1&&(ct.push(j),x(ct));return ct}function u(j){var ct=j.exec(n);if(ct){var L=ct[0];return r(L),n=n.slice(L.length),ct}}function y(){u(/^\s*/)}function x(j){var ct;for(j=j||[];ct=b();)ct!==!1&&j.push(ct);return j}function b(){var j=s();if(!(n.charAt(0)!="/"||n.charAt(1)!="*")){for(var ct=2;n.charAt(ct)!=""&&(n.charAt(ct)!="*"||n.charAt(ct+1)!="/");)++ct;if(ct+=2,n.charAt(ct-1)==="")return l("End of comment missing");var L=n.slice(2,ct-2);return i+=2,r(L),n=n.slice(ct),i+=2,j({type:"comment",comment:L})}}function A(){var j=u(/^([^{]+)/);if(j)return Ne(j[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(ct){return ct.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(ct){return ct.replace(/\u200C/g,",")})}function P(){var j=s(),ct=u(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(ct){if(ct=Ne(ct[0]),!u(/^:\s*/))return l("property missing ':'");var L=u(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),k=j({type:"declaration",property:ct.replace(Ca,""),value:L?Ne(L[0]).replace(Ca,""):""});return u(/^[;\s]*/),k}}function M(){var j=[];if(!f())return l("missing '{'");x(j);for(var ct;ct=P();)ct!==!1&&(j.push(ct),x(j));return g()?j:l("missing '}'")}function D(){for(var j,ct=[],L=s();j=u(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)ct.push(j[1]),u(/^,\s*/);if(ct.length)return L({type:"keyframe",values:ct,declarations:M()})}function z(){var j=s(),ct=u(/^@([-\w]+)?keyframes\s*/);if(ct){var L=ct[1];if(ct=u(/^([-\w]+)\s*/),!ct)return l("@keyframes missing name");var k=ct[1];if(!f())return l("@keyframes missing '{'");for(var E,R=x();E=D();)R.push(E),R=R.concat(x());return g()?j({type:"keyframes",name:k,vendor:L,keyframes:R}):l("@keyframes missing '}'")}}function N(){var j=s(),ct=u(/^@supports *([^{]+)/);if(ct){var L=Ne(ct[1]);if(!f())return l("@supports missing '{'");var k=x().concat(p());return g()?j({type:"supports",supports:L,rules:k}):l("@supports missing '}'")}}function F(){var j=s(),ct=u(/^@host\s*/);if(ct){if(!f())return l("@host missing '{'");var L=x().concat(p());return g()?j({type:"host",rules:L}):l("@host missing '}'")}}function G(){var j=s(),ct=u(/^@media *([^{]+)/);if(ct){var L=Ne(ct[1]);if(!f())return l("@media missing '{'");var k=x().concat(p());return g()?j({type:"media",media:L,rules:k}):l("@media missing '}'")}}function H(){var j=s(),ct=u(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(ct)return j({type:"custom-media",name:Ne(ct[1]),media:Ne(ct[2])})}function $(){var j=s(),ct=u(/^@page */);if(ct){var L=A()||[];if(!f())return l("@page missing '{'");for(var k=x(),E;E=P();)k.push(E),k=k.concat(x());return g()?j({type:"page",selectors:L,declarations:k}):l("@page missing '}'")}}function Y(){var j=s(),ct=u(/^@([-\w]+)?document *([^{]+)/);if(ct){var L=Ne(ct[1]),k=Ne(ct[2]);if(!f())return l("@document missing '{'");var E=x().concat(p());return g()?j({type:"document",document:k,vendor:L,rules:E}):l("@document missing '}'")}}function K(){var j=s(),ct=u(/^@font-face\s*/);if(ct){if(!f())return l("@font-face missing '{'");for(var L=x(),k;k=P();)L.push(k),L=L.concat(x());return g()?j({type:"font-face",declarations:L}):l("@font-face missing '}'")}}var ut=kt("import"),ht=kt("charset"),pt=kt("namespace");function kt(j){var ct=new RegExp("^@"+j+"\\s*([^;]+);");return function(){var L=s(),k=u(ct);if(k){var E={type:j};return E[j]=k[1].trim(),L(E)}}}function St(){if(n[0]=="@")return z()||G()||H()||N()||ut()||ht()||pt()||Y()||$()||F()||K()}function vt(){var j=s(),ct=A();return ct?(x(),j({type:"rule",selectors:ct,declarations:M()})):l("selector missing")}return jr(c())}function Ne(n){return n?n.replace(/^\s+|\s+$/g,""):""}function jr(n,t){var e=n&&typeof n.type=="string",i=e?n:t;for(var r in n){var s=n[r];Array.isArray(s)?s.forEach(function(a){jr(a,i)}):s&&typeof s=="object"&&jr(s,i)}return e&&Object.defineProperty(n,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),n}const Vr=(n,t="image/svg+xml",e="utf-8")=>new Blob([n],{type:`${t};charset=${e}`}),Ea=n=>new XMLSerializer().serializeToString(n),Ic=(n,t="text/html")=>new DOMParser().parseFromString(n,t),ka=(n,t="image/svg+xml",e="utf-8")=>Vr(Ea(n),t,e),Xr=(n,t)=>{const e=document.createElement("a");e.style.visibility="hidden",document.body.appendChild(e),e.download=t,typeof n=="string"?e.href=n:e.href=window.URL.createObjectURL(n),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(e.href)};function Sa(n=["*"],t){if(!globalThis.document||!(globalThis.document instanceof Document))throw new Error("This is not a browser environment");const e=globalThis.document.createElement("input");return e.setAttribute("type","file"),e.setAttribute("visibility","hidden"),Array.isArray(n)&&n.length>0&&e.setAttribute("accept",n.join(",")),t&&e.setAttribute("multiple","true"),e.click(),new Promise((i,r)=>{globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!e.files||e.files?.length===0)&&r(new Error("Cancel select"))},1e3)},{once:!0}),e.addEventListener("change",()=>{if(!e.files||e.files?.length===0)r(new Error("Cancel select"));else{const s=Array.from(e.files);!n.includes("*")&&s.some(a=>!n.includes(`.${Pa(a)}`))&&r(new Error(`Please select files in ${n} format`)),i(s)}})})}function Yr(n,t="text",e){return new Promise((i,r)=>{const s=new FileReader;switch(s.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),s.addEventListener("load",a=>{i(a.target?.result)}),s.addEventListener("error",a=>{r(a)}),t){case"dataURL":s.readAsDataURL(n);break;case"binaryString":s.readAsBinaryString(n);break;case"arrayBuffer":s.readAsArrayBuffer(n);break;default:s.readAsText(n)}})}function Aa(n,t,e){return Yr(n.slice(t,e),"arrayBuffer")}async function Mc(n){const t=await Aa(n,0,4);return ca(t)}const Pa=n=>{let t;return n instanceof File?t=n.name:t=n,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function Lc(n,t){n.addEventListener("change",function(){t(n.files)},!1)}function Dc(n,t){n.addEventListener("dragover",function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},!1),n.addEventListener("drop",function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer&&t(e.dataTransfer.files)},!1)}function Rc(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(t=>setTimeout(()=>{throw t}))}function Oc(n,t={},e=[]){return{tag:n,props:t,children:e}}function ui(n,t){if(n.el)return;const e=n.el=document.createElement(n.tag);if(n.props)for(const i in n.props){const r=n.props[i];i.startsWith("on")?e.addEventListener(i.slice(2).toLowerCase(),r):e.setAttribute(i,r)}n.children&&(typeof n.children=="string"?e.textContent=n.children:n.children.forEach(i=>{ui(i,e)})),t.appendChild(e)}function Ia(n,t){if(n.tag!==t.tag){if(!n.el)return;const e=n.el.parentElement||document.body;e.removeChild(n.el),ui(t,e)}else{const e=t.el=n.el;if(!e)return;const i=n.props,r=t.props;for(const o in i)o in r||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),i[o]):e.removeAttribute(o));for(const o in r){const l=i[o],c=r[o];c!=l&&(o.startsWith("on")?e.addEventListener(o.slice(2).toLowerCase(),c):e.setAttribute(o,c))}const s=n.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof s=="string")e.innerHTML="",a.forEach(o=>{ui(o,e)});else{const o=Math.min(s.length,a.length);for(let l=0;l<o;l++)Ia(s[l],a[l]);a.length>s.length&&a.slice(s.length).forEach(l=>{ui(l,e)}),a.length<s.length&&s.slice(a.length).forEach(l=>{l.el&&e.removeChild(l.el)})}}}function Ma(n,t,e){if(!n){e&&t&&e.appendChild(t);return}if(!n.isEqualNode(t)){if(n.nodeName!==t.nodeName){e.replaceChild(t,n);return}if(n.nodeType===Node.TEXT_NODE){n.textContent!==t.textContent&&(n.textContent=t.textContent);return}for(let i=n.attributes.length-1;i>=0;i--){const r=n.attributes[i].name;!t.hasAttribute(r)&&r!=="open"&&n.removeAttribute(r)}for(let i=0;i<t.attributes.length;i++){const r=t.attributes[i].name,s=t.attributes[i].value;n.setAttribute(r,s)}for(let i=0;i<t.childNodes.length;i++)n.childNodes[i]?Ma(n.childNodes[i],t.childNodes[i],n):n.appendChild(t.childNodes[i].cloneNode(!0));for(;n.childNodes.length>t.childNodes.length;)n.lastChild&&n.removeChild(n.lastChild)}}class Fc{url;socket;waitingResponse={};sendMessageQueue=[];constructor(t){this.url=t,this.createSocket()}createSocket(){console.log("Socket Create Attempted"),this.socket=new WebSocket(this.url),this.socket.onopen=()=>{this.sendMessageQueue.forEach(t=>this.socket?.send(t)),this.sendMessageQueue=[]},this.socket.onclose=t=>{const{code:e,reason:i,wasClean:r}=t;console.log(`ws closed : ${e} ${i} ${r}`)},this.socket.onerror=t=>{console.log(`ws error : ${t.type}`)},this.socket.onmessage=t=>{this.processMessage(t)}}recreateSocket(t){console.log("Socket Recreate Attempted"),this.sendMessageQueue.push(t),this.createSocket()}closeSocket(){this.socket&&(this.socket.close(),console.log("Socket closed"))}openSocket(){this.createSocket(),console.log("Socket opened manually")}sendWithRetry(t){this.socket?.readyState===WebSocket.OPEN?this.socket.send(t):this.recreateSocket(t)}async processMessage(t){if(typeof t.data=="string")try{const e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const i=this.waitingResponse[e.requestid];i?i.resolve?.(e):console.warn("Got data but found no associated request, already timed out?",e)}else console.warn("Got data without request id",e)}catch{console.log(`Received String : ${t.data}`)}else t.data instanceof ArrayBuffer?console.log(`Received ArrayBuffer : ${t.data}`):t.data instanceof Blob&&console.log(`Received Blob : ${t.data}`)}async sendPayload(t){const e=+new Date,i=this.waitingResponse[e]={requestid:e};try{let r;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?r=t:r=JSON.stringify({...i,...t});const s=await new Promise((a,o)=>{i.resolve=a,this.sendWithRetry(r),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-i.requestid)/1e3),s}catch(r){return Promise.reject(r)}finally{delete this.waitingResponse[e]}}async send(t,e,i=r=>{console.log(r)}){this.sendPayload(t).then(e,i)}}function Zr(){return document.compatMode=="BackCompat"?document.body:document.documentElement}function Un(){const n=Zr();return{scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight}}function qi(){const n=Zr();return{clientTop:n.clientTop,clientLeft:n.clientLeft,clientWidth:n.clientWidth,clientHeight:n.clientHeight}}function Wi(){const{clientWidth:n,clientHeight:t}=qi();return{width:n||window.innerWidth,height:t||window.innerHeight}}function zc(){const{scrollWidth:n,scrollHeight:t}=Un(),{width:e,height:i}=Wi();return{width:Math.max(n,e),height:Math.max(t,i)}}function Uc(n){const{width:t,height:e}=Wi(),{top:i,left:r,right:s,bottom:a}=n.getBoundingClientRect();return(i>=0&&i<=e||a>=0&&a<=e)&&(r>=0&&r<=t||s>=0&&s<=t)}function Nc(n,t,e){const i={threshold:1};new IntersectionObserver(function(s,a){let o=s[0];if(s.length>1){const c=s.find(f=>f.isIntersecting);c&&(o=c)}o.isIntersecting&&o.intersectionRatio>=i.threshold?t(o.target):e?.(o.target)},i).observe(n)}function La(n){const{top:t,left:e}=n.getBoundingClientRect(),i=Un();return{x:e+i.scrollLeft,y:t+i.scrollTop}}function Bc(n){return{x:Da(n),y:Ra(n)}}function Da(n){let t=0;for(;n!==null;)t+=n.offsetLeft,n=n.offsetParent;return t}function Ra(n){let t=0;for(;n!==null;)t+=n.offsetTop,n=n.offsetParent;return t}function Gc(n){const t=n.getBoundingClientRect();return{x:t.left,y:t.top}}function Hc(n,t){const e=n.getBoundingClientRect(),i=t.getBoundingClientRect();return{x:i.x-e.x,y:i.y-e.y,width:i.width,height:i.height}}function Oa(n){if("center"in n)return n.center;if(n.pageX&&n.pageY)return{x:n.pageX,y:n.pageY};const t=Un();return{x:n.clientX+t.scrollLeft,y:n.clientY+t.scrollTop}}function jc(n){return{x:n.clientX,y:n.clientY}}function Ji(n,t){const e=Oa(t),i=La(n);return{x:e.x-i.x,y:e.y-i.y}}function $r(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}const Ki=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(n)?t="macOS":/win/i.test(n)?t="Windows":/android/i.test(n)?t="Android":/iphone|ipad|ipod/i.test(n)?t="iOS":/linux/i.test(n)?t="Linux":/bsd/i.test(n)&&(t="BSD"),t.toLowerCase()},Vc=()=>{const n=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(n)){const e=n.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(n)){const e=n.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(n)){const e=n.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(n)){const e=n.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},qr=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/chrome/i.test(n)?t="Chrome":/firefox/i.test(n)?t="Firefox":/safari/i.test(n)?t="Safari":/edge/i.test(n)?t="Edge":/msie|trident/i.test(n)?t="IE":/MicroMessenger/i.test(n)?t="Wechat":/alipay/i.test(n)&&(t="Ali"),t.toLowerCase()},Xc=()=>{const n=navigator.userAgent;let t="Unknown";if(/Chrome/.test(n)){const e=n.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(n)){const e=n.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(n)){const e=n.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(n)){const e=n.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(n)){const e=n.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t},Yc=()=>"geolocation"in navigator?new Promise((n,t)=>{navigator.geolocation.getCurrentPosition(e=>{const i=e.coords.latitude,r=e.coords.longitude;n({latitude:i,longitude:r})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function Zc(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function $c(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Wr(){return Ki()==="ios"}function Jr(){return Ki()==="macos"}function qc(){return Wr()|Jr()}function Fa(){return Ki()==="android"}function Wc(){return Wr()||Fa()}function Jc(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function za(){const n=window.navigator.userAgent,t=n.indexOf("MSIE ");if(t>0)return parseInt(n.substring(t+5,n.indexOf(".",t)),10);if(n.indexOf("Trident/")>0){const r=n.indexOf("rv:");return parseInt(n.substring(r+3,n.indexOf(".",r)),10)}const i=n.indexOf("Edge/");return i>0?parseInt(n.substring(i+5,n.indexOf(".",i)),10):-1}function Ua(){return qr()==="wechat"}function Na(){return qr()==="ali"}function Kc(){return Ua()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function Qc(){return Na()&&navigator.userAgent.match(/miniprogram/i)}const th=za()!==-1,eh=typeof document<"u",Ba=typeof window<"u",nh=typeof history<"u",ih=Ba&&window.File&&window.FileReader&&window.FileList&&window.Blob,Ga=(()=>{const n=$r();return!!(n.Worker&&n.Blob&&n.Promise&&n.OffscreenCanvas&&n.OffscreenCanvasRenderingContext2D&&n.HTMLCanvasElement&&n.HTMLCanvasElement.prototype.transferControlToOffscreen&&n.URL&&n.URL.createObjectURL)})(),rh=typeof Path2D=="function"&&typeof DOMMatrix=="function",sh=function(){if(!$r().OffscreenCanvas)return!1;var t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);var i=t.transferToImageBitmap();try{e.createPattern(i,"no-repeat")}catch{return!1}return!0}();function ah(n,t){let e=n[t];Object.defineProperty(n,"prop",{get:()=>e,set:i=>{e=i;debugger}})}function oh(n){return new Proxy(n,{get(t,e,i){return Reflect.get(t,e,i)},set(t,e,i,r){debugger;return Reflect.set(t,e,i,r)}})}function lh(n){var t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;var i=100,r=function(){var s=Math.min(t.clientWidth,n);t.dataset.width=s,t.dataset.rem=i=Math.round(100*(s/n)),t.style.fontSize=i+"px"};r(),window.rem2px=function(s){return s=parseFloat(s),s*i},window.px2rem=function(s){return s=parseFloat(s),s/i},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",r,!1)}var Ha={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
12
|
-
* http://hammerjs.github.io/
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) 2016 Jorik Tangelder;
|
|
15
|
-
* Licensed under the MIT license */(function(n){(function(t,e,i,r){var s=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),o="function",l=Math.round,c=Math.abs,f=Date.now;function g(h,m,w){return setTimeout(M(h,w),m)}function p(h,m,w){return Array.isArray(h)?(u(h,w[m],w),!0):!1}function u(h,m,w){var C;if(h)if(h.forEach)h.forEach(m,w);else if(h.length!==r)for(C=0;C<h.length;)m.call(w,h[C],C,h),C++;else for(C in h)h.hasOwnProperty(C)&&m.call(w,h[C],C,h)}function y(h,m,w){var C="DEPRECATED METHOD: "+m+`
|
|
16
|
-
`+w+` AT
|
|
17
|
-
`;return function(){var S=new Error("get-stack-trace"),I=S&&S.stack?S.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",U=t.console&&(t.console.warn||t.console.log);return U&&U.call(t.console,C,I),h.apply(this,arguments)}}var x;typeof Object.assign!="function"?x=function(m){if(m===r||m===null)throw new TypeError("Cannot convert undefined or null to object");for(var w=Object(m),C=1;C<arguments.length;C++){var S=arguments[C];if(S!==r&&S!==null)for(var I in S)S.hasOwnProperty(I)&&(w[I]=S[I])}return w}:x=Object.assign;var b=y(function(m,w,C){for(var S=Object.keys(w),I=0;I<S.length;)(!C||C&&m[S[I]]===r)&&(m[S[I]]=w[S[I]]),I++;return m},"extend","Use `assign`."),A=y(function(m,w){return b(m,w,!0)},"merge","Use `assign`.");function P(h,m,w){var C=m.prototype,S;S=h.prototype=Object.create(C),S.constructor=h,S._super=C,w&&x(S,w)}function M(h,m){return function(){return h.apply(m,arguments)}}function D(h,m){return typeof h==o?h.apply(m&&m[0]||r,m):h}function z(h,m){return h===r?m:h}function N(h,m,w){u($(m),function(C){h.addEventListener(C,w,!1)})}function F(h,m,w){u($(m),function(C){h.removeEventListener(C,w,!1)})}function G(h,m){for(;h;){if(h==m)return!0;h=h.parentNode}return!1}function H(h,m){return h.indexOf(m)>-1}function $(h){return h.trim().split(/\s+/g)}function Y(h,m,w){if(h.indexOf&&!w)return h.indexOf(m);for(var C=0;C<h.length;){if(w&&h[C][w]==m||!w&&h[C]===m)return C;C++}return-1}function K(h){return Array.prototype.slice.call(h,0)}function ut(h,m,w){for(var C=[],S=[],I=0;I<h.length;){var U=m?h[I][m]:h[I];Y(S,U)<0&&C.push(h[I]),S[I]=U,I++}return w&&(m?C=C.sort(function(tt,J){return tt[m]>J[m]}):C=C.sort()),C}function ht(h,m){for(var w,C,S=m[0].toUpperCase()+m.slice(1),I=0;I<s.length;){if(w=s[I],C=w?w+S:m,C in h)return C;I++}return r}var pt=1;function kt(){return pt++}function St(h){var m=h.ownerDocument||h;return m.defaultView||m.parentWindow||t}var vt=/mobile|tablet|ip(ad|hone|od)|android/i,j="ontouchstart"in t,ct=ht(t,"PointerEvent")!==r,L=j&&vt.test(navigator.userAgent),k="touch",E="pen",R="mouse",B="kinect",X=25,V=1,et=2,Z=4,it=8,dt=1,mt=2,yt=4,At=8,xt=16,It=mt|yt,Mt=At|xt,Dt=It|Mt,_t=["x","y"],Nt=["clientX","clientY"];function Rt(h,m){var w=this;this.manager=h,this.callback=m,this.element=h.element,this.target=h.options.inputTarget,this.domHandler=function(C){D(h.options.enable,[h])&&w.handler(C)},this.init()}Rt.prototype={handler:function(){},init:function(){this.evEl&&N(this.element,this.evEl,this.domHandler),this.evTarget&&N(this.target,this.evTarget,this.domHandler),this.evWin&&N(St(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&F(this.element,this.evEl,this.domHandler),this.evTarget&&F(this.target,this.evTarget,this.domHandler),this.evWin&&F(St(this.element),this.evWin,this.domHandler)}};function Vt(h){var m,w=h.options.inputClass;return w?m=w:ct?m=we:L?m=qe:j?m=ni:m=Ee,new m(h,zt)}function zt(h,m,w){var C=w.pointers.length,S=w.changedPointers.length,I=m&V&&C-S===0,U=m&(Z|it)&&C-S===0;w.isFirst=!!I,w.isFinal=!!U,I&&(h.session={}),w.eventType=m,ie(h,w),h.emit("hammer.input",w),h.recognize(w),h.session.prevInput=w}function ie(h,m){var w=h.session,C=m.pointers,S=C.length;w.firstInput||(w.firstInput=un(m)),S>1&&!w.firstMultiple?w.firstMultiple=un(m):S===1&&(w.firstMultiple=!1);var I=w.firstInput,U=w.firstMultiple,q=U?U.center:I.center,tt=m.center=Ce(C);m.timeStamp=f(),m.deltaTime=m.timeStamp-I.timeStamp,m.angle=De(q,tt),m.distance=Le(q,tt),Jt(w,m),m.offsetDirection=Xe(m.deltaX,m.deltaY);var J=Ve(m.deltaTime,m.deltaX,m.deltaY);m.overallVelocityX=J.x,m.overallVelocityY=J.y,m.overallVelocity=c(J.x)>c(J.y)?J.x:J.y,m.scale=U?$t(U.pointers,C):1,m.rotation=U?Qn(U.pointers,C):0,m.maxPointers=w.prevInput?m.pointers.length>w.prevInput.maxPointers?m.pointers.length:w.prevInput.maxPointers:m.pointers.length,Me(w,m);var W=h.element;G(m.srcEvent.target,W)&&(W=m.srcEvent.target),m.target=W}function Jt(h,m){var w=m.center,C=h.offsetDelta||{},S=h.prevDelta||{},I=h.prevInput||{};(m.eventType===V||I.eventType===Z)&&(S=h.prevDelta={x:I.deltaX||0,y:I.deltaY||0},C=h.offsetDelta={x:w.x,y:w.y}),m.deltaX=S.x+(w.x-C.x),m.deltaY=S.y+(w.y-C.y)}function Me(h,m){var w=h.lastInterval||m,C=m.timeStamp-w.timeStamp,S,I,U,q;if(m.eventType!=it&&(C>X||w.velocity===r)){var tt=m.deltaX-w.deltaX,J=m.deltaY-w.deltaY,W=Ve(C,tt,J);I=W.x,U=W.y,S=c(W.x)>c(W.y)?W.x:W.y,q=Xe(tt,J),h.lastInterval=m}else S=w.velocity,I=w.velocityX,U=w.velocityY,q=w.direction;m.velocity=S,m.velocityX=I,m.velocityY=U,m.direction=q}function un(h){for(var m=[],w=0;w<h.pointers.length;)m[w]={clientX:l(h.pointers[w].clientX),clientY:l(h.pointers[w].clientY)},w++;return{timeStamp:f(),pointers:m,center:Ce(m),deltaX:h.deltaX,deltaY:h.deltaY}}function Ce(h){var m=h.length;if(m===1)return{x:l(h[0].clientX),y:l(h[0].clientY)};for(var w=0,C=0,S=0;S<m;)w+=h[S].clientX,C+=h[S].clientY,S++;return{x:l(w/m),y:l(C/m)}}function Ve(h,m,w){return{x:m/h||0,y:w/h||0}}function Xe(h,m){return h===m?dt:c(h)>=c(m)?h<0?mt:yt:m<0?At:xt}function Le(h,m,w){w||(w=_t);var C=m[w[0]]-h[w[0]],S=m[w[1]]-h[w[1]];return Math.sqrt(C*C+S*S)}function De(h,m,w){w||(w=_t);var C=m[w[0]]-h[w[0]],S=m[w[1]]-h[w[1]];return Math.atan2(S,C)*180/Math.PI}function Qn(h,m){return De(m[1],m[0],Nt)+De(h[1],h[0],Nt)}function $t(h,m){return Le(m[0],m[1],Nt)/Le(h[0],h[1],Nt)}var Re={mousedown:V,mousemove:et,mouseup:Z},dn="mousedown",ae="mousemove mouseup";function Ee(){this.evEl=dn,this.evWin=ae,this.pressed=!1,Rt.apply(this,arguments)}P(Ee,Rt,{handler:function(m){var w=Re[m.type];w&V&&m.button===0&&(this.pressed=!0),w&et&&m.which!==1&&(w=Z),this.pressed&&(w&Z&&(this.pressed=!1),this.callback(this.manager,w,{pointers:[m],changedPointers:[m],pointerType:R,srcEvent:m}))}});var de={pointerdown:V,pointermove:et,pointerup:Z,pointercancel:it,pointerout:it},In={2:k,3:E,4:R,5:B},Ye="pointerdown",pn="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Ye="MSPointerDown",pn="MSPointerMove MSPointerUp MSPointerCancel");function we(){this.evEl=Ye,this.evWin=pn,Rt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}P(we,Rt,{handler:function(m){var w=this.store,C=!1,S=m.type.toLowerCase().replace("ms",""),I=de[S],U=In[m.pointerType]||m.pointerType,q=U==k,tt=Y(w,m.pointerId,"pointerId");I&V&&(m.button===0||q)?tt<0&&(w.push(m),tt=w.length-1):I&(Z|it)&&(C=!0),!(tt<0)&&(w[tt]=m,this.callback(this.manager,I,{pointers:w,changedPointers:[m],pointerType:U,srcEvent:m}),C&&w.splice(tt,1))}});var Qt={touchstart:V,touchmove:et,touchend:Z,touchcancel:it},Pr="touchstart",gn="touchstart touchmove touchend touchcancel";function Ze(){this.evTarget=Pr,this.evWin=gn,this.started=!1,Rt.apply(this,arguments)}P(Ze,Rt,{handler:function(m){var w=Qt[m.type];if(w===V&&(this.started=!0),!!this.started){var C=Oe.call(this,m,w);w&(Z|it)&&C[0].length-C[1].length===0&&(this.started=!1),this.callback(this.manager,w,{pointers:C[0],changedPointers:C[1],pointerType:k,srcEvent:m})}}});function Oe(h,m){var w=K(h.touches),C=K(h.changedTouches);return m&(Z|it)&&(w=ut(w.concat(C),"identifier",!0)),[w,C]}var ti={touchstart:V,touchmove:et,touchend:Z,touchcancel:it},$e="touchstart touchmove touchend touchcancel";function qe(){this.evTarget=$e,this.targetIds={},Rt.apply(this,arguments)}P(qe,Rt,{handler:function(m){var w=ti[m.type],C=Mn.call(this,m,w);C&&this.callback(this.manager,w,{pointers:C[0],changedPointers:C[1],pointerType:k,srcEvent:m})}});function Mn(h,m){var w=K(h.touches),C=this.targetIds;if(m&(V|et)&&w.length===1)return C[w[0].identifier]=!0,[w,w];var S,I,U=K(h.changedTouches),q=[],tt=this.target;if(I=w.filter(function(J){return G(J.target,tt)}),m===V)for(S=0;S<I.length;)C[I[S].identifier]=!0,S++;for(S=0;S<U.length;)C[U[S].identifier]&&q.push(U[S]),m&(Z|it)&&delete C[U[S].identifier],S++;if(q.length)return[ut(I.concat(q),"identifier",!0),q]}var ei=2500,Ir=25;function ni(){Rt.apply(this,arguments);var h=M(this.handler,this);this.touch=new qe(this.manager,h),this.mouse=new Ee(this.manager,h),this.primaryTouch=null,this.lastTouches=[]}P(ni,Rt,{handler:function(m,w,C){var S=C.pointerType==k,I=C.pointerType==R;if(!(I&&C.sourceCapabilities&&C.sourceCapabilities.firesTouchEvents)){if(S)Mr.call(this,w,C);else if(I&&We.call(this,C))return;this.callback(m,w,C)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Mr(h,m){h&V?(this.primaryTouch=m.changedPointers[0].identifier,Lr.call(this,m)):h&(Z|it)&&Lr.call(this,m)}function Lr(h){var m=h.changedPointers[0];if(m.identifier===this.primaryTouch){var w={x:m.clientX,y:m.clientY};this.lastTouches.push(w);var C=this.lastTouches,S=function(){var I=C.indexOf(w);I>-1&&C.splice(I,1)};setTimeout(S,ei)}}function We(h){for(var m=h.srcEvent.clientX,w=h.srcEvent.clientY,C=0;C<this.lastTouches.length;C++){var S=this.lastTouches[C],I=Math.abs(m-S.x),U=Math.abs(w-S.y);if(I<=Ir&&U<=Ir)return!0}return!1}var Dr=ht(a.style,"touchAction"),Rr=Dr!==r,Or="compute",Fr="auto",ii="manipulation",Je="none",oe="pan-x",Ke="pan-y",mn=vn();function Ot(h,m){this.manager=h,this.set(m)}Ot.prototype={set:function(h){h==Or&&(h=this.compute()),Rr&&this.manager.element.style&&mn[h]&&(this.manager.element.style[Dr]=h),this.actions=h.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var h=[];return u(this.manager.recognizers,function(m){D(m.options.enable,[m])&&(h=h.concat(m.getTouchAction()))}),zr(h.join(" "))},preventDefaults:function(h){var m=h.srcEvent,w=h.offsetDirection;if(this.manager.session.prevented){m.preventDefault();return}var C=this.actions,S=H(C,Je)&&!mn[Je],I=H(C,Ke)&&!mn[Ke],U=H(C,oe)&&!mn[oe];if(S){var q=h.pointers.length===1,tt=h.distance<2,J=h.deltaTime<250;if(q&&tt&&J)return}if(!(U&&I)&&(S||I&&w&It||U&&w&Mt))return this.preventSrc(m)},preventSrc:function(h){this.manager.session.prevented=!0,h.preventDefault()}};function zr(h){if(H(h,Je))return Je;var m=H(h,oe),w=H(h,Ke);return m&&w?Je:m||w?m?oe:Ke:H(h,ii)?ii:Fr}function vn(){if(!Rr)return!1;var h={},m=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(w){h[w]=m?t.CSS.supports("touch-action",w):!0}),h}var Ln=1,te=2,Fe=4,ke=8,ye=ke,Qe=16,Ht=32;function bt(h){this.options=x({},this.defaults,h||{}),this.id=kt(),this.manager=null,this.options.enable=z(this.options.enable,!0),this.state=Ln,this.simultaneous={},this.requireFail=[]}bt.prototype={defaults:{},set:function(h){return x(this.options,h),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(h){if(p(h,"recognizeWith",this))return this;var m=this.simultaneous;return h=_n(h,this),m[h.id]||(m[h.id]=h,h.recognizeWith(this)),this},dropRecognizeWith:function(h){return p(h,"dropRecognizeWith",this)?this:(h=_n(h,this),delete this.simultaneous[h.id],this)},requireFailure:function(h){if(p(h,"requireFailure",this))return this;var m=this.requireFail;return h=_n(h,this),Y(m,h)===-1&&(m.push(h),h.requireFailure(this)),this},dropRequireFailure:function(h){if(p(h,"dropRequireFailure",this))return this;h=_n(h,this);var m=Y(this.requireFail,h);return m>-1&&this.requireFail.splice(m,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(h){return!!this.simultaneous[h.id]},emit:function(h){var m=this,w=this.state;function C(S){m.manager.emit(S,h)}w<ke&&C(m.options.event+ji(w)),C(m.options.event),h.additionalEvent&&C(h.additionalEvent),w>=ke&&C(m.options.event+ji(w))},tryEmit:function(h){if(this.canEmit())return this.emit(h);this.state=Ht},canEmit:function(){for(var h=0;h<this.requireFail.length;){if(!(this.requireFail[h].state&(Ht|Ln)))return!1;h++}return!0},recognize:function(h){var m=x({},h);if(!D(this.options.enable,[this,m])){this.reset(),this.state=Ht;return}this.state&(ye|Qe|Ht)&&(this.state=Ln),this.state=this.process(m),this.state&(te|Fe|ke|Qe)&&this.tryEmit(m)},process:function(h){},getTouchAction:function(){},reset:function(){}};function ji(h){return h&Qe?"cancel":h&ke?"end":h&Fe?"move":h&te?"start":""}function ri(h){return h==xt?"down":h==At?"up":h==mt?"left":h==yt?"right":""}function _n(h,m){var w=m.manager;return w?w.get(h):h}function pe(){bt.apply(this,arguments)}P(pe,bt,{defaults:{pointers:1},attrTest:function(h){var m=this.options.pointers;return m===0||h.pointers.length===m},process:function(h){var m=this.state,w=h.eventType,C=m&(te|Fe),S=this.attrTest(h);return C&&(w&it||!S)?m|Qe:C||S?w&Z?m|ke:m&te?m|Fe:te:Ht}});function le(){pe.apply(this,arguments),this.pX=null,this.pY=null}P(le,pe,{defaults:{event:"pan",threshold:10,pointers:1,direction:Dt},getTouchAction:function(){var h=this.options.direction,m=[];return h&It&&m.push(Ke),h&Mt&&m.push(oe),m},directionTest:function(h){var m=this.options,w=!0,C=h.distance,S=h.direction,I=h.deltaX,U=h.deltaY;return S&m.direction||(m.direction&It?(S=I===0?dt:I<0?mt:yt,w=I!=this.pX,C=Math.abs(h.deltaX)):(S=U===0?dt:U<0?At:xt,w=U!=this.pY,C=Math.abs(h.deltaY))),h.direction=S,w&&C>m.threshold&&S&m.direction},attrTest:function(h){return pe.prototype.attrTest.call(this,h)&&(this.state&te||!(this.state&te)&&this.directionTest(h))},emit:function(h){this.pX=h.deltaX,this.pY=h.deltaY;var m=ri(h.direction);m&&(h.additionalEvent=this.options.event+m),this._super.emit.call(this,h)}});function tn(){pe.apply(this,arguments)}P(tn,pe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Je]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.scale-1)>this.options.threshold||this.state&te)},emit:function(h){if(h.scale!==1){var m=h.scale<1?"in":"out";h.additionalEvent=this.options.event+m}this._super.emit.call(this,h)}});function si(){bt.apply(this,arguments),this._timer=null,this._input=null}P(si,bt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Fr]},process:function(h){var m=this.options,w=h.pointers.length===m.pointers,C=h.distance<m.threshold,S=h.deltaTime>m.time;if(this._input=h,!C||!w||h.eventType&(Z|it)&&!S)this.reset();else if(h.eventType&V)this.reset(),this._timer=g(function(){this.state=ye,this.tryEmit()},m.time,this);else if(h.eventType&Z)return ye;return Ht},reset:function(){clearTimeout(this._timer)},emit:function(h){this.state===ye&&(h&&h.eventType&Z?this.manager.emit(this.options.event+"up",h):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}});function ai(){pe.apply(this,arguments)}P(ai,pe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Je]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.rotation)>this.options.threshold||this.state&te)}});function oi(){pe.apply(this,arguments)}P(oi,pe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:It|Mt,pointers:1},getTouchAction:function(){return le.prototype.getTouchAction.call(this)},attrTest:function(h){var m=this.options.direction,w;return m&(It|Mt)?w=h.overallVelocity:m&It?w=h.overallVelocityX:m&Mt&&(w=h.overallVelocityY),this._super.attrTest.call(this,h)&&m&h.offsetDirection&&h.distance>this.options.threshold&&h.maxPointers==this.options.pointers&&c(w)>this.options.velocity&&h.eventType&Z},emit:function(h){var m=ri(h.offsetDirection);m&&this.manager.emit(this.options.event+m,h),this.manager.emit(this.options.event,h)}});function xe(){bt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}P(xe,bt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ii]},process:function(h){var m=this.options,w=h.pointers.length===m.pointers,C=h.distance<m.threshold,S=h.deltaTime<m.time;if(this.reset(),h.eventType&V&&this.count===0)return this.failTimeout();if(C&&S&&w){if(h.eventType!=Z)return this.failTimeout();var I=this.pTime?h.timeStamp-this.pTime<m.interval:!0,U=!this.pCenter||Le(this.pCenter,h.center)<m.posThreshold;this.pTime=h.timeStamp,this.pCenter=h.center,!U||!I?this.count=1:this.count+=1,this._input=h;var q=this.count%m.taps;if(q===0)return this.hasRequireFailures()?(this._timer=g(function(){this.state=ye,this.tryEmit()},m.interval,this),te):ye}return Ht},failTimeout:function(){return this._timer=g(function(){this.state=Ht},this.options.interval,this),Ht},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ye&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function be(h,m){return m=m||{},m.recognizers=z(m.recognizers,be.defaults.preset),new Rn(h,m)}be.VERSION="2.0.7",be.defaults={domEvents:!1,touchAction:Or,enable:!0,inputTarget:null,inputClass:null,preset:[[ai,{enable:!1}],[tn,{enable:!1},["rotate"]],[oi,{direction:It}],[le,{direction:It},["swipe"]],[xe],[xe,{event:"doubletap",taps:2},["tap"]],[si]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Dn=1,Xt=2;function Rn(h,m){this.options=x({},be.defaults,m||{}),this.options.inputTarget=this.options.inputTarget||h,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=h,this.input=Vt(this),this.touchAction=new Ot(this,this.options.touchAction),d(this,!0),u(this.options.recognizers,function(w){var C=this.add(new w[0](w[1]));w[2]&&C.recognizeWith(w[2]),w[3]&&C.requireFailure(w[3])},this)}Rn.prototype={set:function(h){return x(this.options,h),h.touchAction&&this.touchAction.update(),h.inputTarget&&(this.input.destroy(),this.input.target=h.inputTarget,this.input.init()),this},stop:function(h){this.session.stopped=h?Xt:Dn},recognize:function(h){var m=this.session;if(!m.stopped){this.touchAction.preventDefaults(h);var w,C=this.recognizers,S=m.curRecognizer;(!S||S&&S.state&ye)&&(S=m.curRecognizer=null);for(var I=0;I<C.length;)w=C[I],m.stopped!==Xt&&(!S||w==S||w.canRecognizeWith(S))?w.recognize(h):w.reset(),!S&&w.state&(te|Fe|ke)&&(S=m.curRecognizer=w),I++}},get:function(h){if(h instanceof bt)return h;for(var m=this.recognizers,w=0;w<m.length;w++)if(m[w].options.event==h)return m[w];return null},add:function(h){if(p(h,"add",this))return this;var m=this.get(h.options.event);return m&&this.remove(m),this.recognizers.push(h),h.manager=this,this.touchAction.update(),h},remove:function(h){if(p(h,"remove",this))return this;if(h=this.get(h),h){var m=this.recognizers,w=Y(m,h);w!==-1&&(m.splice(w,1),this.touchAction.update())}return this},on:function(h,m){if(h!==r&&m!==r){var w=this.handlers;return u($(h),function(C){w[C]=w[C]||[],w[C].push(m)}),this}},off:function(h,m){if(h!==r){var w=this.handlers;return u($(h),function(C){m?w[C]&&w[C].splice(Y(w[C],m),1):delete w[C]}),this}},emit:function(h,m){this.options.domEvents&&v(h,m);var w=this.handlers[h]&&this.handlers[h].slice();if(!(!w||!w.length)){m.type=h,m.preventDefault=function(){m.srcEvent.preventDefault()};for(var C=0;C<w.length;)w[C](m),C++}},destroy:function(){this.element&&d(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function d(h,m){var w=h.element;if(w.style){var C;u(h.options.cssProps,function(S,I){C=ht(w.style,I),m?(h.oldCssProps[C]=w.style[C],w.style[C]=S):w.style[C]=h.oldCssProps[C]||""}),m||(h.oldCssProps={})}}function v(h,m){var w=e.createEvent("Event");w.initEvent(h,!0,!0),w.gesture=m,m.target.dispatchEvent(w)}x(be,{INPUT_START:V,INPUT_MOVE:et,INPUT_END:Z,INPUT_CANCEL:it,STATE_POSSIBLE:Ln,STATE_BEGAN:te,STATE_CHANGED:Fe,STATE_ENDED:ke,STATE_RECOGNIZED:ye,STATE_CANCELLED:Qe,STATE_FAILED:Ht,DIRECTION_NONE:dt,DIRECTION_LEFT:mt,DIRECTION_RIGHT:yt,DIRECTION_UP:At,DIRECTION_DOWN:xt,DIRECTION_HORIZONTAL:It,DIRECTION_VERTICAL:Mt,DIRECTION_ALL:Dt,Manager:Rn,Input:Rt,TouchAction:Ot,TouchInput:qe,MouseInput:Ee,PointerEventInput:we,TouchMouseInput:ni,SingleTouchInput:Ze,Recognizer:bt,AttrRecognizer:pe,Tap:xe,Pan:le,Swipe:oi,Pinch:tn,Rotate:ai,Press:si,on:N,off:F,each:u,merge:A,extend:b,assign:x,inherit:P,bindFn:M,prefixed:ht});var _=typeof t<"u"?t:typeof self<"u"?self:{};_.Hammer=be,typeof r=="function"&&r.amd?r(function(){return be}):n.exports?n.exports=be:t[i]=be})(window,document,"Hammer")})(Ha);var ch=Ha.exports;const hh=Yi(ch);function Qi(n){return n*Math.PI/180}function Kr(n){return n*180/Math.PI}function ja(n,t,e,i){const r=n-e,s=t-i;return Math.sqrt(r*r+s*s)}function Qr(n,t,e,i){const r=e-n,s=i-t;return Math.atan2(s,r)}function ts(n,t){return{x:Math.cos(n)*t,y:Math.sin(n)*t}}function es(n,t){const e=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return{x:n/=e,y:t/=e}}function fh(n,t,e,i,r=10){if(Math.abs(e-n)<r&&Math.abs(i-t)<r)return"no";const s=Kr(Qr(n,t,e,i));return s>=-135&&s<=-45?"up":s>45&&s<135?"down":s>=135&&s<=180||s>=-180&&s<-135?"left":s>=-45&&s<=45?"right":"no"}class tr{x;y;vx;vy;ax;ay;mass;constructor(t){this.x=t.x,this.y=t.y,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||0}distanceTo(t){return ja(this.x,this.y,t.x,t.y)}angleTo(t){return Qr(this.x,this.y,t.x,t.y)}velocityTo(t){return{vx:t.x-this.x,vy:t.y-this.y}}followTo(t,e=3){const i=this.angleTo(t),{x:r,y:s}=ts(i,e);this.vx=r,this.vy=s,this.nextFrame()}followAccelerationTo(t,e=.05){const i=this.angleTo(t),{x:r,y:s}=ts(i,e);this.ax=r,this.ay=s,this.nextFrame()}nextFrame(t){const e=t?.gravity??0,i=t?.friction??0;if(this.vx+=this.ax,this.vy+=this.ay,this.vy+=e,i>0){const r=Math.atan2(this.vy,this.vx);let s=Math.sqrt(this.vx*this.vx+this.vy*this.vy);s>i?s-=i:s=0,this.vx=Math.cos(r)*s,this.vy=Math.sin(r)*s}this.x+=this.vx,this.y+=this.vy}nextFrameEaseTo(t,e){const i=e?.gravity??0,r=e?.friction??1,s=e?.easing??.05,a=t.x-this.x,o=t.y-this.y;this.vx=a*s,this.vy=o*s,this.vy+=i,this.vx*=r,this.vy*=r,this.x+=this.vx,this.y+=this.vy}nextFrameSpringTo(t,e){const i=e?.gravity??0,r=e?.friction??.95,s=e?.spring??.03;(Array.isArray(t)?t:[t]).forEach(o=>{const l=o.x-this.x,c=o.y-this.y,f=l*s,g=c*s;this.vx+=f,this.vy+=g}),this.vy+=i,this.vx*=r,this.vy*=r,this.x+=this.vx,this.y+=this.vy}nextFrameSpringConnect(t,e){const i=e?.gravity??0,r=e?.friction??.95,s=e?.spring??.03,a=e?.springLength??100,o=this.angleTo(t);this.nextFrameSpringTo(new tr({x:t.x-Math.cos(o)*a,y:t.y-Math.sin(o)*a}),{spring:s,friction:r,gravity:i})}}class Nn extends tr{width;height;constructor(t){super(t),this.width=t.width,this.height=t.height}eq(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}isIntersectRect(t){return!(this.x+this.width<t.x||t.x+t.width<this.x||this.y+this.height<t.y||t.y+t.height<this.y)}isContainPoint(t){return!(t.x<this.x||t.x>this.x+this.width||t.y<this.y||t.y>this.y+this.height)}toArray(){return[this.x,this.y,this.width,this.height]}clone(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height}}class Te extends tr{radius;constructor(t){super(t),this.radius=t?.radius??0}toSVGPathData(){return[this.x,this.y]}toSVGPathD(){return`${this.x},${this.y}`}setX(t){this.x=t}setY(t){this.y=t}setXY(t,e){this.x=t,this.y=e}eq(t){return this.x===t.x&&this.y===t.y}midPointBtw(t){return new Te({x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2})}toArray(){return[this.x,this.y]}clone(t){this.setXY(t.x,t.y)}getBoundRect(){return new Nn({x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2})}nextFrameCollisionTo(t){const e=t.x-this.x,i=t.y-this.y;if(Math.sqrt(e*e+i*i)<this.radius+t.radius){const a=Math.atan2(i,e),o=Math.sin(a),l=Math.cos(a),c={x:0,y:0},f=s(e,i,o,l,!0),g=s(this.vx,this.vy,o,l,!0),p=s(t.vx,t.vy,o,l,!0),u=g.x-p.x;g.x=((this.mass-t.mass)*g.x+2*t.mass*p.x)/(this.mass+t.mass),p.x=u+g.x;const y=Math.abs(g.x)+Math.abs(p.x),x=this.radius+t.radius-Math.abs(c.x-f.x);c.x+=g.x/y*x,f.x+=p.x/y*x;const b=s(c.x,c.y,o,l,!1),A=s(f.x,f.y,o,l,!1);t.x=this.x+A.x,t.y=this.y+A.y,this.x=this.x+b.x,this.y=this.y+b.y;const P=s(g.x,g.y,o,l,!1),M=s(p.x,p.y,o,l,!1);this.vx=P.x,this.vy=P.y,t.vx=M.x,t.vy=M.y}function s(a,o,l,c,f=!1){return{x:f?a*c+o*l:a*c-o*l,y:f?o*c-a*l:o*c+a*l}}}nextFrameBounce(t,e){const i=t.x,r=t.y,s=t.x+t.width,a=t.y+t.height,o=e?.bounce??-1;this.x+this.radius>s?(this.x=s-this.radius,this.vx*=o):this.x-this.radius<i&&(this.x=i+this.radius,this.vx*=o),this.y+this.radius>a?(this.y=a-this.radius,this.vy*=o):this.y-this.radius<r&&(this.y=r+this.radius,this.vy*=o)}}class Va{constructor(){}static getFormatKeyNames(t){const e=Jr(),i=[];return t.ctrl&&i.push(e?"Cmd":"Ctrl"),t.shift&&i.push("Shift"),t.alt&&i.push("Alt"),typeof t.key=="string"?i.push(oa(t.key)):Array.isArray(t.key)&&(t.key.map(r=>oa(r)),i.push(...t.key)),i}static matchKeyScheme(t,e){const i=t.ctrl??!1,r=t.shift??!1,s=t.alt??!1;if(t.exact)return(i===e.metaKey||i===e.ctrlKey)&&r===e.shiftKey&&s===e.altKey;const a=[];return i&&a.push(i===e.metaKey||i===e.ctrlKey),r&&a.push(r===e.shiftKey),s&&a.push(s===e.altKey),a.every(o=>o)}static on(t,e){if(t?.key===void 0||t?.key===null)return e;const i=t?.target??window;let r=!1;const s=this.getFormatKeyNames(t),a=o=>{if(o.stopPropagation(),!r&&o.key!=="Control"&&o.key!=="Meta"&&o.key!=="Shift"&&o.key!=="Option"&&o.key!=="Alt"&&s.find(l=>l.toLowerCase()===o.key.toLowerCase())&&this.matchKeyScheme(t,o)){o.preventDefault();const l=e(o);if(typeof l!="function")return;const c=f=>{f.preventDefault(),l(f),i.removeEventListener("keyup",c)};i.addEventListener("keyup",c)}};return e.title=t?.title??"",e.formatedKeyNames=s,e.pause=()=>r=!0,e.restart=()=>r=!1,e.removeListener=()=>i.removeEventListener("keydown",a),i.addEventListener("keydown",a),e}}const Xa=uh("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);function uh(n,t=10){const e={},i=n.split(",");for(let r=0;r<i.length;r+=2){const s="&"+i[r+1]+";",a=parseInt(i[r],t);e[s]="&#"+a+";"}return e["\\xa0"]=" ",e}function ee(n,t){const e=Object.keys(t);for(let i=0;i<e.length;i++)n=n.replace(new RegExp("{"+e[i]+"}","gi"),""+t[e[i]]);return n}function er(n){let t,e;if(!n)throw new Error("cannot create a random attribute name for an undefined object");const i="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=i[Math.floor(Math.random()*i.length)];while(n[t]);return t}function dh(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function ph(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const di={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}};class nr{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const i=this.__ctx.__createElement("stop");if(i.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const s=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);s&&(i.setAttribute("stop-color",ee("rgb({r},{g},{b})",{r:s[1],g:s[2],b:s[3]})),i.setAttribute("stop-opacity",s[4]))}else i.setAttribute("stop-color",e);this.__root.appendChild(i)}}class ns{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class pi{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:i=500,enableMirroring:r=!1}){this.enableMirroring=r,t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=i),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(di);for(let e=0,i=t.length;e<i;e++){const r=t[e];this[r]=di[r].canvas}}__getStyleState(){const t={},e=Object.keys(di);for(let i=0,r=e.length;i<r;i++){const s=e[i];t[s]=this[s]}return t}__applyStyleState(t){const e=Object.keys(t);for(let i=0,r=e.length;i<r;i++){const s=e[i];this[s]=t[s]}}__createElement(t,e={},i=!1){const r=this.__document.createElementNS("http://www.w3.org/2000/svg",t),s=Object.keys(e);i&&(r.setAttribute("fill","none"),r.setAttribute("stroke","none"));for(let a=0;a<s.length;a++){const o=s[a];r.setAttribute(o,e[o])}return r}__applyStyleToCurrentElement(t){let e=this.__currentElement;const i=this.__currentElementsToStyle;i&&(e.setAttribute(t,""),e=i.element,i.children.forEach(s=>{s.setAttribute(t,"")}));const r=Object.keys(di);for(let s=0;s<r.length;s++){const a=di[r[s]],o=this[r[s]];if(a.apply){if(o instanceof ns){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const l=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[l]=l,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,ee("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof nr)e.setAttribute(a.apply,ee("url(#{id})",{id:o.__root.getAttribute("id")}));else if(a.apply.indexOf(t)!==-1&&a.svg!==o)if((a.svgAttr==="stroke"||a.svgAttr==="fill")&&o.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);e.setAttribute(a.svgAttr,ee("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let f=parseFloat(c[4]);const g=this.globalAlpha;g!=null&&(f*=g),e.setAttribute(a.svgAttr+"-opacity",""+f)}else{let l=a.svgAttr;if(r[s]==="globalAlpha"&&(l=t+"-"+a.svgAttr,e.getAttribute(l)))continue;l&&e.setAttribute(l,o)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const r=Object.keys(Xa);for(let s=0,a=r.length;s<a;s++){const o=r[s],l=Xa[o],c=new RegExp(o,"gi");c.test(e)&&(e=e.replace(c,l))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const r=this.__createElement("g");e.appendChild(r),this.__currentElement=r}let i=this.__currentElement.getAttribute("transform");i?i+=" ":i="",i+=t,this.__currentElement.setAttribute("transform",i)}scale(t,e){e===void 0&&(e=t),this.__addTransform(ee("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(ee("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(ee("translate({x},{y})",{x:t,y:e}))}transform(t,e,i,r,s,a){this.__addTransform(ee("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:i,d:r,e:s,f:a}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"?t.setAttribute("d",this.__currentDefaultPath):console.error("Attempted to apply path command to node",t.nodeName)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(ee("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(ee("L {x} {y}",this.__currentPosition)):this.__addPathCommand(ee("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,i,r,s,a){this.__currentPosition={x:s,y:a},this.__addPathCommand(ee("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:i,cp2y:r,x:s,y:a}))}quadraticCurveTo(t,e,i,r){this.__currentPosition={x:i,y:r},this.__addPathCommand(ee("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:i,y:r}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,i,r,s){const a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(typeof a>"u"||typeof o>"u")return;if(s<0)throw new Error("IndexSizeError: The radius provided ("+s+") is negative.");if(a===t&&o===e||t===i&&e===r||s===0){this.lineTo(t,e);return}const l=this.normalize([a-t,o-e]),c=this.normalize([i-t,r-e]);if(l[0]*c[1]===l[1]*c[0]){this.lineTo(t,e);return}const f=l[0]*c[0]+l[1]*c[1],g=Math.acos(Math.abs(f)),p=this.normalize([l[0]+c[0],l[1]+c[1]]),u=s/Math.sin(g/2),y=t+u*p[0],x=e+u*p[1],b=[-l[1],l[0]],A=[c[1],-c[0]],P=function(z){const N=z[0];return z[1]>=0?Math.acos(N):-Math.acos(N)},M=P(b),D=P(A);this.lineTo(y+b[0]*s,x+b[1]*s),this.arc(y,x,s,M,D)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,i,r){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.closePath()}fillRect(t,e,i,r){const s=this.__createElement("rect",{x:t,y:e,width:i,height:r},!0);this.__closestGroupOrSvg().appendChild(s),this.__currentElement=s,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,i,r){const s=this.__createElement("rect",{x:t,y:e,width:i,height:r},!0);this.__closestGroupOrSvg().appendChild(s),this.__currentElement=s,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),i=this.__rootSVG.childNodes[1],r=i.childNodes;for(let s=r.length-1;s>=0;s--)r[s]&&i.removeChild(r[s]);this.__currentElement=i,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,i,r){if(t===0&&e===0&&i===this.width&&r===this.height){this.__clearCanvas();return}const s=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:i,height:r,fill:"#FFFFFF"},!0);s.appendChild(a)}createLinearGradient(t,e,i,r){const s=this.__createElement("linearGradient",{id:er(this.__ids),x1:t+"px",x2:i+"px",y1:e+"px",y2:r+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(s),new nr(s,this)}createRadialGradient(t,e,i,r,s,a){const o=this.__createElement("radialGradient",{id:er(this.__ids),cx:r+"px",cy:s+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new nr(o,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),i={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(i.decoration="underline"),this.__fontHref&&(i.href=this.__fontHref),i}__wrapTextLink(t,e){if(t.href){const i=this.__createElement("a");return i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),i.appendChild(e),i}return e}__applyText(t,e,i,r){const s=this.__parseFont(),a=this.__closestGroupOrSvg(),o=this.__createElement("text",{"font-family":s.family,"font-size":s.size,"font-style":s.style,"font-weight":s.weight,"text-decoration":s.decoration,x:e,y:i,"text-anchor":dh(this.textAlign),"dominant-baseline":ph(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(r),a.appendChild(this.__wrapTextLink(s,o))}fillText(t,e,i){this.__applyText(t,e,i,"fill")}strokeText(t,e,i){this.__applyText(t,e,i,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,i,r,s,a){if(r===s)return;r=r%(2*Math.PI),s=s%(2*Math.PI),r===s&&(s=(s+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+i*Math.cos(s),l=e+i*Math.sin(s),c=t+i*Math.cos(r),f=e+i*Math.sin(r),g=a?0:1;let p=0,u=s-r;u<0&&(u+=2*Math.PI),a?p=u>Math.PI?0:1:p=u>Math.PI?1:0,this.lineTo(c,f),this.__addPathCommand(ee("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:p,sweepFlag:g,endX:o,endY:l})),this.__currentPosition={x:o,y:l}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),i=er(this.__ids),r=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",i),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",ee("url(#{id})",{id:i})),t.appendChild(r),this.__currentElement=r}drawImage(...t){let e=t[0],i,r,s,a,o=0,l=0,c,f,g,p,u,y,x,b;if(t.length===3)i=t[1],r=t[2],c=e.width,f=e.height,s=c,a=f;else if(t.length===5)i=t[1],r=t[2],s=t[3],a=t[4],c=e.width,f=e.height;else if(t.length===9)o=t[1],l=t[2],c=t[3],f=t[4],i=t[5],r=t[6],s=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const A=this.__closestGroupOrSvg();this.__currentElement;const P="translate("+i+", "+r+")";if(e instanceof pi){if(g=e.getSvg().cloneNode(!0),g.childNodes&&g.childNodes.length>1){for(p=g.childNodes[0];p.childNodes.length;)b=p.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(p.childNodes[0]);if(u=g.childNodes[1],u){const M=u.getAttribute("transform");let D;M?D=M+" "+P:D=P,u.setAttribute("transform",D),A.appendChild(u)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(y=this.__createElement("image"),y.setAttribute("width",s),y.setAttribute("height",a),y.setAttribute("preserveAspectRatio","none"),(o||l||c!==e.width||f!==e.height)&&(x=this.__document.createElement("canvas"),x.width=s,x.height=a,x.getContext("2d")?.drawImage(e,o,l,c,f,0,0,s,a),e=x),y.setAttribute("transform",P),y.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),A.appendChild(y))}createPattern(t,e){const i=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),r=er(this.__ids);let s;return i.setAttribute("id",r),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(s=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),i.appendChild(s),this.__SVGdefs.appendChild(i)):t instanceof pi&&(i.setAttribute("width",""+t.width),i.setAttribute("height",""+t.height),i.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(i)),new ns(i,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}function gh(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ya={},is={exports:{}},Za;function mh(){return Za||(Za=1,function(n){(function(t){var e="0.4.0",i="hasOwnProperty",r=/[\.\/]/,s="*",a=function(){},o=function(p,u){return p-u},l,c,f={n:{}},g=function(p,u){var y=c,x=Array.prototype.slice.call(arguments,2),b=g.listeners(p),A=0,P,M=[],D={},z=[];l=p,c=0;for(var N=0,F=b.length;N<F;N++)"zIndex"in b[N]&&(M.push(b[N].zIndex),b[N].zIndex<0&&(D[b[N].zIndex]=b[N]));for(M.sort(o);M[A]<0;)if(P=D[M[A++]],z.push(P.apply(u,x)),c)return c=y,z;for(N=0;N<F;N++)if(P=b[N],"zIndex"in P)if(P.zIndex==M[A]){if(z.push(P.apply(u,x)),c)return c=y,z;do if(A++,P=D[M[A]],P&&z.push(P.apply(u,x)),c)return c=y,z;while(P)}else D[P.zIndex]=P;else if(z.push(P.apply(u,x)),c)return c=y,z;return c=y,z.length?z:null};g.listeners=function(p){var u=p.split(r),y=f,x,b,A,P,M,D,z,N,F=[y],G=[];for(P=0,M=u.length;P<M;P++){for(N=[],D=0,z=F.length;D<z;D++)for(y=F[D].n,b=[y[u[P]],y[s]],A=2;A--;)x=b[A],x&&(N.push(x),G=G.concat(x.f||[]));F=N}return G},g.on=function(p,u){for(var y=p.split(r),x=f,b=0,A=y.length;b<A;b++)x=x.n,!x[y[b]]&&(x[y[b]]={n:{}}),x=x[y[b]];for(x.f=x.f||[],b=0,A=x.f.length;b<A;b++)if(x.f[b]==u)return a;return x.f.push(u),function(P){+P==+P&&(u.zIndex=+P)}},g.stop=function(){c=1},g.nt=function(p){return p?new RegExp("(?:\\.|\\/|^)"+p+"(?:\\.|\\/|$)").test(l):l},g.unbind=function(p,u){var y=p.split(r),x,b,A,P,M,D,z,N=[f];for(P=0,M=y.length;P<M;P++)for(D=0;D<N.length;D+=A.length-2){if(A=[D,1],x=N[D].n,y[P]!=s)x[y[P]]&&A.push(x[y[P]]);else for(b in x)x[i](b)&&A.push(x[b]);N.splice.apply(N,A)}for(P=0,M=N.length;P<M;P++)for(x=N[P];x.n;){if(u){if(x.f){for(D=0,z=x.f.length;D<z;D++)if(x.f[D]==u){x.f.splice(D,1);break}!x.f.length&&delete x.f}for(b in x.n)if(x.n[i](b)&&x.n[b].f){var F=x.n[b].f;for(D=0,z=F.length;D<z;D++)if(F[D]==u){F.splice(D,1);break}!F.length&&delete x.n[b].f}}else{delete x.f;for(b in x.n)x.n[i](b)&&x.n[b].f&&delete x.n[b].f}x=x.n}},g.once=function(p,u){var y=function(){u.apply(this,arguments),g.unbind(p,y)};return g.on(p,y)},g.version=e,g.toString=function(){return"You are running Eve "+e},n.exports?n.exports=g:t.eve=g})(xc)}(is)),is.exports}(function(n){if(typeof gh=="function")var t=mh();(function(){function e(p){var u=function(y){u.parse(y)};return u.mode="text",u.type=String(p||"html").toLowerCase(),u.textchunk="",u.raw="",u.parse=l,u.on=a,u.event=s,u.end=r,u}function i(p,u,y){p==`
|
|
18
|
-
`&&this.event("newline"),g[this.mode].call(this,p,u,y)}function r(){i.call(this,"eof"),this.event("eof")}function s(p,u,y){typeof t=="function"&&t("elemental."+p+"."+u,null,u,y||"",this.raw);for(var x=this.events&&this.events[p],b=x&&x.length;b--;)try{this.events[p][b](u,y||"",this.raw)}catch{}this.raw=""}function a(p,u){this.events=this.events||{},this.events[p]=this.events[p]||[],this.events[p].push(u)}function o(p,u){return p&&(p.charAt?p.charAt(u):p[u])}function l(p){p=p||Object(p);for(var u=1,y=p.length+1,x,b,A=o(p,0);u<y;u++)x=b,b=A,A=o(p,u),this.raw+=b,i.call(this,b,A,x);this._beforeEnd=function(){i.call(this,"","",b)}}var c=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]/,f=function(){for(var p in this.attr)this.attr.hasOwnProperty(p)&&this.event("attr",p,{value:this.attr[p],tagname:this.tagname,attr:this.attr})},g={text:function(p,u,y){switch(p){case"<":case"eof":this.nodename="",this.attr={},this.mode="tag name start",this.raw=this.raw.slice(0,-1),this.textchunk&&this.event("text",this.textchunk),this.raw+=p,this.textchunk="";break;default:this.textchunk+=p}},special:function(p,u,y){if(y=="!"&&p=="-"&&u=="-")this.mode="comment start";else{if(this.textchunk=="[CDATA"&&p=="["){this.mode="cdata",this.textchunk="";return}if(p==">"||p=="eof"){this.event("special",this.textchunk),this.mode="text",this.textchunk="";return}this.textchunk+=p}},cdata:function(p,u,y){y=="]"&&p=="]"&&u==">"?(this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1)):(p=="eof"&&g["cdata end"].call(this),this.textchunk+=p)},"cdata end":function(p,u,y){this.event("cdata",this.textchunk),this.textchunk="",this.mode="text"},"comment start":function(p,u,y){u==">"||p=="eof"?(this.event("comment",""),this.mode="comment instant end"):this.mode="comment"},"comment instant end":function(p,u,y){this.mode="text"},comment:function(p,u,y){p=="-"&&y=="-"&&u==">"?(this.mode="comment end",this.textchunk=this.textchunk.slice(0,-1)):p=="eof"?this.event("comment",this.textchunk):this.textchunk+=p},"comment end":function(p,u,y){this.event("comment",this.textchunk),this.textchunk="",this.mode="text"},declaration:function(p,u,y){p=="?"&&u==">"?this.mode="declaration end":(p=="eof"&&this.event("comment",this.textchunk),this.textchunk+=p)},"declaration end":function(p,u,y){this.event("comment",this.textchunk),this.textchunk="",this.mode="text"},"tag name start":function(p,u,y){if(p=="eof")this.event("text","<");else if(!c.test(p)){if(this.mode="tag name",p=="/"){this.mode="close tag name start";return}if(p=="!"){this.mode="special",this.textchunk="";return}if(p=="?"){this.mode="declaration";return}g[this.mode].call(this,p,u,y)}},"close tag name start":function(p,u,y){c.test(p)||(this.mode="close tag name",this.tagname="",this.nodename="",g[this.mode].call(this,p,u,y))},"close tag name":function(p,u,y){if(c.test(p))this.tagname=this.nodename;else switch(p){case">":this.event("/tag",this.tagname||this.nodename),this.mode="text";break;default:!this.tagname&&(this.nodename+=p)}},"tag name":function(p,u,y){if(c.test(p))this.tagname=this.nodename,this.nodename="",this.mode="attr start";else switch(p){case">":this.event("tag",this.nodename),this.mode="text";break;default:this.nodename+=p}},"attr start":function(p,u,y){c.test(p)||(this.mode="attr",this.nodename="",g[this.mode].call(this,p,u,y))},attr:function(p,u,y){if(c.test(p)||p=="=")this.attr[this.nodename]="",this.mode="attr value start";else switch(p){case">":this.nodename=="/"?(delete this.attr["/"],this.event("tag",this.tagname,this.attr),f.call(this),this.event("/tag",this.tagname,!0)):(this.nodename&&(this.attr[this.nodename]=""),this.event("tag",this.tagname,this.attr),f.call(this)),this.mode="text";break;default:this.nodename+=p}},"attr value start":function(p,u,y){if(!c.test(p)){if(this.mode="attr value",this.quote=!1,p=="'"||p=='"'){this.quote=p;return}g[this.mode].call(this,p,u,y)}},"attr value":function(p,u,y){if(c.test(p)&&!this.quote)this.mode="attr start";else if(p==">"&&!this.quote)this.event("tag",this.tagname,this.attr),this.mode="text";else switch(p){case'"':case"'":this.quote==p&&y!="\\"&&(this.mode="attr start");break;default:this.attr[this.nodename]+=p}}};e.version="0.2.1",n.elemental=e,n.eve=t})()})(Ya);const $a=Yi(Ya),qa=[1,0,0,1,0,0],Wa=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class qt{value;matrix3d;isEverTo3d=!1;_prev_translate_z=0;_prev_rotate=0;_prev_rotate_x=0;_prev_rotate_y=0;_prev_rotate_z=0;_prev_scale_z=1;constructor(t=qa){this.value=Array.from(t),this.matrix3d=this.toMatrix3D()}unit(){return this.value=Array.from(qa),this.matrix3d=this.toMatrix3D(),this}transformPoint(t,e,i=0,r=0){const s=t-i,a=e-r;return t=s*this.value[0]+a*this.value[2]+this.value[4],e=s*this.value[1]+a*this.value[3]+this.value[5],[t+i,e+r]}fromString(t){const e=aa("number",t);return e.length===6?e.forEach((i,r)=>{i.fullMatch&&(this.value[r]=parseFloat(i.fullMatch))}):this.unit(),this}toMatrix3D(t=this.matrix3d){const e=[this.value[0],this.value[1],0,0,this.value[2],this.value[3],0,0,0,0,1,0,this.value[4],this.value[5],0,1];return t?(t.value=e,t):new yn(e)}offset(t=0,e=0){return[t-this.value[4],e-this.value[5]]}clone(){return new qt(this.value)}multiply(t){const e=this.value;let i;t instanceof qt?i=t.value:i=t;const r=e[0]*i[0]+e[2]*i[1],s=e[1]*i[0]+e[3]*i[1],a=e[0]*i[2]+e[2]*i[3],o=e[1]*i[2]+e[3]*i[3],l=e[0]*i[4]+e[2]*i[5]+e[4],c=e[1]*i[4]+e[3]*i[5]+e[5];return e[0]=r,e[1]=s,e[2]=a,e[3]=o,e[4]=l,e[5]=c,this}inverse(){const t=new qt(this.value),e=t.value,i=1/(e[0]*e[3]-e[1]*e[2]),r=e[3]*i,s=-e[1]*i,a=-e[2]*i,o=e[0]*i,l=i*(e[2]*e[5]-e[3]*e[4]),c=i*(e[1]*e[4]-e[0]*e[5]);return e[0]=r,e[1]=s,e[2]=a,e[3]=o,e[4]=l,e[5]=c,t}translate(t,e){return this.matrix3d.translate(t,e,0),this.multiply([1,0,0,1,t,e])}translateTo(t,e){const i=this.offset(t,e);return this.translate(i[0],i[1])}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.value[5])}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.value[4],t)}translateZ(t){return this.isEverTo3d=!0,this.matrix3d.translate(0,0,t)}translateZTo(t){return this.translateZ(t-this._prev_translate_z),this._prev_translate_z=t,this}translate3d(t,e,i){return this.isEverTo3d=!0,this.matrix3d.translate(t,e,i)}translate3dTo(t,e,i){return this.translate3d(t-this.matrix3d.value[12],t-this.matrix3d.value[13],i-this._prev_translate_z),this._prev_translate_z=i,this}rotate(t,e=0,i=0){const r=Qi(t),s=+Math.cos(r).toFixed(9),a=+Math.sin(r).toFixed(9);return this.multiply([s,a,-a,s,e,i]),this.translate(-e,-i),this}rotateTo(t,e=0,i=0){return this.rotate(t-this._prev_rotate,e,i),this._prev_rotate=t,this}rotateX(t){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t)}rotateXTo(t){return this.rotateX(t-this._prev_rotate_x),this._prev_rotate_x=t,this}rotateY(t){return this.isEverTo3d=!0,this.matrix3d.rotate("y",t)}rotateYTo(t){return this.rotateY(t-this._prev_rotate_y),this._prev_rotate_y=t,this}rotateZ(t){return this.isEverTo3d=!0,this.matrix3d.rotate("z",t)}rotateZTo(t){return this.rotateZ(t-this._prev_rotate_z),this._prev_rotate_z=t,this}rotate3d(t,e,i){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t).rotate("y",e).rotate("z",i)}rotate3dTo(t,e,i){return this.rotate3d(t-this._prev_rotate_x,e-this._prev_rotate_y,i-this._prev_rotate_z),this._prev_rotate_x=t,this._prev_rotate_y=e,this._prev_rotate_z=i,this}scale(t,e=t,i=0,r=0){return this.matrix3d.scale(t,e,1),this.translate(i,r),this.multiply([t,0,0,e,0,0]),this.translate(-i,-r),this}scaleTo(t,e=t,i=0,r=0){return this.scale(t/this.value[0],e/this.value[3],i,r),this}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.value[0],1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.value[3])}scaleZ(t){return this.isEverTo3d=!0,this.matrix3d.scale(1,1,t)}scaleZTo(t){return this.scaleZ(t/this._prev_scale_z),this._prev_scale_z=t,this}scale3d(t,e,i){return this.isEverTo3d=!0,this.matrix3d.scale(t,e,i)}scale3dTo(t,e,i){return this.scale3d(t/this.matrix3d.value[0],e/this.matrix3d.value[5],i/this._prev_scale_z),this._prev_scale_z=i,this}skew(t,e=t){const i=t*Math.PI/180,r=e*Math.PI/180,s=Math.tan(i),a=Math.tan(r);return this.multiply([1,a,s,1,0,0])}skewTo(t,e=t){return this.skew(t-this.value[2],e-this.value[1])}skewX(t){return this.skew(t,this.value[1])}skewXTo(t){return this.skewTo(t,this.value[1])}skewY(t){return this.skew(this.value[2],t)}skewYTo(t){return this.skewTo(this.value[2],t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,i){return this}skew3dTo(t,e,i){return this}split(){const t={dx:0,dy:0,scalex:1,scaley:1,shear:1,rotate:0,isSimple:!0,isSuperSimple:!0,noRotation:!1};t.dx=this.value[4],t.dy=this.value[5];const e=[[this.value[0],this.value[2]],[this.value[1],this.value[3]]];t.scalex=Math.sqrt(Math.pow(e[0][0],2)+Math.pow(e[0][1],2));let i=es(e[0][0],e[0][1]);e[0][0]=i.x,e[0][1]=i.y,t.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*t.shear,e[1][1]-e[0][1]*t.shear],t.scaley=Math.sqrt(Math.pow(e[1][0],2)+Math.pow(e[1][1],2)),i=es(e[1][0],e[1][1]),e[1][0]=i.x,e[1][1]=i.y,t.shear/=t.scaley;const r=-e[0][1],s=e[1][1];return s<0?(t.rotate=Kr(Math.acos(s)),r<0&&(t.rotate=360-t.rotate)):t.rotate=Qi(Math.asin(r)),t.isSimple=!+t.shear.toFixed(9)&&(t.scalex.toFixed(9)==t.scaley.toFixed(9)||!t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t}static split2(t){const e=Math.atan2(t[1],t[0]),i=Math.pow(t[0],2)+Math.pow(t[1],2),r=Math.sqrt(i),s=(t[0]*t[3]-t[2]*t[1])/r;return{rotation:e/(Math.PI/180),scaleX:r,scaleY:s,x:t[4],y:t[5]}}static getGroupCoords(t,e){const i=t[0],r=t[1],s=t[2],a=t[3],o=t[4],l=t[5],c=e[0],f=e[1],g=e[2],p=e[3],u=e[4],y=e[5],x=c*p,b=f*g,A=(g*r-i*p)/(b-x),P=(c*r-i*f)/(x-b),M=(g*a-s*p)/(b-x),D=(c*a-s*f)/(x-b),z=(g*(l-y)+p*(u-o))/(b-x),N=(c*(l-y)+f*(u-o))/(x-b),F=[A,P,M,D,z,N];return qt.split2(F)}toTransformString(){const t=this.split();return t.isSimple?(t.scalex=+t.scalex.toFixed(4),t.scaley=+t.scaley.toFixed(4),t.rotate=+t.rotate.toFixed(4),(t.dx&&t.dy?"t"+[t.dx,t.dy]:"")+(t.scalex!=1||t.scaley!=1?"s"+[t.scalex,t.scaley,0,0]:"")+(t.rotate?"r"+[t.rotate,0,0]:"")):"matrix"+[this.value[0],this.value[1],this.value[2],this.value[3],this.value[4],this.value[5]]}toString(){return this.isEverTo3d?this.toMatrix3DString():`matrix(${this.value.map(t=>ua(t,6)).join(",")})`}toMatrix3DString(){return this.matrix3d.toString()}toFilter(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.value[0]+", M12="+this.value[2]+", M21="+this.value[1]+", M22="+this.value[3]+", Dx="+this.value[4]+", Dy="+this.value[5]+", sizingmethod='auto expand')"}}class yn{value;constructor(t=Wa){this.value=Array.from(t)}unit(){return this.value=Array.from(Wa),this}fromString(t){const e=aa("number",t);return e.length===16?e.forEach((i,r)=>{i.fullMatch&&(this.value[r]=parseFloat(i.fullMatch))}):this.unit(),this}toMatrix(t){const e=[this.value[0],this.value[1],this.value[4],this.value[5],this.value[12],this.value[13]];return t?(t.value=e,t):new qt(e)}multiplyMatrix(t){const e=this.value[0],i=this.value[1],r=this.value[2],s=this.value[3],a=this.value[4],o=this.value[5],l=this.value[6],c=this.value[7],f=this.value[8],g=this.value[9],p=this.value[10],u=this.value[11],y=this.value[12],x=this.value[13],b=this.value[14],A=this.value[15],P=t.value[0],M=t.value[1],D=t.value[2],z=t.value[3],N=P*e+M*a+D*f+z*y,F=P*i+M*o+D*g+z*x,G=P*r+M*l+D*p+z*b,H=P*s+M*c+D*u+z*A;return new qt([N,F,G,H,0,0])}multiply(t){const e=new qt([t.value[0],t.value[1],t.value[2],t.value[3],0,0]),i=new qt([t.value[4],t.value[5],t.value[6],t.value[7],0,0]),r=new qt([t.value[8],t.value[9],t.value[10],t.value[11],0,0]),s=new qt([t.value[12],t.value[13],t.value[14],t.value[15],0,0]),a=this.multiplyMatrix(e),o=this.multiplyMatrix(i),l=this.multiplyMatrix(r),c=this.multiplyMatrix(s);return this.value[0]=a.value[0],this.value[1]=a.value[1],this.value[2]=a.value[2],this.value[3]=a.value[3],this.value[4]=o.value[0],this.value[5]=o.value[1],this.value[6]=o.value[2],this.value[7]=o.value[3],this.value[8]=l.value[0],this.value[9]=l.value[1],this.value[10]=l.value[2],this.value[11]=l.value[3],this.value[12]=c.value[0],this.value[13]=c.value[1],this.value[14]=c.value[2],this.value[15]=c.value[3],this}translate(t=0,e=0,i=0){return this.multiply(new yn([1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1]))}scale(t=1,e=1,i=1){return this.multiply(new yn([t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1]))}rotate(t,e){const i=Qi(e),r=Math.sin,s=Math.cos;let a;switch(t){case"x":a=[1,0,0,0,0,s(i),r(i),0,0,-r(i),s(i),0,0,0,0,1];break;case"y":a=[s(i),0,-r(i),0,0,1,0,0,r(i),0,s(i),0,0,0,0,1];break;case"z":a=[s(i),r(i),0,0,-r(i),s(i),0,0,0,0,1,0,0,0,0,1];break}return this.multiply(new yn(a))}toString(){return`matrix3d(${this.value.map(t=>ua(t,6)).join(",")})`}}function Bn(n){const t=new qt;return n.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,i,r){r.indexOf(",")>=0?r=r.split(/\s*,\s*/):r=r.split(/\s+/);const s=[];for(let a=0,o=r.length;a<o;a++)r[a].trim()&&s.push(parseFloat(""+r[a]));switch(i.toLowerCase()){case"t":case"translate":t.translate(s[0],s[1]);break;case"translatex":t.translateX(s[0]);break;case"translatey":t.translateY(s[0]);break;case"translatez":t.translateZ(s[0]);break;case"translate3d":t.translate3d(s[0],s[1],s[2]);break;case"r":case"rotate":t.rotate(s[0],s[1]??0,s[2]??0);break;case"rotatex":t.rotateX(s[0]);break;case"rotatey":t.rotateY(s[0]);break;case"rotatez":t.rotateZ(s[0]);break;case"rotate3d":t.rotate3d(s[0],s[1],s[2]);break;case"s":case"scale":t.scale(s[0],s[1]??s[0]);break;case"scalex":t.scaleX(s[0]);break;case"scaley":t.scaleY(s[0]);break;case"scalez":t.scaleZ(s[0]);break;case"scale3d":t.scale3d(s[0],s[1],s[2]);break;case"skew":t.skew(s[0],s[1]??0);break;case"skewx":t.skewX(s[0]);break;case"skewy":t.skewY(s[0]);break;case"skewz":t.skewZ(s[0]);break;case"skew3d":t.skew3d(s[0],s[1],s[2]);break;case"m":case"matrix":t.multiply([s[0],s[1],s[2],s[3],s[4],s[5]]);break;case"matrix3d":t.matrix3d.multiply(new yn(s));break}return""}),t}function rs(n,t,e,i,r,s){if(typeof r>"u"||typeof s>"u"){const a=n-e,o=t-i;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return rs(n,t,r,s)-rs(e,i,r,s)}const Et=$a.eve,vh=$a.elemental,ir={cursor:1,cx:0,cy:0,fill:1,"fill-opacity":0,font:1,"font-family":1,"font-size":0,"font-style":1,"font-weight":1,height:0,"letter-spacing":0,opacity:0,r:0,rx:0,ry:0,src:1,stroke:1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":0,"stroke-opacity":0,"stroke-width":0,"text-anchor":1,width:0,x:0,y:0};function ss(n,t,e){for(var i=(n+"").split(";"),r=/^\s+|\s+$/g,s,a=0,o=i.length;a<o;a++){var l=i[a].split(":");s=l[0].replace(r,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()}),(!e||s in e)&&(t[s]=l[1].replace(r,""),e&&!e[s]&&(t[s]=parseFloat(t[s])))}}function Ja(n){const t=vh(),e=[],i=[],r={};let s,a,o;const l={};function c(f,g){return function(p,u){const y={type:g||f};e.push(y);for(let x in u)Object.prototype.hasOwnProperty.call(u,x)&&Et("rappar."+f+".attr."+x,y,u[x],x);Et("rappar."+f+".attrend",y,u)}}return Et.on("rappar.polygon.attr.points",function(f){this.path="M"+f+"z",Et.stop()}),Et.on("rappar.image.attr.xlink:href",function(f){this.src=f,Et.stop()}),Et.on("rappar.path.attr.d",function(f){this.path=f,Et.stop()}),Et.on("rappar.*.attr.transform",function(f){this.transform=Bn(f).toTransformString(),Et.stop()}),Et.on("rappar.*.attr.fill",function(f){var g=f.match(/url\(#([^)]+)\)/),p=this;g&&(g=g[1],r[g]?this.fill=r[g]:Et.on("rappar.found."+g,function(u){p.fill=u}),Et.stop())}),Et.on("rappar.line.attrend",function(f){this.path="M"+[f.x1,f.y1,f.x2,f.y2]}),Et.on("rappar.*.attrend",function(){for(var f=i.length;f--;)if(i[f]!=this){let p="",u="";for(var g in i[f])g=="transform"?p=i[f].transform:g=="class"&&l["."+i[f][g]]?u=l["."+i[f][g]].join(";")+";"+u:g=="id"&&l["#"+i[f][g]]?u=l["#"+i[f][g]].join(";")+";"+u:typeof this[g]>"u"&&(this[g]=i[f][g]);this.type&&(typeof this.transform>"u"?this.transform=p:this.transform+=p,typeof this.style>"u"?this.style=u:this.style=u+this.style,ss(this.style,this,ir))}}),Et.on("rappar.*.attr.style",function(f){var g=function(){ss(f,this,ir),Et.unbind("rappar.*.attrend",g)};Et.on("rappar.*.attrend",g),Et.stop()}),Et.on("rappar.*.attr.*",function(f,g){g in ir&&(this[g]=ir[g]?f:parseFloat(f))}),Et.on("elemental.tag.circle",c("circle")),Et.on("elemental.tag.ellipse",c("ellipse")),Et.on("elemental.tag.polygon",c("polygon","path")),Et.on("elemental.tag.path",c("path")),Et.on("elemental.tag.line",c("line","path")),Et.on("elemental.tag.rect",c("rect")),Et.on("elemental.tag.image",c("image")),Et.on("elemental.tag.text",c("text")),Et.on("elemental.text",function(f){try{const g=Pc(f);for(let p of g.stylesheet.rules){for(let u of p.selectors)l[u]=[];for(let u of p.declarations)for(let y of p.selectors)l[y].push(`${u.property}:${u.value}`)}}catch{}}),Et.on("elemental.tag.svg",function(f,g){let p=g.width||0,u=g.height||0;if(!p||!u){const y=g.viewBox.split(/\s+/gi);p=parseFloat(y[2])-parseFloat(y[0]),u=parseFloat(y[3])-parseFloat(y[1])}e.push({type:"viewbox",width:p,height:u})}),Et.on("rappar.text.attrend",function(){s="",a=this,this["text-anchor"]=this["text-anchor"]||"start"}),Et.on("elemental.text",function(f,g,p){a&&(s+=p)}),Et.on("elemental./tag.text",function(){a.text=s,a=null}),Et.on("elemental.tag.g",function(f,g){var p={};i.push(p);for(var u in g)Object.prototype.hasOwnProperty.call(g,u)&&(p[u]=g[u],Et("rappar.g.attr."+u,p,g[u],u));Et("rappar.g.attrend",p)}),Et.on("elemental./tag.g",function(f,g){i.pop()}),Et.on("elemental.tag.linearGradient",function(f,g){o={id:g.id,angle:+(360+rs(g.x1,g.y1,g.x2,g.y2,g.x1+100,g.y1)).toFixed(2),stops:[]}}),Et.on("elemental./tag.linearGradient",function(){for(var f=[o.angle],g,p=0,u=o.stops.length;p<u;p++)g=o.stops[p],p&&p!=u-1?f.push(g.color+":"+g.offset):f.push(g.color);r[o.id]=f.join("-"),Et("rappar.found."+o.id,null,r[o.id])}),Et.on("elemental.tag.radialGradient",function(f,g){o={id:g.id,stops:[]}}),Et.on("elemental./tag.radialGradient",function(){for(var f=[],g,p=0,u=o.stops.length;p<u;p++)g=o.stops[p],p&&p!=u-1?f.push(g.color+":"+g.offset):f.push(g.color);r[o.id]="r"+f.join("-"),Et("rappar.found."+o.id,null,r[o.id])}),Et.on("elemental.tag.stop",function(f,g){var p={};g.style&&ss(g.style,p),p.offset=p.offset||g.offset,p.color=p["stop-color"]||g["stop-color"],p.opacity=p["stop-opacity"]||g["stop-opacity"],~(p.offset+"").indexOf("%")?p.offset=parseFloat(p.offset):p.offset=parseFloat(p.offset)*100,p.offset=+p.offset.toFixed(2),o.stops.push(p)}),t(n),t.end(),e}function Ka(n){return typeof n!="string"?!1:(n=n.trim(),/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(n)&&/[\dz]$/i.test(n)&&n.length>4)}const as={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},_h=/([astvzqmhlc])([^astvzqmhlc]*)/gi,wh=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function yh(n){const t=n.match(wh);return t?t.map(Number):[]}function rr(n){const t=[];return n.replace(_h,function(e,i,r){let s=i.toLowerCase();for(r=yh(r),s=="m"&&r.length>2&&(t.push([i].concat(r.splice(0,2))),s="l",i=i=="m"?"l":"L");;){if(r.length==as[s])return r.unshift(i),t.push(r);if(r.length<as[s])throw new Error("malformed path data");t.push([i].concat(r.splice(0,as[s])))}}),t}function sr(n){var t=0,e=0,i=0,r=0;return n.map(function(s){s=s.slice();var a=s[0],o=a.toUpperCase();if(a!=o)switch(s[0]=o,a){case"a":s[6]+=i,s[7]+=r;break;case"v":s[1]+=r;break;case"h":s[1]+=i;break;default:for(var l=1;l<s.length;)s[l++]+=i,s[l++]+=r}switch(o){case"Z":i=t,r=e;break;case"H":i=s[1];break;case"V":r=s[1];break;case"M":i=t=s[1],r=e=s[2];break;default:i=s[s.length-2],r=s[s.length-1]}return s})}function xh(n){var t=0,e=0,i=0,r=0;return n.map(function(s){s=s.slice();var a=s[0],o=a.toLowerCase();if(a!=o)switch(s[0]=o,a){case"A":s[6]-=i,s[7]-=r;break;case"V":s[1]-=r;break;case"H":s[1]-=i;break;default:for(var l=1;l<s.length;)s[l++]-=i,s[l++]-=r}switch(o){case"z":i=t,r=e;break;case"h":i+=s[1];break;case"v":r+=s[1];break;case"m":i+=s[1],r+=s[2],t+=s[1],e+=s[2];break;default:i+=s[s.length-2],r+=s[s.length-1]}return s})}const gi=Math.PI*2;function Qa(n,t,e,i){const r=n*i-t*e<0?-1:1;let s=n*e+t*i;return s>1&&(s=1),s<-1&&(s=-1),r*Math.acos(s)}function bh(n,t,e,i,r,s,a,o,l,c){const f=c*(n-e)/2+l*(t-i)/2,g=-l*(n-e)/2+c*(t-i)/2,p=a*a,u=o*o,y=f*f,x=g*g;let b=p*u-p*x-u*y;b<0&&(b=0),b/=p*x+u*y,b=Math.sqrt(b)*(r===s?-1:1);const A=b*a/o*g,P=b*-o/a*f,M=c*A-l*P+(n+e)/2,D=l*A+c*P+(t+i)/2,z=(f-A)/a,N=(g-P)/o,F=(-f-A)/a,G=(-g-P)/o,H=Qa(1,0,z,N);let $=Qa(z,N,F,G);return s===0&&$>0&&($-=gi),s===1&&$<0&&($+=gi),[M,D,H,$]}function Th(n,t){const e=1.3333333333333333*Math.tan(t/4),i=Math.cos(n),r=Math.sin(n),s=Math.cos(n+t),a=Math.sin(n+t);return[i,r,i-r*e,r+i*e,s+a*e,a-s*e,s,a]}function Ch(n,t,e,i,r,s,a,o,l){const c=Math.sin(l*gi/360),f=Math.cos(l*gi/360),g=f*(n-e)/2+c*(t-i)/2,p=-c*(n-e)/2+f*(t-i)/2;if(g===0&&p===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const u=g*g/(a*a)+p*p/(o*o);u>1&&(a*=Math.sqrt(u),o*=Math.sqrt(u));const y=bh(n,t,e,i,r,s,a,o,c,f),x=[];let b=y[2],A=y[3];const P=Math.max(Math.ceil(Math.abs(A)/(gi/4)),1);A/=P;for(let M=0;M<P;M++)x.push(Th(b,A)),b+=A;return x.map(M=>{for(let D=0;D<M.length;D+=2){let z=M[D+0],N=M[D+1];z*=a,N*=o;const F=f*z-c*N,G=c*z+f*N;M[D+0]=F+y[0],M[D+1]=G+y[1]}return M})}function ar(n){for(var t,e=[],i=0,r=0,s=0,a=0,o=null,l=null,c=0,f=0,g=0,p=n.length;g<p;g++){var u=n[g],y=u[0];switch(y){case"M":s=u[1],a=u[2];break;case"A":var x=Ch(c,f,u[6],u[7],u[4],u[5],u[1],u[2],u[3]);if(!x.length)continue;x=x.map(D=>{const[z,N,F,G,H,$,Y,K]=D;return{x1:F,y1:G,x2:H,y2:$,x:Y,y:K}});for(var b=0,A;b<x.length;b++)A=x[b],u=["C",A.x1,A.y1,A.x2,A.y2,A.x,A.y],b<x.length-1&&e.push(u);break;case"S":var P=c,M=f;(t=="C"||t=="S")&&(P+=P-i,M+=M-r),u=["C",P,M,u[1],u[2],u[3],u[4]];break;case"T":t=="Q"||t=="T"?(o=c*2-o,l=f*2-l):(o=c,l=f),u=to(c,f,o,l,u[1],u[2]);break;case"Q":o=u[1],l=u[2],u=to(c,f,u[1],u[2],u[3],u[4]);break;case"L":u=or(c,f,u[1],u[2]);break;case"H":u=or(c,f,u[1],f);break;case"V":u=or(c,f,c,u[1]);break;case"Z":u=or(c,f,s,a);break}t=y,c=u[u.length-2],f=u[u.length-1],u.length>4?(i=u[u.length-4],r=u[u.length-3]):(i=c,r=f),e.push(u)}return e}function or(n,t,e,i){return["C",n,t,e,i,e,i]}function to(n,t,e,i,r,s){return["C",n/3+.6666666666666666*e,t/3+.6666666666666666*i,r/3+.6666666666666666*e,s/3+.6666666666666666*i,r,s]}const Eh=n=>Array.isArray(n);function Gn(n){if(!(this instanceof Gn))return new Gn(n);this._path=Eh(n)?n:rr(n),this._path=sr(this._path),this._path=Sh(this._path),this._path=kh(this._path)}Gn.prototype.at=function(n,t){return this._walk(n,t).pos},Gn.prototype.length=function(){return this._walk(null).length},Gn.prototype._walk=function(n,t){let e=[0,0],i=[0,0,0],r=[0,0],s=0;for(let f=0;f<this._path.length;f++){let g=this._path[f];if(g[0]==="M"){if(e[0]=g[1],e[1]=g[2],n===0)return{length:s,pos:e}}else if(g[0]==="C"){i[0]=r[0]=e[0],i[1]=r[1]=e[1],i[2]=s;let p=100;for(let u=0;u<=p;u++){let y=u/p,x=a(g,y),b=o(g,y);if(s+=os(e[0],e[1],x,b),e[0]=x,e[1]=b,typeof n=="number"&&s>=n){let A=(s-n)/(s-i[2]),P=[e[0]*(1-A)+i[0]*A,e[1]*(1-A)+i[1]*A];return{length:s,pos:P}}i[0]=e[0],i[1]=e[1],i[2]=s}}else if(g[0]==="Q"){i[0]=r[0]=e[0],i[1]=r[1]=e[1],i[2]=s;let p=100;for(let u=0;u<=p;u++){let y=u/p,x=l(g,y),b=c(g,y);if(s+=os(e[0],e[1],x,b),e[0]=x,e[1]=b,typeof n=="number"&&s>=n){let A=(s-n)/(s-i[2]),P=[e[0]*(1-A)+i[0]*A,e[1]*(1-A)+i[1]*A];return{length:s,pos:P}}i[0]=e[0],i[1]=e[1],i[2]=s}}else if(g[0]==="L"){if(i[0]=e[0],i[1]=e[1],i[2]=s,s+=os(e[0],e[1],g[1],g[2]),e[0]=g[1],e[1]=g[2],typeof n=="number"&&s>=n){let p=(s-n)/(s-i[2]),u=[e[0]*(1-p)+i[0]*p,e[1]*(1-p)+i[1]*p];return{length:s,pos:u}}i[0]=e[0],i[1]=e[1],i[2]=s}}return{length:s,pos:e};function a(f,g){return Math.pow(1-g,3)*r[0]+3*Math.pow(1-g,2)*g*f[1]+3*(1-g)*Math.pow(g,2)*f[3]+Math.pow(g,3)*f[5]}function o(f,g){return Math.pow(1-g,3)*r[1]+3*Math.pow(1-g,2)*g*f[2]+3*(1-g)*Math.pow(g,2)*f[4]+Math.pow(g,3)*f[6]}function l(f,g){return Math.pow(1-g,2)*r[0]+2*(1-g)*g*f[1]+Math.pow(g,2)*f[3]}function c(f,g){return Math.pow(1-g,2)*r[1]+2*(1-g)*g*f[2]+Math.pow(g,2)*f[4]}};function os(n,t,e,i){let r=n-e,s=t-i;return Math.sqrt(r*r+s*s)}function kh(n){let t,e=0,i=0,r={S:{to:"C",x:3},T:{to:"Q",x:1}};for(let s=0,a=n.length;s<a;s++){let o=n[s],l=r[o[0]];l&&(o[0]=l.to,t&&(t[0]===l.to?(e=2*t[l.x+2]-t[l.x],i=2*t[l.x+3]-t[l.x+1]):(e=t[t.length-2],i=t[t.length-1])),o.splice(1,0,e,i)),t=o}return n}function Sh(n){let t=[],e=["L",0,0],i;for(let r=0,s=n.length;r<s;r++){let a=n[r];switch(a[0]){case"M":e=["L",a[1],a[2]],t.push(a);break;case"Z":t.push(e);break;case"H":i=t[t.length-1]||["L",0,0],t.push(["L",a[1],i[i.length-1]]);break;case"V":i=t[t.length-1]||["L",0,0],t.push(["L",i[i.length-2],a[1]]);break;default:t.push(a)}}return t}const ls=n=>{if(typeof n=="function"||Object(n)!==n)return n;const t=new n.constructor;for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=ls(n[e]));return t};function cs(n){const t=cs.ps=cs.ps||{};return t[n]?t[n].sleep=100:t[n]={sleep:100},setTimeout(()=>{for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&e!==n&&(t[e].sleep--,t[e].sleep||delete t[e])}),t[n]}function mi(n,t,e,i){return n==null&&(n=t=e=i=0),t==null&&(t=n.y,e=n.width,i=n.height,n=n.x),{x:n,y:t,width:e,w:e,height:i,h:i,x2:n+e,y2:t+i,cx:n+e/2,cy:t+i/2,r1:Math.min(e,i)/2,r2:Math.max(e,i)/2,r0:Math.sqrt(e*e+i*i)/2,path:Rh(n,t,e,i),vb:[n,t,e,i].join(" ")}}function eo(n,t,e,i,r,s,a,o,l){const c=1-l,f=c**3,g=c**2,p=l*l,u=p*l,y=f*n+g*3*l*e+c*3*l*l*r+u*a,x=f*t+g*3*l*i+c*3*l*l*s+u*o,b=n+2*l*(e-n)+p*(r-2*e+n),A=t+2*l*(i-t)+p*(s-2*i+t),P=e+2*l*(r-e)+p*(a-2*r+e),M=i+2*l*(s-i)+p*(o-2*s+i),D=c*n+l*e,z=c*t+l*i,N=c*r+l*a,F=c*s+l*o,G=90-Math.atan2(b-P,A-M)*180/Math.PI;return{x:y,y:x,m:{x:b,y:A},n:{x:P,y:M},start:{x:D,y:z},end:{x:N,y:F},alpha:G}}function no(n,t,e,i,r,s,a,o){Array.isArray(n)||(n=[n,t,e,i,r,s,a,o]);const l=so(...n);return mi(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)}function Ah(n,t,e){return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height}function Ph(n,t){n=mi(n),t=mi(t);const{x:e,y:i,width:r,height:s}=n,{x:a,y:o,width:l,height:c}=t,f=e+r/2,g=i+s/2,p=a+l/2,u=o+c/2;return Math.abs(f-p)<=(r+l)/2||Math.abs(g-u)<=(s+c)/2}function io(n,t,e,i,r){const s=-3*t+9*e-9*i+3*r,a=n*s+6*t-12*e+6*i;return n*a-3*t+3*e}function ro(n,t,e,i,r,s,a,o,l){l==null&&(l=1),l=Math.max(0,Math.min(l,1));const c=l/2,f=12,g=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let u=0;for(let y=0;y<f;y++){const x=c*g[y]+c,b=io(x,n,e,r,a),A=io(x,t,i,s,o),P=b*b+A*A;u+=p[y]*Math.sqrt(P)}return c*u}function Ih(n,t,e,i,r,s,a,o){if(Math.max(n,e)<Math.min(r,a)||Math.min(n,e)>Math.max(r,a)||Math.max(t,i)<Math.min(s,o)||Math.min(t,i)>Math.max(s,o))return;const l=(n*i-t*e)*(r-a)-(n-e)*(r*o-s*a),c=(n*i-t*e)*(s-o)-(t-i)*(r*o-s*a),f=(n-e)*(s-o)-(t-i)*(r-a);if(!f)return;const g=l/f,p=c/f,u=Number(g.toFixed(2)),y=Number(p.toFixed(2));if(!(u<Number(Math.min(n,e).toFixed(2))||u>Number(Math.max(n,e).toFixed(2))||u<Number(Math.min(r,a).toFixed(2))||u>Number(Math.max(r,a).toFixed(2))||y<Number(Math.min(t,i).toFixed(2))||y>Number(Math.max(t,i).toFixed(2))||y<Number(Math.min(s,o).toFixed(2))||y>Number(Math.max(s,o).toFixed(2))))return{x:g,y:p}}function Mh(n,t,e){const i=no(n),r=no(t);if(!Ph(i,r))return e?0:[];const s=ro.apply(0,n),a=ro.apply(0,t),o=Math.ceil(s/8),l=Math.ceil(a/8),c=[],f=[],g={};let p=e?0:[];for(let u=0;u<o+1;u++){const y=eo.apply(0,n.concat(u/o));c.push({x:y.x,y:y.y,t:u/o})}for(let u=0;u<l+1;u++){const y=eo.apply(0,t.concat(u/l));f.push({x:y.x,y:y.y,t:u/l})}for(let u=0;u<o;u++)for(let y=0;y<l;y++){const x=c[u],b=c[u+1],A=f[y],P=f[y+1],M=Math.abs(b.x-x.x)<.001?"y":"x",D=Math.abs(P.x-A.x)<.001?"y":"x",z=Ih(x.x,x.y,b.x,b.y,A.x,A.y,P.x,P.y);if(z&&g[z.x.toFixed(4)]!==z.y.toFixed(4)){g[z.x.toFixed(4)]=z.y.toFixed(4);const N=x.t+Math.abs((z[M]-x[M])/(b[M]-x[M]))*(b.t-x.t),F=A.t+Math.abs((z[D]-A[D])/(P[D]-A[D]))*(P.t-A.t);N>=0&&N<=1&&F>=0&&F<=1&&(e?p++:p.push({x:z.x,y:z.y,t1:N,t2:F}))}}return p}function Lh(n,t,e){let i,r,s,a,o,l,c,f,g,p,u=e?0:[];for(let y=0,x=n.length;y<x;y++){const b=n[y];if(b[0]==="M")i=o=b[1],r=l=b[2];else{b[0]==="C"?(g=[i,r].concat(b.slice(1)),i=g[6],r=g[7]):(g=[i,r,i,r,o,l,o,l],i=o,r=l);for(let A=0,P=t.length;A<P;A++){const M=t[A];if(M[0]==="M")s=c=M[1],a=f=M[2];else{M[0]==="C"?(p=[s,a].concat(M.slice(1)),s=p[6],a=p[7]):(p=[s,a,s,a,c,f,c,f],s=c,a=f);const D=Mh(g,p,e);if(e)u+=D;else{for(let z=0,N=D.length;z<N;z++)D[z].segment1=y,D[z].segment2=A,D[z].bez1=g,D[z].bez2=p;u=u.concat(D)}}}}}return u}function Dh(n){const t=cs(n);if(t.bbox)return ls(t.bbox);if(!n)return mi();let e=0,i=0,r=[],s=[],a=[];for(let p=0,u=n.length;p<u;p++)if(a=n[p],a[0]==="M")e=a[1],i=a[2],r.push(e),s.push(i);else{const y=so(e,i,a[1],a[2],a[3],a[4],a[5],a[6]);r=r.concat(y.min.x,y.max.x),s=s.concat(y.min.y,y.max.y),e=a[5],i=a[6]}const o=Math.min.apply(0,r),l=Math.min.apply(0,s),c=Math.max.apply(0,r),f=Math.max.apply(0,s),g=mi(o,l,c-o,f-l);return t.bbox=ls(g),g}function Rh(n,t,e,i,r){return r?[["M",Number(n)+Number(r),t],["l",e-r*2,0],["a",r,r,0,0,1,r,r],["l",0,i-r*2],["a",r,r,0,0,1,-r,r],["l",r*2-e,0],["a",r,r,0,0,1,-r,-r],["l",0,r*2-i],["a",r,r,0,0,1,r,-r],["z"]]:[["M",n,t],["l",e,0],["l",0,i],["l",-e,0],["z"]]}function so(n,t,e,i,r,s,a,o){const l=[],c=[[],[]];let f,g,p,u,y,x,b,A;for(let z=0;z<2;++z){if(z===0?(g=6*n-12*e+6*r,f=-3*n+9*e-9*r+3*a,p=3*e-3*n):(g=6*t-12*i+6*s,f=-3*t+9*i-9*s+3*o,p=3*i-3*t),Math.abs(f)<1e-12){if(Math.abs(g)<1e-12)continue;u=-p/g,u>0&&u<1&&l.push(u);continue}b=g*g-4*p*f,A=Math.sqrt(b),!(b<0)&&(y=(-g+A)/(2*f),y>0&&y<1&&l.push(y),x=(-g-A)/(2*f),x>0&&x<1&&l.push(x))}let P=l.length,M;const D=P;for(;P--;)u=l[P],M=1-u,c[0][P]=M*M*M*n+3*M*M*u*e+3*M*u*u*r+u*u*u*a,c[1][P]=M*M*M*t+3*M*M*u*i+3*M*u*u*s+u*u*u*o;return c[0][D]=n,c[1][D]=t,c[0][D+1]=a,c[1][D+1]=o,c[0].length=c[1].length=D+2,{min:{x:Math.min.apply(0,c[0]),y:Math.min.apply(0,c[1])},max:{x:Math.max.apply(0,c[0]),y:Math.max.apply(0,c[1])}}}function Oh(n,t,e){const i=Dh(n);return!(!Ah(i,t,e)||Lh(n,ar([["M",t,e],["H",i.x2+10]]),1)%2!==1)}const hs=new Map;function ao(n){if(hs.has(n))return hs.get(n);const t=Gn(n);return hs.set(n,t),t}function oo(n){const t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",n),t}function lo(n,t){return Xi?oo(n).getTotalLength(t):ao(n).length()}function co(n,t){if(Xi)return oo(n).getPointAtLength(t);{const e=ao(n),[i,r]=e.at(t);return{x:i,y:r}}}let ge=null;function ho(n,t,e){if(Xi){ge||(ge=document.createElement("canvas").getContext("2d"));const i=new Path2D(n);return ge.isPointInPath(i,t,e)}else return Oh(n,t,e)}function fo(n,t,e,{lineWidth:i=1,lineCap:r="butt",lineJoin:s="miter"}){if(Xi){if(ge||(ge=document.createElement("canvas").getContext("2d")),ge.isPointInStroke){ge.save(),ge.lineWidth=i,ge.lineCap=r,ge.lineJoin=s;const a=new Path2D(n),o=ge.isPointInStroke(a,t,e);return ge.restore(),o}}else return null}class fs{point;constructor(t){this.point=new Te(t)}static fromSVGPathData(t){if(t.length<3)throw new Error("Line 参数个数错误");if(t[0].toUpperCase()!=="L")throw new Error("Line command 错误");return new fs({x:t[1],y:t[2]})}toSVGPathData(){return["L",this.point.x,this.point.y]}toSVGPathD(){return"L "+this.point.toSVGPathD()}}const uo=fs;class us extends uo{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1}static fromSVGPathData(t){if(t.length<8)throw new Error("Arc 参数个数错误");if(t[0].toUpperCase()!=="A")throw new Error("Arc command 错误");return new us({x:t[6],y:t[7],rx:t[1],ry:t[2],xAxisRotate:t[3],largeArcFlag:t[4],sweepFlag:t[5]})}toSVGPathData(){return["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.point.x,this.point.y]}toSVGPathD(){return`A ${this.rx},${this.ry} ${this.xAxisRotate} ${this.largeArcFlag},${this.sweepFlag} ${this.point.toSVGPathD()}`}}const po=us;class ds extends uo{ctrlPoints=[];constructor(t){super(t),this.ctrlPoints.push(new Te({x:t.c1x,y:t.c1y})),this.ctrlPoints.push(new Te({x:t.c2x,y:t.c2y}))}static fromSVGPathData(t){if(t.length<7)throw new Error("CubicBezier 参数个数错误");if(t[0].toUpperCase()!=="C")throw new Error("CubicBezier command 错误");return new ds({c1x:t[1],c1y:t[2],c2x:t[3],c2y:t[4],x:t[5],y:t[6]})}toSVGPathData(){return["C",this.ctrlPoints[0].x,this.ctrlPoints[0].y,this.ctrlPoints[1].x,this.ctrlPoints[1].y,this.point.x,this.point.y]}toSVGPathD(){return`C ${this.ctrlPoints.map(t=>t.toSVGPathD()).join(" ")} ${this.point.toSVGPathD()}`}}const ps=ds;class xn{startPoint;isClosed=!1;lines=[];normalizedLines=[];constructor(t){this.startPoint=t?.startPoint??null,this.isClosed=t?.isClosed??!1,t?.lines?.forEach(this.addLine),this.normalize()}setStartPoint(t,e){return this.startPoint=new Te({x:t,y:e}),this}addLine(t){return this.lines.push(t),this}normalize(){let t=this.lines.reduce((i,r)=>(i+=r.toSVGPathD(),i),"");this.startPoint&&(t="M "+this.startPoint.toSVGPathD()+t),this.isClosed&&(t+="Z"),this.normalizedLines=[];const e=ar(sr(rr(t)));for(let i=0,r=e.length;i<r;i++){const s=e[i];if(i==0&&s[0]=="M"){this.setStartPoint(s[1],s[2]);continue}if(i==r-1&&s[0]=="Z"){this.isClosed=!0;continue}this.normalizedLines.push(ps.fromSVGPathData(s))}return this}static fromSVGPathD(t,e){if(!Ka(t))throw new Error("Not an SVG path!");const i=ar(sr(rr(t)));return xn.fromSVGPathData(i,e)}static fromSVGPathData(t,e){const i=new xn;for(let s=0,a=t.length;s<a;s++){const o=t[s],l=o[0];if(s==0&&l=="M"){i.setStartPoint(o[1],o[2]);continue}if(s==a-1&&l=="Z"){i.isClosed=!0;continue}i.addLine(new ps({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],x:o[5],y:o[6]}))}i.normalize();const r=Bn(e??"");return i.transform(r)}toSVGPathD(){let t="";this.startPoint&&(t+="M "+this.startPoint.toSVGPathD());for(let e=0,i=this.normalizedLines.length;e<i;e++)t+=this.normalizedLines[e].toSVGPathD();return this.isClosed&&(t+="Z"),t}toSVGPathData(){const t=[];this.startPoint&&t.push(["M",...this.startPoint.toSVGPathData()]);for(let e=0,i=this.normalizedLines.length;e<i;e++)t.push(this.normalizedLines[e].toSVGPathData());return this.isClosed&&t.push(["Z"]),t}toCanvas(t){const e=this.normalizedLines;e.length&&(this.startPoint&&(t.beginPath(),t.moveTo(this.startPoint.x,this.startPoint.y)),e.forEach(i=>{const[r,...s]=i.toSVGPathData();r==="M"?t.moveTo(s[0],s[1]):r==="Z"?t.closePath():t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}),this.isClosed&&t.closePath())}get bounds(){let t=[0,0,0,0];if(this.normalizedLines.length){t=[1/0,1/0,-1/0,-1/0];for(let e=0,i=this.normalizedLines.length;e<i;e++){const r=this.normalizedLines[e],s=[...r.ctrlPoints,r.point];for(let a=0;a<s.length;a++){const o=s[a].x,l=s[a].y;o<t[0]&&(t[0]=o),l<t[1]&&(t[1]=l),o>t[2]&&(t[2]=o),l>t[3]&&(t[3]=l)}}}return t}get size(){const t=this.bounds;return[t[2]-t[0],t[3]-t[1]]}get center(){const[t,e,i,r]=this.bounds;return[(t+i)/2,(e+r)/2]}getTotalLength(){return lo(this.toSVGPathD())}getPointAtLength(t){return co(this.toSVGPathD(),t)}isPointInPath(t,e){return ho(this.toSVGPathD(),t,e)}isPointInStroke(t,e,i={lineWidth:1,lineCap:"butt",lineJoin:"miter"}){return fo(this.toSVGPathD(),t,e,i)}transform(t){if(this.startPoint){const[e,i]=t.transformPoint(this.startPoint.x,this.startPoint.y);this.setStartPoint(e,i)}return this.normalizedLines=this.normalizedLines.map(e=>{const[i,...r]=e.toSVGPathData(),s=[i];for(let a=0,o=r.length;a<o;a+=2){const l=r[a],c=r[a+1],[f,g]=t.transformPoint(l,c);s.push(f,g)}return ps.fromSVGPathData(s)}),this}translate(t,e){const i=new qt().translate(t,e);return this.transform(i)}rotate(t,e=0,i=0){const r=new qt().rotate(t,e,i);return this.transform(r)}scale(t,e=t,i=0,r=0){const s=new qt().scale(t,e,i,r);return this.transform(s)}skew(t,e=0){const i=new qt().skew(t,e);return this.transform(i)}trim(){const[t,e]=this.bounds;return this.translate(-t,-e),this}static generateRosetta(t,e,i,r,s){if(s==0)throw new Error("no dividing by zero, please");const a=new xn;a.setStartPoint(t,e);const o=360/s;for(let l=0;l<s;l+=1){const c=o*l*Math.PI/180,f=t+2*i*Math.cos(c),g=e+2*i*Math.sin(c);a.addLine(new po({x:f,y:g,rx:i,ry:r,xAxisRotate:o*l,largeArcFlag:1,sweepFlag:1})),a.addLine(new po({x:t,y:e,rx:i,ry:r,xAxisRotate:o*l,largeArcFlag:1,sweepFlag:1}))}return a.normalize(),a}}var go={exports:{}};(function(n,t){(function(e,i){n.exports=i()})(window,function(){return function(e){var i={};function r(s){if(i[s])return i[s].exports;var a=i[s]={i:s,l:!1,exports:{}};return e[s].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=i,r.d=function(s,a,o){r.o(s,a)||Object.defineProperty(s,a,{enumerable:!0,get:o})},r.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},r.t=function(s,a){if(1&a&&(s=r(s)),8&a||4&a&&typeof s=="object"&&s&&s.__esModule)return s;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:s}),2&a&&typeof s!="string")for(var l in s)r.d(o,l,function(c){return s[c]}.bind(null,l));return o},r.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return r.d(a,"a",a),a},r.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},r.p="",r(r.s=1)}([function(e,i,r){var s,a;s=[r(2)],(a=function(o){function l(d){if(l.is(d,"function"))return c?d():o.on("raphael.DOMload",d);if(l.is(d,j))return l._engine.create[P](l,d.splice(0,3+l.is(d[0],vt))).add(d);var v=Array.prototype.slice.call(arguments,0);if(l.is(v[v.length-1],"function")){var _=v.pop();return c?_.call(l._engine.create[P](l,v)):o.on("raphael.DOMload",function(){_.call(l._engine.create[P](l,v))})}return l._engine.create[P](l,arguments)}l.version="2.3.0",l.eve=o;var c,f,g=/[, ]+/,p={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},u=/\{(\d+)\}/g,y="hasOwnProperty",x={doc:document,win:window},b={was:Object.prototype[y].call(x.win,"Raphael"),is:x.win.Raphael},A=function(){this.ca=this.customAttributes={}},P="apply",M="concat",D="ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch,z="",N=" ",F=String,G="split",H="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[G](N),$={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},Y=F.prototype.toLowerCase,K=Math,ut=K.max,ht=K.min,pt=K.abs,kt=K.pow,St=K.PI,vt="number",j="array",ct=Object.prototype.toString,L=(l._ISURL=/^url\(['"]?(.+?)['"]?\)$/i,/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i),k={NaN:1,Infinity:1,"-Infinity":1},E=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,R=K.round,B=parseFloat,X=parseInt,V=F.prototype.toUpperCase,et=l._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0,class:""},Z=l._availableAnimAttrs={blur:vt,"clip-rect":"csv",cx:vt,cy:vt,fill:"colour","fill-opacity":vt,"font-size":vt,height:vt,opacity:vt,path:"path",r:vt,rx:vt,ry:vt,stroke:"colour","stroke-opacity":vt,"stroke-width":vt,transform:"transform",width:vt,x:vt,y:vt},it=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,dt={hs:1,rg:1},mt=/,?([achlmqrstvxz]),?/gi,yt=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,At=/([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,xt=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/gi,It=(l._radial_gradient=/^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,{}),Mt=function(d,v){return B(d)-B(v)},Dt=function(d){return d},_t=l._rectPath=function(d,v,_,h,m){return m?[["M",d+m,v],["l",_-2*m,0],["a",m,m,0,0,1,m,m],["l",0,h-2*m],["a",m,m,0,0,1,-m,m],["l",2*m-_,0],["a",m,m,0,0,1,-m,-m],["l",0,2*m-h],["a",m,m,0,0,1,m,-m],["z"]]:[["M",d,v],["l",_,0],["l",0,h],["l",-_,0],["z"]]},Nt=function(d,v,_,h){return h==null&&(h=_),[["M",d,v],["m",0,-h],["a",_,h,0,1,1,0,2*h],["a",_,h,0,1,1,0,-2*h],["z"]]},Rt=l._getPath={path:function(d){return d.attr("path")},circle:function(d){var v=d.attrs;return Nt(v.cx,v.cy,v.r)},ellipse:function(d){var v=d.attrs;return Nt(v.cx,v.cy,v.rx,v.ry)},rect:function(d){var v=d.attrs;return _t(v.x,v.y,v.width,v.height,v.r)},image:function(d){var v=d.attrs;return _t(v.x,v.y,v.width,v.height)},text:function(d){var v=d._getBBox();return _t(v.x,v.y,v.width,v.height)},set:function(d){var v=d._getBBox();return _t(v.x,v.y,v.width,v.height)}},Vt=l.mapPath=function(d,v){if(!v)return d;var _,h,m,w,C,S,I;for(m=0,C=(d=Mn(d)).length;m<C;m++)for(w=1,S=(I=d[m]).length;w<S;w+=2)_=v.x(I[w],I[w+1]),h=v.y(I[w],I[w+1]),I[w]=_,I[w+1]=h;return d};if(l._g=x,l.type=x.win.SVGAngle||x.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML",l.type=="VML"){var zt,ie=x.doc.createElement("div");if(ie.innerHTML='<v:shape adj="1"/>',(zt=ie.firstChild).style.behavior="url(#default#VML)",!zt||typeof zt.adj!="object")return l.type=z;ie=null}function Jt(d){if(typeof d=="function"||Object(d)!==d)return d;var v=new d.constructor;for(var _ in d)d[y](_)&&(v[_]=Jt(d[_]));return v}l.svg=!(l.vml=l.type=="VML"),l._Paper=A,l.fn=f=A.prototype=l.prototype,l._id=0,l.is=function(d,v){return(v=Y.call(v))=="finite"?!k[y](+d):v=="array"?d instanceof Array:v=="null"&&d===null||v==typeof d&&d!==null||v=="object"&&d===Object(d)||v=="array"&&Array.isArray&&Array.isArray(d)||ct.call(d).slice(8,-1).toLowerCase()==v},l.angle=function(d,v,_,h,m,w){if(m==null){var C=d-_,S=v-h;return C||S?(180+180*K.atan2(-S,-C)/St+360)%360:0}return l.angle(d,v,m,w)-l.angle(_,h,m,w)},l.rad=function(d){return d%360*St/180},l.deg=function(d){return Math.round(180*d/St%360*1e3)/1e3},l.snapTo=function(d,v,_){if(_=l.is(_,"finite")?_:10,l.is(d,j)){for(var h=d.length;h--;)if(pt(d[h]-v)<=_)return d[h]}else{var m=v%(d=+d);if(m<_)return v-m;if(m>d-_)return v-m+d}return v};var Me,un;l.createUUID=(Me=/[xy]/g,un=function(d){var v=16*K.random()|0;return(d=="x"?v:3&v|8).toString(16)},function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(Me,un).toUpperCase()}),l.setWindow=function(d){o("raphael.setWindow",l,x.win,d),x.win=d,x.doc=x.win.document,l._engine.initWin&&l._engine.initWin(x.win)};var Ce=function(d){if(l.vml){var v,_=/^\s+|\s+$/g;try{var h=new ActiveXObject("htmlfile");h.write("<body>"),h.close(),v=h.body}catch{v=createPopup().document.body}var m=v.createTextRange();Ce=$t(function(C){try{v.style.color=F(C).replace(_,z);var S=m.queryCommandValue("ForeColor");return"#"+("000000"+(S=(255&S)<<16|65280&S|(16711680&S)>>>16).toString(16)).slice(-6)}catch{return"none"}})}else{var w=x.doc.createElement("i");w.title="Raphaël Colour Picker",w.style.display="none",x.doc.body.appendChild(w),Ce=$t(function(C){return w.style.color=C,x.doc.defaultView.getComputedStyle(w,z).getPropertyValue("color")})}return Ce(d)},Ve=function(){return"hsb("+[this.h,this.s,this.b]+")"},Xe=function(){return"hsl("+[this.h,this.s,this.l]+")"},Le=function(){return this.hex},De=function(d,v,_){if(v==null&&l.is(d,"object")&&"r"in d&&"g"in d&&"b"in d&&(_=d.b,v=d.g,d=d.r),v==null&&l.is(d,"string")){var h=l.getRGB(d);d=h.r,v=h.g,_=h.b}return(d>1||v>1||_>1)&&(d/=255,v/=255,_/=255),[d,v,_]},Qn=function(d,v,_,h){var m={r:d*=255,g:v*=255,b:_*=255,hex:l.rgb(d,v,_),toString:Le};return l.is(h,"finite")&&(m.opacity=h),m};function $t(d,v,_){return function h(){var m=Array.prototype.slice.call(arguments,0),w=m.join("␀"),C=h.cache=h.cache||{},S=h.count=h.count||[];return C[y](w)?(function(I,U){for(var q=0,tt=I.length;q<tt;q++)if(I[q]===U)return I.push(I.splice(q,1)[0])}(S,w),_?_(C[w]):C[w]):(S.length>=1e3&&delete C[S.shift()],S.push(w),C[w]=d[P](v,m),_?_(C[w]):C[w])}}l.color=function(d){var v;return l.is(d,"object")&&"h"in d&&"s"in d&&"b"in d?(v=l.hsb2rgb(d),d.r=v.r,d.g=v.g,d.b=v.b,d.hex=v.hex):l.is(d,"object")&&"h"in d&&"s"in d&&"l"in d?(v=l.hsl2rgb(d),d.r=v.r,d.g=v.g,d.b=v.b,d.hex=v.hex):(l.is(d,"string")&&(d=l.getRGB(d)),l.is(d,"object")&&"r"in d&&"g"in d&&"b"in d?(v=l.rgb2hsl(d),d.h=v.h,d.s=v.s,d.l=v.l,v=l.rgb2hsb(d),d.v=v.b):(d={hex:"none"}).r=d.g=d.b=d.h=d.s=d.v=d.l=-1),d.toString=Le,d},l.hsb2rgb=function(d,v,_,h){var m,w,C,S,I;return this.is(d,"object")&&"h"in d&&"s"in d&&"b"in d&&(_=d.b,v=d.s,h=d.o,d=d.h),S=(I=_*v)*(1-pt((d=(d*=360)%360/60)%2-1)),m=w=C=_-I,Qn(m+=[I,S,0,0,S,I][d=~~d],w+=[S,I,I,S,0,0][d],C+=[0,0,S,I,I,S][d],h)},l.hsl2rgb=function(d,v,_,h){var m,w,C,S,I;return this.is(d,"object")&&"h"in d&&"s"in d&&"l"in d&&(_=d.l,v=d.s,d=d.h),(d>1||v>1||_>1)&&(d/=360,v/=100,_/=100),S=(I=2*v*(_<.5?_:1-_))*(1-pt((d=(d*=360)%360/60)%2-1)),m=w=C=_-I/2,Qn(m+=[I,S,0,0,S,I][d=~~d],w+=[S,I,I,S,0,0][d],C+=[0,0,S,I,I,S][d],h)},l.rgb2hsb=function(d,v,_){var h,m;return d=(_=De(d,v,_))[0],v=_[1],_=_[2],{h:(((m=(h=ut(d,v,_))-ht(d,v,_))==0?null:h==d?(v-_)/m:h==v?(_-d)/m+2:(d-v)/m+4)+360)%6*60/360,s:m==0?0:m/h,b:h,toString:Ve}},l.rgb2hsl=function(d,v,_){var h,m,w,C;return d=(_=De(d,v,_))[0],v=_[1],_=_[2],h=((m=ut(d,v,_))+(w=ht(d,v,_)))/2,{h:(((C=m-w)==0?null:m==d?(v-_)/C:m==v?(_-d)/C+2:(d-v)/C+4)+360)%6*60/360,s:C==0?0:h<.5?C/(2*h):C/(2-2*h),l:h,toString:Xe}},l._path2string=function(){return this.join(",").replace(mt,"$1")},l._preload=function(d,v){var _=x.doc.createElement("img");_.style.cssText="position:absolute;left:-9999em;top:-9999em",_.onload=function(){v.call(this),this.onload=null,x.doc.body.removeChild(this)},_.onerror=function(){x.doc.body.removeChild(this)},x.doc.body.appendChild(_),_.src=d};function Re(){return this.hex}function dn(d,v){for(var _=[],h=0,m=d.length;m-2*!v>h;h+=2){var w=[{x:+d[h-2],y:+d[h-1]},{x:+d[h],y:+d[h+1]},{x:+d[h+2],y:+d[h+3]},{x:+d[h+4],y:+d[h+5]}];v?h?m-4==h?w[3]={x:+d[0],y:+d[1]}:m-2==h&&(w[2]={x:+d[0],y:+d[1]},w[3]={x:+d[2],y:+d[3]}):w[0]={x:+d[m-2],y:+d[m-1]}:m-4==h?w[3]=w[2]:h||(w[0]={x:+d[h],y:+d[h+1]}),_.push(["C",(-w[0].x+6*w[1].x+w[2].x)/6,(-w[0].y+6*w[1].y+w[2].y)/6,(w[1].x+6*w[2].x-w[3].x)/6,(w[1].y+6*w[2].y-w[3].y)/6,w[2].x,w[2].y])}return _}l.getRGB=$t(function(d){if(!d||(d=F(d)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Re};if(d=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:Re};!dt[y](d.toLowerCase().substring(0,2))&&d.charAt()!="#"&&(d=Ce(d));var v,_,h,m,w,C,S=d.match(L);return S?(S[2]&&(h=X(S[2].substring(5),16),_=X(S[2].substring(3,5),16),v=X(S[2].substring(1,3),16)),S[3]&&(h=X((w=S[3].charAt(3))+w,16),_=X((w=S[3].charAt(2))+w,16),v=X((w=S[3].charAt(1))+w,16)),S[4]&&(C=S[4][G](it),v=B(C[0]),C[0].slice(-1)=="%"&&(v*=2.55),_=B(C[1]),C[1].slice(-1)=="%"&&(_*=2.55),h=B(C[2]),C[2].slice(-1)=="%"&&(h*=2.55),S[1].toLowerCase().slice(0,4)=="rgba"&&(m=B(C[3])),C[3]&&C[3].slice(-1)=="%"&&(m/=100)),S[5]?(C=S[5][G](it),v=B(C[0]),C[0].slice(-1)=="%"&&(v*=2.55),_=B(C[1]),C[1].slice(-1)=="%"&&(_*=2.55),h=B(C[2]),C[2].slice(-1)=="%"&&(h*=2.55),(C[0].slice(-3)=="deg"||C[0].slice(-1)=="°")&&(v/=360),S[1].toLowerCase().slice(0,4)=="hsba"&&(m=B(C[3])),C[3]&&C[3].slice(-1)=="%"&&(m/=100),l.hsb2rgb(v,_,h,m)):S[6]?(C=S[6][G](it),v=B(C[0]),C[0].slice(-1)=="%"&&(v*=2.55),_=B(C[1]),C[1].slice(-1)=="%"&&(_*=2.55),h=B(C[2]),C[2].slice(-1)=="%"&&(h*=2.55),(C[0].slice(-3)=="deg"||C[0].slice(-1)=="°")&&(v/=360),S[1].toLowerCase().slice(0,4)=="hsla"&&(m=B(C[3])),C[3]&&C[3].slice(-1)=="%"&&(m/=100),l.hsl2rgb(v,_,h,m)):((S={r:v,g:_,b:h,toString:Re}).hex="#"+(16777216|h|_<<8|v<<16).toString(16).slice(1),l.is(m,"finite")&&(S.opacity=m),S)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Re}},l),l.hsb=$t(function(d,v,_){return l.hsb2rgb(d,v,_).hex}),l.hsl=$t(function(d,v,_){return l.hsl2rgb(d,v,_).hex}),l.rgb=$t(function(d,v,_){function h(m){return m+.5|0}return"#"+(16777216|h(_)|h(v)<<8|h(d)<<16).toString(16).slice(1)}),l.getColor=function(d){var v=this.getColor.start=this.getColor.start||{h:0,s:1,b:d||.75},_=this.hsb2rgb(v.h,v.s,v.b);return v.h+=.075,v.h>1&&(v.h=0,v.s-=.2,v.s<=0&&(this.getColor.start={h:0,s:1,b:v.b})),_.hex},l.getColor.reset=function(){delete this.start},l.parsePathString=function(d){if(!d)return null;var v=ae(d);if(v.arr)return Qt(v.arr);var _={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},h=[];return l.is(d,j)&&l.is(d[0],j)&&(h=Qt(d)),h.length||F(d).replace(yt,function(m,w,C){var S=[],I=w.toLowerCase();if(C.replace(xt,function(U,q){q&&S.push(+q)}),I=="m"&&S.length>2&&(h.push([w][M](S.splice(0,2))),I="l",w=w=="m"?"l":"L"),I=="r")h.push([w][M](S));else for(;S.length>=_[I]&&(h.push([w][M](S.splice(0,_[I]))),_[I]););}),h.toString=l._path2string,v.arr=Qt(h),h},l.parseTransformString=$t(function(d){if(!d)return null;var v=[];return l.is(d,j)&&l.is(d[0],j)&&(v=Qt(d)),v.length||F(d).replace(At,function(_,h,m){var w=[];Y.call(h),m.replace(xt,function(C,S){S&&w.push(+S)}),v.push([h][M](w))}),v.toString=l._path2string,v},this,function(d){if(!d)return d;for(var v=[],_=0;_<d.length;_++){for(var h=[],m=0;m<d[_].length;m++)h.push(d[_][m]);v.push(h)}return v});var ae=function(d){var v=ae.ps=ae.ps||{};return v[d]?v[d].sleep=100:v[d]={sleep:100},setTimeout(function(){for(var _ in v)v[y](_)&&_!=d&&(v[_].sleep--,!v[_].sleep&&delete v[_])}),v[d]};function Ee(d,v,_,h,m){return d*(d*(-3*v+9*_-9*h+3*m)+6*v-12*_+6*h)-3*v+3*_}function de(d,v,_,h,m,w,C,S,I){I==null&&(I=1);for(var U=(I=I>1?1:I<0?0:I)/2,q=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],tt=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],J=0,W=0;W<12;W++){var nt=U*q[W]+U,st=Ee(nt,d,_,m,C),rt=Ee(nt,v,h,w,S),Q=st*st+rt*rt;J+=tt[W]*K.sqrt(Q)}return U*J}function In(d,v,_,h,m,w,C,S){if(!(ut(d,_)<ht(m,C)||ht(d,_)>ut(m,C)||ut(v,h)<ht(w,S)||ht(v,h)>ut(w,S))){var I=(d-_)*(w-S)-(v-h)*(m-C);if(I){var U=((d*h-v*_)*(m-C)-(d-_)*(m*S-w*C))/I,q=((d*h-v*_)*(w-S)-(v-h)*(m*S-w*C))/I,tt=+U.toFixed(2),J=+q.toFixed(2);if(!(tt<+ht(d,_).toFixed(2)||tt>+ut(d,_).toFixed(2)||tt<+ht(m,C).toFixed(2)||tt>+ut(m,C).toFixed(2)||J<+ht(v,h).toFixed(2)||J>+ut(v,h).toFixed(2)||J<+ht(w,S).toFixed(2)||J>+ut(w,S).toFixed(2)))return{x:U,y:q}}}}function Ye(d,v,_){var h=l.bezierBBox(d),m=l.bezierBBox(v);if(!l.isBBoxIntersect(h,m))return _?0:[];for(var w=de.apply(0,d),C=de.apply(0,v),S=ut(~~(w/5),1),I=ut(~~(C/5),1),U=[],q=[],tt={},J=_?0:[],W=0;W<S+1;W++){var nt=l.findDotsAtSegment.apply(l,d.concat(W/S));U.push({x:nt.x,y:nt.y,t:W/S})}for(W=0;W<I+1;W++)nt=l.findDotsAtSegment.apply(l,v.concat(W/I)),q.push({x:nt.x,y:nt.y,t:W/I});for(W=0;W<S;W++)for(var st=0;st<I;st++){var rt=U[W],Q=U[W+1],gt=q[st],at=q[st+1],ft=pt(Q.x-rt.x)<.001?"y":"x",ot=pt(at.x-gt.x)<.001?"y":"x",Tt=In(rt.x,rt.y,Q.x,Q.y,gt.x,gt.y,at.x,at.y);if(Tt){if(tt[Tt.x.toFixed(4)]==Tt.y.toFixed(4))continue;tt[Tt.x.toFixed(4)]=Tt.y.toFixed(4);var wt=rt.t+pt((Tt[ft]-rt[ft])/(Q[ft]-rt[ft]))*(Q.t-rt.t),Ct=gt.t+pt((Tt[ot]-gt[ot])/(at[ot]-gt[ot]))*(at.t-gt.t);wt>=0&&wt<=1.001&&Ct>=0&&Ct<=1.001&&(_?J++:J.push({x:Tt.x,y:Tt.y,t1:ht(wt,1),t2:ht(Ct,1)}))}}return J}function pn(d,v,_){d=l._path2curve(d),v=l._path2curve(v);for(var h,m,w,C,S,I,U,q,tt,J,W=_?0:[],nt=0,st=d.length;nt<st;nt++){var rt=d[nt];if(rt[0]=="M")h=S=rt[1],m=I=rt[2];else{rt[0]=="C"?(tt=[h,m].concat(rt.slice(1)),h=tt[6],m=tt[7]):(tt=[h,m,h,m,S,I,S,I],h=S,m=I);for(var Q=0,gt=v.length;Q<gt;Q++){var at=v[Q];if(at[0]=="M")w=U=at[1],C=q=at[2];else{at[0]=="C"?(J=[w,C].concat(at.slice(1)),w=J[6],C=J[7]):(J=[w,C,w,C,U,q,U,q],w=U,C=q);var ft=Ye(tt,J,_);if(_)W+=ft;else{for(var ot=0,Tt=ft.length;ot<Tt;ot++)ft[ot].segment1=nt,ft[ot].segment2=Q,ft[ot].bez1=tt,ft[ot].bez2=J;W=W.concat(ft)}}}}}return W}l.findDotsAtSegment=function(d,v,_,h,m,w,C,S,I){var U=1-I,q=kt(U,3),tt=kt(U,2),J=I*I,W=J*I,nt=q*d+3*tt*I*_+3*U*I*I*m+W*C,st=q*v+3*tt*I*h+3*U*I*I*w+W*S,rt=d+2*I*(_-d)+J*(m-2*_+d),Q=v+2*I*(h-v)+J*(w-2*h+v),gt=_+2*I*(m-_)+J*(C-2*m+_),at=h+2*I*(w-h)+J*(S-2*w+h),ft=U*d+I*_,ot=U*v+I*h,Tt=U*m+I*C,wt=U*w+I*S,Ct=90-180*K.atan2(rt-gt,Q-at)/St;return(rt>gt||Q<at)&&(Ct+=180),{x:nt,y:st,m:{x:rt,y:Q},n:{x:gt,y:at},start:{x:ft,y:ot},end:{x:Tt,y:wt},alpha:Ct}},l.bezierBBox=function(d,v,_,h,m,w,C,S){l.is(d,"array")||(d=[d,v,_,h,m,w,C,S]);var I=qe.apply(null,d);return{x:I.min.x,y:I.min.y,x2:I.max.x,y2:I.max.y,width:I.max.x-I.min.x,height:I.max.y-I.min.y}},l.isPointInsideBBox=function(d,v,_){return v>=d.x&&v<=d.x2&&_>=d.y&&_<=d.y2},l.isBBoxIntersect=function(d,v){var _=l.isPointInsideBBox;return _(v,d.x,d.y)||_(v,d.x2,d.y)||_(v,d.x,d.y2)||_(v,d.x2,d.y2)||_(d,v.x,v.y)||_(d,v.x2,v.y)||_(d,v.x,v.y2)||_(d,v.x2,v.y2)||(d.x<v.x2&&d.x>v.x||v.x<d.x2&&v.x>d.x)&&(d.y<v.y2&&d.y>v.y||v.y<d.y2&&v.y>d.y)},l.pathIntersection=function(d,v){return pn(d,v)},l.pathIntersectionNumber=function(d,v){return pn(d,v,1)},l.isPointInsidePath=function(d,v,_){var h=l.pathBBox(d);return l.isPointInsideBBox(h,v,_)&&pn(d,[["M",v,_],["H",h.x2+10]],1)%2==1},l._removedFactory=function(d){return function(){o("raphael.log",null,"Raphaël: you are calling to method “"+d+"” of removed object",d)}};var we=l.pathBBox=function(d){var v=ae(d);if(v.bbox)return Jt(v.bbox);if(!d)return{x:0,y:0,width:0,height:0,x2:0,y2:0};for(var _,h=0,m=0,w=[],C=[],S=0,I=(d=Mn(d)).length;S<I;S++)if((_=d[S])[0]=="M")h=_[1],m=_[2],w.push(h),C.push(m);else{var U=qe(h,m,_[1],_[2],_[3],_[4],_[5],_[6]);w=w[M](U.min.x,U.max.x),C=C[M](U.min.y,U.max.y),h=_[5],m=_[6]}var q=ht[P](0,w),tt=ht[P](0,C),J=ut[P](0,w),W=ut[P](0,C),nt=J-q,st=W-tt,rt={x:q,y:tt,x2:J,y2:W,width:nt,height:st,cx:q+nt/2,cy:tt+st/2};return v.bbox=Jt(rt),rt},Qt=function(d){var v=Jt(d);return v.toString=l._path2string,v},Pr=l._pathToRelative=function(d){var v=ae(d);if(v.rel)return Qt(v.rel);l.is(d,j)&&l.is(d&&d[0],j)||(d=l.parsePathString(d));var _=[],h=0,m=0,w=0,C=0,S=0;d[0][0]=="M"&&(w=h=d[0][1],C=m=d[0][2],S++,_.push(["M",h,m]));for(var I=S,U=d.length;I<U;I++){var q=_[I]=[],tt=d[I];if(tt[0]!=Y.call(tt[0]))switch(q[0]=Y.call(tt[0]),q[0]){case"a":q[1]=tt[1],q[2]=tt[2],q[3]=tt[3],q[4]=tt[4],q[5]=tt[5],q[6]=+(tt[6]-h).toFixed(3),q[7]=+(tt[7]-m).toFixed(3);break;case"v":q[1]=+(tt[1]-m).toFixed(3);break;case"m":w=tt[1],C=tt[2];default:for(var J=1,W=tt.length;J<W;J++)q[J]=+(tt[J]-(J%2?h:m)).toFixed(3)}else{q=_[I]=[],tt[0]=="m"&&(w=tt[1]+h,C=tt[2]+m);for(var nt=0,st=tt.length;nt<st;nt++)_[I][nt]=tt[nt]}var rt=_[I].length;switch(_[I][0]){case"z":h=w,m=C;break;case"h":h+=+_[I][rt-1];break;case"v":m+=+_[I][rt-1];break;default:h+=+_[I][rt-2],m+=+_[I][rt-1]}}return _.toString=l._path2string,v.rel=Qt(_),_},gn=l._pathToAbsolute=function(d){var v=ae(d);if(v.abs)return Qt(v.abs);if(l.is(d,j)&&l.is(d&&d[0],j)||(d=l.parsePathString(d)),!d||!d.length)return[["M",0,0]];var _=[],h=0,m=0,w=0,C=0,S=0;d[0][0]=="M"&&(w=h=+d[0][1],C=m=+d[0][2],S++,_[0]=["M",h,m]);for(var I,U,q=d.length==3&&d[0][0]=="M"&&d[1][0].toUpperCase()=="R"&&d[2][0].toUpperCase()=="Z",tt=S,J=d.length;tt<J;tt++){if(_.push(I=[]),(U=d[tt])[0]!=V.call(U[0]))switch(I[0]=V.call(U[0]),I[0]){case"A":I[1]=U[1],I[2]=U[2],I[3]=U[3],I[4]=U[4],I[5]=U[5],I[6]=+(U[6]+h),I[7]=+(U[7]+m);break;case"V":I[1]=+U[1]+m;break;case"H":I[1]=+U[1]+h;break;case"R":for(var W=[h,m][M](U.slice(1)),nt=2,st=W.length;nt<st;nt++)W[nt]=+W[nt]+h,W[++nt]=+W[nt]+m;_.pop(),_=_[M](dn(W,q));break;case"M":w=+U[1]+h,C=+U[2]+m;default:for(nt=1,st=U.length;nt<st;nt++)I[nt]=+U[nt]+(nt%2?h:m)}else if(U[0]=="R")W=[h,m][M](U.slice(1)),_.pop(),_=_[M](dn(W,q)),I=["R"][M](U.slice(-2));else for(var rt=0,Q=U.length;rt<Q;rt++)I[rt]=U[rt];switch(I[0]){case"Z":h=w,m=C;break;case"H":h=I[1];break;case"V":m=I[1];break;case"M":w=I[I.length-2],C=I[I.length-1];default:h=I[I.length-2],m=I[I.length-1]}}return _.toString=l._path2string,v.abs=Qt(_),_},Ze=function(d,v,_,h){return[d,v,_,h,_,h]},Oe=function(d,v,_,h,m,w){return[1/3*d+2/3*_,1/3*v+2/3*h,1/3*m+2/3*_,1/3*w+2/3*h,m,w]},ti=function(d,v,_,h,m,w,C,S,I,U){var q,tt=120*St/180,J=St/180*(+m||0),W=[],nt=$t(function(pc,gc,Br){return{x:pc*K.cos(Br)-gc*K.sin(Br),y:pc*K.sin(Br)+gc*K.cos(Br)}});if(U)wt=U[0],Ct=U[1],ot=U[2],Tt=U[3];else{d=(q=nt(d,v,-J)).x,v=q.y,S=(q=nt(S,I,-J)).x,I=q.y;var st=(d-S)/2,rt=(v-I)/2,Q=st*st/(_*_)+rt*rt/(h*h);Q>1&&(_*=Q=K.sqrt(Q),h*=Q);var gt=_*_,at=h*h,ft=(w==C?-1:1)*K.sqrt(pt((gt*at-gt*rt*rt-at*st*st)/(gt*rt*rt+at*st*st))),ot=ft*_*rt/h+(d+S)/2,Tt=ft*-h*st/_+(v+I)/2,wt=K.asin(((v-Tt)/h).toFixed(9)),Ct=K.asin(((I-Tt)/h).toFixed(9));(wt=d<ot?St-wt:wt)<0&&(wt=2*St+wt),(Ct=S<ot?St-Ct:Ct)<0&&(Ct=2*St+Ct),C&&wt>Ct&&(wt-=2*St),!C&&Ct>wt&&(Ct-=2*St)}var li=Ct-wt;if(pt(li)>tt){var Vi=Ct,ce=S,ze=I;Ct=wt+tt*(C&&Ct>wt?1:-1),S=ot+_*K.cos(Ct),I=Tt+h*K.sin(Ct),W=ti(S,I,_,h,m,0,C,ce,ze,[Ct,Vi,ot,Tt])}li=Ct-wt;var ci=K.cos(wt),hi=K.sin(wt),Ur=K.cos(Ct),en=K.sin(Ct),On=K.tan(li/4),Nr=4/3*_*On,cc=4/3*h*On,hc=[d,v],fi=[d+Nr*hi,v-cc*ci],fc=[S+Nr*en,I-cc*Ur],uc=[S,I];if(fi[0]=2*hc[0]-fi[0],fi[1]=2*hc[1]-fi[1],U)return[fi,fc,uc][M](W);for(var dc=[],wn=0,o1=(W=[fi,fc,uc][M](W).join()[G](",")).length;wn<o1;wn++)dc[wn]=wn%2?nt(W[wn-1],W[wn],J).y:nt(W[wn],W[wn+1],J).x;return dc},$e=function(d,v,_,h,m,w,C,S,I){var U=1-I;return{x:kt(U,3)*d+3*kt(U,2)*I*_+3*U*I*I*m+kt(I,3)*C,y:kt(U,3)*v+3*kt(U,2)*I*h+3*U*I*I*w+kt(I,3)*S}},qe=$t(function(d,v,_,h,m,w,C,S){var I,U=m-2*_+d-(C-2*m+_),q=2*(_-d)-2*(m-_),tt=d-_,J=(-q+K.sqrt(q*q-4*U*tt))/2/U,W=(-q-K.sqrt(q*q-4*U*tt))/2/U,nt=[v,S],st=[d,C];return pt(J)>"1e12"&&(J=.5),pt(W)>"1e12"&&(W=.5),J>0&&J<1&&(I=$e(d,v,_,h,m,w,C,S,J),st.push(I.x),nt.push(I.y)),W>0&&W<1&&(I=$e(d,v,_,h,m,w,C,S,W),st.push(I.x),nt.push(I.y)),U=w-2*h+v-(S-2*w+h),tt=v-h,J=(-(q=2*(h-v)-2*(w-h))+K.sqrt(q*q-4*U*tt))/2/U,W=(-q-K.sqrt(q*q-4*U*tt))/2/U,pt(J)>"1e12"&&(J=.5),pt(W)>"1e12"&&(W=.5),J>0&&J<1&&(I=$e(d,v,_,h,m,w,C,S,J),st.push(I.x),nt.push(I.y)),W>0&&W<1&&(I=$e(d,v,_,h,m,w,C,S,W),st.push(I.x),nt.push(I.y)),{min:{x:ht[P](0,st),y:ht[P](0,nt)},max:{x:ut[P](0,st),y:ut[P](0,nt)}}}),Mn=l._path2curve=$t(function(d,v){var _=!v&&ae(d);if(!v&&_.curve)return Qt(_.curve);for(var h=gn(d),m=v&&gn(v),w={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},C={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},S=function(ft,ot,Tt){var wt,Ct;if(!ft)return["C",ot.x,ot.y,ot.x,ot.y,ot.x,ot.y];switch(!(ft[0]in{T:1,Q:1})&&(ot.qx=ot.qy=null),ft[0]){case"M":ot.X=ft[1],ot.Y=ft[2];break;case"A":ft=["C"][M](ti[P](0,[ot.x,ot.y][M](ft.slice(1))));break;case"S":Tt=="C"||Tt=="S"?(wt=2*ot.x-ot.bx,Ct=2*ot.y-ot.by):(wt=ot.x,Ct=ot.y),ft=["C",wt,Ct][M](ft.slice(1));break;case"T":Tt=="Q"||Tt=="T"?(ot.qx=2*ot.x-ot.qx,ot.qy=2*ot.y-ot.qy):(ot.qx=ot.x,ot.qy=ot.y),ft=["C"][M](Oe(ot.x,ot.y,ot.qx,ot.qy,ft[1],ft[2]));break;case"Q":ot.qx=ft[1],ot.qy=ft[2],ft=["C"][M](Oe(ot.x,ot.y,ft[1],ft[2],ft[3],ft[4]));break;case"L":ft=["C"][M](Ze(ot.x,ot.y,ft[1],ft[2]));break;case"H":ft=["C"][M](Ze(ot.x,ot.y,ft[1],ot.y));break;case"V":ft=["C"][M](Ze(ot.x,ot.y,ot.x,ft[1]));break;case"Z":ft=["C"][M](Ze(ot.x,ot.y,ot.X,ot.Y))}return ft},I=function(ft,ot){if(ft[ot].length>7){ft[ot].shift();for(var Tt=ft[ot];Tt.length;)q[ot]="A",m&&(tt[ot]="A"),ft.splice(ot++,0,["C"][M](Tt.splice(0,6)));ft.splice(ot,1),st=ut(h.length,m&&m.length||0)}},U=function(ft,ot,Tt,wt,Ct){ft&&ot&&ft[Ct][0]=="M"&&ot[Ct][0]!="M"&&(ot.splice(Ct,0,["M",wt.x,wt.y]),Tt.bx=0,Tt.by=0,Tt.x=ft[Ct][1],Tt.y=ft[Ct][2],st=ut(h.length,m&&m.length||0))},q=[],tt=[],J="",W="",nt=0,st=ut(h.length,m&&m.length||0);nt<st;nt++){h[nt]&&(J=h[nt][0]),J!="C"&&(q[nt]=J,nt&&(W=q[nt-1])),h[nt]=S(h[nt],w,W),q[nt]!="A"&&J=="C"&&(q[nt]="C"),I(h,nt),m&&(m[nt]&&(J=m[nt][0]),J!="C"&&(tt[nt]=J,nt&&(W=tt[nt-1])),m[nt]=S(m[nt],C,W),tt[nt]!="A"&&J=="C"&&(tt[nt]="C"),I(m,nt)),U(h,m,w,C,nt),U(m,h,C,w,nt);var rt=h[nt],Q=m&&m[nt],gt=rt.length,at=m&&Q.length;w.x=rt[gt-2],w.y=rt[gt-1],w.bx=B(rt[gt-4])||w.x,w.by=B(rt[gt-3])||w.y,C.bx=m&&(B(Q[at-4])||C.x),C.by=m&&(B(Q[at-3])||C.y),C.x=m&&Q[at-2],C.y=m&&Q[at-1]}return m||(_.curve=Qt(h)),m?[h,m]:h},null,Qt),ei=(l._parseDots=$t(function(d){for(var v=[],_=0,h=d.length;_<h;_++){var m={},w=d[_].match(/^([^:]*):?([\d\.]*)/);if(m.color=l.getRGB(w[1]),m.color.error)return null;m.opacity=m.color.opacity,m.color=m.color.hex,w[2]&&(m.offset=w[2]+"%"),v.push(m)}for(_=1,h=v.length-1;_<h;_++)if(!v[_].offset){for(var C=B(v[_-1].offset||0),S=0,I=_+1;I<h;I++)if(v[I].offset){S=v[I].offset;break}S||(S=100,I=h);for(var U=((S=B(S))-C)/(I-_+1);_<I;_++)C+=U,v[_].offset=C+"%"}return v}),l._tear=function(d,v){d==v.top&&(v.top=d.prev),d==v.bottom&&(v.bottom=d.next),d.next&&(d.next.prev=d.prev),d.prev&&(d.prev.next=d.next)}),Ir=(l._tofront=function(d,v){v.top!==d&&(ei(d,v),d.next=null,d.prev=v.top,v.top.next=d,v.top=d)},l._toback=function(d,v){v.bottom!==d&&(ei(d,v),d.next=v.bottom,d.prev=null,v.bottom.prev=d,v.bottom=d)},l._insertafter=function(d,v,_){ei(d,_),v==_.top&&(_.top=d),v.next&&(v.next.prev=d),d.next=v.next,d.prev=v,v.next=d},l._insertbefore=function(d,v,_){ei(d,_),v==_.bottom&&(_.bottom=d),v.prev&&(v.prev.next=d),d.prev=v.prev,v.prev=d,d.next=v},l.toMatrix=function(d,v){var _=we(d),h={_:{transform:z},getBBox:function(){return _}};return ni(h,v),h.matrix}),ni=(l.transformPath=function(d,v){return Vt(d,Ir(d,v))},l._extractTransform=function(d,v){if(v==null)return d._.transform;v=F(v).replace(/\.{3}|\u2026/g,d._.transform||z);var _,h,m=l.parseTransformString(v),w=0,C=1,S=1,I=d._,U=new We;if(I.transform=m||[],m)for(var q=0,tt=m.length;q<tt;q++){var J,W,nt,st,rt,Q=m[q],gt=Q.length,at=F(Q[0]).toLowerCase(),ft=Q[0]!=at,ot=ft?U.invert():0;at=="t"&>==3?ft?(J=ot.x(0,0),W=ot.y(0,0),nt=ot.x(Q[1],Q[2]),st=ot.y(Q[1],Q[2]),U.translate(nt-J,st-W)):U.translate(Q[1],Q[2]):at=="r"?gt==2?(rt=rt||d.getBBox(1),U.rotate(Q[1],rt.x+rt.width/2,rt.y+rt.height/2),w+=Q[1]):gt==4&&(ft?(nt=ot.x(Q[2],Q[3]),st=ot.y(Q[2],Q[3]),U.rotate(Q[1],nt,st)):U.rotate(Q[1],Q[2],Q[3]),w+=Q[1]):at=="s"?gt==2||gt==3?(rt=rt||d.getBBox(1),U.scale(Q[1],Q[gt-1],rt.x+rt.width/2,rt.y+rt.height/2),C*=Q[1],S*=Q[gt-1]):gt==5&&(ft?(nt=ot.x(Q[3],Q[4]),st=ot.y(Q[3],Q[4]),U.scale(Q[1],Q[2],nt,st)):U.scale(Q[1],Q[2],Q[3],Q[4]),C*=Q[1],S*=Q[2]):at=="m"&>==7&&U.add(Q[1],Q[2],Q[3],Q[4],Q[5],Q[6]),I.dirtyT=1,d.matrix=U}d.matrix=U,I.sx=C,I.sy=S,I.deg=w,I.dx=_=U.e,I.dy=h=U.f,C==1&&S==1&&!w&&I.bbox?(I.bbox.x+=+_,I.bbox.y+=+h):I.dirtyT=1}),Mr=function(d){var v=d[0];switch(v.toLowerCase()){case"t":return[v,0,0];case"m":return[v,1,0,0,1,0,0];case"r":return d.length==4?[v,0,d[2],d[3]]:[v,0];case"s":return d.length==5?[v,1,1,d[3],d[4]]:d.length==3?[v,1,1]:[v,1]}},Lr=l._equaliseTransform=function(d,v){v=F(v).replace(/\.{3}|\u2026/g,d),d=l.parseTransformString(d)||[],v=l.parseTransformString(v)||[];for(var _,h,m,w,C=ut(d.length,v.length),S=[],I=[],U=0;U<C;U++){if(m=d[U]||Mr(v[U]),w=v[U]||Mr(m),m[0]!=w[0]||m[0].toLowerCase()=="r"&&(m[2]!=w[2]||m[3]!=w[3])||m[0].toLowerCase()=="s"&&(m[3]!=w[3]||m[4]!=w[4]))return;for(S[U]=[],I[U]=[],_=0,h=ut(m.length,w.length);_<h;_++)_ in m&&(S[U][_]=m[_]),_ in w&&(I[U][_]=w[_])}return{from:S,to:I}};function We(d,v,_,h,m,w){d!=null?(this.a=+d,this.b=+v,this.c=+_,this.d=+h,this.e=+m,this.f=+w):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}l._getContainer=function(d,v,_,h){var m;if((m=h!=null||l.is(d,"object")?d:x.doc.getElementById(d))!=null)return m.tagName?v==null?{container:m,width:m.style.pixelWidth||m.offsetWidth,height:m.style.pixelHeight||m.offsetHeight}:{container:m,width:v,height:_}:{container:1,x:d,y:v,width:_,height:h}},l.pathToRelative=Pr,l._engine={},l.path2curve=Mn,l.matrix=function(d,v,_,h,m,w){return new We(d,v,_,h,m,w)},function(d){function v(h){return h[0]*h[0]+h[1]*h[1]}function _(h){var m=K.sqrt(v(h));h[0]&&(h[0]/=m),h[1]&&(h[1]/=m)}d.add=function(h,m,w,C,S,I){var U,q,tt,J,W=[[],[],[]],nt=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],st=[[h,w,S],[m,C,I],[0,0,1]];for(h&&h instanceof We&&(st=[[h.a,h.c,h.e],[h.b,h.d,h.f],[0,0,1]]),U=0;U<3;U++)for(q=0;q<3;q++){for(J=0,tt=0;tt<3;tt++)J+=nt[U][tt]*st[tt][q];W[U][q]=J}this.a=W[0][0],this.b=W[1][0],this.c=W[0][1],this.d=W[1][1],this.e=W[0][2],this.f=W[1][2]},d.invert=function(){var h=this,m=h.a*h.d-h.b*h.c;return new We(h.d/m,-h.b/m,-h.c/m,h.a/m,(h.c*h.f-h.d*h.e)/m,(h.b*h.e-h.a*h.f)/m)},d.clone=function(){return new We(this.a,this.b,this.c,this.d,this.e,this.f)},d.translate=function(h,m){this.add(1,0,0,1,h,m)},d.scale=function(h,m,w,C){m==null&&(m=h),(w||C)&&this.add(1,0,0,1,w,C),this.add(h,0,0,m,0,0),(w||C)&&this.add(1,0,0,1,-w,-C)},d.rotate=function(h,m,w){h=l.rad(h),m=m||0,w=w||0;var C=+K.cos(h).toFixed(9),S=+K.sin(h).toFixed(9);this.add(C,S,-S,C,m,w),this.add(1,0,0,1,-m,-w)},d.x=function(h,m){return h*this.a+m*this.c+this.e},d.y=function(h,m){return h*this.b+m*this.d+this.f},d.get=function(h){return+this[F.fromCharCode(97+h)].toFixed(4)},d.toString=function(){return l.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},d.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},d.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},d.split=function(){var h={};h.dx=this.e,h.dy=this.f;var m=[[this.a,this.c],[this.b,this.d]];h.scalex=K.sqrt(v(m[0])),_(m[0]),h.shear=m[0][0]*m[1][0]+m[0][1]*m[1][1],m[1]=[m[1][0]-m[0][0]*h.shear,m[1][1]-m[0][1]*h.shear],h.scaley=K.sqrt(v(m[1])),_(m[1]),h.shear/=h.scaley;var w=-m[0][1],C=m[1][1];return C<0?(h.rotate=l.deg(K.acos(C)),w<0&&(h.rotate=360-h.rotate)):h.rotate=l.deg(K.asin(w)),h.isSimple=!(+h.shear.toFixed(9)||h.scalex.toFixed(9)!=h.scaley.toFixed(9)&&h.rotate),h.isSuperSimple=!+h.shear.toFixed(9)&&h.scalex.toFixed(9)==h.scaley.toFixed(9)&&!h.rotate,h.noRotation=!+h.shear.toFixed(9)&&!h.rotate,h},d.toTransformString=function(h){var m=h||this[G]();return m.isSimple?(m.scalex=+m.scalex.toFixed(4),m.scaley=+m.scaley.toFixed(4),m.rotate=+m.rotate.toFixed(4),(m.dx||m.dy?"t"+[m.dx,m.dy]:z)+(m.scalex!=1||m.scaley!=1?"s"+[m.scalex,m.scaley,0,0]:z)+(m.rotate?"r"+[m.rotate,0,0]:z)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(We.prototype);for(var Dr=function(){this.returnValue=!1},Rr=function(){return this.originalEvent.preventDefault()},Or=function(){this.cancelBubble=!0},Fr=function(){return this.originalEvent.stopPropagation()},ii=function(d){var v=x.doc.documentElement.scrollTop||x.doc.body.scrollTop,_=x.doc.documentElement.scrollLeft||x.doc.body.scrollLeft;return{x:d.clientX+_,y:d.clientY+v}},Je=x.doc.addEventListener?function(d,v,_,h){var m=function(C){var S=ii(C);return _.call(h,C,S.x,S.y)};if(d.addEventListener(v,m,!1),D&&$[v]){var w=function(C){for(var S=ii(C),I=C,U=0,q=C.targetTouches&&C.targetTouches.length;U<q;U++)if(C.targetTouches[U].target==d){(C=C.targetTouches[U]).originalEvent=I,C.preventDefault=Rr,C.stopPropagation=Fr;break}return _.call(h,C,S.x,S.y)};d.addEventListener($[v],w,!1)}return function(){return d.removeEventListener(v,m,!1),D&&$[v]&&d.removeEventListener($[v],w,!1),!0}}:x.doc.attachEvent?function(d,v,_,h){var m=function(w){w=w||x.win.event;var C=x.doc.documentElement.scrollTop||x.doc.body.scrollTop,S=x.doc.documentElement.scrollLeft||x.doc.body.scrollLeft,I=w.clientX+S,U=w.clientY+C;return w.preventDefault=w.preventDefault||Dr,w.stopPropagation=w.stopPropagation||Or,_.call(h,w,I,U)};return d.attachEvent("on"+v,m),function(){return d.detachEvent("on"+v,m),!0}}:void 0,oe=[],Ke=function(d){for(var v,_=d.clientX,h=d.clientY,m=x.doc.documentElement.scrollTop||x.doc.body.scrollTop,w=x.doc.documentElement.scrollLeft||x.doc.body.scrollLeft,C=oe.length;C--;){if(v=oe[C],D&&d.touches){for(var S,I=d.touches.length;I--;)if((S=d.touches[I]).identifier==v.el._drag.id){_=S.clientX,h=S.clientY,(d.originalEvent?d.originalEvent:d).preventDefault();break}}else d.preventDefault();var U,q=v.el.node,tt=q.nextSibling,J=q.parentNode,W=q.style.display;x.win.opera&&J.removeChild(q),q.style.display="none",U=v.el.paper.getElementByPoint(_,h),q.style.display=W,x.win.opera&&(tt?J.insertBefore(q,tt):J.appendChild(q)),U&&o("raphael.drag.over."+v.el.id,v.el,U),_+=w,h+=m,o("raphael.drag.move."+v.el.id,v.move_scope||v.el,_-v.el._drag.x,h-v.el._drag.y,_,h,d)}},mn=function(d){l.unmousemove(Ke).unmouseup(mn);for(var v,_=oe.length;_--;)(v=oe[_]).el._drag={},o("raphael.drag.end."+v.el.id,v.end_scope||v.start_scope||v.move_scope||v.el,d);oe=[]},Ot=l.el={},zr=H.length;zr--;)(function(d){l[d]=Ot[d]=function(v,_){return l.is(v,"function")&&(this.events=this.events||[],this.events.push({name:d,f:v,unbind:Je(this.shape||this.node||x.doc,d,v,_||this)})),this},l["un"+d]=Ot["un"+d]=function(v){for(var _=this.events||[],h=_.length;h--;)_[h].name!=d||!l.is(v,"undefined")&&_[h].f!=v||(_[h].unbind(),_.splice(h,1),!_.length&&delete this.events);return this}})(H[zr]);Ot.data=function(d,v){var _=It[this.id]=It[this.id]||{};if(arguments.length==0)return _;if(arguments.length==1){if(l.is(d,"object")){for(var h in d)d[y](h)&&this.data(h,d[h]);return this}return o("raphael.data.get."+this.id,this,_[d],d),_[d]}return _[d]=v,o("raphael.data.set."+this.id,this,v,d),this},Ot.removeData=function(d){return d==null?delete It[this.id]:It[this.id]&&delete It[this.id][d],this},Ot.getData=function(){return Jt(It[this.id]||{})},Ot.hover=function(d,v,_,h){return this.mouseover(d,_).mouseout(v,h||_)},Ot.unhover=function(d,v){return this.unmouseover(d).unmouseout(v)};var vn=[];Ot.drag=function(d,v,_,h,m,w){function C(S){(S.originalEvent||S).preventDefault();var I=S.clientX,U=S.clientY,q=x.doc.documentElement.scrollTop||x.doc.body.scrollTop,tt=x.doc.documentElement.scrollLeft||x.doc.body.scrollLeft;if(this._drag.id=S.identifier,D&&S.touches){for(var J,W=S.touches.length;W--;)if(J=S.touches[W],this._drag.id=J.identifier,J.identifier==this._drag.id){I=J.clientX,U=J.clientY;break}}this._drag.x=I+tt,this._drag.y=U+q,!oe.length&&l.mousemove(Ke).mouseup(mn),oe.push({el:this,move_scope:h,start_scope:m,end_scope:w}),v&&o.on("raphael.drag.start."+this.id,v),d&&o.on("raphael.drag.move."+this.id,d),_&&o.on("raphael.drag.end."+this.id,_),o("raphael.drag.start."+this.id,m||h||this,this._drag.x,this._drag.y,S)}return this._drag={},vn.push({el:this,start:C}),this.mousedown(C),this},Ot.onDragOver=function(d){d?o.on("raphael.drag.over."+this.id,d):o.unbind("raphael.drag.over."+this.id)},Ot.undrag=function(){for(var d=vn.length;d--;)vn[d].el==this&&(this.unmousedown(vn[d].start),vn.splice(d,1),o.unbind("raphael.drag.*."+this.id));!vn.length&&l.unmousemove(Ke).unmouseup(mn),oe=[]},f.circle=function(d,v,_){var h=l._engine.circle(this,d||0,v||0,_||0);return this.__set__&&this.__set__.push(h),h},f.rect=function(d,v,_,h,m){var w=l._engine.rect(this,d||0,v||0,_||0,h||0,m||0);return this.__set__&&this.__set__.push(w),w},f.ellipse=function(d,v,_,h){var m=l._engine.ellipse(this,d||0,v||0,_||0,h||0);return this.__set__&&this.__set__.push(m),m},f.path=function(d){d&&!l.is(d,"string")&&!l.is(d[0],j)&&(d+=z);var v=l._engine.path(l.format[P](l,arguments),this);return this.__set__&&this.__set__.push(v),v},f.image=function(d,v,_,h,m){var w=l._engine.image(this,d||"about:blank",v||0,_||0,h||0,m||0);return this.__set__&&this.__set__.push(w),w},f.text=function(d,v,_){var h=l._engine.text(this,d||0,v||0,F(_));return this.__set__&&this.__set__.push(h),h},f.set=function(d){!l.is(d,"array")&&(d=Array.prototype.splice.call(arguments,0,arguments.length));var v=new Dn(d);return this.__set__&&this.__set__.push(v),v.paper=this,v.type="set",v},f.setStart=function(d){this.__set__=d||this.set()},f.setFinish=function(d){var v=this.__set__;return delete this.__set__,v},f.getSize=function(){var d=this.canvas.parentNode;return{width:d.offsetWidth,height:d.offsetHeight}},f.setSize=function(d,v){return l._engine.setSize.call(this,d,v)},f.setViewBox=function(d,v,_,h,m){return l._engine.setViewBox.call(this,d,v,_,h,m)},f.top=f.bottom=null,f.raphael=l;function Ln(){return this.x+N+this.y+N+this.width+" × "+this.height}f.getElementByPoint=function(d,v){var _,h,m,w,C,S,I,U=this.canvas,q=x.doc.elementFromPoint(d,v);if(x.win.opera&&q.tagName=="svg"){var tt=(h=(_=U).getBoundingClientRect(),m=_.ownerDocument,w=m.body,C=m.documentElement,S=C.clientTop||w.clientTop||0,I=C.clientLeft||w.clientLeft||0,{y:h.top+(x.win.pageYOffset||C.scrollTop||w.scrollTop)-S,x:h.left+(x.win.pageXOffset||C.scrollLeft||w.scrollLeft)-I}),J=U.createSVGRect();J.x=d-tt.x,J.y=v-tt.y,J.width=J.height=1;var W=U.getIntersectionList(J,null);W.length&&(q=W[W.length-1])}if(!q)return null;for(;q.parentNode&&q!=U.parentNode&&!q.raphael;)q=q.parentNode;return q==this.canvas.parentNode&&(q=U),q=q&&q.raphael?this.getById(q.raphaelid):null},f.getElementsByBBox=function(d){var v=this.set();return this.forEach(function(_){l.isBBoxIntersect(_.getBBox(),d)&&v.push(_)}),v},f.getById=function(d){for(var v=this.bottom;v;){if(v.id==d)return v;v=v.next}return null},f.forEach=function(d,v){for(var _=this.bottom;_;){if(d.call(v,_)===!1)return this;_=_.next}return this},f.getElementsByPoint=function(d,v){var _=this.set();return this.forEach(function(h){h.isPointInside(d,v)&&_.push(h)}),_},Ot.isPointInside=function(d,v){var _=this.realPath=Rt[this.type](this);return this.attr("transform")&&this.attr("transform").length&&(_=l.transformPath(_,this.attr("transform"))),l.isPointInsidePath(_,d,v)},Ot.getBBox=function(d){if(this.removed)return{};var v=this._;return d?(!v.dirty&&v.bboxwt||(this.realPath=Rt[this.type](this),v.bboxwt=we(this.realPath),v.bboxwt.toString=Ln,v.dirty=0),v.bboxwt):((v.dirty||v.dirtyT||!v.bbox)&&(!v.dirty&&this.realPath||(v.bboxwt=0,this.realPath=Rt[this.type](this)),v.bbox=we(Vt(this.realPath,this.matrix)),v.bbox.toString=Ln,v.dirty=v.dirtyT=0),v.bbox)},Ot.clone=function(){if(this.removed)return null;var d=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(d),d},Ot.glow=function(d){if(this.type=="text")return null;var v={width:((d=d||{}).width||10)+(+this.attr("stroke-width")||1),fill:d.fill||!1,opacity:d.opacity==null?.5:d.opacity,offsetx:d.offsetx||0,offsety:d.offsety||0,color:d.color||"#000"},_=v.width/2,h=this.paper,m=h.set(),w=this.realPath||Rt[this.type](this);w=this.matrix?Vt(w,this.matrix):w;for(var C=1;C<_+1;C++)m.push(h.path(w).attr({stroke:v.color,fill:v.fill?v.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(v.width/_*C).toFixed(3),opacity:+(v.opacity/_).toFixed(3)}));return m.insertBefore(this).translate(v.offsetx,v.offsety)};var te=function(d,v,_,h,m,w,C,S,I){return I==null?de(d,v,_,h,m,w,C,S):l.findDotsAtSegment(d,v,_,h,m,w,C,S,function(U,q,tt,J,W,nt,st,rt,Q){if(!(Q<0||de(U,q,tt,J,W,nt,st,rt)<Q)){var gt,at=.5,ft=1-at;for(gt=de(U,q,tt,J,W,nt,st,rt,ft);pt(gt-Q)>.01;)gt=de(U,q,tt,J,W,nt,st,rt,ft+=(gt<Q?1:-1)*(at/=2));return ft}}(d,v,_,h,m,w,C,S,I))},Fe=function(d,v){return function(_,h,m){for(var w,C,S,I,U,q="",tt={},J=0,W=0,nt=(_=Mn(_)).length;W<nt;W++){if((S=_[W])[0]=="M")w=+S[1],C=+S[2];else{if(J+(I=te(w,C,S[1],S[2],S[3],S[4],S[5],S[6]))>h){if(v&&!tt.start){if(q+=["C"+(U=te(w,C,S[1],S[2],S[3],S[4],S[5],S[6],h-J)).start.x,U.start.y,U.m.x,U.m.y,U.x,U.y],m)return q;tt.start=q,q=["M"+U.x,U.y+"C"+U.n.x,U.n.y,U.end.x,U.end.y,S[5],S[6]].join(),J+=I,w=+S[5],C=+S[6];continue}if(!d&&!v)return{x:(U=te(w,C,S[1],S[2],S[3],S[4],S[5],S[6],h-J)).x,y:U.y,alpha:U.alpha}}J+=I,w=+S[5],C=+S[6]}q+=S.shift()+S}return tt.end=q,(U=d?J:v?tt:l.findDotsAtSegment(w,C,S[0],S[1],S[2],S[3],S[4],S[5],1)).alpha&&(U={x:U.x,y:U.y,alpha:U.alpha}),U}},ke=Fe(1),ye=Fe(),Qe=Fe(0,1);l.getTotalLength=ke,l.getPointAtLength=ye,l.getSubpath=function(d,v,_){if(this.getTotalLength(d)-_<1e-6)return Qe(d,v).end;var h=Qe(d,_,1);return v?Qe(h,v).end:h},Ot.getTotalLength=function(){var d=this.getPath();if(d)return this.node.getTotalLength?this.node.getTotalLength():ke(d)},Ot.getPointAtLength=function(d){var v=this.getPath();if(v)return ye(v,d)},Ot.getPath=function(){var d,v=l._getPath[this.type];if(this.type!="text"&&this.type!="set")return v&&(d=v(this)),d},Ot.getSubpath=function(d,v){var _=this.getPath();if(_)return l.getSubpath(_,d,v)};var Ht=l.easing_formulas={linear:function(d){return d},"<":function(d){return kt(d,1.7)},">":function(d){return kt(d,.48)},"<>":function(d){var v=.48-d/1.04,_=K.sqrt(.1734+v*v),h=_-v,m=-_-v,w=kt(pt(h),1/3)*(h<0?-1:1)+kt(pt(m),1/3)*(m<0?-1:1)+.5;return 3*(1-w)*w*w+w*w*w},backIn:function(d){var v=1.70158;return d*d*((v+1)*d-v)},backOut:function(d){var v=1.70158;return(d-=1)*d*((v+1)*d+v)+1},elastic:function(d){return d==!!d?d:kt(2,-10*d)*K.sin(2*St*(d-.075)/.3)+1},bounce:function(d){var v=7.5625,_=2.75;return d<1/_?v*d*d:d<2/_?v*(d-=1.5/_)*d+.75:d<2.5/_?v*(d-=2.25/_)*d+.9375:v*(d-=2.625/_)*d+.984375}};Ht.easeIn=Ht["ease-in"]=Ht["<"],Ht.easeOut=Ht["ease-out"]=Ht[">"],Ht.easeInOut=Ht["ease-in-out"]=Ht["<>"],Ht["back-in"]=Ht.backIn,Ht["back-out"]=Ht.backOut;var bt=[],ji=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(d){setTimeout(d,16)},ri=function(){for(var d=+new Date,v=0;v<bt.length;v++){var _=bt[v];if(!_.el.removed&&!_.paused){var h,m,w=d-_.start,C=_.ms,S=_.easing,I=_.from,U=_.diff,q=_.to,tt=(_.t,_.el),J={},W={};if(_.initstatus?(w=(_.initstatus*_.anim.top-_.prev)/(_.percent-_.prev)*C,_.status=_.initstatus,delete _.initstatus,_.stop&&bt.splice(v--,1)):_.status=(_.prev+(_.percent-_.prev)*(w/C))/_.anim.top,!(w<0))if(w<C){var nt=S(w/C);for(var st in I)if(I[y](st)){switch(Z[st]){case vt:h=+I[st]+nt*C*U[st];break;case"colour":h="rgb("+[_n(R(I[st].r+nt*C*U[st].r)),_n(R(I[st].g+nt*C*U[st].g)),_n(R(I[st].b+nt*C*U[st].b))].join(",")+")";break;case"path":h=[];for(var rt=0,Q=I[st].length;rt<Q;rt++){h[rt]=[I[st][rt][0]];for(var gt=1,at=I[st][rt].length;gt<at;gt++)h[rt][gt]=+I[st][rt][gt]+nt*C*U[st][rt][gt];h[rt]=h[rt].join(N)}h=h.join(N);break;case"transform":if(U[st].real)for(h=[],rt=0,Q=I[st].length;rt<Q;rt++)for(h[rt]=[I[st][rt][0]],gt=1,at=I[st][rt].length;gt<at;gt++)h[rt][gt]=I[st][rt][gt]+nt*C*U[st][rt][gt];else{var ft=function(Tt){return+I[st][Tt]+nt*C*U[st][Tt]};h=[["m",ft(0),ft(1),ft(2),ft(3),ft(4),ft(5)]]}break;case"csv":if(st=="clip-rect")for(h=[],rt=4;rt--;)h[rt]=+I[st][rt]+nt*C*U[st][rt];break;default:var ot=[][M](I[st]);for(h=[],rt=tt.paper.customAttributes[st].length;rt--;)h[rt]=+ot[rt]+nt*C*U[st][rt]}J[st]=h}tt.attr(J),function(Tt,wt,Ct){setTimeout(function(){o("raphael.anim.frame."+Tt,wt,Ct)})}(tt.id,tt,_.anim)}else{if(function(Tt,wt,Ct){setTimeout(function(){o("raphael.anim.frame."+wt.id,wt,Ct),o("raphael.anim.finish."+wt.id,wt,Ct),l.is(Tt,"function")&&Tt.call(wt)})}(_.callback,tt,_.anim),tt.attr(q),bt.splice(v--,1),_.repeat>1&&!_.next){for(m in q)q[y](m)&&(W[m]=_.totalOrigin[m]);_.el.attr(W),tn(_.anim,_.el,_.anim.percents[0],null,_.totalOrigin,_.repeat-1)}_.next&&!_.stop&&tn(_.anim,_.el,_.next,null,_.totalOrigin,_.repeat)}}}bt.length&&ji(ri)},_n=function(d){return d>255?255:d<0?0:d};function pe(d,v,_,h,m,w){var C=3*v,S=3*(h-v)-C,I=1-C-S,U=3*_,q=3*(m-_)-U,tt=1-U-q;function J(W){return((I*W+S)*W+C)*W}return function(W,nt){var st=function(rt,Q){var gt,at,ft,ot,Tt,wt;for(ft=rt,wt=0;wt<8;wt++){if(ot=J(ft)-rt,pt(ot)<Q)return ft;if(pt(Tt=(3*I*ft+2*S)*ft+C)<1e-6)break;ft-=ot/Tt}if(at=1,(ft=rt)<(gt=0))return gt;if(ft>at)return at;for(;gt<at;){if(ot=J(ft),pt(ot-rt)<Q)return ft;rt>ot?gt=ft:at=ft,ft=(at-gt)/2+gt}return ft}(W,nt);return((tt*st+q)*st+U)*st}(d,1/(200*w))}function le(d,v){var _=[],h={};if(this.ms=v,this.times=1,d){for(var m in d)d[y](m)&&(h[B(m)]=d[m],_.push(B(m)));_.sort(Mt)}this.anim=h,this.top=_[_.length-1],this.percents=_}function tn(d,v,_,h,m,w){_=B(_);var C,S,I,U,q,tt,J=d.ms,W={},nt={},st={};if(h)for(Q=0,gt=bt.length;Q<gt;Q++){var rt=bt[Q];if(rt.el.id==v.id&&rt.anim==d){rt.percent!=_?(bt.splice(Q,1),I=1):S=rt,v.attr(rt.totalOrigin);break}}else h=+nt;for(var Q=0,gt=d.percents.length;Q<gt;Q++){if(d.percents[Q]==_||d.percents[Q]>h*d.top){_=d.percents[Q],q=d.percents[Q-1]||0,J=J/d.top*(_-q),U=d.percents[Q+1],C=d.anim[_];break}h&&v.attr(d.anim[d.percents[Q]])}if(C){if(S)S.initstatus=h,S.start=new Date-S.ms*h;else{for(var at in C)if(C[y](at)&&(Z[y](at)||v.paper.customAttributes[y](at)))switch(W[at]=v.attr(at),W[at]==null&&(W[at]=et[at]),nt[at]=C[at],Z[at]){case vt:st[at]=(nt[at]-W[at])/J;break;case"colour":W[at]=l.getRGB(W[at]);var ft=l.getRGB(nt[at]);st[at]={r:(ft.r-W[at].r)/J,g:(ft.g-W[at].g)/J,b:(ft.b-W[at].b)/J};break;case"path":var ot=Mn(W[at],nt[at]),Tt=ot[1];for(W[at]=ot[0],st[at]=[],Q=0,gt=W[at].length;Q<gt;Q++){st[at][Q]=[0];for(var wt=1,Ct=W[at][Q].length;wt<Ct;wt++)st[at][Q][wt]=(Tt[Q][wt]-W[at][Q][wt])/J}break;case"transform":var li=v._,Vi=Lr(li[at],nt[at]);if(Vi)for(W[at]=Vi.from,nt[at]=Vi.to,st[at]=[],st[at].real=!0,Q=0,gt=W[at].length;Q<gt;Q++)for(st[at][Q]=[W[at][Q][0]],wt=1,Ct=W[at][Q].length;wt<Ct;wt++)st[at][Q][wt]=(nt[at][Q][wt]-W[at][Q][wt])/J;else{var ce=v.matrix||new We,ze={_:{transform:li.transform},getBBox:function(){return v.getBBox(1)}};W[at]=[ce.a,ce.b,ce.c,ce.d,ce.e,ce.f],ni(ze,nt[at]),nt[at]=ze._.transform,st[at]=[(ze.matrix.a-ce.a)/J,(ze.matrix.b-ce.b)/J,(ze.matrix.c-ce.c)/J,(ze.matrix.d-ce.d)/J,(ze.matrix.e-ce.e)/J,(ze.matrix.f-ce.f)/J]}break;case"csv":var ci=F(C[at])[G](g),hi=F(W[at])[G](g);if(at=="clip-rect")for(W[at]=hi,st[at]=[],Q=hi.length;Q--;)st[at][Q]=(ci[Q]-W[at][Q])/J;nt[at]=ci;break;default:for(ci=[][M](C[at]),hi=[][M](W[at]),st[at]=[],Q=v.paper.customAttributes[at].length;Q--;)st[at][Q]=((ci[Q]||0)-(hi[Q]||0))/J}var Ur=C.easing,en=l.easing_formulas[Ur];if(!en)if((en=F(Ur).match(E))&&en.length==5){var On=en;en=function(Nr){return pe(Nr,+On[1],+On[2],+On[3],+On[4],J)}}else en=Dt;if(rt={anim:d,percent:_,timestamp:tt=C.start||d.start||+new Date,start:tt+(d.del||0),status:0,initstatus:h||0,stop:!1,ms:J,easing:en,from:W,diff:st,to:nt,el:v,callback:C.callback,prev:q,next:U,repeat:w||d.times,origin:v.attr(),totalOrigin:m},bt.push(rt),h&&!S&&!I&&(rt.stop=!0,rt.start=new Date-J*h,bt.length==1))return ri();I&&(rt.start=new Date-rt.ms*h),bt.length==1&&ji(ri)}o("raphael.anim.start."+v.id,v,d)}}function si(d){for(var v=0;v<bt.length;v++)bt[v].el.paper==d&&bt.splice(v--,1)}Ot.animateWith=function(d,v,_,h,m,w){if(this.removed)return w&&w.call(this),this;var C=_ instanceof le?_:l.animation(_,h,m,w);tn(C,this,C.percents[0],null,this.attr());for(var S=0,I=bt.length;S<I;S++)if(bt[S].anim==v&&bt[S].el==d){bt[I-1].start=bt[S].start;break}return this},Ot.onAnimation=function(d){return d?o.on("raphael.anim.frame."+this.id,d):o.unbind("raphael.anim.frame."+this.id),this},le.prototype.delay=function(d){var v=new le(this.anim,this.ms);return v.times=this.times,v.del=+d||0,v},le.prototype.repeat=function(d){var v=new le(this.anim,this.ms);return v.del=this.del,v.times=K.floor(ut(d,0))||1,v},l.animation=function(d,v,_,h){if(d instanceof le)return d;!l.is(_,"function")&&_||(h=h||_||null,_=null),d=Object(d),v=+v||0;var m,w,C={};for(w in d)d[y](w)&&B(w)!=w&&B(w)+"%"!=w&&(m=!0,C[w]=d[w]);if(m)return _&&(C.easing=_),h&&(C.callback=h),new le({100:C},v);if(h){var S=0;for(var I in d){var U=X(I);d[y](I)&&U>S&&(S=U)}!d[S+="%"].callback&&(d[S].callback=h)}return new le(d,v)},Ot.animate=function(d,v,_,h){if(this.removed)return h&&h.call(this),this;var m=d instanceof le?d:l.animation(d,v,_,h);return tn(m,this,m.percents[0],null,this.attr()),this},Ot.setTime=function(d,v){return d&&v!=null&&this.status(d,ht(v,d.ms)/d.ms),this},Ot.status=function(d,v){var _,h,m=[],w=0;if(v!=null)return tn(d,this,-1,ht(v,1)),this;for(_=bt.length;w<_;w++)if((h=bt[w]).el.id==this.id&&(!d||h.anim==d)){if(d)return h.status;m.push({anim:h.anim,status:h.status})}return d?0:m},Ot.pause=function(d){for(var v=0;v<bt.length;v++)bt[v].el.id!=this.id||d&&bt[v].anim!=d||o("raphael.anim.pause."+this.id,this,bt[v].anim)!==!1&&(bt[v].paused=!0);return this},Ot.resume=function(d){for(var v=0;v<bt.length;v++)if(bt[v].el.id==this.id&&(!d||bt[v].anim==d)){var _=bt[v];o("raphael.anim.resume."+this.id,this,_.anim)!==!1&&(delete _.paused,this.status(_.anim,_.status))}return this},Ot.stop=function(d){for(var v=0;v<bt.length;v++)bt[v].el.id!=this.id||d&&bt[v].anim!=d||o("raphael.anim.stop."+this.id,this,bt[v].anim)!==!1&&bt.splice(v--,1);return this},o.on("raphael.remove",si),o.on("raphael.clear",si),Ot.toString=function(){return"Raphaël’s object"};var ai,oi,xe,be,Dn=function(d){if(this.items=[],this.length=0,this.type="set",d)for(var v=0,_=d.length;v<_;v++)!d[v]||d[v].constructor!=Ot.constructor&&d[v].constructor!=Dn||(this[this.items.length]=this.items[this.items.length]=d[v],this.length++)},Xt=Dn.prototype;for(var Rn in Xt.push=function(){for(var d,v,_=0,h=arguments.length;_<h;_++)!(d=arguments[_])||d.constructor!=Ot.constructor&&d.constructor!=Dn||(this[v=this.items.length]=this.items[v]=d,this.length++);return this},Xt.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},Xt.forEach=function(d,v){for(var _=0,h=this.items.length;_<h;_++)if(d.call(v,this.items[_],_)===!1)return this;return this},Ot)Ot[y](Rn)&&(Xt[Rn]=function(d){return function(){var v=arguments;return this.forEach(function(_){_[d][P](_,v)})}}(Rn));return Xt.attr=function(d,v){if(d&&l.is(d,j)&&l.is(d[0],"object"))for(var _=0,h=d.length;_<h;_++)this.items[_].attr(d[_]);else for(var m=0,w=this.items.length;m<w;m++)this.items[m].attr(d,v);return this},Xt.clear=function(){for(;this.length;)this.pop()},Xt.splice=function(d,v,_){d=d<0?ut(this.length+d,0):d,v=ut(0,ht(this.length-d,v));var h,m=[],w=[],C=[];for(h=2;h<arguments.length;h++)C.push(arguments[h]);for(h=0;h<v;h++)w.push(this[d+h]);for(;h<this.length-d;h++)m.push(this[d+h]);var S=C.length;for(h=0;h<S+m.length;h++)this.items[d+h]=this[d+h]=h<S?C[h]:m[h-S];for(h=this.items.length=this.length-=v-S;this[h];)delete this[h++];return new Dn(w)},Xt.exclude=function(d){for(var v=0,_=this.length;v<_;v++)if(this[v]==d)return this.splice(v,1),!0},Xt.animate=function(d,v,_,h){(l.is(_,"function")||!_)&&(h=_||null);var m,w,C=this.items.length,S=C,I=this;if(!C)return this;h&&(w=function(){!--C&&h.call(I)}),_=l.is(_,"string")?_:w;var U=l.animation(d,v,_,w);for(m=this.items[--S].animate(U);S--;)this.items[S]&&!this.items[S].removed&&this.items[S].animateWith(m,U,U),this.items[S]&&!this.items[S].removed||C--;return this},Xt.insertAfter=function(d){for(var v=this.items.length;v--;)this.items[v].insertAfter(d);return this},Xt.getBBox=function(){for(var d=[],v=[],_=[],h=[],m=this.items.length;m--;)if(!this.items[m].removed){var w=this.items[m].getBBox();d.push(w.x),v.push(w.y),_.push(w.x+w.width),h.push(w.y+w.height)}return{x:d=ht[P](0,d),y:v=ht[P](0,v),x2:_=ut[P](0,_),y2:h=ut[P](0,h),width:_-d,height:h-v}},Xt.clone=function(d){d=this.paper.set();for(var v=0,_=this.items.length;v<_;v++)d.push(this.items[v].clone());return d},Xt.toString=function(){return"Raphaël‘s set"},Xt.glow=function(d){var v=this.paper.set();return this.forEach(function(_,h){var m=_.glow(d);m?.forEach(function(w,C){v.push(w)})}),v},Xt.isPointInside=function(d,v){var _=!1;return this.forEach(function(h){if(h.isPointInside(d,v))return _=!0,!1}),_},l.registerFont=function(d){if(!d.face)return d;this.fonts=this.fonts||{};var v={w:d.w,face:{},glyphs:{}},_=d.face["font-family"];for(var h in d.face)d.face[y](h)&&(v.face[h]=d.face[h]);if(this.fonts[_]?this.fonts[_].push(v):this.fonts[_]=[v],!d.svg){for(var m in v.face["units-per-em"]=X(d.face["units-per-em"],10),d.glyphs)if(d.glyphs[y](m)){var w=d.glyphs[m];if(v.glyphs[m]={w:w.w,k:{},d:w.d&&"M"+w.d.replace(/[mlcxtrv]/g,function(S){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[S]||"M"})+"z"},w.k)for(var C in w.k)w[y](C)&&(v.glyphs[m].k[C]=w.k[C])}}return d},f.getFont=function(d,v,_,h){if(h=h||"normal",_=_||"normal",v=+v||{normal:400,bold:700,lighter:300,bolder:800}[v]||400,l.fonts){var m,w=l.fonts[d];if(!w){var C=new RegExp("(^|\\s)"+d.replace(/[^\w\d\s+!~.:_-]/g,z)+"(\\s|$)","i");for(var S in l.fonts)if(l.fonts[y](S)&&C.test(S)){w=l.fonts[S];break}}if(w)for(var I=0,U=w.length;I<U&&((m=w[I]).face["font-weight"]!=v||m.face["font-style"]!=_&&m.face["font-style"]||m.face["font-stretch"]!=h);I++);return m}},f.print=function(d,v,_,h,m,w,C,S){w=w||"middle",C=ut(ht(C||0,1),-1),S=ut(ht(S||1,3),1);var I,U=F(_)[G](z),q=0,tt=0,J=z;if(l.is(h,"string")&&(h=this.getFont(h)),h){I=(m||16)/h.face["units-per-em"];for(var W=h.face.bbox[G](g),nt=+W[0],st=W[3]-W[1],rt=0,Q=+W[1]+(w=="baseline"?st+ +h.face.descent:st/2),gt=0,at=U.length;gt<at;gt++){if(U[gt]==`
|
|
19
|
-
`)q=0,ot=0,tt=0,rt+=st*S;else{var ft=tt&&h.glyphs[U[gt-1]]||{},ot=h.glyphs[U[gt]];q+=tt?(ft.w||h.w)+(ft.k&&ft.k[U[gt]]||0)+h.w*C:0,tt=1}ot&&ot.d&&(J+=l.transformPath(ot.d,["t",q*I,rt*I,"s",I,I,nt,Q,"t",(d-nt)/I,(v-Q)/I]))}}return this.path(J).attr({fill:"#000",stroke:"none"})},f.add=function(d){if(l.is(d,"array"))for(var v,_=this.set(),h=0,m=d.length;h<m;h++)v=d[h]||{},p[y](v.type)&&_.push(this[v.type]().attr(v));return _},l.format=function(d,v){var _=l.is(v,j)?[0][M](v):arguments;return d&&l.is(d,"string")&&_.length-1&&(d=d.replace(u,function(h,m){return _[++m]==null?z:_[m]})),d||z},l.fullfill=(ai=/\{([^\}]+)\}/g,oi=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,function(d,v){return String(d).replace(ai,function(_,h){return function(m,w,C){var S=C;return w.replace(oi,function(I,U,q,tt,J){U=U||tt,S&&(U in S&&(S=S[U]),typeof S=="function"&&J&&(S=S()))}),S=(S==null||S==C?m:S)+""}(_,h,v)})}),l.ninja=function(){if(b.was)x.win.Raphael=b.is;else{window.Raphael=void 0;try{delete window.Raphael}catch{}}return l},l.st=Xt,o.on("raphael.DOMload",function(){c=!0}),(xe=document).readyState==null&&xe.addEventListener&&(xe.addEventListener("DOMContentLoaded",be=function(){xe.removeEventListener("DOMContentLoaded",be,!1),xe.readyState="complete"},!1),xe.readyState="loading"),function d(){/in/.test(xe.readyState)?setTimeout(d,9):l.eve("raphael.DOMload")}(),l}.apply(i,s))===void 0||(e.exports=a)},function(e,i,r){var s,a;s=[r(0),r(3),r(4)],(a=function(o){return o}.apply(i,s))===void 0||(e.exports=a)},function(e,i,r){var s,a,o,l,c,f,g,p,u,y,x,b,A,P;l="hasOwnProperty",c=/[\.\/]/,f=/\s*,\s*/,g=function(M,D){return M-D},p={n:{}},u=function(){for(var M=0,D=this.length;M<D;M++)if(this[M]!==void 0)return this[M]},y=function(){for(var M=this.length;--M;)if(this[M]!==void 0)return this[M]},x=Object.prototype.toString,b=String,A=Array.isArray||function(M){return M instanceof Array||x.call(M)=="[object Array]"},(P=function(M,D){var z,N=o,F=Array.prototype.slice.call(arguments,2),G=P.listeners(M),H=0,$=[],Y={},K=[],ut=a;K.firstDefined=u,K.lastDefined=y,a=M,o=0;for(var ht=0,pt=G.length;ht<pt;ht++)"zIndex"in G[ht]&&($.push(G[ht].zIndex),G[ht].zIndex<0&&(Y[G[ht].zIndex]=G[ht]));for($.sort(g);$[H]<0;)if(z=Y[$[H++]],K.push(z.apply(D,F)),o)return o=N,K;for(ht=0;ht<pt;ht++)if("zIndex"in(z=G[ht]))if(z.zIndex==$[H]){if(K.push(z.apply(D,F)),o)break;do if((z=Y[$[++H]])&&K.push(z.apply(D,F)),o)break;while(z)}else Y[z.zIndex]=z;else if(K.push(z.apply(D,F)),o)break;return o=N,a=ut,K})._events=p,P.listeners=function(M){var D,z,N,F,G,H,$,Y,K=A(M)?M:M.split(c),ut=p,ht=[ut],pt=[];for(F=0,G=K.length;F<G;F++){for(Y=[],H=0,$=ht.length;H<$;H++)for(z=[(ut=ht[H].n)[K[F]],ut["*"]],N=2;N--;)(D=z[N])&&(Y.push(D),pt=pt.concat(D.f||[]));ht=Y}return pt},P.separator=function(M){M?(M="["+(M=b(M).replace(/(?=[\.\^\]\[\-])/g,"\\"))+"]",c=new RegExp(M)):c=/[\.\/]/},P.on=function(M,D){if(typeof D!="function")return function(){};for(var z=A(M)?A(M[0])?M:[M]:b(M).split(f),N=0,F=z.length;N<F;N++)(function(G){for(var H,$=A(G)?G:b(G).split(c),Y=p,K=0,ut=$.length;K<ut;K++)Y=(Y=Y.n).hasOwnProperty($[K])&&Y[$[K]]||(Y[$[K]]={n:{}});for(Y.f=Y.f||[],K=0,ut=Y.f.length;K<ut;K++)if(Y.f[K]==D){H=!0;break}!H&&Y.f.push(D)})(z[N]);return function(G){+G==+G&&(D.zIndex=+G)}},P.f=function(M){var D=[].slice.call(arguments,1);return function(){P.apply(null,[M,null].concat(D).concat([].slice.call(arguments,0)))}},P.stop=function(){o=1},P.nt=function(M){var D=A(a)?a.join("."):a;return M?new RegExp("(?:\\.|\\/|^)"+M+"(?:\\.|\\/|$)").test(D):D},P.nts=function(){return A(a)?a:a.split(c)},P.off=P.unbind=function(M,D){if(M){var z=A(M)?A(M[0])?M:[M]:b(M).split(f);if(z.length>1)for(var N=0,F=z.length;N<F;N++)P.off(z[N],D);else{z=A(M)?M:b(M).split(c);var G,H,$,Y,K,ut=[p];for(N=0,F=z.length;N<F;N++)for(Y=0;Y<ut.length;Y+=$.length-2){if($=[Y,1],G=ut[Y].n,z[N]!="*")G[z[N]]&&$.push(G[z[N]]);else for(H in G)G[l](H)&&$.push(G[H]);ut.splice.apply(ut,$)}for(N=0,F=ut.length;N<F;N++)for(G=ut[N];G.n;){if(D){if(G.f){for(Y=0,K=G.f.length;Y<K;Y++)if(G.f[Y]==D){G.f.splice(Y,1);break}!G.f.length&&delete G.f}for(H in G.n)if(G.n[l](H)&&G.n[H].f){var ht=G.n[H].f;for(Y=0,K=ht.length;Y<K;Y++)if(ht[Y]==D){ht.splice(Y,1);break}!ht.length&&delete G.n[H].f}}else for(H in delete G.f,G.n)G.n[l](H)&&G.n[H].f&&delete G.n[H].f;G=G.n}}}else P._events=p={n:{}}},P.once=function(M,D){var z=function(){return P.off(M,z),D.apply(this,arguments)};return P.on(M,z)},P.version="0.5.0",P.toString=function(){return"You are running Eve 0.5.0"},e.exports?e.exports=P:(s=function(){return P}.apply(i,[]))===void 0||(e.exports=s)},function(e,i,r){var s,a;s=[r(0)],(a=function(o){if(!o||o.svg){var l="hasOwnProperty",c=String,f=parseFloat,g=parseInt,p=Math,u=p.max,y=p.abs,x=p.pow,b=/[, ]+/,A=o.eve,P="",M=" ",D="http://www.w3.org/1999/xlink",z={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},N={};o.toString=function(){return`Your browser supports SVG.
|
|
20
|
-
You are running Raphaël `+this.version};var F=function(L,k){if(k)for(var E in typeof L=="string"&&(L=F(L)),k)k[l](E)&&(E.substring(0,6)=="xlink:"?L.setAttributeNS(D,E.substring(6),c(k[E])):L.setAttribute(E,c(k[E])));else(L=o._g.doc.createElementNS("http://www.w3.org/2000/svg",L)).style&&(L.style.webkitTapHighlightColor="rgba(0,0,0,0)");return L},G=function(L,k){var E="linear",R=L.id+k,B=.5,X=.5,V=L.node,et=L.paper,Z=V.style,it=o._g.doc.getElementById(R);if(!it){if(k=(k=c(k).replace(o._radial_gradient,function(Mt,Dt,_t){if(E="radial",Dt&&_t){B=f(Dt);var Nt=2*((X=f(_t))>.5)-1;x(B-.5,2)+x(X-.5,2)>.25&&(X=p.sqrt(.25-x(B-.5,2))*Nt+.5)&&X!=.5&&(X=X.toFixed(5)-1e-5*Nt)}return P})).split(/\s*\-\s*/),E=="linear"){var dt=k.shift();if(dt=-f(dt),isNaN(dt))return null;var mt=[0,0,p.cos(o.rad(dt)),p.sin(o.rad(dt))],yt=1/(u(y(mt[2]),y(mt[3]))||1);mt[2]*=yt,mt[3]*=yt,mt[2]<0&&(mt[0]=-mt[2],mt[2]=0),mt[3]<0&&(mt[1]=-mt[3],mt[3]=0)}var At=o._parseDots(k);if(!At)return null;if(R=R.replace(/[\(\)\s,\xb0#]/g,"_"),L.gradient&&R!=L.gradient.id&&(et.defs.removeChild(L.gradient),delete L.gradient),!L.gradient){it=F(E+"Gradient",{id:R}),L.gradient=it,F(it,E=="radial"?{fx:B,fy:X}:{x1:mt[0],y1:mt[1],x2:mt[2],y2:mt[3],gradientTransform:L.matrix.invert()}),et.defs.appendChild(it);for(var xt=0,It=At.length;xt<It;xt++)it.appendChild(F("stop",{offset:At[xt].offset?At[xt].offset:xt?"100%":"0%","stop-color":At[xt].color||"#fff","stop-opacity":isFinite(At[xt].opacity)?At[xt].opacity:1}))}}return F(V,{fill:H(R),opacity:1,"fill-opacity":1}),Z.fill=P,Z.opacity=1,Z.fillOpacity=1,1},H=function(L){if((k=document.documentMode)&&(k===9||k===10))return"url('#"+L+"')";var k,E=document.location;return"url('"+(E.protocol+"//"+E.host+E.pathname+E.search)+"#"+L+"')"},$=function(L){var k=L.getBBox(1);F(L.pattern,{patternTransform:L.matrix.invert()+" translate("+k.x+","+k.y+")"})},Y=function(L,k,E){if(L.type=="path"){for(var R,B,X,V,et,Z=c(k).toLowerCase().split("-"),it=L.paper,dt=E?"end":"start",mt=L.node,yt=L.attrs,At=yt["stroke-width"],xt=Z.length,It="classic",Mt=3,Dt=3,_t=5;xt--;)switch(Z[xt]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":It=Z[xt];break;case"wide":Dt=5;break;case"narrow":Dt=2;break;case"long":Mt=5;break;case"short":Mt=2}if(It=="open"?(Mt+=2,Dt+=2,_t+=2,X=1,V=E?4:1,et={fill:"none",stroke:yt.stroke}):(V=X=Mt/2,et={fill:yt.stroke,stroke:"none"}),L._.arrows?E?(L._.arrows.endPath&&N[L._.arrows.endPath]--,L._.arrows.endMarker&&N[L._.arrows.endMarker]--):(L._.arrows.startPath&&N[L._.arrows.startPath]--,L._.arrows.startMarker&&N[L._.arrows.startMarker]--):L._.arrows={},It!="none"){var Nt="raphael-marker-"+It,Rt="raphael-marker-"+dt+It+Mt+Dt+"-obj"+L.id;o._g.doc.getElementById(Nt)?N[Nt]++:(it.defs.appendChild(F(F("path"),{"stroke-linecap":"round",d:z[It],id:Nt})),N[Nt]=1);var Vt,zt=o._g.doc.getElementById(Rt);zt?(N[Rt]++,Vt=zt.getElementsByTagName("use")[0]):(zt=F(F("marker"),{id:Rt,markerHeight:Dt,markerWidth:Mt,orient:"auto",refX:V,refY:Dt/2}),Vt=F(F("use"),{"xlink:href":"#"+Nt,transform:(E?"rotate(180 "+Mt/2+" "+Dt/2+") ":P)+"scale("+Mt/_t+","+Dt/_t+")","stroke-width":(1/((Mt/_t+Dt/_t)/2)).toFixed(4)}),zt.appendChild(Vt),it.defs.appendChild(zt),N[Rt]=1),F(Vt,et);var ie=X*(It!="diamond"&&It!="oval");E?(R=L._.arrows.startdx*At||0,B=o.getTotalLength(yt.path)-ie*At):(R=ie*At,B=o.getTotalLength(yt.path)-(L._.arrows.enddx*At||0)),(et={})["marker-"+dt]="url(#"+Rt+")",(B||R)&&(et.d=o.getSubpath(yt.path,R,B)),F(mt,et),L._.arrows[dt+"Path"]=Nt,L._.arrows[dt+"Marker"]=Rt,L._.arrows[dt+"dx"]=ie,L._.arrows[dt+"Type"]=It,L._.arrows[dt+"String"]=k}else E?(R=L._.arrows.startdx*At||0,B=o.getTotalLength(yt.path)-R):(R=0,B=o.getTotalLength(yt.path)-(L._.arrows.enddx*At||0)),L._.arrows[dt+"Path"]&&F(mt,{d:o.getSubpath(yt.path,R,B)}),delete L._.arrows[dt+"Path"],delete L._.arrows[dt+"Marker"],delete L._.arrows[dt+"dx"],delete L._.arrows[dt+"Type"],delete L._.arrows[dt+"String"];for(et in N)if(N[l](et)&&!N[et]){var Jt=o._g.doc.getElementById(et);Jt&&Jt.parentNode.removeChild(Jt)}}},K={"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},ut=function(L,k,E){if(k=K[c(k).toLowerCase()]){for(var R=L.attrs["stroke-width"]||"1",B={round:R,square:R,butt:0}[L.attrs["stroke-linecap"]||E["stroke-linecap"]]||0,X=[],V=k.length;V--;)X[V]=k[V]*R+(V%2?1:-1)*B;F(L.node,{"stroke-dasharray":X.join(",")})}else F(L.node,{"stroke-dasharray":"none"})},ht=function(L,k){var E=L.node,R=L.attrs,B=E.style.visibility;for(var X in E.style.visibility="hidden",k)if(k[l](X)){if(!o._availableAttrs[l](X))continue;var V=k[X];switch(R[X]=V,X){case"blur":L.blur(V);break;case"title":var et=E.getElementsByTagName("title");if(et.length&&(et=et[0]))et.firstChild.nodeValue=V;else{et=F("title");var Z=o._g.doc.createTextNode(V);et.appendChild(Z),E.appendChild(et)}break;case"href":case"target":var it=E.parentNode;if(it.tagName.toLowerCase()!="a"){var dt=F("a");it.insertBefore(dt,E),dt.appendChild(E),it=dt}X=="target"?it.setAttributeNS(D,"show",V=="blank"?"new":V):it.setAttributeNS(D,X,V);break;case"cursor":E.style.cursor=V;break;case"transform":L.transform(V);break;case"arrow-start":Y(L,V);break;case"arrow-end":Y(L,V,1);break;case"clip-rect":var mt=c(V).split(b);if(mt.length==4){L.clip&&L.clip.parentNode.parentNode.removeChild(L.clip.parentNode);var yt=F("clipPath"),At=F("rect");yt.id=o.createUUID(),F(At,{x:mt[0],y:mt[1],width:mt[2],height:mt[3]}),yt.appendChild(At),L.paper.defs.appendChild(yt),F(E,{"clip-path":"url(#"+yt.id+")"}),L.clip=At}if(!V){var xt=E.getAttribute("clip-path");if(xt){var It=o._g.doc.getElementById(xt.replace(/(^url\(#|\)$)/g,P));It&&It.parentNode.removeChild(It),F(E,{"clip-path":P}),delete L.clip}}break;case"path":L.type=="path"&&(F(E,{d:V?R.path=o._pathToAbsolute(V):"M0,0"}),L._.dirty=1,L._.arrows&&("startString"in L._.arrows&&Y(L,L._.arrows.startString),"endString"in L._.arrows&&Y(L,L._.arrows.endString,1)));break;case"width":if(E.setAttribute(X,V),L._.dirty=1,!R.fx)break;X="x",V=R.x;case"x":R.fx&&(V=-R.x-(R.width||0));case"rx":if(X=="rx"&&L.type=="rect")break;case"cx":E.setAttribute(X,V),L.pattern&&$(L),L._.dirty=1;break;case"height":if(E.setAttribute(X,V),L._.dirty=1,!R.fy)break;X="y",V=R.y;case"y":R.fy&&(V=-R.y-(R.height||0));case"ry":if(X=="ry"&&L.type=="rect")break;case"cy":E.setAttribute(X,V),L.pattern&&$(L),L._.dirty=1;break;case"r":L.type=="rect"?F(E,{rx:V,ry:V}):E.setAttribute(X,V),L._.dirty=1;break;case"src":L.type=="image"&&E.setAttributeNS(D,"href",V);break;case"stroke-width":L._.sx==1&&L._.sy==1||(V/=u(y(L._.sx),y(L._.sy))||1),E.setAttribute(X,V),R["stroke-dasharray"]&&ut(L,R["stroke-dasharray"],k),L._.arrows&&("startString"in L._.arrows&&Y(L,L._.arrows.startString),"endString"in L._.arrows&&Y(L,L._.arrows.endString,1));break;case"stroke-dasharray":ut(L,V,k);break;case"fill":var Mt=c(V).match(o._ISURL);if(Mt){yt=F("pattern");var Dt=F("image");yt.id=o.createUUID(),F(yt,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),F(Dt,{x:0,y:0,"xlink:href":Mt[1]}),yt.appendChild(Dt),function(zt){o._preload(Mt[1],function(){var ie=this.offsetWidth,Jt=this.offsetHeight;F(zt,{width:ie,height:Jt}),F(Dt,{width:ie,height:Jt})})}(yt),L.paper.defs.appendChild(yt),F(E,{fill:"url(#"+yt.id+")"}),L.pattern=yt,L.pattern&&$(L);break}var _t=o.getRGB(V);if(_t.error){if((L.type=="circle"||L.type=="ellipse"||c(V).charAt()!="r")&&G(L,V)){if("opacity"in R||"fill-opacity"in R){var Nt=o._g.doc.getElementById(E.getAttribute("fill").replace(/^url\(#|\)$/g,P));if(Nt){var Rt=Nt.getElementsByTagName("stop");F(Rt[Rt.length-1],{"stop-opacity":("opacity"in R?R.opacity:1)*("fill-opacity"in R?R["fill-opacity"]:1)})}}R.gradient=V,R.fill="none";break}}else delete k.gradient,delete R.gradient,!o.is(R.opacity,"undefined")&&o.is(k.opacity,"undefined")&&F(E,{opacity:R.opacity}),!o.is(R["fill-opacity"],"undefined")&&o.is(k["fill-opacity"],"undefined")&&F(E,{"fill-opacity":R["fill-opacity"]});_t[l]("opacity")&&F(E,{"fill-opacity":_t.opacity>1?_t.opacity/100:_t.opacity});case"stroke":_t=o.getRGB(V),E.setAttribute(X,_t.hex),X=="stroke"&&_t[l]("opacity")&&F(E,{"stroke-opacity":_t.opacity>1?_t.opacity/100:_t.opacity}),X=="stroke"&&L._.arrows&&("startString"in L._.arrows&&Y(L,L._.arrows.startString),"endString"in L._.arrows&&Y(L,L._.arrows.endString,1));break;case"gradient":(L.type=="circle"||L.type=="ellipse"||c(V).charAt()!="r")&&G(L,V);break;case"opacity":R.gradient&&!R[l]("stroke-opacity")&&F(E,{"stroke-opacity":V>1?V/100:V});case"fill-opacity":if(R.gradient){(Nt=o._g.doc.getElementById(E.getAttribute("fill").replace(/^url\(#|\)$/g,P)))&&(Rt=Nt.getElementsByTagName("stop"),F(Rt[Rt.length-1],{"stop-opacity":V}));break}default:X=="font-size"&&(V=g(V,10)+"px");var Vt=X.replace(/(\-.)/g,function(zt){return zt.substring(1).toUpperCase()});E.style[Vt]=V,L._.dirty=1,E.setAttribute(X,V)}}pt(L,k),E.style.visibility=B},pt=function(L,k){if(L.type=="text"&&(k[l]("text")||k[l]("font")||k[l]("font-size")||k[l]("x")||k[l]("y"))){var E=L.attrs,R=L.node,B=R.firstChild?g(o._g.doc.defaultView.getComputedStyle(R.firstChild,P).getPropertyValue("font-size"),10):10;if(k[l]("text")){for(E.text=k.text;R.firstChild;)R.removeChild(R.firstChild);for(var X,V=c(k.text).split(`
|
|
21
|
-
`),et=[],Z=0,it=V.length;Z<it;Z++)X=F("tspan"),Z&&F(X,{dy:1.2*B,x:E.x}),X.appendChild(o._g.doc.createTextNode(V[Z])),R.appendChild(X),et[Z]=X}else for(Z=0,it=(et=R.getElementsByTagName("tspan")).length;Z<it;Z++)Z?F(et[Z],{dy:1.2*B,x:E.x}):F(et[0],{dy:0});F(R,{x:E.x,y:E.y}),L._.dirty=1;var dt=L._getBBox(),mt=E.y-(dt.y+dt.height/2);mt&&o.is(mt,"finite")&&F(et[0],{dy:mt})}},kt=function(L){return L.parentNode&&L.parentNode.tagName.toLowerCase()==="a"?L.parentNode:L},St=function(L,k){this[0]=this.node=L,L.raphael=!0,this.id=("0000"+(Math.random()*Math.pow(36,5)<<0).toString(36)).slice(-5),L.raphaelid=this.id,this.matrix=o.matrix(),this.realPath=null,this.paper=k,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!k.bottom&&(k.bottom=this),this.prev=k.top,k.top&&(k.top.next=this),k.top=this,this.next=null},vt=o.el;St.prototype=vt,vt.constructor=St,o._engine.path=function(L,k){var E=F("path");k.canvas&&k.canvas.appendChild(E);var R=new St(E,k);return R.type="path",ht(R,{fill:"none",stroke:"#000",path:L}),R},vt.rotate=function(L,k,E){if(this.removed)return this;if((L=c(L).split(b)).length-1&&(k=f(L[1]),E=f(L[2])),L=f(L[0]),E==null&&(k=E),k==null||E==null){var R=this.getBBox(1);k=R.x+R.width/2,E=R.y+R.height/2}return this.transform(this._.transform.concat([["r",L,k,E]])),this},vt.scale=function(L,k,E,R){if(this.removed)return this;if((L=c(L).split(b)).length-1&&(k=f(L[1]),E=f(L[2]),R=f(L[3])),L=f(L[0]),k==null&&(k=L),R==null&&(E=R),E==null||R==null)var B=this.getBBox(1);return E=E??B.x+B.width/2,R=R??B.y+B.height/2,this.transform(this._.transform.concat([["s",L,k,E,R]])),this},vt.translate=function(L,k){return this.removed?this:((L=c(L).split(b)).length-1&&(k=f(L[1])),L=f(L[0])||0,k=+k||0,this.transform(this._.transform.concat([["t",L,k]])),this)},vt.transform=function(L){var k=this._;if(L==null)return k.transform;if(o._extractTransform(this,L),this.clip&&F(this.clip,{transform:this.matrix.invert()}),this.pattern&&$(this),this.node&&F(this.node,{transform:this.matrix}),k.sx!=1||k.sy!=1){var E=this.attrs[l]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":E})}return this},vt.hide=function(){return this.removed||(this.node.style.display="none"),this},vt.show=function(){return this.removed||(this.node.style.display=""),this},vt.remove=function(){var L=kt(this.node);if(!this.removed&&L.parentNode){var k=this.paper;for(var E in k.__set__&&k.__set__.exclude(this),A.unbind("raphael.*.*."+this.id),this.gradient&&k.defs.removeChild(this.gradient),o._tear(this,k),L.parentNode.removeChild(L),this.removeData(),this)this[E]=typeof this[E]=="function"?o._removedFactory(E):null;this.removed=!0}},vt._getBBox=function(){if(this.node.style.display=="none"){this.show();var L=!0}var k,E=!1;this.paper.canvas.parentElement?k=this.paper.canvas.parentElement.style:this.paper.canvas.parentNode&&(k=this.paper.canvas.parentNode.style),k&&k.display=="none"&&(E=!0,k.display="");var R={};try{R=this.node.getBBox()}catch{R={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}finally{R=R||{},E&&(k.display="none")}return L&&this.hide(),R},vt.attr=function(L,k){if(this.removed)return this;if(L==null){var E={};for(var R in this.attrs)this.attrs[l](R)&&(E[R]=this.attrs[R]);return E.gradient&&E.fill=="none"&&(E.fill=E.gradient)&&delete E.gradient,E.transform=this._.transform,E}if(k==null&&o.is(L,"string")){if(L=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;if(L=="transform")return this._.transform;for(var B=L.split(b),X={},V=0,et=B.length;V<et;V++)(L=B[V])in this.attrs?X[L]=this.attrs[L]:o.is(this.paper.customAttributes[L],"function")?X[L]=this.paper.customAttributes[L].def:X[L]=o._availableAttrs[L];return et-1?X:X[B[0]]}if(k==null&&o.is(L,"array")){for(X={},V=0,et=L.length;V<et;V++)X[L[V]]=this.attr(L[V]);return X}if(k!=null){var Z={};Z[L]=k}else L!=null&&o.is(L,"object")&&(Z=L);for(var it in Z)A("raphael.attr."+it+"."+this.id,this,Z[it]);for(it in this.paper.customAttributes)if(this.paper.customAttributes[l](it)&&Z[l](it)&&o.is(this.paper.customAttributes[it],"function")){var dt=this.paper.customAttributes[it].apply(this,[].concat(Z[it]));for(var mt in this.attrs[it]=Z[it],dt)dt[l](mt)&&(Z[mt]=dt[mt])}return ht(this,Z),this},vt.toFront=function(){if(this.removed)return this;var L=kt(this.node);L.parentNode.appendChild(L);var k=this.paper;return k.top!=this&&o._tofront(this,k),this},vt.toBack=function(){if(this.removed)return this;var L=kt(this.node),k=L.parentNode;return k.insertBefore(L,k.firstChild),o._toback(this,this.paper),this.paper,this},vt.insertAfter=function(L){if(this.removed||!L)return this;var k=kt(this.node),E=kt(L.node||L[L.length-1].node);return E.nextSibling?E.parentNode.insertBefore(k,E.nextSibling):E.parentNode.appendChild(k),o._insertafter(this,L,this.paper),this},vt.insertBefore=function(L){if(this.removed||!L)return this;var k=kt(this.node),E=kt(L.node||L[0].node);return E.parentNode.insertBefore(k,E),o._insertbefore(this,L,this.paper),this},vt.blur=function(L){var k=this;if(+L!=0){var E=F("filter"),R=F("feGaussianBlur");k.attrs.blur=L,E.id=o.createUUID(),F(R,{stdDeviation:+L||1.5}),E.appendChild(R),k.paper.defs.appendChild(E),k._blur=E,F(k.node,{filter:"url(#"+E.id+")"})}else k._blur&&(k._blur.parentNode.removeChild(k._blur),delete k._blur,delete k.attrs.blur),k.node.removeAttribute("filter");return k},o._engine.circle=function(L,k,E,R){var B=F("circle");L.canvas&&L.canvas.appendChild(B);var X=new St(B,L);return X.attrs={cx:k,cy:E,r:R,fill:"none",stroke:"#000"},X.type="circle",F(B,X.attrs),X},o._engine.rect=function(L,k,E,R,B,X){var V=F("rect");L.canvas&&L.canvas.appendChild(V);var et=new St(V,L);return et.attrs={x:k,y:E,width:R,height:B,rx:X||0,ry:X||0,fill:"none",stroke:"#000"},et.type="rect",F(V,et.attrs),et},o._engine.ellipse=function(L,k,E,R,B){var X=F("ellipse");L.canvas&&L.canvas.appendChild(X);var V=new St(X,L);return V.attrs={cx:k,cy:E,rx:R,ry:B,fill:"none",stroke:"#000"},V.type="ellipse",F(X,V.attrs),V},o._engine.image=function(L,k,E,R,B,X){var V=F("image");F(V,{x:E,y:R,width:B,height:X,preserveAspectRatio:"none"}),V.setAttributeNS(D,"href",k),L.canvas&&L.canvas.appendChild(V);var et=new St(V,L);return et.attrs={x:E,y:R,width:B,height:X,src:k},et.type="image",et},o._engine.text=function(L,k,E,R){var B=F("text");L.canvas&&L.canvas.appendChild(B);var X=new St(B,L);return X.attrs={x:k,y:E,"text-anchor":"middle",text:R,"font-family":o._availableAttrs["font-family"],"font-size":o._availableAttrs["font-size"],stroke:"none",fill:"#000"},X.type="text",ht(X,X.attrs),X},o._engine.setSize=function(L,k){return this.width=L||this.width,this.height=k||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},o._engine.create=function(){var L=o._getContainer.apply(0,arguments),k=L&&L.container;if(!k)throw new Error("SVG container not found.");var E,R=L.x,B=L.y,X=L.width,V=L.height,et=F("svg"),Z="overflow:hidden;";return R=R||0,B=B||0,F(et,{height:V=V||342,version:1.1,width:X=X||512,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}),k==1?(et.style.cssText=Z+"position:absolute;left:"+R+"px;top:"+B+"px",o._g.doc.body.appendChild(et),E=1):(et.style.cssText=Z+"position:relative",k.firstChild?k.insertBefore(et,k.firstChild):k.appendChild(et)),(k=new o._Paper).width=X,k.height=V,k.canvas=et,k.clear(),k._left=k._top=0,E&&(k.renderfix=function(){}),k.renderfix(),k},o._engine.setViewBox=function(L,k,E,R,B){A("raphael.setViewBox",this,this._viewBox,[L,k,E,R,B]);var X,V,et=this.getSize(),Z=u(E/et.width,R/et.height),it=this.top,dt=B?"xMidYMid meet":"xMinYMin";for(L==null?(this._vbSize&&(Z=1),delete this._vbSize,X="0 0 "+this.width+M+this.height):(this._vbSize=Z,X=L+M+k+M+E+M+R),F(this.canvas,{viewBox:X,preserveAspectRatio:dt});Z&⁢)V="stroke-width"in it.attrs?it.attrs["stroke-width"]:1,it.attr({"stroke-width":V}),it._.dirty=1,it._.dirtyT=1,it=it.prev;return this._viewBox=[L,k,E,R,!!B],this},o.prototype.renderfix=function(){var L,k=this.canvas,E=k.style;try{L=k.getScreenCTM()||k.createSVGMatrix()}catch{L=k.createSVGMatrix()}var R=-L.e%1,B=-L.f%1;(R||B)&&(R&&(this._left=(this._left+R)%1,E.left=this._left+"px"),B&&(this._top=(this._top+B)%1,E.top=this._top+"px"))},o.prototype.clear=function(){o.eve("raphael.clear",this);for(var L=this.canvas;L.firstChild;)L.removeChild(L.firstChild);this.bottom=this.top=null,(this.desc=F("desc")).appendChild(o._g.doc.createTextNode("Created with Raphaël "+o.version)),L.appendChild(this.desc),L.appendChild(this.defs=F("defs"))},o.prototype.remove=function(){for(var L in A("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this)this[L]=typeof this[L]=="function"?o._removedFactory(L):null};var j=o.st;for(var ct in vt)vt[l](ct)&&!j[l](ct)&&(j[ct]=function(L){return function(){var k=arguments;return this.forEach(function(E){E[L].apply(E,k)})}}(ct))}}.apply(i,s))===void 0||(e.exports=a)},function(e,i,r){var s,a;s=[r(0)],(a=function(o){if(!o||o.vml){var l="hasOwnProperty",c=String,f=parseFloat,g=Math,p=g.round,u=g.max,y=g.min,x=g.abs,b=/[, ]+/,A=o.eve,P=" ",M="",D={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},z=/([clmz]),?([^clmz]*)/gi,N=/ progid:\S+Blur\([^\)]+\)/g,F=/-?[^,\s-]+/g,G="position:absolute;left:0;top:0;width:1px;height:1px;behavior:url(#default#VML)",H=21600,$={path:1,rect:1,image:1},Y={circle:1,ellipse:1},K=function(k,E,R){var B=o.matrix();return B.rotate(-k,.5,.5),{dx:B.x(E,R),dy:B.y(E,R)}},ut=function(k,E,R,B,X,V){var et=k._,Z=k.matrix,it=et.fillpos,dt=k.node,mt=dt.style,yt=1,At="",xt=H/E,It=H/R;if(mt.visibility="hidden",E&&R){if(dt.coordsize=x(xt)+P+x(It),mt.rotation=V*(E*R<0?-1:1),V){var Mt=K(V,B,X);B=Mt.dx,X=Mt.dy}if(E<0&&(At+="x"),R<0&&(At+=" y")&&(yt=-1),mt.flip=At,dt.coordorigin=B*-xt+P+X*-It,it||et.fillsize){var Dt=dt.getElementsByTagName("fill");Dt=Dt&&Dt[0],dt.removeChild(Dt),it&&(Mt=K(V,Z.x(it[0],it[1]),Z.y(it[0],it[1])),Dt.position=Mt.dx*yt+P+Mt.dy*yt),et.fillsize&&(Dt.size=et.fillsize[0]*x(E)+P+et.fillsize[1]*x(R)),dt.appendChild(Dt)}mt.visibility="visible"}};o.toString=function(){return`Your browser doesn’t support SVG. Falling down to VML.
|
|
22
|
-
You are running Raphaël `+this.version};var ht,pt=function(k,E,R){for(var B=c(E).toLowerCase().split("-"),X=R?"end":"start",V=B.length,et="classic",Z="medium",it="medium";V--;)switch(B[V]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":et=B[V];break;case"wide":case"narrow":it=B[V];break;case"long":case"short":Z=B[V]}var dt=k.node.getElementsByTagName("stroke")[0];dt[X+"arrow"]=et,dt[X+"arrowlength"]=Z,dt[X+"arrowwidth"]=it},kt=function(k,E){k.attrs=k.attrs||{};var R=k.node,B=k.attrs,X=R.style,V=$[k.type]&&(E.x!=B.x||E.y!=B.y||E.width!=B.width||E.height!=B.height||E.cx!=B.cx||E.cy!=B.cy||E.rx!=B.rx||E.ry!=B.ry||E.r!=B.r),et=Y[k.type]&&(B.cx!=E.cx||B.cy!=E.cy||B.r!=E.r||B.rx!=E.rx||B.ry!=E.ry),Z=k;for(var it in E)E[l](it)&&(B[it]=E[it]);if(V&&(B.path=o._getPath[k.type](k),k._.dirty=1),E.href&&(R.href=E.href),E.title&&(R.title=E.title),E.target&&(R.target=E.target),E.cursor&&(X.cursor=E.cursor),"blur"in E&&k.blur(E.blur),(E.path&&k.type=="path"||V)&&(R.path=function($t){var Re=/[ahqstv]/gi,dn=o._pathToAbsolute;if(c($t).match(Re)&&(dn=o._path2curve),Re=/[clmz]/g,dn==o._pathToAbsolute&&!c($t).match(Re)){var ae=c($t).replace(z,function(Pr,gn,Ze){var Oe=[],ti=gn.toLowerCase()=="m",$e=D[gn];return Ze.replace(F,function(qe){ti&&Oe.length==2&&($e+=Oe+D[gn=="m"?"l":"L"],Oe=[]),Oe.push(p(qe*H))}),$e+Oe});return ae}var Ee,de,In=dn($t);ae=[];for(var Ye=0,pn=In.length;Ye<pn;Ye++){Ee=In[Ye],(de=In[Ye][0].toLowerCase())=="z"&&(de="x");for(var we=1,Qt=Ee.length;we<Qt;we++)de+=p(Ee[we]*H)+(we!=Qt-1?",":M);ae.push(de)}return ae.join(P)}(~c(B.path).toLowerCase().indexOf("r")?o._pathToAbsolute(B.path):B.path),k._.dirty=1,k.type=="image"&&(k._.fillpos=[B.x,B.y],k._.fillsize=[B.width,B.height],ut(k,1,1,0,0,0))),"transform"in E&&k.transform(E.transform),et){var dt=+B.cx,mt=+B.cy,yt=+B.rx||+B.r||0,At=+B.ry||+B.r||0;R.path=o.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",p((dt-yt)*H),p((mt-At)*H),p((dt+yt)*H),p((mt+At)*H),p(dt*H)),k._.dirty=1}if("clip-rect"in E){var xt=c(E["clip-rect"]).split(b);if(xt.length==4){xt[2]=+xt[2]+ +xt[0],xt[3]=+xt[3]+ +xt[1];var It=R.clipRect||o._g.doc.createElement("div"),Mt=It.style;Mt.clip=o.format("rect({1}px {2}px {3}px {0}px)",xt),R.clipRect||(Mt.position="absolute",Mt.top=0,Mt.left=0,Mt.width=k.paper.width+"px",Mt.height=k.paper.height+"px",R.parentNode.insertBefore(It,R),It.appendChild(R),R.clipRect=It)}E["clip-rect"]||R.clipRect&&(R.clipRect.style.clip="auto")}if(k.textpath){var Dt=k.textpath.style;E.font&&(Dt.font=E.font),E["font-family"]&&(Dt.fontFamily='"'+E["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,M)+'"'),E["font-size"]&&(Dt.fontSize=E["font-size"]),E["font-weight"]&&(Dt.fontWeight=E["font-weight"]),E["font-style"]&&(Dt.fontStyle=E["font-style"])}if("arrow-start"in E&&pt(Z,E["arrow-start"]),"arrow-end"in E&&pt(Z,E["arrow-end"],1),E.opacity!=null||E.fill!=null||E.src!=null||E.stroke!=null||E["stroke-width"]!=null||E["stroke-opacity"]!=null||E["fill-opacity"]!=null||E["stroke-dasharray"]!=null||E["stroke-miterlimit"]!=null||E["stroke-linejoin"]!=null||E["stroke-linecap"]!=null){var _t=R.getElementsByTagName("fill");if(!(_t=_t&&_t[0])&&(_t=ht("fill")),k.type=="image"&&E.src&&(_t.src=E.src),E.fill&&(_t.on=!0),_t.on!=null&&E.fill!="none"&&E.fill!==null||(_t.on=!1),_t.on&&E.fill){var Nt=c(E.fill).match(o._ISURL);if(Nt){_t.parentNode==R&&R.removeChild(_t),_t.rotate=!0,_t.src=Nt[1],_t.type="tile";var Rt=k.getBBox(1);_t.position=Rt.x+P+Rt.y,k._.fillpos=[Rt.x,Rt.y],o._preload(Nt[1],function(){k._.fillsize=[this.offsetWidth,this.offsetHeight]})}else _t.color=o.getRGB(E.fill).hex,_t.src=M,_t.type="solid",o.getRGB(E.fill).error&&(Z.type in{circle:1,ellipse:1}||c(E.fill).charAt()!="r")&&St(Z,E.fill,_t)&&(B.fill="none",B.gradient=E.fill,_t.rotate=!1)}if("fill-opacity"in E||"opacity"in E){var Vt=((+B["fill-opacity"]+1||2)-1)*((+B.opacity+1||2)-1)*((+o.getRGB(E.fill).o+1||2)-1);Vt=y(u(Vt,0),1),_t.opacity=Vt,_t.src&&(_t.color="none")}R.appendChild(_t);var zt=R.getElementsByTagName("stroke")&&R.getElementsByTagName("stroke")[0],ie=!1;!zt&&(ie=zt=ht("stroke")),(E.stroke&&E.stroke!="none"||E["stroke-width"]||E["stroke-opacity"]!=null||E["stroke-dasharray"]||E["stroke-miterlimit"]||E["stroke-linejoin"]||E["stroke-linecap"])&&(zt.on=!0),(E.stroke=="none"||E.stroke===null||zt.on==null||E.stroke==0||E["stroke-width"]==0)&&(zt.on=!1);var Jt=o.getRGB(E.stroke);zt.on&&E.stroke&&(zt.color=Jt.hex),Vt=((+B["stroke-opacity"]+1||2)-1)*((+B.opacity+1||2)-1)*((+Jt.o+1||2)-1);var Me=.75*(f(E["stroke-width"])||1);if(Vt=y(u(Vt,0),1),E["stroke-width"]==null&&(Me=B["stroke-width"]),E["stroke-width"]&&(zt.weight=Me),Me&&Me<1&&(Vt*=Me)&&(zt.weight=1),zt.opacity=Vt,E["stroke-linejoin"]&&(zt.joinstyle=E["stroke-linejoin"]||"miter"),zt.miterlimit=E["stroke-miterlimit"]||8,E["stroke-linecap"]&&(zt.endcap=E["stroke-linecap"]=="butt"?"flat":E["stroke-linecap"]=="square"?"square":"round"),"stroke-dasharray"in E){var un={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};zt.dashstyle=un[l](E["stroke-dasharray"])?un[E["stroke-dasharray"]]:M}ie&&R.appendChild(zt)}if(Z.type=="text"){Z.paper.canvas.style.display=M;var Ce=Z.paper.span,Ve=B.font&&B.font.match(/\d+(?:\.\d*)?(?=px)/);X=Ce.style,B.font&&(X.font=B.font),B["font-family"]&&(X.fontFamily=B["font-family"]),B["font-weight"]&&(X.fontWeight=B["font-weight"]),B["font-style"]&&(X.fontStyle=B["font-style"]),Ve=f(B["font-size"]||Ve&&Ve[0])||10,X.fontSize=100*Ve+"px",Z.textpath.string&&(Ce.innerHTML=c(Z.textpath.string).replace(/</g,"<").replace(/&/g,"&").replace(/\n/g,"<br>"));var Xe=Ce.getBoundingClientRect();Z.W=B.w=(Xe.right-Xe.left)/100,Z.H=B.h=(Xe.bottom-Xe.top)/100,Z.X=B.x,Z.Y=B.y+Z.H/2,("x"in E||"y"in E)&&(Z.path.v=o.format("m{0},{1}l{2},{1}",p(B.x*H),p(B.y*H),p(B.x*H)+1));for(var Le=["x","y","text","font","font-family","font-weight","font-style","font-size"],De=0,Qn=Le.length;De<Qn;De++)if(Le[De]in E){Z._.dirty=1;break}switch(B["text-anchor"]){case"start":Z.textpath.style["v-text-align"]="left",Z.bbx=Z.W/2;break;case"end":Z.textpath.style["v-text-align"]="right",Z.bbx=-Z.W/2;break;default:Z.textpath.style["v-text-align"]="center",Z.bbx=0}Z.textpath.style["v-text-kern"]=!0}},St=function(k,E,R){k.attrs=k.attrs||{},k.attrs;var B=Math.pow,X="linear",V=".5 .5";if(k.attrs.gradient=E,E=(E=c(E).replace(o._radial_gradient,function(yt,At,xt){return X="radial",At&&xt&&(At=f(At),xt=f(xt),B(At-.5,2)+B(xt-.5,2)>.25&&(xt=g.sqrt(.25-B(At-.5,2))*(2*(xt>.5)-1)+.5),V=At+P+xt),M})).split(/\s*\-\s*/),X=="linear"){var et=E.shift();if(et=-f(et),isNaN(et))return null}var Z=o._parseDots(E);if(!Z)return null;if(k=k.shape||k.node,Z.length){k.removeChild(R),R.on=!0,R.method="none",R.color=Z[0].color,R.color2=Z[Z.length-1].color;for(var it=[],dt=0,mt=Z.length;dt<mt;dt++)Z[dt].offset&&it.push(Z[dt].offset+P+Z[dt].color);R.colors=it.length?it.join():"0% "+R.color,X=="radial"?(R.type="gradientTitle",R.focus="100%",R.focussize="0 0",R.focusposition=V,R.angle=0):(R.type="gradient",R.angle=(270-et)%360),k.appendChild(R)}return 1},vt=function(k,E){this[0]=this.node=k,k.raphael=!0,this.id=o._oid++,k.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=E,this.matrix=o.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!E.bottom&&(E.bottom=this),this.prev=E.top,E.top&&(E.top.next=this),E.top=this,this.next=null},j=o.el;vt.prototype=j,j.constructor=vt,j.transform=function(k){if(k==null)return this._.transform;var E,R=this.paper._viewBoxShift,B=R?"s"+[R.scale,R.scale]+"-1-1t"+[R.dx,R.dy]:M;R&&(E=k=c(k).replace(/\.{3}|\u2026/g,this._.transform||M)),o._extractTransform(this,B+k);var X,V=this.matrix.clone(),et=this.skew,Z=this.node,it=~c(this.attrs.fill).indexOf("-"),dt=!c(this.attrs.fill).indexOf("url(");if(V.translate(1,1),dt||it||this.type=="image")if(et.matrix="1 0 0 1",et.offset="0 0",X=V.split(),it&&X.noRotation||!X.isSimple){Z.style.filter=V.toFilter();var mt=this.getBBox(),yt=this.getBBox(1),At=mt.x-yt.x,xt=mt.y-yt.y;Z.coordorigin=At*-H+P+xt*-H,ut(this,1,1,At,xt,0)}else Z.style.filter=M,ut(this,X.scalex,X.scaley,X.dx,X.dy,X.rotate);else Z.style.filter=M,et.matrix=c(V),et.offset=V.offset();return E!==null&&(this._.transform=E,o._extractTransform(this,E)),this},j.rotate=function(k,E,R){if(this.removed)return this;if(k!=null){if((k=c(k).split(b)).length-1&&(E=f(k[1]),R=f(k[2])),k=f(k[0]),R==null&&(E=R),E==null||R==null){var B=this.getBBox(1);E=B.x+B.width/2,R=B.y+B.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",k,E,R]])),this}},j.translate=function(k,E){return this.removed?this:((k=c(k).split(b)).length-1&&(E=f(k[1])),k=f(k[0])||0,E=+E||0,this._.bbox&&(this._.bbox.x+=k,this._.bbox.y+=E),this.transform(this._.transform.concat([["t",k,E]])),this)},j.scale=function(k,E,R,B){if(this.removed)return this;if((k=c(k).split(b)).length-1&&(E=f(k[1]),R=f(k[2]),B=f(k[3]),isNaN(R)&&(R=null),isNaN(B)&&(B=null)),k=f(k[0]),E==null&&(E=k),B==null&&(R=B),R==null||B==null)var X=this.getBBox(1);return R=R??X.x+X.width/2,B=B??X.y+X.height/2,this.transform(this._.transform.concat([["s",k,E,R,B]])),this._.dirtyT=1,this},j.hide=function(){return!this.removed&&(this.node.style.display="none"),this},j.show=function(){return!this.removed&&(this.node.style.display=M),this},j.auxGetBBox=o.el.getBBox,j.getBBox=function(){var k=this.auxGetBBox();if(this.paper&&this.paper._viewBoxShift){var E={},R=1/this.paper._viewBoxShift.scale;return E.x=k.x-this.paper._viewBoxShift.dx,E.x*=R,E.y=k.y-this.paper._viewBoxShift.dy,E.y*=R,E.width=k.width*R,E.height=k.height*R,E.x2=E.x+E.width,E.y2=E.y+E.height,E}return k},j._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},j.remove=function(){if(!this.removed&&this.node.parentNode){for(var k in this.paper.__set__&&this.paper.__set__.exclude(this),o.eve.unbind("raphael.*.*."+this.id),o._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape),this)this[k]=typeof this[k]=="function"?o._removedFactory(k):null;this.removed=!0}},j.attr=function(k,E){if(this.removed)return this;if(k==null){var R={};for(var B in this.attrs)this.attrs[l](B)&&(R[B]=this.attrs[B]);return R.gradient&&R.fill=="none"&&(R.fill=R.gradient)&&delete R.gradient,R.transform=this._.transform,R}if(E==null&&o.is(k,"string")){if(k=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;for(var X=k.split(b),V={},et=0,Z=X.length;et<Z;et++)(k=X[et])in this.attrs?V[k]=this.attrs[k]:o.is(this.paper.customAttributes[k],"function")?V[k]=this.paper.customAttributes[k].def:V[k]=o._availableAttrs[k];return Z-1?V:V[X[0]]}if(this.attrs&&E==null&&o.is(k,"array")){for(V={},et=0,Z=k.length;et<Z;et++)V[k[et]]=this.attr(k[et]);return V}var it;for(var dt in E!=null&&((it={})[k]=E),E==null&&o.is(k,"object")&&(it=k),it)A("raphael.attr."+dt+"."+this.id,this,it[dt]);if(it){for(dt in this.paper.customAttributes)if(this.paper.customAttributes[l](dt)&&it[l](dt)&&o.is(this.paper.customAttributes[dt],"function")){var mt=this.paper.customAttributes[dt].apply(this,[].concat(it[dt]));for(var yt in this.attrs[dt]=it[dt],mt)mt[l](yt)&&(it[yt]=mt[yt])}it.text&&this.type=="text"&&(this.textpath.string=it.text),kt(this,it)}return this},j.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&o._tofront(this,this.paper),this},j.toBack=function(){return this.removed?this:(this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),o._toback(this,this.paper)),this)},j.insertAfter=function(k){return this.removed?this:(k.constructor==o.st.constructor&&(k=k[k.length-1]),k.node.nextSibling?k.node.parentNode.insertBefore(this.node,k.node.nextSibling):k.node.parentNode.appendChild(this.node),o._insertafter(this,k,this.paper),this)},j.insertBefore=function(k){return this.removed?this:(k.constructor==o.st.constructor&&(k=k[0]),k.node.parentNode.insertBefore(this.node,k.node),o._insertbefore(this,k,this.paper),this)},j.blur=function(k){var E=this.node.runtimeStyle,R=E.filter;return R=R.replace(N,M),+k!=0?(this.attrs.blur=k,E.filter=R+P+" progid:DXImageTransform.Microsoft.Blur(pixelradius="+(+k||1.5)+")",E.margin=o.format("-{0}px 0 0 -{0}px",p(+k||1.5))):(E.filter=R,E.margin=0,delete this.attrs.blur),this},o._engine.path=function(k,E){var R=ht("shape");R.style.cssText=G,R.coordsize=H+P+H,R.coordorigin=E.coordorigin;var B=new vt(R,E),X={fill:"none",stroke:"#000"};k&&(X.path=k),B.type="path",B.path=[],B.Path=M,kt(B,X),E.canvas&&E.canvas.appendChild(R);var V=ht("skew");return V.on=!0,R.appendChild(V),B.skew=V,B.transform(M),B},o._engine.rect=function(k,E,R,B,X,V){var et=o._rectPath(E,R,B,X,V),Z=k.path(et),it=Z.attrs;return Z.X=it.x=E,Z.Y=it.y=R,Z.W=it.width=B,Z.H=it.height=X,it.r=V,it.path=et,Z.type="rect",Z},o._engine.ellipse=function(k,E,R,B,X){var V=k.path();return V.attrs,V.X=E-B,V.Y=R-X,V.W=2*B,V.H=2*X,V.type="ellipse",kt(V,{cx:E,cy:R,rx:B,ry:X}),V},o._engine.circle=function(k,E,R,B){var X=k.path();return X.attrs,X.X=E-B,X.Y=R-B,X.W=X.H=2*B,X.type="circle",kt(X,{cx:E,cy:R,r:B}),X},o._engine.image=function(k,E,R,B,X,V){var et=o._rectPath(R,B,X,V),Z=k.path(et).attr({stroke:"none"}),it=Z.attrs,dt=Z.node,mt=dt.getElementsByTagName("fill")[0];return it.src=E,Z.X=it.x=R,Z.Y=it.y=B,Z.W=it.width=X,Z.H=it.height=V,it.path=et,Z.type="image",mt.parentNode==dt&&dt.removeChild(mt),mt.rotate=!0,mt.src=E,mt.type="tile",Z._.fillpos=[R,B],Z._.fillsize=[X,V],dt.appendChild(mt),ut(Z,1,1,0,0,0),Z},o._engine.text=function(k,E,R,B){var X=ht("shape"),V=ht("path"),et=ht("textpath");E=E||0,R=R||0,B=B||"",V.v=o.format("m{0},{1}l{2},{1}",p(E*H),p(R*H),p(E*H)+1),V.textpathok=!0,et.string=c(B),et.on=!0,X.style.cssText=G,X.coordsize=H+P+H,X.coordorigin="0 0";var Z=new vt(X,k),it={fill:"#000",stroke:"none",font:o._availableAttrs.font,text:B};Z.shape=X,Z.path=V,Z.textpath=et,Z.type="text",Z.attrs.text=c(B),Z.attrs.x=E,Z.attrs.y=R,Z.attrs.w=1,Z.attrs.h=1,kt(Z,it),X.appendChild(et),X.appendChild(V),k.canvas.appendChild(X);var dt=ht("skew");return dt.on=!0,X.appendChild(dt),Z.skew=dt,Z.transform(M),Z},o._engine.setSize=function(k,E){var R=this.canvas.style;return this.width=k,this.height=E,k==+k&&(k+="px"),E==+E&&(E+="px"),R.width=k,R.height=E,R.clip="rect(0 "+k+" "+E+" 0)",this._viewBox&&o._engine.setViewBox.apply(this,this._viewBox),this},o._engine.setViewBox=function(k,E,R,B,X){o.eve("raphael.setViewBox",this,this._viewBox,[k,E,R,B,X]);var V,et,Z=this.getSize(),it=Z.width,dt=Z.height;return X&&(R*(V=dt/B)<it&&(k-=(it-R*V)/2/V),B*(et=it/R)<dt&&(E-=(dt-B*et)/2/et)),this._viewBox=[k,E,R,B,!!X],this._viewBoxShift={dx:-k,dy:-E,scale:Z},this.forEach(function(mt){mt.transform("...")}),this},o._engine.initWin=function(k){var E=k.document;E.styleSheets.length<31?E.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"):E.styleSheets[0].addRule(".rvml","behavior:url(#default#VML)");try{!E.namespaces.rvml&&E.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),ht=function(R){return E.createElement("<rvml:"+R+' class="rvml">')}}catch{ht=function(B){return E.createElement("<"+B+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},o._engine.initWin(o._g.win),o._engine.create=function(){var k=o._getContainer.apply(0,arguments),E=k.container,R=k.height,B=k.width,X=k.x,V=k.y;if(!E)throw new Error("VML container not found.");var et=new o._Paper,Z=et.canvas=o._g.doc.createElement("div"),it=Z.style;return X=X||0,V=V||0,B=B||512,R=R||342,et.width=B,et.height=R,B==+B&&(B+="px"),R==+R&&(R+="px"),et.coordsize=216e5+P+216e5,et.coordorigin="0 0",et.span=o._g.doc.createElement("span"),et.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",Z.appendChild(et.span),it.cssText=o.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",B,R),E==1?(o._g.doc.body.appendChild(Z),it.left=X+"px",it.top=V+"px",it.position="absolute"):E.firstChild?E.insertBefore(Z,E.firstChild):E.appendChild(Z),et.renderfix=function(){},et},o.prototype.clear=function(){o.eve("raphael.clear",this),this.canvas.innerHTML=M,this.span=o._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},o.prototype.remove=function(){for(var k in o.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas),this)this[k]=typeof this[k]=="function"?o._removedFactory(k):null;return!0};var ct=o.st;for(var L in j)j[l](L)&&!ct[l](L)&&(ct[L]=function(k){return function(){var E=arguments;return this.forEach(function(R){R[k].apply(R,E)})}}(L))}}.apply(i,s))===void 0||(e.exports=a)}])})})(go);var Fh=go.exports;const Kt=Yi(Fh);class vi{points;constructor(t=[]){this.points=t}toSVGPathData(){const t=[];for(let e=0,i=this.length;e<i;e++)t.push([e===0?"M":"L",this.points[e].x,this.points[e].y]);return t}toSVGPathD(){let t="";for(let e=0,i=this.length;e<i;e++)t+=(e===0?"M":"L")+this.points[e].x+","+this.points[e].y;return t}get length(){return this.points.length}addPoint(t){this.points.push(t)}getPoint(t){return this.points[t]}isContainPoint(t){const e=t.x,i=t.y,r=this.length;let s=!1;const a=2e-10;for(let o=0,l=r-1;o<r;l=o,o++){const c=this.points[o].x,f=this.points[o].y,g=this.points[l].x,p=this.points[l].y;if(c===e&&f===i||g===e&&p===i||i===f&&i===p)return!0;if(i>=f&&i<p||i<f&&i>=p){const u=(g-c)/(p-f),y=c+u*(i-f);if(y===e||Math.abs(y-e)<a)return!0;y>e&&(s=!s)}}return s}[Symbol.iterator](){let t=0;return{next:()=>({value:t>=this.length-1?this.points[++t]:void 0,done:t>=this.length})}}static generateInMultiplePoint(t,e,i,r,s=1){const a=new vi;for(let o=0;o<=s*i;o+=1){const l=Math.floor(o/s)/i*2*Math.PI,c=t+Math.cos(l)*r,f=e+Math.sin(l)*r;a.addPoint(new Te({x:c,y:f}))}return a}}Kt.easing_formulas.swing=function(n){return n+Math.sin(n*Math.PI*2)/2},Kt.easing_formulas.may_cause_seizures=function(n){return n+.2*Math.random()-.1};function zh(n,t,e){let i;return n&&typeof n=="object"&&n.canvas?i=n:n&&(typeof n=="string"||n instanceof HTMLElement)?i=Kt(n,t,e):i=Kt(0,0,t,e),i}Kt.fn.importSVG=function(n,t){const e=Uh.fromRawSVG(n);return e.toRaphael(this,(i,r)=>{e.save(),t&&t(i),r(),e.restore()}),this},Kt.fn.NPolygonPath=function(n,t,e,i,r=2){return{shape:this.path(vi.generateInMultiplePoint(n,t,e,i,r).toSVGPathD()),afterPath:vi.generateInMultiplePoint(n,t,e*r,i,1).toSVGPathD()}},Kt.fn.zoom=function(n=1){return this.setViewBox(0,0,this.width/n,this.height/n),this},Kt.fn.brickwall=function(n,t,e,i,r){for(var s=i/r,a=e/3,o={fill:"firebrick",stroke:"#CCC"},l=0;l<r;l+=1){var c=this.rect(0,0,a,s).attr(o),f=this.rect(0,0,2*a,s).attr(o);l%2?(c.transform("T"+n+","+(t+l*s)),f.transform("T"+(n+a)+","+(t+l*s))):(f.transform("T"+n+","+(t+l*s)),c.transform("T"+(n+2*a)+","+(t+l*s)))}},Kt.fn.rosetta=function(n,t,e,i,r){const s=xn.generateRosetta(n,t,e,i,r);return s.center,this.path(s.toSVGPathD())},Kt.fn.moon=function(n){n=n||{},n.r=typeof n.r=="number"?n.r:100,n.phase=typeof n.phase=="number"?n.phase:.25,n.x=typeof n.x=="number"?n.x:0,n.y=typeof n.y=="number"?n.y:0,this.circle(n.r+n.x,n.r+n.y,n.r).attr({"stroke-width":0,fill:"#999"});function t(i){i=typeof i=="number"?i:.25,i=Math.max(0,Math.min(1,i)),i=(i-.5)*2;let r="M"+n.r+",0";r+="a"+n.r+","+n.r+" 0 0,0 0,"+n.r*2;let s=i>0?0:1;return i=Math.abs(i),i=i||1e-4,n.inner_r=n.r/Math.pow(i,.5),r+="M"+n.r+","+n.r*2,r+="a"+n.inner_r+","+n.inner_r+" 0 0,"+s+" 0,"+n.r*-2,r}var e=this.path(t(n.phase)).attr({"stroke-width":0,stroke:"#999",fill:"#FF9"}).transform("T"+n.x+","+n.y);return{setPhase:function(i){e.attr("path",t(i))}}},Kt.fn.star=function(n,t,e){let i="M"+n+","+(t-e);for(var r=0;r<6;r+=1){const s=270+r*144,a=n+e*Math.cos(s*Math.PI/180),o=t+e*Math.sin(s*Math.PI/180);i+="L"+a+","+o}return this.path(i).attr("stroke-width",0).attr("fill","red")},Kt.fn.heart=function(n=150,t=300){let e="M"+n+","+t;return e+="l120,-175a50,50 0 0,0 -120,-75a50,50 0 0,0 -120,75l120,175",this.path(e).attr("stroke","red").attr("fill","pink")},Kt.el.redder=function(){const n=Kt.getRGB(this.attr("fill"));n.r+=51,this.attr("fill","rgb("+n.r+","+n.g+","+n.b+")")},Kt.installCustomAttributes=function(n){n.customAttributes.redness=function(t){const e=255*(1-t/100);return{fill:"rgb(255,"+e+", "+e+")"}},n.customAttributes.progress=function(t){const e=this.data("progresspath"),i=this.attr(),r={x:0,y:0},s=this.data("progresstrail");if(!e)return{transform:"t0,0"};Object.prototype.hasOwnProperty.call(i,"width")&&(r.x=-this.attr("width")/2,r.y=-this.attr("height")/2);const a=e.getTotalLength(),o=e.getPointAtLength(t*a);return s&&s.attr("path",e.getSubpath(0,t*a)),{transform:"t"+(o.x+r.x)+","+(o.y+r.y)+"r"+o.alpha}}};const gs=Kt;class nn{pgs=[];history=[];save(){this.history.push(fa(this.pgs))}restore(){const t=this.history.pop();t&&(this.pgs=t)}get size(){let t=0,e=0;return this.pgs.forEach(i=>{const r=i.pg;if(r){const[s,a,o,l]=r.bounds,[c,f]=r.size;t=Math.max(t,s,s+c,o),e=Math.max(e,a,a+f,l)}}),[Math.ceil(t),Math.ceil(e)]}static fromRawSVG(t){return nn.fromRawSVGUseRappar(t)}static fromRawSVGUseRappar(t){const e=new nn,i=Ja(t);for(let r=0,s=i.length;r<s;r++){const a=i[r];if(a.type=="viewbox"&&a.width&&a.height)continue;const o={attrs:{}};for(const l in a)l==="type"||l==="path"||l==="transform"||(o.attrs[l]=a[l]);switch(a.type){case"path":o.d=a.path,o.pg=xn.fromSVGPathD(a.path,a.transform);break}e.pgs.push(o)}return e}toRaphael(t,e){let i;t instanceof HTMLElement?i=gs(HTMLElement):typeof t=="string"?i=gs(document.getElementById(t)):i=t;const[r,s]=this.size;i.setSize(r,s);const a=(o=!1)=>{for(let l=0,c=this.pgs.length;l<c;l++){const f=this.pgs[l];if(f.pg&&(f.raphaelPath?f.raphaelPath.attr("path",f.pg.toSVGPathD()):f.raphaelPath=i.path(f.pg.toSVGPathD()),f.raphaelPath.attr(f.attrs)),o&&e){const g=p=>{const{x:u,y}=Ji(i.canvas,p),x=this.pgs.find(b=>b.raphaelPath?.isPointInside(u,y));x&&e?.(x,a)};f.raphaelPath?.unclick(g),f.raphaelPath?.click(g)}}};return a(!0),i}toCanvasOperation(t,e){let i;typeof t=="string"?i=document.getElementById(t):i=t;const[r,s]=this.size;i.width=r,i.height=s;const a=new ms(i),o=()=>{a.clearRect(0,0,r,s);for(let c=0,f=this.pgs.length;c<f;c++){const g=this.pgs[c];g.pg&&(a.save(),this.toCanvasAttrs(a,g.attrs),g.pg.toCanvas(a),g.attrs.stroke!=="none"&&a.stroke(),g.attrs.fill!=="none"&&a.fill(),a.restore())}};o();const l=c=>{const{x:f,y:g}=Ji(a.canvas,c),p=this.pgs.find(u=>u.pg?.isPointInPath(f,g));p&&e?.(p,o)};return i.removeEventListener("click",l),i.addEventListener("click",l),a}toCanvasAttrs(t,e){for(const i in e){const r=e[i];switch(i){case"fill":t.fillStyle=String(r);break;case"stroke":t.strokeStyle=String(r);break;case"stroke-width":t.lineWidth=Number(r);break;case"stroke-linecap":t.lineCap=r;break;case"stroke-linejoin":t.lineJoin=r;break}}}static toDownloadSVGElement(t,e="shape"){Xr(ka(t),`${e}.svg`)}toDownloadSVGElement(t,e="shape"){return nn.toDownloadSVGElement(t,e),this}static toDownloadSVGString(t,e="shape"){Xr(Vr(t),`${e}.svg`)}toDownloadSVGString(t,e="shape"){return nn.toDownloadSVGString(t,e),this}static getSVGDOM(t){if(t instanceof HTMLObjectElement||t instanceof HTMLIFrameElement)return t.contentDocument;if(t instanceof HTMLEmbedElement)return t.getSVGDocument()}}const Uh=nn;class ms{canvas;context;customContext;constructor(t){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),this.customContext=new pi({canvas:this.canvas,width:this.canvas.width,height:this.canvas.height})}set lineWidth(t){this.context.lineWidth=t,this.customContext.lineWidth=t}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.context.lineCap=t,this.customContext.lineCap=t}get lineCap(){return this.context.lineCap}set lineJoin(t){this.context.lineJoin=t,this.customContext.lineCap=t}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.context.lineDashOffset=t,this.customContext.lineDashOffset=t}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.context.miterLimit=t,this.customContext.miterLimit=t}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext.globalAlpha=t}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext.fillStyle=t):(this.context.fillStyle=t.gradient,this.customContext.fillStyle=t.gradientCustom)}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext.strokeStyle=t):(this.context.strokeStyle=t.gradient,this.customContext.strokeStyle=t.gradientCustom)}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext.font=t}get font(){return this.context.font}fill(){return this.context.fill(),this.customContext.fill(),this}fillRect(t,e,i,r){return this.context.fillRect(t,e,i,r),this.customContext.fillRect(t,e,i,r),this}fillText(t,e,i,r){return this.context.fillText(t,e,i,r),this.customContext.fillText(t,e,i),this}setLineDash(t){return this.context.setLineDash(t),this.customContext.setLineDash(t),this}stroke(){return this.context.stroke(),this.customContext.stroke(),this}strokeText(t,e,i,r){return this.context.strokeText(t,e,i,r),this.customContext.strokeText(t,e,i),this}strokeRect(t,e,i,r){return this.context.strokeRect(t,e,i,r),this.customContext.strokeRect(t,e,i,r),this}clearRect(t=0,e=0,i=this.canvas.width,r=this.canvas.height){return this.context.clearRect(t,e,i,r),this.customContext.clearRect(t,e,i,r),this}save(){return this.context.save(),this.customContext.save(),this}restore(){return this.context.restore(),this.customContext.restore(),this}beginPath(){return this.context.beginPath(),this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext.closePath(),this}isPointInPath(t,e){return this.context.isPointInPath(t,e)}moveTo(t,e){return this.context.moveTo(t,e),this.customContext.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext.lineTo(t,e),this}arc(t,e,i,r,s,a){return this.context.arc(t,e,i,r,s,a),this.customContext.arc(t,e,i,r,s,a?-1:1),this}arcTo(t,e,i,r,s){return this.context.arcTo(t,e,i,r,s),this.customContext.arcTo(t,e,i,r,s),this}quadraticCurveTo(t,e,i,r){return this.context.quadraticCurveTo(t,e,i,r),this.customContext.quadraticCurveTo(t,e,i,r),this}bezierCurveTo(t,e,i,r,s,a){return this.context.bezierCurveTo(t,e,i,r,s,a),this.customContext.bezierCurveTo(t,e,i,r,s,a),this}rect(t,e,i,r){return this.context.rect(t,e,i,r),this.customContext.rect(t,e,i,r),this}translate(t,e){return this.context.translate(t,e),this.customContext.translate(t,e),this}rotate(t){return this.context.rotate(t),this.customContext.rotate(t),this}scale(t,e){return this.context.scale(t,e),this.customContext.scale(t,e),this}createLinearGradient(t,e,i,r,s){const a=this.context.createLinearGradient(t,e,i,r),o=this.customContext.createLinearGradient(t,e,i,r);return s&&Object.keys(s).forEach(l=>{const c=parseFloat(l);a.addColorStop(c,s[c]),o.addColorStop(c,s[c])}),{gradient:a,gradientCustom:o}}createRadialGradient(t,e,i,r,s,a,o){const l=this.context.createRadialGradient(t,e,i,r,s,a),c=this.customContext.createRadialGradient(t,e,i,r,s,a);return o&&Object.keys(o).forEach(f=>{const g=parseFloat(f);l.addColorStop(g,o[g]),c.addColorStop(g,o[g])}),{gradient:l,gradientCustom:c}}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const i=e[0],r=e[1];this.context.drawImage(t,i,r)}else if(e.length===4){const i=e[0],r=e[1],s=e[2],a=e[3];this.context.drawImage(t,i,r,s,a)}else if(e.length===8){const i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],l=e[5],c=e[6],f=e[7];this.context.drawImage(t,i,r,s,a,o,l,c,f)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext.drawImage(t,...e),this}getImageData(t,e,i,r,s){return this.context.getImageData(t,e,i,r,s)}putImageData(t,e=0,i=0){return this.context.putImageData(t,e,i)}toRawSVG(){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}toSVGOperation(){const{raw:t}=this.toRawSVG();return nn.fromRawSVG(t)}}class mo extends Ac{container;hammer;mousePoint;ctx;removeEventListeners=[];constructor(t=document.documentElement){super(),this.container=t,this.hammer=new hh(this.container),this.mousePoint=new Te({x:0,y:0}),this.container instanceof HTMLCanvasElement&&(this.ctx=new ms(this.container)),this.initMouseEventListeners(),this.initKeyboardEventListeners(),this.on("pointerMove",this.setMousePoint),this.addDestroyRemove(()=>{this.off("pointerMove",this.setMousePoint)})}addDestroyRemove(t){this.removeEventListeners.push(t)}destroy(){this.removeEventListeners.forEach(t=>t()),this.removeAllListeners()}setMousePoint(t){const e=Ji(this.container,t);this.mousePoint.x=e.x,this.mousePoint.y=e.y}initMouseEventListeners(){const t=new ResizeObserver(j=>{const{width:ct,height:L}=j[0].contentRect;this.emit("resize",ct,L)}),e=j=>{this.emit("mouseDown",j),this.container.style.userSelect="none"},i=j=>{this.emit("mouseUp",j),this.container.style.userSelect=""},r=j=>{this.emit("mouseMove",j)},s=j=>{this.emit("mouseOver",j)},a=j=>{this.emit("mouseOut",j),this.container.style.userSelect=""},o=j=>{this.emit("mouseClick",j)},l=j=>{this.emit("mouseDoubleClick",j)},c=j=>{this.emit("mouseWheel",j)},f=j=>{this.emit("mouseContextMenu",j)},g=j=>{this.emit("touchStart",j),this.container.style.userSelect="none"},p=j=>{this.emit("touchEnd",j),this.container.style.userSelect=""},u=j=>{this.emit("touchCancel",j),this.container.style.userSelect=""},y=j=>{this.emit("touchMove",j)},x=j=>{this.emit("pointerDown",j),this.container.style.userSelect="none"},b=j=>{this.emit("pointerUp",j),this.container.style.userSelect=""},A=j=>{this.emit("pointerCancel",j),this.container.style.userSelect=""},P=j=>{this.emit("pointerMove",j)},M=j=>{this.emit("pan",j)},D=j=>{this.emit("panStart",j),this.container.style.userSelect="none"},z=j=>{this.emit("panMove",j)},N=j=>{this.emit("panEnd",j),this.container.style.userSelect=""},F=j=>{this.emit("panCancel",j),this.container.style.userSelect=""},G=j=>{this.emit("panLeft",j)},H=j=>{this.emit("panRight",j)},$=j=>{this.emit("panUp",j),this.container.style.userSelect=""},Y=j=>{this.emit("panDown",j),this.container.style.userSelect="none"},K=j=>{this.emit("pinch",j)},ut=j=>{this.emit("press",j)},ht=j=>{this.emit("rotate",j)},pt=j=>{this.emit("swipe",j)},kt=j=>{this.emit("tap",j)},St=j=>{!j.target||this.container==j.target||this.container.contains(j.target)||this.emit("tapOutSide",j)};t.observe(this.container),this.container.addEventListener("mousedown",e),this.container.addEventListener("mouseup",i),this.container.addEventListener("mousemove",r),this.container.addEventListener("mouseover",s),this.container.addEventListener("mouseout",a),this.container.addEventListener("click",o),this.container.addEventListener("dblclick",l),this.container.addEventListener("wheel",c),this.container.addEventListener("contextmenu",f),this.container.addEventListener("touchstart",g),this.container.addEventListener("touchend",p),this.container.addEventListener("touchcancel",u),this.container.addEventListener("touchmove",y),this.container.addEventListener("pointerdown",x),this.container.addEventListener("pointerup",b),this.container.addEventListener("pointercancel",A),this.container.addEventListener("pointermove",P),this.hammer.on("pan",M),this.hammer.on("panstart",D),this.hammer.on("panmove",z),this.hammer.on("panend",N),this.hammer.on("pancancel",F),this.hammer.on("panleft",G),this.hammer.on("panright",H),this.hammer.on("panup",$),this.hammer.on("pandown",Y),this.hammer.on("pinch",K),this.hammer.on("press",ut),this.hammer.on("rotate",ht),this.hammer.on("swipe",pt),this.hammer.on("tap",kt),document.addEventListener("pointerdown",St,!1);const vt=()=>{t.unobserve(this.container),this.container.removeEventListener("mousedown",e),this.container.removeEventListener("mouseup",i),this.container.removeEventListener("mousemove",r),this.container.removeEventListener("mouseover",s),this.container.removeEventListener("mouseout",a),this.container.removeEventListener("click",o),this.container.removeEventListener("dblclick",l),this.container.removeEventListener("wheel",c),this.container.removeEventListener("contextmenu",f),this.container.removeEventListener("touchstart",g),this.container.removeEventListener("touchend",p),this.container.removeEventListener("touchcancel",u),this.container.removeEventListener("touchmove",y),this.container.removeEventListener("pointerdown",x),this.container.removeEventListener("pointerup",b),this.container.removeEventListener("pointercancel",A),this.container.removeEventListener("pointermove",P),this.hammer.off("pan",M),this.hammer.off("panstart",D),this.hammer.off("panmove",z),this.hammer.off("panend",N),this.hammer.off("pancancel",F),this.hammer.off("panleft",G),this.hammer.off("panright",H),this.hammer.off("panup",$),this.hammer.off("pandown",Y),this.hammer.off("pinch",K),this.hammer.off("press",ut),this.hammer.off("rotate",ht),this.hammer.off("swipe",pt),this.hammer.off("tap",kt),document.removeEventListener("pointerdown",St,!1),document.removeEventListener("touchstart",St,!1),document.removeEventListener("mousedown",St,!1)};return this.addDestroyRemove(vt),vt}initKeyboardEventListeners(){this.registerKeyDown({title:"打开",key:"o",ctrl:!0,exact:!0},()=>{Sa().then(t=>Yr(t[0])).then(t=>{this.emit("openFile",t)}).catch(t=>{this.emit("openFileError",t)})})}registerKeyDown(t,e,i){const r=Va.on(t,a=>(e(a,r.formatedKeyNames,r.pause,r.restart),i)),s=()=>{r.removeListener?.()};return this.addDestroyRemove(s),s}drawMouseMoveLine(t,e){if(!this.ctx)return;let i=!1;switch(t){case"brush":const r=(e&&e.brushSize)??10,s=(e&&e.brushDensity)??50,a=(e&&e.brushColor)??"#000000",o=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),l=o.data,c=cr(a);this.captureMove({start:()=>{i=!0},end:()=>{i=!1},move:()=>{if(i){for(let f=0;f<s;f++){const g=Math.random()*Math.PI*2,p=Math.random()*r,u=this.mousePoint.x+Math.cos(g)*p|0,y=this.mousePoint.y+Math.sin(g)*p|0,x=(u+y*o.width)*4;l[x]=c>>16&255,l[x+1]=c>>8&255,l[x+2]=c&255,l[x+3]=255}this.ctx.putImageData(o)}}});break;case"line":default:this.captureMove({start:f=>{i=!0,this.ctx.beginPath(),this.setMousePoint(f),this.ctx.moveTo(this.mousePoint.x,this.mousePoint.y)},end:()=>{i=!1,this.ctx.closePath()},move:()=>{i&&(this.ctx.lineTo(this.mousePoint.x,this.mousePoint.y),this.ctx.stroke())}})}}static isTouchEnabled(){return"ontouchstart"in window||navigator.maxTouchPoints>0}captureMove(t){return this.captureMoveUsePointer(t)}captureMoveUseMouse(t){const e=a=>{document.addEventListener("mousemove",r,!1),document.addEventListener("mouseup",i,!1),this.container.style.userSelect="none",t?.start?.(a)},i=a=>{document.removeEventListener("mousemove",r,!1),document.removeEventListener("mouseup",i,!1),this.container.style.userSelect="",t?.end?.(a)},r=a=>{t?.move?.(a)};this.on("mouseDown",e);const s=()=>{this.off("mouseDown",e)};return this.addDestroyRemove(s),s}captureMoveUseTouch(t){const e=a=>{a.preventDefault(),t?.start?.(a)},i=a=>{t?.end?.(a)},r=a=>{t?.move?.(a)};this.on("touchStart",e),this.on("touchEnd",i),this.on("touchCancel",i),this.on("touchMove",r);const s=()=>{this.off("touchStart",e),this.off("touchEnd",i),this.off("touchCancel",i),this.off("touchMove",r)};return this.addDestroyRemove(s),s}captureMoveUsePointer(t){const e=a=>{this.container.setPointerCapture(a.pointerId),this.container.style.userSelect="none",t?.start?.(a)},i=a=>{this.container.style.userSelect="",t?.end?.(a)},r=a=>{t?.move?.(a)};this.on("pointerDown",e),this.on("pointerUp",i),this.on("pointerCancel",i),this.on("pointerMove",r);const s=()=>{this.off("pointerDown",e),this.off("pointerUp",i),this.off("pointerCancel",i),this.off("pointerMove",r)};return this.addDestroyRemove(s),s}static getMouseButton(t){if(document.implementation.hasFeature("MouseEvents","2.0"))return t.button;switch(t.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}}class Pt{static onDocumentReady(t){function e(){document.readyState!=="loading"&&(t(),document.removeEventListener("DOMContentLoaded",e))}typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}static getCSSVar(t){return getComputedStyle(document.documentElement).getPropertyValue(t)}static setCSSVar(t,e){document.documentElement.style.setProperty(t,e)}static safeExec(t){const e=new Proxy(window,{get(i,r,s){if(typeof r=="string"&&["open","location","document"].includes(r))throw new Error(`禁止访问 key: ${r}`);return r==="window"?e:Reflect.get(i,r,s)},set(i,r,s,a){return Reflect.set(i,r,s,a)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(i={},...r){const s=document.createElement(e);for(const a of Object.keys(i))s.setAttribute(a,i[a]);for(const a of r)typeof a=="string"?s.appendChild(document.createTextNode(a)):s.appendChild(a);return s}}});static compileTemplate(t){return t=t.replace(/<%=(.+?)%>/g,"`); \n echo( $1 ); \n echo(`").replace(/<%([\s\S]+?)%>/g,"`); \n $1 \n echo(`"),t="echo(`"+t+"`);",`(function parse(data){
|
|
10
|
+
`.replace(/\s+/g,""),"u");break;case"mime-image":t=/^image\//;break;case"mime-video":t=/^video\//;break;case"mime-audio":t=/^audio\//;break;case"mime-document-word":t=/^application\/(?:vnd\.openxmlformats-officedocument\.wordprocessingml\.document|msword|vnd\.ms-word\.document\.macroenabled\.12|vnd\.openxmlformats-officedocument\.wordprocessingml\.template|vnd\.ms-word\.template\.macroenabled\.12)$/;break;case"mime-document-excel":t=/^application\/(?:vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|vnd\.ms-excel|vnd\.ms-excel\.sheet\.macroenabled\.12|vnd\.openxmlformats-officedocument\.spreadsheetml\.template|vnd\.ms-excel\.template\.macroenabled\.12)$/;break;case"mime-document-ppt":t=/^application\/(?:vnd\.ms-powerpoint|vnd\.openxmlformats-officedocument\.presentationml\.presentation|vnd\.ms-powerpoint\.presentation\.macroenabled\.12|vnd\.openxmlformats-officedocument\.presentationml\.template|vnd\.ms-powerpoint\.template\.macroenabled\.12)$/;break;case"mime-document-json":t=/^application\/json$/;break;case"mime-document-xml":t=/^(?:application|text)\/(?:xml|xhtml\+xml)$/;break}return t},mt=(s,t)=>(typeof s=="string"&&(s=Be(s)||new RegExp(s)),s.test(t)),hn=(s,t)=>{typeof s=="string"&&(s=Be(s)||new RegExp(s));const e=t.match(s);return e?s.flags.toLowerCase().indexOf("g")>=0?e.map(i=>({matchIndex:-1,fullMatch:i,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},Ai=(s,t)=>{typeof s=="string"&&(s=Be(s)||new RegExp(s));const e=[],i=t.matchAll(s);for(const n of i)e.push({matchIndex:typeof n.index=="number"?n.index:-1,fullMatch:n[0],groupMatchs:n.slice(1)});return e};function cn(s){const t=s.match(/[\s\S]/gu);return t?t.length:0}function Li(s,t){const e=s.codePointAt(t);return e?String.fromCodePoint(e):void 0}function ln(){let s=new Date().getTime();return"xxxxxxxx_xxxx_xxxx_yxxx_xxxxxxxxxxxx".replace(/[xy]/g,function(e){const i=(s+Math.random()*16)%16|0;return s=Math.floor(s/16),(e=="x"?i:i&3|8).toString(16)})}function un(s){return s.replace(/(^\w)/g,function(t){return t.toLowerCase()})}const fn=(s,t="-")=>(s=s.replace(/([A-Z])/g,t+"$1").toLowerCase(),s.indexOf(t)==0?s.slice(1):s);function Ue(s){return s.replace(/(^\w|[_-]\w)/g,function(t){return t.slice(-1).toUpperCase()})}function Ri(s){return un(Ue(s))}function Oi(s){let t="";for(let e=0,i=s.length;e<i;e++){const n=s.charCodeAt(e);n>=1&&n<=127?t+=s.charAt(e):n>2047?(t+=String.fromCharCode(224|n>>12&15),t+=String.fromCharCode(128|n>>6&63),t+=String.fromCharCode(128|n>>0&63)):(t+=String.fromCharCode(192|n>>6&31),t+=String.fromCharCode(128|n>>0&63))}return t}var gt=(s=>(s.UNKNOWN="",s.HTML="text/html",s.CSS="text/css",s.XML="text/xml",s.TEXT="text/plain",s.MD="text/plain",s.JPEG="image/jpeg",s.PNG="image/png",s.GIF="image/gif",s.WEBP="image/webp",s.SVG="image/svg+xml",s.ICO="image/x-icon",s.MPEG="audio/mpeg",s.MP3="audio/mpeg",s.OGG="audio/ogg",s.WAV="audio/wav",s.MP4="video/mp4",s.WEBM="video/webm",s.JSON="application/json",s.JAVASCRIPT="application/javascript",s.ECMASCRIPT="application/ecmascript",s.EXCEL="application/vnb.ms-excel",s.XWWW="application/x-www-form-urlencoded",s.DOC="application/msword",s.CSV="application/x-csv",s.PDF="application/pdf",s.ZIP="application/zip",s.TGZ="application/x-gtar",s.TAR_GZ="application/x-gzip",s.EOT="appliaction/vnd.ms-fontobject",s.TTF="aplication/font-sfnt",s))(gt||{});const Ft=(s,t=16)=>(s=s.toLowerCase(),(s.indexOf("0b")==0||s.indexOf("0o")==0||s.indexOf("0x")==0)&&(s=s.slice(2)),parseInt(s,t));function dn(){const s=Uint32Array.of(305419896),t=new Uint8Array(s.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const Ni=s=>{let t=gt.UNKNOWN;switch(new DataView(s).getUint32(0,dn()).toString(16).toUpperCase()){case"FFD8FFDB":t=gt.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=gt.JPEG;break;case"89504E47":t=gt.PNG;break;case"47494638":t=gt.GIF;break;case"52494646":t=gt.WEBP;break;case"25504446":t=gt.PDF;break;case"504B0304":t=gt.ZIP;break}return t},Fi=function(){const s=[];return{writeByte(t){s.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,i=t.length){for(let n=0;n<i;n++)this.writeByte(t[n+e])},writeString(t){for(let e=0,i=t.length;e<i;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return s},toString(){let t="[";for(let e=0,i=s.length;e<i;e++)e>0&&(t+=","),t+=s[e];return t+="]",t}}},mn=function(){let s=0,t=0,e=0,i="";const n=function(a){if(!(a<0)){if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47}throw new Error("n:"+a)},r=function(a){i+=String.fromCharCode(n(a&63))};return{writeByte(a){for(s=s<<8|a&255,t+=8,e+=1;t>=6;)r(s>>>t-6),t-=6},flush(){if(t>0&&(r(s<<6-t),s=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)i+="="}},toString(){return i}}};function Gi(s){const t=typeof s;return t!=="object"?t:Object.prototype.toString.call(s).replace(/^\[object (\S+)\]$/,"$1").toLowerCase()}function gn(s){return Gi(s)==="array"}function ze(s){return Gi(s)==="object"}function Ve(s,t=new WeakMap){if(s==null)return s;if(s.constructor===Date)return new Date(s);if(s.constructor===RegExp)return new RegExp(s);if(typeof s!="object")return s;if(t.has(s))return t.get(s);const e=Object.create(Object.getPrototypeOf(s),Object.getOwnPropertyDescriptors(s));t.set(s,e);for(const i of Reflect.ownKeys(s))e[i]=ze(s[i])?Ve(s[i],t):s[i];return e}function Wt(s,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(s-t)<e}const Xe=(s,t,e)=>s<t?t:s>e?e:s;function Bi(s,t=12){return s.toPrecision(t)}function pn(s){const t=hn("number",s);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}function wn(s,t){let e;return function(...i){clearTimeout(e),e=setTimeout(()=>{s.apply(this,i)},t)}}class Ui{events;constructor(){this.events={}}on(t,e){return this.events[t]||(this.events[t]=[]),this.events[t].push(e),this}addListener(t,e){return this.on(t,e),this}prependListener(t,e){return this.events[t]||(this.events[t]=[]),this.events[t].unshift(e),this}removeListener(t,e){if(this.events[t])return this.events[t]=this.events[t].filter(i=>i!==e),this}off(t,e){return this.removeListener(t,e),this}removeAllListeners(t){return t?this.events[t]=[]:this.events={},this}emit(t,...e){return this.events[t]&&this.events[t].forEach(i=>{Reflect.apply(i,this,e)}),this}once(t,e){const n=(()=>{let r=!1;return(...a)=>{r||(r=!0,Reflect.apply(e,this,a),this.off(t,n))}})();return this.on(t,n),this}}var zi=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function yn(s,t={}){var e=1,i=1;function n(D){var P=D.match(/\n/g);P&&(e+=P.length);var N=D.lastIndexOf(`
|
|
11
|
+
`);i=~N?D.length-N:i+D.length}function r(){var D={line:e,column:i};return function(P){return P.position=new a(D),y(),P}}function a(D){this.start=D,this.end={line:e,column:i},this.source=t.source}a.prototype.content=s;var o=[];function h(D){var P=new Error(t.source+":"+e+":"+i+": "+D);if(P.reason=D,P.filename=t.source,P.line=e,P.column=i,P.source=s,t.silent)o.push(P);else throw P}function c(){var D=w();return{type:"stylesheet",stylesheet:{source:t.source,rules:D,parsingErrors:o}}}function f(){return p(/^{\s*/)}function m(){return p(/^}/)}function w(){var D,P=[];for(y(),x(P);s.length&&s.charAt(0)!="}"&&(D=Lt()||k());)D!==!1&&(P.push(D),x(P));return P}function p(D){var P=D.exec(s);if(P){var N=P[0];return n(N),s=s.slice(N.length),P}}function y(){p(/^\s*/)}function x(D){var P;for(D=D||[];P=b();)P!==!1&&D.push(P);return D}function b(){var D=r();if(!(s.charAt(0)!="/"||s.charAt(1)!="*")){for(var P=2;s.charAt(P)!=""&&(s.charAt(P)!="*"||s.charAt(P+1)!="/");)++P;if(P+=2,s.charAt(P-1)==="")return h("End of comment missing");var N=s.slice(2,P-2);return i+=2,n(N),s=s.slice(P),i+=2,D({type:"comment",comment:N})}}function C(){var D=p(/^([^{]+)/);if(D)return pt(D[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(P){return P.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(P){return P.replace(/\u200C/g,",")})}function _(){var D=r(),P=p(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(P){if(P=pt(P[0]),!p(/^:\s*/))return h("property missing ':'");var N=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),F=D({type:"declaration",property:P.replace(zi,""),value:N?pt(N[0]).replace(zi,""):""});return p(/^[;\s]*/),F}}function I(){var D=[];if(!f())return h("missing '{'");x(D);for(var P;P=_();)P!==!1&&(D.push(P),x(D));return m()?D:h("missing '}'")}function E(){for(var D,P=[],N=r();D=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)P.push(D[1]),p(/^,\s*/);if(P.length)return N({type:"keyframe",values:P,declarations:I()})}function L(){var D=r(),P=p(/^@([-\w]+)?keyframes\s*/);if(P){var N=P[1];if(P=p(/^([-\w]+)\s*/),!P)return h("@keyframes missing name");var F=P[1];if(!f())return h("@keyframes missing '{'");for(var nt,kt=x();nt=E();)kt.push(nt),kt=kt.concat(x());return m()?D({type:"keyframes",name:F,vendor:N,keyframes:kt}):h("@keyframes missing '}'")}}function O(){var D=r(),P=p(/^@supports *([^{]+)/);if(P){var N=pt(P[1]);if(!f())return h("@supports missing '{'");var F=x().concat(w());return m()?D({type:"supports",supports:N,rules:F}):h("@supports missing '}'")}}function B(){var D=r(),P=p(/^@host\s*/);if(P){if(!f())return h("@host missing '{'");var N=x().concat(w());return m()?D({type:"host",rules:N}):h("@host missing '}'")}}function H(){var D=r(),P=p(/^@media *([^{]+)/);if(P){var N=pt(P[1]);if(!f())return h("@media missing '{'");var F=x().concat(w());return m()?D({type:"media",media:N,rules:F}):h("@media missing '}'")}}function z(){var D=r(),P=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(P)return D({type:"custom-media",name:pt(P[1]),media:pt(P[2])})}function j(){var D=r(),P=p(/^@page */);if(P){var N=C()||[];if(!f())return h("@page missing '{'");for(var F=x(),nt;nt=_();)F.push(nt),F=F.concat(x());return m()?D({type:"page",selectors:N,declarations:F}):h("@page missing '}'")}}function it(){var D=r(),P=p(/^@([-\w]+)?document *([^{]+)/);if(P){var N=pt(P[1]),F=pt(P[2]);if(!f())return h("@document missing '{'");var nt=x().concat(w());return m()?D({type:"document",document:F,vendor:N,rules:nt}):h("@document missing '}'")}}function ht(){var D=r(),P=p(/^@font-face\s*/);if(P){if(!f())return h("@font-face missing '{'");for(var N=x(),F;F=_();)N.push(F),N=N.concat(x());return m()?D({type:"font-face",declarations:N}):h("@font-face missing '}'")}}var At=lt("import"),bt=lt("charset"),Vt=lt("namespace");function lt(D){var P=new RegExp("^@"+D+"\\s*([^;]+);");return function(){var N=r(),F=p(P);if(F){var nt={type:D};return nt[D]=F[1].trim(),N(nt)}}}function Lt(){if(s[0]=="@")return L()||H()||z()||O()||At()||bt()||Vt()||it()||j()||B()||ht()}function k(){var D=r(),P=C();return P?(x(),D({type:"rule",selectors:P,declarations:I()})):h("selector missing")}return We(c())}function pt(s){return s?s.replace(/^\s+|\s+$/g,""):""}function We(s,t){var e=s&&typeof s.type=="string",i=e?s:t;for(var n in s){var r=s[n];Array.isArray(r)?r.forEach(function(a){We(a,i)}):r&&typeof r=="object"&&We(r,i)}return e&&Object.defineProperty(s,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),s}const Ye=(s,t="image/svg+xml",e="utf-8")=>new Blob([s],{type:`${t};charset=${e}`}),Vi=s=>new XMLSerializer().serializeToString(s),vn=(s,t="text/html")=>new DOMParser().parseFromString(s,t),Xi=(s,t="image/svg+xml",e="utf-8")=>Ye(Vi(s),t,e),He=(s,t)=>{const e=document.createElement("a");e.style.visibility="hidden",document.body.appendChild(e),e.download=t,typeof s=="string"?e.href=s:e.href=window.URL.createObjectURL(s),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(e.href)};function Wi(s=["*"],t){return new Promise((e,i)=>{if(!globalThis.document||!(globalThis.document instanceof Document))return i(new Error("This is not a browser environment"));const n=globalThis.document.createElement("input");n.setAttribute("type","file"),n.setAttribute("visibility","hidden"),Array.isArray(s)&&s.length>0&&n.setAttribute("accept",s.join(",")),t&&n.setAttribute("multiple","true"),globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!n.files||n.files?.length===0)&&i(new Error("Cancel select"))},1e3)},{once:!0});const r=()=>{if(n.removeEventListener("change",r),!n.files||n.files?.length===0)i(new Error("Cancel select"));else{const a=Array.from(n.files);!s.includes("*")&&a.some(o=>!s.includes(`.${Hi(o)}`))&&i(new Error(`Please select files in ${s} format`)),n.remove(),e(a)}};n.addEventListener("change",r),n.click()})}function je(s,t="text",e){return new Promise((i,n)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{i(a.target?.result)}),r.addEventListener("error",a=>{n(a)}),t){case"dataURL":r.readAsDataURL(s);break;case"binaryString":r.readAsBinaryString(s);break;case"arrayBuffer":r.readAsArrayBuffer(s);break;default:r.readAsText(s)}})}function Yi(s,t,e){return je(s.slice(t,e),"arrayBuffer")}async function bn(s){const t=await Yi(s,0,4);return Ni(t)}const Hi=s=>{let t;return s instanceof File?t=s.name:t=s,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function xn(s,t){s.addEventListener("change",function(){t(s.files)},!1)}function Cn(s,t){s.addEventListener("dragover",function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},!1),s.addEventListener("drop",function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer&&t(e.dataTransfer.files)},!1)}function Tn(s){typeof queueMicrotask=="function"?queueMicrotask(s):Promise.resolve().then(s).catch(t=>setTimeout(()=>{throw t}))}function _n(s,t={},e=[]){return{tag:s,props:t,children:e}}function Yt(s,t){if(s.el)return;const e=s.el=document.createElement(s.tag);if(s.props)for(const i in s.props){const n=s.props[i];i.startsWith("on")?e.addEventListener(i.slice(2).toLowerCase(),n):e.setAttribute(i,n)}s.children&&(typeof s.children=="string"?e.textContent=s.children:s.children.forEach(i=>{Yt(i,e)})),t.appendChild(e)}function ji(s,t){if(s.tag!==t.tag){if(!s.el)return;const e=s.el.parentElement||document.body;e.removeChild(s.el),Yt(t,e)}else{const e=t.el=s.el;if(!e)return;const i=s.props,n=t.props;for(const o in i)o in n||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),i[o]):e.removeAttribute(o));for(const o in n){const h=i[o],c=n[o];c!=h&&(o.startsWith("on")?e.addEventListener(o.slice(2).toLowerCase(),c):e.setAttribute(o,c))}const r=s.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{Yt(o,e)});else{const o=Math.min(r.length,a.length);for(let h=0;h<o;h++)ji(r[h],a[h]);a.length>r.length&&a.slice(r.length).forEach(h=>{Yt(h,e)}),a.length<r.length&&r.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}}function qi(s,t,e){if(!s){e&&t&&e.appendChild(t);return}if(!s.isEqualNode(t)){if(s.nodeName!==t.nodeName){e.replaceChild(t,s);return}if(s.nodeType===Node.TEXT_NODE){s.textContent!==t.textContent&&(s.textContent=t.textContent);return}for(let i=s.attributes.length-1;i>=0;i--){const n=s.attributes[i].name;!t.hasAttribute(n)&&n!=="open"&&s.removeAttribute(n)}for(let i=0;i<t.attributes.length;i++){const n=t.attributes[i].name,r=t.attributes[i].value;s.setAttribute(n,r)}for(let i=0;i<t.childNodes.length;i++)s.childNodes[i]?qi(s.childNodes[i],t.childNodes[i],s):s.appendChild(t.childNodes[i].cloneNode(!0));for(;s.childNodes.length>t.childNodes.length;)s.lastChild&&s.removeChild(s.lastChild)}}class Sn{url;socket;waitingResponse={};sendMessageQueue=[];constructor(t){this.url=t,this.createSocket()}createSocket(){console.log("Socket Create Attempted"),this.socket=new WebSocket(this.url),this.socket.onopen=()=>{this.sendMessageQueue.forEach(t=>this.socket?.send(t)),this.sendMessageQueue=[]},this.socket.onclose=t=>{const{code:e,reason:i,wasClean:n}=t;console.log(`ws closed : ${e} ${i} ${n}`)},this.socket.onerror=t=>{console.log(`ws error : ${t.type}`)},this.socket.onmessage=t=>{this.processMessage(t)}}recreateSocket(t){console.log("Socket Recreate Attempted"),this.sendMessageQueue.push(t),this.createSocket()}closeSocket(){this.socket&&(this.socket.close(),console.log("Socket closed"))}openSocket(){this.createSocket(),console.log("Socket opened manually")}sendWithRetry(t){this.socket?.readyState===WebSocket.OPEN?this.socket.send(t):this.recreateSocket(t)}async processMessage(t){if(typeof t.data=="string")try{const e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const i=this.waitingResponse[e.requestid];i?i.resolve?.(e):console.warn("Got data but found no associated request, already timed out?",e)}else console.warn("Got data without request id",e)}catch{console.log(`Received String : ${t.data}`)}else t.data instanceof ArrayBuffer?console.log(`Received ArrayBuffer : ${t.data}`):t.data instanceof Blob&&console.log(`Received Blob : ${t.data}`)}async sendPayload(t){const e=+new Date,i=this.waitingResponse[e]={requestid:e};try{let n;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?n=t:n=JSON.stringify({...i,...t});const r=await new Promise((a,o)=>{i.resolve=a,this.sendWithRetry(n),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-i.requestid)/1e3),r}catch(n){return Promise.reject(n)}finally{delete this.waitingResponse[e]}}async send(t,e,i=n=>{console.log(n)}){this.sendPayload(t).then(e,i)}}function Pn(){const s=window.screen;return{screenWidth:s.width,screenHeight:s.height,screenX:window.screenX,screenY:window.screenY}}function En(){const s=document.body;return{clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,pageX:s.getBoundingClientRect().x,pageY:s.getBoundingClientRect().y}}function Gt(){const s=document.documentElement;return{clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,offsetWidth:s.offsetWidth,offsetHeight:s.offsetHeight,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft,offsetParent:s.offsetParent,clientX:s.getBoundingClientRect().x,clientY:s.getBoundingClientRect().y}}function kn(){const{clientWidth:s,clientHeight:t}=Gt();return{width:s||window.innerWidth,height:t||window.innerHeight}}function In(){const{scrollWidth:s,scrollHeight:t}=Gt();return{width:s,height:t}}function $i(s){const{top:t,left:e}=s.getBoundingClientRect(),{scrollLeft:i,scrollTop:n}=Gt();return{x:e+i,y:t+n}}function Mn(s){return{x:Ji(s),y:Zi(s)}}function Ji(s){let t=0;for(;s!==null;)t+=s.offsetLeft,s=s.offsetParent;return t}function Zi(s){let t=0;for(;s!==null;)t+=s.offsetTop,s=s.offsetParent;return t}function Dn(s){const t=s.getBoundingClientRect();return{x:t.left,y:t.top}}function An(s,t){const e=s.getBoundingClientRect(),i=t.getBoundingClientRect();return{x:i.x-e.x,y:i.y-e.y,width:i.width||i.right-i.left,height:i.height||i.bottom-i.top}}function Ln(){const{clientHeight:s,scrollTop:t,scrollHeight:e}=Gt(),i=e-s;return i<=0?0:t/i*100}function Rn(s){return{x:s.clientX,y:s.clientY}}function Ki(s){if("center"in s)return s.center;if(s.pageX&&s.pageY)return{x:s.pageX,y:s.pageY};const{scrollLeft:t,scrollTop:e}=Gt();return{x:s.clientX+t,y:s.clientY+e}}function Qi(s,t){const e=Ki(t),i=$i(s);return{x:e.x-i.x,y:e.y-i.y}}function qe(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}const pe=()=>{const s=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(s)?t="macOS":/win/i.test(s)?t="Windows":/android/i.test(s)?t="Android":/iphone|ipad|ipod/i.test(s)?t="iOS":/linux/i.test(s)?t="Linux":/bsd/i.test(s)&&(t="BSD"),t.toLowerCase()},On=()=>{const s=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(s)){const e=s.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(s)){const e=s.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(s)){const e=s.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(s)){const e=s.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},$e=()=>{const s=navigator.userAgent.toLowerCase();let t="Unknown";return/chrome/i.test(s)?t="Chrome":/firefox/i.test(s)?t="Firefox":/safari/i.test(s)?t="Safari":/edge/i.test(s)?t="Edge":/msie|trident/i.test(s)?t="IE":/MicroMessenger/i.test(s)?t="Wechat":/alipay/i.test(s)&&(t="Ali"),t.toLowerCase()},Nn=()=>{const s=navigator.userAgent;let t="Unknown";if(/Chrome/.test(s)){const e=s.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(s)){const e=s.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(s)){const e=s.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(s)){const e=s.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(s)){const e=s.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t},Fn=()=>"geolocation"in navigator?new Promise((s,t)=>{navigator.geolocation.getCurrentPosition(e=>{const i=e.coords.latitude,n=e.coords.longitude;s({latitude:i,longitude:n})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function Gn(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function Bn(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Je(){return pe()==="ios"}function Ze(){return pe()==="macos"}function Un(){return Je()|Ze()}function ts(){return pe()==="android"}function zn(){return Je()||ts()}function Vn(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function es(){const s=window.navigator.userAgent,t=s.indexOf("MSIE ");if(t>0)return parseInt(s.substring(t+5,s.indexOf(".",t)),10);if(s.indexOf("Trident/")>0){const n=s.indexOf("rv:");return parseInt(s.substring(n+3,s.indexOf(".",n)),10)}const i=s.indexOf("Edge/");return i>0?parseInt(s.substring(i+5,s.indexOf(".",i)),10):-1}const Xn=es()!==-1;function Wn(){const s=document.documentMode;return s&&(s===9||s===10)}function is(){return $e()==="wechat"}function ss(){return $e()==="ali"}function Yn(){return is()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function Hn(){return ss()&&navigator.userAgent.match(/miniprogram/i)}const jn=typeof document<"u",ns=typeof window<"u",qn=typeof history<"u",$n=ns&&window.File&&window.FileReader&&window.FileList&&window.Blob,rs=(()=>{const s=qe();return!!(s.Worker&&s.Blob&&s.Promise&&s.OffscreenCanvas&&s.OffscreenCanvasRenderingContext2D&&s.HTMLCanvasElement&&s.HTMLCanvasElement.prototype.transferControlToOffscreen&&s.URL&&s.URL.createObjectURL)})(),Jn=typeof Path2D=="function"&&typeof DOMMatrix=="function",Zn=function(){if(!qe().OffscreenCanvas)return!1;var t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);var i=t.transferToImageBitmap();try{e.createPattern(i,"no-repeat")}catch{return!1}return!0}();function Kn(s,t){let e=s[t];Object.defineProperty(s,"prop",{get:()=>e,set:i=>{e=i;debugger}})}function Qn(s){return new Proxy(s,{get(t,e,i){return Reflect.get(t,e,i)},set(t,e,i,n){debugger;return Reflect.set(t,e,i,n)}})}function tr(s){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let i=100;const n=function(){const r=Math.min(t.clientWidth,s);t.dataset.width=r,t.dataset.rem=i=Math.round(100*(r/s)),t.style.fontSize=i+"px"};n(),window.rem2px=function(r){return r=parseFloat(r),r*i},window.px2rem=function(r){return r=parseFloat(r),r/i},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",n,!1)}class A{static onDocumentReady(t){let e=!1;function i(){document.readyState==="loading"||e||(e=!0,t(),document.removeEventListener("DOMContentLoaded",i))}typeof document<"u"&&(document.addEventListener("DOMContentLoaded",i),i())}static onBeforeUnload(t){function e(){t(),document.removeEventListener("beforeunload",e)}typeof document<"u"&&document.addEventListener("beforeunload",e)}static getCSSVar(t){return getComputedStyle(document.documentElement).getPropertyValue(t)}static setCSSVar(t,e){document.documentElement.style.setProperty(t,e)}static getStyle(t,e,i){const n=t;if(getComputedStyle)if(e){e=fn(e);const r=getComputedStyle(n,i).getPropertyPriority(e);return getComputedStyle(n,i).getPropertyValue(e).trim()+(r?"!"+r:"")}else{const r=[],a=getComputedStyle(n,"");for(let o=0;o<a.length;o++)r.push(a[o]+":"+a.getPropertyValue(a[o]));return r.push(...(n.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(h=>h.trim()))||[])}else if(t.currentStyle){if(e)return e=Ri(e),t.currentStyle[e];{const r=[],a=n.currentStyle;for(let o in a)r.push(o+":"+a[o]);return r.push(...(n.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(h=>h.trim()))||[])}}}static setStyle(t,e,i){if(typeof e=="string"&&i){const n=String(i).toLowerCase().includes("!important")?"important":"";t.style.setProperty(e,i.replace(/!important/i,""),n)}else e instanceof Object&&Object.keys(e).forEach(n=>{const r=String(e[n]).toLowerCase().includes("!important")?"important":"";t.style.setProperty(n,String(e[n]).replace(/!important/i,""),r)})}static setStyleSheet(t,e){let i;if(typeof e=="string"){const r=document.querySelector(e)?.shadowRoot;r?i=r:i=document.querySelector(e)}else i=e;const n=document.createElement("style");if(n.innerHTML=t,i)return i.appendChild(n),()=>{(i instanceof HTMLElement||i instanceof ShadowRoot)&&i.removeChild(n)};{const r=document.styleSheets[0].insertRule(t);return()=>{document.styleSheets[0].deleteRule(r)}}}static toggleClass(t,e,i="toggle"){e.split(/[,\s]+/).forEach(n=>{n.trim()!==""&&t.classList[i](n.trim())})}static addClass(t,e){this.toggleClass(t,e,"add")}static removeClass(t,e){this.toggleClass(t,e,"remove")}static hasClass(t,e){return e.split(/[,\s]+/).every(i=>i.trim()!==""?Array.from(t.classList||[]).includes(i.trim()):!0)}static toggleDisplay(t,e){this.getStyle(t,"display")=="none"&&e===void 0||e===!0?t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block"):t.style.setProperty("display","none")}static show(t){this.toggleDisplay(t,!0)}static hide(t){this.toggleDisplay(t,!1)}static attribute(t,e,i){if(i===void 0&&typeof e=="string")return t.getAttribute(e);let n={};typeof e=="object"?n=e:i!==void 0&&(n[e]=i),Object.entries(n).forEach(([r,a])=>{t.setAttribute(r,a)})}static removeAttribute(t,e){e.split(/[,\s]+/).forEach(i=>{i.trim()!=""&&t.removeAttribute(i.trim())})}static fixProp(t){const e={cellpadding:"cellPadding",cellspacing:"cellSpacing",class:"className",colspan:"colSpan",contenteditable:"contentEditable",for:"htmlFor",frameborder:"frameBorder",maxlength:"maxLength",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return e[t]?e[t]:t}static prop(t,e,i){if(i===void 0&&typeof e=="string")return t[e];{let n={};typeof e=="object"?n=e:typeof e=="string"&&i!==void 0&&(n[e]=i),Object.entries(n).forEach(([r,a])=>{const o=this.fixProp(r);t[o]=a,o=="innerHTML"&&this.scriptConvert(t)})}}static removeProp(t,e){e.split(/[,\s]+/).forEach(i=>{i.trim()!=""&&delete t[this.fixProp(i.trim())]})}static data(t,e,i){if(typeof e=="string"&&(e=Ri(e)),(typeof e=="string"||e===void 0)&&i===void 0){const n=Object.assign({},t.dataset);return Object.keys(n).forEach(r=>{if(n[r]?.startsWith("[")||n[r]?.startsWith("{"))try{n[r]=JSON.parse(n[r]??"")}catch{}}),typeof e=="string"?n[e]:n}else{let n={};typeof e=="object"?n=e:typeof e=="string"&&(n[e]=i),Object.entries(n).forEach(([r,a])=>{a!=null?t.dataset[r]=a instanceof Object?JSON.stringify(a):a:delete t.dataset[r]})}}static removeData(t,e){e.split(/[,\s]+/).forEach(i=>{i.trim()!=""&&delete t.dataset[i.trim()]})}static empty(t){this.html(t,"")}static html(t,e){e instanceof HTMLElement?this.insert(t,e,"replaceWith"):this.prop(t,"innerHTML",e)}static text(t,e){return this.prop(t,"textContent",e)}static value(t,e){return this.prop(t,"value",e)}static dispatchEvent(t,e,i){let n;const r=["click","dblclick","mousedown","mouseup","mousemove"],a=["keydown","keyup","keypress"];typeof e=="string"?r.includes(e)?n=new MouseEvent(e,i):a.includes(e)?n=new KeyboardEvent(e,i):n=new Event(e,i):n=e,t.dispatchEvent(n)}static scriptConvert(t){const e=i=>{const r=i.ownerDocument.createElement("script");r.text=i.text;const a=i.attributes;for(let o=0;o<a.length;o++)r.setAttribute(a[o].name,a[o].value);return r};return t.tagName=="SCRIPT"&&(t=e(t)),t.querySelectorAll&&t.querySelectorAll("script").forEach(i=>{i.parentNode?.replaceChild(e(i),i)}),t}static fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(i=>{const n=this.scriptConvert(i);n!=i&&e.content.replaceChild(n,i)}),e.content}static insert(t,e,i="replaceWith"){return typeof e=="string"?t[i](this.fragment(e)):e instanceof HTMLElement&&t[i](e),this}static createElement(t){return document.createElement.call(document,t)}static createTextNode(t){return document.createTextNode.call(document,t)}static createDocumentFragment(){return document.createDocumentFragment.call(document)}static remove(t){return t.remove()}static siblings=t=>Array.prototype.slice.call(t.parentElement?.children).filter(e=>e!==t);static nextElementSibling(t){return t.nextElementSibling}static previousElementSibling(t){return t.previousElementSibling}static closest(t,e){return t.closest(e)}static shadowRoot(t){return t.shadowRoot}static parentElement=t=>t.parentElement;static changeSelectSelected(t,e){if(t instanceof HTMLSelectElement){const i=t.options;for(let n=0,r=i.length;n<r;n++)i[n].value==e?i[n].selected=!0:i[n].selected=!1}}static changeRadioChecked(t,e){t instanceof HTMLInputElement&&(t.value==e?t.checked=!0:t.checked=!1)}static entity2text(t){const e={lt:60,"lt;":60,"AMP;":38,AMP:38,"GT;":62,GT:62,"QUOT;":34,QUOT:34,"apos;":39,"bull;":8226,"bullet;":8226,"copy;":169,copy:169,"deg;":176,deg:176};let i;return t.charAt(0)=="#"?t.charAt(1).toLowerCase()=="x"?i=parseInt(t.substring(2),16):i=parseInt(t.substring(1),10):i=e[t],i?String.fromCharCode(i):"&"+t}static waitForStyleSheetsLoaded=()=>new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let i=document.styleSheets.length??0;const n=()=>i>=e.length?(t(),!0):!1;n()||e.forEach(r=>{r.onload=()=>{i+=1,n()}})});static loadScript(t,e=()=>{},i=(n,r,a,o,h)=>{}){const n=document.createElement("script");n.type="text/javascript",n.src=t,n.async=!1,n.onload=e,n.onerror=i,document.body.appendChild(n)}static runInSafe(t){const e=new Proxy(window,{get(i,n,r){if(typeof n=="string"&&["open","location","document"].includes(n))throw new Error(`禁止访问 key: ${n}`);return n==="window"?e:Reflect.get(i,n,r)},set(i,n,r,a){return Reflect.set(i,n,r,a)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(i={},...n){const r=document.createElement(e);for(const a of Object.keys(i))r.setAttribute(a,i[a]);for(const a of n)typeof a=="string"?r.appendChild(document.createTextNode(a)):r.appendChild(a);return r}}});static compileTemplate(t){return t=t.replace(/<%=(.+?)%>/g,"`); \n echo( $1 ); \n echo(`").replace(/<%([\s\S]+?)%>/g,"`); \n $1 \n echo(`"),t="echo(`"+t+"`);",`(function parse(data){
|
|
23
12
|
let output = "";
|
|
24
13
|
function echo(html){
|
|
25
14
|
output += html;
|
|
26
15
|
}
|
|
27
16
|
${t}
|
|
28
17
|
return output;
|
|
29
|
-
})`}static safeHtml(t,e="encode"){const i={"&":"&","<":"<",">":">",""":'"',"'":"'"};for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t=t.replace(new RegExp(e=="decode"?r:i[r],"g"),e=="decode"?i[r]:r));return t}static loadScript(t,e=()=>{},i=(r,s,a,o,l)=>{}){const r=document.createElement("script");r.type="text/javascript",r.src=t,r.async=!1,document.body.appendChild(r),r.onload=e,r.onerror=i}static loadStyle(t){const e=document.createElement("link");e.rel="stylesheet",e.href=t,document.head.insertBefore(e,document.head.childNodes[document.head.childNodes.length-1].nextSibling)}static waitForStyleSheetsLoaded=()=>new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let i=document.styleSheets.length??0;const r=()=>i>=e.length?(t(),!0):!1;r()||e.forEach(s=>{s.onload=()=>{i+=1,r()}})});static lazyloadImages(){const t=document.getElementsByTagName("img"),e=Wi().height;let i=0;return()=>{for(let r=i;r<t.length;r++)t[r].getBoundingClientRect().top<e&&(t[r].src=t[r].getAttribute("data-src")??"",i=r+1)}}static iframePostMessage(t,e="http://test.com/localstorage.html"){const i=document.createElement("iframe");i.src=e,document.body.append(i),setTimeout(function(){i.contentWindow?.postMessage(t,e)},4e3),setTimeout(function(){i.remove()},6e3)}static getTextWidth=(t,e,i=400)=>{const r=document.createElement("span");r.style.visibility="hidden",r.style.padding="0",r.style.whiteSpace="nowrap",r.style.overflow="visible",r.style.fontSize=e>12?e+"px":"12px",r.style.fontWeight=i.toString(),r.innerText=t,document.body.appendChild(r);const s=r.offsetWidth;return document.body.removeChild(r),s};static getFixedWidthText=(t,e,i=12,r=400,s=!0)=>{let a="",o="",l="";if(!t||e<i||typeof t!="string")return a;const c=t.split(""),f=document.createElement("span");f.style.visibility="hidden",f.style.padding="0",f.style.whiteSpace="nowrap",f.style.overflow="visible",f.style.fontSize=i>12?i+"px":"12px",f.style.fontWeight=r.toString(),document.body.appendChild(f);for(let g=0,p=c.length;g<p;g++){const u=c[g];if(o=l,l+=u,a=l,f.innerText=l,f.offsetWidth>e){s?a=o+"...":a=o;break}}return document.body.removeChild(f),a};static getLocation(){return new Promise((t,e)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(i=>{t(i.coords)}):e("Geolocation is not supported by this browser")})}static vibrate(t=200){"vibrate"in navigator?window.navigator.vibrate(t):console.error("Your device is not support vibrate on this browser.")}static copyToClipboard=t=>navigator.clipboard.writeText(t);static getSelectedText=()=>window.getSelection()?.toString();static siblings=t=>Array.prototype.slice.call(t.parentNode?.children).filter(e=>e!==t);static isElementFocus=t=>t===document.activeElement;static isTabInView=()=>!document.hidden;static navigateBack=()=>history.back();static navigateBack2=()=>history.go(-1);static addDebuggerOnBeforeUnload=()=>{window.addEventListener("beforeunload",()=>{debugger})}}function lr(n,t=document){return new jt(n,t)}class jt{context;nodes;prefixs=["moz","o","ms","webkit"];constructor(t,e=document){if(this.context=e,typeof t=="string"?this.nodes=Array.from(this.context.querySelectorAll(t)):t instanceof HTMLElement?this.nodes=[t]:this.nodes=t,this.nodes.length===0)throw new Error(`can not find ${t}`);this.each((i,r)=>{i instanceof HTMLInputElement&&i.addEventListener("change",s=>{this.changeRadioChecked(s.currentTarget.value)}),i instanceof HTMLSelectElement&&i.addEventListener("change",s=>{this.changeSelectSelected(s.currentTarget.value)})})}get(t){return t<0&&(t=this.nodes.length+t),this.nodes[t]}concat(t){return new jt(this.nodes.concat(t.nodes),this.context)}then(t){return t(this)??this}each(t){return this.nodes.forEach((e,i)=>{t(e,i)}),this}_save(t,e,i){t._mQuery||(t._mQuery={}),Array.isArray(i)?(t._mQuery[e]=t._mQuery[e]??[],t._mQuery[e].push(...i)):i!=null?t._mQuery[e]=i:delete t._mQuery[e]}on(t,e,i){return this.nodes.forEach(r=>{this._save(r,"events",[{event:t,callback:e,options:i}]),r.addEventListener(t,e,i)}),this}off(t,e,i){return this.nodes.forEach(r=>{r.removeEventListener(t,e,i)}),this}dispatchEvent(t,e){let i;const r=["click","dblclick","mousedown","mouseup","mousemove"],s=["keydown","keyup","keypress"];return typeof t=="string"?r.includes(t)?i=new MouseEvent(t,e):s.includes(t)?i=new KeyboardEvent(t,e):i=new Event(t,e):i=t,this.nodes.forEach(a=>{a.dispatchEvent(i)}),this}change(){return this.dispatchEvent("change")}click(){return this.dispatchEvent("click")}static hasEvent(t,e){return"on"+e in t}static _fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(i=>{const r=jt._scriptConvert(i);r!=i&&e.content.replaceChild(r,i)}),e.content}static _scriptConvert(t){const e=i=>{const s=i.ownerDocument.createElement("script");s.text=i.text;const a=i.attributes;for(let o=0;o<a.length;o++)s.setAttribute(a[o].name,a[o].value);return s};return t.tagName=="SCRIPT"&&(t=e(t)),t.querySelectorAll&&t.querySelectorAll("script").forEach(i=>{i.parentNode?.replaceChild(e(i),i)}),t}static _fixProp(t){const e={cellpadding:"cellPadding",cellspacing:"cellSpacing",class:"className",colspan:"colSpan",contenteditable:"contentEditable",for:"htmlFor",frameborder:"frameBorder",maxlength:"maxLength",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return e[t]?e[t]:t}static isSVG(t){return(t||document.documentElement).nodeName.toLowerCase()==="svg"}static createElement(t){return jt.isSVG()?document.createElementNS.call(document,"http://www.w3.org/2000/svg",t):document.createElement.call(document,t)}static createTextNode(t){return document.createTextNode.call(document,t)}static createDocumentFragment(){return document.createDocumentFragment.call(document)}_insert(t,e){const i=this.nodes.length;if(i<1)return this;const r=[];if(typeof e=="string")this.nodes.forEach(s=>{const a=jt._fragment(e);r.push(...a.children),s[t](a)});else if(e instanceof HTMLElement)this.each(s=>{const a=i===1?e:jt._fragment(e.outerHTML);r.push(...i===1?[e]:a.children),s[t](a)}),i>1&&e.remove();else if(e instanceof jt){const s=i==1;e.each(a=>{this.each(o=>{const l=s?a:a.cloneNode(!0);r.push(l),o[t](l),jt._scriptConvert(l)})}),s||e.remove()}return t=="replaceWith"&&(this.nodes=r),this}append(t){return this._insert("append",t)}prepend(t){return this._insert("prepend",t)}after(t){return this._insert("after",t)}before(t){return this._insert("before",t)}replace(t){return this._insert("replaceWith",t)}remove(){return this.nodes.forEach(t=>{t.remove()}),this}static removeChild(t){t.parentElement?.removeChild(t)}find(t){const e=[];return this.nodes.forEach(i=>{e.push(...Array.from(i.querySelectorAll(t)))}),new jt(e,this.context)}filter(t){const e=[];return this.nodes.forEach(i=>{(i===t||typeof t=="string"&&i.matches&&i.matches(t))&&e.push(i)}),new jt(e,this.context)}next(){const t=[];return this.nodes.forEach(e=>{const i=e.nextElementSibling;i&&t.push(i)}),new jt(t,this.context)}prev(){const t=[];return this.nodes.forEach(e=>{const i=e.previousElementSibling;i&&t.push(i)}),new jt(t,this.context)}closest(t){const e=[];return this.nodes.forEach(i=>{const r=i.closest(t);r&&e.push(r)}),new jt(e,this.context)}shadow(t){const e=[];this.nodes.forEach(r=>{r.shadowRoot&&e.push(r.shadowRoot)});const i=new jt(e,this.context);return t!==void 0?i.find(t):i}parent(t){return this.parents(t,!0)}parents(t,e=!1){const i=[],r=a=>{if(i.indexOf(a)==-1&&i.push(a),!e&&a.parentElement)return r(a.parentElement)};this.nodes.forEach(a=>{a.parentElement&&r(a.parentElement)});const s=new jt(i,this.context);return t!==void 0?s.filter(t):s}static getComputedStyle(t,e,i){let r;const s=t.style.getPropertyPriority(e);return"getComputedStyle"in window?(r=getComputedStyle.call(window,t,i),r=r.getPropertyValue(e)):r=t.style.getPropertyValue(e),r+(s?"!"+s:"")}css(t,e){if((t===void 0||typeof t=="string")&&e===void 0){const i=this.nodes[0].style;if(typeof t=="string"){const r=i.getPropertyPriority(t),s=i.getPropertyValue(t).trim();return s?s+(r?"!"+r:""):jt.getComputedStyle(this.nodes[0],t)}else{const r=Object.fromEntries(this.nodes[0].style.cssText.split(";").filter(s=>!!s).map(s=>s.split(":").map(a=>a.trim())));return Object.assign(r,getComputedStyle.call(window,this.nodes[0])),r}}else{let i={};return typeof t=="string"&&e!==void 0?i[t]=e:typeof t=="object"&&(i=t),this.nodes.forEach(r=>{Object.keys(i).forEach(s=>{const a=String(i[s]).toLowerCase().includes("!important")?"important":"";r.style.setProperty(s,String(i[s]).replace(/!important/i,""),a)})}),this}}addClass(t){return this.toggleClass(t,!0)}removeClass(t){return this.toggleClass(t,!1)}toggleClass(t,e){const i=t.split(/[,\s]+/);return this.nodes.forEach(r=>{i.forEach(s=>{if(s.trim()!==""){let a="toggle";e!==void 0&&(a=e?"add":"remove"),r.classList[a](s.trim())}})}),this}hasClass(t){const e=t.split(/[,\s]+/);let i=!1;return this.nodes.forEach(r=>{i=i||e.every(s=>Array.from(r.classList??[]).includes(s.trim()))}),i}attr(t,e){if(e===void 0&&typeof t=="string")return this.nodes[0].getAttribute(t);let i={};return typeof t=="object"?i=t:e!==void 0&&(i[t]=e),this.nodes.forEach(r=>{Object.entries(i).forEach(([s,a])=>{r.setAttribute(s,a)})}),this}removeAttr(t){const e=t.split(/[,\s]+/);return this.nodes.forEach(i=>{e.forEach(r=>{i.removeAttribute(r)})}),this}prop(t,e){if(e===void 0&&typeof t=="string")return this.nodes[0][t];{let i={};return typeof t=="object"?i=t:typeof t=="string"&&e!==void 0&&(i[t]=e),this.nodes.forEach(r=>{Object.entries(i).forEach(([s,a])=>{const o=jt._fixProp(s);r[o]=a,o=="innerHTML"&&jt._scriptConvert(r)})}),this}}removeProp(t){const e=t.split(/[,\s]+/);return this.nodes.forEach(i=>{e.forEach(r=>{delete i[jt._fixProp(r)]})}),this}changeSelectSelected(t){this.nodes.forEach(e=>{if(e instanceof HTMLSelectElement){const i=e.options;for(let r=0,s=i.length;r<s;r++)i[r].value==t?i[r].selected=!0:i[r].selected=!1}})}changeRadioChecked(t){this.nodes.forEach(e=>{e instanceof HTMLInputElement&&(e.value==t?e.checked=!0:e.checked=!1)})}data(t,e){if(typeof t=="string"&&t.indexOf("-")!=-1)throw new Error(`Key "${t}" contains "-" (dash). Dashes are not allowed in property names. Use camelCase instead.`);if((typeof t=="string"||t===void 0)&&e===void 0){const i=Object.assign({},this.nodes[0].dataset);return Object.keys(i).forEach(r=>{if(i[r]?.startsWith("[")||i[r]?.startsWith("{"))try{i[r]=JSON.parse(i[r]??"")}catch{}}),typeof t=="string"?i[t]:i}else{let i={};return typeof t=="object"?i=t:typeof t=="string"&&(i[t]=e),this.nodes.forEach(r=>{Object.entries(i).forEach(([s,a])=>{a!=null?r.dataset[s]=a instanceof Object?JSON.stringify(a):a:delete r.dataset[s]})}),this}}removeData(t){const e=t.split(/[,\s]+/);return this.nodes.forEach(i=>{e.forEach(r=>{delete i.dataset[r]})}),this}show(){return this.toggle(!0)}hide(){return this.toggle(!1)}toggle(t){return this.nodes.forEach(e=>{const i=e.style.display,r=getComputedStyle(e).display,s=i=="none"||r=="none";if(s&&(t===void 0||t===!0)){const a=e instanceof HTMLTableRowElement?"table-row":e instanceof HTMLTableCellElement?"table-cell":"block";e.style.display=e._mQuery?.prevDisplay??(i==r&&r!="none"?"":a),this._save(e,"prevDisplay",null)}!s&&(t==null||t===!1)&&(r!="none"&&this._save(e,"prevDisplay",r),e.style.setProperty("display","none"))})}empty(){return this.html("")}html(t){return t instanceof HTMLElement?this.empty().append(t.innerHTML):this.prop("innerHTML",t)}text(t){return this.prop("textContent",t)}val(t){return this.prop("value",t)}}function vs(n,t){if(typeof t<"u")window.localStorage.setItem(n,t);else return window.localStorage.getItem(n)??void 0}function Nh(n,t,e){const i=new Date;i.setTime(i.getTime()+e*24*60*60*1e3);const r="expires="+i.toUTCString();document.cookie=n+"="+t+"; "+r}function Bh(n){const t=n+"=",e=document.cookie.split(";");for(let i=0,r=e.length;i<r;i++){const s=e[i].trim();if(s.indexOf(t)==0)return s.substring(t.length,s.length)}return""}const Gh=()=>document.cookie.split(";").map(n=>n.split("=")).reduce((n,[t,e])=>(n[t.trim().replace('"',"")]=e,n),{}),Hh=()=>document.cookie.split(";").forEach(n=>document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));class jh{static theme(t){return t=t||vs("theme"),typeof t>"u"&&(t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),vs("theme",t),document.documentElement.classList.toggle("dark",t==="dark"),t}static has(t){return window.matchMedia(t).matches||!1}static on(t,e){window.matchMedia(t).addEventListener("change",e)}static off(t,e){window.matchMedia(t).removeEventListener("change",e)}}class Vh{static addEventListener(t,e,i){t.addEventListener(e,i,!1)}static removeEventListener(t,e,i){t.removeEventListener(e,i,!1)}static getTarget(t){return t.target||t.srcElement}}class Xh{static setPageVerticalScrollPercent(t,e="width"){const i=lr(t);i.css("transition","all linear 30ms");const{clientHeight:r}=qi(),{scrollTop:s,scrollHeight:a}=Un(),o=a-r,l=o<=0?0:s/o*100;i.css(e,l+"%")}static pullDownRefresh(t,e,i=50){let r=0,s=0;t.addEventListener("touchstart",function(a){r=a.touches[0].pageY,t.style.position="relative",t.style.transition="transform 0s"},!1),t.addEventListener("touchmove",function(a){s=a.touches[0].pageY-r,s>0&&s<i&&(t.style.transform="translateY("+s+"px)")},!1),t.addEventListener("touchend",function(a){t.style.transition="transform 0.5s ease 1s",t.style.transform="translateY(0px)",s>=i&&e()},!1)}static pullUpLoading(t,e=50){const{clientHeight:i}=qi(),{scrollTop:r,scrollHeight:s}=Un();r+i>=s-e&&t()}static scrollTo=(t={x:0,y:0})=>window.scrollTo(t.x,t.y)}class _i{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{e.target}),this.video.srcObject=t}captureWebCamera(){navigator.mediaDevices.getUserMedia({video:!0}).then(t=>{this.setSrcObject(t)})}static async videoMediaChangeSupport(){return new Promise(t=>{const e=document.createElement("iframe"),i=document.createElement("video"),r=document.createElement("source"),s=new MediaSource;s.addEventListener("sourceopen",()=>t(!0)),r.src=URL.createObjectURL(s),r.media="(min-width:10px)",i.append(r),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(i),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{_i.setAutoPlayWhenClick(t),e(!1)})})}static setAutoPlayWhenClick(t){function e(){t.autoplay=!0,t.play(),document.removeEventListener("click",e),document.removeEventListener("touchend",e)}document.addEventListener("click",e),document.addEventListener("touchend",e)}}const Yh={safeAreaTop:Pt.getCSSVar("--safe-area-inset-top"),safeAreaRight:Pt.getCSSVar("--safe-area-inset-right"),safeAreaBottom:Pt.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:Pt.getCSSVar("--safe-area-inset-left"),colorPrimary:Pt.getCSSVar("--color-primary")||"#5078f0",colorRed:Pt.getCSSVar("--color-red")||"#ff5050",colorOrange:Pt.getCSSVar("--color-orange")||"#fa8c00",colorYellow:Pt.getCSSVar("--color-yellow")||"#fadc32",colorGreen:Pt.getCSSVar("--color-green")||"#00c878",colorBlue:Pt.getCSSVar("--color-blue")||"#00b4fa",colorPurple:Pt.getCSSVar("--color-purple")||"#6464fa",colorBlack:Pt.getCSSVar("--color-black")||"#001428",colorGray0:Pt.getCSSVar("--color-gray-0")||"#000000",colorGray3:Pt.getCSSVar("--color-gray-3")||"#333333",colorGray6:Pt.getCSSVar("--color-gray-6")||"#666666",colorGray9:Pt.getCSSVar("--color-gray-9")||"#999999",colorGrayCC:Pt.getCSSVar("--color-gray-cc")||"#cccccc",colorGrayDD:Pt.getCSSVar("--color-gray-dd")||"#dddddd",colorGrayE6:Pt.getCSSVar("--color-gray-e6")||"#e6e6e6",colorGrayEE:Pt.getCSSVar("--color-gray-ee")||"#eeeeee",colorGrayEF:Pt.getCSSVar("--color-gray-ef")||"#efefef",colorGrayF5:Pt.getCSSVar("--color-gray-f5")||"#f5f5f5",colorGrayFF:Pt.getCSSVar("--color-gray-ff")||"#ffffff",fontLineHeight:Pt.getCSSVar("--font-line-height")||"1,4",fontSize32:Pt.getCSSVar("--font-size-32")||"32px",fontSize24:Pt.getCSSVar("--font-size-24")||"24px",fontSize20:Pt.getCSSVar("--font-size-20")||"20px",fontSize18:Pt.getCSSVar("--font-size-18")||"18px",fontSize16:Pt.getCSSVar("--font-size-16")||"16px",fontSize14:Pt.getCSSVar("--font-size-14")||"14px",fontSize12:Pt.getCSSVar("--font-size-12")||"12px",fontSize11:Pt.getCSSVar("--font-size-11")||"11px",gap4:Pt.getCSSVar("--gap-4")||"4px",gap8:Pt.getCSSVar("--gap-8")||"8px",gap12:Pt.getCSSVar("--gap-12")||"12px",gap16:Pt.getCSSVar("--gap-16")||"16px",gap20:Pt.getCSSVar("--gap-20")||"20px",gap40:Pt.getCSSVar("--gap-40")||"40px",height44:Pt.getCSSVar("--height-44")||"44px",height32:Pt.getCSSVar("--height-32")||"32px",borderRadius:Pt.getCSSVar("--border-radius")||"4px"},Zh=()=>Math.random()*16777215,$h=()=>`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`,qh=()=>`#${(~~(Math.random()*(1<<24))).toString(16)}`,cr=function(n){return n[0]==="#"&&(n=n.slice(1)),parseInt(n,16)},vo=function(n){let t="00000"+(n|0).toString(16);return t="#"+t.substring(t.length-6),t},_o=function(n,t=1){const e=n>>16&255,i=n>>8&255,r=n&255,s=t<0?0:t>1?1:t;return s===1?"rgb("+e+","+i+","+r+")":"rgba("+e+","+i+","+r+","+s+")"},_s=function(n,t=1){const e=cr(n);return _o(e,t)},Wh=n=>{const e=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(n);return e?"#"+((1<<24)+(parseInt(e[1])<<16)+(parseInt(e[2])<<8)+parseInt(e[3])).toString(16).slice(1):""};function Jh(n,t){let e=parseInt(n.substring(1,3),16),i=parseInt(n.substring(3,5),16),r=parseInt(n.substring(5,7),16);e==0&&(e=32),i==0&&(i=32),r==0&&(r=32),e=e*(100+t)/100,i=i*(100+t)/100,r=r*(100+t)/100,e=e<255?e:255,i=i<255?i:255,r=r<255?r:255,e=Math.round(e),i=Math.round(i),r=Math.round(r);const s=e.toString(16).length==1?"0"+e.toString(16):e.toString(16),a=i.toString(16).length==1?"0"+i.toString(16):i.toString(16),o=r.toString(16).length==1?"0"+r.toString(16):r.toString(16);return"#"+s+a+o}function Kh(n,t,e,i){let r,s,a;n=n/360,t=t/100,e=e/100;const o=Math.floor(n*6),l=n*6-o,c=e*(1-t),f=e*(1-l*t),g=e*(1-(1-l)*t);switch(o%6){case 0:r=e,s=g,a=c;break;case 1:r=f,s=e,a=c;break;case 2:r=c,s=e,a=g;break;case 3:r=c,s=f,a=e;break;case 4:r=g,s=c,a=e;break;case 5:default:r=e,s=c,a=f;break}return{r:Math.round(r*255),g:Math.round(s*255),b:Math.round(a*255),a:i??1}}function Qh(n,t,e,i){const r=Math.max(n,t,e),s=Math.min(n,t,e),a=r-s,o=r===0?0:a/r,l=r/255;let c;switch(r){case s:c=0;break;case n:c=t-e+a*(t<e?6:0),c/=6*a;break;case t:c=e-n+a*2,c/=6*a;break;case e:default:c=n-t+a*4,c/=6*a;break}return{h:Math.round(c*360),s:Math.round(o*100),v:Math.round(l*100),a:i??1}}function tf(n){return btoa(encodeURIComponent(n)).replaceAll("+","*").replaceAll("/","-").replaceAll("=","")}function ef(n){let t=n.replaceAll("*","+").replaceAll("-","/");const e=t.length%4;return e&&(t=t.padEnd(t.length+(4-e),"=")),decodeURIComponent(atob(t))}function ws(n=window.location.href){return Gr(URL)?new URL(n):wo(n)}function wo(n=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",i="(?<pathname>(?:\\/[^/#?]+)*\\/?)",r="(?<search>(?:\\?[^#]*)?)",s="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${i}${r}${s}$`).exec(n);return{href:n,protocol:o?.groups?.protocol??"",host:o?.groups?.host??"",hostname:o?.groups?.hostname??"",port:o?.groups?.port??"",pathname:o?.groups?.pathname??"",search:o?.groups?.search??"",hash:o?.groups?.hash??""}}function nf(n){const t=ws(n);return t.protocol==="http:"||t.protocol==="https:"}function yo(n=window.location.href){const t=ws(n),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function rf(n=location.search){n=decodeURIComponent(n).replace(/^[#?&]/,"");const t={};if(!n)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let i=e.exec(n);for(;i;)t[i[1]]=i[2],i=e.exec(n);return t}function sf(n){return Array.from(new URLSearchParams(n)).reduce((t,[e,i])=>Object.assign({},t,{[e]:t[e]?(Array.isArray(t[e])?t[e]:[t[e]]).concat(i):i}),{})}function xo(n){let t="";for(const e in n)t&&(t+="&"),t+=`${e}=${n[e]}`;return t}function af(n){return new URLSearchParams(n).toString()}function ys(n){return"?"+[...n.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function hr(n,t){return n.indexOf("?")>=0?n+t.replace(/^\?/,"&"):n.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function of(n){let t="";new MutationObserver(function(i){window.location.href!==t&&(t=window.location.href,n&&n(location.href))}).observe(document,{attributes:!0,childList:!0,subtree:!0})}function lf(n){window.addEventListener("hashchange",()=>{n(location.hash)})}function cf(n){window.addEventListener("popstate",n,!1)}function hf(n){let t=null;if(Ga)try{t=new Worker(URL.createObjectURL(new Blob([n])))}catch(e){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),null}return t}var bo={exports:{}};(function(n){var t={};n.exports=t,t.parse=function(e,i){for(var r=t.bin.readUshort,s=t.bin.readUint,c=0,a={},o=new Uint8Array(e),l=o.length-4;s(o,l)!=101010256;)l--;var c=l;c+=4,c+=4;var f=r(o,c);c+=2,r(o,c),c+=2;var g=s(o,c);c+=4;var p=s(o,c);c+=4,c=p;for(var u=0;u<f;u++){s(o,c),c+=4,c+=4,c+=4,c+=4,s(o,c),c+=4;var g=s(o,c);c+=4;var y=s(o,c);c+=4;var x=r(o,c),b=r(o,c+2),A=r(o,c+4);c+=6,c+=8;var P=s(o,c);c+=4,c+=x+b+A,t._readLocal(o,P,a,g,y,i)}return a},t._readLocal=function(e,i,r,s,a,o){var l=t.bin.readUshort,c=t.bin.readUint;c(e,i),i+=4,l(e,i),i+=2,l(e,i),i+=2;var f=l(e,i);i+=2,c(e,i),i+=4,c(e,i),i+=4,i+=8;var g=l(e,i);i+=2;var p=l(e,i);i+=2;var u=t.bin.readUTF8(e,i,g);if(i+=g,i+=p,o){r[u]={size:a,csize:s};return}var y=new Uint8Array(e.buffer,i);if(f==0)r[u]=new Uint8Array(y.buffer.slice(i,i+s));else if(f==8){var x=new Uint8Array(a);t.inflateRaw(y,x),r[u]=x}else throw"unknown compression method: "+f},t.inflateRaw=function(e,i){return t.F.inflate(e,i)},t.inflate=function(e,i){return e[0],e[1],t.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),i)},t.deflate=function(e,i){i==null&&(i={level:6});var r=0,s=new Uint8Array(50+Math.floor(e.length*1.1));s[r]=120,s[r+1]=156,r+=2,r=t.F.deflateRaw(e,s,r,i.level);var a=t.adler(e,0,e.length);return s[r+0]=a>>>24&255,s[r+1]=a>>>16&255,s[r+2]=a>>>8&255,s[r+3]=a>>>0&255,new Uint8Array(s.buffer,0,r+4)},t.deflateRaw=function(e,i){i==null&&(i={level:6});var r=new Uint8Array(50+Math.floor(e.length*1.1)),s=t.F.deflateRaw(e,r,s,i.level);return new Uint8Array(r.buffer,0,s)},t.encode=function(e,i){i==null&&(i=!1);var r=0,s=t.bin.writeUint,a=t.bin.writeUshort,o={};for(var l in e){var c=!t._noNeed(l)&&!i,f=e[l],g=t.crc.crc(f,0,f.length);o[l]={cpr:c,usize:f.length,crc:g,file:c?t.deflateRaw(f):f}}for(var l in o)r+=o[l].file.length+30+46+2*t.bin.sizeUTF8(l);r+=22;var p=new Uint8Array(r),u=0,y=[];for(var l in o){var x=o[l];y.push(u),u=t._writeHeader(p,u,l,x,0)}var b=0,A=u;for(var l in o){var x=o[l];y.push(u),u=t._writeHeader(p,u,l,x,1,y[b++])}var P=u-A;return s(p,u,101010256),u+=4,u+=4,a(p,u,b),u+=2,a(p,u,b),u+=2,s(p,u,P),u+=4,s(p,u,A),u+=4,u+=2,p.buffer},t._noNeed=function(e){var i=e.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(i)!=-1},t._writeHeader=function(e,i,r,s,a,o){var l=t.bin.writeUint,c=t.bin.writeUshort,f=s.file;l(e,i,a==0?67324752:33639248),i+=4,a==1&&(i+=2),c(e,i,20),i+=2,c(e,i,0),i+=2,c(e,i,s.cpr?8:0),i+=2,l(e,i,0),i+=4,l(e,i,s.crc),i+=4,l(e,i,f.length),i+=4,l(e,i,s.usize),i+=4,c(e,i,t.bin.sizeUTF8(r)),i+=2,c(e,i,0),i+=2,a==1&&(i+=2,i+=2,i+=6,l(e,i,o),i+=4);var g=t.bin.writeUTF8(e,i,r);return i+=g,a==0&&(e.set(f,i),i+=f.length),i},t.crc={table:function(){for(var e=new Uint32Array(256),i=0;i<256;i++){for(var r=i,s=0;s<8;s++)r&1?r=3988292384^r>>>1:r=r>>>1;e[i]=r}return e}(),update:function(e,i,r,s){for(var a=0;a<s;a++)e=t.crc.table[(e^i[r+a])&255]^e>>>8;return e},crc:function(e,i,r){return t.crc.update(4294967295,e,i,r)^4294967295}},t.adler=function(e,i,r){for(var s=1,a=0,o=i,l=i+r;o<l;){for(var c=Math.min(o+5552,l);o<c;)s+=e[o++],a+=s;s=s%65521,a=a%65521}return a<<16|s},t.bin={readUshort:function(e,i){return e[i]|e[i+1]<<8},writeUshort:function(e,i,r){e[i]=r&255,e[i+1]=r>>8&255},readUint:function(e,i){return e[i+3]*16777216+(e[i+2]<<16|e[i+1]<<8|e[i])},writeUint:function(e,i,r){e[i]=r&255,e[i+1]=r>>8&255,e[i+2]=r>>16&255,e[i+3]=r>>24&255},readASCII:function(e,i,r){for(var s="",a=0;a<r;a++)s+=String.fromCharCode(e[i+a]);return s},writeASCII:function(e,i,r){for(var s=0;s<r.length;s++)e[i+s]=r.charCodeAt(s)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,i,r){for(var s="",a,o=0;o<r;o++)s+="%"+t.bin.pad(e[i+o].toString(16));try{a=decodeURIComponent(s)}catch{return t.bin.readASCII(e,i,r)}return a},writeUTF8:function(e,i,r){for(var s=r.length,a=0,o=0;o<s;o++){var l=r.charCodeAt(o);if(!(l&4294967168))e[i+a]=l,a++;else if(!(l&4294965248))e[i+a]=192|l>>6,e[i+a+1]=128|l>>0&63,a+=2;else if(!(l&4294901760))e[i+a]=224|l>>12,e[i+a+1]=128|l>>6&63,e[i+a+2]=128|l>>0&63,a+=3;else if(!(l&4292870144))e[i+a]=240|l>>18,e[i+a+1]=128|l>>12&63,e[i+a+2]=128|l>>6&63,e[i+a+3]=128|l>>0&63,a+=4;else throw"e"}return a},sizeUTF8:function(e){for(var i=e.length,r=0,s=0;s<i;s++){var a=e.charCodeAt(s);if(!(a&4294967168))r++;else if(!(a&4294965248))r+=2;else if(!(a&4294901760))r+=3;else if(!(a&4292870144))r+=4;else throw"e"}return r}},t.F={},t.F.deflateRaw=function(e,i,r,s){var a=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]],o=a[s],l=t.F.U,c=t.F._goodIndex;t.F._hash;var f=t.F._putsE,g=0,p=r<<3,u=0,y=e.length;if(s==0){for(;g<y;){var x=Math.min(65535,y-g);f(i,p,g+x==y?1:0),p=t.F._copyExact(e,g,x,i,p+8),g+=x}return p>>>3}var b=l.lits,A=l.strt,P=l.prev,M=0,D=0,z=0,N=0,F=0,G=0;for(y>2&&(G=t.F._hash(e,0),A[G]=0),g=0;g<y;g++){if(F=G,g+1<y-2){G=t.F._hash(e,g+1);var H=g+1&32767;P[H]=A[G],A[G]=H}if(u<=g){(M>14e3||D>26697)&&y-g>100&&(u<g&&(b[M]=g-u,M+=2,u=g),p=t.F._writeBlock(g==y-1||u==y?1:0,b,M,N,e,z,g-z,i,p),M=D=N=0,z=g);var $=0;g<y-2&&($=t.F._bestMatch(e,g,P,F,Math.min(o[2],y-g),o[3]));var x=$>>>16,Y=$&65535;if($!=0){var x=$>>>16,Y=$&65535,K=c(x,l.of0);l.lhst[257+K]++;var ut=c(Y,l.df0);l.dhst[ut]++,N+=l.exb[K]+l.dxb[ut],b[M]=x<<23|g-u,b[M+1]=Y<<16|K<<8|ut,M+=2,u=g+x}else l.lhst[e[g]]++;D++}}for((z!=g||e.length==0)&&(u<g&&(b[M]=g-u,M+=2,u=g),p=t.F._writeBlock(1,b,M,N,e,z,g-z,i,p),M=0,D=0,M=D=N=0,z=g);p&7;)p++;return p>>>3},t.F._bestMatch=function(e,i,r,s,a,o){var l=i&32767,c=r[l],f=l-c+32768&32767;if(c==l||s!=t.F._hash(e,i-f))return 0;for(var g=0,p=0,u=Math.min(32767,i);f<=u&&--o!=0&&c!=l;){if(g==0||e[i+g]==e[i+g-f]){var y=t.F._howLong(e,i,f);if(y>g){if(g=y,p=f,g>=a)break;f+2<y&&(y=f+2);for(var x=0,b=0;b<y-2;b++){var A=i-f+b+32768&32767,P=r[A],M=A-P+32768&32767;M>x&&(x=M,c=A)}}}l=c,c=r[l],f+=l-c+32768&32767}return g<<16|p},t.F._howLong=function(e,i,r){if(e[i]!=e[i-r]||e[i+1]!=e[i+1-r]||e[i+2]!=e[i+2-r])return 0;var s=i,a=Math.min(e.length,i+258);for(i+=3;i<a&&e[i]==e[i-r];)i++;return i-s},t.F._hash=function(e,i){return(e[i]<<8|e[i+1])+(e[i+2]<<4)&65535},t.saved=0,t.F._writeBlock=function(e,i,r,s,a,o,l,c,f){var g=t.F.U,p=t.F._putsF,u=t.F._putsE,y,x,b,A,P,M,D,z,N;g.lhst[256]++,y=t.F.getTrees(),x=y[0],b=y[1],A=y[2],P=y[3],M=y[4],D=y[5],z=y[6],N=y[7];var F=(f+3&7?8-(f+3&7):0)+32+(l<<3),G=s+t.F.contSize(g.fltree,g.lhst)+t.F.contSize(g.fdtree,g.dhst),H=s+t.F.contSize(g.ltree,g.lhst)+t.F.contSize(g.dtree,g.dhst);H+=14+3*D+t.F.contSize(g.itree,g.ihst)+(g.ihst[16]*2+g.ihst[17]*3+g.ihst[18]*7);for(var $=0;$<286;$++)g.lhst[$]=0;for(var $=0;$<30;$++)g.dhst[$]=0;for(var $=0;$<19;$++)g.ihst[$]=0;var Y=F<G&&F<H?0:G<H?1:2;if(p(c,f,e),p(c,f+1,Y),f+=3,Y==0){for(;f&7;)f++;f=t.F._copyExact(a,o,l,c,f)}else{var K,ut;if(Y==1&&(K=g.fltree,ut=g.fdtree),Y==2){t.F.makeCodes(g.ltree,x),t.F.revCodes(g.ltree,x),t.F.makeCodes(g.dtree,b),t.F.revCodes(g.dtree,b),t.F.makeCodes(g.itree,A),t.F.revCodes(g.itree,A),K=g.ltree,ut=g.dtree,u(c,f,P-257),f+=5,u(c,f,M-1),f+=5,u(c,f,D-4),f+=4;for(var ht=0;ht<D;ht++)u(c,f+ht*3,g.itree[(g.ordr[ht]<<1)+1]);f+=3*D,f=t.F._codeTiny(z,g.itree,c,f),f=t.F._codeTiny(N,g.itree,c,f)}for(var pt=o,kt=0;kt<r;kt+=2){for(var St=i[kt],vt=St>>>23,j=pt+(St&(1<<23)-1);pt<j;)f=t.F._writeLit(a[pt++],K,c,f);if(vt!=0){var ct=i[kt+1],L=ct>>16,k=ct>>8&255,E=ct&255;f=t.F._writeLit(257+k,K,c,f),u(c,f,vt-g.of0[k]),f+=g.exb[k],f=t.F._writeLit(E,ut,c,f),p(c,f,L-g.df0[E]),f+=g.dxb[E],pt+=vt}}f=t.F._writeLit(256,K,c,f)}return f},t.F._copyExact=function(e,i,r,s,a){var o=a>>>3;return s[o]=r,s[o+1]=r>>>8,s[o+2]=255-s[o],s[o+3]=255-s[o+1],o+=4,s.set(new Uint8Array(e.buffer,i,r),o),a+(r+4<<3)},t.F.getTrees=function(){for(var e=t.F.U,i=t.F._hufTree(e.lhst,e.ltree,15),r=t.F._hufTree(e.dhst,e.dtree,15),s=[],a=t.F._lenCodes(e.ltree,s),o=[],l=t.F._lenCodes(e.dtree,o),c=0;c<s.length;c+=2)e.ihst[s[c]]++;for(var c=0;c<o.length;c+=2)e.ihst[o[c]]++;for(var f=t.F._hufTree(e.ihst,e.itree,7),g=19;g>4&&e.itree[(e.ordr[g-1]<<1)+1]==0;)g--;return[i,r,f,a,l,g,s,o]},t.F.getSecond=function(e){for(var i=[],r=0;r<e.length;r+=2)i.push(e[r+1]);return i},t.F.nonZero=function(e){for(var i="",r=0;r<e.length;r+=2)e[r+1]!=0&&(i+=(r>>1)+",");return i},t.F.contSize=function(e,i){for(var r=0,s=0;s<i.length;s++)r+=i[s]*e[(s<<1)+1];return r},t.F._codeTiny=function(e,i,r,s){for(var a=0;a<e.length;a+=2){var o=e[a],l=e[a+1];s=t.F._writeLit(o,i,r,s);var c=o==16?2:o==17?3:7;o>15&&(t.F._putsE(r,s,l,c),s+=c)}return s},t.F._lenCodes=function(e,i){for(var r=e.length;r!=2&&e[r-1]==0;)r-=2;for(var s=0;s<r;s+=2){var a=e[s+1],o=s+3<r?e[s+3]:-1,l=s+5<r?e[s+5]:-1,c=s==0?-1:e[s-1];if(a==0&&o==a&&l==a){for(var f=s+5;f+2<r&&e[f+2]==a;)f+=2;var g=Math.min(f+1-s>>>1,138);g<11?i.push(17,g-3):i.push(18,g-11),s+=g*2-2}else if(a==c&&o==a&&l==a){for(var f=s+5;f+2<r&&e[f+2]==a;)f+=2;var g=Math.min(f+1-s>>>1,6);i.push(16,g-3),s+=g*2-2}else i.push(a,0)}return r>>>1},t.F._hufTree=function(e,i,r){var s=[],a=e.length,o=i.length,l=0;for(l=0;l<o;l+=2)i[l]=0,i[l+1]=0;for(l=0;l<a;l++)e[l]!=0&&s.push({lit:l,f:e[l]});var c=s.length,f=s.slice(0);if(c==0)return 0;if(c==1){var g=s[0].lit,f=g==0?1:0;return i[(g<<1)+1]=1,i[(f<<1)+1]=1,1}s.sort(function(P,M){return P.f-M.f});var p=s[0],u=s[1],y=0,x=1,b=2;for(s[0]={lit:-1,f:p.f+u.f,l:p,r:u,d:0};x!=c-1;)y!=x&&(b==c||s[y].f<s[b].f)?p=s[y++]:p=s[b++],y!=x&&(b==c||s[y].f<s[b].f)?u=s[y++]:u=s[b++],s[x++]={lit:-1,f:p.f+u.f,l:p,r:u};var A=t.F.setDepth(s[x-1],0);for(A>r&&(t.F.restrictDepth(f,r,A),A=r),l=0;l<c;l++)i[(f[l].lit<<1)+1]=f[l].d;return A},t.F.setDepth=function(e,i){return e.lit!=-1?(e.d=i,i):Math.max(t.F.setDepth(e.l,i+1),t.F.setDepth(e.r,i+1))},t.F.restrictDepth=function(e,i,r){var s=0,a=1<<r-i,o=0;for(e.sort(function(c,f){return f.d==c.d?c.f-f.f:f.d-c.d}),s=0;s<e.length&&e[s].d>i;s++){var l=e[s].d;e[s].d=i,o+=a-(1<<r-l)}for(o=o>>>r-i;o>0;){var l=e[s].d;l<i?(e[s].d++,o-=1<<i-l-1):s++}for(;s>=0;s--)e[s].d==i&&o<0&&(e[s].d--,o++);o!=0&&console.log("debt left")},t.F._goodIndex=function(e,i){var r=0;return i[r|16]<=e&&(r|=16),i[r|8]<=e&&(r|=8),i[r|4]<=e&&(r|=4),i[r|2]<=e&&(r|=2),i[r|1]<=e&&(r|=1),r},t.F._writeLit=function(e,i,r,s){return t.F._putsF(r,s,i[e<<1]),s+i[(e<<1)+1]},t.F.inflate=function(e,i){var r=Uint8Array;if(e[0]==3&&e[1]==0)return i||new r(0);var s=t.F,a=s._bitsF,o=s._bitsE,l=s._decodeTiny,c=s.makeCodes,f=s.codes2map,g=s._get17,p=s.U,u=i==null;u&&(i=new r(e.length>>>2<<3));for(var y=0,x=0,b=0,A=0,P=0,M=0,D=0,z=0,N=0,F,G;y==0;){if(y=a(e,N,1),x=a(e,N+1,2),N+=3,x==0){N&7&&(N+=8-(N&7));var H=(N>>>3)+4,$=e[H-4]|e[H-3]<<8;u&&(i=t.F._check(i,z+$)),i.set(new r(e.buffer,e.byteOffset+H,$),z),N=H+$<<3,z+=$;continue}if(u&&(i=t.F._check(i,z+131072)),x==1&&(F=p.flmap,G=p.fdmap,M=511,D=31),x==2){b=o(e,N,5)+257,A=o(e,N+5,5)+1,P=o(e,N+10,4)+4,N+=14;for(var Y=0;Y<38;Y+=2)p.itree[Y]=0,p.itree[Y+1]=0;for(var K=1,Y=0;Y<P;Y++){var ut=o(e,N+Y*3,3);p.itree[(p.ordr[Y]<<1)+1]=ut,ut>K&&(K=ut)}N+=3*P,c(p.itree,K),f(p.itree,K,p.imap),F=p.lmap,G=p.dmap,N=l(p.imap,(1<<K)-1,b+A,e,N,p.ttree);var ht=s._copyOut(p.ttree,0,b,p.ltree);M=(1<<ht)-1;var pt=s._copyOut(p.ttree,b,A,p.dtree);D=(1<<pt)-1,c(p.ltree,ht),f(p.ltree,ht,F),c(p.dtree,pt),f(p.dtree,pt,G)}for(;;){var kt=F[g(e,N)&M];N+=kt&15;var St=kt>>>4;if(!(St>>>8))i[z++]=St;else{if(St==256)break;var vt=z+St-254;if(St>264){var j=p.ldef[St-257];vt=z+(j>>>3)+o(e,N,j&7),N+=j&7}var ct=G[g(e,N)&D];N+=ct&15;var L=ct>>>4,k=p.ddef[L],E=(k>>>4)+a(e,N,k&15);for(N+=k&15,u&&(i=t.F._check(i,z+131072));z<vt;)i[z]=i[z++-E],i[z]=i[z++-E],i[z]=i[z++-E],i[z]=i[z++-E];z=vt}}}return i.length==z?i:i.slice(0,z)},t.F._check=function(e,i){var r=e.length;if(i<=r)return e;var s=new Uint8Array(Math.max(r<<1,i));return s.set(e,0),s},t.F._decodeTiny=function(e,i,r,s,a,o){for(var l=t.F._bitsE,c=t.F._get17,f=0;f<r;){var g=e[c(s,a)&i];a+=g&15;var p=g>>>4;if(p<=15)o[f]=p,f++;else{var u=0,y=0;p==16?(y=3+l(s,a,2),a+=2,u=o[f-1]):p==17?(y=3+l(s,a,3),a+=3):p==18&&(y=11+l(s,a,7),a+=7);for(var x=f+y;f<x;)o[f]=u,f++}}return a},t.F._copyOut=function(e,i,r,s){for(var a=0,o=0,l=s.length>>>1;o<r;){var c=e[o+i];s[o<<1]=0,s[(o<<1)+1]=c,c>a&&(a=c),o++}for(;o<l;)s[o<<1]=0,s[(o<<1)+1]=0,o++;return a},t.F.makeCodes=function(e,i){for(var r=t.F.U,s=e.length,a,o,l,c,f,g=r.bl_count,c=0;c<=i;c++)g[c]=0;for(c=1;c<s;c+=2)g[e[c]]++;var p=r.next_code;for(a=0,g[0]=0,o=1;o<=i;o++)a=a+g[o-1]<<1,p[o]=a;for(l=0;l<s;l+=2)f=e[l+1],f!=0&&(e[l]=p[f],p[f]++)},t.F.codes2map=function(e,i,r){for(var s=e.length,a=t.F.U,o=a.rev15,l=0;l<s;l+=2)if(e[l+1]!=0)for(var c=l>>1,f=e[l+1],g=c<<4|f,p=i-f,u=e[l]<<p,y=u+(1<<p);u!=y;){var x=o[u]>>>15-i;r[x]=g,u++}},t.F.revCodes=function(e,i){for(var r=t.F.U.rev15,s=15-i,a=0;a<e.length;a+=2){var o=e[a]<<i-e[a+1];e[a]=r[o]>>>s}},t.F._putsE=function(e,i,r){r=r<<(i&7);var s=i>>>3;e[s]|=r,e[s+1]|=r>>>8},t.F._putsF=function(e,i,r){r=r<<(i&7);var s=i>>>3;e[s]|=r,e[s+1]|=r>>>8,e[s+2]|=r>>>16},t.F._bitsE=function(e,i,r){return(e[i>>>3]|e[(i>>>3)+1]<<8)>>>(i&7)&(1<<r)-1},t.F._bitsF=function(e,i,r){return(e[i>>>3]|e[(i>>>3)+1]<<8|e[(i>>>3)+2]<<16)>>>(i&7)&(1<<r)-1},t.F._get17=function(e,i){return(e[i>>>3]|e[(i>>>3)+1]<<8|e[(i>>>3)+2]<<16)>>>(i&7)},t.F._get25=function(e,i){return(e[i>>>3]|e[(i>>>3)+1]<<8|e[(i>>>3)+2]<<16|e[(i>>>3)+3]<<24)>>>(i&7)},t.F.U=function(){var e=Uint16Array,i=Uint32Array;return{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[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],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[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],ddef:new i(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new i(286),dhst:new i(30),ihst:new i(19),lits:new i(15e3),strt:new e(65536),prev:new e(32768)}}(),function(){for(var e=t.F.U,i=32768,r=0;r<i;r++){var s=r;s=(s&2863311530)>>>1|(s&1431655765)<<1,s=(s&3435973836)>>>2|(s&858993459)<<2,s=(s&4042322160)>>>4|(s&252645135)<<4,s=(s&4278255360)>>>8|(s&16711935)<<8,e.rev15[r]=(s>>>16|s<<16)>>>17}function a(o,l,c){for(;l--!=0;)o.push(0,c)}for(var r=0;r<32;r++)e.ldef[r]=e.of0[r]<<3|e.exb[r],e.ddef[r]=e.df0[r]<<4|e.dxb[r];a(e.fltree,144,8),a(e.fltree,112,9),a(e.fltree,24,7),a(e.fltree,8,8),t.F.makeCodes(e.fltree,9),t.F.codes2map(e.fltree,9,e.flmap),t.F.revCodes(e.fltree,9),a(e.fdtree,32,5),t.F.makeCodes(e.fdtree,5),t.F.codes2map(e.fdtree,5,e.fdmap),t.F.revCodes(e.fdtree,5),a(e.itree,19,0),a(e.ltree,286,0),a(e.dtree,30,0),a(e.ttree,320,0)}()})(bo);var ff=bo.exports;const To=Yi(ff);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const uf=4,Co=0,Eo=1,df=2;function Hn(n){let t=n.length;for(;--t>=0;)n[t]=0}const pf=0,ko=1,gf=2,mf=3,vf=258,xs=29,wi=256,yi=wi+1+xs,jn=30,bs=19,So=2*yi+1,bn=15,Ts=16,_f=7,Cs=256,Ao=16,Po=17,Io=18,Es=new Uint8Array([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]),fr=new Uint8Array([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]),wf=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Mo=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),yf=512,Be=new Array((yi+2)*2);Hn(Be);const xi=new Array(jn*2);Hn(xi);const bi=new Array(yf);Hn(bi);const Ti=new Array(vf-mf+1);Hn(Ti);const ks=new Array(xs);Hn(ks);const ur=new Array(jn);Hn(ur);function Ss(n,t,e,i,r){this.static_tree=n,this.extra_bits=t,this.extra_base=e,this.elems=i,this.max_length=r,this.has_stree=n&&n.length}let Lo,Do,Ro;function As(n,t){this.dyn_tree=n,this.max_code=0,this.stat_desc=t}const Oo=n=>n<256?bi[n]:bi[256+(n>>>7)],Ci=(n,t)=>{n.pending_buf[n.pending++]=t&255,n.pending_buf[n.pending++]=t>>>8&255},re=(n,t,e)=>{n.bi_valid>Ts-e?(n.bi_buf|=t<<n.bi_valid&65535,Ci(n,n.bi_buf),n.bi_buf=t>>Ts-n.bi_valid,n.bi_valid+=e-Ts):(n.bi_buf|=t<<n.bi_valid&65535,n.bi_valid+=e)},Se=(n,t,e)=>{re(n,e[t*2],e[t*2+1])},Fo=(n,t)=>{let e=0;do e|=n&1,n>>>=1,e<<=1;while(--t>0);return e>>>1},xf=n=>{n.bi_valid===16?(Ci(n,n.bi_buf),n.bi_buf=0,n.bi_valid=0):n.bi_valid>=8&&(n.pending_buf[n.pending++]=n.bi_buf&255,n.bi_buf>>=8,n.bi_valid-=8)},bf=(n,t)=>{const e=t.dyn_tree,i=t.max_code,r=t.stat_desc.static_tree,s=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,l=t.stat_desc.max_length;let c,f,g,p,u,y,x=0;for(p=0;p<=bn;p++)n.bl_count[p]=0;for(e[n.heap[n.heap_max]*2+1]=0,c=n.heap_max+1;c<So;c++)f=n.heap[c],p=e[e[f*2+1]*2+1]+1,p>l&&(p=l,x++),e[f*2+1]=p,!(f>i)&&(n.bl_count[p]++,u=0,f>=o&&(u=a[f-o]),y=e[f*2],n.opt_len+=y*(p+u),s&&(n.static_len+=y*(r[f*2+1]+u)));if(x!==0){do{for(p=l-1;n.bl_count[p]===0;)p--;n.bl_count[p]--,n.bl_count[p+1]+=2,n.bl_count[l]--,x-=2}while(x>0);for(p=l;p!==0;p--)for(f=n.bl_count[p];f!==0;)g=n.heap[--c],!(g>i)&&(e[g*2+1]!==p&&(n.opt_len+=(p-e[g*2+1])*e[g*2],e[g*2+1]=p),f--)}},zo=(n,t,e)=>{const i=new Array(bn+1);let r=0,s,a;for(s=1;s<=bn;s++)r=r+e[s-1]<<1,i[s]=r;for(a=0;a<=t;a++){let o=n[a*2+1];o!==0&&(n[a*2]=Fo(i[o]++,o))}},Tf=()=>{let n,t,e,i,r;const s=new Array(bn+1);for(e=0,i=0;i<xs-1;i++)for(ks[i]=e,n=0;n<1<<Es[i];n++)Ti[e++]=i;for(Ti[e-1]=i,r=0,i=0;i<16;i++)for(ur[i]=r,n=0;n<1<<fr[i];n++)bi[r++]=i;for(r>>=7;i<jn;i++)for(ur[i]=r<<7,n=0;n<1<<fr[i]-7;n++)bi[256+r++]=i;for(t=0;t<=bn;t++)s[t]=0;for(n=0;n<=143;)Be[n*2+1]=8,n++,s[8]++;for(;n<=255;)Be[n*2+1]=9,n++,s[9]++;for(;n<=279;)Be[n*2+1]=7,n++,s[7]++;for(;n<=287;)Be[n*2+1]=8,n++,s[8]++;for(zo(Be,yi+1,s),n=0;n<jn;n++)xi[n*2+1]=5,xi[n*2]=Fo(n,5);Lo=new Ss(Be,Es,wi+1,yi,bn),Do=new Ss(xi,fr,0,jn,bn),Ro=new Ss(new Array(0),wf,0,bs,_f)},Uo=n=>{let t;for(t=0;t<yi;t++)n.dyn_ltree[t*2]=0;for(t=0;t<jn;t++)n.dyn_dtree[t*2]=0;for(t=0;t<bs;t++)n.bl_tree[t*2]=0;n.dyn_ltree[Cs*2]=1,n.opt_len=n.static_len=0,n.sym_next=n.matches=0},No=n=>{n.bi_valid>8?Ci(n,n.bi_buf):n.bi_valid>0&&(n.pending_buf[n.pending++]=n.bi_buf),n.bi_buf=0,n.bi_valid=0},Bo=(n,t,e,i)=>{const r=t*2,s=e*2;return n[r]<n[s]||n[r]===n[s]&&i[t]<=i[e]},Ps=(n,t,e)=>{const i=n.heap[e];let r=e<<1;for(;r<=n.heap_len&&(r<n.heap_len&&Bo(t,n.heap[r+1],n.heap[r],n.depth)&&r++,!Bo(t,i,n.heap[r],n.depth));)n.heap[e]=n.heap[r],e=r,r<<=1;n.heap[e]=i},Go=(n,t,e)=>{let i,r,s=0,a,o;if(n.sym_next!==0)do i=n.pending_buf[n.sym_buf+s++]&255,i+=(n.pending_buf[n.sym_buf+s++]&255)<<8,r=n.pending_buf[n.sym_buf+s++],i===0?Se(n,r,t):(a=Ti[r],Se(n,a+wi+1,t),o=Es[a],o!==0&&(r-=ks[a],re(n,r,o)),i--,a=Oo(i),Se(n,a,e),o=fr[a],o!==0&&(i-=ur[a],re(n,i,o)));while(s<n.sym_next);Se(n,Cs,t)},Is=(n,t)=>{const e=t.dyn_tree,i=t.stat_desc.static_tree,r=t.stat_desc.has_stree,s=t.stat_desc.elems;let a,o,l=-1,c;for(n.heap_len=0,n.heap_max=So,a=0;a<s;a++)e[a*2]!==0?(n.heap[++n.heap_len]=l=a,n.depth[a]=0):e[a*2+1]=0;for(;n.heap_len<2;)c=n.heap[++n.heap_len]=l<2?++l:0,e[c*2]=1,n.depth[c]=0,n.opt_len--,r&&(n.static_len-=i[c*2+1]);for(t.max_code=l,a=n.heap_len>>1;a>=1;a--)Ps(n,e,a);c=s;do a=n.heap[1],n.heap[1]=n.heap[n.heap_len--],Ps(n,e,1),o=n.heap[1],n.heap[--n.heap_max]=a,n.heap[--n.heap_max]=o,e[c*2]=e[a*2]+e[o*2],n.depth[c]=(n.depth[a]>=n.depth[o]?n.depth[a]:n.depth[o])+1,e[a*2+1]=e[o*2+1]=c,n.heap[1]=c++,Ps(n,e,1);while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],bf(n,t),zo(e,l,n.bl_count)},Ho=(n,t,e)=>{let i,r=-1,s,a=t[0*2+1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),t[(e+1)*2+1]=65535,i=0;i<=e;i++)s=a,a=t[(i+1)*2+1],!(++o<l&&s===a)&&(o<c?n.bl_tree[s*2]+=o:s!==0?(s!==r&&n.bl_tree[s*2]++,n.bl_tree[Ao*2]++):o<=10?n.bl_tree[Po*2]++:n.bl_tree[Io*2]++,o=0,r=s,a===0?(l=138,c=3):s===a?(l=6,c=3):(l=7,c=4))},jo=(n,t,e)=>{let i,r=-1,s,a=t[0*2+1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),i=0;i<=e;i++)if(s=a,a=t[(i+1)*2+1],!(++o<l&&s===a)){if(o<c)do Se(n,s,n.bl_tree);while(--o!==0);else s!==0?(s!==r&&(Se(n,s,n.bl_tree),o--),Se(n,Ao,n.bl_tree),re(n,o-3,2)):o<=10?(Se(n,Po,n.bl_tree),re(n,o-3,3)):(Se(n,Io,n.bl_tree),re(n,o-11,7));o=0,r=s,a===0?(l=138,c=3):s===a?(l=6,c=3):(l=7,c=4)}},Cf=n=>{let t;for(Ho(n,n.dyn_ltree,n.l_desc.max_code),Ho(n,n.dyn_dtree,n.d_desc.max_code),Is(n,n.bl_desc),t=bs-1;t>=3&&n.bl_tree[Mo[t]*2+1]===0;t--);return n.opt_len+=3*(t+1)+5+5+4,t},Ef=(n,t,e,i)=>{let r;for(re(n,t-257,5),re(n,e-1,5),re(n,i-4,4),r=0;r<i;r++)re(n,n.bl_tree[Mo[r]*2+1],3);jo(n,n.dyn_ltree,t-1),jo(n,n.dyn_dtree,e-1)},kf=n=>{let t=4093624447,e;for(e=0;e<=31;e++,t>>>=1)if(t&1&&n.dyn_ltree[e*2]!==0)return Co;if(n.dyn_ltree[9*2]!==0||n.dyn_ltree[10*2]!==0||n.dyn_ltree[13*2]!==0)return Eo;for(e=32;e<wi;e++)if(n.dyn_ltree[e*2]!==0)return Eo;return Co};let Vo=!1;const Sf=n=>{Vo||(Tf(),Vo=!0),n.l_desc=new As(n.dyn_ltree,Lo),n.d_desc=new As(n.dyn_dtree,Do),n.bl_desc=new As(n.bl_tree,Ro),n.bi_buf=0,n.bi_valid=0,Uo(n)},Xo=(n,t,e,i)=>{re(n,(pf<<1)+(i?1:0),3),No(n),Ci(n,e),Ci(n,~e),e&&n.pending_buf.set(n.window.subarray(t,t+e),n.pending),n.pending+=e},Af=n=>{re(n,ko<<1,3),Se(n,Cs,Be),xf(n)},Pf=(n,t,e,i)=>{let r,s,a=0;n.level>0?(n.strm.data_type===df&&(n.strm.data_type=kf(n)),Is(n,n.l_desc),Is(n,n.d_desc),a=Cf(n),r=n.opt_len+3+7>>>3,s=n.static_len+3+7>>>3,s<=r&&(r=s)):r=s=e+5,e+4<=r&&t!==-1?Xo(n,t,e,i):n.strategy===uf||s===r?(re(n,(ko<<1)+(i?1:0),3),Go(n,Be,xi)):(re(n,(gf<<1)+(i?1:0),3),Ef(n,n.l_desc.max_code+1,n.d_desc.max_code+1,a+1),Go(n,n.dyn_ltree,n.dyn_dtree)),Uo(n),i&&No(n)},If=(n,t,e)=>(n.pending_buf[n.sym_buf+n.sym_next++]=t,n.pending_buf[n.sym_buf+n.sym_next++]=t>>8,n.pending_buf[n.sym_buf+n.sym_next++]=e,t===0?n.dyn_ltree[e*2]++:(n.matches++,t--,n.dyn_ltree[(Ti[e]+wi+1)*2]++,n.dyn_dtree[Oo(t)*2]++),n.sym_next===n.sym_end);var Mf=Sf,Lf=Xo,Df=Pf,Rf=If,Of=Af,Ff={_tr_init:Mf,_tr_stored_block:Lf,_tr_flush_block:Df,_tr_tally:Rf,_tr_align:Of},Ei=(n,t,e,i)=>{let r=n&65535|0,s=n>>>16&65535|0,a=0;for(;e!==0;){a=e>2e3?2e3:e,e-=a;do r=r+t[i++]|0,s=s+r|0;while(--a);r%=65521,s%=65521}return r|s<<16|0};const zf=()=>{let n,t=[];for(var e=0;e<256;e++){n=e;for(var i=0;i<8;i++)n=n&1?3988292384^n>>>1:n>>>1;t[e]=n}return t},Uf=new Uint32Array(zf());var Yt=(n,t,e,i)=>{const r=Uf,s=i+e;n^=-1;for(let a=i;a<s;a++)n=n>>>8^r[(n^t[a])&255];return n^-1},Tn={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Cn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Nf,_tr_stored_block:Ms,_tr_flush_block:Bf,_tr_tally:rn,_tr_align:Gf}=Ff,{Z_NO_FLUSH:sn,Z_PARTIAL_FLUSH:Hf,Z_FULL_FLUSH:jf,Z_FINISH:me,Z_BLOCK:Yo,Z_OK:Wt,Z_STREAM_END:Zo,Z_STREAM_ERROR:Ae,Z_DATA_ERROR:Vf,Z_BUF_ERROR:Ls,Z_DEFAULT_COMPRESSION:Xf,Z_FILTERED:Yf,Z_HUFFMAN_ONLY:dr,Z_RLE:Zf,Z_FIXED:$f,Z_DEFAULT_STRATEGY:qf,Z_UNKNOWN:Wf,Z_DEFLATED:pr}=Cn,Jf=9,Kf=15,Qf=8,tu=29,Ds=256+1+tu,eu=30,nu=19,iu=2*Ds+1,ru=15,Lt=3,an=258,Pe=an+Lt+1,su=32,Vn=42,Rs=57,Os=69,Fs=73,zs=91,Us=103,En=113,ki=666,ne=1,Xn=2,kn=3,Yn=4,au=3,Sn=(n,t)=>(n.msg=Tn[t],t),$o=n=>n*2-(n>4?9:0),on=n=>{let t=n.length;for(;--t>=0;)n[t]=0},ou=n=>{let t,e,i,r=n.w_size;t=n.hash_size,i=t;do e=n.head[--i],n.head[i]=e>=r?e-r:0;while(--t);t=r,i=t;do e=n.prev[--i],n.prev[i]=e>=r?e-r:0;while(--t)};let ln=(n,t,e)=>(t<<n.hash_shift^e)&n.hash_mask;const he=n=>{const t=n.state;let e=t.pending;e>n.avail_out&&(e=n.avail_out),e!==0&&(n.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+e),n.next_out),n.next_out+=e,t.pending_out+=e,n.total_out+=e,n.avail_out-=e,t.pending-=e,t.pending===0&&(t.pending_out=0))},fe=(n,t)=>{Bf(n,n.block_start>=0?n.block_start:-1,n.strstart-n.block_start,t),n.block_start=n.strstart,he(n.strm)},Ft=(n,t)=>{n.pending_buf[n.pending++]=t},Si=(n,t)=>{n.pending_buf[n.pending++]=t>>>8&255,n.pending_buf[n.pending++]=t&255},Ns=(n,t,e,i)=>{let r=n.avail_in;return r>i&&(r=i),r===0?0:(n.avail_in-=r,t.set(n.input.subarray(n.next_in,n.next_in+r),e),n.state.wrap===1?n.adler=Ei(n.adler,t,r,e):n.state.wrap===2&&(n.adler=Yt(n.adler,t,r,e)),n.next_in+=r,n.total_in+=r,r)},qo=(n,t)=>{let e=n.max_chain_length,i=n.strstart,r,s,a=n.prev_length,o=n.nice_match;const l=n.strstart>n.w_size-Pe?n.strstart-(n.w_size-Pe):0,c=n.window,f=n.w_mask,g=n.prev,p=n.strstart+an;let u=c[i+a-1],y=c[i+a];n.prev_length>=n.good_match&&(e>>=2),o>n.lookahead&&(o=n.lookahead);do if(r=t,!(c[r+a]!==y||c[r+a-1]!==u||c[r]!==c[i]||c[++r]!==c[i+1])){i+=2,r++;do;while(c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&i<p);if(s=an-(p-i),i=p-an,s>a){if(n.match_start=t,a=s,s>=o)break;u=c[i+a-1],y=c[i+a]}}while((t=g[t&f])>l&&--e!==0);return a<=n.lookahead?a:n.lookahead},Zn=n=>{const t=n.w_size;let e,i,r;do{if(i=n.window_size-n.lookahead-n.strstart,n.strstart>=t+(t-Pe)&&(n.window.set(n.window.subarray(t,t+t-i),0),n.match_start-=t,n.strstart-=t,n.block_start-=t,n.insert>n.strstart&&(n.insert=n.strstart),ou(n),i+=t),n.strm.avail_in===0)break;if(e=Ns(n.strm,n.window,n.strstart+n.lookahead,i),n.lookahead+=e,n.lookahead+n.insert>=Lt)for(r=n.strstart-n.insert,n.ins_h=n.window[r],n.ins_h=ln(n,n.ins_h,n.window[r+1]);n.insert&&(n.ins_h=ln(n,n.ins_h,n.window[r+Lt-1]),n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,n.insert--,!(n.lookahead+n.insert<Lt)););}while(n.lookahead<Pe&&n.strm.avail_in!==0)},Wo=(n,t)=>{let e=n.pending_buf_size-5>n.w_size?n.w_size:n.pending_buf_size-5,i,r,s,a=0,o=n.strm.avail_in;do{if(i=65535,s=n.bi_valid+42>>3,n.strm.avail_out<s||(s=n.strm.avail_out-s,r=n.strstart-n.block_start,i>r+n.strm.avail_in&&(i=r+n.strm.avail_in),i>s&&(i=s),i<e&&(i===0&&t!==me||t===sn||i!==r+n.strm.avail_in)))break;a=t===me&&i===r+n.strm.avail_in?1:0,Ms(n,0,0,a),n.pending_buf[n.pending-4]=i,n.pending_buf[n.pending-3]=i>>8,n.pending_buf[n.pending-2]=~i,n.pending_buf[n.pending-1]=~i>>8,he(n.strm),r&&(r>i&&(r=i),n.strm.output.set(n.window.subarray(n.block_start,n.block_start+r),n.strm.next_out),n.strm.next_out+=r,n.strm.avail_out-=r,n.strm.total_out+=r,n.block_start+=r,i-=r),i&&(Ns(n.strm,n.strm.output,n.strm.next_out,i),n.strm.next_out+=i,n.strm.avail_out-=i,n.strm.total_out+=i)}while(a===0);return o-=n.strm.avail_in,o&&(o>=n.w_size?(n.matches=2,n.window.set(n.strm.input.subarray(n.strm.next_in-n.w_size,n.strm.next_in),0),n.strstart=n.w_size,n.insert=n.strstart):(n.window_size-n.strstart<=o&&(n.strstart-=n.w_size,n.window.set(n.window.subarray(n.w_size,n.w_size+n.strstart),0),n.matches<2&&n.matches++,n.insert>n.strstart&&(n.insert=n.strstart)),n.window.set(n.strm.input.subarray(n.strm.next_in-o,n.strm.next_in),n.strstart),n.strstart+=o,n.insert+=o>n.w_size-n.insert?n.w_size-n.insert:o),n.block_start=n.strstart),n.high_water<n.strstart&&(n.high_water=n.strstart),a?Yn:t!==sn&&t!==me&&n.strm.avail_in===0&&n.strstart===n.block_start?Xn:(s=n.window_size-n.strstart,n.strm.avail_in>s&&n.block_start>=n.w_size&&(n.block_start-=n.w_size,n.strstart-=n.w_size,n.window.set(n.window.subarray(n.w_size,n.w_size+n.strstart),0),n.matches<2&&n.matches++,s+=n.w_size,n.insert>n.strstart&&(n.insert=n.strstart)),s>n.strm.avail_in&&(s=n.strm.avail_in),s&&(Ns(n.strm,n.window,n.strstart,s),n.strstart+=s,n.insert+=s>n.w_size-n.insert?n.w_size-n.insert:s),n.high_water<n.strstart&&(n.high_water=n.strstart),s=n.bi_valid+42>>3,s=n.pending_buf_size-s>65535?65535:n.pending_buf_size-s,e=s>n.w_size?n.w_size:s,r=n.strstart-n.block_start,(r>=e||(r||t===me)&&t!==sn&&n.strm.avail_in===0&&r<=s)&&(i=r>s?s:r,a=t===me&&n.strm.avail_in===0&&i===r?1:0,Ms(n,n.block_start,i,a),n.block_start+=i,he(n.strm)),a?kn:ne)},Bs=(n,t)=>{let e,i;for(;;){if(n.lookahead<Pe){if(Zn(n),n.lookahead<Pe&&t===sn)return ne;if(n.lookahead===0)break}if(e=0,n.lookahead>=Lt&&(n.ins_h=ln(n,n.ins_h,n.window[n.strstart+Lt-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),e!==0&&n.strstart-e<=n.w_size-Pe&&(n.match_length=qo(n,e)),n.match_length>=Lt)if(i=rn(n,n.strstart-n.match_start,n.match_length-Lt),n.lookahead-=n.match_length,n.match_length<=n.max_lazy_match&&n.lookahead>=Lt){n.match_length--;do n.strstart++,n.ins_h=ln(n,n.ins_h,n.window[n.strstart+Lt-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart;while(--n.match_length!==0);n.strstart++}else n.strstart+=n.match_length,n.match_length=0,n.ins_h=n.window[n.strstart],n.ins_h=ln(n,n.ins_h,n.window[n.strstart+1]);else i=rn(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++;if(i&&(fe(n,!1),n.strm.avail_out===0))return ne}return n.insert=n.strstart<Lt-1?n.strstart:Lt-1,t===me?(fe(n,!0),n.strm.avail_out===0?kn:Yn):n.sym_next&&(fe(n,!1),n.strm.avail_out===0)?ne:Xn},$n=(n,t)=>{let e,i,r;for(;;){if(n.lookahead<Pe){if(Zn(n),n.lookahead<Pe&&t===sn)return ne;if(n.lookahead===0)break}if(e=0,n.lookahead>=Lt&&(n.ins_h=ln(n,n.ins_h,n.window[n.strstart+Lt-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),n.prev_length=n.match_length,n.prev_match=n.match_start,n.match_length=Lt-1,e!==0&&n.prev_length<n.max_lazy_match&&n.strstart-e<=n.w_size-Pe&&(n.match_length=qo(n,e),n.match_length<=5&&(n.strategy===Yf||n.match_length===Lt&&n.strstart-n.match_start>4096)&&(n.match_length=Lt-1)),n.prev_length>=Lt&&n.match_length<=n.prev_length){r=n.strstart+n.lookahead-Lt,i=rn(n,n.strstart-1-n.prev_match,n.prev_length-Lt),n.lookahead-=n.prev_length-1,n.prev_length-=2;do++n.strstart<=r&&(n.ins_h=ln(n,n.ins_h,n.window[n.strstart+Lt-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart);while(--n.prev_length!==0);if(n.match_available=0,n.match_length=Lt-1,n.strstart++,i&&(fe(n,!1),n.strm.avail_out===0))return ne}else if(n.match_available){if(i=rn(n,0,n.window[n.strstart-1]),i&&fe(n,!1),n.strstart++,n.lookahead--,n.strm.avail_out===0)return ne}else n.match_available=1,n.strstart++,n.lookahead--}return n.match_available&&(i=rn(n,0,n.window[n.strstart-1]),n.match_available=0),n.insert=n.strstart<Lt-1?n.strstart:Lt-1,t===me?(fe(n,!0),n.strm.avail_out===0?kn:Yn):n.sym_next&&(fe(n,!1),n.strm.avail_out===0)?ne:Xn},lu=(n,t)=>{let e,i,r,s;const a=n.window;for(;;){if(n.lookahead<=an){if(Zn(n),n.lookahead<=an&&t===sn)return ne;if(n.lookahead===0)break}if(n.match_length=0,n.lookahead>=Lt&&n.strstart>0&&(r=n.strstart-1,i=a[r],i===a[++r]&&i===a[++r]&&i===a[++r])){s=n.strstart+an;do;while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&r<s);n.match_length=an-(s-r),n.match_length>n.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>=Lt?(e=rn(n,1,n.match_length-Lt),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(e=rn(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),e&&(fe(n,!1),n.strm.avail_out===0))return ne}return n.insert=0,t===me?(fe(n,!0),n.strm.avail_out===0?kn:Yn):n.sym_next&&(fe(n,!1),n.strm.avail_out===0)?ne:Xn},cu=(n,t)=>{let e;for(;;){if(n.lookahead===0&&(Zn(n),n.lookahead===0)){if(t===sn)return ne;break}if(n.match_length=0,e=rn(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++,e&&(fe(n,!1),n.strm.avail_out===0))return ne}return n.insert=0,t===me?(fe(n,!0),n.strm.avail_out===0?kn:Yn):n.sym_next&&(fe(n,!1),n.strm.avail_out===0)?ne:Xn};function Ie(n,t,e,i,r){this.good_length=n,this.max_lazy=t,this.nice_length=e,this.max_chain=i,this.func=r}const Ai=[new Ie(0,0,0,0,Wo),new Ie(4,4,8,4,Bs),new Ie(4,5,16,8,Bs),new Ie(4,6,32,32,Bs),new Ie(4,4,16,16,$n),new Ie(8,16,32,32,$n),new Ie(8,16,128,128,$n),new Ie(8,32,128,256,$n),new Ie(32,128,258,1024,$n),new Ie(32,258,258,4096,$n)],hu=n=>{n.window_size=2*n.w_size,on(n.head),n.max_lazy_match=Ai[n.level].max_lazy,n.good_match=Ai[n.level].good_length,n.nice_match=Ai[n.level].nice_length,n.max_chain_length=Ai[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=Lt-1,n.match_available=0,n.ins_h=0};function fu(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=pr,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(iu*2),this.dyn_dtree=new Uint16Array((2*eu+1)*2),this.bl_tree=new Uint16Array((2*nu+1)*2),on(this.dyn_ltree),on(this.dyn_dtree),on(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(ru+1),this.heap=new Uint16Array(2*Ds+1),on(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Ds+1),on(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Pi=n=>{if(!n)return 1;const t=n.state;return!t||t.strm!==n||t.status!==Vn&&t.status!==Rs&&t.status!==Os&&t.status!==Fs&&t.status!==zs&&t.status!==Us&&t.status!==En&&t.status!==ki?1:0},Jo=n=>{if(Pi(n))return Sn(n,Ae);n.total_in=n.total_out=0,n.data_type=Wf;const t=n.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?Rs:t.wrap?Vn:En,n.adler=t.wrap===2?0:1,t.last_flush=-2,Nf(t),Wt},Ko=n=>{const t=Jo(n);return t===Wt&&hu(n.state),t},uu=(n,t)=>Pi(n)||n.state.wrap!==2?Ae:(n.state.gzhead=t,Wt),Qo=(n,t,e,i,r,s)=>{if(!n)return Ae;let a=1;if(t===Xf&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),r<1||r>Jf||e!==pr||i<8||i>15||t<0||t>9||s<0||s>$f||i===8&&a!==1)return Sn(n,Ae);i===8&&(i=9);const o=new fu;return n.state=o,o.strm=n,o.status=Vn,o.wrap=a,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=r+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+Lt-1)/Lt),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<r+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=(o.lit_bufsize-1)*3,o.level=t,o.strategy=s,o.method=e,Ko(n)},du=(n,t)=>Qo(n,t,pr,Kf,Qf,qf),pu=(n,t)=>{if(Pi(n)||t>Yo||t<0)return n?Sn(n,Ae):Ae;const e=n.state;if(!n.output||n.avail_in!==0&&!n.input||e.status===ki&&t!==me)return Sn(n,n.avail_out===0?Ls:Ae);const i=e.last_flush;if(e.last_flush=t,e.pending!==0){if(he(n),n.avail_out===0)return e.last_flush=-1,Wt}else if(n.avail_in===0&&$o(t)<=$o(i)&&t!==me)return Sn(n,Ls);if(e.status===ki&&n.avail_in!==0)return Sn(n,Ls);if(e.status===Vn&&e.wrap===0&&(e.status=En),e.status===Vn){let r=pr+(e.w_bits-8<<4)<<8,s=-1;if(e.strategy>=dr||e.level<2?s=0:e.level<6?s=1:e.level===6?s=2:s=3,r|=s<<6,e.strstart!==0&&(r|=su),r+=31-r%31,Si(e,r),e.strstart!==0&&(Si(e,n.adler>>>16),Si(e,n.adler&65535)),n.adler=1,e.status=En,he(n),e.pending!==0)return e.last_flush=-1,Wt}if(e.status===Rs){if(n.adler=0,Ft(e,31),Ft(e,139),Ft(e,8),e.gzhead)Ft(e,(e.gzhead.text?1:0)+(e.gzhead.hcrc?2:0)+(e.gzhead.extra?4:0)+(e.gzhead.name?8:0)+(e.gzhead.comment?16:0)),Ft(e,e.gzhead.time&255),Ft(e,e.gzhead.time>>8&255),Ft(e,e.gzhead.time>>16&255),Ft(e,e.gzhead.time>>24&255),Ft(e,e.level===9?2:e.strategy>=dr||e.level<2?4:0),Ft(e,e.gzhead.os&255),e.gzhead.extra&&e.gzhead.extra.length&&(Ft(e,e.gzhead.extra.length&255),Ft(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(n.adler=Yt(n.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=Os;else if(Ft(e,0),Ft(e,0),Ft(e,0),Ft(e,0),Ft(e,0),Ft(e,e.level===9?2:e.strategy>=dr||e.level<2?4:0),Ft(e,au),e.status=En,he(n),e.pending!==0)return e.last_flush=-1,Wt}if(e.status===Os){if(e.gzhead.extra){let r=e.pending,s=(e.gzhead.extra.length&65535)-e.gzindex;for(;e.pending+s>e.pending_buf_size;){let o=e.pending_buf_size-e.pending;if(e.pending_buf.set(e.gzhead.extra.subarray(e.gzindex,e.gzindex+o),e.pending),e.pending=e.pending_buf_size,e.gzhead.hcrc&&e.pending>r&&(n.adler=Yt(n.adler,e.pending_buf,e.pending-r,r)),e.gzindex+=o,he(n),e.pending!==0)return e.last_flush=-1,Wt;r=0,s-=o}let a=new Uint8Array(e.gzhead.extra);e.pending_buf.set(a.subarray(e.gzindex,e.gzindex+s),e.pending),e.pending+=s,e.gzhead.hcrc&&e.pending>r&&(n.adler=Yt(n.adler,e.pending_buf,e.pending-r,r)),e.gzindex=0}e.status=Fs}if(e.status===Fs){if(e.gzhead.name){let r=e.pending,s;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>r&&(n.adler=Yt(n.adler,e.pending_buf,e.pending-r,r)),he(n),e.pending!==0)return e.last_flush=-1,Wt;r=0}e.gzindex<e.gzhead.name.length?s=e.gzhead.name.charCodeAt(e.gzindex++)&255:s=0,Ft(e,s)}while(s!==0);e.gzhead.hcrc&&e.pending>r&&(n.adler=Yt(n.adler,e.pending_buf,e.pending-r,r)),e.gzindex=0}e.status=zs}if(e.status===zs){if(e.gzhead.comment){let r=e.pending,s;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>r&&(n.adler=Yt(n.adler,e.pending_buf,e.pending-r,r)),he(n),e.pending!==0)return e.last_flush=-1,Wt;r=0}e.gzindex<e.gzhead.comment.length?s=e.gzhead.comment.charCodeAt(e.gzindex++)&255:s=0,Ft(e,s)}while(s!==0);e.gzhead.hcrc&&e.pending>r&&(n.adler=Yt(n.adler,e.pending_buf,e.pending-r,r))}e.status=Us}if(e.status===Us){if(e.gzhead.hcrc){if(e.pending+2>e.pending_buf_size&&(he(n),e.pending!==0))return e.last_flush=-1,Wt;Ft(e,n.adler&255),Ft(e,n.adler>>8&255),n.adler=0}if(e.status=En,he(n),e.pending!==0)return e.last_flush=-1,Wt}if(n.avail_in!==0||e.lookahead!==0||t!==sn&&e.status!==ki){let r=e.level===0?Wo(e,t):e.strategy===dr?cu(e,t):e.strategy===Zf?lu(e,t):Ai[e.level].func(e,t);if((r===kn||r===Yn)&&(e.status=ki),r===ne||r===kn)return n.avail_out===0&&(e.last_flush=-1),Wt;if(r===Xn&&(t===Hf?Gf(e):t!==Yo&&(Ms(e,0,0,!1),t===jf&&(on(e.head),e.lookahead===0&&(e.strstart=0,e.block_start=0,e.insert=0))),he(n),n.avail_out===0))return e.last_flush=-1,Wt}return t!==me?Wt:e.wrap<=0?Zo:(e.wrap===2?(Ft(e,n.adler&255),Ft(e,n.adler>>8&255),Ft(e,n.adler>>16&255),Ft(e,n.adler>>24&255),Ft(e,n.total_in&255),Ft(e,n.total_in>>8&255),Ft(e,n.total_in>>16&255),Ft(e,n.total_in>>24&255)):(Si(e,n.adler>>>16),Si(e,n.adler&65535)),he(n),e.wrap>0&&(e.wrap=-e.wrap),e.pending!==0?Wt:Zo)},gu=n=>{if(Pi(n))return Ae;const t=n.state.status;return n.state=null,t===En?Sn(n,Vf):Wt},mu=(n,t)=>{let e=t.length;if(Pi(n))return Ae;const i=n.state,r=i.wrap;if(r===2||r===1&&i.status!==Vn||i.lookahead)return Ae;if(r===1&&(n.adler=Ei(n.adler,t,e,0)),i.wrap=0,e>=i.w_size){r===0&&(on(i.head),i.strstart=0,i.block_start=0,i.insert=0);let l=new Uint8Array(i.w_size);l.set(t.subarray(e-i.w_size,e),0),t=l,e=i.w_size}const s=n.avail_in,a=n.next_in,o=n.input;for(n.avail_in=e,n.next_in=0,n.input=t,Zn(i);i.lookahead>=Lt;){let l=i.strstart,c=i.lookahead-(Lt-1);do i.ins_h=ln(i,i.ins_h,i.window[l+Lt-1]),i.prev[l&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=l,l++;while(--c);i.strstart=l,i.lookahead=Lt-1,Zn(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=Lt-1,i.match_available=0,n.next_in=a,n.input=o,n.avail_in=s,i.wrap=r,Wt};var vu=du,_u=Qo,wu=Ko,yu=Jo,xu=uu,bu=pu,Tu=gu,Cu=mu,Eu="pako deflate (from Nodeca project)",Ii={deflateInit:vu,deflateInit2:_u,deflateReset:wu,deflateResetKeep:yu,deflateSetHeader:xu,deflate:bu,deflateEnd:Tu,deflateSetDictionary:Cu,deflateInfo:Eu};const ku=(n,t)=>Object.prototype.hasOwnProperty.call(n,t);var Su=function(n){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const e=t.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(const i in e)ku(e,i)&&(n[i]=e[i])}}return n},Au=n=>{let t=0;for(let i=0,r=n.length;i<r;i++)t+=n[i].length;const e=new Uint8Array(t);for(let i=0,r=0,s=n.length;i<s;i++){let a=n[i];e.set(a,r),r+=a.length}return e},gr={assign:Su,flattenChunks:Au};let tl=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{tl=!1}const Mi=new Uint8Array(256);for(let n=0;n<256;n++)Mi[n]=n>=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;Mi[254]=Mi[254]=1;var Pu=n=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(n);let t,e,i,r,s,a=n.length,o=0;for(r=0;r<a;r++)e=n.charCodeAt(r),(e&64512)===55296&&r+1<a&&(i=n.charCodeAt(r+1),(i&64512)===56320&&(e=65536+(e-55296<<10)+(i-56320),r++)),o+=e<128?1:e<2048?2:e<65536?3:4;for(t=new Uint8Array(o),s=0,r=0;s<o;r++)e=n.charCodeAt(r),(e&64512)===55296&&r+1<a&&(i=n.charCodeAt(r+1),(i&64512)===56320&&(e=65536+(e-55296<<10)+(i-56320),r++)),e<128?t[s++]=e:e<2048?(t[s++]=192|e>>>6,t[s++]=128|e&63):e<65536?(t[s++]=224|e>>>12,t[s++]=128|e>>>6&63,t[s++]=128|e&63):(t[s++]=240|e>>>18,t[s++]=128|e>>>12&63,t[s++]=128|e>>>6&63,t[s++]=128|e&63);return t};const Iu=(n,t)=>{if(t<65534&&n.subarray&&tl)return String.fromCharCode.apply(null,n.length===t?n:n.subarray(0,t));let e="";for(let i=0;i<t;i++)e+=String.fromCharCode(n[i]);return e};var Mu=(n,t)=>{const e=t||n.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(n.subarray(0,t));let i,r;const s=new Array(e*2);for(r=0,i=0;i<e;){let a=n[i++];if(a<128){s[r++]=a;continue}let o=Mi[a];if(o>4){s[r++]=65533,i+=o-1;continue}for(a&=o===2?31:o===3?15:7;o>1&&i<e;)a=a<<6|n[i++]&63,o--;if(o>1){s[r++]=65533;continue}a<65536?s[r++]=a:(a-=65536,s[r++]=55296|a>>10&1023,s[r++]=56320|a&1023)}return Iu(s,r)},Lu=(n,t)=>{t=t||n.length,t>n.length&&(t=n.length);let e=t-1;for(;e>=0&&(n[e]&192)===128;)e--;return e<0||e===0?t:e+Mi[n[e]]>t?e:t},Li={string2buf:Pu,buf2string:Mu,utf8border:Lu};function Du(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var el=Du;const nl=Object.prototype.toString,{Z_NO_FLUSH:Ru,Z_SYNC_FLUSH:Ou,Z_FULL_FLUSH:Fu,Z_FINISH:zu,Z_OK:mr,Z_STREAM_END:Uu,Z_DEFAULT_COMPRESSION:Nu,Z_DEFAULT_STRATEGY:Bu,Z_DEFLATED:Gu}=Cn;function Di(n){this.options=gr.assign({level:Nu,method:Gu,chunkSize:16384,windowBits:15,memLevel:8,strategy:Bu},n||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new el,this.strm.avail_out=0;let e=Ii.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==mr)throw new Error(Tn[e]);if(t.header&&Ii.deflateSetHeader(this.strm,t.header),t.dictionary){let i;if(typeof t.dictionary=="string"?i=Li.string2buf(t.dictionary):nl.call(t.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(t.dictionary):i=t.dictionary,e=Ii.deflateSetDictionary(this.strm,i),e!==mr)throw new Error(Tn[e]);this._dict_set=!0}}Di.prototype.push=function(n,t){const e=this.strm,i=this.options.chunkSize;let r,s;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?zu:Ru,typeof n=="string"?e.input=Li.string2buf(n):nl.call(n)==="[object ArrayBuffer]"?e.input=new Uint8Array(n):e.input=n,e.next_in=0,e.avail_in=e.input.length;;){if(e.avail_out===0&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),(s===Ou||s===Fu)&&e.avail_out<=6){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(r=Ii.deflate(e,s),r===Uu)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),r=Ii.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===mr;if(e.avail_out===0){this.onData(e.output);continue}if(s>0&&e.next_out>0){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(e.avail_in===0)break}return!0},Di.prototype.onData=function(n){this.chunks.push(n)},Di.prototype.onEnd=function(n){n===mr&&(this.result=gr.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function Gs(n,t){const e=new Di(t);if(e.push(n,!0),e.err)throw e.msg||Tn[e.err];return e.result}function Hu(n,t){return t=t||{},t.raw=!0,Gs(n,t)}function ju(n,t){return t=t||{},t.gzip=!0,Gs(n,t)}var Vu=Di,Xu=Gs,Yu=Hu,Zu=ju,$u=Cn,qu={Deflate:Vu,deflate:Xu,deflateRaw:Yu,gzip:Zu,constants:$u};const vr=16209,Wu=16191;var Ju=function(t,e){let i,r,s,a,o,l,c,f,g,p,u,y,x,b,A,P,M,D,z,N,F,G,H,$;const Y=t.state;i=t.next_in,H=t.input,r=i+(t.avail_in-5),s=t.next_out,$=t.output,a=s-(e-t.avail_out),o=s+(t.avail_out-257),l=Y.dmax,c=Y.wsize,f=Y.whave,g=Y.wnext,p=Y.window,u=Y.hold,y=Y.bits,x=Y.lencode,b=Y.distcode,A=(1<<Y.lenbits)-1,P=(1<<Y.distbits)-1;t:do{y<15&&(u+=H[i++]<<y,y+=8,u+=H[i++]<<y,y+=8),M=x[u&A];e:for(;;){if(D=M>>>24,u>>>=D,y-=D,D=M>>>16&255,D===0)$[s++]=M&65535;else if(D&16){z=M&65535,D&=15,D&&(y<D&&(u+=H[i++]<<y,y+=8),z+=u&(1<<D)-1,u>>>=D,y-=D),y<15&&(u+=H[i++]<<y,y+=8,u+=H[i++]<<y,y+=8),M=b[u&P];n:for(;;){if(D=M>>>24,u>>>=D,y-=D,D=M>>>16&255,D&16){if(N=M&65535,D&=15,y<D&&(u+=H[i++]<<y,y+=8,y<D&&(u+=H[i++]<<y,y+=8)),N+=u&(1<<D)-1,N>l){t.msg="invalid distance too far back",Y.mode=vr;break t}if(u>>>=D,y-=D,D=s-a,N>D){if(D=N-D,D>f&&Y.sane){t.msg="invalid distance too far back",Y.mode=vr;break t}if(F=0,G=p,g===0){if(F+=c-D,D<z){z-=D;do $[s++]=p[F++];while(--D);F=s-N,G=$}}else if(g<D){if(F+=c+g-D,D-=g,D<z){z-=D;do $[s++]=p[F++];while(--D);if(F=0,g<z){D=g,z-=D;do $[s++]=p[F++];while(--D);F=s-N,G=$}}}else if(F+=g-D,D<z){z-=D;do $[s++]=p[F++];while(--D);F=s-N,G=$}for(;z>2;)$[s++]=G[F++],$[s++]=G[F++],$[s++]=G[F++],z-=3;z&&($[s++]=G[F++],z>1&&($[s++]=G[F++]))}else{F=s-N;do $[s++]=$[F++],$[s++]=$[F++],$[s++]=$[F++],z-=3;while(z>2);z&&($[s++]=$[F++],z>1&&($[s++]=$[F++]))}}else if(D&64){t.msg="invalid distance code",Y.mode=vr;break t}else{M=b[(M&65535)+(u&(1<<D)-1)];continue n}break}}else if(D&64)if(D&32){Y.mode=Wu;break t}else{t.msg="invalid literal/length code",Y.mode=vr;break t}else{M=x[(M&65535)+(u&(1<<D)-1)];continue e}break}}while(i<r&&s<o);z=y>>3,i-=z,y-=z<<3,u&=(1<<y)-1,t.next_in=i,t.next_out=s,t.avail_in=i<r?5+(r-i):5-(i-r),t.avail_out=s<o?257+(o-s):257-(s-o),Y.hold=u,Y.bits=y};const qn=15,il=852,rl=592,sl=0,Hs=1,al=2,Ku=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Qu=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),td=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ed=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Ri=(n,t,e,i,r,s,a,o)=>{const l=o.bits;let c=0,f=0,g=0,p=0,u=0,y=0,x=0,b=0,A=0,P=0,M,D,z,N,F,G=null,H;const $=new Uint16Array(qn+1),Y=new Uint16Array(qn+1);let K=null,ut,ht,pt;for(c=0;c<=qn;c++)$[c]=0;for(f=0;f<i;f++)$[t[e+f]]++;for(u=l,p=qn;p>=1&&$[p]===0;p--);if(u>p&&(u=p),p===0)return r[s++]=1<<24|64<<16|0,r[s++]=1<<24|64<<16|0,o.bits=1,0;for(g=1;g<p&&$[g]===0;g++);for(u<g&&(u=g),b=1,c=1;c<=qn;c++)if(b<<=1,b-=$[c],b<0)return-1;if(b>0&&(n===sl||p!==1))return-1;for(Y[1]=0,c=1;c<qn;c++)Y[c+1]=Y[c]+$[c];for(f=0;f<i;f++)t[e+f]!==0&&(a[Y[t[e+f]]++]=f);if(n===sl?(G=K=a,H=20):n===Hs?(G=Ku,K=Qu,H=257):(G=td,K=ed,H=0),P=0,f=0,c=g,F=s,y=u,x=0,z=-1,A=1<<u,N=A-1,n===Hs&&A>il||n===al&&A>rl)return 1;for(;;){ut=c-x,a[f]+1<H?(ht=0,pt=a[f]):a[f]>=H?(ht=K[a[f]-H],pt=G[a[f]-H]):(ht=32+64,pt=0),M=1<<c-x,D=1<<y,g=D;do D-=M,r[F+(P>>x)+D]=ut<<24|ht<<16|pt|0;while(D!==0);for(M=1<<c-1;P&M;)M>>=1;if(M!==0?(P&=M-1,P+=M):P=0,f++,--$[c]===0){if(c===p)break;c=t[e+a[f]]}if(c>u&&(P&N)!==z){for(x===0&&(x=u),F+=g,y=c-x,b=1<<y;y+x<p&&(b-=$[y+x],!(b<=0));)y++,b<<=1;if(A+=1<<y,n===Hs&&A>il||n===al&&A>rl)return 1;z=P&N,r[z]=u<<24|y<<16|F-s|0}}return P!==0&&(r[F+P]=c-x<<24|64<<16|0),o.bits=u,0};const nd=0,ol=1,ll=2,{Z_FINISH:cl,Z_BLOCK:id,Z_TREES:_r,Z_OK:An,Z_STREAM_END:rd,Z_NEED_DICT:sd,Z_STREAM_ERROR:ve,Z_DATA_ERROR:hl,Z_MEM_ERROR:fl,Z_BUF_ERROR:ad,Z_DEFLATED:ul}=Cn,wr=16180,dl=16181,pl=16182,gl=16183,ml=16184,vl=16185,_l=16186,wl=16187,yl=16188,xl=16189,yr=16190,Ge=16191,js=16192,bl=16193,Vs=16194,Tl=16195,Cl=16196,El=16197,kl=16198,xr=16199,br=16200,Sl=16201,Al=16202,Pl=16203,Il=16204,Ml=16205,Xs=16206,Ll=16207,Dl=16208,Bt=16209,Rl=16210,Ol=16211,od=852,ld=592,cd=15,Fl=n=>(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24);function hd(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Pn=n=>{if(!n)return 1;const t=n.state;return!t||t.strm!==n||t.mode<wr||t.mode>Ol?1:0},zl=n=>{if(Pn(n))return ve;const t=n.state;return n.total_in=n.total_out=t.total=0,n.msg="",t.wrap&&(n.adler=t.wrap&1),t.mode=wr,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(od),t.distcode=t.distdyn=new Int32Array(ld),t.sane=1,t.back=-1,An},Ul=n=>{if(Pn(n))return ve;const t=n.state;return t.wsize=0,t.whave=0,t.wnext=0,zl(n)},Nl=(n,t)=>{let e;if(Pn(n))return ve;const i=n.state;return t<0?(e=0,t=-t):(e=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?ve:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=e,i.wbits=t,Ul(n))},Bl=(n,t)=>{if(!n)return ve;const e=new hd;n.state=e,e.strm=n,e.window=null,e.mode=wr;const i=Nl(n,t);return i!==An&&(n.state=null),i},fd=n=>Bl(n,cd);let Gl=!0,Ys,Zs;const ud=n=>{if(Gl){Ys=new Int32Array(512),Zs=new Int32Array(32);let t=0;for(;t<144;)n.lens[t++]=8;for(;t<256;)n.lens[t++]=9;for(;t<280;)n.lens[t++]=7;for(;t<288;)n.lens[t++]=8;for(Ri(ol,n.lens,0,288,Ys,0,n.work,{bits:9}),t=0;t<32;)n.lens[t++]=5;Ri(ll,n.lens,0,32,Zs,0,n.work,{bits:5}),Gl=!1}n.lencode=Ys,n.lenbits=9,n.distcode=Zs,n.distbits=5},Hl=(n,t,e,i)=>{let r;const s=n.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),i>=s.wsize?(s.window.set(t.subarray(e-s.wsize,e),0),s.wnext=0,s.whave=s.wsize):(r=s.wsize-s.wnext,r>i&&(r=i),s.window.set(t.subarray(e-i,e-i+r),s.wnext),i-=r,i?(s.window.set(t.subarray(e-i,e),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=r,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=r))),0},dd=(n,t)=>{let e,i,r,s,a,o,l,c,f,g,p,u,y,x,b=0,A,P,M,D,z,N,F,G;const H=new Uint8Array(4);let $,Y;const K=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Pn(n)||!n.output||!n.input&&n.avail_in!==0)return ve;e=n.state,e.mode===Ge&&(e.mode=js),a=n.next_out,r=n.output,l=n.avail_out,s=n.next_in,i=n.input,o=n.avail_in,c=e.hold,f=e.bits,g=o,p=l,G=An;t:for(;;)switch(e.mode){case wr:if(e.wrap===0){e.mode=js;break}for(;f<16;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}if(e.wrap&2&&c===35615){e.wbits===0&&(e.wbits=15),e.check=0,H[0]=c&255,H[1]=c>>>8&255,e.check=Yt(e.check,H,2,0),c=0,f=0,e.mode=dl;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((c&255)<<8)+(c>>8))%31){n.msg="incorrect header check",e.mode=Bt;break}if((c&15)!==ul){n.msg="unknown compression method",e.mode=Bt;break}if(c>>>=4,f-=4,F=(c&15)+8,e.wbits===0&&(e.wbits=F),F>15||F>e.wbits){n.msg="invalid window size",e.mode=Bt;break}e.dmax=1<<e.wbits,e.flags=0,n.adler=e.check=1,e.mode=c&512?xl:Ge,c=0,f=0;break;case dl:for(;f<16;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}if(e.flags=c,(e.flags&255)!==ul){n.msg="unknown compression method",e.mode=Bt;break}if(e.flags&57344){n.msg="unknown header flags set",e.mode=Bt;break}e.head&&(e.head.text=c>>8&1),e.flags&512&&e.wrap&4&&(H[0]=c&255,H[1]=c>>>8&255,e.check=Yt(e.check,H,2,0)),c=0,f=0,e.mode=pl;case pl:for(;f<32;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}e.head&&(e.head.time=c),e.flags&512&&e.wrap&4&&(H[0]=c&255,H[1]=c>>>8&255,H[2]=c>>>16&255,H[3]=c>>>24&255,e.check=Yt(e.check,H,4,0)),c=0,f=0,e.mode=gl;case gl:for(;f<16;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}e.head&&(e.head.xflags=c&255,e.head.os=c>>8),e.flags&512&&e.wrap&4&&(H[0]=c&255,H[1]=c>>>8&255,e.check=Yt(e.check,H,2,0)),c=0,f=0,e.mode=ml;case ml:if(e.flags&1024){for(;f<16;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}e.length=c,e.head&&(e.head.extra_len=c),e.flags&512&&e.wrap&4&&(H[0]=c&255,H[1]=c>>>8&255,e.check=Yt(e.check,H,2,0)),c=0,f=0}else e.head&&(e.head.extra=null);e.mode=vl;case vl:if(e.flags&1024&&(u=e.length,u>o&&(u=o),u&&(e.head&&(F=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(i.subarray(s,s+u),F)),e.flags&512&&e.wrap&4&&(e.check=Yt(e.check,i,u,s)),o-=u,s+=u,e.length-=u),e.length))break t;e.length=0,e.mode=_l;case _l:if(e.flags&2048){if(o===0)break t;u=0;do F=i[s+u++],e.head&&F&&e.length<65536&&(e.head.name+=String.fromCharCode(F));while(F&&u<o);if(e.flags&512&&e.wrap&4&&(e.check=Yt(e.check,i,u,s)),o-=u,s+=u,F)break t}else e.head&&(e.head.name=null);e.length=0,e.mode=wl;case wl:if(e.flags&4096){if(o===0)break t;u=0;do F=i[s+u++],e.head&&F&&e.length<65536&&(e.head.comment+=String.fromCharCode(F));while(F&&u<o);if(e.flags&512&&e.wrap&4&&(e.check=Yt(e.check,i,u,s)),o-=u,s+=u,F)break t}else e.head&&(e.head.comment=null);e.mode=yl;case yl:if(e.flags&512){for(;f<16;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}if(e.wrap&4&&c!==(e.check&65535)){n.msg="header crc mismatch",e.mode=Bt;break}c=0,f=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),n.adler=e.check=0,e.mode=Ge;break;case xl:for(;f<32;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}n.adler=e.check=Fl(c),c=0,f=0,e.mode=yr;case yr:if(e.havedict===0)return n.next_out=a,n.avail_out=l,n.next_in=s,n.avail_in=o,e.hold=c,e.bits=f,sd;n.adler=e.check=1,e.mode=Ge;case Ge:if(t===id||t===_r)break t;case js:if(e.last){c>>>=f&7,f-=f&7,e.mode=Xs;break}for(;f<3;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}switch(e.last=c&1,c>>>=1,f-=1,c&3){case 0:e.mode=bl;break;case 1:if(ud(e),e.mode=xr,t===_r){c>>>=2,f-=2;break t}break;case 2:e.mode=Cl;break;case 3:n.msg="invalid block type",e.mode=Bt}c>>>=2,f-=2;break;case bl:for(c>>>=f&7,f-=f&7;f<32;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}if((c&65535)!==(c>>>16^65535)){n.msg="invalid stored block lengths",e.mode=Bt;break}if(e.length=c&65535,c=0,f=0,e.mode=Vs,t===_r)break t;case Vs:e.mode=Tl;case Tl:if(u=e.length,u){if(u>o&&(u=o),u>l&&(u=l),u===0)break t;r.set(i.subarray(s,s+u),a),o-=u,s+=u,l-=u,a+=u,e.length-=u;break}e.mode=Ge;break;case Cl:for(;f<14;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}if(e.nlen=(c&31)+257,c>>>=5,f-=5,e.ndist=(c&31)+1,c>>>=5,f-=5,e.ncode=(c&15)+4,c>>>=4,f-=4,e.nlen>286||e.ndist>30){n.msg="too many length or distance symbols",e.mode=Bt;break}e.have=0,e.mode=El;case El:for(;e.have<e.ncode;){for(;f<3;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}e.lens[K[e.have++]]=c&7,c>>>=3,f-=3}for(;e.have<19;)e.lens[K[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,$={bits:e.lenbits},G=Ri(nd,e.lens,0,19,e.lencode,0,e.work,$),e.lenbits=$.bits,G){n.msg="invalid code lengths set",e.mode=Bt;break}e.have=0,e.mode=kl;case kl:for(;e.have<e.nlen+e.ndist;){for(;b=e.lencode[c&(1<<e.lenbits)-1],A=b>>>24,P=b>>>16&255,M=b&65535,!(A<=f);){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}if(M<16)c>>>=A,f-=A,e.lens[e.have++]=M;else{if(M===16){for(Y=A+2;f<Y;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}if(c>>>=A,f-=A,e.have===0){n.msg="invalid bit length repeat",e.mode=Bt;break}F=e.lens[e.have-1],u=3+(c&3),c>>>=2,f-=2}else if(M===17){for(Y=A+3;f<Y;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}c>>>=A,f-=A,F=0,u=3+(c&7),c>>>=3,f-=3}else{for(Y=A+7;f<Y;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}c>>>=A,f-=A,F=0,u=11+(c&127),c>>>=7,f-=7}if(e.have+u>e.nlen+e.ndist){n.msg="invalid bit length repeat",e.mode=Bt;break}for(;u--;)e.lens[e.have++]=F}}if(e.mode===Bt)break;if(e.lens[256]===0){n.msg="invalid code -- missing end-of-block",e.mode=Bt;break}if(e.lenbits=9,$={bits:e.lenbits},G=Ri(ol,e.lens,0,e.nlen,e.lencode,0,e.work,$),e.lenbits=$.bits,G){n.msg="invalid literal/lengths set",e.mode=Bt;break}if(e.distbits=6,e.distcode=e.distdyn,$={bits:e.distbits},G=Ri(ll,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,$),e.distbits=$.bits,G){n.msg="invalid distances set",e.mode=Bt;break}if(e.mode=xr,t===_r)break t;case xr:e.mode=br;case br:if(o>=6&&l>=258){n.next_out=a,n.avail_out=l,n.next_in=s,n.avail_in=o,e.hold=c,e.bits=f,Ju(n,p),a=n.next_out,r=n.output,l=n.avail_out,s=n.next_in,i=n.input,o=n.avail_in,c=e.hold,f=e.bits,e.mode===Ge&&(e.back=-1);break}for(e.back=0;b=e.lencode[c&(1<<e.lenbits)-1],A=b>>>24,P=b>>>16&255,M=b&65535,!(A<=f);){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}if(P&&!(P&240)){for(D=A,z=P,N=M;b=e.lencode[N+((c&(1<<D+z)-1)>>D)],A=b>>>24,P=b>>>16&255,M=b&65535,!(D+A<=f);){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}c>>>=D,f-=D,e.back+=D}if(c>>>=A,f-=A,e.back+=A,e.length=M,P===0){e.mode=Ml;break}if(P&32){e.back=-1,e.mode=Ge;break}if(P&64){n.msg="invalid literal/length code",e.mode=Bt;break}e.extra=P&15,e.mode=Sl;case Sl:if(e.extra){for(Y=e.extra;f<Y;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}e.length+=c&(1<<e.extra)-1,c>>>=e.extra,f-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=Al;case Al:for(;b=e.distcode[c&(1<<e.distbits)-1],A=b>>>24,P=b>>>16&255,M=b&65535,!(A<=f);){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}if(!(P&240)){for(D=A,z=P,N=M;b=e.distcode[N+((c&(1<<D+z)-1)>>D)],A=b>>>24,P=b>>>16&255,M=b&65535,!(D+A<=f);){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}c>>>=D,f-=D,e.back+=D}if(c>>>=A,f-=A,e.back+=A,P&64){n.msg="invalid distance code",e.mode=Bt;break}e.offset=M,e.extra=P&15,e.mode=Pl;case Pl:if(e.extra){for(Y=e.extra;f<Y;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}e.offset+=c&(1<<e.extra)-1,c>>>=e.extra,f-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){n.msg="invalid distance too far back",e.mode=Bt;break}e.mode=Il;case Il:if(l===0)break t;if(u=p-l,e.offset>u){if(u=e.offset-u,u>e.whave&&e.sane){n.msg="invalid distance too far back",e.mode=Bt;break}u>e.wnext?(u-=e.wnext,y=e.wsize-u):y=e.wnext-u,u>e.length&&(u=e.length),x=e.window}else x=r,y=a-e.offset,u=e.length;u>l&&(u=l),l-=u,e.length-=u;do r[a++]=x[y++];while(--u);e.length===0&&(e.mode=br);break;case Ml:if(l===0)break t;r[a++]=e.length,l--,e.mode=br;break;case Xs:if(e.wrap){for(;f<32;){if(o===0)break t;o--,c|=i[s++]<<f,f+=8}if(p-=l,n.total_out+=p,e.total+=p,e.wrap&4&&p&&(n.adler=e.check=e.flags?Yt(e.check,r,p,a-p):Ei(e.check,r,p,a-p)),p=l,e.wrap&4&&(e.flags?c:Fl(c))!==e.check){n.msg="incorrect data check",e.mode=Bt;break}c=0,f=0}e.mode=Ll;case Ll:if(e.wrap&&e.flags){for(;f<32;){if(o===0)break t;o--,c+=i[s++]<<f,f+=8}if(e.wrap&4&&c!==(e.total&4294967295)){n.msg="incorrect length check",e.mode=Bt;break}c=0,f=0}e.mode=Dl;case Dl:G=rd;break t;case Bt:G=hl;break t;case Rl:return fl;case Ol:default:return ve}return n.next_out=a,n.avail_out=l,n.next_in=s,n.avail_in=o,e.hold=c,e.bits=f,(e.wsize||p!==n.avail_out&&e.mode<Bt&&(e.mode<Xs||t!==cl))&&Hl(n,n.output,n.next_out,p-n.avail_out),g-=n.avail_in,p-=n.avail_out,n.total_in+=g,n.total_out+=p,e.total+=p,e.wrap&4&&p&&(n.adler=e.check=e.flags?Yt(e.check,r,p,n.next_out-p):Ei(e.check,r,p,n.next_out-p)),n.data_type=e.bits+(e.last?64:0)+(e.mode===Ge?128:0)+(e.mode===xr||e.mode===Vs?256:0),(g===0&&p===0||t===cl)&&G===An&&(G=ad),G},pd=n=>{if(Pn(n))return ve;let t=n.state;return t.window&&(t.window=null),n.state=null,An},gd=(n,t)=>{if(Pn(n))return ve;const e=n.state;return e.wrap&2?(e.head=t,t.done=!1,An):ve},md=(n,t)=>{const e=t.length;let i,r,s;return Pn(n)||(i=n.state,i.wrap!==0&&i.mode!==yr)?ve:i.mode===yr&&(r=1,r=Ei(r,t,e,0),r!==i.check)?hl:(s=Hl(n,t,e,e),s?(i.mode=Rl,fl):(i.havedict=1,An))};var vd=Ul,_d=Nl,wd=zl,yd=fd,xd=Bl,bd=dd,Td=pd,Cd=gd,Ed=md,kd="pako inflate (from Nodeca project)",He={inflateReset:vd,inflateReset2:_d,inflateResetKeep:wd,inflateInit:yd,inflateInit2:xd,inflate:bd,inflateEnd:Td,inflateGetHeader:Cd,inflateSetDictionary:Ed,inflateInfo:kd};function Sd(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Ad=Sd;const jl=Object.prototype.toString,{Z_NO_FLUSH:Pd,Z_FINISH:Id,Z_OK:Oi,Z_STREAM_END:$s,Z_NEED_DICT:qs,Z_STREAM_ERROR:Md,Z_DATA_ERROR:Vl,Z_MEM_ERROR:Ld}=Cn;function Fi(n){this.options=gr.assign({chunkSize:65536,windowBits:15,to:""},n||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(n&&n.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new el,this.strm.avail_out=0;let e=He.inflateInit2(this.strm,t.windowBits);if(e!==Oi)throw new Error(Tn[e]);if(this.header=new Ad,He.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Li.string2buf(t.dictionary):jl.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=He.inflateSetDictionary(this.strm,t.dictionary),e!==Oi)))throw new Error(Tn[e])}Fi.prototype.push=function(n,t){const e=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let s,a,o;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?Id:Pd,jl.call(n)==="[object ArrayBuffer]"?e.input=new Uint8Array(n):e.input=n,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),s=He.inflate(e,a),s===qs&&r&&(s=He.inflateSetDictionary(e,r),s===Oi?s=He.inflate(e,a):s===Vl&&(s=qs));e.avail_in>0&&s===$s&&e.state.wrap>0&&n[e.next_in]!==0;)He.inflateReset(e),s=He.inflate(e,a);switch(s){case Md:case Vl:case qs:case Ld:return this.onEnd(s),this.ended=!0,!1}if(o=e.avail_out,e.next_out&&(e.avail_out===0||s===$s))if(this.options.to==="string"){let l=Li.utf8border(e.output,e.next_out),c=e.next_out-l,f=Li.buf2string(e.output,l);e.next_out=c,e.avail_out=i-c,c&&e.output.set(e.output.subarray(l,l+c),0),this.onData(f)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(!(s===Oi&&o===0)){if(s===$s)return s=He.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(e.avail_in===0)break}}return!0},Fi.prototype.onData=function(n){this.chunks.push(n)},Fi.prototype.onEnd=function(n){n===Oi&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=gr.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function Ws(n,t){const e=new Fi(t);if(e.push(n),e.err)throw e.msg||Tn[e.err];return e.result}function Dd(n,t){return t=t||{},t.raw=!0,Ws(n,t)}var Rd=Fi,Od=Ws,Fd=Dd,zd=Ws,Ud=Cn,Nd={Inflate:Rd,inflate:Od,inflateRaw:Fd,ungzip:zd,constants:Ud};const{Deflate:Bd,deflate:Gd,deflateRaw:Hd,gzip:jd}=qu,{Inflate:Vd,inflate:Xd,inflateRaw:Yd,ungzip:Zd}=Nd;var $d=Bd,qd=Gd,Wd=Hd,Jd=jd,Kd=Vd,Qd=Xd,t0=Yd,e0=Zd,n0=Cn,i0={Deflate:$d,deflate:qd,deflateRaw:Wd,gzip:Jd,Inflate:Kd,inflate:Qd,inflateRaw:t0,ungzip:e0,constants:n0};const lt={};lt.toRGBA8=function(n){const t=n.width,e=n.height;if(n.tabs.acTL===null)return[lt.toRGBA8.decodeImage(n.data,t,e,n).buffer];const i=[];n.frames[0].data===null&&(n.frames[0].data=n.data);const r=t*e*4,s=new Uint8Array(r),a=new Uint8Array(r),o=new Uint8Array(r);for(let l=0;l<n.frames.length;l++){const c=n.frames[l],f=c.rect.x,g=c.rect.y,p=c.rect.width,u=c.rect.height,y=lt.toRGBA8.decodeImage(c.data,p,u,n);if(l!==0)for(let x=0;x<r;x++)o[x]=s[x];if(c.blend===0?lt._copyTile(y,p,u,s,t,e,f,g,0):c.blend===1&<._copyTile(y,p,u,s,t,e,f,g,1),i.push(s.buffer.slice(0)),c.dispose===1)lt._copyTile(a,p,u,s,t,e,f,g,0);else if(c.dispose===2)for(let x=0;x<r;x++)s[x]=o[x]}return i},lt.toRGBA8.decodeImage=function(n,t,e,i){const r=t*e,s=lt.decode._getBPP(i),a=Math.ceil(t*s/8),o=new Uint8Array(r*4),l=new Uint32Array(o.buffer),c=i.ctype,f=i.depth,g=lt._bin.readUshort;if(c===6){const p=r<<2;if(f===8)for(let u=0;u<p;u+=4)o[u]=n[u],o[u+1]=n[u+1],o[u+2]=n[u+2],o[u+3]=n[u+3];if(f===16)for(let u=0;u<p;u++)o[u]=n[u<<1]}else if(c===2){const p=i.tabs.tRNS;if(p===null){if(f===8)for(let u=0;u<r;u++){const y=u*3;l[u]=-16777216|n[y+2]<<16|n[y+1]<<8|n[y]}if(f===16)for(let u=0;u<r;u++){const y=u*6;l[u]=-16777216|n[y+4]<<16|n[y+2]<<8|n[y]}}else{const u=p[0],y=p[1],x=p[2];if(f===8)for(let b=0;b<r;b++){const A=b<<2,P=b*3;l[b]=-16777216|n[P+2]<<16|n[P+1]<<8|n[P],n[P]===u&&n[P+1]===y&&n[P+2]===x&&(o[A+3]=0)}if(f===16)for(let b=0;b<r;b++){const A=b<<2,P=b*6;l[b]=-16777216|n[P+4]<<16|n[P+2]<<8|n[P],g(n,P)===u&&g(n,P+2)===y&&g(n,P+4)===x&&(o[A+3]=0)}}}else if(c===3){const p=i.tabs.PLTE,u=i.tabs.tRNS,y=u?u.length:0;if(f===1)for(let x=0;x<e;x++){const b=x*a,A=x*t;for(let P=0;P<t;P++){const M=A+P<<2,D=n[b+(P>>3)]>>7-((P&7)<<0)&1,z=3*D;o[M]=p[z],o[M+1]=p[z+1],o[M+2]=p[z+2],o[M+3]=D<y?u[D]:255}}if(f===2)for(let x=0;x<e;x++){const b=x*a,A=x*t;for(let P=0;P<t;P++){const M=A+P<<2,D=n[b+(P>>2)]>>6-((P&3)<<1)&3,z=3*D;o[M]=p[z],o[M+1]=p[z+1],o[M+2]=p[z+2],o[M+3]=D<y?u[D]:255}}if(f===4)for(let x=0;x<e;x++){const b=x*a,A=x*t;for(let P=0;P<t;P++){const M=A+P<<2,D=n[b+(P>>1)]>>4-((P&1)<<2)&15,z=3*D;o[M]=p[z],o[M+1]=p[z+1],o[M+2]=p[z+2],o[M+3]=D<y?u[D]:255}}if(f===8)for(let x=0;x<r;x++){const b=x<<2,A=n[x],P=3*A;o[b]=p[P],o[b+1]=p[P+1],o[b+2]=p[P+2],o[b+3]=A<y?u[A]:255}}else if(c===4){if(f===8)for(let p=0;p<r;p++){const u=p<<2,y=p<<1,x=n[y];o[u]=x,o[u+1]=x,o[u+2]=x,o[u+3]=n[y+1]}if(f===16)for(let p=0;p<r;p++){const u=p<<2,y=p<<2,x=n[y];o[u]=x,o[u+1]=x,o[u+2]=x,o[u+3]=n[y+2]}}else if(c===0){const p=i.tabs.tRNS?i.tabs.tRNS:-1;for(let u=0;u<e;u++){const y=u*a,x=u*t;if(f===1)for(let b=0;b<t;b++){const A=255*(n[y+(b>>>3)]>>>7-(b&7)&1),P=A===p*255?0:255;l[x+b]=P<<24|A<<16|A<<8|A}else if(f===2)for(let b=0;b<t;b++){const A=85*(n[y+(b>>>2)]>>>6-((b&3)<<1)&3),P=A===p*85?0:255;l[x+b]=P<<24|A<<16|A<<8|A}else if(f===4)for(let b=0;b<t;b++){const A=17*(n[y+(b>>>1)]>>>4-((b&1)<<2)&15),P=A===p*17?0:255;l[x+b]=P<<24|A<<16|A<<8|A}else if(f===8)for(let b=0;b<t;b++){const A=n[y+b],P=A===p?0:255;l[x+b]=P<<24|A<<16|A<<8|A}else if(f===16)for(let b=0;b<t;b++){const A=n[y+(b<<1)],P=g(n,y+(b<<1))===p?0:255;l[x+b]=P<<24|A<<16|A<<8|A}}}return o},lt.decode=function(n){const t=new Uint8Array(n);let e=8;const i=lt._bin,r=i.readUshort,s=i.readUint,a={tabs:{},frames:[]},o=new Uint8Array(t.length);let l=0,c,f=0;const g=[137,80,78,71,13,10,26,10];for(let p=0;p<8;p++)if(t[p]!==g[p])throw"The input is not a PNG file!";for(;e<t.length;){const p=i.readUint(t,e);e+=4;const u=i.readASCII(t,e,4);if(e+=4,u==="IHDR")lt.decode._IHDR(t,e,a);else if(u==="CgBI")a.tabs[u]=t.slice(e,e+4);else if(u==="IDAT"){for(let y=0;y<p;y++)o[l+y]=t[e+y];l+=p}else if(u==="acTL")a.tabs[u]={num_frames:s(t,e),num_plays:s(t,e+4)},c=new Uint8Array(t.length);else if(u==="fcTL"){if(f!==0){const A=a.frames[a.frames.length-1];A.data=lt.decode._decompress(a,c.slice(0,f),A.rect.width,A.rect.height),f=0}const y={x:s(t,e+12),y:s(t,e+16),width:s(t,e+4),height:s(t,e+8)};let x=r(t,e+22);x=r(t,e+20)/(x===0?100:x);const b={rect:y,delay:Math.round(x*1e3),dispose:t[e+24],blend:t[e+25]};a.frames.push(b)}else if(u==="fdAT"){for(let y=0;y<p-4;y++)c[f+y]=t[e+y+4];f+=p-4}else if(u==="pHYs")a.tabs[u]=[i.readUint(t,e),i.readUint(t,e+4),t[e+8]];else if(u==="cHRM"){a.tabs[u]=[];for(let y=0;y<8;y++)a.tabs[u].push(i.readUint(t,e+y*4))}else if(u==="tEXt"||u==="zTXt"){a.tabs[u]===null&&(a.tabs[u]={});const y=i.nextZero(t,e),x=i.readASCII(t,e,y-e);let b;const A=e+p-y-1;if(u==="tEXt")b=i.readASCII(t,y+1,A);else{const P=lt.decode._inflate(t.slice(y+2,y+2+A));b=i.readUTF8(P,0,P.length)}a.tabs[u][x]=b}else if(u==="iTXt"){a.tabs[u]==null&&(a.tabs[u]={});let y=0,x=e;y=i.nextZero(t,x);const b=i.readASCII(t,x,y-x);x=y+1;const A=t[x];x+=2,y=i.nextZero(t,x),x=y+1,y=i.nextZero(t,x),x=y+1;let P;const M=p-(x-e);if(A===0)P=i.readUTF8(t,x,M);else{const D=lt.decode._inflate(t.slice(x,x+M));P=i.readUTF8(D,0,D.length)}a.tabs[u][b]=P}else if(u==="PLTE")a.tabs[u]=i.readBytes(t,e,p);else if(u==="hIST"){const y=a.tabs.PLTE.length/3;a.tabs[u]=[];for(let x=0;x<y;x++)a.tabs[u].push(r(t,e+x*2))}else if(u==="tRNS")a.ctype===3?a.tabs[u]=i.readBytes(t,e,p):a.ctype===0?a.tabs[u]=r(t,e):a.ctype===2&&(a.tabs[u]=[r(t,e),r(t,e+2),r(t,e+4)]);else if(u==="gAMA")a.tabs[u]=i.readUint(t,e)/1e5;else if(u==="sRGB")a.tabs[u]=t[e];else if(u==="bKGD")a.ctype===0||a.ctype===4?a.tabs[u]=[r(t,e)]:a.ctype===2||a.ctype===6?a.tabs[u]=[r(t,e),r(t,e+2),r(t,e+4)]:a.ctype===3&&(a.tabs[u]=t[e]);else if(u==="IEND")break;e+=p,e+=4}if(f!==0){const p=a.frames[a.frames.length-1];p.data=lt.decode._decompress(a,c.slice(0,f),p.rect.width,p.rect.height),f=0}return a.data=lt.decode._decompress(a,o,a.width,a.height),delete a.compress,delete a.interlace,delete a.filter,a},lt.decode._decompress=function(n,t,e,i){const r=lt.decode._getBPP(n),s=Math.ceil(e*r/8),a=new Uint8Array((s+1+n.interlace)*i);return n.tabs.CgBI?t=lt.inflateRaw(t,a):t=lt.decode._inflate(t,a),n.interlace===0?t=lt.decode._filterZero(t,n,0,e,i):n.interlace===1&&(t=lt.decode._readInterlace(t,n)),t},lt.decode._inflate=function(n,t){return lt.inflateRaw(new Uint8Array(n.buffer,2,n.length-6),t)},lt.inflateRaw=function(){const n={};return n.H={},n.H.N=function(t,e){const i=Uint8Array;let r=0,s=0,a=0,o=0,l=0,c=0,f=0,g=0,p=0,u,y;if(t[0]===3&&t[1]===0)return e||new i(0);const x=n.H,b=x.b,A=x.e,P=x.R,M=x.n,D=x.A,z=x.Z,N=x.m,F=e===null;for(F&&(e=new i(t.length>>>2<<3));r===0;){if(r=b(t,p,1),s=b(t,p+1,2),p+=3,s===0){p&7&&(p+=8-(p&7));const G=(p>>>3)+4,H=t[G-4]|t[G-3]<<8;F&&(e=n.H.W(e,g+H)),e.set(new i(t.buffer,t.byteOffset+G,H),g),p=G+H<<3,g+=H;continue}if(F&&(e=n.H.W(e,g+131072)),s===1&&(u=N.J,y=N.h,c=511,f=31),s===2){a=A(t,p,5)+257,o=A(t,p+5,5)+1,l=A(t,p+10,4)+4,p+=14;let G=1;for(let Y=0;Y<38;Y+=2)N.Q[Y]=0,N.Q[Y+1]=0;for(let Y=0;Y<l;Y++){const K=A(t,p+Y*3,3);N.Q[(N.X[Y]<<1)+1]=K,K>G&&(G=K)}p+=3*l,M(N.Q,G),D(N.Q,G,N.u),u=N.w,y=N.d,p=P(N.u,(1<<G)-1,a+o,t,p,N.v);const H=x.V(N.v,0,a,N.C);c=(1<<H)-1;const $=x.V(N.v,a,o,N.D);f=(1<<$)-1,M(N.C,H),D(N.C,H,u),M(N.D,$),D(N.D,$,y)}for(;;){const G=u[z(t,p)&c];p+=G&15;const H=G>>>4;if(!(H>>>8))e[g++]=H;else{if(H===256)break;{let $=g+H-254;if(H>264){const pt=N.q[H-257];$=g+(pt>>>3)+A(t,p,pt&7),p+=pt&7}const Y=y[z(t,p)&f];p+=Y&15;const K=Y>>>4,ut=N.c[K],ht=(ut>>>4)+b(t,p,ut&15);for(p+=ut&15;g<$;)e[g]=e[g++-ht],e[g]=e[g++-ht],e[g]=e[g++-ht],e[g]=e[g++-ht];g=$}}}}return e.length===g?e:e.slice(0,g)},n.H.W=function(t,e){const i=t.length;if(e<=i)return t;const r=new Uint8Array(i<<1);return r.set(t,0),r},n.H.R=function(t,e,i,r,s,a){const o=n.H.e,l=n.H.Z;let c=0;for(;c<i;){const f=t[l(r,s)&e];s+=f&15;const g=f>>>4;if(g<=15)a[c]=g,c++;else{let p=0,u=0;g===16?(u=3+o(r,s,2),s+=2,p=a[c-1]):g===17?(u=3+o(r,s,3),s+=3):g===18&&(u=11+o(r,s,7),s+=7);const y=c+u;for(;c<y;)a[c]=p,c++}}return s},n.H.V=function(t,e,i,r){let s=0,a=0;const o=r.length>>>1;for(;a<i;){const l=t[a+e];r[a<<1]=0,r[(a<<1)+1]=l,l>s&&(s=l),a++}for(;a<o;)r[a<<1]=0,r[(a<<1)+1]=0,a++;return s},n.H.n=function(t,e){const i=n.H.m,r=t.length;let s,a,o,l,c;const f=i.j;for(let p=0;p<=e;p++)f[p]=0;for(l=1;l<r;l+=2)f[t[l]]++;const g=i.K;for(s=0,f[0]=0,a=1;a<=e;a++)s=s+f[a-1]<<1,g[a]=s;for(o=0;o<r;o+=2)c=t[o+1],c!==0&&(t[o]=g[c],g[c]++)},n.H.A=function(t,e,i){const r=t.length,a=n.H.m.r;for(let o=0;o<r;o+=2)if(t[o+1]!==0){const l=o>>1,c=t[o+1],f=l<<4|c,g=e-c;let p=t[o]<<g;const u=p+(1<<g);for(;p!==u;){const y=a[p]>>>15-e;i[y]=f,p++}}},n.H.l=function(t,e){const i=n.H.m.r,r=15-e;for(let s=0;s<t.length;s+=2){const a=t[s]<<e-t[s+1];t[s]=i[a]>>>r}},n.H.M=function(t,e,i){i=i<<(e&7);const r=e>>>3;t[r]|=i,t[r+1]|=i>>>8},n.H.I=function(t,e,i){i=i<<(e&7);const r=e>>>3;t[r]|=i,t[r+1]|=i>>>8,t[r+2]|=i>>>16},n.H.e=function(t,e,i){return(t[e>>>3]|t[(e>>>3)+1]<<8)>>>(e&7)&(1<<i)-1},n.H.b=function(t,e,i){return(t[e>>>3]|t[(e>>>3)+1]<<8|t[(e>>>3)+2]<<16)>>>(e&7)&(1<<i)-1},n.H.Z=function(t,e){return(t[e>>>3]|t[(e>>>3)+1]<<8|t[(e>>>3)+2]<<16)>>>(e&7)},n.H.i=function(t,e){return(t[e>>>3]|t[(e>>>3)+1]<<8|t[(e>>>3)+2]<<16|t[(e>>>3)+3]<<24)>>>(e&7)},n.H.m=function(){const t=Uint16Array,e=Uint32Array;return{K:new t(16),j:new t(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new t(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[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],c:new e(32),J:new t(512),_:[],h:new t(32),$:[],w:new t(32768),C:[],v:[],d:new t(32768),D:[],u:new t(512),Q:[],r:new t(32768),s:new e(286),Y:new e(30),a:new e(19),t:new e(15e3),k:new t(65536),g:new t(32768)}}(),function(){const t=n.H.m,e=32768;for(let r=0;r<e;r++){let s=r;s=(s&2863311530)>>>1|(s&1431655765)<<1,s=(s&3435973836)>>>2|(s&858993459)<<2,s=(s&4042322160)>>>4|(s&252645135)<<4,s=(s&4278255360)>>>8|(s&16711935)<<8,t.r[r]=(s>>>16|s<<16)>>>17}function i(r,s,a){for(;s--!==0;)r.push(0,a)}for(let r=0;r<32;r++)t.q[r]=t.S[r]<<3|t.T[r],t.c[r]=t.p[r]<<4|t.z[r];i(t._,144,8),i(t._,112,9),i(t._,24,7),i(t._,8,8),n.H.n(t._,9),n.H.A(t._,9,t.J),n.H.l(t._,9),i(t.$,32,5),n.H.n(t.$,5),n.H.A(t.$,5,t.h),n.H.l(t.$,5),i(t.Q,19,0),i(t.C,286,0),i(t.D,30,0),i(t.v,320,0)}(),n.H.N}(),lt.decode._readInterlace=function(n,t){const e=t.width,i=t.height,r=lt.decode._getBPP(t),s=r>>3,a=Math.ceil(e*r/8),o=new Uint8Array(i*a);let l=0;const c=[0,0,4,0,2,0,1],f=[0,4,0,2,0,1,0],g=[8,8,8,4,4,2,2],p=[8,8,4,4,2,2,1];let u=0;for(;u<7;){const y=g[u],x=p[u];let b=0,A=0,P=c[u];for(;P<i;)P+=y,A++;let M=f[u];for(;M<e;)M+=x,b++;const D=Math.ceil(b*r/8);lt.decode._filterZero(n,t,l,b,A);let z=0,N=c[u];for(;N<i;){let F=f[u],G=l+z*D<<3;for(;F<e;){if(r===1){let H=n[G>>3];H=H>>7-(G&7)&1,o[N*a+(F>>3)]|=H<<7-((F&7)<<0)}if(r===2){let H=n[G>>3];H=H>>6-(G&7)&3,o[N*a+(F>>2)]|=H<<6-((F&3)<<1)}if(r===4){let H=n[G>>3];H=H>>4-(G&7)&15,o[N*a+(F>>1)]|=H<<4-((F&1)<<2)}if(r>=8){const H=N*a+F*s;for(let $=0;$<s;$++)o[H+$]=n[(G>>3)+$]}G+=r,F+=x}z++,N+=y}b*A!==0&&(l+=A*(1+D)),u=u+1}return o},lt.decode._getBPP=function(n){return[1,null,3,1,2,null,4][n.ctype]*n.depth},lt.decode._filterZero=function(n,t,e,i,r){let s=lt.decode._getBPP(t);const a=Math.ceil(i*s/8),o=lt.decode._paeth;s=Math.ceil(s/8);let l=0,c=1,f=n[e],g=0;if(f>1&&(n[e]=[0,0,1][f-2]),f===3)for(g=s;g<a;g++)n[g+1]=n[g+1]+(n[g+1-s]>>>1)&255;for(let p=0;p<r;p++)if(l=e+p*a,c=l+p+1,f=n[c-1],g=0,f===0)for(;g<a;g++)n[l+g]=n[c+g];else if(f===1){for(;g<s;g++)n[l+g]=n[c+g];for(;g<a;g++)n[l+g]=n[c+g]+n[l+g-s]}else if(f===2)for(;g<a;g++)n[l+g]=n[c+g]+n[l+g-a];else if(f===3){for(;g<s;g++)n[l+g]=n[c+g]+(n[l+g-a]>>>1);for(;g<a;g++)n[l+g]=n[c+g]+(n[l+g-a]+n[l+g-s]>>>1)}else{for(;g<s;g++)n[l+g]=n[c+g]+o(0,n[l+g-a],0);for(;g<a;g++)n[l+g]=n[c+g]+o(n[l+g-s],n[l+g-a],n[l+g-s-a])}return n},lt.decode._paeth=function(n,t,e){const i=n+t-e,r=i-n,s=i-t,a=i-e;return r*r<=s*s&&r*r<=a*a?n:s*s<=a*a?t:e},lt.decode._IHDR=function(n,t,e){const i=lt._bin;e.width=i.readUint(n,t),t+=4,e.height=i.readUint(n,t),t+=4,e.depth=n[t],t++,e.ctype=n[t],t++,e.compress=n[t],t++,e.filter=n[t],t++,e.interlace=n[t],t++},lt._bin={nextZero:function(n,t){for(;n[t]!==0;)t++;return t},readUshort:function(n,t){return n[t]<<8|n[t+1]},writeUshort:function(n,t,e){n[t]=e>>8&255,n[t+1]=e&255},readUint:function(n,t){return n[t]*16777216+(n[t+1]<<16|n[t+2]<<8|n[t+3])},writeUint:function(n,t,e){n[t]=e>>24&255,n[t+1]=e>>16&255,n[t+2]=e>>8&255,n[t+3]=e&255},readASCII:function(n,t,e){let i="";for(let r=0;r<e;r++)i+=String.fromCharCode(n[t+r]);return i},writeASCII:function(n,t,e){for(let i=0;i<e.length;i++)n[t+i]=e.charCodeAt(i)},readBytes:function(n,t,e){const i=[];for(let r=0;r<e;r++)i.push(n[t+r]);return i},pad:function(n){return n.length<2?"0"+n:n},readUTF8:function(n,t,e){let i="",r;for(let s=0;s<e;s++)i+="%"+lt._bin.pad(n[t+s].toString(16));try{r=decodeURIComponent(i)}catch{return lt._bin.readASCII(n,t,e)}return r}},lt._copyTile=function(n,t,e,i,r,s,a,o,l){const c=Math.min(t,r),f=Math.min(e,s);let g=0,p=0;for(let u=0;u<f;u++)for(let y=0;y<c;y++)if(a>=0&&o>=0?(g=u*t+y<<2,p=(o+u)*r+a+y<<2):(g=(-o+u)*t-a+y<<2,p=u*r+y<<2),l===0)i[p]=n[g],i[p+1]=n[g+1],i[p+2]=n[g+2],i[p+3]=n[g+3];else if(l===1){const x=n[g+3]*.00392156862745098,b=n[g]*x,A=n[g+1]*x,P=n[g+2]*x,M=i[p+3]*(1/255),D=i[p]*M,z=i[p+1]*M,N=i[p+2]*M,F=1-x,G=x+M*F,H=G===0?0:1/G;i[p+3]=255*G,i[p+0]=(b+D*F)*H,i[p+1]=(A+z*F)*H,i[p+2]=(P+N*F)*H}else if(l===2){const x=n[g+3],b=n[g],A=n[g+1],P=n[g+2],M=i[p+3],D=i[p],z=i[p+1],N=i[p+2];x===M&&b===D&&A===z&&P===N?(i[p]=0,i[p+1]=0,i[p+2]=0,i[p+3]=0):(i[p]=b,i[p+1]=A,i[p+2]=P,i[p+3]=x)}else if(l===3){const x=n[g+3],b=n[g],A=n[g+1],P=n[g+2],M=i[p+3],D=i[p],z=i[p+1],N=i[p+2];if(x===M&&b===D&&A===z&&P===N)continue;if(x<220&&M>20)return!1}return!0},lt.encode=function(n,t,e,i,r,s,a){i===null&&(i=0),a===null&&(a=!1);const o=lt.encode.compress(n,t,e,i,[!1,!1,!1,0,a]);return lt.encode.compressPNG(o,-1),lt.encode._main(o,t,e,r,s)},lt.encodeLL=function(n,t,e,i,r,s,a,o){const l={ctype:0+(i===1?0:2)+(r===0?0:4),depth:s,frames:[]},c=(i+r)*s,f=c*t;for(let p=0;p<n.length;p++)l.frames.push({rect:{x:0,y:0,width:t,height:e},img:new Uint8Array(n[p]),blend:0,dispose:1,bpp:Math.ceil(c/8),bpl:Math.ceil(f/8)});return lt.encode.compressPNG(l,0,!0),lt.encode._main(l,t,e,a,o)},lt.encode._main=function(n,t,e,i,r){r||(r={});const s=lt.crc.crc,a=lt._bin.writeUint,o=lt._bin.writeUshort,l=lt._bin.writeASCII;let c=8;const f=n.frames.length>1;let g=!1,p=8+(16+5+4)+(f?20:0);if(r.sRGB!==null&&r.sRGB!==void 0&&(p+=13),r.pHYs!==null&&r.pHYs!==void 0&&(p+=21),n.ctype===3){const b=n.plte.length;for(let A=0;A<b;A++)n.plte[A]>>>24!==255&&(g=!0);p+=8+b*3+4+(g?8+b*1+4:0)}for(let b=0;b<n.frames.length;b++){const A=n.frames[b];f&&(p+=38),p+=A.cimg.length+12,b!==0&&(p+=4)}p+=12;const u=new Uint8Array(p),y=[137,80,78,71,13,10,26,10];for(let b=0;b<8;b++)u[b]=y[b];if(a(u,c,13),c+=4,l(u,c,"IHDR"),c+=4,a(u,c,t),c+=4,a(u,c,e),c+=4,u[c]=n.depth,c++,u[c]=n.ctype,c++,u[c]=0,c++,u[c]=0,c++,u[c]=0,c++,a(u,c,s(u,c-17,17)),c+=4,r.sRGB!==null&&r.sRGB!==void 0&&(a(u,c,1),c+=4,l(u,c,"sRGB"),c+=4,u[c]=r.sRGB,c++,a(u,c,s(u,c-5,5)),c+=4),r.pHYs!==null&&r.pHYs!==void 0&&(a(u,c,9),c+=4,l(u,c,"pHYs"),c+=4,a(u,c,r.pHYs[0]),c+=4,a(u,c,r.pHYs[1]),c+=4,u[c]=r.pHYs[2],c++,a(u,c,s(u,c-13,13)),c+=4),f&&(a(u,c,8),c+=4,l(u,c,"acTL"),c+=4,a(u,c,n.frames.length),c+=4,a(u,c,r.loop!=null?r.loop:0),c+=4,a(u,c,s(u,c-12,12)),c+=4),n.ctype===3){const b=n.plte.length;a(u,c,b*3),c+=4,l(u,c,"PLTE"),c+=4;for(let A=0;A<b;A++){const P=A*3,M=n.plte[A],D=M&255,z=M>>>8&255,N=M>>>16&255;u[c+P+0]=D,u[c+P+1]=z,u[c+P+2]=N}if(c+=b*3,a(u,c,s(u,c-b*3-4,b*3+4)),c+=4,g){a(u,c,b),c+=4,l(u,c,"tRNS"),c+=4;for(let A=0;A<b;A++)u[c+A]=n.plte[A]>>>24&255;c+=b,a(u,c,s(u,c-b-4,b+4)),c+=4}}let x=0;for(let b=0;b<n.frames.length;b++){const A=n.frames[b];f&&(a(u,c,26),c+=4,l(u,c,"fcTL"),c+=4,a(u,c,x++),c+=4,a(u,c,A.rect.width),c+=4,a(u,c,A.rect.height),c+=4,a(u,c,A.rect.x),c+=4,a(u,c,A.rect.y),c+=4,o(u,c,i[b]),c+=2,o(u,c,1e3),c+=2,u[c]=A.dispose,c++,u[c]=A.blend,c++,a(u,c,s(u,c-30,30)),c+=4);const P=A.cimg,M=P.length;a(u,c,M+(b===0?0:4)),c+=4;const D=c;l(u,c,b===0?"IDAT":"fdAT"),c+=4,b!==0&&(a(u,c,x++),c+=4),u.set(P,c),c+=M,a(u,c,s(u,D,c-D)),c+=4}return a(u,c,0),c+=4,l(u,c,"IEND"),c+=4,a(u,c,s(u,c-4,4)),c+=4,u.buffer},lt.encode.compressPNG=function(n,t,e){for(let i=0;i<n.frames.length;i++){const r=n.frames[i],s=r.rect.height,a=new Uint8Array(s*r.bpl+s);r.cimg=lt.encode._filterZero(r.img,s,r.bpp,r.bpl,a,t,e)}},lt.encode.compress=function(n,t,e,i,r){const s=r[0],a=r[1],o=r[2],l=r[3],c=r[4];let f=6,g=8,p=255;for(let M=0;M<n.length;M++){const D=new Uint8Array(n[M]),z=D.length;for(let N=0;N<z;N+=4)p&=D[N+3]}const u=p!==255,y=lt.encode.framize(n,t,e,s,a,o),x={},b=[],A=[];if(i!==0){const M=[];for(let G=0;G<y.length;G++)M.push(y[G].img.buffer);const D=lt.encode.concatRGBA(M),z=lt.quantize(D,i);let N=0;const F=new Uint8Array(z.abuf);for(let G=0;G<y.length;G++){const H=y[G].img,$=H.length;A.push(new Uint8Array(z.inds.buffer,N>>2,$>>2));for(let Y=0;Y<$;Y+=4)H[Y]=F[N+Y],H[Y+1]=F[N+Y+1],H[Y+2]=F[N+Y+2],H[Y+3]=F[N+Y+3];N+=$}for(let G=0;G<z.plte.length;G++)b.push(z.plte[G].est.rgba)}else for(let M=0;M<y.length;M++){const D=y[M],z=new Uint32Array(D.img.buffer),N=D.rect.width,F=z.length,G=new Uint8Array(F);A.push(G);for(let H=0;H<F;H++){const $=z[H];if(H!==0&&$===z[H-1])G[H]=G[H-1];else if(H>N&&$===z[H-N])G[H]=G[H-N];else{let Y=x[$];if(Y===null&&(x[$]=Y=b.length,b.push($),b.length>=300))break;G[H]=Y}}}const P=b.length;P<=256&&c===!1&&(P<=2?g=1:P<=4?g=2:P<=16?g=4:g=8,g=Math.max(g,l));for(let M=0;M<y.length;M++){const D=y[M],z=D.rect.width,N=D.rect.height;let F=D.img,G=4*z,H=4;if(P<=256&&c===!1){G=Math.ceil(g*z/8);const $=new Uint8Array(G*N),Y=A[M];for(let K=0;K<N;K++){const ut=K*G,ht=K*z;if(g===8)for(let pt=0;pt<z;pt++)$[ut+pt]=Y[ht+pt];else if(g===4)for(let pt=0;pt<z;pt++)$[ut+(pt>>1)]|=Y[ht+pt]<<4-(pt&1)*4;else if(g===2)for(let pt=0;pt<z;pt++)$[ut+(pt>>2)]|=Y[ht+pt]<<6-(pt&3)*2;else if(g===1)for(let pt=0;pt<z;pt++)$[ut+(pt>>3)]|=Y[ht+pt]<<7-(pt&7)*1}F=$,f=3,H=1}else if(u===!1&&y.length===1){const $=new Uint8Array(z*N*3),Y=z*N;for(let K=0;K<Y;K++){const ut=K*3,ht=K*4;$[ut]=F[ht],$[ut+1]=F[ht+1],$[ut+2]=F[ht+2]}F=$,f=2,H=3,G=3*z}D.img=F,D.bpl=G,D.bpp=H}return{ctype:f,depth:g,plte:b,frames:y}},lt.encode.framize=function(n,t,e,i,r,s){const a=[];for(let o=0;o<n.length;o++){const l=new Uint8Array(n[o]),c=new Uint32Array(l.buffer);let f,g=0,p=0,u=t,y=e,x=i?1:0;if(o!==0){const b=s||i||o===1||a[o-2].dispose!==0?1:2;let A=0,P=1e9;for(let D=0;D<b;D++){const z=new Uint32Array(n[o-1-D]);let N=t,F=e,G=-1,H=-1;for(let Y=0;Y<e;Y++)for(let K=0;K<t;K++){const ut=Y*t+K;c[ut]!==z[ut]&&(K<N&&(N=K),K>G&&(G=K),Y<F&&(F=Y),Y>H&&(H=Y))}G===-1&&(N=F=G=H=0),r&&((N&1)===1&&N--,(F&1)===1&&F--);const $=(G-N+1)*(H-F+1);$<P&&(P=$,A=D,g=N,p=F,u=G-N+1,y=H-F+1)}const M=new Uint8Array(n[o-1-A]);A===1&&(a[o-1].dispose=2),f=new Uint8Array(u*y*4),lt._copyTile(M,t,e,f,u,y,-g,-p,0),x=lt._copyTile(l,t,e,f,u,y,-g,-p,3)?1:0,x===1?lt.encode._prepareDiff(l,t,e,f,{x:g,y:p,width:u,height:y}):lt._copyTile(l,t,e,f,u,y,-g,-p,0)}else f=l.slice(0);a.push({rect:{x:g,y:p,width:u,height:y},img:f,blend:x,dispose:0})}if(i)for(let o=0;o<a.length;o++){const l=a[o];if(l.blend===1)continue;const c=l.rect,f=a[o-1].rect,g=Math.min(c.x,f.x),p=Math.min(c.y,f.y),u=Math.max(c.x+c.width,f.x+f.width),y=Math.max(c.y+c.height,f.y+f.height),x={x:g,y:p,width:u-g,height:y-p};a[o-1].dispose=1,o-1!==0&<.encode._updateFrame(n,t,e,a,o-1,x,r),lt.encode._updateFrame(n,t,e,a,o,x,r)}return a},lt.encode._updateFrame=function(n,t,e,i,r,s,a){const o=Uint8Array,l=Uint32Array,c=new o(n[r-1]),f=new l(n[r-1]),g=r+1<n.length?new o(n[r+1]):null,p=new o(n[r]),u=new l(p.buffer);let y=t,x=e,b=-1,A=-1;for(let M=0;M<s.height;M++)for(let D=0;D<s.width;D++){const z=s.x+D,N=s.y+M,F=N*t+z,G=u[F];G===0||i[r-1].dispose===0&&f[F]===G&&(g===null||g[F*4+3]!==0)||(z<y&&(y=z),z>b&&(b=z),N<x&&(x=N),N>A&&(A=N))}b===-1&&(y=x=b=A=0),a&&((y&1)===1&&y--,(x&1)===1&&x--),s={x:y,y:x,width:b-y+1,height:A-x+1};const P=i[r];P.rect=s,P.blend=1,P.img=new Uint8Array(s.width*s.height*4),i[r-1].dispose===0?(lt._copyTile(c,t,e,P.img,s.width,s.height,-s.x,-s.y,0),lt.encode._prepareDiff(p,t,e,P.img,s)):lt._copyTile(p,t,e,P.img,s.width,s.height,-s.x,-s.y,0)},lt.encode._prepareDiff=function(n,t,e,i,r){lt._copyTile(n,t,e,i,r.width,r.height,-r.x,-r.y,2)},lt.encode._filterZero=function(n,t,e,i,r,s,a){const o=[];let l=[0,1,2,3,4];s!==-1?l=[s]:(t*i>5e5||e===1)&&(l=[0]);let c;a&&(c={level:0});const f=r.length>1e7&&To!=null?To:i0;for(let u=0;u<l.length;u++){for(let y=0;y<t;y++)lt.encode._filterLine(r,n,y,i,e,l[u]);o.push(f.deflate(r,c))}let g,p=1e9;for(let u=0;u<o.length;u++)o[u].length<p&&(g=u,p=o[u].length);return o[g]},lt.encode._filterLine=function(n,t,e,i,r,s){const a=e*i;let o=a+e;const l=lt.decode._paeth;if(n[o]=s,o++,s===0)if(i<500)for(let c=0;c<i;c++)n[o+c]=t[a+c];else n.set(new Uint8Array(t.buffer,a,i),o);else if(s===1){for(let c=0;c<r;c++)n[o+c]=t[a+c];for(let c=r;c<i;c++)n[o+c]=t[a+c]-t[a+c-r]+256&255}else if(e===0){for(let c=0;c<r;c++)n[o+c]=t[a+c];if(s===2)for(let c=r;c<i;c++)n[o+c]=t[a+c];if(s===3)for(let c=r;c<i;c++)n[o+c]=t[a+c]-(t[a+c-r]>>1)+256&255;if(s===4)for(let c=r;c<i;c++)n[o+c]=t[a+c]-l(t[a+c-r],0,0)+256&255}else{if(s===2)for(let c=0;c<i;c++)n[o+c]=t[a+c]+256-t[a+c-i]&255;if(s===3){for(let c=0;c<r;c++)n[o+c]=t[a+c]+256-(t[a+c-i]>>1)&255;for(let c=r;c<i;c++)n[o+c]=t[a+c]+256-(t[a+c-i]+t[a+c-r]>>1)&255}if(s===4){for(let c=0;c<r;c++)n[o+c]=t[a+c]+256-l(0,t[a+c-i],0)&255;for(let c=r;c<i;c++)n[o+c]=t[a+c]+256-l(t[a+c-r],t[a+c-i],t[a+c-r-i])&255}}},lt.crc={table:function(){const n=new Uint32Array(256);for(let t=0;t<256;t++){let e=t;for(let i=0;i<8;i++)e&1?e=3988292384^e>>>1:e=e>>>1;n[t]=e}return n}(),update:function(n,t,e,i){for(let r=0;r<i;r++)n=lt.crc.table[(n^t[e+r])&255]^n>>>8;return n},crc:function(n,t,e){return lt.crc.update(4294967295,n,t,e)^4294967295}},lt.quantize=function(n,t){const e=new Uint8Array(n),i=e.slice(0),r=new Uint32Array(i.buffer),s=lt.quantize.getKDtree(i,t),a=s[0],o=s[1],l=lt.quantize.planeDst,c=e,f=r,g=c.length,p=new Uint8Array(e.length>>2);let u;if(e.length<2e7)for(let y=0;y<g;y+=4){const x=c[y]*.00392156862745098,b=c[y+1]*(1/255),A=c[y+2]*(1/255),P=c[y+3]*(1/255);u=lt.quantize.getNearest(a,x,b,A,P),p[y>>2]=u.ind,f[y>>2]=u.est.rgba}else for(let y=0;y<g;y+=4){const x=c[y]*.00392156862745098,b=c[y+1]*(1/255),A=c[y+2]*(1/255),P=c[y+3]*(1/255);for(u=a;u.left;)u=l(u.est,x,b,A,P)<=0?u.left:u.right;p[y>>2]=u.ind,f[y>>2]=u.est.rgba}return{abuf:i.buffer,inds:p,plte:o}},lt.quantize.getKDtree=function(n,t,e){e===null&&(e=1e-4);const i=new Uint32Array(n.buffer),r={i0:0,i1:n.length,bst:null,est:null,tdst:0,left:null,right:null};r.bst=lt.quantize.stats(n,r.i0,r.i1),r.est=lt.quantize.estats(r.bst);const s=[r];for(;s.length<t;){let a=0,o=0;for(let u=0;u<s.length;u++)s[u].est.L>a&&(a=s[u].est.L,o=u);if(a<e)break;const l=s[o],c=lt.quantize.splitPixels(n,i,l.i0,l.i1,l.est.e,l.est.eMq255);if(l.i0>=c||l.i1<=c){l.est.L=0;continue}const g={i0:l.i0,i1:c,bst:null,est:null,tdst:0,left:null,right:null};g.bst=lt.quantize.stats(n,g.i0,g.i1),g.est=lt.quantize.estats(g.bst);const p={i0:c,i1:l.i1,bst:null,est:null,tdst:0,left:null,right:null};p.bst={R:[],m:[],N:l.bst.N-g.bst.N};for(let u=0;u<16;u++)p.bst.R[u]=l.bst.R[u]-g.bst.R[u];for(let u=0;u<4;u++)p.bst.m[u]=l.bst.m[u]-g.bst.m[u];p.est=lt.quantize.estats(p.bst),l.left=g,l.right=p,s[o]=g,s.push(p)}s.sort(function(a,o){return o.bst.N-a.bst.N});for(let a=0;a<s.length;a++)s[a].ind=a;return[r,s]},lt.quantize.getNearest=function(n,t,e,i,r){if(n.left==null)return n.tdst=lt.quantize.dist(n.est.q,t,e,i,r),n;const s=lt.quantize.planeDst(n.est,t,e,i,r);let a=n.left,o=n.right;s>0&&(a=n.right,o=n.left);const l=lt.quantize.getNearest(a,t,e,i,r);if(l.tdst<=s*s)return l;const c=lt.quantize.getNearest(o,t,e,i,r);return c.tdst<l.tdst?c:l},lt.quantize.planeDst=function(n,t,e,i,r){const s=n.e;return s[0]*t+s[1]*e+s[2]*i+s[3]*r-n.eMq},lt.quantize.dist=function(n,t,e,i,r){const s=t-n[0],a=e-n[1],o=i-n[2],l=r-n[3];return s*s+a*a+o*o+l*l},lt.quantize.splitPixels=function(n,t,e,i,r,s){const a=lt.quantize.vecDot;for(i-=4;e<i;){for(;a(n,e,r)<=s;)e+=4;for(;a(n,i,r)>s;)i-=4;if(e>=i)break;const o=t[e>>2];t[e>>2]=t[i>>2],t[i>>2]=o,e+=4,i-=4}for(;a(n,e,r)>s;)e-=4;return e+4},lt.quantize.vecDot=function(n,t,e){return n[t]*e[0]+n[t+1]*e[1]+n[t+2]*e[2]+n[t+3]*e[3]},lt.quantize.stats=function(n,t,e){const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=[0,0,0,0],s=e-t>>2;for(let a=t;a<e;a+=4){const o=n[a]*.00392156862745098,l=n[a+1]*(1/255),c=n[a+2]*(1/255),f=n[a+3]*(1/255);r[0]+=o,r[1]+=l,r[2]+=c,r[3]+=f,i[0]+=o*o,i[1]+=o*l,i[2]+=o*c,i[3]+=o*f,i[5]+=l*l,i[6]+=l*c,i[7]+=l*f,i[10]+=c*c,i[11]+=c*f,i[15]+=f*f}return i[4]=i[1],i[8]=i[2],i[9]=i[6],i[12]=i[3],i[13]=i[7],i[14]=i[11],{R:i,m:r,N:s}},lt.quantize.estats=function(n){const t=n.R,e=n.m,i=n.N,r=e[0],s=e[1],a=e[2],o=e[3],l=i===0?0:1/i,c=[t[0]-r*r*l,t[1]-r*s*l,t[2]-r*a*l,t[3]-r*o*l,t[4]-s*r*l,t[5]-s*s*l,t[6]-s*a*l,t[7]-s*o*l,t[8]-a*r*l,t[9]-a*s*l,t[10]-a*a*l,t[11]-a*o*l,t[12]-o*r*l,t[13]-o*s*l,t[14]-o*a*l,t[15]-o*o*l],f=c,g=lt.M4;let p=[Math.random(),Math.random(),Math.random(),Math.random()],u=0,y=0;if(i!==0)for(let A=0;A<16&&(p=g.multVec(f,p),y=Math.sqrt(g.dot(p,p)),p=g.sml(1/y,p),!(A!==0&&Math.abs(y-u)<1e-9));A++)u=y;const x=[r*l,s*l,a*l,o*l],b=g.dot(g.sml(255,x),p);return{Cov:c,q:x,e:p,L:u,eMq255:b,eMq:g.dot(p,x),rgba:(Math.round(255*x[3])<<24|Math.round(255*x[2])<<16|Math.round(255*x[1])<<8|Math.round(255*x[0])<<0)>>>0}},lt.M4={multVec:function(n,t){return[n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3],n[4]*t[0]+n[5]*t[1]+n[6]*t[2]+n[7]*t[3],n[8]*t[0]+n[9]*t[1]+n[10]*t[2]+n[11]*t[3],n[12]*t[0]+n[13]*t[1]+n[14]*t[2]+n[15]*t[3]]},dot:function(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]},sml:function(n,t){return[n*t[0],n*t[1],n*t[2],n*t[3]]}},lt.encode.concatRGBA=function(n){let t=0;for(let r=0;r<n.length;r++)t+=n[r].byteLength;const e=new Uint8Array(t);let i=0;for(let r=0;r<n.length;r++){const s=new Uint8Array(n[r]),a=s.length;for(let o=0;o<a;o+=4){let l=s[o],c=s[o+1],f=s[o+2];const g=s[o+3];g===0&&(l=c=f=0),e[i+o]=l,e[i+o+1]=c,e[i+o+2]=f,e[i+o+3]=g}i+=a}return e.buffer};const r0=lt,Tr=new Map,Js=(n,t)=>{if(Tr.has(n))return t(null,Tr.get(n));const e=new Image;e.onload=function(){Tr.set(n,{width:e.width,height:e.height,element:e}),t(null,Tr.get(n))},e.onerror=function(i){t(i,null)},e.src=n},s0=(n,t)=>{for(let e=0,i=n.length;e<i;e++){const r=n[e],{type:s}=r;if(s.split("/")[0]!=="image")return;const o=new FileReader;o.onload=function(l){if(!l.target)return t("no reader target",null);const c=l.target.result,f=ca(c),g=new Blob([c]);Ks(g,(p,u)=>{if(!u)return t(p,null);Js(u,(y,x)=>{if(!x)return t(y,null);Xl(u,(b,A)=>{if(!A)return t(b,null);const P={name:r.name,fileType:f,size:r.size,width:x.width,height:x.height,imgUrl:u,imageData:A,blob:g};return t(null,P)})})})},o.readAsArrayBuffer(r)}},Xl=(n,t)=>{Js(n,(e,i)=>{if(!i)return t(e,null);const r=document.createElement("canvas"),s=r.getContext("2d");r.width=i.width,r.height=i.height,s.drawImage(i.element,0,0,r.width,r.height);const a=s.getImageData(0,0,r.width,r.height);return t(null,a)})},a0=(n,t=0,e=0)=>{const i=document.createElement("canvas"),r=i.getContext("2d");return i.width=t,i.height=e,r.drawImage(n,0,0,t,e),r.getImageData(0,0,t,e)},o0=(n,t=0,e=0)=>{const i=document.createElement("canvas"),r=i.getContext("2d");return i.width=t,i.height=e,r.drawImage(n,0,0,t,e),r.getImageData(0,0,t,e)},l0=n=>{const t=n.width,e=n.height,i=t*e*3,r=i+54,s=[66,77,r&255,r>>8&255,r>>16&255,r>>24&255,0,0,0,0,54,0,0,0],a=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,i&255,i>>8&255,i>>16&255,i>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=(4-t*3%4)%4,l=n.data;let c="";const f=t<<2;let g=e;const p=String.fromCharCode;do{const y=f*(g-1);let x="";for(let b=0;b<t;b++){const A=b<<2;x+=p(l[y+A+2])+p(l[y+A+1])+p(l[y+A])}for(let b=0;b<o;b++)x+=String.fromCharCode(0);c+=x}while(--g);function u(y){if(!window.btoa)throw"btoa undefined";let x="";if(typeof y=="string")x=y;else for(let b=0;b<y.length;b++)x+=String.fromCharCode(y[b]);return btoa(x)}return u(s.concat(a))+u(c)},c0=n=>{const{width:t,height:e}=n,i=document.createElement("canvas"),r=i.getContext("2d");return i.width=t,i.height=e,r.putImageData(n,0,0,0,0,t,e),i.toDataURL("image/png")},h0=(n,t,e)=>{const{width:i,height:r}=n,s=document.createElement("canvas"),a=s.getContext("2d");s.width=i,s.height=r,a.putImageData(n,0,0,0,0,i,r);const o=`image/${t?t.toLowerCase():"png"}`;s.toBlob(l=>{e?.(null,l)},o,1)},Ks=(n,t)=>{const e=new FileReader;e.onload=function(i){i.target?t(null,i.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(n)},f0=(n,t)=>{Ks(n,function(e,i){if(i){const r=new Image;r.src=i}else t(e)})};function u0(n){const t=[],e=[],i=[];let r=0;for(let l=0,c=n.data.length;l<c;l+=4)t[r]=n.data[l],e[r]=n.data[l+1],i[r]=n.data[l+2],r+=1;const s=Qs(t),a=Qs(e),o=Qs(i);return"rgb("+s+","+a+","+o+")"}function Qs(n){const t={},e=[],i=[];for(let o=0;o<n.length;o++)t[n[o]]?e.push(n[o]):t[n[o]]=1;let r=0;for(let o=0;o<e.length;o++){r=0;for(let l=0;l<e.length;l++)e[o]===e[l]&&(r+=1),i[o]=r}const s=Math.max.apply(null,i);let a=0;for(;a<i.length;a++)if(i[a]===s)return;return e[a]}const d0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=t[(a*e+e-o-1)*4],r[l+1]=t[(a*e+e-o-1)*4+1],r[l+2]=t[(a*e+e-o-1)*4+2],r[l+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(r,e,i)},p0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=t[((i-a-1)*e+o)*4],r[l+1]=t[((i-a-1)*e+o)*4+1],r[l+2]=t[((i-a-1)*e+o)*4+2],r[l+3]=t[((i-a-1)*e+o)*4+3]}return new ImageData(r,e,i)},g0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<i;o++){const l=(a*i+o)*4;r[l]=t[(o*e+e-a-1)*4],r[l+1]=t[(o*e+e-a-1)*4+1],r[l+2]=t[(o*e+e-a-1)*4+2],r[l+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(r,i,e)},m0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<i;o++){const l=(a*i+o)*4;r[l]=t[((i-o-1)*e+a)*4],r[l+1]=t[((i-o-1)*e+a)*4+1],r[l+2]=t[((i-o-1)*e+a)*4+2],r[l+3]=t[((i-o-1)*e+a)*4+3]}return new ImageData(r,i,e)},v0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4,c=(t[l]+t[l+1]+t[l+2])/3;r[l]=c,r[l+1]=c,r[l+2]=c,r[l+3]=t[l+3]}return new ImageData(r,e,i)},_0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4,c=.2126*t[l]+.7152*t[l+1]+.0722*t[l+2];r[l]=c,r[l+1]=c,r[l+2]=c,r[l+3]=t[l+3]}return new ImageData(r,e,i)},w0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4,f=(t[l]+t[l+1]+t[l+2])/3>127?255:0;r[l]=f,r[l+1]=f,r[l+2]=f,r[l+3]=t[l+3]}return new ImageData(r,e,i)},y0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=255-t[l],r[l+1]=255-t[l+1],r[l+2]=255-t[l+2],r[l+3]=t[l+3]}return new ImageData(r,e,i)},x0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=t[l],r[l+1]=0,r[l+2]=0,r[l+3]=t[l+3]}return new ImageData(r,e,i)},b0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=0,r[l+1]=t[l+1],r[l+2]=0,r[l+3]=t[l+3]}return new ImageData(r,e,i)},T0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=0,r[l+1]=0,r[l+2]=t[l+2],r[l+3]=t[l+3]}return new ImageData(r,e,i)},C0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=t[l],r[l+1]=t[l+1],r[l+2]=0,r[l+3]=t[l+3]}return new ImageData(r,e,i)},E0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=t[l],r[l+1]=0,r[l+2]=t[l+1],r[l+3]=t[l+3]}return new ImageData(r,e,i)},k0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=0,r[l+1]=t[l+1],r[l+2]=t[l+1],r[l+3]=t[l+3]}return new ImageData(r,e,i)},S0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4,c=(t[l+1]+t[l+2])/2;r[l]=t[l],r[l+1]=c,r[l+2]=c,r[l+3]=t[l+3]}return new ImageData(r,e,i)},A0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4,c=(t[l]+t[l+2])/2;r[l]=c,r[l+1]=t[l+1],r[l+2]=c,r[l+3]=t[l+3]}return new ImageData(r,e,i)},P0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4,c=(t[l]+t[l+1])/2;r[l]=c,r[l+1]=c,r[l+2]=t[l+2],r[l+3]=t[l+3]}return new ImageData(r,e,i)},I0=n=>Yl(n,[-1,-1,-1,-1,9,-1,-1,-1,-1]),M0=n=>Yl(n,[-1,-1,-1,-1,8,-1,-1,-1,-1]),L0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=t[l],r[l+1]=t[l+1],r[l+2]=t[l+2],r[l+3]=255}return new ImageData(r,e,i)},D0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;if(t[l+3]===0)r[l]=255,r[l+1]=255,r[l+2]=255,r[l+3]=255;else{const c=Zl([t[l],t[l+1],t[l+2],t[l+3]],[255,255,255,255]);r[l]=c[0],r[l+1]=c[1],r[l+2]=c[2],r[l+3]=c[3]}}return new ImageData(r,e,i)},R0=(n,t,e,i,r,s=!1,a)=>{const{data:o,width:l,height:c}=n;let f=r,g=i,p=t,u=e;if(f<0?f=0:f>l&&(f=l),g<0?g=0:g>c&&(g=c),p<1?p=1:p>l&&(p=l),u<1?u=1:u>c&&(u=c),f+p>l&&(p=l-f),g+u>c&&(u=c-g),s){const y=new Uint8ClampedArray(o.length);for(let b=0;b<c;b++)for(let A=0;A<l;A++){const P=(b*l+A)*4;A>=f&&A<=f+p&&b>=g&&b<=g+u?(y[P]=o[P],y[P+1]=o[P+1],y[P+2]=o[P+2],y[P+3]=o[P+3]):(y[P]=255,y[P+1]=255,y[P+2]=255,y[P+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(y,l,c)}else{const y=new Uint8ClampedArray(p*u*4);for(let b=g;b<=g+u;b++)for(let A=f;A<=f+p;A++){const P=((b-g)*p+A-f)*4,M=(b*l+A)*4;y[P]=o[M],y[P+1]=o[M+1],y[P+2]=o[M+2],y[P+3]=o[M+3]}return new ImageData(y,p,u)}},O0=(n,t,e,i)=>{const{data:r,width:s,height:a}=n;let o=t;o>Math.floor(s/2)&&(o=Math.floor(s/2)),o>Math.floor(a/2)&&(o=Math.floor(a/2)),o<0&&(o=0);const l=new Uint8ClampedArray(r.length);for(let f=0;f<a;f++)for(let g=0;g<s;g++){const p=(f*s+g)*4;let u=-1;g<o?f<o?u=Math.sqrt(Math.pow(o-g-1,2)+Math.pow(o-f-1,2)):f>a-o-1&&(u=Math.sqrt(Math.pow(o-g-1,2)+Math.pow(f-(a-o),2))):g>s-o-1&&(f<o?u=Math.sqrt(Math.pow(g-(s-o),2)+Math.pow(o-f-1,2)):f>a-o-1&&(u=Math.sqrt(Math.pow(g-(s-o),2)+Math.pow(f-(a-o),2)))),Math.round(u)>o?(l[p]=255,l[p+1]=255,l[p+2]=255,l[p+3]=i||e.toUpperCase()==="PNG"?0:255):(l[p]=r[p],l[p+1]=r[p+1],l[p+2]=r[p+2],l[p+3]=i||e.toUpperCase()==="PNG"?r[p+3]:255)}return new ImageData(l,s,a)},F0=(n,t,e,i,r,s=1e4)=>{const a=new Image;a.src=n;const o=document.createElement("canvas"),l=o.getContext("2d");return o.width=s,o.height=s,l.drawImage(a,0,0,t,e,0,0,i,r),l.getImageData(0,0,i,r)},z0=(n,t)=>{const{data:e,width:i,height:r}=n,s=new Uint8ClampedArray(e.length);for(let o=0;o<r;o++)for(let l=0;l<i;l++){const c=(o*i+l)*4;s[c]=Math.max(Math.min(e[c]+t,255),0),s[c+1]=Math.max(Math.min(e[c+1]+t,255),0),s[c+2]=Math.max(Math.min(e[c+2]+t,255),0),s[c+3]=e[c+3]}return new ImageData(s,i,r)},U0=(n,t,e=!1)=>{const{data:i,width:r,height:s}=n,a=new Uint8ClampedArray(i.length);for(let l=0;l<s;l++)for(let c=0;c<r;c++){const f=(l*r+c)*4;i[f+3]===0?(a[f]=255,a[f+1]=255,a[f+2]=255):(a[f]=i[f],a[f+1]=i[f+1],a[f+2]=i[f+2]);let g=i[f+3];e?g=Math.max(Math.min(Math.floor(255*t),255),0):g=Math.max(Math.min(Math.floor(g+255*t),255),0),a[f+3]=g}return new ImageData(a,r,s)},N0=(n,t,e,i)=>{const{data:r,width:s,height:a}=n,{data:o,width:l,height:c}=t;let f=e,g=i;e+c>a&&(f=a-c),i+l>s&&(g=s-l);const p=new Uint8ClampedArray(r.length);for(let y=0;y<a;y++)for(let x=0;x<s;x++){const b=(y*s+x)*4;if(x<g||x>g+l||y<=f||y>=f+c)p[b]=r[b],p[b+1]=r[b+1],p[b+2]=r[b+2],p[b+3]=r[b+3];else{const A=(y*s+x-((f+1)*s+(y-(f+1))*(s-l))+l-g-1)*4,P=[o[A],o[A+1],o[A+2],o[A+3]],M=[r[b],r[b+1],r[b+2],r[b+3]],D=Zl(P,M);p[b]=D[0],p[b+1]=D[1],p[b+2]=D[2],p[b+3]=D[3]}}return new ImageData(p,s,a)},B0=(n,t,e,i,r,s=10)=>{const{data:a,width:o,height:l}=n;let c=r,f=i,g=t,p=e;c<0?c=0:c>o&&(c=o),f<0?f=0:f>l&&(f=l),g<1?g=1:g>o&&(g=o),p<1?p=1:p>l&&(p=l),c+g>o&&(g=o-c),f+p>l&&(p=l-f);const u=new Uint8ClampedArray(a.length);for(let x=0;x<l;x++)for(let b=0;b<o;b++){const A=(x*o+b)*4;if(b>=c&&b<=c+g&&x>=f&&x<=f+p){const P=Math.floor((b-c)/s),M=Math.floor((x-f)/s);let D=Math.floor(s*(P+1)-s/2+c),z=Math.floor(s*(M+1)-s/2+f);D>o-1&&(D=o-1),z>l-1&&(z=l-1);const N=(z*o+D)*4;u[A]=a[N],u[A+1]=a[N+1],u[A+2]=a[N+2],u[A+3]=a[N+3]}else u[A]=a[A],u[A+1]=a[A+1],u[A+2]=a[A+2],u[A+3]=a[A+3]}return new ImageData(u,o,l)},G0=async(n,t,e,i,r,s)=>{const a=r/100;if(["JPG","JPEG"].includes(i.toUpperCase())){const o=new Image;o.src=n;const l=document.createElement("canvas"),c=l.getContext("2d");l.width=t,l.height=e,c.drawImage(o,0,0,t,e),l.toBlob(f=>{s(f)},`image/${i.toLowerCase()}`,a)}else{const o=Math.floor(a*256),l=r0.encode([n.data.buffer],t,e,o),c=new Blob([l]);s&&s(c)}},H0=(n,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}})=>{if(t&&e){const{data:i,width:r,height:s}=n,{data:a}=t,o=new Uint8ClampedArray(i.length),{backgroundColor:l,changeIntoColor:c}=e;for(let g=0;g<s;g++)for(let p=0;p<r;p++){const u=(g*r+p)*4,y=a[u],x=a[u+1],b=a[u+2],A=a[u+3];y===l.r&&x===l.g&&b===l.b&&A===l.a&&c.a!==0?(o[u]=c.r,o[u+1]=c.g,o[u+2]=c.b,o[u+3]=c.a):(o[u]=i[u],o[u+1]=i[u+1],o[u+2]=i[u+2],o[u+3]=i[u+3])}return new ImageData(o,r,s)}return n},Yl=(n,t)=>{const{data:e,width:i,height:r}=n,s=new Uint8ClampedArray(e.length);for(let o=0;o<r;o++)for(let l=0;l<i;l++){const c=(o*i+l)*4;for(let f=0;f<3;f++){const g=c+f;l===0||l===i-1||o===0||o===r-1?s[g]=e[g]:s[g]=t[0]*e[g-i*4-4]+t[1]*e[g-i*4]+t[2]*e[g-i*4+4]+t[3]*e[g-4]+t[4]*e[g]+t[5]*e[g+4]+t[6]*e[g+i*4-4]+t[7]*e[g+i*4]+t[8]*e[g+i*4+4]}s[c+3]=e[c+3]}return new ImageData(s,i,r)},Zl=(n,t)=>{if(n&&n.length===4&&t&&t.length===4){const e=n[3],i=t[3];if(e===255||i===0)return n;if(e===0)return t;{const r=e/255,s=i/255,a=Math.max(Math.min(Math.floor(n[0]*r+t[0]*s*(1-r)),255),0),o=Math.max(Math.min(Math.floor(n[1]*r+t[1]*s*(1-r)),255),0),l=Math.max(Math.min(Math.floor(n[2]*r+t[2]*s*(1-r)),255),0),c=Math.max(Math.min(Math.floor((r+s*(1-r))*255),255),0);return[a,o,l,c]}}return[255,255,255,255]},$l=function(n,t,e){const i=new Array(n*n),r=function(o){const l=o;let c=0,f=0;return{write(g,p){if(g>>>p)throw new Error("length over");for(;c+p>=8;)l.writeByte(255&(g<<c|f)),p-=8-c,g>>>=8-c,f=0,c=0;f=g<<c|f,c=c+p},flush(){c>0&&l.writeByte(f)}}},s=function(o){const l=1<<o,c=(1<<o)+1;let f=o+1;const g=a();for(let b=0;b<l;b++)g.add(String.fromCharCode(b));g.add(String.fromCharCode(l)),g.add(String.fromCharCode(c));const p=ha(),u=r(p);u.write(l,f);let y=0,x=String.fromCharCode(i[y]);for(y+=1;y<i.length;){const b=String.fromCharCode(i[y]);y+=1,g.contains(x+b)?x=x+b:(u.write(g.indexOf(x),f),g.size()<4095&&(g.size()==1<<f&&(f+=1),g.add(x+b)),x=b)}return u.write(g.indexOf(x),f),u.write(c,f),u.flush(),p.toByteArray()},a=function(){const o={};let l=0;return{add(c){if(this.contains(c))throw new Error("dup key:"+c);o[c]=l,l+=1},size(){return l},indexOf(c){return o[c]},contains(c){return typeof o[c]<"u"}}};return{setPixel(o,l,c){i[l*n+o]=c},write(o){o.writeString("GIF87a"),o.writeShort(n),o.writeShort(n),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte(Fn("0x"+t[1]+t[2])),o.writeByte(Fn("0x"+t[3]+t[4])),o.writeByte(Fn("0x"+t[5]+t[6])),o.writeByte(Fn("0x"+e[1]+e[2])),o.writeByte(Fn("0x"+e[3]+e[4])),o.writeByte(Fn("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(n),o.writeShort(n),o.writeByte(0);const l=2,c=s(l);o.writeByte(l);let f=0;for(;c.length-f>255;)o.writeByte(255),o.writeBytes(c,f,255),f+=255;o.writeByte(c.length-f),o.writeBytes(c,f,c.length-f),o.writeByte(0),o.writeString(";")}}},ql=function(n,t,e,i){const r=$l(n,t,e);for(let c=0;c<n;c++)for(let f=0;f<n;f++)r.setPixel(f,c,i(f,c));const s=ha();r.write(s);const a=wc(),o=s.toByteArray();for(let c=0,f=o.length;c<f;c++)a.writeByte(o[c]);a.flush();let l="";return l+="data:image/gif;base64,",l+=a,l},ue={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},zi={M:0,L:1,H:2,Q:3},cn={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Zt={glog:function(n){if(n<1)throw new Error("glog("+n+")");return Zt.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return Zt.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let n=0;n<8;n++)Zt.EXP_TABLE[n]=1<<n;for(let n=8;n<256;n++)Zt.EXP_TABLE[n]=Zt.EXP_TABLE[n-4]^Zt.EXP_TABLE[n-5]^Zt.EXP_TABLE[n-6]^Zt.EXP_TABLE[n-8];for(let n=0;n<255;n++)Zt.LOG_TABLE[Zt.EXP_TABLE[n]]=n;const Gt={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(n){let t=n<<10;for(;Gt.getBCHDigit(t)-Gt.getBCHDigit(Gt.G15)>=0;)t^=Gt.G15<<Gt.getBCHDigit(t)-Gt.getBCHDigit(Gt.G15);return(n<<10|t)^Gt.G15_MASK},getBCHTypeNumber:function(n){let t=n<<12;for(;Gt.getBCHDigit(t)-Gt.getBCHDigit(Gt.G18)>=0;)t^=Gt.G18<<Gt.getBCHDigit(t)-Gt.getBCHDigit(Gt.G18);return n<<12|t},getBCHDigit:function(n){let t=0;for(;n!=0;)t++,n>>>=1;return t},getPatternPosition:function(n){return Gt.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,t,e){switch(n){case cn.PATTERN000:return(t+e)%2==0;case cn.PATTERN001:return t%2==0;case cn.PATTERN010:return e%3==0;case cn.PATTERN011:return(t+e)%3==0;case cn.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case cn.PATTERN101:return t*e%2+t*e%3==0;case cn.PATTERN110:return(t*e%2+t*e%3)%2==0;case cn.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){let t=new Wn([1],0);for(let e=0;e<n;e++)t=t.multiply(new Wn([1,Zt.gexp(e)],0));return t},getLengthInBits:function(n,t){if(1<=t&&t<10)switch(n){case ue.MODE_NUMBER:return 10;case ue.MODE_ALPHA_NUM:return 9;case ue.MODE_8BIT_BYTE:return 8;case ue.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(t<27)switch(n){case ue.MODE_NUMBER:return 12;case ue.MODE_ALPHA_NUM:return 11;case ue.MODE_8BIT_BYTE:return 16;case ue.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(t<41)switch(n){case ue.MODE_NUMBER:return 14;case ue.MODE_ALPHA_NUM:return 13;case ue.MODE_8BIT_BYTE:return 16;case ue.MODE_KANJI:return 12;default:throw new Error("mode:"+n)}else throw new Error("type:"+t)},getLostPoint:function(n){const t=n.getModuleCount();let e=0;for(let s=0;s<t;s++)for(let a=0;a<t;a++){let o=0;const l=n.isDark(s,a);for(let c=-1;c<=1;c++)if(!(s+c<0||t<=s+c))for(let f=-1;f<=1;f++)a+f<0||t<=a+f||c==0&&f==0||l==n.isDark(s+c,a+f)&&o++;o>5&&(e+=3+o-5)}for(let s=0;s<t-1;s++)for(let a=0;a<t-1;a++){let o=0;n.isDark(s,a)&&o++,n.isDark(s+1,a)&&o++,n.isDark(s,a+1)&&o++,n.isDark(s+1,a+1)&&o++,(o==0||o==4)&&(e+=3)}for(let s=0;s<t;s++)for(let a=0;a<t-6;a++)n.isDark(s,a)&&!n.isDark(s,a+1)&&n.isDark(s,a+2)&&n.isDark(s,a+3)&&n.isDark(s,a+4)&&!n.isDark(s,a+5)&&n.isDark(s,a+6)&&(e+=40);for(let s=0;s<t;s++)for(let a=0;a<t-6;a++)n.isDark(a,s)&&!n.isDark(a+1,s)&&n.isDark(a+2,s)&&n.isDark(a+3,s)&&n.isDark(a+4,s)&&!n.isDark(a+5,s)&&n.isDark(a+6,s)&&(e+=40);let i=0;for(let s=0;s<t;s++)for(let a=0;a<t;a++)n.isDark(a,s)&&i++;const r=Math.abs(100*i/t/t-50)/5;return e+=r*10,e}};class Wn{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let i=0;for(;i<t.length&&t[i]==0;)i++;this.num=new Array(t.length-i+e);for(let r=0;r<t.length-i;r++)this.num[r]=t[r+i]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let i=0;i<this.getLength();i++)for(let r=0;r<t.getLength();r++)e[i+r]^=Zt.gexp(Zt.glog(this.get(i))+Zt.glog(t.get(r)));return new Wn(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=Zt.glog(this.get(0))-Zt.glog(t.get(0)),i=new Array(this.getLength());for(let r=0;r<this.getLength();r++)i[r]=this.get(r);for(let r=0;r<t.getLength();r++)i[r]^=Zt.gexp(Zt.glog(t.get(r))+e);return new Wn(i,0).mod(t)}}class je{totalCount;dataCount;constructor(t,e){this.totalCount=t,this.dataCount=e}static RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];static getRSBlocks(t,e){const i=je.getRsBlockTable(t,e);if(i==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const r=i.length/3,s=[];for(let a=0;a<r;a++){const o=i[a*3+0],l=i[a*3+1],c=i[a*3+2];for(let f=0;f<o;f++)s.push(new je(l,c))}return s}static getRsBlockTable(t,e){switch(e){case zi.L:return je.RS_BLOCK_TABLE[(t-1)*4+0];case zi.M:return je.RS_BLOCK_TABLE[(t-1)*4+1];case zi.Q:return je.RS_BLOCK_TABLE[(t-1)*4+2];case zi.H:return je.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Wl{buffer;length;constructor(){this.buffer=[],this.length=0}get(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1}put(t,e){for(let i=0;i<e;i++)this.putBit((t>>>e-i-1&1)==1)}getLengthInBits(){return this.length}putBit(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}class j0{mode;data;constructor(t){this.mode=ue.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,i=this.data.length;e<i;e++)t.put(this.data.charCodeAt(e),8)}}class hn{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=zi[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new j0(t);this.dataList.push(e),this.dataCache=null}isDark(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]}getModuleCount(){return this.moduleCount}make(){if(this.typeNumber<1){let t=1;for(t=1;t<40;t++){const e=je.getRSBlocks(t,this.errorCorrectLevel),i=new Wl;let r=0;for(let s=0;s<e.length;s++)r+=e[s].dataCount;for(let s=0;s<this.dataList.length;s++){const a=this.dataList[s];i.put(a.mode,4),i.put(a.getLength(),Gt.getLengthInBits(a.mode,t)),a.write(i)}if(i.getLengthInBits()<=r*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++){this.modules[i]=new Array(this.moduleCount);for(let r=0;r<this.moduleCount;r++)this.modules[i][r]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=hn.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let i=-1;i<=7;i++)if(!(t+i<=-1||this.moduleCount<=t+i))for(let r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(0<=i&&i<=6&&(r==0||r==6)||0<=r&&r<=6&&(i==0||i==6)||2<=i&&i<=4&&2<=r&&r<=4?this.modules[t+i][e+r]=!0:this.modules[t+i][e+r]=!1)}getBestMaskPattern(){let t=0,e=0;for(let i=0;i<8;i++){this.makeImpl(!0,i);const r=Gt.getLostPoint(this);(i==0||t>r)&&(t=r,e=i)}return e}createMovieClip(t,e,i){const r=t.createEmptyMovieClip(e,i),s=1;this.make();for(let a=0;a<this.modules.length;a++){const o=a*s;for(let l=0;l<this.modules[a].length;l++){const c=l*s;this.modules[a][l]&&(r.beginFill(0,100),r.moveTo(c,o),r.lineTo(c+s,o),r.lineTo(c+s,o+s),r.lineTo(c,o+s),r.endFill())}}return r}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=Gt.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let i=0;i<t.length;i++){const r=t[e],s=t[i];if(this.modules[r][s]==null)for(let a=-2;a<=2;a++)for(let o=-2;o<=2;o++)a==-2||a==2||o==-2||o==2||a==0&&o==0?this.modules[r+a][s+o]=!0:this.modules[r+a][s+o]=!1}}setupTypeNumber(t){const e=Gt.getBCHTypeNumber(this.typeNumber);for(let i=0;i<18;i++){const r=!t&&(e>>i&1)==1;this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=r}for(let i=0;i<18;i++){const r=!t&&(e>>i&1)==1;this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=r}}setupTypeInfo(t,e){const i=this.errorCorrectLevel<<3|e,r=Gt.getBCHTypeInfo(i);for(let s=0;s<15;s++){const a=!t&&(r>>s&1)==1;s<6?this.modules[s][8]=a:s<8?this.modules[s+1][8]=a:this.modules[this.moduleCount-15+s][8]=a}for(let s=0;s<15;s++){const a=!t&&(r>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=a:s<9?this.modules[8][15-s-1+1]=a:this.modules[8][15-s-1]=a}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let i=-1,r=this.moduleCount-1,s=7,a=0;for(let o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(let l=0;l<2;l++)if(this.modules[r][o-l]==null){let c=!1;a<t.length&&(c=(t[a]>>>s&1)==1),Gt.getMask(e,r,o-l)&&(c=!c),this.modules[r][o-l]=c,s--,s==-1&&(a++,s=7)}if(r+=i,r<0||this.moduleCount<=r){r-=i,i=-i;break}}}static createData(t,e,i){const r=je.getRSBlocks(t,e),s=new Wl;for(let o=0;o<i.length;o++){const l=i[o];s.put(l.mode,4),s.put(l.getLength(),Gt.getLengthInBits(l.mode,t)),l.write(s)}let a=0;for(let o=0;o<r.length;o++)a+=r[o].dataCount;if(s.getLengthInBits()>a*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+a*8+")");for(s.getLengthInBits()+4<=a*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=a*8||(s.put(hn.PAD0,8),s.getLengthInBits()>=a*8));)s.put(hn.PAD1,8);return hn.createBytes(s,r)}static createBytes(t,e){let i=0,r=0,s=0;const a=new Array(e.length),o=new Array(e.length);for(let g=0;g<e.length;g++){const p=e[g].dataCount,u=e[g].totalCount-p;r=Math.max(r,p),s=Math.max(s,u),a[g]=new Array(p);for(let A=0;A<a[g].length;A++)a[g][A]=255&t.buffer[A+i];i+=p;const y=Gt.getErrorCorrectPolynomial(u),b=new Wn(a[g],y.getLength()-1).mod(y);o[g]=new Array(y.getLength()-1);for(let A=0;A<o[g].length;A++){const P=A+b.getLength()-o[g].length;o[g][A]=P>=0?b.get(P):0}}let l=0;for(let g=0;g<e.length;g++)l+=e[g].totalCount;const c=new Array(l);let f=0;for(let g=0;g<r;g++)for(let p=0;p<e.length;p++)g<a[p].length&&(c[f++]=a[p][g]);for(let g=0;g<s;g++)for(let p=0;p<e.length;p++)g<o[p].length&&(c[f++]=o[p][g]);return c}}const Jl=Math.ceil,Ui=Math.floor,Kl=Math.round;function V0(n,t){const e=la(n),i=t?.ecc||"H",r=t?.size||256,s=-1,a=t?.padding||0,o=t?.color||"#000000",l=t?.background||"#ffffff",c=new hn(s,i);c.addData(e),c.make();const f=c.getModuleCount(),g=(r-a*2)/f,p=a,u=r-a;return ql(r,o,l,function(y,x){if(p<=y&&y<u&&p<=x&&x<u){const b=Ui((y-p)/g),A=Ui((x-p)/g);return c.isDark(A,b)?0:1}else return 1})}function X0(n,t){const e=t.x||0,i=t.y||0,r=la(n),s=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?Ui(t.size):256,l=t.padding||0,c=-1,f=t.color||"#000000",g=t.background||"#ffffff",p=new hn(c,a);p.addData(r),p.make();const u=p.getModuleCount(),y=(o-l*2)/u;s.fillStyle=g,s.fillRect(e,i,o,o);for(let x=0;x<u;x++)for(let b=0;b<u;b++){const A=Jl((b+1)*y)-Ui(b*y),P=Jl((x+1)*y)-Ui(x*y);s.fillStyle=p.isDark(x,b)?f:g,s.fillRect(e+Kl(b*y)+l,i+Kl(x*y)+l,A,P)}}function ta(){let n=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0;e<t.length;e++)try{n=new window.ActiveXObject(t[e]);break}catch{continue}}else n=new XMLHttpRequest;return n}function Y0(n){if(!n.action)return{url:"",data:"",boundary:""};const t=n.method.toLowerCase()==="get",e=n.method.toLowerCase()==="post";let i=n.action,r="";const s="---------------------------"+Date.now().toString(16);if(window.FormData)r=new FormData(n),t&&(i=hr(i,ys(r)));else if(t){let a="";for(let o=0;o<n.elements.length;o++){const l=n.elements[o];if(!l.hasAttribute("name"))continue;const c=l.nodeName.toUpperCase()==="INPUT"?l.getAttribute("type")?.toUpperCase():"TEXT";if(c==="FILE")for(let f=0,g=l.files?.length??0;f<g;a+="&"+encodeURIComponent(l.name)+"="+encodeURIComponent(l.files?.[f++].name??""));else(c!=="RADIO"&&c!=="CHECKBOX"||l.checked)&&(a+="&"+encodeURIComponent(l.name)+"="+encodeURIComponent(l.value))}i=hr(i,a)}else if(e){const a=[];if(n.enctype==="application/x-www-form-urlencoded"){for(let o=0;o<n.elements.length;o++){const l=n.elements[o];l.hasAttribute("name")&&a.push(encodeURIComponent(l.name)+"="+encodeURIComponent(l.value))}r=a.join("&")}else if(n.enctype==="text/plain"){for(let o=0;o<n.elements.length;o++){const l=n.elements[o];l.hasAttribute("name")&&a.push(l.name+"="+l.value)}r=a.join(`\r
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
})`}static encodeHTML(t,e="encode"){const i={"&":"&","<":"<",">":">",""":'"',"'":"'"};for(const n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t=t.replace(new RegExp(e=="decode"?n:i[n],"g"),e=="decode"?i[n]:n));return t}static getInnerText=t=>{let e=t.innerText;if(!e){const i=t.querySelector("slot")?.assignedNodes()||[];let n=0;for(;!e&&n<=i.length-1;)"innerText"in i[n]&&(e=i[n].innerText),n++}return e};static copyToClipboard=t=>new Promise((e,i)=>{if(navigator.clipboard)navigator.clipboard.writeText(t).then(e).catch(i);else{const n=document.createElement("textarea");n.value=t,n.style.opacity="0",n.style.top="0",n.style.left="0",n.style.position="fixed",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy")?e():i()}catch(r){i(r)}document.body.removeChild(n)}});static scrollTo=(t,e)=>window.scrollTo(t,e);static setScrollRestoration(t){try{window.history.scrollRestoration=t}catch{}}static getLocation(){return new Promise((t,e)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(i=>{t(i.coords)}):e("Geolocation is not supported by this browser")})}static vibrate(t=200){"vibrate"in navigator?window.navigator.vibrate(t):console.error("Your device is not support vibrate on this browser.")}static getSelectedText=()=>window.getSelection()?.toString();static isElementFocus=t=>t===document.activeElement;static isTabInView=()=>!document.hidden;static navigateBack=()=>history.back();static navigateBack2=()=>history.go(-1);static iframePostMessage(t,e="http://test.com/localstorage.html"){const i=document.createElement("iframe");i.src=e,document.body.append(i),setTimeout(function(){i.contentWindow?.postMessage(t,e)},4e3),setTimeout(function(){i.remove()},6e3)}static getTextWidth=(t,e=12,i=400)=>{const n=document.createElement("span");n.style.visibility="hidden",n.style.padding="0",n.style.whiteSpace="nowrap",n.style.overflow="visible",n.style.fontSize=e>12?e+"px":"12px",n.style.fontWeight=i.toString(),n.innerText=t,document.body.appendChild(n);const r=n.offsetWidth;return document.body.removeChild(n),r};static getFixedWidthText=(t,e,i=12,n=400,r=!0)=>{let a="";if(!t||e<i)return a;const o=t.split(""),h="...";let c=r?A.getTextWidth(h,i,n):0;for(let f=0,m=o.length;f<m;f++)if(c+=A.getTextWidth(o[f],i,n),c>e){r&&(a+=h);break}else a+=o[f];return a}}function er(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var as={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
19
|
+
* http://hammerjs.github.io/
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) 2016 Jorik Tangelder;
|
|
22
|
+
* Licensed under the MIT license */(function(s){(function(t,e,i,n){var r=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),o="function",h=Math.round,c=Math.abs,f=Date.now;function m(l,u,g){return setTimeout(I(l,g),u)}function w(l,u,g){return Array.isArray(l)?(p(l,g[u],g),!0):!1}function p(l,u,g){var v;if(l)if(l.forEach)l.forEach(u,g);else if(l.length!==n)for(v=0;v<l.length;)u.call(g,l[v],v,l),v++;else for(v in l)l.hasOwnProperty(v)&&u.call(g,l[v],v,l)}function y(l,u,g){var v="DEPRECATED METHOD: "+u+`
|
|
23
|
+
`+g+` AT
|
|
24
|
+
`;return function(){var S=new Error("get-stack-trace"),M=S&&S.stack?S.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",R=t.console&&(t.console.warn||t.console.log);return R&&R.call(t.console,v,M),l.apply(this,arguments)}}var x;typeof Object.assign!="function"?x=function(u){if(u===n||u===null)throw new TypeError("Cannot convert undefined or null to object");for(var g=Object(u),v=1;v<arguments.length;v++){var S=arguments[v];if(S!==n&&S!==null)for(var M in S)S.hasOwnProperty(M)&&(g[M]=S[M])}return g}:x=Object.assign;var b=y(function(u,g,v){for(var S=Object.keys(g),M=0;M<S.length;)(!v||v&&u[S[M]]===n)&&(u[S[M]]=g[S[M]]),M++;return u},"extend","Use `assign`."),C=y(function(u,g){return b(u,g,!0)},"merge","Use `assign`.");function _(l,u,g){var v=u.prototype,S;S=l.prototype=Object.create(v),S.constructor=l,S._super=v,g&&x(S,g)}function I(l,u){return function(){return l.apply(u,arguments)}}function E(l,u){return typeof l==o?l.apply(u&&u[0]||n,u):l}function L(l,u){return l===n?u:l}function O(l,u,g){p(j(u),function(v){l.addEventListener(v,g,!1)})}function B(l,u,g){p(j(u),function(v){l.removeEventListener(v,g,!1)})}function H(l,u){for(;l;){if(l==u)return!0;l=l.parentNode}return!1}function z(l,u){return l.indexOf(u)>-1}function j(l){return l.trim().split(/\s+/g)}function it(l,u,g){if(l.indexOf&&!g)return l.indexOf(u);for(var v=0;v<l.length;){if(g&&l[v][g]==u||!g&&l[v]===u)return v;v++}return-1}function ht(l){return Array.prototype.slice.call(l,0)}function At(l,u,g){for(var v=[],S=[],M=0;M<l.length;){var R=u?l[M][u]:l[M];it(S,R)<0&&v.push(l[M]),S[M]=R,M++}return g&&(u?v=v.sort(function(q,Z){return q[u]>Z[u]}):v=v.sort()),v}function bt(l,u){for(var g,v,S=u[0].toUpperCase()+u.slice(1),M=0;M<r.length;){if(g=r[M],v=g?g+S:u,v in l)return v;M++}return n}var Vt=1;function lt(){return Vt++}function Lt(l){var u=l.ownerDocument||l;return u.defaultView||u.parentWindow||t}var k=/mobile|tablet|ip(ad|hone|od)|android/i,D="ontouchstart"in t,P=bt(t,"PointerEvent")!==n,N=D&&k.test(navigator.userAgent),F="touch",nt="pen",kt="mouse",Go="kinect",Bo=25,J=1,Rt=2,V=4,tt=8,Ie=1,ce=2,le=4,ue=8,fe=16,ut=ce|le,Ot=ue|fe,Vs=ut|Ot,Xs=["x","y"],Me=["clientX","clientY"];function rt(l,u){var g=this;this.manager=l,this.callback=u,this.element=l.element,this.target=l.options.inputTarget,this.domHandler=function(v){E(l.options.enable,[l])&&g.handler(v)},this.init()}rt.prototype={handler:function(){},init:function(){this.evEl&&O(this.element,this.evEl,this.domHandler),this.evTarget&&O(this.target,this.evTarget,this.domHandler),this.evWin&&O(Lt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&B(this.element,this.evEl,this.domHandler),this.evTarget&&B(this.target,this.evTarget,this.domHandler),this.evWin&&B(Lt(this.element),this.evWin,this.domHandler)}};function Uo(l){var u,g=l.options.inputClass;return g?u=g:P?u=Ci:N?u=Le:D?u=Ti:u=Ae,new u(l,zo)}function zo(l,u,g){var v=g.pointers.length,S=g.changedPointers.length,M=u&J&&v-S===0,R=u&(V|tt)&&v-S===0;g.isFirst=!!M,g.isFinal=!!R,M&&(l.session={}),g.eventType=u,Vo(l,g),l.emit("hammer.input",g),l.recognize(g),l.session.prevInput=g}function Vo(l,u){var g=l.session,v=u.pointers,S=v.length;g.firstInput||(g.firstInput=Ws(u)),S>1&&!g.firstMultiple?g.firstMultiple=Ws(u):S===1&&(g.firstMultiple=!1);var M=g.firstInput,R=g.firstMultiple,W=R?R.center:M.center,q=u.center=Ys(v);u.timeStamp=f(),u.deltaTime=u.timeStamp-M.timeStamp,u.angle=xi(W,q),u.distance=De(W,q),Xo(g,u),u.offsetDirection=js(u.deltaX,u.deltaY);var Z=Hs(u.deltaTime,u.deltaX,u.deltaY);u.overallVelocityX=Z.x,u.overallVelocityY=Z.y,u.overallVelocity=c(Z.x)>c(Z.y)?Z.x:Z.y,u.scale=R?Ho(R.pointers,v):1,u.rotation=R?Yo(R.pointers,v):0,u.maxPointers=g.prevInput?u.pointers.length>g.prevInput.maxPointers?u.pointers.length:g.prevInput.maxPointers:u.pointers.length,Wo(g,u);var dt=l.element;H(u.srcEvent.target,dt)&&(dt=u.srcEvent.target),u.target=dt}function Xo(l,u){var g=u.center,v=l.offsetDelta||{},S=l.prevDelta||{},M=l.prevInput||{};(u.eventType===J||M.eventType===V)&&(S=l.prevDelta={x:M.deltaX||0,y:M.deltaY||0},v=l.offsetDelta={x:g.x,y:g.y}),u.deltaX=S.x+(g.x-v.x),u.deltaY=S.y+(g.y-v.y)}function Wo(l,u){var g=l.lastInterval||u,v=u.timeStamp-g.timeStamp,S,M,R,W;if(u.eventType!=tt&&(v>Bo||g.velocity===n)){var q=u.deltaX-g.deltaX,Z=u.deltaY-g.deltaY,dt=Hs(v,q,Z);M=dt.x,R=dt.y,S=c(dt.x)>c(dt.y)?dt.x:dt.y,W=js(q,Z),l.lastInterval=u}else S=g.velocity,M=g.velocityX,R=g.velocityY,W=g.direction;u.velocity=S,u.velocityX=M,u.velocityY=R,u.direction=W}function Ws(l){for(var u=[],g=0;g<l.pointers.length;)u[g]={clientX:h(l.pointers[g].clientX),clientY:h(l.pointers[g].clientY)},g++;return{timeStamp:f(),pointers:u,center:Ys(u),deltaX:l.deltaX,deltaY:l.deltaY}}function Ys(l){var u=l.length;if(u===1)return{x:h(l[0].clientX),y:h(l[0].clientY)};for(var g=0,v=0,S=0;S<u;)g+=l[S].clientX,v+=l[S].clientY,S++;return{x:h(g/u),y:h(v/u)}}function Hs(l,u,g){return{x:u/l||0,y:g/l||0}}function js(l,u){return l===u?Ie:c(l)>=c(u)?l<0?ce:le:u<0?ue:fe}function De(l,u,g){g||(g=Xs);var v=u[g[0]]-l[g[0]],S=u[g[1]]-l[g[1]];return Math.sqrt(v*v+S*S)}function xi(l,u,g){g||(g=Xs);var v=u[g[0]]-l[g[0]],S=u[g[1]]-l[g[1]];return Math.atan2(S,v)*180/Math.PI}function Yo(l,u){return xi(u[1],u[0],Me)+xi(l[1],l[0],Me)}function Ho(l,u){return De(u[0],u[1],Me)/De(l[0],l[1],Me)}var jo={mousedown:J,mousemove:Rt,mouseup:V},qo="mousedown",$o="mousemove mouseup";function Ae(){this.evEl=qo,this.evWin=$o,this.pressed=!1,rt.apply(this,arguments)}_(Ae,rt,{handler:function(u){var g=jo[u.type];g&J&&u.button===0&&(this.pressed=!0),g&Rt&&u.which!==1&&(g=V),this.pressed&&(g&V&&(this.pressed=!1),this.callback(this.manager,g,{pointers:[u],changedPointers:[u],pointerType:kt,srcEvent:u}))}});var Jo={pointerdown:J,pointermove:Rt,pointerup:V,pointercancel:tt,pointerout:tt},Zo={2:F,3:nt,4:kt,5:Go},qs="pointerdown",$s="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(qs="MSPointerDown",$s="MSPointerMove MSPointerUp MSPointerCancel");function Ci(){this.evEl=qs,this.evWin=$s,rt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}_(Ci,rt,{handler:function(u){var g=this.store,v=!1,S=u.type.toLowerCase().replace("ms",""),M=Jo[S],R=Zo[u.pointerType]||u.pointerType,W=R==F,q=it(g,u.pointerId,"pointerId");M&J&&(u.button===0||W)?q<0&&(g.push(u),q=g.length-1):M&(V|tt)&&(v=!0),!(q<0)&&(g[q]=u,this.callback(this.manager,M,{pointers:g,changedPointers:[u],pointerType:R,srcEvent:u}),v&&g.splice(q,1))}});var Ko={touchstart:J,touchmove:Rt,touchend:V,touchcancel:tt},Qo="touchstart",th="touchstart touchmove touchend touchcancel";function Js(){this.evTarget=Qo,this.evWin=th,this.started=!1,rt.apply(this,arguments)}_(Js,rt,{handler:function(u){var g=Ko[u.type];if(g===J&&(this.started=!0),!!this.started){var v=eh.call(this,u,g);g&(V|tt)&&v[0].length-v[1].length===0&&(this.started=!1),this.callback(this.manager,g,{pointers:v[0],changedPointers:v[1],pointerType:F,srcEvent:u})}}});function eh(l,u){var g=ht(l.touches),v=ht(l.changedTouches);return u&(V|tt)&&(g=At(g.concat(v),"identifier",!0)),[g,v]}var ih={touchstart:J,touchmove:Rt,touchend:V,touchcancel:tt},sh="touchstart touchmove touchend touchcancel";function Le(){this.evTarget=sh,this.targetIds={},rt.apply(this,arguments)}_(Le,rt,{handler:function(u){var g=ih[u.type],v=nh.call(this,u,g);v&&this.callback(this.manager,g,{pointers:v[0],changedPointers:v[1],pointerType:F,srcEvent:u})}});function nh(l,u){var g=ht(l.touches),v=this.targetIds;if(u&(J|Rt)&&g.length===1)return v[g[0].identifier]=!0,[g,g];var S,M,R=ht(l.changedTouches),W=[],q=this.target;if(M=g.filter(function(Z){return H(Z.target,q)}),u===J)for(S=0;S<M.length;)v[M[S].identifier]=!0,S++;for(S=0;S<R.length;)v[R[S].identifier]&&W.push(R[S]),u&(V|tt)&&delete v[R[S].identifier],S++;if(W.length)return[At(M.concat(W),"identifier",!0),W]}var rh=2500,Zs=25;function Ti(){rt.apply(this,arguments);var l=I(this.handler,this);this.touch=new Le(this.manager,l),this.mouse=new Ae(this.manager,l),this.primaryTouch=null,this.lastTouches=[]}_(Ti,rt,{handler:function(u,g,v){var S=v.pointerType==F,M=v.pointerType==kt;if(!(M&&v.sourceCapabilities&&v.sourceCapabilities.firesTouchEvents)){if(S)ah.call(this,g,v);else if(M&&oh.call(this,v))return;this.callback(u,g,v)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function ah(l,u){l&J?(this.primaryTouch=u.changedPointers[0].identifier,Ks.call(this,u)):l&(V|tt)&&Ks.call(this,u)}function Ks(l){var u=l.changedPointers[0];if(u.identifier===this.primaryTouch){var g={x:u.clientX,y:u.clientY};this.lastTouches.push(g);var v=this.lastTouches,S=function(){var M=v.indexOf(g);M>-1&&v.splice(M,1)};setTimeout(S,rh)}}function oh(l){for(var u=l.srcEvent.clientX,g=l.srcEvent.clientY,v=0;v<this.lastTouches.length;v++){var S=this.lastTouches[v],M=Math.abs(u-S.x),R=Math.abs(g-S.y);if(M<=Zs&&R<=Zs)return!0}return!1}var Qs=bt(a.style,"touchAction"),tn=Qs!==n,en="compute",sn="auto",_i="manipulation",Nt="none",de="pan-x",me="pan-y",Re=ch();function Si(l,u){this.manager=l,this.set(u)}Si.prototype={set:function(l){l==en&&(l=this.compute()),tn&&this.manager.element.style&&Re[l]&&(this.manager.element.style[Qs]=l),this.actions=l.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var l=[];return p(this.manager.recognizers,function(u){E(u.options.enable,[u])&&(l=l.concat(u.getTouchAction()))}),hh(l.join(" "))},preventDefaults:function(l){var u=l.srcEvent,g=l.offsetDirection;if(this.manager.session.prevented){u.preventDefault();return}var v=this.actions,S=z(v,Nt)&&!Re[Nt],M=z(v,me)&&!Re[me],R=z(v,de)&&!Re[de];if(S){var W=l.pointers.length===1,q=l.distance<2,Z=l.deltaTime<250;if(W&&q&&Z)return}if(!(R&&M)&&(S||M&&g&ut||R&&g&Ot))return this.preventSrc(u)},preventSrc:function(l){this.manager.session.prevented=!0,l.preventDefault()}};function hh(l){if(z(l,Nt))return Nt;var u=z(l,de),g=z(l,me);return u&&g?Nt:u||g?u?de:me:z(l,_i)?_i:sn}function ch(){if(!tn)return!1;var l={},u=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(g){l[g]=u?t.CSS.supports("touch-action",g):!0}),l}var Oe=1,at=2,Xt=4,It=8,xt=It,ge=16,ft=32;function Ct(l){this.options=x({},this.defaults,l||{}),this.id=lt(),this.manager=null,this.options.enable=L(this.options.enable,!0),this.state=Oe,this.simultaneous={},this.requireFail=[]}Ct.prototype={defaults:{},set:function(l){return x(this.options,l),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(l){if(w(l,"recognizeWith",this))return this;var u=this.simultaneous;return l=Ne(l,this),u[l.id]||(u[l.id]=l,l.recognizeWith(this)),this},dropRecognizeWith:function(l){return w(l,"dropRecognizeWith",this)?this:(l=Ne(l,this),delete this.simultaneous[l.id],this)},requireFailure:function(l){if(w(l,"requireFailure",this))return this;var u=this.requireFail;return l=Ne(l,this),it(u,l)===-1&&(u.push(l),l.requireFailure(this)),this},dropRequireFailure:function(l){if(w(l,"dropRequireFailure",this))return this;l=Ne(l,this);var u=it(this.requireFail,l);return u>-1&&this.requireFail.splice(u,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(l){return!!this.simultaneous[l.id]},emit:function(l){var u=this,g=this.state;function v(S){u.manager.emit(S,l)}g<It&&v(u.options.event+nn(g)),v(u.options.event),l.additionalEvent&&v(l.additionalEvent),g>=It&&v(u.options.event+nn(g))},tryEmit:function(l){if(this.canEmit())return this.emit(l);this.state=ft},canEmit:function(){for(var l=0;l<this.requireFail.length;){if(!(this.requireFail[l].state&(ft|Oe)))return!1;l++}return!0},recognize:function(l){var u=x({},l);if(!E(this.options.enable,[this,u])){this.reset(),this.state=ft;return}this.state&(xt|ge|ft)&&(this.state=Oe),this.state=this.process(u),this.state&(at|Xt|It|ge)&&this.tryEmit(u)},process:function(l){},getTouchAction:function(){},reset:function(){}};function nn(l){return l&ge?"cancel":l&It?"end":l&Xt?"move":l&at?"start":""}function rn(l){return l==fe?"down":l==ue?"up":l==ce?"left":l==le?"right":""}function Ne(l,u){var g=u.manager;return g?g.get(l):l}function ct(){Ct.apply(this,arguments)}_(ct,Ct,{defaults:{pointers:1},attrTest:function(l){var u=this.options.pointers;return u===0||l.pointers.length===u},process:function(l){var u=this.state,g=l.eventType,v=u&(at|Xt),S=this.attrTest(l);return v&&(g&tt||!S)?u|ge:v||S?g&V?u|It:u&at?u|Xt:at:ft}});function Fe(){ct.apply(this,arguments),this.pX=null,this.pY=null}_(Fe,ct,{defaults:{event:"pan",threshold:10,pointers:1,direction:Vs},getTouchAction:function(){var l=this.options.direction,u=[];return l&ut&&u.push(me),l&Ot&&u.push(de),u},directionTest:function(l){var u=this.options,g=!0,v=l.distance,S=l.direction,M=l.deltaX,R=l.deltaY;return S&u.direction||(u.direction&ut?(S=M===0?Ie:M<0?ce:le,g=M!=this.pX,v=Math.abs(l.deltaX)):(S=R===0?Ie:R<0?ue:fe,g=R!=this.pY,v=Math.abs(l.deltaY))),l.direction=S,g&&v>u.threshold&&S&u.direction},attrTest:function(l){return ct.prototype.attrTest.call(this,l)&&(this.state&at||!(this.state&at)&&this.directionTest(l))},emit:function(l){this.pX=l.deltaX,this.pY=l.deltaY;var u=rn(l.direction);u&&(l.additionalEvent=this.options.event+u),this._super.emit.call(this,l)}});function Pi(){ct.apply(this,arguments)}_(Pi,ct,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Nt]},attrTest:function(l){return this._super.attrTest.call(this,l)&&(Math.abs(l.scale-1)>this.options.threshold||this.state&at)},emit:function(l){if(l.scale!==1){var u=l.scale<1?"in":"out";l.additionalEvent=this.options.event+u}this._super.emit.call(this,l)}});function Ei(){Ct.apply(this,arguments),this._timer=null,this._input=null}_(Ei,Ct,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[sn]},process:function(l){var u=this.options,g=l.pointers.length===u.pointers,v=l.distance<u.threshold,S=l.deltaTime>u.time;if(this._input=l,!v||!g||l.eventType&(V|tt)&&!S)this.reset();else if(l.eventType&J)this.reset(),this._timer=m(function(){this.state=xt,this.tryEmit()},u.time,this);else if(l.eventType&V)return xt;return ft},reset:function(){clearTimeout(this._timer)},emit:function(l){this.state===xt&&(l&&l.eventType&V?this.manager.emit(this.options.event+"up",l):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}});function ki(){ct.apply(this,arguments)}_(ki,ct,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Nt]},attrTest:function(l){return this._super.attrTest.call(this,l)&&(Math.abs(l.rotation)>this.options.threshold||this.state&at)}});function Ii(){ct.apply(this,arguments)}_(Ii,ct,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:ut|Ot,pointers:1},getTouchAction:function(){return Fe.prototype.getTouchAction.call(this)},attrTest:function(l){var u=this.options.direction,g;return u&(ut|Ot)?g=l.overallVelocity:u&ut?g=l.overallVelocityX:u&Ot&&(g=l.overallVelocityY),this._super.attrTest.call(this,l)&&u&l.offsetDirection&&l.distance>this.options.threshold&&l.maxPointers==this.options.pointers&&c(g)>this.options.velocity&&l.eventType&V},emit:function(l){var u=rn(l.offsetDirection);u&&this.manager.emit(this.options.event+u,l),this.manager.emit(this.options.event,l)}});function Ge(){Ct.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}_(Ge,Ct,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[_i]},process:function(l){var u=this.options,g=l.pointers.length===u.pointers,v=l.distance<u.threshold,S=l.deltaTime<u.time;if(this.reset(),l.eventType&J&&this.count===0)return this.failTimeout();if(v&&S&&g){if(l.eventType!=V)return this.failTimeout();var M=this.pTime?l.timeStamp-this.pTime<u.interval:!0,R=!this.pCenter||De(this.pCenter,l.center)<u.posThreshold;this.pTime=l.timeStamp,this.pCenter=l.center,!R||!M?this.count=1:this.count+=1,this._input=l;var W=this.count%u.taps;if(W===0)return this.hasRequireFailures()?(this._timer=m(function(){this.state=xt,this.tryEmit()},u.interval,this),at):xt}return ft},failTimeout:function(){return this._timer=m(function(){this.state=ft},this.options.interval,this),ft},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==xt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Tt(l,u){return u=u||{},u.recognizers=L(u.recognizers,Tt.defaults.preset),new Mi(l,u)}Tt.VERSION="2.0.7",Tt.defaults={domEvents:!1,touchAction:en,enable:!0,inputTarget:null,inputClass:null,preset:[[ki,{enable:!1}],[Pi,{enable:!1},["rotate"]],[Ii,{direction:ut}],[Fe,{direction:ut},["swipe"]],[Ge],[Ge,{event:"doubletap",taps:2},["tap"]],[Ei]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var lh=1,an=2;function Mi(l,u){this.options=x({},Tt.defaults,u||{}),this.options.inputTarget=this.options.inputTarget||l,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=l,this.input=Uo(this),this.touchAction=new Si(this,this.options.touchAction),on(this,!0),p(this.options.recognizers,function(g){var v=this.add(new g[0](g[1]));g[2]&&v.recognizeWith(g[2]),g[3]&&v.requireFailure(g[3])},this)}Mi.prototype={set:function(l){return x(this.options,l),l.touchAction&&this.touchAction.update(),l.inputTarget&&(this.input.destroy(),this.input.target=l.inputTarget,this.input.init()),this},stop:function(l){this.session.stopped=l?an:lh},recognize:function(l){var u=this.session;if(!u.stopped){this.touchAction.preventDefaults(l);var g,v=this.recognizers,S=u.curRecognizer;(!S||S&&S.state&xt)&&(S=u.curRecognizer=null);for(var M=0;M<v.length;)g=v[M],u.stopped!==an&&(!S||g==S||g.canRecognizeWith(S))?g.recognize(l):g.reset(),!S&&g.state&(at|Xt|It)&&(S=u.curRecognizer=g),M++}},get:function(l){if(l instanceof Ct)return l;for(var u=this.recognizers,g=0;g<u.length;g++)if(u[g].options.event==l)return u[g];return null},add:function(l){if(w(l,"add",this))return this;var u=this.get(l.options.event);return u&&this.remove(u),this.recognizers.push(l),l.manager=this,this.touchAction.update(),l},remove:function(l){if(w(l,"remove",this))return this;if(l=this.get(l),l){var u=this.recognizers,g=it(u,l);g!==-1&&(u.splice(g,1),this.touchAction.update())}return this},on:function(l,u){if(l!==n&&u!==n){var g=this.handlers;return p(j(l),function(v){g[v]=g[v]||[],g[v].push(u)}),this}},off:function(l,u){if(l!==n){var g=this.handlers;return p(j(l),function(v){u?g[v]&&g[v].splice(it(g[v],u),1):delete g[v]}),this}},emit:function(l,u){this.options.domEvents&&uh(l,u);var g=this.handlers[l]&&this.handlers[l].slice();if(!(!g||!g.length)){u.type=l,u.preventDefault=function(){u.srcEvent.preventDefault()};for(var v=0;v<g.length;)g[v](u),v++}},destroy:function(){this.element&&on(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function on(l,u){var g=l.element;if(g.style){var v;p(l.options.cssProps,function(S,M){v=bt(g.style,M),u?(l.oldCssProps[v]=g.style[v],g.style[v]=S):g.style[v]=l.oldCssProps[v]||""}),u||(l.oldCssProps={})}}function uh(l,u){var g=e.createEvent("Event");g.initEvent(l,!0,!0),g.gesture=u,u.target.dispatchEvent(g)}x(Tt,{INPUT_START:J,INPUT_MOVE:Rt,INPUT_END:V,INPUT_CANCEL:tt,STATE_POSSIBLE:Oe,STATE_BEGAN:at,STATE_CHANGED:Xt,STATE_ENDED:It,STATE_RECOGNIZED:xt,STATE_CANCELLED:ge,STATE_FAILED:ft,DIRECTION_NONE:Ie,DIRECTION_LEFT:ce,DIRECTION_RIGHT:le,DIRECTION_UP:ue,DIRECTION_DOWN:fe,DIRECTION_HORIZONTAL:ut,DIRECTION_VERTICAL:Ot,DIRECTION_ALL:Vs,Manager:Mi,Input:rt,TouchAction:Si,TouchInput:Le,MouseInput:Ae,PointerEventInput:Ci,TouchMouseInput:Ti,SingleTouchInput:Js,Recognizer:Ct,AttrRecognizer:ct,Tap:Ge,Pan:Fe,Swipe:Ii,Pinch:Pi,Rotate:ki,Press:Ei,on:O,off:B,each:p,merge:C,extend:b,assign:x,inherit:_,bindFn:I,prefixed:bt});var fh=typeof t<"u"?t:typeof self<"u"?self:{};fh.Hammer=Tt,typeof n=="function"&&n.amd?n(function(){return Tt}):s.exports?s.exports=Tt:t[i]=Tt})(window,document,"Hammer")})(as);var ir=as.exports;const sr=er(ir);function Ke(s){return s*Math.PI/180}function Ht(s){return s*180/Math.PI}function jt(s,t,e,i){const n=s-e,r=t-i;return Math.sqrt(n*n+r*r)}function qt(s,t,e,i){const n=e-s,r=i-t;return Math.atan2(r,n)}function Qe(s,t,e,i,n,r){if(!n||!r){const a=e-s,o=i-t;return!a&&!o?0:Ht((qt(s,t,e,i)+Math.PI)%(2*Math.PI))}else return Qe(s,t,n,r)-Qe(e,i,n,r)}function ti(s,t){return{x:Math.cos(s)*t,y:Math.sin(s)*t}}function ei(s,t){const e=Math.sqrt(Math.pow(s,2)+Math.pow(t,2));return{x:s/=e,y:t/=e}}function nr(s,t,e,i,n=10){if(Math.abs(e-s)<n&&Math.abs(i-t)<n)return"no";const r=Ht(qt(s,t,e,i));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":r>=-45&&r<=45?"right":"no"}const $t=Math.PI*2;function os(s,t,e,i){const n=s*i-t*e<0?-1:1;let r=s*e+t*i;return r>1&&(r=1),r<-1&&(r=-1),n*Math.acos(r)}function rr(s,t,e,i,n,r,a,o,h,c){const f=c*(s-e)/2+h*(t-i)/2,m=-h*(s-e)/2+c*(t-i)/2,w=a*a,p=o*o,y=f*f,x=m*m;let b=w*p-w*x-p*y;b<0&&(b=0),b/=w*x+p*y,b=Math.sqrt(b)*(n===r?-1:1);const C=b*a/o*m,_=b*-o/a*f,I=c*C-h*_+(s+e)/2,E=h*C+c*_+(t+i)/2,L=(f-C)/a,O=(m-_)/o,B=(-f-C)/a,H=(-m-_)/o,z=os(1,0,L,O);let j=os(L,O,B,H);return r===0&&j>0&&(j-=$t),r===1&&j<0&&(j+=$t),[I,E,z,j]}function ar(s,t){const e=1.3333333333333333*Math.tan(t/4),i=Math.cos(s),n=Math.sin(s),r=Math.cos(s+t),a=Math.sin(s+t);return[i,n,i-n*e,n+i*e,r+a*e,a-r*e,r,a]}function or(s,t,e,i,n,r,a,o,h){const c=Math.sin(h*$t/360),f=Math.cos(h*$t/360),m=f*(s-e)/2+c*(t-i)/2,w=-c*(s-e)/2+f*(t-i)/2;if(m===0&&w===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const p=m*m/(a*a)+w*w/(o*o);p>1&&(a*=Math.sqrt(p),o*=Math.sqrt(p));const y=rr(s,t,e,i,n,r,a,o,c,f),x=[];let b=y[2],C=y[3];const _=Math.max(Math.ceil(Math.abs(C)/($t/4)),1);C/=_;for(let I=0;I<_;I++)x.push(ar(b,C)),b+=C;return x.map(I=>{for(let E=0;E<I.length;E+=2){let L=I[E+0],O=I[E+1];L*=a,O*=o;const B=f*L-c*O,H=c*L+f*O;I[E+0]=B+y[0],I[E+1]=H+y[1]}return I})}function hs(s,t,e,i,n,r){return[s/3+.6666666666666666*e,t/3+.6666666666666666*i,n/3+.6666666666666666*e,r/3+.6666666666666666*i,n,r]}function we(s,t,e,i){return[s,t,e,i,e,i]}class cs{static createSVGElement(t="path"){return document.createElementNS.call(document,"http://www.w3.org/2000/svg",t)}static createSvgPath(t){const e=this.createSVGElement("path");return e.setAttribute("d",t),e}static downloadFromSVGElement(t,e="shape"){He(Xi(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){He(Ye(t),`${e}.svg`)}static SVGParsedPathArgsLength={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};static isSVGPath(t){return typeof t!="string"?!1:(t=t.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4)}static parseSVGPath(t){const e=[];return t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(i,n,r)=>{let a=n.toLowerCase();const o=pn(r);for(a=="m"&&o.length>this.SVGParsedPathArgsLength[a]&&(e.push([n,...o.splice(0,this.SVGParsedPathArgsLength[a])]),a="l",n=n=="m"?"l":"L");o.length;){if(o.length<this.SVGParsedPathArgsLength[a])throw new Error(`SVGPathD ! : ${i}`);e.push([n,...o.splice(0,this.SVGParsedPathArgsLength[a])])}return a=="z"&&e.push([n]),""}),e}static absolutizeSVGPath(t){let e=0,i=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toUpperCase();if(o!=h)switch(a[0]=h,o){case"a":a[6]+=n,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=n;break;default:for(let c=1;c<a.length;)a[c++]+=n,a[c++]+=r}switch(h){case"Z":n=e,r=i;break;case"H":n=a[1];break;case"V":r=a[1];break;case"M":n=e=a[1],r=i=a[2];break;default:n=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,i=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toLowerCase();if(o!=h)switch(a[0]=h,o){case"A":a[6]-=n,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=n;break;default:for(let c=1;c<a.length;)a[c++]-=n,a[c++]-=r}switch(h){case"z":n=e,r=i;break;case"h":n+=a[1];break;case"v":r+=a[1];break;case"m":n+=a[1],r+=a[2],e+=a[1],i+=a[2];break;default:n+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){let e=[],i=0,n=0,r=0,a=0,o=0,h=0,c=0,f=0,m;for(let w=0,p=t.length;w<p;w++){let y=t[w];const x=y[0];switch(x){case"M":i=y[1],n=y[2];break;case"A":const b=or(r,a,y[6],y[7],y[4],y[5],y[1],y[2],y[3]);if(!b.length)continue;b.forEach((I,E)=>{const[L,O,B,H,z,j,it,ht]=I;y=["C",B,H,z,j,it,ht],E<b.length-1&&e.push(y)});break;case"S":let C=r,_=a;(m=="C"||m=="S")&&(C+=C-c,_+=_-f),y=["C",C,_,y[1],y[2],y[3],y[4]];break;case"T":m=="Q"||m=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),y=["C",...hs(r,a,o,h,y[1],y[2])];break;case"Q":o=y[1],h=y[2],y=["C",...hs(r,a,y[1],y[2],y[3],y[4])];break;case"L":y=["C",...we(r,a,y[1],y[2])];break;case"H":y=["C",...we(r,a,y[1],a)];break;case"V":y=["C",...we(r,a,r,y[1])];break;case"Z":y=["C",...we(r,a,i,n)];break}m=x,r=y[y.length-2],a=y[y.length-1],y.length>4?(c=y[y.length-4],f=y[y.length-3]):(c=r,f=a),e.push(y)}return e}static zvhToLSVGPath(t){let e=[],i=["L",0,0],n;for(let r=0,a=t.length;r<a;r++){let o=t[r];switch(o[0]){case"M":i=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(i);break;case"H":n=e[e.length-1]||["L",0,0],e.push(["L",o[1],n[n.length-1]]);break;case"V":n=e[e.length-1]||["L",0,0],e.push(["L",n[n.length-2],o[1]]);break;default:e.push(o)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let i,n=0,r=0;for(let a=0,o=t.length;a<o;a++){const h=t[a],c=e[h[0]];c&&(h[0]=c.to,i&&(i[0]===c.to?(n=2*Number(i[c.x+2])-Number(i[c.x]),r=2*Number(i[c.x+3])-Number(i[c.x+1])):(n=Number(i[i.length-2]),r=Number(i[i.length-1]))),h.splice(1,0,n,r)),i=h}return t}static SVGPathDataToD(t){return t.map(e=>{switch(e[0].toLowerCase()){case"a":return`${e[0]} ${e[1]},${e[2]} ${e[3]} ${e[4]},${e[5]} ${e[6]},${e[7]}`;case"c":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]} ${e[5]},${e[6]}`;case"s":case"q":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]}`;default:return e[0]+" "+e.slice(1).join(",")}}).join(" ")}static absoluteSVGPathD(t){return this.SVGPathDataToD(this.absolutizeSVGPath(this.parseSVGPath(t)))}static walkSVGPathDCacheMap=new Map;static getWalkSVGPathD(t){if(this.walkSVGPathDCacheMap.has(t))return this.walkSVGPathDCacheMap.get(t);const e={at:i=>this.walkSVGPathD(t,i).pos,length:()=>this.walkSVGPathD(t).length};return this.walkSVGPathDCacheMap.set(t,e),e}static walkSVGPathD(t,e){const i=this.longhandSVGPath(this.zvhToLSVGPath(this.absolutizeSVGPath(this.parseSVGPath(t))));function n(w,p){return Math.pow(1-p,3)*f[0]+3*Math.pow(1-p,2)*p*w[1]+3*(1-p)*Math.pow(p,2)*w[3]+Math.pow(p,3)*w[5]}function r(w,p){return Math.pow(1-p,3)*f[1]+3*Math.pow(1-p,2)*p*w[2]+3*(1-p)*Math.pow(p,2)*w[4]+Math.pow(p,3)*w[6]}function a(w,p){return Math.pow(1-p,2)*f[0]+2*(1-p)*p*w[1]+Math.pow(p,2)*w[3]}function o(w,p){return Math.pow(1-p,2)*f[1]+2*(1-p)*p*w[2]+Math.pow(p,2)*w[4]}let h=[0,0],c=[0,0,0],f=[0,0],m=0;for(let w=0,p=i.length;w<p;w++){let y=i[w];if(y[0]==="M"){if(h[0]=y[1],h[1]=y[2],e===0)return{length:m,pos:h}}else if(y[0]==="C"){c[0]=f[0]=h[0],c[1]=f[1]=h[1],c[2]=m;let x=100;for(let b=0;b<=x;b++){let C=b/x,_=n(y,C),I=r(y,C);if(m+=jt(h[0],h[1],_,I),h[0]=_,h[1]=I,typeof e=="number"&&m>=e){let E=(m-e)/(m-c[2]),L=[h[0]*(1-E)+c[0]*E,h[1]*(1-E)+c[1]*E];return{length:m,pos:L}}c[0]=h[0],c[1]=h[1],c[2]=m}}else if(y[0]==="Q"){c[0]=f[0]=h[0],c[1]=f[1]=h[1],c[2]=m;let x=100;for(let b=0;b<=x;b++){let C=b/x,_=a(y,C),I=o(y,C);if(m+=jt(h[0],h[1],_,I),h[0]=_,h[1]=I,typeof e=="number"&&m>=e){let E=(m-e)/(m-c[2]),L=[h[0]*(1-E)+c[0]*E,h[1]*(1-E)+c[1]*E];return{length:m,pos:L}}c[0]=h[0],c[1]=h[1],c[2]=m}}else if(y[0]==="L"){if(c[0]=h[0],c[1]=h[1],c[2]=m,m+=jt(h[0],h[1],y[1],y[2]),h[0]=y[1],h[1]=y[2],typeof e=="number"&&m>=e){let x=(m-e)/(m-c[2]),b=[h[0]*(1-x)+c[0]*x,h[1]*(1-x)+c[1]*x];return{length:m,pos:b}}c[0]=h[0],c[1]=h[1],c[2]=m}}return{length:m,pos:h}}static catmullRom2bezier(t){let e=[];for(let i=0,n=t.length;n-2>i;i+=2){let r;i==0?r=[{x:t[i],y:t[i+1]},{x:t[i],y:t[i+1]},{x:t[i+2],y:t[i+3]},{x:t[i+4],y:t[i+5]}]:n-4==i?r=[{x:t[i-2],y:t[i-1]},{x:t[i],y:t[i+1]},{x:t[i+2],y:t[i+3]},{x:t[i+2],y:t[i+3]}]:r=[{x:t[i-2],y:t[i-1]},{x:t[i],y:t[i+1]},{x:t[i+2],y:t[i+3]},{x:t[i+4],y:t[i+5]}];const a=[{x:r[1].x,y:r[1].y},{x:(-r[0].x+6*r[1].x+r[2].x)/6,y:(-r[0].y+6*r[1].y+r[2].y)/6},{x:(r[1].x+6*r[2].x-r[3].x)/6,y:(r[1].y+6*r[2].y-r[3].y)/6},{x:r[2].x,y:r[2].y}];e.push(["C",a[1].x,a[1].y,a[2].x,a[2].y,a[3].x,a[3].y])}return e}static findDotsAtSegment(t,e,i,n,r,a,o,h,c){let f=1-c,m=Math.pow(f,3),w=Math.pow(f,2),p=c*c,y=p*c,x=m*t+w*3*c*i+f*3*c*c*r+y*o,b=m*e+w*3*c*n+f*3*c*c*a+y*h,C=t+2*c*(i-t)+p*(r-2*i+t),_=e+2*c*(n-e)+p*(a-2*n+e),I=i+2*c*(r-i)+p*(o-2*r+i),E=n+2*c*(a-n)+p*(h-2*a+n),L=f*t+c*i,O=f*e+c*n,B=f*r+c*o,H=f*a+c*h,z=90-Math.atan2(C-I,_-E)*180/Math.PI;return(C>I||_<E)&&(z+=180),{x,y:b,m:{x:C,y:_},n:{x:I,y:E},start:{x:L,y:O},end:{x:B,y:H},alpha:z}}static findDotAtSegment(t,e,i,n,r,a,o,h,c){const f=1-c;return{x:Math.pow(f,3)*t+Math.pow(f,2)*3*c*i+f*3*c*c*r+Math.pow(c,3)*o,y:Math.pow(f,3)*e+Math.pow(f,2)*3*c*n+f*3*c*c*a+Math.pow(c,3)*h}}static curveDim(t,e,i,n,r,a,o,h){const c=[],f=[[],[]];let m,w,p,y,x,b,C,_;for(let O=0;O<2;++O){if(O===0?(w=6*t-12*i+6*r,m=-3*t+9*i-9*r+3*o,p=3*i-3*t):(w=6*e-12*n+6*a,m=-3*e+9*n-9*a+3*h,p=3*n-3*e),Math.abs(m)<1e-12){if(Math.abs(w)<1e-12)continue;y=-p/w,y>0&&y<1&&c.push(y);continue}C=w*w-4*p*m,_=Math.sqrt(C),!(C<0)&&(x=(-w+_)/(2*m),x>0&&x<1&&c.push(x),b=(-w-_)/(2*m),b>0&&b<1&&c.push(b))}let I=c.length,E;const L=I;for(;I--;)y=c[I],E=1-y,f[0][I]=E*E*E*t+3*E*E*y*i+3*E*y*y*r+y*y*y*o,f[1][I]=E*E*E*e+3*E*E*y*n+3*E*y*y*a+y*y*y*h;return f[0][L]=t,f[1][L]=e,f[0][L+1]=o,f[1][L+1]=h,f[0].length=f[1].length=L+2,{min:{x:Math.min.apply(0,f[0]),y:Math.min.apply(0,f[1])},max:{x:Math.max.apply(0,f[0]),y:Math.max.apply(0,f[1])}}}}const K=cs;class wt{id;x;y;rotate;scale;vx;vy;ax;ay;mass;XYIsShapeCenter=!1;path2d=new Path2D;isMouseInShape=!1;isDragging=!1;constructor(t){this.id=ln(),this.x=t?.x||0,this.y=t?.y||0,this.rotate=t?.rotate||0,this.scale=t?.scale||1,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||0}getBoundingClientRect(){return null}toSVGPathD(){const t=[],e=this.toSVGPathData();return e[0]&&Array.isArray(e[0])?t.push(...e):t.push(e),K.SVGPathDataToD(t)}distanceTo(t){return jt(this.x,this.y,t.x,t.y)}angleTo(t){return this.rotate=qt(this.x,this.y,t.x,t.y),this.rotate}velocityTo(t){return{vx:t.x-this.x,vy:t.y-this.y}}followTo(t,e=3){const i=this.angleTo(t),{x:n,y:r}=ti(i,e);this.vx=n,this.vy=r,this.nextFrame()}followAccelerationTo(t,e=.05){const i=this.angleTo(t),{x:n,y:r}=ti(i,e);this.ax=n,this.ay=r,this.nextFrame()}nextFrame(t){const e=t?.gravity??0,i=t?.friction??0;if(this.vx+=this.ax,this.vy+=this.ay,this.vy+=e,i>0){const n=Math.atan2(this.vy,this.vx);let r=Math.sqrt(this.vx*this.vx+this.vy*this.vy);r>i?r-=i:r=0,this.vx=Math.cos(n)*r,this.vy=Math.sin(n)*r}this.x+=this.vx,this.y+=this.vy}nextFrameEaseTo(t,e){const i=e?.gravity??0,n=e?.friction??1,r=e?.easing??.05,a=t.x-this.x,o=t.y-this.y;this.vx=a*r,this.vy=o*r,this.vy+=i,this.vx*=n,this.vy*=n,this.x+=this.vx,this.y+=this.vy}nextFrameSpringTo(t,e){const i=e?.gravity??0,n=e?.friction??.95,r=e?.spring??.03;(Array.isArray(t)?t:[t]).forEach(o=>{const h=o.x-this.x,c=o.y-this.y,f=h*r,m=c*r;this.vx+=f,this.vy+=m}),this.vy+=i,this.vx*=n,this.vy*=n,this.x+=this.vx,this.y+=this.vy}nextFrameSpringConnect(t,e){const i=e?.gravity??0,n=e?.friction??.95,r=e?.spring??.03,a=e?.springLength??100,o=this.angleTo(t);this.nextFrameSpringTo(new Jt({x:t.x-Math.cos(o)*a,y:t.y-Math.sin(o)*a}),{spring:r,friction:n,gravity:i})}}class ot extends wt{width;height;borderRadius;centerX;centerY;rMin;rMax;r;constructor(t){super(t),this.width=t.width,this.height=t.height,this.borderRadius=t.borderRadius||0,this.centerX=this.x+this.width/2,this.centerY=this.y+this.height/2,this.rMin=Math.min(this.width,this.height)/2,this.rMax=Math.max(this.width,this.height)/2,this.r=Math.sqrt(this.width*this.width+this.height*this.height)/2}getBoundingClientRect(){return this}toSVGPathData(){return this.borderRadius?[["M",this.x+this.borderRadius,this.y],["l",this.width-this.borderRadius*2,0],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,this.borderRadius],["l",0,this.height-this.borderRadius*2],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,this.borderRadius],["l",this.borderRadius*2-this.width,0],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,-this.borderRadius],["l",0,this.borderRadius*2-this.height],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,-this.borderRadius],["z"]]:[["M",this.x,this.y],["l",this.width,0],["l",0,this.height],["l",-this.width,0],["z"]]}toCanvasContext(t){t.beginPath(),this.borderRadius<=0?t.rect(0,0,this.width,this.height):(t.moveTo(0,this.borderRadius),t.lineTo(0,this.height-this.borderRadius),t.quadraticCurveTo(0,this.height,this.borderRadius,this.height),t.lineTo(this.width-this.borderRadius,this.height),t.quadraticCurveTo(this.width,this.height,this.width,this.height-this.borderRadius),t.lineTo(this.width,this.borderRadius),t.quadraticCurveTo(this.width,0,this.width-this.borderRadius,0),t.lineTo(this.borderRadius,0),t.quadraticCurveTo(0,0,0,this.borderRadius)),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}isIntersectRect(t){return!(this.x+this.width<t.x||t.x+t.width<this.x||this.y+this.height<t.y||t.y+t.height<this.y)}isContainPoint(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}clone(t){return new ot({x:t.x,y:t.y,width:t.width,height:t.height,borderRadius:t.borderRadius})}toArray(){return[this.x,this.y,this.width,this.height,this.borderRadius]}}class _t extends wt{radius;constructor(t){super(t),this.XYIsShapeCenter=!0,this.radius=t?.radius||0}getBoundingClientRect(){return new ot({x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2})}toSVGPathData(){return["M",this.x,this.y]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}toArray(){return[this.x,this.y]}setX(t){this.x=t}setY(t){this.y=t}setXY(t,e){this.x=t,this.y=e}eq(t){return this.x===t.x&&this.y===t.y}midPointBtw(t){return new _t({x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2})}clone(t){return new _t({x:t.x,y:t.y,radius:t.radius})}nextFrameCollisionTo(t){const e=t.x-this.x,i=t.y-this.y;if(Math.sqrt(e*e+i*i)<this.radius+t.radius){const a=Math.atan2(i,e),o=Math.sin(a),h=Math.cos(a),c={x:0,y:0},f=r(e,i,o,h,!0),m=r(this.vx,this.vy,o,h,!0),w=r(t.vx,t.vy,o,h,!0),p=m.x-w.x;m.x=((this.mass-t.mass)*m.x+2*t.mass*w.x)/(this.mass+t.mass),w.x=p+m.x;const y=Math.abs(m.x)+Math.abs(w.x),x=this.radius+t.radius-Math.abs(c.x-f.x);c.x+=m.x/y*x,f.x+=w.x/y*x;const b=r(c.x,c.y,o,h,!1),C=r(f.x,f.y,o,h,!1);t.x=this.x+C.x,t.y=this.y+C.y,this.x=this.x+b.x,this.y=this.y+b.y;const _=r(m.x,m.y,o,h,!1),I=r(w.x,w.y,o,h,!1);this.vx=_.x,this.vy=_.y,t.vx=I.x,t.vy=I.y}function r(a,o,h,c,f=!1){return{x:f?a*c+o*h:a*c-o*h,y:f?o*c-a*h:o*c+a*h}}}nextFrameBounce(t,e){const i=t.x,n=t.y,r=t.x+t.width,a=t.y+t.height,o=e?.bounce??-1;this.x+this.radius>r?(this.x=r-this.radius,this.vx*=o):this.x-this.radius<i&&(this.x=i+this.radius,this.vx*=o),this.y+this.radius>a?(this.y=a-this.radius,this.vy*=o):this.y-this.radius<n&&(this.y=n+this.radius,this.vy*=o)}}const Jt=_t;class ls{constructor(){}static getFormatKeyNames(t){const e=Ze(),i=[];return t.ctrl&&i.push(e?"Cmd":"Ctrl"),t.shift&&i.push("Shift"),t.alt&&i.push("Alt"),typeof t.key=="string"?i.push(Ue(t.key)):Array.isArray(t.key)&&(t.key.map(n=>Ue(n)),i.push(...t.key)),i}static matchKeyScheme(t,e){const i=t.ctrl??!1,n=t.shift??!1,r=t.alt??!1;if(t.exact)return(i===e.metaKey||i===e.ctrlKey)&&n===e.shiftKey&&r===e.altKey;const a=[];return i&&a.push(i===e.metaKey||i===e.ctrlKey),n&&a.push(n===e.shiftKey),r&&a.push(r===e.altKey),a.every(o=>o)}static on(t,e){if(t?.key===void 0||t?.key===null)return e;const i=t?.target??window;let n=!1;const r=this.getFormatKeyNames(t),a=o=>{if(o.stopPropagation(),!n&&o.key!=="Control"&&o.key!=="Meta"&&o.key!=="Shift"&&o.key!=="Option"&&o.key!=="Alt"&&r.find(h=>h.toLowerCase()===o.key.toLowerCase())&&this.matchKeyScheme(t,o)){o.preventDefault();const h=e(o);if(typeof h!="function")return;const c=f=>{f.preventDefault(),h(f),i.removeEventListener("keyup",c)};i.addEventListener("keyup",c)}};return e.title=t?.title??"",e.formatedKeyNames=r,e.pause=()=>n=!0,e.restart=()=>n=!1,e.removeListener=()=>i.removeEventListener("keydown",a),i.addEventListener("keydown",a),e}}class U extends Ui{container;mousePoint;hammer;domEventRemoveListeners=[];constructor(t=document.documentElement,e=!0){super(),this.container=t,this.hammer=new sr(this.container),this.mousePoint=new _t({x:0,y:0}),e&&this.start()}_emitDebounce=wn((t,...e)=>super.emit(t,...e),50);emit(t,...e){switch(t){case"panLeft":case"panRight":this._emitDebounce(t,...e);break;default:super.emit(t,...e);break}return this}static singleton;static globalScrollChangeCallbacks=[];static get page(){if(U.singleton)return U.singleton;U.singleton=new U,U.singleton.registerKeyDown({title:"打开",key:"o",ctrl:!0,exact:!0},()=>{Wi().then(e=>je(e[0])).then(e=>{U.singleton.emit("openFile",e)}).catch(e=>{U.singleton.emit("openFileError",e)})}),U.singleton.registerMatchMediaChange("(prefers-color-scheme: dark)");const t=()=>U.globalScrollChangeCallbacks.forEach(e=>e());return U.singleton.registerGlobalScrollChange=e=>{U.globalScrollChangeCallbacks.push(e),U.globalScrollChangeCallbacks.length==1&&document.addEventListener("scroll",t)},U.singleton.removeGlobalScrollChange=e=>{const i=U.globalScrollChangeCallbacks.findIndex(n=>n==e);i>=0&&(U.globalScrollChangeCallbacks.splice(i,1),U.globalScrollChangeCallbacks.length==0&&document.removeEventListener("scroll",t))},U.singleton}start(){this.initMouseEventListeners(),this.on("pointerMove",this.setMousePoint),this.addDOMEventRemoveListeners(()=>{this.off("pointerMove",this.setMousePoint)}),this.registerResizeObserver(),this.registerElementDisplayInParentWhenScrollChange()}restart(){this.destroy(),this.start()}destroy(){this.domEventRemoveListeners.forEach(t=>t()),this.removeAllListeners()}addDOMEventRemoveListeners(t){this.domEventRemoveListeners.push(t)}setMousePoint(t){const e=Qi(this.container,t);return this.mousePoint.x=e.x,this.mousePoint.y=e.y,e}initMouseEventListeners(){const t=k=>{this.emit("mouseDown",k),this.container.style.userSelect="none"},e=k=>{this.emit("mouseUp",k),this.container.style.userSelect=""},i=k=>{this.emit("mouseMove",k)},n=k=>{this.emit("mouseOver",k)},r=k=>{this.emit("mouseOut",k),this.container.style.userSelect=""},a=k=>{this.emit("mouseClick",k)},o=k=>{this.emit("mouseDoubleClick",k)},h=k=>{this.emit("mouseWheel",k)},c=k=>{this.emit("mouseContextMenu",k)},f=k=>{this.emit("touchStart",k),this.container.style.userSelect="none"},m=k=>{this.emit("touchEnd",k),this.container.style.userSelect=""},w=k=>{this.emit("touchCancel",k),this.container.style.userSelect=""},p=k=>{this.emit("touchMove",k)},y=k=>{this.emit("pointerDown",k),this.container.style.userSelect="none"},x=k=>{this.emit("pointerUp",k),this.container.style.userSelect=""},b=k=>{this.emit("pointerCancel",k),this.container.style.userSelect=""},C=k=>{this.emit("pointerMove",k)},_=k=>{this.emit("pan",k)},I=k=>{this.emit("panStart",k),this.container.style.userSelect="none"},E=k=>{this.emit("panMove",k)},L=k=>{this.emit("panEnd",k),this.container.style.userSelect=""},O=k=>{this.emit("panCancel",k),this.container.style.userSelect=""},B=k=>{this.emit("panLeft",k)},H=k=>{this.emit("panRight",k)},z=k=>{this.emit("panUp",k),this.container.style.userSelect=""},j=k=>{this.emit("panDown",k),this.container.style.userSelect="none"},it=k=>{this.emit("pinch",k)},ht=k=>{this.emit("press",k)},At=k=>{this.emit("rotate",k)},bt=k=>{this.emit("swipe",k)},Vt=k=>{this.emit("tap",k)},lt=k=>{!k.target||this.container==k.target||this.container.contains(k.target)||this.emit("tapOutSide",k)};this.container.addEventListener("mousedown",t),this.container.addEventListener("mouseup",e),this.container.addEventListener("mousemove",i),this.container.addEventListener("mouseover",n),this.container.addEventListener("mouseout",r),this.container.addEventListener("click",a),this.container.addEventListener("dblclick",o),this.container.addEventListener("wheel",h),this.container.addEventListener("contextmenu",c),this.container.addEventListener("touchstart",f),this.container.addEventListener("touchend",m),this.container.addEventListener("touchcancel",w),this.container.addEventListener("touchmove",p),this.container.addEventListener("pointerdown",y),this.container.addEventListener("pointerup",x),this.container.addEventListener("pointercancel",b),this.container.addEventListener("pointermove",C),this.hammer.on("pan",_),this.hammer.on("panstart",I),this.hammer.on("panmove",E),this.hammer.on("panend",L),this.hammer.on("pancancel",O),this.hammer.on("panleft",B),this.hammer.on("panright",H),this.hammer.on("panup",z),this.hammer.on("pandown",j),this.hammer.on("pinch",it),this.hammer.on("press",ht),this.hammer.on("rotate",At),this.hammer.on("swipe",bt),this.hammer.on("tap",Vt),document.addEventListener("pointerdown",lt,!1);const Lt=()=>{this.container.removeEventListener("mousedown",t),this.container.removeEventListener("mouseup",e),this.container.removeEventListener("mousemove",i),this.container.removeEventListener("mouseover",n),this.container.removeEventListener("mouseout",r),this.container.removeEventListener("click",a),this.container.removeEventListener("dblclick",o),this.container.removeEventListener("wheel",h),this.container.removeEventListener("contextmenu",c),this.container.removeEventListener("touchstart",f),this.container.removeEventListener("touchend",m),this.container.removeEventListener("touchcancel",w),this.container.removeEventListener("touchmove",p),this.container.removeEventListener("pointerdown",y),this.container.removeEventListener("pointerup",x),this.container.removeEventListener("pointercancel",b),this.container.removeEventListener("pointermove",C),this.hammer.off("pan",_),this.hammer.off("panstart",I),this.hammer.off("panmove",E),this.hammer.off("panend",L),this.hammer.off("pancancel",O),this.hammer.off("panleft",B),this.hammer.off("panright",H),this.hammer.off("panup",z),this.hammer.off("pandown",j),this.hammer.off("pinch",it),this.hammer.off("press",ht),this.hammer.off("rotate",At),this.hammer.off("swipe",bt),this.hammer.off("tap",Vt),document.removeEventListener("pointerdown",lt,!1),document.removeEventListener("touchstart",lt,!1),document.removeEventListener("mousedown",lt,!1)};return this.addDOMEventRemoveListeners(Lt),Lt}registerKeyDown(t,e,i){const n=ls.on(t,a=>(e(a,n.formatedKeyNames,n.pause,n.restart),i)),r=()=>{n.removeListener?.()};return this.addDOMEventRemoveListeners(r),r}registerResizeObserver(){const t=new ResizeObserver(i=>{const{width:n,height:r}=i[0].contentRect;this.emit("resize",n,r)});t.observe(this.container);const e=()=>{t.unobserve(this.container)};return this.addDOMEventRemoveListeners(e),e}registerMatchMediaChange(t){let e="";switch(t){case"(prefers-color-scheme: dark)":e="matchMediaChangePrefersColorSchemeDark";break;default:e=t;break}const i=r=>{this.emit(e,r.matches)};window.matchMedia(t).addEventListener("change",i);const n=()=>{window.matchMedia(t).removeEventListener("change",i)};return this.addDOMEventRemoveListeners(n),n}registerElementDisplayInParentWhenScrollChange(t){const e={threshold:t?.threshold||.5,root:t?.parentElement},i=new IntersectionObserver((r,a)=>{let o=r[0];if(r.length>1){const c=r.find(f=>f.isIntersecting);c&&(o=c)}o.isIntersecting&&o.intersectionRatio>=e.threshold?this.emit("showInParent"):this.emit("showOffParent")},e);i.observe(this.container);const n=()=>{i.unobserve(this.container)};return this.addDOMEventRemoveListeners(n),n}registerPullDownRefresh(t){const e=t?.distance||50;let i=0,n=0;return this.captureMove({start:r=>{i=this.setMousePoint(r).y},move:()=>{n=this.mousePoint.y-i,n>0&&n<e&&this.emit("pullDownIng",n)},end:()=>{n>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;let i=0,n=0;return this.captureMove({start:r=>{i=this.setMousePoint(r).y},move:()=>{n=i-this.mousePoint.y,n>0&&n<e&&this.emit("pullUpIng",n)},end:()=>{n>=e&&this.emit("pullUp")}})}static isTouchEnabled(){return"ontouchstart"in window||navigator.maxTouchPoints>0}captureMove(t){return this.captureMoveUsePointer(t)}captureMoveUsePointer(t){const e=a=>{this.container.setPointerCapture(a.pointerId),this.container.style.userSelect="none",t?.start?.(a)},i=a=>{this.container.style.userSelect="",t?.end?.(a)},n=a=>{t?.move?.(a)};this.on("pointerDown",e),this.on("pointerUp",i),this.on("pointerCancel",i),this.on("pointerMove",n);const r=()=>{this.off("pointerDown",e),this.off("pointerUp",i),this.off("pointerCancel",i),this.off("pointerMove",n)};return this.addDOMEventRemoveListeners(r),r}captureMoveUseMouse(t){const e=a=>{document.addEventListener("mousemove",n,!1),document.addEventListener("mouseup",i,!1),this.container.style.userSelect="none",t?.start?.(a)},i=a=>{document.removeEventListener("mousemove",n,!1),document.removeEventListener("mouseup",i,!1),this.container.style.userSelect="",t?.end?.(a)},n=a=>{t?.move?.(a)};this.on("mouseDown",e);const r=()=>{this.off("mouseDown",e)};return this.addDOMEventRemoveListeners(r),r}captureMoveUseTouch(t){const e=a=>{a.preventDefault(),t?.start?.(a)},i=a=>{t?.end?.(a)},n=a=>{t?.move?.(a)};this.on("touchStart",e),this.on("touchEnd",i),this.on("touchCancel",i),this.on("touchMove",n);const r=()=>{this.off("touchStart",e),this.off("touchEnd",i),this.off("touchCancel",i),this.off("touchMove",n)};return this.addDOMEventRemoveListeners(r),r}static getMouseButton(t){if(document.implementation.hasFeature("MouseEvents","2.0"))return t.button;switch(t.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}}class Zt{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{e.target}),this.video.srcObject=t}captureWebCamera(){navigator.mediaDevices.getUserMedia({video:!0}).then(t=>{this.setSrcObject(t)})}static async videoMediaChangeSupport(){return new Promise(t=>{const e=document.createElement("iframe"),i=document.createElement("video"),n=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),n.src=URL.createObjectURL(r),n.media="(min-width:10px)",i.append(n),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(i),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{Zt.setAutoPlayWhenClick(t),e(!1)})})}static setAutoPlayWhenClick(t){function e(){t.autoplay=!0,t.play(),document.removeEventListener("click",e),document.removeEventListener("touchend",e)}document.addEventListener("click",e),document.addEventListener("touchend",e)}}class us extends Ui{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=cn(this.source);if(t===0){this.emit("finish");return}let e,i,n=Li(this.source,0);for(let r=1;r<t;r++)e=i,i=n,n=Li(this.source,r),this.raw+=i,i&&this.step(i,n,e);n&&this.step(n,void 0,i),this.emit("finish")}step(t,e,i){t==`
|
|
25
|
+
`&&this.emit("newline"),this.act(t,e,i)}act(t,e,i){switch(this.mode){case"text":switch(t){case"<":case"eof":this.nodename="",this.attrs={},this.mode="tag name start",this.raw=this.raw.slice(0,-1),this.textchunk&&this.emit("text",this.textchunk),this.raw+=t,this.textchunk="";break;case"&":this.mode="entity",this.entity="";break;default:this.textchunk+=t;break}break;case"entity":mt("whitespace",t)?(this.textchunk+=A.entity2text(this.entity),this.mode="text"):t==";"?(this.textchunk+=A.entity2text(this.entity+t),this.mode="text"):this.entity+=t;break;case"special":if(i=="!"&&t=="-"&&e=="-"){this.mode="comment start";break}if(this.textchunk=="[CDATA"&&t=="["){this.mode="cdata",this.textchunk="";break}if(t==">"||t=="eof"){this.emit("special",this.textchunk),this.mode="text",this.textchunk="";break}this.textchunk+=t;break;case"cdata":if(i=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,i)),this.textchunk+=t;break;case"cdata end":this.emit("cdata",this.textchunk),this.textchunk="",this.mode="text";break;case"comment start":e==">"||t=="eof"?(this.emit("comment",""),this.mode="skip"):this.mode="comment";break;case"skip":this.mode="text";break;case"comment":t=="-"&&i=="-"&&e==">"?(this.mode="comment end",this.textchunk=this.textchunk.slice(0,-1)):t=="eof"?this.emit("comment",this.textchunk):this.textchunk+=t;break;case"comment end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"declaration":if(t=="?"&&e==">"){this.mode="declaration end";break}t=="eof"&&this.emit("comment",this.textchunk),this.textchunk+=t;break;case"declaration end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"tag name start":if(t=="eof"){this.emit("text","<");break}if(!mt("whitespace",t)){if(this.mode="tag name",t=="/"){this.mode="close tag name start";break}else if(t=="!"){this.mode="special",this.textchunk="";break}else if(t=="?"){this.mode="declaration";break}this.act(t,e,i)}break;case"close tag name start":mt("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,i));break;case"close tag name":if(mt("whitespace",t))this.tagname=this.nodename;else switch(t){case">":this.emit("/tag",this.tagname||this.nodename,this.attrs),this.mode="text";break;default:!this.tagname&&(this.nodename+=t);break}break;case"tag name":if(mt("whitespace",t))this.tagname=this.nodename,this.nodename="",this.mode="attr start";else switch(t){case">":this.emit("tag",this.nodename,this.attrs),this.mode="text";break;case"/":this.raw+=e,this.emit("tag",this.nodename,this.attrs),this.emit("/tag",this.nodename,this.attrs),this.mode="skip";break;default:this.nodename+=t;break}break;case"attr start":mt("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,i));break;case"attr":if(mt("whitespace",t)||t=="=")this.attrs[this.nodename]="",this.mode="attr value start";else switch(t){case">":this.nodename=="/"?(delete this.attrs["/"],this.emit("tag",this.tagname,this.attrs),this.emit("/tag",this.tagname,this.attrs)):(this.nodename&&(this.attrs[this.nodename]=""),this.emit("tag",this.tagname,this.attrs)),this.mode="text";break;default:this.nodename+=t;break}break;case"attr value start":if(!mt("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,i)}break;case"attr value":if(mt("whitespace",t)&&!this.quote)this.mode="attr start";else if(t==">"&&!this.quote)this.emit("tag",this.tagname,this.attrs),this.mode="text";else switch(t){case'"':case"'":this.quote==t&&i!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function ii(s,t){if(typeof t<"u")window.localStorage.setItem(s,t);else return window.localStorage.getItem(s)??void 0}function hr(s,t,e){const i=new Date;i.setTime(i.getTime()+e*24*60*60*1e3);const n="expires="+i.toUTCString();document.cookie=s+"="+t+"; "+n}function cr(s){const t=s+"=",e=document.cookie.split(";");for(let i=0,n=e.length;i<n;i++){const r=e[i].trim();if(r.indexOf(t)==0)return r.substring(t.length,r.length)}return""}const lr=()=>document.cookie.split(";").map(s=>s.split("=")).reduce((s,[t,e])=>(s[t.trim().replace('"',"")]=e,s),{}),ur=()=>document.cookie.split(";").forEach(s=>document.cookie=s.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));U.page.on("matchMediaChangePrefersColorSchemeDark",s=>{ye(s?"dark":"light")}),fs();function ye(s){ii("colorScheme",s),document.documentElement.classList.toggle("dark",s=="dark")}function fs(){const s=ii("colorScheme");if(s=="dark"||s=="light")return ye(s),s;{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return ye(t),t}}const fr={safeAreaTop:A.getCSSVar("--safe-area-inset-top"),safeAreaRight:A.getCSSVar("--safe-area-inset-right"),safeAreaBottom:A.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:A.getCSSVar("--safe-area-inset-left"),colorPrimary:A.getCSSVar("--color-primary")||"#5078f0",colorRed:A.getCSSVar("--color-red")||"#ff5050",colorOrange:A.getCSSVar("--color-orange")||"#fa8c00",colorYellow:A.getCSSVar("--color-yellow")||"#fadc32",colorGreen:A.getCSSVar("--color-green")||"#00c878",colorBlue:A.getCSSVar("--color-blue")||"#00b4fa",colorPurple:A.getCSSVar("--color-purple")||"#6464fa",colorBlack:A.getCSSVar("--color-black")||"#001428",colorGray00:A.getCSSVar("--color-gray-00")||"#000000",colorGray33:A.getCSSVar("--color-gray-33")||"#333333",colorGray66:A.getCSSVar("--color-gray-66")||"#666666",colorGray99:A.getCSSVar("--color-gray-99")||"#999999",colorGrayCC:A.getCSSVar("--color-gray-cc")||"#cccccc",colorGrayDD:A.getCSSVar("--color-gray-dd")||"#dddddd",colorGrayE6:A.getCSSVar("--color-gray-e6")||"#e6e6e6",colorGrayEE:A.getCSSVar("--color-gray-ee")||"#eeeeee",colorGrayEF:A.getCSSVar("--color-gray-ef")||"#efefef",colorGrayF5:A.getCSSVar("--color-gray-f5")||"#f5f5f5",colorGrayFF:A.getCSSVar("--color-gray-ff")||"#ffffff",fontLineHeight:A.getCSSVar("--font-line-height")||"1,4",fontSize32:A.getCSSVar("--font-size-32")||"32px",fontSize24:A.getCSSVar("--font-size-24")||"24px",fontSize20:A.getCSSVar("--font-size-20")||"20px",fontSize18:A.getCSSVar("--font-size-18")||"18px",fontSize16:A.getCSSVar("--font-size-16")||"16px",fontSize14:A.getCSSVar("--font-size-14")||"14px",fontSize12:A.getCSSVar("--font-size-12")||"12px",fontSize11:A.getCSSVar("--font-size-11")||"11px",gap4:A.getCSSVar("--gap-4")||"4px",gap8:A.getCSSVar("--gap-8")||"8px",gap12:A.getCSSVar("--gap-12")||"12px",gap16:A.getCSSVar("--gap-16")||"16px",gap20:A.getCSSVar("--gap-20")||"20px",gap40:A.getCSSVar("--gap-40")||"40px",height44:A.getCSSVar("--height-44")||"44px",height32:A.getCSSVar("--height-32")||"32px",borderRadius:A.getCSSVar("--border-radius")||"4px"},dr=()=>Math.random()*16777215,mr=()=>`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`,gr=()=>`#${(~~(Math.random()*(1<<24))).toString(16)}`,ds=function(s){let t="00000"+(s|0).toString(16);return t="#"+t.substring(t.length-6),t},ms=function(s,t=1){const e=s>>16&255,i=s>>8&255,n=s&255,r=t<0?0:t>1?1:t;return r===1?"rgb("+e+","+i+","+n+")":"rgba("+e+","+i+","+n+","+r+")"},ve=function(s){return s[0]==="#"&&(s=s.slice(1)),parseInt(s,16)},si=function(s,t=1){const e=ve(s);return ms(e,t)},pr=s=>{const e=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(s);return e?"#"+((1<<24)+(parseInt(e[1])<<16)+(parseInt(e[2])<<8)+parseInt(e[3])).toString(16).slice(1):""};function wr(s,t){let e=parseInt(s.substring(1,3),16),i=parseInt(s.substring(3,5),16),n=parseInt(s.substring(5,7),16);e==0&&(e=32),i==0&&(i=32),n==0&&(n=32),e=e*(100+t)/100,i=i*(100+t)/100,n=n*(100+t)/100,e=e<255?e:255,i=i<255?i:255,n=n<255?n:255,e=Math.round(e),i=Math.round(i),n=Math.round(n);const r=e.toString(16).length==1?"0"+e.toString(16):e.toString(16),a=i.toString(16).length==1?"0"+i.toString(16):i.toString(16),o=n.toString(16).length==1?"0"+n.toString(16):n.toString(16);return"#"+r+a+o}function yr(s,t,e,i){let n,r,a;s=s/360,t=t/100,e=e/100;const o=Math.floor(s*6),h=s*6-o,c=e*(1-t),f=e*(1-h*t),m=e*(1-(1-h)*t);switch(o%6){case 0:n=e,r=m,a=c;break;case 1:n=f,r=e,a=c;break;case 2:n=c,r=e,a=m;break;case 3:n=c,r=f,a=e;break;case 4:n=m,r=c,a=e;break;case 5:default:n=e,r=c,a=f;break}return{r:Math.round(n*255),g:Math.round(r*255),b:Math.round(a*255),opacity:i??1}}function vr(s,t,e,i){s*=360;let n,r,a,o,h;return s=s%360/60,h=e*t,o=h*(1-Math.abs(s%2-1)),n=r=a=e-h,s=~~s,n+=[h,o,0,0,o,h][s],r+=[o,h,h,o,0,0][s],a+=[0,0,o,h,h,o][s],{r:n,g:r,b:a,opacity:i??1}}function br(s,t,e,i){(s>1||t>1||e>1)&&(s/=360,t/=100,e/=100),s*=360;var n,r,a,o,h;return s=s%360/60,h=2*t*(e<.5?e:1-e),o=h*(1-Math.abs(s%2-1)),n=r=a=e-h/2,s=~~s,n+=[h,o,0,0,o,h][s],r+=[o,h,h,o,0,0][s],a+=[0,0,o,h,h,o][s],{r:n,g:r,b:a,opacity:i??1}}function xr(s,t,e,i){const n=Math.max(s,t,e),r=Math.min(s,t,e),a=n-r,o=n===0?0:a/n,h=n/255;let c;switch(n){case r:c=0;break;case s:c=t-e+a*(t<e?6:0),c/=6*a;break;case t:c=e-s+a*2,c/=6*a;break;case e:default:c=s-t+a*4,c/=6*a;break}return{h:Math.round(c*360),s:Math.round(o*100),v:Math.round(h*100),opacity:i??1}}function Cr(s,t,e){let i,n,r,a;return r=Math.max(s,t,e),a=r-Math.min(s,t,e),i=a==0?0:r==s?(t-e)/a:r==t?(e-s)/a+2:(s-t)/a+4,i=(i+360)%6*60/360,n=a==0?0:a/r,{h:i,s:n,b:r}}function Tr(s,t,e){let i,n,r,a,o,h;return a=Math.max(s,t,e),o=Math.min(s,t,e),h=a-o,i=h==0?0:a==s?(t-e)/h:a==t?(e-s)/h+2:(s-t)/h+4,i=(i+360)%6*60/360,r=(a+o)/2,n=h==0?0:r<.5?h/(2*r):h/(2-2*r),{h:i,s:n,l:r}}function _r(s){return btoa(encodeURIComponent(s)).replaceAll("+","*").replaceAll("/","-").replaceAll("=","")}function Sr(s){let t=s.replaceAll("*","+").replaceAll("-","/");const e=t.length%4;return e&&(t=t.padEnd(t.length+(4-e),"=")),decodeURIComponent(atob(t))}function ni(s=window.location.href){return ze(URL)?new URL(s):gs(s)}function gs(s=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",i="(?<pathname>(?:\\/[^/#?]+)*\\/?)",n="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${i}${n}${r}$`).exec(s);return{href:s,protocol:o?.groups?.protocol??"",host:o?.groups?.host??"",hostname:o?.groups?.hostname??"",port:o?.groups?.port??"",pathname:o?.groups?.pathname??"",search:o?.groups?.search??"",hash:o?.groups?.hash??""}}function Pr(s){const t=ni(s);return t.protocol==="http:"||t.protocol==="https:"}function ps(s=window.location.href){const t=ni(s),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function Er(s=location.search){s=decodeURIComponent(s).replace(/^[#?&]/,"");const t={};if(!s)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let i=e.exec(s);for(;i;)t[i[1]]=i[2],i=e.exec(s);return t}function kr(s){return Array.from(new URLSearchParams(s)).reduce((t,[e,i])=>Object.assign({},t,{[e]:t[e]?(Array.isArray(t[e])?t[e]:[t[e]]).concat(i):i}),{})}function ws(s){let t="";for(const e in s)t&&(t+="&"),t+=`${e}=${s[e]}`;return t}function Ir(s){return new URLSearchParams(s).toString()}function ri(s){return"?"+[...s.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function be(s,t){return s.indexOf("?")>=0?s+t.replace(/^\?/,"&"):s.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function Mr(s){let t="";new MutationObserver(function(i){window.location.href!==t&&(t=window.location.href,s&&s(location.href))}).observe(document,{attributes:!0,childList:!0,subtree:!0})}function Dr(s){window.addEventListener("hashchange",()=>{s(location.hash)})}function Ar(s){window.addEventListener("popstate",s,!1)}function Lr(s){let t=null;if(rs)try{t=new Worker(URL.createObjectURL(new Blob([s])))}catch(e){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),null}return t}const xe=new Map;async function Rr(s){return new Promise((t,e)=>{Ce(s,(i,n)=>i?e(i):t({width:n.width,height:n.height,aspectRatio:n.width/n.height}))})}const Ce=(s,t)=>{if(xe.has(s))return t(null,xe.get(s));const e=new Image;e.onload=function(){xe.set(s,{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height,element:e}),t(null,xe.get(s))},e.onerror=function(i){t(i,null)},e.src=s},Or=(s,t)=>{for(let e=0,i=s.length;e<i;e++){const n=s[e],{type:r}=n;if(r.split("/")[0]!=="image")return;const o=new FileReader;o.onload=function(h){if(!h.target)return t("no reader target",null);const c=h.target.result,f=Ni(c),m=new Blob([c]);ai(m,(w,p)=>{if(!p)return t(w,null);Ce(p,(y,x)=>{if(!x)return t(y,null);ys(p,(b,C)=>{if(!C)return t(b,null);const _={name:n.name,fileType:f,size:n.size,width:x.width,height:x.height,imgUrl:p,imageData:C,blob:m};return t(null,_)})})})},o.readAsArrayBuffer(n)}},ys=(s,t)=>{Ce(s,(e,i)=>{if(!i)return t(e,null);const n=document.createElement("canvas"),r=n.getContext("2d");n.width=i.width,n.height=i.height,r.drawImage(i.element,0,0,n.width,n.height);const a=r.getImageData(0,0,n.width,n.height);return t(null,a)})},Nr=(s,t=0,e=0)=>{const i=document.createElement("canvas"),n=i.getContext("2d");return i.width=t,i.height=e,n.drawImage(s,0,0,t,e),n.getImageData(0,0,t,e)},Fr=(s,t=0,e=0)=>{const i=document.createElement("canvas"),n=i.getContext("2d");return i.width=t,i.height=e,n.drawImage(s,0,0,t,e),n.getImageData(0,0,t,e)},Gr=s=>{const t=s.width,e=s.height,i=t*e*3,n=i+54,r=[66,77,n&255,n>>8&255,n>>16&255,n>>24&255,0,0,0,0,54,0,0,0],a=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,i&255,i>>8&255,i>>16&255,i>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=(4-t*3%4)%4,h=s.data;let c="";const f=t<<2;let m=e;const w=String.fromCharCode;do{const y=f*(m-1);let x="";for(let b=0;b<t;b++){const C=b<<2;x+=w(h[y+C+2])+w(h[y+C+1])+w(h[y+C])}for(let b=0;b<o;b++)x+=String.fromCharCode(0);c+=x}while(--m);function p(y){if(!window.btoa)throw"btoa undefined";let x="";if(typeof y=="string")x=y;else for(let b=0;b<y.length;b++)x+=String.fromCharCode(y[b]);return btoa(x)}return p(r.concat(a))+p(c)},Br=s=>{const{width:t,height:e}=s,i=document.createElement("canvas"),n=i.getContext("2d");return i.width=t,i.height=e,n.putImageData(s,0,0,0,0,t,e),i.toDataURL("image/png")},Ur=(s,t,e)=>{const{width:i,height:n}=s,r=document.createElement("canvas"),a=r.getContext("2d");r.width=i,r.height=n,a.putImageData(s,0,0,0,0,i,n);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},o,1)},ai=(s,t)=>{const e=new FileReader;e.onload=function(i){i.target?t(null,i.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(s)},zr=(s,t)=>{ai(s,function(e,i){if(i){const n=new Image;n.src=i}else t(e)})};function Vr(s){const t=[],e=[],i=[];let n=0;for(let h=0,c=s.data.length;h<c;h+=4)t[n]=s.data[h],e[n]=s.data[h+1],i[n]=s.data[h+2],n+=1;const r=oi(t),a=oi(e),o=oi(i);return"rgb("+r+","+a+","+o+")"}function oi(s){const t={},e=[],i=[];for(let o=0;o<s.length;o++)t[s[o]]?e.push(s[o]):t[s[o]]=1;let n=0;for(let o=0;o<e.length;o++){n=0;for(let h=0;h<e.length;h++)e[o]===e[h]&&(n+=1),i[o]=n}const r=Math.max.apply(null,i);let a=0;for(;a<i.length;a++)if(i[a]===r)return;return e[a]}const Xr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[(a*e+e-o-1)*4],n[h+1]=t[(a*e+e-o-1)*4+1],n[h+2]=t[(a*e+e-o-1)*4+2],n[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(n,e,i)},Wr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[((i-a-1)*e+o)*4],n[h+1]=t[((i-a-1)*e+o)*4+1],n[h+2]=t[((i-a-1)*e+o)*4+2],n[h+3]=t[((i-a-1)*e+o)*4+3]}return new ImageData(n,e,i)},Yr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<i;o++){const h=(a*i+o)*4;n[h]=t[(o*e+e-a-1)*4],n[h+1]=t[(o*e+e-a-1)*4+1],n[h+2]=t[(o*e+e-a-1)*4+2],n[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(n,i,e)},Hr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<i;o++){const h=(a*i+o)*4;n[h]=t[((i-o-1)*e+a)*4],n[h+1]=t[((i-o-1)*e+a)*4+1],n[h+2]=t[((i-o-1)*e+a)*4+2],n[h+3]=t[((i-o-1)*e+a)*4+3]}return new ImageData(n,i,e)},jr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1]+t[h+2])/3;n[h]=c,n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,i)},qr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=.2126*t[h]+.7152*t[h+1]+.0722*t[h+2];n[h]=c,n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,i)},$r=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,f=(t[h]+t[h+1]+t[h+2])/3>127?255:0;n[h]=f,n[h+1]=f,n[h+2]=f,n[h+3]=t[h+3]}return new ImageData(n,e,i)},Jr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=255-t[h],n[h+1]=255-t[h+1],n[h+2]=255-t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,i)},Zr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=0,n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,i)},Kr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=t[h+1],n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,i)},Qr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=0,n[h+2]=t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,i)},ta=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=t[h+1],n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,i)},ea=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=0,n[h+2]=t[h+1],n[h+3]=t[h+3]}return new ImageData(n,e,i)},ia=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=t[h+1],n[h+2]=t[h+1],n[h+3]=t[h+3]}return new ImageData(n,e,i)},sa=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h+1]+t[h+2])/2;n[h]=t[h],n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,i)},na=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+2])/2;n[h]=c,n[h+1]=t[h+1],n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,i)},ra=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1])/2;n[h]=c,n[h+1]=c,n[h+2]=t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,i)},aa=s=>vs(s,[-1,-1,-1,-1,9,-1,-1,-1,-1]),oa=s=>vs(s,[-1,-1,-1,-1,8,-1,-1,-1,-1]),ha=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=t[h+1],n[h+2]=t[h+2],n[h+3]=255}return new ImageData(n,e,i)},ca=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;if(t[h+3]===0)n[h]=255,n[h+1]=255,n[h+2]=255,n[h+3]=255;else{const c=bs([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);n[h]=c[0],n[h+1]=c[1],n[h+2]=c[2],n[h+3]=c[3]}}return new ImageData(n,e,i)},la=(s,t,e,i,n,r=!1,a)=>{const{data:o,width:h,height:c}=s;let f=n,m=i,w=t,p=e;if(f<0?f=0:f>h&&(f=h),m<0?m=0:m>c&&(m=c),w<1?w=1:w>h&&(w=h),p<1?p=1:p>c&&(p=c),f+w>h&&(w=h-f),m+p>c&&(p=c-m),r){const y=new Uint8ClampedArray(o.length);for(let b=0;b<c;b++)for(let C=0;C<h;C++){const _=(b*h+C)*4;C>=f&&C<=f+w&&b>=m&&b<=m+p?(y[_]=o[_],y[_+1]=o[_+1],y[_+2]=o[_+2],y[_+3]=o[_+3]):(y[_]=255,y[_+1]=255,y[_+2]=255,y[_+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(y,h,c)}else{const y=new Uint8ClampedArray(w*p*4);for(let b=m;b<=m+p;b++)for(let C=f;C<=f+w;C++){const _=((b-m)*w+C-f)*4,I=(b*h+C)*4;y[_]=o[I],y[_+1]=o[I+1],y[_+2]=o[I+2],y[_+3]=o[I+3]}return new ImageData(y,w,p)}},ua=(s,t,e,i)=>{const{data:n,width:r,height:a}=s;let o=t;o>Math.floor(r/2)&&(o=Math.floor(r/2)),o>Math.floor(a/2)&&(o=Math.floor(a/2)),o<0&&(o=0);const h=new Uint8ClampedArray(n.length);for(let f=0;f<a;f++)for(let m=0;m<r;m++){const w=(f*r+m)*4;let p=-1;m<o?f<o?p=Math.sqrt(Math.pow(o-m-1,2)+Math.pow(o-f-1,2)):f>a-o-1&&(p=Math.sqrt(Math.pow(o-m-1,2)+Math.pow(f-(a-o),2))):m>r-o-1&&(f<o?p=Math.sqrt(Math.pow(m-(r-o),2)+Math.pow(o-f-1,2)):f>a-o-1&&(p=Math.sqrt(Math.pow(m-(r-o),2)+Math.pow(f-(a-o),2)))),Math.round(p)>o?(h[w]=255,h[w+1]=255,h[w+2]=255,h[w+3]=i||e.toUpperCase()==="PNG"?0:255):(h[w]=n[w],h[w+1]=n[w+1],h[w+2]=n[w+2],h[w+3]=i||e.toUpperCase()==="PNG"?n[w+3]:255)}return new ImageData(h,r,a)},fa=(s,t,e,i,n,r=1e4)=>{const a=new Image;a.src=s;const o=document.createElement("canvas"),h=o.getContext("2d");return o.width=r,o.height=r,h.drawImage(a,0,0,t,e,0,0,i,n),h.getImageData(0,0,i,n)},da=(s,t)=>{const{data:e,width:i,height:n}=s,r=new Uint8ClampedArray(e.length);for(let o=0;o<n;o++)for(let h=0;h<i;h++){const c=(o*i+h)*4;r[c]=Math.max(Math.min(e[c]+t,255),0),r[c+1]=Math.max(Math.min(e[c+1]+t,255),0),r[c+2]=Math.max(Math.min(e[c+2]+t,255),0),r[c+3]=e[c+3]}return new ImageData(r,i,n)},ma=(s,t,e=!1)=>{const{data:i,width:n,height:r}=s,a=new Uint8ClampedArray(i.length);for(let h=0;h<r;h++)for(let c=0;c<n;c++){const f=(h*n+c)*4;i[f+3]===0?(a[f]=255,a[f+1]=255,a[f+2]=255):(a[f]=i[f],a[f+1]=i[f+1],a[f+2]=i[f+2]);let m=i[f+3];e?m=Math.max(Math.min(Math.floor(255*t),255),0):m=Math.max(Math.min(Math.floor(m+255*t),255),0),a[f+3]=m}return new ImageData(a,n,r)},ga=(s,t,e,i)=>{const{data:n,width:r,height:a}=s,{data:o,width:h,height:c}=t;let f=e,m=i;e+c>a&&(f=a-c),i+h>r&&(m=r-h);const w=new Uint8ClampedArray(n.length);for(let y=0;y<a;y++)for(let x=0;x<r;x++){const b=(y*r+x)*4;if(x<m||x>m+h||y<=f||y>=f+c)w[b]=n[b],w[b+1]=n[b+1],w[b+2]=n[b+2],w[b+3]=n[b+3];else{const C=(y*r+x-((f+1)*r+(y-(f+1))*(r-h))+h-m-1)*4,_=[o[C],o[C+1],o[C+2],o[C+3]],I=[n[b],n[b+1],n[b+2],n[b+3]],E=bs(_,I);w[b]=E[0],w[b+1]=E[1],w[b+2]=E[2],w[b+3]=E[3]}}return new ImageData(w,r,a)},pa=(s,t,e,i,n,r=10)=>{const{data:a,width:o,height:h}=s;let c=n,f=i,m=t,w=e;c<0?c=0:c>o&&(c=o),f<0?f=0:f>h&&(f=h),m<1?m=1:m>o&&(m=o),w<1?w=1:w>h&&(w=h),c+m>o&&(m=o-c),f+w>h&&(w=h-f);const p=new Uint8ClampedArray(a.length);for(let x=0;x<h;x++)for(let b=0;b<o;b++){const C=(x*o+b)*4;if(b>=c&&b<=c+m&&x>=f&&x<=f+w){const _=Math.floor((b-c)/r),I=Math.floor((x-f)/r);let E=Math.floor(r*(_+1)-r/2+c),L=Math.floor(r*(I+1)-r/2+f);E>o-1&&(E=o-1),L>h-1&&(L=h-1);const O=(L*o+E)*4;p[C]=a[O],p[C+1]=a[O+1],p[C+2]=a[O+2],p[C+3]=a[O+3]}else p[C]=a[C],p[C+1]=a[C+1],p[C+2]=a[C+2],p[C+3]=a[C+3]}return new ImageData(p,o,h)},wa=(s,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}})=>{if(t&&e){const{data:i,width:n,height:r}=s,{data:a}=t,o=new Uint8ClampedArray(i.length),{backgroundColor:h,changeIntoColor:c}=e;for(let m=0;m<r;m++)for(let w=0;w<n;w++){const p=(m*n+w)*4,y=a[p],x=a[p+1],b=a[p+2],C=a[p+3];y===h.r&&x===h.g&&b===h.b&&C===h.a&&c.a!==0?(o[p]=c.r,o[p+1]=c.g,o[p+2]=c.b,o[p+3]=c.a):(o[p]=i[p],o[p+1]=i[p+1],o[p+2]=i[p+2],o[p+3]=i[p+3])}return new ImageData(o,n,r)}return s},vs=(s,t)=>{const{data:e,width:i,height:n}=s,r=new Uint8ClampedArray(e.length);for(let o=0;o<n;o++)for(let h=0;h<i;h++){const c=(o*i+h)*4;for(let f=0;f<3;f++){const m=c+f;h===0||h===i-1||o===0||o===n-1?r[m]=e[m]:r[m]=t[0]*e[m-i*4-4]+t[1]*e[m-i*4]+t[2]*e[m-i*4+4]+t[3]*e[m-4]+t[4]*e[m]+t[5]*e[m+4]+t[6]*e[m+i*4-4]+t[7]*e[m+i*4]+t[8]*e[m+i*4+4]}r[c+3]=e[c+3]}return new ImageData(r,i,n)},bs=(s,t)=>{if(s&&s.length===4&&t&&t.length===4){const e=s[3],i=t[3];if(e===255||i===0)return s;if(e===0)return t;{const n=e/255,r=i/255,a=Math.max(Math.min(Math.floor(s[0]*n+t[0]*r*(1-n)),255),0),o=Math.max(Math.min(Math.floor(s[1]*n+t[1]*r*(1-n)),255),0),h=Math.max(Math.min(Math.floor(s[2]*n+t[2]*r*(1-n)),255),0),c=Math.max(Math.min(Math.floor((n+r*(1-n))*255),255),0);return[a,o,h,c]}}return[255,255,255,255]},xs=function(s,t,e){const i=new Array(s*s),n=function(o){const h=o;let c=0,f=0;return{write(m,w){if(m>>>w)throw new Error("length over");for(;c+w>=8;)h.writeByte(255&(m<<c|f)),w-=8-c,m>>>=8-c,f=0,c=0;f=m<<c|f,c=c+w},flush(){c>0&&h.writeByte(f)}}},r=function(o){const h=1<<o,c=(1<<o)+1;let f=o+1;const m=a();for(let b=0;b<h;b++)m.add(String.fromCharCode(b));m.add(String.fromCharCode(h)),m.add(String.fromCharCode(c));const w=Fi(),p=n(w);p.write(h,f);let y=0,x=String.fromCharCode(i[y]);for(y+=1;y<i.length;){const b=String.fromCharCode(i[y]);y+=1,m.contains(x+b)?x=x+b:(p.write(m.indexOf(x),f),m.size()<4095&&(m.size()==1<<f&&(f+=1),m.add(x+b)),x=b)}return p.write(m.indexOf(x),f),p.write(c,f),p.flush(),w.toByteArray()},a=function(){const o={};let h=0;return{add(c){if(this.contains(c))throw new Error("dup key:"+c);o[c]=h,h+=1},size(){return h},indexOf(c){return o[c]},contains(c){return typeof o[c]<"u"}}};return{setPixel(o,h,c){i[h*s+o]=c},write(o){o.writeString("GIF87a"),o.writeShort(s),o.writeShort(s),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte(Ft("0x"+t[1]+t[2])),o.writeByte(Ft("0x"+t[3]+t[4])),o.writeByte(Ft("0x"+t[5]+t[6])),o.writeByte(Ft("0x"+e[1]+e[2])),o.writeByte(Ft("0x"+e[3]+e[4])),o.writeByte(Ft("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(s),o.writeShort(s),o.writeByte(0);const h=2,c=r(h);o.writeByte(h);let f=0;for(;c.length-f>255;)o.writeByte(255),o.writeBytes(c,f,255),f+=255;o.writeByte(c.length-f),o.writeBytes(c,f,c.length-f),o.writeByte(0),o.writeString(";")}}},Cs=function(s,t,e,i){const n=xs(s,t,e);for(let c=0;c<s;c++)for(let f=0;f<s;f++)n.setPixel(f,c,i(f,c));const r=Fi();n.write(r);const a=mn(),o=r.toByteArray();for(let c=0,f=o.length;c<f;c++)a.writeByte(o[c]);a.flush();let h="";return h+="data:image/gif;base64,",h+=a,h},et={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Kt={M:0,L:1,H:2,Q:3},St={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},X={glog:function(s){if(s<1)throw new Error("glog("+s+")");return X.LOG_TABLE[s]},gexp:function(s){for(;s<0;)s+=255;for(;s>=256;)s-=255;return X.EXP_TABLE[s]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let s=0;s<8;s++)X.EXP_TABLE[s]=1<<s;for(let s=8;s<256;s++)X.EXP_TABLE[s]=X.EXP_TABLE[s-4]^X.EXP_TABLE[s-5]^X.EXP_TABLE[s-6]^X.EXP_TABLE[s-8];for(let s=0;s<255;s++)X.LOG_TABLE[X.EXP_TABLE[s]]=s;const G={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(s){let t=s<<10;for(;G.getBCHDigit(t)-G.getBCHDigit(G.G15)>=0;)t^=G.G15<<G.getBCHDigit(t)-G.getBCHDigit(G.G15);return(s<<10|t)^G.G15_MASK},getBCHTypeNumber:function(s){let t=s<<12;for(;G.getBCHDigit(t)-G.getBCHDigit(G.G18)>=0;)t^=G.G18<<G.getBCHDigit(t)-G.getBCHDigit(G.G18);return s<<12|t},getBCHDigit:function(s){let t=0;for(;s!=0;)t++,s>>>=1;return t},getPatternPosition:function(s){return G.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,t,e){switch(s){case St.PATTERN000:return(t+e)%2==0;case St.PATTERN001:return t%2==0;case St.PATTERN010:return e%3==0;case St.PATTERN011:return(t+e)%3==0;case St.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case St.PATTERN101:return t*e%2+t*e%3==0;case St.PATTERN110:return(t*e%2+t*e%3)%2==0;case St.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){let t=new Bt([1],0);for(let e=0;e<s;e++)t=t.multiply(new Bt([1,X.gexp(e)],0));return t},getLengthInBits:function(s,t){if(1<=t&&t<10)switch(s){case et.MODE_NUMBER:return 10;case et.MODE_ALPHA_NUM:return 9;case et.MODE_8BIT_BYTE:return 8;case et.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(t<27)switch(s){case et.MODE_NUMBER:return 12;case et.MODE_ALPHA_NUM:return 11;case et.MODE_8BIT_BYTE:return 16;case et.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(t<41)switch(s){case et.MODE_NUMBER:return 14;case et.MODE_ALPHA_NUM:return 13;case et.MODE_8BIT_BYTE:return 16;case et.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+t)},getLostPoint:function(s){const t=s.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const h=s.isDark(r,a);for(let c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(let f=-1;f<=1;f++)a+f<0||t<=a+f||c==0&&f==0||h==s.isDark(r+c,a+f)&&o++;o>5&&(e+=3+o-5)}for(let r=0;r<t-1;r++)for(let a=0;a<t-1;a++){let o=0;s.isDark(r,a)&&o++,s.isDark(r+1,a)&&o++,s.isDark(r,a+1)&&o++,s.isDark(r+1,a+1)&&o++,(o==0||o==4)&&(e+=3)}for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)s.isDark(r,a)&&!s.isDark(r,a+1)&&s.isDark(r,a+2)&&s.isDark(r,a+3)&&s.isDark(r,a+4)&&!s.isDark(r,a+5)&&s.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)s.isDark(a,r)&&!s.isDark(a+1,r)&&s.isDark(a+2,r)&&s.isDark(a+3,r)&&s.isDark(a+4,r)&&!s.isDark(a+5,r)&&s.isDark(a+6,r)&&(e+=40);let i=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)s.isDark(a,r)&&i++;const n=Math.abs(100*i/t/t-50)/5;return e+=n*10,e}};class Bt{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let i=0;for(;i<t.length&&t[i]==0;)i++;this.num=new Array(t.length-i+e);for(let n=0;n<t.length-i;n++)this.num[n]=t[n+i]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let i=0;i<this.getLength();i++)for(let n=0;n<t.getLength();n++)e[i+n]^=X.gexp(X.glog(this.get(i))+X.glog(t.get(n)));return new Bt(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=X.glog(this.get(0))-X.glog(t.get(0)),i=new Array(this.getLength());for(let n=0;n<this.getLength();n++)i[n]=this.get(n);for(let n=0;n<t.getLength();n++)i[n]^=X.gexp(X.glog(t.get(n))+e);return new Bt(i,0).mod(t)}}class yt{totalCount;dataCount;constructor(t,e){this.totalCount=t,this.dataCount=e}static RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];static getRSBlocks(t,e){const i=yt.getRsBlockTable(t,e);if(i==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const n=i.length/3,r=[];for(let a=0;a<n;a++){const o=i[a*3+0],h=i[a*3+1],c=i[a*3+2];for(let f=0;f<o;f++)r.push(new yt(h,c))}return r}static getRsBlockTable(t,e){switch(e){case Kt.L:return yt.RS_BLOCK_TABLE[(t-1)*4+0];case Kt.M:return yt.RS_BLOCK_TABLE[(t-1)*4+1];case Kt.Q:return yt.RS_BLOCK_TABLE[(t-1)*4+2];case Kt.H:return yt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Ts{buffer;length;constructor(){this.buffer=[],this.length=0}get(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1}put(t,e){for(let i=0;i<e;i++)this.putBit((t>>>e-i-1&1)==1)}getLengthInBits(){return this.length}putBit(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}class ya{mode;data;constructor(t){this.mode=et.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,i=this.data.length;e<i;e++)t.put(this.data.charCodeAt(e),8)}}class Pt{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Kt[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new ya(t);this.dataList.push(e),this.dataCache=null}isDark(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]}getModuleCount(){return this.moduleCount}make(){if(this.typeNumber<1){let t=1;for(t=1;t<40;t++){const e=yt.getRSBlocks(t,this.errorCorrectLevel),i=new Ts;let n=0;for(let r=0;r<e.length;r++)n+=e[r].dataCount;for(let r=0;r<this.dataList.length;r++){const a=this.dataList[r];i.put(a.mode,4),i.put(a.getLength(),G.getLengthInBits(a.mode,t)),a.write(i)}if(i.getLengthInBits()<=n*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++){this.modules[i]=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++)this.modules[i][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=Pt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let i=-1;i<=7;i++)if(!(t+i<=-1||this.moduleCount<=t+i))for(let n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=i&&i<=6&&(n==0||n==6)||0<=n&&n<=6&&(i==0||i==6)||2<=i&&i<=4&&2<=n&&n<=4?this.modules[t+i][e+n]=!0:this.modules[t+i][e+n]=!1)}getBestMaskPattern(){let t=0,e=0;for(let i=0;i<8;i++){this.makeImpl(!0,i);const n=G.getLostPoint(this);(i==0||t>n)&&(t=n,e=i)}return e}createMovieClip(t,e,i){const n=t.createEmptyMovieClip(e,i),r=1;this.make();for(let a=0;a<this.modules.length;a++){const o=a*r;for(let h=0;h<this.modules[a].length;h++){const c=h*r;this.modules[a][h]&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+r,o),n.lineTo(c+r,o+r),n.lineTo(c,o+r),n.endFill())}}return n}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=G.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let i=0;i<t.length;i++){const n=t[e],r=t[i];if(this.modules[n][r]==null)for(let a=-2;a<=2;a++)for(let o=-2;o<=2;o++)a==-2||a==2||o==-2||o==2||a==0&&o==0?this.modules[n+a][r+o]=!0:this.modules[n+a][r+o]=!1}}setupTypeNumber(t){const e=G.getBCHTypeNumber(this.typeNumber);for(let i=0;i<18;i++){const n=!t&&(e>>i&1)==1;this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=n}for(let i=0;i<18;i++){const n=!t&&(e>>i&1)==1;this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=n}}setupTypeInfo(t,e){const i=this.errorCorrectLevel<<3|e,n=G.getBCHTypeInfo(i);for(let r=0;r<15;r++){const a=!t&&(n>>r&1)==1;r<6?this.modules[r][8]=a:r<8?this.modules[r+1][8]=a:this.modules[this.moduleCount-15+r][8]=a}for(let r=0;r<15;r++){const a=!t&&(n>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=a:r<9?this.modules[8][15-r-1+1]=a:this.modules[8][15-r-1]=a}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let i=-1,n=this.moduleCount-1,r=7,a=0;for(let o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(let h=0;h<2;h++)if(this.modules[n][o-h]==null){let c=!1;a<t.length&&(c=(t[a]>>>r&1)==1),G.getMask(e,n,o-h)&&(c=!c),this.modules[n][o-h]=c,r--,r==-1&&(a++,r=7)}if(n+=i,n<0||this.moduleCount<=n){n-=i,i=-i;break}}}static createData(t,e,i){const n=yt.getRSBlocks(t,e),r=new Ts;for(let o=0;o<i.length;o++){const h=i[o];r.put(h.mode,4),r.put(h.getLength(),G.getLengthInBits(h.mode,t)),h.write(r)}let a=0;for(let o=0;o<n.length;o++)a+=n[o].dataCount;if(r.getLengthInBits()>a*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+a*8+")");for(r.getLengthInBits()+4<=a*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=a*8||(r.put(Pt.PAD0,8),r.getLengthInBits()>=a*8));)r.put(Pt.PAD1,8);return Pt.createBytes(r,n)}static createBytes(t,e){let i=0,n=0,r=0;const a=new Array(e.length),o=new Array(e.length);for(let m=0;m<e.length;m++){const w=e[m].dataCount,p=e[m].totalCount-w;n=Math.max(n,w),r=Math.max(r,p),a[m]=new Array(w);for(let C=0;C<a[m].length;C++)a[m][C]=255&t.buffer[C+i];i+=w;const y=G.getErrorCorrectPolynomial(p),b=new Bt(a[m],y.getLength()-1).mod(y);o[m]=new Array(y.getLength()-1);for(let C=0;C<o[m].length;C++){const _=C+b.getLength()-o[m].length;o[m][C]=_>=0?b.get(_):0}}let h=0;for(let m=0;m<e.length;m++)h+=e[m].totalCount;const c=new Array(h);let f=0;for(let m=0;m<n;m++)for(let w=0;w<e.length;w++)m<a[w].length&&(c[f++]=a[w][m]);for(let m=0;m<r;m++)for(let w=0;w<e.length;w++)m<o[w].length&&(c[f++]=o[w][m]);return c}}const _s=Math.ceil,Qt=Math.floor,Ss=Math.round;function va(s,t){const e=Oi(s),i=t?.ecc||"H",n=t?.size||256,r=-1,a=t?.padding||0,o=t?.color||"#000000",h=t?.background||"#ffffff",c=new Pt(r,i);c.addData(e),c.make();const f=c.getModuleCount(),m=(n-a*2)/f,w=a,p=n-a;return Cs(n,o,h,function(y,x){if(w<=y&&y<p&&w<=x&&x<p){const b=Qt((y-w)/m),C=Qt((x-w)/m);return c.isDark(C,b)?0:1}else return 1})}function ba(s,t){const e=t.x||0,i=t.y||0,n=Oi(s),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?Qt(t.size):256,h=t.padding||0,c=-1,f=t.color||"#000000",m=t.background||"#ffffff",w=new Pt(c,a);w.addData(n),w.make();const p=w.getModuleCount(),y=(o-h*2)/p;r.fillStyle=m,r.fillRect(e,i,o,o);for(let x=0;x<p;x++)for(let b=0;b<p;b++){const C=_s((b+1)*y)-Qt(b*y),_=_s((x+1)*y)-Qt(x*y);r.fillStyle=w.isDark(x,b)?f:m,r.fillRect(e+Ss(b*y)+h,i+Ss(x*y)+h,C,_)}}function xa(s){return new Promise((t,e)=>{fetch(s).then(i=>i.text()).then(i=>{t(i)}).catch(i=>{e(i)})})}function hi(){let s=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0;e<t.length;e++)try{s=new window.ActiveXObject(t[e]);break}catch{continue}}else s=new XMLHttpRequest;return s}function Ca(s){if(!s.action)return{url:"",data:"",boundary:""};const t=s.method.toLowerCase()==="get",e=s.method.toLowerCase()==="post";let i=s.action,n="";const r="---------------------------"+Date.now().toString(16);if(window.FormData)n=new FormData(s),t&&(i=be(i,ri(n)));else if(t){let a="";for(let o=0;o<s.elements.length;o++){const h=s.elements[o];if(!h.hasAttribute("name"))continue;const c=h.nodeName.toUpperCase()==="INPUT"?h.getAttribute("type")?.toUpperCase():"TEXT";if(c==="FILE")for(let f=0,m=h.files?.length??0;f<m;a+="&"+encodeURIComponent(h.name)+"="+encodeURIComponent(h.files?.[f++].name??""));else(c!=="RADIO"&&c!=="CHECKBOX"||h.checked)&&(a+="&"+encodeURIComponent(h.name)+"="+encodeURIComponent(h.value))}i=be(i,a)}else if(e){const a=[];if(s.enctype==="application/x-www-form-urlencoded"){for(let o=0;o<s.elements.length;o++){const h=s.elements[o];h.hasAttribute("name")&&a.push(encodeURIComponent(h.name)+"="+encodeURIComponent(h.value))}n=a.join("&")}else if(s.enctype==="text/plain"){for(let o=0;o<s.elements.length;o++){const h=s.elements[o];h.hasAttribute("name")&&a.push(h.name+"="+h.value)}n=a.join(`\r
|
|
26
|
+
`)}else if(s.enctype==="multipart/form-data"){for(let o=0;o<s.elements.length;o++){const h=s.elements[o];if(!h.hasAttribute("name"))continue;if((h.nodeName.toUpperCase()==="INPUT"?h.getAttribute("type")?.toUpperCase():"TEXT")==="FILE")for(let f=0,m=h.files?.length??0;f<m;f++){const w=h.files?.[f];a.push('Content-Disposition: form-data; name="'+h.name+'"; filename="'+w?.name+`"\r
|
|
27
|
+
Content-Type: `+w?.type+`\r
|
|
32
28
|
\r
|
|
33
|
-
`)}else a.push('Content-Disposition: form-data; name="'+
|
|
29
|
+
`)}else a.push('Content-Disposition: form-data; name="'+h.name+`"\r
|
|
34
30
|
\r
|
|
35
|
-
`+
|
|
36
|
-
`)}
|
|
37
|
-
`)}}return{url:i,data:
|
|
38
|
-
`+
|
|
39
|
-
`):f.send(JSON.stringify(s))):(f.open(g,r,!0),p(),f.send(JSON.stringify(s)))})}function $0(n,t){const e=ta();e.open("HEAD",n),e.filepath=n,e.callback=t,e.onload=function(){const i=parseFloat(window.localStorage.getItem("lm_"+this.filepath)??""),r=Date.parse(this.getResponseHeader("Last-Modified"));(isNaN(i)||r>i)&&(window.localStorage.setItem("lm_"+this.filepath,String(Date.now())),isFinite(i)&&this.callback(r,i))},e.send()}let Cr;const Ql=new WeakMap;function ea(n,t){let e=Ql.get(n);e||(e=new Map,Ql.set(n,e));let i=e.get(t);return i||(i=new tc,e.set(t,i)),i}class tc{subscribers;constructor(){this.subscribers=new Set}depend(){Cr&&this.subscribers.add(Cr)}notify(){this.subscribers.forEach(t=>t())}}function q0(n){Cr=n,n(),Cr=null}function W0(n){return Object.keys(n).forEach(t=>{let e=n[t];const i=ea(n,t);Object.defineProperty(n,t,{get(){return i.depend(),e},set(r){r!=e&&(e=r,i.notify())}})}),n}function J0(n){return new Proxy(n,{get(t,e,i){return ea(n,e).depend(),Reflect.get(t,e,i)},set(t,e,i,r){const s=ea(n,e);return n[e]!=i&&(n[e]=i,s.notify()),Reflect.set(t,e,i,r)}})}class Er{x;y;z;constructor(t=[0,0,0],e=[0,0,0]){const[i,r,s]=t,[a,o,l]=e;this.x=i-a,this.y=r-o,this.z=s-l}get length(){const{x:t,y:e,z:i}=this;return Math.sqrt(t*t+e*e+i*i)}unit(){const t=this.length;return new Er([this.x/t,this.y/t,this.z/t])}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){const e=this.x,i=this.y,r=this.z,s=t.x,a=t.y,o=t.z;return new Er([i*o-r*a,r*s-e*o,e*a-s*i])}}(function(){let n=0;window.requestAnimationFrame||(window.requestAnimationFrame=function(t){const e=new Date().getTime(),i=Math.max(0,16-(e-n)),r=window.setTimeout(function(){t(e+i)},i);return n=e+i,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})})();const ec=n=>{let t=window.requestAnimationFrame(function e(i){t=window.requestAnimationFrame(e),n(i,t)});return()=>window.cancelAnimationFrame(t)};class K0{id=0;renders={};cancelFn;constructor(){}get length(){let t=0;for(let e in this.renders)t++;return t}register(t){const e=this.id++;this.renders[e]=t,this.run()}run(){this.cancelFn||(this.cancelFn=ec((t,e)=>{const i=[];for(let r in this.renders)this.renders[r](t)===!1&&i.push(parseInt(r));for(let r of i)delete this.renders[r];!this.length&&this.cancelFn&&(this.cancelFn(),this.cancelFn=void 0)}))}}const kr=new K0;let Ni;typeof self>"u"&&typeof process<"u"&&process.hrtime?Ni=function(){const n=process.hrtime();return n[0]*1e3+n[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?Ni=self.performance.now.bind(self.performance):Date.now!==void 0?Ni=Date.now:Ni=function(){return new Date().getTime()};const Jn=Ni;class Bi{static _nextId=0;static nextId(){return Bi._nextId++}}const Sr={Linear:{None:function(n){return n}},Ease:{In:function(n){return Math.pow(n,1.7)}},Quadratic:{In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}},Cubic:{In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}},Quartic:{In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}},Quintic:{In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}},Sinusoidal:{In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}},Exponential:{In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}},Circular:{In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}},Elastic:{In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}},Back:{In:function(n){return n===1?1:n*n*((1.70158+1)*n-1.70158)},Out:function(n){return n===0?0:--n*n*((1.70158+1)*n+1.70158)+1},InOut:function(n){const t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}},Bounce:{In:function(n){return 1-Sr.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?Sr.Bounce.In(n*2)*.5:Sr.Bounce.Out(n*2-1)*.5+.5}},generatePow:function(n=4){return n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(t){return t**n},Out:function(t){return 1-(1-t)**n},InOut:function(t){return t<.5?(t*2)**n/2:(1-(2-t*2)**n)/2+.5}}},random:function(n){return Math.random()},createStep:function(n){return function(t){return Math.floor(t*n)/n}},createNoisyEasing:function(n,t=.1){const e=1-t;return function(i){return t*Math.random()+e*n(i)}}},na=Sr,Gi={Utils:{Linear:function(n,t,e){return(t-n)*e+n},Factorial:function(){const n=[1];return function(t){let e=1;if(n[t])return n[t];for(let i=t;i>1;i--)e*=i;return n[t]=e,e}}(),Bernstein:function(n,t){const e=Gi.Utils.Factorial;return e(n)/e(t)/e(n-t)},CatmullRom:function(n,t,e,i,r){const s=(e-n)*.5,a=(i-t)*.5,o=r*r,l=r*o;return(2*t-2*e+s+a)*l+(-3*t+3*e-2*s-a)*o+s*r+t}},Linear:function(n,t){const e=n.length-1,i=e*t,r=Math.floor(i),s=Gi.Utils.Linear;return t<0?s(n[0],n[1],i):t>1?s(n[e],n[e-1],e-i):s(n[r],n[r+1>e?e:r+1],i-r)},Bezier:function(n,t){let e=0;const i=n.length-1,r=Math.pow,s=Gi.Utils.Bernstein;for(let a=0;a<=i;a++)e+=r(1-t,i-a)*r(t,a)*n[a]*s(i,a);return e},CatmullRom:function(n,t){const e=n.length-1;let i=e*t,r=Math.floor(i);const s=Gi.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(r=Math.floor(i=e*(1+t))),s(n[(r-1+e)%e],n[r],n[(r+1)%e],n[(r+2)%e],i-r)):t<0?n[0]-(s(n[0],n[0],n[1],n[1],-i)-n[0]):t>1?n[e]-(s(n[e],n[e],n[e-1],n[e-1],i-e)-n[e]):s(n[r?r-1:0],n[r],n[e<r+1?e:r+1],n[e<r+2?e:r+2],i-r)}},ia=Gi;class nc{_tweens={};_tweensAddedDuringUpdate={};getAll(){return Object.keys(this._tweens).map(t=>this._tweens[t])}removeAll(){this._tweens={}}add(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t}remove(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]}update(t=Jn(),e=!1){let i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(let r=0;r<i.length;r++){const s=this._tweens[i[r]],a=!e;s&&s.update(t,a)===!1&&!e&&delete this._tweens[i[r]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0}}const _e=new nc;class ic{constructor(t,e=_e){this._object=t,this._group=e}_id=Bi.nextId();_isPlaying=!1;_startTime=0;_delayTime=0;_durationTime=1e3;_isPaused=!1;_pauseStartTime=0;_initialRepeat=0;_repeat=0;_repeatDelayTime;_yoyo=!1;_reversed=!1;_valuesStart={};_valuesEnd={};_valuesStartRepeat={};_easingFunction=na.Linear.None;_interpolationFunction=ia.Linear;_chainedTweens=[];_isChainStopped=!1;_onStartCallback;_onStartCallbackFired=!1;_onEveryStartCallback;_onEveryStartCallbackFired=!1;_onUpdateCallback;_onRepeatCallback;_onCompleteCallback;_onStopCallback;_goToEnd=!1;getId(){return this._id}isPlaying(){return this._isPlaying}isPaused(){return this._isPaused}to(t,e){return this._valuesEnd=Object.create(t),e!==void 0&&(this._durationTime=e),this}duration(t=1e3){return this._durationTime=t,this}start(t=Jn()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,i,r){for(const s in i){const a=t[s],o=Array.isArray(a),l=o?"array":typeof a,c=!o&&Array.isArray(i[s]);if(!(l==="undefined"||l==="function")){if(c){let f=i[s];if(f.length===0)continue;f=f.map(this._handleRelativeValue.bind(this,a)),i[s]=[a].concat(f)}if((l==="object"||o)&&a&&!c){e[s]=o?[]:{};for(const f in a)e[s][f]=a[f];r[s]=o?[]:{},this._setupProperties(a,e[s],i[s],r[s])}else typeof e[s]>"u"&&(e[s]=a),o||(e[s]*=1),c?r[s]=i[s].slice().reverse():r[s]=e[s]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=Jn()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=Jn()){return!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStartTime,this._pauseStartTime=0,this._group&&this._group.add(this),this)}stopChainedTweens(){for(let t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this}group(t=_e){return this._group=t,this}delay(t=0){return this._delayTime=t,this}repeat(t=0){return this._initialRepeat=t,this._repeat=t,this}repeatDelay(t){return this._repeatDelayTime=t,this}yoyo(t=!1){return this._yoyo=t,this}easing(t=na.Linear.None){return this._easingFunction=t,this}interpolation(t=ia.Linear){return this._interpolationFunction=t,this}chain(...t){return this._chainedTweens=t,this}onStart(t){return this._onStartCallback=t,this}onEveryStart(t){return this._onEveryStartCallback=t,this}onUpdate(t){return this._onUpdateCallback=t,this}onRepeat(t){return this._onRepeatCallback=t,this}onComplete(t){return this._onCompleteCallback=t,this}onStop(t){return this._onStopCallback=t,this}update(t=Jn(),e=!0){if(this._isPaused)return!0;let i,r;const s=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>s)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),r=(t-this._startTime)/this._durationTime,r=this._durationTime===0||r>1?1:r;const a=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),r===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let o=0,l=this._chainedTweens.length;o<l;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,i,r){for(const s in i){if(e[s]===void 0)continue;const a=e[s]||0;let o=i[s];const l=Array.isArray(t[s]),c=Array.isArray(o);!l&&c?t[s]=this._interpolationFunction(o,r):typeof o=="object"&&o?this._updateProperties(t[s],a,o,r):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[s]=a+(o-a)*r))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=i,this._valuesEnd[t]=e}}const Q0=Bi.nextId,tp=_e.getAll.bind(_e),ep=_e.removeAll.bind(_e),np=_e.add.bind(_e),ip=_e.remove.bind(_e),rp=_e.update.bind(_e),Ar={now:Jn,Sequence:Bi,Easing:na,Interpolation:ia,Group:nc,Tween:ic,nextId:Q0,getAll:tp,removeAll:ep,add:np,remove:ip,update:rp};function rc(n){switch(n){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}const sp={attributeName:["display"],values:[["block","block"]]},se={easeName:"linear",begin:0,dur:300,repeatCount:1,direction:"normal",fill:"freeze",keyTimes:[0,1]};class fn{currentAnimateName;objects=[];actions=[];constructor(){}hasObjects(){return this.objects.length>0}fromDOM(t){return Array.isArray(t)||(t=[t]),this.objects=[],t.forEach(e=>{const i=lr(e);this.objects.push({width:parseFloat(i.css("width")),height:parseFloat(i.css("height")),dom:i,el:e,originCSSObject:i.css()})}),this}toCSS(t,...e){if(!this.hasObjects())return;switch(this.currentAnimateName=t,this[t](...e),this.objects[0].dom?.parent().css({position:"relative",perspective:"1000px",overflow:"hidden"}),t){default:this.objects.forEach((s,a)=>{s.dom?.css({position:"absolute","z-index":String(1e3+a),"transform-style":"preserve-3d","backface-visibility":"hidden"})});break}let i=0;const r=()=>{this.actions.forEach((s,a)=>{const o=this.objects[s.objectIndex];let l=[],c=[];Array.isArray(s.attributeName)?(l=s.attributeName,c=s.values):s.attributeName&&(l=[s.attributeName],c=[s.values]);const f=s.keyTimes.length,g=Bn(o.dom?.css("transform")??"");let p=s.begin;s.keyTimes.forEach((u,y)=>{const x={_matrix:g};l.forEach((b,A)=>{const P=c[A][s.direction=="reverse"?f-y-1:y];fn.setCSSObjectTransformUseMatrix(b,P,x)}),y==0?o.dom?.css(Object.assign(x,{transition:""})):(setTimeout(()=>{o.dom?.css(Object.assign(x,{transition:`all ${s.realKeyTimes[y]}ms cubic-bezier(${s.keySplines[y-1].join(",")})`}))},p),p+=s.realKeyTimes[y])}),setTimeout(()=>{s.fill==="remove"&&o.dom?.css(o.originCSSObject??{}),a==this.actions.length-1&&(typeof s.repeatCount=="number"&&++i<s.repeatCount||s.repeatCount=="infinite")&&requestAnimationFrame(()=>{this.currentAnimateName===t&&r()})},s.begin+s.dur)})};r()}static isRunningGlobalTween=!1;static runGlobalTween(t){fn.isRunningGlobalTween||kr.register(()=>(fn.isRunningGlobalTween=Ar.update(t?.()),fn.isRunningGlobalTween))}static toTween(t,e,i){const r=i?.onUpdate??(()=>{}),s=i?.onStart??(()=>{}),a=i?.onComplete??(()=>{}),o=i?.duration??1e3,l=i?.delay??0,c=i?.easeFunction??Ar.Easing.Linear.None,f=i?.repeat??0,g=i?.yoyo??!1,p=new Ar.Tween(t).to(e,o).delay(l).easing(c).repeat(f).yoyo(g).onStart(s).onUpdate(function(u,y){r(u,y)}).onComplete(a);return i?.interpolationFunction&&p.interpolation(i.interpolationFunction),{tween:p,startAuto:u=>{p.start(u?.()),kr.register(()=>{const y=p.update(u?.());if(i?.precision){let x=!0;for(let b in t)Hr(t[b],e[b],i.precision)||(x=!1);return x?!1:y}return y})}}}static toTweenCSS(t,e,i,r){const s=lr(t);s?.parent().css({overflow:"hidden","transform-style":"preserve-3d",perspective:"1000px","backface-visibility":"hidden"});const a={_matrix:Bn(s?.css("transform")??"")},o=r?.onUpdate??(()=>{});return fn.toTween(e,i,Object.assign(r??{},{onUpdate:(l,c)=>{for(let f in l)fn.setCSSObjectTransformUseMatrix(f,l[f],a);t.style.transform=a.transform,o(l,c)}}))}static setCSSObjectTransformUseMatrix(t,e,i={}){switch(t){case"translate":i._matrix.translate(e[0]??0,e[1]??0);break;case"translateTo":i._matrix.translateTo(e[0]??0,e[1]??0);break;case"translateX":i._matrix.translateX(e??0);break;case"translateXTo":i._matrix.translateXTo(e??0);break;case"translateY":i._matrix.translateY(e??0);break;case"translateYTo":i._matrix.translateYTo(e??0);break;case"translateZ":i._matrix.translateZ(e??0);break;case"translateZTo":i._matrix.translateZTo(e??0);break;case"translate3d":i._matrix.translate3d(e[0]??0,e[1]??0,e[2]??0);break;case"translate3dTo":i._matrix.translate3dTo(e[0]??0,e[1]??0,e[2]??0);break;case"rotate":typeof e=="number"?i._matrix.rotate(e??0):i._matrix.rotate(e[0]??0,e[1]??0,e[2]??0);break;case"rotateTo":typeof e=="number"?i._matrix.rotateTo(e??0):i._matrix.rotateTo(e[0]??0,e[1]??0,e[2]??0);break;case"rotateX":i._matrix.rotateX(e??0);break;case"rotateXTo":i._matrix.rotateXTo(e??0);break;case"rotateY":i._matrix.rotateY(e??0);break;case"rotateYTo":i._matrix.rotateYTo(e??0);break;case"rotateZ":i._matrix.rotateZ(e??0);break;case"rotateZTo":i._matrix.rotateZTo(e??0);break;case"rotate3d":i._matrix.rotate3d(e[0]??0,e[1]??0,e[2]??0);break;case"rotate3dTo":i._matrix.rotate3dTo(e[0]??0,e[1]??0,e[2]??0);break;case"scale":typeof e=="number"?i._matrix.scale(e??1):i._matrix.scale(e[0]??1,e[1]??1,e[2]??0,e[3]??0);break;case"scaleTo":typeof e=="number"?i._matrix.scaleTo(e??1):i._matrix.scaleTo(e[0]??1,e[1]??1,e[2]??0,e[3]??0);break;case"scaleX":i._matrix.scaleX(e??1);break;case"scaleXTo":i._matrix.scaleXTo(e??1);break;case"scaleY":i._matrix.scaleY(e??1);break;case"scaleYTo":i._matrix.scaleYTo(e??1);break;case"scaleZ":i._matrix.scaleZ(e??1);break;case"scaleZTo":i._matrix.scaleZTo(e??1);break;case"scale3d":i._matrix.scale3d(e??1);break;case"scale3dTo":i._matrix.scale3dTo(e??1);break;case"skew":typeof e=="number"?i._matrix.skew(e??0):i._matrix.skew(e[0]??0,e[1]??0);break;case"skewTo":typeof e=="number"?i._matrix.skewTo(e??0):i._matrix.skewTo(e[0]??0,e[1]??0);break;case"skewX":i._matrix.skewX(e??0);break;case"skewXTo":i._matrix.skewXTo(e??1);break;case"skewY":i._matrix.skewY(e??0);break;case"skewYTo":i._matrix.skewYTo(e??1);break;case"skewZ":case"skewZTo":case"skew3d":case"skew3dTo":break;default:Object.assign(i,{[t]:`${e??""}`});break}return Object.assign(i,{transform:i._matrix.toString()}),i}_addAction(t,e=!1){return this.actions=e?[]:this.actions,Array.isArray(t)||(t=[t]),t.forEach(i=>{this.actions.push(Object.assign(i,{realKeyTimes:i.keyTimes.map(r=>i.dur*r)}))}),this}_addAnimate(t=sp,e=se,i=0,r=!1){const s=e.keyTimes??[0,1],a=[];return s.forEach((o,l)=>{l>0&&a.push(rc(e.easeName??"linear"))}),this._addAction({objectIndex:i,attributeName:t.attributeName,values:t.values,begin:e.begin??0,dur:e.dur??300,keyTimes:s,keySplines:a,repeatCount:e.repeatCount??1,direction:e.direction??"normal",fill:e.fill??"freeze"},r),this}_predefinedAnimate(t,e,i,r,s=se,a=this.objects.length-1){let o=!0,l=!1,c=!1,f=!1;const g=this.objects.length;a=(a+g)%g;const p=(a-1+g)%g,u=(a+1+g)%g,y=this.objects[a],x=this.objects[p],b=this.objects[u];if(x&&p!==a){const A=t(x);A&&(this._addAnimate(A,s,p,o),o=!1,l=!0)}if(y){const A=e(y);A&&(this._addAnimate(A,s,a,o),o=!1,c=!0)}if(b&&u!==a){const A=i(b);A&&(this._addAnimate(A,s,u,o),o=!1,f=!0)}this.objects.forEach((A,P)=>{if(!(P==p&&l||P==a&&c||P==u&&f)){const M=r(A);M&&(this._addAnimate(M,s,P,o),o=!1)}})}flip(t=se,e=this.objects.length-1){const i=e-1,r=this.objects[i],s=this.objects[e],a=Bn(s.dom?.css("transform")??""),o=a.clone();r.dom?.show(),r.dom?.css("opacity","1");const l=r.el?.getBoundingClientRect();r.dom?.css("opacity","0"),s.dom?.show(),s.dom?.css("opacity","1");const c=s.el?.getBoundingClientRect(),f=r.dom?.css("background-color"),g=s.dom?.css("background-color");o.translate((l?.left??0)-(c?.left??0),(l?.top??0)-(c?.top??0)),o.scale((l?.width??1)/(c?.width??1),(l?.height??1)/(c?.height??1));const p={transform:o.toString(),transition:""};f&&Object.assign(p,{"background-color":f}),s.dom?.css(p);const u={transform:a.toString(),transition:`all ${t.dur}ms cubic-bezier(${rc(t.easeName??"linear").join(",")})`};g&&Object.assign(u,{"background-color":g}),setTimeout(()=>{s.dom?.css(u)},t.begin)}slideLeft(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["translateTo"],values:[[[0,0],[-i.width,0]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[i.width,0],[0,0]]]}),i=>{},i=>({attributeName:["translateTo"],values:[[[-i.width,0],[-i.width,0]]]}),t,e)}slideRight(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>{},i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[-i.width,0],[0,0]]]}),i=>({attributeName:["translateTo"],values:[[[0,0],[i.width,0]]]}),i=>({attributeName:["translateTo"],values:[[[i.width,0],[i.width,0]]]}),t,e)}slideDown(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["translateTo"],values:[[[0,0],[0,i.height]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,-i.height],[0,0]]]}),i=>{},i=>({attributeName:["translateTo"],values:[[[0,i.height],[0,i.height]]]}),t,e)}slideUp(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["translateTo"],values:[[[0,0],[0,-i.height]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,i.height],[0,0]]]}),i=>{},i=>({attributeName:["translateTo"],values:[[[0,-i.height],[0,-i.height]]]}),t,e)}flipLeft(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,180]]}),i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[-180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}flipRight(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,-180]]}),i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}flipDown(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,-180]]}),i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}flipUp(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,180]]}),i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[-180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}popIn(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>{},i=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[.8,1],[0,1]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}popOut(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>{},i=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[1,1.2],[1,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}rotate(t=se,e=this.objects.length-1){Object.assign(t,{keyTimes:[0,1]});const i=t.degree??360;this._predefinedAnimate(r=>{},r=>({attributeName:["opacity","rotate"],values:[[1,1],[0,i]]}),r=>{},r=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}}class Kn extends Te{app;rotate;scale;isMouseDownInBounds=!1;removeCaptureMove;constructor(t,e){super({x:0,y:0,...e}),this.rotate=e?.rotate??0,this.scale=e?.scale??1,this.app=t,this.removeCaptureMove=this.app.captureMove({start:i=>{this.isMouseDownInBounds=this.app.ctx?.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y)||this.getBoundRect().isContainPoint(this.app.mousePoint)},end:i=>{this.isMouseDownInBounds=!1},move:i=>{}})}destroy(){this.removeCaptureMove()}draw(t){if(this.app.ctx){if(this.app.ctx.save(),t?.followMouseMove&&(!Hr(this.x,this.app.mousePoint.x,5)||!Hr(this.y,this.app.mousePoint.y,5))&&(this.rotate=this.angleTo(this.app.mousePoint),this.followTo(this.app.mousePoint)),t?.dragMouseMove){if(this.app.container.style.cursor="grab",this.isMouseDownInBounds){this.app.container.style.cursor="grabbing",this.x=this.app.mousePoint.x,this.y=this.app.mousePoint.y;const e=this.getBoundRect();e.width&&e.height&&!this.radius&&(this.x-=this.getBoundRect().width/2,this.y-=this.getBoundRect().height/2)}}else this.app.container.style.cursor="default";t?.dragFreeEaseTo&&(this.isMouseDownInBounds||this.nextFrameEaseTo(new Te({x:t.dragFreeEaseTo.targetX,y:t.dragFreeEaseTo.targetY}),{easing:t.dragFreeEaseTo?.easing??.05})),t?.extra?.(),this.app.ctx?.translate(this.x,this.y),this.app.ctx?.rotate(this.rotate),this.app.ctx?.scale(this.scale,this.scale),t?.shape(),this.app.ctx.lineWidth>0&&this.app.ctx.stroke(),this.app.ctx?.restore()}}}class op extends Kn{constructor(t,e){super(t,e)}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=2,this.app.ctx.fillStyle="#ffff00",t?.extra?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.moveTo(-50,-25),this.app.ctx.lineTo(0,-25),this.app.ctx.lineTo(0,-50),this.app.ctx.lineTo(50,0),this.app.ctx.lineTo(0,50),this.app.ctx.lineTo(0,25),this.app.ctx.lineTo(-50,25),this.app.ctx.lineTo(-50,-25),this.app.ctx.closePath(),this.app.ctx.fill())}})}}class lp extends Kn{radius;constructor(t,e){super(t,e),this.radius=e?.radius??40}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.fillStyle="#ff0000",t?.extra?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.arc(0,0,this.radius,0,Math.PI*2,!0),this.app.ctx.closePath(),this.app.ctx.fill())}})}}class cp extends Kn{toX;toY;c1x;c1y;c2x;c2y;constructor(t,e){super(t,e),this.toX=e?.toX??0,this.toY=e?.toY??0,this.c1x=e?.c1x??0,this.c1y=e?.c1y??0,this.c2x=e?.c2x??0,this.c2y=e?.c2y??0}getBoundRect(){if(this.rotate===0){const t=Math.min(this.x,this.toX),e=Math.min(this.y,this.toY),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return new Nn({x:t,y:e,width:i-t,height:r-e})}else{const t=Math.sin(this.rotate),e=Math.cos(this.rotate),i=e*this.x-t*this.y,r=e*this.toX-t*this.toY,s=e*this.y+t*this.x,a=e*this.toY+t*this.toX;return new Nn({x:Math.min(i,r),y:Math.min(s,a),width:Math.max(i,r)-Math.min(i,r),height:Math.max(s,a)-Math.min(s,a)})}}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.strokeStyle="#eeeeee",t?.extra?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.moveTo(0,0),this.app.ctx.lineTo(this.toX-this.x,this.toY-this.y))}})}drawQuadratic(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.strokeStyle="#eeeeee",t?.extra?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.moveTo(0,0),this.app.ctx.quadraticCurveTo(this.c1x-this.x,this.c1y-this.y,this.toX-this.x,this.toY-this.y))}})}drawQuadraticThrough(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.strokeStyle="#eeeeee",t?.extra?.())},shape:()=>{if(!this.app.ctx)return;this.app.ctx.beginPath(),this.app.ctx.moveTo(0,0);const e=this.c1x*2-(this.x+this.toX)/2,i=this.c1y*2-(this.y+this.toY)/2;this.app.ctx.quadraticCurveTo(e-this.x,i-this.y,this.toX-this.x,this.toY-this.y)}})}drawQuadraticThroughCurve(t,e){super.draw({...e,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.strokeStyle="#eeeeee",e?.extra?.())},shape:()=>{if(!this.app.ctx)return;const i=t.length;if(i<3)return new Error("points length must >= 3");const r=(t[0].x+t[i-1].x)/2,s=(t[0].y+t[i-1].y)/2;this.app.ctx.beginPath(),this.app.ctx.moveTo(r,s);let a=0;for(;a<i-1;a++){const o=(t[a].x+t[a+1].x)/2,l=(t[a].y+t[a+1].y)/2;this.app.ctx.quadraticCurveTo(t[a].x-this.x,t[a].y-this.y,o-this.x,l-this.y)}this.app.ctx.quadraticCurveTo(t[a].x-this.x,t[a].y-this.y,r-this.x,s-this.y)}})}drawQuadraticThroughCurveNotGood(t,e){super.draw({...e,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.strokeStyle="#eeeeee",e?.extra?.())},shape:()=>{if(!this.app.ctx)return;const i=t.length;if(i<3)return new Error("points length must >= 3");this.app.ctx.beginPath(),this.app.ctx.moveTo(t[0].x,t[0].y);let r=1;for(;r<i-2;r++){const s=(t[r].x+t[r+1].x)/2,a=(t[r].y+t[r+1].y)/2;this.app.ctx.quadraticCurveTo(t[r].x-this.x,t[r].y-this.y,s-this.x,a-this.y)}this.app.ctx.quadraticCurveTo(t[r].x-this.x,t[r].y-this.y,t[r+1].x-this.x,t[r+1].y-this.y)}})}}class hp extends Kn{width;height;borderRadius;rect;constructor(t,e){return super(t,e),this.width=e?.width??50,this.height=e?.height??50,this.borderRadius=e?.borderRadius??0,this.rect=new Nn({x:this.x,y:this.y,width:this.width,height:this.height}),new Proxy(this,{get:(r,s,a)=>Reflect.get(r,s,a),set:(r,s,a,o)=>{switch(s){case"x":case"y":case"width":case"height":this.rect[s]=a;break}return Reflect.set(r,s,a,o)}})}getBoundRect(){return this.rect}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.fillStyle="#ff0000",t?.extra?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.borderRadius<=0?this.app.ctx.rect(0,0,this.width,this.height):(this.app.ctx.moveTo(0,0+this.borderRadius),this.app.ctx.lineTo(0,0+this.height-this.borderRadius),this.app.ctx.quadraticCurveTo(0,0+this.height,0+this.borderRadius,0+this.height),this.app.ctx.lineTo(0+this.width-this.borderRadius,0+this.height),this.app.ctx.quadraticCurveTo(0+this.width,0+this.height,0+this.width,0+this.height-this.borderRadius),this.app.ctx.lineTo(0+this.width,0+this.borderRadius),this.app.ctx.quadraticCurveTo(0+this.width,0,0+this.width-this.borderRadius,0),this.app.ctx.lineTo(0+this.borderRadius,0),this.app.ctx.quadraticCurveTo(0,0,0,0+this.borderRadius)),this.app.ctx.closePath(),this.app.ctx.fill())}})}}class fp extends Kn{constructor(t,e){super(t,e)}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=0,this.app.ctx.fillStyle="rgb(200,80,80)",t?.extra?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.moveTo(4,24),this.app.ctx.lineTo(8,16),this.app.ctx.lineTo(14,10),this.app.ctx.lineTo(15,0),this.app.ctx.lineTo(9,-10),this.app.ctx.lineTo(2,0),this.app.ctx.lineTo(-2,0),this.app.ctx.lineTo(-9,-10),this.app.ctx.lineTo(-15,0),this.app.ctx.lineTo(-14,10),this.app.ctx.lineTo(-8,16),this.app.ctx.lineTo(-4,24),this.app.ctx.closePath(),this.app.ctx.fill())}})}}class up extends Kn{constructor(t,e){super(t,e)}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=0,this.app.ctx.fillStyle="rgb(150,150,150)",t?.extra?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.moveTo(0,0),this.app.ctx.bezierCurveTo(15,0,15,-40,5,-30),this.app.ctx.lineTo(0,0),this.app.ctx.bezierCurveTo(-15,0,-15,-40,-5,-30),this.app.ctx.lineTo(0,0),this.app.ctx.fill(),this.app.ctx.beginPath(),this.app.ctx.arc(0,0,15,0,Math.PI*2,!0),this.app.ctx.fill())}})}}class sc{x;y;z;brightness;constructor(t,e,i,r){this.x=t,this.y=e,this.z=i,this.brightness=r}setBrightness(t){this.brightness=Math.min(Math.max(t,0),1)}}class dp{x;y;width;height;rotation;showFlame;constructor(){this.x=0,this.y=0,this.width=25,this.height=20,this.rotation=0,this.showFlame=!1}draw(t,e){t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.lineWidth=1,t.strokeStyle="#ffffff",e?.(t),t.beginPath(),t.moveTo(10,0),t.lineTo(-10,10),t.lineTo(-5,0),t.lineTo(-10,-10),t.lineTo(10,0),t.closePath(),t.stroke(),this.showFlame&&(t.beginPath(),t.moveTo(-7.5,-5),t.lineTo(-15,0),t.lineTo(-7.5,5),t.closePath(),t.stroke()),t.restore()}}class pp{x;y;scaleX;scaleY;color;alpha;lineWidth;branch;constructor(){this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.color="#ffffff",this.alpha=1,this.lineWidth=1,this.branch=[],this.branch[0]=-140-Math.random()*20,this.branch[1]=-30-Math.random()*30,this.branch[2]=Math.random()*80-40,this.branch[3]=-100-Math.random()*40,this.branch[4]=-60-Math.random()*40,this.branch[5]=Math.random()*60-30,this.branch[6]=-110-Math.random()*20}draw(t,e){t.save(),t.translate(this.x,this.y),t.scale(this.scaleX,this.scaleY),t.lineWidth=this.lineWidth,t.strokeStyle=_s(this.color,this.alpha),e?.(t),t.beginPath(),t.moveTo(0,0),t.lineTo(0,this.branch[0]),t.moveTo(0,this.branch[1]),t.lineTo(this.branch[2],this.branch[3]),t.moveTo(0,this.branch[4]),t.lineTo(this.branch[5],this.branch[6]),t.stroke(),t.restore()}}class gp{x;y;z;fl;vpX;vpY;cX;cY;cZ;constructor(t,e,i){this.x=t,this.y=e,this.z=i,this.fl=250,this.vpX=0,this.vpY=0,this.cX=0,this.cY=0,this.cZ=0}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,i){this.cX=t,this.cY=e,this.cZ=i}rotateX(t){const e=Math.cos(t),i=Math.sin(t),r=this.y*e-this.z*i,s=this.z*e+this.y*i;this.y=r,this.z=s}rotateY(t){const e=Math.cos(t),i=Math.sin(t),r=this.x*e-this.z*i,s=this.z*e+this.x*i;this.x=r,this.z=s}rotateZ(t){const e=Math.cos(t),i=Math.sin(t),r=this.x*e-this.y*i,s=this.y*e+this.x*i;this.x=r,this.y=s}getScreenX(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}}class mp{pointA;pointB;pointC;color;lineWidth;alpha;constructor(t,e,i,r="#ff0000"){this.pointA=t,this.pointB=e,this.pointC=i,this.color=r,this.lineWidth=1,this.alpha=1}draw(t,e){this.isBackface()||(t.save(),t.lineWidth=this.lineWidth,t.fillStyle=t.strokeStyle=_s(this.color,this.alpha),e?.(t),t.beginPath(),t.moveTo(this.pointA.getScreenX(),this.pointA.getScreenY()),t.lineTo(this.pointB.getScreenX(),this.pointB.getScreenY()),t.lineTo(this.pointC.getScreenX(),this.pointC.getScreenY()),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore())}getDepth(){return Math.min(this.pointA.z,this.pointB.z,this.pointC.z)}isBackface(){const t=this.pointC.getScreenX()-this.pointA.getScreenX(),e=this.pointC.getScreenY()-this.pointA.getScreenY(),i=this.pointB.getScreenX()-this.pointC.getScreenX(),r=this.pointB.getScreenY()-this.pointC.getScreenY();return t*r>e*i}}class vp{pointA;pointB;pointC;color;lineWidth;alpha;light;constructor(t,e,i,r="#ff0000"){this.pointA=t,this.pointB=e,this.pointC=i,this.color=r,this.lineWidth=1,this.alpha=1,this.light=new sc(0,0,0,1)}draw(t,e){this.isBackface()||(t.save(),t.lineWidth=this.lineWidth,t.fillStyle=t.strokeStyle=this.getAdjustedColor(),e?.(t),t.beginPath(),t.moveTo(this.pointA.getScreenX(),this.pointA.getScreenY()),t.lineTo(this.pointB.getScreenX(),this.pointB.getScreenY()),t.lineTo(this.pointC.getScreenX(),this.pointC.getScreenY()),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore())}getDepth(){return Math.min(this.pointA.z,this.pointB.z,this.pointC.z)}isBackface(){const t=this.pointC.getScreenX()-this.pointA.getScreenX(),e=this.pointC.getScreenY()-this.pointA.getScreenY(),i=this.pointB.getScreenX()-this.pointC.getScreenX(),r=this.pointB.getScreenY()-this.pointC.getScreenY();return t*r>e*i}getAdjustedColor(){const t=cr(this.color);let e=t>>16,i=t>>8&255,r=t&255;const s=this.getLightFactor();return e*=s,i*=s,r*=s,vo(e<<16|i<<8|r)}getLightFactor(){const t={x:this.pointA.x-this.pointB.x,y:this.pointA.y-this.pointB.y,z:this.pointA.z-this.pointB.z},e={x:this.pointB.x-this.pointC.x,y:this.pointB.y-this.pointC.y,z:this.pointB.z-this.pointC.z},i={x:t.y*e.z-t.z*e.y,y:-(t.x*e.z-t.z*e.x),z:t.x*e.y-t.y*e.x},r=i.x*this.light.x+i.y*this.light.y+i.z*this.light.z,s=Math.sqrt(i.x*i.x+i.y*i.y+i.z*i.z),a=Math.sqrt(this.light.x*this.light.x+this.light.y*this.light.y+this.light.z*this.light.z);return Math.acos(r/(s*a))/Math.PI*this.light.brightness}}class _p{min;max;value;x;y;width;height;backColor;backBorderColor;backWidth;handleColor;handleBorderColor;handleHeight;handleY;onchange;prevCanvas;currentContext;animatedID=0;constructor(t=0,e=100,i=0,r){this.min=t,this.max=e,this.value=i,this.onchange=r,this.x=0,this.y=0,this.width=16,this.height=100,this.backColor="#cccccc",this.backBorderColor="#999999",this.backWidth=4,this.handleColor="#eeeeee",this.handleBorderColor="#cccccc",this.handleHeight=6,this.handleY=0,this.updatePosition()}draw(t,e){this.currentContext=t,t.save(),t.translate(this.x,this.y),e?.(t),t.clearRect(this.x,this.y,this.width,this.height),t.fillStyle=this.backColor,t.beginPath(),t.fillRect(this.width/2-this.backWidth/2,0,this.backWidth,this.height),t.closePath(),t.strokeStyle=this.handleBorderColor,t.fillStyle=this.handleColor,t.beginPath(),t.rect(0,this.handleY,this.width,this.handleHeight),t.closePath(),t.fill(),t.stroke(),t.restore(),(!this.prevCanvas||this.prevCanvas!=t.canvas)&&(this.captureMouse(t.canvas),this.prevCanvas=t.canvas)}updateValue(){const t=this.value,e=this.height-this.handleHeight,i=this.max-this.min;this.value=(e-this.handleY)/e*i+this.min,this.value!==t&&(this.onchange?.(this.value),kr.register(()=>this.currentContext?(this.draw(this.currentContext),!0):!1))}updatePosition(){const t=this.height-this.handleHeight,e=this.max-this.min;this.handleY=t-(this.value-this.min)/e*t}captureMouse(t){const e=new Nn({x:0,y:0,width:0,height:0}),i=()=>{e.x=this.x,e.y=this.y+this.handleY,e.width=this.width,e.height=this.handleHeight};i();let r=!1;const s=new mo(t);s.captureMove({move:()=>{if(r){const a=s.mousePoint.y-this.y;this.handleY=Math.min(this.height-this.handleHeight,Math.max(a,0)),this.updateValue()}},start:()=>{r=e.isContainPoint(s.mousePoint)},end:()=>{i()}})}}class wp{x;y;width;height;rotation;scaleX;scaleY;color;lineWidth;constructor(t,e,i="#ffffff"){this.x=0,this.y=0,this.width=t,this.height=e,this.rotation=0,this.scaleX=1,this.scaleY=1,this.color=i,this.lineWidth=1}draw(t,e){const i=this.height,r=this.width+i,s=i/2;t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.scale(this.scaleX,this.scaleY),t.lineWidth=this.lineWidth,t.fillStyle=this.color,e?.(t),t.beginPath(),t.moveTo(0,-s),t.lineTo(r-2*s,-s),t.quadraticCurveTo(-s+r,-s,-s+r,0),t.lineTo(-s+r,i-2*s),t.quadraticCurveTo(-s+r,-s+i,r-2*s,-s+i),t.lineTo(0,-s+i),t.quadraticCurveTo(-s,-s+i,-s,i-2*s),t.lineTo(-s,0),t.quadraticCurveTo(-s,-s,0,-s),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.beginPath(),t.arc(0,0,2,0,Math.PI*2,!0),t.closePath(),t.stroke(),t.beginPath(),t.arc(this.width,0,2,0,Math.PI*2,!0),t.closePath(),t.stroke(),t.restore()}getPin(){return{x:this.x+Math.cos(this.rotation)*this.width,y:this.y+Math.sin(this.rotation)*this.width}}}class yp{R;r;O;constructor(t,e,i){this.R=t,this.r=e,this.O=i}draw(t,e){t.save(),e?.(t);let i=this.R-this.O,r=0,s=1;t.beginPath(),t.moveTo(i,r);let a,o;do{if(s>2e4)break;a=(this.R+this.r)*Math.cos(s*Math.PI/72)-(this.r+this.O)*Math.cos((this.R+this.r)/this.r*(s*Math.PI/72)),o=(this.R+this.r)*Math.sin(s*Math.PI/72)-(this.r+this.O)*Math.sin((this.R+this.r)/this.r*(s*Math.PI/72)),t.lineTo(a,o),i=a,r=o,s++}while(a!=this.R-this.O&&o!=0);t.stroke(),t.restore()}}class xp{r;constructor(t){this.r=t}draw(t,e){t.save(),e?.(t),t.beginPath(),t.moveTo(this.r,0);for(let i=0;i<9;i++)t.rotate(Math.PI/5),i%2==0?t.lineTo(this.r/.525731*.200811,0):t.lineTo(this.r,0);t.closePath(),t.fill(),t.restore()}}class bp{startX;startY;width;height;constructor(t,e,i,r){this.startX=t,this.startY=e,this.width=i,this.height=r}draw(t,e){t.save(),e?.(t);let i=0;const r=()=>{t.clearRect(this.startX,this.startY,this.width,this.height),t.setLineDash([4,2]),t.lineDashOffset=-i,t.strokeRect(this.startX,this.startY,this.width,this.height)};function s(){i++,i>16&&(i=0),r(),setTimeout(s,40)}s(),t.restore()}}class Tp{constructor(){}draw(t,e){t.save(),e?.(t),t.beginPath(),t.arc(75,75,50,0,Math.PI*2,!0),t.moveTo(110,75),t.arc(75,75,35,0,Math.PI,!1),t.moveTo(65,65),t.arc(60,65,5,0,Math.PI*2,!0),t.moveTo(95,65),t.arc(90,65,5,0,Math.PI*2,!0),t.stroke(),t.restore()}}class Cp{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new _i(t),this.remoteVideoUtil=new _i(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(i=>{this.localVideoUtil.setSrcObject(i),t(i)}).catch(i=>{this.trace(`navigator.getUserMedia error: ${i}.`),e(i)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),i=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),i.length>0&&this.trace(`Using audio device: ${i[0].label}.`);const r=void 0,s=new RTCPeerConnection(r);this.localPeerConnection=s,this.trace("Created local peer connection object localPeerConnection."),s.addEventListener("icecandidate",this.handleConnection),s.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const a=new RTCPeerConnection(r);this.remotePeerConnection=a,this.trace("Created remote peer connection object remotePeerConnection."),a.addEventListener("icecandidate",this.handleConnection),a.addEventListener("iceconnectionstatechange",this.handleConnectionChange),a.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),s.addTrack(e[0],t),s.addTrack(i[0],t),this.trace("localPeerConnection createOffer start."),s.createOffer({offerToReceiveVideo:!0}).then(o=>this.createdOffer(o)).catch(o=>this.setSessionDescriptionError(o))}handleConnection(t){const e=t.target,i=t.candidate;if(e&&i){const r=new RTCIceCandidate(i),s=this.getOtherPeer(e);s&&(s.addIceCandidate(r).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
|
|
31
|
+
`+h.value+`\r
|
|
32
|
+
`)}n=a.join(r+`\r
|
|
33
|
+
`)}}return{url:i,data:n,boundary:r}}function Ta(s){return new Promise((t,e)=>{const{method:i="GET",url:n="",data:r="",headers:a={},responseType:o="json",timeout:h=3e4,boundary:c=""}=s;Object.assign(a,{Accept:"*/*"});const f=hi();f.onreadystatechange=function(p){f.readyState===4&&(f.status===200?t(f.response):e(f.statusText))},f.ontimeout=function(){e(`${n} is timed out for ${h}ms.`)},f.addEventListener("error",function(p){e(p)},!1),f.addEventListener("progress",function(p){if(p.lengthComputable){const y=Math.round(p.loaded*100/p.total);s.progress?.(y)}},!1),f.addEventListener("load",function(p){s.load?.(p)},!1),f.addEventListener("loadstart",function(p){s.loadstart?.(p)},!1),f.addEventListener("loadend",function(p){s.loadend?.(p)},!1),f.addEventListener("abort",function(p){s.abort?.(p)},!1),f.timeout=h,f.responseType=o;const m=i.toUpperCase();function w(){for(const p in a)f.setRequestHeader(p,a[p]);c&&f.setRequestHeader("Content-Type","multipart/form-data; boundary="+c)}if(m==="GET"){let p="";typeof r=="string"?p=r:r instanceof FormData?p=ri(r):ze(r)&&(p=ws(r)),f.open("GET",be(n,p),!0),w(),f.send(null)}else m==="POST"?(f.open("POST",n,!0),w(),c?f.sendAsBinary(c+`\r
|
|
34
|
+
`+r+c+`--\r
|
|
35
|
+
`):f.send(JSON.stringify(r))):(f.open(m,n,!0),w(),f.send(JSON.stringify(r)))})}function _a(s,t){const e=hi();e.open("HEAD",s),e.filepath=s,e.callback=t,e.onload=function(){const i=parseFloat(window.localStorage.getItem("lm_"+this.filepath)??""),n=Date.parse(this.getResponseHeader("Last-Modified"));(isNaN(i)||n>i)&&(window.localStorage.setItem("lm_"+this.filepath,String(Date.now())),isFinite(i)&&this.callback(n,i))},e.send()}let Te;const Ps=new WeakMap;function ci(s,t){let e=Ps.get(s);e||(e=new Map,Ps.set(s,e));let i=e.get(t);return i||(i=new Es,e.set(t,i)),i}class Es{subscribers;constructor(){this.subscribers=new Set}depend(){Te&&this.subscribers.add(Te)}notify(){this.subscribers.forEach(t=>t())}}function Sa(s){Te=s,s(),Te=null}function Pa(s){return Object.keys(s).forEach(t=>{let e=s[t];const i=ci(s,t);Object.defineProperty(s,t,{get(){return i.depend(),e},set(n){n!=e&&(e=n,i.notify())}})}),s}function Ea(s){return new Proxy(s,{get(t,e,i){return ci(s,e).depend(),Reflect.get(t,e,i)},set(t,e,i,n){const r=ci(s,e);return s[e]!=i&&(s[e]=i,r.notify()),Reflect.set(t,e,i,n)}})}const ks=[1,0,0,1,0,0],Is=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class Y{value;matrix3d;isEverTo3d=!1;_prev_translate_z=0;_prev_rotate=0;_prev_rotate_x=0;_prev_rotate_y=0;_prev_rotate_z=0;_prev_scale_z=1;constructor(t=ks){this.value=Array.from(t),this.matrix3d=this.toMatrix3D()}unit(){return this.value=Array.from(ks),this.matrix3d=this.toMatrix3D(),this}transformPoint(t,e,i=0,n=0){const r=t-i,a=e-n;return t=r*this.value[0]+a*this.value[2]+this.value[4],e=r*this.value[1]+a*this.value[3]+this.value[5],[t+i,e+n]}fromString(t){const e=Ai("number",t);return e.length===6?e.forEach((i,n)=>{i.fullMatch&&(this.value[n]=parseFloat(i.fullMatch))}):this.unit(),this}toMatrix3D(t=this.matrix3d){const e=[this.value[0],this.value[1],0,0,this.value[2],this.value[3],0,0,0,0,1,0,this.value[4],this.value[5],0,1];return t?(t.value=e,t):new Mt(e)}clone(){return new Y(this.value)}multiply(t){const e=this.value;let i;t instanceof Y?i=t.value:i=t;const n=e[0]*i[0]+e[2]*i[1],r=e[1]*i[0]+e[3]*i[1],a=e[0]*i[2]+e[2]*i[3],o=e[1]*i[2]+e[3]*i[3],h=e[0]*i[4]+e[2]*i[5]+e[4],c=e[1]*i[4]+e[3]*i[5]+e[5];return e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=h,e[5]=c,this}inverse(){const t=new Y(this.value),e=t.value,i=1/(e[0]*e[3]-e[1]*e[2]),n=e[3]*i,r=-e[1]*i,a=-e[2]*i,o=e[0]*i,h=i*(e[2]*e[5]-e[3]*e[4]),c=i*(e[1]*e[4]-e[0]*e[5]);return e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=h,e[5]=c,t}offset(t=0,e=0){return[t-this.value[4],e-this.value[5]]}translate(t,e){return this.matrix3d.translate(t,e,0),this.multiply([1,0,0,1,t,e])}translateTo(t,e){const i=this.offset(t,e);return this.translate(i[0],i[1])}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.value[5])}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.value[4],t)}translateZ(t){return this.isEverTo3d=!0,this.matrix3d.translate(0,0,t)}translateZTo(t){return this.translateZ(t-this._prev_translate_z),this._prev_translate_z=t,this}translate3d(t,e,i){return this.isEverTo3d=!0,this.matrix3d.translate(t,e,i)}translate3dTo(t,e,i){return this.translate3d(t-this.matrix3d.value[12],t-this.matrix3d.value[13],i-this._prev_translate_z),this._prev_translate_z=i,this}rotate(t,e=0,i=0){const n=Ke(t),r=+Math.cos(n).toFixed(9),a=+Math.sin(n).toFixed(9);return this.multiply([r,a,-a,r,e,i]),this.translate(-e,-i),this}rotateTo(t,e=0,i=0){return this.rotate(t-this._prev_rotate,e,i),this._prev_rotate=t,this}rotateX(t){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t)}rotateXTo(t){return this.rotateX(t-this._prev_rotate_x),this._prev_rotate_x=t,this}rotateY(t){return this.isEverTo3d=!0,this.matrix3d.rotate("y",t)}rotateYTo(t){return this.rotateY(t-this._prev_rotate_y),this._prev_rotate_y=t,this}rotateZ(t){return this.isEverTo3d=!0,this.matrix3d.rotate("z",t)}rotateZTo(t){return this.rotateZ(t-this._prev_rotate_z),this._prev_rotate_z=t,this}rotate3d(t,e,i){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t).rotate("y",e).rotate("z",i)}rotate3dTo(t,e,i){return this.rotate3d(t-this._prev_rotate_x,e-this._prev_rotate_y,i-this._prev_rotate_z),this._prev_rotate_x=t,this._prev_rotate_y=e,this._prev_rotate_z=i,this}scale(t,e=t,i=0,n=0){return this.matrix3d.scale(t,e,1),this.translate(i,n),this.multiply([t,0,0,e,0,0]),this.translate(-i,-n),this}scaleTo(t,e=t,i=0,n=0){return this.scale(t/this.value[0],e/this.value[3],i,n),this}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.value[0],1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.value[3])}scaleZ(t){return this.isEverTo3d=!0,this.matrix3d.scale(1,1,t)}scaleZTo(t){return this.scaleZ(t/this._prev_scale_z),this._prev_scale_z=t,this}scale3d(t,e,i){return this.isEverTo3d=!0,this.matrix3d.scale(t,e,i)}scale3dTo(t,e,i){return this.scale3d(t/this.matrix3d.value[0],e/this.matrix3d.value[5],i/this._prev_scale_z),this._prev_scale_z=i,this}skew(t,e=t){const i=t*Math.PI/180,n=e*Math.PI/180,r=Math.tan(i),a=Math.tan(n);return this.multiply([1,a,r,1,0,0])}skewTo(t,e=t){return this.skew(t-this.value[2],e-this.value[1])}skewX(t){return this.skew(t,this.value[1])}skewXTo(t){return this.skewTo(t,this.value[1])}skewY(t){return this.skew(this.value[2],t)}skewYTo(t){return this.skewTo(this.value[2],t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,i){return this}skew3dTo(t,e,i){return this}split(){const t={dx:0,dy:0,scalex:1,scaley:1,shear:1,rotate:0,isSimple:!0,isSuperSimple:!0,noRotation:!1};t.dx=this.value[4],t.dy=this.value[5];const e=[[this.value[0],this.value[2]],[this.value[1],this.value[3]]];t.scalex=Math.sqrt(Math.pow(e[0][0],2)+Math.pow(e[0][1],2));let i=ei(e[0][0],e[0][1]);e[0][0]=i.x,e[0][1]=i.y,t.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*t.shear,e[1][1]-e[0][1]*t.shear],t.scaley=Math.sqrt(Math.pow(e[1][0],2)+Math.pow(e[1][1],2)),i=ei(e[1][0],e[1][1]),e[1][0]=i.x,e[1][1]=i.y,t.shear/=t.scaley;const n=-e[0][1],r=e[1][1];return r<0?(t.rotate=Ht(Math.acos(r)),n<0&&(t.rotate=360-t.rotate)):t.rotate=Ht(Math.asin(n)),t.isSimple=!+t.shear.toFixed(9)&&(t.scalex.toFixed(9)==t.scaley.toFixed(9)||!t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t}static split2(t){const e=Math.atan2(t[1],t[0]),i=Math.pow(t[0],2)+Math.pow(t[1],2),n=Math.sqrt(i),r=(t[0]*t[3]-t[2]*t[1])/n;return{rotation:e/(Math.PI/180),scaleX:n,scaleY:r,x:t[4],y:t[5]}}static getGroupCoords(t,e){const i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],h=t[5],c=e[0],f=e[1],m=e[2],w=e[3],p=e[4],y=e[5],x=c*w,b=f*m,C=(m*n-i*w)/(b-x),_=(c*n-i*f)/(x-b),I=(m*a-r*w)/(b-x),E=(c*a-r*f)/(x-b),L=(m*(h-y)+w*(p-o))/(b-x),O=(c*(h-y)+f*(p-o))/(x-b),B=[C,_,I,E,L,O];return Y.split2(B)}toTransformString(){const t=this.split();return t.isSimple?(t.scalex=+t.scalex.toFixed(4),t.scaley=+t.scaley.toFixed(4),t.rotate=+t.rotate.toFixed(4),(t.dx&&t.dy?"t"+[t.dx,t.dy]:"")+(t.scalex!=1||t.scaley!=1?"s"+[t.scalex,t.scaley,0,0]:"")+(t.rotate?"r"+[t.rotate,0,0]:"")):"matrix"+[this.value[0],this.value[1],this.value[2],this.value[3],this.value[4],this.value[5]]}toString(){return this.isEverTo3d?this.toMatrix3DString():`matrix(${this.value.map(t=>Bi(t,6)).join(",")})`}toMatrix3DString(){return this.matrix3d.toString()}toFilter(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.value[0]+", M12="+this.value[2]+", M21="+this.value[1]+", M22="+this.value[3]+", Dx="+this.value[4]+", Dy="+this.value[5]+", sizingmethod='auto expand')"}}class Mt{value;constructor(t=Is){this.value=Array.from(t)}unit(){return this.value=Array.from(Is),this}fromString(t){const e=Ai("number",t);return e.length===16?e.forEach((i,n)=>{i.fullMatch&&(this.value[n]=parseFloat(i.fullMatch))}):this.unit(),this}toMatrix(t){const e=[this.value[0],this.value[1],this.value[4],this.value[5],this.value[12],this.value[13]];return t?(t.value=e,t):new Y(e)}multiplyMatrix(t){const e=this.value[0],i=this.value[1],n=this.value[2],r=this.value[3],a=this.value[4],o=this.value[5],h=this.value[6],c=this.value[7],f=this.value[8],m=this.value[9],w=this.value[10],p=this.value[11],y=this.value[12],x=this.value[13],b=this.value[14],C=this.value[15],_=t.value[0],I=t.value[1],E=t.value[2],L=t.value[3],O=_*e+I*a+E*f+L*y,B=_*i+I*o+E*m+L*x,H=_*n+I*h+E*w+L*b,z=_*r+I*c+E*p+L*C;return new Y([O,B,H,z,0,0])}multiply(t){const e=new Y([t.value[0],t.value[1],t.value[2],t.value[3],0,0]),i=new Y([t.value[4],t.value[5],t.value[6],t.value[7],0,0]),n=new Y([t.value[8],t.value[9],t.value[10],t.value[11],0,0]),r=new Y([t.value[12],t.value[13],t.value[14],t.value[15],0,0]),a=this.multiplyMatrix(e),o=this.multiplyMatrix(i),h=this.multiplyMatrix(n),c=this.multiplyMatrix(r);return this.value[0]=a.value[0],this.value[1]=a.value[1],this.value[2]=a.value[2],this.value[3]=a.value[3],this.value[4]=o.value[0],this.value[5]=o.value[1],this.value[6]=o.value[2],this.value[7]=o.value[3],this.value[8]=h.value[0],this.value[9]=h.value[1],this.value[10]=h.value[2],this.value[11]=h.value[3],this.value[12]=c.value[0],this.value[13]=c.value[1],this.value[14]=c.value[2],this.value[15]=c.value[3],this}translate(t=0,e=0,i=0){return this.multiply(new Mt([1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1]))}scale(t=1,e=1,i=1){return this.multiply(new Mt([t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1]))}rotate(t,e){const i=Ke(e),n=Math.sin,r=Math.cos;let a;switch(t){case"x":a=[1,0,0,0,0,r(i),n(i),0,0,-n(i),r(i),0,0,0,0,1];break;case"y":a=[r(i),0,-n(i),0,0,1,0,0,n(i),0,r(i),0,0,0,0,1];break;case"z":a=[r(i),n(i),0,0,-n(i),r(i),0,0,0,0,1,0,0,0,0,1];break}return this.multiply(new Mt(a))}toString(){return`matrix3d(${this.value.map(t=>Bi(t,6)).join(",")})`}}function te(s){const t=new Y;return s.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,i,n){n.indexOf(",")>=0?n=n.split(/\s*,\s*/):n=n.split(/\s+/);const r=[];for(let a=0,o=n.length;a<o;a++)n[a].trim()&&r.push(parseFloat(""+n[a]));switch(i.toLowerCase()){case"t":case"translate":t.translate(r[0],r[1]);break;case"translatex":t.translateX(r[0]);break;case"translatey":t.translateY(r[0]);break;case"translatez":t.translateZ(r[0]);break;case"translate3d":t.translate3d(r[0],r[1],r[2]);break;case"r":case"rotate":t.rotate(r[0],r[1]??0,r[2]??0);break;case"rotatex":t.rotateX(r[0]);break;case"rotatey":t.rotateY(r[0]);break;case"rotatez":t.rotateZ(r[0]);break;case"rotate3d":t.rotate3d(r[0],r[1],r[2]);break;case"s":case"scale":t.scale(r[0],r[1]??r[0]);break;case"scalex":t.scaleX(r[0]);break;case"scaley":t.scaleY(r[0]);break;case"scalez":t.scaleZ(r[0]);break;case"scale3d":t.scale3d(r[0],r[1],r[2]);break;case"skew":t.skew(r[0],r[1]??0);break;case"skewx":t.skewX(r[0]);break;case"skewy":t.skewY(r[0]);break;case"skewz":t.skewZ(r[0]);break;case"skew3d":t.skew3d(r[0],r[1],r[2]);break;case"m":case"matrix":t.multiply([r[0],r[1],r[2],r[3],r[4],r[5]]);break;case"matrix3d":t.matrix3d.multiply(new Mt(r));break}return""}),t}class _e{x;y;z;constructor(t=[0,0,0],e=[0,0,0]){const[i,n,r]=t,[a,o,h]=e;this.x=i-a,this.y=n-o,this.z=r-h}get length(){const{x:t,y:e,z:i}=this;return Math.sqrt(t*t+e*e+i*i)}unit(){const t=this.length;return new _e([this.x/t,this.y/t,this.z/t])}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){const e=this.x,i=this.y,n=this.z,r=t.x,a=t.y,o=t.z;return new _e([i*o-n*a,n*r-e*o,e*a-r*i])}}class Ms extends us{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,i)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,i)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const i=yn(e);for(let n of i.stylesheet.rules)for(let r of n.declarations)for(let a of n.selectors)this.globalStyles[a]=this.globalStyles[a]||[],this.globalStyles[a].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,i)=>{let n=this.groups.length;for(;n--;)if(this.groups[n]!=this.currentItem){let r="",a="";for(let o in this.groups[n])o=="transform"?r=this.groups[n].transform:o=="class"&&this.globalStyles["."+this.groups[n][o]]?a=this.globalStyles["."+this.groups[n][o]].join(";")+";"+a:o=="id"&&this.globalStyles["#"+this.groups[n][o]]?a=this.globalStyles["#"+this.groups[n][o]].join(";")+";"+a:typeof this.currentItem[o]>"u"&&(this.currentItem[o]=this.groups[n][o]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=a:this.currentItem.style=a+this.currentItem.style,this.currentItem.class&&this.globalStyles["."+this.currentItem.class]?this.currentItem.style=this.globalStyles["."+this.currentItem.class].join(";")+";"+this.currentItem.style:this.currentItem.id&&this.globalStyles["#"+this.currentItem.id]&&(this.currentItem.style=this.globalStyles["#"+this.currentItem.id].join(";")+";"+this.currentItem.style),ui(this.currentItem.style,this.currentItem,fi)}switch(this.processAttrs(e,i),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let i=[],n;switch(t){case"svg":let r="",a="";if(e.width&&e.height)r=e.width,a=e.height;else if(e.viewBox){const o=e.viewBox.split(/\s+/gi);o.length==4&&(r=String(parseFloat(o[2])-parseFloat(o[0])),a=String(parseFloat(o[3])-parseFloat(o[1])))}r&&a&&this.items.push({type:"viewbox",width:r,height:a});break;case"line":typeof e.x1=="number"&&typeof e.y1=="number"&&typeof e.x2=="number"&&typeof e.y2=="number"&&(this.currentItem.path="M"+[e.x1,e.y1,e.x2,e.y2]);break;case"stop":n={},e.style&&ui(e.style,n),n.offset=n.offset||e.offset,n.color=n["stop-color"]||e["stop-color"],n.opacity=n["stop-opacity"]||e["stop-opacity"],~(n.offset+"").indexOf("%")?n.offset=parseFloat(n.offset):n.offset=parseFloat(n.offset)*100,n.offset=+n.offset.toFixed(2),this.grad.stops.push(n);break;case"linearGradient":this.grad.angle=(360+li(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),i=[this.grad.angle];for(let o=0,h=this.grad.stops.length;o<h;o++)n=this.grad.stops[o],o&&o!=h-1?i.push(n.color+":"+n.offset):i.push(n.color);this.idtops[this.grad.id]=i.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break;case"radialGradient":i=[];for(let o=0,h=this.grad.stops.length;o<h;o++)n=this.grad.stops[o],o&&o!=h-1?i.push(n.color+":"+n.offset):i.push(n.color);this.idtops[this.grad.id]=i.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break}for(let r in e){const a=e[r];if(fi.includes(r)&&(this.currentItem[r]=a),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&ui(a,this.currentItem,fi),r==="transform"&&(this.currentItem.transform=a+(this.currentItem.transform||" ")),r==="fill"){const o=a.match(/url\(#([^)]+)\)/);if(o){const h=o[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+a+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=a),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=a)}}addToItems(){this.items.push(this.currentItem)}}function li(s,t,e,i,n,r){if(typeof n>"u"||typeof r>"u"){const a=s-e,o=t-i;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return li(s,t,n,r)-li(e,i,n,r)}function ui(s,t,e){const i=(s+"").split(";"),n=/^\s+|\s+$/g;for(let r=0,a=i.length;r<a;r++){let o=i[r].split(":"),h=o[0].replace(n,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=o[1].replace(n,""))}}const fi=["id","class","viewBox","width","height","x","y","cx","cy","r","rx","ry","cursor","opacity","src","fill","fill-opacity","stroke","stroke-dasharray","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","font","font-family","font-size","font-style","font-weight","letter-spacing"];class Et extends wt{fromX;fromY;constructor(t){super(t),this.fromX=t?.fromX||0,this.fromY=t?.fromY||0}static fromSVGPathData(t,e){if(t.length<3)throw new Error("Line 参数个数错误");if(t[0].toUpperCase()!=="L")throw new Error("Line command 错误");return new Et({x:t[1],y:t[2],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["L",this.x,this.y]}toCanvasContext(t){t.beginPath(),t.moveTo(this.fromX,this.fromY),t.lineTo(this.x,this.y)}getBoundingClientRect(){const t=qt(this.fromX,this.fromY,this.x,this.y);if(t===0){const e=Math.min(this.x,this.fromX),i=Math.min(this.y,this.fromY),n=Math.max(this.x,this.fromX),r=Math.max(this.y,this.fromY);return new ot({x:e,y:i,width:n-e,height:r-i})}else{const e=Math.sin(t),i=Math.cos(t),n=i*this.fromX-e*this.fromY,r=i*this.x-e*this.y,a=i*this.fromY+e*this.fromX,o=i*this.y+e*this.x;return new ot({x:Math.min(n,r),y:Math.min(a,o),width:Math.max(n,r)-Math.min(n,r),height:Math.max(a,o)-Math.min(a,o)})}}}class Ut extends Et{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}static fromSVGPathData(t,e){if(t.length<7)throw new Error("CubicBezier 参数个数错误");if(t[0].toUpperCase()!=="C")throw new Error("CubicBezier command 错误");return new Ut({c1x:t[1],c1y:t[2],c2x:t[3],c2y:t[4],x:t[5],y:t[6],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["C",this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y]}toCanvasContext(t){t.beginPath(),t.moveTo(this.fromX,this.fromY),t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y)}getBoundingClientRect(){const t=K.curveDim(this.fromX,this.fromY,this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y);return new ot({x:t.min.x,y:t.min.y,width:t.max.x-t.min.x,height:t.max.y-t.min.y})}base3(t,e,i,n,r){const a=-3*e+9*i-9*n+3*r,o=t*a+6*e-12*i+6*n;return t*o-3*e+3*i}length(t=1){t=Math.max(0,Math.min(t,1));const e=t/2,i=12,n=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],r=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let a=0;for(let o=0;o<i;o++){const h=e*n[o]+e,c=this.base3(h,this.fromX,this.c1x,this.c2x,this.x),f=this.base3(h,this.fromY,this.c1y,this.c2y,this.y),m=c*c+f*f;a+=r[o]*Math.sqrt(m)}return e*a}}class ee extends Et{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1}static fromSVGPathData(t,e){if(t.length<8)throw new Error("Arc 参数个数错误");if(t[0].toUpperCase()!=="A")throw new Error("Arc command 错误");return new ee({rx:t[1],ry:t[2],xAxisRotate:t[3],largeArcFlag:t[4],sweepFlag:t[5],x:t[6],y:t[7],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.x,this.y]}}class ie{prevPoint;startPoint;isClosed=!1;lines=[];normalizedLines=[];constructor(){}setStartPoint(t,e){return this.startPoint=new Jt({x:t,y:e}),this.prevPoint=this.startPoint,this}addLine(t){return this.lines.push(t),this}static fromSVGPathD(t,e){if(!K.isSVGPath(t))throw new Error("Not an SVG path!");return this.fromSVGPathData(K.parseSVGPath(t),e)}static fromSVGPathData(t,e){const i=new ie,n=K.normalizeSVGPath(K.absolutizeSVGPath(t));for(let a=0,o=n.length;a<o;a++){const h=n[a],c=h[0];if(a==0&&c=="M"){i.setStartPoint(h[1],h[2]);continue}if(a==o-1&&c=="Z"){i.isClosed=!0;continue}i.addLine(new Ut({c1x:h[1],c1y:h[2],c2x:h[3],c2y:h[4],x:h[5],y:h[6]}))}i.normalize();const r=te(e??"");return i.transform(r)}normalize(){this.normalizedLines=[];const t=K.normalizeSVGPath(K.absolutizeSVGPath(this.lines.map(e=>e.toSVGPathData())));for(let e=0,i=t.length;e<i;e++){const n=t[e];this.normalizedLines.push(Ut.fromSVGPathData(n,this.prevPoint)),this.prevPoint=new Jt({x:n[n.length-2],y:n[n.length-1]})}return this}toSVGPathData(){const t=[];this.startPoint&&t.push(this.startPoint.toSVGPathData());for(let e=0,i=this.normalizedLines.length;e<i;e++)t.push(this.normalizedLines[e].toSVGPathData());return this.isClosed&&t.push(["Z"]),t}toSVGPathD(){return K.SVGPathDataToD(this.toSVGPathData())}transform(t){if(this.startPoint){const[e,i]=t.transformPoint(this.startPoint.x,this.startPoint.y);this.setStartPoint(e,i)}return this.normalizedLines=this.normalizedLines.map(e=>{const[i,...n]=e.toSVGPathData(),r=[i];for(let a=0,o=n.length;a<o;a+=2){const[h,c]=t.transformPoint(n[a],n[a+1]);r.push(h,c)}return Ut.fromSVGPathData(r)}),this}translate(t,e){const i=new Y().translate(t,e);return this.transform(i)}rotate(t,e=0,i=0){const n=new Y().rotate(t,e,i);return this.transform(n)}scale(t,e=t,i=0,n=0){const r=new Y().scale(t,e,i,n);return this.transform(r)}skew(t,e=0){const i=new Y().skew(t,e);return this.transform(i)}trim(){const t=this.getBoundingClientRect();return this.translate(-t.x,-t.y),this}toCanvasContext(t){this.normalizedLines.length&&(this.startPoint&&(t.beginPath(),t.moveTo(this.startPoint.x,this.startPoint.y)),this.normalizedLines.forEach(e=>{const[i,...n]=e.toSVGPathData();t.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5])}),this.isClosed&&t.closePath())}getBoundingClientRect(){let t=0,e=0,i=[],n=[];this.startPoint&&(t=this.startPoint.x,e=this.startPoint.y,i.push(t),n.push(e)),this.normalizedLines.forEach(c=>{const f=K.curveDim(t,e,c.c1x,c.c1y,c.c2x,c.c2y,c.x,c.y);i=i.concat(f.min.x,f.max.x),n=n.concat(f.min.y,f.max.y),t=c.x,e=c.y});const r=Math.min.apply(0,i),a=Math.min.apply(0,n),o=Math.max.apply(0,i),h=Math.max.apply(0,n);return new ot({x:r,y:a,width:o-r,height:h-a})}getTotalLength(){return Di?K.createSvgPath(this.toSVGPathD()).getTotalLength():K.getWalkSVGPathD(this.toSVGPathD()).length()}getPointAtLength(t){if(Di)return K.createSvgPath(this.toSVGPathD()).getPointAtLength(t);{const e=K.getWalkSVGPathD(this.toSVGPathD()),[i,n]=e.at(t);return{x:i,y:n}}}isPointInPath(t,e,i){return t.isPointInPath(new Path2D(this.toSVGPathD()),e,i)}isPointInStroke(t,e,i){return t.isPointInStroke(new Path2D(this.toSVGPathD()),e,i)}static generateRosetta(t,e,i,n,r){if(r==0)throw new Error("no dividing by zero, please");const a=new ie;a.setStartPoint(t,e);const o=360/r;for(let h=0;h<r;h+=1){const c=o*h*Math.PI/180,f=t+2*i*Math.cos(c),m=e+2*i*Math.sin(c);a.addLine(new ee({x:f,y:m,rx:i,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1})),a.addLine(new ee({x:t,y:e,rx:i,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1}))}return a.normalize(),a}}class di extends wt{svgWidth=0;svgHeight=0;width=0;height=0;pgas=[];history=[];save(){this.history.push(Ve(this.pgas))}restore(){const t=this.history.pop();t&&(this.pgas=t)}current(){return Ve(this.pgas)}constructor(t){super(t),this.width=t.width;const e=new Ms(t.svg).parse();for(let i=0,n=e.length;i<n;i++){const r=e[i];if(r.type=="viewbox"&&r.width&&r.height){this.svgWidth=parseFloat(r.width),this.svgHeight=parseFloat(r.height);const h=this.svgWidth/this.svgHeight;this.height=this.width/h;continue}if(r.type!="path")continue;const a={};for(const h in r)h==="type"||h==="path"||h==="transform"||(a[h]=r[h]);const o=ie.fromSVGPathD(r.path,r.transform);this.width&&this.svgWidth&&o.scale(this.width/this.svgWidth),this.pgas.push({pg:o,attrs:a})}}getBoundingClientRect(){return new ot({x:this.x,y:this.y,width:this.width,height:this.height})}toSVGPathData(){return this.pgas.map(t=>t.pg.toSVGPathData()).reduce((t,e)=>t.concat(e),[])}toCanvasContext(t){for(let e=0,i=this.pgas.length;e<i;e++){t.save();const n=this.pgas[e];this.SVGAttrsToCanvasAttrs(t,n.attrs),n.pg.toCanvasContext(t),n.attrs.stroke!=="none"&&t.stroke(),n.attrs.fill!=="none"&&t.fill(),t.restore()}}SVGAttrsToCanvasAttrs(t,e){for(const i in e){const n=e[i];switch(i){case"fill":t.fillStyle=n;break;case"stroke":t.strokeStyle=n;break;case"stroke-width":t.lineWidth=Number(n);break;case"stroke-linecap":t.lineCap=n;break;case"stroke-linejoin":t.lineJoin=n;break}}}}class ka extends wt{rx;ry;constructor(t){super(t),this.XYIsShapeCenter=!0,this.rx=t?.rx||0,this.ry=t?.ry||0}getBoundingClientRect(){return new ot({x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2})}toSVGPathData(){return[["M",this.x,this.y],["m",0,-this.ry],["a",this.rx,this.ry,0,1,1,0,2*this.ry],["a",this.rx,this.ry,0,1,1,0,-2*this.ry],["z"]]}toCanvasContext(t){t.beginPath(),t.ellipse(this.x,this.y,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class mi extends wt{points;constructor(t=[]){if(!t.length)throw new Error("points can't be null");super(t[0]),this.points=t}toSVGPathData(){const t=[];for(let e=0,i=this.length;e<i;e++)t.push([e===0?"M":"L",this.points[e].x,this.points[e].y]);return t}toCanvasContext(t){const e=this.points.length;if(e<3)throw new Error("points length must >= 3");t.beginPath();const i=(this.points[0].x+this.points[e-1].x)/2,n=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(i,n);let r=0;for(;r<e-1;r++){const a=(this.points[r].x+this.points[r+1].x)/2,o=(this.points[r].y+this.points[r+1].y)/2;t.quadraticCurveTo(this.points[r].x-this.x,this.points[r].y-this.y,a-this.x,o-this.y)}t.quadraticCurveTo(this.points[r].x-this.x,this.points[r].y-this.y,i-this.x,n-this.y)}get length(){return this.points.length}addPoint(t){this.points.push(t)}getPoint(t){return this.points[t]}isContainPoint(t,e){const i=this.length;let n=!1;const r=2e-10;for(let a=0,o=i-1;a<i;o=a,a++){const h=this.points[a].x,c=this.points[a].y,f=this.points[o].x,m=this.points[o].y;if(h===t&&c===e||f===t&&m===e||e===c&&e===m)return!0;if(e>=c&&e<m||e<c&&e>=m){const w=(f-h)/(m-c),p=h+w*(e-c);if(p===t||Math.abs(p-t)<r)return!0;p>t&&(n=!n)}}return n}[Symbol.iterator](){let t=0;return{next:()=>({value:t>=this.length-1?this.points[++t]:void 0,done:t>=this.length})}}static generateInMultiplePoint(t,e,i,n,r=1){const a=new mi;for(let o=0;o<=r*i;o+=1){const h=Math.floor(o/r)/i*2*Math.PI,c=t+Math.cos(h)*n,f=e+Math.sin(h)*n;a.addPoint(new Jt({x:c,y:f}))}return a}}class gi extends Et{cx;cy;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy}static fromSVGPathData(t,e){if(t.length<5)throw new Error("QuadraticBezier 参数个数错误");if(t[0].toUpperCase()!=="Q")throw new Error("QuadraticBezier command 错误");return new gi({cx:t[1],cy:t[2],x:t[3],y:t[4],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["Q",this.cx,this.cy,this.x,this.y]}toCanvasContext(t,e){const i=typeof e?.isLineThrough=="boolean"?e?.isLineThrough:!0;if(t.beginPath(),t.moveTo(this.fromX,this.fromY),i){const n=this.cx*2-(this.fromX+this.x)/2,r=this.cy*2-(this.fromY+this.y)/2;t.quadraticCurveTo(n,r,this.x,this.y)}else t.quadraticCurveTo(this.cx,this.cy,this.x,this.y)}}class Ia extends wt{constructor(t){super(t)}toSVGPathData(){return[["M",this.x,this.y],["m",-50,-25],["l",0,-25],["l",0,-50],["l",50,0],["l",0,50],["l",0,25],["l",-50,25],["l",-50,-25],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(-50,-25),t.lineTo(0,-25),t.lineTo(0,-50),t.lineTo(50,0),t.lineTo(0,50),t.lineTo(0,25),t.lineTo(-50,25),t.lineTo(-50,-25),t.closePath()}}class Ma extends wt{constructor(t){super(t)}toSVGPathData(){return[["M",this.x,this.y],["m",4,24],["l",8,16],["l",14,10],["l",15,0],["l",9,-10],["l",2,0],["l",-2,0],["l",-9,-10],["l",-15,0],["l",-14,10],["l",-8,16],["l",-4,24],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(4,24),t.lineTo(8,16),t.lineTo(14,10),t.lineTo(15,0),t.lineTo(9,-10),t.lineTo(2,0),t.lineTo(-2,0),t.lineTo(-9,-10),t.lineTo(-15,0),t.lineTo(-14,10),t.lineTo(-8,16),t.lineTo(-4,24),t.closePath()}}(function(){let s=0;window.requestAnimationFrame||(window.requestAnimationFrame=function(t){const e=new Date().getTime(),i=Math.max(0,16-(e-s)),n=window.setTimeout(function(){t(e+i)},i);return s=e+i,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})})();const Ds=s=>{let t=window.requestAnimationFrame(function e(i){t=window.requestAnimationFrame(e),s(i,t)});return()=>window.cancelAnimationFrame(t)};class Da{id=0;renders={};cancelFn;constructor(){}get length(){let t=0;for(let e in this.renders)t++;return t}register(t){const e=this.id++;this.renders[e]=t,this.run()}registerAccurateSetTimeout(t,e=0){let i;this.register(n=>(i||(i=n),n-i>=e?(t(),!1):!0))}run(){this.cancelFn||(this.cancelFn=Ds((t,e)=>{const i=[];for(let n in this.renders)this.renders[n](t)===!1&&i.push(parseInt(n));for(let n of i)delete this.renders[n];!this.length&&this.cancelFn&&(this.cancelFn(),this.cancelFn=void 0)}))}}const Dt=new Da;let se;typeof self>"u"&&typeof process<"u"&&process.hrtime?se=function(){const s=process.hrtime();return s[0]*1e3+s[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?se=self.performance.now.bind(self.performance):Date.now!==void 0?se=Date.now:se=function(){return new Date().getTime()};const zt=se;class ne{static _nextId=0;static nextId(){return ne._nextId++}}const Se={Linear:{None:function(s){return s}},Ease:{In:function(s){return Math.pow(s,1.7)}},Quadratic:{In:function(s){return s*s},Out:function(s){return s*(2-s)},InOut:function(s){return(s*=2)<1?.5*s*s:-.5*(--s*(s-2)-1)}},Cubic:{In:function(s){return s*s*s},Out:function(s){return--s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s:.5*((s-=2)*s*s+2)}},Quartic:{In:function(s){return s*s*s*s},Out:function(s){return 1- --s*s*s*s},InOut:function(s){return(s*=2)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2)}},Quintic:{In:function(s){return s*s*s*s*s},Out:function(s){return--s*s*s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2)}},Sinusoidal:{In:function(s){return 1-Math.sin((1-s)*Math.PI/2)},Out:function(s){return Math.sin(s*Math.PI/2)},InOut:function(s){return .5*(1-Math.sin(Math.PI*(.5-s)))}},Exponential:{In:function(s){return s===0?0:Math.pow(1024,s-1)},Out:function(s){return s===1?1:1-Math.pow(2,-10*s)},InOut:function(s){return s===0?0:s===1?1:(s*=2)<1?.5*Math.pow(1024,s-1):.5*(-Math.pow(2,-10*(s-1))+2)}},Circular:{In:function(s){return 1-Math.sqrt(1-s*s)},Out:function(s){return Math.sqrt(1- --s*s)},InOut:function(s){return(s*=2)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1)}},Elastic:{In:function(s){return s===0?0:s===1?1:-Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI)},Out:function(s){return s===0?0:s===1?1:Math.pow(2,-10*s)*Math.sin((s-.1)*5*Math.PI)+1},InOut:function(s){return s===0?0:s===1?1:(s*=2,s<1?-.5*Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI):.5*Math.pow(2,-10*(s-1))*Math.sin((s-1.1)*5*Math.PI)+1)}},Back:{In:function(s){return s===1?1:s*s*((1.70158+1)*s-1.70158)},Out:function(s){return s===0?0:--s*s*((1.70158+1)*s+1.70158)+1},InOut:function(s){const t=2.5949095;return(s*=2)<1?.5*(s*s*((t+1)*s-t)):.5*((s-=2)*s*((t+1)*s+t)+2)}},Bounce:{In:function(s){return 1-Se.Bounce.Out(1-s)},Out:function(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},InOut:function(s){return s<.5?Se.Bounce.In(s*2)*.5:Se.Bounce.Out(s*2-1)*.5+.5}},generatePow:function(s=4){return s=s<Number.EPSILON?Number.EPSILON:s,s=s>1e4?1e4:s,{In:function(t){return t**s},Out:function(t){return 1-(1-t)**s},InOut:function(t){return t<.5?(t*2)**s/2:(1-(2-t*2)**s)/2+.5}}},random:function(s){return Math.random()},createStep:function(s){return function(t){return Math.floor(t*s)/s}},createNoisyEasing:function(s,t=.1){const e=1-t;return function(i){return t*Math.random()+e*s(i)}}},pi=Se,re={Utils:{Linear:function(s,t,e){return(t-s)*e+s},Factorial:function(){const s=[1];return function(t){let e=1;if(s[t])return s[t];for(let i=t;i>1;i--)e*=i;return s[t]=e,e}}(),Bernstein:function(s,t){const e=re.Utils.Factorial;return e(s)/e(t)/e(s-t)},CatmullRom:function(s,t,e,i,n){const r=(e-s)*.5,a=(i-t)*.5,o=n*n,h=n*o;return(2*t-2*e+r+a)*h+(-3*t+3*e-2*r-a)*o+r*n+t}},Linear:function(s,t){const e=s.length-1,i=e*t,n=Math.floor(i),r=re.Utils.Linear;return t<0?r(s[0],s[1],i):t>1?r(s[e],s[e-1],e-i):r(s[n],s[n+1>e?e:n+1],i-n)},Bezier:function(s,t){let e=0;const i=s.length-1,n=Math.pow,r=re.Utils.Bernstein;for(let a=0;a<=i;a++)e+=n(1-t,i-a)*n(t,a)*s[a]*r(i,a);return e},CatmullRom:function(s,t){const e=s.length-1;let i=e*t,n=Math.floor(i);const r=re.Utils.CatmullRom;return s[0]===s[e]?(t<0&&(n=Math.floor(i=e*(1+t))),r(s[(n-1+e)%e],s[n],s[(n+1)%e],s[(n+2)%e],i-n)):t<0?s[0]-(r(s[0],s[0],s[1],s[1],-i)-s[0]):t>1?s[e]-(r(s[e],s[e],s[e-1],s[e-1],i-e)-s[e]):r(s[n?n-1:0],s[n],s[e<n+1?e:n+1],s[e<n+2?e:n+2],i-n)}},wi=re;class As{_tweens={};_tweensAddedDuringUpdate={};getAll(){return Object.keys(this._tweens).map(t=>this._tweens[t])}removeAll(){this._tweens={}}add(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t}remove(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]}update(t=zt(),e=!1){let i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(let n=0;n<i.length;n++){const r=this._tweens[i[n]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[i[n]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0}}const st=new As;class Ls{constructor(t,e=st){this._object=t,this._group=e}_id=ne.nextId();_isPlaying=!1;_startTime=0;_delayTime=0;_durationTime=1e3;_isPaused=!1;_pauseStartTime=0;_initialRepeat=0;_repeat=0;_repeatDelayTime;_yoyo=!1;_reversed=!1;_valuesStart={};_valuesEnd={};_valuesStartRepeat={};_easingFunction=pi.Linear.None;_interpolationFunction=wi.Linear;_chainedTweens=[];_isChainStopped=!1;_onStartCallback;_onStartCallbackFired=!1;_onEveryStartCallback;_onEveryStartCallbackFired=!1;_onUpdateCallback;_onRepeatCallback;_onCompleteCallback;_onStopCallback;_goToEnd=!1;getId(){return this._id}isPlaying(){return this._isPlaying}isPaused(){return this._isPaused}to(t,e){return this._valuesEnd=Object.create(t),e!==void 0&&(this._durationTime=e),this}duration(t=1e3){return this._durationTime=t,this}start(t=zt()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,i,n){for(const r in i){const a=t[r],o=Array.isArray(a),h=o?"array":typeof a,c=!o&&Array.isArray(i[r]);if(!(h==="undefined"||h==="function")){if(c){let f=i[r];if(f.length===0)continue;f=f.map(this._handleRelativeValue.bind(this,a)),i[r]=[a].concat(f)}if((h==="object"||o)&&a&&!c){e[r]=o?[]:{};for(const f in a)e[r][f]=a[f];n[r]=o?[]:{},this._setupProperties(a,e[r],i[r],n[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),c?n[r]=i[r].slice().reverse():n[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=zt()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=zt()){return!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStartTime,this._pauseStartTime=0,this._group&&this._group.add(this),this)}stopChainedTweens(){for(let t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this}group(t=st){return this._group=t,this}delay(t=0){return this._delayTime=t,this}repeat(t=0){return this._initialRepeat=t,this._repeat=t,this}repeatDelay(t){return this._repeatDelayTime=t,this}yoyo(t=!1){return this._yoyo=t,this}easing(t=pi.Linear.None){return this._easingFunction=t,this}interpolation(t=wi.Linear){return this._interpolationFunction=t,this}chain(...t){return this._chainedTweens=t,this}onStart(t){return this._onStartCallback=t,this}onEveryStart(t){return this._onEveryStartCallback=t,this}onUpdate(t){return this._onUpdateCallback=t,this}onRepeat(t){return this._onRepeatCallback=t,this}onComplete(t){return this._onCompleteCallback=t,this}onStop(t){return this._onStopCallback=t,this}update(t=zt(),e=!0){if(this._isPaused)return!0;let i,n;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),n=(t-this._startTime)/this._durationTime,n=this._durationTime===0||n>1?1:n;const a=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),n===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let o=0,h=this._chainedTweens.length;o<h;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,i,n){for(const r in i){if(e[r]===void 0)continue;const a=e[r]||0;let o=i[r];const h=Array.isArray(t[r]),c=Array.isArray(o);!h&&c?t[r]=this._interpolationFunction(o,n):typeof o=="object"&&o?this._updateProperties(t[r],a,o,n):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*n))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=i,this._valuesEnd[t]=e}}const Aa=ne.nextId,La=st.getAll.bind(st),Ra=st.removeAll.bind(st),Oa=st.add.bind(st),Na=st.remove.bind(st),Fa=st.update.bind(st),Pe={now:zt,Sequence:ne,Easing:pi,Interpolation:wi,Group:As,Tween:Ls,nextId:Aa,getAll:La,removeAll:Ra,add:Oa,remove:Na,update:Fa};function Rs(s){switch(s){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}const Ga={attributeName:["display"],values:[["block","block"]]},Q={easeName:"linear",begin:0,dur:300,repeatCount:1,direction:"normal",fill:"freeze",keyTimes:[0,1]};class vt{currentPredefinedAnimateName;currentPredefinedAnimateArgs;objects=[];currentObjects=[];isRunning=!1;constructor(){}destroy(){}hasObjects(){return this.objects.length>0}fromDOM(t){return Array.isArray(t)||(t=[t]),this.objects=[],t.forEach(e=>{this.objects.push({width:parseFloat(A.getStyle(e,"width")),height:parseFloat(A.getStyle(e,"height")),el:e,originCSSObject:{}})}),this}static isRunningGlobalTween=!1;static runGlobalTween(t){vt.isRunningGlobalTween||Dt.register(()=>(vt.isRunningGlobalTween=Pe.update(t?.()),vt.isRunningGlobalTween))}static toTween(t,e,i){const n=i?.onUpdate??(()=>{}),r=i?.onStart??(()=>{}),a=i?.onComplete??(()=>{}),o=i?.duration??1e3,h=i?.delay??0,c=i?.easeFunction??Pe.Easing.Linear.None,f=i?.repeat??0,m=i?.yoyo??!1,w=new Pe.Tween(t).to(e,o).delay(h).easing(c).repeat(f).yoyo(m).onStart(r).onUpdate(function(p,y){n(p,y)}).onComplete(a);return i?.interpolationFunction&&w.interpolation(i.interpolationFunction),{tween:w,startAuto:p=>{w.start(p?.()),Dt.register(()=>{const y=w.update(p?.());if(i?.precision){let x=!0;for(let b in t)Wt(t[b],e[b],i.precision)||(x=!1);return x?!1:y}return y})}}}static toTweenCSS(t,e,i,n){const r={_matrix:te(A.getStyle(t,"transform")??"")},a=n?.onUpdate??(()=>{});return vt.toTween(e,i,Object.assign(n??{},{onUpdate:(o,h)=>{for(let c in o)vt.setCSSObjectTransformUseMatrix(c,o[c],r);t.style.transform=r.transform,a(o,h)}}))}static setCSSObjectTransformUseMatrix(t,e,i={},n){switch(t){case"translate":i._matrix.translate(e[0]??0,e[1]??0);break;case"translateTo":i._matrix.translateTo(e[0]??0,e[1]??0);break;case"translateX":i._matrix.translateX(e??0);break;case"translateXTo":i._matrix.translateXTo(e??0);break;case"translateY":i._matrix.translateY(e??0);break;case"translateYTo":i._matrix.translateYTo(e??0);break;case"translateZ":i._matrix.translateZ(e??0);break;case"translateZTo":i._matrix.translateZTo(e??0);break;case"translate3d":i._matrix.translate3d(e[0]??0,e[1]??0,e[2]??0);break;case"translate3dTo":i._matrix.translate3dTo(e[0]??0,e[1]??0,e[2]??0);break;case"rotate":typeof e=="number"?i._matrix.rotate(e??0):i._matrix.rotate(e[0]??0,e[1]??0,e[2]??0);break;case"rotateTo":typeof e=="number"?i._matrix.rotateTo(e??0):i._matrix.rotateTo(e[0]??0,e[1]??0,e[2]??0);break;case"rotateX":i._matrix.rotateX(e??0);break;case"rotateXTo":i._matrix.rotateXTo(e??0);break;case"rotateY":i._matrix.rotateY(e??0);break;case"rotateYTo":i._matrix.rotateYTo(e??0);break;case"rotateZ":i._matrix.rotateZ(e??0);break;case"rotateZTo":i._matrix.rotateZTo(e??0);break;case"rotate3d":i._matrix.rotate3d(e[0]??0,e[1]??0,e[2]??0);break;case"rotate3dTo":i._matrix.rotate3dTo(e[0]??0,e[1]??0,e[2]??0);break;case"scale":typeof e=="number"?i._matrix.scale(e??1):i._matrix.scale(e[0]??1,e[1]??1,e[2]??0,e[3]??0);break;case"scaleTo":typeof e=="number"?i._matrix.scaleTo(e??1):i._matrix.scaleTo(e[0]??1,e[1]??1,e[2]??0,e[3]??0);break;case"scaleX":i._matrix.scaleX(e??1);break;case"scaleXTo":i._matrix.scaleXTo(e??1);break;case"scaleY":i._matrix.scaleY(e??1);break;case"scaleYTo":i._matrix.scaleYTo(e??1);break;case"scaleZ":i._matrix.scaleZ(e??1);break;case"scaleZTo":i._matrix.scaleZTo(e??1);break;case"scale3d":i._matrix.scale3d(e??1);break;case"scale3dTo":i._matrix.scale3dTo(e??1);break;case"skew":typeof e=="number"?i._matrix.skew(e??0):i._matrix.skew(e[0]??0,e[1]??0);break;case"skewTo":typeof e=="number"?i._matrix.skewTo(e??0):i._matrix.skewTo(e[0]??0,e[1]??0);break;case"skewX":i._matrix.skewX(e??0);break;case"skewXTo":i._matrix.skewXTo(e??1);break;case"skewY":i._matrix.skewY(e??0);break;case"skewYTo":i._matrix.skewYTo(e??1);break;case"skewZ":case"skewZTo":case"skew3d":case"skew3dTo":break;default:n&&!Object.prototype.hasOwnProperty.call(n.originCSSObject,t)&&(n.originCSSObject[t]=A.getStyle(n.el,t)),Object.assign(i,{[t]:`${e??""}`});break}return Object.assign(i,{transform:i._matrix.toString()}),i}_addCurrentObject(t=Ga,e=Q,i=0,n,r=!1){const a=e.keyTimes??[0,1],o=[];a.forEach((c,f)=>{f>0&&o.push(Rs(e.easeName??"linear"))});const h=e.dur??300;return this.currentObjects=r?[]:this.currentObjects,this.currentObjects.push({objectIndex:i,sequenceType:n,attributeName:t.attributeName,values:t.values,immediate:t.immediate||!1,begin:e.begin??0,dur:h,keyTimes:a,realKeyTimes:a.map(c=>h*c),keySplines:o,repeatCount:e.repeatCount??1,direction:e.direction??"normal",fill:e.fill??"freeze",onComplete:e.onComplete}),this}_resetGroupCurrentObjects(t,e,i,n,r=Q,a=this.objects.length-1){let o=!0,h=!1,c=!1,f=!1;const m=this.objects.length-1;a=Xe(a,0,m);let w=a-1;w=Xe(w,0,m);let p=a+1;p=Xe(p,0,m);const y=this.objects[a],x=this.objects[w],b=this.objects[p];if(x&&w!==a){const C=t(x);C&&(this._addCurrentObject(C,r,w,"prev",o),o=!1,h=!0)}if(y){const C=e(y);C&&(this._addCurrentObject(C,r,a,"current",o),o=!1,c=!0)}if(b&&p!==a){const C=i(b);C&&(this._addCurrentObject(C,r,p,"next",o),o=!1,f=!0)}this.objects.forEach((C,_)=>{if(!(_==w&&h||_==a&&c||_==p&&f)){const I=n(C);I&&(this._addCurrentObject(I,r,_,"other",o),o=!1)}})}toCSS(t,...e){if(!this.hasObjects()||this.isRunning)return;switch(this.currentPredefinedAnimateName=t,this.currentPredefinedAnimateArgs=e,this[t](...e),this.objects[0].el&&this.objects[0].el.parentElement&&(this.objects[0].el.parentElement.style.position=A.getStyle(this.objects[0].el.parentElement,"transform")||"relative",this.objects[0].el.parentElement.style.perspective=A.getStyle(this.objects[0].el.parentElement,"perspective")||"1000px"),t){default:this.objects.forEach((r,a)=>{A.setStyle(r.el,Object.assign(r?.originCSSObject??{},{position:"absolute","z-index":String(2e3+a),"transform-style":"preserve-3d","backface-visibility":"hidden"}))});break}let i=0;const n=()=>{this.isRunning=!0,this.currentObjects.forEach((r,a)=>{const o=this.objects[r.objectIndex];let h=[],c=[];Array.isArray(r.attributeName)?(h=r.attributeName,c=r.values):r.attributeName&&(h=[r.attributeName],c=[r.values]);const f=r.keyTimes.length;let m=r.begin;r.keyTimes.forEach((w,p)=>{if(p==0||r.immediate){const y={_matrix:te("")};h.forEach((x,b)=>{const C=c[b][r.direction=="reverse"?f-1-p:p];vt.setCSSObjectTransformUseMatrix(x,C,y,o)}),A.setStyle(o.el,Object.assign(y,{transition:"all 0ms!important"}))}else Dt.registerAccurateSetTimeout(((y,x,b)=>()=>{const C={_matrix:te("")};h.forEach((_,I)=>{const E=c[I][x.direction=="reverse"?f-1-y:y];vt.setCSSObjectTransformUseMatrix(_,E,C,b)}),A.setStyle(b.el,Object.assign(C,{transition:`all ${x.realKeyTimes[y]}ms cubic-bezier(${x.keySplines[y-1].join(",")})`}))})(p,r,o),m+1),m+=r.realKeyTimes[p]}),Dt.registerAccurateSetTimeout(((w,p)=>()=>{w.fill==="remove"&&A.setStyle(o.el,o.originCSSObject??{}),p==this.currentObjects.length-1&&(w.onComplete?.(),this.isRunning=!1,(typeof w.repeatCount=="number"&&++i<w.repeatCount||w.repeatCount=="infinite")&&requestAnimationFrame(()=>{this.currentPredefinedAnimateName===t&&n()}))})(r,a),r.begin+r.dur)})};n()}slideLeft(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[-i.width,0]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[i.width,0],[0,0]]]}),i=>{},i=>({attributeName:["opacity","translateTo"],values:[[0,0],[[i.width,0],[i.width,0]]],immediate:!0}),t,e)}slideRight(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>{},i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[-i.width,0],[0,0]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[i.width,0]]]}),i=>({attributeName:["opacity","translateTo"],values:[[0,0],[[-i.width,0],[-i.width,0]]],immediate:!0}),t,e)}slideDown(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[0,i.height]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,-i.height],[0,0]]]}),i=>{},i=>({attributeName:["opacity","translateTo"],values:[[0,0],[[0,-i.height],[0,-i.height]]],immediate:!0}),t,e)}slideUp(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[0,-i.height]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,i.height],[0,0]]]}),i=>{},i=>({attributeName:["opacity","translateTo"],values:[[0,0],[[0,i.height],[0,i.height]]],immediate:!0}),t,e)}flipLeft(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,180]]}),i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[-180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipRight(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,-180]]}),i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipDown(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,-180]]}),i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipUp(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,180]]}),i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[-180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}popIn(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>{},i=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[.8,1],[0,1]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}popOut(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>{},i=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[1,1.2],[1,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}rotate(t=Q,e=this.objects.length-1){Object.assign(t,{keyTimes:[0,1]});const i=t.degree??360;this._resetGroupCurrentObjects(n=>{},n=>({attributeName:["opacity","rotate"],values:[[1,1],[0,i]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}static flipCSS(t,e,i=Q){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),a=A.getStyle(t,"backgroundColor"),o=A.getStyle(e,"backgroundColor");e.style.transition="none",e.style.left=""+n.left,e.style.top=""+n.top,e.style.width=n.width+"px",e.style.height=n.height+"px",a&&(e.style.backgroundColor=a),Dt.registerAccurateSetTimeout(()=>{e.style.transition=`all ${i.dur}ms cubic-bezier(${Rs(i.easeName??"linear").join(",")})`,e.style.left=""+r.left,e.style.top=""+r.top,e.style.width=r.width+"px",e.style.height=r.height+"px",o&&(e.style.backgroundColor=o)},i.begin)}}const Os=Ba("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);function Ba(s,t=10){const e={},i=s.split(",");for(let n=0;n<i.length;n+=2){const r="&"+i[n+1]+";",a=parseInt(i[n],t);e[r]="&#"+a+";"}return e["\\xa0"]=" ",e}function $(s,t){const e=Object.keys(t);for(let i=0;i<e.length;i++)s=s.replace(new RegExp("{"+e[i]+"}","gi"),""+t[e[i]]);return s}function Ee(s){let t,e;if(!s)throw new Error("cannot create a random attribute name for an undefined object");const i="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=i[Math.floor(Math.random()*i.length)];while(s[t]);return t}function Ua(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function za(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const ae={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}};class ke{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const i=this.__ctx.__createElement("stop");if(i.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(i.setAttribute("stop-color",$("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),i.setAttribute("stop-opacity",r[4]))}else i.setAttribute("stop-color",e);this.__root.appendChild(i)}}class yi{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class oe{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:i=500,enableMirroring:n=!1}){this.enableMirroring=n,t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=i),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(ae);for(let e=0,i=t.length;e<i;e++){const n=t[e];this[n]=ae[n].canvas}}__getStyleState(){const t={},e=Object.keys(ae);for(let i=0,n=e.length;i<n;i++){const r=e[i];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let i=0,n=e.length;i<n;i++){const r=e[i];this[r]=t[r]}}__createElement(t,e={},i=!1){const n=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);i&&(n.setAttribute("fill","none"),n.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];n.setAttribute(o,e[o])}return n}__applyStyleToCurrentElement(t){let e=this.__currentElement;const i=this.__currentElementsToStyle;i&&(e.setAttribute(t,""),e=i.element,i.children.forEach(r=>{r.setAttribute(t,"")}));const n=Object.keys(ae);for(let r=0;r<n.length;r++){const a=ae[n[r]],o=this[n[r]];if(a.apply){if(o instanceof yi){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const h=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,$("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof ke)e.setAttribute(a.apply,$("url(#{id})",{id:o.__root.getAttribute("id")}));else if(a.apply.indexOf(t)!==-1&&a.svg!==o)if((a.svgAttr==="stroke"||a.svgAttr==="fill")&&o.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);e.setAttribute(a.svgAttr,$("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let f=parseFloat(c[4]);const m=this.globalAlpha;m!=null&&(f*=m),e.setAttribute(a.svgAttr+"-opacity",""+f)}else{let h=a.svgAttr;if(n[r]==="globalAlpha"&&(h=t+"-"+a.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,o)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const n=Object.keys(Os);for(let r=0,a=n.length;r<a;r++){const o=n[r],h=Os[o],c=new RegExp(o,"gi");c.test(e)&&(e=e.replace(c,h))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const n=this.__createElement("g");e.appendChild(n),this.__currentElement=n}let i=this.__currentElement.getAttribute("transform");i?i+=" ":i="",i+=t,this.__currentElement.setAttribute("transform",i)}scale(t,e){e===void 0&&(e=t),this.__addTransform($("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform($("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform($("translate({x},{y})",{x:t,y:e}))}transform(t,e,i,n,r,a){this.__addTransform($("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:i,d:n,e:r,f:a}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand($("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand($("L {x} {y}",this.__currentPosition)):this.__addPathCommand($("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,i,n,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand($("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:i,cp2y:n,x:r,y:a}))}quadraticCurveTo(t,e,i,n){this.__currentPosition={x:i,y:n},this.__addPathCommand($("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:i,y:n}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,i,n,r){const a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(typeof a>"u"||typeof o>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(a===t&&o===e||t===i&&e===n||r===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),c=this.normalize([i-t,n-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const f=h[0]*c[0]+h[1]*c[1],m=Math.acos(Math.abs(f)),w=this.normalize([h[0]+c[0],h[1]+c[1]]),p=r/Math.sin(m/2),y=t+p*w[0],x=e+p*w[1],b=[-h[1],h[0]],C=[c[1],-c[0]],_=function(L){const O=L[0];return L[1]>=0?Math.acos(O):-Math.acos(O)},I=_(b),E=_(C);this.lineTo(y+b[0]*r,x+b[1]*r),this.arc(y,x,r,I,E)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,i,n){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+n),this.lineTo(t,e+n),this.lineTo(t,e),this.closePath()}fillRect(t,e,i,n){const r=this.__createElement("rect",{x:t,y:e,width:i,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,i,n){const r=this.__createElement("rect",{x:t,y:e,width:i,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),i=this.__rootSVG.childNodes[1],n=i.childNodes;for(let r=n.length-1;r>=0;r--)n[r]&&i.removeChild(n[r]);this.__currentElement=i,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,i,n){if(t===0&&e===0&&i===this.width&&n===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:i,height:n,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,i,n){const r=this.__createElement("linearGradient",{id:Ee(this.__ids),x1:t+"px",x2:i+"px",y1:e+"px",y2:n+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new ke(r,this)}createRadialGradient(t,e,i,n,r,a){const o=this.__createElement("radialGradient",{id:Ee(this.__ids),cx:n+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new ke(o,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),i={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(i.decoration="underline"),this.__fontHref&&(i.href=this.__fontHref),i}__wrapTextLink(t,e){if(t.href){const i=this.__createElement("a");return i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),i.appendChild(e),i}return e}__applyText(t,e,i,n){const r=this.__parseFont(),a=this.__closestGroupOrSvg(),o=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:i,"text-anchor":Ua(this.textAlign),"dominant-baseline":za(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(n),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,i){this.__applyText(t,e,i,"fill")}strokeText(t,e,i){this.__applyText(t,e,i,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,i,n,r,a){if(n===r)return;n=n%(2*Math.PI),r=r%(2*Math.PI),n===r&&(r=(r+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+i*Math.cos(r),h=e+i*Math.sin(r),c=t+i*Math.cos(n),f=e+i*Math.sin(n),m=a?0:1;let w=0,p=r-n;p<0&&(p+=2*Math.PI),a?w=p>Math.PI?0:1:w=p>Math.PI?1:0,this.lineTo(c,f),this.__addPathCommand($("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:w,sweepFlag:m,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),i=Ee(this.__ids),n=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",i),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",$("url(#{id})",{id:i})),t.appendChild(n),this.__currentElement=n}drawImage(...t){let e=t[0],i,n,r,a,o=0,h=0,c,f,m,w,p,y,x,b;if(t.length===3)i=t[1],n=t[2],c=e.width,f=e.height,r=c,a=f;else if(t.length===5)i=t[1],n=t[2],r=t[3],a=t[4],c=e.width,f=e.height;else if(t.length===9)o=t[1],h=t[2],c=t[3],f=t[4],i=t[5],n=t[6],r=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const C=this.__closestGroupOrSvg();this.__currentElement;const _="translate("+i+", "+n+")";if(e instanceof oe){if(m=e.getSvg().cloneNode(!0),m.childNodes&&m.childNodes.length>1){for(w=m.childNodes[0];w.childNodes.length;)b=w.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(w.childNodes[0]);if(p=m.childNodes[1],p){const I=p.getAttribute("transform");let E;I?E=I+" "+_:E=_,p.setAttribute("transform",E),C.appendChild(p)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(y=this.__createElement("image"),y.setAttribute("width",r),y.setAttribute("height",a),y.setAttribute("preserveAspectRatio","none"),(o||h||c!==e.width||f!==e.height)&&(x=this.__document.createElement("canvas"),x.width=r,x.height=a,x.getContext("2d")?.drawImage(e,o,h,c,f,0,0,r,a),e=x),y.setAttribute("transform",_),y.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),C.appendChild(y))}createPattern(t,e){const i=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),n=Ee(this.__ids);let r;return i.setAttribute("id",n),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),i.appendChild(r),this.__SVGdefs.appendChild(i)):t instanceof oe&&(i.setAttribute("width",""+t.width),i.setAttribute("height",""+t.height),i.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(i)),new yi(i,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class Ns{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;matrixs=[];hasSetCustomLineWidth=!1;hasSetCustomFillStyle=!1;constructor(t){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),this.customContext=new oe({canvas:this.canvas,width:this.canvas.width,height:this.canvas.height})}set lineWidth(t){this.hasSetCustomLineWidth=!0,this.context.lineWidth=t,this.customContext.lineWidth=t}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.context.lineCap=t,this.customContext.lineCap=t}get lineCap(){return this.context.lineCap}set lineJoin(t){this.context.lineJoin=t,this.customContext.lineCap=t}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.context.lineDashOffset=t,this.customContext.lineDashOffset=t}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.context.miterLimit=t,this.customContext.miterLimit=t}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext.globalAlpha=t}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext.fillStyle=t):(this.context.fillStyle=t.gradient,this.customContext.fillStyle=t.gradientCustom)}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext.strokeStyle=t):(this.context.strokeStyle=t.gradient,this.customContext.strokeStyle=t.gradientCustom)}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext.font=t}get font(){return this.context.font}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext.fill()),this}fillRect(t,e,i,n){return this.context.fillRect(t,e,i,n),this.customContext.fillRect(t,e,i,n),this}fillText(t,e,i,n){return this.context.fillText(t,e,i,n),this.customContext.fillText(t,e,i),this}setLineDash(t){return this.context.setLineDash(t),this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext.stroke()),this}strokeText(t,e,i,n){return this.context.strokeText(t,e,i,n),this.customContext.strokeText(t,e,i),this}strokeRect(t,e,i,n){return this.context.strokeRect(t,e,i,n),this.customContext.strokeRect(t,e,i,n),this}clearRect(t=0,e=0,i=this.canvas.width,n=this.canvas.height){return this.context.clearRect(t,e,i,n),this.customContext.clearRect(t,e,i,n),this}save(){return this.context.save(),this.customContext.save(),this.path2Ds.push(this.currentPath2D),this.matrixs.push(this.currentMatrix),this.currentPath2D=new Path2D,this.currentMatrix=new DOMMatrix,this}restore(){return this.context.restore(),this.customContext.restore(),this.hasSetCustomLineWidth=!1,this.hasSetCustomFillStyle=!1,this.currentPath2D=this.path2Ds.pop()||new Path2D,this.currentMatrix=this.matrixs.pop()||new DOMMatrix,this}beginPath(){return this.context.beginPath(),this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext.closePath(),this.currentPath2D.closePath(),this}addPath(t=this.currentPath2D,e=this.currentMatrix){const i=new Path2D;i.addPath(t,e),this.currentPath2D=i}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.addPath(),this}rotate(t){return this.context.rotate(t),this.customContext.rotate(t),this.currentMatrix.rotate(t),this.addPath(),this}scale(t,e=t){return this.context.scale(t,e),this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.addPath(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,i,n,r,a){return this.context.arc(t,e,i,n,r,a),this.customContext.arc(t,e,i,n,r,a?-1:1),this.currentPath2D.arc(t,e,i,n,r,a),this}arcTo(t,e,i,n,r){return this.context.arcTo(t,e,i,n,r),this.customContext.arcTo(t,e,i,n,r),this.currentPath2D.arcTo(t,e,i,n,r),this}ellipse(t,e,i,n,r,a,o,h){return this.context.ellipse(t,e,i,n,r,a,o,h),this.currentPath2D.ellipse(t,e,i,n,r,a,o,h),this}quadraticCurveTo(t,e,i,n){return this.context.quadraticCurveTo(t,e,i,n),this.customContext.quadraticCurveTo(t,e,i,n),this.currentPath2D.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,r,a){return this.context.bezierCurveTo(t,e,i,n,r,a),this.customContext.bezierCurveTo(t,e,i,n,r,a),this.currentPath2D.bezierCurveTo(t,e,i,n,r,a),this}rect(t,e,i,n){return this.context.rect(t,e,i,n),this.customContext.rect(t,e,i,n),this.currentPath2D.rect(t,e,i,n),this}createLinearGradient(t,e,i,n,r){const a=this.context.createLinearGradient(t,e,i,n),o=this.customContext.createLinearGradient(t,e,i,n);return r&&Object.keys(r).forEach(h=>{const c=parseFloat(h);a.addColorStop(c,r[c]),o.addColorStop(c,r[c])}),{gradient:a,gradientCustom:o}}createRadialGradient(t,e,i,n,r,a,o){const h=this.context.createRadialGradient(t,e,i,n,r,a),c=this.customContext.createRadialGradient(t,e,i,n,r,a);return o&&Object.keys(o).forEach(f=>{const m=parseFloat(f);h.addColorStop(m,o[m]),c.addColorStop(m,o[m])}),{gradient:h,gradientCustom:c}}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const i=e[0],n=e[1];this.context.drawImage(t,i,n)}else if(e.length===4){const i=e[0],n=e[1],r=e[2],a=e[3];this.context.drawImage(t,i,n,r,a)}else if(e.length===8){const i=e[0],n=e[1],r=e[2],a=e[3],o=e[4],h=e[5],c=e[6],f=e[7];this.context.drawImage(t,i,n,r,a,o,h,c,f)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,i=this.canvas.width,n=this.canvas.height,r){return this.context.getImageData(t,e,i,n,r)}putImageData(t,e=0,i=0){return this.context.putImageData(t,e,i)}toRawSVG(){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}}class Va{app;ctx;shapes=[];isMouseDown=!1;draggingShapeID="";removes=[];constructor(t){this.app=t,this.ctx=new Ns(this.app.container),this.app.captureMove({start:()=>{this.isMouseDown=!0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.draggingShapeID="",this.setCursor()},move:()=>{this.setCursor()}})}setCursor(){this.draggingShapeID?this.app.container.style.cursor="grabbing":this.shapes.filter(t=>t.shape.isMouseInShape&&t.dragMouseMove).length?this.app.container.style.cursor="grab":this.app.container.style.cursor="default"}flushShapes(t=[]){return this.shapes=[],gn(t)?this.shapes.push(...t):this.shapes.push(t),this}draw(){return this.removes.forEach(t=>t()),this.shapes.forEach(t=>{if(this.ctx.save(),t.followMouseMove&&(!Wt(t.shape.x,this.app.mousePoint.x,5)||!Wt(t.shape.y,this.app.mousePoint.y,5))&&(t.shape.angleTo(this.app.mousePoint),t.shape.followTo(this.app.mousePoint)),t.dragFreeEaseTo&&(this.isMouseDown||t.shape.nextFrameEaseTo(new Jt({x:t.dragFreeEaseTo.targetX,y:t.dragFreeEaseTo.targetY}),{easing:t.dragFreeEaseTo?.easing??.05})),t.clickInPath&&t.shape instanceof di){const e=()=>{if(!(t.shape instanceof di))return;const i=t.shape.pgas.findIndex(n=>n.pg.isPointInPath(this.ctx,this.app.mousePoint.x,this.app.mousePoint.y));i>=0&&t.clickInPath?.(i)};this.app.on("tap",e),this.removes.push(()=>{this.app.off("tap",e)})}if(t.extra?.(this.ctx),t.shape instanceof Et||this.ctx.translate(t.shape.x,t.shape.y),this.ctx.rotate(t.shape.rotate),this.ctx.scale(t.shape.scale,t.shape.scale),t.shape.toCanvasContext(this.ctx,{isLineThrough:t.isLineThrough}),t.shape.path2d=this.ctx.currentPath2D,t.shape.isMouseInShape=t.shape.getBoundingClientRect()?.isContainPoint(this.app.mousePoint.x,this.app.mousePoint.y)||this.ctx.isPointInPath(t.shape.path2d,this.app.mousePoint.x,this.app.mousePoint.y)||!1,this.ctx.hasSetCustomLineWidth&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill(),t.dragMouseMove&&!this.draggingShapeID&&this.isMouseDown&&t.shape.isMouseInShape&&(this.draggingShapeID=t.shape.id,t.shape.isDragging=!0,this.shapes.filter(e=>e.shape.id!=t.shape.id).forEach(e=>e.shape.isDragging=!1)),this.draggingShapeID==t.shape.id){t.shape.x=this.app.mousePoint.x,t.shape.y=this.app.mousePoint.y;const e=t.shape.getBoundingClientRect();e&&e.width&&e.height&&!t.shape.XYIsShapeCenter&&(t.shape.x-=e.width/2,t.shape.y-=e.height/2),t.shape instanceof Et||this.ctx.translate(t.shape.x,t.shape.y),t.shape.path2d=this.ctx.currentPath2D}this.ctx.restore()}),this}drawMouseMoveLine(t="line",e){switch(t){case"brush":const i=(e&&e.brushSize)??10,n=(e&&e.brushDensity)??50,r=(e&&e.brushColor)??"#000000",a=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),o=a.data,h=ve(r);return this.app.captureMove({move:()=>{if(this.isMouseDown){for(let c=0;c<n;c++){const f=Math.random()*Math.PI*2,m=Math.random()*i,w=this.app.mousePoint.x+Math.cos(f)*m|0,p=this.app.mousePoint.y+Math.sin(f)*m|0,y=(w+p*a.width)*4;o[y]=h>>16&255,o[y+1]=h>>8&255,o[y+2]=h&255,o[y+3]=255}this.ctx.putImageData(a)}}});case"line":default:return this.app.captureMove({start:c=>{this.ctx.beginPath(),this.app.setMousePoint(c),this.ctx.moveTo(this.app.mousePoint.x,this.app.mousePoint.y)},end:()=>{this.ctx.closePath()},move:()=>{this.isMouseDown&&(this.ctx.lineTo(this.app.mousePoint.x,this.app.mousePoint.y),this.ctx.stroke())}})}}}class Fs extends _t{app;rotate;scale;isMouseDownInBounds=!1;removeCaptureMove;constructor(t,e){super({x:0,y:0,...e}),this.rotate=e?.rotate??0,this.scale=e?.scale??1,this.app=t,this.removeCaptureMove=this.app.captureMove({start:i=>{this.isMouseDownInBounds=this.app.ctx?.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y)||this.getBoundingClientRect().isContainPoint(this.app.mousePoint.x,this.app.mousePoint.y)},end:i=>{this.isMouseDownInBounds=!1},move:i=>{}})}destroy(){this.removeCaptureMove()}draw(t){if(this.app.ctx){if(this.app.ctx.save(),t?.followMouseMove&&(!Wt(this.x,this.app.mousePoint.x,5)||!Wt(this.y,this.app.mousePoint.y,5))&&(this.rotate=this.angleTo(this.app.mousePoint),this.followTo(this.app.mousePoint)),t?.dragMouseMove){if(this.app.container.style.cursor="grab",this.isMouseDownInBounds){this.app.container.style.cursor="grabbing",this.x=this.app.mousePoint.x,this.y=this.app.mousePoint.y;const e=this.getBoundingClientRect();e.width&&e.height&&!this.radius&&(this.x-=this.getBoundingClientRect().width/2,this.y-=this.getBoundingClientRect().height/2)}}else this.app.container.style.cursor="default";t?.dragFreeEaseTo&&(this.isMouseDownInBounds||this.nextFrameEaseTo(new _t({x:t.dragFreeEaseTo.targetX,y:t.dragFreeEaseTo.targetY}),{easing:t.dragFreeEaseTo?.easing??.05})),t?.extra?.(),this.app.ctx?.translate(this.x,this.y),this.app.ctx?.rotate(this.rotate),this.app.ctx?.scale(this.scale,this.scale),t?.shape(),this.app.ctx.lineWidth>0&&this.app.ctx.stroke(),this.app.ctx?.restore()}}}class Xa extends Fs{constructor(t,e){super(t,e)}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=0,this.app.ctx.fillStyle="rgb(150,150,150)",t?.extra?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.moveTo(0,0),this.app.ctx.bezierCurveTo(15,0,15,-40,5,-30),this.app.ctx.lineTo(0,0),this.app.ctx.bezierCurveTo(-15,0,-15,-40,-5,-30),this.app.ctx.lineTo(0,0),this.app.ctx.fill(),this.app.ctx.beginPath(),this.app.ctx.arc(0,0,15,0,Math.PI*2,!0),this.app.ctx.fill())}})}}class Wa extends Fs{width;height;fillColor;constructor(t,e){super(t,e),this.width=e?.width??50,this.height=e?.height??50,this.fillColor=e?.fillColor??"#ff0000"}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=0,this.app.ctx.fillStyle=this.fillColor,t?.extra?.())},shape:()=>{if(!this.app.ctx)return;this.app.ctx.beginPath();let e=this.height*.3;this.app.ctx.moveTo(this.x,this.y+e),this.app.ctx.bezierCurveTo(this.x,this.y,this.x-this.width/2,this.y,this.x-this.width/2,this.y+e),this.app.ctx.bezierCurveTo(this.x-this.width/2,this.y+(this.height+e)/2,this.x,this.y+(this.height+e)/1.4,this.x,this.y+this.height),this.app.ctx.bezierCurveTo(this.x,this.y+(this.height+e)/1.8,this.x+this.width/2,this.y+(this.height+e)/2,this.x+this.width/2,this.y+e),this.app.ctx.bezierCurveTo(this.x+this.width/2,this.y,this.x,this.y,this.x,this.y+e),this.app.ctx.closePath(),this.app.ctx.fill()}})}}class Gs{x;y;z;brightness;constructor(t,e,i,n){this.x=t,this.y=e,this.z=i,this.brightness=n}setBrightness(t){this.brightness=Math.min(Math.max(t,0),1)}}class Ya{x;y;width;height;rotation;showFlame;constructor(){this.x=0,this.y=0,this.width=25,this.height=20,this.rotation=0,this.showFlame=!1}draw(t,e){t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.lineWidth=1,t.strokeStyle="#ffffff",e?.(t),t.beginPath(),t.moveTo(10,0),t.lineTo(-10,10),t.lineTo(-5,0),t.lineTo(-10,-10),t.lineTo(10,0),t.closePath(),t.stroke(),this.showFlame&&(t.beginPath(),t.moveTo(-7.5,-5),t.lineTo(-15,0),t.lineTo(-7.5,5),t.closePath(),t.stroke()),t.restore()}}class Ha{x;y;scaleX;scaleY;color;alpha;lineWidth;branch;constructor(){this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.color="#ffffff",this.alpha=1,this.lineWidth=1,this.branch=[],this.branch[0]=-140-Math.random()*20,this.branch[1]=-30-Math.random()*30,this.branch[2]=Math.random()*80-40,this.branch[3]=-100-Math.random()*40,this.branch[4]=-60-Math.random()*40,this.branch[5]=Math.random()*60-30,this.branch[6]=-110-Math.random()*20}draw(t,e){t.save(),t.translate(this.x,this.y),t.scale(this.scaleX,this.scaleY),t.lineWidth=this.lineWidth,t.strokeStyle=si(this.color,this.alpha),e?.(t),t.beginPath(),t.moveTo(0,0),t.lineTo(0,this.branch[0]),t.moveTo(0,this.branch[1]),t.lineTo(this.branch[2],this.branch[3]),t.moveTo(0,this.branch[4]),t.lineTo(this.branch[5],this.branch[6]),t.stroke(),t.restore()}}class ja{x;y;z;fl;vpX;vpY;cX;cY;cZ;constructor(t,e,i){this.x=t,this.y=e,this.z=i,this.fl=250,this.vpX=0,this.vpY=0,this.cX=0,this.cY=0,this.cZ=0}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,i){this.cX=t,this.cY=e,this.cZ=i}rotateX(t){const e=Math.cos(t),i=Math.sin(t),n=this.y*e-this.z*i,r=this.z*e+this.y*i;this.y=n,this.z=r}rotateY(t){const e=Math.cos(t),i=Math.sin(t),n=this.x*e-this.z*i,r=this.z*e+this.x*i;this.x=n,this.z=r}rotateZ(t){const e=Math.cos(t),i=Math.sin(t),n=this.x*e-this.y*i,r=this.y*e+this.x*i;this.x=n,this.y=r}getScreenX(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}}class qa{pointA;pointB;pointC;color;lineWidth;alpha;constructor(t,e,i,n="#ff0000"){this.pointA=t,this.pointB=e,this.pointC=i,this.color=n,this.lineWidth=1,this.alpha=1}draw(t,e){this.isBackface()||(t.save(),t.lineWidth=this.lineWidth,t.fillStyle=t.strokeStyle=si(this.color,this.alpha),e?.(t),t.beginPath(),t.moveTo(this.pointA.getScreenX(),this.pointA.getScreenY()),t.lineTo(this.pointB.getScreenX(),this.pointB.getScreenY()),t.lineTo(this.pointC.getScreenX(),this.pointC.getScreenY()),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore())}getDepth(){return Math.min(this.pointA.z,this.pointB.z,this.pointC.z)}isBackface(){const t=this.pointC.getScreenX()-this.pointA.getScreenX(),e=this.pointC.getScreenY()-this.pointA.getScreenY(),i=this.pointB.getScreenX()-this.pointC.getScreenX(),n=this.pointB.getScreenY()-this.pointC.getScreenY();return t*n>e*i}}class $a{pointA;pointB;pointC;color;lineWidth;alpha;light;constructor(t,e,i,n="#ff0000"){this.pointA=t,this.pointB=e,this.pointC=i,this.color=n,this.lineWidth=1,this.alpha=1,this.light=new Gs(0,0,0,1)}draw(t,e){this.isBackface()||(t.save(),t.lineWidth=this.lineWidth,t.fillStyle=t.strokeStyle=this.getAdjustedColor(),e?.(t),t.beginPath(),t.moveTo(this.pointA.getScreenX(),this.pointA.getScreenY()),t.lineTo(this.pointB.getScreenX(),this.pointB.getScreenY()),t.lineTo(this.pointC.getScreenX(),this.pointC.getScreenY()),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore())}getDepth(){return Math.min(this.pointA.z,this.pointB.z,this.pointC.z)}isBackface(){const t=this.pointC.getScreenX()-this.pointA.getScreenX(),e=this.pointC.getScreenY()-this.pointA.getScreenY(),i=this.pointB.getScreenX()-this.pointC.getScreenX(),n=this.pointB.getScreenY()-this.pointC.getScreenY();return t*n>e*i}getAdjustedColor(){const t=ve(this.color);let e=t>>16,i=t>>8&255,n=t&255;const r=this.getLightFactor();return e*=r,i*=r,n*=r,ds(e<<16|i<<8|n)}getLightFactor(){const t={x:this.pointA.x-this.pointB.x,y:this.pointA.y-this.pointB.y,z:this.pointA.z-this.pointB.z},e={x:this.pointB.x-this.pointC.x,y:this.pointB.y-this.pointC.y,z:this.pointB.z-this.pointC.z},i={x:t.y*e.z-t.z*e.y,y:-(t.x*e.z-t.z*e.x),z:t.x*e.y-t.y*e.x},n=i.x*this.light.x+i.y*this.light.y+i.z*this.light.z,r=Math.sqrt(i.x*i.x+i.y*i.y+i.z*i.z),a=Math.sqrt(this.light.x*this.light.x+this.light.y*this.light.y+this.light.z*this.light.z);return Math.acos(n/(r*a))/Math.PI*this.light.brightness}}class Ja{min;max;value;x;y;width;height;backColor;backBorderColor;backWidth;handleColor;handleBorderColor;handleHeight;handleY;onchange;prevCanvas;currentContext;animatedID=0;constructor(t=0,e=100,i=0,n){this.min=t,this.max=e,this.value=i,this.onchange=n,this.x=0,this.y=0,this.width=16,this.height=100,this.backColor="#cccccc",this.backBorderColor="#999999",this.backWidth=4,this.handleColor="#eeeeee",this.handleBorderColor="#cccccc",this.handleHeight=6,this.handleY=0,this.updatePosition()}draw(t,e){this.currentContext=t,t.save(),t.translate(this.x,this.y),e?.(t),t.clearRect(this.x,this.y,this.width,this.height),t.fillStyle=this.backColor,t.beginPath(),t.fillRect(this.width/2-this.backWidth/2,0,this.backWidth,this.height),t.closePath(),t.strokeStyle=this.handleBorderColor,t.fillStyle=this.handleColor,t.beginPath(),t.rect(0,this.handleY,this.width,this.handleHeight),t.closePath(),t.fill(),t.stroke(),t.restore(),(!this.prevCanvas||this.prevCanvas!=t.canvas)&&(this.captureMouse(t.canvas),this.prevCanvas=t.canvas)}updateValue(){const t=this.value,e=this.height-this.handleHeight,i=this.max-this.min;this.value=(e-this.handleY)/e*i+this.min,this.value!==t&&(this.onchange?.(this.value),Dt.register(()=>this.currentContext?(this.draw(this.currentContext),!0):!1))}updatePosition(){const t=this.height-this.handleHeight,e=this.max-this.min;this.handleY=t-(this.value-this.min)/e*t}captureMouse(t){const e=new ot({x:0,y:0,width:0,height:0}),i=()=>{e.x=this.x,e.y=this.y+this.handleY,e.width=this.width,e.height=this.handleHeight};i();let n=!1;const r=new U(t);r.captureMove({move:()=>{if(n){const a=r.mousePoint.y-this.y;this.handleY=Math.min(this.height-this.handleHeight,Math.max(a,0)),this.updateValue()}},start:()=>{n=e.isContainPoint(r.mousePoint.x,r.mousePoint.y)},end:()=>{i()}})}}class Za{R;r;O;constructor(t,e,i){this.R=t,this.r=e,this.O=i}draw(t,e){t.save(),e?.(t);let i=this.R-this.O,n=0,r=1;t.beginPath(),t.moveTo(i,n);let a,o;do{if(r>2e4)break;a=(this.R+this.r)*Math.cos(r*Math.PI/72)-(this.r+this.O)*Math.cos((this.R+this.r)/this.r*(r*Math.PI/72)),o=(this.R+this.r)*Math.sin(r*Math.PI/72)-(this.r+this.O)*Math.sin((this.R+this.r)/this.r*(r*Math.PI/72)),t.lineTo(a,o),i=a,n=o,r++}while(a!=this.R-this.O&&o!=0);t.stroke(),t.restore()}}class Ka{r;constructor(t){this.r=t}draw(t,e){t.save(),e?.(t),t.beginPath(),t.moveTo(this.r,0);for(let i=0;i<9;i++)t.rotate(Math.PI/5),i%2==0?t.lineTo(this.r/.525731*.200811,0):t.lineTo(this.r,0);t.closePath(),t.fill(),t.restore()}}class Qa{startX;startY;width;height;constructor(t,e,i,n){this.startX=t,this.startY=e,this.width=i,this.height=n}draw(t,e){t.save(),e?.(t);let i=0;const n=()=>{t.clearRect(this.startX,this.startY,this.width,this.height),t.setLineDash([4,2]),t.lineDashOffset=-i,t.strokeRect(this.startX,this.startY,this.width,this.height)};function r(){i++,i>16&&(i=0),n(),setTimeout(r,40)}r(),t.restore()}}class to{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new Zt(t),this.remoteVideoUtil=new Zt(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(i=>{this.localVideoUtil.setSrcObject(i),t(i)}).catch(i=>{this.trace(`navigator.getUserMedia error: ${i}.`),e(i)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),i=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),i.length>0&&this.trace(`Using audio device: ${i[0].label}.`);const n=void 0,r=new RTCPeerConnection(n);this.localPeerConnection=r,this.trace("Created local peer connection object localPeerConnection."),r.addEventListener("icecandidate",this.handleConnection),r.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const a=new RTCPeerConnection(n);this.remotePeerConnection=a,this.trace("Created remote peer connection object remotePeerConnection."),a.addEventListener("icecandidate",this.handleConnection),a.addEventListener("iceconnectionstatechange",this.handleConnectionChange),a.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),r.addTrack(e[0],t),r.addTrack(i[0],t),this.trace("localPeerConnection createOffer start."),r.createOffer({offerToReceiveVideo:!0}).then(o=>this.createdOffer(o)).catch(o=>this.setSessionDescriptionError(o))}handleConnection(t){const e=t.target,i=t.candidate;if(e&&i){const n=new RTCIceCandidate(i),r=this.getOtherPeer(e);r&&(r.addIceCandidate(n).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
|
|
40
36
|
${t.candidate.candidate}.`))}}handleConnectionSuccess(t){this.trace(`${this.getPeerName(t)} addIceCandidate success.`)}handleConnectionFailure(t,e){this.trace(`${this.getPeerName(t)} failed to add ICE Candidate:
|
|
41
37
|
${e.toString()}.`)}handleConnectionChange(t){const e=t.target;console.log("ICE state change event: ",t),e&&this.trace(`${this.getPeerName(e)} ICE state: ${e.iceConnectionState}.`)}createdOffer(t){this.trace(`Offer from localPeerConnection:
|
|
42
38
|
${t.sdp}`),this.localPeerConnection&&(this.trace("localPeerConnection setLocalDescription start."),this.localPeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.remotePeerConnection&&(this.trace("remotePeerConnection setRemoteDescription start."),this.remotePeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e)),this.trace("remotePeerConnection createAnswer start."),this.remotePeerConnection.createAnswer().then(e=>this.createdAnswer(e)).catch(e=>this.setSessionDescriptionError(e)))}createdAnswer(t){this.trace(`Answer from remotePeerConnection:
|
|
43
|
-
${t.sdp}.`),this.remotePeerConnection&&(this.trace("remotePeerConnection setLocalDescription start."),this.remotePeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.localPeerConnection&&(this.trace("localPeerConnection setRemoteDescription start."),this.localPeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e)))}setSessionDescriptionError(t){this.trace(`Failed to create session description: ${t.toString()}.`)}setDescriptionSuccess(t,e){const i=this.getPeerName(t);this.trace(`${i} ${e} complete.`)}setLocalDescriptionSuccess(t){this.setDescriptionSuccess(t,"setLocalDescription")}setRemoteDescriptionSuccess(t){this.setDescriptionSuccess(t,"setRemoteDescription")}trace(t){t=t.trim();const e=(window.performance.now()/1e3).toFixed(3);console.log(e,t);const i=document.createElement("div");i.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(i)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class Ep{canvas;gl;constructor(t){this.canvas=t;const e={alpha:!0,premultipliedAlpha:!1};if(this.gl=this.canvas.getContext("webgl",e),!this.gl)throw new Error("WebGL failed to initialize.")}}function ac(n,t){return!n||n.parentElement===null?t:ac(n.parentElement,t.concat([n]))}const ra=function(n,t){return getComputedStyle(n,null).getPropertyValue(t)},kp=function(n){return ra(n,"overflow")+ra(n,"overflow-y")+ra(n,"overflow-x")},Sp=function(n){return/(auto|scroll)/.test(kp(n))};function Ap(n){if(!(n instanceof HTMLElement||n instanceof SVGElement))return;const t=ac(n.parentElement,[]);for(let e=0;e<t.length;e+=1)if(Sp(t[e]))return t[e];return document.scrollingElement||document.documentElement}const oc=[],lc={};function sa(n){oc.push(n)}function Pp(n,t=!1){const e=yo();if(lc[e])return;wx.error(s=>{console.log(s.errMsg??JSON.stringify(s))}),wx.ready(()=>{oc.forEach(s=>s())});const i=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],r=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(n,{debug:t,jsApiList:i,openTagList:r})),lc[e]=!0}function Ip(n){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[n],success:function(i){i.checkResult[n]?t(!0):e(!1)},fail:function(){e(!1)}})})}function Mp(n){sa(function(){wx.updateAppMessageShareData(n)})}function Lp(n){sa(function(){wx.updateTimelineShareData(n)})}function Dp(n){wx.chooseImage(n)}function Rp(n){wx.previewImage(n)}function Op(n){wx.uploadImage(n)}function Fp(n){wx.downloadImage(n)}function zp(n){wx.getLocalImgData(n)}function Up(){wx.startRecord()}function Np(n){wx.stopRecord(n)}function Bp(n){wx.onVoiceRecordEnd(n)}function Gp(n){wx.playVoice(n)}function Hp(n){wx.pauseVoice(n)}function jp(n){wx.stopVoice(n)}function Vp(n){wx.onVoicePlayEnd(n)}function Xp(n){wx.uploadVoice(n)}function Yp(n){wx.downloadVoice(n)}function Zp(n){wx.translateVoice(n)}function $p(n){wx.getNetworkType(n)}function qp(n){wx.openLocation(n)}function Wp(n){wx.getLocation(n)}function Jp(n){wx.scanQRCode(n)}function Kp(n,t,e){function i(){WeixinJSBridge.invoke("getBrandWCPayRequest",n,function(r){r.err_msg=="get_brand_wcpay_request:ok"?t():e(r.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",i,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",i),document.attachEvent("onWeixinJSBridgeReady",i)):i()}function Qp(n){window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)}function Hi(n,t){let e="未知错误";switch(n.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${n.error}(${e}): ${n.errorMessage}`}function t1(n,t,e){ap.tradePay(Object.assign(n,{}),function(i){let r="未知错误";switch(i.resultCode){case 9e3:return r="订单支付成功",t?.(r);case 8e3:r="正在处理中";break;case 4e3:r="订单支付失败";break;case 6001:r="用户中途取消";break;case 6002:r="网络连接出错";break;case 99:r="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(r)})}function e1(n,t,e){ap.scan(Object.assign(n,{fail:i=>{e?.(Hi(i))}}),function(i){t?.(i.code)})}function n1(n,t,e){ap.getLocation(Object.assign(n,{fail:i=>{e?.(Hi(i))}}),function(i){t?.(i)})}function i1(n,t,e){ap.openLocation(Object.assign(n,{fail:i=>{e?.(Hi(i))}}),function(){t?.()})}function r1(n,t,e){ap.chooseImage(Object.assign(n,{fail:i=>{e?.(Hi(i,"chooseImage"))}}),function(i){t?.(i)})}function s1(n,t,e){ap.previewImage(Object.assign(n,{fail:i=>{e?.(Hi(i))}}),function(){t?.()})}class a1{map;constructor(t,e=120.619585,i=31.299379,r=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,i),r)}}return O.AnimateOperation=fn,O.CanvasOperation=ms,O.CustomCanvasContext=pi,O.CustomCanvasGradient=nr,O.CustomCanvasPattern=ns,O.DOMEvent=Vh,O.DOMEventBus=mo,O.DOMKey=Va,O.DOMMedia=jh,O.DOMQuery=jt,O.DOMScroll=Xh,O.DOMToBlob=ka,O.DOMToString=Ea,O.DOMUtil=Pt,O.DOMVideo=_i,O.Dep=tc,O.HSVToRGBObject=Kh,O.Matrix=qt,O.Matrix3D=yn,O.PathGroup=xn,O.Point=Te,O.Polygon=vi,O.QRCode=hn,O.RGBStringToHexString=Wh,O.RGBToHSVObject=Qh,O.Rect=Nn,O.SVGOperation=nn,O.ShapeArmyAnts=bp,O.ShapeArrow=op,O.ShapeBall=lp,O.ShapeFox=fp,O.ShapeLight=sc,O.ShapeLine=cp,O.ShapePoint3d=gp,O.ShapeRabbit=up,O.ShapeRect=hp,O.ShapeSegment=wp,O.ShapeShip=dp,O.ShapeSlider=_p,O.ShapeSmileFace=Tp,O.ShapeSpirograph=yp,O.ShapeStar=xp,O.ShapeTree=pp,O.ShapeTriangle=mp,O.ShapeTriangleLight=vp,O.TWEEN=Ar,O.Tween=ic,O.Vector=Er,O.WebGLRenderer=Ep,O.WebRTCClient=Cp,O.WebSocketClient=Fc,O.YZRaphael=gs,O.absolutize=sr,O.addWatermark=N0,O.addWxJsReadyFnBeforeConfig=sa,O.ajax=Z0,O.aliJsChooseImage=r1,O.aliJsGetLocation=n1,O.aliJsOpenLocation=i1,O.aliJsPreviewImage=s1,O.aliJsReady=Qp,O.aliJsScan=e1,O.aliJsTradePay=t1,O.angle=Qr,O.animateInWeb=ec,O.appendURLSearchString=hr,O.base64URLDecode=ef,O.base64URLEncode=tf,O.blobToRawImage=f0,O.canDrawBitmap=sh,O.canUsePaths=rh,O.canUseWorker=Ga,O.changeBrightness=z0,O.changeDiaphaneity=U0,O.changeSize=F0,O.checkWxJsApi=Ip,O.clearCookies=Hh,O.colorNumberToHexString=vo,O.colorNumberToRGBString=_o,O.compression=G0,O.createXMLHttpRequest=ta,O.debugObject=oh,O.debugObjectProperty=ah,O.distance=ja,O.dquery=lr,O.drawQRCodeToCanvas=X0,O.fileOrBlobToDataURL=Ks,O.fileToArrayBufferPromise=Aa,O.flipSideToSide=d0,O.flipUpsideDown=p0,O.formDataToSearchString=ys,O.fromAngleAndLength=ts,O.getBrowserClient=qr,O.getBrowserClientVersion=Xc,O.getBrowserLanguage=Zc,O.getCookie=Bh,O.getCookieObject=Gh,O.getDirection=fh,O.getDocumentElement=Zr,O.getElementLeftInPage=Da,O.getElementPositionInPage=La,O.getElementPositionInPage2=Bc,O.getElementPositionInViewport=Gc,O.getElementTopInPage=Ra,O.getFileExtensionFromFile=Pa,O.getFileTypeFromFile=Mc,O.getFilesImageInfo=s0,O.getFormSubmitData=Y0,O.getGlobal=$r,O.getImageDataByAIData=H0,O.getImageDataFromBitmap=o0,O.getImageDataFromUrl=Xl,O.getImageDataFromVideo=a0,O.getImageMainColor=u0,O.getInternetExplorerVersion=za,O.getMousePositionInElement=Ji,O.getMousePositionInPage=Oa,O.getMousePositionInViewport=jc,O.getOperatingSystem=Ki,O.getOperatingSystemVersion=Vc,O.getPageClient=qi,O.getPageScroll=Un,O.getPageSize=zc,O.getPointAtLength=co,O.getRaphael=zh,O.getRawImageInfo=Js,O.getRelativeBoundingClientRect=Hc,O.getScrollParent=Ap,O.getTimeZone=$c,O.getTotalLength=lo,O.getURL=ws,O.getUserGeolocationPromise=Yc,O.getViewportSize=Wi,O.getWorker=hf,O.gifImage=$l,O.h=Oc,O.handleDragAndDropFiles=Dc,O.handleInputFiles=Lc,O.hasDocument=eh,O.hasHistory=nh,O.hasWindow=Ba,O.hexStringToColorNumber=cr,O.hexStringToRGBString=_s,O.ifWebFileHasChanged=$0,O.imageDataToBitmap=l0,O.imageDataToBlob=h0,O.imageDataToDataURL=c0,O.injectWxJsConfig=Pp,O.isAliBrowser=Na,O.isAliMiniProgram=Qc,O.isAndroid=Fa,O.isAppleDevice=qc,O.isBrowserSupportFileAPI=ih,O.isDarkMode=Jc,O.isElementInViewport=Nc,O.isElementInViewportSimple=Uc,O.isIE=th,O.isIOS=Wr,O.isMacOS=Jr,O.isMobile=Wc,O.isPointInPath=ho,O.isPointInStroke=fo,O.isSvgPath=Ka,O.isURL=nf,O.isWxBrowser=Ua,O.isWxMiniProgram=Kc,O.jpgToPng=L0,O.leftRotate=g0,O.linkExport=Xr,O.localstorage=vs,O.mapTDTJSSDK=a1,O.marginSharpen=M0,O.microTask=Rc,O.mosaic=B0,O.mount=ui,O.normalize=ar,O.normalizePoint=es,O.onHashChange=lf,O.onHistoryChange=cf,O.onURLChange=of,O.outputGifBase64=ql,O.outputQRCodeBase64=V0,O.parse=rr,O.parseTransformToMatrix=Bn,O.parseURL=wo,O.patch=Ia,O.patchDOM=Ma,O.pngToJpg=D0,O.radiusClip=O0,O.randomColorHexString=$h,O.randomColorHexString2=qh,O.randomColorNumber=Zh,O.rappar=Ja,O.reactiveVue2=W0,O.reactiveVue3=J0,O.readFileInBrowser=Yr,O.recordToSearchString=xo,O.recordToSearchString2=af,O.rectClip=R0,O.relative=xh,O.rightRotate=m0,O.searchStringToRecord=rf,O.searchStringToRecord2=sf,O.selectFileInBrowser=Sa,O.setCookie=Nh,O.setRem=lh,O.shadeColor=Jh,O.sharpen=I0,O.singletonGlobalAnimateInWeb=kr,O.stringToBlob=Vr,O.stringToDOM=Ic,O.theme=Yh,O.toBlackAndWhite=w0,O.toBlue=T0,O.toBlueAndGreen=k0,O.toBlueAndGrey=P0,O.toDegree=Kr,O.toGreen=b0,O.toGreenAndGrey=A0,O.toGrey=v0,O.toGrey2=_0,O.toOpposite=y0,O.toRadian=Qi,O.toRed=x0,O.toRedAndBlue=E0,O.toRedAndGreen=C0,O.toRedAndGrey=S0,O.trimURLHash=yo,O.watchEffect=q0,O.wxJsChooseImage=Dp,O.wxJsDownloadImage=Fp,O.wxJsDownloadVoice=Yp,O.wxJsGetLocalImgData=zp,O.wxJsGetLocation=Wp,O.wxJsGetNetworkType=$p,O.wxJsOnVoicePlayEnd=Vp,O.wxJsOnVoiceRecordEnd=Bp,O.wxJsOpenLocation=qp,O.wxJsPauseVoice=Hp,O.wxJsPay=Kp,O.wxJsPlayVoice=Gp,O.wxJsPreviewImage=Rp,O.wxJsScanQRCode=Jp,O.wxJsStartRecord=Up,O.wxJsStopRecord=Np,O.wxJsStopVoice=jp,O.wxJsTranslateVoice=Zp,O.wxJsUpdateAppMessageShareData=Mp,O.wxJsUpdateTimelineShareData=Lp,O.wxJsUploadImage=Op,O.wxJsUploadVoice=Xp,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"}),O}({});
|
|
39
|
+
${t.sdp}.`),this.remotePeerConnection&&(this.trace("remotePeerConnection setLocalDescription start."),this.remotePeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.localPeerConnection&&(this.trace("localPeerConnection setRemoteDescription start."),this.localPeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e)))}setSessionDescriptionError(t){this.trace(`Failed to create session description: ${t.toString()}.`)}setDescriptionSuccess(t,e){const i=this.getPeerName(t);this.trace(`${i} ${e} complete.`)}setLocalDescriptionSuccess(t){this.setDescriptionSuccess(t,"setLocalDescription")}setRemoteDescriptionSuccess(t){this.setDescriptionSuccess(t,"setRemoteDescription")}trace(t){t=t.trim();const e=(window.performance.now()/1e3).toFixed(3);console.log(e,t);const i=document.createElement("div");i.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(i)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class eo{canvas;gl;constructor(t){this.canvas=t;const e={alpha:!0,premultipliedAlpha:!1};if(this.gl=this.canvas.getContext("webgl",e),!this.gl)throw new Error("WebGL failed to initialize.")}}function Bs(s,t){return!s||s.parentElement===null?t:Bs(s.parentElement,t.concat([s]))}const vi=function(s,t){return getComputedStyle(s,null).getPropertyValue(t)},io=function(s){return vi(s,"overflow")+vi(s,"overflow-y")+vi(s,"overflow-x")},so=function(s){return/(auto|scroll)/.test(io(s))};function no(s){if(!(s instanceof HTMLElement||s instanceof SVGElement))return;const t=Bs(s.parentElement,[]);for(let e=0;e<t.length;e+=1)if(so(t[e]))return t[e];return document.scrollingElement||document.documentElement}const Us=[],zs={};function bi(s){Us.push(s)}function ro(s,t=!1){const e=ps();if(zs[e])return;wx.error(r=>{console.log(r.errMsg??JSON.stringify(r))}),wx.ready(()=>{Us.forEach(r=>r())});const i=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],n=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(s,{debug:t,jsApiList:i,openTagList:n})),zs[e]=!0}function ao(s){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[s],success:function(i){i.checkResult[s]?t(!0):e(!1)},fail:function(){e(!1)}})})}function oo(s){bi(function(){wx.updateAppMessageShareData(s)})}function ho(s){bi(function(){wx.updateTimelineShareData(s)})}function co(s){wx.chooseImage(s)}function lo(s){wx.previewImage(s)}function uo(s){wx.uploadImage(s)}function fo(s){wx.downloadImage(s)}function mo(s){wx.getLocalImgData(s)}function go(){wx.startRecord()}function po(s){wx.stopRecord(s)}function wo(s){wx.onVoiceRecordEnd(s)}function yo(s){wx.playVoice(s)}function vo(s){wx.pauseVoice(s)}function bo(s){wx.stopVoice(s)}function xo(s){wx.onVoicePlayEnd(s)}function Co(s){wx.uploadVoice(s)}function To(s){wx.downloadVoice(s)}function _o(s){wx.translateVoice(s)}function So(s){wx.getNetworkType(s)}function Po(s){wx.openLocation(s)}function Eo(s){wx.getLocation(s)}function ko(s){wx.scanQRCode(s)}function Io(s,t,e){function i(){WeixinJSBridge.invoke("getBrandWCPayRequest",s,function(n){n.err_msg=="get_brand_wcpay_request:ok"?t():e(n.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",i,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",i),document.attachEvent("onWeixinJSBridgeReady",i)):i()}function Mo(s){window.AlipayJSBridge?s&&s():document.addEventListener("AlipayJSBridgeReady",s,!1)}function he(s,t){let e="未知错误";switch(s.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${s.error}(${e}): ${s.errorMessage}`}function Do(s,t,e){ap.tradePay(Object.assign(s,{}),function(i){let n="未知错误";switch(i.resultCode){case 9e3:return n="订单支付成功",t?.(n);case 8e3:n="正在处理中";break;case 4e3:n="订单支付失败";break;case 6001:n="用户中途取消";break;case 6002:n="网络连接出错";break;case 99:n="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(n)})}function Ao(s,t,e){ap.scan(Object.assign(s,{fail:i=>{e?.(he(i))}}),function(i){t?.(i.code)})}function Lo(s,t,e){ap.getLocation(Object.assign(s,{fail:i=>{e?.(he(i))}}),function(i){t?.(i)})}function Ro(s,t,e){ap.openLocation(Object.assign(s,{fail:i=>{e?.(he(i))}}),function(){t?.()})}function Oo(s,t,e){ap.chooseImage(Object.assign(s,{fail:i=>{e?.(he(i,"chooseImage"))}}),function(i){t?.(i)})}function No(s,t,e){ap.previewImage(Object.assign(s,{fail:i=>{e?.(he(i))}}),function(){t?.()})}class Fo{map;constructor(t,e=120.619585,i=31.299379,n=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,i),n)}}return d.AnimateOperation=vt,d.Arc=ee,d.Arrow=Ia,d.Canvas=Va,d.CanvasOperation=Ns,d.CubicBezier=Ut,d.CustomCanvasContext=oe,d.CustomCanvasGradient=ke,d.CustomCanvasPattern=yi,d.DOMEventBus=U,d.DOMKey=ls,d.DOMParse=us,d.DOMSVGUtil=cs,d.DOMToBlob=Xi,d.DOMToString=Vi,d.DOMUtil=A,d.DOMVideo=Zt,d.Dep=Es,d.Ellipse=ka,d.Fox=Ma,d.Line=Et,d.Matrix=Y,d.Matrix3D=Mt,d.PathGroup=ie,d.Point=_t,d.Points=mi,d.QRCode=Pt,d.QuadraticBezier=gi,d.RGBToHex=pr,d.Rect=ot,d.SVGParse=Ms,d.Shape=wt,d.ShapeArmyAnts=Qa,d.ShapeFromSVG=di,d.ShapeHeart=Wa,d.ShapeLight=Gs,d.ShapePoint3d=ja,d.ShapeRabbit=Xa,d.ShapeShip=Ya,d.ShapeSlider=Ja,d.ShapeSpirograph=Za,d.ShapeStar=Ka,d.ShapeTree=Ha,d.ShapeTriangle=qa,d.ShapeTriangleLight=$a,d.TWEEN=Pe,d.Tween=Ls,d.Vector=_e,d.WebGLRenderer=eo,d.WebRTCClient=to,d.WebSocketClient=Sn,d.addWatermark=ga,d.addWxJsReadyFnBeforeConfig=bi,d.ajax=Ta,d.aliJsChooseImage=Oo,d.aliJsGetLocation=Lo,d.aliJsOpenLocation=Ro,d.aliJsPreviewImage=No,d.aliJsReady=Mo,d.aliJsScan=Ao,d.aliJsTradePay=Do,d.angle=qt,d.angleInSVG=Qe,d.animateInWeb=Ds,d.appendURLSearchString=be,d.base64URLDecode=Sr,d.base64URLEncode=_r,d.blobToRawImage=zr,d.canDrawBitmap=Zn,d.canUsePaths=Jn,d.canUseWorker=rs,d.changeBrightness=da,d.changeDiaphaneity=ma,d.changeSize=fa,d.checkWxJsApi=ao,d.clearCookies=ur,d.createXMLHttpRequest=hi,d.debugObject=Qn,d.debugObjectProperty=Kn,d.distance=jt,d.drawQRCodeToCanvas=ba,d.fileOrBlobToDataURL=ai,d.fileToArrayBufferPromise=Yi,d.flipSideToSide=Xr,d.flipUpsideDown=Wr,d.formDataToSearchString=ri,d.fromRadianAndLength=ti,d.getBrowserClient=$e,d.getBrowserClientVersion=Nn,d.getBrowserLanguage=Gn,d.getColorScheme=fs,d.getCookie=cr,d.getCookieObject=lr,d.getDirection=nr,d.getElementLeftPositionInPage2=Ji,d.getElementPositionInPage=$i,d.getElementPositionInPage2=Mn,d.getElementPositionInViewport=Dn,d.getElementTopPositionInPage2=Zi,d.getFileExtensionFromFile=Hi,d.getFileString=xa,d.getFileTypeFromFile=bn,d.getFilesImageInfo=Or,d.getFormSubmitData=Ca,d.getGlobal=qe,d.getImageAspectRatio=Rr,d.getImageDataByAIData=wa,d.getImageDataFromBitmap=Fr,d.getImageDataFromUrl=ys,d.getImageDataFromVideo=Nr,d.getImageMainColor=Vr,d.getInternetExplorerVersion=es,d.getMousePositionInElement=Qi,d.getMousePositionInPage=Ki,d.getMousePositionInViewport=Rn,d.getOperatingSystem=pe,d.getOperatingSystemVersion=On,d.getPageBodyElement=En,d.getPageDocumentElement=Gt,d.getPageSize=In,d.getRawImageInfo=Ce,d.getRelativeBoundingClientRect=An,d.getScreenElement=Pn,d.getScrollParent=no,d.getTimeZone=Bn,d.getURL=ni,d.getUserGeolocationPromise=Fn,d.getVerticalScrollPercentInPage=Ln,d.getViewportSize=kn,d.getWorker=Lr,d.gifImage=xs,d.h=_n,d.handleDragAndDropFiles=Cn,d.handleInputFiles=xn,d.hasDocument=jn,d.hasHistory=qn,d.hasWindow=ns,d.hexToNumber=ve,d.hexToRGB=si,d.hsb2rgb=vr,d.hsl2rgb=br,d.hsv2rgb=yr,d.ifWebFileHasChanged=_a,d.imageDataToBitmap=Gr,d.imageDataToBlob=Ur,d.imageDataToDataURL=Br,d.injectWxJsConfig=ro,d.isAliBrowser=ss,d.isAliMiniProgram=Hn,d.isAndroid=ts,d.isAppleDevice=Un,d.isBrowserSupportFileAPI=$n,d.isDarkMode=Vn,d.isIE=Xn,d.isIE9or10=Wn,d.isIOS=Je,d.isMacOS=Ze,d.isMobile=zn,d.isURL=Pr,d.isWxBrowser=is,d.isWxMiniProgram=Yn,d.jpgToPng=ha,d.leftRotate=Yr,d.linkExport=He,d.localstorage=ii,d.mapTDTJSSDK=Fo,d.marginSharpen=oa,d.microTask=Tn,d.mosaic=pa,d.mount=Yt,d.normalizePoint=ei,d.numberToHex=ds,d.numberToRGB=ms,d.onHashChange=Dr,d.onHistoryChange=Ar,d.onURLChange=Mr,d.outputGifBase64=Cs,d.outputQRCodeBase64=va,d.parseTransformToMatrix=te,d.parseURL=gs,d.patch=ji,d.patchDOM=qi,d.pngToJpg=ca,d.radiusClip=ua,d.randomColorHex=mr,d.randomColorHex2=gr,d.randomColorNumber=dr,d.reactiveVue2=Pa,d.reactiveVue3=Ea,d.readFileInBrowser=je,d.recordToSearchString=ws,d.recordToSearchString2=Ir,d.rectClip=la,d.rgb2hsb=Cr,d.rgb2hsl=Tr,d.rgb2hsv=xr,d.rightRotate=Hr,d.searchStringToRecord=Er,d.searchStringToRecord2=kr,d.selectFileInBrowser=Wi,d.setColorScheme=ye,d.setCookie=hr,d.setRem=tr,d.shadeColor=wr,d.sharpen=aa,d.singletonGlobalAnimateInWeb=Dt,d.stringToBlob=Ye,d.stringToDOM=vn,d.theme=fr,d.toBlackAndWhite=$r,d.toBlue=Qr,d.toBlueAndGreen=ia,d.toBlueAndGrey=ra,d.toDegree=Ht,d.toGreen=Kr,d.toGreenAndGrey=na,d.toGrey=jr,d.toGrey2=qr,d.toOpposite=Jr,d.toRadian=Ke,d.toRed=Zr,d.toRedAndBlue=ea,d.toRedAndGreen=ta,d.toRedAndGrey=sa,d.trimURLHash=ps,d.watchEffect=Sa,d.wxJsChooseImage=co,d.wxJsDownloadImage=fo,d.wxJsDownloadVoice=To,d.wxJsGetLocalImgData=mo,d.wxJsGetLocation=Eo,d.wxJsGetNetworkType=So,d.wxJsOnVoicePlayEnd=xo,d.wxJsOnVoiceRecordEnd=wo,d.wxJsOpenLocation=Po,d.wxJsPauseVoice=vo,d.wxJsPay=Io,d.wxJsPlayVoice=yo,d.wxJsPreviewImage=lo,d.wxJsScanQRCode=ko,d.wxJsStartRecord=go,d.wxJsStopRecord=po,d.wxJsStopVoice=bo,d.wxJsTranslateVoice=_o,d.wxJsUpdateAppMessageShareData=oo,d.wxJsUpdateTimelineShareData=ho,d.wxJsUploadImage=uo,d.wxJsUploadVoice=Co,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),d}({});
|
|
44
40
|
//# sourceMappingURL=zyzgroup_core_web.iife.js.map
|