@zyzgroup/core-web 0.0.83 → 0.0.85
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/zyzgroup_core_web.iife.js +17 -17
- package/dist/zyzgroup_core_web.iife.js.map +1 -1
- package/dist/zyzgroup_core_web.js +2943 -2651
- package/dist/zyzgroup_core_web.js.map +1 -1
- package/dist/zyzgroup_core_web.umd.cjs +17 -17
- package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
- package/package.json +3 -1
- package/types/ajax.d.ts +2 -1
- package/types/ajax.d.ts.map +1 -1
- package/types/axios.d.ts +16 -23
- package/types/axios.d.ts.map +1 -1
- package/types/file.d.ts +26 -3
- package/types/file.d.ts.map +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ZYZGroupCoreWeb=function(
|
|
1
|
+
var ZYZGroupCoreWeb=function(g){"use strict";function en(){return typeof window<"u"?window:typeof global<"u"?global:this||{}}class Ze{maps=new Map;mapsAddedDuringUpdate=new Map;entries(){return Array.from(this.maps.entries())}keys(){return Array.from(this.maps.keys())}values(){return Array.from(this.maps.values())}get length(){return this.entries().length}set(t,e){this.maps.set(t,e),this.mapsAddedDuringUpdate.set(t,e)}get(t){return this.maps.get(t)}shift(){const t=this.entries();if(t.length){const[e,s]=t[0];return this.delete(e),[e,s]}}delete(t){return this.mapsAddedDuringUpdate.delete(t),this.maps.delete(t)}deleteAll(){this.maps=new Map,this.mapsAddedDuringUpdate=new Map}filter(t){let e=Array.from(this.maps.entries());for(;e.length>0;){this.mapsAddedDuringUpdate=new Map;for(let s=0,i=e.length;s<i;s++){const[r,a]=e[s];t(r,a)===!1&&this.delete(r)}e=Array.from(this.mapsAddedDuringUpdate.entries())}}}const fe=new Ze,Ke=n=>{let t=null;switch(n){case"any-character":t=/[^]/;break;case"bin":t=/^(0b)?[0-1]+$/i;break;case"oct":t=/^(0o)?[0-7]+$/i;break;case"hex":t=/^(0x)?[0-9a-fA-F]+$/i;break;case"ascii":t=/^[\x00-\xFF]+$/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"trim":t=/^\s+|\s+$/g;break;case"regexp":t=/[\\^$.*+?()[\]{}|]/g;break;case"regexp-flags":t=/\w*$/;break;case"native-method":t=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(Ke("regexp"),"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");break;case"svg-segment":t=/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi;break;case"mobile-china":t=/^\+?[1-9]{1}[0-9]{10}$/g;break;case"email":t=/^[A-Za-z0-9_!#$%&'*+/=?`{|}~^.-]+\@[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"url":t=/^http[s]?:\/\/([\w-]+\.)+[\w-]+([\w-./?%&=]*)?$/;break;case"element-url":t=/^url\(['"]?(.+?)['"]?\)$/i;break;case"date":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})$/;break;case"time":t=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/;break;case"datetime":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})\s+(\d{1,2}):(\d{1,2}):(\d{1,2})$/;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"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"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"var-name":t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;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,24 +7,24 @@ var ZYZGroupCoreWeb=function(p){"use strict";function en(){return typeof window<
|
|
|
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},Nt=(n,t)=>(typeof n=="string"&&(n=Ze(n)||new RegExp(n)),n.test(t)),sn=(n,t)=>{typeof n=="string"&&(n=Ze(n)||new RegExp(n));const e=t.match(n);return e?n.flags.toLowerCase().indexOf("g")>=0?e.map(s=>({matchIndex:-1,fullMatch:s,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},nn=(n,t)=>{typeof n=="string"&&(n=Ze(n)||new RegExp(n));const e=[],s=t.matchAll(n);for(const i of s)e.push({matchIndex:typeof i.index=="number"?i.index:-1,fullMatch:i[0],groupMatchs:i.slice(1)});return e};function Da(n){const t=n.match(/[\s\S]/gu);return t?t.length:0}function rn(n,t){const e=n.codePointAt(t);return e?String.fromCodePoint(e):void 0}const st=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function Vs(){const n=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(st[n&255]+st[n>>8&255]+st[n>>16&255]+st[n>>24&255]+"-"+st[t&255]+st[t>>8&255]+"-"+st[t>>16&15|64]+st[t>>24&255]+"-"+st[e&63|128]+st[e>>8&255]+"-"+st[e>>16&255]+st[e>>24&255]+st[s&255]+st[s>>8&255]+st[s>>16&255]+st[s>>24&255]).toLowerCase()}function Aa(n){const t=fe.get(n);if(t)return t;const e=n.replace(/(^\w)/g,function(s){return s.toLowerCase()});return fe.set(n,e),e}const ft=(n,t="-")=>{const e=fe.get(n);if(e)return e;let s=n.replace(new RegExp(`${t}?([A-Z])`,"g"),t+"$1").toLowerCase();return s=s.replace(new RegExp(`^${t}`),""),fe.set(n,s),s};function zs(n){const t=fe.get(n);if(t)return t;const e=n.replace(/(^\w|[_-]\w)/g,function(s){return s.slice(-1).toUpperCase()});return fe.set(n,e),e}function an(n){return Aa(zs(n))}function on(n){let t="";for(let e=0,s=n.length;e<s;e++){const i=n.charCodeAt(e);i>=1&&i<=127?t+=n.charAt(e):i>2047?(t+=String.fromCharCode(224|i>>12&15),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|i>>0&63)):(t+=String.fromCharCode(192|i>>6&31),t+=String.fromCharCode(128|i>>0&63))}return t}var Yt=(n=>(n.UNKNOWN="",n.HTML="text/html",n.XHTML="application/xhtml+xml",n.XML="application/xml",n.XML_TEXT="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.MP4="video/mp4",n.OGG="audio/ogg",n.WAV="audio/wav",n.WEBM="video/webm",n.CSS="text/css",n.JAVASCRIPT="application/javascript",n.ECMASCRIPT="application/ecmascript",n.JSON="application/json",n.XWWW="application/x-www-form-urlencoded",n.DOC="application/msword",n.CSV="application/x-csv",n.EXCEL="application/vnb.ms-excel",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))(Yt||{}),hn=(n=>(n.ascii="ascii",n.utf8="utf8",n.utf16le="utf16le",n.ucs2="ucs2",n.base64="base64",n.base64url="base64url",n.latin1="latin1",n.binary="binary",n.hex="hex",n))(hn||{});const me=(n,t=16)=>{let e=n.toLowerCase();const s=e.indexOf("0b")==0,i=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(s||i||r)&&(e=e.slice(2)),s&&(t=2),i&&(t=8),r&&(t=16);const a=parseInt(e,t);if(isNaN(a))throw new Error(`radixStringToNumber(${n}, ${t}) 无法解析!`);return a};function Ia(n){return new TextEncoder().encode(n)}function ka(n,t=hn.utf8){return new TextDecoder(t).decode(n)}function Ma(){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 cn=n=>{let t=Yt.UNKNOWN;switch(new DataView(n).getUint32(0,Ma()).toString(16).toUpperCase()){case"FFD8FFDB":t=Yt.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Yt.JPEG;break;case"89504E47":t=Yt.PNG;break;case"47494638":t=Yt.GIF;break;case"52494646":t=Yt.WEBP;break;case"25504446":t=Yt.PDF;break;case"504B0304":t=Yt.ZIP;break}return t};let Se;class La{subscribers;constructor(){this.subscribers=new Set}add(){Se&&!this.subscribers.has(Se)&&this.subscribers.add(Se)}notify(){this.subscribers.forEach(t=>t())}}const ln=new WeakMap;function un(n,t){let e=ln.get(n);e||(e=new Map,ln.set(n,e));let s=e.get(t);return s||(s=new La,e.set(t,s)),s}function qs(n){Se=n,n(),Se=null}const Ra=Symbol("isProxy");function Oa(n){return new Proxy(n,{get(t,e,s){return e===Ra?!0:(un(n,e).add(),Reflect.get(t,e,s))},set(t,e,s,i){const r=un(n,e);return n[e]!=s&&(n[e]=s,r.notify()),Reflect.set(t,e,s,i)}})}const Fa=Oa;function dn(n){return n!=null}function Na(n,...t){return new n.constructor(...t)}function fn(n,t){for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&!t(e,n[e])&&delete n[e];return n}function Ya(n,t="",e=["","sign","key"]){return Object.keys(n).filter(s=>{for(let i=0,r=e.length;i<r;i++)if(n[s]==e[i])return!1;return!0}).sort().map(s=>`${s}=${n[s]}`).join("&")+t}function Ce(n,t){const e=n.findIndex(s=>s===t);return e>=0&&n.splice(e,1),n}let mn;try{mn=Map}catch{mn=function(){}}let pn;try{pn=Set}catch{pn=function(){}}function $t(n,t){if(n=parseFloat(n),isNaN(n)){if(typeof t=="number")return t;throw new Error(`parseNumber(${n}) isNaN!`)}return n}function Ke(n,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(n-t)<e}const V=(n,t,e)=>n<t?t:n>e?e:n,Ba=(n,t,e)=>s=>{const i=V(s,n,t);return e==0?i:t-i<e?t:Math.round(i/e)*e};function Xa(n,t=12){return $t(n).toFixed(t)}function At(n,t=12){return+Xa(n,t)}function Hs(n,t){const e=sn("number-single",String(n));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):dn(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?n.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?n.substring(e.matchIndex+e.fullMatch.length):""}}function gn(n){const t=sn("number",n);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}Ga();function Ga(){const n=new ArrayBuffer(4),t=new Float32Array(n),e=new Uint32Array(n),s=new Uint32Array(512),i=new Uint32Array(512);for(let h=0;h<256;++h){const c=h-127;c<-27?(s[h]=0,s[h|256]=32768,i[h]=24,i[h|256]=24):c<-14?(s[h]=1024>>-c-14,s[h|256]=1024>>-c-14|32768,i[h]=-c-1,i[h|256]=-c-1):c<=15?(s[h]=c+15<<10,s[h|256]=c+15<<10|32768,i[h]=13,i[h|256]=13):c<128?(s[h]=31744,s[h|256]=64512,i[h]=24,i[h|256]=24):(s[h]=31744,s[h|256]=64512,i[h]=13,i[h|256]=13)}const r=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let h=1;h<1024;++h){let c=h<<13,l=0;for(;!(c&8388608);)c<<=1,l-=8388608;c&=-8388609,l+=947912704,r[h]=c|l}for(let h=1024;h<2048;++h)r[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)a[h]=h<<23;a[31]=1199570944,a[32]=2147483648;for(let h=33;h<63;++h)a[h]=2147483648+(h-32<<23);a[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(o[h]=1024);return{floatView:t,uint32View:e,baseTable:s,shiftTable:i,mantissaTable:r,exponentTable:a,offsetTable:o}}const Ua={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:n=>{const t=["th","st","nd","rd"],e=n%100;return`[${n}${t[(e-20)%10]||t[e]||t[0]}]`}};let Qe="en";const ts={};ts[Qe]=Ua;function yn(n,t){if(!n)return Qe;let e;if(typeof n=="string"){const s=n.toLowerCase();ts[s]&&(e=s),t&&(ts[s]=t,e=s);const i=n.split("-");if(!e&&i.length>1)return yn(i[0])}else{const{name:s}=n;ts[s]=n,e=s}return e&&(Qe=e),e||Qe}function $(){return(performance||Date).now()}function Va(n,t){let e;return function(...s){clearTimeout(e),e=setTimeout(()=>{n.apply(this,s)},t)}}class js{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(s=>s!==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(s=>{Reflect.apply(s,this,e)}),this}once(t,e){const i=(()=>{let r=!1;return(...a)=>{r||(r=!0,Reflect.apply(e,this,a),this.off(t,i))}})();return this.on(t,i),this}}var wn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function za(n,t={}){var e=1,s=1;function i(M){var D=M.match(/\n/g);D&&(e+=D.length);var F=M.lastIndexOf(`
|
|
11
|
-
`);s=~F?M.length-F:s+M.length}function r(){var M={line:e,column:s};return function(D){return D.position=new a(M),m(),D}}function a(M){this.start=M,this.end={line:e,column:s},this.source=t.source}a.prototype.content=n;var o=[];function h(M){var D=new Error(t.source+":"+e+":"+s+": "+M);if(D.reason=M,D.filename=t.source,D.line=e,D.column=s,D.source=n,t.silent)o.push(D);else throw D}function c(){var M=g();return{type:"stylesheet",stylesheet:{source:t.source,rules:M,parsingErrors:o}}}function l(){return y(/^{\s*/)}function d(){return y(/^}/)}function g(){var M,D=[];for(m(),x(D);n.length&&n.charAt(0)!="}"&&(M=le()||be());)M!==!1&&(D.push(M),x(D));return D}function y(M){var D=M.exec(n);if(D){var F=D[0];return i(F),n=n.slice(F.length),D}}function m(){y(/^\s*/)}function x(M){var D;for(M=M||[];D=b();)D!==!1&&M.push(D);return M}function b(){var M=r();if(!(n.charAt(0)!="/"||n.charAt(1)!="*")){for(var D=2;n.charAt(D)!=""&&(n.charAt(D)!="*"||n.charAt(D+1)!="/");)++D;if(D+=2,n.charAt(D-1)==="")return h("End of comment missing");var F=n.slice(2,D-2);return s+=2,i(F),n=n.slice(D),s+=2,M({type:"comment",comment:F})}}function S(){var M=y(/^([^{]+)/);if(M)return Bt(M[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(D){return D.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(D){return D.replace(/\u200C/g,",")})}function C(){var M=r(),D=y(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(D){if(D=Bt(D[0]),!y(/^:\s*/))return h("property missing ':'");var F=y(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),G=M({type:"declaration",property:D.replace(wn,""),value:F?Bt(F[0]).replace(wn,""):""});return y(/^[;\s]*/),G}}function L(){var M=[];if(!l())return h("missing '{'");x(M);for(var D;D=C();)D!==!1&&(M.push(D),x(M));return d()?M:h("missing '}'")}function R(){for(var M,D=[],F=r();M=y(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)D.push(M[1]),y(/^,\s*/);if(D.length)return F({type:"keyframe",values:D,declarations:L()})}function X(){var M=r(),D=y(/^@([-\w]+)?keyframes\s*/);if(D){var F=D[1];if(D=y(/^([-\w]+)\s*/),!D)return h("@keyframes missing name");var G=D[1];if(!l())return h("@keyframes missing '{'");for(var ut,_t=x();ut=R();)_t.push(ut),_t=_t.concat(x());return d()?M({type:"keyframes",name:G,vendor:F,keyframes:_t}):h("@keyframes missing '}'")}}function Y(){var M=r(),D=y(/^@supports *([^{]+)/);if(D){var F=Bt(D[1]);if(!l())return h("@supports missing '{'");var G=x().concat(g());return d()?M({type:"supports",supports:F,rules:G}):h("@supports missing '}'")}}function H(){var M=r(),D=y(/^@host\s*/);if(D){if(!l())return h("@host missing '{'");var F=x().concat(g());return d()?M({type:"host",rules:F}):h("@host missing '}'")}}function at(){var M=r(),D=y(/^@media *([^{]+)/);if(D){var F=Bt(D[1]);if(!l())return h("@media missing '{'");var G=x().concat(g());return d()?M({type:"media",media:F,rules:G}):h("@media missing '}'")}}function J(){var M=r(),D=y(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(D)return M({type:"custom-media",name:Bt(D[1]),media:Bt(D[2])})}function Z(){var M=r(),D=y(/^@page */);if(D){var F=S()||[];if(!l())return h("@page missing '{'");for(var G=x(),ut;ut=C();)G.push(ut),G=G.concat(x());return d()?M({type:"page",selectors:F,declarations:G}):h("@page missing '}'")}}function j(){var M=r(),D=y(/^@([-\w]+)?document *([^{]+)/);if(D){var F=Bt(D[1]),G=Bt(D[2]);if(!l())return h("@document missing '{'");var ut=x().concat(g());return d()?M({type:"document",document:G,vendor:F,rules:ut}):h("@document missing '}'")}}function ot(){var M=r(),D=y(/^@font-face\s*/);if(D){if(!l())return h("@font-face missing '{'");for(var F=x(),G;G=C();)F.push(G),F=F.concat(x());return d()?M({type:"font-face",declarations:F}):h("@font-face missing '}'")}}var St=ne("import"),gt=ne("charset"),xe=ne("namespace");function ne(M){var D=new RegExp("^@"+M+"\\s*([^;]+);");return function(){var F=r(),G=y(D);if(G){var ut={type:M};return ut[M]=G[1].trim(),F(ut)}}}function le(){if(n[0]=="@")return X()||at()||J()||Y()||St()||gt()||xe()||j()||Z()||H()||ot()}function be(){var M=r(),D=S();return D?(x(),M({type:"rule",selectors:D,declarations:L()})):h("selector missing")}return Ws(c())}function Bt(n){return n?n.replace(/^\s+|\s+$/g,""):""}function Ws(n,t){var e=n&&typeof n.type=="string",s=e?n:t;for(var i in n){var r=n[i];Array.isArray(r)?r.forEach(function(a){Ws(a,s)}):r&&typeof r=="object"&&Ws(r,s)}return e&&Object.defineProperty(n,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),n}const qa={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:(n,t)=>{switch(t){case"W":return`${n}周`;default:return`${n}日`}},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:(n,t)=>{const e=n*100+t;return e<600?"凌晨":e<900?"早上":e<1100?"上午":e<1300?"中午":e<1800?"下午":"晚上"}};yn(qa);function Ha(n,t=(e,s)=>e<=s){const e=n.length;let s=Math.floor(e/2);for(;s>0;){for(let i=s;i<e;i++){const r=n[i];let a=i;for(;a>=s&&!t(n[a-s],r);)n[a]=n[a-s],a-=s;n[a]=r}s=Math.floor(s/2)}}let xn;try{xn=Promise}catch{xn=function(){}}const $s=(n,t="image/svg+xml",e="utf-8")=>e==="base64"?new Blob([n],{type:`${t};${e}`}):new Blob([n],{type:`${t};charset=${e}`}),Js=n=>new XMLSerializer().serializeToString(n),ja=(n,t="text/html")=>new DOMParser().parseFromString(n,t),bn=(n,t="image/svg+xml",e="utf-8")=>$s(Js(n),t,e),Zs=(n,t)=>new Promise(e=>{const s=document.createElement("a");s.style.visibility="hidden",document.body.appendChild(s),s.download=t,typeof n=="string"?s.href=n:s.href=window.URL.createObjectURL(n),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(s.href),e()});function vn(n=["*"],t){return new Promise((e,s)=>{if(!globalThis.document||!(globalThis.document instanceof Document))return s(new Error("This is not a browser environment"));const i=globalThis.document.createElement("input");i.setAttribute("type","file"),i.setAttribute("visibility","hidden"),Array.isArray(n)&&n.length>0&&i.setAttribute("accept",n.join(",")),t&&i.setAttribute("multiple","true"),globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!i.files||i.files?.length===0)&&s(new Error("Cancel select"))},1e3)},{once:!0});const r=()=>{if(i.removeEventListener("change",r),!i.files||i.files?.length===0)s(new Error("Cancel select"));else{const a=Array.from(i.files);!n.includes("*")&&a.some(o=>!n.includes(`.${Sn(o)}`))&&s(new Error(`Please select files in ${n} format`)),i.remove(),e(a)}};i.addEventListener("change",r),i.click()})}function es(n,t="text",e){return new Promise((s,i)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{s(a.target?.result)}),r.addEventListener("error",a=>{i(a)}),t){case"dataURL":r.readAsDataURL(n);break;case"binaryString":r.readAsBinaryString(n);break;case"arrayBuffer":r.readAsArrayBuffer(n);break;case"text":default:r.readAsText(n)}})}async function Wa(n){const t=await es(n,"arrayBuffer");return cn(t)}const Sn=n=>{let t;return n instanceof File?t=n.name:t=n,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function Jt(n,t={},e=[],s){return{tag:n,props:t,children:e,el:s}}function pe(n,t){if(n.el)return n.el;if(n.el=document.createElement(n.tag),n.props)for(const e in n.props){const s=n.props[e];e.startsWith("on")?n.el.addEventListener(e.slice(2).toLowerCase(),s):n.el.setAttribute(e,s)}return n.children&&(typeof n.children=="string"?n.el.textContent=n.children:n.children.forEach(e=>{pe(e,n.el)})),t?.appendChild(n.el),n.el}function ss(n,t){if(!n.el)return;if(n.tag!==t.tag){(n.el.parentElement||document.body).replaceChild(pe(t),n.el);return}const e=t.el=n.el,s=n.props,i=t.props;for(const o in s)o in i||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),s[o]):e.removeAttribute(o));for(const o in i){const h=s[o],c=i[o];if(c!=h)if(o.startsWith("on")){const l=o.slice(2).toLowerCase();e.removeEventListener(l,h),e.addEventListener(l,c)}else o==="style"?Object.keys(c||{}).forEach(l=>{const d=String(c[l]).toLowerCase().includes("!important")?"important":"";e.style.setProperty(ft(l),String(c[l]).replace(/!important/i,""),d)}):e.setAttribute(o,c)}const r=n.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{pe(o,e)});else{const o=Math.min(r.length,a.length);for(let h=0;h<o;h++)ss(r[h],a[h]);a.length>r.length&&a.slice(r.length).forEach(h=>{pe(h,e)}),a.length<r.length&&r.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}function Cn(n,t){if(!n.isEqualNode(t)){if(n.nodeName!==t.nodeName){(n.parentElement||document.body).replaceChild(t,n);return}if(n.nodeType===Node.TEXT_NODE){n.textContent!==t.textContent&&(n.textContent=t.textContent);return}for(let e=n.attributes.length-1;e>=0;e--){const s=n.attributes[e].name;!t.hasAttribute(s)&&s!=="open"&&n.removeAttribute(s)}for(let e=0;e<t.attributes.length;e++){const s=t.attributes[e].name,i=t.attributes[e].value;n.setAttribute(s,i)}for(let e=0;e<t.childNodes.length;e++)n.childNodes[e]?Cn(n.childNodes[e],t.childNodes[e]):n.appendChild(t.childNodes[e].cloneNode(!0));for(;n.childNodes.length>t.childNodes.length;)n.lastChild&&n.removeChild(n.lastChild)}}class $a{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:s,wasClean:i}=t;console.log(`ws closed : ${e} ${s} ${i}`)},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 s=this.waitingResponse[e.requestid];s?s.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,s=this.waitingResponse[e]={requestid:e};try{let i;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?i=t:i=JSON.stringify({...s,...t});const r=await new Promise((a,o)=>{s.resolve=a,this.sendWithRetry(i),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-s.requestid)/1e3),r}catch(i){return Promise.reject(i)}finally{delete this.waitingResponse[e]}}async send(t,e,s=i=>{console.log(i)}){this.sendPayload(t).then(e,s)}}function Ja(){const n=window.screen;return{screenWidth:n.width,screenHeight:n.height,screenX:window.screenX,screenY:window.screenY}}function Ee(){const n=document.documentElement;return{clientWidth:n.clientWidth,clientHeight:n.clientHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,offsetWidth:n.offsetWidth,offsetHeight:n.offsetHeight,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft,offsetParent:n.offsetParent}}function Za(){const n=document.body;return{clientWidth:n.clientWidth,clientHeight:n.clientHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,offsetWidth:n.offsetWidth,offsetHeight:n.offsetHeight,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft,offsetParent:n.offsetParent}}function Ka(){return typeof window.innerWidth=="number"?{width:window.innerWidth,height:window.innerHeight}:document.compatMode==="CSS1Compat"?{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}:{width:document.body.clientWidth,height:document.body.clientHeight}}function Qa(){const{scrollWidth:n,scrollHeight:t}=Ee();return{width:n,height:t}}function En(n){const{top:t,left:e,width:s,height:i}=n.getBoundingClientRect(),{scrollLeft:r,scrollTop:a}=Ee();return{x:e+r,y:t+a,width:s,height:i}}function to(n){let t=n,e=0,s=0;for(;t!==null;)e+=t.offsetLeft,s+=t.offsetTop,t.offsetParent instanceof HTMLElement?t=t.offsetParent:t=null;return{x:e,y:s,width:n.offsetWidth,height:n.offsetHeight}}function Tn(n){return n.getBoundingClientRect()}function eo(n){const t=n.getBoundingClientRect();return{x:n.offsetLeft,y:n.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function so(){const{clientHeight:n,scrollTop:t,scrollHeight:e}=Ee(),s=e-n;return s<=0?0:t/s*100}function io(n){if("center"in n){const t=n.center,e=Tn(n.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:n.clientX,y:n.clientY}}function Pn(n){if("center"in n)return n.center;if(typeof n.pageX=="number"&&typeof n.pageY=="number")return{x:n.pageX,y:n.pageY};const{scrollLeft:t,scrollTop:e}=Ee();return{x:n.clientX+t,y:n.clientY+e}}function Tt(n,t){if(!t&&"offsetX"in n)return{x:n.offsetX,y:n.offsetY};const e=Pn(n),s=En(t||n.target);return{x:e.x-s.x,y:e.y-s.y}}const is=()=>{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()},no=()=>{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()},Ks=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(n)||/opera/i.test(n)?t="Opera":/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()},ro=()=>{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},ao=()=>"geolocation"in navigator?new Promise((n,t)=>{navigator.geolocation.getCurrentPosition(e=>{const s=e.coords.latitude,i=e.coords.longitude;n({latitude:s,longitude:i})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function oo(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function ho(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Qs(){return is()==="ios"}function ti(){return is()==="macos"}function co(){return Qs()|ti()}function _n(){return is()==="android"}function lo(){return Qs()||_n()}function uo(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function Dn(){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 i=n.indexOf("rv:");return parseInt(n.substring(i+3,n.indexOf(".",i)),10)}const s=n.indexOf("Edge/");return s>0?parseInt(n.substring(s+5,n.indexOf(".",s)),10):-1}const fo=Dn()!==-1;function mo(){const n=document.documentMode;return n&&(n===9||n===10)}function An(){return Ks()==="wechat"}function In(){return Ks()==="ali"}function po(){return An()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function go(){return In()&&navigator.userAgent.match(/miniprogram/i)}const yo=typeof document<"u",kn=typeof window<"u",wo=typeof history<"u",xo=kn&&window.File&&window.FileReader&&window.FileList&&window.Blob,Mn=(()=>{const n=en();return!!(n.Worker&&n.Blob&&n.Promise&&n.OffscreenCanvas&&n.OffscreenCanvasRenderingContext2D&&n.HTMLCanvasElement&&n.HTMLCanvasElement.prototype.transferControlToOffscreen&&n.URL&&n.URL.createObjectURL)})(),bo=typeof Path2D=="function"&&typeof DOMMatrix=="function",Ln=function(){if(!en().OffscreenCanvas)return!1;const t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);const s=t.transferToImageBitmap();try{e.createPattern(s,"no-repeat")}catch{return!1}return!0}(),vo=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},So="webkit moz ms o".split(" ");function ns(n){return typeof n=="function"&&/native code/.test(n.toString())}function Co(n){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let s=100;const i=function(){const r=Math.min(t.clientWidth,n);t.dataset.width=r,t.dataset.rem=s=Math.round(100*(r/n)),t.style.fontSize=s+"px"};i(),window.rem2px=function(r){return r=parseFloat(r),r*s},window.px2rem=function(r){return r=parseFloat(r),r/s},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",i,!1)}function O(n){return n*Math.PI/180}function it(n){return n*180/Math.PI}function rs(n,t,e=0){return Math.sqrt(n*n+t*t+e*e)}function as(n,t,e,s){return rs(e-n,s-t)}function os(n,t,e,s){const i=e-n,r=s-t;return i*i+r*r}function Zt(n,t,e,s){let i=Math.atan2(s-t,e-n);return i<0&&(i+=Math.PI*2),i}function It(n,t){return{dx:Math.cos(n)*t,dy:Math.sin(n)*t}}function Eo(n,t,e){if(typeof e=="number"){const s=Math.sqrt(Math.pow(n,2)+Math.pow(t,2)+Math.pow(e,2));return{x:n/=s,y:t/=s,z:e/=s}}else{const s=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return{x:n/=s,y:t/=s}}}function To(n,t,e,s,i=10){if(Math.abs(e-n)<i&&Math.abs(s-t)<i)return"no";const r=it(Zt(n,t,e,s));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}const Rn=Po("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 Po(n,t=10){const e={},s=n.split(",");for(let i=0;i<s.length;i+=2){const r="&"+s[i+1]+";",a=parseInt(s[i],t);e[r]="&#"+a+";"}return e["\\xa0"]=" ",e}function ht(n,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)n=n.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return n}function hs(n){let t,e;if(!n)throw new Error("cannot create a random attribute name for an undefined object");const s="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=s[Math.floor(Math.random()*s.length)];while(n[t]);return t}function _o(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function Do(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const Te={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"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}};class cs{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const s=this.__ctx.__createElement("stop");if(s.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&&(s.setAttribute("stop-color",ht("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),s.setAttribute("stop-opacity",r[4]))}else s.setAttribute("stop-color",e);this.__root.appendChild(s)}}class ei{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Pe{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:s=500}){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=s),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(Te);for(let e=0,s=t.length;e<s;e++){const i=t[e];this[i]=Te[i].canvas}}__getStyleState(){const t={},e=Object.keys(Te);for(let s=0,i=e.length;s<i;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,i=e.length;s<i;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];i.setAttribute(o,e[o])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const s=this.__currentElementsToStyle;s&&(e.setAttribute(t,""),e=s.element,s.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(Te);for(let r=0;r<i.length;r++){const a=Te[i[r]],o=this[i[r]];if(a.apply){if(o instanceof ei){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,ht("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof cs)e.setAttribute(a.apply,ht("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);if(c){e.setAttribute(a.svgAttr,ht("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const d=this.globalAlpha;d!=null&&(l*=d),e.setAttribute(a.svgAttr+"-opacity",""+l)}}else{let h=a.svgAttr;if(i[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 i=Object.keys(Rn);for(let r=0,a=i.length;r<a;r++){const o=i[r],h=Rn[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 i=this.__createElement("g");e.appendChild(i),this.__currentElement=i}let s=this.__currentElement.getAttribute("transform");s?s+=" ":s="",s+=t,this.__currentElement.setAttribute("transform",s)}scale(t,e){e===void 0&&(e=t),this.__addTransform(ht("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(ht("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(ht("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,i,r,a){this.__addTransform(ht("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,d:i,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(ht("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(ht("L {x} {y}",this.__currentPosition)):this.__addPathCommand(ht("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,i,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(ht("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:i,x:r,y:a}))}quadraticCurveTo(t,e,s,i){this.__currentPosition={x:s,y:i},this.__addPathCommand(ht("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:i}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,s,i,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===s&&e===i||r===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),c=this.normalize([s-t,i-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const l=h[0]*c[0]+h[1]*c[1],d=Math.acos(Math.abs(l)),g=this.normalize([h[0]+c[0],h[1]+c[1]]),y=r/Math.sin(d/2),m=t+y*g[0],x=e+y*g[1],b=[-h[1],h[0]],S=[c[1],-c[0]],C=function(X){const Y=X[0];return X[1]>=0?Math.acos(Y):-Math.acos(Y)},L=C(b),R=C(S);this.lineTo(m+b[0]*r,x+b[1]*r),this.arc(m,x,r,L,R)}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,s,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],i=s.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&s.removeChild(i[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,i){if(t===0&&e===0&&s===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:s,height:i,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,s,i){const r=this.__createElement("linearGradient",{id:hs(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new cs(r,this)}createRadialGradient(t,e,s,i,r,a){const o=this.__createElement("radialGradient",{id:hs(this.__ids),cx:i+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new cs(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),s={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"&&(s.decoration="underline"),this.__fontHref&&(s.href=this.__fontHref),s}__wrapTextLink(t,e){if(t.href){const s=this.__createElement("a");return s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),s.appendChild(e),s}return e}__applyText(t,e,s,i){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:s,"text-anchor":_o(this.textAlign),"dominant-baseline":Do(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(i),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,s){this.__applyText(t,e,s,"fill")}strokeText(t,e,s){this.__applyText(t,e,s,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,i,r,a){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===r&&(r=(r+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+s*Math.cos(r),h=e+s*Math.sin(r),c=t+s*Math.cos(i),l=e+s*Math.sin(i),d=a?0:1;let g=0,y=r-i;y<0&&(y+=2*Math.PI),a?g=y>Math.PI?0:1:g=y>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(ht("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:g,sweepFlag:d,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=hs(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",s),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",ht("url(#{id})",{id:s})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],s,i,r,a,o=0,h=0,c,l,d,g,y,m,x,b;if(t.length===3)s=t[1],i=t[2],c=e.width,l=e.height,r=c,a=l;else if(t.length===5)s=t[1],i=t[2],r=t[3],a=t[4],c=e.width,l=e.height;else if(t.length===9)o=t[1],h=t[2],c=t[3],l=t[4],s=t[5],i=t[6],r=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const S=this.__closestGroupOrSvg();this.__currentElement;const C="translate("+s+", "+i+")";if(e instanceof Pe){if(d=e.getSvg().cloneNode(!0),d.childNodes&&d.childNodes.length>1){for(g=d.childNodes[0];g.childNodes.length;)b=g.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(g.childNodes[0]);if(y=d.childNodes[1],y){const L=y.getAttribute("transform");let R;L?R=L+" "+C:R=C,y.setAttribute("transform",R),S.appendChild(y)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(m=this.__createElement("image"),m.setAttribute("width",r),m.setAttribute("height",a),m.setAttribute("preserveAspectRatio","none"),(o||h||c!==e.width||l!==e.height)&&(x=this.__document.createElement("canvas"),x.width=r,x.height=a,x.getContext("2d")?.drawImage(e,o,h,c,l,0,0,r,a),e=x),m.setAttribute("transform",C),m.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),S.appendChild(m))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=hs(this.__ids);let r;return s.setAttribute("id",i),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")),s.appendChild(r),this.__SVGdefs.appendChild(s)):t instanceof Pe&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new ei(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class ls{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s,i=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new Pe({canvas:this.canvas,width:e||this.canvas.width,height:s||this.canvas.height}))}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(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&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(this.customContext.fillStyle=t.gradientCustom))}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,s,i){return this.context.fillRect(t,e,s,i),this.customContext&&this.customContext.fillRect(t,e,s,i),this}fillText(t,e,s,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,i),this.customContext&&this.customContext.fillText(t,e,s),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,s,i){return this.context.strokeText(t,e,s,i),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,i){return this.context.strokeRect(t,e,s,i),this.customContext&&this.customContext.strokeRect(t,e,s,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,s,i),this.customContext&&this.customContext.clearRect(t,e,s,i),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext&&this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const s=new Path2D;s.addPath(t,e),this.currentPath2D=s}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&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,s=0){return this.translate(e,s),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-s),this.changePath2D(),this}scale(t,e=t,s=0,i=0){return this.translate(s,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-s,-i),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,s,i,r,a){return this.context.arc(t,e,s,i,r,a),this.customContext&&this.customContext.arc(t,e,s,i,r,a?-1:1),this.currentPath2D.arc(t,e,s,i,r,a),this}arcTo(t,e,s,i,r){return this.context.arcTo(t,e,s,i,r),this.customContext&&this.customContext.arcTo(t,e,s,i,r),this.currentPath2D.arcTo(t,e,s,i,r),this}ellipse(t,e,s,i,r,a,o,h){return this.context.ellipse(t,e,s,i,r,a,o,h),this.currentPath2D.ellipse(t,e,s,i,r,a,o,h),this}quadraticCurveTo(t,e,s,i){return this.context.quadraticCurveTo(t,e,s,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,i),this.currentPath2D.quadraticCurveTo(t,e,s,i),this}bezierCurveTo(t,e,s,i,r,a){return this.context.bezierCurveTo(t,e,s,i,r,a),this.customContext&&this.customContext.bezierCurveTo(t,e,s,i,r,a),this.currentPath2D.bezierCurveTo(t,e,s,i,r,a),this}rect(t,e,s,i){return this.context.rect(t,e,s,i),this.customContext&&this.customContext.rect(t,e,s,i),this.currentPath2D.rect(t,e,s,i),this}createLinearGradient(t,e,s,i,r){const a=this.context.createLinearGradient(t,e,s,i);return r&&Object.entries(r).forEach(([o,h])=>{a.addColorStop(parseFloat(o),h)}),a}createRadialGradient(t,e,s,i,r,a,o){const h=this.context.createRadialGradient(t,e,s,i,r,a);return o&&Object.entries(o).forEach(([c,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const s=e[0],i=e[1];this.context.drawImage(t,s,i)}else if(e.length===4){const s=e[0],i=e[1],r=e[2],a=e[3];this.context.drawImage(t,s,i,r,a)}else if(e.length===8){const s=e[0],i=e[1],r=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,s,i,r,a,o,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,s=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,s,i,r)}putImageData(t,e=0,s=0){return this.context.putImageData(t,e,s)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}}class us{x;y;toX;toY;constructor(t){this.x=t?.x||0,this.y=t?.y||0,this.toX=t?.toX||0,this.toY=t?.toY||0}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(){const t=Zt(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),s=Math.min(this.y,this.toY),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:s,width:i-e,height:r-s}}else{const e=Math.sin(t),s=Math.cos(t),i=s*this.x-e*this.y,r=s*this.toX-e*this.toY,a=s*this.y+e*this.x,o=s*this.toY+e*this.toX;return{x:Math.min(i,r),y:Math.min(a,o),width:Math.max(i,r)-Math.min(i,r),height:Math.max(a,o)-Math.min(a,o)}}}interpolate(t){return{x:this.x+t*(this.toX-this.x),y:this.y+t*(this.toY-this.y)}}intersection(t){const e=this.x,s=this.y,i=t.toX,r=t.toY,a=this.toX-e,o=t.x-i;if(!a&&!o)return null;const h=(this.toY-s)/a,c=(t.y-r)/o;if(a){if(!o)return{x:i,y:h*(i-e)+s}}else return{x:e,y:c*(e-i)+r};const l=(-c*i+r+h*e-s)/(h-c),d=h*(l-e)+s;return isNaN(l)||isNaN(d)?null:{x:l,y:d}}}const On=us;class si extends us{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,this.toX=t.toX,this.toY=t.toY}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,s,i,r,a,o,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,s,i,r,a,o,h,!this.sweepFlag)}convert(t,e,s,i,r,a,o,h,c){const l=o/180*Math.PI,d=(t-s)/2,g=(e-i)/2,y=Math.cos(l)*d+Math.sin(l)*g,m=-Math.sin(l)*d+Math.cos(l)*g,x=y*y/(r*r)+m*m/(a*a);if(x>1){const j=Math.sqrt(x);throw r=j*r,a=j*a,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${a}.`)}const b=Math.sqrt((r*r*a*a-r*r*m*m-a*a*y*y)/(r*r*m*m+a*a*y*y)),S=h!=c?1:-1,C=S*b*r*m/a,L=S*b*-a*y/r,R=(t+s)/2,X=(e+i)/2,Y=Math.cos(l)*C-Math.sin(l)*L+R,H=Math.sin(l)*C+Math.cos(l)*L+X,at=(j,ot,St,gt)=>(j*gt>=ot*St?1:-1)*Math.acos((j*St+ot*gt)/(Math.sqrt(j*j+ot*ot)*Math.sqrt(St*St+gt*gt))),J=at(1,0,t-Y,e-H)-l,Z=at(t-Y,e-H,s-Y,i-H);return[Y,H,r,a,l,J,J+Z]}}class Ao extends us{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,s,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(){const t=[this.x,this.toX],e=[this.y,this.toY];let s,i,r,a;for(let c=0;c<2;++c)s=c==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,i=c==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=c==0?this.x:this.y,Math.abs(s)>1e-12&&(a=-i/(2*s),0<a&&a<1&&[t,e][c].push(s*a*a+i*a+r));const o={x:Math.min.apply(0,t),y:Math.min.apply(0,e)},h={x:Math.max.apply(0,t),y:Math.max.apply(0,e)};return{x:o.x,y:o.y,width:h.x-o.x,height:h.y-o.y}}interpolate(t){return{x:(1-t)*(1-t)*this.x+2*(1-t)*t*this.cx+t*t*this.toX,y:(1-t)*(1-t)*this.y+2*(1-t)*t*this.cy+t*t*this.toY}}}const Io=Ao;class mt extends us{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}toSVGPathData(){return[["C",this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY]]}toCanvasContext(t){t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY)}getBoundingClientRect(){let t=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),e=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),s=this.x-this.c1x,i=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t;const a=[this.y,this.toY],o=[this.x,this.toX];let h;const c=[];Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),t=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),e=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),s=this.y-this.c1y,i=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t,Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y}));let l=[],d=c.length;for(let m=0;m<d;m++){for(let x=m+1;x<d;x++)c[m].X===c[x].X&&c[m].Y===c[x].Y&&(x=++m);l.push({X:c[m].X,Y:c[m].Y})}const g={x:Math.min.apply(Math,o),y:Math.min.apply(Math,a)},y={x:Math.max.apply(Math,o),y:Math.max.apply(Math,a)};return{x:g.x,y:g.y,width:y.x-g.x,height:y.y-g.y,dots:l}}interpolate(t){return{x:Math.pow(1-t,3)*this.x+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.toX,y:Math.pow(1-t,3)*this.y+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.toY}}static base3(t,e,s,i,r){const a=-3*e+9*s-9*i+3*r,o=t*a+6*e-12*s+6*i;return t*o-3*e+3*s}static bezlen(t,e,s,i,r,a,o,h,c=1){c=Math.max(0,Math.min(c,1));const l=c/2,d=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],g=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let y=0;for(let m=0;m<12;m++){const x=l*d[m]+l,b=this.base3(x,t,s,r,o),S=this.base3(x,e,i,a,h);y+=g[m]*Math.sqrt(b*b+S*S)}return l*y}length(t=1){return mt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,s=this.y,i=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,h=this.toX,c=this.toY;if(t<0||mt.bezlen(e,s,i,r,a,o,h,c)<t)return 0;let l=1,d=l/2,g=l-d,y=mt.bezlen(e,s,i,r,a,o,h,c,g);for(;Math.abs(y-t)>.01;)d/=2,g+=(y<t?1:-1)*d,y=mt.bezlen(e,s,i,r,a,o,h,c,g);return g}getPointAtSegmentLength(t){const e=this.getTatLen(t);let s=1-e,i=Math.pow(s,3),r=Math.pow(s,2),a=e*e,o=a*e,h=i*this.x+r*3*e*this.c1x+s*3*e*e*this.c2x+o*this.toX,c=i*this.y+r*3*e*this.c1y+s*3*e*e*this.c2y+o*this.toY,l=this.x+2*e*(this.c1x-this.x)+a*(this.c2x-2*this.c1x+this.x),d=this.y+2*e*(this.c1y-this.y)+a*(this.c2y-2*this.c1y+this.y),g=this.c1x+2*e*(this.c2x-this.c1x)+a*(this.toX-2*this.c2x+this.c1x),y=this.c1y+2*e*(this.c2y-this.c1y)+a*(this.toY-2*this.c2y+this.c1y),m=s*this.x+e*this.c1x,x=s*this.y+e*this.c1y,b=s*this.c2x+e*this.toX,S=s*this.c2y+e*this.toY,C=90-Math.atan2(l-g,d-y)*180/Math.PI;return{x:h,y:c,m:{x:l,y:d},n:{x:g,y},start:{x:m,y:x},end:{x:b,y:S},alpha:C}}}const _e=Math.PI*2;function Fn(n,t,e,s){const i=n*s-t*e<0?-1:1;let r=n*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function ko(n,t,e,s,i,r,a,o,h,c){const l=c*(n-e)/2+h*(t-s)/2,d=-h*(n-e)/2+c*(t-s)/2,g=a*a,y=o*o,m=l*l,x=d*d;let b=g*y-g*x-y*m;b<0&&(b=0),b/=g*x+y*m,b=Math.sqrt(b)*(i===r?-1:1);const S=b*a/o*d,C=b*-o/a*l,L=c*S-h*C+(n+e)/2,R=h*S+c*C+(t+s)/2,X=(l-S)/a,Y=(d-C)/o,H=(-l-S)/a,at=(-d-C)/o,J=Fn(1,0,X,Y);let Z=Fn(X,Y,H,at);return r===0&&Z>0&&(Z-=_e),r===1&&Z<0&&(Z+=_e),[L,R,J,Z]}function Mo(n,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(n),i=Math.sin(n),r=Math.cos(n+t),a=Math.sin(n+t);return[s,i,s-i*e,i+s*e,r+a*e,a-r*e,r,a]}function Nn(n,t,e,s,i,r,a,o,h){const c=Math.sin(h*_e/360),l=Math.cos(h*_e/360),d=l*(n-e)/2+c*(t-s)/2,g=-c*(n-e)/2+l*(t-s)/2;if(d===0&&g===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const y=d*d/(a*a)+g*g/(o*o);y>1&&(a*=Math.sqrt(y),o*=Math.sqrt(y));const m=ko(n,t,e,s,i,r,a,o,c,l),x=[];let b=m[2],S=m[3];const C=Math.max(Math.ceil(Math.abs(S)/(_e/4)),1);S/=C;for(let L=0;L<C;L++)x.push(Mo(b,S)),b+=S;return x.map(L=>{for(let R=0;R<L.length;R+=2){let X=L[R+0],Y=L[R+1];X*=a,Y*=o;const H=l*X-c*Y,at=c*X+l*Y;L[R+0]=H+m[0],L[R+1]=at+m[1]}return L})}function ii(n,t,e,s,i,r){return[n/3+.6666666666666666*e,t/3+.6666666666666666*s,i/3+.6666666666666666*e,r/3+.6666666666666666*s,i,r]}function De(n,t,e,s){return[n,t,e,s,e,s]}const Ae={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class ae{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&A.attribute(s,e),s}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||Vs()})}static downloadFromSVGElement(t,e="shape"){return Zs(bn(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Zs($s(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return Js(t)}static isSVGPath(t){return typeof t!="string"?!1:(t=t.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(t)&&/[\dz]$/i.test(t))}static SVGPathDataToD(t){return t.map(e=>{if(!e[0])return"";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 parseSVGPath(t){const e=[];return ae.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,i,r)=>{let a=i.toLowerCase();const o=gn(r);for(a=="m"&&o.length>Ae[a]&&(e.push([i,...o.splice(0,Ae[a])]),a="l",i=i=="m"?"l":"L");o.length;){if(o.length<Ae[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${i} } args:{ ${o} }`);e.push([i,...o.splice(0,Ae[a])])}return a=="z"&&e.push([i]),""}),e}static absolutizeSVGPath(t){let e=0,s=0,i=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]+=i,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=i;break;default:for(let c=1;c<a.length;)a[c++]+=i,a[c++]+=r}switch(h){case"Z":i=e,r=s;break;case"H":i=a[1];break;case"V":r=a[1];break;case"M":i=e=a[1],r=s=a[2];break;default:i=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,s=0,i=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]-=i,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=i;break;default:for(let c=1;c<a.length;)a[c++]-=i,a[c++]-=r}switch(h){case"z":i=e,r=s;break;case"h":i+=a[1];break;case"v":r+=a[1];break;case"m":i+=a[1],r+=a[2],e+=a[1],s+=a[2];break;default:i+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){const e=[];let s=0,i=0,r=0,a=0,o=0,h=0,c=0,l=0,d;for(let g=0,y=t.length;g<y;g++){let m=t[g];const x=m[0];switch(x){case"M":s=m[1],i=m[2];break;case"A":const b=Nn(r,a,m[6],m[7],m[4],m[5],m[1],m[2],m[3]);if(!b.length)continue;b.forEach((L,R)=>{const[X,Y,H,at,J,Z,j,ot]=L;m=["C",H,at,J,Z,j,ot],R<b.length-1&&e.push(m)});break;case"S":let S=r,C=a;(d=="C"||d=="S")&&(S+=S-c,C+=C-l),m=["C",S,C,m[1],m[2],m[3],m[4]];break;case"T":d=="Q"||d=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),m=["C",...ii(r,a,o,h,m[1],m[2])];break;case"Q":o=m[1],h=m[2],m=["C",...ii(r,a,m[1],m[2],m[3],m[4])];break;case"L":m=["C",...De(r,a,m[1],m[2])];break;case"H":m=["C",...De(r,a,m[1],a)];break;case"V":m=["C",...De(r,a,r,m[1])];break;case"Z":m=["C",...De(r,a,s,i)];break}d=x,r=m[m.length-2],a=m[m.length-1],m.length>4?(c=m[m.length-4],l=m[m.length-3]):(c=r,l=a),e.push(m)}return e}static catmullRom2bezier(t){const e=[];for(let s=0,i=t.length;i-2>s;s+=2){let r;s==0?r=[{x:t[s],y:t[s+1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}]:i-4==s?r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+2],y:t[s+3]}]:r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+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 zvhToLSVGPath(t){const e=[];let s=["L",0,0],i;for(let r=0,a=t.length;r<a;r++){const o=t[r];switch(o[0]){case"M":s=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(s);break;case"H":i=e[e.length-1]||["L",0,0],e.push(["L",o[1],i[i.length-1]]);break;case"V":i=e[e.length-1]||["L",0,0],e.push(["L",i[i.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 s,i=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,s&&(s[0]===c.to?(i=2*Number(s[c.x+2])-Number(s[c.x]),r=2*Number(s[c.x+3])-Number(s[c.x+1])):(i=Number(s[s.length-2]),r=Number(s[s.length-1]))),h.splice(1,0,i,r)),s=h}return t}}const yt=ae;class wt{cX;cY;x;y;degree;scalarX;scalarY;startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){this.cX=0,this.cY=0,this.x=t?.x||0,this.y=t?.y||0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&(this.cX=t.centerX-this.x,this.cY=t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.reset(t?.d,t?.originMatrix)}reset(t,e){typeof t=="string"?this.resetFromSVGPathData(yt.parseSVGPath(t),e):t instanceof wt?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const s=yt.normalizeSVGPath(yt.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let i=!1;for(let r=0,a=s.length;r<a;r++){const o=s[r];if(o[0]=="M"){i||(i=!0,this.startPathX=o[1],this.startPathY=o[2]),this.prevPathX=o[1],this.prevPathY=o[2];continue}this.appendLine(new mt({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}e&&({x:this.startPathX,y:this.startPathY}=e.transformPoint({x:this.startPathX,y:this.startPathY}),{x:this.prevPathX,y:this.prevPathY}=e.transformPoint({x:this.prevPathX,y:this.prevPathY}),this.normalizedLines.forEach(r=>{({x:r.x,y:r.y}=e.transformPoint({x:r.x,y:r.y})),{x:r.c1x,y:r.c1y}=e.transformPoint({x:r.c1x,y:r.c1y}),{x:r.c2x,y:r.c2y}=e.transformPoint({x:r.c2x,y:r.c2y}),{x:r.toX,y:r.toY}=e.transformPoint({x:r.toX,y:r.toY})}))}static fromPolymorphPoints(t){const e=new wt;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let s=2,i=t.length;s+5<i;s+=6)e.appendLine(new mt({c1x:t[s],c1y:t[s+1],c2x:t[s+2],c2y:t[s+3],toX:t[s+4],toY:t[s+5]}));return e}static fromLines(t){const e=new wt;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let s=0,i=t.length;s<i;s++)e.appendLine(t[s]);return e}appendLine(t){if(t instanceof si){Nn(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,d,g,y,m,x,b,S]=c;this.normalizedLines.push(new mt({x:this.prevPathX,y:this.prevPathY,c1x:g,c1y:y,c2x:m,c2y:x,toX:b,toY:S})),this.prevPathX=b,this.prevPathY=S});return}let e,s,i,r,a,o;t instanceof mt?(e=t.c1x,s=t.c1y,i=t.c2x,r=t.c2y,a=t.toX,o=t.toY):t instanceof Io?[e,s,i,r,a,o]=ii(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,i,r,a,o]=De(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new mt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:i,c2y:r,toX:a,toY:o})),this.prevPathX=a,this.prevPathY=o}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform(),i=[];i.push(["M",t,e]);for(let r=0,a=s.length;r<a;r++)i.push(...s[r].toSVGPathData());return i}toSVGPathD(){return yt.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:s,normalizedLines:i}=this.updateTransform();t.beginPath(),t.moveTo(e,s),i.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],s=[];if(t.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),s.push(c.y,c.y+c.height)}),e.length==0||s.length==0)return{x:0,y:0,width:0,height:0};const i=Math.min.apply(0,e),r=Math.min.apply(0,s),a=Math.max.apply(0,e),o=Math.max.apply(0,s);return{x:i,y:r,width:a-i,height:o-r}}update(t){this.cX=typeof t.cX=="number"?t.cX:this.cX,this.cY=typeof t.cY=="number"?t.cY:this.cY,this.x=t.x,this.y=t.y,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY}updateTransform(){const t=new ct;if(t.translate(this.x+this.cX,this.y+this.cY),t.rotate(this.degree),t.scale(this.scalarX,this.scalarY),t.translate(-this.cX,-this.cY),t.isIdentity)return{startPathX:this.startPathX,startPathY:this.startPathY,normalizedLines:this.normalizedLines};{let e=this.startPathX,s=this.startPathY;({x:e,y:s}=t.transformPoint({x:e,y:s}));const i=[];return this.normalizedLines.forEach(r=>{let a=r.x,o=r.y,h=r.c1x,c=r.c1y,l=r.c2x,d=r.c2y,g=r.toX,y=r.toY;({x:a,y:o}=t.transformPoint({x:a,y:o})),{x:h,y:c}=t.transformPoint({x:h,y:c}),{x:l,y:d}=t.transformPoint({x:l,y:d}),{x:g,y}=t.transformPoint({x:g,y}),i.push(new mt({x:a,y:o,c1x:h,c1y:c,c2x:l,c2y:d,toX:g,toY:y}))}),{startPathX:e,startPathY:s,normalizedLines:i}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,s)=>e+=s.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let s=0;const i=e.length;for(let r=0;r<i;r++){const a=e[r],o=a.length();if(s+o>=t)return a.getPointAtSegmentLength(t-s);s+=o}return e[i-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:s,normalizedLines:i}=this.updateTransform(),r=i.length;if(r===0)return{x:e,y:s};if(r===1)return i[0].interpolate(t);{let a=t*r,o=i[0];if(a--,a>1)for(let h=1;h<r&&(o=i[h],a>1);h++)a-=1;return o.interpolate(a)}}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const s=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(s,t):s}}getSubpathsAtLength(t,e,s){const{startPathX:i,startPathY:r,normalizedLines:a}=t.updateTransform();let o=null,h=0;const c=new wt;c.prevPathX=c.startPathX=i,c.prevPathY=c.startPathY=r;for(let l=0,d=a.length;l<d;l++){const g=a[l],y=g.length();if(h+y>e&&!o){const m=g.getPointAtSegmentLength(e-h);if(c.appendLine(new mt({c1x:m.start.x,c1y:m.start.y,c2x:m.m.x,c2y:m.m.y,toX:m.x,toY:m.y})),s)return c;o=c,c.appendLine(new mt({c1x:m.n.x,c1y:m.n.y,c2x:m.end.x,c2y:m.end.y,toX:g.x,toY:g.y})),h+=y;continue}h+=y,c.appendLine(g)}return c}closestPoint(t,e){const s=this.getTotalLength();let i={x:t,y:e},r=0,a=1/0,o=8;for(let c=0;c<=s;c+=o){let l=this.getPointAtLength(c),d=os(l.x,l.y,t,e);d<a&&(i=l,r=c,a=d)}for(o/=2;o>.5;){let c=r-o,l=this.getPointAtLength(c),d=os(l.x,l.y,t,e),g=r+o,y=this.getPointAtLength(g),m=os(y.x,y.y,t,e);c>=0&&d<a?(i=l,r=c,a=d):g<=s&&m<a?(i=y,r=g,a=m):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:i,rotation:r>=s?Zt(h.x,h.y,i.x,i.y):Zt(i.x,i.y,h.x,h.y),distance:Math.sqrt(a)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform();return[t,e].concat(s.reduce((i,r)=>i.concat([r.c1x,r.c1y,r.c2x,r.c2y,r.toX,r.toY]),[]))}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let s=t[e-2],i=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=as(t[a],t[a+1],s,i),s=t[a],i=t[a+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,s=e.length;let i=t-s;const r=Math.ceil(t/s),a=[];a.push(["M",e[0],e[1]]);let o=2;for(;o+5<=s-1;){const h=e[o++],c=e[o++],l=e[o++],d=e[o++],g=e[o++],y=e[o++];a.push(["C",h,c,l,d,g,y]);let m=0;for(;m<r&&i>0;)a.push(["C",g,y,g,y,g,y]),i-=6,m++}return a}static mixPoints(t,e,s){const i=t.length,r=new Array(i);for(let a=0;a<i;a++)r[a]=At(t[a]+(e[a]-t[a])*s,6);return r}static getPathInterpolator(t,e){return s=>Math.abs(s-0)<Number.EPSILON?t:Math.abs(s-1)<Number.EPSILON?e:wt.fromPolymorphPoints(wt.mixPoints(new wt({d:t}).polymorphPoints,new wt({d:e}).polymorphPoints,s)).toSVGPathData()}}const Lo=wt;(function(){if(!window.requestAnimationFrame){let n=$();window.requestAnimationFrame=function(t){const e=$(),s=Math.max(0,16-(e-n)),i=window.setTimeout(function(){t(e+s)},s);return n=e+s,i}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})})();const ni=n=>{let t=!1;return window.requestAnimationFrame(function e(s){!t&&n(s)&&window.requestAnimationFrame(e)}),()=>{t=!0}};function ri(n,t=0){if(t==0)return n($()),()=>{};{const e=$();return ni(s=>s-e>=t?(n(s),!1):!0)}}function Ro(n,t=0){let e=!1,s=0,i=$();const r=a=>{if(e)return;s++;const o=a-i-s*t;n(a,s,t-o<=0),ri(r,Math.max(0,t-o))};return ri(r,t),()=>{e=!0}}function Oo(n,t=20){const e=1e3/t;let s=0,i;return()=>($()-s>=e&&(s=$(),i=n()),i)}const Kt=new Je;let ai=!1;function Yn(n,t,e){n&&t&&Kt.set(n,t),!ai&&(ai=!0,requestIdleCallback(s=>{for(ai=!1;s.timeRemaining()>0&&Kt.length>0;){const i=Kt.shift();i&&i[1]()}Kt.length>0&&Yn()},{timeout:e}))}let oi=!1;function hi(n,t,e){if(n&&t&&Kt.set(n,t),oi)return;oi=!0;const s=$();Xn(i=>{for(oi=!1;(i.timeRemaining()>0||e&&$()-s>=e)&&Kt.length>0;){const r=Kt.shift();r&&r[1]()}Kt.length>0&&hi()})}let ds=0,oe=33,Qt=33,ci;const Bn=new MessageChannel,Fo=Bn.port2;Bn.port1.onmessage=n=>{ci!==null&&ci({didTimeout:ds<=$(),timeRemaining:()=>Math.max(0,ds-$())})};function Xn(n){return ci=n,requestAnimationFrame(t=>{let e=t-ds+Qt;e<Qt&&oe<Qt?(e<8&&(e=8),Qt=e<oe?oe:e):e>Qt&&oe>Qt?Qt=e<oe?oe:e:oe=e,ds=t+Qt,Fo.postMessage(null)})}function No(n){return cancelAnimationFrame(n)}function Yo(n){if(typeof setImmediate<"u"&&ns(setImmediate))setImmediate(n);else if(typeof MessageChannel<"u"&&(ns(MessageChannel)||MessageChannel.toString()==="[object MessageChannelConstructor]")){const{port1:t,port2:e}=new MessageChannel;e.onmessage=n,t.postMessage(null)}else typeof Promise<"u"&&ns(Promise)?Promise.resolve().then(n):setTimeout(n,0)}function Bo(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(t=>setTimeout(()=>{throw t}))}class Ie{static _nextId=0;static nextId(){return Ie._nextId++}}const I={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-I.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?I.Bounce.In(n*2)*.5:I.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(s){return t*Math.random()+e*n(s)}},swing:function(n){return n+Math.sin(n*Math.PI*2)/2},causeSeizures:function(n){return n+.2*Math.random()-.1}};function Gn(n){switch(n){case I.Quadratic.In:return I.Quadratic.Out;case I.Quadratic.Out:return I.Quadratic.In;case I.Quadratic.InOut:return I.Quadratic.InOut;case I.Cubic.In:return I.Cubic.Out;case I.Cubic.Out:return I.Cubic.In;case I.Cubic.InOut:return I.Cubic.InOut;case I.Quartic.In:return I.Quartic.Out;case I.Quartic.Out:return I.Quartic.In;case I.Quartic.InOut:return I.Quartic.InOut;case I.Quintic.In:return I.Quintic.Out;case I.Quintic.Out:return I.Quintic.In;case I.Quintic.InOut:return I.Quintic.InOut;case I.Sinusoidal.In:return I.Sinusoidal.Out;case I.Sinusoidal.Out:return I.Sinusoidal.In;case I.Sinusoidal.InOut:return I.Sinusoidal.InOut;case I.Exponential.In:return I.Exponential.Out;case I.Exponential.Out:return I.Exponential.In;case I.Exponential.InOut:return I.Exponential.InOut;case I.Circular.In:return I.Circular.Out;case I.Circular.Out:return I.Circular.In;case I.Circular.InOut:return I.Circular.InOut;case I.Elastic.In:return I.Elastic.Out;case I.Elastic.Out:return I.Elastic.In;case I.Elastic.InOut:return I.Elastic.InOut;case I.Back.In:return I.Back.Out;case I.Back.Out:return I.Back.In;case I.Back.InOut:return I.Back.InOut;case I.Bounce.In:return I.Bounce.Out;case I.Bounce.Out:return I.Bounce.In;case I.Bounce.InOut:return I.Bounce.InOut;default:return n}}const Xo=4,Go=.001,Uo=1e-7,Vo=10,ke=11,fs=1/(ke-1),zo=typeof Float32Array=="function";function Un(n,t){return 1-3*t+3*n}function Vn(n,t){return 3*t-6*n}function zn(n){return 3*n}function ms(n,t,e){return((Un(t,e)*n+Vn(t,e))*n+zn(t))*n}function qn(n,t,e){return 3*Un(t,e)*n*n+2*Vn(t,e)*n+zn(t)}function qo(n,t,e,s,i){let r,a,o=0;do a=t+(e-t)/2,r=ms(a,s,i)-n,r>0?e=a:t=a;while(Math.abs(r)>Uo&&++o<Vo);return a}function Ho(n,t,e,s){for(let i=0;i<Xo;++i){const r=qn(t,e,s);if(r===0)return t;const a=ms(t,e,s)-n;t-=a/r}return t}function jo(n){return n}function li(n,t,e,s){if(!(0<=n&&n<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===t&&e===s)return jo;const i=zo?new Float32Array(ke):new Array(ke);for(let a=0;a<ke;++a)i[a]=ms(a*fs,n,e);function r(a){let o=0,h=1;const c=ke-1;for(;h!==c&&i[h]<=a;++h)o+=fs;--h;const l=(a-i[h])/(i[h+1]-i[h]),d=o+l*fs,g=qn(d,n,e);return g>=Go?Ho(a,d,n,e):g===0?d:qo(a,o,o+fs,n,e)}return a=>a===0||a===1?a:ms(r(a),t,s)}function ui(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]}}function Hn(n){const[t,e,s,i]=ui(n);return[1-s,1-i,1-t,1-e]}function Wo(n){return li(...ui(n))}function $o(n){return li(...Hn(n))}const Xt={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 s=t;s>1;s--)e*=s;return n[t]=e,e}}(),Bernstein:function(n,t){const e=Xt.Utils.Factorial;return e(n)/e(t)/e(n-t)},CatmullRom:function(n,t,e,s,i){const r=(e-n)*.5,a=(s-t)*.5,o=i*i,h=i*o;return(2*t-2*e+r+a)*h+(-3*t+3*e-2*r-a)*o+r*i+t},QuadraticBezier:(n,t,e,s)=>{const i=1-s;return i*i*n+2*i*s*t+s*s*e},CubicBezier:(n,t,e,s,i)=>{const r=1-i;return r*r*r*n+3*r*r*i*t+3*r*i*i*e+i*i*i*s}},Linear:function(n,t){const e=n.length-1,s=e*t,i=Math.floor(s),r=Xt.Utils.Linear;return t<0?r(n[0],n[1],s):t>1?r(n[e],n[e-1],e-s):r(n[i],n[i+1>e?e:i+1],s-i)},Bezier:function(n,t){let e=0;const s=n.length-1,i=Math.pow,r=Xt.Utils.Bernstein;for(let a=0;a<=s;a++)e+=i(1-t,s-a)*i(t,a)*n[a]*r(s,a);return e},CatmullRom:function(n,t){const e=n.length-1;let s=e*t,i=Math.floor(s);const r=Xt.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(i=Math.floor(s=e*(1+t))),r(n[(i-1+e)%e],n[i],n[(i+1)%e],n[(i+2)%e],s-i)):t<0?n[0]-(r(n[0],n[0],n[1],n[1],-s)-n[0]):t>1?n[e]-(r(n[e],n[e],n[e-1],n[e-1],s-e)-n[e]):r(n[i?i-1:0],n[i],n[e<i+1?e:i+1],n[e<i+2?e:i+2],s-i)}};class jn{_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=$(),e=!1){const s=Object.keys(this._tweens);for(let i=0;i<s.length;i++){const r=this._tweens[s[i]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[s[i]]}return!!Object.keys(this._tweens).length}}const bt=new jn;class di{constructor(t,e=bt){this._object=t,this._group=e}_id=Ie.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=I.Linear.None;_interpolationFunction=Xt.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=$()){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,s,i){for(const r in s){const a=t[r],o=Array.isArray(a),h=o?"array":typeof a,c=!o&&Array.isArray(s[r]);if(!(h==="undefined"||h==="function")){if(c){let l=s[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,a)),s[r]=[a].concat(l)}if((h==="object"||o)&&a&&!c){e[r]=o?[]:{};for(const l in a)e[r][l]=a[l];i[r]=o?[]:{},this._setupProperties(a,e[r],s[r],i[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),c?i[r]=s[r].slice().reverse():i[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=$()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=$()){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=bt){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=I.Linear.None){return this._easingFunction=t,this}interpolation(t=Xt.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=$(),e=!0){if(this._isPaused)return!0;let s,i;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),i=(t-this._startTime)/this._durationTime,i=this._durationTime===0||i>1?1:i;const a=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),i===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];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,s,i){for(const r in s){if(e[r]===void 0)continue;const a=e[r]||0;let o=s[r];const h=Array.isArray(t[r]),c=Array.isArray(o);!h&&c?t[r]=this._interpolationFunction(o,i):typeof o=="object"&&o?this._updateProperties(t[r],a,o,i):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*i))}}_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],s=this._valuesEnd[t];typeof s=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(s):this._valuesStartRepeat[t]=s,this._valuesEnd[t]=e}}const Jo=Ie.nextId,Zo=bt.getAll.bind(bt),Ko=bt.removeAll.bind(bt),Qo=bt.add.bind(bt),th=bt.remove.bind(bt),eh=bt.update.bind(bt),sh={now:$,Sequence:Ie,Easing:I,Interpolation:Xt,Group:jn,Tween:di,nextId:Jo,getAll:Zo,removeAll:Ko,add:Qo,remove:th,update:eh};class fi{autoStart;startTime;oldTime;elapsedTime;running;constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=$(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=$();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class ps{tweens=[];frameDuration;onGroupStart;onGroupComplete;constructor(t){this.frameDuration=t?.frameDuration||1e3,this.onGroupStart=t?.onGroupStart,this.onGroupComplete=t?.onGroupComplete}get count(){return this.tweens.length}clear(){this.tweens=[]}sort(t=!1){Ha(this.tweens,(e,s)=>t?e.delay>s.delay:e.delay<=s.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(s=>{const i={...s};delete i.tween,i.fromValues={...i.fromValues},i.toValues={...i.toValues},e.push(i)}),e}addTween(t,e,s){const i={fromValues:t,toValues:e,frames:typeof s?.frames=="number"?s.frames:1,delay:typeof s?.delay=="number"?s.delay:this.tweens.length,easeFunction:s?.easeFunction||I.Linear.None,interpolationFunction:s?.interpolationFunction||Xt.Linear,repeat:typeof s?.repeat=="number"?s.repeat:0,yoyo:s?.yoyo||!1,onStart:s?.onStart||(()=>{}),onUpdate:s?.onUpdate||(()=>{}),onComplete:s?.onComplete||(()=>{})};return this.tweens.push(i),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new fi,s=this.frameDuration;return new Promise(i=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=ni(r=>{if(!this.isPaused){const o=Math.max(0,r-this.pausedDuration),h=Math.max(0,e.getElapsedTime()-this.pausedDuration);t.filter(c=>c.delay*s<=h).forEach(c=>{c.tween||(c.tween=new di({...c.fromValues}).to({...c.toValues},c.frames*s).easing(c.easeFunction).interpolation(c.interpolationFunction).repeat(c.repeat).yoyo(c.yoyo).onStart(c.onStart).onUpdate(c.onUpdate).onComplete(c.onComplete),c.tween.start(o)),(c.delay+c.frames*(c.repeat+1))*s>h?c.tween.update(o):(c.tween.isPlaying()&&c.tween.end(),Ce(t,c))})}const a=!!t.length;return a||(this.onGroupComplete?.(),i()),a})})}isPaused=!1;pausedClock=new fi;pausedDuration=0;play(t=this.cloneTweens(this.tweens)){this.isPaused=!1,this.pausedDuration=0,this.runTweens(t)}reverse(){const t=this.cloneTweens(this.tweens);let e=0;t.forEach(s=>{e=Math.max(e,s.delay+s.frames),s.easeFunction=Gn(s.easeFunction);const i={...s.toValues};s.toValues={...s.fromValues},s.fromValues={...i}}),t.forEach(s=>{s.delay=e-s.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}class U extends js{id;originD;originMatrix;independentTransformInGroup;forceCXY=!1;cX;cY;x;y;degree;scalarX;scalarY;diffXInGroup;diffYInGroup;diffDegreeInGroup;diffScalarXInGroup;diffScalarYInGroup;vx;vy;ax;ay;mass;attrs;enableDrag;alongPath;isDragging=!1;isMouseIn=!1;targetToAfterDragFree;followMouse;strokeArmyAnts;strokeArmyAntsOffset=0;strokeDashTotalLength=0;isShow=!0;el;pathd;usePathDtoCanvasContext=!1;parent;shapes=[];constructor(t){if(super(),this.id=Vs(),t?.d&&(this.originD=t?.d),t?.originMatrix&&(this.originMatrix=t.originMatrix),this.independentTransformInGroup=typeof t?.independentTransformInGroup=="boolean"?t.independentTransformInGroup:!1,this.x=t?.x||0,this.y=t?.y||0,this.cX=0,this.cY=0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&this.forceSetCXY(t.centerX-this.x,t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.diffXInGroup=t?.diffXInGroup||0,this.diffYInGroup=t?.diffYInGroup||0,this.diffDegreeInGroup=t?.diffDegreeInGroup||0,this.diffScalarXInGroup=t?.diffScalarXInGroup||1,this.diffScalarYInGroup=t?.diffScalarYInGroup||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||1,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this.enableDrag=t?.enableDrag||!1,this.alongPath=t?.alongPath,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.strokeArmyAnts=t?.strokeArmyAnts||!1,this.strokeArmyAnts){const s=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",s),this.strokeDashTotalLength=gn(s).reduce((i,r)=>i+r,0)}return Fa(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new wt,qs(()=>{this.pathd?.reset(this.originD||this.toSVGPathData(),this.originMatrix)}),this.pathd&&!this.forceCXY){const t=this.shapes.length==0?this.pathd.getBoundingClientRect():this.getBoundingClientRect();t&&(this.pathd.cX=this.cX=t.x+t.width/2-this.pathd.x,this.pathd.cY=this.cY=t.y+t.height/2-this.pathd.y)}this.shapeInit()}return this.pathd}frameStart(t){}frameUpdate(t,e){this.pathd=this.initPathD(),this.pathd.update(this),this.strokeArmyAnts&&(this.isMouseIn||(this.setAttr("stroke-dashoffset",String(this.strokeArmyAntsOffset++)),this.strokeArmyAntsOffset>this.strokeDashTotalLength&&(this.strokeArmyAntsOffset=0)))}frameEnd(t){}toSVGPathData(){return[]}toSVGPathD(){return this.pathd?.toSVGPathD()||""}toCanvasContext(t){this.usePathDtoCanvasContext=!0,this.pathd?.toCanvasContext(t)}getBoundingClientRect(){return this.pathd?.getBoundingClientRect()||null}get center(){const t=this.getBoundingClientRect(),e={x:this.x,y:this.y};return t&&(e.x=t.x+t.width/2,e.y=t.y+t.height/2),e}trim(){if(this.parent)return;const t=this.getBoundingClientRect();if(!t)return;this.shapes.forEach(s=>{const i=s.originMatrix?s.originMatrix.clone():new ct;i.translate(-t.x+s.x,-t.y+s.y),s.originMatrix=i});const e=this.originMatrix?this.originMatrix.clone():new ct;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,s){if(s instanceof ls)return s.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=s.createSVGPoint(),i.x=t,i.y=e}if(this.el instanceof SVGGeometryElement)return this.el.isPointInFill(i);{const r=this.getBoundingClientRect();if(r)return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height}return!1}isPointInStroke(t,e,s){if(s instanceof ls)return s.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=s.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(i):!1}clone(){return Na(this).copy(this)}copy(t){return this.id=t.id,this.originD=t.originD,this.originMatrix=t.originMatrix,this.independentTransformInGroup=t.independentTransformInGroup,this.x=t.x,this.y=t.y,this.cX=t.cX,this.cY=t.cY,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY,this.diffXInGroup=t.diffXInGroup,this.diffYInGroup=t.diffYInGroup,this.diffDegreeInGroup=t.diffDegreeInGroup,this.diffScalarXInGroup=t.diffScalarXInGroup,this.diffScalarYInGroup=t.diffScalarYInGroup,this.vx=t.vx,this.vy=t.vy,this.ax=t.ax,this.ay=t.ay,this.mass=t.mass,this.attrs={...t.attrs},this.enableDrag=t.enableDrag,this.alongPath=t.alongPath,this.targetToAfterDragFree=t.targetToAfterDragFree,this.followMouse=t.followMouse,this.isShow=t.isShow,this.strokeArmyAnts=t.strokeArmyAnts,this.strokeDashTotalLength=t.strokeDashTotalLength,this}save(){}restore(){}setAttr(t,e){typeof t!="string"?Object.assign(this.attrs,Object.fromEntries(Object.entries(t).map(([s,i])=>[ft(s),i]))):e&&(this.attrs[ft(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[ft(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[ft(t)]}distance(t){return as(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=it(Zt(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:i}=It(O(this.degree),e);this.vx=s,this.vy=i,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:i}=It(O(this.degree),e);this.ax=s,this.ay=i,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,s=t.y-this.y,i=e*e+s*s,r=Math.sqrt(i),a=this.mass*t.mass/i,o=a*e/r,h=a*s/r;this.vx+=o/this.mass,this.vy+=h/this.mass,t.vx-=o/t.mass,t.vy-=h/t.mass}run(t){this.vx+=this.ax,this.vy+=this.ay;const e=$t(t?.gravity,0);this.vy+=e;const s=$t(t?.friction,1);this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const s=$t(e?.easing,.05),i=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=i*s,this.vy=r*s,this.run(e)}runSpringTo(t,e){const s=$t(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.cX-this.x,a=i.y-this.cY-this.y,o=r*s,h=a*s;this.vx+=o,this.vy+=h}),this.run({friction:.9,...e})}springMassTo(t,e){const s=$t(e?.springLength,100),i=$t(e?.spring,1e-4),r=t.x-this.x,a=t.y-this.y,o=Math.sqrt(r*r+a*a);if(o<s){const h=r*i,c=a*i;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-o/s}return 0}getTotalLength(){return this.initPathD().getTotalLength()}interpolate(t){return this.initPathD().interpolate(t)}getPointAtLength(t){return this.initPathD().getPointAtLength(t)}trailPath(t,e=0){const s=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*s),this.getPointAtLength(e*s)}strokeDashTween(t=1e3,e){const s=this.initPathD(),i=At(s.getTotalLength(),0);this.setAttr({strokeDasharray:`${i} ${i}`,strokeDashoffset:`${i}`});const r=e?.onUpdate,a=new ps({frameDuration:t});a.addTween({offset:i},{offset:0},Object.assign(e||{},{onUpdate:(o,h)=>{this.setAttr("strokeDashoffset",""+At(o.offset,2)),r?.(o,h)}})),a.play()}}class Me extends U{x;y;z;fl;vpX;vpY;cX;cY;cZ;radius;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.fl=t?.fl||250,this.vpX=t?.vpX||0,this.vpY=t?.vpY||0,this.cX=t?.cX||0,this.cY=t?.cY||0,this.cZ=t?.cZ||0,this.radius=t?.radius||0}toSVGPathData(){return this.radius?[["M",this.getScreenX(),this.getScreenY()-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:[["M",this.getScreenX(),this.getScreenY()]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,s){this.cX=t,this.cY=e,this.cZ=s}rotateX(t){({x:this.y,y:this.z}=Pt(O(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=Pt(O(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=Pt(O(t),this.x,this.y))}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}eq(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.radius===t.radius&&this.mass===t.mass}length(){return rs(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,s=t.y-this.y,i=t.z-this.z;return Math.sqrt(e*e+s*s+i*i)}scalar(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y,i=this.z;return{x:s*t.z-i*t.y,y:i*t.x-e*t.z,z:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y,z:this.z*t.z}}div(t){return{x:this.x/t.x,y:this.y/t.y,z:this.z/t.z}}add(t){return{x:this.x+t.x,y:this.y+t.y,z:this.z+t.z}}sub(t){return{x:this.x-t.x,y:this.y-t.y,z:this.z-t.z}}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y,z:this.z-2*e*t.z}}}const Wn=[1,0,0,1,0,0],$n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class ct{value;_m13=0;_m23=0;_m33=1;matrix3d;constructor(t=Wn){this.value=Array.from(t),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D()}static fromString(t){const e=new ct,s=nn("number",t);return s.length===6&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this._m13}get m21(){return this.value[2]}get m22(){return this.value[3]}get m23(){return this._m23}get m31(){return this.value[4]}get m32(){return this.value[5]}get m33(){return this._m33}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this._m13=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set m23(t){this._m23=t}set m31(t){this.value[4]=t}set m32(t){this.value[5]=t}set m33(t){this._m33=t}toMatrix3D(t=this.matrix3d){const e=[this.m11,this.m12,0,this.m13,this.m21,this.m22,0,this.m23,0,0,1,0,this.m31,this.m32,0,this.m33];return t?(t.value=e,t):new pt(e)}identity(){return this.value=Array.from(Wn),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D(),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}normalize(){const t=this.m33||1e-4;return this.scalar(1/t)}transformPoint(t){const e=t.z||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31,y:t.x*this.m12+t.y*this.m22+e*this.m32,z:t.x*this.m13+t.y*this.m23+e*this.m33}}clone(){return new ct([...this.value])}multiply(t){const e=this.clone(),s=t instanceof ct?t:new ct(t);return this.m11=s.m11*e.m11+s.m12*e.m21+s.m13*e.m31,this.m12=s.m11*e.m12+s.m12*e.m22+s.m13*e.m32,this.m13=s.m11*e.m13+s.m12*e.m23+s.m13*e.m33,this.m21=s.m21*e.m11+s.m22*e.m21+s.m23*e.m31,this.m22=s.m21*e.m12+s.m22*e.m22+s.m23*e.m32,this.m23=s.m21*e.m13+s.m22*e.m23+s.m23*e.m33,this.m31=s.m31*e.m11+s.m32*e.m21+s.m33*e.m31,this.m32=s.m31*e.m12+s.m32*e.m22+s.m33*e.m32,this.m33=s.m31*e.m13+s.m32*e.m23+s.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}inverse(){const t=this.m11,e=this.m12,s=this.m13,i=this.m21,r=this.m22,a=this.m23,o=this.m31,h=this.m32,c=this.m33,l=c*r-a*h,d=-c*i+a*o,g=h*i-r*o;let y=t*l+e*d+s*g;return y?(y=1/y,this.m11=l*y,this.m12=(-c*e+s*h)*y,this.m13=(a*e-s*r)*y,this.m21=d*y,this.m22=(c*t-s*o)*y,this.m23=(-a*t+s*i)*y,this.m31=g*y,this.m32=(-h*t+e*o)*y,this.m33=(r*t-e*i)*y,this):null}adjugate(){const t=new ct;return t.m11=this.m22*this.m33-this.m32*this.m23,t.m12=this.m32*this.m13-this.m12*this.m33,t.m13=this.m12*this.m23-this.m22*this.m13,t.m21=this.m31*this.m23-this.m21*this.m33,t.m22=this.m11*this.m33-this.m31*this.m13,t.m23=this.m21*this.m13-this.m11*this.m23,t.m31=this.m21*this.m32-this.m31*this.m22,t.m32=this.m31*this.m12-this.m11*this.m32,t.m33=this.m11*this.m22-this.m21*this.m12,t}split(){let t=it(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(t+=180),{x:this.m31,y:this.m32,degree:t,scaleX:Math.sqrt(this.m11*this.m11+this.m12*this.m12),scaleY:Math.sqrt(this.m21*this.m21+this.m22*this.m22),skewX:it(Math.atan2(-this.m21,this.m22)),skewY:it(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],s=this.value[1],i=this.value[2],r=this.value[3],a=this.value[4],o=this.value[5],h=t.value[0],c=t.value[1],l=t.value[2],d=t.value[3],g=t.value[4],y=t.value[5],m=h*d,x=c*l,b=(l*s-e*d)/(x-m),S=(h*s-e*c)/(m-x),C=(l*r-i*d)/(x-m),L=(h*r-i*c)/(m-x),R=(l*(o-y)+d*(g-a))/(x-m),X=(h*(o-y)+c*(g-a))/(m-x),Y=[b,S,C,L,R,X];return new ct(Y)}toString(t=6){return this.matrix3d.is2D()?`matrix(${this.value.map(e=>At(e,t)).join(",")})`:this.matrix3d.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix3D(),this}translateTo(t,e){return this.translate(t-this.m31,e-this.m32)}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.m32)}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.m31,t)}translateZ(t){return this.matrix3d.translate(0,0,t),this.matrix3d.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix3d.m43),this}translate3d(t,e,s){return this.matrix3d.translate(t,e,s),this.matrix3d.toMatrix(this),this}translate3dTo(t,e,s){return this.translate3d(t-this.matrix3d.m41,e-this.matrix3d.m42,s-this.matrix3d.m43),this}rotate(t,e=0,s=0){const i=O(t),r=Math.cos(i),a=Math.sin(i);return this.translate(e,s),this.multiply([r,a,-a,r,0,0]),this.translate(-e,-s),this.toMatrix3D(),this}rotateTo(t,e=0,s=0){const{degree:i}=this.split();return this.rotate(t-i,e,s),this}rotateX(t){return this.matrix3d.rotateX(t),this.matrix3d.toMatrix(this),this}rotateXTo(t){const{degreeX:e}=this.matrix3d.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix3d.rotateY(t),this.matrix3d.toMatrix(this),this}rotateYTo(t){const{degreeY:e}=this.matrix3d.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix3d.rotateZ(t),this.matrix3d.toMatrix(this),this}rotateZTo(t){const{degreeZ:e}=this.matrix3d.split();return this.rotateZ(t-e),this}rotate3d(t,e,s){return this.matrix3d.rotateX(t).rotateY(e).rotateZ(s),this.matrix3d.toMatrix(this),this}rotate3dTo(t,e,s){const{degreeX:i,degreeY:r,degreeZ:a}=this.matrix3d.split();return this.rotate3d(t-i,e-r,s-a),this}scale(t,e=t,s=0,i=0){return this.translate(s,i),this.multiply([t,0,0,e,0,0]),this.translate(-s,-i),this.toMatrix3D(),this}scaleTo(t,e=t,s=0,i=0){return this.scale(t/this.m11,e/this.m22,s,i)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.matrix3d.scale(1,1,t),this.matrix3d.toMatrix(this),this}scaleZTo(t){const{scalarZ:e}=this.matrix3d.split();return this.scaleZ(t/e),this}scale3d(t,e=t,s=t){return this.matrix3d.scale(t,e,s),this.matrix3d.toMatrix(this),this}scale3dTo(t,e=t,s=t){const{scalarX:i,scalarY:r,scalarZ:a}=this.matrix3d.split();return this.scale3d(t/i,e/r,s/a),this}skew(t,e=t){return this.multiply([Math.cos(O(e)),Math.sin(O(e)),-Math.sin(O(t)),Math.cos(O(t)),0,0]),this.toMatrix3D(),this}skewTo(t,e=t){const{skewX:s,skewY:i}=this.split();return this.skew(t-s,e-i)}skewX(t){const{skewY:e}=this.split();return this.skew(t,e)}skewXTo(t){const{skewY:e}=this.split();return this.skewTo(t,e)}skewY(t){const{skewX:e}=this.split();return this.skew(e,t)}skewYTo(t){const{skewX:e}=this.split();return this.skewTo(e,t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,s){return this}skew3dTo(t,e,s){return this}perspective(t){return this.matrix3d.perspective(t),this.matrix3d.toMatrix(this),this}}class pt{value;is3dSpecial=!1;constructor(t=$n){this.value=Array.from(t)}static fromString(t){const e=new pt,s=nn("number",t);return s.length===16&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m14(){return this.value[3]}get m21(){return this.value[4]}get m22(){return this.value[5]}get m23(){return this.value[6]}get m24(){return this.value[7]}get m31(){return this.value[8]}get m32(){return this.value[9]}get m33(){return this.value[10]}get m34(){return this.value[11]}get m41(){return this.value[12]}get m42(){return this.value[13]}get m43(){return this.value[14]}get m44(){return this.value[15]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m14(t){this.value[3]=t}set m21(t){this.value[4]=t}set m22(t){this.value[5]=t}set m23(t){this.value[6]=t}set m24(t){this.value[7]=t}set m31(t){this.value[8]=t}set m32(t){this.value[9]=t}set m33(t){this.value[10]=t}set m34(t){this.value[11]=t}set m41(t){this.value[12]=t}set m42(t){this.value[13]=t}set m43(t){this.value[14]=t}set m44(t){this.value[15]=t}is2D(){return!this.is3dSpecial&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m43==0&&this.m44==1}is3D(){return!this.is2D()}identity(){return this.value=Array.from($n),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m14==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m24==0&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m41==0&&this.m42==0&&this.m43==0&&this.m44==1}clone(){return new pt([...this.value])}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m14*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m24*=t,this.m31*=t,this.m32*=t,this.m33*=t,this.m34*=t,this.m41*=t,this.m42*=t,this.m43*=t,this.m44*=t,this}normalize(){return this.scalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,s=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+s*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+s*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+s*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+s*this.m44}}toMatrix(t){const{scalarX:e,scalarY:s,skewX:i,skewY:r,x:a,y:o}=this.split(),h=[e,r,i,s,a,o];return t?(t.value=h,t):new ct(h)}flatten(){return this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m14=0,this.m24=0,this.m43=0,this.m44=1,this}toString(t=6){return`matrix3d(${this.value.map(e=>At(e,t)).join(",")})`}split(){const t=Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),e=Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),s=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),i=it(V(Math.asin(-this.m13),-1,1));let r=it(Math.atan2(this.m23,this.m33));Math.cos(O(i))===0&&(r=it(Math.atan2(-this.m31,this.m22)));let a=it(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(a+=180),{x:this.m41,y:this.m42,z:this.m43,scalarX:t,scalarY:e,scalarZ:s,degreeX:r,degreeY:i,degreeZ:a,skewX:it(this.m14),skewY:it(this.m24),skewZ:it(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}inverse(){const t=[],e=this.m11,s=this.m12,i=this.m13,r=this.m14,a=this.m21,o=this.m22,h=this.m23,c=this.m24,l=this.m31,d=this.m32,g=this.m33,y=this.m34,m=this.m41,x=this.m42,b=this.m43,S=this.m44;t[0]=h*y*x-c*g*x+c*d*b-o*y*b-h*d*S+o*g*S,t[1]=r*g*x-i*y*x-r*d*b+s*y*b+i*d*S-s*g*S,t[2]=i*c*x-r*h*x+r*o*b-s*c*b-i*o*S+s*h*S,t[3]=r*h*d-i*c*d-r*o*g+s*c*g+i*o*y-s*h*y;const C=e*t[0]+a*t[1]+l*t[2]+m*t[3];if(C==0)return console.warn("Can't invert matrix, determinant is 0");t[4]=c*g*m-h*y*m-c*l*b+a*y*b+h*l*S-a*g*S,t[5]=i*y*m-r*g*m+r*l*b-e*y*b-i*l*S+e*g*S,t[6]=r*h*m-i*c*m-r*a*b+e*c*b+i*a*S-e*h*S,t[7]=i*c*l-r*h*l+r*a*g-e*c*g-i*a*y+e*h*y,t[8]=o*y*m-c*d*m+c*l*x-a*y*x-o*l*S+a*d*S,t[9]=r*d*m-s*y*m-r*l*x+e*y*x+s*l*S-e*d*S,t[10]=s*c*m-r*o*m+r*a*x-e*c*x-s*a*S+e*o*S,t[11]=r*o*l-s*c*l-r*a*d+e*c*d+s*a*y-e*o*y,t[12]=h*d*m-o*g*m-h*l*x+a*g*x+o*l*b-a*d*b,t[13]=s*g*m-i*d*m+i*l*x-e*g*x-s*l*b+e*d*b,t[14]=i*o*m-s*h*m-i*a*x+e*h*x+s*a*b-e*o*b,t[15]=s*h*l-i*o*l+i*a*d-e*h*d-s*a*g+e*o*g,this.value=t,this.scalar(1/C)}multiply(t){const e=this.clone();return this.m11=t.m11*e.m11+t.m12*e.m21+t.m13*e.m31+t.m14*e.m41,this.m12=t.m11*e.m12+t.m12*e.m22+t.m13*e.m32+t.m14*e.m42,this.m13=t.m11*e.m13+t.m12*e.m23+t.m13*e.m33+t.m14*e.m43,this.m14=t.m11*e.m14+t.m12*e.m24+t.m13*e.m34+t.m14*e.m44,this.m21=t.m21*e.m11+t.m22*e.m21+t.m23*e.m31+t.m24*e.m41,this.m22=t.m21*e.m12+t.m22*e.m22+t.m23*e.m32+t.m24*e.m42,this.m23=t.m21*e.m13+t.m22*e.m23+t.m23*e.m33+t.m24*e.m43,this.m24=t.m21*e.m14+t.m22*e.m24+t.m23*e.m34+t.m24*e.m44,this.m31=t.m31*e.m11+t.m32*e.m21+t.m33*e.m31+t.m34*e.m41,this.m32=t.m31*e.m12+t.m32*e.m22+t.m33*e.m32+t.m34*e.m42,this.m33=t.m31*e.m13+t.m32*e.m23+t.m33*e.m33+t.m34*e.m43,this.m34=t.m31*e.m14+t.m32*e.m24+t.m33*e.m34+t.m34*e.m44,this.m41=t.m41*e.m11+t.m42*e.m21+t.m43*e.m31+t.m44*e.m41,this.m42=t.m41*e.m12+t.m42*e.m22+t.m43*e.m32+t.m44*e.m42,this.m43=t.m41*e.m13+t.m42*e.m23+t.m43*e.m33+t.m44*e.m43,this.m44=t.m41*e.m14+t.m42*e.m24+t.m43*e.m34+t.m44*e.m44,this}translate(t=0,e=0,s=0){return this.multiply(new pt([1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1]))}scale(t=1,e=1,s=1){return this.multiply(new pt([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}rotateX(t){const e=O(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new pt([1,0,0,0,0,s,i,0,0,-i,s,0,0,0,0,1]))}rotateY(t){const e=O(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new pt([s,0,-i,0,0,1,0,0,i,0,s,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=O(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new pt([s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,s=0){return this.multiply(new pt([1,0,0,O(t),0,1,0,O(e),0,0,1,O(s),0,0,0,1]))}perspective(t){return this.multiply(new pt([1,0,0,0,0,1,0,0,0,0,1,t?-(1/t):0,0,0,0,1]))}unproject(t){let e=t.x*this.m11+t.y*this.m21+this.m41,s=t.x*this.m12+t.y*this.m22+this.m42,i=t.x*this.m13+t.y*this.m23+this.m43,r=t.x*this.m14+t.y*this.m24+this.m44,a=e+this.m31,o=s+this.m32,h=i+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,s/=r,i/=r,c==0&&(c=1e-4),a/=c,o/=c,h/=c;const l=h-i;if(l==0)return{x:e,y:s,z:i,mass:r};const d=-i/l;return e+=d*(a-e),s+=d*(o-s),{x:e,y:s,z:i,mass:r}}project(t){const e=t.z;let s=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,i=t.x*this.m12+t.y*this.m22+e*this.m32+this.m42,r=t.x*this.m14+t.y*this.m24+e*this.m34+this.m44;return r==0&&(r=1e-4),s/=r,i/=r,r<0&&(s-=this.m41,i-=this.m42,s*=1/r,i*=1/r,s+=this.m41,i+=this.m42),{x:s,y:i,z:e,mass:r}}bounds(t,e,s,i){const r=new Me({x:t,y:e}),a=new Me({x:t+s,y:e}),o=new Me({x:t+s,y:e+i}),h=new Me({x:t,y:e+i});({x:r.x,y:r.y,z:r.z,mass:r.mass}=this.project(r)),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:h.x,y:h.y,z:h.z,mass:h.mass}=this.project(h);const c=Math.min(r.x,a.x,o.x,h.x),l=Math.min(r.y,a.y,o.y,h.y),d=Math.max(r.x,a.x,o.x,h.x)-c,g=Math.max(r.y,a.y,o.y,h.y)-l;return{x:c,y:l,width:d,height:g}}}function mi(n){const t=new ct;return n.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,s,i){i.indexOf(",")>=0?i=i.split(/\s*,\s*/):i=i.split(/\s+/);const r=[];for(let a=0,o=i.length;a<o;a++)i[a].trim()&&r.push(parseFloat(""+i[a]));switch(s.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]]),t.toMatrix3D();break;case"matrix3d":t.matrix3d.multiply(new pt(r)),t.matrix3d.toMatrix(t);break}return""}),t}function Pt(n,t,e){const s=new ct;return s.rotate(it(n)),s.transformPoint({x:t,y:e})}function pi(n){const t=typeof n?.x=="number"?n?.x:0,e=typeof n?.y=="number"?n?.y:0,s=typeof n?.degree=="number"?n?.degree:0,i=typeof n?.scalarX=="number"?n?.scalarX:1,r=typeof n?.scalarY=="number"?n?.scalarY:1,a=O(s),o=Math.cos(a),h=Math.sin(a),c=new DOMMatrix([o*i,h*i,-h*r,o*r,t,e]);return c.multiplySelf(new DOMMatrix(n?.originMatrix||"")),c}function ih(n,t){const e=new Path2D(n),s=new Path2D;return s.addPath(e,pi(t)),s}function Jn(n,t){const e={x:t.m11,y:t.m12,z:t.m13},s={x:t.m21,y:t.m22,z:t.m23},i={x:t.m31,y:t.m32,z:t.m33},r=n.transformPoint(e),a=n.transformPoint(s),o=n.transformPoint(i),h=new ct;return h.m11=r.x,h.m12=r.y,h.m13=r.z,h.m21=a.x,h.m22=a.y,h.m23=a.z,h.m31=o.x,h.m32=o.y,h.m33=o.z,h}function Zn(n,t){const e={x:t.m11,y:t.m12,z:t.m13,w:t.m14},s={x:t.m21,y:t.m22,z:t.m23,w:t.m24},i={x:t.m31,y:t.m32,z:t.m33,w:t.m34},r={x:t.m41,y:t.m42,z:t.m43,w:t.m44},a=n.transformPoint(e),o=n.transformPoint(s),h=n.transformPoint(i),c=n.transformPoint(r);return new pt([a.x,a.y,a.z,a.w,o.x,o.y,o.z,o.w,h.x,h.y,h.z,h.w,c.x,c.y,c.z,c.w])}function nh(n){let t=n[0];for(let e=1,s=n.length;e<s;e++)t=Jn(t,n[e]);return t}function rh(n){let t=n[0];for(let e=1,s=n.length;e<s;e++)t=Zn(t,n[e]);return t}class A{static createElementNS(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}static isActive(t){return t===document.activeElement&&(t.type||t.href)}static isTouchEnabled(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}static origins=new Je;static updates=new Je;static patchDom=()=>{this.origins.filter((t,e)=>{const s=this.updates.get(t);return s&&ss(e,s),this.updates.delete(t),!1})};static getVNode(t,e){let s=t.getAttribute("id")||"";s||(s=e||Vs(),t.setAttribute("id",s)),this.origins.get(s)||this.origins.set(s,Jt(t.tagName,{},[],t));const i=this.updates.get(s)||Jt(t.tagName,{},[],t);return{vnode:i,immediate:()=>{this.updates.set(s,i),A.patchDom()},schedule:()=>{this.updates.set(s,i),hi("FLUSH_DOM_ACTIONS",A.patchDom,50)}}}static getElement(t){const e=t.style?t.ownerDocument:t.document||t;return{el:t,document:e,window:e.defaultView,isRootNode:/(html|body)/i.test(t.tagName)||t===document}}static getCSSVar(t){return getComputedStyle(document.documentElement).getPropertyValue(t)}static setCSSVar(t,e){document.documentElement.style.setProperty(t,e)}static add3DSupport(t,e="1000px"){if(t.parentElement){const s=A.getStyle(t.parentElement,"position");A.setStyle(t.parentElement,{position:s=="static"?"relative":s,perspective:e})}A.setStyle(t,{"transform-style":"preserve-3d"})}static convertAttrs(t,e,s={}){Object.prototype.hasOwnProperty.call(s,"transform")||Object.assign(s,{transform:A.getStyle(t,"transform")||""});const i=mi(s.transform),r={};for(const a in e){const o=e[a];switch(a){case"transform":break;case"translate":i.translate(o[0]||0,o[1]||0);break;case"translateTo":i.translateTo(o[0]||0,o[1]||0);break;case"translateX":i.translateX(o||0);break;case"translateXTo":i.translateXTo(o||0);break;case"translateY":i.translateY(o||0);break;case"translateYTo":i.translateYTo(o||0);break;case"translateZ":i.translateZ(o||0);break;case"translateZTo":i.translateZTo(o||0);break;case"translate3d":i.translate3d(o[0]||0,o[1]||0,o[2]||0);break;case"translate3dTo":i.translate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotate":typeof o=="number"?i.rotate(o||0):i.rotate(o[0]||0,o[1]||0,o[2]||0);break;case"rotateTo":typeof o=="number"?i.rotateTo(o||0):i.rotateTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotateX":i.rotateX(o||0);break;case"rotateXTo":i.rotateXTo(o||0);break;case"rotateY":i.rotateY(o||0);break;case"rotateYTo":i.rotateYTo(o||0);break;case"rotateZ":i.rotateZ(o||0);break;case"rotateZTo":i.rotateZTo(o||0);break;case"rotate3d":i.rotate3d(o[0]||0,o[1]||0,o[2]||0);break;case"rotate3dTo":i.rotate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"scale":typeof o=="number"?i.scale(o||1):i.scale(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleTo":typeof o=="number"?i.scaleTo(o||1):i.scaleTo(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleX":i.scaleX(o||1);break;case"scaleXTo":i.scaleXTo(o||1);break;case"scaleY":i.scaleY(o||1);break;case"scaleYTo":i.scaleYTo(o||1);break;case"scaleZ":i.scaleZ(o||1);break;case"scaleZTo":i.scaleZTo(o||1);break;case"scale3d":typeof o=="number"?i.scale3d(o||1):i.scale3d(o[0]||1,o[1]||1,o[2]||1);break;case"scale3dTo":typeof o=="number"?i.scale3dTo(o||1):i.scale3dTo(o[0]||1,o[1]||1,o[2]||1);break;case"skew":typeof o=="number"?i.skew(o||0):i.skew(o[0]||0,o[1]||0);break;case"skewTo":typeof o=="number"?i.skewTo(o||0):i.skewTo(o[0]||0,o[1]||0);break;case"skewX":i.skewX(o||0);break;case"skewXTo":i.skewXTo(o||0);break;case"skewY":i.skewY(o||0);break;case"skewYTo":i.skewYTo(o||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":i.perspective(o||0);break;default:Object.prototype.hasOwnProperty.call(s,a)||(s[a]=A.getStyle(t,a)),Object.assign(r,{[a]:`${o}`});break}}return Object.assign(r,{transform:i.toString()}),r}static attrsToCanvas(t,e){for(const s in e){const i=e[s];switch(s){case"fill":i!=="none"&&(t.fillStyle=i);break;case"stroke":i!=="none"&&(t.strokeStyle=i);break;case"stroke-width":case"strokeWidth":t.lineWidth=Number(i);break;case"stroke-linecap":case"strokeLinecap":t.lineCap=i;break;case"stroke-linejoin":case"strokeLinejoin":switch(i){case"round":case"bevel":case"miter":t.lineJoin=i;break;default:t.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":t.miterLimit=Number(i);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":t.lineDashOffset=Number(i);break;case"stroke-dasharray":case"strokeDasharray":typeof i=="string"&&t.setLineDash(i.split(/\s+/).map(r=>Number(r)));break;case"cursor":break;case"font":typeof i=="string"&&(t.font=i);break;case"font-size":case"fontSize":t.font+=` ${i}`;break;case"font-family":case"fontFamily":t.font+=` ${i}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(i){case"middle":t.textAlign="center";break;case"end":t.textAlign="end";break;case"start":t.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(i){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":t.textBaseline=i;break;default:t.textBaseline="alphabetic";break}break}}}static getStyle(t,e,s){const i=t;if(getComputedStyle)if(e){e=ft(e);const r=getComputedStyle(i,s).getPropertyPriority(e);return getComputedStyle(i,s).getPropertyValue(e).trim()+(r?"!"+r:"")}else{const r=[],a=getComputedStyle(i,"");for(let o=0;o<a.length;o++)r.push(a[o]+":"+a.getPropertyValue(a[o]));return r.push(...(i.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=an(e),t.currentStyle[e];{const r=[],a=i.currentStyle;for(const o in a)r.push(o+":"+a[o]);return r.push(...(i.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(h=>h.trim()))||[])}}}static setStyle(t,e,s){typeof e=="string"&&s?t.style.setProperty(ft(e),s.replace(/!important/i,""),String(s).toLowerCase().includes("!important")?"important":""):e instanceof Object&&Object.keys(e).forEach(i=>{t.style.setProperty(ft(i),String(e[i]).replace(/!important/i,""),String(e[i]).toLowerCase().includes("!important")?"important":"")})}static injectStyle(t,e){let s;if(typeof e=="string"){const r=document.querySelector(e)?.shadowRoot;r?s=r:s=document.querySelector(e)}else s=e||document.getElementsByTagName("head")[0];const i=document.createElement("style");if(i.innerHTML=t,s)return s.appendChild(i),()=>{(s instanceof HTMLElement||s instanceof ShadowRoot)&&s.removeChild(i)};{const r=document.styleSheets[0].insertRule(t);return()=>{document.styleSheets[0].deleteRule(r)}}}static loadLink(t,e=()=>{},s=(i,r,a,o,h)=>{}){const i=document.createElement("link");i.type="text/css",i.rel="stylesheet",i.href=t,i.onload=e,i.onerror=s,document.getElementsByTagName("head")[0].appendChild(i)}static loadScript(t,e=()=>{},s=(i,r,a,o,h)=>{}){const i=document.createElement("script");i.type="text/javascript",i.src=t,i.async=!1,i.onload=e,i.onerror=s,document.body.appendChild(i)}static waitForStyleSheetsLoaded(){return new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let s=document.styleSheets.length||0;const i=()=>s>=e.length?(t(),!0):!1;i()||e.forEach(r=>{r.onload=()=>{s+=1,i()}})})}static toggleClass(t,e,s="toggle"){if(t.classList)e.split(/[,\s]+/).forEach(i=>{const r=i.trim();r!==""&&t.classList[s](r)});else{const i=t.className.split(/ +/);let r=!1;e.split(/[,\s]+/).forEach(a=>{const o=a.trim();if(o!==""){const h=i.indexOf(o);switch(s){case"add":h===-1&&(i.push(o),r=!0);break;case"remove":h!==-1&&(i.splice(h,1),r=!0);break;case"toggle":h===-1?i.push(o):i.splice(h,1),r=!0;break}}}),r&&t.setAttribute("class",i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}static addClass(t,e){this.toggleClass(t,e,"add")}static removeClass(t,e){this.toggleClass(t,e,"remove")}static hasClass(t,e){return new RegExp("(?:^|\\s+)"+e+"(?:\\s+|$)").test(t.className)||!1}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){t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block")}static hide(t){t.style.setProperty("display","none")}static attribute(t,e,s){let i={};if(e===void 0&&s===void 0){for(let o=0,h=t.attributes,c=h.length;o<c;o++){const l=h[o];l.nodeName&&l.nodeValue&&(i[l.nodeName]=l.nodeValue)}return i}if(typeof e=="string"&&s===void 0)return t.getAttribute(ft(e));typeof e=="object"?i=e:typeof e=="string"&&s!==void 0&&(i[e]=s);const{vnode:r,schedule:a}=this.getVNode(t,i.id);Object.entries(i).forEach(([o,h])=>{r.props[ft(o)]=h}),a()}static removeAttribute(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&t.removeAttribute(s.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,s){if(s===void 0&&typeof e=="string")return t[e];{let i={};typeof e=="object"?i=e:typeof e=="string"&&s!==void 0&&(i[e]=s),Object.entries(i).forEach(([r,a])=>{const o=this.fixProp(r);t[o]=a,o=="innerHTML"&&this.scriptConvert(t)})}}static removeProp(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&delete t[this.fixProp(s.trim())]})}static data(t,e,s){if(typeof e=="string"&&(e=an(e)),(typeof e=="string"||e===void 0)&&s===void 0){const i=Object.assign({},t.dataset);return Object.keys(i).forEach(r=>{if(i[r]?.startsWith("[")||i[r]?.startsWith("{"))try{i[r]=JSON.parse(i[r]||"")}catch{}}),typeof e=="string"?i[e]:i}else{let i={};typeof e=="object"?i=e:typeof e=="string"&&(i[e]=s),Object.entries(i).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(s=>{s.trim()!=""&&delete t.dataset[s.trim()]})}static empty(t){this.html(t,"")}static html(t,e){e instanceof HTMLElement||e instanceof SVGElement?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 bind(t,e,s,i=!1){t.addEventListener&&t.addEventListener(e,s,i)}static unbind(t,e,s,i=!1){t.removeEventListener&&t.removeEventListener(e,s,i)}static MouseEvents=["click","dblclick","mousedown","mouseup","mousemove","mouseover","mouseout"];static KeyboardEvents=["keydown","keyup","keypress"];static TouchEvents=["touchstart","touchend","touchcancel","touchmove"];static DragEvents=["dragstart","dragend","dragenter","dragover"];static Events=["change"];static fakeEvent(t,e,s){let i;A.MouseEvents.includes(e)?i=new MouseEvent(e,s):A.KeyboardEvents.includes(e)?i=new KeyboardEvent(e,s):A.TouchEvents.includes(e)?i=new TouchEvent(e,s):A.DragEvents.includes(e)?i=new DragEvent(e,s):A.Events.includes(e)?i=new Event(e,s):i=new CustomEvent(e,s),(t||i.target)?.dispatchEvent(i)}static fireEvent(t,e,s){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:s}))}static scriptConvert(t){const e=s=>{const r=s.ownerDocument.createElement("script");r.text=s.text;const a=s.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(s=>{s.parentNode?.replaceChild(e(s),s)}),t}static insert(t,e,s="append"){return typeof e=="string"?t[s](this.fragment(e)):(e instanceof HTMLElement||e instanceof SVGElement)&&t[s](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 fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(s=>{const i=this.scriptConvert(s);i!=s&&e.content.replaceChild(i,s)}),e.content}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 contains(t,e){return t.contains?t!=e&&t.contains(e):!!(t.compareDocumentPosition(e)&16)}static changeSelectSelected(t,e){if(t instanceof HTMLSelectElement){const s=t.options;for(let i=0,r=s.length;i<r;i++)s[i].value==e?s[i].selected=!0:s[i].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 s;return t.charAt(0)=="#"?t.charAt(1).toLowerCase()=="x"?s=parseInt(t.substring(2),16):s=parseInt(t.substring(1),10):s=e[t],s?String.fromCharCode(s):"&"+t}static runInSafe(t){const e=new Proxy(window,{get(s,i,r){if(typeof i=="string"&&["open","location","document"].includes(i))throw new Error(`禁止访问 key: ${i}`);return i==="window"?e:Reflect.get(s,i,r)},set(s,i,r,a){return Reflect.set(s,i,r,a)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(s={},...i){const r=document.createElement(e);for(const a of Object.keys(s))r.setAttribute(a,s[a]);for(const a of i)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){
|
|
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},Bt=(n,t)=>(typeof n=="string"&&(n=Ke(n)||new RegExp(n)),n.test(t)),sn=(n,t)=>{typeof n=="string"&&(n=Ke(n)||new RegExp(n));const e=t.match(n);return e?n.flags.toLowerCase().indexOf("g")>=0?e.map(s=>({matchIndex:-1,fullMatch:s,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},nn=(n,t)=>{typeof n=="string"&&(n=Ke(n)||new RegExp(n));const e=[],s=t.matchAll(n);for(const i of s)e.push({matchIndex:typeof i.index=="number"?i.index:-1,fullMatch:i[0],groupMatchs:i.slice(1)});return e};function Ia(n){const t=n.match(/[\s\S]/gu);return t?t.length:0}function rn(n,t){const e=n.codePointAt(t);return e?String.fromCodePoint(e):void 0}const it=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function zs(){const n=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(it[n&255]+it[n>>8&255]+it[n>>16&255]+it[n>>24&255]+"-"+it[t&255]+it[t>>8&255]+"-"+it[t>>16&15|64]+it[t>>24&255]+"-"+it[e&63|128]+it[e>>8&255]+"-"+it[e>>16&255]+it[e>>24&255]+it[s&255]+it[s>>8&255]+it[s>>16&255]+it[s>>24&255]).toLowerCase()}function ka(n){const t=fe.get(n);if(t)return t;const e=n.replace(/(^\w)/g,function(s){return s.toLowerCase()});return fe.set(n,e),e}const ft=(n,t="-")=>{const e=fe.get(n);if(e)return e;let s=n.replace(new RegExp(`${t}?([A-Z])`,"g"),t+"$1").toLowerCase();return s=s.replace(new RegExp(`^${t}`),""),fe.set(n,s),s};function qs(n){const t=fe.get(n);if(t)return t;const e=n.replace(/(^\w|[_-]\w)/g,function(s){return s.slice(-1).toUpperCase()});return fe.set(n,e),e}function an(n){return ka(qs(n))}function on(n){let t="";for(let e=0,s=n.length;e<s;e++){const i=n.charCodeAt(e);i>=1&&i<=127?t+=n.charAt(e):i>2047?(t+=String.fromCharCode(224|i>>12&15),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|i>>0&63)):(t+=String.fromCharCode(192|i>>6&31),t+=String.fromCharCode(128|i>>0&63))}return t}let Se;class La{subscribers;constructor(){this.subscribers=new Set}add(){Se&&!this.subscribers.has(Se)&&this.subscribers.add(Se)}notify(){this.subscribers.forEach(t=>t())}}const hn=new WeakMap;function cn(n,t){let e=hn.get(n);e||(e=new Map,hn.set(n,e));let s=e.get(t);return s||(s=new La,e.set(t,s)),s}function Hs(n){Se=n,n(),Se=null}const Ra=Symbol("isProxy");function Oa(n){return new Proxy(n,{get(t,e,s){return e===Ra?!0:(cn(n,e).add(),Reflect.get(t,e,s))},set(t,e,s,i){const r=cn(n,e);return n[e]!=s&&(n[e]=s,r.notify()),Reflect.set(t,e,s,i)}})}const Fa=Oa;function ln(n){return n!=null}function Na(n,...t){return new n.constructor(...t)}function un(n,t){for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&!t(e,n[e])&&delete n[e];return n}function Ba(n,t="",e=["","sign","key"]){return Object.keys(n).filter(s=>{for(let i=0,r=e.length;i<r;i++)if(n[s]==e[i])return!1;return!0}).sort().map(s=>`${s}=${n[s]}`).join("&")+t}function Ce(n,t){const e=n.findIndex(s=>s===t);return e>=0&&n.splice(e,1),n}let dn;try{dn=Map}catch{dn=function(){}}let fn;try{fn=Set}catch{fn=function(){}}function Wt(n,t){if(n=parseFloat(n),isNaN(n)){if(typeof t=="number")return t;throw new Error(`parseNumber(${n}) isNaN!`)}return n}function Qe(n,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(n-t)<e}const H=(n,t,e)=>n<t?t:n>e?e:n,Ya=(n,t,e)=>s=>{const i=H(s,n,t);return e==0?i:t-i<e?t:Math.round(i/e)*e};function Xa(n,t=12){return Wt(n).toFixed(t)}function Mt(n,t=12){return+Xa(n,t)}function js(n,t){const e=sn("number-single",String(n));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):ln(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?n.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?n.substring(e.matchIndex+e.fullMatch.length):""}}function mn(n){const t=sn("number",n);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}Ua();function Ua(){const n=new ArrayBuffer(4),t=new Float32Array(n),e=new Uint32Array(n),s=new Uint32Array(512),i=new Uint32Array(512);for(let h=0;h<256;++h){const c=h-127;c<-27?(s[h]=0,s[h|256]=32768,i[h]=24,i[h|256]=24):c<-14?(s[h]=1024>>-c-14,s[h|256]=1024>>-c-14|32768,i[h]=-c-1,i[h|256]=-c-1):c<=15?(s[h]=c+15<<10,s[h|256]=c+15<<10|32768,i[h]=13,i[h|256]=13):c<128?(s[h]=31744,s[h|256]=64512,i[h]=24,i[h|256]=24):(s[h]=31744,s[h|256]=64512,i[h]=13,i[h|256]=13)}const r=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let h=1;h<1024;++h){let c=h<<13,l=0;for(;!(c&8388608);)c<<=1,l-=8388608;c&=-8388609,l+=947912704,r[h]=c|l}for(let h=1024;h<2048;++h)r[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)a[h]=h<<23;a[31]=1199570944,a[32]=2147483648;for(let h=33;h<63;++h)a[h]=2147483648+(h-32<<23);a[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(o[h]=1024);return{floatView:t,uint32View:e,baseTable:s,shiftTable:i,mantissaTable:r,exponentTable:a,offsetTable:o}}var Tt=(n=>(n.UNKNOWN="",n.HTML="text/html",n.XHTML="application/xhtml+xml",n.XML="application/xml",n.XML_TEXT="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.MP4="video/mp4",n.OGG="audio/ogg",n.WAV="audio/wav",n.WEBM="video/webm",n.CSS="text/css",n.JAVASCRIPT="application/javascript",n.ECMASCRIPT="application/ecmascript",n.JSON="application/json",n.XWWW="application/x-www-form-urlencoded",n.DOC="application/msword",n.CSV="application/x-csv",n.EXCEL="application/vnb.ms-excel",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))(Tt||{}),Ee=(n=>(n.ascii="ascii",n.utf8="utf8",n.utf16le="utf16le",n.ucs2="ucs2",n.base64="base64",n.base64url="base64url",n.latin1="latin1",n.binary="binary",n.hex="hex",n))(Ee||{});const me=(n,t=16)=>{let e=n.toLowerCase();const s=e.indexOf("0b")==0,i=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(s||i||r)&&(e=e.slice(2)),s&&(t=2),i&&(t=8),r&&(t=16);const a=parseInt(e,t);if(isNaN(a))throw new Error(`radixStringToNumber(${n}, ${t}) 无法解析!`);return a};function Ga(n){return new TextEncoder().encode(n)}function Va(n,t=Ee.utf8){return new TextDecoder(t).decode(n)}const pn=(n,t=Tt.SVG,e=Ee.utf8)=>e===Ee.base64?new Blob([n],{type:`${t};${e}`}):new Blob([n],{type:`${t};charset=${e}`}),gn=n=>{let t=Tt.UNKNOWN;switch(new DataView(n).getUint32(0,za()).toString(16).toUpperCase()){case"FFD8FFDB":t=Tt.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Tt.JPEG;break;case"89504E47":t=Tt.PNG;break;case"47494638":t=Tt.GIF;break;case"52494646":t=Tt.WEBP;break;case"25504446":t=Tt.PDF;break;case"504B0304":t=Tt.ZIP;break}return t};function za(){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 qa={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:n=>{const t=["th","st","nd","rd"],e=n%100;return`[${n}${t[(e-20)%10]||t[e]||t[0]}]`}};let ts="en";const es={};es[ts]=qa;function yn(n,t){if(!n)return ts;let e;if(typeof n=="string"){const s=n.toLowerCase();es[s]&&(e=s),t&&(es[s]=t,e=s);const i=n.split("-");if(!e&&i.length>1)return yn(i[0])}else{const{name:s}=n;es[s]=n,e=s}return e&&(ts=e),e||ts}function K(){return(performance||Date).now()}function Ha(n,t){let e;return function(...s){clearTimeout(e),e=setTimeout(()=>{n.apply(this,s)},t)}}class $s{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(s=>s!==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(s=>{Reflect.apply(s,this,e)}),this}once(t,e){const i=(()=>{let r=!1;return(...a)=>{r||(r=!0,Reflect.apply(e,this,a),this.off(t,i))}})();return this.on(t,i),this}}var wn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function ja(n,t={}){var e=1,s=1;function i(F){var k=F.match(/\n/g);k&&(e+=k.length);var Y=F.lastIndexOf(`
|
|
11
|
+
`);s=~Y?F.length-Y:s+F.length}function r(){var F={line:e,column:s};return function(k){return k.position=new a(F),m(),k}}function a(F){this.start=F,this.end={line:e,column:s},this.source=t.source}a.prototype.content=n;var o=[];function h(F){var k=new Error(t.source+":"+e+":"+s+": "+F);if(k.reason=F,k.filename=t.source,k.line=e,k.column=s,k.source=n,t.silent)o.push(k);else throw k}function c(){var F=w();return{type:"stylesheet",stylesheet:{source:t.source,rules:F,parsingErrors:o}}}function l(){return b(/^{\s*/)}function d(){return b(/^}/)}function w(){var F,k=[];for(m(),P(k);n.length&&n.charAt(0)!="}"&&(F=le()||be());)F!==!1&&(k.push(F),P(k));return k}function b(F){var k=F.exec(n);if(k){var Y=k[0];return i(Y),n=n.slice(Y.length),k}}function m(){b(/^\s*/)}function P(F){var k;for(F=F||[];k=_();)k!==!1&&F.push(k);return F}function _(){var F=r();if(!(n.charAt(0)!="/"||n.charAt(1)!="*")){for(var k=2;n.charAt(k)!=""&&(n.charAt(k)!="*"||n.charAt(k+1)!="/");)++k;if(k+=2,n.charAt(k-1)==="")return h("End of comment missing");var Y=n.slice(2,k-2);return s+=2,i(Y),n=n.slice(k),s+=2,F({type:"comment",comment:Y})}}function v(){var F=b(/^([^{]+)/);if(F)return Yt(F[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(k){return k.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(k){return k.replace(/\u200C/g,",")})}function x(){var F=r(),k=b(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(k){if(k=Yt(k[0]),!b(/^:\s*/))return h("property missing ':'");var Y=b(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),G=F({type:"declaration",property:k.replace(wn,""),value:Y?Yt(Y[0]).replace(wn,""):""});return b(/^[;\s]*/),G}}function y(){var F=[];if(!l())return h("missing '{'");P(F);for(var k;k=x();)k!==!1&&(F.push(k),P(F));return d()?F:h("missing '}'")}function p(){for(var F,k=[],Y=r();F=b(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)k.push(F[1]),b(/^,\s*/);if(k.length)return Y({type:"keyframe",values:k,declarations:y()})}function E(){var F=r(),k=b(/^@([-\w]+)?keyframes\s*/);if(k){var Y=k[1];if(k=b(/^([-\w]+)\s*/),!k)return h("@keyframes missing name");var G=k[1];if(!l())return h("@keyframes missing '{'");for(var ut,At=P();ut=p();)At.push(ut),At=At.concat(P());return d()?F({type:"keyframes",name:G,vendor:Y,keyframes:At}):h("@keyframes missing '}'")}}function C(){var F=r(),k=b(/^@supports *([^{]+)/);if(k){var Y=Yt(k[1]);if(!l())return h("@supports missing '{'");var G=P().concat(w());return d()?F({type:"supports",supports:Y,rules:G}):h("@supports missing '}'")}}function B(){var F=r(),k=b(/^@host\s*/);if(k){if(!l())return h("@host missing '{'");var Y=P().concat(w());return d()?F({type:"host",rules:Y}):h("@host missing '}'")}}function q(){var F=r(),k=b(/^@media *([^{]+)/);if(k){var Y=Yt(k[1]);if(!l())return h("@media missing '{'");var G=P().concat(w());return d()?F({type:"media",media:Y,rules:G}):h("@media missing '}'")}}function V(){var F=r(),k=b(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(k)return F({type:"custom-media",name:Yt(k[1]),media:Yt(k[2])})}function W(){var F=r(),k=b(/^@page */);if(k){var Y=v()||[];if(!l())return h("@page missing '{'");for(var G=P(),ut;ut=x();)G.push(ut),G=G.concat(P());return d()?F({type:"page",selectors:Y,declarations:G}):h("@page missing '}'")}}function J(){var F=r(),k=b(/^@([-\w]+)?document *([^{]+)/);if(k){var Y=Yt(k[1]),G=Yt(k[2]);if(!l())return h("@document missing '{'");var ut=P().concat(w());return d()?F({type:"document",document:G,vendor:Y,rules:ut}):h("@document missing '}'")}}function ot(){var F=r(),k=b(/^@font-face\s*/);if(k){if(!l())return h("@font-face missing '{'");for(var Y=P(),G;G=x();)Y.push(G),Y=Y.concat(P());return d()?F({type:"font-face",declarations:Y}):h("@font-face missing '}'")}}var St=ne("import"),gt=ne("charset"),xe=ne("namespace");function ne(F){var k=new RegExp("^@"+F+"\\s*([^;]+);");return function(){var Y=r(),G=b(k);if(G){var ut={type:F};return ut[F]=G[1].trim(),Y(ut)}}}function le(){if(n[0]=="@")return E()||q()||V()||C()||St()||gt()||xe()||J()||W()||B()||ot()}function be(){var F=r(),k=v();return k?(P(),F({type:"rule",selectors:k,declarations:y()})):h("selector missing")}return Ws(c())}function Yt(n){return n?n.replace(/^\s+|\s+$/g,""):""}function Ws(n,t){var e=n&&typeof n.type=="string",s=e?n:t;for(var i in n){var r=n[i];Array.isArray(r)?r.forEach(function(a){Ws(a,s)}):r&&typeof r=="object"&&Ws(r,s)}return e&&Object.defineProperty(n,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),n}const $a={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:(n,t)=>{switch(t){case"W":return`${n}周`;default:return`${n}日`}},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:(n,t)=>{const e=n*100+t;return e<600?"凌晨":e<900?"早上":e<1100?"上午":e<1300?"中午":e<1800?"下午":"晚上"}};yn($a);function Wa(n,t=(e,s)=>e<=s){const e=n.length;let s=Math.floor(e/2);for(;s>0;){for(let i=s;i<e;i++){const r=n[i];let a=i;for(;a>=s&&!t(n[a-s],r);)n[a]=n[a-s],a-=s;n[a]=r}s=Math.floor(s/2)}}let xn;try{xn=Promise}catch{xn=function(){}}function bn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var vn={exports:{}};(function(n,t){(function(e){n.exports=e()})(function(e){var s=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(v,x){var y=v[0],p=v[1],E=v[2],C=v[3];y+=(p&E|~p&C)+x[0]-680876936|0,y=(y<<7|y>>>25)+p|0,C+=(y&p|~y&E)+x[1]-389564586|0,C=(C<<12|C>>>20)+y|0,E+=(C&y|~C&p)+x[2]+606105819|0,E=(E<<17|E>>>15)+C|0,p+=(E&C|~E&y)+x[3]-1044525330|0,p=(p<<22|p>>>10)+E|0,y+=(p&E|~p&C)+x[4]-176418897|0,y=(y<<7|y>>>25)+p|0,C+=(y&p|~y&E)+x[5]+1200080426|0,C=(C<<12|C>>>20)+y|0,E+=(C&y|~C&p)+x[6]-1473231341|0,E=(E<<17|E>>>15)+C|0,p+=(E&C|~E&y)+x[7]-45705983|0,p=(p<<22|p>>>10)+E|0,y+=(p&E|~p&C)+x[8]+1770035416|0,y=(y<<7|y>>>25)+p|0,C+=(y&p|~y&E)+x[9]-1958414417|0,C=(C<<12|C>>>20)+y|0,E+=(C&y|~C&p)+x[10]-42063|0,E=(E<<17|E>>>15)+C|0,p+=(E&C|~E&y)+x[11]-1990404162|0,p=(p<<22|p>>>10)+E|0,y+=(p&E|~p&C)+x[12]+1804603682|0,y=(y<<7|y>>>25)+p|0,C+=(y&p|~y&E)+x[13]-40341101|0,C=(C<<12|C>>>20)+y|0,E+=(C&y|~C&p)+x[14]-1502002290|0,E=(E<<17|E>>>15)+C|0,p+=(E&C|~E&y)+x[15]+1236535329|0,p=(p<<22|p>>>10)+E|0,y+=(p&C|E&~C)+x[1]-165796510|0,y=(y<<5|y>>>27)+p|0,C+=(y&E|p&~E)+x[6]-1069501632|0,C=(C<<9|C>>>23)+y|0,E+=(C&p|y&~p)+x[11]+643717713|0,E=(E<<14|E>>>18)+C|0,p+=(E&y|C&~y)+x[0]-373897302|0,p=(p<<20|p>>>12)+E|0,y+=(p&C|E&~C)+x[5]-701558691|0,y=(y<<5|y>>>27)+p|0,C+=(y&E|p&~E)+x[10]+38016083|0,C=(C<<9|C>>>23)+y|0,E+=(C&p|y&~p)+x[15]-660478335|0,E=(E<<14|E>>>18)+C|0,p+=(E&y|C&~y)+x[4]-405537848|0,p=(p<<20|p>>>12)+E|0,y+=(p&C|E&~C)+x[9]+568446438|0,y=(y<<5|y>>>27)+p|0,C+=(y&E|p&~E)+x[14]-1019803690|0,C=(C<<9|C>>>23)+y|0,E+=(C&p|y&~p)+x[3]-187363961|0,E=(E<<14|E>>>18)+C|0,p+=(E&y|C&~y)+x[8]+1163531501|0,p=(p<<20|p>>>12)+E|0,y+=(p&C|E&~C)+x[13]-1444681467|0,y=(y<<5|y>>>27)+p|0,C+=(y&E|p&~E)+x[2]-51403784|0,C=(C<<9|C>>>23)+y|0,E+=(C&p|y&~p)+x[7]+1735328473|0,E=(E<<14|E>>>18)+C|0,p+=(E&y|C&~y)+x[12]-1926607734|0,p=(p<<20|p>>>12)+E|0,y+=(p^E^C)+x[5]-378558|0,y=(y<<4|y>>>28)+p|0,C+=(y^p^E)+x[8]-2022574463|0,C=(C<<11|C>>>21)+y|0,E+=(C^y^p)+x[11]+1839030562|0,E=(E<<16|E>>>16)+C|0,p+=(E^C^y)+x[14]-35309556|0,p=(p<<23|p>>>9)+E|0,y+=(p^E^C)+x[1]-1530992060|0,y=(y<<4|y>>>28)+p|0,C+=(y^p^E)+x[4]+1272893353|0,C=(C<<11|C>>>21)+y|0,E+=(C^y^p)+x[7]-155497632|0,E=(E<<16|E>>>16)+C|0,p+=(E^C^y)+x[10]-1094730640|0,p=(p<<23|p>>>9)+E|0,y+=(p^E^C)+x[13]+681279174|0,y=(y<<4|y>>>28)+p|0,C+=(y^p^E)+x[0]-358537222|0,C=(C<<11|C>>>21)+y|0,E+=(C^y^p)+x[3]-722521979|0,E=(E<<16|E>>>16)+C|0,p+=(E^C^y)+x[6]+76029189|0,p=(p<<23|p>>>9)+E|0,y+=(p^E^C)+x[9]-640364487|0,y=(y<<4|y>>>28)+p|0,C+=(y^p^E)+x[12]-421815835|0,C=(C<<11|C>>>21)+y|0,E+=(C^y^p)+x[15]+530742520|0,E=(E<<16|E>>>16)+C|0,p+=(E^C^y)+x[2]-995338651|0,p=(p<<23|p>>>9)+E|0,y+=(E^(p|~C))+x[0]-198630844|0,y=(y<<6|y>>>26)+p|0,C+=(p^(y|~E))+x[7]+1126891415|0,C=(C<<10|C>>>22)+y|0,E+=(y^(C|~p))+x[14]-1416354905|0,E=(E<<15|E>>>17)+C|0,p+=(C^(E|~y))+x[5]-57434055|0,p=(p<<21|p>>>11)+E|0,y+=(E^(p|~C))+x[12]+1700485571|0,y=(y<<6|y>>>26)+p|0,C+=(p^(y|~E))+x[3]-1894986606|0,C=(C<<10|C>>>22)+y|0,E+=(y^(C|~p))+x[10]-1051523|0,E=(E<<15|E>>>17)+C|0,p+=(C^(E|~y))+x[1]-2054922799|0,p=(p<<21|p>>>11)+E|0,y+=(E^(p|~C))+x[8]+1873313359|0,y=(y<<6|y>>>26)+p|0,C+=(p^(y|~E))+x[15]-30611744|0,C=(C<<10|C>>>22)+y|0,E+=(y^(C|~p))+x[6]-1560198380|0,E=(E<<15|E>>>17)+C|0,p+=(C^(E|~y))+x[13]+1309151649|0,p=(p<<21|p>>>11)+E|0,y+=(E^(p|~C))+x[4]-145523070|0,y=(y<<6|y>>>26)+p|0,C+=(p^(y|~E))+x[11]-1120210379|0,C=(C<<10|C>>>22)+y|0,E+=(y^(C|~p))+x[2]+718787259|0,E=(E<<15|E>>>17)+C|0,p+=(C^(E|~y))+x[9]-343485551|0,p=(p<<21|p>>>11)+E|0,v[0]=y+v[0]|0,v[1]=p+v[1]|0,v[2]=E+v[2]|0,v[3]=C+v[3]|0}function r(v){var x=[],y;for(y=0;y<64;y+=4)x[y>>2]=v.charCodeAt(y)+(v.charCodeAt(y+1)<<8)+(v.charCodeAt(y+2)<<16)+(v.charCodeAt(y+3)<<24);return x}function a(v){var x=[],y;for(y=0;y<64;y+=4)x[y>>2]=v[y]+(v[y+1]<<8)+(v[y+2]<<16)+(v[y+3]<<24);return x}function o(v){var x=v.length,y=[1732584193,-271733879,-1732584194,271733878],p,E,C,B,q,V;for(p=64;p<=x;p+=64)i(y,r(v.substring(p-64,p)));for(v=v.substring(p-64),E=v.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],p=0;p<E;p+=1)C[p>>2]|=v.charCodeAt(p)<<(p%4<<3);if(C[p>>2]|=128<<(p%4<<3),p>55)for(i(y,C),p=0;p<16;p+=1)C[p]=0;return B=x*8,B=B.toString(16).match(/(.*?)(.{0,8})$/),q=parseInt(B[2],16),V=parseInt(B[1],16)||0,C[14]=q,C[15]=V,i(y,C),y}function h(v){var x=v.length,y=[1732584193,-271733879,-1732584194,271733878],p,E,C,B,q,V;for(p=64;p<=x;p+=64)i(y,a(v.subarray(p-64,p)));for(v=p-64<x?v.subarray(p-64):new Uint8Array(0),E=v.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],p=0;p<E;p+=1)C[p>>2]|=v[p]<<(p%4<<3);if(C[p>>2]|=128<<(p%4<<3),p>55)for(i(y,C),p=0;p<16;p+=1)C[p]=0;return B=x*8,B=B.toString(16).match(/(.*?)(.{0,8})$/),q=parseInt(B[2],16),V=parseInt(B[1],16)||0,C[14]=q,C[15]=V,i(y,C),y}function c(v){var x="",y;for(y=0;y<4;y+=1)x+=s[v>>y*8+4&15]+s[v>>y*8&15];return x}function l(v){var x;for(x=0;x<v.length;x+=1)v[x]=c(v[x]);return v.join("")}l(o("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function v(x,y){return x=x|0||0,x<0?Math.max(x+y,0):Math.min(x,y)}ArrayBuffer.prototype.slice=function(x,y){var p=this.byteLength,E=v(x,p),C=p,B,q,V,W;return y!==e&&(C=v(y,p)),E>C?new ArrayBuffer(0):(B=C-E,q=new ArrayBuffer(B),V=new Uint8Array(q),W=new Uint8Array(this,E,B),V.set(W),q)}}();function d(v){return/[\u0080-\uFFFF]/.test(v)&&(v=unescape(encodeURIComponent(v))),v}function w(v,x){var y=v.length,p=new ArrayBuffer(y),E=new Uint8Array(p),C;for(C=0;C<y;C+=1)E[C]=v.charCodeAt(C);return x?E:p}function b(v){return String.fromCharCode.apply(null,new Uint8Array(v))}function m(v,x,y){var p=new Uint8Array(v.byteLength+x.byteLength);return p.set(new Uint8Array(v)),p.set(new Uint8Array(x),v.byteLength),y?p:p.buffer}function P(v){var x=[],y=v.length,p;for(p=0;p<y-1;p+=2)x.push(parseInt(v.substr(p,2),16));return String.fromCharCode.apply(String,x)}function _(){this.reset()}return _.prototype.append=function(v){return this.appendBinary(d(v)),this},_.prototype.appendBinary=function(v){this._buff+=v,this._length+=v.length;var x=this._buff.length,y;for(y=64;y<=x;y+=64)i(this._hash,r(this._buff.substring(y-64,y)));return this._buff=this._buff.substring(y-64),this},_.prototype.end=function(v){var x=this._buff,y=x.length,p,E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],C;for(p=0;p<y;p+=1)E[p>>2]|=x.charCodeAt(p)<<(p%4<<3);return this._finish(E,y),C=l(this._hash),v&&(C=P(C)),this.reset(),C},_.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},_.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},_.prototype.setState=function(v){return this._buff=v.buff,this._length=v.length,this._hash=v.hash,this},_.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},_.prototype._finish=function(v,x){var y=x,p,E,C;if(v[y>>2]|=128<<(y%4<<3),y>55)for(i(this._hash,v),y=0;y<16;y+=1)v[y]=0;p=this._length*8,p=p.toString(16).match(/(.*?)(.{0,8})$/),E=parseInt(p[2],16),C=parseInt(p[1],16)||0,v[14]=E,v[15]=C,i(this._hash,v)},_.hash=function(v,x){return _.hashBinary(d(v),x)},_.hashBinary=function(v,x){var y=o(v),p=l(y);return x?P(p):p},_.ArrayBuffer=function(){this.reset()},_.ArrayBuffer.prototype.append=function(v){var x=m(this._buff.buffer,v,!0),y=x.length,p;for(this._length+=v.byteLength,p=64;p<=y;p+=64)i(this._hash,a(x.subarray(p-64,p)));return this._buff=p-64<y?new Uint8Array(x.buffer.slice(p-64)):new Uint8Array(0),this},_.ArrayBuffer.prototype.end=function(v){var x=this._buff,y=x.length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],E,C;for(E=0;E<y;E+=1)p[E>>2]|=x[E]<<(E%4<<3);return this._finish(p,y),C=l(this._hash),v&&(C=P(C)),this.reset(),C},_.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},_.ArrayBuffer.prototype.getState=function(){var v=_.prototype.getState.call(this);return v.buff=b(v.buff),v},_.ArrayBuffer.prototype.setState=function(v){return v.buff=w(v.buff,!0),_.prototype.setState.call(this,v)},_.ArrayBuffer.prototype.destroy=_.prototype.destroy,_.ArrayBuffer.prototype._finish=_.prototype._finish,_.ArrayBuffer.hash=function(v,x){var y=h(new Uint8Array(v)),p=l(y);return x?P(p):p},_})})(vn);var Ja=vn.exports;const Za=bn(Ja),Js=n=>new XMLSerializer().serializeToString(n),Ka=(n,t="text/html")=>new DOMParser().parseFromString(n,t),Sn=(n,t=Tt.SVG,e=Ee.utf8)=>pn(Js(n),t,e),Zs=(n,t)=>new Promise(e=>{const s=document.createElement("a");s.style.visibility="hidden",document.body.appendChild(s),s.download=t,typeof n=="string"?s.href=n:s.href=window.URL.createObjectURL(n),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(s.href),e()});function Cn(n=["*"],t){return new Promise((e,s)=>{if(!globalThis.document||!(globalThis.document instanceof Document))return s(new Error("This is not a browser environment"));const i=globalThis.document.createElement("input");i.setAttribute("type","file"),i.setAttribute("visibility","hidden"),Array.isArray(n)&&n.length>0&&i.setAttribute("accept",n.join(",")),t&&i.setAttribute("multiple","true"),globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!i.files||i.files?.length===0)&&s(new Error("Cancel select"))},1e3)},{once:!0});const r=()=>{if(i.removeEventListener("change",r),!i.files||i.files?.length===0)s(new Error("Cancel select"));else{const a=Array.from(i.files);!n.includes("*")&&a.some(o=>!n.includes(`.${En(o)}`))&&s(new Error(`Please select files in ${n} format`)),i.remove(),e(a)}};i.addEventListener("change",r),i.click()})}function ss(n,t="text",e){return new Promise((s,i)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{s(a.target?.result)}),r.addEventListener("error",a=>{i(a)}),t){case"dataURL":r.readAsDataURL(n);break;case"binaryString":r.readAsBinaryString(n);break;case"arrayBuffer":r.readAsArrayBuffer(n);break;case"text":default:r.readAsText(n)}})}async function Qa(n){const t=await ss(n,"arrayBuffer");return gn(t)}const En=n=>{let t;return n instanceof File?t=n.name:t=n,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function Tn(n,t,e,s,i,r,a){const o=new FileReader;o.onload=h=>{if(!h.target||!h.target.result)return t(h);if(e.append(h.target.result),a<s.size)Tn(n,t,e,s,i,a,Math.min(a+i,s.size));else return n(e.end())},o.onerror=h=>t(h),o.readAsArrayBuffer(s.slice(r,a))}async function to(n,t=1048576){return await new Promise((e,s)=>Tn(e,s,new Za.ArrayBuffer,n,t,0,Math.min(t,n.size)))}class eo{file;url;completeFileUrl;autoUpload;chunk;chunks;currentChunk;isUploading;isUploaded;constructor(t){this.file=t.file,this.url=t.url,this.completeFileUrl=t.completeFileUrl,this.autoUpload=t.autoUpload||!1,this.chunk=t.chunk||1048576,this.chunks=Math.ceil(this.file.size/this.chunk),this.currentChunk=0,this.isUploading=!1,this.isUploaded=!1}initXhr(){return{load:()=>{},error:t=>{console.log("xhr error"+t.toString())}}}}function Jt(n,t={},e=[],s){return{tag:n,props:t,children:e,el:s}}function pe(n,t){if(n.el)return n.el;if(n.el=document.createElement(n.tag),n.props)for(const e in n.props){const s=n.props[e];e.startsWith("on")?n.el.addEventListener(e.slice(2).toLowerCase(),s):n.el.setAttribute(e,s)}return n.children&&(typeof n.children=="string"?n.el.textContent=n.children:n.children.forEach(e=>{pe(e,n.el)})),t?.appendChild(n.el),n.el}function is(n,t){if(!n.el)return;if(n.tag!==t.tag){(n.el.parentElement||document.body).replaceChild(pe(t),n.el);return}const e=t.el=n.el,s=n.props,i=t.props;for(const o in s)o in i||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),s[o]):e.removeAttribute(o));for(const o in i){const h=s[o],c=i[o];if(c!=h)if(o.startsWith("on")){const l=o.slice(2).toLowerCase();e.removeEventListener(l,h),e.addEventListener(l,c)}else o==="style"?Object.keys(c||{}).forEach(l=>{const d=String(c[l]).toLowerCase().includes("!important")?"important":"";e.style.setProperty(ft(l),String(c[l]).replace(/!important/i,""),d)}):e.setAttribute(o,c)}const r=n.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{pe(o,e)});else{const o=Math.min(r.length,a.length);for(let h=0;h<o;h++)is(r[h],a[h]);a.length>r.length&&a.slice(r.length).forEach(h=>{pe(h,e)}),a.length<r.length&&r.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}function Pn(n,t){if(!n.isEqualNode(t)){if(n.nodeName!==t.nodeName){(n.parentElement||document.body).replaceChild(t,n);return}if(n.nodeType===Node.TEXT_NODE){n.textContent!==t.textContent&&(n.textContent=t.textContent);return}for(let e=n.attributes.length-1;e>=0;e--){const s=n.attributes[e].name;!t.hasAttribute(s)&&s!=="open"&&n.removeAttribute(s)}for(let e=0;e<t.attributes.length;e++){const s=t.attributes[e].name,i=t.attributes[e].value;n.setAttribute(s,i)}for(let e=0;e<t.childNodes.length;e++)n.childNodes[e]?Pn(n.childNodes[e],t.childNodes[e]):n.appendChild(t.childNodes[e].cloneNode(!0));for(;n.childNodes.length>t.childNodes.length;)n.lastChild&&n.removeChild(n.lastChild)}}class so{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:s,wasClean:i}=t;console.log(`ws closed : ${e} ${s} ${i}`)},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 s=this.waitingResponse[e.requestid];s?s.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,s=this.waitingResponse[e]={requestid:e};try{let i;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?i=t:i=JSON.stringify({...s,...t});const r=await new Promise((a,o)=>{s.resolve=a,this.sendWithRetry(i),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-s.requestid)/1e3),r}catch(i){return Promise.reject(i)}finally{delete this.waitingResponse[e]}}async send(t,e,s=i=>{console.log(i)}){this.sendPayload(t).then(e,s)}}function io(){const n=window.screen;return{screenWidth:n.width,screenHeight:n.height,screenX:window.screenX,screenY:window.screenY}}function Te(){const n=document.documentElement;return{clientWidth:n.clientWidth,clientHeight:n.clientHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,offsetWidth:n.offsetWidth,offsetHeight:n.offsetHeight,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft,offsetParent:n.offsetParent}}function no(){const n=document.body;return{clientWidth:n.clientWidth,clientHeight:n.clientHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,offsetWidth:n.offsetWidth,offsetHeight:n.offsetHeight,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft,offsetParent:n.offsetParent}}function ro(){return typeof window.innerWidth=="number"?{width:window.innerWidth,height:window.innerHeight}:document.compatMode==="CSS1Compat"?{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}:{width:document.body.clientWidth,height:document.body.clientHeight}}function ao(){const{scrollWidth:n,scrollHeight:t}=Te();return{width:n,height:t}}function _n(n){const{top:t,left:e,width:s,height:i}=n.getBoundingClientRect(),{scrollLeft:r,scrollTop:a}=Te();return{x:e+r,y:t+a,width:s,height:i}}function oo(n){let t=n,e=0,s=0;for(;t!==null;)e+=t.offsetLeft,s+=t.offsetTop,t.offsetParent instanceof HTMLElement?t=t.offsetParent:t=null;return{x:e,y:s,width:n.offsetWidth,height:n.offsetHeight}}function An(n){return n.getBoundingClientRect()}function ho(n){const t=n.getBoundingClientRect();return{x:n.offsetLeft,y:n.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function co(){const{clientHeight:n,scrollTop:t,scrollHeight:e}=Te(),s=e-n;return s<=0?0:t/s*100}function lo(n){if("center"in n){const t=n.center,e=An(n.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:n.clientX,y:n.clientY}}function Dn(n){if("center"in n)return n.center;if(typeof n.pageX=="number"&&typeof n.pageY=="number")return{x:n.pageX,y:n.pageY};const{scrollLeft:t,scrollTop:e}=Te();return{x:n.clientX+t,y:n.clientY+e}}function Pt(n,t){if(!t&&"offsetX"in n)return{x:n.offsetX,y:n.offsetY};const e=Dn(n),s=_n(t||n.target);return{x:e.x-s.x,y:e.y-s.y}}const ns=()=>{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()},uo=()=>{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()},Ks=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(n)||/opera/i.test(n)?t="Opera":/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()},fo=()=>{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},mo=()=>"geolocation"in navigator?new Promise((n,t)=>{navigator.geolocation.getCurrentPosition(e=>{const s=e.coords.latitude,i=e.coords.longitude;n({latitude:s,longitude:i})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function po(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function go(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Qs(){return ns()==="ios"}function ti(){return ns()==="macos"}function yo(){return Qs()|ti()}function Mn(){return ns()==="android"}function wo(){return Qs()||Mn()}function xo(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function In(){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 i=n.indexOf("rv:");return parseInt(n.substring(i+3,n.indexOf(".",i)),10)}const s=n.indexOf("Edge/");return s>0?parseInt(n.substring(s+5,n.indexOf(".",s)),10):-1}const bo=In()!==-1;function vo(){const n=document.documentMode;return n&&(n===9||n===10)}function kn(){return Ks()==="wechat"}function Ln(){return Ks()==="ali"}function So(){return kn()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function Co(){return Ln()&&navigator.userAgent.match(/miniprogram/i)}const Eo=typeof document<"u",Rn=typeof window<"u",To=typeof history<"u",Po=Rn&&window.File&&window.FileReader&&window.FileList&&window.Blob,On=(()=>{const n=en();return!!(n.Worker&&n.Blob&&n.Promise&&n.OffscreenCanvas&&n.OffscreenCanvasRenderingContext2D&&n.HTMLCanvasElement&&n.HTMLCanvasElement.prototype.transferControlToOffscreen&&n.URL&&n.URL.createObjectURL)})(),_o=typeof Path2D=="function"&&typeof DOMMatrix=="function",Fn=function(){if(!en().OffscreenCanvas)return!1;const t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);const s=t.transferToImageBitmap();try{e.createPattern(s,"no-repeat")}catch{return!1}return!0}(),Ao=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},Do="webkit moz ms o".split(" ");function rs(n){return typeof n=="function"&&/native code/.test(n.toString())}function Mo(n){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let s=100;const i=function(){const r=Math.min(t.clientWidth,n);t.dataset.width=r,t.dataset.rem=s=Math.round(100*(r/n)),t.style.fontSize=s+"px"};i(),window.rem2px=function(r){return r=parseFloat(r),r*s},window.px2rem=function(r){return r=parseFloat(r),r/s},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",i,!1)}function N(n){return n*Math.PI/180}function nt(n){return n*180/Math.PI}function as(n,t,e=0){return Math.sqrt(n*n+t*t+e*e)}function os(n,t,e,s){return as(e-n,s-t)}function hs(n,t,e,s){const i=e-n,r=s-t;return i*i+r*r}function Zt(n,t,e,s){let i=Math.atan2(s-t,e-n);return i<0&&(i+=Math.PI*2),i}function It(n,t){return{dx:Math.cos(n)*t,dy:Math.sin(n)*t}}function Io(n,t,e){if(typeof e=="number"){const s=Math.sqrt(Math.pow(n,2)+Math.pow(t,2)+Math.pow(e,2));return{x:n/=s,y:t/=s,z:e/=s}}else{const s=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return{x:n/=s,y:t/=s}}}function ko(n,t,e,s,i=10){if(Math.abs(e-n)<i&&Math.abs(s-t)<i)return"no";const r=nt(Zt(n,t,e,s));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}const Nn=Lo("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 Lo(n,t=10){const e={},s=n.split(",");for(let i=0;i<s.length;i+=2){const r="&"+s[i+1]+";",a=parseInt(s[i],t);e[r]="&#"+a+";"}return e["\\xa0"]=" ",e}function ht(n,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)n=n.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return n}function cs(n){let t,e;if(!n)throw new Error("cannot create a random attribute name for an undefined object");const s="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=s[Math.floor(Math.random()*s.length)];while(n[t]);return t}function Ro(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function Oo(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const Pe={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"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}};class ls{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const s=this.__ctx.__createElement("stop");if(s.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&&(s.setAttribute("stop-color",ht("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),s.setAttribute("stop-opacity",r[4]))}else s.setAttribute("stop-color",e);this.__root.appendChild(s)}}class ei{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class _e{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:s=500}){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=s),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(Pe);for(let e=0,s=t.length;e<s;e++){const i=t[e];this[i]=Pe[i].canvas}}__getStyleState(){const t={},e=Object.keys(Pe);for(let s=0,i=e.length;s<i;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,i=e.length;s<i;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];i.setAttribute(o,e[o])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const s=this.__currentElementsToStyle;s&&(e.setAttribute(t,""),e=s.element,s.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(Pe);for(let r=0;r<i.length;r++){const a=Pe[i[r]],o=this[i[r]];if(a.apply){if(o instanceof ei){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,ht("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof ls)e.setAttribute(a.apply,ht("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);if(c){e.setAttribute(a.svgAttr,ht("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const d=this.globalAlpha;d!=null&&(l*=d),e.setAttribute(a.svgAttr+"-opacity",""+l)}}else{let h=a.svgAttr;if(i[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 i=Object.keys(Nn);for(let r=0,a=i.length;r<a;r++){const o=i[r],h=Nn[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 i=this.__createElement("g");e.appendChild(i),this.__currentElement=i}let s=this.__currentElement.getAttribute("transform");s?s+=" ":s="",s+=t,this.__currentElement.setAttribute("transform",s)}scale(t,e){e===void 0&&(e=t),this.__addTransform(ht("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(ht("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(ht("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,i,r,a){this.__addTransform(ht("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,d:i,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(ht("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(ht("L {x} {y}",this.__currentPosition)):this.__addPathCommand(ht("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,i,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(ht("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:i,x:r,y:a}))}quadraticCurveTo(t,e,s,i){this.__currentPosition={x:s,y:i},this.__addPathCommand(ht("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:i}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,s,i,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===s&&e===i||r===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),c=this.normalize([s-t,i-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const l=h[0]*c[0]+h[1]*c[1],d=Math.acos(Math.abs(l)),w=this.normalize([h[0]+c[0],h[1]+c[1]]),b=r/Math.sin(d/2),m=t+b*w[0],P=e+b*w[1],_=[-h[1],h[0]],v=[c[1],-c[0]],x=function(E){const C=E[0];return E[1]>=0?Math.acos(C):-Math.acos(C)},y=x(_),p=x(v);this.lineTo(m+_[0]*r,P+_[1]*r),this.arc(m,P,r,y,p)}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,s,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],i=s.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&s.removeChild(i[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,i){if(t===0&&e===0&&s===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:s,height:i,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,s,i){const r=this.__createElement("linearGradient",{id:cs(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new ls(r,this)}createRadialGradient(t,e,s,i,r,a){const o=this.__createElement("radialGradient",{id:cs(this.__ids),cx:i+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new ls(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),s={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"&&(s.decoration="underline"),this.__fontHref&&(s.href=this.__fontHref),s}__wrapTextLink(t,e){if(t.href){const s=this.__createElement("a");return s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),s.appendChild(e),s}return e}__applyText(t,e,s,i){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:s,"text-anchor":Ro(this.textAlign),"dominant-baseline":Oo(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(i),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,s){this.__applyText(t,e,s,"fill")}strokeText(t,e,s){this.__applyText(t,e,s,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,i,r,a){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===r&&(r=(r+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+s*Math.cos(r),h=e+s*Math.sin(r),c=t+s*Math.cos(i),l=e+s*Math.sin(i),d=a?0:1;let w=0,b=r-i;b<0&&(b+=2*Math.PI),a?w=b>Math.PI?0:1:w=b>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(ht("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:w,sweepFlag:d,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=cs(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",s),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",ht("url(#{id})",{id:s})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],s,i,r,a,o=0,h=0,c,l,d,w,b,m,P,_;if(t.length===3)s=t[1],i=t[2],c=e.width,l=e.height,r=c,a=l;else if(t.length===5)s=t[1],i=t[2],r=t[3],a=t[4],c=e.width,l=e.height;else if(t.length===9)o=t[1],h=t[2],c=t[3],l=t[4],s=t[5],i=t[6],r=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const v=this.__closestGroupOrSvg();this.__currentElement;const x="translate("+s+", "+i+")";if(e instanceof _e){if(d=e.getSvg().cloneNode(!0),d.childNodes&&d.childNodes.length>1){for(w=d.childNodes[0];w.childNodes.length;)_=w.childNodes[0].getAttribute("id"),this.__ids[_]=_,this.__SVGdefs.appendChild(w.childNodes[0]);if(b=d.childNodes[1],b){const y=b.getAttribute("transform");let p;y?p=y+" "+x:p=x,b.setAttribute("transform",p),v.appendChild(b)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(m=this.__createElement("image"),m.setAttribute("width",r),m.setAttribute("height",a),m.setAttribute("preserveAspectRatio","none"),(o||h||c!==e.width||l!==e.height)&&(P=this.__document.createElement("canvas"),P.width=r,P.height=a,P.getContext("2d")?.drawImage(e,o,h,c,l,0,0,r,a),e=P),m.setAttribute("transform",x),m.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),v.appendChild(m))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=cs(this.__ids);let r;return s.setAttribute("id",i),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")),s.appendChild(r),this.__SVGdefs.appendChild(s)):t instanceof _e&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new ei(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class us{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s,i=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new _e({canvas:this.canvas,width:e||this.canvas.width,height:s||this.canvas.height}))}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(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&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(this.customContext.fillStyle=t.gradientCustom))}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,s,i){return this.context.fillRect(t,e,s,i),this.customContext&&this.customContext.fillRect(t,e,s,i),this}fillText(t,e,s,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,i),this.customContext&&this.customContext.fillText(t,e,s),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,s,i){return this.context.strokeText(t,e,s,i),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,i){return this.context.strokeRect(t,e,s,i),this.customContext&&this.customContext.strokeRect(t,e,s,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,s,i),this.customContext&&this.customContext.clearRect(t,e,s,i),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext&&this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const s=new Path2D;s.addPath(t,e),this.currentPath2D=s}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&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,s=0){return this.translate(e,s),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-s),this.changePath2D(),this}scale(t,e=t,s=0,i=0){return this.translate(s,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-s,-i),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,s,i,r,a){return this.context.arc(t,e,s,i,r,a),this.customContext&&this.customContext.arc(t,e,s,i,r,a?-1:1),this.currentPath2D.arc(t,e,s,i,r,a),this}arcTo(t,e,s,i,r){return this.context.arcTo(t,e,s,i,r),this.customContext&&this.customContext.arcTo(t,e,s,i,r),this.currentPath2D.arcTo(t,e,s,i,r),this}ellipse(t,e,s,i,r,a,o,h){return this.context.ellipse(t,e,s,i,r,a,o,h),this.currentPath2D.ellipse(t,e,s,i,r,a,o,h),this}quadraticCurveTo(t,e,s,i){return this.context.quadraticCurveTo(t,e,s,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,i),this.currentPath2D.quadraticCurveTo(t,e,s,i),this}bezierCurveTo(t,e,s,i,r,a){return this.context.bezierCurveTo(t,e,s,i,r,a),this.customContext&&this.customContext.bezierCurveTo(t,e,s,i,r,a),this.currentPath2D.bezierCurveTo(t,e,s,i,r,a),this}rect(t,e,s,i){return this.context.rect(t,e,s,i),this.customContext&&this.customContext.rect(t,e,s,i),this.currentPath2D.rect(t,e,s,i),this}createLinearGradient(t,e,s,i,r){const a=this.context.createLinearGradient(t,e,s,i);return r&&Object.entries(r).forEach(([o,h])=>{a.addColorStop(parseFloat(o),h)}),a}createRadialGradient(t,e,s,i,r,a,o){const h=this.context.createRadialGradient(t,e,s,i,r,a);return o&&Object.entries(o).forEach(([c,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const s=e[0],i=e[1];this.context.drawImage(t,s,i)}else if(e.length===4){const s=e[0],i=e[1],r=e[2],a=e[3];this.context.drawImage(t,s,i,r,a)}else if(e.length===8){const s=e[0],i=e[1],r=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,s,i,r,a,o,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,s=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,s,i,r)}putImageData(t,e=0,s=0){return this.context.putImageData(t,e,s)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}}class ds{x;y;toX;toY;constructor(t){this.x=t?.x||0,this.y=t?.y||0,this.toX=t?.toX||0,this.toY=t?.toY||0}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(){const t=Zt(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),s=Math.min(this.y,this.toY),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:s,width:i-e,height:r-s}}else{const e=Math.sin(t),s=Math.cos(t),i=s*this.x-e*this.y,r=s*this.toX-e*this.toY,a=s*this.y+e*this.x,o=s*this.toY+e*this.toX;return{x:Math.min(i,r),y:Math.min(a,o),width:Math.max(i,r)-Math.min(i,r),height:Math.max(a,o)-Math.min(a,o)}}}interpolate(t){return{x:this.x+t*(this.toX-this.x),y:this.y+t*(this.toY-this.y)}}intersection(t){const e=this.x,s=this.y,i=t.toX,r=t.toY,a=this.toX-e,o=t.x-i;if(!a&&!o)return null;const h=(this.toY-s)/a,c=(t.y-r)/o;if(a){if(!o)return{x:i,y:h*(i-e)+s}}else return{x:e,y:c*(e-i)+r};const l=(-c*i+r+h*e-s)/(h-c),d=h*(l-e)+s;return isNaN(l)||isNaN(d)?null:{x:l,y:d}}}const Bn=ds;class si extends ds{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,this.toX=t.toX,this.toY=t.toY}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,s,i,r,a,o,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,s,i,r,a,o,h,!this.sweepFlag)}convert(t,e,s,i,r,a,o,h,c){const l=o/180*Math.PI,d=(t-s)/2,w=(e-i)/2,b=Math.cos(l)*d+Math.sin(l)*w,m=-Math.sin(l)*d+Math.cos(l)*w,P=b*b/(r*r)+m*m/(a*a);if(P>1){const J=Math.sqrt(P);throw r=J*r,a=J*a,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${a}.`)}const _=Math.sqrt((r*r*a*a-r*r*m*m-a*a*b*b)/(r*r*m*m+a*a*b*b)),v=h!=c?1:-1,x=v*_*r*m/a,y=v*_*-a*b/r,p=(t+s)/2,E=(e+i)/2,C=Math.cos(l)*x-Math.sin(l)*y+p,B=Math.sin(l)*x+Math.cos(l)*y+E,q=(J,ot,St,gt)=>(J*gt>=ot*St?1:-1)*Math.acos((J*St+ot*gt)/(Math.sqrt(J*J+ot*ot)*Math.sqrt(St*St+gt*gt))),V=q(1,0,t-C,e-B)-l,W=q(t-C,e-B,s-C,i-B);return[C,B,r,a,l,V,V+W]}}class Fo extends ds{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,s,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(){const t=[this.x,this.toX],e=[this.y,this.toY];let s,i,r,a;for(let c=0;c<2;++c)s=c==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,i=c==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=c==0?this.x:this.y,Math.abs(s)>1e-12&&(a=-i/(2*s),0<a&&a<1&&[t,e][c].push(s*a*a+i*a+r));const o={x:Math.min.apply(0,t),y:Math.min.apply(0,e)},h={x:Math.max.apply(0,t),y:Math.max.apply(0,e)};return{x:o.x,y:o.y,width:h.x-o.x,height:h.y-o.y}}interpolate(t){return{x:(1-t)*(1-t)*this.x+2*(1-t)*t*this.cx+t*t*this.toX,y:(1-t)*(1-t)*this.y+2*(1-t)*t*this.cy+t*t*this.toY}}}const No=Fo;class mt extends ds{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}toSVGPathData(){return[["C",this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY]]}toCanvasContext(t){t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY)}getBoundingClientRect(){let t=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),e=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),s=this.x-this.c1x,i=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t;const a=[this.y,this.toY],o=[this.x,this.toX];let h;const c=[];Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),t=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),e=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),s=this.y-this.c1y,i=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t,Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y}));let l=[],d=c.length;for(let m=0;m<d;m++){for(let P=m+1;P<d;P++)c[m].X===c[P].X&&c[m].Y===c[P].Y&&(P=++m);l.push({X:c[m].X,Y:c[m].Y})}const w={x:Math.min.apply(Math,o),y:Math.min.apply(Math,a)},b={x:Math.max.apply(Math,o),y:Math.max.apply(Math,a)};return{x:w.x,y:w.y,width:b.x-w.x,height:b.y-w.y,dots:l}}interpolate(t){return{x:Math.pow(1-t,3)*this.x+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.toX,y:Math.pow(1-t,3)*this.y+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.toY}}static base3(t,e,s,i,r){const a=-3*e+9*s-9*i+3*r,o=t*a+6*e-12*s+6*i;return t*o-3*e+3*s}static bezlen(t,e,s,i,r,a,o,h,c=1){c=Math.max(0,Math.min(c,1));const l=c/2,d=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],w=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let b=0;for(let m=0;m<12;m++){const P=l*d[m]+l,_=this.base3(P,t,s,r,o),v=this.base3(P,e,i,a,h);b+=w[m]*Math.sqrt(_*_+v*v)}return l*b}length(t=1){return mt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,s=this.y,i=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,h=this.toX,c=this.toY;if(t<0||mt.bezlen(e,s,i,r,a,o,h,c)<t)return 0;let l=1,d=l/2,w=l-d,b=mt.bezlen(e,s,i,r,a,o,h,c,w);for(;Math.abs(b-t)>.01;)d/=2,w+=(b<t?1:-1)*d,b=mt.bezlen(e,s,i,r,a,o,h,c,w);return w}getPointAtSegmentLength(t){const e=this.getTatLen(t);let s=1-e,i=Math.pow(s,3),r=Math.pow(s,2),a=e*e,o=a*e,h=i*this.x+r*3*e*this.c1x+s*3*e*e*this.c2x+o*this.toX,c=i*this.y+r*3*e*this.c1y+s*3*e*e*this.c2y+o*this.toY,l=this.x+2*e*(this.c1x-this.x)+a*(this.c2x-2*this.c1x+this.x),d=this.y+2*e*(this.c1y-this.y)+a*(this.c2y-2*this.c1y+this.y),w=this.c1x+2*e*(this.c2x-this.c1x)+a*(this.toX-2*this.c2x+this.c1x),b=this.c1y+2*e*(this.c2y-this.c1y)+a*(this.toY-2*this.c2y+this.c1y),m=s*this.x+e*this.c1x,P=s*this.y+e*this.c1y,_=s*this.c2x+e*this.toX,v=s*this.c2y+e*this.toY,x=90-Math.atan2(l-w,d-b)*180/Math.PI;return{x:h,y:c,m:{x:l,y:d},n:{x:w,y:b},start:{x:m,y:P},end:{x:_,y:v},alpha:x}}}const Ae=Math.PI*2;function Yn(n,t,e,s){const i=n*s-t*e<0?-1:1;let r=n*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function Bo(n,t,e,s,i,r,a,o,h,c){const l=c*(n-e)/2+h*(t-s)/2,d=-h*(n-e)/2+c*(t-s)/2,w=a*a,b=o*o,m=l*l,P=d*d;let _=w*b-w*P-b*m;_<0&&(_=0),_/=w*P+b*m,_=Math.sqrt(_)*(i===r?-1:1);const v=_*a/o*d,x=_*-o/a*l,y=c*v-h*x+(n+e)/2,p=h*v+c*x+(t+s)/2,E=(l-v)/a,C=(d-x)/o,B=(-l-v)/a,q=(-d-x)/o,V=Yn(1,0,E,C);let W=Yn(E,C,B,q);return r===0&&W>0&&(W-=Ae),r===1&&W<0&&(W+=Ae),[y,p,V,W]}function Yo(n,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(n),i=Math.sin(n),r=Math.cos(n+t),a=Math.sin(n+t);return[s,i,s-i*e,i+s*e,r+a*e,a-r*e,r,a]}function Xn(n,t,e,s,i,r,a,o,h){const c=Math.sin(h*Ae/360),l=Math.cos(h*Ae/360),d=l*(n-e)/2+c*(t-s)/2,w=-c*(n-e)/2+l*(t-s)/2;if(d===0&&w===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const b=d*d/(a*a)+w*w/(o*o);b>1&&(a*=Math.sqrt(b),o*=Math.sqrt(b));const m=Bo(n,t,e,s,i,r,a,o,c,l),P=[];let _=m[2],v=m[3];const x=Math.max(Math.ceil(Math.abs(v)/(Ae/4)),1);v/=x;for(let y=0;y<x;y++)P.push(Yo(_,v)),_+=v;return P.map(y=>{for(let p=0;p<y.length;p+=2){let E=y[p+0],C=y[p+1];E*=a,C*=o;const B=l*E-c*C,q=c*E+l*C;y[p+0]=B+m[0],y[p+1]=q+m[1]}return y})}function ii(n,t,e,s,i,r){return[n/3+.6666666666666666*e,t/3+.6666666666666666*s,i/3+.6666666666666666*e,r/3+.6666666666666666*s,i,r]}function De(n,t,e,s){return[n,t,e,s,e,s]}const Me={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class ae{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&L.attribute(s,e),s}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||zs()})}static downloadFromSVGElement(t,e="shape"){return Zs(Sn(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Zs(pn(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return Js(t)}static isSVGPath(t){return typeof t!="string"?!1:(t=t.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(t)&&/[\dz]$/i.test(t))}static SVGPathDataToD(t){return t.map(e=>{if(!e[0])return"";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 parseSVGPath(t){const e=[];return ae.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,i,r)=>{let a=i.toLowerCase();const o=mn(r);for(a=="m"&&o.length>Me[a]&&(e.push([i,...o.splice(0,Me[a])]),a="l",i=i=="m"?"l":"L");o.length;){if(o.length<Me[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${i} } args:{ ${o} }`);e.push([i,...o.splice(0,Me[a])])}return a=="z"&&e.push([i]),""}),e}static absolutizeSVGPath(t){let e=0,s=0,i=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]+=i,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=i;break;default:for(let c=1;c<a.length;)a[c++]+=i,a[c++]+=r}switch(h){case"Z":i=e,r=s;break;case"H":i=a[1];break;case"V":r=a[1];break;case"M":i=e=a[1],r=s=a[2];break;default:i=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,s=0,i=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]-=i,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=i;break;default:for(let c=1;c<a.length;)a[c++]-=i,a[c++]-=r}switch(h){case"z":i=e,r=s;break;case"h":i+=a[1];break;case"v":r+=a[1];break;case"m":i+=a[1],r+=a[2],e+=a[1],s+=a[2];break;default:i+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){const e=[];let s=0,i=0,r=0,a=0,o=0,h=0,c=0,l=0,d;for(let w=0,b=t.length;w<b;w++){let m=t[w];const P=m[0];switch(P){case"M":s=m[1],i=m[2];break;case"A":const _=Xn(r,a,m[6],m[7],m[4],m[5],m[1],m[2],m[3]);if(!_.length)continue;_.forEach((y,p)=>{const[E,C,B,q,V,W,J,ot]=y;m=["C",B,q,V,W,J,ot],p<_.length-1&&e.push(m)});break;case"S":let v=r,x=a;(d=="C"||d=="S")&&(v+=v-c,x+=x-l),m=["C",v,x,m[1],m[2],m[3],m[4]];break;case"T":d=="Q"||d=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),m=["C",...ii(r,a,o,h,m[1],m[2])];break;case"Q":o=m[1],h=m[2],m=["C",...ii(r,a,m[1],m[2],m[3],m[4])];break;case"L":m=["C",...De(r,a,m[1],m[2])];break;case"H":m=["C",...De(r,a,m[1],a)];break;case"V":m=["C",...De(r,a,r,m[1])];break;case"Z":m=["C",...De(r,a,s,i)];break}d=P,r=m[m.length-2],a=m[m.length-1],m.length>4?(c=m[m.length-4],l=m[m.length-3]):(c=r,l=a),e.push(m)}return e}static catmullRom2bezier(t){const e=[];for(let s=0,i=t.length;i-2>s;s+=2){let r;s==0?r=[{x:t[s],y:t[s+1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}]:i-4==s?r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+2],y:t[s+3]}]:r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+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 zvhToLSVGPath(t){const e=[];let s=["L",0,0],i;for(let r=0,a=t.length;r<a;r++){const o=t[r];switch(o[0]){case"M":s=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(s);break;case"H":i=e[e.length-1]||["L",0,0],e.push(["L",o[1],i[i.length-1]]);break;case"V":i=e[e.length-1]||["L",0,0],e.push(["L",i[i.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 s,i=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,s&&(s[0]===c.to?(i=2*Number(s[c.x+2])-Number(s[c.x]),r=2*Number(s[c.x+3])-Number(s[c.x+1])):(i=Number(s[s.length-2]),r=Number(s[s.length-1]))),h.splice(1,0,i,r)),s=h}return t}}const yt=ae;class wt{cX;cY;x;y;degree;scalarX;scalarY;startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){this.cX=0,this.cY=0,this.x=t?.x||0,this.y=t?.y||0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&(this.cX=t.centerX-this.x,this.cY=t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.reset(t?.d,t?.originMatrix)}reset(t,e){typeof t=="string"?this.resetFromSVGPathData(yt.parseSVGPath(t),e):t instanceof wt?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const s=yt.normalizeSVGPath(yt.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let i=!1;for(let r=0,a=s.length;r<a;r++){const o=s[r];if(o[0]=="M"){i||(i=!0,this.startPathX=o[1],this.startPathY=o[2]),this.prevPathX=o[1],this.prevPathY=o[2];continue}this.appendLine(new mt({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}e&&({x:this.startPathX,y:this.startPathY}=e.transformPoint({x:this.startPathX,y:this.startPathY}),{x:this.prevPathX,y:this.prevPathY}=e.transformPoint({x:this.prevPathX,y:this.prevPathY}),this.normalizedLines.forEach(r=>{({x:r.x,y:r.y}=e.transformPoint({x:r.x,y:r.y})),{x:r.c1x,y:r.c1y}=e.transformPoint({x:r.c1x,y:r.c1y}),{x:r.c2x,y:r.c2y}=e.transformPoint({x:r.c2x,y:r.c2y}),{x:r.toX,y:r.toY}=e.transformPoint({x:r.toX,y:r.toY})}))}static fromPolymorphPoints(t){const e=new wt;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let s=2,i=t.length;s+5<i;s+=6)e.appendLine(new mt({c1x:t[s],c1y:t[s+1],c2x:t[s+2],c2y:t[s+3],toX:t[s+4],toY:t[s+5]}));return e}static fromLines(t){const e=new wt;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let s=0,i=t.length;s<i;s++)e.appendLine(t[s]);return e}appendLine(t){if(t instanceof si){Xn(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,d,w,b,m,P,_,v]=c;this.normalizedLines.push(new mt({x:this.prevPathX,y:this.prevPathY,c1x:w,c1y:b,c2x:m,c2y:P,toX:_,toY:v})),this.prevPathX=_,this.prevPathY=v});return}let e,s,i,r,a,o;t instanceof mt?(e=t.c1x,s=t.c1y,i=t.c2x,r=t.c2y,a=t.toX,o=t.toY):t instanceof No?[e,s,i,r,a,o]=ii(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,i,r,a,o]=De(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new mt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:i,c2y:r,toX:a,toY:o})),this.prevPathX=a,this.prevPathY=o}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform(),i=[];i.push(["M",t,e]);for(let r=0,a=s.length;r<a;r++)i.push(...s[r].toSVGPathData());return i}toSVGPathD(){return yt.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:s,normalizedLines:i}=this.updateTransform();t.beginPath(),t.moveTo(e,s),i.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],s=[];if(t.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),s.push(c.y,c.y+c.height)}),e.length==0||s.length==0)return{x:0,y:0,width:0,height:0};const i=Math.min.apply(0,e),r=Math.min.apply(0,s),a=Math.max.apply(0,e),o=Math.max.apply(0,s);return{x:i,y:r,width:a-i,height:o-r}}update(t){this.cX=typeof t.cX=="number"?t.cX:this.cX,this.cY=typeof t.cY=="number"?t.cY:this.cY,this.x=t.x,this.y=t.y,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY}updateTransform(){const t=new ct;if(t.translate(this.x+this.cX,this.y+this.cY),t.rotate(this.degree),t.scale(this.scalarX,this.scalarY),t.translate(-this.cX,-this.cY),t.isIdentity)return{startPathX:this.startPathX,startPathY:this.startPathY,normalizedLines:this.normalizedLines};{let e=this.startPathX,s=this.startPathY;({x:e,y:s}=t.transformPoint({x:e,y:s}));const i=[];return this.normalizedLines.forEach(r=>{let a=r.x,o=r.y,h=r.c1x,c=r.c1y,l=r.c2x,d=r.c2y,w=r.toX,b=r.toY;({x:a,y:o}=t.transformPoint({x:a,y:o})),{x:h,y:c}=t.transformPoint({x:h,y:c}),{x:l,y:d}=t.transformPoint({x:l,y:d}),{x:w,y:b}=t.transformPoint({x:w,y:b}),i.push(new mt({x:a,y:o,c1x:h,c1y:c,c2x:l,c2y:d,toX:w,toY:b}))}),{startPathX:e,startPathY:s,normalizedLines:i}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,s)=>e+=s.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let s=0;const i=e.length;for(let r=0;r<i;r++){const a=e[r],o=a.length();if(s+o>=t)return a.getPointAtSegmentLength(t-s);s+=o}return e[i-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:s,normalizedLines:i}=this.updateTransform(),r=i.length;if(r===0)return{x:e,y:s};if(r===1)return i[0].interpolate(t);{let a=t*r,o=i[0];if(a--,a>1)for(let h=1;h<r&&(o=i[h],a>1);h++)a-=1;return o.interpolate(a)}}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const s=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(s,t):s}}getSubpathsAtLength(t,e,s){const{startPathX:i,startPathY:r,normalizedLines:a}=t.updateTransform();let o=null,h=0;const c=new wt;c.prevPathX=c.startPathX=i,c.prevPathY=c.startPathY=r;for(let l=0,d=a.length;l<d;l++){const w=a[l],b=w.length();if(h+b>e&&!o){const m=w.getPointAtSegmentLength(e-h);if(c.appendLine(new mt({c1x:m.start.x,c1y:m.start.y,c2x:m.m.x,c2y:m.m.y,toX:m.x,toY:m.y})),s)return c;o=c,c.appendLine(new mt({c1x:m.n.x,c1y:m.n.y,c2x:m.end.x,c2y:m.end.y,toX:w.x,toY:w.y})),h+=b;continue}h+=b,c.appendLine(w)}return c}closestPoint(t,e){const s=this.getTotalLength();let i={x:t,y:e},r=0,a=1/0,o=8;for(let c=0;c<=s;c+=o){let l=this.getPointAtLength(c),d=hs(l.x,l.y,t,e);d<a&&(i=l,r=c,a=d)}for(o/=2;o>.5;){let c=r-o,l=this.getPointAtLength(c),d=hs(l.x,l.y,t,e),w=r+o,b=this.getPointAtLength(w),m=hs(b.x,b.y,t,e);c>=0&&d<a?(i=l,r=c,a=d):w<=s&&m<a?(i=b,r=w,a=m):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:i,rotation:r>=s?Zt(h.x,h.y,i.x,i.y):Zt(i.x,i.y,h.x,h.y),distance:Math.sqrt(a)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform();return[t,e].concat(s.reduce((i,r)=>i.concat([r.c1x,r.c1y,r.c2x,r.c2y,r.toX,r.toY]),[]))}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let s=t[e-2],i=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=os(t[a],t[a+1],s,i),s=t[a],i=t[a+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,s=e.length;let i=t-s;const r=Math.ceil(t/s),a=[];a.push(["M",e[0],e[1]]);let o=2;for(;o+5<=s-1;){const h=e[o++],c=e[o++],l=e[o++],d=e[o++],w=e[o++],b=e[o++];a.push(["C",h,c,l,d,w,b]);let m=0;for(;m<r&&i>0;)a.push(["C",w,b,w,b,w,b]),i-=6,m++}return a}static mixPoints(t,e,s){const i=t.length,r=new Array(i);for(let a=0;a<i;a++)r[a]=Mt(t[a]+(e[a]-t[a])*s,6);return r}static getPathInterpolator(t,e){return s=>Math.abs(s-0)<Number.EPSILON?t:Math.abs(s-1)<Number.EPSILON?e:wt.fromPolymorphPoints(wt.mixPoints(new wt({d:t}).polymorphPoints,new wt({d:e}).polymorphPoints,s)).toSVGPathData()}}const Xo=wt;(function(){if(!window.requestAnimationFrame){let n=K();window.requestAnimationFrame=function(t){const e=K(),s=Math.max(0,16-(e-n)),i=window.setTimeout(function(){t(e+s)},s);return n=e+s,i}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})})();const ni=n=>{let t=!1;return window.requestAnimationFrame(function e(s){!t&&n(s)&&window.requestAnimationFrame(e)}),()=>{t=!0}};function ri(n,t=0){if(t==0)return n(K()),()=>{};{const e=K();return ni(s=>s-e>=t?(n(s),!1):!0)}}function Uo(n,t=0){let e=!1,s=0,i=K();const r=a=>{if(e)return;s++;const o=a-i-s*t;n(a,s,t-o<=0),ri(r,Math.max(0,t-o))};return ri(r,t),()=>{e=!0}}function Go(n,t=20){const e=1e3/t;let s=0,i;return()=>(K()-s>=e&&(s=K(),i=n()),i)}const Kt=new Ze;let ai=!1;function Un(n,t,e){n&&t&&Kt.set(n,t),!ai&&(ai=!0,requestIdleCallback(s=>{for(ai=!1;s.timeRemaining()>0&&Kt.length>0;){const i=Kt.shift();i&&i[1]()}Kt.length>0&&Un()},{timeout:e}))}let oi=!1;function hi(n,t,e){if(n&&t&&Kt.set(n,t),oi)return;oi=!0;const s=K();Vn(i=>{for(oi=!1;(i.timeRemaining()>0||e&&K()-s>=e)&&Kt.length>0;){const r=Kt.shift();r&&r[1]()}Kt.length>0&&hi()})}let fs=0,oe=33,Qt=33,ci;const Gn=new MessageChannel,Vo=Gn.port2;Gn.port1.onmessage=n=>{ci!==null&&ci({didTimeout:fs<=K(),timeRemaining:()=>Math.max(0,fs-K())})};function Vn(n){return ci=n,requestAnimationFrame(t=>{let e=t-fs+Qt;e<Qt&&oe<Qt?(e<8&&(e=8),Qt=e<oe?oe:e):e>Qt&&oe>Qt?Qt=e<oe?oe:e:oe=e,fs=t+Qt,Vo.postMessage(null)})}function zo(n){return cancelAnimationFrame(n)}function qo(n){if(typeof setImmediate<"u"&&rs(setImmediate))setImmediate(n);else if(typeof MessageChannel<"u"&&(rs(MessageChannel)||MessageChannel.toString()==="[object MessageChannelConstructor]")){const{port1:t,port2:e}=new MessageChannel;e.onmessage=n,t.postMessage(null)}else typeof Promise<"u"&&rs(Promise)?Promise.resolve().then(n):setTimeout(n,0)}function Ho(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(t=>setTimeout(()=>{throw t}))}class Ie{static _nextId=0;static nextId(){return Ie._nextId++}}const R={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-R.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?R.Bounce.In(n*2)*.5:R.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(s){return t*Math.random()+e*n(s)}},swing:function(n){return n+Math.sin(n*Math.PI*2)/2},causeSeizures:function(n){return n+.2*Math.random()-.1}};function zn(n){switch(n){case R.Quadratic.In:return R.Quadratic.Out;case R.Quadratic.Out:return R.Quadratic.In;case R.Quadratic.InOut:return R.Quadratic.InOut;case R.Cubic.In:return R.Cubic.Out;case R.Cubic.Out:return R.Cubic.In;case R.Cubic.InOut:return R.Cubic.InOut;case R.Quartic.In:return R.Quartic.Out;case R.Quartic.Out:return R.Quartic.In;case R.Quartic.InOut:return R.Quartic.InOut;case R.Quintic.In:return R.Quintic.Out;case R.Quintic.Out:return R.Quintic.In;case R.Quintic.InOut:return R.Quintic.InOut;case R.Sinusoidal.In:return R.Sinusoidal.Out;case R.Sinusoidal.Out:return R.Sinusoidal.In;case R.Sinusoidal.InOut:return R.Sinusoidal.InOut;case R.Exponential.In:return R.Exponential.Out;case R.Exponential.Out:return R.Exponential.In;case R.Exponential.InOut:return R.Exponential.InOut;case R.Circular.In:return R.Circular.Out;case R.Circular.Out:return R.Circular.In;case R.Circular.InOut:return R.Circular.InOut;case R.Elastic.In:return R.Elastic.Out;case R.Elastic.Out:return R.Elastic.In;case R.Elastic.InOut:return R.Elastic.InOut;case R.Back.In:return R.Back.Out;case R.Back.Out:return R.Back.In;case R.Back.InOut:return R.Back.InOut;case R.Bounce.In:return R.Bounce.Out;case R.Bounce.Out:return R.Bounce.In;case R.Bounce.InOut:return R.Bounce.InOut;default:return n}}const jo=4,$o=.001,Wo=1e-7,Jo=10,ke=11,ms=1/(ke-1),Zo=typeof Float32Array=="function";function qn(n,t){return 1-3*t+3*n}function Hn(n,t){return 3*t-6*n}function jn(n){return 3*n}function ps(n,t,e){return((qn(t,e)*n+Hn(t,e))*n+jn(t))*n}function $n(n,t,e){return 3*qn(t,e)*n*n+2*Hn(t,e)*n+jn(t)}function Ko(n,t,e,s,i){let r,a,o=0;do a=t+(e-t)/2,r=ps(a,s,i)-n,r>0?e=a:t=a;while(Math.abs(r)>Wo&&++o<Jo);return a}function Qo(n,t,e,s){for(let i=0;i<jo;++i){const r=$n(t,e,s);if(r===0)return t;const a=ps(t,e,s)-n;t-=a/r}return t}function th(n){return n}function li(n,t,e,s){if(!(0<=n&&n<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===t&&e===s)return th;const i=Zo?new Float32Array(ke):new Array(ke);for(let a=0;a<ke;++a)i[a]=ps(a*ms,n,e);function r(a){let o=0,h=1;const c=ke-1;for(;h!==c&&i[h]<=a;++h)o+=ms;--h;const l=(a-i[h])/(i[h+1]-i[h]),d=o+l*ms,w=$n(d,n,e);return w>=$o?Qo(a,d,n,e):w===0?d:Ko(a,o,o+ms,n,e)}return a=>a===0||a===1?a:ps(r(a),t,s)}function ui(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]}}function Wn(n){const[t,e,s,i]=ui(n);return[1-s,1-i,1-t,1-e]}function eh(n){return li(...ui(n))}function sh(n){return li(...Wn(n))}const Xt={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 s=t;s>1;s--)e*=s;return n[t]=e,e}}(),Bernstein:function(n,t){const e=Xt.Utils.Factorial;return e(n)/e(t)/e(n-t)},CatmullRom:function(n,t,e,s,i){const r=(e-n)*.5,a=(s-t)*.5,o=i*i,h=i*o;return(2*t-2*e+r+a)*h+(-3*t+3*e-2*r-a)*o+r*i+t},QuadraticBezier:(n,t,e,s)=>{const i=1-s;return i*i*n+2*i*s*t+s*s*e},CubicBezier:(n,t,e,s,i)=>{const r=1-i;return r*r*r*n+3*r*r*i*t+3*r*i*i*e+i*i*i*s}},Linear:function(n,t){const e=n.length-1,s=e*t,i=Math.floor(s),r=Xt.Utils.Linear;return t<0?r(n[0],n[1],s):t>1?r(n[e],n[e-1],e-s):r(n[i],n[i+1>e?e:i+1],s-i)},Bezier:function(n,t){let e=0;const s=n.length-1,i=Math.pow,r=Xt.Utils.Bernstein;for(let a=0;a<=s;a++)e+=i(1-t,s-a)*i(t,a)*n[a]*r(s,a);return e},CatmullRom:function(n,t){const e=n.length-1;let s=e*t,i=Math.floor(s);const r=Xt.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(i=Math.floor(s=e*(1+t))),r(n[(i-1+e)%e],n[i],n[(i+1)%e],n[(i+2)%e],s-i)):t<0?n[0]-(r(n[0],n[0],n[1],n[1],-s)-n[0]):t>1?n[e]-(r(n[e],n[e],n[e-1],n[e-1],s-e)-n[e]):r(n[i?i-1:0],n[i],n[e<i+1?e:i+1],n[e<i+2?e:i+2],s-i)}};class Jn{_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=K(),e=!1){const s=Object.keys(this._tweens);for(let i=0;i<s.length;i++){const r=this._tweens[s[i]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[s[i]]}return!!Object.keys(this._tweens).length}}const bt=new Jn;class di{constructor(t,e=bt){this._object=t,this._group=e}_id=Ie.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=R.Linear.None;_interpolationFunction=Xt.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=K()){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,s,i){for(const r in s){const a=t[r],o=Array.isArray(a),h=o?"array":typeof a,c=!o&&Array.isArray(s[r]);if(!(h==="undefined"||h==="function")){if(c){let l=s[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,a)),s[r]=[a].concat(l)}if((h==="object"||o)&&a&&!c){e[r]=o?[]:{};for(const l in a)e[r][l]=a[l];i[r]=o?[]:{},this._setupProperties(a,e[r],s[r],i[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),c?i[r]=s[r].slice().reverse():i[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=K()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=K()){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=bt){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=R.Linear.None){return this._easingFunction=t,this}interpolation(t=Xt.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=K(),e=!0){if(this._isPaused)return!0;let s,i;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),i=(t-this._startTime)/this._durationTime,i=this._durationTime===0||i>1?1:i;const a=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),i===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];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,s,i){for(const r in s){if(e[r]===void 0)continue;const a=e[r]||0;let o=s[r];const h=Array.isArray(t[r]),c=Array.isArray(o);!h&&c?t[r]=this._interpolationFunction(o,i):typeof o=="object"&&o?this._updateProperties(t[r],a,o,i):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*i))}}_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],s=this._valuesEnd[t];typeof s=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(s):this._valuesStartRepeat[t]=s,this._valuesEnd[t]=e}}const ih=Ie.nextId,nh=bt.getAll.bind(bt),rh=bt.removeAll.bind(bt),ah=bt.add.bind(bt),oh=bt.remove.bind(bt),hh=bt.update.bind(bt),ch={now:K,Sequence:Ie,Easing:R,Interpolation:Xt,Group:Jn,Tween:di,nextId:ih,getAll:nh,removeAll:rh,add:ah,remove:oh,update:hh};class fi{autoStart;startTime;oldTime;elapsedTime;running;constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=K(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=K();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class gs{tweens=[];frameDuration;onGroupStart;onGroupComplete;constructor(t){this.frameDuration=t?.frameDuration||1e3,this.onGroupStart=t?.onGroupStart,this.onGroupComplete=t?.onGroupComplete}get count(){return this.tweens.length}clear(){this.tweens=[]}sort(t=!1){Wa(this.tweens,(e,s)=>t?e.delay>s.delay:e.delay<=s.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(s=>{const i={...s};delete i.tween,i.fromValues={...i.fromValues},i.toValues={...i.toValues},e.push(i)}),e}addTween(t,e,s){const i={fromValues:t,toValues:e,frames:typeof s?.frames=="number"?s.frames:1,delay:typeof s?.delay=="number"?s.delay:this.tweens.length,easeFunction:s?.easeFunction||R.Linear.None,interpolationFunction:s?.interpolationFunction||Xt.Linear,repeat:typeof s?.repeat=="number"?s.repeat:0,yoyo:s?.yoyo||!1,onStart:s?.onStart||(()=>{}),onUpdate:s?.onUpdate||(()=>{}),onComplete:s?.onComplete||(()=>{})};return this.tweens.push(i),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new fi,s=this.frameDuration;return new Promise(i=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=ni(r=>{if(!this.isPaused){const o=Math.max(0,r-this.pausedDuration),h=Math.max(0,e.getElapsedTime()-this.pausedDuration);t.filter(c=>c.delay*s<=h).forEach(c=>{c.tween||(c.tween=new di({...c.fromValues}).to({...c.toValues},c.frames*s).easing(c.easeFunction).interpolation(c.interpolationFunction).repeat(c.repeat).yoyo(c.yoyo).onStart(c.onStart).onUpdate(c.onUpdate).onComplete(c.onComplete),c.tween.start(o)),(c.delay+c.frames*(c.repeat+1))*s>h?c.tween.update(o):(c.tween.isPlaying()&&c.tween.end(),Ce(t,c))})}const a=!!t.length;return a||(this.onGroupComplete?.(),i()),a})})}isPaused=!1;pausedClock=new fi;pausedDuration=0;play(t=this.cloneTweens(this.tweens)){this.isPaused=!1,this.pausedDuration=0,this.runTweens(t)}reverse(){const t=this.cloneTweens(this.tweens);let e=0;t.forEach(s=>{e=Math.max(e,s.delay+s.frames),s.easeFunction=zn(s.easeFunction);const i={...s.toValues};s.toValues={...s.fromValues},s.fromValues={...i}}),t.forEach(s=>{s.delay=e-s.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}class z extends $s{id;originD;originMatrix;independentTransformInGroup;forceCXY=!1;cX;cY;x;y;degree;scalarX;scalarY;diffXInGroup;diffYInGroup;diffDegreeInGroup;diffScalarXInGroup;diffScalarYInGroup;vx;vy;ax;ay;mass;attrs;enableDrag;alongPath;isDragging=!1;isMouseIn=!1;targetToAfterDragFree;followMouse;strokeArmyAnts;strokeArmyAntsOffset=0;strokeDashTotalLength=0;isShow=!0;el;pathd;usePathDtoCanvasContext=!1;parent;shapes=[];constructor(t){if(super(),this.id=zs(),t?.d&&(this.originD=t?.d),t?.originMatrix&&(this.originMatrix=t.originMatrix),this.independentTransformInGroup=typeof t?.independentTransformInGroup=="boolean"?t.independentTransformInGroup:!1,this.x=t?.x||0,this.y=t?.y||0,this.cX=0,this.cY=0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&this.forceSetCXY(t.centerX-this.x,t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.diffXInGroup=t?.diffXInGroup||0,this.diffYInGroup=t?.diffYInGroup||0,this.diffDegreeInGroup=t?.diffDegreeInGroup||0,this.diffScalarXInGroup=t?.diffScalarXInGroup||1,this.diffScalarYInGroup=t?.diffScalarYInGroup||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||1,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this.enableDrag=t?.enableDrag||!1,this.alongPath=t?.alongPath,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.strokeArmyAnts=t?.strokeArmyAnts||!1,this.strokeArmyAnts){const s=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",s),this.strokeDashTotalLength=mn(s).reduce((i,r)=>i+r,0)}return Fa(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new wt,Hs(()=>{this.pathd?.reset(this.originD||this.toSVGPathData(),this.originMatrix)}),this.pathd&&!this.forceCXY){const t=this.shapes.length==0?this.pathd.getBoundingClientRect():this.getBoundingClientRect();t&&(this.pathd.cX=this.cX=t.x+t.width/2-this.pathd.x,this.pathd.cY=this.cY=t.y+t.height/2-this.pathd.y)}this.shapeInit()}return this.pathd}frameStart(t){}frameUpdate(t,e){this.pathd=this.initPathD(),this.pathd.update(this),this.strokeArmyAnts&&(this.isMouseIn||(this.setAttr("stroke-dashoffset",String(this.strokeArmyAntsOffset++)),this.strokeArmyAntsOffset>this.strokeDashTotalLength&&(this.strokeArmyAntsOffset=0)))}frameEnd(t){}toSVGPathData(){return[]}toSVGPathD(){return this.pathd?.toSVGPathD()||""}toCanvasContext(t){this.usePathDtoCanvasContext=!0,this.pathd?.toCanvasContext(t)}getBoundingClientRect(){return this.pathd?.getBoundingClientRect()||null}get center(){const t=this.getBoundingClientRect(),e={x:this.x,y:this.y};return t&&(e.x=t.x+t.width/2,e.y=t.y+t.height/2),e}trim(){if(this.parent)return;const t=this.getBoundingClientRect();if(!t)return;this.shapes.forEach(s=>{const i=s.originMatrix?s.originMatrix.clone():new ct;i.translate(-t.x+s.x,-t.y+s.y),s.originMatrix=i});const e=this.originMatrix?this.originMatrix.clone():new ct;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,s){if(s instanceof us)return s.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=s.createSVGPoint(),i.x=t,i.y=e}if(this.el instanceof SVGGeometryElement)return this.el.isPointInFill(i);{const r=this.getBoundingClientRect();if(r)return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height}return!1}isPointInStroke(t,e,s){if(s instanceof us)return s.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=s.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(i):!1}clone(){return Na(this).copy(this)}copy(t){return this.id=t.id,this.originD=t.originD,this.originMatrix=t.originMatrix,this.independentTransformInGroup=t.independentTransformInGroup,this.x=t.x,this.y=t.y,this.cX=t.cX,this.cY=t.cY,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY,this.diffXInGroup=t.diffXInGroup,this.diffYInGroup=t.diffYInGroup,this.diffDegreeInGroup=t.diffDegreeInGroup,this.diffScalarXInGroup=t.diffScalarXInGroup,this.diffScalarYInGroup=t.diffScalarYInGroup,this.vx=t.vx,this.vy=t.vy,this.ax=t.ax,this.ay=t.ay,this.mass=t.mass,this.attrs={...t.attrs},this.enableDrag=t.enableDrag,this.alongPath=t.alongPath,this.targetToAfterDragFree=t.targetToAfterDragFree,this.followMouse=t.followMouse,this.isShow=t.isShow,this.strokeArmyAnts=t.strokeArmyAnts,this.strokeDashTotalLength=t.strokeDashTotalLength,this}save(){}restore(){}setAttr(t,e){typeof t!="string"?Object.assign(this.attrs,Object.fromEntries(Object.entries(t).map(([s,i])=>[ft(s),i]))):e&&(this.attrs[ft(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[ft(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[ft(t)]}distance(t){return os(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=nt(Zt(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:i}=It(N(this.degree),e);this.vx=s,this.vy=i,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:i}=It(N(this.degree),e);this.ax=s,this.ay=i,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,s=t.y-this.y,i=e*e+s*s,r=Math.sqrt(i),a=this.mass*t.mass/i,o=a*e/r,h=a*s/r;this.vx+=o/this.mass,this.vy+=h/this.mass,t.vx-=o/t.mass,t.vy-=h/t.mass}run(t){this.vx+=this.ax,this.vy+=this.ay;const e=Wt(t?.gravity,0);this.vy+=e;const s=Wt(t?.friction,1);this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const s=Wt(e?.easing,.05),i=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=i*s,this.vy=r*s,this.run(e)}runSpringTo(t,e){const s=Wt(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.cX-this.x,a=i.y-this.cY-this.y,o=r*s,h=a*s;this.vx+=o,this.vy+=h}),this.run({friction:.9,...e})}springMassTo(t,e){const s=Wt(e?.springLength,100),i=Wt(e?.spring,1e-4),r=t.x-this.x,a=t.y-this.y,o=Math.sqrt(r*r+a*a);if(o<s){const h=r*i,c=a*i;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-o/s}return 0}getTotalLength(){return this.initPathD().getTotalLength()}interpolate(t){return this.initPathD().interpolate(t)}getPointAtLength(t){return this.initPathD().getPointAtLength(t)}trailPath(t,e=0){const s=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*s),this.getPointAtLength(e*s)}strokeDashTween(t=1e3,e){const s=this.initPathD(),i=Mt(s.getTotalLength(),0);this.setAttr({strokeDasharray:`${i} ${i}`,strokeDashoffset:`${i}`});const r=e?.onUpdate,a=new gs({frameDuration:t});a.addTween({offset:i},{offset:0},Object.assign(e||{},{onUpdate:(o,h)=>{this.setAttr("strokeDashoffset",""+Mt(o.offset,2)),r?.(o,h)}})),a.play()}}class Le extends z{x;y;z;fl;vpX;vpY;cX;cY;cZ;radius;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.fl=t?.fl||250,this.vpX=t?.vpX||0,this.vpY=t?.vpY||0,this.cX=t?.cX||0,this.cY=t?.cY||0,this.cZ=t?.cZ||0,this.radius=t?.radius||0}toSVGPathData(){return this.radius?[["M",this.getScreenX(),this.getScreenY()-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:[["M",this.getScreenX(),this.getScreenY()]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,s){this.cX=t,this.cY=e,this.cZ=s}rotateX(t){({x:this.y,y:this.z}=_t(N(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=_t(N(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=_t(N(t),this.x,this.y))}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}eq(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.radius===t.radius&&this.mass===t.mass}length(){return as(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,s=t.y-this.y,i=t.z-this.z;return Math.sqrt(e*e+s*s+i*i)}scalar(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y,i=this.z;return{x:s*t.z-i*t.y,y:i*t.x-e*t.z,z:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y,z:this.z*t.z}}div(t){return{x:this.x/t.x,y:this.y/t.y,z:this.z/t.z}}add(t){return{x:this.x+t.x,y:this.y+t.y,z:this.z+t.z}}sub(t){return{x:this.x-t.x,y:this.y-t.y,z:this.z-t.z}}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y,z:this.z-2*e*t.z}}}const Zn=[1,0,0,1,0,0],Kn=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class ct{value;_m13=0;_m23=0;_m33=1;matrix3d;constructor(t=Zn){this.value=Array.from(t),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D()}static fromString(t){const e=new ct,s=nn("number",t);return s.length===6&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this._m13}get m21(){return this.value[2]}get m22(){return this.value[3]}get m23(){return this._m23}get m31(){return this.value[4]}get m32(){return this.value[5]}get m33(){return this._m33}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this._m13=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set m23(t){this._m23=t}set m31(t){this.value[4]=t}set m32(t){this.value[5]=t}set m33(t){this._m33=t}toMatrix3D(t=this.matrix3d){const e=[this.m11,this.m12,0,this.m13,this.m21,this.m22,0,this.m23,0,0,1,0,this.m31,this.m32,0,this.m33];return t?(t.value=e,t):new pt(e)}identity(){return this.value=Array.from(Zn),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D(),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}normalize(){const t=this.m33||1e-4;return this.scalar(1/t)}transformPoint(t){const e=t.z||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31,y:t.x*this.m12+t.y*this.m22+e*this.m32,z:t.x*this.m13+t.y*this.m23+e*this.m33}}clone(){return new ct([...this.value])}multiply(t){const e=this.clone(),s=t instanceof ct?t:new ct(t);return this.m11=s.m11*e.m11+s.m12*e.m21+s.m13*e.m31,this.m12=s.m11*e.m12+s.m12*e.m22+s.m13*e.m32,this.m13=s.m11*e.m13+s.m12*e.m23+s.m13*e.m33,this.m21=s.m21*e.m11+s.m22*e.m21+s.m23*e.m31,this.m22=s.m21*e.m12+s.m22*e.m22+s.m23*e.m32,this.m23=s.m21*e.m13+s.m22*e.m23+s.m23*e.m33,this.m31=s.m31*e.m11+s.m32*e.m21+s.m33*e.m31,this.m32=s.m31*e.m12+s.m32*e.m22+s.m33*e.m32,this.m33=s.m31*e.m13+s.m32*e.m23+s.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}inverse(){const t=this.m11,e=this.m12,s=this.m13,i=this.m21,r=this.m22,a=this.m23,o=this.m31,h=this.m32,c=this.m33,l=c*r-a*h,d=-c*i+a*o,w=h*i-r*o;let b=t*l+e*d+s*w;return b?(b=1/b,this.m11=l*b,this.m12=(-c*e+s*h)*b,this.m13=(a*e-s*r)*b,this.m21=d*b,this.m22=(c*t-s*o)*b,this.m23=(-a*t+s*i)*b,this.m31=w*b,this.m32=(-h*t+e*o)*b,this.m33=(r*t-e*i)*b,this):null}adjugate(){const t=new ct;return t.m11=this.m22*this.m33-this.m32*this.m23,t.m12=this.m32*this.m13-this.m12*this.m33,t.m13=this.m12*this.m23-this.m22*this.m13,t.m21=this.m31*this.m23-this.m21*this.m33,t.m22=this.m11*this.m33-this.m31*this.m13,t.m23=this.m21*this.m13-this.m11*this.m23,t.m31=this.m21*this.m32-this.m31*this.m22,t.m32=this.m31*this.m12-this.m11*this.m32,t.m33=this.m11*this.m22-this.m21*this.m12,t}split(){let t=nt(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(t+=180),{x:this.m31,y:this.m32,degree:t,scaleX:Math.sqrt(this.m11*this.m11+this.m12*this.m12),scaleY:Math.sqrt(this.m21*this.m21+this.m22*this.m22),skewX:nt(Math.atan2(-this.m21,this.m22)),skewY:nt(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],s=this.value[1],i=this.value[2],r=this.value[3],a=this.value[4],o=this.value[5],h=t.value[0],c=t.value[1],l=t.value[2],d=t.value[3],w=t.value[4],b=t.value[5],m=h*d,P=c*l,_=(l*s-e*d)/(P-m),v=(h*s-e*c)/(m-P),x=(l*r-i*d)/(P-m),y=(h*r-i*c)/(m-P),p=(l*(o-b)+d*(w-a))/(P-m),E=(h*(o-b)+c*(w-a))/(m-P),C=[_,v,x,y,p,E];return new ct(C)}toString(t=6){return this.matrix3d.is2D()?`matrix(${this.value.map(e=>Mt(e,t)).join(",")})`:this.matrix3d.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix3D(),this}translateTo(t,e){return this.translate(t-this.m31,e-this.m32)}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.m32)}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.m31,t)}translateZ(t){return this.matrix3d.translate(0,0,t),this.matrix3d.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix3d.m43),this}translate3d(t,e,s){return this.matrix3d.translate(t,e,s),this.matrix3d.toMatrix(this),this}translate3dTo(t,e,s){return this.translate3d(t-this.matrix3d.m41,e-this.matrix3d.m42,s-this.matrix3d.m43),this}rotate(t,e=0,s=0){const i=N(t),r=Math.cos(i),a=Math.sin(i);return this.translate(e,s),this.multiply([r,a,-a,r,0,0]),this.translate(-e,-s),this.toMatrix3D(),this}rotateTo(t,e=0,s=0){const{degree:i}=this.split();return this.rotate(t-i,e,s),this}rotateX(t){return this.matrix3d.rotateX(t),this.matrix3d.toMatrix(this),this}rotateXTo(t){const{degreeX:e}=this.matrix3d.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix3d.rotateY(t),this.matrix3d.toMatrix(this),this}rotateYTo(t){const{degreeY:e}=this.matrix3d.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix3d.rotateZ(t),this.matrix3d.toMatrix(this),this}rotateZTo(t){const{degreeZ:e}=this.matrix3d.split();return this.rotateZ(t-e),this}rotate3d(t,e,s){return this.matrix3d.rotateX(t).rotateY(e).rotateZ(s),this.matrix3d.toMatrix(this),this}rotate3dTo(t,e,s){const{degreeX:i,degreeY:r,degreeZ:a}=this.matrix3d.split();return this.rotate3d(t-i,e-r,s-a),this}scale(t,e=t,s=0,i=0){return this.translate(s,i),this.multiply([t,0,0,e,0,0]),this.translate(-s,-i),this.toMatrix3D(),this}scaleTo(t,e=t,s=0,i=0){return this.scale(t/this.m11,e/this.m22,s,i)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.matrix3d.scale(1,1,t),this.matrix3d.toMatrix(this),this}scaleZTo(t){const{scalarZ:e}=this.matrix3d.split();return this.scaleZ(t/e),this}scale3d(t,e=t,s=t){return this.matrix3d.scale(t,e,s),this.matrix3d.toMatrix(this),this}scale3dTo(t,e=t,s=t){const{scalarX:i,scalarY:r,scalarZ:a}=this.matrix3d.split();return this.scale3d(t/i,e/r,s/a),this}skew(t,e=t){return this.multiply([Math.cos(N(e)),Math.sin(N(e)),-Math.sin(N(t)),Math.cos(N(t)),0,0]),this.toMatrix3D(),this}skewTo(t,e=t){const{skewX:s,skewY:i}=this.split();return this.skew(t-s,e-i)}skewX(t){const{skewY:e}=this.split();return this.skew(t,e)}skewXTo(t){const{skewY:e}=this.split();return this.skewTo(t,e)}skewY(t){const{skewX:e}=this.split();return this.skew(e,t)}skewYTo(t){const{skewX:e}=this.split();return this.skewTo(e,t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,s){return this}skew3dTo(t,e,s){return this}perspective(t){return this.matrix3d.perspective(t),this.matrix3d.toMatrix(this),this}}class pt{value;is3dSpecial=!1;constructor(t=Kn){this.value=Array.from(t)}static fromString(t){const e=new pt,s=nn("number",t);return s.length===16&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m14(){return this.value[3]}get m21(){return this.value[4]}get m22(){return this.value[5]}get m23(){return this.value[6]}get m24(){return this.value[7]}get m31(){return this.value[8]}get m32(){return this.value[9]}get m33(){return this.value[10]}get m34(){return this.value[11]}get m41(){return this.value[12]}get m42(){return this.value[13]}get m43(){return this.value[14]}get m44(){return this.value[15]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m14(t){this.value[3]=t}set m21(t){this.value[4]=t}set m22(t){this.value[5]=t}set m23(t){this.value[6]=t}set m24(t){this.value[7]=t}set m31(t){this.value[8]=t}set m32(t){this.value[9]=t}set m33(t){this.value[10]=t}set m34(t){this.value[11]=t}set m41(t){this.value[12]=t}set m42(t){this.value[13]=t}set m43(t){this.value[14]=t}set m44(t){this.value[15]=t}is2D(){return!this.is3dSpecial&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m43==0&&this.m44==1}is3D(){return!this.is2D()}identity(){return this.value=Array.from(Kn),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m14==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m24==0&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m41==0&&this.m42==0&&this.m43==0&&this.m44==1}clone(){return new pt([...this.value])}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m14*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m24*=t,this.m31*=t,this.m32*=t,this.m33*=t,this.m34*=t,this.m41*=t,this.m42*=t,this.m43*=t,this.m44*=t,this}normalize(){return this.scalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,s=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+s*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+s*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+s*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+s*this.m44}}toMatrix(t){const{scalarX:e,scalarY:s,skewX:i,skewY:r,x:a,y:o}=this.split(),h=[e,r,i,s,a,o];return t?(t.value=h,t):new ct(h)}flatten(){return this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m14=0,this.m24=0,this.m43=0,this.m44=1,this}toString(t=6){return`matrix3d(${this.value.map(e=>Mt(e,t)).join(",")})`}split(){const t=Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),e=Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),s=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),i=nt(H(Math.asin(-this.m13),-1,1));let r=nt(Math.atan2(this.m23,this.m33));Math.cos(N(i))===0&&(r=nt(Math.atan2(-this.m31,this.m22)));let a=nt(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(a+=180),{x:this.m41,y:this.m42,z:this.m43,scalarX:t,scalarY:e,scalarZ:s,degreeX:r,degreeY:i,degreeZ:a,skewX:nt(this.m14),skewY:nt(this.m24),skewZ:nt(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}inverse(){const t=[],e=this.m11,s=this.m12,i=this.m13,r=this.m14,a=this.m21,o=this.m22,h=this.m23,c=this.m24,l=this.m31,d=this.m32,w=this.m33,b=this.m34,m=this.m41,P=this.m42,_=this.m43,v=this.m44;t[0]=h*b*P-c*w*P+c*d*_-o*b*_-h*d*v+o*w*v,t[1]=r*w*P-i*b*P-r*d*_+s*b*_+i*d*v-s*w*v,t[2]=i*c*P-r*h*P+r*o*_-s*c*_-i*o*v+s*h*v,t[3]=r*h*d-i*c*d-r*o*w+s*c*w+i*o*b-s*h*b;const x=e*t[0]+a*t[1]+l*t[2]+m*t[3];if(x==0)return console.warn("Can't invert matrix, determinant is 0");t[4]=c*w*m-h*b*m-c*l*_+a*b*_+h*l*v-a*w*v,t[5]=i*b*m-r*w*m+r*l*_-e*b*_-i*l*v+e*w*v,t[6]=r*h*m-i*c*m-r*a*_+e*c*_+i*a*v-e*h*v,t[7]=i*c*l-r*h*l+r*a*w-e*c*w-i*a*b+e*h*b,t[8]=o*b*m-c*d*m+c*l*P-a*b*P-o*l*v+a*d*v,t[9]=r*d*m-s*b*m-r*l*P+e*b*P+s*l*v-e*d*v,t[10]=s*c*m-r*o*m+r*a*P-e*c*P-s*a*v+e*o*v,t[11]=r*o*l-s*c*l-r*a*d+e*c*d+s*a*b-e*o*b,t[12]=h*d*m-o*w*m-h*l*P+a*w*P+o*l*_-a*d*_,t[13]=s*w*m-i*d*m+i*l*P-e*w*P-s*l*_+e*d*_,t[14]=i*o*m-s*h*m-i*a*P+e*h*P+s*a*_-e*o*_,t[15]=s*h*l-i*o*l+i*a*d-e*h*d-s*a*w+e*o*w,this.value=t,this.scalar(1/x)}multiply(t){const e=this.clone();return this.m11=t.m11*e.m11+t.m12*e.m21+t.m13*e.m31+t.m14*e.m41,this.m12=t.m11*e.m12+t.m12*e.m22+t.m13*e.m32+t.m14*e.m42,this.m13=t.m11*e.m13+t.m12*e.m23+t.m13*e.m33+t.m14*e.m43,this.m14=t.m11*e.m14+t.m12*e.m24+t.m13*e.m34+t.m14*e.m44,this.m21=t.m21*e.m11+t.m22*e.m21+t.m23*e.m31+t.m24*e.m41,this.m22=t.m21*e.m12+t.m22*e.m22+t.m23*e.m32+t.m24*e.m42,this.m23=t.m21*e.m13+t.m22*e.m23+t.m23*e.m33+t.m24*e.m43,this.m24=t.m21*e.m14+t.m22*e.m24+t.m23*e.m34+t.m24*e.m44,this.m31=t.m31*e.m11+t.m32*e.m21+t.m33*e.m31+t.m34*e.m41,this.m32=t.m31*e.m12+t.m32*e.m22+t.m33*e.m32+t.m34*e.m42,this.m33=t.m31*e.m13+t.m32*e.m23+t.m33*e.m33+t.m34*e.m43,this.m34=t.m31*e.m14+t.m32*e.m24+t.m33*e.m34+t.m34*e.m44,this.m41=t.m41*e.m11+t.m42*e.m21+t.m43*e.m31+t.m44*e.m41,this.m42=t.m41*e.m12+t.m42*e.m22+t.m43*e.m32+t.m44*e.m42,this.m43=t.m41*e.m13+t.m42*e.m23+t.m43*e.m33+t.m44*e.m43,this.m44=t.m41*e.m14+t.m42*e.m24+t.m43*e.m34+t.m44*e.m44,this}translate(t=0,e=0,s=0){return this.multiply(new pt([1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1]))}scale(t=1,e=1,s=1){return this.multiply(new pt([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}rotateX(t){const e=N(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new pt([1,0,0,0,0,s,i,0,0,-i,s,0,0,0,0,1]))}rotateY(t){const e=N(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new pt([s,0,-i,0,0,1,0,0,i,0,s,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=N(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new pt([s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,s=0){return this.multiply(new pt([1,0,0,N(t),0,1,0,N(e),0,0,1,N(s),0,0,0,1]))}perspective(t){return this.multiply(new pt([1,0,0,0,0,1,0,0,0,0,1,t?-(1/t):0,0,0,0,1]))}unproject(t){let e=t.x*this.m11+t.y*this.m21+this.m41,s=t.x*this.m12+t.y*this.m22+this.m42,i=t.x*this.m13+t.y*this.m23+this.m43,r=t.x*this.m14+t.y*this.m24+this.m44,a=e+this.m31,o=s+this.m32,h=i+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,s/=r,i/=r,c==0&&(c=1e-4),a/=c,o/=c,h/=c;const l=h-i;if(l==0)return{x:e,y:s,z:i,mass:r};const d=-i/l;return e+=d*(a-e),s+=d*(o-s),{x:e,y:s,z:i,mass:r}}project(t){const e=t.z;let s=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,i=t.x*this.m12+t.y*this.m22+e*this.m32+this.m42,r=t.x*this.m14+t.y*this.m24+e*this.m34+this.m44;return r==0&&(r=1e-4),s/=r,i/=r,r<0&&(s-=this.m41,i-=this.m42,s*=1/r,i*=1/r,s+=this.m41,i+=this.m42),{x:s,y:i,z:e,mass:r}}bounds(t,e,s,i){const r=new Le({x:t,y:e}),a=new Le({x:t+s,y:e}),o=new Le({x:t+s,y:e+i}),h=new Le({x:t,y:e+i});({x:r.x,y:r.y,z:r.z,mass:r.mass}=this.project(r)),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:h.x,y:h.y,z:h.z,mass:h.mass}=this.project(h);const c=Math.min(r.x,a.x,o.x,h.x),l=Math.min(r.y,a.y,o.y,h.y),d=Math.max(r.x,a.x,o.x,h.x)-c,w=Math.max(r.y,a.y,o.y,h.y)-l;return{x:c,y:l,width:d,height:w}}}function mi(n){const t=new ct;return n.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,s,i){i.indexOf(",")>=0?i=i.split(/\s*,\s*/):i=i.split(/\s+/);const r=[];for(let a=0,o=i.length;a<o;a++)i[a].trim()&&r.push(parseFloat(""+i[a]));switch(s.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]]),t.toMatrix3D();break;case"matrix3d":t.matrix3d.multiply(new pt(r)),t.matrix3d.toMatrix(t);break}return""}),t}function _t(n,t,e){const s=new ct;return s.rotate(nt(n)),s.transformPoint({x:t,y:e})}function pi(n){const t=typeof n?.x=="number"?n?.x:0,e=typeof n?.y=="number"?n?.y:0,s=typeof n?.degree=="number"?n?.degree:0,i=typeof n?.scalarX=="number"?n?.scalarX:1,r=typeof n?.scalarY=="number"?n?.scalarY:1,a=N(s),o=Math.cos(a),h=Math.sin(a),c=new DOMMatrix([o*i,h*i,-h*r,o*r,t,e]);return c.multiplySelf(new DOMMatrix(n?.originMatrix||"")),c}function lh(n,t){const e=new Path2D(n),s=new Path2D;return s.addPath(e,pi(t)),s}function Qn(n,t){const e={x:t.m11,y:t.m12,z:t.m13},s={x:t.m21,y:t.m22,z:t.m23},i={x:t.m31,y:t.m32,z:t.m33},r=n.transformPoint(e),a=n.transformPoint(s),o=n.transformPoint(i),h=new ct;return h.m11=r.x,h.m12=r.y,h.m13=r.z,h.m21=a.x,h.m22=a.y,h.m23=a.z,h.m31=o.x,h.m32=o.y,h.m33=o.z,h}function tr(n,t){const e={x:t.m11,y:t.m12,z:t.m13,w:t.m14},s={x:t.m21,y:t.m22,z:t.m23,w:t.m24},i={x:t.m31,y:t.m32,z:t.m33,w:t.m34},r={x:t.m41,y:t.m42,z:t.m43,w:t.m44},a=n.transformPoint(e),o=n.transformPoint(s),h=n.transformPoint(i),c=n.transformPoint(r);return new pt([a.x,a.y,a.z,a.w,o.x,o.y,o.z,o.w,h.x,h.y,h.z,h.w,c.x,c.y,c.z,c.w])}function uh(n){let t=n[0];for(let e=1,s=n.length;e<s;e++)t=Qn(t,n[e]);return t}function dh(n){let t=n[0];for(let e=1,s=n.length;e<s;e++)t=tr(t,n[e]);return t}class L{static createElementNS(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}static isActive(t){return t===document.activeElement&&(t.type||t.href)}static isTouchEnabled(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}static origins=new Ze;static updates=new Ze;static patchDom=()=>{this.origins.filter((t,e)=>{const s=this.updates.get(t);return s&&is(e,s),this.updates.delete(t),!1})};static getVNode(t,e){let s=t.getAttribute("id")||"";s||(s=e||zs(),t.setAttribute("id",s)),this.origins.get(s)||this.origins.set(s,Jt(t.tagName,{},[],t));const i=this.updates.get(s)||Jt(t.tagName,{},[],t);return{vnode:i,immediate:()=>{this.updates.set(s,i),L.patchDom()},schedule:()=>{this.updates.set(s,i),hi("FLUSH_DOM_ACTIONS",L.patchDom,50)}}}static getElement(t){const e=t.style?t.ownerDocument:t.document||t;return{el:t,document:e,window:e.defaultView,isRootNode:/(html|body)/i.test(t.tagName)||t===document}}static getCSSVar(t){return getComputedStyle(document.documentElement).getPropertyValue(t)}static setCSSVar(t,e){document.documentElement.style.setProperty(t,e)}static add3DSupport(t,e="1000px"){if(t.parentElement){const s=L.getStyle(t.parentElement,"position");L.setStyle(t.parentElement,{position:s=="static"?"relative":s,perspective:e})}L.setStyle(t,{"transform-style":"preserve-3d"})}static convertAttrs(t,e,s={}){Object.prototype.hasOwnProperty.call(s,"transform")||Object.assign(s,{transform:L.getStyle(t,"transform")||""});const i=mi(s.transform),r={};for(const a in e){const o=e[a];switch(a){case"transform":break;case"translate":i.translate(o[0]||0,o[1]||0);break;case"translateTo":i.translateTo(o[0]||0,o[1]||0);break;case"translateX":i.translateX(o||0);break;case"translateXTo":i.translateXTo(o||0);break;case"translateY":i.translateY(o||0);break;case"translateYTo":i.translateYTo(o||0);break;case"translateZ":i.translateZ(o||0);break;case"translateZTo":i.translateZTo(o||0);break;case"translate3d":i.translate3d(o[0]||0,o[1]||0,o[2]||0);break;case"translate3dTo":i.translate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotate":typeof o=="number"?i.rotate(o||0):i.rotate(o[0]||0,o[1]||0,o[2]||0);break;case"rotateTo":typeof o=="number"?i.rotateTo(o||0):i.rotateTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotateX":i.rotateX(o||0);break;case"rotateXTo":i.rotateXTo(o||0);break;case"rotateY":i.rotateY(o||0);break;case"rotateYTo":i.rotateYTo(o||0);break;case"rotateZ":i.rotateZ(o||0);break;case"rotateZTo":i.rotateZTo(o||0);break;case"rotate3d":i.rotate3d(o[0]||0,o[1]||0,o[2]||0);break;case"rotate3dTo":i.rotate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"scale":typeof o=="number"?i.scale(o||1):i.scale(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleTo":typeof o=="number"?i.scaleTo(o||1):i.scaleTo(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleX":i.scaleX(o||1);break;case"scaleXTo":i.scaleXTo(o||1);break;case"scaleY":i.scaleY(o||1);break;case"scaleYTo":i.scaleYTo(o||1);break;case"scaleZ":i.scaleZ(o||1);break;case"scaleZTo":i.scaleZTo(o||1);break;case"scale3d":typeof o=="number"?i.scale3d(o||1):i.scale3d(o[0]||1,o[1]||1,o[2]||1);break;case"scale3dTo":typeof o=="number"?i.scale3dTo(o||1):i.scale3dTo(o[0]||1,o[1]||1,o[2]||1);break;case"skew":typeof o=="number"?i.skew(o||0):i.skew(o[0]||0,o[1]||0);break;case"skewTo":typeof o=="number"?i.skewTo(o||0):i.skewTo(o[0]||0,o[1]||0);break;case"skewX":i.skewX(o||0);break;case"skewXTo":i.skewXTo(o||0);break;case"skewY":i.skewY(o||0);break;case"skewYTo":i.skewYTo(o||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":i.perspective(o||0);break;default:Object.prototype.hasOwnProperty.call(s,a)||(s[a]=L.getStyle(t,a)),Object.assign(r,{[a]:`${o}`});break}}return Object.assign(r,{transform:i.toString()}),r}static attrsToCanvas(t,e){for(const s in e){const i=e[s];switch(s){case"fill":i!=="none"&&(t.fillStyle=i);break;case"stroke":i!=="none"&&(t.strokeStyle=i);break;case"stroke-width":case"strokeWidth":t.lineWidth=Number(i);break;case"stroke-linecap":case"strokeLinecap":t.lineCap=i;break;case"stroke-linejoin":case"strokeLinejoin":switch(i){case"round":case"bevel":case"miter":t.lineJoin=i;break;default:t.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":t.miterLimit=Number(i);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":t.lineDashOffset=Number(i);break;case"stroke-dasharray":case"strokeDasharray":typeof i=="string"&&t.setLineDash(i.split(/\s+/).map(r=>Number(r)));break;case"cursor":break;case"font":typeof i=="string"&&(t.font=i);break;case"font-size":case"fontSize":t.font+=` ${i}`;break;case"font-family":case"fontFamily":t.font+=` ${i}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(i){case"middle":t.textAlign="center";break;case"end":t.textAlign="end";break;case"start":t.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(i){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":t.textBaseline=i;break;default:t.textBaseline="alphabetic";break}break}}}static getStyle(t,e,s){const i=t;if(getComputedStyle)if(e){e=ft(e);const r=getComputedStyle(i,s).getPropertyPriority(e);return getComputedStyle(i,s).getPropertyValue(e).trim()+(r?"!"+r:"")}else{const r=[],a=getComputedStyle(i,"");for(let o=0;o<a.length;o++)r.push(a[o]+":"+a.getPropertyValue(a[o]));return r.push(...(i.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=an(e),t.currentStyle[e];{const r=[],a=i.currentStyle;for(const o in a)r.push(o+":"+a[o]);return r.push(...(i.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(h=>h.trim()))||[])}}}static setStyle(t,e,s){typeof e=="string"&&s?t.style.setProperty(ft(e),s.replace(/!important/i,""),String(s).toLowerCase().includes("!important")?"important":""):e instanceof Object&&Object.keys(e).forEach(i=>{t.style.setProperty(ft(i),String(e[i]).replace(/!important/i,""),String(e[i]).toLowerCase().includes("!important")?"important":"")})}static injectStyle(t,e){let s;if(typeof e=="string"){const r=document.querySelector(e)?.shadowRoot;r?s=r:s=document.querySelector(e)}else s=e||document.getElementsByTagName("head")[0];const i=document.createElement("style");if(i.innerHTML=t,s)return s.appendChild(i),()=>{(s instanceof HTMLElement||s instanceof ShadowRoot)&&s.removeChild(i)};{const r=document.styleSheets[0].insertRule(t);return()=>{document.styleSheets[0].deleteRule(r)}}}static loadLink(t,e=()=>{},s=(i,r,a,o,h)=>{}){const i=document.createElement("link");i.type="text/css",i.rel="stylesheet",i.href=t,i.onload=e,i.onerror=s,document.getElementsByTagName("head")[0].appendChild(i)}static loadScript(t,e=()=>{},s=(i,r,a,o,h)=>{}){const i=document.createElement("script");i.type="text/javascript",i.src=t,i.async=!1,i.onload=e,i.onerror=s,document.body.appendChild(i)}static waitForStyleSheetsLoaded(){return new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let s=document.styleSheets.length||0;const i=()=>s>=e.length?(t(),!0):!1;i()||e.forEach(r=>{r.onload=()=>{s+=1,i()}})})}static toggleClass(t,e,s="toggle"){if(t.classList)e.split(/[,\s]+/).forEach(i=>{const r=i.trim();r!==""&&t.classList[s](r)});else{const i=t.className.split(/ +/);let r=!1;e.split(/[,\s]+/).forEach(a=>{const o=a.trim();if(o!==""){const h=i.indexOf(o);switch(s){case"add":h===-1&&(i.push(o),r=!0);break;case"remove":h!==-1&&(i.splice(h,1),r=!0);break;case"toggle":h===-1?i.push(o):i.splice(h,1),r=!0;break}}}),r&&t.setAttribute("class",i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}static addClass(t,e){this.toggleClass(t,e,"add")}static removeClass(t,e){this.toggleClass(t,e,"remove")}static hasClass(t,e){return new RegExp("(?:^|\\s+)"+e+"(?:\\s+|$)").test(t.className)||!1}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){t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block")}static hide(t){t.style.setProperty("display","none")}static attribute(t,e,s){let i={};if(e===void 0&&s===void 0){for(let o=0,h=t.attributes,c=h.length;o<c;o++){const l=h[o];l.nodeName&&l.nodeValue&&(i[l.nodeName]=l.nodeValue)}return i}if(typeof e=="string"&&s===void 0)return t.getAttribute(ft(e));typeof e=="object"?i=e:typeof e=="string"&&s!==void 0&&(i[e]=s);const{vnode:r,schedule:a}=this.getVNode(t,i.id);Object.entries(i).forEach(([o,h])=>{r.props[ft(o)]=h}),a()}static removeAttribute(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&t.removeAttribute(s.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,s){if(s===void 0&&typeof e=="string")return t[e];{let i={};typeof e=="object"?i=e:typeof e=="string"&&s!==void 0&&(i[e]=s),Object.entries(i).forEach(([r,a])=>{const o=this.fixProp(r);t[o]=a,o=="innerHTML"&&this.scriptConvert(t)})}}static removeProp(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&delete t[this.fixProp(s.trim())]})}static data(t,e,s){if(typeof e=="string"&&(e=an(e)),(typeof e=="string"||e===void 0)&&s===void 0){const i=Object.assign({},t.dataset);return Object.keys(i).forEach(r=>{if(i[r]?.startsWith("[")||i[r]?.startsWith("{"))try{i[r]=JSON.parse(i[r]||"")}catch{}}),typeof e=="string"?i[e]:i}else{let i={};typeof e=="object"?i=e:typeof e=="string"&&(i[e]=s),Object.entries(i).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(s=>{s.trim()!=""&&delete t.dataset[s.trim()]})}static empty(t){this.html(t,"")}static html(t,e){e instanceof HTMLElement||e instanceof SVGElement?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 bind(t,e,s,i=!1){t.addEventListener&&t.addEventListener(e,s,i)}static unbind(t,e,s,i=!1){t.removeEventListener&&t.removeEventListener(e,s,i)}static MouseEvents=["click","dblclick","mousedown","mouseup","mousemove","mouseover","mouseout"];static KeyboardEvents=["keydown","keyup","keypress"];static TouchEvents=["touchstart","touchend","touchcancel","touchmove"];static DragEvents=["dragstart","dragend","dragenter","dragover"];static Events=["change"];static fakeEvent(t,e,s){let i;L.MouseEvents.includes(e)?i=new MouseEvent(e,s):L.KeyboardEvents.includes(e)?i=new KeyboardEvent(e,s):L.TouchEvents.includes(e)?i=new TouchEvent(e,s):L.DragEvents.includes(e)?i=new DragEvent(e,s):L.Events.includes(e)?i=new Event(e,s):i=new CustomEvent(e,s),(t||i.target)?.dispatchEvent(i)}static fireEvent(t,e,s){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:s}))}static scriptConvert(t){const e=s=>{const r=s.ownerDocument.createElement("script");r.text=s.text;const a=s.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(s=>{s.parentNode?.replaceChild(e(s),s)}),t}static insert(t,e,s="append"){return typeof e=="string"?t[s](this.fragment(e)):(e instanceof HTMLElement||e instanceof SVGElement)&&t[s](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 fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(s=>{const i=this.scriptConvert(s);i!=s&&e.content.replaceChild(i,s)}),e.content}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 contains(t,e){return t.contains?t!=e&&t.contains(e):!!(t.compareDocumentPosition(e)&16)}static changeSelectSelected(t,e){if(t instanceof HTMLSelectElement){const s=t.options;for(let i=0,r=s.length;i<r;i++)s[i].value==e?s[i].selected=!0:s[i].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 s;return t.charAt(0)=="#"?t.charAt(1).toLowerCase()=="x"?s=parseInt(t.substring(2),16):s=parseInt(t.substring(1),10):s=e[t],s?String.fromCharCode(s):"&"+t}static runInSafe(t){const e=new Proxy(window,{get(s,i,r){if(typeof i=="string"&&["open","location","document"].includes(i))throw new Error(`禁止访问 key: ${i}`);return i==="window"?e:Reflect.get(s,i,r)},set(s,i,r,a){return Reflect.set(s,i,r,a)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(s={},...i){const r=document.createElement(e);for(const a of Object.keys(s))r.setAttribute(a,s[a]);for(const a of i)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){
|
|
12
12
|
let output = "";
|
|
13
13
|
function echo(html){
|
|
14
14
|
output += html;
|
|
15
15
|
}
|
|
16
16
|
${t}
|
|
17
17
|
return output;
|
|
18
|
-
})`}static escape(t,e="encode"){const s={"&":"&","<":"<",">":">",'"':""","'":"'"};for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t=t.replace(new RegExp(e=="encode"?i:s[i],"g"),e=="encode"?s[i]:i));return t}static getInnerText=t=>{let e=t.innerText;if(!e){const s=t.querySelector("slot")?.assignedNodes()||[];let i=0;for(;!e&&i<=s.length-1;)"innerText"in s[i]&&(e=s[i].innerText),i++}return e};static copyToClipboard=t=>new Promise((e,s)=>{if(navigator.clipboard)navigator.clipboard.writeText(t).then(e).catch(s);else{const i=document.createElement("textarea");i.value=t,i.style.opacity="0",i.style.top="0",i.style.left="0",i.style.position="fixed",document.body.appendChild(i),i.focus(),i.select();try{document.execCommand("copy")?e():s()}catch(r){s(r)}document.body.removeChild(i)}});static scrollTo=(t,e)=>window.scrollTo(t,e);static getLocation(){return new Promise((t,e)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(s=>{t(s.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 s=document.createElement("iframe");s.src=e,document.body.append(s),setTimeout(function(){s.contentWindow?.postMessage(t,e)},4e3),setTimeout(function(){s.remove()},6e3)}static measureText=(t,e=12,s=400)=>{const i=document.createElement("span");i.style.visibility="hidden",i.style.margin="0",i.style.padding="0",i.style.inset="0",i.style.whiteSpace="nowrap",i.style.overflow="visible",i.style.fontSize=e+"px",i.style.fontWeight=s.toString(),i.innerText=t,document.body.appendChild(i);const r=i.offsetWidth,a=i.offsetHeight;return document.body.removeChild(i),{width:r,height:a}};static getFixedWidthText=(t,e,s=12,i=400,r=!0)=>{let a="";if(!t||e<s)return a;const o=t.split(""),h="...";let c=r?
|
|
18
|
+
})`}static escape(t,e="encode"){const s={"&":"&","<":"<",">":">",'"':""","'":"'"};for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t=t.replace(new RegExp(e=="encode"?i:s[i],"g"),e=="encode"?s[i]:i));return t}static getInnerText=t=>{let e=t.innerText;if(!e){const s=t.querySelector("slot")?.assignedNodes()||[];let i=0;for(;!e&&i<=s.length-1;)"innerText"in s[i]&&(e=s[i].innerText),i++}return e};static copyToClipboard=t=>new Promise((e,s)=>{if(navigator.clipboard)navigator.clipboard.writeText(t).then(e).catch(s);else{const i=document.createElement("textarea");i.value=t,i.style.opacity="0",i.style.top="0",i.style.left="0",i.style.position="fixed",document.body.appendChild(i),i.focus(),i.select();try{document.execCommand("copy")?e():s()}catch(r){s(r)}document.body.removeChild(i)}});static scrollTo=(t,e)=>window.scrollTo(t,e);static getLocation(){return new Promise((t,e)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(s=>{t(s.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 s=document.createElement("iframe");s.src=e,document.body.append(s),setTimeout(function(){s.contentWindow?.postMessage(t,e)},4e3),setTimeout(function(){s.remove()},6e3)}static measureText=(t,e=12,s=400)=>{const i=document.createElement("span");i.style.visibility="hidden",i.style.margin="0",i.style.padding="0",i.style.inset="0",i.style.whiteSpace="nowrap",i.style.overflow="visible",i.style.fontSize=e+"px",i.style.fontWeight=s.toString(),i.innerText=t,document.body.appendChild(i);const r=i.offsetWidth,a=i.offsetHeight;return document.body.removeChild(i),{width:r,height:a}};static getFixedWidthText=(t,e,s=12,i=400,r=!0)=>{let a="";if(!t||e<s)return a;const o=t.split(""),h="...";let c=r?L.measureText(h,s,i).width:0;for(let l=0,d=o.length;l<d;l++)if(c+=L.measureText(o[l],s,i).width,c>e){r&&(a+=h);break}else a+=o[l];return a};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}}}var er={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
19
19
|
* http://hammerjs.github.io/
|
|
20
20
|
*
|
|
21
21
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
22
|
-
* Licensed under the MIT license */(function(n){(function(t,e,s,i){var r=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),o="function",h=Math.round,c=Math.abs,l=Date.now;function d(u,f,
|
|
23
|
-
`+
|
|
24
|
-
`;return function(){var _=new Error("get-stack-trace"),k=_&&_.stack?_.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",N=t.console&&(t.console.warn||t.console.log);return N&&N.call(t.console,v,k),u.apply(this,arguments)}}var x;typeof Object.assign!="function"?x=function(f){if(f===i||f===null)throw new TypeError("Cannot convert undefined or null to object");for(var w=Object(f),v=1;v<arguments.length;v++){var _=arguments[v];if(_!==i&&_!==null)for(var k in _)_.hasOwnProperty(k)&&(w[k]=_[k])}return w}:x=Object.assign;var b=m(function(f,w,v){for(var _=Object.keys(w),k=0;k<_.length;)(!v||v&&f[_[k]]===i)&&(f[_[k]]=w[_[k]]),k++;return f},"extend","Use `assign`."),S=m(function(f,w){return b(f,w,!0)},"merge","Use `assign`.");function C(u,f,w){var v=f.prototype,_;_=u.prototype=Object.create(v),_.constructor=u,_._super=v,w&&x(_,w)}function L(u,f){return function(){return u.apply(f,arguments)}}function R(u,f){return typeof u==o?u.apply(f&&f[0]||i,f):u}function X(u,f){return u===i?f:u}function Y(u,f,w){y(Z(f),function(v){u.addEventListener(v,w,!1)})}function H(u,f,w){y(Z(f),function(v){u.removeEventListener(v,w,!1)})}function at(u,f){for(;u;){if(u==f)return!0;u=u.parentNode}return!1}function J(u,f){return u.indexOf(f)>-1}function Z(u){return u.trim().split(/\s+/g)}function j(u,f,w){if(u.indexOf&&!w)return u.indexOf(f);for(var v=0;v<u.length;){if(w&&u[v][w]==f||!w&&u[v]===f)return v;v++}return-1}function ot(u){return Array.prototype.slice.call(u,0)}function St(u,f,w){for(var v=[],_=[],k=0;k<u.length;){var N=f?u[k][f]:u[k];j(_,N)<0&&v.push(u[k]),_[k]=N,k++}return w&&(f?v=v.sort(function(et,dt){return et[f]>dt[f]}):v=v.sort()),v}function gt(u,f){for(var w,v,_=f[0].toUpperCase()+f.slice(1),k=0;k<r.length;){if(w=r[k],v=w?w+_:f,v in u)return v;k++}return i}var xe=1;function ne(){return xe++}function le(u){var f=u.ownerDocument||u;return f.defaultView||f.parentWindow||t}var be=/mobile|tablet|ip(ad|hone|od)|android/i,M="ontouchstart"in t,D=gt(t,"PointerEvent")!==i,F=M&&be.test(navigator.userAgent),G="touch",ut="pen",_t="mouse",ks="kinect",Ms=25,Q=1,Lt=2,q=4,P=8,Ls=1,Ve=2,ze=4,qe=8,He=16,Rt=Ve|ze,ue=qe|He,ca=Rt|ue,la=["x","y"],Rs=["clientX","clientY"];function Ct(u,f){var w=this;this.manager=u,this.callback=f,this.element=u.element,this.target=u.options.inputTarget,this.domHandler=function(v){R(u.options.enable,[u])&&w.handler(v)},this.init()}Ct.prototype={handler:function(){},init:function(){this.evEl&&Y(this.element,this.evEl,this.domHandler),this.evTarget&&Y(this.target,this.evTarget,this.domHandler),this.evWin&&Y(le(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&H(this.element,this.evEl,this.domHandler),this.evTarget&&H(this.target,this.evTarget,this.domHandler),this.evWin&&H(le(this.element),this.evWin,this.domHandler)}};function Vu(u){var f,w=u.options.inputClass;return w?f=w:D?f=Hi:F?f=Ns:M?f=ji:f=Fs,new f(u,zu)}function zu(u,f,w){var v=w.pointers.length,_=w.changedPointers.length,k=f&Q&&v-_===0,N=f&(q|P)&&v-_===0;w.isFirst=!!k,w.isFinal=!!N,k&&(u.session={}),w.eventType=f,qu(u,w),u.emit("hammer.input",w),u.recognize(w),u.session.prevInput=w}function qu(u,f){var w=u.session,v=f.pointers,_=v.length;w.firstInput||(w.firstInput=ua(f)),_>1&&!w.firstMultiple?w.firstMultiple=ua(f):_===1&&(w.firstMultiple=!1);var k=w.firstInput,N=w.firstMultiple,tt=N?N.center:k.center,et=f.center=da(v);f.timeStamp=l(),f.deltaTime=f.timeStamp-k.timeStamp,f.angle=qi(tt,et),f.distance=Os(tt,et),Hu(w,f),f.offsetDirection=ma(f.deltaX,f.deltaY);var dt=fa(f.deltaTime,f.deltaX,f.deltaY);f.overallVelocityX=dt.x,f.overallVelocityY=dt.y,f.overallVelocity=c(dt.x)>c(dt.y)?dt.x:dt.y,f.scale=N?$u(N.pointers,v):1,f.rotation=N?Wu(N.pointers,v):0,f.maxPointers=w.prevInput?f.pointers.length>w.prevInput.maxPointers?f.pointers.length:w.prevInput.maxPointers:f.pointers.length,ju(w,f);var Ft=u.element;at(f.srcEvent.target,Ft)&&(Ft=f.srcEvent.target),f.target=Ft}function Hu(u,f){var w=f.center,v=u.offsetDelta||{},_=u.prevDelta||{},k=u.prevInput||{};(f.eventType===Q||k.eventType===q)&&(_=u.prevDelta={x:k.deltaX||0,y:k.deltaY||0},v=u.offsetDelta={x:w.x,y:w.y}),f.deltaX=_.x+(w.x-v.x),f.deltaY=_.y+(w.y-v.y)}function ju(u,f){var w=u.lastInterval||f,v=f.timeStamp-w.timeStamp,_,k,N,tt;if(f.eventType!=P&&(v>Ms||w.velocity===i)){var et=f.deltaX-w.deltaX,dt=f.deltaY-w.deltaY,Ft=fa(v,et,dt);k=Ft.x,N=Ft.y,_=c(Ft.x)>c(Ft.y)?Ft.x:Ft.y,tt=ma(et,dt),u.lastInterval=f}else _=w.velocity,k=w.velocityX,N=w.velocityY,tt=w.direction;f.velocity=_,f.velocityX=k,f.velocityY=N,f.direction=tt}function ua(u){for(var f=[],w=0;w<u.pointers.length;)f[w]={clientX:h(u.pointers[w].clientX),clientY:h(u.pointers[w].clientY)},w++;return{timeStamp:l(),pointers:f,center:da(f),deltaX:u.deltaX,deltaY:u.deltaY}}function da(u){var f=u.length;if(f===1)return{x:h(u[0].clientX),y:h(u[0].clientY)};for(var w=0,v=0,_=0;_<f;)w+=u[_].clientX,v+=u[_].clientY,_++;return{x:h(w/f),y:h(v/f)}}function fa(u,f,w){return{x:f/u||0,y:w/u||0}}function ma(u,f){return u===f?Ls:c(u)>=c(f)?u<0?Ve:ze:f<0?qe:He}function Os(u,f,w){w||(w=la);var v=f[w[0]]-u[w[0]],_=f[w[1]]-u[w[1]];return Math.sqrt(v*v+_*_)}function qi(u,f,w){w||(w=la);var v=f[w[0]]-u[w[0]],_=f[w[1]]-u[w[1]];return Math.atan2(_,v)*180/Math.PI}function Wu(u,f){return qi(f[1],f[0],Rs)+qi(u[1],u[0],Rs)}function $u(u,f){return Os(f[0],f[1],Rs)/Os(u[0],u[1],Rs)}var Ju={mousedown:Q,mousemove:Lt,mouseup:q},Zu="mousedown",Ku="mousemove mouseup";function Fs(){this.evEl=Zu,this.evWin=Ku,this.pressed=!1,Ct.apply(this,arguments)}C(Fs,Ct,{handler:function(f){var w=Ju[f.type];w&Q&&f.button===0&&(this.pressed=!0),w&Lt&&f.which!==1&&(w=q),this.pressed&&(w&q&&(this.pressed=!1),this.callback(this.manager,w,{pointers:[f],changedPointers:[f],pointerType:_t,srcEvent:f}))}});var Qu={pointerdown:Q,pointermove:Lt,pointerup:q,pointercancel:P,pointerout:P},td={2:G,3:ut,4:_t,5:ks},pa="pointerdown",ga="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(pa="MSPointerDown",ga="MSPointerMove MSPointerUp MSPointerCancel");function Hi(){this.evEl=pa,this.evWin=ga,Ct.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}C(Hi,Ct,{handler:function(f){var w=this.store,v=!1,_=f.type.toLowerCase().replace("ms",""),k=Qu[_],N=td[f.pointerType]||f.pointerType,tt=N==G,et=j(w,f.pointerId,"pointerId");k&Q&&(f.button===0||tt)?et<0&&(w.push(f),et=w.length-1):k&(q|P)&&(v=!0),!(et<0)&&(w[et]=f,this.callback(this.manager,k,{pointers:w,changedPointers:[f],pointerType:N,srcEvent:f}),v&&w.splice(et,1))}});var ed={touchstart:Q,touchmove:Lt,touchend:q,touchcancel:P},sd="touchstart",id="touchstart touchmove touchend touchcancel";function ya(){this.evTarget=sd,this.evWin=id,this.started=!1,Ct.apply(this,arguments)}C(ya,Ct,{handler:function(f){var w=ed[f.type];if(w===Q&&(this.started=!0),!!this.started){var v=nd.call(this,f,w);w&(q|P)&&v[0].length-v[1].length===0&&(this.started=!1),this.callback(this.manager,w,{pointers:v[0],changedPointers:v[1],pointerType:G,srcEvent:f})}}});function nd(u,f){var w=ot(u.touches),v=ot(u.changedTouches);return f&(q|P)&&(w=St(w.concat(v),"identifier",!0)),[w,v]}var rd={touchstart:Q,touchmove:Lt,touchend:q,touchcancel:P},ad="touchstart touchmove touchend touchcancel";function Ns(){this.evTarget=ad,this.targetIds={},Ct.apply(this,arguments)}C(Ns,Ct,{handler:function(f){var w=rd[f.type],v=od.call(this,f,w);v&&this.callback(this.manager,w,{pointers:v[0],changedPointers:v[1],pointerType:G,srcEvent:f})}});function od(u,f){var w=ot(u.touches),v=this.targetIds;if(f&(Q|Lt)&&w.length===1)return v[w[0].identifier]=!0,[w,w];var _,k,N=ot(u.changedTouches),tt=[],et=this.target;if(k=w.filter(function(dt){return at(dt.target,et)}),f===Q)for(_=0;_<k.length;)v[k[_].identifier]=!0,_++;for(_=0;_<N.length;)v[N[_].identifier]&&tt.push(N[_]),f&(q|P)&&delete v[N[_].identifier],_++;if(tt.length)return[St(k.concat(tt),"identifier",!0),tt]}var hd=2500,wa=25;function ji(){Ct.apply(this,arguments);var u=L(this.handler,this);this.touch=new Ns(this.manager,u),this.mouse=new Fs(this.manager,u),this.primaryTouch=null,this.lastTouches=[]}C(ji,Ct,{handler:function(f,w,v){var _=v.pointerType==G,k=v.pointerType==_t;if(!(k&&v.sourceCapabilities&&v.sourceCapabilities.firesTouchEvents)){if(_)cd.call(this,w,v);else if(k&&ld.call(this,v))return;this.callback(f,w,v)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function cd(u,f){u&Q?(this.primaryTouch=f.changedPointers[0].identifier,xa.call(this,f)):u&(q|P)&&xa.call(this,f)}function xa(u){var f=u.changedPointers[0];if(f.identifier===this.primaryTouch){var w={x:f.clientX,y:f.clientY};this.lastTouches.push(w);var v=this.lastTouches,_=function(){var k=v.indexOf(w);k>-1&&v.splice(k,1)};setTimeout(_,hd)}}function ld(u){for(var f=u.srcEvent.clientX,w=u.srcEvent.clientY,v=0;v<this.lastTouches.length;v++){var _=this.lastTouches[v],k=Math.abs(f-_.x),N=Math.abs(w-_.y);if(k<=wa&&N<=wa)return!0}return!1}var ba=gt(a.style,"touchAction"),va=ba!==i,Sa="compute",Ca="auto",Wi="manipulation",de="none",je="pan-x",We="pan-y",Ys=dd();function $i(u,f){this.manager=u,this.set(f)}$i.prototype={set:function(u){u==Sa&&(u=this.compute()),va&&this.manager.element.style&&Ys[u]&&(this.manager.element.style[ba]=u),this.actions=u.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var u=[];return y(this.manager.recognizers,function(f){R(f.options.enable,[f])&&(u=u.concat(f.getTouchAction()))}),ud(u.join(" "))},preventDefaults:function(u){var f=u.srcEvent,w=u.offsetDirection;if(this.manager.session.prevented){f.preventDefault();return}var v=this.actions,_=J(v,de)&&!Ys[de],k=J(v,We)&&!Ys[We],N=J(v,je)&&!Ys[je];if(_){var tt=u.pointers.length===1,et=u.distance<2,dt=u.deltaTime<250;if(tt&&et&&dt)return}if(!(N&&k)&&(_||k&&w&Rt||N&&w&ue))return this.preventSrc(f)},preventSrc:function(u){this.manager.session.prevented=!0,u.preventDefault()}};function ud(u){if(J(u,de))return de;var f=J(u,je),w=J(u,We);return f&&w?de:f||w?f?je:We:J(u,Wi)?Wi:Ca}function dd(){if(!va)return!1;var u={},f=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(w){u[w]=f?t.CSS.supports("touch-action",w):!0}),u}var Bs=1,Et=2,ve=4,re=8,Ht=re,$e=16,Ot=32;function jt(u){this.options=x({},this.defaults,u||{}),this.id=ne(),this.manager=null,this.options.enable=X(this.options.enable,!0),this.state=Bs,this.simultaneous={},this.requireFail=[]}jt.prototype={defaults:{},set:function(u){return x(this.options,u),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(u){if(g(u,"recognizeWith",this))return this;var f=this.simultaneous;return u=Xs(u,this),f[u.id]||(f[u.id]=u,u.recognizeWith(this)),this},dropRecognizeWith:function(u){return g(u,"dropRecognizeWith",this)?this:(u=Xs(u,this),delete this.simultaneous[u.id],this)},requireFailure:function(u){if(g(u,"requireFailure",this))return this;var f=this.requireFail;return u=Xs(u,this),j(f,u)===-1&&(f.push(u),u.requireFailure(this)),this},dropRequireFailure:function(u){if(g(u,"dropRequireFailure",this))return this;u=Xs(u,this);var f=j(this.requireFail,u);return f>-1&&this.requireFail.splice(f,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(u){return!!this.simultaneous[u.id]},emit:function(u){var f=this,w=this.state;function v(_){f.manager.emit(_,u)}w<re&&v(f.options.event+Ea(w)),v(f.options.event),u.additionalEvent&&v(u.additionalEvent),w>=re&&v(f.options.event+Ea(w))},tryEmit:function(u){if(this.canEmit())return this.emit(u);this.state=Ot},canEmit:function(){for(var u=0;u<this.requireFail.length;){if(!(this.requireFail[u].state&(Ot|Bs)))return!1;u++}return!0},recognize:function(u){var f=x({},u);if(!R(this.options.enable,[this,f])){this.reset(),this.state=Ot;return}this.state&(Ht|$e|Ot)&&(this.state=Bs),this.state=this.process(f),this.state&(Et|ve|re|$e)&&this.tryEmit(f)},process:function(u){},getTouchAction:function(){},reset:function(){}};function Ea(u){return u&$e?"cancel":u&re?"end":u&ve?"move":u&Et?"start":""}function Ta(u){return u==He?"down":u==qe?"up":u==Ve?"left":u==ze?"right":""}function Xs(u,f){var w=f.manager;return w?w.get(u):u}function Dt(){jt.apply(this,arguments)}C(Dt,jt,{defaults:{pointers:1},attrTest:function(u){var f=this.options.pointers;return f===0||u.pointers.length===f},process:function(u){var f=this.state,w=u.eventType,v=f&(Et|ve),_=this.attrTest(u);return v&&(w&P||!_)?f|$e:v||_?w&q?f|re:f&Et?f|ve:Et:Ot}});function Gs(){Dt.apply(this,arguments),this.pX=null,this.pY=null}C(Gs,Dt,{defaults:{event:"pan",threshold:10,pointers:1,direction:ca},getTouchAction:function(){var u=this.options.direction,f=[];return u&Rt&&f.push(We),u&ue&&f.push(je),f},directionTest:function(u){var f=this.options,w=!0,v=u.distance,_=u.direction,k=u.deltaX,N=u.deltaY;return _&f.direction||(f.direction&Rt?(_=k===0?Ls:k<0?Ve:ze,w=k!=this.pX,v=Math.abs(u.deltaX)):(_=N===0?Ls:N<0?qe:He,w=N!=this.pY,v=Math.abs(u.deltaY))),u.direction=_,w&&v>f.threshold&&_&f.direction},attrTest:function(u){return Dt.prototype.attrTest.call(this,u)&&(this.state&Et||!(this.state&Et)&&this.directionTest(u))},emit:function(u){this.pX=u.deltaX,this.pY=u.deltaY;var f=Ta(u.direction);f&&(u.additionalEvent=this.options.event+f),this._super.emit.call(this,u)}});function Ji(){Dt.apply(this,arguments)}C(Ji,Dt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[de]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.scale-1)>this.options.threshold||this.state&Et)},emit:function(u){if(u.scale!==1){var f=u.scale<1?"in":"out";u.additionalEvent=this.options.event+f}this._super.emit.call(this,u)}});function Zi(){jt.apply(this,arguments),this._timer=null,this._input=null}C(Zi,jt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ca]},process:function(u){var f=this.options,w=u.pointers.length===f.pointers,v=u.distance<f.threshold,_=u.deltaTime>f.time;if(this._input=u,!v||!w||u.eventType&(q|P)&&!_)this.reset();else if(u.eventType&Q)this.reset(),this._timer=d(function(){this.state=Ht,this.tryEmit()},f.time,this);else if(u.eventType&q)return Ht;return Ot},reset:function(){clearTimeout(this._timer)},emit:function(u){this.state===Ht&&(u&&u.eventType&q?this.manager.emit(this.options.event+"up",u):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Ki(){Dt.apply(this,arguments)}C(Ki,Dt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[de]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.rotation)>this.options.threshold||this.state&Et)}});function Qi(){Dt.apply(this,arguments)}C(Qi,Dt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Rt|ue,pointers:1},getTouchAction:function(){return Gs.prototype.getTouchAction.call(this)},attrTest:function(u){var f=this.options.direction,w;return f&(Rt|ue)?w=u.overallVelocity:f&Rt?w=u.overallVelocityX:f&ue&&(w=u.overallVelocityY),this._super.attrTest.call(this,u)&&f&u.offsetDirection&&u.distance>this.options.threshold&&u.maxPointers==this.options.pointers&&c(w)>this.options.velocity&&u.eventType&q},emit:function(u){var f=Ta(u.offsetDirection);f&&this.manager.emit(this.options.event+f,u),this.manager.emit(this.options.event,u)}});function Us(){jt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}C(Us,jt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Wi]},process:function(u){var f=this.options,w=u.pointers.length===f.pointers,v=u.distance<f.threshold,_=u.deltaTime<f.time;if(this.reset(),u.eventType&Q&&this.count===0)return this.failTimeout();if(v&&_&&w){if(u.eventType!=q)return this.failTimeout();var k=this.pTime?u.timeStamp-this.pTime<f.interval:!0,N=!this.pCenter||Os(this.pCenter,u.center)<f.posThreshold;this.pTime=u.timeStamp,this.pCenter=u.center,!N||!k?this.count=1:this.count+=1,this._input=u;var tt=this.count%f.taps;if(tt===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=Ht,this.tryEmit()},f.interval,this),Et):Ht}return Ot},failTimeout:function(){return this._timer=d(function(){this.state=Ot},this.options.interval,this),Ot},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Ht&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Wt(u,f){return f=f||{},f.recognizers=X(f.recognizers,Wt.defaults.preset),new tn(u,f)}Wt.VERSION="2.0.7",Wt.defaults={domEvents:!1,touchAction:Sa,enable:!0,inputTarget:null,inputClass:null,preset:[[Ki,{enable:!1}],[Ji,{enable:!1},["rotate"]],[Qi,{direction:Rt}],[Gs,{direction:Rt},["swipe"]],[Us],[Us,{event:"doubletap",taps:2},["tap"]],[Zi]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var fd=1,Pa=2;function tn(u,f){this.options=x({},Wt.defaults,f||{}),this.options.inputTarget=this.options.inputTarget||u,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=u,this.input=Vu(this),this.touchAction=new $i(this,this.options.touchAction),_a(this,!0),y(this.options.recognizers,function(w){var v=this.add(new w[0](w[1]));w[2]&&v.recognizeWith(w[2]),w[3]&&v.requireFailure(w[3])},this)}tn.prototype={set:function(u){return x(this.options,u),u.touchAction&&this.touchAction.update(),u.inputTarget&&(this.input.destroy(),this.input.target=u.inputTarget,this.input.init()),this},stop:function(u){this.session.stopped=u?Pa:fd},recognize:function(u){var f=this.session;if(!f.stopped){this.touchAction.preventDefaults(u);var w,v=this.recognizers,_=f.curRecognizer;(!_||_&&_.state&Ht)&&(_=f.curRecognizer=null);for(var k=0;k<v.length;)w=v[k],f.stopped!==Pa&&(!_||w==_||w.canRecognizeWith(_))?w.recognize(u):w.reset(),!_&&w.state&(Et|ve|re)&&(_=f.curRecognizer=w),k++}},get:function(u){if(u instanceof jt)return u;for(var f=this.recognizers,w=0;w<f.length;w++)if(f[w].options.event==u)return f[w];return null},add:function(u){if(g(u,"add",this))return this;var f=this.get(u.options.event);return f&&this.remove(f),this.recognizers.push(u),u.manager=this,this.touchAction.update(),u},remove:function(u){if(g(u,"remove",this))return this;if(u=this.get(u),u){var f=this.recognizers,w=j(f,u);w!==-1&&(f.splice(w,1),this.touchAction.update())}return this},on:function(u,f){if(u!==i&&f!==i){var w=this.handlers;return y(Z(u),function(v){w[v]=w[v]||[],w[v].push(f)}),this}},off:function(u,f){if(u!==i){var w=this.handlers;return y(Z(u),function(v){f?w[v]&&w[v].splice(j(w[v],f),1):delete w[v]}),this}},emit:function(u,f){this.options.domEvents&&md(u,f);var w=this.handlers[u]&&this.handlers[u].slice();if(!(!w||!w.length)){f.type=u,f.preventDefault=function(){f.srcEvent.preventDefault()};for(var v=0;v<w.length;)w[v](f),v++}},destroy:function(){this.element&&_a(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function _a(u,f){var w=u.element;if(w.style){var v;y(u.options.cssProps,function(_,k){v=gt(w.style,k),f?(u.oldCssProps[v]=w.style[v],w.style[v]=_):w.style[v]=u.oldCssProps[v]||""}),f||(u.oldCssProps={})}}function md(u,f){var w=e.createEvent("Event");w.initEvent(u,!0,!0),w.gesture=f,f.target.dispatchEvent(w)}x(Wt,{INPUT_START:Q,INPUT_MOVE:Lt,INPUT_END:q,INPUT_CANCEL:P,STATE_POSSIBLE:Bs,STATE_BEGAN:Et,STATE_CHANGED:ve,STATE_ENDED:re,STATE_RECOGNIZED:Ht,STATE_CANCELLED:$e,STATE_FAILED:Ot,DIRECTION_NONE:Ls,DIRECTION_LEFT:Ve,DIRECTION_RIGHT:ze,DIRECTION_UP:qe,DIRECTION_DOWN:He,DIRECTION_HORIZONTAL:Rt,DIRECTION_VERTICAL:ue,DIRECTION_ALL:ca,Manager:tn,Input:Ct,TouchAction:$i,TouchInput:Ns,MouseInput:Fs,PointerEventInput:Hi,TouchMouseInput:ji,SingleTouchInput:ya,Recognizer:jt,AttrRecognizer:Dt,Tap:Us,Pan:Gs,Swipe:Qi,Pinch:Ji,Rotate:Ki,Press:Zi,on:Y,off:H,each:y,merge:S,extend:b,assign:x,inherit:C,bindFn:L,prefixed:gt});var pd=typeof t<"u"?t:typeof self<"u"?self:{};pd.Hammer=Wt,typeof i=="function"&&i.amd?i(function(){return Wt}):n.exports?n.exports=Wt:t[s]=Wt})(window,document,"Hammer")})(Kn);var oh=Kn.exports;const hh=ah(oh);class Qn{constructor(){}static getFormatKeyNames(t){const e=ti(),s=[];return t.ctrl&&s.push(e?"Cmd":"Ctrl"),t.shift&&s.push("Shift"),t.alt&&s.push("Alt"),typeof t.key=="string"?s.push(zs(t.key)):Array.isArray(t.key)&&(t.key.map(i=>zs(i)),s.push(...t.key)),s}static matchKeyScheme(t,e){const s=t.ctrl??!1,i=t.shift??!1,r=t.alt??!1;if(t.exact)return(s===e.metaKey||s===e.ctrlKey)&&i===e.shiftKey&&r===e.altKey;const a=[];return s&&a.push(s===e.metaKey||s===e.ctrlKey),i&&a.push(i===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 s=t?.target??window;let i=!1;const r=this.getFormatKeyNames(t),a=o=>{if(o.stopPropagation(),!i&&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=l=>{l.preventDefault(),h(l),s.removeEventListener("keyup",c)};s.addEventListener("keyup",c)}};return e.title=t?.title??"",e.formatedKeyNames=r,e.pause=()=>i=!0,e.restart=()=>i=!1,e.removeListener=()=>s.removeEventListener("keydown",a),s.addEventListener("keydown",a),e}}const ch={BACKSPACE:8,TAB:9,COMMA:188,DELETE:46,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,UP:38,DOWN:40,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32};class tr extends js{container;width;height;mousePoint={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0};hammer;removes=[];constructor(t=document.documentElement,e=!0,s){super(),this.container=t,this.width=t.offsetWidth,this.height=t.offsetHeight,this.hammer=new hh(this.container),e&&this.start(s)}emitDebounce=Va((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}start(t){this.registerMouseEventListeners(),this.registerTransitionEventListeners(),this.registerAnimationEventListeners(),this.registerResizeObserver(),this.registerElementDisplayInParent(),t&&t.forEach(e=>{this.addRemoves(e())}),this.on("pointerMove",e=>{this.setMousePoint(Tt(e,this.container))})}destroy(){this.removes.forEach(t=>t()),this.removes=[],this.removeAllListeners()}restart(){this.destroy(),this.start()}addRemoves(t){this.removes.push(t)}registerMouseEventListeners(){const t=P=>{this.emit("mouseDown",P)},e=P=>{this.emit("mouseUp",P)},s=P=>{this.emit("mouseMove",P)},i=P=>{this.emit("mouseOver",P)},r=P=>{this.emit("mouseOut",P)},a=P=>{this.emit("mouseEnter",P)},o=P=>{this.emit("mouseLeave",P)},h=P=>{this.emit("mouseClick",P)},c=P=>{this.emit("mouseDoubleClick",P)},l=P=>{this.emit("mouseWheel",P)},d=P=>{this.emit("mouseContextMenu",P)},g=P=>{this.emit("touchStart",P)},y=P=>{this.emit("touchEnd",P)},m=P=>{this.emit("touchCancel",P)},x=P=>{this.emit("touchMove",P)},b=P=>{this.emit("pointerDown",P)},S=P=>{this.emit("pointerUp",P)},C=P=>{this.emit("pointerCancel",P)},L=P=>{this.emit("pointerMove",P)},R=P=>{this.emit("pan",P)},X=P=>{this.emit("panStart",P)},Y=P=>{this.emit("panMove",P)},H=P=>{this.emit("panEnd",P)},at=P=>{this.emit("panCancel",P)},J=P=>{this.emit("panLeft",P)},Z=P=>{this.emit("panRight",P)},j=P=>{this.emit("panUp",P)},ot=P=>{this.emit("panDown",P)},St=P=>{this.emit("pinch",P)},gt=P=>{this.emit("press",P)},xe=P=>{this.emit("rotate",P)},ne=P=>{this.emit("swipe",P)},le=P=>{this.emit("swipeLeft",P)},be=P=>{this.emit("swipeRight",P)},M=P=>{this.emit("swipeUp",P)},D=P=>{this.emit("swipeDown",P)},F=P=>{this.emit("tap",P)},G=P=>{!P.target||this.container==P.target||this.container.contains(P.target)||this.emit("tapOutSide",P)},ut=P=>{this.emit("inputChange",P,this.container.files)},_t=P=>{this.emit("dragstart",P)},ks=P=>{P.dataTransfer&&(P.dataTransfer.dropEffect="copy"),this.emit("dragover",P)},Ms=P=>{this.emit("dragenter",P)},Q=P=>{this.emit("dragend",P)},Lt=P=>{P.dataTransfer,this.emit("drop",P,P.dataTransfer?.files)};this.container.addEventListener("mousedown",t,!1),this.container.addEventListener("mouseup",e,!1),this.container.addEventListener("mousemove",s,!1),this.container.addEventListener("mouseover",i,!1),this.container.addEventListener("mouseout",r,!1),this.container.addEventListener("mouseenter",a,!1),this.container.addEventListener("mouseleave",o,!1),this.container.addEventListener("click",h,!1),this.container.addEventListener("dblclick",c,!1),this.container.addEventListener("wheel",l,!1),this.container.addEventListener("contextmenu",d,!1),this.container.addEventListener("touchstart",g,!1),this.container.addEventListener("touchend",y,!1),this.container.addEventListener("touchcancel",m,!1),this.container.addEventListener("touchmove",x,!1),this.container.addEventListener("pointerdown",b,!1),this.container.addEventListener("pointerup",S,!1),this.container.addEventListener("pointercancel",C,!1),this.container.addEventListener("pointermove",L,!1),this.hammer.on("pan",R),this.hammer.on("panstart",X),this.hammer.on("panmove",Y),this.hammer.on("panend",H),this.hammer.on("pancancel",at),this.hammer.on("panleft",J),this.hammer.on("panright",Z),this.hammer.on("panup",j),this.hammer.on("pandown",ot),this.hammer.on("pinch",St),this.hammer.on("press",gt),this.hammer.on("rotate",xe),this.hammer.on("swipe",ne),this.hammer.on("swipeleft",le),this.hammer.on("swiperight",be),this.hammer.on("swipeup",M),this.hammer.on("swipedown",D),this.hammer.on("tap",F),document.addEventListener("pointerdown",G,!1),this.container instanceof HTMLInputElement&&this.container.addEventListener("change",ut,!1),this.container.addEventListener("dragstart",_t,!1),this.container.addEventListener("dragover",ks,!1),this.container.addEventListener("dragenter",Ms,!1),this.container.addEventListener("dragend",Q,!1),this.container.addEventListener("drop",Lt,!1);const q=()=>{this.container.removeEventListener("mousedown",t,!1),this.container.removeEventListener("mouseup",e,!1),this.container.removeEventListener("mousemove",s,!1),this.container.removeEventListener("mouseover",i,!1),this.container.removeEventListener("mouseout",r,!1),this.container.removeEventListener("mouseenter",a,!1),this.container.removeEventListener("mouseleave",o,!1),this.container.removeEventListener("click",h,!1),this.container.removeEventListener("dblclick",c,!1),this.container.removeEventListener("wheel",l,!1),this.container.removeEventListener("contextmenu",d,!1),this.container.removeEventListener("touchstart",g,!1),this.container.removeEventListener("touchend",y,!1),this.container.removeEventListener("touchcancel",m,!1),this.container.removeEventListener("touchmove",x,!1),this.container.removeEventListener("pointerdown",b,!1),this.container.removeEventListener("pointerup",S,!1),this.container.removeEventListener("pointercancel",C),this.container.removeEventListener("pointermove",L,!1),this.hammer.off("pan",R),this.hammer.off("panstart",X),this.hammer.off("panmove",Y),this.hammer.off("panend",H),this.hammer.off("pancancel",at),this.hammer.off("panleft",J),this.hammer.off("panright",Z),this.hammer.off("panup",j),this.hammer.off("pandown",ot),this.hammer.off("pinch",St),this.hammer.off("press",gt),this.hammer.off("rotate",xe),this.hammer.off("swipe",ne),this.hammer.off("swipeleft",le),this.hammer.off("swiperight",be),this.hammer.off("swipeup",M),this.hammer.off("swipedown",D),this.hammer.off("tap",F),document.removeEventListener("pointerdown",G,!1),document.removeEventListener("touchstart",G,!1),document.removeEventListener("mousedown",G,!1),this.container instanceof HTMLInputElement&&this.container.removeEventListener("change",ut,!1),this.container.removeEventListener("dragstart",_t,!1),this.container.removeEventListener("dragover",ks,!1),this.container.removeEventListener("dragenter",Ms,!1),this.container.removeEventListener("dragend",Q,!1),this.container.removeEventListener("drop",Lt,!1)};return this.addRemoves(q),q}registerTransitionEventListeners(){const t=i=>{this.emit("transitionstart",i)},e=i=>{this.emit("transitionend",i)};this.container.addEventListener("transitionstart",t,!1),this.container.addEventListener("transitionend",e,!1);const s=()=>{this.container.removeEventListener("transitionstart",t,!1),this.container.removeEventListener("transitionend",e,!1)};return this.addRemoves(s),s}registerAnimationEventListeners(){const t=i=>{this.emit("animationstart",i)},e=i=>{this.emit("animationend",i)};this.container.addEventListener("animationstart",t,!1),this.container.addEventListener("animationend",e,!1);const s=()=>{this.container.removeEventListener("animationstart",t,!1),this.container.removeEventListener("animationend",e,!1)};return this.addRemoves(s),s}registerKeyDown(t,e,s){const i=Qn.on(t,a=>(e(a,i.formatedKeyNames,i.pause,i.restart),s)),r=()=>{i.removeListener?.()};return this.addRemoves(r),r}registerResizeObserver(){let t;if(typeof ResizeObserver<"u"){const e=new ResizeObserver(s=>{const{width:i,height:r}=s[0].contentRect;this.width=i,this.height=r,this.emit("resize",i,r)});e.observe(this.container),t=()=>{e.unobserve(this.container)}}else{const e="orientationchange"in window?"orientationchange":"resize",s=i=>{const r=i.target.innerWidth,a=i.target.innerHeight;this.emit("resize",r,a)};window.addEventListener(e,s,!1),t=()=>{window.removeEventListener(e,s,!1)}}return this.addRemoves(t),t}registerElementDisplayInParent(t){const e={threshold:t?.threshold||.5,root:t?.parentElement},s=new IntersectionObserver((r,a)=>{let o=r[0];if(r.length>1){const c=r.find(l=>l.isIntersecting);c&&(o=c)}o.isIntersecting&&o.intersectionRatio>=e.threshold?this.emit("showInParent"):this.emit("showOffParent")},e);s.observe(this.container);const i=()=>{s.unobserve(this.container)};return this.addRemoves(i),i}registerPullDownRefresh(t){const e=t?.distance||50;return this.captureDrag({move:(s,i)=>{i.dStartY>0&&i.dStartY<e&&this.emit("pullDowning",i.dStartY)},end:(s,i)=>{i.dStartY>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;return this.captureDrag({move:(s,i)=>{i.dStartY>0&&i.dStartY<e&&this.emit("pullUping",i.dStartY)},end:(s,i)=>{i.dStartY>=e&&this.emit("pullUp")}})}setMousePoint(t){this.mousePoint.x=t.x,this.mousePoint.y=t.y,this.mousePoint.dx=typeof t.dx=="number"?t.dx:0,this.mousePoint.dy=typeof t.dy=="number"?t.dy:0,this.mousePoint.dStartX=typeof t.dStartX=="number"?t.dStartX:0,this.mousePoint.dStartY=typeof t.dStartY=="number"?t.dStartY:0}captureDrag(t){return this.captureDragUsePointer(t)}captureDragUsePointer(t){let e,s;const i=h=>{h.preventDefault(),h.stopPropagation(),this.on("pointerMove",a),this.on("pointerUp",r),this.on("pointerCancel",r),s=Tt(h,this.container);const c={...s};e=c,this.setMousePoint(c),t?.start?.(h,c)},r=h=>{h.preventDefault(),h.stopPropagation(),this.off("pointerMove",a),this.off("pointerUp",r),this.off("pointerCancel",r),s=Tt(h,this.container);const c={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(c),t?.end?.(h,c),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c={...s};s=Tt(h,this.container);const l={...s,dx:s.x-(c.x||0),dy:s.y-(c.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.move?.(h,l)};this.on("pointerDown",i);const o=()=>{this.off("pointerDown",i)};return this.addRemoves(o),o}captureDragUseMouse(t){let e,s;const i=h=>{h.preventDefault(),h.stopPropagation(),document.addEventListener("mousemove",a,!1),document.addEventListener("mouseup",r,!1),s=Tt(h,this.container);const c={...s};e=c,this.setMousePoint(c),t?.start?.(h,c)},r=h=>{h.preventDefault(),h.stopPropagation(),document.removeEventListener("mousemove",a,!1),document.removeEventListener("mouseup",r,!1),s=Tt(h,this.container);const c={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(c),t?.end?.(h,c),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c={...s};s=Tt(h,this.container);const l={...s,dx:s.x-(c.x||0),dy:s.y-(c.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.move?.(h,l)};this.on("mouseDown",i);const o=()=>{this.off("mouseDown",i)};return this.addRemoves(o),o}captureDragUseTouch(t){let e,s;const i=h=>{h.preventDefault(),h.stopPropagation(),this.on("touchMove",a),this.on("touchEnd",r),this.on("touchCancel",r);const c=h.changedTouches[0];s=Tt(c,this.container);const l={...s};e=l,this.setMousePoint(l),t?.start?.(c,l)},r=h=>{h.preventDefault(),h.stopPropagation(),this.off("touchMove",a),this.off("touchEnd",r),this.off("touchCancel",r);const c=h.changedTouches[0];s=Tt(c,this.container);const l={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.end?.(c,l),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c=h.changedTouches[0],l={...s};s=Tt(c,this.container);const d={...s,dx:s.x-(l.x||0),dy:s.y-(l.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(d),t?.move?.(c,d)};this.on("touchStart",i);const o=()=>{this.off("touchStart",i)};return this.addRemoves(o),o}}const nt=new tr(document.documentElement,!0,[()=>lh("(prefers-color-scheme: dark)"),uh,fh,dh]);nt.registerKeyDown({title:"打开",key:"o",ctrl:!0,exact:!0},()=>{vn().then(n=>es(n[0])).then(n=>{nt.emit("openFile",n)}).catch(n=>{nt.emit("openFileError",n)})});function lh(n){let t="";switch(n){case"(prefers-color-scheme: dark)":t="matchMediaChangePrefersColorSchemeDark";break;default:t=n;break}const e=s=>{nt.emit(t,s.matches)};return window.matchMedia(n).addEventListener("change",e,!1),()=>{window.matchMedia(n).removeEventListener("change",e,!1)}}function uh(){let n="";const t=new MutationObserver(i=>{location.href!==n&&(n=location.href,nt.emit("urlchange",location.href))});t.observe(document,{attributes:!0,childList:!0,subtree:!0});const e=()=>{nt.emit("hashchange",location.hash)};window.addEventListener("hashchange",e,!1);const s=()=>{nt.emit("popstate")};return window.addEventListener("popstate",s,!1),()=>{t.disconnect(),window.removeEventListener("hashchange",e,!1),window.removeEventListener("popstate",s,!1)}}function dh(){const n=r=>{nt.emit("beforeunload",r)};window.addEventListener("beforeunload",n,!1);const t=r=>{nt.emit("pagehide",r)};window.addEventListener("pagehide",t,!1);const e=r=>{nt.emit("windowFocus",r)};window.addEventListener("focus",e,!1);const s=r=>{nt.emit("windowBlur",r)};window.addEventListener("blur",s,!1);const i=r=>{document.hidden?nt.emit("windowVisibilityChangeHide",r):nt.emit("windowVisibilityChangeShow",r)};return document.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("beforeunload",n,!1),window.removeEventListener("pagehide",t,!1),window.removeEventListener("focus",e,!1),window.removeEventListener("blur",s,!1),document.removeEventListener("visibilitychange",i,!1)}}function fh(){const n=t=>{nt.emit("scroll",t)};return document.addEventListener("scroll",n,!1),()=>{document.removeEventListener("scroll",n,!1)}}const mh=n=>{let t=!1;function e(){if(document.readyState!=="loading"){if(t){document.removeEventListener("DOMContentLoaded",e,!1);return}t=!0,document.removeEventListener("DOMContentLoaded",e,!1),n()}}document.addEventListener("DOMContentLoaded",e,!1),e()};class Le{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"),s=document.createElement("video"),i=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),i.src=URL.createObjectURL(r),i.media="(min-width:10px)",s.append(i),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(s),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(()=>{Le.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 er extends js{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Da(this.source);if(t===0){this.emit("finish");return}let e,s,i=rn(this.source,0);for(let r=1;r<t;r++)e=s,s=i,i=rn(this.source,r),this.raw+=s,s&&this.step(s,i,e);i&&this.step(i,void 0,s),this.emit("finish")}step(t,e,s){t==`
|
|
25
|
-
`&&this.emit("newline"),this.act(t,e,s)}act(t,e,s){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":Nt("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(s=="!"&&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(s=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,s)),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=="-"&&s=="-"&&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(!Nt("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,s)}break;case"close tag name start":Nt("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,s));break;case"close tag name":if(Nt("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(Nt("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":Nt("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,s));break;case"attr":if(Nt("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(!Nt("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,s)}break;case"attr value":if(Nt("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&&s!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function gi(n,t,e){if(typeof t<"u")window.localStorage.setItem(n,JSON.stringify({value:t,expires:typeof e=="number"?e:-1}));else{const s=window.localStorage.getItem(n);try{const i=JSON.parse(s||"");return"expires"in i&&parseInt(i.expires)>=0&&new Date().getTime()>parseInt(i.expires)?void 0:i.value||void 0}catch{return s||void 0}}}function ph(n,t,e){const s=new Date;s.setTime(s.getTime()+e*24*60*60*1e3);const i="expires="+s.toUTCString();document.cookie=n+"="+t+"; "+i}function gh(n){const t=n+"=",e=document.cookie.split(";");for(let s=0,i=e.length;s<i;s++){const r=e[s].trim();if(r.indexOf(t)==0)return r.substring(t.length,r.length)}return""}const yh=()=>document.cookie.split(";").map(n=>n.split("=")).reduce((n,[t,e])=>(n[t.trim().replace('"',"")]=e,n),{}),wh=()=>document.cookie.split(";").forEach(n=>document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));nt.on("matchMediaChangePrefersColorSchemeDark",n=>{gs(n?"dark":"light")}),sr();function gs(n){gi("ColorScheme",n),document.documentElement.classList.toggle("dark",n=="dark")}function sr(){const n=gi("ColorScheme");if(n=="dark"||n=="light")return gs(n),n;{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return gs(t),t}}const yi={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",fontSize22:A.getCSSVar("--font-size-22")||"22px",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",fontSize10:A.getCSSVar("--font-size-10")||"10px",d4:A.getCSSVar("--distance-4")||"4px",d8:A.getCSSVar("--distance-8")||"8px",d12:A.getCSSVar("--distance-12")||"12px",d16:A.getCSSVar("--distance-16")||"16px",d20:A.getCSSVar("--distance-20")||"20px",d32:A.getCSSVar("--distance-32")||"32px",d40:A.getCSSVar("--distance-40")||"40px",d44:A.getCSSVar("--distance-44")||"44px"};class lt{__color={r:0,g:0,b:0,a:1};constructor(t,e){t&&this.setColor(t),typeof e=="number"&&this.setAlpha(e)}get color(){return this.__color}set color(t){this.__color=wi(t)}setColor(t){return this.color=t,this}get r(){return this.__color.r}set r(t){this.__color.r=V(Math.round(t),0,255)}get g(){return this.__color.g}set g(t){this.__color.g=V(Math.round(t),0,255)}get b(){return this.__color.b}set b(t){this.__color.b=V(Math.round(t),0,255)}get a(){return this.__color.a}set a(t){this.__color.a=V(t,0,1)}setAlpha(t){return this.a=t,this}setRGB(t,e,s){return this.r=t,this.g=e,this.b=s,this}setRGBA(t,e,s,i){return this.r=t,this.g=e,this.b=s,this.a=i,this}get hex(){return(this.r<<16)+(this.g<<8)+this.b}toString(){if(this.a===1){const t="000000"+this.hex.toString(16);return"#"+t.slice(t.length-6)}else return`rgba(${this.r},${this.g},${this.b},${At(this.a,6)})`}clone(){return new lt(this.color)}copy(t){this.setColor(t.color)}opposite(t=!1,e="#000000",s="#ffffff"){if(t)return new lt(this.r*.299+this.g*.587+this.b*.114>186?e:s);{const i=this.clone();return i.r=255-i.r,i.g=255-i.g,i.b=255-i.b,i}}lighten(t){t=V(Math.abs(t),0,1);let{r:e,g:s,b:i,a:r}=this.color;return e+=(255-e)*t,s+=(255-s)*t,i+=(255-i)*t,new lt().setRGBA(e,s,i,r)}darken(t){t=V(Math.abs(t),0,1);let{r:e,g:s,b:i,a:r}=this.color;return e=e*(1-t),s=s*(1-t),i=i*(1-t),new lt().setRGBA(e,s,i,r)}static gradient(t,e,s){try{const i=wi(t),r=wi(e);return new lt().setRGB((r.r-i.r)*s+i.r,(r.g-i.g)*s+i.g,(r.b-i.b)*s+i.b)}catch{return new lt(e)}}static random(){return new lt(Math.random()*16777215)}get hsv(){const{r:t,g:e,b:s,a:i}=this.color,r=Math.max(t,e,s),a=Math.min(t,e,s),o=r-a;let h;return t===r?h=(e-s)/o:e===r?h=2+(s-t)/o:h=4+(t-e)/o,h/=6,h<0&&(h+=1),{h:o==0?0:h*360,s:r===0?0:o/r,v:r/255,a:i}}set h(t){const e=this.hsv;e.h=V(t,0,360),this.setColor(e)}get h(){return this.hsv.h}set s(t){const e=this.hsv;e.s=V(t,0,1),this.setColor(e)}get s(){return this.hsv.s}set v(t){const e=this.hsv;e.v=V(t,0,1),this.setColor(e)}get v(){return this.hsv.v}}function Re(n,t){return new lt(n,t)}function wi(n){const t=Object.prototype.hasOwnProperty.call(n,"a")?V(n.a,0,1):1;if(Object.prototype.hasOwnProperty.call(n,"r")&&Object.prototype.hasOwnProperty.call(n,"g")&&Object.prototype.hasOwnProperty.call(n,"b"))return n.r=V(Math.round(n.r),0,255),n.g=V(Math.round(n.g),0,255),n.b=V(Math.round(n.b),0,255),n.a=t,n;if(Object.prototype.hasOwnProperty.call(n,"h")&&Object.prototype.hasOwnProperty.call(n,"s")&&Object.prototype.hasOwnProperty.call(n,"v")){let s=V(n.h,0,360),i=V(n.s,0,1),r=V(n.v,0,1);const a=Math.floor(s/60)%6,o=s/60-Math.floor(s/60),h=r*(1-i),c=r*(1-o*i),l=r*(1-(1-o)*i),d=[[r,l,h],[c,r,h],[h,r,l],[h,c,r],[l,h,r],[r,h,c]][a];return{r:Math.round(d[0]*255),g:Math.round(d[1]*255),b:Math.round(d[2]*255),a:t}}const e={r:0,g:0,b:0,a:t};if(typeof n=="number")n<Math.pow(2,24)?(e.r=n>>16&255,e.g=n>>8&255,e.b=n&255):(e.r=n>>24&255,e.g=n>>16&255,e.b=n>>8&255,e.a=(n&255)/255);else if(typeof n=="string"){const s=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?\s*(\d?\.?\d*)?\s*\)/gi.exec(n);if(s)e.r=parseInt(s[1]),e.g=parseInt(s[2]),e.b=parseInt(s[3]),s[4]&&(e.a=parseFloat(s[4]));else{let i=n.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);i?(e.r=parseInt(`${i[1]}${i[1]}`,16),e.g=parseInt(`${i[2]}${i[2]}`,16),e.b=parseInt(`${i[3]}${i[3]}`,16)):(i=n.match(/^#([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})$/i),i?(e.r=parseInt(i[1],16),e.g=parseInt(i[2],16),e.b=parseInt(i[3],16)):(i=n.match(/^#([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})$/i),i?(e.r=parseInt(i[1],16),e.g=parseInt(i[2],16),e.b=parseInt(i[3],16),e.a=parseInt(i[4],16)/255):n==="none"&&(e.a=0)))}}else throw new Error("parseColor 不支持的颜色解析:"+n);return e.r=V(e.r,0,255),e.g=V(e.g,0,255),e.b=V(e.b,0,255),e.a=V(e.a,0,1),e}const ir=["#0ac2d2","#7bb7fa","#60d7a9","#fdc162","#fd6a62","#f68dbb","#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff","#dc4916","#6871b1","#d1b935","#1bbc9b","#FF7F50","#4BBFC3","#ff9900"],he={backgroundColor:"#1a1a1a",numberColor:"#2FA1D6",booleanColor:"#806787",stringColor:"#1ed36f",functionColor:"#e61d5f",saveRowColor:"#dad5cb",buttonColor:"",borderColor:"",inputColor:""};he.buttonColor=new lt(he.saveRowColor).darken(.1).toString(),he.borderColor=new lt(he.backgroundColor).lighten(.07).toString(),he.inputColor=new lt(he.backgroundColor).lighten(.085).toString();function ys(n=window.location.href){return dn(URL)?new URL(n):nr(n)}function nr(n=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",s="(?<pathname>(?:\\/[^/#?]+)*\\/?)",i="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${s}${i}${r}$`).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 xh(n){const t=ys(n);return t.protocol==="http:"||t.protocol==="https:"}function rr(n=window.location.href){const t=ys(n),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function bh(n=ys().search){n=decodeURIComponent(n).replace(/^[#?&]/,"");const t={};if(!n)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let s=e.exec(n);for(;s;)t[s[1]]=s[2],s=e.exec(n);return t}function ws(n){return"?"+Object.entries(n).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function ar(n){return"?"+[...n.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function or(n,t){return n.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function vh(n,t){return or(n,ws(t))}function xi(n,t){return n+t.replace(/^[&?]/,n.indexOf("?")>=0?"&":"?")}function Sh(n,t){return xi(n,ws(t))}class Ch{worker;cbs={};constructor(t){if(Mn)try{this.worker=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){throw typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),e}else throw new Error("Your environment do not support Worker !")}postMessage(t,e=[]){this.worker.postMessage(t,e)}onmessage(t){this.worker.addEventListener("message",t)}offmessage(t){this.worker.removeEventListener("message",t)}onmessageerror(t){this.worker.addEventListener("messageerror",t)}offmessageerror(t){this.worker.removeEventListener("messageerror",t)}postCanvas(t){const e=t.transferControlToOffscreen();this.worker.postMessage({canvas:e},[e])}postPort(t){this.worker.postMessage({port:t},[t])}postReset(){this.worker.postMessage({reset:!0});for(const t in this.cbs)this.cbs[t](),delete this.cbs[t]}fire(t,e){return new Promise(s=>{if(e){const i=Math.random().toString(36).slice(2),r=a=>{a.data.id===i&&(this.worker.removeEventListener("message",r),delete this.cbs[i],e(),s())};this.cbs[i]=r.bind(this,{data:{id:i}}),this.worker.addEventListener("message",r),this.worker.postMessage({...t,id:i})}else this.worker.postMessage(t),s()})}}class Eh{port1;port2;port1MessageCbs=[];port2MessageCbs=[];port1MessageErrorCbs=[];port2MessageErrorCbs=[];constructor(){const{port1:t,port2:e}=new MessageChannel;this.port1=t,this.port2=e,this.port1.addEventListener("message",s=>{this.port1MessageCbs.forEach(i=>i(this.port1,s))}),this.port1.addEventListener("messageerror",s=>{this.port1MessageErrorCbs.forEach(i=>i(this.port1,s))}),this.port1.start(),this.port2.addEventListener("message",s=>{this.port2MessageCbs.forEach(i=>i(this.port2,s))}),this.port2.addEventListener("messageerror",s=>{this.port2MessageErrorCbs.forEach(i=>i(this.port2,s))}),this.port2.start()}close(){this.port1.close(),this.port2.close()}onPort1Message(t){this.port1MessageCbs.push(t)}onPort1MessageError(t){this.port1MessageErrorCbs.push(t)}offPort1Message(t){Ce(this.port1MessageCbs,t)}offPort1MessageError(t){Ce(this.port1MessageErrorCbs,t)}onPort2Message(t){this.port2MessageCbs.push(t)}onPort2MessageError(t){this.port2MessageErrorCbs.push(t)}offPort2Message(t){Ce(this.port2MessageCbs,t)}offPort2MessageError(t){Ce(this.port2MessageErrorCbs,t)}}function hr(){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,s=t.length;e<s;e++)try{n=new window.ActiveXObject(t[e]);break}catch{continue}}else n=new XMLHttpRequest;return n}function Th(n,t){return new Promise((e,s)=>{const{method:i="GET",data:r={},multipartFormDataString:a="",boundary:o="",headers:h={},withCredentials:c=!1,responseType:l="json",timeout:d=3e4}=t||{},g=hr();g.timeout=d,g.responseType=l,g.onreadystatechange=function(C){g.readyState===4&&(g.status===200?e(g.response):s(g.statusText))},g.ontimeout=function(){s(`${n} is timed out for ${d}ms.`)},g.addEventListener("error",function(C){s(C)},!1),g.addEventListener("progress",function(C){if(C.lengthComputable){const L=Math.round(C.loaded*100/C.total);t?.progress?.(L,g)}},!1),g.addEventListener("load",function(C){t?.load?.(C,g)},!1),g.addEventListener("loadstart",function(C){t?.loadstart?.(C,g)},!1),g.addEventListener("loadend",function(C){t?.loadend?.(C,g)},!1),g.addEventListener("abort",function(C){t?.abort?.(C,g)},!1);const y=i.toUpperCase();Object.assign(h,{Accept:"*/*"});let m=!1,x=!1,b=!1;function S(){c&&(g.withCredentials=!0);for(const C in h)ft(C).toLowerCase()=="content-type"&&h[C].toLowerCase()=="multipart/form-data"?(m=!0,g.setRequestHeader("Content-Type","multipart/form-data; boundary="+o)):(ft(C).toLowerCase()=="content-type"&&(h[C].toLowerCase().indexOf("text/plain")>=0?x=!0:h[C].toLowerCase().indexOf("application/json")>=0&&(b=!0)),g.setRequestHeader(C,h[C]))}switch(y){case"GET":let C="";r instanceof FormData?C=ar(r):C=ws(r),g.open("GET",xi(n,C),!0),S(),g.send(null);break;default:g.open(y,n,!0),S(),m?g.sendAsBinary(a):b?g.send(JSON.stringify(r)):x?g.send(Object.entries(r).map(([L,R])=>`${L}=${R}`).join(`\r
|
|
26
|
-
`)):
|
|
27
|
-
Content-Type: `+
|
|
22
|
+
* Licensed under the MIT license */(function(n){(function(t,e,s,i){var r=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),o="function",h=Math.round,c=Math.abs,l=Date.now;function d(u,f,S){return setTimeout(y(u,S),f)}function w(u,f,S){return Array.isArray(u)?(b(u,S[f],S),!0):!1}function b(u,f,S){var A;if(u)if(u.forEach)u.forEach(f,S);else if(u.length!==i)for(A=0;A<u.length;)f.call(S,u[A],A,u),A++;else for(A in u)u.hasOwnProperty(A)&&f.call(S,u[A],A,u)}function m(u,f,S){var A="DEPRECATED METHOD: "+f+`
|
|
23
|
+
`+S+` AT
|
|
24
|
+
`;return function(){var I=new Error("get-stack-trace"),O=I&&I.stack?I.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",X=t.console&&(t.console.warn||t.console.log);return X&&X.call(t.console,A,O),u.apply(this,arguments)}}var P;typeof Object.assign!="function"?P=function(f){if(f===i||f===null)throw new TypeError("Cannot convert undefined or null to object");for(var S=Object(f),A=1;A<arguments.length;A++){var I=arguments[A];if(I!==i&&I!==null)for(var O in I)I.hasOwnProperty(O)&&(S[O]=I[O])}return S}:P=Object.assign;var _=m(function(f,S,A){for(var I=Object.keys(S),O=0;O<I.length;)(!A||A&&f[I[O]]===i)&&(f[I[O]]=S[I[O]]),O++;return f},"extend","Use `assign`."),v=m(function(f,S){return _(f,S,!0)},"merge","Use `assign`.");function x(u,f,S){var A=f.prototype,I;I=u.prototype=Object.create(A),I.constructor=u,I._super=A,S&&P(I,S)}function y(u,f){return function(){return u.apply(f,arguments)}}function p(u,f){return typeof u==o?u.apply(f&&f[0]||i,f):u}function E(u,f){return u===i?f:u}function C(u,f,S){b(W(f),function(A){u.addEventListener(A,S,!1)})}function B(u,f,S){b(W(f),function(A){u.removeEventListener(A,S,!1)})}function q(u,f){for(;u;){if(u==f)return!0;u=u.parentNode}return!1}function V(u,f){return u.indexOf(f)>-1}function W(u){return u.trim().split(/\s+/g)}function J(u,f,S){if(u.indexOf&&!S)return u.indexOf(f);for(var A=0;A<u.length;){if(S&&u[A][S]==f||!S&&u[A]===f)return A;A++}return-1}function ot(u){return Array.prototype.slice.call(u,0)}function St(u,f,S){for(var A=[],I=[],O=0;O<u.length;){var X=f?u[O][f]:u[O];J(I,X)<0&&A.push(u[O]),I[O]=X,O++}return S&&(f?A=A.sort(function(st,dt){return st[f]>dt[f]}):A=A.sort()),A}function gt(u,f){for(var S,A,I=f[0].toUpperCase()+f.slice(1),O=0;O<r.length;){if(S=r[O],A=S?S+I:f,A in u)return A;O++}return i}var xe=1;function ne(){return xe++}function le(u){var f=u.ownerDocument||u;return f.defaultView||f.parentWindow||t}var be=/mobile|tablet|ip(ad|hone|od)|android/i,F="ontouchstart"in t,k=gt(t,"PointerEvent")!==i,Y=F&&be.test(navigator.userAgent),G="touch",ut="pen",At="mouse",ks="kinect",Ls=25,tt=1,Rt=2,$=4,M=8,Rs=1,ze=2,qe=4,He=8,je=16,Ot=ze|qe,ue=He|je,da=Ot|ue,fa=["x","y"],Os=["clientX","clientY"];function Ct(u,f){var S=this;this.manager=u,this.callback=f,this.element=u.element,this.target=u.options.inputTarget,this.domHandler=function(A){p(u.options.enable,[u])&&S.handler(A)},this.init()}Ct.prototype={handler:function(){},init:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(le(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(le(this.element),this.evWin,this.domHandler)}};function Wu(u){var f,S=u.options.inputClass;return S?f=S:k?f=Hi:Y?f=Bs:F?f=ji:f=Ns,new f(u,Ju)}function Ju(u,f,S){var A=S.pointers.length,I=S.changedPointers.length,O=f&tt&&A-I===0,X=f&($|M)&&A-I===0;S.isFirst=!!O,S.isFinal=!!X,O&&(u.session={}),S.eventType=f,Zu(u,S),u.emit("hammer.input",S),u.recognize(S),u.session.prevInput=S}function Zu(u,f){var S=u.session,A=f.pointers,I=A.length;S.firstInput||(S.firstInput=ma(f)),I>1&&!S.firstMultiple?S.firstMultiple=ma(f):I===1&&(S.firstMultiple=!1);var O=S.firstInput,X=S.firstMultiple,et=X?X.center:O.center,st=f.center=pa(A);f.timeStamp=l(),f.deltaTime=f.timeStamp-O.timeStamp,f.angle=qi(et,st),f.distance=Fs(et,st),Ku(S,f),f.offsetDirection=ya(f.deltaX,f.deltaY);var dt=ga(f.deltaTime,f.deltaX,f.deltaY);f.overallVelocityX=dt.x,f.overallVelocityY=dt.y,f.overallVelocity=c(dt.x)>c(dt.y)?dt.x:dt.y,f.scale=X?ed(X.pointers,A):1,f.rotation=X?td(X.pointers,A):0,f.maxPointers=S.prevInput?f.pointers.length>S.prevInput.maxPointers?f.pointers.length:S.prevInput.maxPointers:f.pointers.length,Qu(S,f);var Nt=u.element;q(f.srcEvent.target,Nt)&&(Nt=f.srcEvent.target),f.target=Nt}function Ku(u,f){var S=f.center,A=u.offsetDelta||{},I=u.prevDelta||{},O=u.prevInput||{};(f.eventType===tt||O.eventType===$)&&(I=u.prevDelta={x:O.deltaX||0,y:O.deltaY||0},A=u.offsetDelta={x:S.x,y:S.y}),f.deltaX=I.x+(S.x-A.x),f.deltaY=I.y+(S.y-A.y)}function Qu(u,f){var S=u.lastInterval||f,A=f.timeStamp-S.timeStamp,I,O,X,et;if(f.eventType!=M&&(A>Ls||S.velocity===i)){var st=f.deltaX-S.deltaX,dt=f.deltaY-S.deltaY,Nt=ga(A,st,dt);O=Nt.x,X=Nt.y,I=c(Nt.x)>c(Nt.y)?Nt.x:Nt.y,et=ya(st,dt),u.lastInterval=f}else I=S.velocity,O=S.velocityX,X=S.velocityY,et=S.direction;f.velocity=I,f.velocityX=O,f.velocityY=X,f.direction=et}function ma(u){for(var f=[],S=0;S<u.pointers.length;)f[S]={clientX:h(u.pointers[S].clientX),clientY:h(u.pointers[S].clientY)},S++;return{timeStamp:l(),pointers:f,center:pa(f),deltaX:u.deltaX,deltaY:u.deltaY}}function pa(u){var f=u.length;if(f===1)return{x:h(u[0].clientX),y:h(u[0].clientY)};for(var S=0,A=0,I=0;I<f;)S+=u[I].clientX,A+=u[I].clientY,I++;return{x:h(S/f),y:h(A/f)}}function ga(u,f,S){return{x:f/u||0,y:S/u||0}}function ya(u,f){return u===f?Rs:c(u)>=c(f)?u<0?ze:qe:f<0?He:je}function Fs(u,f,S){S||(S=fa);var A=f[S[0]]-u[S[0]],I=f[S[1]]-u[S[1]];return Math.sqrt(A*A+I*I)}function qi(u,f,S){S||(S=fa);var A=f[S[0]]-u[S[0]],I=f[S[1]]-u[S[1]];return Math.atan2(I,A)*180/Math.PI}function td(u,f){return qi(f[1],f[0],Os)+qi(u[1],u[0],Os)}function ed(u,f){return Fs(f[0],f[1],Os)/Fs(u[0],u[1],Os)}var sd={mousedown:tt,mousemove:Rt,mouseup:$},id="mousedown",nd="mousemove mouseup";function Ns(){this.evEl=id,this.evWin=nd,this.pressed=!1,Ct.apply(this,arguments)}x(Ns,Ct,{handler:function(f){var S=sd[f.type];S&tt&&f.button===0&&(this.pressed=!0),S&Rt&&f.which!==1&&(S=$),this.pressed&&(S&$&&(this.pressed=!1),this.callback(this.manager,S,{pointers:[f],changedPointers:[f],pointerType:At,srcEvent:f}))}});var rd={pointerdown:tt,pointermove:Rt,pointerup:$,pointercancel:M,pointerout:M},ad={2:G,3:ut,4:At,5:ks},wa="pointerdown",xa="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(wa="MSPointerDown",xa="MSPointerMove MSPointerUp MSPointerCancel");function Hi(){this.evEl=wa,this.evWin=xa,Ct.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}x(Hi,Ct,{handler:function(f){var S=this.store,A=!1,I=f.type.toLowerCase().replace("ms",""),O=rd[I],X=ad[f.pointerType]||f.pointerType,et=X==G,st=J(S,f.pointerId,"pointerId");O&tt&&(f.button===0||et)?st<0&&(S.push(f),st=S.length-1):O&($|M)&&(A=!0),!(st<0)&&(S[st]=f,this.callback(this.manager,O,{pointers:S,changedPointers:[f],pointerType:X,srcEvent:f}),A&&S.splice(st,1))}});var od={touchstart:tt,touchmove:Rt,touchend:$,touchcancel:M},hd="touchstart",cd="touchstart touchmove touchend touchcancel";function ba(){this.evTarget=hd,this.evWin=cd,this.started=!1,Ct.apply(this,arguments)}x(ba,Ct,{handler:function(f){var S=od[f.type];if(S===tt&&(this.started=!0),!!this.started){var A=ld.call(this,f,S);S&($|M)&&A[0].length-A[1].length===0&&(this.started=!1),this.callback(this.manager,S,{pointers:A[0],changedPointers:A[1],pointerType:G,srcEvent:f})}}});function ld(u,f){var S=ot(u.touches),A=ot(u.changedTouches);return f&($|M)&&(S=St(S.concat(A),"identifier",!0)),[S,A]}var ud={touchstart:tt,touchmove:Rt,touchend:$,touchcancel:M},dd="touchstart touchmove touchend touchcancel";function Bs(){this.evTarget=dd,this.targetIds={},Ct.apply(this,arguments)}x(Bs,Ct,{handler:function(f){var S=ud[f.type],A=fd.call(this,f,S);A&&this.callback(this.manager,S,{pointers:A[0],changedPointers:A[1],pointerType:G,srcEvent:f})}});function fd(u,f){var S=ot(u.touches),A=this.targetIds;if(f&(tt|Rt)&&S.length===1)return A[S[0].identifier]=!0,[S,S];var I,O,X=ot(u.changedTouches),et=[],st=this.target;if(O=S.filter(function(dt){return q(dt.target,st)}),f===tt)for(I=0;I<O.length;)A[O[I].identifier]=!0,I++;for(I=0;I<X.length;)A[X[I].identifier]&&et.push(X[I]),f&($|M)&&delete A[X[I].identifier],I++;if(et.length)return[St(O.concat(et),"identifier",!0),et]}var md=2500,va=25;function ji(){Ct.apply(this,arguments);var u=y(this.handler,this);this.touch=new Bs(this.manager,u),this.mouse=new Ns(this.manager,u),this.primaryTouch=null,this.lastTouches=[]}x(ji,Ct,{handler:function(f,S,A){var I=A.pointerType==G,O=A.pointerType==At;if(!(O&&A.sourceCapabilities&&A.sourceCapabilities.firesTouchEvents)){if(I)pd.call(this,S,A);else if(O&&gd.call(this,A))return;this.callback(f,S,A)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function pd(u,f){u&tt?(this.primaryTouch=f.changedPointers[0].identifier,Sa.call(this,f)):u&($|M)&&Sa.call(this,f)}function Sa(u){var f=u.changedPointers[0];if(f.identifier===this.primaryTouch){var S={x:f.clientX,y:f.clientY};this.lastTouches.push(S);var A=this.lastTouches,I=function(){var O=A.indexOf(S);O>-1&&A.splice(O,1)};setTimeout(I,md)}}function gd(u){for(var f=u.srcEvent.clientX,S=u.srcEvent.clientY,A=0;A<this.lastTouches.length;A++){var I=this.lastTouches[A],O=Math.abs(f-I.x),X=Math.abs(S-I.y);if(O<=va&&X<=va)return!0}return!1}var Ca=gt(a.style,"touchAction"),Ea=Ca!==i,Ta="compute",Pa="auto",$i="manipulation",de="none",$e="pan-x",We="pan-y",Ys=wd();function Wi(u,f){this.manager=u,this.set(f)}Wi.prototype={set:function(u){u==Ta&&(u=this.compute()),Ea&&this.manager.element.style&&Ys[u]&&(this.manager.element.style[Ca]=u),this.actions=u.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var u=[];return b(this.manager.recognizers,function(f){p(f.options.enable,[f])&&(u=u.concat(f.getTouchAction()))}),yd(u.join(" "))},preventDefaults:function(u){var f=u.srcEvent,S=u.offsetDirection;if(this.manager.session.prevented){f.preventDefault();return}var A=this.actions,I=V(A,de)&&!Ys[de],O=V(A,We)&&!Ys[We],X=V(A,$e)&&!Ys[$e];if(I){var et=u.pointers.length===1,st=u.distance<2,dt=u.deltaTime<250;if(et&&st&&dt)return}if(!(X&&O)&&(I||O&&S&Ot||X&&S&ue))return this.preventSrc(f)},preventSrc:function(u){this.manager.session.prevented=!0,u.preventDefault()}};function yd(u){if(V(u,de))return de;var f=V(u,$e),S=V(u,We);return f&&S?de:f||S?f?$e:We:V(u,$i)?$i:Pa}function wd(){if(!Ea)return!1;var u={},f=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(S){u[S]=f?t.CSS.supports("touch-action",S):!0}),u}var Xs=1,Et=2,ve=4,re=8,Ht=re,Je=16,Ft=32;function jt(u){this.options=P({},this.defaults,u||{}),this.id=ne(),this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=Xs,this.simultaneous={},this.requireFail=[]}jt.prototype={defaults:{},set:function(u){return P(this.options,u),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(u){if(w(u,"recognizeWith",this))return this;var f=this.simultaneous;return u=Us(u,this),f[u.id]||(f[u.id]=u,u.recognizeWith(this)),this},dropRecognizeWith:function(u){return w(u,"dropRecognizeWith",this)?this:(u=Us(u,this),delete this.simultaneous[u.id],this)},requireFailure:function(u){if(w(u,"requireFailure",this))return this;var f=this.requireFail;return u=Us(u,this),J(f,u)===-1&&(f.push(u),u.requireFailure(this)),this},dropRequireFailure:function(u){if(w(u,"dropRequireFailure",this))return this;u=Us(u,this);var f=J(this.requireFail,u);return f>-1&&this.requireFail.splice(f,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(u){return!!this.simultaneous[u.id]},emit:function(u){var f=this,S=this.state;function A(I){f.manager.emit(I,u)}S<re&&A(f.options.event+_a(S)),A(f.options.event),u.additionalEvent&&A(u.additionalEvent),S>=re&&A(f.options.event+_a(S))},tryEmit:function(u){if(this.canEmit())return this.emit(u);this.state=Ft},canEmit:function(){for(var u=0;u<this.requireFail.length;){if(!(this.requireFail[u].state&(Ft|Xs)))return!1;u++}return!0},recognize:function(u){var f=P({},u);if(!p(this.options.enable,[this,f])){this.reset(),this.state=Ft;return}this.state&(Ht|Je|Ft)&&(this.state=Xs),this.state=this.process(f),this.state&(Et|ve|re|Je)&&this.tryEmit(f)},process:function(u){},getTouchAction:function(){},reset:function(){}};function _a(u){return u&Je?"cancel":u&re?"end":u&ve?"move":u&Et?"start":""}function Aa(u){return u==je?"down":u==He?"up":u==ze?"left":u==qe?"right":""}function Us(u,f){var S=f.manager;return S?S.get(u):u}function Dt(){jt.apply(this,arguments)}x(Dt,jt,{defaults:{pointers:1},attrTest:function(u){var f=this.options.pointers;return f===0||u.pointers.length===f},process:function(u){var f=this.state,S=u.eventType,A=f&(Et|ve),I=this.attrTest(u);return A&&(S&M||!I)?f|Je:A||I?S&$?f|re:f&Et?f|ve:Et:Ft}});function Gs(){Dt.apply(this,arguments),this.pX=null,this.pY=null}x(Gs,Dt,{defaults:{event:"pan",threshold:10,pointers:1,direction:da},getTouchAction:function(){var u=this.options.direction,f=[];return u&Ot&&f.push(We),u&ue&&f.push($e),f},directionTest:function(u){var f=this.options,S=!0,A=u.distance,I=u.direction,O=u.deltaX,X=u.deltaY;return I&f.direction||(f.direction&Ot?(I=O===0?Rs:O<0?ze:qe,S=O!=this.pX,A=Math.abs(u.deltaX)):(I=X===0?Rs:X<0?He:je,S=X!=this.pY,A=Math.abs(u.deltaY))),u.direction=I,S&&A>f.threshold&&I&f.direction},attrTest:function(u){return Dt.prototype.attrTest.call(this,u)&&(this.state&Et||!(this.state&Et)&&this.directionTest(u))},emit:function(u){this.pX=u.deltaX,this.pY=u.deltaY;var f=Aa(u.direction);f&&(u.additionalEvent=this.options.event+f),this._super.emit.call(this,u)}});function Ji(){Dt.apply(this,arguments)}x(Ji,Dt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[de]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.scale-1)>this.options.threshold||this.state&Et)},emit:function(u){if(u.scale!==1){var f=u.scale<1?"in":"out";u.additionalEvent=this.options.event+f}this._super.emit.call(this,u)}});function Zi(){jt.apply(this,arguments),this._timer=null,this._input=null}x(Zi,jt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Pa]},process:function(u){var f=this.options,S=u.pointers.length===f.pointers,A=u.distance<f.threshold,I=u.deltaTime>f.time;if(this._input=u,!A||!S||u.eventType&($|M)&&!I)this.reset();else if(u.eventType&tt)this.reset(),this._timer=d(function(){this.state=Ht,this.tryEmit()},f.time,this);else if(u.eventType&$)return Ht;return Ft},reset:function(){clearTimeout(this._timer)},emit:function(u){this.state===Ht&&(u&&u.eventType&$?this.manager.emit(this.options.event+"up",u):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Ki(){Dt.apply(this,arguments)}x(Ki,Dt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[de]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.rotation)>this.options.threshold||this.state&Et)}});function Qi(){Dt.apply(this,arguments)}x(Qi,Dt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ot|ue,pointers:1},getTouchAction:function(){return Gs.prototype.getTouchAction.call(this)},attrTest:function(u){var f=this.options.direction,S;return f&(Ot|ue)?S=u.overallVelocity:f&Ot?S=u.overallVelocityX:f&ue&&(S=u.overallVelocityY),this._super.attrTest.call(this,u)&&f&u.offsetDirection&&u.distance>this.options.threshold&&u.maxPointers==this.options.pointers&&c(S)>this.options.velocity&&u.eventType&$},emit:function(u){var f=Aa(u.offsetDirection);f&&this.manager.emit(this.options.event+f,u),this.manager.emit(this.options.event,u)}});function Vs(){jt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}x(Vs,jt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[$i]},process:function(u){var f=this.options,S=u.pointers.length===f.pointers,A=u.distance<f.threshold,I=u.deltaTime<f.time;if(this.reset(),u.eventType&tt&&this.count===0)return this.failTimeout();if(A&&I&&S){if(u.eventType!=$)return this.failTimeout();var O=this.pTime?u.timeStamp-this.pTime<f.interval:!0,X=!this.pCenter||Fs(this.pCenter,u.center)<f.posThreshold;this.pTime=u.timeStamp,this.pCenter=u.center,!X||!O?this.count=1:this.count+=1,this._input=u;var et=this.count%f.taps;if(et===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=Ht,this.tryEmit()},f.interval,this),Et):Ht}return Ft},failTimeout:function(){return this._timer=d(function(){this.state=Ft},this.options.interval,this),Ft},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Ht&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function $t(u,f){return f=f||{},f.recognizers=E(f.recognizers,$t.defaults.preset),new tn(u,f)}$t.VERSION="2.0.7",$t.defaults={domEvents:!1,touchAction:Ta,enable:!0,inputTarget:null,inputClass:null,preset:[[Ki,{enable:!1}],[Ji,{enable:!1},["rotate"]],[Qi,{direction:Ot}],[Gs,{direction:Ot},["swipe"]],[Vs],[Vs,{event:"doubletap",taps:2},["tap"]],[Zi]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var xd=1,Da=2;function tn(u,f){this.options=P({},$t.defaults,f||{}),this.options.inputTarget=this.options.inputTarget||u,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=u,this.input=Wu(this),this.touchAction=new Wi(this,this.options.touchAction),Ma(this,!0),b(this.options.recognizers,function(S){var A=this.add(new S[0](S[1]));S[2]&&A.recognizeWith(S[2]),S[3]&&A.requireFailure(S[3])},this)}tn.prototype={set:function(u){return P(this.options,u),u.touchAction&&this.touchAction.update(),u.inputTarget&&(this.input.destroy(),this.input.target=u.inputTarget,this.input.init()),this},stop:function(u){this.session.stopped=u?Da:xd},recognize:function(u){var f=this.session;if(!f.stopped){this.touchAction.preventDefaults(u);var S,A=this.recognizers,I=f.curRecognizer;(!I||I&&I.state&Ht)&&(I=f.curRecognizer=null);for(var O=0;O<A.length;)S=A[O],f.stopped!==Da&&(!I||S==I||S.canRecognizeWith(I))?S.recognize(u):S.reset(),!I&&S.state&(Et|ve|re)&&(I=f.curRecognizer=S),O++}},get:function(u){if(u instanceof jt)return u;for(var f=this.recognizers,S=0;S<f.length;S++)if(f[S].options.event==u)return f[S];return null},add:function(u){if(w(u,"add",this))return this;var f=this.get(u.options.event);return f&&this.remove(f),this.recognizers.push(u),u.manager=this,this.touchAction.update(),u},remove:function(u){if(w(u,"remove",this))return this;if(u=this.get(u),u){var f=this.recognizers,S=J(f,u);S!==-1&&(f.splice(S,1),this.touchAction.update())}return this},on:function(u,f){if(u!==i&&f!==i){var S=this.handlers;return b(W(u),function(A){S[A]=S[A]||[],S[A].push(f)}),this}},off:function(u,f){if(u!==i){var S=this.handlers;return b(W(u),function(A){f?S[A]&&S[A].splice(J(S[A],f),1):delete S[A]}),this}},emit:function(u,f){this.options.domEvents&&bd(u,f);var S=this.handlers[u]&&this.handlers[u].slice();if(!(!S||!S.length)){f.type=u,f.preventDefault=function(){f.srcEvent.preventDefault()};for(var A=0;A<S.length;)S[A](f),A++}},destroy:function(){this.element&&Ma(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Ma(u,f){var S=u.element;if(S.style){var A;b(u.options.cssProps,function(I,O){A=gt(S.style,O),f?(u.oldCssProps[A]=S.style[A],S.style[A]=I):S.style[A]=u.oldCssProps[A]||""}),f||(u.oldCssProps={})}}function bd(u,f){var S=e.createEvent("Event");S.initEvent(u,!0,!0),S.gesture=f,f.target.dispatchEvent(S)}P($t,{INPUT_START:tt,INPUT_MOVE:Rt,INPUT_END:$,INPUT_CANCEL:M,STATE_POSSIBLE:Xs,STATE_BEGAN:Et,STATE_CHANGED:ve,STATE_ENDED:re,STATE_RECOGNIZED:Ht,STATE_CANCELLED:Je,STATE_FAILED:Ft,DIRECTION_NONE:Rs,DIRECTION_LEFT:ze,DIRECTION_RIGHT:qe,DIRECTION_UP:He,DIRECTION_DOWN:je,DIRECTION_HORIZONTAL:Ot,DIRECTION_VERTICAL:ue,DIRECTION_ALL:da,Manager:tn,Input:Ct,TouchAction:Wi,TouchInput:Bs,MouseInput:Ns,PointerEventInput:Hi,TouchMouseInput:ji,SingleTouchInput:ba,Recognizer:jt,AttrRecognizer:Dt,Tap:Vs,Pan:Gs,Swipe:Qi,Pinch:Ji,Rotate:Ki,Press:Zi,on:C,off:B,each:b,merge:v,extend:_,assign:P,inherit:x,bindFn:y,prefixed:gt});var vd=typeof t<"u"?t:typeof self<"u"?self:{};vd.Hammer=$t,typeof i=="function"&&i.amd?i(function(){return $t}):n.exports?n.exports=$t:t[s]=$t})(window,document,"Hammer")})(er);var fh=er.exports;const mh=bn(fh);class sr{constructor(){}static getFormatKeyNames(t){const e=ti(),s=[];return t.ctrl&&s.push(e?"Cmd":"Ctrl"),t.shift&&s.push("Shift"),t.alt&&s.push("Alt"),typeof t.key=="string"?s.push(qs(t.key)):Array.isArray(t.key)&&(t.key.map(i=>qs(i)),s.push(...t.key)),s}static matchKeyScheme(t,e){const s=t.ctrl??!1,i=t.shift??!1,r=t.alt??!1;if(t.exact)return(s===e.metaKey||s===e.ctrlKey)&&i===e.shiftKey&&r===e.altKey;const a=[];return s&&a.push(s===e.metaKey||s===e.ctrlKey),i&&a.push(i===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 s=t?.target??window;let i=!1;const r=this.getFormatKeyNames(t),a=o=>{if(o.stopPropagation(),!i&&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=l=>{l.preventDefault(),h(l),s.removeEventListener("keyup",c)};s.addEventListener("keyup",c)}};return e.title=t?.title??"",e.formatedKeyNames=r,e.pause=()=>i=!0,e.restart=()=>i=!1,e.removeListener=()=>s.removeEventListener("keydown",a),s.addEventListener("keydown",a),e}}const ph={BACKSPACE:8,TAB:9,COMMA:188,DELETE:46,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,UP:38,DOWN:40,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32};class ir extends $s{container;width;height;mousePoint={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0};hammer;removes=[];constructor(t=document.documentElement,e=!0,s){super(),this.container=t,this.width=t.offsetWidth,this.height=t.offsetHeight,this.hammer=new mh(this.container),e&&this.start(s)}emitDebounce=Ha((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}start(t){this.registerMouseEventListeners(),this.registerTransitionEventListeners(),this.registerAnimationEventListeners(),this.registerResizeObserver(),this.registerElementDisplayInParent(),t&&t.forEach(e=>{this.addRemoves(e())}),this.on("pointerMove",e=>{this.setMousePoint(Pt(e,this.container))})}destroy(){this.removes.forEach(t=>t()),this.removes=[],this.removeAllListeners()}restart(){this.destroy(),this.start()}addRemoves(t){this.removes.push(t)}registerMouseEventListeners(){const t=M=>{this.emit("mouseDown",M)},e=M=>{this.emit("mouseUp",M)},s=M=>{this.emit("mouseMove",M)},i=M=>{this.emit("mouseOver",M)},r=M=>{this.emit("mouseOut",M)},a=M=>{this.emit("mouseEnter",M)},o=M=>{this.emit("mouseLeave",M)},h=M=>{this.emit("mouseClick",M)},c=M=>{this.emit("mouseDoubleClick",M)},l=M=>{this.emit("mouseWheel",M)},d=M=>{this.emit("mouseContextMenu",M)},w=M=>{this.emit("touchStart",M)},b=M=>{this.emit("touchEnd",M)},m=M=>{this.emit("touchCancel",M)},P=M=>{this.emit("touchMove",M)},_=M=>{this.emit("pointerDown",M)},v=M=>{this.emit("pointerUp",M)},x=M=>{this.emit("pointerCancel",M)},y=M=>{this.emit("pointerMove",M)},p=M=>{this.emit("pan",M)},E=M=>{this.emit("panStart",M)},C=M=>{this.emit("panMove",M)},B=M=>{this.emit("panEnd",M)},q=M=>{this.emit("panCancel",M)},V=M=>{this.emit("panLeft",M)},W=M=>{this.emit("panRight",M)},J=M=>{this.emit("panUp",M)},ot=M=>{this.emit("panDown",M)},St=M=>{this.emit("pinch",M)},gt=M=>{this.emit("press",M)},xe=M=>{this.emit("rotate",M)},ne=M=>{this.emit("swipe",M)},le=M=>{this.emit("swipeLeft",M)},be=M=>{this.emit("swipeRight",M)},F=M=>{this.emit("swipeUp",M)},k=M=>{this.emit("swipeDown",M)},Y=M=>{this.emit("tap",M)},G=M=>{!M.target||this.container==M.target||this.container.contains(M.target)||this.emit("tapOutSide",M)},ut=M=>{this.emit("inputChange",M,this.container.files)},At=M=>{this.emit("dragstart",M)},ks=M=>{M.dataTransfer&&(M.dataTransfer.dropEffect="copy"),this.emit("dragover",M)},Ls=M=>{this.emit("dragenter",M)},tt=M=>{this.emit("dragend",M)},Rt=M=>{M.dataTransfer,this.emit("drop",M,M.dataTransfer?.files)};this.container.addEventListener("mousedown",t,!1),this.container.addEventListener("mouseup",e,!1),this.container.addEventListener("mousemove",s,!1),this.container.addEventListener("mouseover",i,!1),this.container.addEventListener("mouseout",r,!1),this.container.addEventListener("mouseenter",a,!1),this.container.addEventListener("mouseleave",o,!1),this.container.addEventListener("click",h,!1),this.container.addEventListener("dblclick",c,!1),this.container.addEventListener("wheel",l,!1),this.container.addEventListener("contextmenu",d,!1),this.container.addEventListener("touchstart",w,!1),this.container.addEventListener("touchend",b,!1),this.container.addEventListener("touchcancel",m,!1),this.container.addEventListener("touchmove",P,!1),this.container.addEventListener("pointerdown",_,!1),this.container.addEventListener("pointerup",v,!1),this.container.addEventListener("pointercancel",x,!1),this.container.addEventListener("pointermove",y,!1),this.hammer.on("pan",p),this.hammer.on("panstart",E),this.hammer.on("panmove",C),this.hammer.on("panend",B),this.hammer.on("pancancel",q),this.hammer.on("panleft",V),this.hammer.on("panright",W),this.hammer.on("panup",J),this.hammer.on("pandown",ot),this.hammer.on("pinch",St),this.hammer.on("press",gt),this.hammer.on("rotate",xe),this.hammer.on("swipe",ne),this.hammer.on("swipeleft",le),this.hammer.on("swiperight",be),this.hammer.on("swipeup",F),this.hammer.on("swipedown",k),this.hammer.on("tap",Y),document.addEventListener("pointerdown",G,!1),this.container instanceof HTMLInputElement&&this.container.addEventListener("change",ut,!1),this.container.addEventListener("dragstart",At,!1),this.container.addEventListener("dragover",ks,!1),this.container.addEventListener("dragenter",Ls,!1),this.container.addEventListener("dragend",tt,!1),this.container.addEventListener("drop",Rt,!1);const $=()=>{this.container.removeEventListener("mousedown",t,!1),this.container.removeEventListener("mouseup",e,!1),this.container.removeEventListener("mousemove",s,!1),this.container.removeEventListener("mouseover",i,!1),this.container.removeEventListener("mouseout",r,!1),this.container.removeEventListener("mouseenter",a,!1),this.container.removeEventListener("mouseleave",o,!1),this.container.removeEventListener("click",h,!1),this.container.removeEventListener("dblclick",c,!1),this.container.removeEventListener("wheel",l,!1),this.container.removeEventListener("contextmenu",d,!1),this.container.removeEventListener("touchstart",w,!1),this.container.removeEventListener("touchend",b,!1),this.container.removeEventListener("touchcancel",m,!1),this.container.removeEventListener("touchmove",P,!1),this.container.removeEventListener("pointerdown",_,!1),this.container.removeEventListener("pointerup",v,!1),this.container.removeEventListener("pointercancel",x),this.container.removeEventListener("pointermove",y,!1),this.hammer.off("pan",p),this.hammer.off("panstart",E),this.hammer.off("panmove",C),this.hammer.off("panend",B),this.hammer.off("pancancel",q),this.hammer.off("panleft",V),this.hammer.off("panright",W),this.hammer.off("panup",J),this.hammer.off("pandown",ot),this.hammer.off("pinch",St),this.hammer.off("press",gt),this.hammer.off("rotate",xe),this.hammer.off("swipe",ne),this.hammer.off("swipeleft",le),this.hammer.off("swiperight",be),this.hammer.off("swipeup",F),this.hammer.off("swipedown",k),this.hammer.off("tap",Y),document.removeEventListener("pointerdown",G,!1),document.removeEventListener("touchstart",G,!1),document.removeEventListener("mousedown",G,!1),this.container instanceof HTMLInputElement&&this.container.removeEventListener("change",ut,!1),this.container.removeEventListener("dragstart",At,!1),this.container.removeEventListener("dragover",ks,!1),this.container.removeEventListener("dragenter",Ls,!1),this.container.removeEventListener("dragend",tt,!1),this.container.removeEventListener("drop",Rt,!1)};return this.addRemoves($),$}registerTransitionEventListeners(){const t=i=>{this.emit("transitionstart",i)},e=i=>{this.emit("transitionend",i)};this.container.addEventListener("transitionstart",t,!1),this.container.addEventListener("transitionend",e,!1);const s=()=>{this.container.removeEventListener("transitionstart",t,!1),this.container.removeEventListener("transitionend",e,!1)};return this.addRemoves(s),s}registerAnimationEventListeners(){const t=i=>{this.emit("animationstart",i)},e=i=>{this.emit("animationend",i)};this.container.addEventListener("animationstart",t,!1),this.container.addEventListener("animationend",e,!1);const s=()=>{this.container.removeEventListener("animationstart",t,!1),this.container.removeEventListener("animationend",e,!1)};return this.addRemoves(s),s}registerKeyDown(t,e,s){const i=sr.on(t,a=>(e(a,i.formatedKeyNames,i.pause,i.restart),s)),r=()=>{i.removeListener?.()};return this.addRemoves(r),r}registerResizeObserver(){let t;if(typeof ResizeObserver<"u"){const e=new ResizeObserver(s=>{const{width:i,height:r}=s[0].contentRect;this.width=i,this.height=r,this.emit("resize",i,r)});e.observe(this.container),t=()=>{e.unobserve(this.container)}}else{const e="orientationchange"in window?"orientationchange":"resize",s=i=>{const r=i.target.innerWidth,a=i.target.innerHeight;this.emit("resize",r,a)};window.addEventListener(e,s,!1),t=()=>{window.removeEventListener(e,s,!1)}}return this.addRemoves(t),t}registerElementDisplayInParent(t){const e={threshold:t?.threshold||.5,root:t?.parentElement},s=new IntersectionObserver((r,a)=>{let o=r[0];if(r.length>1){const c=r.find(l=>l.isIntersecting);c&&(o=c)}o.isIntersecting&&o.intersectionRatio>=e.threshold?this.emit("showInParent"):this.emit("showOffParent")},e);s.observe(this.container);const i=()=>{s.unobserve(this.container)};return this.addRemoves(i),i}registerPullDownRefresh(t){const e=t?.distance||50;return this.captureDrag({move:(s,i)=>{i.dStartY>0&&i.dStartY<e&&this.emit("pullDowning",i.dStartY)},end:(s,i)=>{i.dStartY>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;return this.captureDrag({move:(s,i)=>{i.dStartY>0&&i.dStartY<e&&this.emit("pullUping",i.dStartY)},end:(s,i)=>{i.dStartY>=e&&this.emit("pullUp")}})}setMousePoint(t){this.mousePoint.x=t.x,this.mousePoint.y=t.y,this.mousePoint.dx=typeof t.dx=="number"?t.dx:0,this.mousePoint.dy=typeof t.dy=="number"?t.dy:0,this.mousePoint.dStartX=typeof t.dStartX=="number"?t.dStartX:0,this.mousePoint.dStartY=typeof t.dStartY=="number"?t.dStartY:0}captureDrag(t){return this.captureDragUsePointer(t)}captureDragUsePointer(t){let e,s;const i=h=>{h.preventDefault(),h.stopPropagation(),this.on("pointerMove",a),this.on("pointerUp",r),this.on("pointerCancel",r),s=Pt(h,this.container);const c={...s};e=c,this.setMousePoint(c),t?.start?.(h,c)},r=h=>{h.preventDefault(),h.stopPropagation(),this.off("pointerMove",a),this.off("pointerUp",r),this.off("pointerCancel",r),s=Pt(h,this.container);const c={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(c),t?.end?.(h,c),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c={...s};s=Pt(h,this.container);const l={...s,dx:s.x-(c.x||0),dy:s.y-(c.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.move?.(h,l)};this.on("pointerDown",i);const o=()=>{this.off("pointerDown",i)};return this.addRemoves(o),o}captureDragUseMouse(t){let e,s;const i=h=>{h.preventDefault(),h.stopPropagation(),document.addEventListener("mousemove",a,!1),document.addEventListener("mouseup",r,!1),s=Pt(h,this.container);const c={...s};e=c,this.setMousePoint(c),t?.start?.(h,c)},r=h=>{h.preventDefault(),h.stopPropagation(),document.removeEventListener("mousemove",a,!1),document.removeEventListener("mouseup",r,!1),s=Pt(h,this.container);const c={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(c),t?.end?.(h,c),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c={...s};s=Pt(h,this.container);const l={...s,dx:s.x-(c.x||0),dy:s.y-(c.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.move?.(h,l)};this.on("mouseDown",i);const o=()=>{this.off("mouseDown",i)};return this.addRemoves(o),o}captureDragUseTouch(t){let e,s;const i=h=>{h.preventDefault(),h.stopPropagation(),this.on("touchMove",a),this.on("touchEnd",r),this.on("touchCancel",r);const c=h.changedTouches[0];s=Pt(c,this.container);const l={...s};e=l,this.setMousePoint(l),t?.start?.(c,l)},r=h=>{h.preventDefault(),h.stopPropagation(),this.off("touchMove",a),this.off("touchEnd",r),this.off("touchCancel",r);const c=h.changedTouches[0];s=Pt(c,this.container);const l={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.end?.(c,l),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c=h.changedTouches[0],l={...s};s=Pt(c,this.container);const d={...s,dx:s.x-(l.x||0),dy:s.y-(l.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(d),t?.move?.(c,d)};this.on("touchStart",i);const o=()=>{this.off("touchStart",i)};return this.addRemoves(o),o}}const rt=new ir(document.documentElement,!0,[()=>gh("(prefers-color-scheme: dark)"),yh,xh,wh]);rt.registerKeyDown({title:"打开",key:"o",ctrl:!0,exact:!0},()=>{Cn().then(n=>ss(n[0])).then(n=>{rt.emit("openFile",n)}).catch(n=>{rt.emit("openFileError",n)})});function gh(n){let t="";switch(n){case"(prefers-color-scheme: dark)":t="matchMediaChangePrefersColorSchemeDark";break;default:t=n;break}const e=s=>{rt.emit(t,s.matches)};return window.matchMedia(n).addEventListener("change",e,!1),()=>{window.matchMedia(n).removeEventListener("change",e,!1)}}function yh(){let n="";const t=new MutationObserver(i=>{location.href!==n&&(n=location.href,rt.emit("urlchange",location.href))});t.observe(document,{attributes:!0,childList:!0,subtree:!0});const e=()=>{rt.emit("hashchange",location.hash)};window.addEventListener("hashchange",e,!1);const s=()=>{rt.emit("popstate")};return window.addEventListener("popstate",s,!1),()=>{t.disconnect(),window.removeEventListener("hashchange",e,!1),window.removeEventListener("popstate",s,!1)}}function wh(){const n=r=>{rt.emit("beforeunload",r)};window.addEventListener("beforeunload",n,!1);const t=r=>{rt.emit("pagehide",r)};window.addEventListener("pagehide",t,!1);const e=r=>{rt.emit("windowFocus",r)};window.addEventListener("focus",e,!1);const s=r=>{rt.emit("windowBlur",r)};window.addEventListener("blur",s,!1);const i=r=>{document.hidden?rt.emit("windowVisibilityChangeHide",r):rt.emit("windowVisibilityChangeShow",r)};return document.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("beforeunload",n,!1),window.removeEventListener("pagehide",t,!1),window.removeEventListener("focus",e,!1),window.removeEventListener("blur",s,!1),document.removeEventListener("visibilitychange",i,!1)}}function xh(){const n=t=>{rt.emit("scroll",t)};return document.addEventListener("scroll",n,!1),()=>{document.removeEventListener("scroll",n,!1)}}const bh=n=>{let t=!1;function e(){if(document.readyState!=="loading"){if(t){document.removeEventListener("DOMContentLoaded",e,!1);return}t=!0,document.removeEventListener("DOMContentLoaded",e,!1),n()}}document.addEventListener("DOMContentLoaded",e,!1),e()};class Re{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"),s=document.createElement("video"),i=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),i.src=URL.createObjectURL(r),i.media="(min-width:10px)",s.append(i),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(s),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(()=>{Re.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 nr extends $s{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Ia(this.source);if(t===0){this.emit("finish");return}let e,s,i=rn(this.source,0);for(let r=1;r<t;r++)e=s,s=i,i=rn(this.source,r),this.raw+=s,s&&this.step(s,i,e);i&&this.step(i,void 0,s),this.emit("finish")}step(t,e,s){t==`
|
|
25
|
+
`&&this.emit("newline"),this.act(t,e,s)}act(t,e,s){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":Bt("whitespace",t)?(this.textchunk+=L.entity2text(this.entity),this.mode="text"):t==";"?(this.textchunk+=L.entity2text(this.entity+t),this.mode="text"):this.entity+=t;break;case"special":if(s=="!"&&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(s=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,s)),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=="-"&&s=="-"&&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(!Bt("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,s)}break;case"close tag name start":Bt("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,s));break;case"close tag name":if(Bt("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(Bt("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":Bt("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,s));break;case"attr":if(Bt("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(!Bt("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,s)}break;case"attr value":if(Bt("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&&s!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function gi(n,t,e){if(typeof t<"u")window.localStorage.setItem(n,JSON.stringify({value:t,expires:typeof e=="number"?e:-1}));else{const s=window.localStorage.getItem(n);try{const i=JSON.parse(s||"");return"expires"in i&&parseInt(i.expires)>=0&&new Date().getTime()>parseInt(i.expires)?void 0:i.value||void 0}catch{return s||void 0}}}function vh(n,t,e){const s=new Date;s.setTime(s.getTime()+e*24*60*60*1e3);const i="expires="+s.toUTCString();document.cookie=n+"="+t+"; "+i}function Sh(n){const t=n+"=",e=document.cookie.split(";");for(let s=0,i=e.length;s<i;s++){const r=e[s].trim();if(r.indexOf(t)==0)return r.substring(t.length,r.length)}return""}const Ch=()=>document.cookie.split(";").map(n=>n.split("=")).reduce((n,[t,e])=>(n[t.trim().replace('"',"")]=e,n),{}),Eh=()=>document.cookie.split(";").forEach(n=>document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));rt.on("matchMediaChangePrefersColorSchemeDark",n=>{ys(n?"dark":"light")}),rr();function ys(n){gi("ColorScheme",n),document.documentElement.classList.toggle("dark",n=="dark")}function rr(){const n=gi("ColorScheme");if(n=="dark"||n=="light")return ys(n),n;{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return ys(t),t}}const yi={safeAreaTop:L.getCSSVar("--safe-area-inset-top"),safeAreaRight:L.getCSSVar("--safe-area-inset-right"),safeAreaBottom:L.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:L.getCSSVar("--safe-area-inset-left"),colorPrimary:L.getCSSVar("--color-primary")||"#5078f0",colorRed:L.getCSSVar("--color-red")||"#ff5050",colorOrange:L.getCSSVar("--color-orange")||"#fa8c00",colorYellow:L.getCSSVar("--color-yellow")||"#fadc32",colorGreen:L.getCSSVar("--color-green")||"#00c878",colorBlue:L.getCSSVar("--color-blue")||"#00b4fa",colorPurple:L.getCSSVar("--color-purple")||"#6464fa",colorBlack:L.getCSSVar("--color-black")||"#001428",colorGray00:L.getCSSVar("--color-gray-00")||"#000000",colorGray33:L.getCSSVar("--color-gray-33")||"#333333",colorGray66:L.getCSSVar("--color-gray-66")||"#666666",colorGray99:L.getCSSVar("--color-gray-99")||"#999999",colorGrayCC:L.getCSSVar("--color-gray-cc")||"#cccccc",colorGrayDD:L.getCSSVar("--color-gray-dd")||"#dddddd",colorGrayE6:L.getCSSVar("--color-gray-e6")||"#e6e6e6",colorGrayEE:L.getCSSVar("--color-gray-ee")||"#eeeeee",colorGrayEF:L.getCSSVar("--color-gray-ef")||"#efefef",colorGrayF5:L.getCSSVar("--color-gray-f5")||"#f5f5f5",colorGrayFF:L.getCSSVar("--color-gray-ff")||"#ffffff",fontLineHeight:L.getCSSVar("--font-line-height")||"1.4",fontSize32:L.getCSSVar("--font-size-32")||"32px",fontSize24:L.getCSSVar("--font-size-24")||"24px",fontSize22:L.getCSSVar("--font-size-22")||"22px",fontSize20:L.getCSSVar("--font-size-20")||"20px",fontSize18:L.getCSSVar("--font-size-18")||"18px",fontSize16:L.getCSSVar("--font-size-16")||"16px",fontSize14:L.getCSSVar("--font-size-14")||"14px",fontSize12:L.getCSSVar("--font-size-12")||"12px",fontSize10:L.getCSSVar("--font-size-10")||"10px",d4:L.getCSSVar("--distance-4")||"4px",d8:L.getCSSVar("--distance-8")||"8px",d12:L.getCSSVar("--distance-12")||"12px",d16:L.getCSSVar("--distance-16")||"16px",d20:L.getCSSVar("--distance-20")||"20px",d32:L.getCSSVar("--distance-32")||"32px",d40:L.getCSSVar("--distance-40")||"40px",d44:L.getCSSVar("--distance-44")||"44px"};class lt{__color={r:0,g:0,b:0,a:1};constructor(t,e){t&&this.setColor(t),typeof e=="number"&&this.setAlpha(e)}get color(){return this.__color}set color(t){this.__color=wi(t)}setColor(t){return this.color=t,this}get r(){return this.__color.r}set r(t){this.__color.r=H(Math.round(t),0,255)}get g(){return this.__color.g}set g(t){this.__color.g=H(Math.round(t),0,255)}get b(){return this.__color.b}set b(t){this.__color.b=H(Math.round(t),0,255)}get a(){return this.__color.a}set a(t){this.__color.a=H(t,0,1)}setAlpha(t){return this.a=t,this}setRGB(t,e,s){return this.r=t,this.g=e,this.b=s,this}setRGBA(t,e,s,i){return this.r=t,this.g=e,this.b=s,this.a=i,this}get hex(){return(this.r<<16)+(this.g<<8)+this.b}toString(){if(this.a===1){const t="000000"+this.hex.toString(16);return"#"+t.slice(t.length-6)}else return`rgba(${this.r},${this.g},${this.b},${Mt(this.a,6)})`}clone(){return new lt(this.color)}copy(t){this.setColor(t.color)}opposite(t=!1,e="#000000",s="#ffffff"){if(t)return new lt(this.r*.299+this.g*.587+this.b*.114>186?e:s);{const i=this.clone();return i.r=255-i.r,i.g=255-i.g,i.b=255-i.b,i}}lighten(t){t=H(Math.abs(t),0,1);let{r:e,g:s,b:i,a:r}=this.color;return e+=(255-e)*t,s+=(255-s)*t,i+=(255-i)*t,new lt().setRGBA(e,s,i,r)}darken(t){t=H(Math.abs(t),0,1);let{r:e,g:s,b:i,a:r}=this.color;return e=e*(1-t),s=s*(1-t),i=i*(1-t),new lt().setRGBA(e,s,i,r)}static gradient(t,e,s){try{const i=wi(t),r=wi(e);return new lt().setRGB((r.r-i.r)*s+i.r,(r.g-i.g)*s+i.g,(r.b-i.b)*s+i.b)}catch{return new lt(e)}}static random(){return new lt(Math.random()*16777215)}get hsv(){const{r:t,g:e,b:s,a:i}=this.color,r=Math.max(t,e,s),a=Math.min(t,e,s),o=r-a;let h;return t===r?h=(e-s)/o:e===r?h=2+(s-t)/o:h=4+(t-e)/o,h/=6,h<0&&(h+=1),{h:o==0?0:h*360,s:r===0?0:o/r,v:r/255,a:i}}set h(t){const e=this.hsv;e.h=H(t,0,360),this.setColor(e)}get h(){return this.hsv.h}set s(t){const e=this.hsv;e.s=H(t,0,1),this.setColor(e)}get s(){return this.hsv.s}set v(t){const e=this.hsv;e.v=H(t,0,1),this.setColor(e)}get v(){return this.hsv.v}}function Oe(n,t){return new lt(n,t)}function wi(n){const t=Object.prototype.hasOwnProperty.call(n,"a")?H(n.a,0,1):1;if(Object.prototype.hasOwnProperty.call(n,"r")&&Object.prototype.hasOwnProperty.call(n,"g")&&Object.prototype.hasOwnProperty.call(n,"b"))return n.r=H(Math.round(n.r),0,255),n.g=H(Math.round(n.g),0,255),n.b=H(Math.round(n.b),0,255),n.a=t,n;if(Object.prototype.hasOwnProperty.call(n,"h")&&Object.prototype.hasOwnProperty.call(n,"s")&&Object.prototype.hasOwnProperty.call(n,"v")){let s=H(n.h,0,360),i=H(n.s,0,1),r=H(n.v,0,1);const a=Math.floor(s/60)%6,o=s/60-Math.floor(s/60),h=r*(1-i),c=r*(1-o*i),l=r*(1-(1-o)*i),d=[[r,l,h],[c,r,h],[h,r,l],[h,c,r],[l,h,r],[r,h,c]][a];return{r:Math.round(d[0]*255),g:Math.round(d[1]*255),b:Math.round(d[2]*255),a:t}}const e={r:0,g:0,b:0,a:t};if(typeof n=="number")n<Math.pow(2,24)?(e.r=n>>16&255,e.g=n>>8&255,e.b=n&255):(e.r=n>>24&255,e.g=n>>16&255,e.b=n>>8&255,e.a=(n&255)/255);else if(typeof n=="string"){const s=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?\s*(\d?\.?\d*)?\s*\)/gi.exec(n);if(s)e.r=parseInt(s[1]),e.g=parseInt(s[2]),e.b=parseInt(s[3]),s[4]&&(e.a=parseFloat(s[4]));else{let i=n.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);i?(e.r=parseInt(`${i[1]}${i[1]}`,16),e.g=parseInt(`${i[2]}${i[2]}`,16),e.b=parseInt(`${i[3]}${i[3]}`,16)):(i=n.match(/^#([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})$/i),i?(e.r=parseInt(i[1],16),e.g=parseInt(i[2],16),e.b=parseInt(i[3],16)):(i=n.match(/^#([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})$/i),i?(e.r=parseInt(i[1],16),e.g=parseInt(i[2],16),e.b=parseInt(i[3],16),e.a=parseInt(i[4],16)/255):n==="none"&&(e.a=0)))}}else throw new Error("parseColor 不支持的颜色解析:"+n);return e.r=H(e.r,0,255),e.g=H(e.g,0,255),e.b=H(e.b,0,255),e.a=H(e.a,0,1),e}const ar=["#0ac2d2","#7bb7fa","#60d7a9","#fdc162","#fd6a62","#f68dbb","#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff","#dc4916","#6871b1","#d1b935","#1bbc9b","#FF7F50","#4BBFC3","#ff9900"],he={backgroundColor:"#1a1a1a",numberColor:"#2FA1D6",booleanColor:"#806787",stringColor:"#1ed36f",functionColor:"#e61d5f",saveRowColor:"#dad5cb",buttonColor:"",borderColor:"",inputColor:""};he.buttonColor=new lt(he.saveRowColor).darken(.1).toString(),he.borderColor=new lt(he.backgroundColor).lighten(.07).toString(),he.inputColor=new lt(he.backgroundColor).lighten(.085).toString();function ws(n=window.location.href){return ln(URL)?new URL(n):or(n)}function or(n=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",s="(?<pathname>(?:\\/[^/#?]+)*\\/?)",i="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${s}${i}${r}$`).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 Th(n){const t=ws(n);return t.protocol==="http:"||t.protocol==="https:"}function hr(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 Ph(n=ws().search){n=decodeURIComponent(n).replace(/^[#?&]/,"");const t={};if(!n)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let s=e.exec(n);for(;s;)t[s[1]]=s[2],s=e.exec(n);return t}function xs(n){return"?"+Object.entries(n).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function cr(n){return"?"+[...n.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function lr(n,t){return n.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function _h(n,t){return lr(n,xs(t))}function xi(n,t){return n+t.replace(/^[&?]/,n.indexOf("?")>=0?"&":"?")}function Ah(n,t){return xi(n,xs(t))}class Dh{worker;cbs={};constructor(t){if(On)try{this.worker=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){throw typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),e}else throw new Error("Your environment do not support Worker !")}postMessage(t,e=[]){this.worker.postMessage(t,e)}onmessage(t){this.worker.addEventListener("message",t)}offmessage(t){this.worker.removeEventListener("message",t)}onmessageerror(t){this.worker.addEventListener("messageerror",t)}offmessageerror(t){this.worker.removeEventListener("messageerror",t)}postCanvas(t){const e=t.transferControlToOffscreen();this.worker.postMessage({canvas:e},[e])}postPort(t){this.worker.postMessage({port:t},[t])}postReset(){this.worker.postMessage({reset:!0});for(const t in this.cbs)this.cbs[t](),delete this.cbs[t]}fire(t,e){return new Promise(s=>{if(e){const i=Math.random().toString(36).slice(2),r=a=>{a.data.id===i&&(this.worker.removeEventListener("message",r),delete this.cbs[i],e(),s())};this.cbs[i]=r.bind(this,{data:{id:i}}),this.worker.addEventListener("message",r),this.worker.postMessage({...t,id:i})}else this.worker.postMessage(t),s()})}}class Mh{port1;port2;port1MessageCbs=[];port2MessageCbs=[];port1MessageErrorCbs=[];port2MessageErrorCbs=[];constructor(){const{port1:t,port2:e}=new MessageChannel;this.port1=t,this.port2=e,this.port1.addEventListener("message",s=>{this.port1MessageCbs.forEach(i=>i(this.port1,s))}),this.port1.addEventListener("messageerror",s=>{this.port1MessageErrorCbs.forEach(i=>i(this.port1,s))}),this.port1.start(),this.port2.addEventListener("message",s=>{this.port2MessageCbs.forEach(i=>i(this.port2,s))}),this.port2.addEventListener("messageerror",s=>{this.port2MessageErrorCbs.forEach(i=>i(this.port2,s))}),this.port2.start()}close(){this.port1.close(),this.port2.close()}onPort1Message(t){this.port1MessageCbs.push(t)}onPort1MessageError(t){this.port1MessageErrorCbs.push(t)}offPort1Message(t){Ce(this.port1MessageCbs,t)}offPort1MessageError(t){Ce(this.port1MessageErrorCbs,t)}onPort2Message(t){this.port2MessageCbs.push(t)}onPort2MessageError(t){this.port2MessageErrorCbs.push(t)}offPort2Message(t){Ce(this.port2MessageCbs,t)}offPort2MessageError(t){Ce(this.port2MessageErrorCbs,t)}}function ur(){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,s=t.length;e<s;e++)try{n=new window.ActiveXObject(t[e]);break}catch{continue}}else n=new XMLHttpRequest;return n}function Ih(n,t){return new Promise((e,s)=>{const{method:i="GET",data:r={},multipartFormDataString:a="",boundary:o="",headers:h={},withCredentials:c=!1,responseType:l="json",timeout:d=3e4}=t||{},w=ur();w.timeout=d,w.responseType=l,w.onreadystatechange=function(x){w.readyState===4&&(w.status===200?e(w.response):s(w.statusText))},w.ontimeout=()=>{s(`${n} is timed out for ${d}ms.`)},w.addEventListener("load",x=>t?.load?.(x,w),!1),w.addEventListener("loadstart",x=>t?.loadstart?.(x,w),!1),w.addEventListener("progress",x=>{if(x.lengthComputable){const y=Math.round(x.loaded*100/x.total);t?.progress?.(x,w,y)}},!1),w.addEventListener("loadend",x=>t?.loadend?.(x,w),!1),w.addEventListener("error",x=>t?.error?.(x,w),!1),w.addEventListener("abort",x=>t?.abort?.(x,w),!1);const b=i.toUpperCase();Object.assign(h,{Accept:"*/*"});let m=!1,P=!1,_=!1;function v(){c&&(w.withCredentials=!0);for(const x in h)ft(x).toLowerCase()=="content-type"&&h[x].toLowerCase()=="multipart/form-data"?(m=!0,w.setRequestHeader("Content-Type","multipart/form-data; boundary="+o)):(ft(x).toLowerCase()=="content-type"&&(h[x].toLowerCase().indexOf("text/plain")>=0?P=!0:h[x].toLowerCase().indexOf("application/json")>=0&&(_=!0)),w.setRequestHeader(x,h[x]))}switch(b){case"GET":let x="";r instanceof FormData?x=cr(r):x=xs(r),w.open("GET",xi(n,x),!0),v(),w.send(null);break;default:w.open(b,n,!0),v(),m?w.sendAsBinary(a):_?w.send(JSON.stringify(r)):P?w.send(Object.entries(r).map(([y,p])=>`${y}=${p}`).join(`\r
|
|
26
|
+
`)):w.send(Object.entries(r).map(([y,p])=>`${encodeURIComponent(y)}=${encodeURIComponent(p)}`).join("&"));break}})}async function kh(n){const t={url:n.action||"",data:{},contentType:n.method.toLowerCase()==="post"&&n.enctype?n.enctype:"application/x-www-form-urlencoded",multipartFormDataString:"",boundary:"---------------------------"+Date.now().toString(16)},e=[],s=t.contentType=="multipart/form-data";for(let i=0;i<n.elements.length;i++){const r=n.elements[i];if(!r.hasAttribute("name"))continue;const a=r.getAttribute("type");switch(r.nodeName.toUpperCase()==="INPUT"&&a?a.toUpperCase():""){case"FILE":const h=r;if(s)for(let d=0,w=h.files?.length||0;d<w;d++){const b=h.files?.[d];if(b){const m=await ss(b,"binaryString");e.push('Content-Disposition: form-data; name="'+h.name+'"; filename="'+b.name+`"\r
|
|
27
|
+
Content-Type: `+b.type+`\r
|
|
28
28
|
\r
|
|
29
29
|
`+m+`\r
|
|
30
30
|
`)}}break;case"RADIO":case"CHECKBOX":if(!r.checked)break;default:const l=r;s?e.push('Content-Disposition: form-data; name="'+l.name+`"\r
|
|
@@ -33,14 +33,14 @@ Content-Type: `+y.type+`\r
|
|
|
33
33
|
`):t.data[l.name]=l.value;break}}return t.multipartFormDataString="--"+t.boundary+`\r
|
|
34
34
|
`+e.join("--"+t.boundary+`\r
|
|
35
35
|
`)+"--"+t.boundary+`--\r
|
|
36
|
-
`,t}function cr(n,t){return function(){return n.apply(t,arguments)}}const{toString:_h}=Object.prototype,{getPrototypeOf:bi}=Object,xs=(n=>t=>{const e=_h.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),kt=n=>(n=n.toLowerCase(),t=>xs(t)===n),bs=n=>t=>typeof t===n,{isArray:ge}=Array,Oe=bs("undefined");function Dh(n){return n!==null&&!Oe(n)&&n.constructor!==null&&!Oe(n.constructor)&&vt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const lr=kt("ArrayBuffer");function Ah(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&lr(n.buffer),t}const Ih=bs("string"),vt=bs("function"),ur=bs("number"),vs=n=>n!==null&&typeof n=="object",kh=n=>n===!0||n===!1,Ss=n=>{if(xs(n)!=="object")return!1;const t=bi(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},Mh=kt("Date"),Lh=kt("File"),Rh=kt("Blob"),Oh=kt("FileList"),Fh=n=>vs(n)&&vt(n.pipe),Nh=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||vt(n.append)&&((t=xs(n))==="formdata"||t==="object"&&vt(n.toString)&&n.toString()==="[object FormData]"))},Yh=kt("URLSearchParams"),Bh=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Fe(n,t,{allOwnKeys:e=!1}={}){if(n===null||typeof n>"u")return;let s,i;if(typeof n!="object"&&(n=[n]),ge(n))for(s=0,i=n.length;s<i;s++)t.call(null,n[s],s,n);else{const r=e?Object.getOwnPropertyNames(n):Object.keys(n),a=r.length;let o;for(s=0;s<a;s++)o=r[s],t.call(null,n[o],o,n)}}function dr(n,t){t=t.toLowerCase();const e=Object.keys(n);let s=e.length,i;for(;s-- >0;)if(i=e[s],t===i.toLowerCase())return i;return null}const fr=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),mr=n=>!Oe(n)&&n!==fr;function vi(){const{caseless:n}=mr(this)&&this||{},t={},e=(s,i)=>{const r=n&&dr(t,i)||i;Ss(t[r])&&Ss(s)?t[r]=vi(t[r],s):Ss(s)?t[r]=vi({},s):ge(s)?t[r]=s.slice():t[r]=s};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Fe(arguments[s],e);return t}const Xh=(n,t,e,{allOwnKeys:s}={})=>(Fe(t,(i,r)=>{e&&vt(i)?n[r]=cr(i,e):n[r]=i},{allOwnKeys:s}),n),Gh=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Uh=(n,t,e,s)=>{n.prototype=Object.create(t.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),e&&Object.assign(n.prototype,e)},Vh=(n,t,e,s)=>{let i,r,a;const o={};if(t=t||{},n==null)return t;do{for(i=Object.getOwnPropertyNames(n),r=i.length;r-- >0;)a=i[r],(!s||s(a,n,t))&&!o[a]&&(t[a]=n[a],o[a]=!0);n=e!==!1&&bi(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},zh=(n,t,e)=>{n=String(n),(e===void 0||e>n.length)&&(e=n.length),e-=t.length;const s=n.indexOf(t,e);return s!==-1&&s===e},qh=n=>{if(!n)return null;if(ge(n))return n;let t=n.length;if(!ur(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=n[t];return e},Hh=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&bi(Uint8Array)),jh=(n,t)=>{const s=(n&&n[Symbol.iterator]).call(n);let i;for(;(i=s.next())&&!i.done;){const r=i.value;t.call(n,r[0],r[1])}},Wh=(n,t)=>{let e;const s=[];for(;(e=n.exec(t))!==null;)s.push(e);return s},$h=kt("HTMLFormElement"),Jh=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,i){return s.toUpperCase()+i}),pr=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),Zh=kt("RegExp"),gr=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),s={};Fe(e,(i,r)=>{let a;(a=t(i,r,n))!==!1&&(s[r]=a||i)}),Object.defineProperties(n,s)},Kh=n=>{gr(n,(t,e)=>{if(vt(n)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=n[e];if(vt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},Qh=(n,t)=>{const e={},s=i=>{i.forEach(r=>{e[r]=!0})};return ge(n)?s(n):s(String(n).split(t)),e},tc=()=>{},ec=(n,t)=>(n=+n,Number.isFinite(n)?n:t),Si="abcdefghijklmnopqrstuvwxyz",yr="0123456789",wr={DIGIT:yr,ALPHA:Si,ALPHA_DIGIT:Si+Si.toUpperCase()+yr},sc=(n=16,t=wr.ALPHA_DIGIT)=>{let e="";const{length:s}=t;for(;n--;)e+=t[Math.random()*s|0];return e};function ic(n){return!!(n&&vt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const nc=n=>{const t=new Array(10),e=(s,i)=>{if(vs(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[i]=s;const r=ge(s)?[]:{};return Fe(s,(a,o)=>{const h=e(a,i+1);!Oe(h)&&(r[o]=h)}),t[i]=void 0,r}}return s};return e(n,0)},rc=kt("AsyncFunction"),E={isArray:ge,isArrayBuffer:lr,isBuffer:Dh,isFormData:Nh,isArrayBufferView:Ah,isString:Ih,isNumber:ur,isBoolean:kh,isObject:vs,isPlainObject:Ss,isUndefined:Oe,isDate:Mh,isFile:Lh,isBlob:Rh,isRegExp:Zh,isFunction:vt,isStream:Fh,isURLSearchParams:Yh,isTypedArray:Hh,isFileList:Oh,forEach:Fe,merge:vi,extend:Xh,trim:Bh,stripBOM:Gh,inherits:Uh,toFlatObject:Vh,kindOf:xs,kindOfTest:kt,endsWith:zh,toArray:qh,forEachEntry:jh,matchAll:Wh,isHTMLForm:$h,hasOwnProperty:pr,hasOwnProp:pr,reduceDescriptors:gr,freezeMethods:Kh,toObjectSet:Qh,toCamelCase:Jh,noop:tc,toFiniteNumber:ec,findKey:dr,global:fr,isContextDefined:mr,ALPHABET:wr,generateString:sc,isSpecCompliantForm:ic,toJSONObject:nc,isAsyncFn:rc,isThenable:n=>n&&(vs(n)||vt(n))&&vt(n.then)&&vt(n.catch)};function B(n,t,e,s,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),s&&(this.request=s),i&&(this.response=i)}E.inherits(B,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:E.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const xr=B.prototype,br={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{br[n]={value:n}}),Object.defineProperties(B,br),Object.defineProperty(xr,"isAxiosError",{value:!0}),B.from=(n,t,e,s,i,r)=>{const a=Object.create(xr);return E.toFlatObject(n,a,function(h){return h!==Error.prototype},o=>o!=="isAxiosError"),B.call(a,n.message,t,e,s,i),a.cause=n,a.name=n.name,r&&Object.assign(a,r),a};const ac=null;function Ci(n){return E.isPlainObject(n)||E.isArray(n)}function vr(n){return E.endsWith(n,"[]")?n.slice(0,-2):n}function Sr(n,t,e){return n?n.concat(t).map(function(i,r){return i=vr(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function oc(n){return E.isArray(n)&&!n.some(Ci)}const hc=E.toFlatObject(E,{},null,function(t){return/^is[A-Z]/.test(t)});function Cs(n,t,e){if(!E.isObject(n))throw new TypeError("target must be an object");t=t||new FormData,e=E.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,b){return!E.isUndefined(b[x])});const s=e.metaTokens,i=e.visitor||l,r=e.dots,a=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&E.isSpecCompliantForm(t);if(!E.isFunction(i))throw new TypeError("visitor must be a function");function c(m){if(m===null)return"";if(E.isDate(m))return m.toISOString();if(!h&&E.isBlob(m))throw new B("Blob is not supported. Use a Buffer instead.");return E.isArrayBuffer(m)||E.isTypedArray(m)?h&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function l(m,x,b){let S=m;if(m&&!b&&typeof m=="object"){if(E.endsWith(x,"{}"))x=s?x:x.slice(0,-2),m=JSON.stringify(m);else if(E.isArray(m)&&oc(m)||(E.isFileList(m)||E.endsWith(x,"[]"))&&(S=E.toArray(m)))return x=vr(x),S.forEach(function(L,R){!(E.isUndefined(L)||L===null)&&t.append(a===!0?Sr([x],R,r):a===null?x:x+"[]",c(L))}),!1}return Ci(m)?!0:(t.append(Sr(b,x,r),c(m)),!1)}const d=[],g=Object.assign(hc,{defaultVisitor:l,convertValue:c,isVisitable:Ci});function y(m,x){if(!E.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+x.join("."));d.push(m),E.forEach(m,function(S,C){(!(E.isUndefined(S)||S===null)&&i.call(t,S,E.isString(C)?C.trim():C,x,g))===!0&&y(S,x?x.concat(C):[C])}),d.pop()}}if(!E.isObject(n))throw new TypeError("data must be an object");return y(n),t}function Cr(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Ei(n,t){this._pairs=[],n&&Cs(n,this,t)}const Er=Ei.prototype;Er.append=function(t,e){this._pairs.push([t,e])},Er.toString=function(t){const e=t?function(s){return t.call(this,s,Cr)}:Cr;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function cc(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Tr(n,t,e){if(!t)return n;const s=e&&e.encode||cc,i=e&&e.serialize;let r;if(i?r=i(t,e):r=E.isURLSearchParams(t)?t.toString():new Ei(t,e).toString(s),r){const a=n.indexOf("#");a!==-1&&(n=n.slice(0,a)),n+=(n.indexOf("?")===-1?"?":"&")+r}return n}class lc{constructor(){this.handlers=[]}use(t,e,s){return this.handlers.push({fulfilled:t,rejected:e,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){E.forEach(this.handlers,function(s){s!==null&&t(s)})}}const Pr=lc,_r={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},uc=typeof URLSearchParams<"u"?URLSearchParams:Ei,dc=typeof FormData<"u"?FormData:null,fc=typeof Blob<"u"?Blob:null,mc=(()=>{let n;return typeof navigator<"u"&&((n=navigator.product)==="ReactNative"||n==="NativeScript"||n==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),pc=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Mt={isBrowser:!0,classes:{URLSearchParams:uc,FormData:dc,Blob:fc},isStandardBrowserEnv:mc,isStandardBrowserWebWorkerEnv:pc,protocols:["http","https","file","blob","url","data"]};function gc(n,t){return Cs(n,new Mt.classes.URLSearchParams,Object.assign({visitor:function(e,s,i,r){return Mt.isNode&&E.isBuffer(e)?(this.append(s,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function yc(n){return E.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function wc(n){const t={},e=Object.keys(n);let s;const i=e.length;let r;for(s=0;s<i;s++)r=e[s],t[r]=n[r];return t}function Dr(n){function t(e,s,i,r){let a=e[r++];const o=Number.isFinite(+a),h=r>=e.length;return a=!a&&E.isArray(i)?i.length:a,h?(E.hasOwnProp(i,a)?i[a]=[i[a],s]:i[a]=s,!o):((!i[a]||!E.isObject(i[a]))&&(i[a]=[]),t(e,s,i[a],r)&&E.isArray(i[a])&&(i[a]=wc(i[a])),!o)}if(E.isFormData(n)&&E.isFunction(n.entries)){const e={};return E.forEachEntry(n,(s,i)=>{t(yc(s),i,e,0)}),e}return null}function xc(n,t,e){if(E.isString(n))try{return(t||JSON.parse)(n),E.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(e||JSON.stringify)(n)}const Ti={transitional:_r,adapter:["xhr","http"],transformRequest:[function(t,e){const s=e.getContentType()||"",i=s.indexOf("application/json")>-1,r=E.isObject(t);if(r&&E.isHTMLForm(t)&&(t=new FormData(t)),E.isFormData(t))return i&&i?JSON.stringify(Dr(t)):t;if(E.isArrayBuffer(t)||E.isBuffer(t)||E.isStream(t)||E.isFile(t)||E.isBlob(t))return t;if(E.isArrayBufferView(t))return t.buffer;if(E.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(r){if(s.indexOf("application/x-www-form-urlencoded")>-1)return gc(t,this.formSerializer).toString();if((o=E.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Cs(o?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),xc(t)):t}],transformResponse:[function(t){const e=this.transitional||Ti.transitional,s=e&&e.forcedJSONParsing,i=this.responseType==="json";if(t&&E.isString(t)&&(s&&!this.responseType||i)){const a=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?B.from(o,B.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mt.classes.FormData,Blob:Mt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};E.forEach(["delete","get","head","post","put","patch"],n=>{Ti.headers[n]={}});const Pi=Ti,bc=E.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),vc=n=>{const t={};let e,s,i;return n&&n.split(`
|
|
37
|
-
`).forEach(function(a){i=a.indexOf(":"),e=a.substring(0,i).trim().toLowerCase(),s=a.substring(i+1).trim(),!(!e||t[e]&&
|
|
38
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(i=>s.set(i)),s}static accessor(t){const s=(this[
|
|
39
|
-
`+r.map(
|
|
40
|
-
`):" "+Lr(r[0]):"as no adapter specified";throw new B("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:Ai};function Ii(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Ye(null,n)}function Or(n){return Ii(n),n.headers=Gt.from(n.headers),n.data=Di.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Rr.getAdapter(n.adapter||Pi.adapter)(n).then(function(s){return Ii(n),s.data=Di.call(n,n.transformResponse,s),s.headers=Gt.from(s.headers),s},function(s){return Ir(s)||(Ii(n),s&&s.response&&(s.response.data=Di.call(n,n.transformResponse,s.response),s.response.headers=Gt.from(s.response.headers))),Promise.reject(s)})}const Fr=n=>n instanceof Gt?n.toJSON():n;function ye(n,t){t=t||{};const e={};function s(c,l,d){return E.isPlainObject(c)&&E.isPlainObject(l)?E.merge.call({caseless:d},c,l):E.isPlainObject(l)?E.merge({},l):E.isArray(l)?l.slice():l}function i(c,l,d){if(E.isUndefined(l)){if(!E.isUndefined(c))return s(void 0,c,d)}else return s(c,l,d)}function r(c,l){if(!E.isUndefined(l))return s(void 0,l)}function a(c,l){if(E.isUndefined(l)){if(!E.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function o(c,l,d){if(d in t)return s(c,l);if(d in n)return s(void 0,c)}const h={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(c,l)=>i(Fr(c),Fr(l),!0)};return E.forEach(Object.keys(Object.assign({},n,t)),function(l){const d=h[l]||i,g=d(n[l],t[l],l);E.isUndefined(g)&&d!==o||(e[l]=g)}),e}const Nr="1.5.1",ki={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{ki[n]=function(s){return typeof s===n||"a"+(t<1?"n ":" ")+n}});const Yr={};ki.transitional=function(t,e,s){function i(r,a){return"[Axios v"+Nr+"] Transitional option '"+r+"'"+a+(s?". "+s:"")}return(r,a,o)=>{if(t===!1)throw new B(i(a," has been removed"+(e?" in "+e:"")),B.ERR_DEPRECATED);return e&&!Yr[a]&&(Yr[a]=!0,console.warn(i(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,a,o):!0}};function Rc(n,t,e){if(typeof n!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let i=s.length;for(;i-- >0;){const r=s[i],a=t[r];if(a){const o=n[r],h=o===void 0||a(o,r,n);if(h!==!0)throw new B("option "+r+" must be "+h,B.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new B("Unknown option "+r,B.ERR_BAD_OPTION)}}const Mi={assertOptions:Rc,validators:ki},te=Mi.validators;class Ps{constructor(t){this.defaults=t,this.interceptors={request:new Pr,response:new Pr}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=ye(this.defaults,e);const{transitional:s,paramsSerializer:i,headers:r}=e;s!==void 0&&Mi.assertOptions(s,{silentJSONParsing:te.transitional(te.boolean),forcedJSONParsing:te.transitional(te.boolean),clarifyTimeoutError:te.transitional(te.boolean)},!1),i!=null&&(E.isFunction(i)?e.paramsSerializer={serialize:i}:Mi.assertOptions(i,{encode:te.function,serialize:te.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&E.merge(r.common,r[e.method]);r&&E.forEach(["delete","get","head","post","put","patch","common"],m=>{delete r[m]}),e.headers=Gt.concat(a,r);const o=[];let h=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(e)===!1||(h=h&&x.synchronous,o.unshift(x.fulfilled,x.rejected))});const c=[];this.interceptors.response.forEach(function(x){c.push(x.fulfilled,x.rejected)});let l,d=0,g;if(!h){const m=[Or.bind(this),void 0];for(m.unshift.apply(m,o),m.push.apply(m,c),g=m.length,l=Promise.resolve(e);d<g;)l=l.then(m[d++],m[d++]);return l}g=o.length;let y=e;for(d=0;d<g;){const m=o[d++],x=o[d++];try{y=m(y)}catch(b){x.call(this,b);break}}try{l=Or.call(this,y)}catch(m){return Promise.reject(m)}for(d=0,g=c.length;d<g;)l=l.then(c[d++],c[d++]);return l}getUri(t){t=ye(this.defaults,t);const e=kr(t.baseURL,t.url);return Tr(e,t.params,t.paramsSerializer)}}E.forEach(["delete","get","head","options"],function(t){Ps.prototype[t]=function(e,s){return this.request(ye(s||{},{method:t,url:e,data:(s||{}).data}))}}),E.forEach(["post","put","patch"],function(t){function e(s){return function(r,a,o){return this.request(ye(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}Ps.prototype[t]=e(),Ps.prototype[t+"Form"]=e(!0)});const _s=Ps;class Li{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const s=this;this.promise.then(i=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](i);s._listeners=null}),this.promise.then=i=>{let r;const a=new Promise(o=>{s.subscribe(o),r=o}).then(i);return a.cancel=function(){s.unsubscribe(r)},a},t(function(r,a,o){s.reason||(s.reason=new Ye(r,a,o),e(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}static source(){let t;return{token:new Li(function(i){t=i}),cancel:t}}}const Oc=Li;function Fc(n){return function(e){return n.apply(null,e)}}function Nc(n){return E.isObject(n)&&n.isAxiosError===!0}const Ri={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ri).forEach(([n,t])=>{Ri[t]=n});const Yc=Ri;function Br(n){const t=new _s(n),e=cr(_s.prototype.request,t);return E.extend(e,_s.prototype,t,{allOwnKeys:!0}),E.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return Br(ye(n,i))},e}const W=Br(Pi);W.Axios=_s,W.CanceledError=Ye,W.CancelToken=Oc,W.isCancel=Ir,W.VERSION=Nr,W.toFormData=Cs,W.AxiosError=B,W.Cancel=W.CanceledError,W.all=function(t){return Promise.all(t)},W.spread=Fc,W.isAxiosError=Nc,W.mergeConfig=ye,W.AxiosHeaders=Gt,W.formToJSON=n=>Dr(E.isHTMLForm(n)?new FormData(n):n),W.getAdapter=Rr.getAdapter,W.HttpStatusCode=Yc,W.default=W;const Bc=W,Xr=window.crypto.subtle;Xr||console.warn("Crypto API not supported");async function Gr(n,t="SHA-256"){const e=await Xr.digest(t,Ia(n));return ka(e)}async function Ur(n,t="SHA-256"){const e=JSON.stringify(Ya(n));return Gr(e,t)}class Xc{instance;interceptors;requestCanceler;constructor(t){this.instance=Bc.create(t),this.interceptors=t?.interceptors,this.requestCanceler=new Vr,this.instance.interceptors.request.use(e=>(this.requestCanceler.pendingRequest(e),e),e=>(this.requestCanceler.cancelRequest(e.config),e)),this.instance.interceptors.request.use(this.interceptors?.requestInterceptor,this.interceptors?.requestInterceptorCatch),this.instance.interceptors.response.use(this.interceptors?.responseInterceptor,this.interceptors?.responseInterceptorCatch),this.instance.interceptors.response.use(e=>new Promise((s,i)=>{this.requestCanceler.confirmRequest(e.config),e.status===200?s(e.data):i(e.data)}),async e=>{const{code:s="",config:i}=e;return!i||!i.retry||!i.retryStatus?.includes(s)||(i.retryCounted=i.retryCounted??0,i.retryCounted>=i.retry)?Promise.reject(e):(i.retryCounted++,await new Promise(r=>{setTimeout(()=>{r(void 0)},i.retryDelay)}),await this.request(i))})}request(t){return new Promise((e,s)=>{try{t.interceptors?.requestInterceptor&&(t=t.interceptors?.requestInterceptor(t)),this.instance.request(t).then(i=>{t.interceptors?.responseInterceptor&&(i=t.interceptors.responseInterceptor(i)),e(i)}).catch(i=>{t.interceptors?.responseInterceptorCatch&&(i=t.interceptors?.responseInterceptorCatch(i)),s(i)})}catch(i){t.interceptors?.requestInterceptorCatch&&t.interceptors.requestInterceptorCatch(i)}})}get(t,e){return this.request({...e,method:"get",url:t})}delete(t,e){return this.request({...e,method:"delete",url:t})}head(t,e){return this.request({...e,method:"head",url:t})}options(t,e){return this.request({...e,method:"options",url:t})}post(t,e,s){return this.request({...s,method:"post",url:t,data:e})}put(t,e,s){return this.request({...s,method:"put",url:t,data:e})}patch(t,e,s){return this.request({...s,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class Vr{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}async pendingRequest(t){const e=await this.getRequestId(t);if(this.pendingRequestMap.has(e))t.signal=this.pendingRequestMap.get(e)?.signal;else{const s=new AbortController;t.signal=s.signal,this.pendingRequestMap.set(e,s)}}async confirmRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&this.pendingRequestMap.delete(e)}async cancelRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&(this.pendingRequestMap.get(e)?.abort(),this.pendingRequestMap.delete(e))}async cancelAllRequest(){for(const t of this.pendingRequestMap.values())t.abort();this.pendingRequestMap.clear()}async getRequestId(t){const{url:e,method:s,params:i,data:r}=t;return await Ur({url:e,method:s,params:i,data:r})}}function Gc(n,t,e,s,i){const r=t/e;let a=0,o=0;switch(n){case"aspectFit":r>=1?(a=s,o=a/r,o>i&&(o=i,a=o*r)):(o=i,a=o*r,a>s&&(a=s,o=a/r));break;case"aspectFill":r>=1?(o=i,a=o*r):(a=s,o=a/r);break;case"widthFix":a=s,o=a/r;break;case"heightFix":o=i,a=o*r;break;case"scaleToFill":default:a=s,o=i;break}return{width:a,height:o}}const Ds=new Map;async function Uc(n){return new Promise((t,e)=>{As(n,(s,i)=>s?e(s):t({width:i.width,height:i.height,aspectRatio:i.width/i.height}))})}const As=(n,t)=>{if(Ds.has(n))return t(null,Ds.get(n));const e=new Image;e.onload=function(){Ds.set(n,{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height,element:e}),t(null,Ds.get(n))},e.onerror=function(s){t(s,null)},e.src=n},Vc=(n,t)=>{for(let e=0,s=n.length;e<s;e++){const i=n[e],{type:r}=i;if(r.split("/")[0]!=="image")continue;const a=new FileReader;a.onload=function(o){if(!o.target)return t("no reader target",null);const h=o.target.result,c=cn(h),l=new Blob([h]);Oi(l,(d,g)=>{if(!g)return t(d,null);As(g,(y,m)=>{if(!m)return t(y,null);zr(g,(x,b)=>{if(!b)return t(x,null);const S={name:i.name,fileType:c,size:i.size,width:m.width,height:m.height,imgUrl:g,imageData:b,blob:l};return t(null,S)})})})},a.readAsArrayBuffer(i)}},zr=(n,t)=>{As(n,(e,s)=>{if(!s)return t(e,null);const i=document.createElement("canvas"),r=i.getContext("2d");i.width=s.width,i.height=s.height,r.drawImage(s.element,0,0,i.width,i.height);const a=r.getImageData(0,0,i.width,i.height);return t(null,a)})},zc=(n,t=0,e=0)=>{const s=document.createElement("canvas"),i=s.getContext("2d");return s.width=t,s.height=e,i.drawImage(n,0,0,t,e),i.getImageData(0,0,t,e)},qc=(n,t=0,e=0)=>{const s=document.createElement("canvas"),i=s.getContext("2d");return s.width=t,s.height=e,i.drawImage(n,0,0,t,e),i.getImageData(0,0,t,e)},Hc=n=>{const t=n.width,e=n.height,s=t*e*3,i=s+54,r=[66,77,i&255,i>>8&255,i>>16&255,i>>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,s&255,s>>8&255,s>>16&255,s>>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=n.data;let c="";const l=t<<2;let d=e;const g=String.fromCharCode;do{const m=l*(d-1);let x="";for(let b=0;b<t;b++){const S=b<<2;x+=g(h[m+S+2])+g(h[m+S+1])+g(h[m+S])}for(let b=0;b<o;b++)x+=String.fromCharCode(0);c+=x}while(--d);function y(m){if(!window.btoa)throw"btoa undefined";let x="";if(typeof m=="string")x=m;else for(let b=0;b<m.length;b++)x+=String.fromCharCode(m[b]);return btoa(x)}return y(r.concat(a))+y(c)},jc=n=>{const{width:t,height:e}=n,s=document.createElement("canvas"),i=s.getContext("2d");return s.width=t,s.height=e,i.putImageData(n,0,0,0,0,t,e),s.toDataURL("image/png")},Wc=(n,t,e)=>{const{width:s,height:i}=n,r=document.createElement("canvas"),a=r.getContext("2d");r.width=s,r.height=i,a.putImageData(n,0,0,0,0,s,i);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},o,1)},Oi=(n,t)=>{const e=new FileReader;e.onload=function(s){s.target?t(null,s.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(n)},$c=(n,t)=>{Oi(n,function(e,s){if(s){const i=new Image;i.src=s}else t(e)})};function Jc(n){const t=[],e=[],s=[];let i=0;for(let h=0,c=n.data.length;h<c;h+=4)t[i]=n.data[h],e[i]=n.data[h+1],s[i]=n.data[h+2],i+=1;const r=Fi(t),a=Fi(e),o=Fi(s);return"rgb("+r+","+a+","+o+")"}function Fi(n){const t={},e=[],s=[];for(let o=0;o<n.length;o++)t[n[o]]?e.push(n[o]):t[n[o]]=1;let i=0;for(let o=0;o<e.length;o++){i=0;for(let h=0;h<e.length;h++)e[o]===e[h]&&(i+=1),s[o]=i}const r=Math.max.apply(null,s);let a=0;for(;a<s.length;a++)if(s[a]===r)return;return e[a]}const Zc=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[(a*e+e-o-1)*4],i[h+1]=t[(a*e+e-o-1)*4+1],i[h+2]=t[(a*e+e-o-1)*4+2],i[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(i,e,s)},Kc=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[((s-a-1)*e+o)*4],i[h+1]=t[((s-a-1)*e+o)*4+1],i[h+2]=t[((s-a-1)*e+o)*4+2],i[h+3]=t[((s-a-1)*e+o)*4+3]}return new ImageData(i,e,s)},Qc=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;i[h]=t[(o*e+e-a-1)*4],i[h+1]=t[(o*e+e-a-1)*4+1],i[h+2]=t[(o*e+e-a-1)*4+2],i[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(i,s,e)},tl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;i[h]=t[((s-o-1)*e+a)*4],i[h+1]=t[((s-o-1)*e+a)*4+1],i[h+2]=t[((s-o-1)*e+a)*4+2],i[h+3]=t[((s-o-1)*e+a)*4+3]}return new ImageData(i,s,e)},el=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1]+t[h+2])/3;i[h]=c,i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},sl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;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];i[h]=c,i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},il=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h]+t[h+1]+t[h+2])/3>127?255:0;i[h]=l,i[h+1]=l,i[h+2]=l,i[h+3]=t[h+3]}return new ImageData(i,e,s)},nl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=255-t[h],i[h+1]=255-t[h+1],i[h+2]=255-t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},rl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=0,i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},al=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=0,i[h+1]=t[h+1],i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},ol=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=0,i[h+1]=0,i[h+2]=t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},hl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=t[h+1],i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},cl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=0,i[h+2]=t[h+1],i[h+3]=t[h+3]}return new ImageData(i,e,s)},ll=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=0,i[h+1]=t[h+1],i[h+2]=t[h+1],i[h+3]=t[h+3]}return new ImageData(i,e,s)},ul=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h+1]+t[h+2])/2;i[h]=t[h],i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},dl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+2])/2;i[h]=c,i[h+1]=t[h+1],i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},fl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1])/2;i[h]=c,i[h+1]=c,i[h+2]=t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},ml=n=>qr(n,[-1,-1,-1,-1,9,-1,-1,-1,-1]),pl=n=>qr(n,[-1,-1,-1,-1,8,-1,-1,-1,-1]),gl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=t[h+1],i[h+2]=t[h+2],i[h+3]=255}return new ImageData(i,e,s)},yl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;if(t[h+3]===0)i[h]=255,i[h+1]=255,i[h+2]=255,i[h+3]=255;else{const c=Hr([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);i[h]=c[0],i[h+1]=c[1],i[h+2]=c[2],i[h+3]=c[3]}}return new ImageData(i,e,s)},wl=(n,t,e,s,i,r=!1,a)=>{const{data:o,width:h,height:c}=n;let l=i,d=s,g=t,y=e;if(l<0?l=0:l>h&&(l=h),d<0?d=0:d>c&&(d=c),g<1?g=1:g>h&&(g=h),y<1?y=1:y>c&&(y=c),l+g>h&&(g=h-l),d+y>c&&(y=c-d),r){const m=new Uint8ClampedArray(o.length);for(let b=0;b<c;b++)for(let S=0;S<h;S++){const C=(b*h+S)*4;S>=l&&S<=l+g&&b>=d&&b<=d+y?(m[C]=o[C],m[C+1]=o[C+1],m[C+2]=o[C+2],m[C+3]=o[C+3]):(m[C]=255,m[C+1]=255,m[C+2]=255,m[C+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(m,h,c)}else{const m=new Uint8ClampedArray(g*y*4);for(let b=d;b<=d+y;b++)for(let S=l;S<=l+g;S++){const C=((b-d)*g+S-l)*4,L=(b*h+S)*4;m[C]=o[L],m[C+1]=o[L+1],m[C+2]=o[L+2],m[C+3]=o[L+3]}return new ImageData(m,g,y)}},xl=(n,t,e,s)=>{const{data:i,width:r,height:a}=n;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(i.length);for(let l=0;l<a;l++)for(let d=0;d<r;d++){const g=(l*r+d)*4;let y=-1;d<o?l<o?y=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(y=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(l-(a-o),2))):d>r-o-1&&(l<o?y=Math.sqrt(Math.pow(d-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(y=Math.sqrt(Math.pow(d-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(y)>o?(h[g]=255,h[g+1]=255,h[g+2]=255,h[g+3]=s||e.toUpperCase()==="PNG"?0:255):(h[g]=i[g],h[g+1]=i[g+1],h[g+2]=i[g+2],h[g+3]=s||e.toUpperCase()==="PNG"?i[g+3]:255)}return new ImageData(h,r,a)},bl=(n,t,e,s,i,r=1e4)=>{const a=new Image;a.src=n;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,s,i),h.getImageData(0,0,s,i)},vl=(n,t)=>{const{data:e,width:s,height:i}=n,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;o++)for(let h=0;h<s;h++){const c=(o*s+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,s,i)},Sl=(n,t,e=!1)=>{const{data:s,width:i,height:r}=n,a=new Uint8ClampedArray(s.length);for(let h=0;h<r;h++)for(let c=0;c<i;c++){const l=(h*i+c)*4;s[l+3]===0?(a[l]=255,a[l+1]=255,a[l+2]=255):(a[l]=s[l],a[l+1]=s[l+1],a[l+2]=s[l+2]);let d=s[l+3];e?d=Math.max(Math.min(Math.floor(255*t),255),0):d=Math.max(Math.min(Math.floor(d+255*t),255),0),a[l+3]=d}return new ImageData(a,i,r)},Cl=(n,t,e,s)=>{const{data:i,width:r,height:a}=n,{data:o,width:h,height:c}=t;let l=e,d=s;e+c>a&&(l=a-c),s+h>r&&(d=r-h);const g=new Uint8ClampedArray(i.length);for(let m=0;m<a;m++)for(let x=0;x<r;x++){const b=(m*r+x)*4;if(x<d||x>d+h||m<=l||m>=l+c)g[b]=i[b],g[b+1]=i[b+1],g[b+2]=i[b+2],g[b+3]=i[b+3];else{const S=(m*r+x-((l+1)*r+(m-(l+1))*(r-h))+h-d-1)*4,C=[o[S],o[S+1],o[S+2],o[S+3]],L=[i[b],i[b+1],i[b+2],i[b+3]],R=Hr(C,L);g[b]=R[0],g[b+1]=R[1],g[b+2]=R[2],g[b+3]=R[3]}}return new ImageData(g,r,a)},El=(n,t,e,s,i,r=10)=>{const{data:a,width:o,height:h}=n;let c=i,l=s,d=t,g=e;c<0?c=0:c>o&&(c=o),l<0?l=0:l>h&&(l=h),d<1?d=1:d>o&&(d=o),g<1?g=1:g>h&&(g=h),c+d>o&&(d=o-c),l+g>h&&(g=h-l);const y=new Uint8ClampedArray(a.length);for(let x=0;x<h;x++)for(let b=0;b<o;b++){const S=(x*o+b)*4;if(b>=c&&b<=c+d&&x>=l&&x<=l+g){const C=Math.floor((b-c)/r),L=Math.floor((x-l)/r);let R=Math.floor(r*(C+1)-r/2+c),X=Math.floor(r*(L+1)-r/2+l);R>o-1&&(R=o-1),X>h-1&&(X=h-1);const Y=(X*o+R)*4;y[S]=a[Y],y[S+1]=a[Y+1],y[S+2]=a[Y+2],y[S+3]=a[Y+3]}else y[S]=a[S],y[S+1]=a[S+1],y[S+2]=a[S+2],y[S+3]=a[S+3]}return new ImageData(y,o,h)},Tl=(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:s,width:i,height:r}=n,{data:a}=t,o=new Uint8ClampedArray(s.length),{backgroundColor:h,changeIntoColor:c}=e;for(let d=0;d<r;d++)for(let g=0;g<i;g++){const y=(d*i+g)*4,m=a[y],x=a[y+1],b=a[y+2],S=a[y+3];m===h.r&&x===h.g&&b===h.b&&S===h.a&&c.a!==0?(o[y]=c.r,o[y+1]=c.g,o[y+2]=c.b,o[y+3]=c.a):(o[y]=s[y],o[y+1]=s[y+1],o[y+2]=s[y+2],o[y+3]=s[y+3])}return new ImageData(o,i,r)}return n},qr=(n,t)=>{const{data:e,width:s,height:i}=n,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;for(let l=0;l<3;l++){const d=c+l;h===0||h===s-1||o===0||o===i-1?r[d]=e[d]:r[d]=t[0]*e[d-s*4-4]+t[1]*e[d-s*4]+t[2]*e[d-s*4+4]+t[3]*e[d-4]+t[4]*e[d]+t[5]*e[d+4]+t[6]*e[d+s*4-4]+t[7]*e[d+s*4]+t[8]*e[d+s*4+4]}r[c+3]=e[c+3]}return new ImageData(r,s,i)},Hr=(n,t)=>{if(n&&n.length===4&&t&&t.length===4){const e=n[3],s=t[3];if(e===255||s===0)return n;if(e===0)return t;{const i=e/255,r=s/255,a=Math.max(Math.min(Math.floor(n[0]*i+t[0]*r*(1-i)),255),0),o=Math.max(Math.min(Math.floor(n[1]*i+t[1]*r*(1-i)),255),0),h=Math.max(Math.min(Math.floor(n[2]*i+t[2]*r*(1-i)),255),0),c=Math.max(Math.min(Math.floor((i+r*(1-i))*255),255),0);return[a,o,h,c]}}return[255,255,255,255]},Ni=function(){const n=[];return{writeByte(t){n.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,s=t.length){for(let i=0;i<s;i++)this.writeByte(t[i+e])},writeString(t){for(let e=0,s=t.length;e<s;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return n},toString(){let t="[";for(let e=0,s=n.length;e<s;e++)e>0&&(t+=","),t+=n[e];return t+="]",t}}},jr=function(){let n=0,t=0,e=0,s="";const i=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){s+=String.fromCharCode(i(a&63))};return{writeByte(a){for(n=n<<8|a&255,t+=8,e+=1;t>=6;)r(n>>>t-6),t-=6},flush(){if(t>0&&(r(n<<6-t),n=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)s+="="}},toString(){return s}}},Wr=function(n,t,e){const s=new Array(n*n),i=function(o){const h=o;let c=0,l=0;return{write(d,g){if(d>>>g)throw new Error("length over");for(;c+g>=8;)h.writeByte(255&(d<<c|l)),g-=8-c,d>>>=8-c,l=0,c=0;l=d<<c|l,c=c+g},flush(){c>0&&h.writeByte(l)}}},r=function(o){const h=1<<o,c=(1<<o)+1;let l=o+1;const d=a();for(let b=0;b<h;b++)d.add(String.fromCharCode(b));d.add(String.fromCharCode(h)),d.add(String.fromCharCode(c));const g=Ni(),y=i(g);y.write(h,l);let m=0,x=String.fromCharCode(s[m]);for(m+=1;m<s.length;){const b=String.fromCharCode(s[m]);m+=1,d.contains(x+b)?x=x+b:(y.write(d.indexOf(x),l),d.size()<4095&&(d.size()==1<<l&&(l+=1),d.add(x+b)),x=b)}return y.write(d.indexOf(x),l),y.write(c,l),y.flush(),g.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){s[h*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(me("0x"+t[1]+t[2])),o.writeByte(me("0x"+t[3]+t[4])),o.writeByte(me("0x"+t[5]+t[6])),o.writeByte(me("0x"+e[1]+e[2])),o.writeByte(me("0x"+e[3]+e[4])),o.writeByte(me("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(n),o.writeShort(n),o.writeByte(0);const h=2,c=r(h);o.writeByte(h);let l=0;for(;c.length-l>255;)o.writeByte(255),o.writeBytes(c,l,255),l+=255;o.writeByte(c.length-l),o.writeBytes(c,l,c.length-l),o.writeByte(0),o.writeString(";")}}},$r=function(n,t,e,s){const i=Wr(n,t,e);for(let c=0;c<n;c++)for(let l=0;l<n;l++)i.setPixel(l,c,s(l,c));const r=Ni();i.write(r);const a=jr(),o=r.toByteArray();for(let c=0,l=o.length;c<l;c++)a.writeByte(o[c]);a.flush();let h="";return h+="data:image/gif;base64,",h+=a,h},xt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Be={M:0,L:1,H:2,Q:3},ee={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},K={glog:function(n){if(n<1)throw new Error("glog("+n+")");return K.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return K.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let n=0;n<8;n++)K.EXP_TABLE[n]=1<<n;for(let n=8;n<256;n++)K.EXP_TABLE[n]=K.EXP_TABLE[n-4]^K.EXP_TABLE[n-5]^K.EXP_TABLE[n-6]^K.EXP_TABLE[n-8];for(let n=0;n<255;n++)K.LOG_TABLE[K.EXP_TABLE[n]]=n;const z={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(;z.getBCHDigit(t)-z.getBCHDigit(z.G15)>=0;)t^=z.G15<<z.getBCHDigit(t)-z.getBCHDigit(z.G15);return(n<<10|t)^z.G15_MASK},getBCHTypeNumber:function(n){let t=n<<12;for(;z.getBCHDigit(t)-z.getBCHDigit(z.G18)>=0;)t^=z.G18<<z.getBCHDigit(t)-z.getBCHDigit(z.G18);return n<<12|t},getBCHDigit:function(n){let t=0;for(;n!=0;)t++,n>>>=1;return t},getPatternPosition:function(n){return z.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,t,e){switch(n){case ee.PATTERN000:return(t+e)%2==0;case ee.PATTERN001:return t%2==0;case ee.PATTERN010:return e%3==0;case ee.PATTERN011:return(t+e)%3==0;case ee.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case ee.PATTERN101:return t*e%2+t*e%3==0;case ee.PATTERN110:return(t*e%2+t*e%3)%2==0;case ee.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){let t=new we([1],0);for(let e=0;e<n;e++)t=t.multiply(new we([1,K.gexp(e)],0));return t},getLengthInBits:function(n,t){if(1<=t&&t<10)switch(n){case xt.MODE_NUMBER:return 10;case xt.MODE_ALPHA_NUM:return 9;case xt.MODE_8BIT_BYTE:return 8;case xt.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(t<27)switch(n){case xt.MODE_NUMBER:return 12;case xt.MODE_ALPHA_NUM:return 11;case xt.MODE_8BIT_BYTE:return 16;case xt.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(t<41)switch(n){case xt.MODE_NUMBER:return 14;case xt.MODE_ALPHA_NUM:return 13;case xt.MODE_8BIT_BYTE:return 16;case xt.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 r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const h=n.isDark(r,a);for(let c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(let l=-1;l<=1;l++)a+l<0||t<=a+l||c==0&&l==0||h==n.isDark(r+c,a+l)&&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;n.isDark(r,a)&&o++,n.isDark(r+1,a)&&o++,n.isDark(r,a+1)&&o++,n.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++)n.isDark(r,a)&&!n.isDark(r,a+1)&&n.isDark(r,a+2)&&n.isDark(r,a+3)&&n.isDark(r,a+4)&&!n.isDark(r,a+5)&&n.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)n.isDark(a,r)&&!n.isDark(a+1,r)&&n.isDark(a+2,r)&&n.isDark(a+3,r)&&n.isDark(a+4,r)&&!n.isDark(a+5,r)&&n.isDark(a+6,r)&&(e+=40);let s=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)n.isDark(a,r)&&s++;const i=Math.abs(100*s/t/t-50)/5;return e+=i*10,e}};class we{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let s=0;for(;s<t.length&&t[s]==0;)s++;this.num=new Array(t.length-s+e);for(let i=0;i<t.length-s;i++)this.num[i]=t[i+s]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let s=0;s<this.getLength();s++)for(let i=0;i<t.getLength();i++)e[s+i]^=K.gexp(K.glog(this.get(s))+K.glog(t.get(i)));return new we(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=K.glog(this.get(0))-K.glog(t.get(0)),s=new Array(this.getLength());for(let i=0;i<this.getLength();i++)s[i]=this.get(i);for(let i=0;i<t.getLength();i++)s[i]^=K.gexp(K.glog(t.get(i))+e);return new we(s,0).mod(t)}}class Ut{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 s=Ut.getRsBlockTable(t,e);if(s==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const i=s.length/3,r=[];for(let a=0;a<i;a++){const o=s[a*3+0],h=s[a*3+1],c=s[a*3+2];for(let l=0;l<o;l++)r.push(new Ut(h,c))}return r}static getRsBlockTable(t,e){switch(e){case Be.L:return Ut.RS_BLOCK_TABLE[(t-1)*4+0];case Be.M:return Ut.RS_BLOCK_TABLE[(t-1)*4+1];case Be.Q:return Ut.RS_BLOCK_TABLE[(t-1)*4+2];case Be.H:return Ut.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Jr{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 s=0;s<e;s++)this.putBit((t>>>e-s-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 Pl{mode;data;constructor(t){this.mode=xt.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,s=this.data.length;e<s;e++)t.put(this.data.charCodeAt(e),8)}}class se{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Be[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new Pl(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=Ut.getRSBlocks(t,this.errorCorrectLevel),s=new Jr;let i=0;for(let r=0;r<e.length;r++)i+=e[r].dataCount;for(let r=0;r<this.dataList.length;r++){const a=this.dataList[r];s.put(a.mode,4),s.put(a.getLength(),z.getLengthInBits(a.mode,t)),a.write(s)}if(s.getLengthInBits()<=i*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 s=0;s<this.moduleCount;s++){this.modules[s]=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++)this.modules[s][i]=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=se.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let s=-1;s<=7;s++)if(!(t+s<=-1||this.moduleCount<=t+s))for(let i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=s&&s<=6&&(i==0||i==6)||0<=i&&i<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=i&&i<=4?this.modules[t+s][e+i]=!0:this.modules[t+s][e+i]=!1)}getBestMaskPattern(){let t=0,e=0;for(let s=0;s<8;s++){this.makeImpl(!0,s);const i=z.getLostPoint(this);(s==0||t>i)&&(t=i,e=s)}return e}createMovieClip(t,e,s){const i=t.createEmptyMovieClip(e,s),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]&&(i.beginFill(0,100),i.moveTo(c,o),i.lineTo(c+r,o),i.lineTo(c+r,o+r),i.lineTo(c,o+r),i.endFill())}}return i}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=z.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let s=0;s<t.length;s++){const i=t[e],r=t[s];if(this.modules[i][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[i+a][r+o]=!0:this.modules[i+a][r+o]=!1}}setupTypeNumber(t){const e=z.getBCHTypeNumber(this.typeNumber);for(let s=0;s<18;s++){const i=!t&&(e>>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=i}for(let s=0;s<18;s++){const i=!t&&(e>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=i}}setupTypeInfo(t,e){const s=this.errorCorrectLevel<<3|e,i=z.getBCHTypeInfo(s);for(let r=0;r<15;r++){const a=!t&&(i>>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&&(i>>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 s=-1,i=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[i][o-h]==null){let c=!1;a<t.length&&(c=(t[a]>>>r&1)==1),z.getMask(e,i,o-h)&&(c=!c),this.modules[i][o-h]=c,r--,r==-1&&(a++,r=7)}if(i+=s,i<0||this.moduleCount<=i){i-=s,s=-s;break}}}static createData(t,e,s){const i=Ut.getRSBlocks(t,e),r=new Jr;for(let o=0;o<s.length;o++){const h=s[o];r.put(h.mode,4),r.put(h.getLength(),z.getLengthInBits(h.mode,t)),h.write(r)}let a=0;for(let o=0;o<i.length;o++)a+=i[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(se.PAD0,8),r.getLengthInBits()>=a*8));)r.put(se.PAD1,8);return se.createBytes(r,i)}static createBytes(t,e){let s=0,i=0,r=0;const a=new Array(e.length),o=new Array(e.length);for(let d=0;d<e.length;d++){const g=e[d].dataCount,y=e[d].totalCount-g;i=Math.max(i,g),r=Math.max(r,y),a[d]=new Array(g);for(let S=0;S<a[d].length;S++)a[d][S]=255&t.buffer[S+s];s+=g;const m=z.getErrorCorrectPolynomial(y),b=new we(a[d],m.getLength()-1).mod(m);o[d]=new Array(m.getLength()-1);for(let S=0;S<o[d].length;S++){const C=S+b.getLength()-o[d].length;o[d][S]=C>=0?b.get(C):0}}let h=0;for(let d=0;d<e.length;d++)h+=e[d].totalCount;const c=new Array(h);let l=0;for(let d=0;d<i;d++)for(let g=0;g<e.length;g++)d<a[g].length&&(c[l++]=a[g][d]);for(let d=0;d<r;d++)for(let g=0;g<e.length;g++)d<o[g].length&&(c[l++]=o[g][d]);return c}}const Zr=Math.ceil,Xe=Math.floor,Kr=Math.round;function _l(n,t){const e=on(n),s=t?.ecc||"H",i=t?.size||256,r=-1,a=t?.padding||0,o=t?.color||"#000000",h=t?.background||"#ffffff",c=new se(r,s);c.addData(e),c.make();const l=c.getModuleCount(),d=(i-a*2)/l,g=a,y=i-a;return $r(i,o,h,function(m,x){if(g<=m&&m<y&&g<=x&&x<y){const b=Xe((m-g)/d),S=Xe((x-g)/d);return c.isDark(S,b)?0:1}else return 1})}function Dl(n,t){const e=t.x||0,s=t.y||0,i=on(n),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?Xe(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",d=t.background||"#ffffff",g=new se(c,a);g.addData(i),g.make();const y=g.getModuleCount(),m=(o-h*2)/y;r.fillStyle=d,r.fillRect(e,s,o,o);for(let x=0;x<y;x++)for(let b=0;b<y;b++){const S=Zr((b+1)*m)-Xe(b*m),C=Zr((x+1)*m)-Xe(x*m);r.fillStyle=g.isDark(x,b)?l:d,r.fillRect(e+Kr(b*m)+h,s+Kr(x*m)+h,S,C)}}class rt extends U{shapesCountChange=!1;constructor(t){super(t)}shapeInit(){}frameStart(t){return this.shapesCountChange&&(this.shapesCountChange=!1,this.shapes.forEach(e=>{e.parent=this,e.initPathD()}),this.pathd=this.initPathD(),this.shapes.forEach(e=>{!e.forceCXY&&!e.independentTransformInGroup&&(e.cX=this.cX-e.diffXInGroup,e.cY=this.cY-e.diffYInGroup)})),super.frameStart(t)}frameUpdate(t,e){this.shapes.forEach(s=>{!s.independentTransformInGroup&&!s.isDragging&&(s.x=this.x+s.diffXInGroup,s.y=this.y+s.diffYInGroup,s.degree=this.degree+s.diffDegreeInGroup,s.scalarX=this.scalarX*s.diffScalarXInGroup,s.scalarY=this.scalarY*s.diffScalarYInGroup)}),super.frameUpdate(t,e)}addShape(t){(Array.isArray(t)?t:[t]).forEach(e=>{this.shapes.findIndex(s=>s.id==e.id)==-1&&(e.on("draging",(s,i)=>{this.enableDrag&&(this.x+=s,this.y+=i,this.emit("draging",s,i,e))}),this.shapes.push(e),this.shapesCountChange=!0)})}getBoundingClientRect(){const t=[],e=[];this.shapes.forEach(h=>{const c=h.getBoundingClientRect();c&&(t.push(c.x,c.x+c.width),e.push(c.y,c.y+c.height))});const s=this.pathd?.getBoundingClientRect();if(s&&(s.width||s.height)&&(t.push(s.x,s.x+s.width),e.push(s.y,s.y+s.height)),t.length==0||e.length==0)return null;const i=Math.min.apply(0,t),r=Math.min.apply(0,e),a=Math.max.apply(0,t),o=Math.max.apply(0,e);return{x:i,y:r,width:a-i,height:o-r}}setAttrs(t,e){typeof t!="string"?(super.setAttr(t),this.shapes.forEach(s=>{s.setAttr(t)})):e&&(super.setAttr(t,e),this.shapes.forEach(s=>{s.setAttr(t,e)}))}sortPathD(){this.shapes=this.shapes.map(t=>{const e=t.initPathD();return{shape:t,perimeter:e.perimeterPoints()}}).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendFill(t){const e=t.shapes.length,s=this.shapes.length;if(e<s)return t.expendFill(this);for(let i=s;i<e;i++){const a=t.shapes[i].initPathD().polymorphPoints,o=a[0],h=a[1],c=[["M",o,h]];for(let l=2;l+5<a.length;l+=6)c.push(["C",o,h,o,h,o,h]);this.addShape(new U({attrs:{...t.shapes[i].getAttrs()},d:c}))}}strokeDashTween(t,e){switch(e?.type){case"sequence":const s=this.shapes.length-1;this.shapes.forEach((o,h)=>{o.strokeDashTween(t,{...e,delay:h,onStart:()=>{h==0&&e?.onGroupStart?.()},onUpdate:()=>{e?.onGroupUpdate?.()},onComplete:()=>{h==s&&e?.onGroupComplete?.()}})});break;case"parallel":default:const i=new ps({frameDuration:t}),r={},a={};this.shapes.forEach((o,h)=>{const c=At(o.getTotalLength(),0);r[`offset_${h}`]=c,a[`offset_${h}`]=0,o.setAttr({strokeDasharray:`${c} ${c}`,strokeDashoffset:`${c}`})}),i.addTween(r,a,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(o,h)=>{for(let c in o){const l=Hs(c).number;this.shapes[l].setAttr("strokeDashoffset",""+At(o[c],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),i.play();break}}}class ce extends U{toX;toY;constructor(t){super(t),this.toX=t?.toX||0,this.toY=t?.toY||0;let e=this.toX-this.x,s=this.toY-this.y;return new Proxy(this,{set(i,r,a,o){switch(r){case"x":i.toX=a+e;break;case"y":i.toY=a+s;break;case"toX":e=a-i.x;break;case"toY":s=a-i.y;break}return Reflect.set(i,r,a,o)}})}toSVGPathData(){return[["m",0,0],["l",this.toX-this.x,this.toY-this.y]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.lineTo(this.toX-this.x,this.toY-this.y)}intersection(t){const e=new On({x:this.x,y:this.y,toX:this.toX,toY:this.toY}),s=new On({x:t.x,y:t.y,toX:t.toX,toY:t.toY});return e.intersection(s)}}class Al extends U{cx;cy;toX;toY;isLineThrough;constructor(t){super(t),this.cx=t?.cx||0,this.cy=t?.cy||0,this.toX=t?.toX||0,this.toY=t?.toY||0,this.isLineThrough=typeof t?.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["m",0,0],["q",t-this.x,e-this.y,this.toX-this.x,this.toY-this.y]]}else return[["m",0,0],["q",this.cx-this.x,this.cy-this.y,this.toX-this.x,this.toY-this.y]]}toCanvasContext(t){if(t.beginPath(),t.moveTo(0,0),this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e-this.x,s-this.y,this.toX-this.x,this.toY-this.y)}else t.quadraticCurveTo(this.cx-this.x,this.cy-this.y,this.toX-this.x,this.toY-this.y)}}class Qr extends er{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,s)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,s)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const s=za(e);for(let i of s.stylesheet.rules)for(let r of i.declarations)for(let a of i.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,s)=>{let i=this.groups.length;for(;i--;)if(this.groups[i]!=this.currentItem){let r="",a="";for(let o in this.groups[i])o=="transform"?r=this.groups[i].transform:o=="class"&&this.globalStyles["."+this.groups[i][o]]?a=this.globalStyles["."+this.groups[i][o]].join(";")+";"+a:o=="id"&&this.globalStyles["#"+this.groups[i][o]]?a=this.globalStyles["#"+this.groups[i][o]].join(";")+";"+a:typeof this.currentItem[o]>"u"&&(this.currentItem[o]=this.groups[i][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),Bi(this.currentItem.style,this.currentItem,Xi)}switch(this.processAttrs(e,s),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 s=[],i;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":i={},e.style&&Bi(e.style,i),i.offset=i.offset||e.offset,i.color=i["stop-color"]||e["stop-color"],i.opacity=i["stop-opacity"]||e["stop-opacity"],~(i.offset+"").indexOf("%")?i.offset=parseFloat(i.offset):i.offset=parseFloat(i.offset)*100,i.offset=+i.offset.toFixed(2),this.grad.stops.push(i);break;case"linearGradient":this.grad.angle=(360+Yi(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),s=[this.grad.angle];for(let o=0,h=this.grad.stops.length;o<h;o++)i=this.grad.stops[o],o&&o!=h-1?s.push(i.color+":"+i.offset):s.push(i.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break;case"radialGradient":s=[];for(let o=0,h=this.grad.stops.length;o<h;o++)i=this.grad.stops[o],o&&o!=h-1?s.push(i.color+":"+i.offset):s.push(i.color);this.idtops[this.grad.id]=s.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(Xi.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"&&Bi(a,this.currentItem,Xi),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 Yi(n,t,e,s,i,r){if(typeof i>"u"||typeof r>"u"){const a=n-e,o=t-s;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return Yi(n,t,i,r)-Yi(e,s,i,r)}function Bi(n,t,e){const s=(n+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,a=s.length;r<a;r++){let o=s[r].split(":"),h=o[0].replace(i,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=o[1].replace(i,""))}}const Xi=["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 Il{app;rootEl;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e,s){this.app=t,this.rootEl=yt.createSVGElement("svg"),A.empty(this.app.container),A.insert(this.app.container,this.rootEl),e&&s?this.setSize(e,s):(this.setSize(this.app.width,this.app.height),this.app.on("resize",()=>{this.setSize(this.app.width,this.app.height)})),this.app.captureDrag({start:()=>{this.isMouseDown=!0,this.dragDx=0,this.dragDy=0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.dragDx=0,this.dragDy=0,this.setCursor()},move:(i,r)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=r.dx,this.dragDy+=r.dy),this.setCursor()}}),this.app.on("tap",()=>{for(let i of this.shapes)if(this.currentMouseInShape==i){i.emit("clicked");let r=i.parent;for(;r;)r.emit("clicked",i),r=r.parent;break}})}setCursor(){this.currentEnableDragMouseInShape?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShape?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}setSize(t,e){return A.attribute(this.rootEl,{viewBox:`0 0 ${t} ${e}`,width:`${t}`,height:`${e}`}),this}download(){return yt.downloadFromSVGElement(this.rootEl)}_addDrawShape(t){this.shapes.findIndex(e=>e.id==t.id)===-1&&(this.shapes.push(t),t instanceof rt&&t.shapes.forEach(e=>{this._addDrawShape(e)}))}path(t){(Array.isArray(t)?t:[t]).forEach(e=>{this._addDrawShape(e)}),this.isMouseDown&&this.currentEnableDragMouseInShape||(this.currentMouseInShape=void 0);for(let e of this.shapes){if(!e.isShow){e.el&&(A.remove(e.el),delete e.el);continue}if(e.frameStart(this.app.mousePoint),e.el||(e instanceof Ge?e.el=this.text(e.text,e.x,e.y,fn(e.getAttrs(),(i,r)=>typeof r=="string")):(e.el=yt.createSvgPath(e.toSVGPathD(),e.id),A.insert(this.rootEl,e.el))),e.followMouse&&(!Ke(e.x,this.app.mousePoint.x,5)||!Ke(e.y,this.app.mousePoint.y,5))&&e.followTo(this.app.mousePoint),e.targetToAfterDragFree&&(this.isMouseDown||e.runEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShape==e){e.isDragging=!0;const i=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,i||r){if(e.x+=i,e.y+=r,e.alongPath){const a=e.alongPath.closestPoint(e.x,e.y);e.x=a.point.x-e.cX,e.y=a.point.y-e.cY}e.emit("draging",i,r)}}else e.isDragging=!1;e instanceof Ge&&(e.setAttr("x",String(e.x)),e.setAttr("y",String(e.y))),e.frameUpdate(this.app.mousePoint);const s=e.toSVGPathD();if(this.attr(e,fn(e.getAttrs(),(i,r)=>typeof r=="string")),this.attr(e,"d",s),!this.currentMouseInShape){const i=e.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||e.isPointInStroke(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||!1;e.isMouseIn=i,i&&(this.currentMouseInShape=e,e.enableDrag&&(this.currentEnableDragMouseInShape=e))}e.frameEnd(this.app.mousePoint)}this.currentMouseInShape||(this.currentEnableDragMouseInShape=void 0)}delete(t){(Array.isArray(t)?t:[t]).forEach(e=>{e.el&&A.remove(e.el),delete e.el,this.shapes=this.shapes.filter(s=>s.id!==e.id)})}clear(){this.shapes.forEach(t=>{t.el&&A.remove(t.el),delete t.el}),A.empty(this.rootEl),this.shapes=[]}attr(t,e,s){const i=t.el||t;return i instanceof SVGElement?e===void 0&&s===void 0?A.attribute(i):typeof e=="string"&&s===void 0?A.attribute(i,ft(e))||"":(typeof e=="object"?A.attribute(i,e):typeof e=="string"&&s!==void 0&&A.attribute(i,ft(e),s),this):this}circle(t,e,s){return this.path(new Vt({x:t,y:e,radius:s}))}circleEl(t,e,s){const i=yt.createSVGElement("circle",{cx:String(t),cy:String(e),r:String(s)});return A.insert(this.rootEl,i),i}ellipse(t,e,s,i){return this.path(new ea({x:t,y:e,rx:s,ry:i}))}ellipseEl(t,e,s,i){const r=yt.createSVGElement("ellipse",{cx:String(t),cy:String(e),rx:String(s),ry:String(i)});return A.insert(this.rootEl,r),r}rect(t,e,s,i){return this.path(new zt({x:t,y:e,width:s,height:i}))}rectEl(t,e,s,i){const r=yt.createSVGElement("rect",{x:String(t),y:String(e),width:String(s),height:String(i)});return A.insert(this.rootEl,r),r}image(t,e,s,i,r){}text(t,e,s,i){const r=yt.createSVGElement("text",{x:String(e),y:String(s)});return A.html(r,t),this.attr(r,Object.assign({"alignment-baseline":"middle"},i)),A.insert(this.rootEl,r),r}textWithTspan(t,e,s,i){const r=i?.["line-height"]||"1.2em",a=yt.createSVGElement("text",{x:String(e),y:String(s)});return t.split(`
|
|
41
|
-
`).forEach((o,h)=>{if(o.trim()){const c=yt.createSVGElement("tspan",{x:String(e),dy:h>0?r:"0"});A.html(c,o),A.insert(a,c),this.attr(c,Object.assign({"alignment-baseline":"middle"},i))}}),A.insert(this.rootEl,a),a}}class kl extends rt{svgWidth=0;svgHeight=0;width=0;height=0;constructor(t){super(t);const e=new Qr(t.svg).parse();for(let s=0,i=e.length;s<i;s++){const r=e[s];if(r.type=="viewbox"&&r.width&&r.height){if(this.svgWidth=parseFloat(r.width),this.svgHeight=parseFloat(r.height),t.width){const l=this.svgWidth/this.svgHeight;this.width=t.width,this.height=this.width/l}else this.width=this.svgWidth,this.height=this.svgHeight;continue}if(r.type!="path"||!ae.isSVGPath(r.path))continue;const a={};for(const l in r)l==="type"||l==="path"||l==="transform"||(a[l]=r[l]);const o=ae.absolutizeSVGPath(ae.parseSVGPath(r.path)),h=[];let c=[];for(let l=0,d=o.length;l<d;l++){const g=o[l];c.push(g),g[0].toLowerCase()=="z"&&(h.push(c),c=[])}c.length&&h.push(c),h.forEach(l=>{const d=mi(r.transform??"");d.scale(this.width&&this.svgWidth?this.width/this.svgWidth:1),this.addShape(new U({...t,attrs:{...a,...t?.attrs||{}},d:l,originMatrix:d}))})}}shapeInit(){this.trim()}}class Vt extends U{radius;constructor(t){super(t),this.radius=t?.radius||0}getBoundingClientRect(){return{x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2}}toSVGPathData(){return this.radius?[["m",0,-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:[["m",0,0]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.radius===t.radius&&this.mass===t.mass}midPointBtw(t){return{x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2}}length(){return rs(this.x,this.y)}scalar(t){return this.x*=t,this.y*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y;return{x:s*t.x-e*t.y,y:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y}}div(t){return{x:this.x/t.x,y:this.y/t.y}}add(t){return{x:this.x+t.x,y:this.y+t.y}}sub(t){return{x:this.x-t.x,y:this.y-t.y}}dot(t){return this.x*t.x+this.y*t.y}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y}}checkCollision(t){const e=t.x-this.x,s=t.y-this.y;if(Math.sqrt(e*e+s*s)<this.radius+t.radius){const r=Math.atan2(s,e),a={x:0,y:0},o=Pt(-r,e,s),h=Pt(-r,this.vx,this.vy),c=Pt(-r,t.vx,t.vy),l=h.x-c.x;h.x=((this.mass-t.mass)*h.x+2*t.mass*c.x)/(this.mass+t.mass),c.x=l+h.x;const d=Math.abs(h.x)+Math.abs(c.x),g=this.radius+t.radius-Math.abs(a.x-o.x);a.x+=h.x/d*g,o.x+=c.x/d*g;const y=Pt(r,a.x,a.y),m=Pt(r,o.x,o.y);t.x=this.x+m.x,t.y=this.y+m.y,this.x=this.x+y.x,this.y=this.y+y.y;const x=Pt(r,h.x,h.y),b=Pt(r,c.x,c.y);this.vx=x.x,this.vy=x.y,t.vx=b.x,t.vy=b.y}}checkWall(t){const e=typeof t?.bounce=="number"?t.bounce:-1,s=t.wall.x,i=t.wall.y,r=t.wall.x+t.wall.width,a=t.wall.y+t.wall.height;this.x+this.radius>r?(this.x=r-this.radius,this.vx*=e):this.x-this.radius<s&&(this.x=s+this.radius,this.vx*=e),this.y+this.radius>a?(this.y=a-this.radius,this.vy*=e):this.y-this.radius<i&&(this.y=i+this.radius,this.vy*=e)}}class ta extends U{points;isStraight;constructor(t){if(super(t),this.points=t.points,this.points.length<3)throw new Error("points length must >= 3");this.isStraight=typeof t?.isStraight=="boolean"?t.isStraight:!0}toSVGPathData(){const t=[],e=this.points.length;if(this.isStraight){t.push(["M",this.points[0].x,this.points[0].y]);for(let s=1;s<=e-1;s++)t.push(["L",this.points[s].x,this.points[s].y]);t.push(["Z"])}else{const s=(this.points[0].x+this.points[e-1].x)/2,i=(this.points[0].y+this.points[e-1].y)/2;t.push(["M",s,i]);for(let r=0;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.push(["Q",this.points[r].x,this.points[r].y,a,o])}t.push(["Q",this.points[e-1].x,this.points[e-1].y,s,i])}return t}toCanvasContext(t){t.beginPath();const e=this.points.length;if(this.isStraight){t.moveTo(this.points[0].x,this.points[0].y);for(let s=1;s<=e-1;s++)t.lineTo(this.points[s].x,this.points[s].y);t.closePath()}else{const s=(this.points[0].x+this.points[e-1].x)/2,i=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(s,i);for(let r=0;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.points[r].y,a,o)}t.quadraticCurveTo(this.points[e-1].x,this.points[e-1].y,s,i)}}isContainPoint(t,e){const s=this.points.length;let i=!1;const r=2e-10;for(let a=0,o=s-1;a<s;o=a,a++){const h=this.points[a].x,c=this.points[a].y,l=this.points[o].x,d=this.points[o].y;if(h===t&&c===e||l===t&&d===e||e===c&&e===d)return!0;if(e>=c&&e<d||e<c&&e>=d){const g=(l-h)/(d-c),y=h+g*(e-c);if(y===t||Math.abs(y-t)<r)return!0;y>t&&(i=!i)}}return i}[Symbol.iterator](){let t=-1;return{next:()=>({value:t<=this.points.length-1?this.points[++t]:void 0,done:t>=this.points.length})}}}class zt extends U{width;height;borderRadius;constructor(t){super(t),this.width=t.width,this.height=t.height,this.borderRadius=t.borderRadius||0}static fromCubicBezier(t,e,s,i,r,a,o,h){const c=new mt({x:t,y:e,c1x:s,c1y:i,c2x:r,c2y:a,toX:o,toY:h});return new zt(c.getBoundingClientRect())}getBoundingClientRect(){return{x:this.x,y:this.y,width:this.width,height:this.height}}toSVGPathData(){return this.borderRadius?[["m",this.borderRadius,0],["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",0,0],["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&&this.borderRadius===t.borderRadius}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}}class ea extends U{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}getBoundingClientRect(){return{x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2}}toSVGPathData(){return[["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(0,0,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class Ml extends U{constructor(t){super(t)}toSVGPathData(){return[["m",-50,-25],["l",50,0],["l",0,-25],["l",50,50],["l",-50,50],["l",0,-25],["l",-50,0],["l",0,-50],["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 Ll extends U{constructor(t){super(t)}toSVGPathData(){return[["m",4,24],["l",4,-8],["l",6,-6],["l",1,-10],["l",-6,-10],["l",-7,10],["l",-4,0],["l",-7,-10],["l",-6,10],["l",1,10],["l",6,6],["l",4,8],["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()}}class Rl extends U{rx;ry;constructor(t){super(t),this.rx=t?.rx||10,this.ry=t?.ry||10}toSVGPathData(){return[["m",0,0],["l",this.rx*2.4,-this.ry*3.14],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,-this.ry*1.5],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,this.ry*1.5],["l",this.rx*2.4,this.ry*3.14],["z"]]}}class Ol extends U{rx;ry;constructor(t){super(t),this.rx=t?.rx??50,this.ry=t?.ry??50}toSVGPathData(){return[["m",0,0+this.ry*.3],["C",0,0,0-this.rx/2,0,0-this.rx/2,0+this.ry*.3],["C",0-this.rx/2,0+(this.ry+this.ry*.3)/2,0,0+(this.ry+this.ry*.3)/1.4,0,0+this.ry],["C",0,0+(this.ry+this.ry*.3)/1.8,0+this.rx/2,0+(this.ry+this.ry*.3)/2,0+this.rx/2,0+this.ry*.3],["C",0+this.rx/2,0,0,0,0,0+this.ry*.3],["z"]]}}class Fl extends U{r;constructor(t){super(t),this.r=t?.r||20}toSVGPathData(){const t=[["m",0,-this.r]];for(let e=0;e<6;e+=1){const s=288+e*144,i=this.r*Math.cos(O(s)),r=this.r*Math.sin(O(s));t.push(["l",i,r])}return t}}class Nl extends U{constructor(t){super(t)}toSVGPathData(){return[["M",0,0],["C",15,0,15,-40,5,-30],["L",0,0],["C",-15,0,-15,-40,-5,-30],["L",0,0],["a",15,15,0,1,1,0,30],["a",15,15,0,1,1,0,-30]]}}class Yl extends U{constructor(t){super(t),this.originD="m5.068 9.267-3.08-.77a.512.512 0 0 1 0-.994l3.08-.77a2.289 2.289 0 0 0 1.665-1.665l.77-3.08a.512.512 0 0 1 .994 0l.77 3.08c.205.82.845 1.46 1.665 1.665l3.08.77a.512.512 0 0 1 0 .994l-3.08.77a2.29 2.29 0 0 0-1.665 1.665l-.77 3.08a.512.512 0 0 1-.994 0l-.77-3.08a2.289 2.289 0 0 0-1.665-1.665Z"}}class Bl extends rt{constructor(t){super(t);const e=new ce({...t,x:this.x,y:this.y,toX:this.x,toY:this.y-140-Math.random()*20}),s=30+Math.random()*30,i=new ce({...t,x:this.x,y:this.y-s,diffYInGroup:-s,toX:this.x+Math.random()*80-40,toY:this.y-100-Math.random()*40}),r=60+Math.random()*40,a=new ce({...t,x:this.x,y:this.y-r,diffYInGroup:-r,toX:this.x+Math.random()*60-30,toY:this.y-110-Math.random()*20});this.addShape([e,i,a])}}class Ge extends U{text;width=0;height=0;constructor(t){super(t),this.text=t.text,this.setAttr({fontSize:"10px",fontFamily:'system-ui, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',emojiFontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif',fill:"#666666",stroke:"none","alignment-baseline":"middle",textAnchor:"start",...this.getAttrs()});const e=Hs(this.getAttr("fontSize"),10).number,s=Hs(this.getAttr("fontWeight"),400).number,i=A.measureText(this.text,e,s);this.width=i.width,this.height=i.height}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){t.fillText(this.text,0,0)}}class sa extends rt{text;bg;padding;offset;isShow;textShape;bgShape;constructor(t){super(t),this.text=t.text,this.bg=t.bg||"rgba(0,0,0,0.5)",this.padding=t.padding||4,this.offset=t.offset||20,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!1,this.textShape=new Ge({...t,x:this.x+this.offset,y:this.y+this.offset,text:this.text,attrs:{...this.getAttrs(),fill:Re(this.bg).opposite(!0).toString(),textAnchor:"start"}}),this.bgShape=new zt({...t,x:this.textShape.x-this.padding,y:this.textShape.y-this.textShape.height/2-this.padding,width:this.textShape.width+this.padding*2,height:this.textShape.height+this.padding*2,attrs:{...this.getAttrs(),fill:this.bg}}),this.addShape([this.bgShape,this.textShape])}shapeInit(){qs(()=>{this.textShape.x=this.x+this.offset,this.textShape.y=this.y+this.offset,this.textShape.text=this.text,this.textShape.isShow=this.isShow,this.bgShape.x=this.textShape.x-this.padding,this.bgShape.y=this.textShape.y-this.textShape.height/2-this.padding,this.bgShape.width=this.textShape.width+this.padding*2,this.bgShape.height=this.textShape.height+this.padding*2,this.bgShape.isShow=this.isShow})}}class Xl extends rt{radius;expandRaidus;startDegree;endDegree;text="";defaultShowText;tip="";p1=new Vt;p1Offset=10;p2=new Vt;p2Offset=40;p3=new Vt;p3Offset=10;p4=new Vt;p4Offset=10;direction=1;sectorArc;line12;line23;textShape;tipShape;constructor(t){super(t),this.radius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.text=t.text||"",this.defaultShowText=typeof t?.defaultShowText=="boolean"?t.defaultShowText:!!this.text,this.tip=t.tip||"",this.sectorArc=new ia({x:this.x,y:this.y,radius:this.radius,expandRaidus:this.expandRaidus,startDegree:this.startDegree,endDegree:this.endDegree,attrs:Object.assign({...this.getAttrs()},{strokeWidth:"0"})}),this.addShape(this.sectorArc);const e=Object.assign({...this.getAttrs()},{fill:"none"});this.line12=new ce({x:this.p1.x,y:this.p1.y,toX:this.p2.x,toY:this.p2.y,attrs:{...e},isShow:this.defaultShowText}),this.line23=new ce({x:this.p2.x,y:this.p2.y,toX:this.p3.x,toY:this.p3.y,attrs:{...e},isShow:this.defaultShowText}),this.textShape=new Ge({x:this.p4.x,y:this.p4.y,text:this.text,attrs:{stroke:e.stroke,textAnchor:this.direction==1?"start":"end"},isShow:this.defaultShowText}),this.text&&(this.addShape(this.line12),this.addShape(this.line23),this.addShape(this.textShape)),this.tipShape=new sa({x:0,y:0,text:this.tip,isShow:!1}),this.tip&&this.addShape(this.tipShape)}frameUpdate(t){this.text&&!this.defaultShowText&&(this.line12.isShow=this.sectorArc.isMouseIn,this.line23.isShow=this.sectorArc.isMouseIn,this.textShape.isShow=this.sectorArc.isMouseIn);const e=this.startDegree+(this.endDegree-this.startDegree)/2,{dx:s,dy:i}=It(O(e),this.sectorArc.radius+this.p1Offset);this.p1.x=this.x+s,this.p1.y=this.y+i;const{dx:r,dy:a}=It(O(e),this.sectorArc.radius+this.p1Offset+this.p2Offset);this.p2.x=this.x+r,this.p2.y=this.y+a,this.line12.x=this.p1.x,this.line12.y=this.p1.y,this.line12.toX=this.p2.x,this.line12.toY=this.p2.y,this.direction=this.p1.x>this.x?1:-1,this.p3.x=this.p2.x+this.direction*this.p3Offset,this.p3.y=this.p2.y,this.p4.x=this.p3.x+this.direction*this.p4Offset,this.p4.y=this.p3.y,this.line23.x=this.p2.x,this.line23.y=this.p2.y,this.line23.toX=this.p3.x,this.line23.toY=this.p3.y,this.textShape.x=this.p4.x,this.textShape.y=this.p4.y,this.textShape.setAttr("textAnchor",this.direction==1?"start":"end"),this.sectorArc.isMouseIn?(this.tipShape.isShow=!0,this.tipShape.x=t.x,this.tipShape.y=t.y):(this.tipShape.isShow=!1,this.tipShape.x=t.x,this.tipShape.y=t.y)}}class ia extends U{radius;realRadius;expandRaidus;startDegree;endDegree;vr;ar;bounce;durationTime;status;constructor(t){super(t),this.radius=0,this.realRadius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.vr=0,this.ar=.03,this.bounce=.6,this.durationTime=8.333333333333334,this.status=0}frameUpdate(){this.status==0&&this.radius<this.realRadius?(this.expand(this.realRadius),this.radius>=this.realRadius&&(this.status=1)):this.isMouseIn?this.expand(this.realRadius+this.expandRaidus):this.shrink(this.realRadius)}expand(t){this.vr+=this.ar,this.radius+=this.vr*this.durationTime,this.radius>t&&(this.radius=t,this.vr*=-this.bounce)}shrink(t){this.vr-=this.ar,this.radius+=this.vr*this.durationTime,this.radius<t&&(this.radius=t,this.vr*=-this.bounce)}toSVGPathData(){const{dx:t,dy:e}=It(O(this.startDegree),this.radius),{dx:s,dy:i}=It(O(this.endDegree),this.radius);return[["m",0,0],["l",t,e],["a",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,s-t,i-e],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.arc(0,0,this.radius,O(this.startDegree),O(this.endDegree),!1),t.closePath()}containPoint(t,e){const s=as(this.x,this.y,t,e),i=it(Zt(this.x,this.y,t,e));return s<=this.radius&&i>=this.startDegree&&i<=this.endDegree}}class Gl extends rt{showFlame;ship;flame;constructor(t){super(t),this.showFlame=typeof t?.showFlame=="boolean"?t.showFlame:!1,this.ship=new U({...t,d:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]]}),this.addShape(this.ship),this.flame=new U({...t,isShow:this.showFlame,d:[["m",-10,-5],["l",-7.5,5],["l",7.5,5],["z"]]}),this.addShape(this.flame)}shapeInit(){qs(()=>{this.ship.x=this.x,this.ship.y=this.y,this.flame.x=this.x,this.flame.y=this.y,this.flame.isShow=this.showFlame})}}class Ul extends rt{value;backgroundRect;occupyRect;handle;constructor(t){super(t);const e=t?.min||0,s=t?.max||100,i=t?.step||1,r=Ba(e,s,i);this.value=r(typeof t?.defaultValue=="number"?V(t.defaultValue,e,s):e);const a=this.value/(s-e),o=t?.barWidth||100,h=t?.barHeight||4,c=t?.handleRadius||10,l=h*.5,d=t?.barColor||yi.colorGrayF5,g=t?.handleColor||yi.colorPrimary;this.backgroundRect=new zt({x:this.x,y:this.y,width:o,height:h,borderRadius:l,attrs:{fill:d},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.backgroundRect),this.occupyRect=new zt({x:this.x,y:this.y,width:o*a,height:h,borderRadius:l,attrs:{fill:g},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.occupyRect),this.handle=new Vt({x:this.x+o*a,y:this.y+l,diffXInGroup:o*a,diffYInGroup:l,radius:c,alongPath:new Lo({x:this.x,y:this.y+l,d:[["m",0,0],["l",o,0]]}),attrs:{fill:g},enableDrag:!0,independentTransformInGroup:!0}),this.addShape(this.handle),this.handle.on("draging",y=>{this.occupyRect.width=V(this.occupyRect.width+y,0,o),this.value=r((this.handle.x-this.x)/o*(s-e)+e),this.emit("change",this.value)})}}class Vl extends rt{width;height;cornerRadius;controlPoint;mainRect;rightPoint;constructor(t){super(t),this.width=t.width,this.height=t.height,this.cornerRadius=this.height/2,this.controlPoint=new Vt({...t,x:this.x,y:this.y,radius:2}),this.forceSetCXY(this.controlPoint.cX,this.controlPoint.cY),this.mainRect=new zt({...t,x:this.x-this.cornerRadius,y:this.y-this.cornerRadius,diffXInGroup:-this.cornerRadius,diffYInGroup:-this.cornerRadius,width:this.width+this.cornerRadius*2,height:this.height,borderRadius:this.cornerRadius}),this.rightPoint=new Vt({...t,x:this.x+this.width,y:this.y,diffXInGroup:this.width,radius:2}),this.addShape([this.mainRect,this.controlPoint,this.rightPoint])}getPin(){return{x:this.controlPoint.x+Math.cos(O(this.controlPoint.degree))*this.width,y:this.controlPoint.y+Math.sin(O(this.controlPoint.degree))*this.width}}}class Gi extends U{extendDegree;radius;startDegree;endDegree;diffDegree;constructor(t){super(t),this.extendDegree=t?.extendDegree||0,this.x=(t.x||0)+t.width/2;const e=Math.min(t.width/2,t.height)-t.lineWidth;this.radius=e-e*Math.abs(Math.sin(O(this.extendDegree))),this.y=(t.y||0)+t.height-t.lineWidth-this.radius*Math.abs(Math.sin(O(this.extendDegree))),this.diffDegree=t.endDegree-t.startDegree,this.startDegree=180+t.startDegree-this.extendDegree,this.endDegree=180+t.endDegree+this.extendDegree,this.setAttr({"stroke-linecap":"round","stroke-width":String(t.lineWidth),stroke:t.color||"none"})}setPercent(t){this.endDegree=this.startDegree+(this.diffDegree+this.extendDegree*2)*t}toSVGPathData(){const{dx:t,dy:e}=It(O(this.startDegree),this.radius),{dx:s,dy:i}=It(O(this.endDegree),this.radius);return[["m",t,e],["a",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,s-t,i-e]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,O(this.startDegree),O(this.endDegree),!1)}}class zl extends rt{percent=0;ringBg;ring;lines=[];bgColor;startColor;endColor;indicatorLineCount;constructor(t){super(t);const e=t?.startDegree||0,s=t?.endDegree||180,i=t?.extendDegree||15,r=t?.lineWidth||12;this.bgColor=t?.bgColor||"#B3C6E7",this.startColor=t?.startColor||"#5A82F0",this.endColor=t?.endColor||"#66B3FF",this.percent=t?.percent||0,this.indicatorLineCount=23;const a=20,o=2,h=17;this.ringBg=new Gi({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:i,lineWidth:r,color:this.bgColor}),this.addShape(this.ringBg),this.ring=new Gi({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:i,lineWidth:r}),this.addShape(this.ring);const c=this.ringBg.y-this.ringBg.radius+a;for(let l=0;l<this.indicatorLineCount;l++)this.lines.push(new ce({...t,centerX:this.ringBg.x,centerY:this.ringBg.y,x:this.ringBg.x,y:c,toX:this.ringBg.x,toY:c+h,degree:this.ringBg.startDegree+90+(s-e+i*2)/(this.indicatorLineCount-1)*l,attrs:{"stroke-linecap":"round","stroke-width":String(o),stroke:this.bgColor}}));this.addShape(this.lines)}setPercent(t){this.percent=t}shapeInit(){this.on("draging",(t,e,s)=>{this.shapes.forEach(i=>{i!=s&&(i.x+=t,i.y+=e)})})}frameUpdate(t,e){const s=this.ringBg.radius-this.ringBg.radius*Math.cos(Math.PI*this.percent),i=this.ringBg.radius*Math.sin(Math.PI*this.percent);if(e){const r=e.createLinearGradient(-this.ringBg.radius,0,-this.ringBg.radius+s,-i,{0:this.startColor,1:this.endColor});this.ring.setAttr({stroke:r})}else this.ring.setAttr({stroke:this.startColor});this.ring.setPercent(this.percent);for(let r=0;r<this.indicatorLineCount;r++){const a=r/(this.indicatorLineCount-1)<=this.percent;this.lines[r].setAttr({stroke:a&&e?e.createLinearGradient(0,0,this.lines[r].toX-this.lines[r].x,this.lines[r].toY-this.lines[r].y,{0:this.startColor,1:this.endColor}):a?this.startColor:this.bgColor})}}}class ql extends U{x;y;z;brightness;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.brightness=this.setBrightness(t?.brightness||1)}setBrightness(t){return this.brightness=V(t,0,1),this.brightness}toSVGPathData(){return[]}}const Hl=ql;class jl extends U{points;light;constructor(t=[]){if(t.length<3)throw new Error("points length must >= 3");super(),this.points=t,this.light=new Hl({x:0,y:0,z:0,brightness:1})}toSVGPathData(){const t=[];t.push(["M",this.points[0].getScreenX(),this.points[0].getScreenY()]);for(let e=0,s=this.points.length;e<=s-1;e++)t.push(["L",this.points[e].getScreenX(),this.points[e].getScreenY()]);return t.push(["L",this.points[0].getScreenX(),this.points[0].getScreenY()]),t}toCanvasContext(t){t.beginPath(),t.moveTo(0,0);for(let e=0,s=this.points.length;e<=s-1;e++)t.lineTo(this.points[e].getScreenX()-this.points[0].getScreenX(),this.points[e].getScreenY()-this.points[0].getScreenY());t.lineTo(0,0)}get length(){return this.points.length}getDepth(){return Math.min(...this.points.map(t=>t.z))}isBackface(){const t=this.points[2].getScreenX()-this.points[0].getScreenX(),e=this.points[2].getScreenY()-this.points[0].getScreenY(),s=this.points[1].getScreenX()-this.points[2].getScreenX(),i=this.points[1].getScreenY()-this.points[2].getScreenY();return t*i>e*s}getLightFactor(){const t={x:this.points[0].x-this.points[1].x,y:this.points[0].y-this.points[1].y,z:this.points[0].z-this.points[1].z},e={x:this.points[1].x-this.points[2].x,y:this.points[1].y-this.points[2].y,z:this.points[1].z-this.points[2].z},s={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},i=s.x*this.light.x+s.y*this.light.y+s.z*this.light.z,r=Math.sqrt(s.x*s.x+s.y*s.y+s.z*s.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(i/(r*a))/Math.PI*this.light.brightness}getAdjustedColor(t){const e=Re(t),s=this.getLightFactor();return e.r*=s,e.g*=s,e.b*=s,e.toString()}}class Wl extends rt{fettis=[];constructor(t,e,s){super();const{shape:i,x:r,y:a,particleCount:o,angle:h,spread:c,startVelocity:l,decay:d,gravity:g,drift:y,ticks:m,colors:x,scalar:b,flat:S}=Object.assign({shape:zt,x:.5,y:.6,particleCount:100,angle:90,spread:70,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,colors:ir,scalar:1,flat:!1},s||{}),C=O(h),L=O(c);let R=o;for(;R--;){const X=x[R%x.length],Y=new i({x:t*r,y:e*a,width:10,height:10,scalar:b,attrs:{fill:X},independentTransformInGroup:!0});this.addShape(Y),this.fettis.push({shape:Y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:l*.5+Math.random()*l,angle2D:-C+(.5*L-Math.random()*L),tiltAngle:(Math.random()*.5+.25)*Math.PI,tick:0,totalTicks:m,decay:d,drift:y,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:g*3,scalar:b,flat:S,color:Re(X)})}}frameUpdate(t){this.fettis.length&&(this.fettis=this.fettis.filter(e=>{e.shape.x+=Math.cos(e.angle2D)*e.velocity+e.drift,e.shape.y+=Math.sin(e.angle2D)*e.velocity+e.gravity,e.velocity*=e.decay,e.flat?(e.wobble=0,e.wobbleX=e.shape.x+10*e.scalar,e.wobbleY=e.shape.y+10*e.scalar,e.tiltSin=0,e.tiltCos=0,e.random=1):(e.wobble+=e.wobbleSpeed,e.wobbleX=e.shape.x+10*e.scalar*Math.cos(e.wobble),e.wobbleY=e.shape.y+10*e.scalar*Math.sin(e.wobble),e.tiltAngle+=.1,e.tiltSin=Math.sin(e.tiltAngle),e.tiltCos=Math.cos(e.tiltAngle),e.random=Math.random()+2);const s=e.tick++/e.totalTicks,i=e.shape.x+e.random*e.tiltCos,r=e.shape.y+e.random*e.tiltSin,a=e.wobbleX+e.random*e.tiltCos,o=e.wobbleY+e.random*e.tiltSin;return e.shape.setAttr("fill",e.color.setAlpha(1-s).toString()),e.shape.degree=it(Math.PI/10*e.wobble),e.shape.scalarX=Math.abs(a-i)*.1,e.shape.scalarY=Math.abs(o-r)*.1,e.tick<e.totalTicks}))}}class Ui{shapes;constructor(t){this.shapes=t}run(t){this.shapes.forEach(s=>{s.run(),t?.wall&&s.checkWall({wall:t.wall,bounce:t.bounce})});const e=this.shapes.length;for(let s=0,i=e-1;s<i;s++)for(let r=s+1;r<e;r++)this.shapes[s].checkCollision(this.shapes[r])}gravitate(){const t=this.shapes.length;this.shapes.forEach((e,s)=>{e.run();for(let i=s+1;i<t;i++)e.checkCollision(this.shapes[i]),e.gravitateTo(this.shapes[i])})}springChain(t){this.shapes.forEach((e,s)=>{s>0&&e.runSpringTo(this.shapes[s-1],t)})}springConnect(t){const e=$t(t?.springLength,100);this.shapes.forEach(s=>{s.isDragging||this.shapes.filter(i=>i.id!==s.id).forEach(i=>{const r=Zt(s.x,s.y,i.x,i.y);s.runSpringTo({x:i.x-Math.cos(r)*e,y:i.y-Math.sin(r)*e},t)})})}springMass(t,e){const s=this.shapes.length,i=[];return this.shapes.forEach((r,a)=>{r.run(e),r.x>t.x+t.width?r.x=t.x:r.x<t.x&&(r.x=t.x+t.width),r.y>t.y+t.height?r.y=t.y:r.y<t.y&&(r.y=t.y+t.height);for(let o=a+1;o<s;o++)i.push([r.x,r.y,this.shapes[o].x,this.shapes[o].y,r.springMassTo(this.shapes[o],e)])}),i}polymorph(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");const t=this.shapes.length-1,e=new Array(t);for(let i=0;i<t;i++){const r=this.shapes[i].initPathD();this.shapes[i].frameStart();const a=this.shapes[i+1].initPathD();this.shapes[i+1].frameStart();const o=Math.max(r.polymorphPoints.length,a.polymorphPoints.length);e[i]=wt.getPathInterpolator(r.expendFill(o),a.expendFill(o))}const s=new U({d:e[0](0)});return i=>{const r=At(t*i,6),a=Math.min(Math.floor(r),t-1),o=At(r-a,6);s.originD=e[a](o);const h=this.shapes[a].getAttr("fill","none"),c=this.shapes[a+1].getAttr("fill","none");typeof h=="string"&&typeof c=="string"&&s.setAttr("fill",lt.gradient(h,c,o).toString());const l=this.shapes[a].getAttr("stroke","none"),d=this.shapes[a+1].getAttr("stroke","none");return typeof l=="string"&&typeof d=="string"&&s.setAttr("stroke",lt.gradient(l,d,o).toString()),s}}polymorphGroup(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");let t=0,e;const s=[];this.shapes.forEach(o=>{let h;o instanceof rt?(h=o,h.sortPathD()):(h=new rt,h.addShape(o)),s.push(h),t<h.shapes.length&&(t=h.shapes.length,e=h)}),s.forEach(o=>{o!==e&&o.expendFill(e)});const i=[];s.forEach((o,h)=>{o.shapes.forEach((c,l)=>{i[l]=i[l]||[],i[l][h]=c})});const r=[];i.forEach(o=>{r.push(new Ui(o).polymorph())});const a=new rt;return r.forEach(o=>{a.addShape(o(0))}),o=>(r.forEach(h=>{h(o)}),a)}polymorphTween(t=6e3,e){const s=this.shapes.findIndex(o=>o instanceof rt)>=0?this.polymorphGroup():this.polymorph(),i=s(0),r=e?.onUpdate,a=new ps({frameDuration:t});a.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(o,h)=>{s(o.t),r?.(o,h),e?.draw?.(i)}})),a.play()}static generatePointsShape(t,e,s,i){const r=[];for(let a=0;a<i;a++){const o=a/i*2*Math.PI,{dx:h,dy:c}=It(o,s);r.push({x:t+h,y:e+c})}return new ta({points:r})}static generateRosettaShape(t,e,s,i,r){if(r==0)throw new Error("no dividing by zero, please");const a=[],o=360/r;for(let h=0;h<r;h+=1){const c=o*h*Math.PI/180,l=t+2*s*Math.cos(c),d=e+2*s*Math.sin(c);a.push(new si({x:t,y:e,rx:s,ry:i,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:l,toY:d})),a.push(new si({x:l,y:d,rx:s,ry:i,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:t,toY:e}))}return new U({d:wt.fromLines(a)})}}const na={map:new Map,transform:function(n){if(Ln)return n;if(this.map.has(n))return this.map.get(n);const t=new OffscreenCanvas(n.width,n.height);return t.getContext("2d")?.drawImage(n,0,0),this.map.set(n,t),t},clear:function(){this.map.clear()}};function $l(n,t,e){const s=new OffscreenCanvas(n,t),i=s.getContext("2d");if(i)return e(i),s.transferToImageBitmap()}function Jl(n,t,e){const s=n.createPattern(na.transform(t),"no-repeat");if(s){const i=pi(e);s.setTransform(i),n.fillStyle=s}}class Zl{app;ctx;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e=!1){if(this.app=t,!(this.app.container instanceof HTMLCanvasElement))throw new Error("app.container 应该为 HTMLCanvasElement!");this.ctx=new ls(this.app.container,this.app.width,this.app.height,e),this.app.captureDrag({start:()=>{this.isMouseDown=!0,this.dragDx=0,this.dragDy=0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.dragDx=0,this.dragDy=0,this.setCursor()},move:(s,i)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=i.dx,this.dragDy+=i.dy),this.setCursor()}}),this.app.on("tap",()=>{for(let s of this.shapes)if(this.currentMouseInShape==s){s.emit("clicked");let i=s.parent;for(;i;)i.emit("clicked",s),i=i.parent;break}})}setCursor(){this.currentEnableDragMouseInShape?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShape?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}transformCtxBaseOnShape(t){t.usePathDtoCanvasContext||(this.ctx.translate(t.x,t.y),this.ctx.rotate(O(t.degree),t.cX,t.cY),this.ctx.scale(t.scalarX,t.scalarY,t.cX,t.cY))}_addDrawShape(t){this.shapes.push(t),t instanceof rt&&t.shapes.forEach(e=>{this._addDrawShape(e)})}draw(t=[]){this.shapes=[],(Array.isArray(t)?t:[t]).forEach(e=>{this._addDrawShape(e)}),this.isMouseDown&&this.currentEnableDragMouseInShape||(this.currentMouseInShape=void 0);for(let e of this.shapes){if(!e.isShow)continue;if(this.ctx.save(),e.frameStart(this.app.mousePoint),A.attrsToCanvas(this.ctx,e.getAttrs()),e.followMouse&&(!Ke(e.x,this.app.mousePoint.x,5)||!Ke(e.y,this.app.mousePoint.y,5))&&e.followTo(this.app.mousePoint),e.targetToAfterDragFree&&(this.isMouseDown||e.runEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShape==e){e.isDragging=!0;const i=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,i||r){if(e.x+=i,e.y+=r,e.alongPath){const a=e.alongPath.closestPoint(e.x,e.y);e.x=a.point.x-e.cX,e.y=a.point.y-e.cY}e.emit("draging",i,r)}}else e.isDragging=!1;e.frameUpdate(this.app.mousePoint,this.ctx),this.transformCtxBaseOnShape(e),e.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill();const s=this.ctx.currentPath2D;if(!this.currentMouseInShape){const i=this.ctx.isPointInPath(s,this.app.mousePoint.x,this.app.mousePoint.y)||this.ctx.isPointInStroke(s,this.app.mousePoint.x,this.app.mousePoint.y)||!1;e.isMouseIn=i,i&&(this.currentMouseInShape=e,e.enableDrag&&(this.currentEnableDragMouseInShape=e))}e.frameEnd(this.app.mousePoint),this.ctx.restore()}this.currentMouseInShape||(this.currentEnableDragMouseInShape=void 0)}drawMouseMoveLine(t="line",e){switch(t){case"brush":const s=e?.brushSize??10,i=e?.brushDensity??50,r=e?.brushColor??"#000000",a=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),o=a.data,h=Re(r);return this.app.captureDrag({move:()=>{if(this.isMouseDown){for(let c=0;c<i;c++){const l=Math.random()*Math.PI*2,d=Math.random()*s,g=this.app.mousePoint.x+Math.cos(l)*d|0,y=this.app.mousePoint.y+Math.sin(l)*d|0,m=(g+y*a.width)*4;o[m]=h.r,o[m+1]=h.g,o[m+2]=h.b,o[m+3]=255}this.ctx.putImageData(a)}}});case"line":default:return this.app.captureDrag({start:c=>{this.ctx.beginPath(),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 Kl{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new Le(t),this.remoteVideoUtil=new Le(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(s=>{this.localVideoUtil.setSrcObject(s),t(s)}).catch(s=>{this.trace(`navigator.getUserMedia error: ${s}.`),e(s)})})}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(),s=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),s.length>0&&this.trace(`Using audio device: ${s[0].label}.`);const i=void 0,r=new RTCPeerConnection(i);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(i);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(s[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,s=t.candidate;if(e&&s){const i=new RTCIceCandidate(s),r=this.getOtherPeer(e);r&&(r.addIceCandidate(i).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
|
|
36
|
+
`,t}function dr(n,t){return function(){return n.apply(t,arguments)}}const{toString:Lh}=Object.prototype,{getPrototypeOf:bi}=Object,bs=(n=>t=>{const e=Lh.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),kt=n=>(n=n.toLowerCase(),t=>bs(t)===n),vs=n=>t=>typeof t===n,{isArray:ge}=Array,Fe=vs("undefined");function Rh(n){return n!==null&&!Fe(n)&&n.constructor!==null&&!Fe(n.constructor)&&vt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const fr=kt("ArrayBuffer");function Oh(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&fr(n.buffer),t}const Fh=vs("string"),vt=vs("function"),mr=vs("number"),Ss=n=>n!==null&&typeof n=="object",Nh=n=>n===!0||n===!1,Cs=n=>{if(bs(n)!=="object")return!1;const t=bi(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},Bh=kt("Date"),Yh=kt("File"),Xh=kt("Blob"),Uh=kt("FileList"),Gh=n=>Ss(n)&&vt(n.pipe),Vh=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||vt(n.append)&&((t=bs(n))==="formdata"||t==="object"&&vt(n.toString)&&n.toString()==="[object FormData]"))},zh=kt("URLSearchParams"),qh=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ne(n,t,{allOwnKeys:e=!1}={}){if(n===null||typeof n>"u")return;let s,i;if(typeof n!="object"&&(n=[n]),ge(n))for(s=0,i=n.length;s<i;s++)t.call(null,n[s],s,n);else{const r=e?Object.getOwnPropertyNames(n):Object.keys(n),a=r.length;let o;for(s=0;s<a;s++)o=r[s],t.call(null,n[o],o,n)}}function pr(n,t){t=t.toLowerCase();const e=Object.keys(n);let s=e.length,i;for(;s-- >0;)if(i=e[s],t===i.toLowerCase())return i;return null}const gr=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),yr=n=>!Fe(n)&&n!==gr;function vi(){const{caseless:n}=yr(this)&&this||{},t={},e=(s,i)=>{const r=n&&pr(t,i)||i;Cs(t[r])&&Cs(s)?t[r]=vi(t[r],s):Cs(s)?t[r]=vi({},s):ge(s)?t[r]=s.slice():t[r]=s};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Ne(arguments[s],e);return t}const Hh=(n,t,e,{allOwnKeys:s}={})=>(Ne(t,(i,r)=>{e&&vt(i)?n[r]=dr(i,e):n[r]=i},{allOwnKeys:s}),n),jh=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),$h=(n,t,e,s)=>{n.prototype=Object.create(t.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),e&&Object.assign(n.prototype,e)},Wh=(n,t,e,s)=>{let i,r,a;const o={};if(t=t||{},n==null)return t;do{for(i=Object.getOwnPropertyNames(n),r=i.length;r-- >0;)a=i[r],(!s||s(a,n,t))&&!o[a]&&(t[a]=n[a],o[a]=!0);n=e!==!1&&bi(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},Jh=(n,t,e)=>{n=String(n),(e===void 0||e>n.length)&&(e=n.length),e-=t.length;const s=n.indexOf(t,e);return s!==-1&&s===e},Zh=n=>{if(!n)return null;if(ge(n))return n;let t=n.length;if(!mr(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=n[t];return e},Kh=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&bi(Uint8Array)),Qh=(n,t)=>{const s=(n&&n[Symbol.iterator]).call(n);let i;for(;(i=s.next())&&!i.done;){const r=i.value;t.call(n,r[0],r[1])}},tc=(n,t)=>{let e;const s=[];for(;(e=n.exec(t))!==null;)s.push(e);return s},ec=kt("HTMLFormElement"),sc=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,i){return s.toUpperCase()+i}),wr=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),ic=kt("RegExp"),xr=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),s={};Ne(e,(i,r)=>{let a;(a=t(i,r,n))!==!1&&(s[r]=a||i)}),Object.defineProperties(n,s)},nc=n=>{xr(n,(t,e)=>{if(vt(n)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=n[e];if(vt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},rc=(n,t)=>{const e={},s=i=>{i.forEach(r=>{e[r]=!0})};return ge(n)?s(n):s(String(n).split(t)),e},ac=()=>{},oc=(n,t)=>(n=+n,Number.isFinite(n)?n:t),Si="abcdefghijklmnopqrstuvwxyz",br="0123456789",vr={DIGIT:br,ALPHA:Si,ALPHA_DIGIT:Si+Si.toUpperCase()+br},hc=(n=16,t=vr.ALPHA_DIGIT)=>{let e="";const{length:s}=t;for(;n--;)e+=t[Math.random()*s|0];return e};function cc(n){return!!(n&&vt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const lc=n=>{const t=new Array(10),e=(s,i)=>{if(Ss(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[i]=s;const r=ge(s)?[]:{};return Ne(s,(a,o)=>{const h=e(a,i+1);!Fe(h)&&(r[o]=h)}),t[i]=void 0,r}}return s};return e(n,0)},uc=kt("AsyncFunction"),D={isArray:ge,isArrayBuffer:fr,isBuffer:Rh,isFormData:Vh,isArrayBufferView:Oh,isString:Fh,isNumber:mr,isBoolean:Nh,isObject:Ss,isPlainObject:Cs,isUndefined:Fe,isDate:Bh,isFile:Yh,isBlob:Xh,isRegExp:ic,isFunction:vt,isStream:Gh,isURLSearchParams:zh,isTypedArray:Kh,isFileList:Uh,forEach:Ne,merge:vi,extend:Hh,trim:qh,stripBOM:jh,inherits:$h,toFlatObject:Wh,kindOf:bs,kindOfTest:kt,endsWith:Jh,toArray:Zh,forEachEntry:Qh,matchAll:tc,isHTMLForm:ec,hasOwnProperty:wr,hasOwnProp:wr,reduceDescriptors:xr,freezeMethods:nc,toObjectSet:rc,toCamelCase:sc,noop:ac,toFiniteNumber:oc,findKey:pr,global:gr,isContextDefined:yr,ALPHABET:vr,generateString:hc,isSpecCompliantForm:cc,toJSONObject:lc,isAsyncFn:uc,isThenable:n=>n&&(Ss(n)||vt(n))&&vt(n.then)&&vt(n.catch)};function U(n,t,e,s,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),s&&(this.request=s),i&&(this.response=i)}D.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:D.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Sr=U.prototype,Cr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{Cr[n]={value:n}}),Object.defineProperties(U,Cr),Object.defineProperty(Sr,"isAxiosError",{value:!0}),U.from=(n,t,e,s,i,r)=>{const a=Object.create(Sr);return D.toFlatObject(n,a,function(h){return h!==Error.prototype},o=>o!=="isAxiosError"),U.call(a,n.message,t,e,s,i),a.cause=n,a.name=n.name,r&&Object.assign(a,r),a};const dc=null;function Ci(n){return D.isPlainObject(n)||D.isArray(n)}function Er(n){return D.endsWith(n,"[]")?n.slice(0,-2):n}function Tr(n,t,e){return n?n.concat(t).map(function(i,r){return i=Er(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function fc(n){return D.isArray(n)&&!n.some(Ci)}const mc=D.toFlatObject(D,{},null,function(t){return/^is[A-Z]/.test(t)});function Es(n,t,e){if(!D.isObject(n))throw new TypeError("target must be an object");t=t||new FormData,e=D.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(P,_){return!D.isUndefined(_[P])});const s=e.metaTokens,i=e.visitor||l,r=e.dots,a=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&D.isSpecCompliantForm(t);if(!D.isFunction(i))throw new TypeError("visitor must be a function");function c(m){if(m===null)return"";if(D.isDate(m))return m.toISOString();if(!h&&D.isBlob(m))throw new U("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(m)||D.isTypedArray(m)?h&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function l(m,P,_){let v=m;if(m&&!_&&typeof m=="object"){if(D.endsWith(P,"{}"))P=s?P:P.slice(0,-2),m=JSON.stringify(m);else if(D.isArray(m)&&fc(m)||(D.isFileList(m)||D.endsWith(P,"[]"))&&(v=D.toArray(m)))return P=Er(P),v.forEach(function(y,p){!(D.isUndefined(y)||y===null)&&t.append(a===!0?Tr([P],p,r):a===null?P:P+"[]",c(y))}),!1}return Ci(m)?!0:(t.append(Tr(_,P,r),c(m)),!1)}const d=[],w=Object.assign(mc,{defaultVisitor:l,convertValue:c,isVisitable:Ci});function b(m,P){if(!D.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+P.join("."));d.push(m),D.forEach(m,function(v,x){(!(D.isUndefined(v)||v===null)&&i.call(t,v,D.isString(x)?x.trim():x,P,w))===!0&&b(v,P?P.concat(x):[x])}),d.pop()}}if(!D.isObject(n))throw new TypeError("data must be an object");return b(n),t}function Pr(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Ei(n,t){this._pairs=[],n&&Es(n,this,t)}const _r=Ei.prototype;_r.append=function(t,e){this._pairs.push([t,e])},_r.toString=function(t){const e=t?function(s){return t.call(this,s,Pr)}:Pr;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function pc(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ar(n,t,e){if(!t)return n;const s=e&&e.encode||pc,i=e&&e.serialize;let r;if(i?r=i(t,e):r=D.isURLSearchParams(t)?t.toString():new Ei(t,e).toString(s),r){const a=n.indexOf("#");a!==-1&&(n=n.slice(0,a)),n+=(n.indexOf("?")===-1?"?":"&")+r}return n}class gc{constructor(){this.handlers=[]}use(t,e,s){return this.handlers.push({fulfilled:t,rejected:e,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){D.forEach(this.handlers,function(s){s!==null&&t(s)})}}const Dr=gc,Mr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},yc=typeof URLSearchParams<"u"?URLSearchParams:Ei,wc=typeof FormData<"u"?FormData:null,xc=typeof Blob<"u"?Blob:null,bc=(()=>{let n;return typeof navigator<"u"&&((n=navigator.product)==="ReactNative"||n==="NativeScript"||n==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),vc=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Lt={isBrowser:!0,classes:{URLSearchParams:yc,FormData:wc,Blob:xc},isStandardBrowserEnv:bc,isStandardBrowserWebWorkerEnv:vc,protocols:["http","https","file","blob","url","data"]};function Sc(n,t){return Es(n,new Lt.classes.URLSearchParams,Object.assign({visitor:function(e,s,i,r){return Lt.isNode&&D.isBuffer(e)?(this.append(s,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function Cc(n){return D.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Ec(n){const t={},e=Object.keys(n);let s;const i=e.length;let r;for(s=0;s<i;s++)r=e[s],t[r]=n[r];return t}function Ir(n){function t(e,s,i,r){let a=e[r++];const o=Number.isFinite(+a),h=r>=e.length;return a=!a&&D.isArray(i)?i.length:a,h?(D.hasOwnProp(i,a)?i[a]=[i[a],s]:i[a]=s,!o):((!i[a]||!D.isObject(i[a]))&&(i[a]=[]),t(e,s,i[a],r)&&D.isArray(i[a])&&(i[a]=Ec(i[a])),!o)}if(D.isFormData(n)&&D.isFunction(n.entries)){const e={};return D.forEachEntry(n,(s,i)=>{t(Cc(s),i,e,0)}),e}return null}function Tc(n,t,e){if(D.isString(n))try{return(t||JSON.parse)(n),D.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(e||JSON.stringify)(n)}const Ti={transitional:Mr,adapter:["xhr","http"],transformRequest:[function(t,e){const s=e.getContentType()||"",i=s.indexOf("application/json")>-1,r=D.isObject(t);if(r&&D.isHTMLForm(t)&&(t=new FormData(t)),D.isFormData(t))return i&&i?JSON.stringify(Ir(t)):t;if(D.isArrayBuffer(t)||D.isBuffer(t)||D.isStream(t)||D.isFile(t)||D.isBlob(t))return t;if(D.isArrayBufferView(t))return t.buffer;if(D.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(r){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Sc(t,this.formSerializer).toString();if((o=D.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Es(o?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),Tc(t)):t}],transformResponse:[function(t){const e=this.transitional||Ti.transitional,s=e&&e.forcedJSONParsing,i=this.responseType==="json";if(t&&D.isString(t)&&(s&&!this.responseType||i)){const a=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?U.from(o,U.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Lt.classes.FormData,Blob:Lt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};D.forEach(["delete","get","head","post","put","patch"],n=>{Ti.headers[n]={}});const Pi=Ti,Pc=D.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),_c=n=>{const t={};let e,s,i;return n&&n.split(`
|
|
37
|
+
`).forEach(function(a){i=a.indexOf(":"),e=a.substring(0,i).trim().toLowerCase(),s=a.substring(i+1).trim(),!(!e||t[e]&&Pc[e])&&(e==="set-cookie"?t[e]?t[e].push(s):t[e]=[s]:t[e]=t[e]?t[e]+", "+s:s)}),t},kr=Symbol("internals");function Be(n){return n&&String(n).trim().toLowerCase()}function Ts(n){return n===!1||n==null?n:D.isArray(n)?n.map(Ts):String(n)}function Ac(n){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=e.exec(n);)t[s[1]]=s[2];return t}const Dc=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function _i(n,t,e,s,i){if(D.isFunction(s))return s.call(this,t,e);if(i&&(t=e),!!D.isString(t)){if(D.isString(s))return t.indexOf(s)!==-1;if(D.isRegExp(s))return s.test(t)}}function Mc(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,s)=>e.toUpperCase()+s)}function Ic(n,t){const e=D.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(n,s+e,{value:function(i,r,a){return this[s].call(this,t,i,r,a)},configurable:!0})})}class Ps{constructor(t){t&&this.set(t)}set(t,e,s){const i=this;function r(o,h,c){const l=Be(h);if(!l)throw new Error("header name must be a non-empty string");const d=D.findKey(i,l);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||h]=Ts(o))}const a=(o,h)=>D.forEach(o,(c,l)=>r(c,l,h));return D.isPlainObject(t)||t instanceof this.constructor?a(t,e):D.isString(t)&&(t=t.trim())&&!Dc(t)?a(_c(t),e):t!=null&&r(e,t,s),this}get(t,e){if(t=Be(t),t){const s=D.findKey(this,t);if(s){const i=this[s];if(!e)return i;if(e===!0)return Ac(i);if(D.isFunction(e))return e.call(this,i,s);if(D.isRegExp(e))return e.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Be(t),t){const s=D.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||_i(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let i=!1;function r(a){if(a=Be(a),a){const o=D.findKey(s,a);o&&(!e||_i(s,s[o],o,e))&&(delete s[o],i=!0)}}return D.isArray(t)?t.forEach(r):r(t),i}clear(t){const e=Object.keys(this);let s=e.length,i=!1;for(;s--;){const r=e[s];(!t||_i(this,this[r],r,t,!0))&&(delete this[r],i=!0)}return i}normalize(t){const e=this,s={};return D.forEach(this,(i,r)=>{const a=D.findKey(s,r);if(a){e[a]=Ts(i),delete e[r];return}const o=t?Mc(r):String(r).trim();o!==r&&delete e[r],e[o]=Ts(i),s[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return D.forEach(this,(s,i)=>{s!=null&&s!==!1&&(e[i]=t&&D.isArray(s)?s.join(", "):s)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
|
|
38
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(i=>s.set(i)),s}static accessor(t){const s=(this[kr]=this[kr]={accessors:{}}).accessors,i=this.prototype;function r(a){const o=Be(a);s[o]||(Ic(i,a),s[o]=!0)}return D.isArray(t)?t.forEach(r):r(t),this}}Ps.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),D.reduceDescriptors(Ps.prototype,({value:n},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(s){this[e]=s}}}),D.freezeMethods(Ps);const Ut=Ps;function Ai(n,t){const e=this||Pi,s=t||e,i=Ut.from(s.headers);let r=s.data;return D.forEach(n,function(o){r=o.call(e,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function Lr(n){return!!(n&&n.__CANCEL__)}function Ye(n,t,e){U.call(this,n??"canceled",U.ERR_CANCELED,t,e),this.name="CanceledError"}D.inherits(Ye,U,{__CANCEL__:!0});function kc(n,t,e){const s=e.config.validateStatus;!e.status||!s||s(e.status)?n(e):t(new U("Request failed with status code "+e.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}const Lc=Lt.isStandardBrowserEnv?function(){return{write:function(e,s,i,r,a,o){const h=[];h.push(e+"="+encodeURIComponent(s)),D.isNumber(i)&&h.push("expires="+new Date(i).toGMTString()),D.isString(r)&&h.push("path="+r),D.isString(a)&&h.push("domain="+a),o===!0&&h.push("secure"),document.cookie=h.join("; ")},read:function(e){const s=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Rc(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function Oc(n,t){return t?n.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):n}function Rr(n,t){return n&&!Rc(t)?Oc(n,t):t}const Fc=Lt.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let s;function i(r){let a=r;return t&&(e.setAttribute("href",a),a=e.href),e.setAttribute("href",a),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return s=i(window.location.href),function(a){const o=D.isString(a)?i(a):a;return o.protocol===s.protocol&&o.host===s.host}}():function(){return function(){return!0}}();function Nc(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}function Bc(n,t){n=n||10;const e=new Array(n),s=new Array(n);let i=0,r=0,a;return t=t!==void 0?t:1e3,function(h){const c=Date.now(),l=s[r];a||(a=c),e[i]=h,s[i]=c;let d=r,w=0;for(;d!==i;)w+=e[d++],d=d%n;if(i=(i+1)%n,i===r&&(r=(r+1)%n),c-a<t)return;const b=l&&c-l;return b?Math.round(w*1e3/b):void 0}}function Or(n,t){let e=0;const s=Bc(50,250);return i=>{const r=i.loaded,a=i.lengthComputable?i.total:void 0,o=r-e,h=s(o),c=r<=a;e=r;const l={loaded:r,total:a,progress:a?r/a:void 0,bytes:o,rate:h||void 0,estimated:h&&a&&c?(a-r)/h:void 0,event:i};l[t?"download":"upload"]=!0,n(l)}}const Di={http:dc,xhr:typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(e,s){let i=n.data;const r=Ut.from(n.headers).normalize(),a=n.responseType;let o;function h(){n.cancelToken&&n.cancelToken.unsubscribe(o),n.signal&&n.signal.removeEventListener("abort",o)}let c;D.isFormData(i)&&(Lt.isStandardBrowserEnv||Lt.isStandardBrowserWebWorkerEnv?r.setContentType(!1):r.getContentType(/^\s*multipart\/form-data/)?D.isString(c=r.getContentType())&&r.setContentType(c.replace(/^\s*(multipart\/form-data);+/,"$1")):r.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(n.auth){const m=n.auth.username||"",P=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";r.set("Authorization","Basic "+btoa(m+":"+P))}const d=Rr(n.baseURL,n.url);l.open(n.method.toUpperCase(),Ar(d,n.params,n.paramsSerializer),!0),l.timeout=n.timeout;function w(){if(!l)return;const m=Ut.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),_={data:!a||a==="text"||a==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:m,config:n,request:l};kc(function(x){e(x),h()},function(x){s(x),h()},_),l=null}if("onloadend"in l?l.onloadend=w:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(w)},l.onabort=function(){l&&(s(new U("Request aborted",U.ECONNABORTED,n,l)),l=null)},l.onerror=function(){s(new U("Network Error",U.ERR_NETWORK,n,l)),l=null},l.ontimeout=function(){let P=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const _=n.transitional||Mr;n.timeoutErrorMessage&&(P=n.timeoutErrorMessage),s(new U(P,_.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,n,l)),l=null},Lt.isStandardBrowserEnv){const m=(n.withCredentials||Fc(d))&&n.xsrfCookieName&&Lc.read(n.xsrfCookieName);m&&r.set(n.xsrfHeaderName,m)}i===void 0&&r.setContentType(null),"setRequestHeader"in l&&D.forEach(r.toJSON(),function(P,_){l.setRequestHeader(_,P)}),D.isUndefined(n.withCredentials)||(l.withCredentials=!!n.withCredentials),a&&a!=="json"&&(l.responseType=n.responseType),typeof n.onDownloadProgress=="function"&&l.addEventListener("progress",Or(n.onDownloadProgress,!0)),typeof n.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",Or(n.onUploadProgress)),(n.cancelToken||n.signal)&&(o=m=>{l&&(s(!m||m.type?new Ye(null,n,l):m),l.abort(),l=null)},n.cancelToken&&n.cancelToken.subscribe(o),n.signal&&(n.signal.aborted?o():n.signal.addEventListener("abort",o)));const b=Nc(d);if(b&&Lt.protocols.indexOf(b)===-1){s(new U("Unsupported protocol "+b+":",U.ERR_BAD_REQUEST,n));return}l.send(i||null)})}};D.forEach(Di,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch{}Object.defineProperty(n,"adapterName",{value:t})}});const Fr=n=>`- ${n}`,Yc=n=>D.isFunction(n)||n===null||n===!1,Nr={getAdapter:n=>{n=D.isArray(n)?n:[n];const{length:t}=n;let e,s;const i={};for(let r=0;r<t;r++){e=n[r];let a;if(s=e,!Yc(e)&&(s=Di[(a=String(e)).toLowerCase()],s===void 0))throw new U(`Unknown adapter '${a}'`);if(s)break;i[a||"#"+r]=s}if(!s){const r=Object.entries(i).map(([o,h])=>`adapter ${o} `+(h===!1?"is not supported by the environment":"is not available in the build"));let a=t?r.length>1?`since :
|
|
39
|
+
`+r.map(Fr).join(`
|
|
40
|
+
`):" "+Fr(r[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:Di};function Mi(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Ye(null,n)}function Br(n){return Mi(n),n.headers=Ut.from(n.headers),n.data=Ai.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Nr.getAdapter(n.adapter||Pi.adapter)(n).then(function(s){return Mi(n),s.data=Ai.call(n,n.transformResponse,s),s.headers=Ut.from(s.headers),s},function(s){return Lr(s)||(Mi(n),s&&s.response&&(s.response.data=Ai.call(n,n.transformResponse,s.response),s.response.headers=Ut.from(s.response.headers))),Promise.reject(s)})}const Yr=n=>n instanceof Ut?n.toJSON():n;function ye(n,t){t=t||{};const e={};function s(c,l,d){return D.isPlainObject(c)&&D.isPlainObject(l)?D.merge.call({caseless:d},c,l):D.isPlainObject(l)?D.merge({},l):D.isArray(l)?l.slice():l}function i(c,l,d){if(D.isUndefined(l)){if(!D.isUndefined(c))return s(void 0,c,d)}else return s(c,l,d)}function r(c,l){if(!D.isUndefined(l))return s(void 0,l)}function a(c,l){if(D.isUndefined(l)){if(!D.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function o(c,l,d){if(d in t)return s(c,l);if(d in n)return s(void 0,c)}const h={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(c,l)=>i(Yr(c),Yr(l),!0)};return D.forEach(Object.keys(Object.assign({},n,t)),function(l){const d=h[l]||i,w=d(n[l],t[l],l);D.isUndefined(w)&&d!==o||(e[l]=w)}),e}const Xr="1.5.1",Ii={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{Ii[n]=function(s){return typeof s===n||"a"+(t<1?"n ":" ")+n}});const Ur={};Ii.transitional=function(t,e,s){function i(r,a){return"[Axios v"+Xr+"] Transitional option '"+r+"'"+a+(s?". "+s:"")}return(r,a,o)=>{if(t===!1)throw new U(i(a," has been removed"+(e?" in "+e:"")),U.ERR_DEPRECATED);return e&&!Ur[a]&&(Ur[a]=!0,console.warn(i(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,a,o):!0}};function Xc(n,t,e){if(typeof n!="object")throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let i=s.length;for(;i-- >0;){const r=s[i],a=t[r];if(a){const o=n[r],h=o===void 0||a(o,r,n);if(h!==!0)throw new U("option "+r+" must be "+h,U.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new U("Unknown option "+r,U.ERR_BAD_OPTION)}}const ki={assertOptions:Xc,validators:Ii},te=ki.validators;class _s{constructor(t){this.defaults=t,this.interceptors={request:new Dr,response:new Dr}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=ye(this.defaults,e);const{transitional:s,paramsSerializer:i,headers:r}=e;s!==void 0&&ki.assertOptions(s,{silentJSONParsing:te.transitional(te.boolean),forcedJSONParsing:te.transitional(te.boolean),clarifyTimeoutError:te.transitional(te.boolean)},!1),i!=null&&(D.isFunction(i)?e.paramsSerializer={serialize:i}:ki.assertOptions(i,{encode:te.function,serialize:te.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&D.merge(r.common,r[e.method]);r&&D.forEach(["delete","get","head","post","put","patch","common"],m=>{delete r[m]}),e.headers=Ut.concat(a,r);const o=[];let h=!0;this.interceptors.request.forEach(function(P){typeof P.runWhen=="function"&&P.runWhen(e)===!1||(h=h&&P.synchronous,o.unshift(P.fulfilled,P.rejected))});const c=[];this.interceptors.response.forEach(function(P){c.push(P.fulfilled,P.rejected)});let l,d=0,w;if(!h){const m=[Br.bind(this),void 0];for(m.unshift.apply(m,o),m.push.apply(m,c),w=m.length,l=Promise.resolve(e);d<w;)l=l.then(m[d++],m[d++]);return l}w=o.length;let b=e;for(d=0;d<w;){const m=o[d++],P=o[d++];try{b=m(b)}catch(_){P.call(this,_);break}}try{l=Br.call(this,b)}catch(m){return Promise.reject(m)}for(d=0,w=c.length;d<w;)l=l.then(c[d++],c[d++]);return l}getUri(t){t=ye(this.defaults,t);const e=Rr(t.baseURL,t.url);return Ar(e,t.params,t.paramsSerializer)}}D.forEach(["delete","get","head","options"],function(t){_s.prototype[t]=function(e,s){return this.request(ye(s||{},{method:t,url:e,data:(s||{}).data}))}}),D.forEach(["post","put","patch"],function(t){function e(s){return function(r,a,o){return this.request(ye(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}_s.prototype[t]=e(),_s.prototype[t+"Form"]=e(!0)});const As=_s;class Li{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const s=this;this.promise.then(i=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](i);s._listeners=null}),this.promise.then=i=>{let r;const a=new Promise(o=>{s.subscribe(o),r=o}).then(i);return a.cancel=function(){s.unsubscribe(r)},a},t(function(r,a,o){s.reason||(s.reason=new Ye(r,a,o),e(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}static source(){let t;return{token:new Li(function(i){t=i}),cancel:t}}}const Uc=Li;function Gc(n){return function(e){return n.apply(null,e)}}function Vc(n){return D.isObject(n)&&n.isAxiosError===!0}const Ri={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ri).forEach(([n,t])=>{Ri[t]=n});const zc=Ri;function Gr(n){const t=new As(n),e=dr(As.prototype.request,t);return D.extend(e,As.prototype,t,{allOwnKeys:!0}),D.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return Gr(ye(n,i))},e}const Z=Gr(Pi);Z.Axios=As,Z.CanceledError=Ye,Z.CancelToken=Uc,Z.isCancel=Lr,Z.VERSION=Xr,Z.toFormData=Es,Z.AxiosError=U,Z.Cancel=Z.CanceledError,Z.all=function(t){return Promise.all(t)},Z.spread=Gc,Z.isAxiosError=Vc,Z.mergeConfig=ye,Z.AxiosHeaders=Ut,Z.formToJSON=n=>Ir(D.isHTMLForm(n)?new FormData(n):n),Z.getAdapter=Nr.getAdapter,Z.HttpStatusCode=zc,Z.default=Z;const qc=Z,Vr=window.crypto.subtle;Vr||console.warn("Crypto API not supported");async function zr(n,t="SHA-256"){const e=await Vr.digest(t,Ga(n));return Va(e)}async function qr(n,t="SHA-256"){const e=JSON.stringify(Ba(n));return zr(e,t)}class Hc{instance;constructor(t){this.instance=qc.create(t);const e=new Hr;this.instance.interceptors.request.use(s=>(e.pendingRequest(s),s),s=>(e.cancelRequest(s.config),s)),t?.interceptor&&(this.instance.interceptors.request.use(t.interceptor.request,t.interceptor.requestError),this.instance.interceptors.response.use(t.interceptor.response,t.interceptor.responseError)),this.instance.interceptors.response.use(async s=>(await e.confirmRequest(s.config),s.data),async s=>{const{code:i="",config:r}=s;return!r||!r.retry||(r.retryCounted=r.retryCounted||0,r.retryCounted>=r.retry)?Promise.reject(s):(r.retryCounted++,await new Promise(a=>{setTimeout(a,r.retryDelay)}),await this.request(r))})}async request(t){return await this.instance.request(t)}async get(t,e){return this.request({...e,method:"get",url:t})}async delete(t,e){return this.request({...e,method:"delete",url:t})}async head(t,e){return this.request({...e,method:"head",url:t})}async options(t,e){return this.request({...e,method:"options",url:t})}async post(t,e,s){return this.request({...s,method:"post",url:t,data:e})}async put(t,e,s){return this.request({...s,method:"put",url:t,data:e})}async patch(t,e,s){return this.request({...s,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class Hr{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}async getRequestId(t){const{url:e,method:s,params:i,data:r}=t;return await qr({url:e,method:s,params:i,data:r})}async pendingRequest(t){const e=await this.getRequestId(t);if(this.pendingRequestMap.has(e))t.signal=this.pendingRequestMap.get(e)?.signal;else{const s=new AbortController;t.signal=s.signal,this.pendingRequestMap.set(e,s)}}async confirmRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&this.pendingRequestMap.delete(e)}async cancelRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&(this.pendingRequestMap.get(e)?.abort(),this.pendingRequestMap.delete(e))}async cancelAllRequest(){const t=this.pendingRequestMap.values();for(const e of t)e.abort();this.pendingRequestMap.clear()}}function jc(n,t,e,s,i){const r=t/e;let a=0,o=0;switch(n){case"aspectFit":r>=1?(a=s,o=a/r,o>i&&(o=i,a=o*r)):(o=i,a=o*r,a>s&&(a=s,o=a/r));break;case"aspectFill":r>=1?(o=i,a=o*r):(a=s,o=a/r);break;case"widthFix":a=s,o=a/r;break;case"heightFix":o=i,a=o*r;break;case"scaleToFill":default:a=s,o=i;break}return{width:a,height:o}}const Ds=new Map;async function $c(n){return new Promise((t,e)=>{Ms(n,(s,i)=>s?e(s):t({width:i.width,height:i.height,aspectRatio:i.width/i.height}))})}const Ms=(n,t)=>{if(Ds.has(n))return t(null,Ds.get(n));const e=new Image;e.onload=function(){Ds.set(n,{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height,element:e}),t(null,Ds.get(n))},e.onerror=function(s){t(s,null)},e.src=n},Wc=(n,t)=>{for(let e=0,s=n.length;e<s;e++){const i=n[e],{type:r}=i;if(r.split("/")[0]!=="image")continue;const a=new FileReader;a.onload=function(o){if(!o.target)return t("no reader target",null);const h=o.target.result,c=gn(h),l=new Blob([h]);Oi(l,(d,w)=>{if(!w)return t(d,null);Ms(w,(b,m)=>{if(!m)return t(b,null);jr(w,(P,_)=>{if(!_)return t(P,null);const v={name:i.name,fileType:c,size:i.size,width:m.width,height:m.height,imgUrl:w,imageData:_,blob:l};return t(null,v)})})})},a.readAsArrayBuffer(i)}},jr=(n,t)=>{Ms(n,(e,s)=>{if(!s)return t(e,null);const i=document.createElement("canvas"),r=i.getContext("2d");i.width=s.width,i.height=s.height,r.drawImage(s.element,0,0,i.width,i.height);const a=r.getImageData(0,0,i.width,i.height);return t(null,a)})},Jc=(n,t=0,e=0)=>{const s=document.createElement("canvas"),i=s.getContext("2d");return s.width=t,s.height=e,i.drawImage(n,0,0,t,e),i.getImageData(0,0,t,e)},Zc=(n,t=0,e=0)=>{const s=document.createElement("canvas"),i=s.getContext("2d");return s.width=t,s.height=e,i.drawImage(n,0,0,t,e),i.getImageData(0,0,t,e)},Kc=n=>{const t=n.width,e=n.height,s=t*e*3,i=s+54,r=[66,77,i&255,i>>8&255,i>>16&255,i>>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,s&255,s>>8&255,s>>16&255,s>>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=n.data;let c="";const l=t<<2;let d=e;const w=String.fromCharCode;do{const m=l*(d-1);let P="";for(let _=0;_<t;_++){const v=_<<2;P+=w(h[m+v+2])+w(h[m+v+1])+w(h[m+v])}for(let _=0;_<o;_++)P+=String.fromCharCode(0);c+=P}while(--d);function b(m){if(!window.btoa)throw"btoa undefined";let P="";if(typeof m=="string")P=m;else for(let _=0;_<m.length;_++)P+=String.fromCharCode(m[_]);return btoa(P)}return b(r.concat(a))+b(c)},Qc=n=>{const{width:t,height:e}=n,s=document.createElement("canvas"),i=s.getContext("2d");return s.width=t,s.height=e,i.putImageData(n,0,0,0,0,t,e),s.toDataURL("image/png")},tl=(n,t,e)=>{const{width:s,height:i}=n,r=document.createElement("canvas"),a=r.getContext("2d");r.width=s,r.height=i,a.putImageData(n,0,0,0,0,s,i);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},o,1)},Oi=(n,t)=>{const e=new FileReader;e.onload=function(s){s.target?t(null,s.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(n)},el=(n,t)=>{Oi(n,function(e,s){if(s){const i=new Image;i.src=s}else t(e)})};function sl(n){const t=[],e=[],s=[];let i=0;for(let h=0,c=n.data.length;h<c;h+=4)t[i]=n.data[h],e[i]=n.data[h+1],s[i]=n.data[h+2],i+=1;const r=Fi(t),a=Fi(e),o=Fi(s);return"rgb("+r+","+a+","+o+")"}function Fi(n){const t={},e=[],s=[];for(let o=0;o<n.length;o++)t[n[o]]?e.push(n[o]):t[n[o]]=1;let i=0;for(let o=0;o<e.length;o++){i=0;for(let h=0;h<e.length;h++)e[o]===e[h]&&(i+=1),s[o]=i}const r=Math.max.apply(null,s);let a=0;for(;a<s.length;a++)if(s[a]===r)return;return e[a]}const il=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[(a*e+e-o-1)*4],i[h+1]=t[(a*e+e-o-1)*4+1],i[h+2]=t[(a*e+e-o-1)*4+2],i[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(i,e,s)},nl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[((s-a-1)*e+o)*4],i[h+1]=t[((s-a-1)*e+o)*4+1],i[h+2]=t[((s-a-1)*e+o)*4+2],i[h+3]=t[((s-a-1)*e+o)*4+3]}return new ImageData(i,e,s)},rl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;i[h]=t[(o*e+e-a-1)*4],i[h+1]=t[(o*e+e-a-1)*4+1],i[h+2]=t[(o*e+e-a-1)*4+2],i[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(i,s,e)},al=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;i[h]=t[((s-o-1)*e+a)*4],i[h+1]=t[((s-o-1)*e+a)*4+1],i[h+2]=t[((s-o-1)*e+a)*4+2],i[h+3]=t[((s-o-1)*e+a)*4+3]}return new ImageData(i,s,e)},ol=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1]+t[h+2])/3;i[h]=c,i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},hl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;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];i[h]=c,i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},cl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h]+t[h+1]+t[h+2])/3>127?255:0;i[h]=l,i[h+1]=l,i[h+2]=l,i[h+3]=t[h+3]}return new ImageData(i,e,s)},ll=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=255-t[h],i[h+1]=255-t[h+1],i[h+2]=255-t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},ul=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=0,i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},dl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=0,i[h+1]=t[h+1],i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},fl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=0,i[h+1]=0,i[h+2]=t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},ml=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=t[h+1],i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},pl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=0,i[h+2]=t[h+1],i[h+3]=t[h+3]}return new ImageData(i,e,s)},gl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=0,i[h+1]=t[h+1],i[h+2]=t[h+1],i[h+3]=t[h+3]}return new ImageData(i,e,s)},yl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h+1]+t[h+2])/2;i[h]=t[h],i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},wl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+2])/2;i[h]=c,i[h+1]=t[h+1],i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},xl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1])/2;i[h]=c,i[h+1]=c,i[h+2]=t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},bl=n=>$r(n,[-1,-1,-1,-1,9,-1,-1,-1,-1]),vl=n=>$r(n,[-1,-1,-1,-1,8,-1,-1,-1,-1]),Sl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=t[h+1],i[h+2]=t[h+2],i[h+3]=255}return new ImageData(i,e,s)},Cl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;if(t[h+3]===0)i[h]=255,i[h+1]=255,i[h+2]=255,i[h+3]=255;else{const c=Wr([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);i[h]=c[0],i[h+1]=c[1],i[h+2]=c[2],i[h+3]=c[3]}}return new ImageData(i,e,s)},El=(n,t,e,s,i,r=!1,a)=>{const{data:o,width:h,height:c}=n;let l=i,d=s,w=t,b=e;if(l<0?l=0:l>h&&(l=h),d<0?d=0:d>c&&(d=c),w<1?w=1:w>h&&(w=h),b<1?b=1:b>c&&(b=c),l+w>h&&(w=h-l),d+b>c&&(b=c-d),r){const m=new Uint8ClampedArray(o.length);for(let _=0;_<c;_++)for(let v=0;v<h;v++){const x=(_*h+v)*4;v>=l&&v<=l+w&&_>=d&&_<=d+b?(m[x]=o[x],m[x+1]=o[x+1],m[x+2]=o[x+2],m[x+3]=o[x+3]):(m[x]=255,m[x+1]=255,m[x+2]=255,m[x+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(m,h,c)}else{const m=new Uint8ClampedArray(w*b*4);for(let _=d;_<=d+b;_++)for(let v=l;v<=l+w;v++){const x=((_-d)*w+v-l)*4,y=(_*h+v)*4;m[x]=o[y],m[x+1]=o[y+1],m[x+2]=o[y+2],m[x+3]=o[y+3]}return new ImageData(m,w,b)}},Tl=(n,t,e,s)=>{const{data:i,width:r,height:a}=n;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(i.length);for(let l=0;l<a;l++)for(let d=0;d<r;d++){const w=(l*r+d)*4;let b=-1;d<o?l<o?b=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(b=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(l-(a-o),2))):d>r-o-1&&(l<o?b=Math.sqrt(Math.pow(d-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(b=Math.sqrt(Math.pow(d-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(b)>o?(h[w]=255,h[w+1]=255,h[w+2]=255,h[w+3]=s||e.toUpperCase()==="PNG"?0:255):(h[w]=i[w],h[w+1]=i[w+1],h[w+2]=i[w+2],h[w+3]=s||e.toUpperCase()==="PNG"?i[w+3]:255)}return new ImageData(h,r,a)},Pl=(n,t,e,s,i,r=1e4)=>{const a=new Image;a.src=n;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,s,i),h.getImageData(0,0,s,i)},_l=(n,t)=>{const{data:e,width:s,height:i}=n,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;o++)for(let h=0;h<s;h++){const c=(o*s+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,s,i)},Al=(n,t,e=!1)=>{const{data:s,width:i,height:r}=n,a=new Uint8ClampedArray(s.length);for(let h=0;h<r;h++)for(let c=0;c<i;c++){const l=(h*i+c)*4;s[l+3]===0?(a[l]=255,a[l+1]=255,a[l+2]=255):(a[l]=s[l],a[l+1]=s[l+1],a[l+2]=s[l+2]);let d=s[l+3];e?d=Math.max(Math.min(Math.floor(255*t),255),0):d=Math.max(Math.min(Math.floor(d+255*t),255),0),a[l+3]=d}return new ImageData(a,i,r)},Dl=(n,t,e,s)=>{const{data:i,width:r,height:a}=n,{data:o,width:h,height:c}=t;let l=e,d=s;e+c>a&&(l=a-c),s+h>r&&(d=r-h);const w=new Uint8ClampedArray(i.length);for(let m=0;m<a;m++)for(let P=0;P<r;P++){const _=(m*r+P)*4;if(P<d||P>d+h||m<=l||m>=l+c)w[_]=i[_],w[_+1]=i[_+1],w[_+2]=i[_+2],w[_+3]=i[_+3];else{const v=(m*r+P-((l+1)*r+(m-(l+1))*(r-h))+h-d-1)*4,x=[o[v],o[v+1],o[v+2],o[v+3]],y=[i[_],i[_+1],i[_+2],i[_+3]],p=Wr(x,y);w[_]=p[0],w[_+1]=p[1],w[_+2]=p[2],w[_+3]=p[3]}}return new ImageData(w,r,a)},Ml=(n,t,e,s,i,r=10)=>{const{data:a,width:o,height:h}=n;let c=i,l=s,d=t,w=e;c<0?c=0:c>o&&(c=o),l<0?l=0:l>h&&(l=h),d<1?d=1:d>o&&(d=o),w<1?w=1:w>h&&(w=h),c+d>o&&(d=o-c),l+w>h&&(w=h-l);const b=new Uint8ClampedArray(a.length);for(let P=0;P<h;P++)for(let _=0;_<o;_++){const v=(P*o+_)*4;if(_>=c&&_<=c+d&&P>=l&&P<=l+w){const x=Math.floor((_-c)/r),y=Math.floor((P-l)/r);let p=Math.floor(r*(x+1)-r/2+c),E=Math.floor(r*(y+1)-r/2+l);p>o-1&&(p=o-1),E>h-1&&(E=h-1);const C=(E*o+p)*4;b[v]=a[C],b[v+1]=a[C+1],b[v+2]=a[C+2],b[v+3]=a[C+3]}else b[v]=a[v],b[v+1]=a[v+1],b[v+2]=a[v+2],b[v+3]=a[v+3]}return new ImageData(b,o,h)},Il=(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:s,width:i,height:r}=n,{data:a}=t,o=new Uint8ClampedArray(s.length),{backgroundColor:h,changeIntoColor:c}=e;for(let d=0;d<r;d++)for(let w=0;w<i;w++){const b=(d*i+w)*4,m=a[b],P=a[b+1],_=a[b+2],v=a[b+3];m===h.r&&P===h.g&&_===h.b&&v===h.a&&c.a!==0?(o[b]=c.r,o[b+1]=c.g,o[b+2]=c.b,o[b+3]=c.a):(o[b]=s[b],o[b+1]=s[b+1],o[b+2]=s[b+2],o[b+3]=s[b+3])}return new ImageData(o,i,r)}return n},$r=(n,t)=>{const{data:e,width:s,height:i}=n,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;for(let l=0;l<3;l++){const d=c+l;h===0||h===s-1||o===0||o===i-1?r[d]=e[d]:r[d]=t[0]*e[d-s*4-4]+t[1]*e[d-s*4]+t[2]*e[d-s*4+4]+t[3]*e[d-4]+t[4]*e[d]+t[5]*e[d+4]+t[6]*e[d+s*4-4]+t[7]*e[d+s*4]+t[8]*e[d+s*4+4]}r[c+3]=e[c+3]}return new ImageData(r,s,i)},Wr=(n,t)=>{if(n&&n.length===4&&t&&t.length===4){const e=n[3],s=t[3];if(e===255||s===0)return n;if(e===0)return t;{const i=e/255,r=s/255,a=Math.max(Math.min(Math.floor(n[0]*i+t[0]*r*(1-i)),255),0),o=Math.max(Math.min(Math.floor(n[1]*i+t[1]*r*(1-i)),255),0),h=Math.max(Math.min(Math.floor(n[2]*i+t[2]*r*(1-i)),255),0),c=Math.max(Math.min(Math.floor((i+r*(1-i))*255),255),0);return[a,o,h,c]}}return[255,255,255,255]},Ni=function(){const n=[];return{writeByte(t){n.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,s=t.length){for(let i=0;i<s;i++)this.writeByte(t[i+e])},writeString(t){for(let e=0,s=t.length;e<s;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return n},toString(){let t="[";for(let e=0,s=n.length;e<s;e++)e>0&&(t+=","),t+=n[e];return t+="]",t}}},Jr=function(){let n=0,t=0,e=0,s="";const i=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){s+=String.fromCharCode(i(a&63))};return{writeByte(a){for(n=n<<8|a&255,t+=8,e+=1;t>=6;)r(n>>>t-6),t-=6},flush(){if(t>0&&(r(n<<6-t),n=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)s+="="}},toString(){return s}}},Zr=function(n,t,e){const s=new Array(n*n),i=function(o){const h=o;let c=0,l=0;return{write(d,w){if(d>>>w)throw new Error("length over");for(;c+w>=8;)h.writeByte(255&(d<<c|l)),w-=8-c,d>>>=8-c,l=0,c=0;l=d<<c|l,c=c+w},flush(){c>0&&h.writeByte(l)}}},r=function(o){const h=1<<o,c=(1<<o)+1;let l=o+1;const d=a();for(let _=0;_<h;_++)d.add(String.fromCharCode(_));d.add(String.fromCharCode(h)),d.add(String.fromCharCode(c));const w=Ni(),b=i(w);b.write(h,l);let m=0,P=String.fromCharCode(s[m]);for(m+=1;m<s.length;){const _=String.fromCharCode(s[m]);m+=1,d.contains(P+_)?P=P+_:(b.write(d.indexOf(P),l),d.size()<4095&&(d.size()==1<<l&&(l+=1),d.add(P+_)),P=_)}return b.write(d.indexOf(P),l),b.write(c,l),b.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){s[h*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(me("0x"+t[1]+t[2])),o.writeByte(me("0x"+t[3]+t[4])),o.writeByte(me("0x"+t[5]+t[6])),o.writeByte(me("0x"+e[1]+e[2])),o.writeByte(me("0x"+e[3]+e[4])),o.writeByte(me("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(n),o.writeShort(n),o.writeByte(0);const h=2,c=r(h);o.writeByte(h);let l=0;for(;c.length-l>255;)o.writeByte(255),o.writeBytes(c,l,255),l+=255;o.writeByte(c.length-l),o.writeBytes(c,l,c.length-l),o.writeByte(0),o.writeString(";")}}},Kr=function(n,t,e,s){const i=Zr(n,t,e);for(let c=0;c<n;c++)for(let l=0;l<n;l++)i.setPixel(l,c,s(l,c));const r=Ni();i.write(r);const a=Jr(),o=r.toByteArray();for(let c=0,l=o.length;c<l;c++)a.writeByte(o[c]);a.flush();let h="";return h+="data:image/gif;base64,",h+=a,h},xt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Xe={M:0,L:1,H:2,Q:3},ee={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Q={glog:function(n){if(n<1)throw new Error("glog("+n+")");return Q.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return Q.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let n=0;n<8;n++)Q.EXP_TABLE[n]=1<<n;for(let n=8;n<256;n++)Q.EXP_TABLE[n]=Q.EXP_TABLE[n-4]^Q.EXP_TABLE[n-5]^Q.EXP_TABLE[n-6]^Q.EXP_TABLE[n-8];for(let n=0;n<255;n++)Q.LOG_TABLE[Q.EXP_TABLE[n]]=n;const j={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(;j.getBCHDigit(t)-j.getBCHDigit(j.G15)>=0;)t^=j.G15<<j.getBCHDigit(t)-j.getBCHDigit(j.G15);return(n<<10|t)^j.G15_MASK},getBCHTypeNumber:function(n){let t=n<<12;for(;j.getBCHDigit(t)-j.getBCHDigit(j.G18)>=0;)t^=j.G18<<j.getBCHDigit(t)-j.getBCHDigit(j.G18);return n<<12|t},getBCHDigit:function(n){let t=0;for(;n!=0;)t++,n>>>=1;return t},getPatternPosition:function(n){return j.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,t,e){switch(n){case ee.PATTERN000:return(t+e)%2==0;case ee.PATTERN001:return t%2==0;case ee.PATTERN010:return e%3==0;case ee.PATTERN011:return(t+e)%3==0;case ee.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case ee.PATTERN101:return t*e%2+t*e%3==0;case ee.PATTERN110:return(t*e%2+t*e%3)%2==0;case ee.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){let t=new we([1],0);for(let e=0;e<n;e++)t=t.multiply(new we([1,Q.gexp(e)],0));return t},getLengthInBits:function(n,t){if(1<=t&&t<10)switch(n){case xt.MODE_NUMBER:return 10;case xt.MODE_ALPHA_NUM:return 9;case xt.MODE_8BIT_BYTE:return 8;case xt.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(t<27)switch(n){case xt.MODE_NUMBER:return 12;case xt.MODE_ALPHA_NUM:return 11;case xt.MODE_8BIT_BYTE:return 16;case xt.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(t<41)switch(n){case xt.MODE_NUMBER:return 14;case xt.MODE_ALPHA_NUM:return 13;case xt.MODE_8BIT_BYTE:return 16;case xt.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 r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const h=n.isDark(r,a);for(let c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(let l=-1;l<=1;l++)a+l<0||t<=a+l||c==0&&l==0||h==n.isDark(r+c,a+l)&&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;n.isDark(r,a)&&o++,n.isDark(r+1,a)&&o++,n.isDark(r,a+1)&&o++,n.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++)n.isDark(r,a)&&!n.isDark(r,a+1)&&n.isDark(r,a+2)&&n.isDark(r,a+3)&&n.isDark(r,a+4)&&!n.isDark(r,a+5)&&n.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)n.isDark(a,r)&&!n.isDark(a+1,r)&&n.isDark(a+2,r)&&n.isDark(a+3,r)&&n.isDark(a+4,r)&&!n.isDark(a+5,r)&&n.isDark(a+6,r)&&(e+=40);let s=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)n.isDark(a,r)&&s++;const i=Math.abs(100*s/t/t-50)/5;return e+=i*10,e}};class we{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let s=0;for(;s<t.length&&t[s]==0;)s++;this.num=new Array(t.length-s+e);for(let i=0;i<t.length-s;i++)this.num[i]=t[i+s]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let s=0;s<this.getLength();s++)for(let i=0;i<t.getLength();i++)e[s+i]^=Q.gexp(Q.glog(this.get(s))+Q.glog(t.get(i)));return new we(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=Q.glog(this.get(0))-Q.glog(t.get(0)),s=new Array(this.getLength());for(let i=0;i<this.getLength();i++)s[i]=this.get(i);for(let i=0;i<t.getLength();i++)s[i]^=Q.gexp(Q.glog(t.get(i))+e);return new we(s,0).mod(t)}}class Gt{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 s=Gt.getRsBlockTable(t,e);if(s==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const i=s.length/3,r=[];for(let a=0;a<i;a++){const o=s[a*3+0],h=s[a*3+1],c=s[a*3+2];for(let l=0;l<o;l++)r.push(new Gt(h,c))}return r}static getRsBlockTable(t,e){switch(e){case Xe.L:return Gt.RS_BLOCK_TABLE[(t-1)*4+0];case Xe.M:return Gt.RS_BLOCK_TABLE[(t-1)*4+1];case Xe.Q:return Gt.RS_BLOCK_TABLE[(t-1)*4+2];case Xe.H:return Gt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Qr{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 s=0;s<e;s++)this.putBit((t>>>e-s-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 kl{mode;data;constructor(t){this.mode=xt.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,s=this.data.length;e<s;e++)t.put(this.data.charCodeAt(e),8)}}class se{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Xe[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new kl(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=Gt.getRSBlocks(t,this.errorCorrectLevel),s=new Qr;let i=0;for(let r=0;r<e.length;r++)i+=e[r].dataCount;for(let r=0;r<this.dataList.length;r++){const a=this.dataList[r];s.put(a.mode,4),s.put(a.getLength(),j.getLengthInBits(a.mode,t)),a.write(s)}if(s.getLengthInBits()<=i*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 s=0;s<this.moduleCount;s++){this.modules[s]=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++)this.modules[s][i]=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=se.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let s=-1;s<=7;s++)if(!(t+s<=-1||this.moduleCount<=t+s))for(let i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=s&&s<=6&&(i==0||i==6)||0<=i&&i<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=i&&i<=4?this.modules[t+s][e+i]=!0:this.modules[t+s][e+i]=!1)}getBestMaskPattern(){let t=0,e=0;for(let s=0;s<8;s++){this.makeImpl(!0,s);const i=j.getLostPoint(this);(s==0||t>i)&&(t=i,e=s)}return e}createMovieClip(t,e,s){const i=t.createEmptyMovieClip(e,s),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]&&(i.beginFill(0,100),i.moveTo(c,o),i.lineTo(c+r,o),i.lineTo(c+r,o+r),i.lineTo(c,o+r),i.endFill())}}return i}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=j.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let s=0;s<t.length;s++){const i=t[e],r=t[s];if(this.modules[i][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[i+a][r+o]=!0:this.modules[i+a][r+o]=!1}}setupTypeNumber(t){const e=j.getBCHTypeNumber(this.typeNumber);for(let s=0;s<18;s++){const i=!t&&(e>>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=i}for(let s=0;s<18;s++){const i=!t&&(e>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=i}}setupTypeInfo(t,e){const s=this.errorCorrectLevel<<3|e,i=j.getBCHTypeInfo(s);for(let r=0;r<15;r++){const a=!t&&(i>>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&&(i>>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 s=-1,i=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[i][o-h]==null){let c=!1;a<t.length&&(c=(t[a]>>>r&1)==1),j.getMask(e,i,o-h)&&(c=!c),this.modules[i][o-h]=c,r--,r==-1&&(a++,r=7)}if(i+=s,i<0||this.moduleCount<=i){i-=s,s=-s;break}}}static createData(t,e,s){const i=Gt.getRSBlocks(t,e),r=new Qr;for(let o=0;o<s.length;o++){const h=s[o];r.put(h.mode,4),r.put(h.getLength(),j.getLengthInBits(h.mode,t)),h.write(r)}let a=0;for(let o=0;o<i.length;o++)a+=i[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(se.PAD0,8),r.getLengthInBits()>=a*8));)r.put(se.PAD1,8);return se.createBytes(r,i)}static createBytes(t,e){let s=0,i=0,r=0;const a=new Array(e.length),o=new Array(e.length);for(let d=0;d<e.length;d++){const w=e[d].dataCount,b=e[d].totalCount-w;i=Math.max(i,w),r=Math.max(r,b),a[d]=new Array(w);for(let v=0;v<a[d].length;v++)a[d][v]=255&t.buffer[v+s];s+=w;const m=j.getErrorCorrectPolynomial(b),_=new we(a[d],m.getLength()-1).mod(m);o[d]=new Array(m.getLength()-1);for(let v=0;v<o[d].length;v++){const x=v+_.getLength()-o[d].length;o[d][v]=x>=0?_.get(x):0}}let h=0;for(let d=0;d<e.length;d++)h+=e[d].totalCount;const c=new Array(h);let l=0;for(let d=0;d<i;d++)for(let w=0;w<e.length;w++)d<a[w].length&&(c[l++]=a[w][d]);for(let d=0;d<r;d++)for(let w=0;w<e.length;w++)d<o[w].length&&(c[l++]=o[w][d]);return c}}const ta=Math.ceil,Ue=Math.floor,ea=Math.round;function Ll(n,t){const e=on(n),s=t?.ecc||"H",i=t?.size||256,r=-1,a=t?.padding||0,o=t?.color||"#000000",h=t?.background||"#ffffff",c=new se(r,s);c.addData(e),c.make();const l=c.getModuleCount(),d=(i-a*2)/l,w=a,b=i-a;return Kr(i,o,h,function(m,P){if(w<=m&&m<b&&w<=P&&P<b){const _=Ue((m-w)/d),v=Ue((P-w)/d);return c.isDark(v,_)?0:1}else return 1})}function Rl(n,t){const e=t.x||0,s=t.y||0,i=on(n),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?Ue(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",d=t.background||"#ffffff",w=new se(c,a);w.addData(i),w.make();const b=w.getModuleCount(),m=(o-h*2)/b;r.fillStyle=d,r.fillRect(e,s,o,o);for(let P=0;P<b;P++)for(let _=0;_<b;_++){const v=ta((_+1)*m)-Ue(_*m),x=ta((P+1)*m)-Ue(P*m);r.fillStyle=w.isDark(P,_)?l:d,r.fillRect(e+ea(_*m)+h,s+ea(P*m)+h,v,x)}}class at extends z{shapesCountChange=!1;constructor(t){super(t)}shapeInit(){}frameStart(t){return this.shapesCountChange&&(this.shapesCountChange=!1,this.shapes.forEach(e=>{e.parent=this,e.initPathD()}),this.pathd=this.initPathD(),this.shapes.forEach(e=>{!e.forceCXY&&!e.independentTransformInGroup&&(e.cX=this.cX-e.diffXInGroup,e.cY=this.cY-e.diffYInGroup)})),super.frameStart(t)}frameUpdate(t,e){this.shapes.forEach(s=>{!s.independentTransformInGroup&&!s.isDragging&&(s.x=this.x+s.diffXInGroup,s.y=this.y+s.diffYInGroup,s.degree=this.degree+s.diffDegreeInGroup,s.scalarX=this.scalarX*s.diffScalarXInGroup,s.scalarY=this.scalarY*s.diffScalarYInGroup)}),super.frameUpdate(t,e)}addShape(t){(Array.isArray(t)?t:[t]).forEach(e=>{this.shapes.findIndex(s=>s.id==e.id)==-1&&(e.on("draging",(s,i)=>{this.enableDrag&&(this.x+=s,this.y+=i,this.emit("draging",s,i,e))}),this.shapes.push(e),this.shapesCountChange=!0)})}getBoundingClientRect(){const t=[],e=[];this.shapes.forEach(h=>{const c=h.getBoundingClientRect();c&&(t.push(c.x,c.x+c.width),e.push(c.y,c.y+c.height))});const s=this.pathd?.getBoundingClientRect();if(s&&(s.width||s.height)&&(t.push(s.x,s.x+s.width),e.push(s.y,s.y+s.height)),t.length==0||e.length==0)return null;const i=Math.min.apply(0,t),r=Math.min.apply(0,e),a=Math.max.apply(0,t),o=Math.max.apply(0,e);return{x:i,y:r,width:a-i,height:o-r}}setAttrs(t,e){typeof t!="string"?(super.setAttr(t),this.shapes.forEach(s=>{s.setAttr(t)})):e&&(super.setAttr(t,e),this.shapes.forEach(s=>{s.setAttr(t,e)}))}sortPathD(){this.shapes=this.shapes.map(t=>{const e=t.initPathD();return{shape:t,perimeter:e.perimeterPoints()}}).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendFill(t){const e=t.shapes.length,s=this.shapes.length;if(e<s)return t.expendFill(this);for(let i=s;i<e;i++){const a=t.shapes[i].initPathD().polymorphPoints,o=a[0],h=a[1],c=[["M",o,h]];for(let l=2;l+5<a.length;l+=6)c.push(["C",o,h,o,h,o,h]);this.addShape(new z({attrs:{...t.shapes[i].getAttrs()},d:c}))}}strokeDashTween(t,e){switch(e?.type){case"sequence":const s=this.shapes.length-1;this.shapes.forEach((o,h)=>{o.strokeDashTween(t,{...e,delay:h,onStart:()=>{h==0&&e?.onGroupStart?.()},onUpdate:()=>{e?.onGroupUpdate?.()},onComplete:()=>{h==s&&e?.onGroupComplete?.()}})});break;case"parallel":default:const i=new gs({frameDuration:t}),r={},a={};this.shapes.forEach((o,h)=>{const c=Mt(o.getTotalLength(),0);r[`offset_${h}`]=c,a[`offset_${h}`]=0,o.setAttr({strokeDasharray:`${c} ${c}`,strokeDashoffset:`${c}`})}),i.addTween(r,a,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(o,h)=>{for(let c in o){const l=js(c).number;this.shapes[l].setAttr("strokeDashoffset",""+Mt(o[c],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),i.play();break}}}class ce extends z{toX;toY;constructor(t){super(t),this.toX=t?.toX||0,this.toY=t?.toY||0;let e=this.toX-this.x,s=this.toY-this.y;return new Proxy(this,{set(i,r,a,o){switch(r){case"x":i.toX=a+e;break;case"y":i.toY=a+s;break;case"toX":e=a-i.x;break;case"toY":s=a-i.y;break}return Reflect.set(i,r,a,o)}})}toSVGPathData(){return[["m",0,0],["l",this.toX-this.x,this.toY-this.y]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.lineTo(this.toX-this.x,this.toY-this.y)}intersection(t){const e=new Bn({x:this.x,y:this.y,toX:this.toX,toY:this.toY}),s=new Bn({x:t.x,y:t.y,toX:t.toX,toY:t.toY});return e.intersection(s)}}class Ol extends z{cx;cy;toX;toY;isLineThrough;constructor(t){super(t),this.cx=t?.cx||0,this.cy=t?.cy||0,this.toX=t?.toX||0,this.toY=t?.toY||0,this.isLineThrough=typeof t?.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["m",0,0],["q",t-this.x,e-this.y,this.toX-this.x,this.toY-this.y]]}else return[["m",0,0],["q",this.cx-this.x,this.cy-this.y,this.toX-this.x,this.toY-this.y]]}toCanvasContext(t){if(t.beginPath(),t.moveTo(0,0),this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e-this.x,s-this.y,this.toX-this.x,this.toY-this.y)}else t.quadraticCurveTo(this.cx-this.x,this.cy-this.y,this.toX-this.x,this.toY-this.y)}}class sa extends nr{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,s)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,s)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const s=ja(e);for(let i of s.stylesheet.rules)for(let r of i.declarations)for(let a of i.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,s)=>{let i=this.groups.length;for(;i--;)if(this.groups[i]!=this.currentItem){let r="",a="";for(let o in this.groups[i])o=="transform"?r=this.groups[i].transform:o=="class"&&this.globalStyles["."+this.groups[i][o]]?a=this.globalStyles["."+this.groups[i][o]].join(";")+";"+a:o=="id"&&this.globalStyles["#"+this.groups[i][o]]?a=this.globalStyles["#"+this.groups[i][o]].join(";")+";"+a:typeof this.currentItem[o]>"u"&&(this.currentItem[o]=this.groups[i][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),Yi(this.currentItem.style,this.currentItem,Xi)}switch(this.processAttrs(e,s),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 s=[],i;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":i={},e.style&&Yi(e.style,i),i.offset=i.offset||e.offset,i.color=i["stop-color"]||e["stop-color"],i.opacity=i["stop-opacity"]||e["stop-opacity"],~(i.offset+"").indexOf("%")?i.offset=parseFloat(i.offset):i.offset=parseFloat(i.offset)*100,i.offset=+i.offset.toFixed(2),this.grad.stops.push(i);break;case"linearGradient":this.grad.angle=(360+Bi(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),s=[this.grad.angle];for(let o=0,h=this.grad.stops.length;o<h;o++)i=this.grad.stops[o],o&&o!=h-1?s.push(i.color+":"+i.offset):s.push(i.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break;case"radialGradient":s=[];for(let o=0,h=this.grad.stops.length;o<h;o++)i=this.grad.stops[o],o&&o!=h-1?s.push(i.color+":"+i.offset):s.push(i.color);this.idtops[this.grad.id]=s.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(Xi.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"&&Yi(a,this.currentItem,Xi),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 Bi(n,t,e,s,i,r){if(typeof i>"u"||typeof r>"u"){const a=n-e,o=t-s;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return Bi(n,t,i,r)-Bi(e,s,i,r)}function Yi(n,t,e){const s=(n+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,a=s.length;r<a;r++){let o=s[r].split(":"),h=o[0].replace(i,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=o[1].replace(i,""))}}const Xi=["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 Fl{app;rootEl;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e,s){this.app=t,this.rootEl=yt.createSVGElement("svg"),L.empty(this.app.container),L.insert(this.app.container,this.rootEl),e&&s?this.setSize(e,s):(this.setSize(this.app.width,this.app.height),this.app.on("resize",()=>{this.setSize(this.app.width,this.app.height)})),this.app.captureDrag({start:()=>{this.isMouseDown=!0,this.dragDx=0,this.dragDy=0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.dragDx=0,this.dragDy=0,this.setCursor()},move:(i,r)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=r.dx,this.dragDy+=r.dy),this.setCursor()}}),this.app.on("tap",()=>{for(let i of this.shapes)if(this.currentMouseInShape==i){i.emit("clicked");let r=i.parent;for(;r;)r.emit("clicked",i),r=r.parent;break}})}setCursor(){this.currentEnableDragMouseInShape?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShape?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}setSize(t,e){return L.attribute(this.rootEl,{viewBox:`0 0 ${t} ${e}`,width:`${t}`,height:`${e}`}),this}download(){return yt.downloadFromSVGElement(this.rootEl)}_addDrawShape(t){this.shapes.findIndex(e=>e.id==t.id)===-1&&(this.shapes.push(t),t instanceof at&&t.shapes.forEach(e=>{this._addDrawShape(e)}))}path(t){(Array.isArray(t)?t:[t]).forEach(e=>{this._addDrawShape(e)}),this.isMouseDown&&this.currentEnableDragMouseInShape||(this.currentMouseInShape=void 0);for(let e of this.shapes){if(!e.isShow){e.el&&(L.remove(e.el),delete e.el);continue}if(e.frameStart(this.app.mousePoint),e.el||(e instanceof Ge?e.el=this.text(e.text,e.x,e.y,un(e.getAttrs(),(i,r)=>typeof r=="string")):(e.el=yt.createSvgPath(e.toSVGPathD(),e.id),L.insert(this.rootEl,e.el))),e.followMouse&&(!Qe(e.x,this.app.mousePoint.x,5)||!Qe(e.y,this.app.mousePoint.y,5))&&e.followTo(this.app.mousePoint),e.targetToAfterDragFree&&(this.isMouseDown||e.runEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShape==e){e.isDragging=!0;const i=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,i||r){if(e.x+=i,e.y+=r,e.alongPath){const a=e.alongPath.closestPoint(e.x,e.y);e.x=a.point.x-e.cX,e.y=a.point.y-e.cY}e.emit("draging",i,r)}}else e.isDragging=!1;e instanceof Ge&&(e.setAttr("x",String(e.x)),e.setAttr("y",String(e.y))),e.frameUpdate(this.app.mousePoint);const s=e.toSVGPathD();if(this.attr(e,un(e.getAttrs(),(i,r)=>typeof r=="string")),this.attr(e,"d",s),!this.currentMouseInShape){const i=e.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||e.isPointInStroke(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||!1;e.isMouseIn=i,i&&(this.currentMouseInShape=e,e.enableDrag&&(this.currentEnableDragMouseInShape=e))}e.frameEnd(this.app.mousePoint)}this.currentMouseInShape||(this.currentEnableDragMouseInShape=void 0)}delete(t){(Array.isArray(t)?t:[t]).forEach(e=>{e.el&&L.remove(e.el),delete e.el,this.shapes=this.shapes.filter(s=>s.id!==e.id)})}clear(){this.shapes.forEach(t=>{t.el&&L.remove(t.el),delete t.el}),L.empty(this.rootEl),this.shapes=[]}attr(t,e,s){const i=t.el||t;return i instanceof SVGElement?e===void 0&&s===void 0?L.attribute(i):typeof e=="string"&&s===void 0?L.attribute(i,ft(e))||"":(typeof e=="object"?L.attribute(i,e):typeof e=="string"&&s!==void 0&&L.attribute(i,ft(e),s),this):this}circle(t,e,s){return this.path(new Vt({x:t,y:e,radius:s}))}circleEl(t,e,s){const i=yt.createSVGElement("circle",{cx:String(t),cy:String(e),r:String(s)});return L.insert(this.rootEl,i),i}ellipse(t,e,s,i){return this.path(new na({x:t,y:e,rx:s,ry:i}))}ellipseEl(t,e,s,i){const r=yt.createSVGElement("ellipse",{cx:String(t),cy:String(e),rx:String(s),ry:String(i)});return L.insert(this.rootEl,r),r}rect(t,e,s,i){return this.path(new zt({x:t,y:e,width:s,height:i}))}rectEl(t,e,s,i){const r=yt.createSVGElement("rect",{x:String(t),y:String(e),width:String(s),height:String(i)});return L.insert(this.rootEl,r),r}image(t,e,s,i,r){}text(t,e,s,i){const r=yt.createSVGElement("text",{x:String(e),y:String(s)});return L.html(r,t),this.attr(r,Object.assign({"alignment-baseline":"middle"},i)),L.insert(this.rootEl,r),r}textWithTspan(t,e,s,i){const r=i?.["line-height"]||"1.2em",a=yt.createSVGElement("text",{x:String(e),y:String(s)});return t.split(`
|
|
41
|
+
`).forEach((o,h)=>{if(o.trim()){const c=yt.createSVGElement("tspan",{x:String(e),dy:h>0?r:"0"});L.html(c,o),L.insert(a,c),this.attr(c,Object.assign({"alignment-baseline":"middle"},i))}}),L.insert(this.rootEl,a),a}}class Nl extends at{svgWidth=0;svgHeight=0;width=0;height=0;constructor(t){super(t);const e=new sa(t.svg).parse();for(let s=0,i=e.length;s<i;s++){const r=e[s];if(r.type=="viewbox"&&r.width&&r.height){if(this.svgWidth=parseFloat(r.width),this.svgHeight=parseFloat(r.height),t.width){const l=this.svgWidth/this.svgHeight;this.width=t.width,this.height=this.width/l}else this.width=this.svgWidth,this.height=this.svgHeight;continue}if(r.type!="path"||!ae.isSVGPath(r.path))continue;const a={};for(const l in r)l==="type"||l==="path"||l==="transform"||(a[l]=r[l]);const o=ae.absolutizeSVGPath(ae.parseSVGPath(r.path)),h=[];let c=[];for(let l=0,d=o.length;l<d;l++){const w=o[l];c.push(w),w[0].toLowerCase()=="z"&&(h.push(c),c=[])}c.length&&h.push(c),h.forEach(l=>{const d=mi(r.transform??"");d.scale(this.width&&this.svgWidth?this.width/this.svgWidth:1),this.addShape(new z({...t,attrs:{...a,...t?.attrs||{}},d:l,originMatrix:d}))})}}shapeInit(){this.trim()}}class Vt extends z{radius;constructor(t){super(t),this.radius=t?.radius||0}getBoundingClientRect(){return{x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2}}toSVGPathData(){return this.radius?[["m",0,-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:[["m",0,0]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.radius===t.radius&&this.mass===t.mass}midPointBtw(t){return{x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2}}length(){return as(this.x,this.y)}scalar(t){return this.x*=t,this.y*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y;return{x:s*t.x-e*t.y,y:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y}}div(t){return{x:this.x/t.x,y:this.y/t.y}}add(t){return{x:this.x+t.x,y:this.y+t.y}}sub(t){return{x:this.x-t.x,y:this.y-t.y}}dot(t){return this.x*t.x+this.y*t.y}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y}}checkCollision(t){const e=t.x-this.x,s=t.y-this.y;if(Math.sqrt(e*e+s*s)<this.radius+t.radius){const r=Math.atan2(s,e),a={x:0,y:0},o=_t(-r,e,s),h=_t(-r,this.vx,this.vy),c=_t(-r,t.vx,t.vy),l=h.x-c.x;h.x=((this.mass-t.mass)*h.x+2*t.mass*c.x)/(this.mass+t.mass),c.x=l+h.x;const d=Math.abs(h.x)+Math.abs(c.x),w=this.radius+t.radius-Math.abs(a.x-o.x);a.x+=h.x/d*w,o.x+=c.x/d*w;const b=_t(r,a.x,a.y),m=_t(r,o.x,o.y);t.x=this.x+m.x,t.y=this.y+m.y,this.x=this.x+b.x,this.y=this.y+b.y;const P=_t(r,h.x,h.y),_=_t(r,c.x,c.y);this.vx=P.x,this.vy=P.y,t.vx=_.x,t.vy=_.y}}checkWall(t){const e=typeof t?.bounce=="number"?t.bounce:-1,s=t.wall.x,i=t.wall.y,r=t.wall.x+t.wall.width,a=t.wall.y+t.wall.height;this.x+this.radius>r?(this.x=r-this.radius,this.vx*=e):this.x-this.radius<s&&(this.x=s+this.radius,this.vx*=e),this.y+this.radius>a?(this.y=a-this.radius,this.vy*=e):this.y-this.radius<i&&(this.y=i+this.radius,this.vy*=e)}}class ia extends z{points;isStraight;constructor(t){if(super(t),this.points=t.points,this.points.length<3)throw new Error("points length must >= 3");this.isStraight=typeof t?.isStraight=="boolean"?t.isStraight:!0}toSVGPathData(){const t=[],e=this.points.length;if(this.isStraight){t.push(["M",this.points[0].x,this.points[0].y]);for(let s=1;s<=e-1;s++)t.push(["L",this.points[s].x,this.points[s].y]);t.push(["Z"])}else{const s=(this.points[0].x+this.points[e-1].x)/2,i=(this.points[0].y+this.points[e-1].y)/2;t.push(["M",s,i]);for(let r=0;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.push(["Q",this.points[r].x,this.points[r].y,a,o])}t.push(["Q",this.points[e-1].x,this.points[e-1].y,s,i])}return t}toCanvasContext(t){t.beginPath();const e=this.points.length;if(this.isStraight){t.moveTo(this.points[0].x,this.points[0].y);for(let s=1;s<=e-1;s++)t.lineTo(this.points[s].x,this.points[s].y);t.closePath()}else{const s=(this.points[0].x+this.points[e-1].x)/2,i=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(s,i);for(let r=0;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.points[r].y,a,o)}t.quadraticCurveTo(this.points[e-1].x,this.points[e-1].y,s,i)}}isContainPoint(t,e){const s=this.points.length;let i=!1;const r=2e-10;for(let a=0,o=s-1;a<s;o=a,a++){const h=this.points[a].x,c=this.points[a].y,l=this.points[o].x,d=this.points[o].y;if(h===t&&c===e||l===t&&d===e||e===c&&e===d)return!0;if(e>=c&&e<d||e<c&&e>=d){const w=(l-h)/(d-c),b=h+w*(e-c);if(b===t||Math.abs(b-t)<r)return!0;b>t&&(i=!i)}}return i}[Symbol.iterator](){let t=-1;return{next:()=>({value:t<=this.points.length-1?this.points[++t]:void 0,done:t>=this.points.length})}}}class zt extends z{width;height;borderRadius;constructor(t){super(t),this.width=t.width,this.height=t.height,this.borderRadius=t.borderRadius||0}static fromCubicBezier(t,e,s,i,r,a,o,h){const c=new mt({x:t,y:e,c1x:s,c1y:i,c2x:r,c2y:a,toX:o,toY:h});return new zt(c.getBoundingClientRect())}getBoundingClientRect(){return{x:this.x,y:this.y,width:this.width,height:this.height}}toSVGPathData(){return this.borderRadius?[["m",this.borderRadius,0],["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",0,0],["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&&this.borderRadius===t.borderRadius}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}}class na extends z{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}getBoundingClientRect(){return{x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2}}toSVGPathData(){return[["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(0,0,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class Bl extends z{constructor(t){super(t)}toSVGPathData(){return[["m",-50,-25],["l",50,0],["l",0,-25],["l",50,50],["l",-50,50],["l",0,-25],["l",-50,0],["l",0,-50],["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 Yl extends z{constructor(t){super(t)}toSVGPathData(){return[["m",4,24],["l",4,-8],["l",6,-6],["l",1,-10],["l",-6,-10],["l",-7,10],["l",-4,0],["l",-7,-10],["l",-6,10],["l",1,10],["l",6,6],["l",4,8],["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()}}class Xl extends z{rx;ry;constructor(t){super(t),this.rx=t?.rx||10,this.ry=t?.ry||10}toSVGPathData(){return[["m",0,0],["l",this.rx*2.4,-this.ry*3.14],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,-this.ry*1.5],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,this.ry*1.5],["l",this.rx*2.4,this.ry*3.14],["z"]]}}class Ul extends z{rx;ry;constructor(t){super(t),this.rx=t?.rx??50,this.ry=t?.ry??50}toSVGPathData(){return[["m",0,0+this.ry*.3],["C",0,0,0-this.rx/2,0,0-this.rx/2,0+this.ry*.3],["C",0-this.rx/2,0+(this.ry+this.ry*.3)/2,0,0+(this.ry+this.ry*.3)/1.4,0,0+this.ry],["C",0,0+(this.ry+this.ry*.3)/1.8,0+this.rx/2,0+(this.ry+this.ry*.3)/2,0+this.rx/2,0+this.ry*.3],["C",0+this.rx/2,0,0,0,0,0+this.ry*.3],["z"]]}}class Gl extends z{r;constructor(t){super(t),this.r=t?.r||20}toSVGPathData(){const t=[["m",0,-this.r]];for(let e=0;e<6;e+=1){const s=288+e*144,i=this.r*Math.cos(N(s)),r=this.r*Math.sin(N(s));t.push(["l",i,r])}return t}}class Vl extends z{constructor(t){super(t)}toSVGPathData(){return[["M",0,0],["C",15,0,15,-40,5,-30],["L",0,0],["C",-15,0,-15,-40,-5,-30],["L",0,0],["a",15,15,0,1,1,0,30],["a",15,15,0,1,1,0,-30]]}}class zl extends z{constructor(t){super(t),this.originD="m5.068 9.267-3.08-.77a.512.512 0 0 1 0-.994l3.08-.77a2.289 2.289 0 0 0 1.665-1.665l.77-3.08a.512.512 0 0 1 .994 0l.77 3.08c.205.82.845 1.46 1.665 1.665l3.08.77a.512.512 0 0 1 0 .994l-3.08.77a2.29 2.29 0 0 0-1.665 1.665l-.77 3.08a.512.512 0 0 1-.994 0l-.77-3.08a2.289 2.289 0 0 0-1.665-1.665Z"}}class ql extends at{constructor(t){super(t);const e=new ce({...t,x:this.x,y:this.y,toX:this.x,toY:this.y-140-Math.random()*20}),s=30+Math.random()*30,i=new ce({...t,x:this.x,y:this.y-s,diffYInGroup:-s,toX:this.x+Math.random()*80-40,toY:this.y-100-Math.random()*40}),r=60+Math.random()*40,a=new ce({...t,x:this.x,y:this.y-r,diffYInGroup:-r,toX:this.x+Math.random()*60-30,toY:this.y-110-Math.random()*20});this.addShape([e,i,a])}}class Ge extends z{text;width=0;height=0;constructor(t){super(t),this.text=t.text,this.setAttr({fontSize:"10px",fontFamily:'system-ui, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',emojiFontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif',fill:"#666666",stroke:"none","alignment-baseline":"middle",textAnchor:"start",...this.getAttrs()});const e=js(this.getAttr("fontSize"),10).number,s=js(this.getAttr("fontWeight"),400).number,i=L.measureText(this.text,e,s);this.width=i.width,this.height=i.height}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){t.fillText(this.text,0,0)}}class ra extends at{text;bg;padding;offset;isShow;textShape;bgShape;constructor(t){super(t),this.text=t.text,this.bg=t.bg||"rgba(0,0,0,0.5)",this.padding=t.padding||4,this.offset=t.offset||20,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!1,this.textShape=new Ge({...t,x:this.x+this.offset,y:this.y+this.offset,text:this.text,attrs:{...this.getAttrs(),fill:Oe(this.bg).opposite(!0).toString(),textAnchor:"start"}}),this.bgShape=new zt({...t,x:this.textShape.x-this.padding,y:this.textShape.y-this.textShape.height/2-this.padding,width:this.textShape.width+this.padding*2,height:this.textShape.height+this.padding*2,attrs:{...this.getAttrs(),fill:this.bg}}),this.addShape([this.bgShape,this.textShape])}shapeInit(){Hs(()=>{this.textShape.x=this.x+this.offset,this.textShape.y=this.y+this.offset,this.textShape.text=this.text,this.textShape.isShow=this.isShow,this.bgShape.x=this.textShape.x-this.padding,this.bgShape.y=this.textShape.y-this.textShape.height/2-this.padding,this.bgShape.width=this.textShape.width+this.padding*2,this.bgShape.height=this.textShape.height+this.padding*2,this.bgShape.isShow=this.isShow})}}class Hl extends at{radius;expandRaidus;startDegree;endDegree;text="";defaultShowText;tip="";p1=new Vt;p1Offset=10;p2=new Vt;p2Offset=40;p3=new Vt;p3Offset=10;p4=new Vt;p4Offset=10;direction=1;sectorArc;line12;line23;textShape;tipShape;constructor(t){super(t),this.radius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.text=t.text||"",this.defaultShowText=typeof t?.defaultShowText=="boolean"?t.defaultShowText:!!this.text,this.tip=t.tip||"",this.sectorArc=new aa({x:this.x,y:this.y,radius:this.radius,expandRaidus:this.expandRaidus,startDegree:this.startDegree,endDegree:this.endDegree,attrs:Object.assign({...this.getAttrs()},{strokeWidth:"0"})}),this.addShape(this.sectorArc);const e=Object.assign({...this.getAttrs()},{fill:"none"});this.line12=new ce({x:this.p1.x,y:this.p1.y,toX:this.p2.x,toY:this.p2.y,attrs:{...e},isShow:this.defaultShowText}),this.line23=new ce({x:this.p2.x,y:this.p2.y,toX:this.p3.x,toY:this.p3.y,attrs:{...e},isShow:this.defaultShowText}),this.textShape=new Ge({x:this.p4.x,y:this.p4.y,text:this.text,attrs:{stroke:e.stroke,textAnchor:this.direction==1?"start":"end"},isShow:this.defaultShowText}),this.text&&(this.addShape(this.line12),this.addShape(this.line23),this.addShape(this.textShape)),this.tipShape=new ra({x:0,y:0,text:this.tip,isShow:!1}),this.tip&&this.addShape(this.tipShape)}frameUpdate(t){this.text&&!this.defaultShowText&&(this.line12.isShow=this.sectorArc.isMouseIn,this.line23.isShow=this.sectorArc.isMouseIn,this.textShape.isShow=this.sectorArc.isMouseIn);const e=this.startDegree+(this.endDegree-this.startDegree)/2,{dx:s,dy:i}=It(N(e),this.sectorArc.radius+this.p1Offset);this.p1.x=this.x+s,this.p1.y=this.y+i;const{dx:r,dy:a}=It(N(e),this.sectorArc.radius+this.p1Offset+this.p2Offset);this.p2.x=this.x+r,this.p2.y=this.y+a,this.line12.x=this.p1.x,this.line12.y=this.p1.y,this.line12.toX=this.p2.x,this.line12.toY=this.p2.y,this.direction=this.p1.x>this.x?1:-1,this.p3.x=this.p2.x+this.direction*this.p3Offset,this.p3.y=this.p2.y,this.p4.x=this.p3.x+this.direction*this.p4Offset,this.p4.y=this.p3.y,this.line23.x=this.p2.x,this.line23.y=this.p2.y,this.line23.toX=this.p3.x,this.line23.toY=this.p3.y,this.textShape.x=this.p4.x,this.textShape.y=this.p4.y,this.textShape.setAttr("textAnchor",this.direction==1?"start":"end"),this.sectorArc.isMouseIn?(this.tipShape.isShow=!0,this.tipShape.x=t.x,this.tipShape.y=t.y):(this.tipShape.isShow=!1,this.tipShape.x=t.x,this.tipShape.y=t.y)}}class aa extends z{radius;realRadius;expandRaidus;startDegree;endDegree;vr;ar;bounce;durationTime;status;constructor(t){super(t),this.radius=0,this.realRadius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.vr=0,this.ar=.03,this.bounce=.6,this.durationTime=8.333333333333334,this.status=0}frameUpdate(){this.status==0&&this.radius<this.realRadius?(this.expand(this.realRadius),this.radius>=this.realRadius&&(this.status=1)):this.isMouseIn?this.expand(this.realRadius+this.expandRaidus):this.shrink(this.realRadius)}expand(t){this.vr+=this.ar,this.radius+=this.vr*this.durationTime,this.radius>t&&(this.radius=t,this.vr*=-this.bounce)}shrink(t){this.vr-=this.ar,this.radius+=this.vr*this.durationTime,this.radius<t&&(this.radius=t,this.vr*=-this.bounce)}toSVGPathData(){const{dx:t,dy:e}=It(N(this.startDegree),this.radius),{dx:s,dy:i}=It(N(this.endDegree),this.radius);return[["m",0,0],["l",t,e],["a",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,s-t,i-e],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.arc(0,0,this.radius,N(this.startDegree),N(this.endDegree),!1),t.closePath()}containPoint(t,e){const s=os(this.x,this.y,t,e),i=nt(Zt(this.x,this.y,t,e));return s<=this.radius&&i>=this.startDegree&&i<=this.endDegree}}class jl extends at{showFlame;ship;flame;constructor(t){super(t),this.showFlame=typeof t?.showFlame=="boolean"?t.showFlame:!1,this.ship=new z({...t,d:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]]}),this.addShape(this.ship),this.flame=new z({...t,isShow:this.showFlame,d:[["m",-10,-5],["l",-7.5,5],["l",7.5,5],["z"]]}),this.addShape(this.flame)}shapeInit(){Hs(()=>{this.ship.x=this.x,this.ship.y=this.y,this.flame.x=this.x,this.flame.y=this.y,this.flame.isShow=this.showFlame})}}class $l extends at{value;backgroundRect;occupyRect;handle;constructor(t){super(t);const e=t?.min||0,s=t?.max||100,i=t?.step||1,r=Ya(e,s,i);this.value=r(typeof t?.defaultValue=="number"?H(t.defaultValue,e,s):e);const a=this.value/(s-e),o=t?.barWidth||100,h=t?.barHeight||4,c=t?.handleRadius||10,l=h*.5,d=t?.barColor||yi.colorGrayF5,w=t?.handleColor||yi.colorPrimary;this.backgroundRect=new zt({x:this.x,y:this.y,width:o,height:h,borderRadius:l,attrs:{fill:d},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.backgroundRect),this.occupyRect=new zt({x:this.x,y:this.y,width:o*a,height:h,borderRadius:l,attrs:{fill:w},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.occupyRect),this.handle=new Vt({x:this.x+o*a,y:this.y+l,diffXInGroup:o*a,diffYInGroup:l,radius:c,alongPath:new Xo({x:this.x,y:this.y+l,d:[["m",0,0],["l",o,0]]}),attrs:{fill:w},enableDrag:!0,independentTransformInGroup:!0}),this.addShape(this.handle),this.handle.on("draging",b=>{this.occupyRect.width=H(this.occupyRect.width+b,0,o),this.value=r((this.handle.x-this.x)/o*(s-e)+e),this.emit("change",this.value)})}}class Wl extends at{width;height;cornerRadius;controlPoint;mainRect;rightPoint;constructor(t){super(t),this.width=t.width,this.height=t.height,this.cornerRadius=this.height/2,this.controlPoint=new Vt({...t,x:this.x,y:this.y,radius:2}),this.forceSetCXY(this.controlPoint.cX,this.controlPoint.cY),this.mainRect=new zt({...t,x:this.x-this.cornerRadius,y:this.y-this.cornerRadius,diffXInGroup:-this.cornerRadius,diffYInGroup:-this.cornerRadius,width:this.width+this.cornerRadius*2,height:this.height,borderRadius:this.cornerRadius}),this.rightPoint=new Vt({...t,x:this.x+this.width,y:this.y,diffXInGroup:this.width,radius:2}),this.addShape([this.mainRect,this.controlPoint,this.rightPoint])}getPin(){return{x:this.controlPoint.x+Math.cos(N(this.controlPoint.degree))*this.width,y:this.controlPoint.y+Math.sin(N(this.controlPoint.degree))*this.width}}}class Ui extends z{extendDegree;radius;startDegree;endDegree;diffDegree;constructor(t){super(t),this.extendDegree=t?.extendDegree||0,this.x=(t.x||0)+t.width/2;const e=Math.min(t.width/2,t.height)-t.lineWidth;this.radius=e-e*Math.abs(Math.sin(N(this.extendDegree))),this.y=(t.y||0)+t.height-t.lineWidth-this.radius*Math.abs(Math.sin(N(this.extendDegree))),this.diffDegree=t.endDegree-t.startDegree,this.startDegree=180+t.startDegree-this.extendDegree,this.endDegree=180+t.endDegree+this.extendDegree,this.setAttr({"stroke-linecap":"round","stroke-width":String(t.lineWidth),stroke:t.color||"none"})}setPercent(t){this.endDegree=this.startDegree+(this.diffDegree+this.extendDegree*2)*t}toSVGPathData(){const{dx:t,dy:e}=It(N(this.startDegree),this.radius),{dx:s,dy:i}=It(N(this.endDegree),this.radius);return[["m",t,e],["a",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,s-t,i-e]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,N(this.startDegree),N(this.endDegree),!1)}}class Jl extends at{percent=0;ringBg;ring;lines=[];bgColor;startColor;endColor;indicatorLineCount;constructor(t){super(t);const e=t?.startDegree||0,s=t?.endDegree||180,i=t?.extendDegree||15,r=t?.lineWidth||12;this.bgColor=t?.bgColor||"#B3C6E7",this.startColor=t?.startColor||"#5A82F0",this.endColor=t?.endColor||"#66B3FF",this.percent=t?.percent||0,this.indicatorLineCount=23;const a=20,o=2,h=17;this.ringBg=new Ui({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:i,lineWidth:r,color:this.bgColor}),this.addShape(this.ringBg),this.ring=new Ui({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:i,lineWidth:r}),this.addShape(this.ring);const c=this.ringBg.y-this.ringBg.radius+a;for(let l=0;l<this.indicatorLineCount;l++)this.lines.push(new ce({...t,centerX:this.ringBg.x,centerY:this.ringBg.y,x:this.ringBg.x,y:c,toX:this.ringBg.x,toY:c+h,degree:this.ringBg.startDegree+90+(s-e+i*2)/(this.indicatorLineCount-1)*l,attrs:{"stroke-linecap":"round","stroke-width":String(o),stroke:this.bgColor}}));this.addShape(this.lines)}setPercent(t){this.percent=t}shapeInit(){this.on("draging",(t,e,s)=>{this.shapes.forEach(i=>{i!=s&&(i.x+=t,i.y+=e)})})}frameUpdate(t,e){const s=this.ringBg.radius-this.ringBg.radius*Math.cos(Math.PI*this.percent),i=this.ringBg.radius*Math.sin(Math.PI*this.percent);if(e){const r=e.createLinearGradient(-this.ringBg.radius,0,-this.ringBg.radius+s,-i,{0:this.startColor,1:this.endColor});this.ring.setAttr({stroke:r})}else this.ring.setAttr({stroke:this.startColor});this.ring.setPercent(this.percent);for(let r=0;r<this.indicatorLineCount;r++){const a=r/(this.indicatorLineCount-1)<=this.percent;this.lines[r].setAttr({stroke:a&&e?e.createLinearGradient(0,0,this.lines[r].toX-this.lines[r].x,this.lines[r].toY-this.lines[r].y,{0:this.startColor,1:this.endColor}):a?this.startColor:this.bgColor})}}}class Zl extends z{x;y;z;brightness;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.brightness=this.setBrightness(t?.brightness||1)}setBrightness(t){return this.brightness=H(t,0,1),this.brightness}toSVGPathData(){return[]}}const Kl=Zl;class Ql extends z{points;light;constructor(t=[]){if(t.length<3)throw new Error("points length must >= 3");super(),this.points=t,this.light=new Kl({x:0,y:0,z:0,brightness:1})}toSVGPathData(){const t=[];t.push(["M",this.points[0].getScreenX(),this.points[0].getScreenY()]);for(let e=0,s=this.points.length;e<=s-1;e++)t.push(["L",this.points[e].getScreenX(),this.points[e].getScreenY()]);return t.push(["L",this.points[0].getScreenX(),this.points[0].getScreenY()]),t}toCanvasContext(t){t.beginPath(),t.moveTo(0,0);for(let e=0,s=this.points.length;e<=s-1;e++)t.lineTo(this.points[e].getScreenX()-this.points[0].getScreenX(),this.points[e].getScreenY()-this.points[0].getScreenY());t.lineTo(0,0)}get length(){return this.points.length}getDepth(){return Math.min(...this.points.map(t=>t.z))}isBackface(){const t=this.points[2].getScreenX()-this.points[0].getScreenX(),e=this.points[2].getScreenY()-this.points[0].getScreenY(),s=this.points[1].getScreenX()-this.points[2].getScreenX(),i=this.points[1].getScreenY()-this.points[2].getScreenY();return t*i>e*s}getLightFactor(){const t={x:this.points[0].x-this.points[1].x,y:this.points[0].y-this.points[1].y,z:this.points[0].z-this.points[1].z},e={x:this.points[1].x-this.points[2].x,y:this.points[1].y-this.points[2].y,z:this.points[1].z-this.points[2].z},s={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},i=s.x*this.light.x+s.y*this.light.y+s.z*this.light.z,r=Math.sqrt(s.x*s.x+s.y*s.y+s.z*s.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(i/(r*a))/Math.PI*this.light.brightness}getAdjustedColor(t){const e=Oe(t),s=this.getLightFactor();return e.r*=s,e.g*=s,e.b*=s,e.toString()}}class tu extends at{fettis=[];constructor(t,e,s){super();const{shape:i,x:r,y:a,particleCount:o,angle:h,spread:c,startVelocity:l,decay:d,gravity:w,drift:b,ticks:m,colors:P,scalar:_,flat:v}=Object.assign({shape:zt,x:.5,y:.6,particleCount:100,angle:90,spread:70,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,colors:ar,scalar:1,flat:!1},s||{}),x=N(h),y=N(c);let p=o;for(;p--;){const E=P[p%P.length],C=new i({x:t*r,y:e*a,width:10,height:10,scalar:_,attrs:{fill:E},independentTransformInGroup:!0});this.addShape(C),this.fettis.push({shape:C,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:l*.5+Math.random()*l,angle2D:-x+(.5*y-Math.random()*y),tiltAngle:(Math.random()*.5+.25)*Math.PI,tick:0,totalTicks:m,decay:d,drift:b,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:w*3,scalar:_,flat:v,color:Oe(E)})}}frameUpdate(t){this.fettis.length&&(this.fettis=this.fettis.filter(e=>{e.shape.x+=Math.cos(e.angle2D)*e.velocity+e.drift,e.shape.y+=Math.sin(e.angle2D)*e.velocity+e.gravity,e.velocity*=e.decay,e.flat?(e.wobble=0,e.wobbleX=e.shape.x+10*e.scalar,e.wobbleY=e.shape.y+10*e.scalar,e.tiltSin=0,e.tiltCos=0,e.random=1):(e.wobble+=e.wobbleSpeed,e.wobbleX=e.shape.x+10*e.scalar*Math.cos(e.wobble),e.wobbleY=e.shape.y+10*e.scalar*Math.sin(e.wobble),e.tiltAngle+=.1,e.tiltSin=Math.sin(e.tiltAngle),e.tiltCos=Math.cos(e.tiltAngle),e.random=Math.random()+2);const s=e.tick++/e.totalTicks,i=e.shape.x+e.random*e.tiltCos,r=e.shape.y+e.random*e.tiltSin,a=e.wobbleX+e.random*e.tiltCos,o=e.wobbleY+e.random*e.tiltSin;return e.shape.setAttr("fill",e.color.setAlpha(1-s).toString()),e.shape.degree=nt(Math.PI/10*e.wobble),e.shape.scalarX=Math.abs(a-i)*.1,e.shape.scalarY=Math.abs(o-r)*.1,e.tick<e.totalTicks}))}}class Gi{shapes;constructor(t){this.shapes=t}run(t){this.shapes.forEach(s=>{s.run(),t?.wall&&s.checkWall({wall:t.wall,bounce:t.bounce})});const e=this.shapes.length;for(let s=0,i=e-1;s<i;s++)for(let r=s+1;r<e;r++)this.shapes[s].checkCollision(this.shapes[r])}gravitate(){const t=this.shapes.length;this.shapes.forEach((e,s)=>{e.run();for(let i=s+1;i<t;i++)e.checkCollision(this.shapes[i]),e.gravitateTo(this.shapes[i])})}springChain(t){this.shapes.forEach((e,s)=>{s>0&&e.runSpringTo(this.shapes[s-1],t)})}springConnect(t){const e=Wt(t?.springLength,100);this.shapes.forEach(s=>{s.isDragging||this.shapes.filter(i=>i.id!==s.id).forEach(i=>{const r=Zt(s.x,s.y,i.x,i.y);s.runSpringTo({x:i.x-Math.cos(r)*e,y:i.y-Math.sin(r)*e},t)})})}springMass(t,e){const s=this.shapes.length,i=[];return this.shapes.forEach((r,a)=>{r.run(e),r.x>t.x+t.width?r.x=t.x:r.x<t.x&&(r.x=t.x+t.width),r.y>t.y+t.height?r.y=t.y:r.y<t.y&&(r.y=t.y+t.height);for(let o=a+1;o<s;o++)i.push([r.x,r.y,this.shapes[o].x,this.shapes[o].y,r.springMassTo(this.shapes[o],e)])}),i}polymorph(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");const t=this.shapes.length-1,e=new Array(t);for(let i=0;i<t;i++){const r=this.shapes[i].initPathD();this.shapes[i].frameStart();const a=this.shapes[i+1].initPathD();this.shapes[i+1].frameStart();const o=Math.max(r.polymorphPoints.length,a.polymorphPoints.length);e[i]=wt.getPathInterpolator(r.expendFill(o),a.expendFill(o))}const s=new z({d:e[0](0)});return i=>{const r=Mt(t*i,6),a=Math.min(Math.floor(r),t-1),o=Mt(r-a,6);s.originD=e[a](o);const h=this.shapes[a].getAttr("fill","none"),c=this.shapes[a+1].getAttr("fill","none");typeof h=="string"&&typeof c=="string"&&s.setAttr("fill",lt.gradient(h,c,o).toString());const l=this.shapes[a].getAttr("stroke","none"),d=this.shapes[a+1].getAttr("stroke","none");return typeof l=="string"&&typeof d=="string"&&s.setAttr("stroke",lt.gradient(l,d,o).toString()),s}}polymorphGroup(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");let t=0,e;const s=[];this.shapes.forEach(o=>{let h;o instanceof at?(h=o,h.sortPathD()):(h=new at,h.addShape(o)),s.push(h),t<h.shapes.length&&(t=h.shapes.length,e=h)}),s.forEach(o=>{o!==e&&o.expendFill(e)});const i=[];s.forEach((o,h)=>{o.shapes.forEach((c,l)=>{i[l]=i[l]||[],i[l][h]=c})});const r=[];i.forEach(o=>{r.push(new Gi(o).polymorph())});const a=new at;return r.forEach(o=>{a.addShape(o(0))}),o=>(r.forEach(h=>{h(o)}),a)}polymorphTween(t=6e3,e){const s=this.shapes.findIndex(o=>o instanceof at)>=0?this.polymorphGroup():this.polymorph(),i=s(0),r=e?.onUpdate,a=new gs({frameDuration:t});a.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(o,h)=>{s(o.t),r?.(o,h),e?.draw?.(i)}})),a.play()}static generatePointsShape(t,e,s,i){const r=[];for(let a=0;a<i;a++){const o=a/i*2*Math.PI,{dx:h,dy:c}=It(o,s);r.push({x:t+h,y:e+c})}return new ia({points:r})}static generateRosettaShape(t,e,s,i,r){if(r==0)throw new Error("no dividing by zero, please");const a=[],o=360/r;for(let h=0;h<r;h+=1){const c=o*h*Math.PI/180,l=t+2*s*Math.cos(c),d=e+2*s*Math.sin(c);a.push(new si({x:t,y:e,rx:s,ry:i,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:l,toY:d})),a.push(new si({x:l,y:d,rx:s,ry:i,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:t,toY:e}))}return new z({d:wt.fromLines(a)})}}const oa={map:new Map,transform:function(n){if(Fn)return n;if(this.map.has(n))return this.map.get(n);const t=new OffscreenCanvas(n.width,n.height);return t.getContext("2d")?.drawImage(n,0,0),this.map.set(n,t),t},clear:function(){this.map.clear()}};function eu(n,t,e){const s=new OffscreenCanvas(n,t),i=s.getContext("2d");if(i)return e(i),s.transferToImageBitmap()}function su(n,t,e){const s=n.createPattern(oa.transform(t),"no-repeat");if(s){const i=pi(e);s.setTransform(i),n.fillStyle=s}}class iu{app;ctx;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e=!1){if(this.app=t,!(this.app.container instanceof HTMLCanvasElement))throw new Error("app.container 应该为 HTMLCanvasElement!");this.ctx=new us(this.app.container,this.app.width,this.app.height,e),this.app.captureDrag({start:()=>{this.isMouseDown=!0,this.dragDx=0,this.dragDy=0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.dragDx=0,this.dragDy=0,this.setCursor()},move:(s,i)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=i.dx,this.dragDy+=i.dy),this.setCursor()}}),this.app.on("tap",()=>{for(let s of this.shapes)if(this.currentMouseInShape==s){s.emit("clicked");let i=s.parent;for(;i;)i.emit("clicked",s),i=i.parent;break}})}setCursor(){this.currentEnableDragMouseInShape?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShape?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}transformCtxBaseOnShape(t){t.usePathDtoCanvasContext||(this.ctx.translate(t.x,t.y),this.ctx.rotate(N(t.degree),t.cX,t.cY),this.ctx.scale(t.scalarX,t.scalarY,t.cX,t.cY))}_addDrawShape(t){this.shapes.push(t),t instanceof at&&t.shapes.forEach(e=>{this._addDrawShape(e)})}draw(t=[]){this.shapes=[],(Array.isArray(t)?t:[t]).forEach(e=>{this._addDrawShape(e)}),this.isMouseDown&&this.currentEnableDragMouseInShape||(this.currentMouseInShape=void 0);for(let e of this.shapes){if(!e.isShow)continue;if(this.ctx.save(),e.frameStart(this.app.mousePoint),L.attrsToCanvas(this.ctx,e.getAttrs()),e.followMouse&&(!Qe(e.x,this.app.mousePoint.x,5)||!Qe(e.y,this.app.mousePoint.y,5))&&e.followTo(this.app.mousePoint),e.targetToAfterDragFree&&(this.isMouseDown||e.runEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShape==e){e.isDragging=!0;const i=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,i||r){if(e.x+=i,e.y+=r,e.alongPath){const a=e.alongPath.closestPoint(e.x,e.y);e.x=a.point.x-e.cX,e.y=a.point.y-e.cY}e.emit("draging",i,r)}}else e.isDragging=!1;e.frameUpdate(this.app.mousePoint,this.ctx),this.transformCtxBaseOnShape(e),e.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill();const s=this.ctx.currentPath2D;if(!this.currentMouseInShape){const i=this.ctx.isPointInPath(s,this.app.mousePoint.x,this.app.mousePoint.y)||this.ctx.isPointInStroke(s,this.app.mousePoint.x,this.app.mousePoint.y)||!1;e.isMouseIn=i,i&&(this.currentMouseInShape=e,e.enableDrag&&(this.currentEnableDragMouseInShape=e))}e.frameEnd(this.app.mousePoint),this.ctx.restore()}this.currentMouseInShape||(this.currentEnableDragMouseInShape=void 0)}drawMouseMoveLine(t="line",e){switch(t){case"brush":const s=e?.brushSize??10,i=e?.brushDensity??50,r=e?.brushColor??"#000000",a=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),o=a.data,h=Oe(r);return this.app.captureDrag({move:()=>{if(this.isMouseDown){for(let c=0;c<i;c++){const l=Math.random()*Math.PI*2,d=Math.random()*s,w=this.app.mousePoint.x+Math.cos(l)*d|0,b=this.app.mousePoint.y+Math.sin(l)*d|0,m=(w+b*a.width)*4;o[m]=h.r,o[m+1]=h.g,o[m+2]=h.b,o[m+3]=255}this.ctx.putImageData(a)}}});case"line":default:return this.app.captureDrag({start:c=>{this.ctx.beginPath(),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 nu{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new Re(t),this.remoteVideoUtil=new Re(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(s=>{this.localVideoUtil.setSrcObject(s),t(s)}).catch(s=>{this.trace(`navigator.getUserMedia error: ${s}.`),e(s)})})}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(),s=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),s.length>0&&this.trace(`Using audio device: ${s[0].label}.`);const i=void 0,r=new RTCPeerConnection(i);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(i);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(s[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,s=t.candidate;if(e&&s){const i=new RTCIceCandidate(s),r=this.getOtherPeer(e);r&&(r.addIceCandidate(i).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
|
|
42
42
|
${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:
|
|
43
43
|
${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:
|
|
44
44
|
${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:
|
|
45
|
-
${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 s=this.getPeerName(t);this.trace(`${s} ${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 s=document.createElement("div");s.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(s)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class Ql{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 ra(n,t){return!n||n.parentElement===null?t:ra(n.parentElement,t.concat([n]))}const Vi=function(n,t){return getComputedStyle(n,null).getPropertyValue(t)},tu=function(n){return Vi(n,"overflow")+Vi(n,"overflow-y")+Vi(n,"overflow-x")},eu=function(n){return/(auto|scroll)/.test(tu(n))};function su(n){if(!(n instanceof HTMLElement||n instanceof SVGElement))return;const t=ra(n.parentElement,[]);for(let e=0;e<t.length;e+=1)if(eu(t[e]))return t[e];return document.scrollingElement||document.documentElement}const aa=[],oa={};function zi(n){aa.push(n)}function iu(n,t=!1){const e=rr();if(oa[e])return;wx.error(r=>{console.log(r.errMsg??JSON.stringify(r))}),wx.ready(()=>{aa.forEach(r=>r())});const s=["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"],i=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(n,{debug:t,jsApiList:s,openTagList:i})),oa[e]=!0}function nu(n){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[n],success:function(s){s.checkResult[n]?t(!0):e(!1)},fail:function(){e(!1)}})})}function ru(n){zi(function(){wx.updateAppMessageShareData(n)})}function au(n){zi(function(){wx.updateTimelineShareData(n)})}function ou(n){wx.chooseImage(n)}function hu(n){wx.previewImage(n)}function cu(n){wx.uploadImage(n)}function lu(n){wx.downloadImage(n)}function uu(n){wx.getLocalImgData(n)}function du(){wx.startRecord()}function fu(n){wx.stopRecord(n)}function mu(n){wx.onVoiceRecordEnd(n)}function pu(n){wx.playVoice(n)}function gu(n){wx.pauseVoice(n)}function yu(n){wx.stopVoice(n)}function wu(n){wx.onVoicePlayEnd(n)}function xu(n){wx.uploadVoice(n)}function bu(n){wx.downloadVoice(n)}function vu(n){wx.translateVoice(n)}function Su(n){wx.getNetworkType(n)}function Cu(n){wx.openLocation(n)}function Eu(n){wx.getLocation(n)}function Tu(n){wx.scanQRCode(n)}function Pu(n,t,e){function s(){WeixinJSBridge.invoke("getBrandWCPayRequest",n,function(i){i.err_msg=="get_brand_wcpay_request:ok"?t():e(i.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",s,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",s),document.attachEvent("onWeixinJSBridgeReady",s)):s()}function _u(n){window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)}function Ue(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 Du(n,t,e){ap.tradePay(Object.assign(n,{}),function(s){let i="未知错误";switch(s.resultCode){case 9e3:return i="订单支付成功",t?.(i);case 8e3:i="正在处理中";break;case 4e3:i="订单支付失败";break;case 6001:i="用户中途取消";break;case 6002:i="网络连接出错";break;case 99:i="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(i)})}function Au(n,t,e){ap.scan(Object.assign(n,{fail:s=>{e?.(Ue(s))}}),function(s){t?.(s.code)})}function Iu(n,t,e){ap.getLocation(Object.assign(n,{fail:s=>{e?.(Ue(s))}}),function(s){t?.(s)})}function ku(n,t,e){ap.openLocation(Object.assign(n,{fail:s=>{e?.(Ue(s))}}),function(){t?.()})}function Mu(n,t,e){ap.chooseImage(Object.assign(n,{fail:s=>{e?.(Ue(s,"chooseImage"))}}),function(s){t?.(s)})}function Lu(n,t,e){ap.previewImage(Object.assign(n,{fail:s=>{e?.(Ue(s))}}),function(){t?.()})}class Ru{map;constructor(t,e=120.619585,s=31.299379,i=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,s),i)}}class Ou{currentPage;itemsPerPage;entriesInterval;entriesEdge;linkTo;prevText;nextText;ellipseText;prevShowAlways;nextShowAlways;callback;totalPages;parentVNode;constructor(t,e,s){this.currentPage=s?.currentPage||0,this.itemsPerPage=s?.itemsPerPage||10,this.entriesInterval=s?.entriesInterval||5,this.entriesEdge=s?.entriesEdge||1,this.linkTo=s?.linkTo||"javascript:;",this.prevText=s?.prevText||"上一页",this.nextText=s?.nextText||"下一页",this.ellipseText=s?.ellipseText||"...",this.prevShowAlways=typeof s?.prevShowAlways=="boolean"?s?.prevShowAlways:!0,this.nextShowAlways=typeof s?.nextShowAlways=="boolean"?s?.nextShowAlways:!0,this.callback=s?.callback||(i=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),pe(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return Jt("div",{class:"pagination"},[])}appendVNode(t,e,s){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const i=s?.text||String(e+1),r=s?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?Jt("span",{class:`current ${r}`},i):Jt("a",{class:r,href:this.linkTo.replace(/__id__/,String(e)),onClick:a=>this.selectPage(e,a)},i))}drawLinks(){const t=this.createParentVNode(),e=Math.ceil(this.entriesInterval/2),s=this.currentPage>e?Math.max(Math.min(this.currentPage-e,this.totalPages-this.entriesInterval),0):0,i=this.currentPage>e?Math.min(this.currentPage+e,this.totalPages):Math.min(this.entriesInterval,this.totalPages);if(this.prevText&&(this.currentPage>0||this.prevShowAlways)&&this.appendVNode(t,this.currentPage-1,{text:this.prevText,classes:"prev"}),s>0&&this.entriesEdge>0){const r=Math.min(this.entriesEdge,s);for(let a=0;a<r;a++)this.appendVNode(t,a);this.entriesEdge<s&&this.ellipseText&&t.children.push(Jt("span",{},this.ellipseText))}for(let r=s;r<i;r++)this.appendVNode(t,r);if(i<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>i&&this.ellipseText&&t.children.push(Jt("span",{},this.ellipseText));const r=Math.max(this.totalPages-this.entriesEdge,i);for(let a=r;a<this.totalPages;a++)this.appendVNode(t,a)}this.nextText&&(this.currentPage<this.totalPages-1||this.nextShowAlways)&&this.appendVNode(t,this.currentPage+1,{text:this.nextText,classes:"next"}),ss(this.parentVNode,t),this.parentVNode=t}selectPage(t,e){this.currentPage=t=t<0?0:t<this.totalPages?t:this.totalPages-1,this.drawLinks();const s=this.callback(t);return e&&(s||(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)),s}prevPage(){return this.selectPage(this.currentPage-1)}nextPage(){return this.selectPage(this.currentPage+1)}}const ie={enabled:!1,files:{},add:function(n,t){this.enabled!==!1&&(this.files[n]=t)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class Fu{isLoading=!1;itemsLoaded=0;itemsTotal=0;urlModifier;handlers=[];_onStart;_onLoad;_onProgress;_onError;constructor(t){this._onStart=t?.onStart,this._onLoad=t?.onLoad,this._onProgress=t?.onProgress,this._onError=t?.onError}itemStart(t){this.itemsTotal++,this.isLoading===!1&&this._onStart?.(t,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(t){this.itemsLoaded++,this._onProgress?.(t,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this._onLoad?.())}itemError(t){this._onError?.(t)}resolveURL(t){return this.urlModifier?this.urlModifier(t):t}setURLModifier(t){return this.urlModifier=t,this}addHandler(t,e){return this.handlers.push(t,e),this}removeHandler(t){const e=this.handlers.indexOf(t);return e!==-1&&this.handlers.splice(e,2),this}getHandler(t){for(let e=0,s=this.handlers.length;e<s;e+=2){const i=this.handlers[e],r=this.handlers[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return r}return null}}const Nu=new Fu;class Yu{static DEFAULT_MATERIAL_NAME="__DEFAULT";manager;crossOrigin;withCredentials;path;resourcePath;requestHeader;constructor(t){this.manager=t!==void 0?t:Nu,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(t,e){}loadAsync(t,e){return new Promise((s,i)=>{this.load(t,{onLoad:s,onProgress:e,onError:i})})}parse(t){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const Is=Yu;class Bu extends Is{constructor(t){super(t)}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=ie.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s;const i=A.createElementNS("img"),r=()=>{o(),ie.add(t,i),e?.onLoad?.(i),this.manager.itemEnd(t)},a=h=>{o(),e?.onError?.(h),this.manager.itemError(t),this.manager.itemEnd(t)};function o(){i.removeEventListener("load",r,!1),i.removeEventListener("error",a,!1)}return i.addEventListener("load",r,!1),i.addEventListener("error",a,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(i.crossOrigin=this.crossOrigin),this.manager.itemStart(t),i.src=t,i}}class Xu extends Is{isImageBitmapLoader=!0;options;constructor(t){super(t),typeof createImageBitmap>"u"&&console.warn("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=ie.get(t);if(s!==void 0){if(this.manager.itemStart(t),s.then){s.then(r=>{e?.onLoad?.(r),this.manager.itemEnd(t)}).catch(r=>{e?.onError?.(r)});return}return setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s}const i=fetch(t,{credentials:this.crossOrigin==="anonymous"?"same-origin":"include",headers:this.requestHeader}).then(r=>r.blob()).then(r=>createImageBitmap(r,Object.assign(this.options,{colorSpaceConversion:"none"}))).then(r=>(ie.add(t,r),e?.onLoad?.(r),this.manager.itemEnd(t),r)).catch(r=>{e?.onError?.(r),ie.remove(t),this.manager.itemError(t),this.manager.itemEnd(t)});ie.add(t,i),this.manager.itemStart(t)}}const qt={};class Gu extends Error{response;constructor(t,e){super(t),this.response=e}}class ha extends Is{mimeType;responseType="";constructor(t){super(t),typeof fetch>"u"&&console.warn("FileLoader: fetch() not supported.")}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=ie.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s;if(qt[t]!==void 0){qt[t].push({onLoad:e?.onLoad,onProgress:e?.onProgress,onError:e?.onError});return}qt[t]=[],qt[t].push({onLoad:e?.onLoad,onProgress:e?.onProgress,onError:e?.onError});const i=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),r=this.mimeType,a=this.responseType;fetch(i).then(o=>{if(o.status===200||o.status===0){if(o.status===0&&console.warn("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||o.body===void 0||o.body?.getReader===void 0)return o;const h=qt[t],c=o.body.getReader(),l=o.headers.get("X-File-Size")||o.headers.get("Content-Length"),d=l?parseInt(l):0,g=d!==0;let y=0;const m=new ReadableStream({start(x){b();function b(){c.read().then(({done:S,value:C})=>{if(S)x.close();else{y+=C.byteLength;const L=new ProgressEvent("progress",{lengthComputable:g,loaded:y,total:d});for(let R=0,X=h.length;R<X;R++)h[R].onProgress?.(L);x.enqueue(C),b()}},S=>{x.error(S)})}}});return new Response(m)}else throw new Gu(`fetch for "${o.url}" responded with ${o.status}: ${o.statusText}`,o)}).then(o=>{switch(a){case"arraybuffer":return o.arrayBuffer();case"blob":return o.blob();case"document":return o.text().then(h=>new DOMParser().parseFromString(h,r));case"json":return o.json();default:if(r===void 0)return o.text();{const c=/charset="?([^;"\s]*)"?/i.exec(r),l=c&&c[1]?c[1].toLowerCase():void 0,d=new TextDecoder(l);return o.arrayBuffer().then(g=>d.decode(g))}}}).then(o=>{ie.add(t,o);const h=qt[t];delete qt[t];for(let c=0,l=h.length;c<l;c++)h[c].onLoad?.(o)}).catch(o=>{const h=qt[t];if(h===void 0)throw this.manager.itemError(t),o;delete qt[t];for(let c=0,l=h.length;c<l;c++)h[c].onError?.(o);this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class Uu extends Is{constructor(t){super(t)}load(t,e){const s=new ha(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,{onLoad:i=>{try{const r=i.slice(0);new AudioContext().decodeAudioData(r,o=>{e?.onLoad?.(o)}).catch(o=>{e?.onError?.(o),this.manager.itemError(t)})}catch(r){e?.onError?.(r),this.manager.itemError(t)}},onProgress:e?.onProgress,onError:e?.onError})}}return p.Arrow=Ml,p.AudioLoader=Uu,p.BezierEasing=li,p.CSSToJSEasing=Wo,p.Clock=fi,p.Color=lt,p.CommonKeyCode=ch,p.Confetti=Wl,p.ControlsColorPattern=he,p.Cross=Yl,p.CustomCanvasContext=Pe,p.CustomCanvasGradient=cs,p.CustomCanvasPattern=ei,p.DOMEventBus=tr,p.DOMKey=Qn,p.DOMParse=er,p.DOMSVGUtil=ae,p.DOMToBlob=bn,p.DOMToString=Js,p.DOMUtil=A,p.DOMVideo=Le,p.Easing=I,p.Ellipse=ea,p.FetchWithAxios=Xc,p.FetchWithAxiosRequestCancel=Vr,p.FileLoader=ha,p.Fox=Ll,p.Heart=Rl,p.HeartVariant=Ol,p.ImageBitmapLoader=Xu,p.ImageLoader=Bu,p.Interpolation=Xt,p.Line=ce,p.LinePicture=kl,p.LineQuadraticBezier=Al,p.Matrix=ct,p.Matrix3D=pt,p.NormalColors=ir,p.Pagination=Ou,p.Point=Vt,p.Point3D=Me,p.Point3Ds=jl,p.Points=ta,p.QRCode=se,p.Rabbit=Nl,p.Rect=zt,p.Ring=Gi,p.RingIndicator=zl,p.SVGParse=Qr,p.SVGParsedPathArgsLength=Ae,p.Sector=Xl,p.SectorArc=ia,p.Segment=Vl,p.Shape=U,p.ShapeCombo=Ui,p.ShapeGroup=rt,p.Ship=Gl,p.Slider=Ul,p.Star=Fl,p.TWEEN=sh,p.Text=Ge,p.Timeline=ps,p.Tip=sa,p.Tree=Bl,p.Tween=di,p.WebGLRenderer=Ql,p.WebRTCClient=Kl,p.WebSocketClient=$a,p.YZCanvas=Zl,p.YZCanvasContext=ls,p.YZMessageChannel=Eh,p.YZSVG=Il,p.YZWorker=Ch,p.addWatermark=Cl,p.addWxJsReadyFnBeforeConfig=zi,p.ajax=Th,p.aliJsChooseImage=Mu,p.aliJsGetLocation=Iu,p.aliJsOpenLocation=ku,p.aliJsPreviewImage=Lu,p.aliJsReady=_u,p.aliJsScan=Au,p.aliJsTradePay=Du,p.angle=Zt,p.appendURL=xi,p.appendURLRecord=Sh,p.base64EncodeOutputStream=jr,p.bitmapMapper=na,p.blobToRawImage=$c,p.byteArrayOutputStream=Ni,p.canDrawBitmap=Ln,p.canUsePaths=bo,p.canUseWorker=Mn,p.changeBrightness=vl,p.changeDiaphaneity=Sl,p.changeSize=bl,p.checkWxJsApi=nu,p.clearCookies=wh,p.color=Re,p.computeImageDisplayRect=Gc,p.createXMLHttpRequest=hr,p.distance=as,p.distance2=os,p.drawBitmapInCanvas=Jl,p.drawQRCodeToCanvas=Dl,p.easeNameToCubicBezier=ui,p.fileOrBlobToDataURL=Oi,p.flipSideToSide=Zc,p.flipUpsideDown=Kc,p.flushURL=or,p.flushURLRecord=vh,p.formDataToString=ar,p.fpsTask=Oo,p.getBitmapFromCanvas=$l,p.getBodyPosition=Za,p.getBrowserClient=Ks,p.getBrowserClientVersion=ro,p.getBrowserLanguage=oo,p.getColorScheme=sr,p.getCookie=gh,p.getCookieObject=yh,p.getDOMMatrix=pi,p.getDirection=To,p.getDocumentElementPosition=Ee,p.getElementPositionInPage=En,p.getElementPositionInPage2=to,p.getElementPositionInViewport=Tn,p.getFileExtension=Sn,p.getFileTypeFromFile=Wa,p.getFilesImageInfo=Vc,p.getFormSubmitData=Ph,p.getImageAspectRatio=Uc,p.getImageDataByAIData=Tl,p.getImageDataFromBitmap=qc,p.getImageDataFromUrl=zr,p.getImageDataFromVideo=zc,p.getImageMainColor=Jc,p.getInternetExplorerVersion=Dn,p.getMousePositionInElement=Tt,p.getMousePositionInPage=Pn,p.getMousePositionInViewport=io,p.getOperatingSystem=is,p.getOperatingSystemVersion=no,p.getPageSize=Qa,p.getRawImageInfo=As,p.getRelativeBoundingClientRect=eo,p.getScreenPosition=Ja,p.getScrollParent=su,p.getTimeZone=ho,p.getURL=ys,p.getUserGeolocationPromise=ao,p.getVerticalScrollPercentInPage=so,p.getViewportSize=Ka,p.gifImage=Wr,p.h=Jt,p.hasDocument=yo,p.hasHistory=wo,p.hasWindow=kn,p.imageDataToBitmap=Hc,p.imageDataToBlob=Wc,p.imageDataToDataURL=jc,p.injectWxJsConfig=iu,p.isAliBrowser=In,p.isAliMiniProgram=go,p.isAndroid=_n,p.isAppleDevice=co,p.isBrowserSupportFileAPI=xo,p.isDarkMode=uo,p.isElement=vo,p.isIE=fo,p.isIE9or10=mo,p.isIOS=Qs,p.isMacOS=ti,p.isMobile=lo,p.isNative=ns,p.isURL=xh,p.isWxBrowser=An,p.isWxMiniProgram=po,p.jpgToPng=gl,p.leftRotate=Qc,p.length=rs,p.linkExport=Zs,p.localstorage=gi,p.mapTDTJSSDK=Ru,p.marginSharpen=pl,p.microTask=Bo,p.mosaic=El,p.mount=pe,p.multiplyArrayOfMatrix=nh,p.multiplyArrayOfMatrix3D=rh,p.multiplyMatrix=Jn,p.multiplyMatrix3D=Zn,p.nextTick=Yo,p.normalizePoint=Eo,p.objectSignature=Ur,p.onDocumentReady=mh,p.outputGifBase64=$r,p.outputQRCodeBase64=_l,p.parseTransformToMatrix=mi,p.parseURL=nr,p.patch=ss,p.patchDOM=Cn,p.pngToJpg=yl,p.polar=It,p.prefixes=So,p.radiusClip=xl,p.readFileInBrowser=es,p.recordToString=ws,p.rectClip=wl,p.requestAnimationFrameCycle=ni,p.reverseCSSToJSEasing=$o,p.reverseEaseNameToCubicBezier=Hn,p.reverseEasing=Gn,p.rightRotate=tl,p.rotatePoint=Pt,p.scheduleIdle=Yn,p.scheduleYZIdle=hi,p.selectFileInBrowser=vn,p.setColorScheme=gs,p.setCookie=ph,p.setIntervalAccurate=Ro,p.setRem=Co,p.setTimeoutAccurate=ri,p.sharpen=ml,p.signature=Gr,p.singletonDOMEventBus=nt,p.stringToBlob=$s,p.stringToDOM=ja,p.stringToRecord=bh,p.theme=yi,p.toBlackAndWhite=il,p.toBlue=ol,p.toBlueAndGreen=ll,p.toBlueAndGrey=fl,p.toDegree=it,p.toGreen=al,p.toGreenAndGrey=dl,p.toGrey=el,p.toGrey2=sl,p.toOpposite=nl,p.toRadian=O,p.toRed=rl,p.toRedAndBlue=cl,p.toRedAndGreen=hl,p.toRedAndGrey=ul,p.transformPath2D=ih,p.trimURLHash=rr,p.wxJsChooseImage=ou,p.wxJsDownloadImage=lu,p.wxJsDownloadVoice=bu,p.wxJsGetLocalImgData=uu,p.wxJsGetLocation=Eu,p.wxJsGetNetworkType=Su,p.wxJsOnVoicePlayEnd=wu,p.wxJsOnVoiceRecordEnd=mu,p.wxJsOpenLocation=Cu,p.wxJsPauseVoice=gu,p.wxJsPay=Pu,p.wxJsPlayVoice=pu,p.wxJsPreviewImage=hu,p.wxJsScanQRCode=Tu,p.wxJsStartRecord=du,p.wxJsStopRecord=fu,p.wxJsStopVoice=yu,p.wxJsTranslateVoice=vu,p.wxJsUpdateAppMessageShareData=ru,p.wxJsUpdateTimelineShareData=au,p.wxJsUploadImage=cu,p.wxJsUploadVoice=xu,p.yzCancelIdleCallback=No,p.yzRequestIdleCallback=Xn,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),p}({});
|
|
45
|
+
${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 s=this.getPeerName(t);this.trace(`${s} ${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 s=document.createElement("div");s.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(s)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class ru{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 ha(n,t){return!n||n.parentElement===null?t:ha(n.parentElement,t.concat([n]))}const Vi=function(n,t){return getComputedStyle(n,null).getPropertyValue(t)},au=function(n){return Vi(n,"overflow")+Vi(n,"overflow-y")+Vi(n,"overflow-x")},ou=function(n){return/(auto|scroll)/.test(au(n))};function hu(n){if(!(n instanceof HTMLElement||n instanceof SVGElement))return;const t=ha(n.parentElement,[]);for(let e=0;e<t.length;e+=1)if(ou(t[e]))return t[e];return document.scrollingElement||document.documentElement}const ca=[],la={};function zi(n){ca.push(n)}function cu(n,t=!1){const e=hr();if(la[e])return;wx.error(r=>{console.log(r.errMsg??JSON.stringify(r))}),wx.ready(()=>{ca.forEach(r=>r())});const s=["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"],i=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(n,{debug:t,jsApiList:s,openTagList:i})),la[e]=!0}function lu(n){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[n],success:function(s){s.checkResult[n]?t(!0):e(!1)},fail:function(){e(!1)}})})}function uu(n){zi(function(){wx.updateAppMessageShareData(n)})}function du(n){zi(function(){wx.updateTimelineShareData(n)})}function fu(n){wx.chooseImage(n)}function mu(n){wx.previewImage(n)}function pu(n){wx.uploadImage(n)}function gu(n){wx.downloadImage(n)}function yu(n){wx.getLocalImgData(n)}function wu(){wx.startRecord()}function xu(n){wx.stopRecord(n)}function bu(n){wx.onVoiceRecordEnd(n)}function vu(n){wx.playVoice(n)}function Su(n){wx.pauseVoice(n)}function Cu(n){wx.stopVoice(n)}function Eu(n){wx.onVoicePlayEnd(n)}function Tu(n){wx.uploadVoice(n)}function Pu(n){wx.downloadVoice(n)}function _u(n){wx.translateVoice(n)}function Au(n){wx.getNetworkType(n)}function Du(n){wx.openLocation(n)}function Mu(n){wx.getLocation(n)}function Iu(n){wx.scanQRCode(n)}function ku(n,t,e){function s(){WeixinJSBridge.invoke("getBrandWCPayRequest",n,function(i){i.err_msg=="get_brand_wcpay_request:ok"?t():e(i.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",s,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",s),document.attachEvent("onWeixinJSBridgeReady",s)):s()}function Lu(n){window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)}function Ve(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 Ru(n,t,e){ap.tradePay(Object.assign(n,{}),function(s){let i="未知错误";switch(s.resultCode){case 9e3:return i="订单支付成功",t?.(i);case 8e3:i="正在处理中";break;case 4e3:i="订单支付失败";break;case 6001:i="用户中途取消";break;case 6002:i="网络连接出错";break;case 99:i="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(i)})}function Ou(n,t,e){ap.scan(Object.assign(n,{fail:s=>{e?.(Ve(s))}}),function(s){t?.(s.code)})}function Fu(n,t,e){ap.getLocation(Object.assign(n,{fail:s=>{e?.(Ve(s))}}),function(s){t?.(s)})}function Nu(n,t,e){ap.openLocation(Object.assign(n,{fail:s=>{e?.(Ve(s))}}),function(){t?.()})}function Bu(n,t,e){ap.chooseImage(Object.assign(n,{fail:s=>{e?.(Ve(s,"chooseImage"))}}),function(s){t?.(s)})}function Yu(n,t,e){ap.previewImage(Object.assign(n,{fail:s=>{e?.(Ve(s))}}),function(){t?.()})}class Xu{map;constructor(t,e=120.619585,s=31.299379,i=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,s),i)}}class Uu{currentPage;itemsPerPage;entriesInterval;entriesEdge;linkTo;prevText;nextText;ellipseText;prevShowAlways;nextShowAlways;callback;totalPages;parentVNode;constructor(t,e,s){this.currentPage=s?.currentPage||0,this.itemsPerPage=s?.itemsPerPage||10,this.entriesInterval=s?.entriesInterval||5,this.entriesEdge=s?.entriesEdge||1,this.linkTo=s?.linkTo||"javascript:;",this.prevText=s?.prevText||"上一页",this.nextText=s?.nextText||"下一页",this.ellipseText=s?.ellipseText||"...",this.prevShowAlways=typeof s?.prevShowAlways=="boolean"?s?.prevShowAlways:!0,this.nextShowAlways=typeof s?.nextShowAlways=="boolean"?s?.nextShowAlways:!0,this.callback=s?.callback||(i=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),pe(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return Jt("div",{class:"pagination"},[])}appendVNode(t,e,s){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const i=s?.text||String(e+1),r=s?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?Jt("span",{class:`current ${r}`},i):Jt("a",{class:r,href:this.linkTo.replace(/__id__/,String(e)),onClick:a=>this.selectPage(e,a)},i))}drawLinks(){const t=this.createParentVNode(),e=Math.ceil(this.entriesInterval/2),s=this.currentPage>e?Math.max(Math.min(this.currentPage-e,this.totalPages-this.entriesInterval),0):0,i=this.currentPage>e?Math.min(this.currentPage+e,this.totalPages):Math.min(this.entriesInterval,this.totalPages);if(this.prevText&&(this.currentPage>0||this.prevShowAlways)&&this.appendVNode(t,this.currentPage-1,{text:this.prevText,classes:"prev"}),s>0&&this.entriesEdge>0){const r=Math.min(this.entriesEdge,s);for(let a=0;a<r;a++)this.appendVNode(t,a);this.entriesEdge<s&&this.ellipseText&&t.children.push(Jt("span",{},this.ellipseText))}for(let r=s;r<i;r++)this.appendVNode(t,r);if(i<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>i&&this.ellipseText&&t.children.push(Jt("span",{},this.ellipseText));const r=Math.max(this.totalPages-this.entriesEdge,i);for(let a=r;a<this.totalPages;a++)this.appendVNode(t,a)}this.nextText&&(this.currentPage<this.totalPages-1||this.nextShowAlways)&&this.appendVNode(t,this.currentPage+1,{text:this.nextText,classes:"next"}),is(this.parentVNode,t),this.parentVNode=t}selectPage(t,e){this.currentPage=t=t<0?0:t<this.totalPages?t:this.totalPages-1,this.drawLinks();const s=this.callback(t);return e&&(s||(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)),s}prevPage(){return this.selectPage(this.currentPage-1)}nextPage(){return this.selectPage(this.currentPage+1)}}const ie={enabled:!1,files:{},add:function(n,t){this.enabled!==!1&&(this.files[n]=t)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class Gu{isLoading=!1;itemsLoaded=0;itemsTotal=0;urlModifier;handlers=[];_onStart;_onLoad;_onProgress;_onError;constructor(t){this._onStart=t?.onStart,this._onLoad=t?.onLoad,this._onProgress=t?.onProgress,this._onError=t?.onError}itemStart(t){this.itemsTotal++,this.isLoading===!1&&this._onStart?.(t,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(t){this.itemsLoaded++,this._onProgress?.(t,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this._onLoad?.())}itemError(t){this._onError?.(t)}resolveURL(t){return this.urlModifier?this.urlModifier(t):t}setURLModifier(t){return this.urlModifier=t,this}addHandler(t,e){return this.handlers.push(t,e),this}removeHandler(t){const e=this.handlers.indexOf(t);return e!==-1&&this.handlers.splice(e,2),this}getHandler(t){for(let e=0,s=this.handlers.length;e<s;e+=2){const i=this.handlers[e],r=this.handlers[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return r}return null}}const Vu=new Gu;class zu{static DEFAULT_MATERIAL_NAME="__DEFAULT";manager;crossOrigin;withCredentials;path;resourcePath;requestHeader;constructor(t){this.manager=t!==void 0?t:Vu,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(t,e){}loadAsync(t,e){return new Promise((s,i)=>{this.load(t,{onLoad:s,onProgress:e,onError:i})})}parse(t){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const Is=zu;class qu extends Is{constructor(t){super(t)}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=ie.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s;const i=L.createElementNS("img"),r=()=>{o(),ie.add(t,i),e?.onLoad?.(i),this.manager.itemEnd(t)},a=h=>{o(),e?.onError?.(h),this.manager.itemError(t),this.manager.itemEnd(t)};function o(){i.removeEventListener("load",r,!1),i.removeEventListener("error",a,!1)}return i.addEventListener("load",r,!1),i.addEventListener("error",a,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(i.crossOrigin=this.crossOrigin),this.manager.itemStart(t),i.src=t,i}}class Hu extends Is{isImageBitmapLoader=!0;options;constructor(t){super(t),typeof createImageBitmap>"u"&&console.warn("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=ie.get(t);if(s!==void 0){if(this.manager.itemStart(t),s.then){s.then(r=>{e?.onLoad?.(r),this.manager.itemEnd(t)}).catch(r=>{e?.onError?.(r)});return}return setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s}const i=fetch(t,{credentials:this.crossOrigin==="anonymous"?"same-origin":"include",headers:this.requestHeader}).then(r=>r.blob()).then(r=>createImageBitmap(r,Object.assign(this.options,{colorSpaceConversion:"none"}))).then(r=>(ie.add(t,r),e?.onLoad?.(r),this.manager.itemEnd(t),r)).catch(r=>{e?.onError?.(r),ie.remove(t),this.manager.itemError(t),this.manager.itemEnd(t)});ie.add(t,i),this.manager.itemStart(t)}}const qt={};class ju extends Error{response;constructor(t,e){super(t),this.response=e}}class ua extends Is{mimeType;responseType="";constructor(t){super(t),typeof fetch>"u"&&console.warn("FileLoader: fetch() not supported.")}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=ie.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s;if(qt[t]!==void 0){qt[t].push({onLoad:e?.onLoad,onProgress:e?.onProgress,onError:e?.onError});return}qt[t]=[],qt[t].push({onLoad:e?.onLoad,onProgress:e?.onProgress,onError:e?.onError});const i=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),r=this.mimeType,a=this.responseType;fetch(i).then(o=>{if(o.status===200||o.status===0){if(o.status===0&&console.warn("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||o.body===void 0||o.body?.getReader===void 0)return o;const h=qt[t],c=o.body.getReader(),l=o.headers.get("X-File-Size")||o.headers.get("Content-Length"),d=l?parseInt(l):0,w=d!==0;let b=0;const m=new ReadableStream({start(P){_();function _(){c.read().then(({done:v,value:x})=>{if(v)P.close();else{b+=x.byteLength;const y=new ProgressEvent("progress",{lengthComputable:w,loaded:b,total:d});for(let p=0,E=h.length;p<E;p++)h[p].onProgress?.(y);P.enqueue(x),_()}},v=>{P.error(v)})}}});return new Response(m)}else throw new ju(`fetch for "${o.url}" responded with ${o.status}: ${o.statusText}`,o)}).then(o=>{switch(a){case"arraybuffer":return o.arrayBuffer();case"blob":return o.blob();case"document":return o.text().then(h=>new DOMParser().parseFromString(h,r));case"json":return o.json();default:if(r===void 0)return o.text();{const c=/charset="?([^;"\s]*)"?/i.exec(r),l=c&&c[1]?c[1].toLowerCase():void 0,d=new TextDecoder(l);return o.arrayBuffer().then(w=>d.decode(w))}}}).then(o=>{ie.add(t,o);const h=qt[t];delete qt[t];for(let c=0,l=h.length;c<l;c++)h[c].onLoad?.(o)}).catch(o=>{const h=qt[t];if(h===void 0)throw this.manager.itemError(t),o;delete qt[t];for(let c=0,l=h.length;c<l;c++)h[c].onError?.(o);this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class $u extends Is{constructor(t){super(t)}load(t,e){const s=new ua(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,{onLoad:i=>{try{const r=i.slice(0);new AudioContext().decodeAudioData(r,o=>{e?.onLoad?.(o)}).catch(o=>{e?.onError?.(o),this.manager.itemError(t)})}catch(r){e?.onError?.(r),this.manager.itemError(t)}},onProgress:e?.onProgress,onError:e?.onError})}}return g.Arrow=Bl,g.AudioLoader=$u,g.BezierEasing=li,g.CSSToJSEasing=eh,g.Clock=fi,g.Color=lt,g.CommonKeyCode=ph,g.Confetti=tu,g.ControlsColorPattern=he,g.Cross=zl,g.CustomCanvasContext=_e,g.CustomCanvasGradient=ls,g.CustomCanvasPattern=ei,g.DOMEventBus=ir,g.DOMKey=sr,g.DOMParse=nr,g.DOMSVGUtil=ae,g.DOMToBlob=Sn,g.DOMToString=Js,g.DOMUtil=L,g.DOMVideo=Re,g.Easing=R,g.Ellipse=na,g.FetchWithAxios=Hc,g.FetchWithAxiosRequestCancel=Hr,g.FileLoader=ua,g.FileUpload=eo,g.Fox=Yl,g.Heart=Xl,g.HeartVariant=Ul,g.ImageBitmapLoader=Hu,g.ImageLoader=qu,g.Interpolation=Xt,g.Line=ce,g.LinePicture=Nl,g.LineQuadraticBezier=Ol,g.Matrix=ct,g.Matrix3D=pt,g.NormalColors=ar,g.Pagination=Uu,g.Point=Vt,g.Point3D=Le,g.Point3Ds=Ql,g.Points=ia,g.QRCode=se,g.Rabbit=Vl,g.Rect=zt,g.Ring=Ui,g.RingIndicator=Jl,g.SVGParse=sa,g.SVGParsedPathArgsLength=Me,g.Sector=Hl,g.SectorArc=aa,g.Segment=Wl,g.Shape=z,g.ShapeCombo=Gi,g.ShapeGroup=at,g.Ship=jl,g.Slider=$l,g.Star=Gl,g.TWEEN=ch,g.Text=Ge,g.Timeline=gs,g.Tip=ra,g.Tree=ql,g.Tween=di,g.WebGLRenderer=ru,g.WebRTCClient=nu,g.WebSocketClient=so,g.YZCanvas=iu,g.YZCanvasContext=us,g.YZMessageChannel=Mh,g.YZSVG=Fl,g.YZWorker=Dh,g.addWatermark=Dl,g.addWxJsReadyFnBeforeConfig=zi,g.ajax=Ih,g.aliJsChooseImage=Bu,g.aliJsGetLocation=Fu,g.aliJsOpenLocation=Nu,g.aliJsPreviewImage=Yu,g.aliJsReady=Lu,g.aliJsScan=Ou,g.aliJsTradePay=Ru,g.angle=Zt,g.appendURL=xi,g.appendURLRecord=Ah,g.base64EncodeOutputStream=Jr,g.bitmapMapper=oa,g.blobToRawImage=el,g.byteArrayOutputStream=Ni,g.canDrawBitmap=Fn,g.canUsePaths=_o,g.canUseWorker=On,g.changeBrightness=_l,g.changeDiaphaneity=Al,g.changeSize=Pl,g.checkWxJsApi=lu,g.clearCookies=Eh,g.color=Oe,g.computeImageDisplayRect=jc,g.createXMLHttpRequest=ur,g.distance=os,g.distance2=hs,g.drawBitmapInCanvas=su,g.drawQRCodeToCanvas=Rl,g.easeNameToCubicBezier=ui,g.fileOrBlobToDataURL=Oi,g.flipSideToSide=il,g.flipUpsideDown=nl,g.flushURL=lr,g.flushURLRecord=_h,g.formDataToString=cr,g.fpsTask=Go,g.getBitmapFromCanvas=eu,g.getBodyPosition=no,g.getBrowserClient=Ks,g.getBrowserClientVersion=fo,g.getBrowserLanguage=po,g.getColorScheme=rr,g.getCookie=Sh,g.getCookieObject=Ch,g.getDOMMatrix=pi,g.getDirection=ko,g.getDocumentElementPosition=Te,g.getElementPositionInPage=_n,g.getElementPositionInPage2=oo,g.getElementPositionInViewport=An,g.getFileExtension=En,g.getFileMD5Hash=to,g.getFileTypeFromFile=Qa,g.getFilesImageInfo=Wc,g.getFormSubmitData=kh,g.getImageAspectRatio=$c,g.getImageDataByAIData=Il,g.getImageDataFromBitmap=Zc,g.getImageDataFromUrl=jr,g.getImageDataFromVideo=Jc,g.getImageMainColor=sl,g.getInternetExplorerVersion=In,g.getMousePositionInElement=Pt,g.getMousePositionInPage=Dn,g.getMousePositionInViewport=lo,g.getOperatingSystem=ns,g.getOperatingSystemVersion=uo,g.getPageSize=ao,g.getRawImageInfo=Ms,g.getRelativeBoundingClientRect=ho,g.getScreenPosition=io,g.getScrollParent=hu,g.getTimeZone=go,g.getURL=ws,g.getUserGeolocationPromise=mo,g.getVerticalScrollPercentInPage=co,g.getViewportSize=ro,g.gifImage=Zr,g.h=Jt,g.hasDocument=Eo,g.hasHistory=To,g.hasWindow=Rn,g.imageDataToBitmap=Kc,g.imageDataToBlob=tl,g.imageDataToDataURL=Qc,g.injectWxJsConfig=cu,g.isAliBrowser=Ln,g.isAliMiniProgram=Co,g.isAndroid=Mn,g.isAppleDevice=yo,g.isBrowserSupportFileAPI=Po,g.isDarkMode=xo,g.isElement=Ao,g.isIE=bo,g.isIE9or10=vo,g.isIOS=Qs,g.isMacOS=ti,g.isMobile=wo,g.isNative=rs,g.isURL=Th,g.isWxBrowser=kn,g.isWxMiniProgram=So,g.jpgToPng=Sl,g.leftRotate=rl,g.length=as,g.linkExport=Zs,g.localstorage=gi,g.mapTDTJSSDK=Xu,g.marginSharpen=vl,g.microTask=Ho,g.mosaic=Ml,g.mount=pe,g.multiplyArrayOfMatrix=uh,g.multiplyArrayOfMatrix3D=dh,g.multiplyMatrix=Qn,g.multiplyMatrix3D=tr,g.nextTick=qo,g.normalizePoint=Io,g.objectSignature=qr,g.onDocumentReady=bh,g.outputGifBase64=Kr,g.outputQRCodeBase64=Ll,g.parseTransformToMatrix=mi,g.parseURL=or,g.patch=is,g.patchDOM=Pn,g.pngToJpg=Cl,g.polar=It,g.prefixes=Do,g.radiusClip=Tl,g.readFileInBrowser=ss,g.recordToString=xs,g.rectClip=El,g.requestAnimationFrameCycle=ni,g.reverseCSSToJSEasing=sh,g.reverseEaseNameToCubicBezier=Wn,g.reverseEasing=zn,g.rightRotate=al,g.rotatePoint=_t,g.scheduleIdle=Un,g.scheduleYZIdle=hi,g.selectFileInBrowser=Cn,g.setColorScheme=ys,g.setCookie=vh,g.setIntervalAccurate=Uo,g.setRem=Mo,g.setTimeoutAccurate=ri,g.sharpen=bl,g.signature=zr,g.singletonDOMEventBus=rt,g.stringToDOM=Ka,g.stringToRecord=Ph,g.theme=yi,g.toBlackAndWhite=cl,g.toBlue=fl,g.toBlueAndGreen=gl,g.toBlueAndGrey=xl,g.toDegree=nt,g.toGreen=dl,g.toGreenAndGrey=wl,g.toGrey=ol,g.toGrey2=hl,g.toOpposite=ll,g.toRadian=N,g.toRed=ul,g.toRedAndBlue=pl,g.toRedAndGreen=ml,g.toRedAndGrey=yl,g.transformPath2D=lh,g.trimURLHash=hr,g.wxJsChooseImage=fu,g.wxJsDownloadImage=gu,g.wxJsDownloadVoice=Pu,g.wxJsGetLocalImgData=yu,g.wxJsGetLocation=Mu,g.wxJsGetNetworkType=Au,g.wxJsOnVoicePlayEnd=Eu,g.wxJsOnVoiceRecordEnd=bu,g.wxJsOpenLocation=Du,g.wxJsPauseVoice=Su,g.wxJsPay=ku,g.wxJsPlayVoice=vu,g.wxJsPreviewImage=mu,g.wxJsScanQRCode=Iu,g.wxJsStartRecord=wu,g.wxJsStopRecord=xu,g.wxJsStopVoice=Cu,g.wxJsTranslateVoice=_u,g.wxJsUpdateAppMessageShareData=uu,g.wxJsUpdateTimelineShareData=du,g.wxJsUploadImage=pu,g.wxJsUploadVoice=Tu,g.yzCancelIdleCallback=zo,g.yzRequestIdleCallback=Vn,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),g}({});
|
|
46
46
|
//# sourceMappingURL=zyzgroup_core_web.iife.js.map
|